diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 80a817536cc..f7e404e6d00 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -21,7 +21,7 @@ In case of bug fixes, please provide the list of supported branches where this fix should be also merged. Please uncomment following line, adjusting the corresponding target branches for the backport. --> - + @@ -32,8 +32,8 @@ ## Contributor Checklist - [ ] Commit messages follow the project guidelines. @@ -48,7 +48,6 @@ - [ ] Applicable backports have been included in the description. - ## Reviewer Checklist - [ ] The PR has a milestone assigned. diff --git a/.github/workflows/config/asan_colcon.meta b/.github/workflows/config/asan_colcon.meta index b35d778421d..58bb8ed124b 100644 --- a/.github/workflows/config/asan_colcon.meta +++ b/.github/workflows/config/asan_colcon.meta @@ -1,5 +1,5 @@ names: - fastrtps: + fastdds: cmake-args: - "-DNO_TLS=OFF" - "-DSECURITY=ON" @@ -14,4 +14,3 @@ names: - "-Dgtest_force_shared_crt=ON" - "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_GMOCK=ON" - diff --git a/.github/workflows/config/ci.meta b/.github/workflows/config/ci.meta index 471c510dac4..922251be0a8 100644 --- a/.github/workflows/config/ci.meta +++ b/.github/workflows/config/ci.meta @@ -1,5 +1,5 @@ names: - fastrtps: + fastdds: cmake-args: - "-DBUILD_DOCUMENTATION=OFF" - "-DBUILD_SHARED_LIBS=ON" @@ -8,7 +8,6 @@ names: - "-DFASTDDS_ENFORCE_LOG_INFO=ON" - "-DFASTDDS_PIM_API_TESTS=ON" - "-DFASTDDS_STATISTICS=ON" - - "-DFASTRTPS_API_TESTS=OFF" - "-DINSTALL_EXAMPLES=ON" - "-DINSTALL_TOOLS=ON" - "-DINTERNAL_DEBUG=ON" @@ -19,7 +18,7 @@ names: - "-DSTRICT_REALTIME=OFF" - "-DSYSTEM_TESTS=ON" - "-DMEMORYCHECK_COMMAND_OPTIONS=-q --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=2 --error-exitcode=1" - - "-DMEMORYCHECK_SUPPRESSIONS_FILE=../../src/fastrtps/valgrind.supp" + - "-DMEMORYCHECK_SUPPRESSIONS_FILE=../../src/fastdds/valgrind.supp" googletest-distribution: cmake-args: - "-Dgtest_force_shared_crt=ON" diff --git a/.github/workflows/config/documentation.meta b/.github/workflows/config/documentation.meta index c0d85a3d55f..f6a3e624c81 100644 --- a/.github/workflows/config/documentation.meta +++ b/.github/workflows/config/documentation.meta @@ -1,5 +1,5 @@ names: - fastrtps: + fastdds: cmake-args: - "-DBUILD_SHARED_LIBS=ON" - "-DSECURITY=ON" diff --git a/.github/workflows/config/tsan_colcon.meta b/.github/workflows/config/tsan_colcon.meta index 341a32d0c23..e406dfc183a 100644 --- a/.github/workflows/config/tsan_colcon.meta +++ b/.github/workflows/config/tsan_colcon.meta @@ -3,12 +3,11 @@ names: cmake-args: - "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" - "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" - fastrtps: + fastdds: cmake-args: - "-DCOMPILE_EXAMPLES=OFF" - "-DEPROSIMA_BUILD_TESTS=ON" - "-DRTPS_API_TESTS=ON" - - "-DFASTRTPS_API_TESTS=OFF" - "-DFASTDDS_PIM_API_TESTS=ON" - "-DPERFORMANCE_TESTS=ON" - "-DNO_TLS=OFF" diff --git a/.github/workflows/documentation-tests.yaml b/.github/workflows/documentation-tests.yaml index ce35dd442ae..bc3ba7612af 100644 --- a/.github/workflows/documentation-tests.yaml +++ b/.github/workflows/documentation-tests.yaml @@ -44,7 +44,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds submodules: true - name: Get minimum supported version of CMake @@ -74,14 +74,14 @@ jobs: - name: Download Fast DDS .repos uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0 with: - vcs_repos_file: ./src/fastrtps/fastrtps.repos + vcs_repos_file: ./src/fastdds/fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.repos destination_workspace: src skip_existing: 'true' @@ -123,7 +123,7 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: './src/fastrtps/.github/workflows/config/documentation.meta' + colcon_meta_file: './src/fastdds/.github/workflows/config/documentation.meta' colcon_build_args: '' colcon_build_args_default: '' cmake_args: '' diff --git a/.github/workflows/mac-ci.yml b/.github/workflows/mac-ci.yml index 69f34c3f044..03945a414ac 100644 --- a/.github/workflows/mac-ci.yml +++ b/.github/workflows/mac-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS MacOS CI +name: Fast DDS MacOS CI on: workflow_dispatch: diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 8490d894475..33940e7ba0f 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -3,15 +3,19 @@ on: push: branches: - 'master' + - '2.14.x' + jobs: - mirror_job: + mirror_job_master: + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest name: Mirror master branch to API & ABI compatible minor version branches strategy: fail-fast: false matrix: dest_branch: - - '2.14.x' + - '3.0.x' + - '3.x' steps: - name: Mirror action step id: mirror @@ -20,3 +24,21 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} source: 'master' dest: ${{ matrix.dest_branch }} + + mirror_job_2_x: + if: github.ref == 'refs/heads/2.14.x' + runs-on: ubuntu-latest + name: Mirror master branch to API & ABI compatible minor version branches + strategy: + fail-fast: false + matrix: + dest_branch: + - '2.x' + steps: + - name: Mirror action step + id: mirror + uses: eProsima/eProsima-CI/external/mirror-branch-action@v0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + source: '2.14.x' + dest: ${{ matrix.dest_branch }} diff --git a/.github/workflows/nightly-mac-ci.yml b/.github/workflows/nightly-mac-ci.yml index 157e23d5e3b..f8e5959dae7 100644 --- a/.github/workflows/nightly-mac-ci.yml +++ b/.github/workflows/nightly-mac-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS MacOS CI (nightly) +name: Fast DDS MacOS CI (nightly) on: workflow_dispatch: @@ -20,6 +20,20 @@ jobs: ctest-args: "-LE xfail" fastdds-branch: 'master' + nightly-mac-ci-2_14_x: + strategy: + fail-fast: false + matrix: + security: + - 'ON' + - 'OFF' + uses: eProsima/Fast-DDS/.github/workflows/reusable-mac-ci.yml@2.14.x + with: + label: 'nightly-sec-${{ matrix.security }}-mac-ci-2.14.x' + cmake-args: "-DSECURITY=${{ matrix.security }}" + ctest-args: "-LE xfail" + fastdds-branch: '2.14.x' + nightly-mac-ci-2_13_x: strategy: fail-fast: false @@ -61,17 +75,3 @@ jobs: cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" fastdds-branch: '2.6.x' - - nightly-mac-ci-3_0_x-devel: - strategy: - fail-fast: false - matrix: - security: - - 'ON' - - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-mac-ci.yml@3.0.x-devel - with: - label: 'nightly-sec-${{ matrix.security }}-mac-ci-3.0.x-devel' - cmake-args: "-DSECURITY=${{ matrix.security }}" - ctest-args: "-LE xfail" - fastdds-branch: '3.0.x-devel' diff --git a/.github/workflows/nightly-sanitizers-ci.yml b/.github/workflows/nightly-sanitizers-ci.yml index c917bd88222..ddcedce2f0b 100644 --- a/.github/workflows/nightly-sanitizers-ci.yml +++ b/.github/workflows/nightly-sanitizers-ci.yml @@ -20,6 +20,20 @@ jobs: fastdds_ref: 'master' discovery_server_ref: 'master' + nightly-sanitizers-ci-2_14_x: + uses: eProsima/Fast-DDS/.github/workflows/reusable-sanitizers-ci.yml@2.14.x + with: + label: 'nightly-sec-sanitizers-ci-2.14.x' + run_asan_fastdds: true + run_asan_discovery_server: true + run_tsan_fastdds: true + colcon_build_args: '' + colcon_test_args: '' + cmake_args: '' + ctest_args: '' + fastdds_ref: '2.14.x' + discovery_server_ref: 'v1.2.2' + nightly-sanitizers-ci-2_13_x: uses: eProsima/Fast-DDS/.github/workflows/reusable-sanitizers-ci.yml@2.13.x with: @@ -61,17 +75,3 @@ jobs: ctest_args: '' fastdds_ref: '2.6.x' discovery_server_ref: 'v1.2.1' - - nightly-sanitizers-ci-3_0_x-devel: - uses: eProsima/Fast-DDS/.github/workflows/reusable-sanitizers-ci.yml@3.0.x-devel - with: - label: 'nightly-sec-sanitizers-ci-3.0.x-devel' - run_asan_fastdds: true - run_asan_discovery_server: true - run_tsan_fastdds: true - colcon_build_args: '' - colcon_test_args: '' - cmake_args: '' - ctest_args: '' - fastdds_ref: '3.0.x-devel' - discovery_server_ref: '3.0.x-devel' diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml index 79df7e5a61c..b4216f87349 100644 --- a/.github/workflows/nightly-ubuntu-ci.yml +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Ubuntu CI (nightly) +name: Fast DDS Ubuntu CI (nightly) on: workflow_dispatch: @@ -23,7 +23,7 @@ jobs: ctest-args: "-LE xfail" fastdds-branch: 'master' - nightly-ubuntu-ci-2_13_x: + nightly-ubuntu-ci-2_14_x: strategy: fail-fast: false matrix: @@ -32,15 +32,15 @@ jobs: security: - 'ON' - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.13.x + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.14.x with: os-image: ${{ matrix.os-image }} - label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.13.x' + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.14.x' cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" - fastdds-branch: '2.13.x' + fastdds-branch: '2.14.x' - nightly-ubuntu-ci-2_10_x: + nightly-ubuntu-ci-2_13_x: strategy: fail-fast: false matrix: @@ -49,15 +49,15 @@ jobs: security: - 'ON' - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.10.x + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.13.x with: os-image: ${{ matrix.os-image }} - label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.10.x' + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.13.x' cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" - fastdds-branch: '2.10.x' + fastdds-branch: '2.13.x' - nightly-ubuntu-ci-2_6_x: + nightly-ubuntu-ci-2_10_x: strategy: fail-fast: false matrix: @@ -66,15 +66,15 @@ jobs: security: - 'ON' - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.6.x + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.10.x with: os-image: ${{ matrix.os-image }} - label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.6.x' + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.10.x' cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" - fastdds-branch: '2.6.x' + fastdds-branch: '2.10.x' - nightly-ubuntu-ci-3_0_x-devel: + nightly-ubuntu-ci-2_6_x: strategy: fail-fast: false matrix: @@ -83,10 +83,10 @@ jobs: security: - 'ON' - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@3.0.x-devel + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.6.x with: os-image: ${{ matrix.os-image }} - label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-3.0.x-devel' + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.6.x' cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" - fastdds-branch: '3.0.x-devel' + fastdds-branch: '2.6.x' diff --git a/.github/workflows/nightly-windows-ci.yml b/.github/workflows/nightly-windows-ci.yml index 29c50cb09e7..edaf8226b1c 100644 --- a/.github/workflows/nightly-windows-ci.yml +++ b/.github/workflows/nightly-windows-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Windows CI (nightly) +name: Fast DDS Windows CI (nightly) on: workflow_dispatch: @@ -20,6 +20,20 @@ jobs: ctest-args: "-LE xfail" fastdds_branch: 'master' + nightly-windows-ci-2_14_x: + strategy: + fail-fast: false + matrix: + security: + - 'ON' + - 'OFF' + uses: eProsima/Fast-DDS/.github/workflows/reusable-windows-ci.yml@2.14.x + with: + label: 'nightly-sec-${{ matrix.security }}-windows-ci-2.14.x' + cmake-args: "-DSECURITY=${{ matrix.security }}" + ctest-args: "-LE xfail" + fastdds_branch: '2.14.x' + nightly-windows-ci-2_13_x: strategy: fail-fast: false @@ -61,17 +75,3 @@ jobs: cmake-args: "-DSECURITY=${{ matrix.security }}" ctest-args: "-LE xfail" fastdds_branch: '2.6.x' - - nightly-windows-ci-3_0_x-devel: - strategy: - fail-fast: false - matrix: - security: - - 'ON' - - 'OFF' - uses: eProsima/Fast-DDS/.github/workflows/reusable-windows-ci.yml@3.0.x-devel - with: - label: 'nightly-sec-${{ matrix.security }}-windows-ci-3.0.x-devel' - cmake-args: "-DSECURITY=${{ matrix.security }}" - ctest-args: "-LE xfail" - fastdds_branch: '3.0.x-devel' diff --git a/.github/workflows/rebase-3.0.x-devel.yaml b/.github/workflows/rebase-3.0.x-devel.yaml deleted file mode 100644 index a29973215cc..00000000000 --- a/.github/workflows/rebase-3.0.x-devel.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: rebase-3.0.x-devel-master - -on: - schedule: - - cron: '0 0 * * *' - # scheduled every midnight - workflow_dispatch: - #manual run of the workflow job - -jobs: - rebase-branches: - name: Rebase 3.0.x-devel branch HEAD with master current branch - runs-on: ubuntu-latest - - steps: - # Step 1: checkout action - - name: Checkout target repo - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - ref: 3.0.x-devel - fetch-depth: 0 - persist-credentials: true - - # Step 2: Set git config - - name: Set git config - id: config - run: | - git config --local user.email "ricardogonzalez@eprosima.com" - git config --local user.name "richiprosima" - shell: bash - - # Step 3: Rebase - - name: Rebase current branch - id: rebase_master - run: | - git fetch origin master - git rebase origin/master - shell: bash - - # Step 4: Push - - name: Force push if required - id: push - run: | - if [ "$(git status | grep 'diverged\|ahead')" ]; then - git push -f - fi; - shell: bash diff --git a/.github/workflows/reusable-mac-ci.yml b/.github/workflows/reusable-mac-ci.yml index 3807960499e..02ee5916ad7 100644 --- a/.github/workflows/reusable-mac-ci.yml +++ b/.github/workflows/reusable-mac-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS MacOS CI reusable workflow +name: Fast DDS MacOS CI reusable workflow on: workflow_call: @@ -55,7 +55,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds ref: ${{ inputs.fastdds-branch }} - uses: eProsima/eProsima-CI/external/setup-python@v0 @@ -93,14 +93,14 @@ jobs: - name: Fetch Fast DDS dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.repos destination_workspace: src skip_existing: 'true' @@ -112,7 +112,7 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.meta colcon_build_args: ${{ inputs.colcon-args }} cmake_args: ${{ inputs.cmake-args }} cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wno-enum-constexpr-conversion" @@ -128,7 +128,7 @@ jobs: colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" - packages_names: fastrtps + packages_names: fastdds workspace: ${{ github.workspace }} test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} diff --git a/.github/workflows/reusable-sanitizers-ci.yml b/.github/workflows/reusable-sanitizers-ci.yml index a08587bf322..ec267d7ff28 100644 --- a/.github/workflows/reusable-sanitizers-ci.yml +++ b/.github/workflows/reusable-sanitizers-ci.yml @@ -71,7 +71,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds ref: ${{ inputs.fastdds_ref }} - name: Get minimum supported version of CMake @@ -98,27 +98,27 @@ jobs: - name: Fetch Fast DDS dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.repos destination_workspace: src skip_existing: 'true' - name: Show .meta file id: show_meta run: | - cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -166,16 +166,16 @@ jobs: - name: Show .meta file id: show_meta run: | - cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} - cmake_args_default: -DEPROSIMA_BUILD_TESTS=ON -DRTPS_API_TESTS=ON -DFASTRTPS_API_TESTS=ON -DFASTDDS_PIM_API_TESTS=ON -DPERFORMANCE_TESTS=ON + cmake_args_default: -DEPROSIMA_BUILD_TESTS=ON -DRTPS_API_TESTS=ON -DFASTDDS_PIM_API_TESTS=ON -DPERFORMANCE_TESTS=ON cmake_build_type: 'Debug' workspace: ${{ github.workspace }} workspace_dependencies: '' @@ -190,7 +190,7 @@ jobs: colcon_test_args_default: '--event-handlers=console_direct+ --return-code-on-test-failure' ctest_args: ${{ inputs.ctest_args }} ctest_args_default: '--timeout 300 --label-exclude "xfail"' - packages_names: fastrtps + packages_names: fastdds workspace: ${{ github.workspace }} workspace_dependencies: '' test_report_artifact: ${{ format('test_report_{0}_{1}', inputs.label, github.job) }} @@ -198,13 +198,13 @@ jobs: - name: Report sanitizer errors if: ${{ inputs.run_asan_fastdds }} run: | - bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh \ + bash src/fastdds/.github/workflows/utils/specific_errors_filter.sh \ "==ERROR:" \ - log/latest_test/fastrtps/stdout_stderr.log \ + log/latest_test/fastdds/stdout_stderr.log \ _tmp_specific_error_file.log - python3 src/fastrtps/.github/workflows/utils/log_parser.py \ - --log-file log/latest_test/fastrtps/stdout_stderr.log \ + python3 src/fastdds/.github/workflows/utils/log_parser.py \ + --log-file log/latest_test/fastdds/stdout_stderr.log \ --specific-error-file _tmp_specific_error_file.log \ --output-file $GITHUB_STEP_SUMMARY \ --sanitizer asan @@ -263,13 +263,13 @@ jobs: - name: Show .meta file id: show_meta run: | - cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan_colcon.meta colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -295,12 +295,12 @@ jobs: - name: Report sanitizer errors if: ${{ inputs.run_asan_discovery_server }} run: | - bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh \ + bash src/fastdds/.github/workflows/utils/specific_errors_filter.sh \ "==ERROR:" \ log/latest_test/discovery-server/stdout_stderr.log \ _tmp_specific_error_file.log - python3 src/fastrtps/.github/workflows/utils/log_parser.py \ + python3 src/fastdds/.github/workflows/utils/log_parser.py \ --log-file log/latest_test/discovery-server/stdout_stderr.log \ --specific-error-file _tmp_specific_error_file.log \ --output-file $GITHUB_STEP_SUMMARY \ @@ -332,7 +332,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds ref: ${{ inputs.fastdds_ref }} - name: Get minimum supported version of CMake @@ -359,27 +359,27 @@ jobs: - name: Fetch Fast DDS dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.repos destination_workspace: src skip_existing: 'true' - name: Show .meta file id: show_meta run: | - cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/tsan_colcon.meta + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/tsan_colcon.meta - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/tsan_colcon.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/tsan_colcon.meta colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -397,7 +397,7 @@ jobs: colcon_test_args_default: '--event-handlers=console_direct+ --return-code-on-test-failure' ctest_args: ${{ inputs.ctest_args }} ctest_args_default: '--timeout 300 --label-exclude "xfail" -V -E DDSSQLFilterValueTests' - packages_names: fastrtps + packages_names: fastdds workspace: ${{ github.workspace }} workspace_dependencies: '' test_report_artifact: ${{ format('test_report_{0}_{1}', inputs.label, github.job) }} @@ -410,7 +410,7 @@ jobs: # Create a dir for the exports $exports = New-Item -ItemType Directory -Path ./exports # Move to the reports dir - pushd ./log/latest_test/fastrtps + pushd ./log/latest_test/fastdds # Install the report parser module Find-Module -Repository PSGallery -Name SanReportParser | Install-Module -Scope CurrentUser -Force # Parse the report files diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index 6c3b1d59ff9..22a7d21b0b5 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Ubuntu CI reusable workflow +name: Fast DDS Ubuntu CI reusable workflow on: workflow_call: @@ -53,7 +53,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds ref: ${{ inputs.fastdds-branch }} - name: Install Fix Python version @@ -92,14 +92,14 @@ jobs: - name: Fetch Fast DDS dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.repos destination_workspace: src skip_existing: 'true' @@ -133,7 +133,7 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.meta + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.meta colcon_build_args: ${{ inputs.colcon-args }} cmake_args: ${{ inputs.cmake-args }} cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual" -DFASTDDS_EXAMPLE_TESTS=ON @@ -149,7 +149,7 @@ jobs: colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" - packages_names: fastrtps + packages_names: fastdds workspace: ${{ github.workspace }} test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 3524ed8b9f0..41d7952c835 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Windows CI reusable workflow +name: Fast DDS Windows CI reusable workflow on: workflow_call: @@ -52,7 +52,7 @@ jobs: - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: src/fastrtps + path: src/fastdds submodules: true ref: ${{ inputs.fastdds_branch }} @@ -131,14 +131,14 @@ jobs: - name: Fetch Fast DDS dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}\src\fastrtps\fastrtps.repos + vcs_repos_file: ${{ github.workspace }}\src\fastdds\fastdds.repos destination_workspace: src skip_existing: 'true' - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: - vcs_repos_file: ${{ github.workspace }}\src\fastrtps\.github\workflows\config\ci.repos + vcs_repos_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\ci.repos destination_workspace: src skip_existing: 'true' @@ -147,7 +147,7 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/windows/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}\src\fastrtps\.github\workflows\config\ci.meta + colcon_meta_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\ci.meta colcon_build_args: ${{ inputs.colcon-args }} # The following Fast DDS CMake options need to be specified here instead of in the ci.meta file # because they vary from platform to platform @@ -164,7 +164,7 @@ jobs: colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" - packages_names: fastrtps + packages_names: fastdds workspace: ${{ github.workspace }} test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 01861fccbc1..9a9d14443fb 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Ubuntu CI +name: Fast DDS Ubuntu CI on: workflow_dispatch: diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 0838b8fdde8..d33b39bb693 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -1,4 +1,4 @@ -name: Fast-DDS Windows CI +name: Fast DDS Windows CI on: workflow_dispatch: diff --git a/.settings/org.eclipse.cdt.codan.core.prefs b/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index 77386c23cbe..00000000000 --- a/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,67 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.checkers.noreturn=Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} diff --git a/CMakeLists.txt b/CMakeLists.txt index ca781828ea4..5871f3b0326 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,9 @@ endif() ############################################################################### # Project # ############################################################################### -project(fastrtps VERSION "2.14.1" LANGUAGES C CXX) +project(fastdds VERSION "3.0.0" LANGUAGES C CXX) -set(PROJECT_NAME_LARGE "Fast RTPS") +set(PROJECT_NAME_LARGE "Fast DDS") string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER) message(STATUS "Version: ${PROJECT_VERSION}") @@ -229,12 +229,12 @@ option(BUILD_SHARED_LIBS "Create shared libraries by default" ON) ############################################################################### include(${PROJECT_SOURCE_DIR}/cmake/common/eprosima_libraries.cmake) -# if we are building Fast-DDS as a static library we must load Fast-CDR as one +# if we are building Fast DDS as a static library we must load Fast-CDR as one if(NOT BUILD_SHARED_LIBS) set(FASTDDS_STATIC ON) endif() -eprosima_find_package(fastcdr REQUIRED) +eprosima_find_package(fastcdr 2 REQUIRED) eprosima_find_thirdparty(Asio asio VERSION 1.10.8) eprosima_find_thirdparty(TinyXML2 tinyxml2) @@ -477,7 +477,7 @@ if(BUILD_DOCUMENTATION) set(USE_DOT YES) endif() # Configure the template doxyfile for or specific project - configure_file(doxyfile.in ${PROJECT_BINARY_DIR}/doxyfile @ONLY IMMEDIATE) + configure_file(utils/doxygen/doxyfile.in ${PROJECT_BINARY_DIR}/doxyfile @ONLY IMMEDIATE) # Add custom target to run doxygen when ever the project is build add_custom_target(doxygen COMMAND "${DOXYGEN_EXECUTABLE}" "${PROJECT_BINARY_DIR}/doxyfile" @@ -497,7 +497,6 @@ if(BUILD_DOCUMENTATION) set(README_INSTALL_LOCATION "${DOC_INSTALL_DIR}") endif() - configure_file(doc/README.html.in ${README_LOCATION}/README.html @ONLY IMMEDIATE) ### ReadTheDocs ######################## if(NOT CHECK_DOCUMENTATION) @@ -557,7 +556,7 @@ install(FILES ${PROJECT_SOURCE_DIR}/LICENSE ) # Install xml validators -install(FILES ${PROJECT_SOURCE_DIR}/resources/xsd/fastRTPS_profiles.xsd +install(FILES ${PROJECT_SOURCE_DIR}/resources/xsd/fastdds_profiles.xsd DESTINATION ${DATA_INSTALL_DIR} COMPONENT xsd ) @@ -597,11 +596,6 @@ if(BUILD_DOCUMENTATION) COMPONENT documentation ) - install(FILES "${README_LOCATION}/README.html" - DESTINATION ${README_INSTALL_LOCATION} - COMPONENT documentation - ) - if(NOT CHECK_DOCUMENTATION) install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/manual DESTINATION ${DOC_INSTALL_DIR} diff --git a/CTestJenkins.cmake b/CTestJenkins.cmake deleted file mode 100644 index 1c5bbfb15c7..00000000000 --- a/CTestJenkins.cmake +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") -set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build") -set(CTEST_TEST_TIMEOUT 300) - -site_name(CTEST_SITE) -set(CTEST_BUILD_NAME "${JENKINS_BUILD_NAME}") -set(CTEST_BUILD_OPTIONS "${JENKINS_BUILD_OPTIONS}") -set(CTEST_BUILD_CONFIGURATION "${JENKINS_BUILD_CONFIGURATION}") - -set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${CTEST_MEMORYCHECK_COMMAND_OPTIONS} --quiet --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --xml=yes --xml-file=test_%p_memcheck.xml \"--suppressions=${CTEST_SOURCE_DIRECTORY}/valgrind.supp\"") - -set(CTEST_COVERAGE_C_FLAGS "-DCMAKE_C_FLAGS:STRING=-fwrapv -fprofile-arcs -ftest-coverage") -set(CTEST_COVERAGE_CXX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-fwrapv -fprofile-arcs -ftest-coverage") -set(CTEST_COVERAGE_EXE_LD_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage") -set(CTEST_COVERAGE_SHARED_LD_FLAGS "-DCMAKE_SHARED_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage") - -include(ProcessorCount) -ProcessorCount(NUMBER_PROCESSORS) -message("Number of processors: " ${NUMBER_PROCESSORS}) -if(NOT NUMBER_PROCESSORS EQUAL 0) - if(${JENKINS_GENERATOR} MATCHES "Unix Makefiles") - set(CTEST_BUILD_FLAGS "-j${NUMBER_PROCESSORS} -l${NUMBER_PROCESSORS}") - # Error using visual studio with multicore - #elseif(${JENKINS_GENERATOR} MATCHES "Visual Studio") - #set(CTEST_WIN_CXX_FLAGS "-DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS:STRING=/MP") - endif() - set(CTEST_TEST_ARGS ${CTEST_TEST_ARGS} PARALLEL_LEVEL ${NUMBER_PROCESSORS}) -endif() - -# Check CMake version for QUIET parameter -if(${CMAKE_MAJOR_VERSION} GREATER 3 OR (${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 2)) - set(QUIET_ QUIET) -endif() - -ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) - -if(UNIX) - find_program(CTEST_COVERAGE_COMMAND NAMES gcov) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) -endif() - -set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND}") -set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}") -set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_BUILD_OPTIONS}") -set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_WIN_CXX_FLAGS}") -if(CTEST_COVERAGE_COMMAND AND NOT DISABLE_CTEST_COVERAGE) - set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_C_FLAGS}\"") - set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_CXX_FLAGS}\"") - set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_EXE_LD_FLAGS}\"") - set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_SHARED_LD_FLAGS}\"") -endif() -set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"") -set(CTEST_BUILD_COMMAND "${CMAKE_COMMAND} --build .") -if(WIN32) - set(CTEST_BUILD_COMMAND "${CTEST_BUILD_COMMAND} --config ${CTEST_BUILD_CONFIGURATION}") -endif() -set(CTEST_CONFIGURATION_TYPE ${CTEST_BUILD_CONFIGURATION}) - -ctest_start("${JENKINS_DASHBOARD}" ${QUIET_}) -ctest_configure(RETURN_VALUE CONFIGURING_RET_VALUE ${QUIET_}) -ctest_build(RETURN_VALUE BUILDING_RET_VALUE ${QUIET_}) -ctest_test(${QUIET_}) -if(CTEST_COVERAGE_COMMAND AND NOT DISABLE_CTEST_COVERAGE) - ctest_coverage(${QUIET_}) -endif() -if(CTEST_MEMORYCHECK_COMMAND AND NOT DISABLE_CTEST_MEMORYCHECK) - ctest_memcheck(EXCLUDE_LABEL NoMemoryCheck ${QUIET_}) -endif() - -if(NOT CONFIGURING_RET_VALUE AND NOT BUILDING_RET_VALUE) - message(0) -else() - message(255) -endif() diff --git a/QUALITY.md b/QUALITY.md index ccc06545d1e..2bcedf4de59 100644 --- a/QUALITY.md +++ b/QUALITY.md @@ -2,7 +2,7 @@ This document is a declaration of software quality for *eprosima Fast DDS* inspi # Quality Declaration -*eprosima Fast DDS* (formerly Fast RTPS) is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). +*eprosima Fast DDS* is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. diff --git a/README.md b/README.md index 0e583c217e6..ef9df24fb1c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Fast DDS](doc/images/fastdds_github_banner.png)](https://eprosima.com/index.php/products-all/eprosima-fast-dds) +[![Fast DDS](resources/images/fastdds_github_banner.png)](https://eprosima.com/index.php/products-all/eprosima-fast-dds)
@@ -20,11 +20,11 @@
FIWARE Robotics - License - Releases - Issues - Forks - Stars + License + Releases + Issues + Forks + Stars Documentation badge
Status @@ -37,20 +37,22 @@

-*eprosima Fast DDS* (formerly Fast RTPS) is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, -as defined and maintained by the Object Management Group (OMG) consortium. RTPS is also the wire interoperability protocol defined for the Data Distribution -Service (DDS) standard. *eProsima Fast DDS* expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. + +> [!WARNING] +> **In preparation for v3.0.0, Fast DDS' master branch is undergoing major changes entailing API breaks.** +> **Until Fast DDS v3.0.0 is released, it is strongly advisable to use the latest stable branch, [2.14.x](https://github.com/eProsima/Fast-DDS/tree/2.14.x)**. + +*eprosima Fast DDS* is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). +eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. +RTPS is also the wire interoperability protocol defined for the Data Distribution Service (DDS) standard. +*eProsima Fast DDS* expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. Some of the main features of this library are: -* Configurable best-effort and reliable publish-subscribe communication policies for real-time -applications. -* Plug and play connectivity so that any new applications are automatically discovered by any other -members of the network. -* Modularity and scalability to allow continuous growth with complex and simple devices in the -network. -* Configurable network behavior and interchangeable transport layer: Choose the best protocol and -system input/output channel combination for each deployment. +* Configurable best-effort and reliable publish-subscribe communication policies for real-time applications. +* Plug and play connectivity so that any new applications are automatically discovered by any other members of the network. +* Modularity and scalability to allow continuous growth with complex and simple devices in the network. +* Configurable network behavior and interchangeable transport layer: Choose the best protocol and system input/output channel combination for each deployment. * Two API Layers: a high-level Publisher-Subscriber one focused on usability (DDS) and a lower-level Writer-Reader one that provides finer access to the inner workings of the RTPS protocol. *eProsima Fast DDS* has been adopted by multiple organizations in many sectors including these important cases: @@ -58,8 +60,8 @@ system input/output channel combination for each deployment. * Robotics: ROS (Robotic Operating System) as their default middleware for every ROS 2 long term (LTS) releases and most of the non-LTS releases. * EU R&D: FIWARE Incubated GE. -This project is part of [FIWARE](https://www.fiware.org/). For more information check the FIWARE Catalogue entry for -[Robotics](https://github.com/Fiware/catalogue/tree/master/robotics). +This project is part of [FIWARE](https://www.fiware.org/). +For more information check the FIWARE Catalogue entry for [Robotics](https://github.com/Fiware/catalogue/tree/master/robotics). ## Want us to share your project with the community? @@ -96,13 +98,13 @@ You can access the documentation online, which is hosted on [Read the Docs](http ## Quality Declaration -*eprosima Fast DDS* claims to be in the **Quality Level 1** category based on the guidelines provided by -[ROS 2](https://ros.org/reps/rep-2004.html). +*eprosima Fast DDS* claims to be in the **Quality Level 1** category based on the guidelines provided by [ROS 2](https://ros.org/reps/rep-2004.html). See the [Quality Declaration](https://github.com/eProsima/Fast-DDS/blob/master/QUALITY.md) for more details. ## Quick Demo -eProsima provides the eProsima Fast DDS Suite Docker image for those who want a quick demonstration of Fast-DDS running on an Ubuntu platform. It can be downloaded from [eProsima's downloads page](https://eprosima.com/index.php/downloads-all). +eProsima provides the eProsima Fast DDS Suite Docker image for those who want a quick demonstration of Fast DDS running on an Ubuntu platform. +It can be downloaded from [eProsima's downloads page](https://eprosima.com/index.php/downloads-all). This Docker image was built for Ubuntu 20.04 (Focal Fossa). @@ -125,54 +127,44 @@ This Docker Image comes bundled with the following: ### Shapes Demo -eProsima Shapes Demo is an application in which Publishers and Subscribers are shapes of different -colors and sizes moving on a board. Each shape refers to its own topic: Square, Triangle or Circle. -A single instance of the eProsima Shapes Demo can publish on or subscribe to several topics at a -time. +eProsima Shapes Demo is an application in which Publishers and Subscribers are shapes of different colors and sizes moving on a board. +Each shape refers to its own topic: Square, Triangle or Circle. +A single instance of the eProsima Shapes Demo can publish on or subscribe to several topics at a time. -You can read more about this application on the -[Shapes Demo documentation page](https://eprosima-shapes-demo.readthedocs.io/). +You can read more about this application on the [Shapes Demo documentation page](https://eprosima-shapes-demo.readthedocs.io/). To run this application once inside the Docker container run: $ ShapesDemo -eProsima Shapes Demo usage information can be found on the -[Shapes Demo First Steps page](https://eprosima-shapes-demo.readthedocs.io/en/latest/first_steps/first_steps.html). +eProsima Shapes Demo usage information can be found on the [Shapes Demo First Steps page](https://eprosima-shapes-demo.readthedocs.io/en/latest/first_steps/first_steps.html). ### Fast DDS Monitor -eProsima Fast DDS Monitor is a graphical desktop application aimed at monitoring DDS environments -deployed using the *eProsima Fast DDS* library. Thus, the user can monitor in real time the status -of publication/subscription communications between DDS entities. They can also choose from a wide -variety of communication parameters to be measured (latency, throughput,packet loss, etc.), as well -as record and compute in real time statistical measurements on these parameters (mean, variance, -standard deviation, etc.). +eProsima Fast DDS Monitor is a graphical desktop application aimed at monitoring DDS environments deployed using the *eProsima Fast DDS* library. +Thus, the user can monitor in real time the status of publication/subscription communications between DDS entities. +They can also choose from a wide variety of communication parameters to be measured (latency, throughput,packet loss, etc.), as well as record and compute in real time statistical measurements on these parameters (mean, variance, standard deviation, etc.). -You can read more about this application on the -[Fast DDS Monitor documentation page](https://fast-dds-monitor.readthedocs.io/). +You can read more about this application on the [Fast DDS Monitor documentation page](https://fast-dds-monitor.readthedocs.io/). To run this application once inside the Docker container run: $ fastdds_monitor -eProsima Fast DDS Monitor usage information can be found on the -[Fast DDS Monitor User Manual]( -https://fast-dds-monitor.readthedocs.io/en/latest/rst/user_manual/initialize_monitoring.html). +eProsima Fast DDS Monitor usage information can be found on the [Fast DDS Monitor User Manual](https://fast-dds-monitor.readthedocs.io/en/latest/rst/user_manual/initialize_monitoring.html). ### Fast DDS libraries and Examples -Included in this Docker container is a set of binary examples that showcase several functionalities of the -Fast DDS libraries. These examples' path can be accessed from a terminal by typing +Included in this Docker container is a set of binary examples that showcase several functionalities of the Fast DDS libraries. +These examples' path can be accessed from a terminal by typing $ goToExamples -From this folder you can access all examples, both for DDS and RTPS. We detail the steps to launch two such -examples below. +From this folder you can access all examples, both for DDS and RTPS. +We detail the steps to launch two such examples below. -To launch the Hello World example (a minimal example that will perform a Publisher/Subscriber match and start -sending samples) you could run: +To launch the Hello World example (a minimal example that will perform a Publisher/Subscriber match and start sending samples) you could run: $ goToExamples $ cd dds/HelloWorldExample/bin @@ -180,8 +172,8 @@ sending samples) you could run: split-window "./HelloWorldExample subscriber" \; \ select-layout even-vertical -This example is not constrained to the current instance. It's possible to run several instances of this -container to check the communication between them by running the following from each container. +This example is not constrained to the current instance. +It is possible to run several instances of this container to check the communication between them by running the following from each container. $ goToExamples $ cd dds/HelloWorldExample/bin @@ -193,9 +185,9 @@ or $ cd dds/HelloWorldExample/bin $ ./HelloWorldExample subscriber -Another example you could launch is the Benchmark example. This example creates either a Publisher or a Subscriber and -on a successful match starts sending samples. After a few seconds the process that launched the Publisher will show -a report with the number of samples transmitted. +Another example you could launch is the Benchmark example. +This example creates either a Publisher or a Subscriber and on a successful match starts sending samples. +After a few seconds the process that launched the Publisher will show a report with the number of samples transmitted. On the subscriber side, run: @@ -235,5 +227,4 @@ More information: rosin-project.eu eu_flag -This project has received funding from the European Union’s Horizon 2020 -research and innovation programme under grant agreement no. 732287. +This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 732287. diff --git a/UPGRADING.md b/UPGRADING.md index 59a4631d489..d9344f7438c 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,6 +1,6 @@ Upgrading from previous versions ================================ -If you have used *fastrtpsgen* to generate part of your code, it is always *recommended* to regenerate it. +If you have used *fastddsgen* to generate part of your code, it is always *recommended* to regenerate it. When upgrading from a version older than 1.7.0, regeneration is **required**. diff --git a/build_qnx/common.mk b/build_qnx/common.mk index e5bbef9c544..b9d694d8cb9 100644 --- a/build_qnx/common.mk +++ b/build_qnx/common.mk @@ -12,7 +12,7 @@ NAME=Fast-DDS FAST-DDS_INSTALL_ROOT ?= $(INSTALL_ROOT_$(OS)) # These commands require GNU Make -FAST-DDS_CMAKE_VERSION = $(shell bash -c "grep VERSION $(PROJECT_ROOT)/../CMakeLists.txt | grep fastrtps ") +FAST-DDS_CMAKE_VERSION = $(shell bash -c "grep VERSION $(PROJECT_ROOT)/../CMakeLists.txt | grep fastdds ") FAST-DDS_VERSION = .$(subst $\",,$(word 3,$(FAST-DDS_CMAKE_VERSION))) #choose Release or Debug diff --git a/cmake/modules/FindTinyXML2.cmake b/cmake/modules/FindTinyXML2.cmake index 44b8e645758..c05986ad7f9 100644 --- a/cmake/modules/FindTinyXML2.cmake +++ b/cmake/modules/FindTinyXML2.cmake @@ -2,7 +2,7 @@ # TINYXML2_INCLUDE_DIR # TINYXML2_SOURCE_DIR -option(TINYXML2_FROM_SOURCE "Integrate TinyXML2 source code inside Fast RTPS" OFF) +option(TINYXML2_FROM_SOURCE "Integrate TinyXML2 source code inside Fast DDS" OFF) # Option for evaluating whether we are looking in for tinyxml2 in submodule set(TINYXML2_FROM_THIRDPARTY OFF) diff --git a/cmake/packaging/Config.cmake.in b/cmake/packaging/Config.cmake.in index 01693a9a802..ea462700f8f 100644 --- a/cmake/packaging/Config.cmake.in +++ b/cmake/packaging/Config.cmake.in @@ -16,7 +16,7 @@ set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@) @PACKAGE_INIT@ -@FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION@ +@FASTDDS_PACKAGE_OPT_BIN_DIR_CONDITION@ set_and_check(@PROJECT_NAME@_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@") endif() set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") @@ -25,67 +25,67 @@ set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@") find_package(fastcdr REQUIRED) find_package(foonathan_memory REQUIRED) find_package(TinyXML2 QUIET) -@FASTRTPS_INSTALLER_DEPS_ANCILLARY@ -@FASTRTPS_PACKAGE_UNIX_OPT_DEPS@ +@FASTDDS_INSTALLER_DEPS_ANCILLARY@ +@FASTDDS_PACKAGE_UNIX_OPT_DEPS@ -set(fastrtps_known_comps static shared) -set(fastrtps_comp_static NO) -set(fastrtps_comp_shared NO) -foreach (fastrtps_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) - if (fastrtps_comp IN_LIST fastrtps_known_comps) - set(fastrtps_comp_${fastrtps_comp} YES) +set(fastdds_known_comps static shared) +set(fastdds_comp_static NO) +set(fastdds_comp_shared NO) +foreach (fastdds_comp IN LISTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS) + if (fastdds_comp IN_LIST fastdds_known_comps) + set(fastdds_comp_${fastdds_comp} YES) else () set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE - "fastrtps does not recognize component `${fastrtps_comp}`.") + "fastdds does not recognize component `${fastdds_comp}`.") set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) return() endif () endforeach () -if (fastrtps_comp_static AND fastrtps_comp_shared) +if (fastdds_comp_static AND fastdds_comp_shared) set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE - "fastrtps `static` and `shared` components are mutually exclusive.") + "fastdds `static` and `shared` components are mutually exclusive.") set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) return() endif () -set(fastrtps_static_targets "${CMAKE_CURRENT_LIST_DIR}/fastrtps-static-targets.cmake") -set(fastrtps_shared_targets "${CMAKE_CURRENT_LIST_DIR}/fastrtps-shared-targets.cmake") +set(fastdds_static_targets "${CMAKE_CURRENT_LIST_DIR}/fastdds-static-targets.cmake") +set(fastdds_shared_targets "${CMAKE_CURRENT_LIST_DIR}/fastdds-shared-targets.cmake") -macro(fastrtps_load_targets type) - if (NOT EXISTS "${fastrtps_${type}_targets}") +macro(fastdds_load_targets type) + if (NOT EXISTS "${fastdds_${type}_targets}") set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE - "fastrtps `${type}` libraries were requested but not found.") + "fastdds `${type}` libraries were requested but not found.") set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) return() endif () # find related dependency packages like OpenSSL - @FASTRTPS_INSTALLER_OPT_DEPS@ - @FASTRTPS_PACKAGE_WIN32_OPT_DEPS@ + @FASTDDS_INSTALLER_OPT_DEPS@ + @FASTDDS_PACKAGE_WIN32_OPT_DEPS@ - include("${fastrtps_${type}_targets}") + include("${fastdds_${type}_targets}") endmacro() -if (fastrtps_comp_static) - fastrtps_load_targets(static) -elseif (fastrtps_comp_shared) - fastrtps_load_targets(shared) -elseif (DEFINED fastrtps_SHARED_LIBS AND fastrtps_SHARED_LIBS) - fastrtps_load_targets(shared) -elseif (DEFINED fastrtps_SHARED_LIBS AND NOT fastrtps_SHARED_LIBS) - fastrtps_load_targets(static) +if (fastdds_comp_static) + fastdds_load_targets(static) +elseif (fastdds_comp_shared) + fastdds_load_targets(shared) +elseif (DEFINED fastdds_SHARED_LIBS AND fastdds_SHARED_LIBS) + fastdds_load_targets(shared) +elseif (DEFINED fastdds_SHARED_LIBS AND NOT fastdds_SHARED_LIBS) + fastdds_load_targets(static) elseif (BUILD_SHARED_LIBS) - if (EXISTS "${fastrtps_shared_targets}") - fastrtps_load_targets(shared) + if (EXISTS "${fastdds_shared_targets}") + fastdds_load_targets(shared) else () - fastrtps_load_targets(static) + fastdds_load_targets(static) endif () else () - if (EXISTS "${fastrtps_static_targets}") - fastrtps_load_targets(static) + if (EXISTS "${fastdds_static_targets}") + fastdds_load_targets(static) else () - fastrtps_load_targets(shared) + fastdds_load_targets(shared) endif () endif () diff --git a/cmake/packaging/windows/fastdds-config.cmake b/cmake/packaging/windows/fastdds-config.cmake new file mode 100644 index 00000000000..f8b17d560d1 --- /dev/null +++ b/cmake/packaging/windows/fastdds-config.cmake @@ -0,0 +1,23 @@ +# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if(MSVC_VERSION LESS_EQUAL 1900) + message(FATAL_ERROR "Visual Studio version ${MSVC_VERSION} is no longer supported") +else() + if(CMAKE_CL_64) + include("${CMAKE_CURRENT_LIST_DIR}/../share/fastdds-x64Win64VS2019/cmake/fastdds-config.cmake") + else() + include("${CMAKE_CURRENT_LIST_DIR}/../share/fastdds-i86Win32VS2019/cmake/fastdds-config.cmake") + endif() +endif() diff --git a/cmake/packaging/windows/fastrtps.manifest.in b/cmake/packaging/windows/fastdds.manifest.in similarity index 100% rename from cmake/packaging/windows/fastrtps.manifest.in rename to cmake/packaging/windows/fastdds.manifest.in diff --git a/cmake/packaging/windows/fastrtps-config.cmake b/cmake/packaging/windows/fastrtps-config.cmake deleted file mode 100644 index ee4a8b9ad95..00000000000 --- a/cmake/packaging/windows/fastrtps-config.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(MSVC_VERSION LESS_EQUAL 1900) - message(FATAL_ERROR "Visual Studio version ${MSVC_VERSION} is no longer supported") -else() - if(CMAKE_CL_64) - include("${CMAKE_CURRENT_LIST_DIR}/../share/fastrtps-x64Win64VS2019/cmake/fastrtps-config.cmake") - else() - include("${CMAKE_CURRENT_LIST_DIR}/../share/fastrtps-i86Win32VS2019/cmake/fastrtps-config.cmake") - endif() -endif() diff --git a/colcon.pkg b/colcon.pkg index d71654b9523..8e78ca24b51 100644 --- a/colcon.pkg +++ b/colcon.pkg @@ -1,5 +1,5 @@ { - "name": "fastrtps", + "name": "fastdds", "type": "cmake", "dependencies" : ["fastcdr", "FOONATHAN_MEMORY", "foonathan_memory_vendor", "googletest-distribution"] } diff --git a/doc/README.html.in b/doc/README.html.in deleted file mode 100644 index 95c615285c0..00000000000 --- a/doc/README.html.in +++ /dev/null @@ -1,1273 +0,0 @@ - - - - - - - - - -



- - - - - - - - - - -
-

eProsima
Plaza de la Encina 10-11
Nucleo 4, 2Βͺ Planta
28760 Tres Cantos (Madrid)

-
-

-

-

Fast DDS v@PROJECT_VERSION@

-

Email: support@eprosima.com
Phone: +34 91 804 34 48
www.eprosima.com

-
-


-

-Available documentation:

-


-

-Local:

-


- -


-

Online (updated frequently):

-


- -


-


-

Copyright© 2019 eProsima. All rights reserved.

-

This copy of eProsima Fast DDS is licensed to you under the terms described in the LICENSE file included in this distribution.

- - diff --git a/doc/design/intra-process.md b/doc/design/intra-process.md deleted file mode 100644 index 89ee6c7ea93..00000000000 --- a/doc/design/intra-process.md +++ /dev/null @@ -1,93 +0,0 @@ -# Intra-process delivery - -Several requirements, each with a section. - -## Identifying local endpoints -Endpoints on the same process have the same content on the first 8 octets of their GUID prefix. - -### GUID_t refactor -* Provide methods `is_builtin()`, `is_on_same_process_as(other_guid)` and `is_on_same_host_as(other_guid)` -* Consider other improvements - * Split Guid.h into three headers (guid, prefix and entity_id) - * Converting EntityId_t to uint32_t - * Use a union on GuidPrefix_t to efficiently compare parts of it - -### Getting pointers to local endpoints -* Add methods on RTPSDomain to return a pointer to reader/writer given its guid -* Should be aware of builtin endpoints - -## Intra-process reception -The processing of new data on the subscribers is performed by the thread writing the data. -This thread is in charge of copying the `CacheChange_t` into the `ReaderHistory` and calling `NotifyChanges()`. -This decision was taken to maintain consistence with how currently operate the reception threads coming from transport -layer. - -User's documentation should make clear any user's listener registered to be informed about new changes implies having -blocked both the transport's reception threads and threads which write data. -Also should explain there is another mechanism to read samples, using the function `wait_for_unread_samples()` from the -user's thread and then taking/reading them. - -Current Reader API will be used by local writers to deliver data. The local writer will call `processDataMsg` directly. - -## Readers: management of local writers -When matching a writer, the reader should check if it is on the same process. - -**Considerations at destruction time** - -Until now a reader was safe to be destructed because we are sure that no thread will access it. This is possible because: - -* All events which use the reader were destructed first. Then the event thread will never access the reader. -* The reader was deregistered from the `ReceiverResource` objects. Then any reception thread will never access the -reader. - -Now a reader can be accessed by a writer from the local process. But it was accessed if there was a match with the -writer using discovery. Therefore, we should make sure there will be an unmatch with the writer using discovery before -the reader is destructed. And this unmatch will be instantly because the EDP builtin endpoints will use intraprocess -mechanism. - -### StatefulReader -No output traffic to local writers should be performed. -* Changes on WriterProxy - * `remote_locators_shrinked` should return an empty vector for local writers - * Timed event `heartbeat response` should never be started for local writers - * Timed event `initial acknack` should directly call `process_acknack` on the local writer - -## Writers: management of local readers -When matching a reader, the writer should check if it is on the same process. -* No output traffic to local readers should be performed. -* Samples are sent to local readers using `processDataMsg`. -* When a local reader is matched, and transient_local durability is used, the reader should automatically receive data -with `processDataMsg`. - -### StatelessWriter -* On ReaderLocator::start, no locators should be added when the reader is local - -### StatefulWriter -* Samples sent to local readers are automatically acknowledged -* Gaps sent to local readers should directly call `processGapMsg` -* Heartbeats sent to local readers should directly call `processHeartbeatMsg` -* Timed events should never be started for local readers, except for an `initial heartbeat` - -## Discovery process - -### Participant discovery (PDP) -In order to keep the sepparation of domains while on the same process, we will leave participant discovery to the standard mechanism. -No intraprocess delivery will be used for builtin PDP readers and writers. - -### Endpoint discovery (EDP) -We will leave endpoint discovery to the standard mechanism, but builtin endpoints will use the new mechanism to -send/receive `WriterProxyData` and `ReaderProxyData` to/from the ones on the local process. - -## Additional considerations - -### Security -If we rely on the comparison of the GUID to identify endpoints on the same process, those belonging to a secured participant will not be taken into account, as in that case the GUID is recalculated using a hash of the whole participant GUID. - -### Liveliness -No changes are necessary for the liveliness assertion mechanism, except that manual_by_topic assertions should directly call `processHeartbeatMsg` on local readers. - -### Side effects - -* This design isolates all message traffic from the wire, that is, tools like **wiresharkβ„’** will become useless. Given that most of our customers actually run intraprocess code, and report their issues using **wiresharkβ„’** traces, these changes will create a support nightmare. A workaround may be to supply a flag to inhibits the intraprocess behavior for debugging purposes, stating clearly, that it should be turn off during performance test. - -* Once a shared memory transport is developed for interprocess purposes, an intraprocess mechanism would be pointless. That's because the trade off between speed gain and source complexity would be very expensive. From memory consumption point of view using an interprocess discovery database would yield more benefits that having per-process discovery databases. diff --git a/doc/design/shared-memory-transport/interprocess_shared_mem.md b/doc/design/shared-memory-transport/interprocess_shared_mem.md deleted file mode 100644 index 1f650474a1e..00000000000 --- a/doc/design/shared-memory-transport/interprocess_shared_mem.md +++ /dev/null @@ -1,105 +0,0 @@ -# Interprocess Shared Memory model - -## Overview - -This document describes a model for interprocess shared memory communication of software components interchanging data messages. The objective of the model is to provide a shared memory based transport layer suitable for a Real-time Publish-Subscribe DDS (Data Distribution Service). - -## Context - -eProsima has received commercial proposals to implement a shared memory transport as an improvement of its FastRPTS product. The goals listed in this document are extracted from the customers proposals. - -### Improvements over the standard network transports - -* Reduce OS Kernel calls: This is unavoidable for transports like UDP / TCP (even with the loopback interface). -* Large message support: Network stacks needs to fragment large packets. -* Avoid data serialization / deserialization process: This is not possible in heterogeneous networks, but is possible in shared memory interprocess communication. -* Reduce memory copies: A buffer can be shared directly with several readers without additional copies. - -### Objectives - -* Increase the communications performance of processes in the same machine. -* Create a portable shared memory library (Windows / Linux / MacOS). -* Documentation. -* Tests -* Examples / Tutorials. - -## Architecture - -### Design concepts - -* **Segment**: Is a block of shared memory of fixed size that can be accessed from different processes. Shared memory segments have a global name so any process who knows the name can open the segment and map it in its address space. - -* **SegmentId**: SegmentIds are names that uniquely identify shared memory segments, these names are 16 characters UUIDs. - -* **Shared memory buffer**: Is a buffer allocated in the shared memory segment. - -* **Buffer descriptor**: Shared memory buffers can be referenced by buffers descriptors, these descriptors act like pointers to a buffer that can be copied between processes with a minimum cost. A descriptor contains the SegmentId and the offset to the data from the base of the segment. - -* **Shared memory port**: Is a communication channel identified by a port_id(uint32_t number). Through this channel, buffer descriptors are sent to other processes. It has a ring-buffer, in shared memory, where descriptors are stored. The same port can by opened by several processes for reading and writing operations. Multiple listeners can be registered in a port to be notified when descriptors are pushed to the ring-buffer. Multiple data producers can push descriptors to a port. The port contains an atomic counter with the number of listeners registered on it, each position in the ring-buffer has also a counter initialized to the number of listeners, as listeners read the descriptor, decrement the counter, so the ring-buffer position will be considered free when the counter is zero. The port also has an interprocess condition variable where the listeners will wait for incoming descriptors. - -* **Listener**: Listeners listen to descriptors pushed to a port. The Listener provides an interface for the application to wait and access to the data referenced by the descriptors. When a consumer pops a descriptor from the port listener, look at the descriptor's SegmentId field to open the origin shared memory segment (if not already opened in this process), once the origin segment is mapped locally, the consumer is able to access the data using the offset field contained in the descriptor. - -* **SharedMemoryManager**: Applications instantiate this object in order to access the shared memory resources described above. At least one per process memory manager is required. The manager provides functionality for the application to create shared memory segments, alloc data buffers in the segments, push buffer descriptors to shared memory ports and create listeners associated to a port. - -### Example scenario -![](interprocess_shared_mem1.png) - -Let's study the above example. There are three processes with a SharedMemManager per process, every process creates its own shared memory segment intended to store the buffers that will be shared with other processes. - -P1, P2 and P3 processes are participants in a RTPS-DDS environment. Discovery of participants is done by using multicast, so we have selected shared memory port0 as "multicast" port for discovery, therefore, first thing all participants do is to open the shared memory port0. A listener attached to port0 is created too, by every participant, to read the incoming descriptors. - -Each participant opens a port to receive unicast messages, ports 1, 2 and 3 respectively, and create listeners associated to those ports. - -The first message the participants send is the multicast discovery message: "I'm here, and I am listening on portN". So they alloc a buffer in its local segment, write that information to the buffer and push the buffer's descriptor through the port0. Observe how port0's ring-buffer store the descriptors to Data1a(P1), Data2a(P2), Data3a(P3) after all processes have pushed their discovery descriptors. - -After the discovery phase, participants know the other participants and their "unicast" ports so they can send messages to specific participants by pushing to the participant's unicast port. - -Finally, let's observe how P1 is sharing Data1c with P2 and P3, this is done by pushing the buffer descriptor to P2 and P3 unicast ports. This way one shared memory buffer can be shared with several processes without making any copy of the buffer (just copy the descriptors). This is an important improvement with respect to transports like UDP and TCP. - -### Design considerations - -* **Minimize global interprocess locks**: Interprocess locks are dangerous because, in the case one of the involved processes crashes while holding an interprocess lock, all the collaborating processes could be affected. In this design, pushing data to a port and reading data from the port are lock-free operations. For performance reasons waiting for data on a port, when the port is empty, requires interprocess lock mecanishms like mutexes and condition variables. This is specially dangerous in multicast ports because if one listener crashes while waiting this could block the port for the rest of the listeners. More complex design features could be added to make the library fault-tolerance, but it will possibly be at a cost of losing performance. - -* **Scalable number of processes**: Every process creates its own shared memory segments to store the locally generated messages. This is more scalable than having a global segment shared between all the involved processes. - -* **Per application / process customizable memory usage**: Again, a local shared memory segment allows to adapt the size of the segments to the requirements of the application. Imagine for example an application sending two types of data: Video and status info. It could create a big segment to store video frames, and a small segment for the status messages. - -### Future improvements - -* **Fault tolerance**: As stated in the design considerations, the possibility of a process crashing holding interprocess resources is real. Implementing fault tolerance for these cases is not an easy task. Timeouts, keep alive checks and garbage collectors are some of the things that could be added to the initial design in order to achieve fault tolerance. This will be considered in future revisions. - -### Mapping the design to FastRTPS - -#### Transport Layer - -* **Locators**: LOCATOR_KIND_SHM Is defined to identify shared memory transport endpoints. Locator_t fields are filled in this way: - * kind: 16 (Is the RTPS vendor-specific range). - * port: The locator's port contains the shared memory port_id. - * address: The whole address is set to 0 except for the first byte that is used to mark unicast (address[0]='U') or multicast (address[0]='M'). - -* **SharedMemTransportDescriptor**: The following values can be customized: - * segment_size: Size of the shared memory segment reserved by the transport. - * port_queue_capacity: Size, in number of messages, of the shared memory port message queue. - * port_overflow_policy: DISCARD or FAIL. - * segment_overflow_policy: DISCARD or FAIL - * max_message_size: By default max_message_size will be the segment_size, but is possible to specify a value <= segment_size. In that case fragmentation could occur. - -* **Default metatraffic multicast locator**: One locator, the port will be selected by the participant (will be the same as in the RTPS standard for UDP). - -* **Default metatraffic unicast locator**: One locator, the port will be selected by the participant (default port_id will be the same as in the RTPS standard for UDP). - -* **Default output locator**: There will be no default output locator. - -* **OpenInputChannel**: A SharedMemChannelResource instance will be created. An opened channels vector is maintained, if the same input locator is opened several times the channel instance is reused. - -* **OpenOutputChannel**: There will be only one SharedMemSenderResource instance per transport instance, an unordered_map of opened ports will be maintained by the SharedMemSenderResource object in order to match the destination locators to the shared memory ports. - -## Class design -![](interprocess_shared_mem2.png) - -#### RTPS Layer - -In FastRTPS transports are associated to participants, so the new SHM transport can used, by adding an instance of a SharedMemTransportDescriptor class to the list of participant's user transports. -So there is a shared memory segment per participant that will be shared by all participant's publishers. - -Transport selection: As RTPSParticipant is able to have multiple transports, a transport selection mecanishm is necessary when communicating with other participants reachable by several transports. The defined behaviour here is: If the participants involved are in the same host and both have SHM transport configured, then SHM transport is selected for all communications between those participants. diff --git a/doc/design/shared-memory-transport/interprocess_shared_mem1.png b/doc/design/shared-memory-transport/interprocess_shared_mem1.png deleted file mode 100644 index 3187e9ad534..00000000000 Binary files a/doc/design/shared-memory-transport/interprocess_shared_mem1.png and /dev/null differ diff --git a/doc/design/shared-memory-transport/interprocess_shared_mem2.plantuml b/doc/design/shared-memory-transport/interprocess_shared_mem2.plantuml deleted file mode 100644 index 427a646dfc0..00000000000 --- a/doc/design/shared-memory-transport/interprocess_shared_mem2.plantuml +++ /dev/null @@ -1,68 +0,0 @@ -```plantuml -@startuml - -hide empty members - -!define struct(x) class x << (S,CadetBlue) >> - -class SharedMemTransport { - ..Channel handling.. - +OpenOutputChannel() - +OpenInputChannel() - +Send() - .. - -input_channels_ -} - -struct(SharedMemTransportDescriptor) { - ..Interface implementation.. - +min_send_buffer_size() - +max_message_size() - ..Additional configuration.. - +segment_size - +port_queue_capacity - +port_overflow_policy -} - -class ChannelResource { - -} - -class SharedMemChannelResource { - +Receive() -} - -class SenderResource { -} - -class SharedMemSenderResource { - -locators_ports_map -} - -class SharedMemManager { - +create_segment() - +open_port() -} - -class SharedMemManager::Port { - +push() - +create_listener() -} - -class SharedMemManager::Listener { - +pop() -} - -TransportInterface ()-- SharedMemTransport -TransportDescriptorInterface ()-- SharedMemTransportDescriptor -ChannelResource <|-- SharedMemChannelResource -SharedMemTransport o-- SharedMemManager -SharedMemTransport "1" *-- "n" SharedMemChannelResource -SenderResource <|-- SharedMemSenderResource -SharedMemTransport "1" *-- "1" SharedMemSenderResource -SharedMemChannelResource "1" *-- "1" SharedMemManager::Listener : listen on -SharedMemManager::Listener "1" o-- "1" SharedMemManager::Port -SharedMemSenderResource "1" *-- "n" SharedMemManager::Port : send to - -@enduml -``` \ No newline at end of file diff --git a/doc/design/shared-memory-transport/interprocess_shared_mem2.png b/doc/design/shared-memory-transport/interprocess_shared_mem2.png deleted file mode 100644 index 67b022e7a30..00000000000 Binary files a/doc/design/shared-memory-transport/interprocess_shared_mem2.png and /dev/null differ diff --git a/doc/pdf/FASTRTPSGEN - User Manual.odt b/doc/pdf/FASTRTPSGEN - User Manual.odt deleted file mode 100644 index 704aeff52da..00000000000 Binary files a/doc/pdf/FASTRTPSGEN - User Manual.odt and /dev/null differ diff --git a/doc/pdf/Fast RTPS - Installation Manual.odt b/doc/pdf/Fast RTPS - Installation Manual.odt deleted file mode 100644 index 5367442e0e7..00000000000 Binary files a/doc/pdf/Fast RTPS - Installation Manual.odt and /dev/null differ diff --git a/doc/pdf/Fast RTPS - Latency Test.odt b/doc/pdf/Fast RTPS - Latency Test.odt deleted file mode 100644 index b8de45281e6..00000000000 Binary files a/doc/pdf/Fast RTPS - Latency Test.odt and /dev/null differ diff --git a/doc/pdf/Fast RTPS - Throughput Test.odt b/doc/pdf/Fast RTPS - Throughput Test.odt deleted file mode 100644 index 0a1585ea441..00000000000 Binary files a/doc/pdf/Fast RTPS - Throughput Test.odt and /dev/null differ diff --git a/doc/pdf/Fast RTPS - User Manual.odt b/doc/pdf/Fast RTPS - User Manual.odt deleted file mode 100644 index 9f4a3ff045b..00000000000 Binary files a/doc/pdf/Fast RTPS - User Manual.odt and /dev/null differ diff --git a/doc/proposals/shared-memory-transport/sony/PubSub_overview.png b/doc/proposals/shared-memory-transport/sony/PubSub_overview.png deleted file mode 100755 index cfc2da4d018..00000000000 Binary files a/doc/proposals/shared-memory-transport/sony/PubSub_overview.png and /dev/null differ diff --git a/doc/proposals/shared-memory-transport/sony/RPC_overview.png b/doc/proposals/shared-memory-transport/sony/RPC_overview.png deleted file mode 100755 index d25009c43da..00000000000 Binary files a/doc/proposals/shared-memory-transport/sony/RPC_overview.png and /dev/null differ diff --git a/doc/proposals/shared-memory-transport/sony/improvement.png b/doc/proposals/shared-memory-transport/sony/improvement.png deleted file mode 100755 index b913dcdbf2d..00000000000 Binary files a/doc/proposals/shared-memory-transport/sony/improvement.png and /dev/null differ diff --git a/doc/proposals/shared-memory-transport/sony/ms1_rtps_shared_memory_transport.md b/doc/proposals/shared-memory-transport/sony/ms1_rtps_shared_memory_transport.md deleted file mode 100755 index 6bce5cff89e..00000000000 --- a/doc/proposals/shared-memory-transport/sony/ms1_rtps_shared_memory_transport.md +++ /dev/null @@ -1,127 +0,0 @@ -# Overview - -DDSi-RTPS(Real-Time Publish-Subscribe) is the **protocol** that enable to support vendor implementation. And RTPS specifies implementaion and message packet format and other stuff as well. On this proposal, it will descibe how we could integrate **shared memory as transport** for RTPS layer based on. - -# Objective - -Implement a shared Memory transport using the current Fast-RTPS transport API & Architecture: The transport will be used as any other transport (including serialization and RTPS encapsulation). This approach is used in other DDS implementations such as commercial release for OpenSplice and RTI Connext DDS. This is mostly related to ROS2 RMW transport, but it can be used in any DDS application or product. - -# Requirements - -- Multi-Platform support (Windows, Linux and MacOS) along with ROS2. -- Design and Architecture Description -- Source Code [Fast-RTPS](https://github.com/eProsima/Fast-RTPS) -- Documents for user manual and tutorials. -- ROS2/RMW compatible interface (do not break ROS2 userland) -- Latency/Bandwidth improvement results. -- Intra/Inter-Process Communication - -# Architecture / Design - -## Interoperability - -There is no gurantee that the whole system is constructed with eProsima Fast-RTPS, so multiple DDS implementaions may be used in a distributed system. -To keep the interoperability between different vendor DDS implementations, the shared memory transport feature has to be implemented with the following: - -- All communications must take place using RTPS Messages. -- All implementations must implement the RTPS Message Receiver. -- Simple Participant and Endpoint Discovery Protocols. - -## Discovery - -Participant and Endpoint Discovery(PDP, EDP such as metatrrafic transmittion) will be kept as is in the current code, since this negotiation does not require shared memory use cases (all of the RTPS protocol stays put). - -## Memory Management - -- Dynamic Configuration - - Shared memory transport should be dynamically configured when necessary, that is, when the reader exists on the same host system than the writer. This is mandatory to reduce unnecessary message passing via shared memory. - - This can be detected using the GuidPrefix_t information in the locator, which includes vendor id, host id, process id and participant id. - - ``` - struct RTPS_DllAPI GuidPrefix_t - ``` - -- Lifecycle - - Shared memory lifecycle is managed by the writer corresponding to HistoryCache more likely QoS setting. - -- Owner - - Shared memory is owned by the writer. The writer is responsible of managing the shared memory (creation and removal) according to the aforementioned lifecycle. - -- Version - - Versioning must be used to check if the implementation supports the shared memory feature or not. - -## Shared Memory Framework - -Since this whole project is targeted to be multi-platform, it is mandatory not to use system dependent shared memory frameworks or primitives. - -- C/C++ implementation - - Primitive baseline implementation, can be used for multi-platform. - - But most parts need to be implemented by our own. - - Also good affinity to intra-process, just use std::shared_ptr. -- POSIX IPC shared memory (shm_open) - - This is only for Unix system, so not good affinity for Windows/Mac. -- **boost::interprocess** - - Surely multi-platform, this is generic and up-to-date interfaces. - - Generic shared memory interface - - Emulation layer available for windows and system v(xsi) if necessary. - - Memory mapped file (this can be useful to use ramfs to refresh system restart or reboot) - - Shared memory range can be truncated dynamically. - - Container mapping with allocator - - File locking (this could be useful to exclude access to the memory mapped shared memory) - - Writer has read_write mode and reader only has read_only mode. - - ***But cannot be extremly optimized via system calls, such as hugetlb to reduce TLB miss hit and pagefaults.*** - - -## Event Notification - -Writer needs to notify right after the shared memory is ready to be read on reader side. Then reader will be notified that data is ready to read out. - -- RTPS extensible message - - Submessages with ID's 0x80 to 0xff (inclusive) are vendor-specific - - But probably we should avoid sending messages via network. -- **boost::interprocess** - - Condition: after data is set by writer, notify the subscribers via condition variable on shared memory (named under topic name?). - - Semaphore: after data is set by writer, post to notify the subscribers via semaphore on shared memory. Can be used to control the number of subscribers to read via wait API (named under topic name?). - -## Security - -- Encryption / Decryption: - - Shared memory will be used as transport only, so encrypted data will be stored on shared memory. Therefore, this does not affect anything. -- Access Permission: - - Can we support access permission? Like file system based access permission? This needs to be considered. - - Since security implementation is different among platforms, boost::interprocess does not try to standardize the access permission control. This is responsibility of the implementation. - -## Quality of Service - -Since this is just a new implementation of the transport layer for shared memory, where all the rest of the RTPS protocol stays put, we expect full compatibility of configuration with Fast-RTPS. - -Nevertheless, this needs to be further considered during the detailed design and implementation. - -# Considerations - -## Intra Process Communication - -There is an intra-process communication feature in ROS2 rclcpp and rcl layer (basically zero-copy based). This has nothing to do with DDS implementation, but needs to be considered to ensure this feature doesn't break when implementing the DDS shared memory transport. Refer to [Intra-Process-Communication](https://index.ros.org//doc/ros2/Tutorials/Intra-Process-Communication/) - -Intra-process communication does not support QoS specification, e.g) RMW_QOS_POLICY_HISTORY_KEEP_ALL, !RMW_QOS_POLICY_DURABILITY_VOLATILE is not supported. - -Intra-process communication uses a ring buffer that is internally implemented [mapped_ring_buffer.hpp](https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/mapped_ring_buffer.hpp). - -**this implementataion will stay on rclcpp for other implementations, but will be decricated for eProsima Fast-RTPS use-cases basically.** - -## Container Boundary - -Using containers basically means to divide the user space into independent sections, so shared memory should not be used beyond the container boundary. - -This can be actually done just checking IP addresses to see if both participants are in the same host or not. So we don't expect addtional requirements, it just appears to be another network interface. - -# Reference - -[ROSConJP 2019 Lightning Talk Presentation](https://discourse.ros.org/uploads/short-url/1SbbxgRCiM6NH2BuSCqNAe0aogx.pdf) -[Boost.Interprocess](https://www.boost.org/doc/libs/1_71_0/doc/html/interprocess.html) - diff --git a/doc/proposals/shared-memory-transport/sony/ms2_rmw_shared_memory_data_share_sony.md b/doc/proposals/shared-memory-transport/sony/ms2_rmw_shared_memory_data_share_sony.md deleted file mode 100755 index f5c9770155d..00000000000 --- a/doc/proposals/shared-memory-transport/sony/ms2_rmw_shared_memory_data_share_sony.md +++ /dev/null @@ -1,87 +0,0 @@ -# Overview - -Sony has already done implementation using internal shared memory light framework to connect rmw layer, so that ROS2 applicatoin can use the shared memory publisher/subscriber framework without notice. This is the same target for milestone-2, so this documentation describe about the history and feasibilities, and also basic design for shared memory data sharing in linux system. - -# Background - -- We need to deal with a large amount of data for recognitions, robotics, intelligent processes like agent device. The data has to be shared among a lot of framework and process spaces, otherwise copy in/out system space overhead will stress the system resources. especially embedded devices, this could be fatal issue. -- It is impossible to complete the requirement with single process even if that is the embedded consumer devices. Data shall be shared in the host system efficiently so that application can use the data without concern. Besides data size is getting bigger and bigger such as 4K, 8K images, ToF, Lidar, Radar, PointCloud and so on. We surely need more band width/high latency data sharing against these situations. - -# Requirements - -### Publisher/Subscriber Architecture (N:N) - -![PubSub_overview](./PubSub_overview.png) - -Publisher: after system calls to map and create message on the filesystem, it will directly write the dat into the message. Then at the finish writing or closing file, that will be notified to the subscriber with file path. - -Subscriber: file path will be notified via inotify, the subscriber to get the corresponding message to open and read directly. - -**There will be no copy insluding user application or framework itself** - -### Remote Procedure Call Support (1:1 asynchronous, such as rosservice) - -![RPC_overview](./RPC_overview.png) - -Unique ID assigned for each message, so easy to recognize who’s message. - -- Perfectly Copyless Data Sharing -- Low Latency and High Throughput -- Message Lifecycle and Timestamp support -- Data Access Control via Filesystem -- Storage supported as backend (user flexibility) - -# Design - -## Platform - -Linux 2.6.13 or later (technically the platform supports [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html)) - -## Data Channel - -Basically in-memory file system such as ramfs or tmpfs. but this is not a limitation or constraints, user can choose the backend file system to specify the root directory. ramfs and tmpfs is actually memory storage, but it can keep the file on the filesystem as long as system running. this would be also good, once the system reboots it will refresh the entire cache data, we can restart as clean. - -Taking advantage of linux interfaces such as map/unmap to assign the physical pages into the user process space, no additional overhead or stack will be provided from this framework. - -## Signal and Event Notification - -from our experience and benchmark on embedded linux system, [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) came up the candidate number 1. inotify is also provied by linux kernel and it allows us to notify events on filesystem and what kind of events and what file is actually changed.(written, closed or opened etc.) this is really simple linux kernel interface and also support message queue order guranteed by linux kernel. - -## Access Permission Control - -since this framework is constructed on filesystem based storage, we can control access permission just like we do with normal files and user/group permission control. without certain group or access permission, user cannot even see the files or any activities by this framework. - -## Datatype / Serialization - -Do not serialize data into the shared memory with publish/subscribe. So user application needs to be aware before to write/read the binary data fits in the certain structure. - -## Remarkable Features (Only Related) - -- Configurable parameters for each topic - root file path and ring buffer length to keep for each topic shall be predefined. -- Ring Buffer / File Mapped Shared Memory - Ring Buffer is controlled by framework, e.g) entries of single topic. -- Retain Memory - once the file is mapped into physical page, it will never unmapped unless it is necessary. - this will reduce the huge system time via system calls. -- Huge TLB - also reduce system time for cache miss, pagefaults and tlb miss hit. - -# Feasibilities - -With Sony internal framework and rmw_sony_cpp to connect the implementation to ROS2 frontend, there is a huge performance improvemnent that we have taking advantage of shared memory. - - - -of course this is only prototype and Non-DDS implementation which means in general there is not a lot of processes that is required with DDS implementation. But even anticipated value expectation in prototype, there is an improvement as followings. - - - -- Publisher:Subscriber = 1:1 -- Serializer is [Fast-CDR](https://github.com/eProsima/Fast-CDR) -- Ubuntu 18.04 ROS Dashing -- Skylake PC - -# Note - -This is just for sharing primitives, but we can work on this feature more generic way and keep the improvement as it is. diff --git a/doc/proposals/shared-memory-transport/sony/rmw_sony_cpp.png b/doc/proposals/shared-memory-transport/sony/rmw_sony_cpp.png deleted file mode 100755 index eda23ff7ecd..00000000000 Binary files a/doc/proposals/shared-memory-transport/sony/rmw_sony_cpp.png and /dev/null differ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 88766a3b3ff..d63b96f986c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(fastrtps_FOUND TRUE) +set(fastdds_FOUND TRUE) add_subdirectory(cpp/dds) add_subdirectory(cpp/rtps) diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx deleted file mode 100644 index f423c3c9cc9..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AdvancedConfiguration.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AdvancedConfiguration.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - - - -AdvancedConfiguration::AdvancedConfiguration() -{ -} - -AdvancedConfiguration::~AdvancedConfiguration() -{ -} - -AdvancedConfiguration::AdvancedConfiguration( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; -} - -AdvancedConfiguration::AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - const AdvancedConfiguration& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; - return *this; -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - AdvancedConfiguration&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); - return *this; -} - -bool AdvancedConfiguration::operator ==( - const AdvancedConfiguration& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool AdvancedConfiguration::operator !=( - const AdvancedConfiguration& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AdvancedConfiguration::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AdvancedConfiguration::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AdvancedConfiguration::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void AdvancedConfiguration::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void AdvancedConfiguration::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& AdvancedConfiguration::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& AdvancedConfiguration::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void AdvancedConfiguration::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void AdvancedConfiguration::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& AdvancedConfiguration::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& AdvancedConfiguration::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "AdvancedConfigurationCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h deleted file mode 100644 index 207a02e1cd0..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AdvancedConfiguration.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "AdvancedConfigurationv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ -#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ADVANCEDCONFIGURATION_SOURCE) -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllexport ) -#else -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllimport ) -#endif // ADVANCEDCONFIGURATION_SOURCE -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure AdvancedConfiguration defined by the user in the IDL file. - * @ingroup AdvancedConfiguration - */ -class AdvancedConfiguration -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AdvancedConfiguration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AdvancedConfiguration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - const AdvancedConfiguration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - const AdvancedConfiguration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AdvancedConfiguration& x) const; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AdvancedConfiguration& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - -private: - - uint32_t m_index{0}; - std::array m_message{0}; - std::vector m_data; - -}; - -#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp new file mode 100644 index 00000000000..cf302de8bc8 --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp @@ -0,0 +1,275 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AdvancedConfiguration.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ +#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ + +#include +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ADVANCEDCONFIGURATION_SOURCE) +#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllexport ) +#else +#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllimport ) +#endif // ADVANCEDCONFIGURATION_SOURCE +#else +#define ADVANCEDCONFIGURATION_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ADVANCEDCONFIGURATION_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure AdvancedConfiguration defined by the user in the IDL file. + * @ingroup AdvancedConfiguration + */ +class AdvancedConfiguration +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AdvancedConfiguration() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AdvancedConfiguration() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AdvancedConfiguration that will be copied. + */ + eProsima_user_DllExport AdvancedConfiguration( + const AdvancedConfiguration& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AdvancedConfiguration that will be copied. + */ + eProsima_user_DllExport AdvancedConfiguration( + AdvancedConfiguration&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AdvancedConfiguration that will be copied. + */ + eProsima_user_DllExport AdvancedConfiguration& operator =( + const AdvancedConfiguration& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AdvancedConfiguration that will be copied. + */ + eProsima_user_DllExport AdvancedConfiguration& operator =( + AdvancedConfiguration&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AdvancedConfiguration object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AdvancedConfiguration& x) const + { + return (m_index == x.m_index && + m_message == x.m_message && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x AdvancedConfiguration object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AdvancedConfiguration& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data() + { + return m_data; + } + + + +private: + + uint32_t m_index{0}; + std::array m_message{0}; + std::vector m_data; + +}; + +#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ + + diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp index a99d903b31f..5eb6868b802 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp @@ -22,9 +22,9 @@ #ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATIONCDRAUX_HPP_ #define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATIONCDRAUX_HPP_ -#include "AdvancedConfiguration.h" +#include "AdvancedConfiguration.hpp" -constexpr uint32_t AdvancedConfiguration_max_cdr_typesize {132UL}; +constexpr uint32_t AdvancedConfiguration_max_cdr_typesize {32UL}; constexpr uint32_t AdvancedConfiguration_max_key_cdr_typesize {0UL}; @@ -34,10 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AdvancedConfiguration& data); diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp index 61815b63fe3..58b1d9fab52 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx index fc1cdd916e3..007acf0d5b9 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx @@ -19,20 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "AdvancedConfigurationPubSubTypes.h" +#include #include -#include "AdvancedConfigurationPubSubTypes.h" #include "AdvancedConfigurationCdrAux.hpp" +#include "AdvancedConfigurationTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - AdvancedConfigurationPubSubType::AdvancedConfigurationPubSubType() { setName("AdvancedConfiguration"); @@ -221,3 +219,11 @@ bool AdvancedConfigurationPubSubType::getKey( return true; } +void AdvancedConfigurationPubSubType::register_type_object_representation() const +{ + register_AdvancedConfiguration_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "AdvancedConfigurationCdrAux.ipp" diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h index 7c513bc156c..1d09762eebe 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "AdvancedConfiguration.h" +#include "AdvancedConfiguration.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,10 +38,6 @@ #endif // GEN_API_VER - - - - /*! * @brief This class represents the TopicDataType of the type AdvancedConfiguration defined by the user in the IDL file. * @ingroup AdvancedConfiguration @@ -92,6 +88,9 @@ class AdvancedConfigurationPubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPublisher.cpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPublisher.cpp index d606a603cc4..63420653ed1 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPublisher.cpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPublisher.cpp @@ -17,9 +17,11 @@ * */ +#include "AdvancedConfigurationPublisher.h" + #include -#include #include +#include #include #include @@ -29,10 +31,6 @@ #include #include #include -#include -#include - -#include "AdvancedConfigurationPublisher.h" using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp index 807942606c4..2caa591eaa4 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp @@ -17,6 +17,8 @@ * */ +#include "AdvancedConfigurationSubscriber.h" + #include #include @@ -27,10 +29,6 @@ #include #include #include -#include -#include - -#include "AdvancedConfigurationSubscriber.h" using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -282,7 +280,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx new file mode 100644 index 00000000000..c19034579e1 --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx @@ -0,0 +1,461 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AdvancedConfigurationTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "AdvancedConfigurationTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AdvancedConfiguration.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_AdvancedConfiguration_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_AdvancedConfiguration_type_identifier(); + + }); +} + +void register_AdvancedConfiguration_type_identifier() +{ + { + StructTypeFlag struct_flags_AdvancedConfiguration = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_AdvancedConfiguration; + TypeIdentifierPair type_ids_AdvancedConfiguration; + QualifiedTypeName type_name_AdvancedConfiguration = "AdvancedConfiguration"; + eprosima::fastcdr::optional type_ann_builtin_AdvancedConfiguration; + eprosima::fastcdr::optional ann_custom_AdvancedConfiguration; + CompleteTypeDetail detail_AdvancedConfiguration = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AdvancedConfiguration, ann_custom_AdvancedConfiguration, type_name_AdvancedConfiguration.to_string()); + CompleteStructHeader header_AdvancedConfiguration; + header_AdvancedConfiguration = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AdvancedConfiguration); + CompleteStructMemberSeq member_seq_AdvancedConfiguration; + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_AdvancedConfiguration); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_index); + } + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_20 {nullptr}; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_20 = EK_COMPLETE; + if (TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_20 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_20 = 0; + PlainCollectionHeader header_anonymous_array_char_20 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_20, element_flags_anonymous_array_char_20); + std::string type_id_kind_anonymous_array_char_20("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_char_20 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_AdvancedConfiguration); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_message); + } + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_AdvancedConfiguration); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_data); + } + CompleteStructType struct_type_AdvancedConfiguration = TypeObjectUtils::build_complete_struct_type(struct_flags_AdvancedConfiguration, header_AdvancedConfiguration, member_seq_AdvancedConfiguration); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_AdvancedConfiguration, type_name_AdvancedConfiguration.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AdvancedConfiguration already registered in TypeObjectRegistry for a different type."); + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "AdvancedConfiguration", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AdvancedConfiguration: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp new file mode 100644 index 00000000000..c863db7608d --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AdvancedConfigurationTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_AdvancedConfiguration_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register AdvancedConfiguration related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_AdvancedConfiguration_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx deleted file mode 100644 index 2e28c5a0822..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AdvancedConfiguration.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AdvancedConfiguration.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define AdvancedConfiguration_max_cdr_typesize 132ULL; - - - - - - -AdvancedConfiguration::AdvancedConfiguration() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((20)) * 1); - // sequence m_data - - -} - -AdvancedConfiguration::~AdvancedConfiguration() -{ -} - -AdvancedConfiguration::AdvancedConfiguration( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - -} - -AdvancedConfiguration::AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - - return *this; -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - - return *this; -} - -bool AdvancedConfiguration::operator ==( - const AdvancedConfiguration& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool AdvancedConfiguration::operator !=( - const AdvancedConfiguration& x) const -{ - return !(*this == x); -} - -size_t AdvancedConfiguration::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return AdvancedConfiguration_max_cdr_typesize; -} - -size_t AdvancedConfiguration::getCdrSerializedSize( - const AdvancedConfiguration& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void AdvancedConfiguration::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - - scdr << m_data; - - -} - -void AdvancedConfiguration::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - - - dcdr >> m_data; - - -} - - -bool AdvancedConfiguration::isKeyDefined() -{ - return false; -} - -void AdvancedConfiguration::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AdvancedConfiguration::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AdvancedConfiguration::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AdvancedConfiguration::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void AdvancedConfiguration::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void AdvancedConfiguration::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& AdvancedConfiguration::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& AdvancedConfiguration::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void AdvancedConfiguration::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void AdvancedConfiguration::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& AdvancedConfiguration::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& AdvancedConfiguration::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h deleted file mode 100644 index 5ea849b1748..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AdvancedConfiguration.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ -#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ADVANCEDCONFIGURATION_SOURCE) -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllexport ) -#else -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllimport ) -#endif // ADVANCEDCONFIGURATION_SOURCE -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure AdvancedConfiguration defined by the user in the IDL file. - * @ingroup AdvancedConfiguration - */ -class AdvancedConfiguration -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AdvancedConfiguration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AdvancedConfiguration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - const AdvancedConfiguration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - const AdvancedConfiguration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AdvancedConfiguration& x) const; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AdvancedConfiguration& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const AdvancedConfiguration& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - std::vector m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/CMakeLists.txt b/examples/cpp/dds/AdvancedConfigurationExample/CMakeLists.txt index b58e08d8e87..16a28f79266 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/CMakeLists.txt +++ b/examples/cpp/dds/AdvancedConfigurationExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:SHM_TRANSPORT_BUILTIN> # Enable SHM as built-in transport ) -target_link_libraries(${PROJECT_NAME} fastrtps fastcdr fastdds::optionparser) +target_link_libraries(${PROJECT_NAME} fastdds fastcdr fastdds::optionparser) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION examples/cpp/dds/${PROJECT_NAME}/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/AdvancedConfigurationExample/README.md b/examples/cpp/dds/AdvancedConfigurationExample/README.md index fdc0352d5cb..c31397f38f9 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/README.md +++ b/examples/cpp/dds/AdvancedConfigurationExample/README.md @@ -85,7 +85,7 @@ QoS options: Discovery options: --ttl Set multicast discovery Time To Live on IPv4 or Hop Limit - for IPv6. If not set, uses Fast-DDS default (1 hop). + for IPv6. If not set, uses Fast DDS default (1 hop). Increase it to avoid discovery issues on scenarios with several routers. Maximum: 255. ``` @@ -100,5 +100,5 @@ This code presents how to run a publisher with this example without Shared Memor ```sh # From AdvancedConfigurationExample installation dir -FASTRTPS_DEFAULT_PROFILES_FILE=shm_off.xml ./AdvancedConfigurationExample publisher --xml-profile no_shm_participant_profile +FASTDDS_DEFAULT_PROFILES_FILE=shm_off.xml ./AdvancedConfigurationExample publisher --xml-profile no_shm_participant_profile ``` diff --git a/examples/cpp/dds/AdvancedConfigurationExample/arg_configuration.h b/examples/cpp/dds/AdvancedConfigurationExample/arg_configuration.h index 96cc666d4fe..997360b7e9c 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/arg_configuration.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/arg_configuration.h @@ -239,7 +239,7 @@ const option::Descriptor usage[] = { { UNKNOWN_OPT, 0, "", "", Arg::None, "\nDiscovery options:"}, { TTL, 0, "", "ttl", Arg::NumericRange<1, 255>, "\t--ttl \tSet multicast discovery Time To Live on IPv4 or Hop Limit for IPv6." - " If not set, uses Fast-DDS default (1 hop). Increase it to avoid discovery issues" + " If not set, uses Fast DDS default (1 hop). Increase it to avoid discovery issues" " on scenarios with several routers. Maximum: 255."}, { 0, 0, 0, 0, 0, 0 } diff --git a/examples/cpp/dds/AdvancedConfigurationExample/shm_off.xml b/examples/cpp/dds/AdvancedConfigurationExample/shm_off.xml index d02bf86f1ad..50d23e0c3ca 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/shm_off.xml +++ b/examples/cpp/dds/AdvancedConfigurationExample/shm_off.xml @@ -1,6 +1,6 @@ - + custom_udpv4_transport diff --git a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationPublisher.cpp b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationPublisher.cpp index 1f231adf86d..3734b53436a 100644 --- a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationPublisher.cpp +++ b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationPublisher.cpp @@ -17,6 +17,8 @@ * */ +#include "BasicConfigurationPublisher.h" + #include #include @@ -28,10 +30,6 @@ #include #include #include -#include -#include - -#include "BasicConfigurationPublisher.h" using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; diff --git a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp index cd333888698..5f22068cab3 100644 --- a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp +++ b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp @@ -17,6 +17,8 @@ * */ +#include "BasicConfigurationSubscriber.h" + #include #include @@ -27,10 +29,6 @@ #include #include #include -#include -#include - -#include "BasicConfigurationSubscriber.h" using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -254,7 +252,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/BasicConfigurationExample/CMakeLists.txt b/examples/cpp/dds/BasicConfigurationExample/CMakeLists.txt index 5b951d5e9d2..ba91f9520dc 100644 --- a/examples/cpp/dds/BasicConfigurationExample/CMakeLists.txt +++ b/examples/cpp/dds/BasicConfigurationExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,6 +46,6 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE $<$:SHM_TRANSPORT_BUILTIN> # Enable SHM as built-in transport ) -target_link_libraries(${PROJECT_NAME} fastrtps fastcdr fastdds::optionparser) +target_link_libraries(${PROJECT_NAME} fastdds fastcdr fastdds::optionparser) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION examples/cpp/dds/${PROJECT_NAME}/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx deleted file mode 100644 index 0d9236d0cee..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h deleted file mode 100644 index aaf09e4bc57..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - -private: - - uint32_t m_index{0}; - std::array m_message{0}; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp new file mode 100644 index 00000000000..138a79db54c --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp @@ -0,0 +1,226 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::array m_message{0}; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp index 5c8468e7cb1..de0e84c6ecd 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {28UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h index ddbfbab5db6..52736f6dad8 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..8c30e9795fe --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,306 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_20 {nullptr}; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_20 = EK_COMPLETE; + if (TK_NONE == type_ids_HelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_20 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_20 = 0; + PlainCollectionHeader header_anonymous_array_char_20 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_20, element_flags_anonymous_array_char_20); + std::string type_id_kind_anonymous_array_char_20("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_char_20 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx deleted file mode 100644 index 3b9a562b692..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 28ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((20)) * 1); - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h deleted file mode 100644 index d4554ac83a2..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/README.md b/examples/cpp/dds/BasicConfigurationExample/README.md index 02f3c1a7ef9..a95ef86a3f9 100644 --- a/examples/cpp/dds/BasicConfigurationExample/README.md +++ b/examples/cpp/dds/BasicConfigurationExample/README.md @@ -66,7 +66,7 @@ QoS options: Discovery options: --ttl Set multicast discovery Time To Live on IPv4 or Hop Limit - for IPv6. If not set, uses Fast-DDS default (1 hop). + for IPv6. If not set, uses Fast DDS default (1 hop). Increase it to avoid discovery issues on scenarios with several routers. Maximum: 255. ``` diff --git a/examples/cpp/dds/BasicConfigurationExample/arg_configuration.h b/examples/cpp/dds/BasicConfigurationExample/arg_configuration.h index 84d58fd68b3..2d8154fcdb1 100644 --- a/examples/cpp/dds/BasicConfigurationExample/arg_configuration.h +++ b/examples/cpp/dds/BasicConfigurationExample/arg_configuration.h @@ -220,7 +220,7 @@ const option::Descriptor usage[] = { { UNKNOWN_OPT, 0, "", "", Arg::None, "\nDiscovery options:"}, { TTL, 0, "", "ttl", Arg::NumericRange<1, 255>, "\t--ttl \tSet multicast discovery Time To Live on IPv4 or Hop Limit for IPv6." - " If not set, uses Fast-DDS default (1 hop). Increase it to avoid discovery issues" + " If not set, uses Fast DDS default (1 hop). Increase it to avoid discovery issues" " on scenarios with several routers. Maximum: 255."}, { 0, 0, 0, 0, 0, 0 } diff --git a/examples/cpp/dds/CMakeLists.txt b/examples/cpp/dds/CMakeLists.txt index 421eb164dcb..0ade7a00048 100644 --- a/examples/cpp/dds/CMakeLists.txt +++ b/examples/cpp/dds/CMakeLists.txt @@ -39,7 +39,6 @@ add_subdirectory(SampleConfig_Controller) add_subdirectory(SampleConfig_Events) add_subdirectory(SampleConfig_Multimedia) add_subdirectory(StaticHelloWorldExample) -add_subdirectory(TypeLookupService) add_subdirectory(WriterLoansExample) add_subdirectory(ZeroCopyExample) diff --git a/examples/cpp/dds/Configurability/CMakeLists.txt b/examples/cpp/dds/Configurability/CMakeLists.txt index 3be7f877c7d..d86f271d8c7 100644 --- a/examples/cpp/dds/Configurability/CMakeLists.txt +++ b/examples/cpp/dds/Configurability/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -47,7 +47,7 @@ target_compile_definitions(DDSConfigurabilityPublisher PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSConfigurabilityPublisher fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSConfigurabilityPublisher fastdds fastcdr foonathan_memory) install(TARGETS DDSConfigurabilityPublisher RUNTIME DESTINATION examples/cpp/dds/Configurability/${BIN_INSTALL_DIR} ) @@ -57,7 +57,7 @@ target_compile_definitions(DDSConfigurabilitySubscriber PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSConfigurabilitySubscriber fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSConfigurabilitySubscriber fastdds fastcdr foonathan_memory) install(TARGETS DDSConfigurabilitySubscriber RUNTIME DESTINATION examples/cpp/dds/Configurability/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/Configurability/ConfigurabilityPublisher.cpp b/examples/cpp/dds/Configurability/ConfigurabilityPublisher.cpp index 608ad437ec7..26b13df5869 100644 --- a/examples/cpp/dds/Configurability/ConfigurabilityPublisher.cpp +++ b/examples/cpp/dds/Configurability/ConfigurabilityPublisher.cpp @@ -1,8 +1,8 @@ /*** - * Use Case Demonstrator for eProsima Fast RTPS + * Use Case Demonstrator for eProsima Fast DDS * -------------------------------------------- * - * This is an interactive program designed to show the effect of different configuration parameters on the behaviour of eProsima Fast RTPS + * This is an interactive program designed to show the effect of different configuration parameters on the behaviour of eProsima Fast DDS * ***/ diff --git a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp index 6c5f7702357..4094a972244 100644 --- a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp +++ b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp @@ -1,8 +1,8 @@ /*** - * Use Case Demonstrator for eProsima Fast RTPS + * Use Case Demonstrator for eProsima Fast DDS * -------------------------------------------- * - * This is an interactive program designed to show the effect of different configuration parameters on the behaviour of eProsima Fast RTPS + * This is an interactive program designed to show the effect of different configuration parameters on the behaviour of eProsima Fast DDS * ***/ @@ -363,7 +363,7 @@ int main() } else if ( c == std::string("r")) { - while (EarlyReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (EarlyReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << "Sample Received! Index:" << std::to_string(my_sample.index()) << " Key:" << std::to_string(my_sample.key_value()) << std::endl; diff --git a/examples/cpp/dds/Configurability/sample.cxx b/examples/cpp/dds/Configurability/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/Configurability/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sample.h b/examples/cpp/dds/Configurability/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/Configurability/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sample.hpp b/examples/cpp/dds/Configurability/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/Configurability/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.hpp b/examples/cpp/dds/Configurability/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.hpp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.ipp b/examples/cpp/dds/Configurability/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.ipp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.h b/examples/cpp/dds/Configurability/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.h +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Configurability/samplev1.cxx b/examples/cpp/dds/Configurability/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/Configurability/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Configurability/samplev1.h b/examples/cpp/dds/Configurability/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/Configurability/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt index abbbc4f3c0d..0eb3d11b4fc 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt +++ b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() message(STATUS "Configuring ContentFilterTopic examples...") @@ -31,10 +31,8 @@ set(CFT_COMMON_SOURCES ContentFilteredTopicExample_main.cpp ContentFilteredTopicExamplePublisher.cpp ContentFilteredTopicExampleSubscriber.cpp - HelloWorld.cxx - HelloWorldv1.cxx HelloWorldPubSubTypes.cxx - HelloWorldTypeObject.cxx + HelloWorldTypeObjectSupport.cxx ) add_executable(DDSContentFilteredTopicExample ${CFT_COMMON_SOURCES}) @@ -43,6 +41,6 @@ target_compile_definitions(DDSContentFilteredTopicExample PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_compile_features(DDSContentFilteredTopicExample PRIVATE cxx_std_11) -target_link_libraries(DDSContentFilteredTopicExample fastrtps fastcdr fastdds::optionparser) +target_link_libraries(DDSContentFilteredTopicExample fastdds fastcdr fastdds::optionparser) install(TARGETS DDSContentFilteredTopicExample RUNTIME DESTINATION examples/cpp/dds/ContentFilteredTopicExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp index f1419c701e7..77e35423bce 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp @@ -29,16 +29,12 @@ #include #include -#include "HelloWorldTypeObject.h" +#include "HelloWorldTypeObjectSupport.hpp" using namespace eprosima::fastdds::dds; bool ContentFilteredTopicExamplePublisher::init() { - // The default filter class requires the TypeObject to be registered - // (see https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/topic/contentFilteredTopic/createContentFilteredTopic.html) - registerHelloWorldTypes(); - // Initialize internal variables matched_ = 0; diff --git a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp index 1a91342c43c..b116074dfe4 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp @@ -27,17 +27,13 @@ #include #include -#include "HelloWorldTypeObject.h" +#include "HelloWorldTypeObjectSupport.hpp" using namespace eprosima::fastdds::dds; bool ContentFilteredTopicExampleSubscriber::init( bool custom_filter) { - // The default filter class requires the TypeObject to be registered - // (see https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/topic/contentFilteredTopic/createContentFilteredTopic.html) - registerHelloWorldTypes(); - // Initialize internal variables matched_ = 0; @@ -55,7 +51,7 @@ bool ContentFilteredTopicExampleSubscriber::init( if (custom_filter) { // Register the filter factory - if (ReturnCode_t::RETCODE_OK != + if (eprosima::fastdds::dds::RETCODE_OK != participant_->register_content_filter_factory("MY_CUSTOM_FILTER", &filter_factory)) { return false; @@ -159,7 +155,7 @@ void ContentFilteredTopicExampleSubscriber::on_data_available( { SampleInfo info; // Take next sample from DataReader's history - if (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&hello_, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == reader->take_next_sample(&hello_, &info)) { // Some samples only update the instance state. Only if it is a valid sample (with data) if (ALIVE_INSTANCE_STATE == info.instance_state) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx deleted file mode 100644 index 502f3953b05..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx deleted file mode 100644 index 69e829c28d7..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorldTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "HelloWorld.h" -#include "HelloWorldTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerHelloWorldTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(true), - GetHelloWorldObject(true)); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(false), - GetHelloWorldObject(false)); - - }); -} - - - -const TypeIdentifier* GetHelloWorldIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetHelloWorldObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); -} - -const TypeObject* GetHelloWorldObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteHelloWorldObject(); - } - //else - return GetMinimalHelloWorldObject(); -} - -const TypeObject* GetMinimalHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_index; - mst_index.common().member_id(memberId++); - mst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_index.common().member_flags().IS_OPTIONAL(false); - mst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_index.common().member_flags().IS_KEY(false); - mst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 index_hash("index"); - for(int i = 0; i < 4; ++i) - { - mst_index.detail().name_hash()[i] = index_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_index); - - MinimalStructMember mst_message; - mst_message.common().member_id(memberId++); - mst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_message.common().member_flags().IS_OPTIONAL(false); - mst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_message.common().member_flags().IS_KEY(false); - mst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 message_hash("message"); - for(int i = 0; i < 4; ++i) - { - mst_message.detail().name_hash()[i] = message_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_message); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); -} - -const TypeObject* GetCompleteHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_index; - cst_index.common().member_id(memberId++); - cst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_index.common().member_flags().IS_OPTIONAL(false); - cst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_index.common().member_flags().IS_KEY(false); - cst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_index.detail().name("index"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_index); - - CompleteStructMember cst_message; - cst_message.common().member_id(memberId++); - cst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_message.common().member_flags().IS_OPTIONAL(false); - cst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_message.common().member_flags().IS_KEY(false); - cst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_message.detail().name("message"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_message); - - - // Header - type_object->complete().struct_type().header().detail().type_name("HelloWorld"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); -} diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h deleted file mode 100644 index 76b2a621eb7..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorldTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HelloWorld_SOURCE) -#define HelloWorld_DllAPI __declspec( dllexport ) -#else -#define HelloWorld_DllAPI __declspec( dllimport ) -#endif // HelloWorld_SOURCE -#else -#define HelloWorld_DllAPI -#endif -#else -#define HelloWorld_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerHelloWorldTypes(); - - - -eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); -eProsima_user_DllExport const TypeObject* GetCompleteHelloWorldObject(); - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx deleted file mode 100644 index bb049241e49..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp index deb86feca93..606a37d3226 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp @@ -22,11 +22,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_parameters Parameters required by the filter * @param filter_instance Instance of the filter to be evaluated * - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the requirements for creating the + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the requirements for creating the * ContentFilteredTopic using this factory are not met - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if the ContentFilteredTopic is correctly created + * eprosima::fastdds::dds::RETCODE_OK if the ContentFilteredTopic is correctly created */ - eprosima::fastrtps::types::ReturnCode_t create_content_filter( + eprosima::fastdds::dds::ReturnCode_t create_content_filter( const char* filter_class_name, // My custom filter class name is 'MY_CUSTOM_FILTER'. const char* type_name, // This custom filter only supports one type: 'HelloWorld'. const eprosima::fastdds::dds::TopicDataType* /*data_type*/, // Not used in this implementation. @@ -41,7 +41,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check that the two mandatory filter parameters were set. 2 != filter_parameters.length()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // If there is an update, delete previous instance. @@ -53,7 +53,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Instantiation of the Custom Filter. filter_instance = new MyCustomFilter(std::stoi(filter_parameters[0]), std::stoi(filter_parameters[1])); - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } /** @@ -62,11 +62,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_class_name Custom filter name * @param filter_instance Instance of the filter to be deleted. * After returning, the passed pointer becomes invalid. - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the instance was created with another + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the instance was created with another * factory - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if correctly deleted + * eprosima::fastdds::dds::RETCODE_OK if correctly deleted */ - eprosima::fastrtps::types::ReturnCode_t delete_content_filter( + eprosima::fastdds::dds::ReturnCode_t delete_content_filter( const char* filter_class_name, eprosima::fastdds::dds::IContentFilter* filter_instance) override { @@ -75,7 +75,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check the filter instance is valid nullptr != filter_instance) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // Deletion of the Custom Filter. @@ -84,7 +84,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto delete(dynamic_cast(filter_instance)); } - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } }; diff --git a/examples/cpp/dds/CustomListenerExample/CMakeLists.txt b/examples/cpp/dds/CustomListenerExample/CMakeLists.txt index 8a9d42515a1..ef062af7ab7 100644 --- a/examples/cpp/dds/CustomListenerExample/CMakeLists.txt +++ b/examples/cpp/dds/CustomListenerExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() # Check C++11 @@ -44,6 +44,6 @@ target_compile_definitions(DDSCustomListenerExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSCustomListenerExample fastrtps fastcdr) +target_link_libraries(DDSCustomListenerExample fastdds fastcdr) install(TARGETS DDSCustomListenerExample RUNTIME DESTINATION examples/cpp/dds/CustomListenerExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/CustomListenerExample/CustomListenerPublisher.cpp b/examples/cpp/dds/CustomListenerExample/CustomListenerPublisher.cpp index f8414ce90dc..b2fa6762663 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListenerPublisher.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListenerPublisher.cpp @@ -18,15 +18,14 @@ */ #include "CustomListenerPublisher.h" -#include -#include + +#include + #include -#include -#include #include +#include #include - -#include +#include using namespace eprosima::fastdds::dds; diff --git a/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.cpp b/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.cpp index bd685482f66..b3940eafef0 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.cpp @@ -18,15 +18,14 @@ */ #include "CustomListenerSubscriber.h" -#include -#include + +#include + #include -#include #include -#include #include - -#include +#include +#include using namespace eprosima::fastdds::dds; diff --git a/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.h b/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.h index 6c3cbf44830..d5a31f44bd8 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.h +++ b/examples/cpp/dds/CustomListenerExample/CustomListenerSubscriber.h @@ -20,13 +20,13 @@ #ifndef CUSTOMLISTENERSUBSCRIBER_H_ #define CUSTOMLISTENERSUBSCRIBER_H_ -#include "TopicPubSubTypes.h" -#include "CustomListeners.h" - +#include #include #include -#include -#include +#include + +#include "CustomListeners.h" +#include "TopicPubSubTypes.h" class CustomListenerSubscriber { diff --git a/examples/cpp/dds/CustomListenerExample/CustomListener_main.cpp b/examples/cpp/dds/CustomListenerExample/CustomListener_main.cpp index c38282a8de4..907a44b5835 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListener_main.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListener_main.cpp @@ -17,15 +17,13 @@ * */ +#include +#include + #include "CustomListenerPublisher.h" #include "CustomListenerSubscriber.h" #include "CustomListeners.h" - -#include - -#include - using eprosima::fastdds::dds::Log; int main( diff --git a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp index b18b4dbf3bd..a2cdd135856 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp @@ -18,25 +18,21 @@ */ #include "CustomListeners.h" -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include +#include #include +#include #include - -#include +#include +#include +#include +#include +#include using namespace eprosima::fastdds::dds; - void CustomDataWriterListener::on_publication_matched( DataWriter*, const PublicationMatchedStatus& info) @@ -84,7 +80,7 @@ void CustomDataReaderListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -152,7 +148,7 @@ void CustomDomainParticipantListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/CustomListenerExample/CustomListeners.h b/examples/cpp/dds/CustomListenerExample/CustomListeners.h index 701bfdb2079..12ef7c514ff 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListeners.h +++ b/examples/cpp/dds/CustomListenerExample/CustomListeners.h @@ -20,24 +20,18 @@ #ifndef CUSTOMLISTENERS_H_ #define CUSTOMLISTENERS_H_ -#include "TopicPubSubTypes.h" - -#include -#include -#include +#include #include - +#include +#include #include - +#include +#include #include +#include +#include -#include -#include -#include - -#include -#include - +#include "TopicPubSubTypes.h" class CustomDataWriterListener : public eprosima::fastdds::dds::DataWriterListener { diff --git a/examples/cpp/dds/CustomListenerExample/Topic.cxx b/examples/cpp/dds/CustomListenerExample/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topic.h b/examples/cpp/dds/CustomListenerExample/Topic.h deleted file mode 100644 index 2596f317a1e..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topic.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Topicv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topic.hpp b/examples/cpp/dds/CustomListenerExample/Topic.hpp new file mode 100644 index 00000000000..8f86884c2b8 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/Topic.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Topic.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ + + diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h index b9100bacbe9..0b37b3746f3 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.cxx b/examples/cpp/dds/CustomListenerExample/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.h b/examples/cpp/dds/CustomListenerExample/Topicv1.h deleted file mode 100644 index e06f22b7e2b..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CMakeLists.txt b/examples/cpp/dds/CustomPayloadPoolExample/CMakeLists.txt index 1b61ca13b7e..adecbdaeb26 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CMakeLists.txt +++ b/examples/cpp/dds/CustomPayloadPoolExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(CustomPayloadPoolExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(CustomPayloadPoolExample fastrtps fastcdr fastdds::optionparser) +target_link_libraries(CustomPayloadPoolExample fastdds fastcdr fastdds::optionparser) install(TARGETS CustomPayloadPoolExample RUNTIME DESTINATION examples/cpp/dds/CustomPayloadPoolExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx deleted file mode 100644 index 7f304177d38..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CustomPayloadPoolData.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CustomPayloadPoolData.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -CustomPayloadPoolData::CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::~CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::CustomPayloadPoolData( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -CustomPayloadPoolData::CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - const CustomPayloadPoolData& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - CustomPayloadPoolData&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool CustomPayloadPoolData::operator ==( - const CustomPayloadPoolData& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool CustomPayloadPoolData::operator !=( - const CustomPayloadPoolData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void CustomPayloadPoolData::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t CustomPayloadPoolData::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& CustomPayloadPoolData::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void CustomPayloadPoolData::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void CustomPayloadPoolData::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& CustomPayloadPoolData::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& CustomPayloadPoolData::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "CustomPayloadPoolDataCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h deleted file mode 100644 index 46b1c16c138..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CustomPayloadPoolData.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "CustomPayloadPoolDatav1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ -#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CUSTOMPAYLOADPOOLDATA_SOURCE) -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllexport ) -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllimport ) -#endif // CUSTOMPAYLOADPOOLDATA_SOURCE -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. - * @ingroup CustomPayloadPoolData - */ -class CustomPayloadPoolData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CustomPayloadPoolData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CustomPayloadPoolData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - const CustomPayloadPoolData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - const CustomPayloadPoolData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CustomPayloadPoolData& x) const; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CustomPayloadPoolData& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp new file mode 100644 index 00000000000..19136a331f9 --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CustomPayloadPoolData.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ +#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CUSTOMPAYLOADPOOLDATA_SOURCE) +#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllexport ) +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllimport ) +#endif // CUSTOMPAYLOADPOOLDATA_SOURCE +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. + * @ingroup CustomPayloadPoolData + */ +class CustomPayloadPoolData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CustomPayloadPoolData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CustomPayloadPoolData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData( + const CustomPayloadPoolData& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData( + CustomPayloadPoolData&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData& operator =( + const CustomPayloadPoolData& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData& operator =( + CustomPayloadPoolData&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CustomPayloadPoolData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CustomPayloadPoolData& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x CustomPayloadPoolData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CustomPayloadPoolData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ + + diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp index 3d50c83da22..926bf7ea3d7 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ #define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ -#include "CustomPayloadPoolData.h" +#include "CustomPayloadPoolData.hpp" constexpr uint32_t CustomPayloadPoolData_max_cdr_typesize {268UL}; constexpr uint32_t CustomPayloadPoolData_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const CustomPayloadPoolData& data); diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp index 0fb2b162fb2..89f2aaad27d 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx index ffd0e7faa97..3133c1d0b6c 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "CustomPayloadPoolDataPubSubTypes.h" +#include #include -#include "CustomPayloadPoolDataPubSubTypes.h" #include "CustomPayloadPoolDataCdrAux.hpp" +#include "CustomPayloadPoolDataTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - CustomPayloadPoolDataPubSubType::CustomPayloadPoolDataPubSubType() { setName("CustomPayloadPoolData"); @@ -219,3 +219,11 @@ bool CustomPayloadPoolDataPubSubType::getKey( return true; } +void CustomPayloadPoolDataPubSubType::register_type_object_representation() const +{ + register_CustomPayloadPoolData_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "CustomPayloadPoolDataCdrAux.ipp" diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h index a8ae92cfc06..92ce3732bea 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "CustomPayloadPoolData.h" +#include "CustomPayloadPoolData.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type CustomPayloadPoolData defined by the user in the IDL file. * @ingroup CustomPayloadPoolData @@ -90,6 +88,9 @@ class CustomPayloadPoolDataPubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPublisher.cpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPublisher.cpp index 866a7364bc4..4fa276efbfb 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPublisher.cpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPublisher.cpp @@ -17,19 +17,16 @@ * */ -#include -#include - #include "CustomPayloadPoolDataPublisher.h" +#include +#include + #include #include +#include #include #include -#include -#include -#include - using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp index 5dc610964ac..ab35a8684e0 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp @@ -17,17 +17,15 @@ * */ -#include - #include "CustomPayloadPoolDataSubscriber.h" +#include + #include -#include #include +#include #include #include -#include -#include using namespace eprosima::fastdds::dds; @@ -151,7 +149,7 @@ void CustomPayloadPoolDataSubscriber::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.h index ab1ab59039d..7179f216fba 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.h @@ -23,13 +23,13 @@ #include #include -#include "CustomPayloadPoolDataPubSubTypes.h" -#include "CustomPayloadPool.hpp" - #include #include #include -#include +#include + +#include "CustomPayloadPool.hpp" +#include "CustomPayloadPoolDataPubSubTypes.h" class CustomPayloadPoolDataSubscriber : private eprosima::fastdds::dds::DataReaderListener { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx new file mode 100644 index 00000000000..9491872d4ac --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CustomPayloadPoolDataTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "CustomPayloadPoolDataTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CustomPayloadPoolData.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_CustomPayloadPoolData_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_CustomPayloadPoolData_type_identifier(); + + }); +} + +void register_CustomPayloadPoolData_type_identifier() +{ + { + StructTypeFlag struct_flags_CustomPayloadPoolData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_CustomPayloadPoolData; + TypeIdentifierPair type_ids_CustomPayloadPoolData; + QualifiedTypeName type_name_CustomPayloadPoolData = "CustomPayloadPoolData"; + eprosima::fastcdr::optional type_ann_builtin_CustomPayloadPoolData; + eprosima::fastcdr::optional ann_custom_CustomPayloadPoolData; + CompleteTypeDetail detail_CustomPayloadPoolData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_CustomPayloadPoolData, ann_custom_CustomPayloadPoolData, type_name_CustomPayloadPoolData.to_string()); + CompleteStructHeader header_CustomPayloadPoolData; + header_CustomPayloadPoolData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_CustomPayloadPoolData); + CompleteStructMemberSeq member_seq_CustomPayloadPoolData; + { + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_CustomPayloadPoolData); + + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1()._d() || TK_NONE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_CustomPayloadPoolData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_CustomPayloadPoolData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_CustomPayloadPoolData.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_CustomPayloadPoolData); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_CustomPayloadPoolData, member_index); + } + { + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CustomPayloadPoolData); + + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CustomPayloadPoolData); + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1()._d() || TK_NONE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_CustomPayloadPoolData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_CustomPayloadPoolData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_CustomPayloadPoolData.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_CustomPayloadPoolData); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_CustomPayloadPoolData, member_message); + } + CompleteStructType struct_type_CustomPayloadPoolData = TypeObjectUtils::build_complete_struct_type(struct_flags_CustomPayloadPoolData, header_CustomPayloadPoolData, member_seq_CustomPayloadPoolData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_CustomPayloadPoolData, type_name_CustomPayloadPoolData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "CustomPayloadPoolData already registered in TypeObjectRegistry for a different type."); + } + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "CustomPayloadPoolData", type_ids_CustomPayloadPoolData); + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "CustomPayloadPoolData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp new file mode 100644 index 00000000000..adc9d80573a --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CustomPayloadPoolDataTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_CustomPayloadPoolData_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register CustomPayloadPoolData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_CustomPayloadPoolData_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx deleted file mode 100644 index 51f45ea225f..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CustomPayloadPoolData.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CustomPayloadPoolData.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define CustomPayloadPoolData_max_cdr_typesize 268ULL; - - - - -CustomPayloadPoolData::CustomPayloadPoolData() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -CustomPayloadPoolData::~CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::CustomPayloadPoolData( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -CustomPayloadPoolData::CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool CustomPayloadPoolData::operator ==( - const CustomPayloadPoolData& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool CustomPayloadPoolData::operator !=( - const CustomPayloadPoolData& x) const -{ - return !(*this == x); -} - -size_t CustomPayloadPoolData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return CustomPayloadPoolData_max_cdr_typesize; -} - -size_t CustomPayloadPoolData::getCdrSerializedSize( - const CustomPayloadPoolData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void CustomPayloadPoolData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void CustomPayloadPoolData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool CustomPayloadPoolData::isKeyDefined() -{ - return false; -} - -void CustomPayloadPoolData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void CustomPayloadPoolData::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t CustomPayloadPoolData::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& CustomPayloadPoolData::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void CustomPayloadPoolData::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void CustomPayloadPoolData::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& CustomPayloadPoolData::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& CustomPayloadPoolData::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h deleted file mode 100644 index 1779f3b76d7..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file CustomPayloadPoolData.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ -#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CUSTOMPAYLOADPOOLDATA_SOURCE) -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllexport ) -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllimport ) -#endif // CUSTOMPAYLOADPOOLDATA_SOURCE -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. - * @ingroup CustomPayloadPoolData - */ -class CustomPayloadPoolData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CustomPayloadPoolData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CustomPayloadPoolData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - const CustomPayloadPoolData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - const CustomPayloadPoolData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CustomPayloadPoolData& x) const; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CustomPayloadPoolData& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const CustomPayloadPoolData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPool_main.cpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPool_main.cpp index da78c8a224c..fd9f9db33ab 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPool_main.cpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPool_main.cpp @@ -20,14 +20,13 @@ #include #include -#include "CustomPayloadPoolDataPublisher.h" -#include "CustomPayloadPoolDataSubscriber.h" - #include -#include - +#include #include +#include "CustomPayloadPoolDataPublisher.h" +#include "CustomPayloadPoolDataSubscriber.h" + using eprosima::fastdds::dds::Log; namespace option = eprosima::option; diff --git a/examples/cpp/dds/DeadlineQoSExample/CMakeLists.txt b/examples/cpp/dds/DeadlineQoSExample/CMakeLists.txt index 4a5f3ba2af1..3713e6e2b83 100644 --- a/examples/cpp/dds/DeadlineQoSExample/CMakeLists.txt +++ b/examples/cpp/dds/DeadlineQoSExample/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSDeadlineQoSExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSDeadlineQoSExample fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSDeadlineQoSExample fastdds fastcdr foonathan_memory) if(UNIX AND NOT(QNXNTO) AND NOT(ANDROID)) target_link_libraries(DDSDeadlineQoSExample pthread) endif() diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx deleted file mode 100644 index ded92f4bcdc..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file deadlinepayload.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "deadlinepayload.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloMsg::HelloMsg() -{ -} - -HelloMsg::~HelloMsg() -{ -} - -HelloMsg::HelloMsg( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - m_payload = x.m_payload; -} - -HelloMsg::HelloMsg( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - m_payload = std::move(x.m_payload); -} - -HelloMsg& HelloMsg::operator =( - const HelloMsg& x) -{ - - m_deadlinekey = x.m_deadlinekey; - m_payload = x.m_payload; - return *this; -} - -HelloMsg& HelloMsg::operator =( - HelloMsg&& x) noexcept -{ - - m_deadlinekey = x.m_deadlinekey; - m_payload = std::move(x.m_payload); - return *this; -} - -bool HelloMsg::operator ==( - const HelloMsg& x) const -{ - return (m_deadlinekey == x.m_deadlinekey && - m_payload == x.m_payload); -} - -bool HelloMsg::operator !=( - const HelloMsg& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ -void HelloMsg::deadlinekey( - uint16_t _deadlinekey) -{ - m_deadlinekey = _deadlinekey; -} - -/*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ -uint16_t HelloMsg::deadlinekey() const -{ - return m_deadlinekey; -} - -/*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ -uint16_t& HelloMsg::deadlinekey() -{ - return m_deadlinekey; -} - - -/*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ -void HelloMsg::payload( - const eprosima::fastcdr::fixed_string<256>& _payload) -{ - m_payload = _payload; -} - -/*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ -void HelloMsg::payload( - eprosima::fastcdr::fixed_string<256>&& _payload) -{ - m_payload = std::move(_payload); -} - -/*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ -const eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() const -{ - return m_payload; -} - -/*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ -eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() -{ - return m_payload; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "deadlinepayloadCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h deleted file mode 100644 index 4dd530394b2..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file deadlinepayload.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "deadlinepayloadv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ -#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DEADLINEPAYLOAD_SOURCE) -#define DEADLINEPAYLOAD_DllAPI __declspec( dllexport ) -#else -#define DEADLINEPAYLOAD_DllAPI __declspec( dllimport ) -#endif // DEADLINEPAYLOAD_SOURCE -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloMsg defined by the user in the IDL file. - * @ingroup deadlinepayload - */ -class HelloMsg -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloMsg(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloMsg(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - const HelloMsg& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - HelloMsg&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - const HelloMsg& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - HelloMsg&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloMsg& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloMsg& x) const; - - /*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ - eProsima_user_DllExport void deadlinekey( - uint16_t _deadlinekey); - - /*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ - eProsima_user_DllExport uint16_t deadlinekey() const; - - /*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ - eProsima_user_DllExport uint16_t& deadlinekey(); - - - /*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ - eProsima_user_DllExport void payload( - const eprosima::fastcdr::fixed_string<256>& _payload); - - /*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ - eProsima_user_DllExport void payload( - eprosima::fastcdr::fixed_string<256>&& _payload); - - /*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<256>& payload() const; - - /*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<256>& payload(); - -private: - - uint16_t m_deadlinekey{0}; - eprosima::fastcdr::fixed_string<256> m_payload; - -}; - -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp new file mode 100644 index 00000000000..e46adfefb01 --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file deadlinepayload.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ +#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DEADLINEPAYLOAD_SOURCE) +#define DEADLINEPAYLOAD_DllAPI __declspec( dllexport ) +#else +#define DEADLINEPAYLOAD_DllAPI __declspec( dllimport ) +#endif // DEADLINEPAYLOAD_SOURCE +#else +#define DEADLINEPAYLOAD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DEADLINEPAYLOAD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloMsg defined by the user in the IDL file. + * @ingroup deadlinepayload + */ +class HelloMsg +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloMsg() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloMsg() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg( + const HelloMsg& x) + { + m_deadlinekey = x.m_deadlinekey; + + m_payload = x.m_payload; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg( + HelloMsg&& x) noexcept + { + m_deadlinekey = x.m_deadlinekey; + m_payload = std::move(x.m_payload); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg& operator =( + const HelloMsg& x) + { + + m_deadlinekey = x.m_deadlinekey; + + m_payload = x.m_payload; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg& operator =( + HelloMsg&& x) noexcept + { + + m_deadlinekey = x.m_deadlinekey; + m_payload = std::move(x.m_payload); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloMsg object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloMsg& x) const + { + return (m_deadlinekey == x.m_deadlinekey && + m_payload == x.m_payload); + } + + /*! + * @brief Comparison operator. + * @param x HelloMsg object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloMsg& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member deadlinekey + * @param _deadlinekey New value for member deadlinekey + */ + eProsima_user_DllExport void deadlinekey( + uint16_t _deadlinekey) + { + m_deadlinekey = _deadlinekey; + } + + /*! + * @brief This function returns the value of member deadlinekey + * @return Value of member deadlinekey + */ + eProsima_user_DllExport uint16_t deadlinekey() const + { + return m_deadlinekey; + } + + /*! + * @brief This function returns a reference to member deadlinekey + * @return Reference to member deadlinekey + */ + eProsima_user_DllExport uint16_t& deadlinekey() + { + return m_deadlinekey; + } + + + /*! + * @brief This function copies the value in member payload + * @param _payload New value to be copied in member payload + */ + eProsima_user_DllExport void payload( + const eprosima::fastcdr::fixed_string<256>& _payload) + { + m_payload = _payload; + } + + /*! + * @brief This function moves the value in member payload + * @param _payload New value to be moved in member payload + */ + eProsima_user_DllExport void payload( + eprosima::fastcdr::fixed_string<256>&& _payload) + { + m_payload = std::move(_payload); + } + + /*! + * @brief This function returns a constant reference to member payload + * @return Constant reference to member payload + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<256>& payload() const + { + return m_payload; + } + + /*! + * @brief This function returns a reference to member payload + * @return Reference to member payload + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<256>& payload() + { + return m_payload; + } + + + +private: + + uint16_t m_deadlinekey{0}; + eprosima::fastcdr::fixed_string<256> m_payload; + +}; + +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ + + diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp index cf5ad3e0bdc..a23da79e9bb 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ #define _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ -#include "deadlinepayload.h" +#include "deadlinepayload.hpp" constexpr uint32_t HelloMsg_max_cdr_typesize {269UL}; constexpr uint32_t HelloMsg_max_key_cdr_typesize {2UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloMsg& data); diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp index a16c0446aab..6dd3947b3c6 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubMain.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubMain.cxx index e47cbdda0c6..47f019ba6ff 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubMain.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubMain.cxx @@ -15,10 +15,6 @@ #include "deadlinepayloadPublisher.h" #include "deadlinepayloadSubscriber.h" - -#include -#include - using namespace eprosima; using namespace eprosima::fastrtps; diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx index 300ac806538..faa25783be9 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "deadlinepayloadPubSubTypes.h" +#include #include -#include "deadlinepayloadPubSubTypes.h" #include "deadlinepayloadCdrAux.hpp" +#include "deadlinepayloadTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloMsgPubSubType::HelloMsgPubSubType() { setName("HelloMsg"); @@ -219,3 +219,11 @@ bool HelloMsgPubSubType::getKey( return true; } +void HelloMsgPubSubType::register_type_object_representation() const +{ + register_deadlinepayload_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "deadlinepayloadCdrAux.ipp" diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h index bc9fceae08e..a49ed543f16 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "deadlinepayload.h" +#include "deadlinepayload.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloMsg defined by the user in the IDL file. * @ingroup deadlinepayload @@ -90,6 +88,9 @@ class HelloMsgPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx index 09d89827bac..0a893426857 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx @@ -124,7 +124,7 @@ void deadlinepayloadSubscriber::SubListener::on_data_available( { SampleInfo info; HelloMsg st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.h index d65f44d76cd..bda26f3e921 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.h @@ -24,15 +24,13 @@ #define _DEADLINEPAYLOAD_SUBSCRIBER_H_ #include -#include #include #include +#include #include #include "deadlinepayloadPubSubTypes.h" -#include "mapableKey.h" - class deadlinepayloadSubscriber { public: diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx new file mode 100644 index 00000000000..4d75ddf0def --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx @@ -0,0 +1,261 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file deadlinepayloadTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "deadlinepayloadTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "deadlinepayload.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_deadlinepayload_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloMsg_type_identifier(); + + }); +} + +void register_HelloMsg_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloMsg = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloMsg; + TypeIdentifierPair type_ids_HelloMsg; + QualifiedTypeName type_name_HelloMsg = "HelloMsg"; + eprosima::fastcdr::optional type_ann_builtin_HelloMsg; + eprosima::fastcdr::optional ann_custom_HelloMsg; + CompleteTypeDetail detail_HelloMsg = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloMsg, ann_custom_HelloMsg, type_name_HelloMsg.to_string()); + CompleteStructHeader header_HelloMsg; + header_HelloMsg = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloMsg); + CompleteStructMemberSeq member_seq_HelloMsg; + { + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_HelloMsg); + + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "deadlinekey Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_deadlinekey = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_deadlinekey; + MemberId member_id_deadlinekey = 0x00000000; + if (EK_COMPLETE == type_ids_HelloMsg.type_identifier1()._d() || TK_NONE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadlinekey = TypeObjectUtils::build_common_struct_member(member_id_deadlinekey, member_flags_deadlinekey, type_ids_HelloMsg.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadlinekey = TypeObjectUtils::build_common_struct_member(member_id_deadlinekey, member_flags_deadlinekey, type_ids_HelloMsg.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure deadlinekey member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadlinekey = "deadlinekey"; + eprosima::fastcdr::optional member_ann_builtin_deadlinekey; + ann_custom_HelloMsg.reset(); + AppliedAnnotationSeq tmp_ann_custom_deadlinekey; + eprosima::fastcdr::optional unit_deadlinekey; + eprosima::fastcdr::optional min_deadlinekey; + eprosima::fastcdr::optional max_deadlinekey; + eprosima::fastcdr::optional hash_id_deadlinekey; + if (unit_deadlinekey.has_value() || min_deadlinekey.has_value() || max_deadlinekey.has_value() || hash_id_deadlinekey.has_value()) + { + member_ann_builtin_deadlinekey = TypeObjectUtils::build_applied_builtin_member_annotations(unit_deadlinekey, min_deadlinekey, max_deadlinekey, hash_id_deadlinekey); + } + if (!tmp_ann_custom_deadlinekey.empty()) + { + ann_custom_HelloMsg = tmp_ann_custom_deadlinekey; + } + CompleteMemberDetail detail_deadlinekey = TypeObjectUtils::build_complete_member_detail(name_deadlinekey, member_ann_builtin_deadlinekey, ann_custom_HelloMsg); + CompleteStructMember member_deadlinekey = TypeObjectUtils::build_complete_struct_member(common_deadlinekey, detail_deadlinekey); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloMsg, member_deadlinekey); + } + { + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_256", type_ids_HelloMsg); + + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_256("TI_STRING8_LARGE"); + if (type_id_kind_anonymous_string_256 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(256); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_256 == "TI_STRING8_LARGE") + { + LBound bound = 256; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256: Unknown String kind."); + return; + } + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_256", type_ids_HelloMsg); + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_payload = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_payload; + MemberId member_id_payload = 0x00000001; + if (EK_COMPLETE == type_ids_HelloMsg.type_identifier1()._d() || TK_NONE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_payload = TypeObjectUtils::build_common_struct_member(member_id_payload, member_flags_payload, type_ids_HelloMsg.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_payload = TypeObjectUtils::build_common_struct_member(member_id_payload, member_flags_payload, type_ids_HelloMsg.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure payload member TypeIdentifier inconsistent."); + return; + } + MemberName name_payload = "payload"; + eprosima::fastcdr::optional member_ann_builtin_payload; + ann_custom_HelloMsg.reset(); + CompleteMemberDetail detail_payload = TypeObjectUtils::build_complete_member_detail(name_payload, member_ann_builtin_payload, ann_custom_HelloMsg); + CompleteStructMember member_payload = TypeObjectUtils::build_complete_struct_member(common_payload, detail_payload); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloMsg, member_payload); + } + CompleteStructType struct_type_HelloMsg = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloMsg, header_HelloMsg, member_seq_HelloMsg); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloMsg, type_name_HelloMsg.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloMsg already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloMsg", type_ids_HelloMsg); + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloMsg: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp new file mode 100644 index 00000000000..ae7ba5c9f0a --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file deadlinepayloadTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_deadlinepayload_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloMsg related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloMsg_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx deleted file mode 100644 index 6e8e3e66443..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file deadlinepayload.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "deadlinepayload.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloMsg_max_cdr_typesize 269ULL; - - - - -HelloMsg::HelloMsg() -{ - // unsigned short m_deadlinekey - m_deadlinekey = 0; - // /type_d() m_payload - - -} - -HelloMsg::~HelloMsg() -{ -} - -HelloMsg::HelloMsg( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = x.m_payload; - -} - -HelloMsg::HelloMsg( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = std::move(x.m_payload); - -} - -HelloMsg& HelloMsg::operator =( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = x.m_payload; - - return *this; -} - -HelloMsg& HelloMsg::operator =( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = std::move(x.m_payload); - - return *this; -} - -bool HelloMsg::operator ==( - const HelloMsg& x) const -{ - return (m_deadlinekey == x.m_deadlinekey && - m_payload == x.m_payload); -} - -bool HelloMsg::operator !=( - const HelloMsg& x) const -{ - return !(*this == x); -} - -size_t HelloMsg::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloMsg_max_cdr_typesize; -} - -size_t HelloMsg::getCdrSerializedSize( - const HelloMsg& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.payload().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloMsg::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_deadlinekey; - - scdr << m_payload.c_str(); - -} - -void HelloMsg::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_deadlinekey; - - - - { - std::string aux; - dcdr >> aux; - m_payload = aux.c_str(); - } - - -} - - -bool HelloMsg::isKeyDefined() -{ - return true; -} - -void HelloMsg::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - scdr << m_deadlinekey; - - -} - -/*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ -void HelloMsg::deadlinekey( - uint16_t _deadlinekey) -{ - m_deadlinekey = _deadlinekey; -} - -/*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ -uint16_t HelloMsg::deadlinekey() const -{ - return m_deadlinekey; -} - -/*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ -uint16_t& HelloMsg::deadlinekey() -{ - return m_deadlinekey; -} - - -/*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ -void HelloMsg::payload( - const eprosima::fastrtps::fixed_string<256>& _payload) -{ - m_payload = _payload; -} - -/*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ -void HelloMsg::payload( - eprosima::fastrtps::fixed_string<256>&& _payload) -{ - m_payload = std::move(_payload); -} - -/*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ -const eprosima::fastrtps::fixed_string<256>& HelloMsg::payload() const -{ - return m_payload; -} - -/*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ -eprosima::fastrtps::fixed_string<256>& HelloMsg::payload() -{ - return m_payload; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h deleted file mode 100644 index 1711ff83a06..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file deadlinepayload.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ -#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DEADLINEPAYLOAD_SOURCE) -#define DEADLINEPAYLOAD_DllAPI __declspec( dllexport ) -#else -#define DEADLINEPAYLOAD_DllAPI __declspec( dllimport ) -#endif // DEADLINEPAYLOAD_SOURCE -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloMsg defined by the user in the IDL file. - * @ingroup deadlinepayload - */ -class HelloMsg -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloMsg(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloMsg(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - const HelloMsg& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - HelloMsg&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - const HelloMsg& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - HelloMsg&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloMsg& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloMsg& x) const; - - /*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ - eProsima_user_DllExport void deadlinekey( - uint16_t _deadlinekey); - - /*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ - eProsima_user_DllExport uint16_t deadlinekey() const; - - /*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ - eProsima_user_DllExport uint16_t& deadlinekey(); - - - /*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ - eProsima_user_DllExport void payload( - const eprosima::fastrtps::fixed_string<256>& _payload); - - /*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ - eProsima_user_DllExport void payload( - eprosima::fastrtps::fixed_string<256>&& _payload); - - /*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<256>& payload() const; - - /*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<256>& payload(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloMsg& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_deadlinekey; - eprosima::fastrtps::fixed_string<256> m_payload; - -}; - - -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/mapableKey.h b/examples/cpp/dds/DeadlineQoSExample/mapableKey.h deleted file mode 100644 index 4b34b059f79..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/mapableKey.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef MAPABLEKEY_H_ -#define MAPABLEKEY_H_ - -#include -#include -#include -#include - -#include - -typedef struct ex_mapableKey -{ - - eprosima::fastrtps::rtps::octet value[16]; - - ex_mapableKey& operator =( - const eprosima::fastrtps::rtps::InstanceHandle_t& ihandle) - { - for (uint8_t i = 0; i < 16; i++) - { - value[i] = ihandle.value[i]; - } - return *this; - } - -}mapable_key; - -inline bool operator <( - const ex_mapableKey& ex_mapableKey1, - const ex_mapableKey& ex_mapableKey2) -{ - for (uint8_t i = 0; i < 16; ++i) - { - if (ex_mapableKey1.value[i] < ex_mapableKey2.value[i]) - { - return true; - } - } - return false; -} - -#endif // ifndef MAPABLEKEY_H_ diff --git a/examples/cpp/dds/DisablePositiveACKs/CMakeLists.txt b/examples/cpp/dds/DisablePositiveACKs/CMakeLists.txt index 3dc4e941b59..8ad0336e19a 100644 --- a/examples/cpp/dds/DisablePositiveACKs/CMakeLists.txt +++ b/examples/cpp/dds/DisablePositiveACKs/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -44,6 +44,6 @@ target_compile_definitions(DDSDisablePositiveACKs PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSDisablePositiveACKs fastrtps fastcdr) +target_link_libraries(DDSDisablePositiveACKs fastdds fastcdr) install(TARGETS DDSDisablePositiveACKs RUNTIME DESTINATION examples/cpp/dds/DisablePositiveACKs/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKS_main.cpp b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKS_main.cpp index e4afc17ea12..3ec4fe51f69 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKS_main.cpp +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKS_main.cpp @@ -20,13 +20,14 @@ #include "DisablePositiveACKsPublisher.h" #include "DisablePositiveACKsSubscriber.h" -#include -#include +#include using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; + /** * @brief Parses command line arguments * @param argc Number of command line arguments @@ -182,7 +183,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h index 694f227fec9..8c0aa046795 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h @@ -20,7 +20,7 @@ #ifndef DisablePositiveACKsPublisher_H_ #define DisablePositiveACKsPublisher_H_ -#include "Topic.h" +#include "Topic.hpp" #include "TopicPubSubTypes.h" #include diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp index 72186e17663..38569a7fb77 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp @@ -129,7 +129,7 @@ void DisablePositiveACKsSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h index 0d383c77717..7423e10579d 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h @@ -20,8 +20,8 @@ #ifndef DisablePositiveACKsSubscriber_H_ #define DisablePositiveACKsSubscriber_H_ +#include "Topic.hpp" #include "TopicPubSubTypes.h" -#include "Topic.h" #include #include diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.h b/examples/cpp/dds/DisablePositiveACKs/Topic.h deleted file mode 100644 index 2596f317a1e..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Topicv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.hpp b/examples/cpp/dds/DisablePositiveACKs/Topic.hpp new file mode 100644 index 00000000000..8f86884c2b8 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Topic.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ + + diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h index b9100bacbe9..0b37b3746f3 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx b/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.h b/examples/cpp/dds/DisablePositiveACKs/Topicv1.h deleted file mode 100644 index e06f22b7e2b..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/CMakeLists.txt b/examples/cpp/dds/DiscoveryServerExample/CMakeLists.txt index 5c09eaaad0f..035ff741189 100644 --- a/examples/cpp/dds/DiscoveryServerExample/CMakeLists.txt +++ b/examples/cpp/dds/DiscoveryServerExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -44,6 +44,6 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(${PROJECT_NAME} fastrtps fastcdr fastdds::optionparser) +target_link_libraries(${PROJECT_NAME} fastdds fastcdr fastdds::optionparser) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION examples/cpp/dds/${PROJECT_NAME}/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp index 32c6770f1a5..d3063562aad 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp @@ -17,6 +17,8 @@ * */ +#include "DiscoveryServerPublisher.h" + #include #include @@ -30,11 +32,7 @@ #include #include #include -#include -#include -#include - -#include "DiscoveryServerPublisher.h" +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -257,8 +255,10 @@ void HelloWorldPublisher::PubListener::on_publication_matched( void HelloWorldPublisher::PubListener::on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Discovered Participant with GUID " << info.info.m_guid << std::endl; diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h index 82bbfd6ee47..2ddb09baba9 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h @@ -101,7 +101,8 @@ class HelloWorldPublisher //! Callback executed when a DomainParticipant is discovered, dropped or removed void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; private: diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp index 7b71826790d..4992b318014 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp @@ -17,6 +17,8 @@ * */ +#include "DiscoveryServerServer.h" + #include #include #include @@ -24,13 +26,10 @@ #include #include -#include -#include #include #include -#include - -#include "DiscoveryServerServer.h" +#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -251,8 +250,10 @@ DiscoveryServer::~DiscoveryServer() void DiscoveryServer::ServerListener::on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Discovered Participant with GUID " << info.info.m_guid << std::endl; diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h index 566dd904826..8b96f66a26f 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h @@ -83,7 +83,8 @@ class DiscoveryServer //! Callback executed when a DomainParticipant is discovered, dropped or removed void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; private: diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp index 9051bac5b5f..b3d65084678 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp @@ -17,6 +17,8 @@ * */ +#include "DiscoveryServerSubscriber.h" + #include #include #include @@ -27,15 +29,11 @@ #include #include #include -#include -#include #include #include -#include -#include -#include - -#include "DiscoveryServerSubscriber.h" +#include +#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -277,7 +275,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -294,8 +292,10 @@ void HelloWorldSubscriber::SubListener::on_data_available( void HelloWorldSubscriber::SubListener::on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Discovered Participant with GUID " << info.info.m_guid << std::endl; diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h index 21cfed4832f..44e6066bd53 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h @@ -108,7 +108,8 @@ class HelloWorldSubscriber //! Callback executed when a DomainParticipant is discovered, dropped or removed void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; private: diff --git a/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h b/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h index 29f1acdd40f..411ef048a33 100644 --- a/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h +++ b/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "common.h" diff --git a/examples/cpp/dds/DiscoveryServerExample/common.h b/examples/cpp/dds/DiscoveryServerExample/common.h index 5ef51a62ff4..24bdf99aa6b 100644 --- a/examples/cpp/dds/DiscoveryServerExample/common.h +++ b/examples/cpp/dds/DiscoveryServerExample/common.h @@ -21,7 +21,7 @@ #define _EPROSIMA_FASTDDS_EXAMPLES_CPP_DDS_DISCOVERYSERVEREXAMPLE_COMMON_H_ #include -#include +#include enum class TransportKind { diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DynamicHelloWorldExample/CMakeLists.txt b/examples/cpp/dds/DynamicHelloWorldExample/CMakeLists.txt index b5b42c636a0..8e80ce0a115 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/CMakeLists.txt +++ b/examples/cpp/dds/DynamicHelloWorldExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSDynamicHelloWorldExample PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSDynamicHelloWorldExample fastrtps fastcdr) +target_link_libraries(DDSDynamicHelloWorldExample fastdds fastcdr) install(TARGETS DDSDynamicHelloWorldExample RUNTIME DESTINATION examples/cpp/dds/DynamicHelloWorldExample/${BIN_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/helloworld_example_type_profile.xml diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp index 567653d7a30..d5c6f93a514 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp @@ -18,20 +18,18 @@ */ #include "HelloWorldPublisher.h" -#include -#include -#include -#include -#include -#include -#include - -#include - -#include #include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace eprosima::fastdds::dds; HelloWorldPublisher::HelloWorldPublisher() @@ -42,8 +40,8 @@ HelloWorldPublisher::HelloWorldPublisher() bool HelloWorldPublisher::init() { - if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK != - eprosima::fastrtps::xmlparser::XMLProfileManager::loadXMLFile("helloworld_example_type_profile.xml")) + if (RETCODE_OK != + DomainParticipantFactory::get_instance()->load_XML_profiles_file("helloworld_example_type_profile.xml")) { std::cout << "Cannot open XML file \"helloworld_example_type_profile.xml\". Please, run the publisher from the folder " @@ -51,25 +49,21 @@ bool HelloWorldPublisher::init() return false; } - eprosima::fastrtps::types::DynamicType_ptr dyn_type = - eprosima::fastrtps::xmlparser::XMLProfileManager::getDynamicTypeByName("HelloWorld")->build(); - TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - m_Hello = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(dyn_type); + DynamicType::_ref_type dyn_type; + if (RETCODE_OK != + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", + dyn_type)) + { + std::cout << + "Error getting dynamic type \"HelloWorld\"." << std::endl; + return false; + } - m_Hello->set_string_value("Hello DDS Dynamic World", 0); - m_Hello->set_uint32_value(0, 1); - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); - array->set_uint32_value(10, array->get_array_index({0, 0})); - array->set_uint32_value(20, array->get_array_index({1, 0})); - array->set_uint32_value(30, array->get_array_index({2, 0})); - array->set_uint32_value(40, array->get_array_index({3, 0})); - array->set_uint32_value(50, array->get_array_index({4, 0})); - array->set_uint32_value(60, array->get_array_index({0, 1})); - array->set_uint32_value(70, array->get_array_index({1, 1})); - array->set_uint32_value(80, array->get_array_index({2, 1})); - array->set_uint32_value(90, array->get_array_index({3, 1})); - array->set_uint32_value(100, array->get_array_index({4, 1})); - m_Hello->return_loaned_value(array); + TypeSupport m_type(new DynamicPubSubType(dyn_type)); + m_Hello = DynamicDataFactory::get_instance()->create_data(dyn_type); + m_Hello->set_string_value(m_Hello->get_member_id_by_name("message"), "Hello DDS Dynamic World"); + m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), 0); + m_Hello->set_uint32_values(m_Hello->get_member_id_by_name("array"), {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}); DomainParticipantQos pqos; pqos.name("Participant_pub"); @@ -81,8 +75,8 @@ bool HelloWorldPublisher::init() } //REGISTER THE TYPE + //TODO(Xtypes) this property will be removed m_type.get()->auto_fill_type_information(false); - m_type.get()->auto_fill_type_object(true); m_type.register_type(mp_participant); @@ -94,7 +88,7 @@ bool HelloWorldPublisher::init() return false; } - topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", "HelloWorld", TOPIC_QOS_DEFAULT); + topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", m_type->getName(), TOPIC_QOS_DEFAULT); if (topic_ == nullptr) { @@ -163,23 +157,23 @@ void HelloWorldPublisher::runThread( if (publish(false)) { std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); + m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message")); + uint32_t index {0}; + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + UInt32Seq array; + m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array")); std::string aux_array = "["; - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); + for (uint32_t i = 0; i < 5; ++i) { aux_array += "["; for (uint32_t j = 0; j < 2; ++j) { - uint32_t elem; - array->get_uint32_value(elem, array->get_array_index({i, j})); - aux_array += std::to_string(elem) + (j == 1 ? "]" : ", "); + aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", "); } aux_array += (i == 4 ? "]" : "], "); } - m_Hello->return_loaned_value(array); + std::cout << "Message: " << message << " with index: " << index << " array: " << aux_array << " SENT" << std::endl; } @@ -197,23 +191,23 @@ void HelloWorldPublisher::runThread( else { std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); + m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message")); + uint32_t index {0}; + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + UInt32Seq array; + m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array")); std::string aux_array = "["; - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); + for (uint32_t i = 0; i < 5; ++i) { aux_array += "["; for (uint32_t j = 0; j < 2; ++j) { - uint32_t elem; - array->get_uint32_value(elem, array->get_array_index({i, j})); - aux_array += std::to_string(elem) + (j == 1 ? "]" : ", "); + aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", "); } aux_array += (i == 4 ? "]" : "], "); } - m_Hello->return_loaned_value(array); + std::cout << "Message: " << message << " with index: " << index << " array: " << aux_array << " SENT" << std::endl; } @@ -247,23 +241,13 @@ bool HelloWorldPublisher::publish( if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0) { uint32_t index; - m_Hello->get_uint32_value(index, 1); - m_Hello->set_uint32_value(index + 1, 1); - - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); - array->set_uint32_value(10 + index, array->get_array_index({0, 0})); - array->set_uint32_value(20 + index, array->get_array_index({1, 0})); - array->set_uint32_value(30 + index, array->get_array_index({2, 0})); - array->set_uint32_value(40 + index, array->get_array_index({3, 0})); - array->set_uint32_value(50 + index, array->get_array_index({4, 0})); - array->set_uint32_value(60 + index, array->get_array_index({0, 1})); - array->set_uint32_value(70 + index, array->get_array_index({1, 1})); - array->set_uint32_value(80 + index, array->get_array_index({2, 1})); - array->set_uint32_value(90 + index, array->get_array_index({3, 1})); - array->set_uint32_value(100 + index, array->get_array_index({4, 1})); - m_Hello->return_loaned_value(array); - - writer_->write(m_Hello.get()); + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), index + 1); + m_Hello->set_uint32_values(m_Hello->get_member_id_by_name( + "array"), + {10 + index, 20 + index, 30 + index, 40 + index, 50 + index, 60 + index, 70 + index, 80 + index, 90 + index, + 100 + index}); + writer_->write(&m_Hello); return true; } return false; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h index 39f10fd2e0b..03f734e35aa 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h @@ -20,6 +20,8 @@ #ifndef HELLOWORLDPUBLISHER_H_ #define HELLOWORLDPUBLISHER_H_ +#include + #include #include @@ -45,7 +47,7 @@ class HelloWorldPublisher private: - eprosima::fastrtps::types::DynamicData_ptr m_Hello; + eprosima::fastdds::dds::DynamicData::_ref_type m_Hello; eprosima::fastdds::dds::DomainParticipant* mp_participant; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp index 753a1590e0d..f65d324a2cf 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp @@ -27,13 +27,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include using namespace eprosima::fastdds::dds; -using eprosima::fastrtps::types::ReturnCode_t; HelloWorldSubscriber::HelloWorldSubscriber() : mp_participant(nullptr) @@ -58,7 +55,7 @@ bool HelloWorldSubscriber::init() { return false; } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) + if (mp_participant->enable() != RETCODE_OK) { DomainParticipantFactory::get_instance()->delete_participant(mp_participant); return false; @@ -117,40 +114,25 @@ void HelloWorldSubscriber::SubListener::on_data_available( if (dit != subscriber_->datas_.end()) { - eprosima::fastrtps::types::DynamicData_ptr data = dit->second; + DynamicData::_ref_type data {dit->second}; SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&data, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { - eprosima::fastrtps::types::DynamicType_ptr type = subscriber_->readers_[reader]; + const DynamicType::_ref_type type {subscriber_->readers_[reader]}; this->n_samples++; std::cout << "Received data of type " << type->get_name() << std::endl; - eprosima::fastrtps::types::DynamicDataHelper::print(data); } } } } -void HelloWorldSubscriber::SubListener::on_type_discovery( - DomainParticipant*, - const eprosima::fastrtps::rtps::SampleIdentity&, - const eprosima::fastrtps::string_255& topic_name, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - std::cout << "Discovered type: " << dyn_type->get_name() << " from topic " << topic_name << std::endl; - received_type_ = dyn_type; - reception_flag_.store(true); - types_cv_.notify_one(); -} - void HelloWorldSubscriber::initialize_entities() { auto type = m_listener.received_type_; std::cout << "Initializing DDS entities for type: " << type->get_name() << std::endl; - TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(type)); + TypeSupport m_type(new DynamicPubSubType(type)); m_type.register_type(mp_participant); if (mp_subscriber == nullptr) @@ -184,8 +166,7 @@ void HelloWorldSubscriber::initialize_entities() topics_[reader] = topic; readers_[reader] = type; - eprosima::fastrtps::types::DynamicData_ptr data( - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(type)); + DynamicData::_ref_type data {DynamicDataFactory::get_instance()->create_data(type)}; datas_[reader] = data; } diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h index fe10753b623..447d8685e9f 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h @@ -20,21 +20,17 @@ #ifndef HELLOWORLDSUBSCRIBER_H_ #define HELLOWORLDSUBSCRIBER_H_ +#include +#include +#include + #include #include #include #include -#include -#include - -#include -#include - -#include - -#include -#include -#include +#include +#include +#include class HelloWorldSubscriber { @@ -65,11 +61,9 @@ class HelloWorldSubscriber std::map topics_; - std::map readers_; - - std::map datas_; + std::map readers_; - eprosima::fastrtps::SubscriberAttributes att_; + std::map datas_; eprosima::fastdds::dds::DataReaderQos qos_; @@ -99,14 +93,6 @@ class HelloWorldSubscriber eprosima::fastdds::dds::DataReader* reader, const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastrtps::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - int n_matched; uint32_t n_samples; @@ -115,7 +101,7 @@ class HelloWorldSubscriber std::condition_variable types_cv_; - eprosima::fastrtps::types::DynamicType_ptr received_type_; + eprosima::fastdds::dds::DynamicType::_ref_type received_type_; std::atomic reception_flag_{false}; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorld_main.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorld_main.cpp index a880dcd6067..582908edb44 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorld_main.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorld_main.cpp @@ -20,7 +20,7 @@ #include "HelloWorldPublisher.h" #include "HelloWorldSubscriber.h" -#include +#include using eprosima::fastdds::dds::Log; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/helloworld_example_type_profile.xml b/examples/cpp/dds/DynamicHelloWorldExample/helloworld_example_type_profile.xml index 1cb261cde23..4fa748f4973 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/helloworld_example_type_profile.xml +++ b/examples/cpp/dds/DynamicHelloWorldExample/helloworld_example_type_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/cpp/dds/Filtering/CMakeLists.txt b/examples/cpp/dds/Filtering/CMakeLists.txt index 3255936b8d4..45a34aa0889 100644 --- a/examples/cpp/dds/Filtering/CMakeLists.txt +++ b/examples/cpp/dds/Filtering/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -47,7 +47,7 @@ target_compile_definitions(DDSFiltering PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSFiltering fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSFiltering fastdds fastcdr foonathan_memory) install(TARGETS DDSFiltering RUNTIME DESTINATION examples/cpp/dds/Filtering/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/Filtering/FilteringExample.cxx b/examples/cpp/dds/Filtering/FilteringExample.cxx deleted file mode 100644 index 3f489150d46..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExample.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FilteringExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FilteringExample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -FilteringExample::FilteringExample() -{ -} - -FilteringExample::~FilteringExample() -{ -} - -FilteringExample::FilteringExample( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; -} - -FilteringExample::FilteringExample( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; -} - -FilteringExample& FilteringExample::operator =( - const FilteringExample& x) -{ - - m_sampleNumber = x.m_sampleNumber; - return *this; -} - -FilteringExample& FilteringExample::operator =( - FilteringExample&& x) noexcept -{ - - m_sampleNumber = x.m_sampleNumber; - return *this; -} - -bool FilteringExample::operator ==( - const FilteringExample& x) const -{ - return (m_sampleNumber == x.m_sampleNumber); -} - -bool FilteringExample::operator !=( - const FilteringExample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ -void FilteringExample::sampleNumber( - int32_t _sampleNumber) -{ - m_sampleNumber = _sampleNumber; -} - -/*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ -int32_t FilteringExample::sampleNumber() const -{ - return m_sampleNumber; -} - -/*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ -int32_t& FilteringExample::sampleNumber() -{ - return m_sampleNumber; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "FilteringExampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExample.h b/examples/cpp/dds/Filtering/FilteringExample.h deleted file mode 100644 index c57439eb75c..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExample.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FilteringExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "FilteringExamplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FILTERINGEXAMPLE_SOURCE) -#define FILTERINGEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FILTERINGEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FILTERINGEXAMPLE_SOURCE -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FilteringExample defined by the user in the IDL file. - * @ingroup FilteringExample - */ -class FilteringExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FilteringExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FilteringExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - const FilteringExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - FilteringExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - const FilteringExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - FilteringExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FilteringExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FilteringExample& x) const; - - /*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ - eProsima_user_DllExport void sampleNumber( - int32_t _sampleNumber); - - /*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ - eProsima_user_DllExport int32_t sampleNumber() const; - - /*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ - eProsima_user_DllExport int32_t& sampleNumber(); - -private: - - int32_t m_sampleNumber{0}; - -}; - -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExample.hpp b/examples/cpp/dds/Filtering/FilteringExample.hpp new file mode 100644 index 00000000000..b79790c6dec --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExample.hpp @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FilteringExample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ +#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FILTERINGEXAMPLE_SOURCE) +#define FILTERINGEXAMPLE_DllAPI __declspec( dllexport ) +#else +#define FILTERINGEXAMPLE_DllAPI __declspec( dllimport ) +#endif // FILTERINGEXAMPLE_SOURCE +#else +#define FILTERINGEXAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FILTERINGEXAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure FilteringExample defined by the user in the IDL file. + * @ingroup FilteringExample + */ +class FilteringExample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FilteringExample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FilteringExample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample( + const FilteringExample& x) + { + m_sampleNumber = x.m_sampleNumber; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample( + FilteringExample&& x) noexcept + { + m_sampleNumber = x.m_sampleNumber; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample& operator =( + const FilteringExample& x) + { + + m_sampleNumber = x.m_sampleNumber; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample& operator =( + FilteringExample&& x) noexcept + { + + m_sampleNumber = x.m_sampleNumber; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x FilteringExample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FilteringExample& x) const + { + return (m_sampleNumber == x.m_sampleNumber); + } + + /*! + * @brief Comparison operator. + * @param x FilteringExample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FilteringExample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member sampleNumber + * @param _sampleNumber New value for member sampleNumber + */ + eProsima_user_DllExport void sampleNumber( + int32_t _sampleNumber) + { + m_sampleNumber = _sampleNumber; + } + + /*! + * @brief This function returns the value of member sampleNumber + * @return Value of member sampleNumber + */ + eProsima_user_DllExport int32_t sampleNumber() const + { + return m_sampleNumber; + } + + /*! + * @brief This function returns a reference to member sampleNumber + * @return Reference to member sampleNumber + */ + eProsima_user_DllExport int32_t& sampleNumber() + { + return m_sampleNumber; + } + + + +private: + + int32_t m_sampleNumber{0}; + +}; + +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ + + diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp index 54b78a2c93a..7b9e9f23d6c 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ -#include "FilteringExample.h" +#include "FilteringExample.hpp" constexpr uint32_t FilteringExample_max_cdr_typesize {8UL}; constexpr uint32_t FilteringExample_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FilteringExample& data); diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp index d2fdb2c7032..5e95da1ef32 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubMain.cxx b/examples/cpp/dds/Filtering/FilteringExamplePubSubMain.cxx index 51229191915..0da1061846b 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubMain.cxx +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubMain.cxx @@ -15,10 +15,6 @@ #include "FilteringExamplePublisher.h" #include "FilteringExampleSubscriber.h" - -#include -#include - using namespace eprosima; using namespace eprosima::fastrtps; diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx index be0bd937a6b..86c035eec5e 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "FilteringExamplePubSubTypes.h" +#include #include -#include "FilteringExamplePubSubTypes.h" #include "FilteringExampleCdrAux.hpp" +#include "FilteringExampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - FilteringExamplePubSubType::FilteringExamplePubSubType() { setName("FilteringExample"); @@ -219,3 +219,11 @@ bool FilteringExamplePubSubType::getKey( return true; } +void FilteringExamplePubSubType::register_type_object_representation() const +{ + register_FilteringExample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "FilteringExampleCdrAux.ipp" diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h index 7f167f7b498..8b75d448159 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "FilteringExample.h" +#include "FilteringExample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type FilteringExample defined by the user in the IDL file. * @ingroup FilteringExample @@ -90,6 +88,9 @@ class FilteringExamplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx index 6a5f254046e..b2bbc02297f 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx +++ b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx @@ -127,7 +127,7 @@ void FilteringExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FilteringExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..24837dd4cc2 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FilteringExampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "FilteringExampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FilteringExample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_FilteringExample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_FilteringExample_type_identifier(); + + }); +} + +void register_FilteringExample_type_identifier() +{ + { + StructTypeFlag struct_flags_FilteringExample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_FilteringExample; + TypeIdentifierPair type_ids_FilteringExample; + QualifiedTypeName type_name_FilteringExample = "FilteringExample"; + eprosima::fastcdr::optional type_ann_builtin_FilteringExample; + eprosima::fastcdr::optional ann_custom_FilteringExample; + CompleteTypeDetail detail_FilteringExample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FilteringExample, ann_custom_FilteringExample, type_name_FilteringExample.to_string()); + CompleteStructHeader header_FilteringExample; + header_FilteringExample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FilteringExample); + CompleteStructMemberSeq member_seq_FilteringExample; + { + return_code_FilteringExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FilteringExample); + + if (return_code_FilteringExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sampleNumber Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_sampleNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sampleNumber; + MemberId member_id_sampleNumber = 0x00000000; + if (EK_COMPLETE == type_ids_FilteringExample.type_identifier1()._d() || TK_NONE == type_ids_FilteringExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sampleNumber = TypeObjectUtils::build_common_struct_member(member_id_sampleNumber, member_flags_sampleNumber, type_ids_FilteringExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FilteringExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sampleNumber = TypeObjectUtils::build_common_struct_member(member_id_sampleNumber, member_flags_sampleNumber, type_ids_FilteringExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sampleNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_sampleNumber = "sampleNumber"; + eprosima::fastcdr::optional member_ann_builtin_sampleNumber; + ann_custom_FilteringExample.reset(); + CompleteMemberDetail detail_sampleNumber = TypeObjectUtils::build_complete_member_detail(name_sampleNumber, member_ann_builtin_sampleNumber, ann_custom_FilteringExample); + CompleteStructMember member_sampleNumber = TypeObjectUtils::build_complete_struct_member(common_sampleNumber, detail_sampleNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_FilteringExample, member_sampleNumber); + } + CompleteStructType struct_type_FilteringExample = TypeObjectUtils::build_complete_struct_type(struct_flags_FilteringExample, header_FilteringExample, member_seq_FilteringExample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_FilteringExample, type_name_FilteringExample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FilteringExample already registered in TypeObjectRegistry for a different type."); + } + return_code_FilteringExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "FilteringExample", type_ids_FilteringExample); + if (return_code_FilteringExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FilteringExample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..a2f76df5a00 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FilteringExampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_FilteringExample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register FilteringExample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_FilteringExample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.cxx b/examples/cpp/dds/Filtering/FilteringExamplev1.cxx deleted file mode 100644 index 22b80052278..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExamplev1.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FilteringExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FilteringExample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define FilteringExample_max_cdr_typesize 8ULL; - - - - -FilteringExample::FilteringExample() -{ - // long m_sampleNumber - m_sampleNumber = 0; - -} - -FilteringExample::~FilteringExample() -{ -} - -FilteringExample::FilteringExample( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; - -} - -FilteringExample::FilteringExample( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; - -} - -FilteringExample& FilteringExample::operator =( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; - - return *this; -} - -FilteringExample& FilteringExample::operator =( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; - - return *this; -} - -bool FilteringExample::operator ==( - const FilteringExample& x) const -{ - return (m_sampleNumber == x.m_sampleNumber); -} - -bool FilteringExample::operator !=( - const FilteringExample& x) const -{ - return !(*this == x); -} - -size_t FilteringExample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FilteringExample_max_cdr_typesize; -} - -size_t FilteringExample::getCdrSerializedSize( - const FilteringExample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void FilteringExample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sampleNumber; - -} - -void FilteringExample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sampleNumber; - - -} - - -bool FilteringExample::isKeyDefined() -{ - return false; -} - -void FilteringExample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ -void FilteringExample::sampleNumber( - int32_t _sampleNumber) -{ - m_sampleNumber = _sampleNumber; -} - -/*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ -int32_t FilteringExample::sampleNumber() const -{ - return m_sampleNumber; -} - -/*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ -int32_t& FilteringExample::sampleNumber() -{ - return m_sampleNumber; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.h b/examples/cpp/dds/Filtering/FilteringExamplev1.h deleted file mode 100644 index b7e6c2228c1..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExamplev1.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FilteringExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FILTERINGEXAMPLE_SOURCE) -#define FILTERINGEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FILTERINGEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FILTERINGEXAMPLE_SOURCE -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FilteringExample defined by the user in the IDL file. - * @ingroup FilteringExample - */ -class FilteringExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FilteringExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FilteringExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - const FilteringExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - FilteringExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - const FilteringExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - FilteringExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FilteringExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FilteringExample& x) const; - - /*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ - eProsima_user_DllExport void sampleNumber( - int32_t _sampleNumber); - - /*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ - eProsima_user_DllExport int32_t sampleNumber() const; - - /*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ - eProsima_user_DllExport int32_t& sampleNumber(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const FilteringExample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_sampleNumber; - -}; - - -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/CMakeLists.txt b/examples/cpp/dds/FlowControlExample/CMakeLists.txt index e321364d0e4..09fddb094bf 100644 --- a/examples/cpp/dds/FlowControlExample/CMakeLists.txt +++ b/examples/cpp/dds/FlowControlExample/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -47,6 +47,6 @@ target_compile_definitions(DDSFlowControlExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSFlowControlExample fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSFlowControlExample fastdds fastcdr foonathan_memory) install(TARGETS DDSFlowControlExample RUNTIME DESTINATION examples/cpp/dds/FlowControlExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx deleted file mode 100644 index c38d02771de..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FlowControlExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FlowControlExample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -FlowControlExample::FlowControlExample() -{ -} - -FlowControlExample::~FlowControlExample() -{ -} - -FlowControlExample::FlowControlExample( - const FlowControlExample& x) -{ - m_message = x.m_message; - m_wasFast = x.m_wasFast; -} - -FlowControlExample::FlowControlExample( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - m_wasFast = x.m_wasFast; -} - -FlowControlExample& FlowControlExample::operator =( - const FlowControlExample& x) -{ - - m_message = x.m_message; - m_wasFast = x.m_wasFast; - return *this; -} - -FlowControlExample& FlowControlExample::operator =( - FlowControlExample&& x) noexcept -{ - - m_message = std::move(x.m_message); - m_wasFast = x.m_wasFast; - return *this; -} - -bool FlowControlExample::operator ==( - const FlowControlExample& x) const -{ - return (m_message == x.m_message && - m_wasFast == x.m_wasFast); -} - -bool FlowControlExample::operator !=( - const FlowControlExample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void FlowControlExample::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void FlowControlExample::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& FlowControlExample::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& FlowControlExample::message() -{ - return m_message; -} - - -/*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ -void FlowControlExample::wasFast( - char _wasFast) -{ - m_wasFast = _wasFast; -} - -/*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ -char FlowControlExample::wasFast() const -{ - return m_wasFast; -} - -/*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ -char& FlowControlExample::wasFast() -{ - return m_wasFast; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "FlowControlExampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.h b/examples/cpp/dds/FlowControlExample/FlowControlExample.h deleted file mode 100644 index f73d6e41c08..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FlowControlExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "FlowControlExamplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FLOWCONTROLEXAMPLE_SOURCE) -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FLOWCONTROLEXAMPLE_SOURCE -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. - * @ingroup FlowControlExample - */ -class FlowControlExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FlowControlExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FlowControlExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - const FlowControlExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - FlowControlExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - const FlowControlExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - FlowControlExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FlowControlExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FlowControlExample& x) const; - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ - eProsima_user_DllExport void wasFast( - char _wasFast); - - /*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ - eProsima_user_DllExport char wasFast() const; - - /*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ - eProsima_user_DllExport char& wasFast(); - -private: - - std::array m_message; - char m_wasFast{0}; - -}; - -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp new file mode 100644 index 00000000000..68bcb6de578 --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp @@ -0,0 +1,226 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FlowControlExample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ +#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ + +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FLOWCONTROLEXAMPLE_SOURCE) +#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllexport ) +#else +#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllimport ) +#endif // FLOWCONTROLEXAMPLE_SOURCE +#else +#define FLOWCONTROLEXAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FLOWCONTROLEXAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. + * @ingroup FlowControlExample + */ +class FlowControlExample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FlowControlExample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FlowControlExample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample( + const FlowControlExample& x) + { + m_message = x.m_message; + + m_wasFast = x.m_wasFast; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample( + FlowControlExample&& x) noexcept + { + m_message = std::move(x.m_message); + m_wasFast = x.m_wasFast; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample& operator =( + const FlowControlExample& x) + { + + m_message = x.m_message; + + m_wasFast = x.m_wasFast; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample& operator =( + FlowControlExample&& x) noexcept + { + + m_message = std::move(x.m_message); + m_wasFast = x.m_wasFast; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x FlowControlExample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FlowControlExample& x) const + { + return (m_message == x.m_message && + m_wasFast == x.m_wasFast); + } + + /*! + * @brief Comparison operator. + * @param x FlowControlExample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FlowControlExample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + + /*! + * @brief This function sets a value in member wasFast + * @param _wasFast New value for member wasFast + */ + eProsima_user_DllExport void wasFast( + char _wasFast) + { + m_wasFast = _wasFast; + } + + /*! + * @brief This function returns the value of member wasFast + * @return Value of member wasFast + */ + eProsima_user_DllExport char wasFast() const + { + return m_wasFast; + } + + /*! + * @brief This function returns a reference to member wasFast + * @return Reference to member wasFast + */ + eProsima_user_DllExport char& wasFast() + { + return m_wasFast; + } + + + +private: + + std::array m_message{0}; + char m_wasFast{0}; + +}; + +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ + + diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp index 4ef8e609e19..279a35713c0 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ -#include "FlowControlExample.h" +#include "FlowControlExample.hpp" constexpr uint32_t FlowControlExample_max_cdr_typesize {600005UL}; constexpr uint32_t FlowControlExample_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FlowControlExample& data); diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp index 361c67ee3cf..f2f080c5235 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubMain.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubMain.cxx index cf18ba9d55a..a696c5d9d0e 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubMain.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubMain.cxx @@ -19,14 +19,9 @@ * This file was generated by the tool fastcdrgen. */ - #include "FlowControlExamplePublisher.h" #include "FlowControlExampleSubscriber.h" - -#include -#include - using namespace eprosima; using namespace eprosima::fastrtps; diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx index 1d375cfbfe3..9267a718200 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "FlowControlExamplePubSubTypes.h" +#include #include -#include "FlowControlExamplePubSubTypes.h" #include "FlowControlExampleCdrAux.hpp" +#include "FlowControlExampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - FlowControlExamplePubSubType::FlowControlExamplePubSubType() { setName("FlowControlExample"); @@ -219,3 +219,11 @@ bool FlowControlExamplePubSubType::getKey( return true; } +void FlowControlExamplePubSubType::register_type_object_representation() const +{ + register_FlowControlExample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "FlowControlExampleCdrAux.ipp" diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h index f47b513e629..ce79bf04a31 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "FlowControlExample.h" +#include "FlowControlExample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type FlowControlExample defined by the user in the IDL file. * @ingroup FlowControlExample @@ -90,6 +88,9 @@ class FlowControlExamplePubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx index ffff981281c..4edeba1b574 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx @@ -124,7 +124,7 @@ void FlowControlExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FlowControlExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..b6383b89cc1 --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx @@ -0,0 +1,306 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FlowControlExampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "FlowControlExampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FlowControlExample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_FlowControlExample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_FlowControlExample_type_identifier(); + + }); +} + +void register_FlowControlExample_type_identifier() +{ + { + StructTypeFlag struct_flags_FlowControlExample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_FlowControlExample; + TypeIdentifierPair type_ids_FlowControlExample; + QualifiedTypeName type_name_FlowControlExample = "FlowControlExample"; + eprosima::fastcdr::optional type_ann_builtin_FlowControlExample; + eprosima::fastcdr::optional ann_custom_FlowControlExample; + CompleteTypeDetail detail_FlowControlExample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FlowControlExample, ann_custom_FlowControlExample, type_name_FlowControlExample.to_string()); + CompleteStructHeader header_FlowControlExample; + header_FlowControlExample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FlowControlExample); + CompleteStructMemberSeq member_seq_FlowControlExample; + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_600000", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_600000 {nullptr}; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_600000 = new TypeIdentifier(type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_600000 = new TypeIdentifier(type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_600000 = EK_COMPLETE; + if (TK_NONE == type_ids_FlowControlExample.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_600000 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_600000 = 0; + PlainCollectionHeader header_anonymous_array_char_600000 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_600000, element_flags_anonymous_array_char_600000); + std::string type_id_kind_anonymous_array_char_600000("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_600000 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(600000)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_600000, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_600000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_600000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(600000)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_600000, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_600000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_600000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_600000", type_ids_FlowControlExample); + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000000; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_FlowControlExample.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_FlowControlExample); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_FlowControlExample, member_message); + } + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "wasFast Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_wasFast = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_wasFast; + MemberId member_id_wasFast = 0x00000001; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_wasFast = TypeObjectUtils::build_common_struct_member(member_id_wasFast, member_flags_wasFast, type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_wasFast = TypeObjectUtils::build_common_struct_member(member_id_wasFast, member_flags_wasFast, type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure wasFast member TypeIdentifier inconsistent."); + return; + } + MemberName name_wasFast = "wasFast"; + eprosima::fastcdr::optional member_ann_builtin_wasFast; + ann_custom_FlowControlExample.reset(); + CompleteMemberDetail detail_wasFast = TypeObjectUtils::build_complete_member_detail(name_wasFast, member_ann_builtin_wasFast, ann_custom_FlowControlExample); + CompleteStructMember member_wasFast = TypeObjectUtils::build_complete_struct_member(common_wasFast, detail_wasFast); + TypeObjectUtils::add_complete_struct_member(member_seq_FlowControlExample, member_wasFast); + } + CompleteStructType struct_type_FlowControlExample = TypeObjectUtils::build_complete_struct_type(struct_flags_FlowControlExample, header_FlowControlExample, member_seq_FlowControlExample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_FlowControlExample, type_name_FlowControlExample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FlowControlExample already registered in TypeObjectRegistry for a different type."); + } + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "FlowControlExample", type_ids_FlowControlExample); + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FlowControlExample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..7caf86c114a --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FlowControlExampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_FlowControlExample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register FlowControlExample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_FlowControlExample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx deleted file mode 100644 index 8da82aa6d10..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FlowControlExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FlowControlExample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define FlowControlExample_max_cdr_typesize 600005ULL; - - - - -FlowControlExample::FlowControlExample() -{ - // char m_message - memset(&m_message, 0, ((600000)) * 1); - // char m_wasFast - m_wasFast = 0; - -} - -FlowControlExample::~FlowControlExample() -{ -} - -FlowControlExample::FlowControlExample( - const FlowControlExample& x) -{ - m_message = x.m_message; - - - m_wasFast = x.m_wasFast; - -} - -FlowControlExample::FlowControlExample( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - - - m_wasFast = x.m_wasFast; - -} - -FlowControlExample& FlowControlExample::operator =( - const FlowControlExample& x) -{ - m_message = x.m_message; - - - m_wasFast = x.m_wasFast; - - return *this; -} - -FlowControlExample& FlowControlExample::operator =( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - - - m_wasFast = x.m_wasFast; - - return *this; -} - -bool FlowControlExample::operator ==( - const FlowControlExample& x) const -{ - return (m_message == x.m_message && - m_wasFast == x.m_wasFast); -} - -bool FlowControlExample::operator !=( - const FlowControlExample& x) const -{ - return !(*this == x); -} - -size_t FlowControlExample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FlowControlExample_max_cdr_typesize; -} - -size_t FlowControlExample::getCdrSerializedSize( - const FlowControlExample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((600000)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void FlowControlExample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_message; - - - scdr << m_wasFast; - -} - -void FlowControlExample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_message; - - - - dcdr >> m_wasFast; - - -} - - -bool FlowControlExample::isKeyDefined() -{ - return false; -} - -void FlowControlExample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void FlowControlExample::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void FlowControlExample::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& FlowControlExample::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& FlowControlExample::message() -{ - return m_message; -} - - -/*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ -void FlowControlExample::wasFast( - char _wasFast) -{ - m_wasFast = _wasFast; -} - -/*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ -char FlowControlExample::wasFast() const -{ - return m_wasFast; -} - -/*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ -char& FlowControlExample::wasFast() -{ - return m_wasFast; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h deleted file mode 100644 index f72b0a10dae..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FlowControlExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FLOWCONTROLEXAMPLE_SOURCE) -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FLOWCONTROLEXAMPLE_SOURCE -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. - * @ingroup FlowControlExample - */ -class FlowControlExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FlowControlExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FlowControlExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - const FlowControlExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - FlowControlExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - const FlowControlExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - FlowControlExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FlowControlExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FlowControlExample& x) const; - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ - eProsima_user_DllExport void wasFast( - char _wasFast); - - /*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ - eProsima_user_DllExport char wasFast() const; - - /*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ - eProsima_user_DllExport char& wasFast(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const FlowControlExample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_message; - char m_wasFast; - -}; - - -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/CMakeLists.txt b/examples/cpp/dds/HelloWorldExample/CMakeLists.txt index 583847ee4f5..87fbf8dc2b4 100644 --- a/examples/cpp/dds/HelloWorldExample/CMakeLists.txt +++ b/examples/cpp/dds/HelloWorldExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(DDSHelloWorldExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSHelloWorldExample fastrtps fastcdr fastdds::optionparser) +target_link_libraries(DDSHelloWorldExample fastdds fastcdr fastdds::optionparser) install(TARGETS DDSHelloWorldExample RUNTIME DESTINATION examples/cpp/dds/HelloWorldExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.h b/examples/cpp/dds/HelloWorldExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPublisher.cpp b/examples/cpp/dds/HelloWorldExample/HelloWorldPublisher.cpp index 86f3e0009f5..1a2bdfce472 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPublisher.cpp @@ -18,15 +18,14 @@ */ #include "HelloWorldPublisher.h" -#include -#include + +#include + #include -#include -#include #include +#include #include - -#include +#include using namespace eprosima::fastdds::dds; diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp index 6823a32f4e6..680194c85b8 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp @@ -22,13 +22,11 @@ #include #include -#include -#include #include -#include #include -#include #include +#include +#include using namespace eprosima::fastdds::dds; @@ -158,7 +156,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.h index ecd897bd532..227198cf191 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.h @@ -20,12 +20,12 @@ #ifndef HELLOWORLDSUBSCRIBER_H_ #define HELLOWORLDSUBSCRIBER_H_ -#include "HelloWorldPubSubTypes.h" - +#include #include #include -#include -#include +#include + +#include "HelloWorldPubSubTypes.h" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld_main.cpp b/examples/cpp/dds/HelloWorldExample/HelloWorld_main.cpp index 35870eb670f..7a6fb595f09 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld_main.cpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld_main.cpp @@ -20,14 +20,13 @@ #include #include -#include "HelloWorldPublisher.h" -#include "HelloWorldSubscriber.h" - #include -#include - +#include #include +#include "HelloWorldPublisher.h" +#include "HelloWorldSubscriber.h" + using eprosima::fastdds::dds::Log; namespace option = eprosima::option; diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/README.txt b/examples/cpp/dds/HelloWorldExample/README.txt index 2055de76c58..6e02448ed83 100644 --- a/examples/cpp/dds/HelloWorldExample/README.txt +++ b/examples/cpp/dds/HelloWorldExample/README.txt @@ -4,12 +4,12 @@ In the first one launch: ./DDSHelloWorldExample publisher (or DDSHelloWorldExamp In the second one: ./DDSHelloWorldExample subscriber (or DDSHelloWorldExample.exe subscriber on windows). In order to use xml profiles (--env or shorcut -e cli flags): - - reference the xml profiles file setting the environment variable FASTRTPS_DEFAULT_PROFILES_FILE to its path. - - name it DEFAULT_FASTRTPS_PROFILES.xml and make sure the file is besides the DDSHelloWorldExample binary. + - reference the xml profiles file setting the environment variable FASTDDS_DEFAULT_PROFILES_FILE to its path. + - name it DEFAULT_FASTDDS_PROFILES.xml and make sure the file is besides the DDSHelloWorldExample binary. The profile loaded will be the mark as default one with the corresponding attribute. For example: - + Profiles example name diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/CMakeLists.txt b/examples/cpp/dds/HelloWorldExampleDataSharing/CMakeLists.txt index 424624e354d..63830c19c42 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/CMakeLists.txt +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -41,6 +41,6 @@ file(GLOB DDS_HELLOWORLD_EXAMPLE_DATASHARING_SOURCES_CPP "*.cpp") add_executable(DDSHelloWorldExampleDataSharing ${DDS_HELLOWORLD_EXAMPLE_DATASHARING_SOURCES_CXX} ${DDS_HELLOWORLD_EXAMPLE_DATASHARING_SOURCES_CPP}) -target_link_libraries(DDSHelloWorldExampleDataSharing fastrtps fastcdr) +target_link_libraries(DDSHelloWorldExampleDataSharing fastdds fastcdr) install(TARGETS DDSHelloWorldExampleDataSharing RUNTIME DESTINATION examples/cpp/dds/HelloWorldExampleDataSharing/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx deleted file mode 100644 index 3622c2401de..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const eprosima::fastcdr::fixed_string<20>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastcdr::fixed_string<20>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<20>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<20>& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h deleted file mode 100644 index 3488835aafe..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<20>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<20>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<20>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<20>& message(); - -private: - - uint32_t m_index{0}; - eprosima::fastcdr::fixed_string<20> m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp new file mode 100644 index 00000000000..22c4f7b2cda --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastcdr::fixed_string<20>& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastcdr::fixed_string<20>&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<20>& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<20>& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + eprosima::fastcdr::fixed_string<20> m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp index b0d081fe956..5d8548e14b8 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {33UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h index ddbfbab5db6..52736f6dad8 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPublisher.cpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPublisher.cpp index d6410f39fbc..24b6a033e9e 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPublisher.cpp @@ -18,15 +18,14 @@ */ #include "HelloWorldPublisher.h" -#include -#include + +#include + #include -#include -#include #include +#include #include - -#include +#include using namespace eprosima::fastdds::dds; diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp index 4e0e1fa9c58..690cdfdab64 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp @@ -27,8 +27,6 @@ #include #include #include -#include -#include using namespace eprosima::fastdds::dds; @@ -131,7 +129,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.h index c2cd03b7ebc..4d700a8cab2 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.h @@ -20,12 +20,12 @@ #ifndef HELLOWORLDSUBSCRIBER_H_ #define HELLOWORLDSUBSCRIBER_H_ -#include "HelloWorldPubSubTypes.h" - +#include #include #include -#include -#include +#include + +#include "HelloWorldPubSubTypes.h" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..7049f02b87e --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_20", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_20("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_20 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(20); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_20 == "TI_STRING8_LARGE") + { + LBound bound = 20; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_20", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld_main.cpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld_main.cpp index 12bfa578b4d..f7ff24627db 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld_main.cpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld_main.cpp @@ -17,12 +17,11 @@ * */ -#include "HelloWorldPublisher.h" -#include "HelloWorldSubscriber.h" - #include +#include -#include +#include "HelloWorldPublisher.h" +#include "HelloWorldSubscriber.h" using eprosima::fastdds::dds::Log; diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx deleted file mode 100644 index 27e02c6c6d3..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 33ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - { - std::string aux; - dcdr >> aux; - m_message = aux.c_str(); - } - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const eprosima::fastrtps::fixed_string<20>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastrtps::fixed_string<20>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastrtps::fixed_string<20>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastrtps::fixed_string<20>& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h deleted file mode 100644 index 00281b09128..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastrtps::fixed_string<20>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastrtps::fixed_string<20>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<20>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<20>& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - eprosima::fastrtps::fixed_string<20> m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/CMakeLists.txt b/examples/cpp/dds/HelloWorldExampleSharedMem/CMakeLists.txt index d7d8d045222..057b67e1e89 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/CMakeLists.txt +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -51,6 +51,6 @@ target_compile_definitions(DDSHelloWorldExampleSharedMem PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSHelloWorldExampleSharedMem fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSHelloWorldExampleSharedMem fastdds fastcdr foonathan_memory) install(TARGETS DDSHelloWorldExampleSharedMem RUNTIME DESTINATION examples/cpp/dds/HelloWorldExampleSharedMem/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx deleted file mode 100644 index 68c604b6588..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void HelloWorld::data( - const std::array& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void HelloWorld::data( - std::array&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::array& HelloWorld::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::array& HelloWorld::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h deleted file mode 100644 index deb44d359b1..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::array& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::array&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::array& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::array& data(); - -private: - - uint32_t m_index{0}; - std::string m_message; - std::array m_data; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp new file mode 100644 index 00000000000..7fbb251328b --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp @@ -0,0 +1,275 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::array& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::array&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::array& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::array& data() + { + return m_data; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + std::array m_data{0}; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp index 77b8e2a63aa..2755baecef9 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {1048844UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp index 2243fe1af8d..bcdc3a4d321 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h index b3728ca47ad..ef37aa5f383 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp index 9afd1360353..77a438830bf 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp @@ -146,7 +146,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(hello_.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(hello_.get(), &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h index d6be44aaf28..706ca6ada3d 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..afeb68f5251 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,407 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_1048576", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_1048576 {nullptr}; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_1048576 = new TypeIdentifier(type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_1048576 = new TypeIdentifier(type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_1048576 = EK_COMPLETE; + if (TK_NONE == type_ids_HelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_1048576 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_1048576 = 0; + PlainCollectionHeader header_anonymous_array_char_1048576 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_1048576, element_flags_anonymous_array_char_1048576); + std::string type_id_kind_anonymous_array_char_1048576("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_1048576 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(1048576)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_1048576, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_1048576)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_1048576")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(1048576)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_1048576, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_1048576)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_1048576")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_1048576", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_HelloWorld); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_data); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld_main.cpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld_main.cpp index 04339bba607..979be73bef1 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld_main.cpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld_main.cpp @@ -17,17 +17,18 @@ * */ -#include "HelloWorldPublisher.h" -#include "HelloWorldSubscriber.h" - #include -#include -#include +#include + +#include "HelloWorldPublisher.h" +#include "HelloWorldSubscriber.h" using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; + int main( int argc, char** argv) @@ -112,7 +113,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx deleted file mode 100644 index 0136d21e4c7..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 1048844ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - // char m_data - memset(&m_data, 0, ((1024*1024)) * 1); - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - current_alignment += (((1024*1024)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - - scdr << m_data; - - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - - - dcdr >> m_data; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void HelloWorld::data( - const std::array& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void HelloWorld::data( - std::array&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::array& HelloWorld::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::array& HelloWorld::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h deleted file mode 100644 index 8221e3d9fbe..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::array& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::array&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::array& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::array& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - std::array m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/CMakeLists.txt b/examples/cpp/dds/HelloWorldExampleTCP/CMakeLists.txt index e98a20ff119..28cc54d5d2f 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/CMakeLists.txt +++ b/examples/cpp/dds/HelloWorldExampleTCP/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -55,6 +55,6 @@ target_compile_definitions(DDSHelloWorldExampleTCP PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSHelloWorldExampleTCP fastrtps fastcdr foonathan_memory fastdds::optionparser) +target_link_libraries(DDSHelloWorldExampleTCP fastdds fastcdr foonathan_memory fastdds::optionparser) install(TARGETS DDSHelloWorldExampleTCP RUNTIME DESTINATION examples/cpp/dds/HelloWorldExampleTCP/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.cpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.cpp index 846e72e262b..ceb7fb25de3 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.cpp @@ -20,7 +20,7 @@ #include "HelloWorldPublisher.h" #include #include -#include +#include #include diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h index 1301ec490dd..63a228fe286 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #include diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp index 4e63d3587da..df49a3d256d 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -179,7 +179,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h index 9f3c4c2eb10..15133e2ba63 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #include diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld_main.cpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld_main.cpp index 94a00bf20c2..f1b1677e472 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld_main.cpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld_main.cpp @@ -17,16 +17,13 @@ * */ -#include "HelloWorldPublisher.h" -#include "HelloWorldSubscriber.h" - -#include -#include - #include #include +#include "HelloWorldPublisher.h" +#include "HelloWorldSubscriber.h" + namespace option = eprosima::option; struct Arg : public option::Arg @@ -311,6 +308,5 @@ int main( break; } } - Domain::stopAll(); return 0; } diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/CMakeLists.txt b/examples/cpp/dds/HistoryKind/CMakeLists.txt index 9f6462776c9..217442c05fc 100644 --- a/examples/cpp/dds/HistoryKind/CMakeLists.txt +++ b/examples/cpp/dds/HistoryKind/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 2.12 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSHistoryKind PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSHistoryKind fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSHistoryKind fastdds fastcdr foonathan_memory) install(TARGETS DDSHistoryKind RUNTIME DESTINATION examples/cpp/dds/HistoryKind/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/HistoryKind/pastsamples.cpp b/examples/cpp/dds/HistoryKind/pastsamples.cpp index 6561d835ede..25937ac9182 100644 --- a/examples/cpp/dds/HistoryKind/pastsamples.cpp +++ b/examples/cpp/dds/HistoryKind/pastsamples.cpp @@ -193,14 +193,14 @@ void pastsamples() //Read the contents of both histories: std::cout << "The Keep All Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Keep Last (Depth 10) Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/HistoryKind/sample.cxx b/examples/cpp/dds/HistoryKind/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/HistoryKind/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sample.h b/examples/cpp/dds/HistoryKind/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/HistoryKind/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sample.hpp b/examples/cpp/dds/HistoryKind/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HistoryKind/samplev1.cxx b/examples/cpp/dds/HistoryKind/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/HistoryKind/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/samplev1.h b/examples/cpp/dds/HistoryKind/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/HistoryKind/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/CMakeLists.txt b/examples/cpp/dds/Keys/CMakeLists.txt index 2cb9c151b80..8bee7df7fa0 100644 --- a/examples/cpp/dds/Keys/CMakeLists.txt +++ b/examples/cpp/dds/Keys/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSKeys PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSKeys fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSKeys fastdds fastcdr foonathan_memory) install(TARGETS DDSKeys RUNTIME DESTINATION examples/cpp/dds/Keys/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/Keys/keys.cpp b/examples/cpp/dds/Keys/keys.cpp index d32c03e1513..9faba4e251d 100644 --- a/examples/cpp/dds/Keys/keys.cpp +++ b/examples/cpp/dds/Keys/keys.cpp @@ -141,7 +141,7 @@ class SubListener : public eprosima::fastdds::dds::DataReaderListener DataReader* reader) override { SampleInfo info; - if (reader->take_next_sample(&m_sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&m_sample, &info) == RETCODE_OK) { if (info.valid_data) { @@ -365,7 +365,7 @@ void keys() //Read the contents of both histories: std::vector< std::pair> sampleList; std::cout << "The Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { sampleList.push_back(std::pair(my_sample.index(), my_sample.key_value())); } diff --git a/examples/cpp/dds/Keys/sample.cxx b/examples/cpp/dds/Keys/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/Keys/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sample.h b/examples/cpp/dds/Keys/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/Keys/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sample.hpp b/examples/cpp/dds/Keys/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/Keys/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/Keys/sampleCdrAux.hpp b/examples/cpp/dds/Keys/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.hpp +++ b/examples/cpp/dds/Keys/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/Keys/sampleCdrAux.ipp b/examples/cpp/dds/Keys/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.ipp +++ b/examples/cpp/dds/Keys/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.cxx b/examples/cpp/dds/Keys/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Keys/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.h b/examples/cpp/dds/Keys/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.h +++ b/examples/cpp/dds/Keys/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx b/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp b/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Keys/samplev1.cxx b/examples/cpp/dds/Keys/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/Keys/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/samplev1.h b/examples/cpp/dds/Keys/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/Keys/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/CMakeLists.txt b/examples/cpp/dds/LateJoiners/CMakeLists.txt index fd683dc6d23..f289f626014 100644 --- a/examples/cpp/dds/LateJoiners/CMakeLists.txt +++ b/examples/cpp/dds/LateJoiners/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 2.12 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSLateJoiners PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSLateJoiners fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSLateJoiners fastdds fastcdr foonathan_memory) install(TARGETS DDSLateJoiners RUNTIME DESTINATION examples/cpp/dds/LateJoiners/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/LateJoiners/latejoiners.cpp b/examples/cpp/dds/LateJoiners/latejoiners.cpp index 4566c146b45..4209ea5e835 100644 --- a/examples/cpp/dds/LateJoiners/latejoiners.cpp +++ b/examples/cpp/dds/LateJoiners/latejoiners.cpp @@ -177,13 +177,13 @@ void latejoiners() //Read the contents of both histories: std::cout << "The Transient Local Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Volatile Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/LateJoiners/sample.cxx b/examples/cpp/dds/LateJoiners/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/LateJoiners/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sample.h b/examples/cpp/dds/LateJoiners/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/LateJoiners/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sample.hpp b/examples/cpp/dds/LateJoiners/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LateJoiners/samplev1.cxx b/examples/cpp/dds/LateJoiners/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/LateJoiners/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/samplev1.h b/examples/cpp/dds/LateJoiners/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/LateJoiners/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/CMakeLists.txt b/examples/cpp/dds/LifespanQoSExample/CMakeLists.txt index 0e9f9ce97d6..15146b63341 100644 --- a/examples/cpp/dds/LifespanQoSExample/CMakeLists.txt +++ b/examples/cpp/dds/LifespanQoSExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 2.12 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(DDSLifespanQoSExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSLifespanQoSExample fastrtps fastcdr) +target_link_libraries(DDSLifespanQoSExample fastdds fastcdr) install(TARGETS DDSLifespanQoSExample RUNTIME DESTINATION examples/cpp/dds/LifespanQoSExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx deleted file mode 100644 index 66c85b61161..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Lifespan.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Lifespan.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Lifespan::Lifespan() -{ -} - -Lifespan::~Lifespan() -{ -} - -Lifespan::Lifespan( - const Lifespan& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Lifespan::Lifespan( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Lifespan& Lifespan::operator =( - const Lifespan& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Lifespan& Lifespan::operator =( - Lifespan&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Lifespan::operator ==( - const Lifespan& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Lifespan::operator !=( - const Lifespan& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Lifespan::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Lifespan::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Lifespan::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Lifespan::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Lifespan::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Lifespan::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Lifespan::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LifespanCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.h b/examples/cpp/dds/LifespanQoSExample/Lifespan.h deleted file mode 100644 index 5d6e5da9c5c..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Lifespan.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Lifespanv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ -#define _FAST_DDS_GENERATED_LIFESPAN_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LIFESPAN_SOURCE) -#define LIFESPAN_DllAPI __declspec( dllexport ) -#else -#define LIFESPAN_DllAPI __declspec( dllimport ) -#endif // LIFESPAN_SOURCE -#else -#define LIFESPAN_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LIFESPAN_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Lifespan defined by the user in the IDL file. - * @ingroup Lifespan - */ -class Lifespan -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Lifespan(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Lifespan(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - const Lifespan& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - Lifespan&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - const Lifespan& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - Lifespan&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Lifespan& x) const; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Lifespan& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_LIFESPAN_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.hpp b/examples/cpp/dds/LifespanQoSExample/Lifespan.hpp new file mode 100644 index 00000000000..2d2668b9996 --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Lifespan.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LIFESPAN_HPP_ +#define _FAST_DDS_GENERATED_LIFESPAN_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LIFESPAN_SOURCE) +#define LIFESPAN_DllAPI __declspec( dllexport ) +#else +#define LIFESPAN_DllAPI __declspec( dllimport ) +#endif // LIFESPAN_SOURCE +#else +#define LIFESPAN_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LIFESPAN_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Lifespan defined by the user in the IDL file. + * @ingroup Lifespan + */ +class Lifespan +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Lifespan() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Lifespan() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan( + const Lifespan& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan( + Lifespan&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan& operator =( + const Lifespan& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan& operator =( + Lifespan&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Lifespan object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Lifespan& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x Lifespan object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Lifespan& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_LIFESPAN_HPP_ + + diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp index 770a53f6a14..590d3f48c33 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ -#include "Lifespan.h" +#include "Lifespan.hpp" constexpr uint32_t Lifespan_max_cdr_typesize {268UL}; constexpr uint32_t Lifespan_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Lifespan& data); diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp index 59e8f99cfd7..b890d727220 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx index 05b7ea5970c..bddbe31e7d4 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LifespanPubSubTypes.h" +#include #include -#include "LifespanPubSubTypes.h" #include "LifespanCdrAux.hpp" +#include "LifespanTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - LifespanPubSubType::LifespanPubSubType() { setName("Lifespan"); @@ -219,3 +219,11 @@ bool LifespanPubSubType::getKey( return true; } +void LifespanPubSubType::register_type_object_representation() const +{ + register_Lifespan_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LifespanCdrAux.ipp" diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h index 01b48528ed9..8c936d6dc6f 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Lifespan.h" +#include "Lifespan.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Lifespan defined by the user in the IDL file. * @ingroup Lifespan @@ -90,6 +88,9 @@ class LifespanPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h b/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h index cb0db6fab53..a737941258e 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h @@ -20,7 +20,7 @@ #ifndef HELLOWORLDPUBLISHER_H_ #define HELLOWORLDPUBLISHER_H_ -#include "Lifespan.h" +#include "Lifespan.hpp" #include "LifespanPubSubTypes.h" #include diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp index 737f92b99f2..e7d9b96571f 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp @@ -130,7 +130,7 @@ void LifespanSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->read_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->read_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { @@ -160,7 +160,7 @@ void LifespanSubscriber::run( for ( uint32_t i = 0; i < listener.n_samples; i++ ) { - if (reader_->take_next_sample((void*) &data, &info) == ReturnCode_t::RETCODE_OK) + if (reader_->take_next_sample((void*) &data, &info) == RETCODE_OK) { std::cout << "Message " << data.message() << " " << data.index() << " read from history" << std::endl; } diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h index 64434c34bc9..2ba5f0392b9 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h @@ -20,8 +20,8 @@ #ifndef HELLOWORLDSUBSCRIBER_H_ #define HELLOWORLDSUBSCRIBER_H_ +#include "Lifespan.hpp" #include "LifespanPubSubTypes.h" -#include "Lifespan.h" #include #include diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx new file mode 100644 index 00000000000..52d6afa027c --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LifespanTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LifespanTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Lifespan.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Lifespan_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Lifespan_type_identifier(); + + }); +} + +void register_Lifespan_type_identifier() +{ + { + StructTypeFlag struct_flags_Lifespan = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Lifespan; + TypeIdentifierPair type_ids_Lifespan; + QualifiedTypeName type_name_Lifespan = "Lifespan"; + eprosima::fastcdr::optional type_ann_builtin_Lifespan; + eprosima::fastcdr::optional ann_custom_Lifespan; + CompleteTypeDetail detail_Lifespan = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Lifespan, ann_custom_Lifespan, type_name_Lifespan.to_string()); + CompleteStructHeader header_Lifespan; + header_Lifespan = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Lifespan); + CompleteStructMemberSeq member_seq_Lifespan; + { + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Lifespan); + + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Lifespan.type_identifier1()._d() || TK_NONE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Lifespan.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Lifespan.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Lifespan.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Lifespan); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Lifespan, member_index); + } + { + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Lifespan); + + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Lifespan); + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Lifespan.type_identifier1()._d() || TK_NONE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Lifespan.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Lifespan.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Lifespan.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Lifespan); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Lifespan, member_message); + } + CompleteStructType struct_type_Lifespan = TypeObjectUtils::build_complete_struct_type(struct_flags_Lifespan, header_Lifespan, member_seq_Lifespan); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Lifespan, type_name_Lifespan.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Lifespan already registered in TypeObjectRegistry for a different type."); + } + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Lifespan", type_ids_Lifespan); + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Lifespan: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp new file mode 100644 index 00000000000..c0b2e0b9327 --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LifespanTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Lifespan_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Lifespan related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Lifespan_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan_main.cpp b/examples/cpp/dds/LifespanQoSExample/Lifespan_main.cpp index e0d2e4a395f..8b50afb30ce 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan_main.cpp +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan_main.cpp @@ -17,15 +17,16 @@ * */ +#include + #include "LifespanPublisher.h" #include "LifespanSubscriber.h" -#include -#include - using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; + int main( int argc, char** argv) @@ -104,7 +105,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx deleted file mode 100644 index 81eaa4dd19b..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Lifespan.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Lifespan.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Lifespan_max_cdr_typesize 268ULL; - - - - -Lifespan::Lifespan() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Lifespan::~Lifespan() -{ -} - -Lifespan::Lifespan( - const Lifespan& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Lifespan::Lifespan( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Lifespan& Lifespan::operator =( - const Lifespan& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Lifespan& Lifespan::operator =( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Lifespan::operator ==( - const Lifespan& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Lifespan::operator !=( - const Lifespan& x) const -{ - return !(*this == x); -} - -size_t Lifespan::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Lifespan_max_cdr_typesize; -} - -size_t Lifespan::getCdrSerializedSize( - const Lifespan& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Lifespan::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Lifespan::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Lifespan::isKeyDefined() -{ - return false; -} - -void Lifespan::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Lifespan::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Lifespan::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Lifespan::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Lifespan::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Lifespan::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Lifespan::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Lifespan::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h deleted file mode 100644 index ad92ec390df..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Lifespan.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ -#define _FAST_DDS_GENERATED_LIFESPAN_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LIFESPAN_SOURCE) -#define LIFESPAN_DllAPI __declspec( dllexport ) -#else -#define LIFESPAN_DllAPI __declspec( dllimport ) -#endif // LIFESPAN_SOURCE -#else -#define LIFESPAN_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LIFESPAN_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Lifespan defined by the user in the IDL file. - * @ingroup Lifespan - */ -class Lifespan -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Lifespan(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Lifespan(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - const Lifespan& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - Lifespan&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - const Lifespan& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - Lifespan&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Lifespan& x) const; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Lifespan& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Lifespan& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LIFESPAN_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/CMakeLists.txt b/examples/cpp/dds/LivelinessQoS/CMakeLists.txt index 6e9a89e4de7..a49536c22b5 100644 --- a/examples/cpp/dds/LivelinessQoS/CMakeLists.txt +++ b/examples/cpp/dds/LivelinessQoS/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(DDSLivelinessQoS PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSLivelinessQoS fastrtps fastcdr) +target_link_libraries(DDSLivelinessQoS fastdds fastcdr) install(TARGETS DDSLivelinessQoS RUNTIME DESTINATION examples/cpp/dds/LivelinessQoS/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h b/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h index 5efec3fec94..f3cfca53c7b 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h +++ b/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h @@ -20,16 +20,16 @@ #ifndef LivelinessPublisher_H_ #define LivelinessPublisher_H_ -#include "TopicPubSubTypes.h" -#include "Topic.h" +#include #include -#include #include #include +#include #include -#include +#include "TopicPubSubTypes.h" +#include "Topic.hpp" class LivelinessPublisher { @@ -43,7 +43,7 @@ class LivelinessPublisher //! Initialize bool init( - eprosima::fastrtps::LivelinessQosPolicyKind kind, + eprosima::fastdds::dds::LivelinessQosPolicyKind kind, int liveliness_ms); //! Publish a sample @@ -90,7 +90,7 @@ class LivelinessPublisher void on_liveliness_lost( eprosima::fastdds::dds::DataWriter* writer, - const eprosima::fastrtps::LivelinessLostStatus& status) override; + const eprosima::fastdds::dds::LivelinessLostStatus& status) override; int n_matched; diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp index 6e94d9570e6..e18664904ad 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp +++ b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp @@ -138,7 +138,7 @@ void LivelinessSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&topic, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&topic, &info) == RETCODE_OK) { if (info.valid_data) { @@ -182,8 +182,10 @@ void LivelinessSubscriber::run( void LivelinessSubscriber::PartListener::on_participant_discovery( DomainParticipant*, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Participant discovered" << std::endl; diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h index 154decdf689..fc3f2065053 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h +++ b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h @@ -20,17 +20,17 @@ #ifndef LIVELINESSSUBSCRIBER_H_ #define LIVELINESSSUBSCRIBER_H_ -#include "TopicPubSubTypes.h" -#include "Topic.h" - #include #include -#include #include #include +#include #include #include +#include "TopicPubSubTypes.h" +#include "Topic.hpp" + class LivelinessSubscriber { public: @@ -43,7 +43,7 @@ class LivelinessSubscriber //! Initialize the subscriber bool init( - eprosima::fastrtps::LivelinessQosPolicyKind kind, + eprosima::fastdds::dds::LivelinessQosPolicyKind kind, int liveliness_ms); //! RUN the subscriber @@ -105,7 +105,8 @@ class LivelinessSubscriber virtual void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; private: diff --git a/examples/cpp/dds/LivelinessQoS/Liveliness_main.cpp b/examples/cpp/dds/LivelinessQoS/Liveliness_main.cpp index 2c3c28f0514..93ece7e9990 100644 --- a/examples/cpp/dds/LivelinessQoS/Liveliness_main.cpp +++ b/examples/cpp/dds/LivelinessQoS/Liveliness_main.cpp @@ -17,16 +17,16 @@ * */ +#include +#include + #include "LivelinessPublisher.h" #include "LivelinessSubscriber.h" -#include -#include -#include - using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; //! //! \brief Parses command line artuments @@ -57,7 +57,7 @@ int main( int sleep_ms = 1000; int count = 10; - eprosima::fastrtps::LivelinessQosPolicyKind kind = eprosima::fastrtps::AUTOMATIC_LIVELINESS_QOS; + LivelinessQosPolicyKind kind = LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS; if (!parse_arguments( argc, @@ -109,7 +109,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } @@ -119,7 +118,7 @@ bool parse_arguments( char** argv, int& type, int& lease_duration_ms, - eprosima::fastrtps::LivelinessQosPolicyKind& kind, + LivelinessQosPolicyKind& kind, int& sleep_ms, int& samples) { @@ -153,15 +152,15 @@ bool parse_arguments( { if (!strcmp(argv[count + 1], "AUTOMATIC")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS; } else if (!strcmp(argv[count + 1], "MANUAL_BY_PARTICIPANT")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS; } else if (!strcmp(argv[count + 1], "MANUAL_BY_TOPIC")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS; } else { @@ -201,15 +200,15 @@ bool parse_arguments( { if (!strcmp(argv[count + 1], "AUTOMATIC")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS; } else if (!strcmp(argv[count + 1], "MANUAL_BY_PARTICIPANT")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS; } else if (!strcmp(argv[count + 1], "MANUAL_BY_TOPIC")) { - kind = eprosima::fastrtps::LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS; + kind = LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS; } else { diff --git a/examples/cpp/dds/LivelinessQoS/Topic.cxx b/examples/cpp/dds/LivelinessQoS/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topic.h b/examples/cpp/dds/LivelinessQoS/Topic.h deleted file mode 100644 index 2596f317a1e..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topic.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Topicv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topic.hpp b/examples/cpp/dds/LivelinessQoS/Topic.hpp new file mode 100644 index 00000000000..8f86884c2b8 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/Topic.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Topic.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ + + diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h index b9100bacbe9..0b37b3746f3 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.cxx b/examples/cpp/dds/LivelinessQoS/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.h b/examples/cpp/dds/LivelinessQoS/Topicv1.h deleted file mode 100644 index e06f22b7e2b..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/CMakeLists.txt b/examples/cpp/dds/OwnershipStrengthQoSExample/CMakeLists.txt index f26d31984dd..4f77e0747a9 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/CMakeLists.txt +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSOwnershipStrengthQoSExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSOwnershipStrengthQoSExample fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSOwnershipStrengthQoSExample fastdds fastcdr foonathan_memory) install(TARGETS DDSOwnershipStrengthQoSExample RUNTIME DESTINATION examples/cpp/dds/OwnershipStrengthQoSExample/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx deleted file mode 100644 index c566d2aa145..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OwnershipStrength.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "OwnershipStrength.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -ExampleMessage::ExampleMessage() -{ -} - -ExampleMessage::~ExampleMessage() -{ -} - -ExampleMessage::ExampleMessage( - const ExampleMessage& x) -{ - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = x.m_message; -} - -ExampleMessage::ExampleMessage( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = std::move(x.m_message); -} - -ExampleMessage& ExampleMessage::operator =( - const ExampleMessage& x) -{ - - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = x.m_message; - return *this; -} - -ExampleMessage& ExampleMessage::operator =( - ExampleMessage&& x) noexcept -{ - - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = std::move(x.m_message); - return *this; -} - -bool ExampleMessage::operator ==( - const ExampleMessage& x) const -{ - return (m_index == x.m_index && - m_ownershipStrength == x.m_ownershipStrength && - m_message == x.m_message); -} - -bool ExampleMessage::operator !=( - const ExampleMessage& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void ExampleMessage::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t ExampleMessage::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& ExampleMessage::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ -void ExampleMessage::ownershipStrength( - uint32_t _ownershipStrength) -{ - m_ownershipStrength = _ownershipStrength; -} - -/*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ -uint32_t ExampleMessage::ownershipStrength() const -{ - return m_ownershipStrength; -} - -/*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ -uint32_t& ExampleMessage::ownershipStrength() -{ - return m_ownershipStrength; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void ExampleMessage::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void ExampleMessage::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& ExampleMessage::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& ExampleMessage::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "OwnershipStrengthCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h deleted file mode 100644 index 2ce1eddefa3..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OwnershipStrength.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "OwnershipStrengthv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ -#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(OWNERSHIPSTRENGTH_SOURCE) -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllexport ) -#else -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllimport ) -#endif // OWNERSHIPSTRENGTH_SOURCE -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. - * @ingroup OwnershipStrength - */ -class ExampleMessage -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ExampleMessage(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ExampleMessage(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - const ExampleMessage& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - ExampleMessage&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - const ExampleMessage& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - ExampleMessage&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ExampleMessage& x) const; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ExampleMessage& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ - eProsima_user_DllExport void ownershipStrength( - uint32_t _ownershipStrength); - - /*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ - eProsima_user_DllExport uint32_t ownershipStrength() const; - - /*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ - eProsima_user_DllExport uint32_t& ownershipStrength(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - uint32_t m_ownershipStrength{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp new file mode 100644 index 00000000000..7b2459abfca --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OwnershipStrength.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ +#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(OWNERSHIPSTRENGTH_SOURCE) +#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllexport ) +#else +#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllimport ) +#endif // OWNERSHIPSTRENGTH_SOURCE +#else +#define OWNERSHIPSTRENGTH_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define OWNERSHIPSTRENGTH_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. + * @ingroup OwnershipStrength + */ +class ExampleMessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExampleMessage() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExampleMessage() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage( + const ExampleMessage& x) + { + m_index = x.m_index; + + m_ownershipStrength = x.m_ownershipStrength; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage( + ExampleMessage&& x) noexcept + { + m_index = x.m_index; + m_ownershipStrength = x.m_ownershipStrength; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage& operator =( + const ExampleMessage& x) + { + + m_index = x.m_index; + + m_ownershipStrength = x.m_ownershipStrength; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage& operator =( + ExampleMessage&& x) noexcept + { + + m_index = x.m_index; + m_ownershipStrength = x.m_ownershipStrength; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ExampleMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExampleMessage& x) const + { + return (m_index == x.m_index && + m_ownershipStrength == x.m_ownershipStrength && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x ExampleMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExampleMessage& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member ownershipStrength + * @param _ownershipStrength New value for member ownershipStrength + */ + eProsima_user_DllExport void ownershipStrength( + uint32_t _ownershipStrength) + { + m_ownershipStrength = _ownershipStrength; + } + + /*! + * @brief This function returns the value of member ownershipStrength + * @return Value of member ownershipStrength + */ + eProsima_user_DllExport uint32_t ownershipStrength() const + { + return m_ownershipStrength; + } + + /*! + * @brief This function returns a reference to member ownershipStrength + * @return Reference to member ownershipStrength + */ + eProsima_user_DllExport uint32_t& ownershipStrength() + { + return m_ownershipStrength; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + uint32_t m_ownershipStrength{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ + + diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp index d0eed4b0f5f..b13a1e7de3e 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ #define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ -#include "OwnershipStrength.h" +#include "OwnershipStrength.hpp" constexpr uint32_t ExampleMessage_max_cdr_typesize {272UL}; constexpr uint32_t ExampleMessage_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ExampleMessage& data); diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp index 5adb5bdd0a1..d4beca7dd09 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubMain.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubMain.cxx index 454d3b1dca3..73749ab9a04 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubMain.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubMain.cxx @@ -19,16 +19,16 @@ * This file was generated by the tool fastcdrgen. */ -#include "OwnershipStrengthPublisher.h" -#include "OwnershipStrengthSubscriber.h" +#include +#include -#include -#include -#include +#include "OwnershipStrengthPublisher.h" +#include "OwnershipStrengthSubscriber.h" using namespace eprosima; using namespace eprosima::fastrtps; +using namespace eprosima::fastdds::dds; int main(int argc, char** argv) { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx index 279bcd498c4..ea56a8eeb1a 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "OwnershipStrengthPubSubTypes.h" +#include #include -#include "OwnershipStrengthPubSubTypes.h" #include "OwnershipStrengthCdrAux.hpp" +#include "OwnershipStrengthTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - ExampleMessagePubSubType::ExampleMessagePubSubType() { setName("ExampleMessage"); @@ -219,3 +219,11 @@ bool ExampleMessagePubSubType::getKey( return true; } +void ExampleMessagePubSubType::register_type_object_representation() const +{ + register_OwnershipStrength_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "OwnershipStrengthCdrAux.ipp" diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h index 0ab6652c4ee..02d1733e97d 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "OwnershipStrength.h" +#include "OwnershipStrength.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type ExampleMessage defined by the user in the IDL file. * @ingroup OwnershipStrength @@ -90,6 +88,9 @@ class ExampleMessagePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx index 32fa0d9193d..ca8ae3cedb9 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx @@ -90,7 +90,7 @@ bool OwnershipStrengthSubscriber::init() //Create DataReader DataReaderQos rqos; - rqos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + rqos.reliability().kind = ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS; reader_ = subscriber_->create_datareader(topic_, rqos, &m_listener); @@ -174,7 +174,7 @@ void OwnershipStrengthSubscriber::SubListener::on_data_available( { SampleInfo info; ExampleMessage st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data && m_hierarchy.IsMessageStrong(st, info)) { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx new file mode 100644 index 00000000000..2af3cdeeeff --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx @@ -0,0 +1,312 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OwnershipStrengthTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "OwnershipStrengthTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "OwnershipStrength.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_OwnershipStrength_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_ExampleMessage_type_identifier(); + + }); +} + +void register_ExampleMessage_type_identifier() +{ + { + StructTypeFlag struct_flags_ExampleMessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_ExampleMessage; + TypeIdentifierPair type_ids_ExampleMessage; + QualifiedTypeName type_name_ExampleMessage = "ExampleMessage"; + eprosima::fastcdr::optional type_ann_builtin_ExampleMessage; + eprosima::fastcdr::optional ann_custom_ExampleMessage; + CompleteTypeDetail detail_ExampleMessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ExampleMessage, ann_custom_ExampleMessage, type_name_ExampleMessage.to_string()); + CompleteStructHeader header_ExampleMessage; + header_ExampleMessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ExampleMessage); + CompleteStructMemberSeq member_seq_ExampleMessage; + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_ExampleMessage); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_index); + } + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ownershipStrength Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_ownershipStrength = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_ownershipStrength; + MemberId member_id_ownershipStrength = 0x00000001; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_ownershipStrength = TypeObjectUtils::build_common_struct_member(member_id_ownershipStrength, member_flags_ownershipStrength, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_ownershipStrength = TypeObjectUtils::build_common_struct_member(member_id_ownershipStrength, member_flags_ownershipStrength, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure ownershipStrength member TypeIdentifier inconsistent."); + return; + } + MemberName name_ownershipStrength = "ownershipStrength"; + eprosima::fastcdr::optional member_ann_builtin_ownershipStrength; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_ownershipStrength = TypeObjectUtils::build_complete_member_detail(name_ownershipStrength, member_ann_builtin_ownershipStrength, ann_custom_ExampleMessage); + CompleteStructMember member_ownershipStrength = TypeObjectUtils::build_complete_struct_member(common_ownershipStrength, detail_ownershipStrength); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_ownershipStrength); + } + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ExampleMessage); + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000002; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_ExampleMessage); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_message); + } + CompleteStructType struct_type_ExampleMessage = TypeObjectUtils::build_complete_struct_type(struct_flags_ExampleMessage, header_ExampleMessage, member_seq_ExampleMessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ExampleMessage, type_name_ExampleMessage.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ExampleMessage already registered in TypeObjectRegistry for a different type."); + } + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "ExampleMessage", type_ids_ExampleMessage); + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ExampleMessage: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp new file mode 100644 index 00000000000..e16f4b42995 --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file OwnershipStrengthTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_OwnershipStrength_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register ExampleMessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_ExampleMessage_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx deleted file mode 100644 index b98d38c3f26..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OwnershipStrength.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "OwnershipStrength.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define ExampleMessage_max_cdr_typesize 272ULL; - - - - -ExampleMessage::ExampleMessage() -{ - // unsigned long m_index - m_index = 0; - // unsigned long m_ownershipStrength - m_ownershipStrength = 0; - // /type_d() m_message - - -} - -ExampleMessage::~ExampleMessage() -{ -} - -ExampleMessage::ExampleMessage( - const ExampleMessage& x) -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = x.m_message; - -} - -ExampleMessage::ExampleMessage( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = std::move(x.m_message); - -} - -ExampleMessage& ExampleMessage::operator =( - const ExampleMessage& x) -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = x.m_message; - - return *this; -} - -ExampleMessage& ExampleMessage::operator =( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool ExampleMessage::operator ==( - const ExampleMessage& x) const -{ - return (m_index == x.m_index && - m_ownershipStrength == x.m_ownershipStrength && - m_message == x.m_message); -} - -bool ExampleMessage::operator !=( - const ExampleMessage& x) const -{ - return !(*this == x); -} - -size_t ExampleMessage::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ExampleMessage_max_cdr_typesize; -} - -size_t ExampleMessage::getCdrSerializedSize( - const ExampleMessage& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void ExampleMessage::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_ownershipStrength; - - scdr << m_message.c_str(); - -} - -void ExampleMessage::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_ownershipStrength; - - - - dcdr >> m_message; - - -} - - -bool ExampleMessage::isKeyDefined() -{ - return false; -} - -void ExampleMessage::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void ExampleMessage::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t ExampleMessage::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& ExampleMessage::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ -void ExampleMessage::ownershipStrength( - uint32_t _ownershipStrength) -{ - m_ownershipStrength = _ownershipStrength; -} - -/*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ -uint32_t ExampleMessage::ownershipStrength() const -{ - return m_ownershipStrength; -} - -/*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ -uint32_t& ExampleMessage::ownershipStrength() -{ - return m_ownershipStrength; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void ExampleMessage::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void ExampleMessage::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& ExampleMessage::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& ExampleMessage::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h deleted file mode 100644 index ce63f631f87..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file OwnershipStrength.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ -#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(OWNERSHIPSTRENGTH_SOURCE) -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllexport ) -#else -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllimport ) -#endif // OWNERSHIPSTRENGTH_SOURCE -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. - * @ingroup OwnershipStrength - */ -class ExampleMessage -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ExampleMessage(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ExampleMessage(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - const ExampleMessage& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - ExampleMessage&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - const ExampleMessage& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - ExampleMessage&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ExampleMessage& x) const; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ExampleMessage& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ - eProsima_user_DllExport void ownershipStrength( - uint32_t _ownershipStrength); - - /*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ - eProsima_user_DllExport uint32_t ownershipStrength() const; - - /*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ - eProsima_user_DllExport uint32_t& ownershipStrength(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ExampleMessage& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - uint32_t m_ownershipStrength; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt index 654db9d07b6..a3efdf02707 100644 --- a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt +++ b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -36,9 +36,8 @@ endif() message(STATUS "Configuring Request-Reply example...") set(DDS_REQUEST_REPLY_EXAMPLE_COMMON_SOURCES - Calculator.cxx - Calculatorv1.cxx CalculatorPubSubTypes.cxx + CalculatorTypeObjectSupport.cxx ) set( DDS_REQUEST_REPLY_EXAMPLE_CLIENT_SOURCES CalculatorClient.cpp @@ -55,7 +54,7 @@ target_compile_definitions(DDSCalculatorClient PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSCalculatorClient fastrtps fastcdr) +target_link_libraries(DDSCalculatorClient fastdds fastcdr) install(TARGETS DDSCalculatorClient RUNTIME DESTINATION examples/cpp/dds/RequestReplyExample/${BIN_INSTALL_DIR}) @@ -67,6 +66,6 @@ target_compile_definitions(DDSCalculatorServer PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSCalculatorServer fastrtps fastcdr) +target_link_libraries(DDSCalculatorServer fastdds fastcdr) install(TARGETS DDSCalculatorServer RUNTIME DESTINATION examples/cpp/dds/RequestReplyExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.cxx b/examples/cpp/dds/RequestReplyExample/Calculator.cxx deleted file mode 100644 index 664663c6180..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculator.cxx +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Calculator.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Calculator.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -RequestType::RequestType() -{ -} - -RequestType::~RequestType() -{ -} - -RequestType::RequestType( - const RequestType& x) -{ - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; -} - -RequestType::RequestType( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; -} - -RequestType& RequestType::operator =( - const RequestType& x) -{ - - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; - return *this; -} - -RequestType& RequestType::operator =( - RequestType&& x) noexcept -{ - - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; - return *this; -} - -bool RequestType::operator ==( - const RequestType& x) const -{ - return (m_operation == x.m_operation && - m_x == x.m_x && - m_y == x.m_y); -} - -bool RequestType::operator !=( - const RequestType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ -void RequestType::operation( - OperationType _operation) -{ - m_operation = _operation; -} - -/*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ -OperationType RequestType::operation() const -{ - return m_operation; -} - -/*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ -OperationType& RequestType::operation() -{ - return m_operation; -} - - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void RequestType::x( - int32_t _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -int32_t RequestType::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -int32_t& RequestType::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void RequestType::y( - int32_t _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -int32_t RequestType::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -int32_t& RequestType::y() -{ - return m_y; -} - - - - -ReplyType::ReplyType() -{ -} - -ReplyType::~ReplyType() -{ -} - -ReplyType::ReplyType( - const ReplyType& x) -{ - m_z = x.m_z; -} - -ReplyType::ReplyType( - ReplyType&& x) noexcept -{ - m_z = x.m_z; -} - -ReplyType& ReplyType::operator =( - const ReplyType& x) -{ - - m_z = x.m_z; - return *this; -} - -ReplyType& ReplyType::operator =( - ReplyType&& x) noexcept -{ - - m_z = x.m_z; - return *this; -} - -bool ReplyType::operator ==( - const ReplyType& x) const -{ - return (m_z == x.m_z); -} - -bool ReplyType::operator !=( - const ReplyType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void ReplyType::z( - int64_t _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -int64_t ReplyType::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -int64_t& ReplyType::z() -{ - return m_z; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "CalculatorCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.h b/examples/cpp/dds/RequestReplyExample/Calculator.h deleted file mode 100644 index 945af396175..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculator.h +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Calculator.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Calculatorv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ -#define _FAST_DDS_GENERATED_CALCULATOR_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CALCULATOR_SOURCE) -#define CALCULATOR_DllAPI __declspec( dllexport ) -#else -#define CALCULATOR_DllAPI __declspec( dllimport ) -#endif // CALCULATOR_SOURCE -#else -#define CALCULATOR_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CALCULATOR_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration OperationType defined by the user in the IDL file. - * @ingroup Calculator - */ -enum OperationType : uint32_t -{ - ADDITION, - SUBTRACTION, - MULTIPLICATION, - DIVISION -}; - - -/*! - * @brief This class represents the structure RequestType defined by the user in the IDL file. - * @ingroup Calculator - */ -class RequestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RequestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RequestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - const RequestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - RequestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - const RequestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - RequestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RequestType& x) const; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RequestType& x) const; - - /*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ - eProsima_user_DllExport void operation( - OperationType _operation); - - /*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ - eProsima_user_DllExport OperationType operation() const; - - /*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ - eProsima_user_DllExport OperationType& operation(); - - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - int32_t _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport int32_t x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport int32_t& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - int32_t _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport int32_t y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport int32_t& y(); - -private: - - OperationType m_operation{::ADDITION}; - int32_t m_x{0}; - int32_t m_y{0}; - -}; - - -/*! - * @brief This class represents the structure ReplyType defined by the user in the IDL file. - * @ingroup Calculator - */ -class ReplyType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ReplyType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ReplyType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - const ReplyType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - ReplyType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - const ReplyType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - ReplyType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ReplyType& x) const; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ReplyType& x) const; - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - int64_t _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport int64_t z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport int64_t& z(); - -private: - - int64_t m_z{0}; - -}; - -#endif // _FAST_DDS_GENERATED_CALCULATOR_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.hpp b/examples/cpp/dds/RequestReplyExample/Calculator.hpp new file mode 100644 index 00000000000..f6404b6bfdd --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/Calculator.hpp @@ -0,0 +1,386 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Calculator.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CALCULATOR_HPP_ +#define _FAST_DDS_GENERATED_CALCULATOR_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CALCULATOR_SOURCE) +#define CALCULATOR_DllAPI __declspec( dllexport ) +#else +#define CALCULATOR_DllAPI __declspec( dllimport ) +#endif // CALCULATOR_SOURCE +#else +#define CALCULATOR_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CALCULATOR_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the enumeration OperationType defined by the user in the IDL file. + * @ingroup Calculator + */ +enum class OperationType : uint32_t +{ + ADDITION, + SUBTRACTION, + MULTIPLICATION, + DIVISION +}; +/*! + * @brief This class represents the structure RequestType defined by the user in the IDL file. + * @ingroup Calculator + */ +class RequestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RequestType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RequestType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType( + const RequestType& x) + { + m_operation = x.m_operation; + + m_x = x.m_x; + + m_y = x.m_y; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType( + RequestType&& x) noexcept + { + m_operation = x.m_operation; + m_x = x.m_x; + m_y = x.m_y; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType& operator =( + const RequestType& x) + { + + m_operation = x.m_operation; + + m_x = x.m_x; + + m_y = x.m_y; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType& operator =( + RequestType&& x) noexcept + { + + m_operation = x.m_operation; + m_x = x.m_x; + m_y = x.m_y; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x RequestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RequestType& x) const + { + return (m_operation == x.m_operation && + m_x == x.m_x && + m_y == x.m_y); + } + + /*! + * @brief Comparison operator. + * @param x RequestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RequestType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member operation + * @param _operation New value for member operation + */ + eProsima_user_DllExport void operation( + OperationType _operation) + { + m_operation = _operation; + } + + /*! + * @brief This function returns the value of member operation + * @return Value of member operation + */ + eProsima_user_DllExport OperationType operation() const + { + return m_operation; + } + + /*! + * @brief This function returns a reference to member operation + * @return Reference to member operation + */ + eProsima_user_DllExport OperationType& operation() + { + return m_operation; + } + + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + int32_t _x) + { + m_x = _x; + } + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport int32_t x() const + { + return m_x; + } + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport int32_t& x() + { + return m_x; + } + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + int32_t _y) + { + m_y = _y; + } + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport int32_t y() const + { + return m_y; + } + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport int32_t& y() + { + return m_y; + } + + + +private: + + OperationType m_operation{OperationType::ADDITION}; + int32_t m_x{0}; + int32_t m_y{0}; + +}; +/*! + * @brief This class represents the structure ReplyType defined by the user in the IDL file. + * @ingroup Calculator + */ +class ReplyType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ReplyType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ReplyType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType( + const ReplyType& x) + { + m_z = x.m_z; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType( + ReplyType&& x) noexcept + { + m_z = x.m_z; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType& operator =( + const ReplyType& x) + { + + m_z = x.m_z; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType& operator =( + ReplyType&& x) noexcept + { + + m_z = x.m_z; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ReplyType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ReplyType& x) const + { + return (m_z == x.m_z); + } + + /*! + * @brief Comparison operator. + * @param x ReplyType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ReplyType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + int64_t _z) + { + m_z = _z; + } + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport int64_t z() const + { + return m_z; + } + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport int64_t& z() + { + return m_z; + } + + + +private: + + int64_t m_z{0}; + +}; + +#endif // _FAST_DDS_GENERATED_CALCULATOR_HPP_ + + diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp index ca610452fdb..203f46ff5ec 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ #define _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ -#include "Calculator.h" +#include "Calculator.hpp" constexpr uint32_t ReplyType_max_cdr_typesize {16UL}; constexpr uint32_t ReplyType_max_key_cdr_typesize {0UL}; @@ -37,14 +37,10 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const RequestType& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ReplyType& data); diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp index 4930387fbbd..011ade654b9 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -128,8 +126,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp b/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp index b5a56e12735..3c6aa796f9a 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorClient.cpp @@ -16,13 +16,14 @@ #include #include -#include #include -#include +#include #include -#include +#include #include -#include +#include +#include + #include "CalculatorPubSubTypes.h" class CalculatorClient diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx index e928e28c98d..8c8a2588d31 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "CalculatorPubSubTypes.h" +#include #include -#include "CalculatorPubSubTypes.h" #include "CalculatorCdrAux.hpp" +#include "CalculatorTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - RequestTypePubSubType::RequestTypePubSubType() { setName("RequestType"); @@ -219,7 +219,10 @@ bool RequestTypePubSubType::getKey( return true; } - +void RequestTypePubSubType::register_type_object_representation() const +{ + register_Calculator_type_objects(); +} ReplyTypePubSubType::ReplyTypePubSubType() { @@ -409,3 +412,11 @@ bool ReplyTypePubSubType::getKey( return true; } +void ReplyTypePubSubType::register_type_object_representation() const +{ + register_Calculator_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "CalculatorCdrAux.ipp" diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h index ae4b2b39e8d..eac5b5c2a6e 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Calculator.h" +#include "Calculator.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type RequestType defined by the user in the IDL file. * @ingroup Calculator @@ -90,6 +88,9 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -128,8 +129,6 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType }; - - /*! * @brief This class represents the TopicDataType of the type ReplyType defined by the user in the IDL file. * @ingroup Calculator @@ -180,6 +179,9 @@ class ReplyTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorServer.cpp b/examples/cpp/dds/RequestReplyExample/CalculatorServer.cpp index 4a9df742374..59f933e5c96 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorServer.cpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorServer.cpp @@ -16,13 +16,14 @@ #include #include -#include #include -#include +#include #include -#include +#include #include -#include +#include +#include + #include "CalculatorPubSubTypes.h" class CalculatorServer diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx new file mode 100644 index 00000000000..5d358352dc6 --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx @@ -0,0 +1,436 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CalculatorTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "CalculatorTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Calculator.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Calculator_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_RequestType_type_identifier(); + + register_ReplyType_type_identifier(); + + }); +} + +void register_RequestType_type_identifier() +{ + { + StructTypeFlag struct_flags_RequestType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_RequestType; + TypeIdentifierPair type_ids_RequestType; + QualifiedTypeName type_name_RequestType = "RequestType"; + eprosima::fastcdr::optional type_ann_builtin_RequestType; + eprosima::fastcdr::optional ann_custom_RequestType; + CompleteTypeDetail detail_RequestType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_RequestType, ann_custom_RequestType, type_name_RequestType.to_string()); + CompleteStructHeader header_RequestType; + header_RequestType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_RequestType); + CompleteStructMemberSeq member_seq_RequestType; + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "OperationType", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_OperationType = 0; + BitBound bit_bound_OperationType = 32; + CommonEnumeratedHeader common_OperationType = TypeObjectUtils::build_common_enumerated_header(bit_bound_OperationType); + QualifiedTypeName type_name_OperationType = "OperationType"; + eprosima::fastcdr::optional type_ann_builtin_OperationType; + eprosima::fastcdr::optional ann_custom_OperationType; + CompleteTypeDetail detail_OperationType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OperationType, ann_custom_OperationType, type_name_OperationType.to_string()); + CompleteEnumeratedHeader header_OperationType = TypeObjectUtils::build_complete_enumerated_header(common_OperationType, detail_OperationType); + CompleteEnumeratedLiteralSeq literal_seq_OperationType; + { + EnumeratedLiteralFlag flags_ADDITION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_ADDITION = TypeObjectUtils::build_common_enumerated_literal(0, flags_ADDITION); + eprosima::fastcdr::optional member_ann_builtin_ADDITION; + ann_custom_OperationType.reset(); + MemberName name_ADDITION = "ADDITION"; + CompleteMemberDetail detail_ADDITION = TypeObjectUtils::build_complete_member_detail(name_ADDITION, member_ann_builtin_ADDITION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_ADDITION = TypeObjectUtils::build_complete_enumerated_literal(common_ADDITION, detail_ADDITION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_ADDITION); + } + { + EnumeratedLiteralFlag flags_SUBTRACTION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_SUBTRACTION = TypeObjectUtils::build_common_enumerated_literal(1, flags_SUBTRACTION); + eprosima::fastcdr::optional member_ann_builtin_SUBTRACTION; + ann_custom_OperationType.reset(); + MemberName name_SUBTRACTION = "SUBTRACTION"; + CompleteMemberDetail detail_SUBTRACTION = TypeObjectUtils::build_complete_member_detail(name_SUBTRACTION, member_ann_builtin_SUBTRACTION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_SUBTRACTION = TypeObjectUtils::build_complete_enumerated_literal(common_SUBTRACTION, detail_SUBTRACTION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_SUBTRACTION); + } + { + EnumeratedLiteralFlag flags_MULTIPLICATION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MULTIPLICATION = TypeObjectUtils::build_common_enumerated_literal(2, flags_MULTIPLICATION); + eprosima::fastcdr::optional member_ann_builtin_MULTIPLICATION; + ann_custom_OperationType.reset(); + MemberName name_MULTIPLICATION = "MULTIPLICATION"; + CompleteMemberDetail detail_MULTIPLICATION = TypeObjectUtils::build_complete_member_detail(name_MULTIPLICATION, member_ann_builtin_MULTIPLICATION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_MULTIPLICATION = TypeObjectUtils::build_complete_enumerated_literal(common_MULTIPLICATION, detail_MULTIPLICATION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_MULTIPLICATION); + } + { + EnumeratedLiteralFlag flags_DIVISION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DIVISION = TypeObjectUtils::build_common_enumerated_literal(3, flags_DIVISION); + eprosima::fastcdr::optional member_ann_builtin_DIVISION; + ann_custom_OperationType.reset(); + MemberName name_DIVISION = "DIVISION"; + CompleteMemberDetail detail_DIVISION = TypeObjectUtils::build_complete_member_detail(name_DIVISION, member_ann_builtin_DIVISION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_DIVISION = TypeObjectUtils::build_complete_enumerated_literal(common_DIVISION, detail_DIVISION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_DIVISION); + } + CompleteEnumeratedType enumerated_type_OperationType = TypeObjectUtils::build_complete_enumerated_type(enum_flags_OperationType, header_OperationType, + literal_seq_OperationType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_OperationType, type_name_OperationType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "OperationType already registered in TypeObjectRegistry for a different type."); + } + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "OperationType", type_ids_RequestType); + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "OperationType: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_operation = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_operation; + MemberId member_id_operation = 0x00000000; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_operation = TypeObjectUtils::build_common_struct_member(member_id_operation, member_flags_operation, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_operation = TypeObjectUtils::build_common_struct_member(member_id_operation, member_flags_operation, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure operation member TypeIdentifier inconsistent."); + return; + } + MemberName name_operation = "operation"; + eprosima::fastcdr::optional member_ann_builtin_operation; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_operation = TypeObjectUtils::build_complete_member_detail(name_operation, member_ann_builtin_operation, ann_custom_RequestType); + CompleteStructMember member_operation = TypeObjectUtils::build_complete_struct_member(common_operation, detail_operation); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_operation); + } + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "x Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_x = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_x; + MemberId member_id_x = 0x00000001; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_x = TypeObjectUtils::build_common_struct_member(member_id_x, member_flags_x, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_x = TypeObjectUtils::build_common_struct_member(member_id_x, member_flags_x, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure x member TypeIdentifier inconsistent."); + return; + } + MemberName name_x = "x"; + eprosima::fastcdr::optional member_ann_builtin_x; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_x = TypeObjectUtils::build_complete_member_detail(name_x, member_ann_builtin_x, ann_custom_RequestType); + CompleteStructMember member_x = TypeObjectUtils::build_complete_struct_member(common_x, detail_x); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_x); + } + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "y Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_y = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_y; + MemberId member_id_y = 0x00000002; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_y = TypeObjectUtils::build_common_struct_member(member_id_y, member_flags_y, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_y = TypeObjectUtils::build_common_struct_member(member_id_y, member_flags_y, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure y member TypeIdentifier inconsistent."); + return; + } + MemberName name_y = "y"; + eprosima::fastcdr::optional member_ann_builtin_y; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_y = TypeObjectUtils::build_complete_member_detail(name_y, member_ann_builtin_y, ann_custom_RequestType); + CompleteStructMember member_y = TypeObjectUtils::build_complete_struct_member(common_y, detail_y); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_y); + } + CompleteStructType struct_type_RequestType = TypeObjectUtils::build_complete_struct_type(struct_flags_RequestType, header_RequestType, member_seq_RequestType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_RequestType, type_name_RequestType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "RequestType already registered in TypeObjectRegistry for a different type."); + } + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "RequestType", type_ids_RequestType); + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "RequestType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_ReplyType_type_identifier() +{ + { + StructTypeFlag struct_flags_ReplyType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_ReplyType; + TypeIdentifierPair type_ids_ReplyType; + QualifiedTypeName type_name_ReplyType = "ReplyType"; + eprosima::fastcdr::optional type_ann_builtin_ReplyType; + eprosima::fastcdr::optional ann_custom_ReplyType; + CompleteTypeDetail detail_ReplyType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ReplyType, ann_custom_ReplyType, type_name_ReplyType.to_string()); + CompleteStructHeader header_ReplyType; + header_ReplyType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ReplyType); + CompleteStructMemberSeq member_seq_ReplyType; + { + return_code_ReplyType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ReplyType); + + if (return_code_ReplyType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "z Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_z = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_z; + MemberId member_id_z = 0x00000000; + if (EK_COMPLETE == type_ids_ReplyType.type_identifier1()._d() || TK_NONE == type_ids_ReplyType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ReplyType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ReplyType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_z = TypeObjectUtils::build_common_struct_member(member_id_z, member_flags_z, type_ids_ReplyType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ReplyType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ReplyType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ReplyType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_z = TypeObjectUtils::build_common_struct_member(member_id_z, member_flags_z, type_ids_ReplyType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure z member TypeIdentifier inconsistent."); + return; + } + MemberName name_z = "z"; + eprosima::fastcdr::optional member_ann_builtin_z; + ann_custom_ReplyType.reset(); + CompleteMemberDetail detail_z = TypeObjectUtils::build_complete_member_detail(name_z, member_ann_builtin_z, ann_custom_ReplyType); + CompleteStructMember member_z = TypeObjectUtils::build_complete_struct_member(common_z, detail_z); + TypeObjectUtils::add_complete_struct_member(member_seq_ReplyType, member_z); + } + CompleteStructType struct_type_ReplyType = TypeObjectUtils::build_complete_struct_type(struct_flags_ReplyType, header_ReplyType, member_seq_ReplyType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ReplyType, type_name_ReplyType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ReplyType already registered in TypeObjectRegistry for a different type."); + } + return_code_ReplyType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "ReplyType", type_ids_ReplyType); + if (return_code_ReplyType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ReplyType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp new file mode 100644 index 00000000000..fa71b03f7d9 --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file CalculatorTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Calculator_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register RequestType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_RequestType_type_identifier(); +/** + * @brief Register ReplyType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_ReplyType_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx b/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx deleted file mode 100644 index 50874dc3bc9..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Calculator.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Calculator.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define ReplyType_max_cdr_typesize 16ULL; -#define RequestType_max_cdr_typesize 16ULL; - - - - -RequestType::RequestType() -{ - // OperationType m_operation - m_operation = ::ADDITION; - // long m_x - m_x = 0; - // long m_y - m_y = 0; - -} - -RequestType::~RequestType() -{ -} - -RequestType::RequestType( - const RequestType& x) -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - -} - -RequestType::RequestType( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - -} - -RequestType& RequestType::operator =( - const RequestType& x) -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - - return *this; -} - -RequestType& RequestType::operator =( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - - return *this; -} - -bool RequestType::operator ==( - const RequestType& x) const -{ - return (m_operation == x.m_operation && - m_x == x.m_x && - m_y == x.m_y); -} - -bool RequestType::operator !=( - const RequestType& x) const -{ - return !(*this == x); -} - -size_t RequestType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return RequestType_max_cdr_typesize; -} - -size_t RequestType::getCdrSerializedSize( - const RequestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void RequestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_operation; - - scdr << m_x; - - scdr << m_y; - -} - -void RequestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_operation = (OperationType)enum_value; - } - - - - dcdr >> m_x; - - - - dcdr >> m_y; - - -} - - -bool RequestType::isKeyDefined() -{ - return false; -} - -void RequestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ -void RequestType::operation( - OperationType _operation) -{ - m_operation = _operation; -} - -/*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ -OperationType RequestType::operation() const -{ - return m_operation; -} - -/*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ -OperationType& RequestType::operation() -{ - return m_operation; -} - - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void RequestType::x( - int32_t _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -int32_t RequestType::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -int32_t& RequestType::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void RequestType::y( - int32_t _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -int32_t RequestType::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -int32_t& RequestType::y() -{ - return m_y; -} - - - - - -ReplyType::ReplyType() -{ - // long long m_z - m_z = 0; - -} - -ReplyType::~ReplyType() -{ -} - -ReplyType::ReplyType( - const ReplyType& x) -{ - m_z = x.m_z; - -} - -ReplyType::ReplyType( - ReplyType&& x) noexcept -{ - m_z = x.m_z; - -} - -ReplyType& ReplyType::operator =( - const ReplyType& x) -{ - m_z = x.m_z; - - return *this; -} - -ReplyType& ReplyType::operator =( - ReplyType&& x) noexcept -{ - m_z = x.m_z; - - return *this; -} - -bool ReplyType::operator ==( - const ReplyType& x) const -{ - return (m_z == x.m_z); -} - -bool ReplyType::operator !=( - const ReplyType& x) const -{ - return !(*this == x); -} - -size_t ReplyType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ReplyType_max_cdr_typesize; -} - -size_t ReplyType::getCdrSerializedSize( - const ReplyType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void ReplyType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_z; - -} - -void ReplyType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_z; - - -} - - -bool ReplyType::isKeyDefined() -{ - return false; -} - -void ReplyType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void ReplyType::z( - int64_t _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -int64_t ReplyType::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -int64_t& ReplyType::z() -{ - return m_z; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.h b/examples/cpp/dds/RequestReplyExample/Calculatorv1.h deleted file mode 100644 index af2bccef6ca..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculatorv1.h +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Calculator.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ -#define _FAST_DDS_GENERATED_CALCULATOR_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CALCULATOR_SOURCE) -#define CALCULATOR_DllAPI __declspec( dllexport ) -#else -#define CALCULATOR_DllAPI __declspec( dllimport ) -#endif // CALCULATOR_SOURCE -#else -#define CALCULATOR_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CALCULATOR_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration OperationType defined by the user in the IDL file. - * @ingroup Calculator - */ -enum OperationType : uint32_t -{ - ADDITION, - SUBTRACTION, - MULTIPLICATION, - DIVISION -}; - - -/*! - * @brief This class represents the structure RequestType defined by the user in the IDL file. - * @ingroup Calculator - */ -class RequestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RequestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RequestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - const RequestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - RequestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - const RequestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - RequestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RequestType& x) const; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RequestType& x) const; - - /*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ - eProsima_user_DllExport void operation( - OperationType _operation); - - /*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ - eProsima_user_DllExport OperationType operation() const; - - /*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ - eProsima_user_DllExport OperationType& operation(); - - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - int32_t _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport int32_t x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport int32_t& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - int32_t _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport int32_t y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport int32_t& y(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const RequestType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - OperationType m_operation; - int32_t m_x; - int32_t m_y; - -}; - - - -/*! - * @brief This class represents the structure ReplyType defined by the user in the IDL file. - * @ingroup Calculator - */ -class ReplyType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ReplyType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ReplyType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - const ReplyType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - ReplyType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - const ReplyType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - ReplyType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ReplyType& x) const; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ReplyType& x) const; - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - int64_t _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport int64_t z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport int64_t& z(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ReplyType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int64_t m_z; - -}; - - -#endif // _FAST_DDS_GENERATED_CALCULATOR_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/CMakeLists.txt b/examples/cpp/dds/SampleConfig_Controller/CMakeLists.txt index b806afaca8a..bfe106ab4a3 100644 --- a/examples/cpp/dds/SampleConfig_Controller/CMakeLists.txt +++ b/examples/cpp/dds/SampleConfig_Controller/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSSampleConfig_Controller PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSSampleConfig_Controller fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSSampleConfig_Controller fastdds fastcdr foonathan_memory) install(TARGETS DDSSampleConfig_Controller RUNTIME DESTINATION examples/cpp/dds/SampleConfig_Controller/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.cxx b/examples/cpp/dds/SampleConfig_Controller/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.h b/examples/cpp/dds/SampleConfig_Controller/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.hpp b/examples/cpp/dds/SampleConfig_Controller/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp index 9d3580e9a88..80fa6a39ab8 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp @@ -151,7 +151,7 @@ void safest() //Read the contents of both histories: std::cout << "The Reliable Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " (key " << static_cast(my_sample.key_value()) << ")" << std::endl; diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx b/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.h b/examples/cpp/dds/SampleConfig_Controller/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/CMakeLists.txt b/examples/cpp/dds/SampleConfig_Events/CMakeLists.txt index 58ce865c015..b13077c1140 100644 --- a/examples/cpp/dds/SampleConfig_Events/CMakeLists.txt +++ b/examples/cpp/dds/SampleConfig_Events/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSSampleConfig_Events PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSSampleConfig_Events fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSSampleConfig_Events fastdds fastcdr foonathan_memory) install(TARGETS DDSSampleConfig_Events RUNTIME DESTINATION examples/cpp/dds/SampleConfig_Events/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/SampleConfig_Events/README.txt b/examples/cpp/dds/SampleConfig_Events/README.txt index 885f13760b3..57515f0c7b0 100644 --- a/examples/cpp/dds/SampleConfig_Events/README.txt +++ b/examples/cpp/dds/SampleConfig_Events/README.txt @@ -80,7 +80,7 @@ Audio and Video transmission have a common characteristic: Having a stable, high - Distributed measurement: Controllers -Lets say we have a factory with a network of distributed temperature sensors and we want to use eProsima Fast RTPS to send data from said sensors to an automation computer which +Lets say we have a factory with a network of distributed temperature sensors and we want to use eProsima Fast DDS to send data from said sensors to an automation computer which makes decisions based on the temperature distribution. We would group all sensors within one single topic, Reliability: Reliable. We want to make sure samples are not lost. Furthermore, since reliable more ensures data delivery, it allows us to detect hardware problems when a sensor becomes silent diff --git a/examples/cpp/dds/SampleConfig_Events/sample.cxx b/examples/cpp/dds/SampleConfig_Events/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.h b/examples/cpp/dds/SampleConfig_Events/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.hpp b/examples/cpp/dds/SampleConfig_Events/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp index 97641f71866..72059ffa468 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp @@ -156,7 +156,7 @@ void triggers() //Read the contents of both histories: std::cout << "The Subscriber holds: " << std::endl; - while (myReader->take_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->take_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.cxx b/examples/cpp/dds/SampleConfig_Events/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.h b/examples/cpp/dds/SampleConfig_Events/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/CMakeLists.txt b/examples/cpp/dds/SampleConfig_Multimedia/CMakeLists.txt index 19862018d38..22d59bfdaac 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/CMakeLists.txt +++ b/examples/cpp/dds/SampleConfig_Multimedia/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(DDSSampleConfig_Multimedia PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSSampleConfig_Multimedia fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSSampleConfig_Multimedia fastdds fastcdr foonathan_memory) install(TARGETS DDSSampleConfig_Multimedia RUNTIME DESTINATION examples/cpp/dds/SampleConfig_Multimedia/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/dds/SampleConfig_Multimedia/README.txt b/examples/cpp/dds/SampleConfig_Multimedia/README.txt index 59c6346b9cf..542a16db64f 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/README.txt +++ b/examples/cpp/dds/SampleConfig_Multimedia/README.txt @@ -80,7 +80,7 @@ Audio and Video transmission have a common characteristic: Having a stable, high - Distributed measurement: Controllers -Lets say we have a factory with a network of distributed temperature sensors and we want to use eProsima Fast RTPS to send data from said sensors to an automation computer which +Lets say we have a factory with a network of distributed temperature sensors and we want to use eProsima Fast DDS to send data from said sensors to an automation computer which makes decisions based on the temperature distribution. We would group all sensors within one single topic, Reliability: Reliable. We want to make sure samples are not lost. Furthermore, since reliable more ensures data delivery, it allows us to detect hardware problems when a sensor becomes silent diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.h b/examples/cpp/dds/SampleConfig_Multimedia/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h index ec881115211..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp index 65e979b8bb7..f503f0daa63 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp @@ -149,7 +149,7 @@ void fastest() //Read the contents of both histories: std::cout << "The Reliable Subscriber (with a history depth of 5) holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h deleted file mode 100644 index 4fa288d1bc9..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/CMakeLists.txt b/examples/cpp/dds/SecureHelloWorldExample/CMakeLists.txt index a06592719d7..237263af779 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/CMakeLists.txt +++ b/examples/cpp/dds/SecureHelloWorldExample/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -48,7 +48,7 @@ target_compile_definitions(DDSSecureHelloWorldExample PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(DDSSecureHelloWorldExample PRIVATE) -target_link_libraries(DDSSecureHelloWorldExample fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSSecureHelloWorldExample fastdds fastcdr foonathan_memory) install(TARGETS DDSSecureHelloWorldExample RUNTIME DESTINATION examples/cpp/dds/SecureHelloWorldExample/${BIN_INSTALL_DIR}) install(DIRECTORY ${PROJECT_SOURCE_DIR}/certs diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h index ca01551f3c3..220e10338ce 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp index 175eb640873..5d505897f4d 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp @@ -143,7 +143,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h index 1c5c45faa0d..0d5cb38bfae 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld_main.cpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld_main.cpp index 9294faf0f43..215766a17e2 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld_main.cpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld_main.cpp @@ -17,15 +17,16 @@ * */ +#include + #include "HelloWorldPublisher.h" #include "HelloWorldSubscriber.h" -#include -#include - using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; + int main( int argc, char** argv) @@ -71,7 +72,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/CMakeLists.txt b/examples/cpp/dds/StaticHelloWorldExample/CMakeLists.txt index cbe65f36bc6..f9c95e72240 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/CMakeLists.txt +++ b/examples/cpp/dds/StaticHelloWorldExample/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -52,7 +52,7 @@ target_compile_definitions(DDSStaticHelloWorldExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSStaticHelloWorldExample fastrtps fastcdr foonathan_memory) +target_link_libraries(DDSStaticHelloWorldExample fastdds fastcdr foonathan_memory) install(TARGETS DDSStaticHelloWorldExample RUNTIME DESTINATION examples/cpp/dds/StaticHelloWorldExample/${BIN_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/HelloWorldPublisher_static_disc.xml diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h index cb61cd6ba23..a9b4ac119e0 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h index 6f37d220749..ec1b5312bcc 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h @@ -26,8 +26,7 @@ #include #include - -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp index 278d65536c4..7b38e634fd5 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp @@ -128,7 +128,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h index 6d45aadc167..5395d10e642 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h @@ -27,7 +27,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld_main.cpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld_main.cpp index d6806155bda..954b0f91ae8 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld_main.cpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld_main.cpp @@ -17,15 +17,16 @@ * */ +#include + #include "HelloWorldPublisher.h" #include "HelloWorldSubscriber.h" -#include -#include - using namespace eprosima; using namespace fastrtps; using namespace rtps; +using namespace eprosima::fastdds::dds; + int main( int argc, char** argv) @@ -72,7 +73,6 @@ int main( break; } } - Domain::stopAll(); Log::Reset(); return 0; } diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 9f6f726e0ab..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/TypeLookupService/CMakeLists.txt b/examples/cpp/dds/TypeLookupService/CMakeLists.txt deleted file mode 100644 index b53eb6cdae0..00000000000 --- a/examples/cpp/dds/TypeLookupService/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 3.20) - -project(TypeLookupExample VERSION 1 LANGUAGES CXX) - -# Find requirements -if(NOT fastcdr_FOUND) - find_package(fastcdr 2 REQUIRED) -endif() - -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) -endif() - -#Check C++11 -include(CheckCXXCompilerFlag) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11) - if(NOT SUPPORTS_CXX11) - message(FATAL_ERROR "Compiler doesn't support C++11") - endif() -endif() - -message(STATUS "Configuring TypeLookup example...") -file(GLOB DDS_TYPELOOKUP_EXAMPLE_SOURCES_CPP "*.cpp") - -add_executable(TypeLookupExample - ${DDS_TYPELOOKUP_EXAMPLE_SOURCES_CPP}) - -target_compile_definitions(TypeLookupExample PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. -) -target_link_libraries(TypeLookupExample fastrtps fastcdr) -install(TARGETS TypeLookupExample - RUNTIME DESTINATION examples/cpp/dds/TypeLookupService/${BIN_INSTALL_DIR}) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/example_type_profile.xml - DESTINATION examples/cpp/dds/TypeLookupService/${BIN_INSTALL_DIR}) - -file(COPY example_type_profile.xml DESTINATION ${PROJECT_BINARY_DIR}) diff --git a/examples/cpp/dds/TypeLookupService/README.txt b/examples/cpp/dds/TypeLookupService/README.txt deleted file mode 100644 index 69b047bf282..00000000000 --- a/examples/cpp/dds/TypeLookupService/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -To launch this test open two different consoles: - -In the first one launch: ./TypeLookupExample publisher -(or TypeLookupExample.exe publisher on windows). -In the second one: ./TypeLookupExample subscriber -(or TypeLookupExample.exe subscriber on windows). - -In this example, the publisher loads a type from the XML file "example_type_profile.xml". -The publisher shares the TypeInformation so other participants can discover it. - -After retrieving the type using the TypeLookup service, -the subscriber will discover the type and introspecting it will show the received messages from the publisher. - -The type defined in the XML file can be modified to see how the subscriber notices the changes automatically, -but take into account that the publisher should be modified to understand the changes. - -For this example, the root type must be a structure. diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp deleted file mode 100644 index 47e1e554712..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupPublisher.cpp - * - */ - -#include "TypeLookupPublisher.h" -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TypeLookupPublisher::TypeLookupPublisher() - : mp_participant(nullptr) - , mp_publisher(nullptr) -{ -} - -bool TypeLookupPublisher::init() -{ - if (xmlparser::XMLP_ret::XML_OK != - xmlparser::XMLProfileManager::loadXMLFile("example_type_profile.xml")) - { - std::cout << "Cannot open XML file \"example_type_profile.xml\". Please, run the publisher from the folder " - << "that contatins this XML file." << std::endl; - return false; - } - - types::DynamicType_ptr dyn_type = xmlparser::XMLProfileManager::getDynamicTypeByName("TypeLookup")->build(); - TypeSupport m_type(new types::DynamicPubSubType(dyn_type)); - m_Hello = types::DynamicDataFactory::get_instance()->create_data(dyn_type); - - m_Hello->set_string_value("Hello DDS Dynamic World", 0); - m_Hello->set_uint32_value(0, 1); - types::DynamicData* inner = m_Hello->loan_value(2); - inner->set_byte_value(10, 0); - m_Hello->return_loaned_value(inner); - - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = SIMPLE; - pqos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true; - pqos.wire_protocol().builtin.typelookup_config.use_server = true; - pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.name("Participant_pub"); - mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, pqos); - - if (mp_participant == nullptr) - { - return false; - } - - //REGISTER THE TYPE - m_type.get()->auto_fill_type_information(true); - m_type.get()->auto_fill_type_object(false); - m_type.register_type(mp_participant); - - //CREATE THE PUBLISHER - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - - if (mp_publisher == nullptr) - { - return false; - } - - topic_ = mp_participant->create_topic("TypeLookupTopic", "TypeLookup", TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return false; - } - - // CREATE THE WRITER - DataWriterQos wqos; - wqos.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; - wqos.history().depth = 30; - wqos.resource_limits().max_samples = 50; - wqos.resource_limits().allocated_samples = 20; - wqos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2; - wqos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 200 * 1000 * 1000; - writer_ = mp_publisher->create_datawriter(topic_, wqos, &m_listener); - - if (writer_ == nullptr) - { - return false; - } - - return true; - -} - -TypeLookupPublisher::~TypeLookupPublisher() -{ - if (writer_ != nullptr) - { - mp_publisher->delete_datawriter(writer_); - } - if (mp_publisher != nullptr) - { - mp_participant->delete_publisher(mp_publisher); - } - if (topic_ != nullptr) - { - mp_participant->delete_topic(topic_); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -void TypeLookupPublisher::PubListener::on_publication_matched( - eprosima::fastdds::dds::DataWriter*, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) -{ - if (info.current_count_change == 1) - { - n_matched++; - firstConnected = true; - std::cout << "Publisher matched" << std::endl; - } - else if (info.current_count_change == -1) - { - n_matched--; - std::cout << "Publisher unmatched" << std::endl; - } - else - { - std::cout << "Publisher received an invalid value for PublicationMatchedStatus." << std::endl; - } -} - -void TypeLookupPublisher::runThread( - uint32_t samples, - uint32_t sleep) -{ - if (samples == 0) - { - while (!stop) - { - if (publish(false)) - { - std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); - std::cout << "Message: " << message << " with index: " << index << " SENT" << std::endl; - } - std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); - } - } - else - { - for (uint32_t i = 0; i < samples; ++i) - { - if (!publish()) - { - --i; - } - else - { - std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); - std::cout << "Message: " << message << " with index: " << index << " SENT" << std::endl; - } - std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); - } - } -} - -void TypeLookupPublisher::run( - uint32_t samples, - uint32_t sleep) -{ - stop = false; - std::thread thread(&TypeLookupPublisher::runThread, this, samples, sleep); - if (samples == 0) - { - std::cout << "Publisher running. Please press enter to stop the Publisher at any time." << std::endl; - std::cin.ignore(); - stop = true; - } - else - { - std::cout << "Publisher running " << samples << " samples." << std::endl; - } - thread.join(); -} - -bool TypeLookupPublisher::publish( - bool waitForListener) -{ - if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0) - { - uint32_t index; - m_Hello->get_uint32_value(index, 1); - m_Hello->set_uint32_value(index + 1, 1); - types::DynamicData* inner = m_Hello->loan_value(2); - octet inner_count; - inner->get_byte_value(inner_count, 0); - inner->set_byte_value(inner_count + 1, 0); - m_Hello->return_loaned_value(inner); - writer_->write(m_Hello.get()); - return true; - } - return false; -} diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h deleted file mode 100644 index 567ac872c1e..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupPublisher.h - * - */ - -#ifndef HELLOWORLDPUBLISHER_H_ -#define HELLOWORLDPUBLISHER_H_ - -#include -#include - -#include -#include - -class TypeLookupPublisher -{ -public: - - TypeLookupPublisher(); - - virtual ~TypeLookupPublisher(); - - //!Initialize - bool init(); - - //!Publish a sample - bool publish( - bool waitForListener = true); - - //!Run for number samples - void run( - uint32_t number, - uint32_t sleep); - -private: - - eprosima::fastrtps::types::DynamicData_ptr m_Hello; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Publisher* mp_publisher; - - eprosima::fastdds::dds::Topic* topic_; - - eprosima::fastdds::dds::DataWriter* writer_; - - bool stop; - - class PubListener : public eprosima::fastdds::dds::DataWriterListener - { - public: - - PubListener() - : n_matched(0) - , firstConnected(false) - { - } - - ~PubListener() override - { - } - - void on_publication_matched( - eprosima::fastdds::dds::DataWriter* writer, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; - - int n_matched; - - bool firstConnected; - } - m_listener; - - void runThread( - uint32_t number, - uint32_t sleep); -}; - - - -#endif /* HELLOWORLDPUBLISHER_H_ */ diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp deleted file mode 100644 index 108822411d0..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupSubscriber.cpp - * - */ - -#include "TypeLookupSubscriber.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TypeLookupSubscriber::TypeLookupSubscriber() - : mp_participant(nullptr) - , mp_subscriber(nullptr) - , m_listener(this) -{ -} - -bool TypeLookupSubscriber::init() -{ - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = SIMPLE; - pqos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true; - pqos.wire_protocol().builtin.typelookup_config.use_client = true; - pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.name("Participant_sub"); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - StatusMask par_mask = StatusMask::subscription_matched() << StatusMask::data_available(); - mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, pqos, &m_listener, par_mask); - if (mp_participant == nullptr) - { - return false; - } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) - { - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); - return false; - } - - // CREATE THE COMMON READER ATTRIBUTES - qos_ = DATAREADER_QOS_DEFAULT; - qos_.durability().kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS; - qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; - qos_.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; - qos_.history().depth = 30; - qos_.resource_limits().max_samples = 50; - qos_.resource_limits().allocated_samples = 20; - - return true; -} - -TypeLookupSubscriber::~TypeLookupSubscriber() -{ - for (const auto& it : topics_) - { - mp_subscriber->delete_datareader(it.first); - mp_participant->delete_topic(it.second); - } - if (mp_subscriber != nullptr) - { - mp_participant->delete_subscriber(mp_subscriber); - } - - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); - topics_.clear(); - readers_.clear(); - datas_.clear(); -} - -void TypeLookupSubscriber::SubListener::on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) -{ - if (info.current_count_change == 1) - { - n_matched++; - std::cout << "Subscriber matched" << std::endl; - } - else if (info.current_count_change == -1) - { - n_matched--; - std::cout << "Subscriber unmatched" << std::endl; - auto itr = subscriber_->readers_.find(reader); - if (itr != subscriber_->readers_.end()) - { - subscriber_->readers_.erase(itr); - } - - auto itd = subscriber_->datas_.find(reader); - if (itd != subscriber_->datas_.end()) - { - subscriber_->datas_.erase(itd); - } - - if (subscriber_->mp_subscriber != nullptr) - { - subscriber_->mp_subscriber->delete_datareader(reader); - } - } - else - { - std::cout << "Subscriber received an invalid value for SubscriptionMatchedStatus." << std::endl; - } -} - -void TypeLookupSubscriber::SubListener::on_data_available( - eprosima::fastdds::dds::DataReader* reader) -{ - auto dit = subscriber_->datas_.find(reader); - - if (dit != subscriber_->datas_.end()) - { - types::DynamicData_ptr data = dit->second; - SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) - { - if (info.valid_data) - { - types::DynamicType_ptr type = subscriber_->readers_[reader]; - this->n_samples++; - std::cout << "Received data of type " << type->get_name() << std::endl; - types::DynamicDataHelper::print(data); - } - } - } -} - -void TypeLookupSubscriber::SubListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string& name, const types::DynamicType_ptr type) - { - std::cout << "Discovered type: " << name << " from topic " << topic_name << std::endl; - - if (subscriber_->mp_subscriber == nullptr) - { - //SubscriberAttributes Rparam; - //Rparam = subscriber_->att_; - //Rparam.topic = subscriber_->topic_; - //Rparam.topic.topicName = topic_name; - //Rparam.qos = subscriber_->qos_; - subscriber_->mp_subscriber = subscriber_->mp_participant->create_subscriber( - SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (subscriber_->mp_subscriber == nullptr) - { - return; - } - } - - //CREATE THE TOPIC - eprosima::fastdds::dds::Topic* topic = subscriber_->mp_participant->create_topic( - "TypeLookupTopic", - name, - TOPIC_QOS_DEFAULT); - - if (topic == nullptr) - { - return; - } - - StatusMask sub_mask = StatusMask::subscription_matched() << StatusMask::data_available(); - DataReader* reader = subscriber_->mp_subscriber->create_datareader( - topic, - subscriber_->qos_, - &subscriber_->m_listener, - sub_mask); - - if (type == nullptr) - { - const types::TypeIdentifier* ident = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(name); - - if (nullptr != ident) - { - const types::TypeObject* obj = - types::TypeObjectFactory::get_instance()->get_type_object(ident); - - types::DynamicType_ptr dyn_type = - types::TypeObjectFactory::get_instance()->build_dynamic_type(name, ident, obj); - - if (nullptr != dyn_type) - { - subscriber_->readers_[reader] = dyn_type; - types::DynamicData_ptr data( - types::DynamicDataFactory::get_instance()->create_data(dyn_type)); - subscriber_->datas_[reader] = data; - } - else - { - std::cout << "ERROR: DynamicType cannot be created for type: " << name << std::endl; - } - } - else - { - std::cout << "ERROR: TypeIdentifier cannot be retrieved for type: " << name << std::endl; - } - } - else - { - subscriber_->topics_[reader] = topic; - subscriber_->readers_[reader] = type; - types::DynamicData_ptr data(types::DynamicDataFactory::get_instance()->create_data(type)); - subscriber_->datas_[reader] = data; - } - }; - - subscriber_->mp_participant->register_remote_type( - type_information, - type_name.to_string(), - callback); -} - -void TypeLookupSubscriber::run() -{ - std::cout << "Subscriber running. Please press enter to stop the Subscriber" << std::endl; - std::cin.ignore(); -} - -void TypeLookupSubscriber::run( - uint32_t number) -{ - std::cout << "Subscriber running until " << number << " samples have been received" << std::endl; - while (number > this->m_listener.n_samples) - { - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - } -} diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h deleted file mode 100644 index 07654ce8019..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupSubscriber.h - * - */ - -#ifndef HELLOWORLDSUBSCRIBER_H_ -#define HELLOWORLDSUBSCRIBER_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -class TypeLookupSubscriber -{ -public: - - TypeLookupSubscriber(); - - virtual ~TypeLookupSubscriber(); - - //!Initialize the subscriber - bool init(); - - //!RUN the subscriber - void run(); - - //!Run the subscriber until number samples have been received. - void run( - uint32_t number); - -private: - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Subscriber* mp_subscriber; - - std::map topics_; - - std::map readers_; - - std::map datas_; - - eprosima::fastrtps::SubscriberAttributes att_; - - eprosima::fastdds::dds::DataReaderQos qos_; - -public: - - class SubListener - : public eprosima::fastdds::dds::DomainParticipantListener - { - public: - - SubListener( - TypeLookupSubscriber* sub) - : n_matched(0) - , n_samples(0) - , subscriber_(sub) - { - } - - ~SubListener() override - { - } - - void on_data_available( - eprosima::fastdds::dds::DataReader* reader) override; - - void on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - int n_matched; - - uint32_t n_samples; - - TypeLookupSubscriber* subscriber_; - - std::map topic_type_map_; - - eprosima::fastrtps::types::TypeInformation type_info_; - } - m_listener; - -private: - - eprosima::fastrtps::types::DynamicPubSubType m_type; -}; - -#endif /* HELLOWORLDSUBSCRIBER_H_ */ diff --git a/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp b/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp deleted file mode 100644 index cf11cf2a71c..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookup_main.cpp - * - */ - -#include "TypeLookupPublisher.h" -#include "TypeLookupSubscriber.h" - -#include - -using namespace eprosima::fastrtps; - -int main( - int argc, - char** argv) -{ - std::cout << "Starting " << std::endl; - int type = 1; - int count = 5; - long sleep = 100; - if (argc > 1) - { - if (strcmp(argv[1], "publisher") == 0) - { - type = 1; - if (argc >= 3) - { - count = atoi(argv[2]); - if (argc == 4) - { - sleep = atoi(argv[3]); - } - } - } - else if (strcmp(argv[1], "subscriber") == 0) - { - type = 2; - } - } - else - { - std::cout << "publisher OR subscriber argument needed" << std::endl; - Log::Reset(); - return 0; - } - - switch (type) - { - case 1: - { - TypeLookupPublisher mypub; - if (mypub.init()) - { - mypub.run(count, sleep); - } - break; - } - case 2: - { - TypeLookupSubscriber mysub; - if (mysub.init()) - { - mysub.run(); - } - break; - } - } - Log::Reset(); - return 0; -} diff --git a/examples/cpp/dds/TypeLookupService/example_type_profile.xml b/examples/cpp/dds/TypeLookupService/example_type_profile.xml deleted file mode 100644 index d11369f1e39..00000000000 --- a/examples/cpp/dds/TypeLookupService/example_type_profile.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/cpp/dds/WriterLoansExample/CMakeLists.txt b/examples/cpp/dds/WriterLoansExample/CMakeLists.txt index 4aceabc3907..7acc8fa94ac 100644 --- a/examples/cpp/dds/WriterLoansExample/CMakeLists.txt +++ b/examples/cpp/dds/WriterLoansExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(DDSWriterLoansExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSWriterLoansExample fastrtps fastcdr) +target_link_libraries(DDSWriterLoansExample fastdds fastcdr) install(TARGETS DDSWriterLoansExample RUNTIME DESTINATION examples/cpp/dds/WriterLoansExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx deleted file mode 100644 index 54ca2b05ab0..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LoanableHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h deleted file mode 100644 index 80d8feaca9b..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "LoanableHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - -private: - - uint32_t m_index{0}; - std::array m_message{0}; - -}; - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp new file mode 100644 index 00000000000..1567811078c --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp @@ -0,0 +1,226 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ + +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LOANABLEHELLOWORLD_SOURCE) +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // LOANABLEHELLOWORLD_SOURCE +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. + * @ingroup LoanableHelloWorld + */ +class LoanableHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoanableHelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoanableHelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + const LoanableHelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + const LoanableHelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + LoanableHelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoanableHelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoanableHelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::array m_message{0}; + +}; + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp index c29aaedaaff..8fc200fee77 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" constexpr uint32_t LoanableHelloWorld_max_cdr_typesize {260UL}; constexpr uint32_t LoanableHelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp index 640061e832c..2c932b2b441 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx index 668ff484ea0..5ce26c2a2ed 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LoanableHelloWorldPubSubTypes.h" +#include #include -#include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" +#include "LoanableHelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); @@ -219,3 +219,11 @@ bool LoanableHelloWorldPubSubType::getKey( return true; } +void LoanableHelloWorldPubSubType::register_type_object_representation() const +{ + register_LoanableHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LoanableHelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h index 06ba8663ef8..33525ee7726 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - #ifndef SWIG namespace detail { @@ -123,6 +121,9 @@ class LoanableHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx index 44ec5a404fd..9407dce4f3d 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx @@ -140,7 +140,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { LoanableHelloWorld* data = static_cast(sample); data->index() = msgsent + 1; diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx index 6ebf7a6f077..dfa87a321bb 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx @@ -127,7 +127,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( LoanableHelloWorld st; SampleInfo info; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..212eb4a6d62 --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,313 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LoanableHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LoanableHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_LoanableHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_LoanableHelloWorld_type_identifier(); + + }); +} + +void register_LoanableHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_LoanableHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_LoanableHelloWorld; + TypeIdentifierPair type_ids_LoanableHelloWorld; + QualifiedTypeName type_name_LoanableHelloWorld = "LoanableHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_LoanableHelloWorld; + eprosima::fastcdr::optional ann_custom_LoanableHelloWorld; + AppliedAnnotationSeq tmp_ann_custom_LoanableHelloWorld; + eprosima::fastcdr::optional verbatim_LoanableHelloWorld; + if (!tmp_ann_custom_LoanableHelloWorld.empty()) + { + ann_custom_LoanableHelloWorld = tmp_ann_custom_LoanableHelloWorld; + } + + CompleteTypeDetail detail_LoanableHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LoanableHelloWorld, ann_custom_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string()); + CompleteStructHeader header_LoanableHelloWorld; + header_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LoanableHelloWorld); + CompleteStructMemberSeq member_seq_LoanableHelloWorld; + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LoanableHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_index); + } + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_256 {nullptr}; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_256 = EK_COMPLETE; + if (TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_256 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_256 = 0; + PlainCollectionHeader header_anonymous_array_char_256 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_256, element_flags_anonymous_array_char_256); + std::string type_id_kind_anonymous_array_char_256("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_256 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_LoanableHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_message); + } + CompleteStructType struct_type_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_LoanableHelloWorld, header_LoanableHelloWorld, member_seq_LoanableHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "LoanableHelloWorld", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..101fafc55f4 --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_LoanableHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register LoanableHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_LoanableHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx deleted file mode 100644 index 63da3dfddbc..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define LoanableHelloWorld_max_cdr_typesize 260ULL; - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((256)) * 1); - -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -size_t LoanableHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LoanableHelloWorld_max_cdr_typesize; -} - -size_t LoanableHelloWorld::getCdrSerializedSize( - const LoanableHelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void LoanableHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void LoanableHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool LoanableHelloWorld::isKeyDefined() -{ - return false; -} - -void LoanableHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h deleted file mode 100644 index 1c13fed5575..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LoanableHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/CMakeLists.txt b/examples/cpp/dds/ZeroCopyExample/CMakeLists.txt index 817e2028164..468ffbade99 100644 --- a/examples/cpp/dds/ZeroCopyExample/CMakeLists.txt +++ b/examples/cpp/dds/ZeroCopyExample/CMakeLists.txt @@ -21,8 +21,8 @@ if(NOT fastcdr_FOUND) find_package(fastcdr 2 REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -43,6 +43,6 @@ target_compile_definitions(DDSZeroCopyExample PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(DDSZeroCopyExample fastrtps fastcdr) +target_link_libraries(DDSZeroCopyExample fastdds fastcdr) install(TARGETS DDSZeroCopyExample RUNTIME DESTINATION examples/cpp/dds/ZeroCopyExample/${BIN_INSTALL_DIR}) diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx deleted file mode 100644 index 54ca2b05ab0..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LoanableHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h deleted file mode 100644 index 80d8feaca9b..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "LoanableHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - -private: - - uint32_t m_index{0}; - std::array m_message{0}; - -}; - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp new file mode 100644 index 00000000000..1567811078c --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp @@ -0,0 +1,226 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ + +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LOANABLEHELLOWORLD_SOURCE) +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // LOANABLEHELLOWORLD_SOURCE +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. + * @ingroup LoanableHelloWorld + */ +class LoanableHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoanableHelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoanableHelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + const LoanableHelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + const LoanableHelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + LoanableHelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoanableHelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoanableHelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::array m_message{0}; + +}; + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp index c29aaedaaff..8fc200fee77 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" constexpr uint32_t LoanableHelloWorld_max_cdr_typesize {260UL}; constexpr uint32_t LoanableHelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp index 640061e832c..2c932b2b441 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx index 668ff484ea0..5ce26c2a2ed 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LoanableHelloWorldPubSubTypes.h" +#include #include -#include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" +#include "LoanableHelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); @@ -219,3 +219,11 @@ bool LoanableHelloWorldPubSubType::getKey( return true; } +void LoanableHelloWorldPubSubType::register_type_object_representation() const +{ + register_LoanableHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LoanableHelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h index 06ba8663ef8..33525ee7726 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - #ifndef SWIG namespace detail { @@ -123,6 +121,9 @@ class LoanableHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx index 0854b6ebd47..e19c18d90ec 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx @@ -144,7 +144,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { std::cout << "Preparing sample at address " << sample << std::endl; LoanableHelloWorld* data = static_cast(sample); diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx index 67d9b286824..15fa0200bfd 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx @@ -130,7 +130,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( DataSeq data; SampleInfoSeq infos; - while (ReturnCode_t::RETCODE_OK == reader->take(data, infos)) + while (RETCODE_OK == reader->take(data, infos)) { for (LoanableCollection::size_type i = 0; i < infos.length(); ++i) { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..212eb4a6d62 --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,313 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LoanableHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LoanableHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_LoanableHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_LoanableHelloWorld_type_identifier(); + + }); +} + +void register_LoanableHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_LoanableHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_LoanableHelloWorld; + TypeIdentifierPair type_ids_LoanableHelloWorld; + QualifiedTypeName type_name_LoanableHelloWorld = "LoanableHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_LoanableHelloWorld; + eprosima::fastcdr::optional ann_custom_LoanableHelloWorld; + AppliedAnnotationSeq tmp_ann_custom_LoanableHelloWorld; + eprosima::fastcdr::optional verbatim_LoanableHelloWorld; + if (!tmp_ann_custom_LoanableHelloWorld.empty()) + { + ann_custom_LoanableHelloWorld = tmp_ann_custom_LoanableHelloWorld; + } + + CompleteTypeDetail detail_LoanableHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LoanableHelloWorld, ann_custom_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string()); + CompleteStructHeader header_LoanableHelloWorld; + header_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LoanableHelloWorld); + CompleteStructMemberSeq member_seq_LoanableHelloWorld; + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LoanableHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_index); + } + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_256 {nullptr}; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_256 = EK_COMPLETE; + if (TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_256 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_256 = 0; + PlainCollectionHeader header_anonymous_array_char_256 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_256, element_flags_anonymous_array_char_256); + std::string type_id_kind_anonymous_array_char_256("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_256 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_LoanableHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_message); + } + CompleteStructType struct_type_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_LoanableHelloWorld, header_LoanableHelloWorld, member_seq_LoanableHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "LoanableHelloWorld", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..101fafc55f4 --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file LoanableHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_LoanableHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register LoanableHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_LoanableHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx deleted file mode 100644 index 63da3dfddbc..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define LoanableHelloWorld_max_cdr_typesize 260ULL; - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((256)) * 1); - -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -size_t LoanableHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LoanableHelloWorld_max_cdr_typesize; -} - -size_t LoanableHelloWorld::getCdrSerializedSize( - const LoanableHelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void LoanableHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void LoanableHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool LoanableHelloWorld::isKeyDefined() -{ - return false; -} - -void LoanableHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h deleted file mode 100644 index 1c13fed5575..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LoanableHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/rtps/AsSocket/CMakeLists.txt b/examples/cpp/rtps/AsSocket/CMakeLists.txt index 27e868d53f0..5fcdcb79a42 100644 --- a/examples/cpp/rtps/AsSocket/CMakeLists.txt +++ b/examples/cpp/rtps/AsSocket/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(AsSocket PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(AsSocket fastrtps fastcdr foonathan_memory) +target_link_libraries(AsSocket fastdds fastcdr foonathan_memory) install(TARGETS AsSocket RUNTIME DESTINATION examples/cpp/rtps/AsSocket/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/rtps/AsSocket/TestReaderSocket.cpp b/examples/cpp/rtps/AsSocket/TestReaderSocket.cpp index d2741a7e9be..32f08e6f877 100644 --- a/examples/cpp/rtps/AsSocket/TestReaderSocket.cpp +++ b/examples/cpp/rtps/AsSocket/TestReaderSocket.cpp @@ -19,16 +19,14 @@ #include "TestReaderSocket.h" -#include "fastrtps/rtps/reader/RTPSReader.h" -#include "fastrtps/rtps/participant/RTPSParticipant.h" -#include "fastrtps/rtps/RTPSDomain.h" - -#include "fastrtps/rtps/attributes/RTPSParticipantAttributes.h" -#include "fastrtps/rtps/attributes/ReaderAttributes.h" -#include "fastrtps/rtps/attributes/HistoryAttributes.h" - -#include "fastrtps/rtps/history/ReaderHistory.h" -#include "fastrtps/utils/IPLocator.h" +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/examples/cpp/rtps/AsSocket/TestReaderSocket.h b/examples/cpp/rtps/AsSocket/TestReaderSocket.h index c7f815b48d5..6f562eb6c0f 100644 --- a/examples/cpp/rtps/AsSocket/TestReaderSocket.h +++ b/examples/cpp/rtps/AsSocket/TestReaderSocket.h @@ -20,10 +20,8 @@ #ifndef TESTREADERSOCKET_H_ #define TESTREADERSOCKET_H_ -#include "fastrtps/rtps/rtps_fwd.h" - - -#include "fastrtps/rtps/reader/ReaderListener.h" +#include +#include class TestReaderSocket { diff --git a/examples/cpp/rtps/AsSocket/TestWriterSocket.cpp b/examples/cpp/rtps/AsSocket/TestWriterSocket.cpp index 9579c7baecb..4b8b4f8a1ad 100644 --- a/examples/cpp/rtps/AsSocket/TestWriterSocket.cpp +++ b/examples/cpp/rtps/AsSocket/TestWriterSocket.cpp @@ -19,18 +19,15 @@ #include "TestWriterSocket.h" -#include "fastrtps/rtps/writer/RTPSWriter.h" -#include "fastrtps/rtps/participant/RTPSParticipant.h" -#include "fastrtps/rtps/RTPSDomain.h" - -#include "fastrtps/rtps/attributes/RTPSParticipantAttributes.h" -#include "fastrtps/rtps/attributes/WriterAttributes.h" -#include "fastrtps/rtps/attributes/HistoryAttributes.h" - -#include "fastrtps/rtps/builtin/data/ReaderProxyData.h" - -#include "fastrtps/rtps/history/WriterHistory.h" -#include "fastrtps/utils/IPLocator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/examples/cpp/rtps/AsSocket/TestWriterSocket.h b/examples/cpp/rtps/AsSocket/TestWriterSocket.h index 08202aacfe6..e3b1da2eaa5 100644 --- a/examples/cpp/rtps/AsSocket/TestWriterSocket.h +++ b/examples/cpp/rtps/AsSocket/TestWriterSocket.h @@ -20,12 +20,11 @@ #ifndef TESTWRITERSOCKET_H_ #define TESTWRITERSOCKET_H_ -#include "fastrtps/rtps/rtps_fwd.h" - - -#include -#include #include +#include +#include + +#include class TestWriterSocket { diff --git a/examples/cpp/rtps/AsSocket/main_RTPSTest.cpp b/examples/cpp/rtps/AsSocket/main_RTPSTest.cpp index 12a4046a076..1b15de7c479 100644 --- a/examples/cpp/rtps/AsSocket/main_RTPSTest.cpp +++ b/examples/cpp/rtps/AsSocket/main_RTPSTest.cpp @@ -12,16 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include #include #include +#include +#include +#include #include +#include -#include "fastrtps/log/Log.h" -#include "fastrtps/rtps/RTPSDomain.h" +#include #include "TestWriterSocket.h" #include "TestReaderSocket.h" @@ -31,7 +30,6 @@ using namespace fastrtps; using namespace rtps; using namespace std; - int main( int argc, char** argv) diff --git a/examples/cpp/rtps/Persistent/CMakeLists.txt b/examples/cpp/rtps/Persistent/CMakeLists.txt index 0463dd49a79..4766274f096 100644 --- a/examples/cpp/rtps/Persistent/CMakeLists.txt +++ b/examples/cpp/rtps/Persistent/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(Persistent PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(Persistent fastrtps fastcdr foonathan_memory) +target_link_libraries(Persistent fastdds fastcdr foonathan_memory) install(TARGETS Persistent RUNTIME DESTINATION examples/cpp/rtps/Persistent/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/rtps/Persistent/TestReaderPersistent.cpp b/examples/cpp/rtps/Persistent/TestReaderPersistent.cpp index d5335281463..533ca73bc64 100644 --- a/examples/cpp/rtps/Persistent/TestReaderPersistent.cpp +++ b/examples/cpp/rtps/Persistent/TestReaderPersistent.cpp @@ -19,18 +19,15 @@ #include "TestReaderPersistent.h" -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -94,7 +91,7 @@ bool TestReaderPersistent::reg() Tatt.topicKind = NO_KEY; Tatt.topicDataType = "string"; Tatt.topicName = "exampleTopic"; - ReaderQos Rqos; + eprosima::fastdds::dds::ReaderQos Rqos; return mp_participant->registerReader(mp_reader, Tatt, Rqos); } diff --git a/examples/cpp/rtps/Persistent/TestReaderPersistent.h b/examples/cpp/rtps/Persistent/TestReaderPersistent.h index b55f4aa9cdc..ce635e11f33 100644 --- a/examples/cpp/rtps/Persistent/TestReaderPersistent.h +++ b/examples/cpp/rtps/Persistent/TestReaderPersistent.h @@ -20,10 +20,8 @@ #ifndef TESTREADERPERSISTENT_H_ #define TESTREADERPERSISTENT_H_ -#include - - -#include +#include +#include class TestReaderPersistent { diff --git a/examples/cpp/rtps/Persistent/TestWriterPersistent.cpp b/examples/cpp/rtps/Persistent/TestWriterPersistent.cpp index 02be80fb581..0170d72bd9e 100644 --- a/examples/cpp/rtps/Persistent/TestWriterPersistent.cpp +++ b/examples/cpp/rtps/Persistent/TestWriterPersistent.cpp @@ -22,15 +22,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -97,7 +97,7 @@ bool TestWriterPersistent::reg() Tatt.topicKind = NO_KEY; Tatt.topicDataType = "string"; Tatt.topicName = "exampleTopic"; - WriterQos Wqos; + eprosima::fastdds::dds::WriterQos Wqos; return mp_participant->registerWriter(mp_writer, Tatt, Wqos); } diff --git a/examples/cpp/rtps/Persistent/TestWriterPersistent.h b/examples/cpp/rtps/Persistent/TestWriterPersistent.h index 6ea3716369f..24eba95a982 100644 --- a/examples/cpp/rtps/Persistent/TestWriterPersistent.h +++ b/examples/cpp/rtps/Persistent/TestWriterPersistent.h @@ -20,10 +20,8 @@ #ifndef TESTWRITERPERSISTENT_H_ #define TESTWRITERPERSISTENT_H_ -#include - - -#include +#include +#include class TestWriterPersistent { diff --git a/examples/cpp/rtps/Persistent/main_RTPSTest.cpp b/examples/cpp/rtps/Persistent/main_RTPSTest.cpp index c3361bbb7f2..171675f3bef 100644 --- a/examples/cpp/rtps/Persistent/main_RTPSTest.cpp +++ b/examples/cpp/rtps/Persistent/main_RTPSTest.cpp @@ -12,26 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include #include #include +#include +#include +#include #include +#include -#include -#include +#include -#include "TestWriterPersistent.h" #include "TestReaderPersistent.h" +#include "TestWriterPersistent.h" using namespace eprosima; using namespace fastrtps; using namespace rtps; using namespace std; - int main( int argc, char** argv) diff --git a/examples/cpp/rtps/Registered/CMakeLists.txt b/examples/cpp/rtps/Registered/CMakeLists.txt index 3cd10781e41..d28ff14cadd 100644 --- a/examples/cpp/rtps/Registered/CMakeLists.txt +++ b/examples/cpp/rtps/Registered/CMakeLists.txt @@ -25,8 +25,8 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() #Check C++11 @@ -46,7 +46,7 @@ target_compile_definitions(Registered PRIVATE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) -target_link_libraries(Registered fastrtps fastcdr foonathan_memory) +target_link_libraries(Registered fastdds fastcdr foonathan_memory) install(TARGETS Registered RUNTIME DESTINATION examples/cpp/rtps/Registered/${BIN_INSTALL_DIR} ) diff --git a/examples/cpp/rtps/Registered/TestReaderRegistered.cpp b/examples/cpp/rtps/Registered/TestReaderRegistered.cpp index b0feb7c7755..e5cfb2ffd67 100644 --- a/examples/cpp/rtps/Registered/TestReaderRegistered.cpp +++ b/examples/cpp/rtps/Registered/TestReaderRegistered.cpp @@ -19,18 +19,15 @@ #include "TestReaderRegistered.h" -#include "fastrtps/rtps/reader/RTPSReader.h" -#include "fastrtps/rtps/participant/RTPSParticipant.h" -#include "fastrtps/rtps/RTPSDomain.h" - -#include "fastrtps/rtps/attributes/RTPSParticipantAttributes.h" -#include "fastrtps/rtps/attributes/ReaderAttributes.h" -#include "fastrtps/rtps/attributes/HistoryAttributes.h" - -#include "fastrtps/rtps/history/ReaderHistory.h" - -#include "fastrtps/attributes/TopicAttributes.h" -#include "fastrtps/qos/ReaderQos.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -86,7 +83,7 @@ bool TestReaderRegistered::reg() Tatt.topicKind = NO_KEY; Tatt.topicDataType = "string"; Tatt.topicName = "exampleTopic"; - ReaderQos Rqos; + eprosima::fastdds::dds::ReaderQos Rqos; return mp_participant->registerReader(mp_reader, Tatt, Rqos); } diff --git a/examples/cpp/rtps/Registered/TestReaderRegistered.h b/examples/cpp/rtps/Registered/TestReaderRegistered.h index 3c1799b7654..860133aefd9 100644 --- a/examples/cpp/rtps/Registered/TestReaderRegistered.h +++ b/examples/cpp/rtps/Registered/TestReaderRegistered.h @@ -20,10 +20,8 @@ #ifndef TESTREADERREGISTERED_H_ #define TESTREADERREGISTERED_H_ -#include "fastrtps/rtps/rtps_fwd.h" - - -#include "fastrtps/rtps/reader/ReaderListener.h" +#include +#include class TestReaderRegistered { diff --git a/examples/cpp/rtps/Registered/TestWriterRegistered.cpp b/examples/cpp/rtps/Registered/TestWriterRegistered.cpp index 04155160eb0..05071191227 100644 --- a/examples/cpp/rtps/Registered/TestWriterRegistered.cpp +++ b/examples/cpp/rtps/Registered/TestWriterRegistered.cpp @@ -22,15 +22,15 @@ #include #include -#include "fastrtps/attributes/TopicAttributes.h" -#include "fastrtps/qos/WriterQos.h" -#include "fastrtps/rtps/attributes/HistoryAttributes.h" -#include "fastrtps/rtps/attributes/RTPSParticipantAttributes.h" -#include "fastrtps/rtps/attributes/WriterAttributes.h" -#include "fastrtps/rtps/history/WriterHistory.h" -#include "fastrtps/rtps/participant/RTPSParticipant.h" -#include "fastrtps/rtps/RTPSDomain.h" -#include "fastrtps/rtps/writer/RTPSWriter.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -88,7 +88,7 @@ bool TestWriterRegistered::reg() Tatt.topicKind = NO_KEY; Tatt.topicDataType = "string"; Tatt.topicName = "exampleTopic"; - WriterQos Wqos; + eprosima::fastdds::dds::WriterQos Wqos; return mp_participant->registerWriter(mp_writer, Tatt, Wqos); } diff --git a/examples/cpp/rtps/Registered/TestWriterRegistered.h b/examples/cpp/rtps/Registered/TestWriterRegistered.h index 110d176e4a4..3e7776d080e 100644 --- a/examples/cpp/rtps/Registered/TestWriterRegistered.h +++ b/examples/cpp/rtps/Registered/TestWriterRegistered.h @@ -20,10 +20,8 @@ #ifndef TESTWRITERREGISTERED_H_ #define TESTWRITERREGISTERED_H_ -#include "fastrtps/rtps/rtps_fwd.h" - - -#include "fastrtps/rtps/writer/WriterListener.h" +#include +#include class TestWriterRegistered { diff --git a/examples/cpp/rtps/Registered/main_RTPSTest.cpp b/examples/cpp/rtps/Registered/main_RTPSTest.cpp index d66129c0ee9..cf444a2a450 100644 --- a/examples/cpp/rtps/Registered/main_RTPSTest.cpp +++ b/examples/cpp/rtps/Registered/main_RTPSTest.cpp @@ -12,26 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include #include #include +#include +#include +#include #include +#include -#include "fastrtps/log/Log.h" -#include "fastrtps/rtps/RTPSDomain.h" +#include -#include "TestWriterRegistered.h" #include "TestReaderRegistered.h" +#include "TestWriterRegistered.h" using namespace eprosima; using namespace fastrtps; using namespace rtps; using namespace std; - int main( int argc, char** argv) diff --git a/fastdds.repos b/fastdds.repos new file mode 100644 index 00000000000..0d5f2cd5217 --- /dev/null +++ b/fastdds.repos @@ -0,0 +1,17 @@ +repositories: + foonathan_memory_vendor: + type: git + url: https://github.com/eProsima/foonathan_memory_vendor.git + version: master + fastcdr: + type: git + url: https://github.com/eProsima/Fast-CDR.git + version: master + fastdds: + type: git + url: https://github.com/eProsima/Fast-DDS.git + version: 3.0.x-devel + fastddsgen: + type: git + url: https://github.com/eProsima/Fast-DDS-Gen.git + version: 4.0.x-devel diff --git a/fastrtps.repos b/fastrtps.repos deleted file mode 100644 index 69dec7e99cd..00000000000 --- a/fastrtps.repos +++ /dev/null @@ -1,17 +0,0 @@ -repositories: - foonathan_memory_vendor: - type: git - url: https://github.com/eProsima/foonathan_memory_vendor.git - version: master - fastcdr: - type: git - url: https://github.com/eProsima/Fast-CDR.git - version: master - fastrtps: - type: git - url: https://github.com/eProsima/Fast-DDS.git - version: master - fastddsgen: - type: git - url: https://github.com/eProsima/Fast-DDS-Gen.git - version: master diff --git a/fuzz/C++/fuzz_XMLProfiles/CMakeLists.txt b/fuzz/C++/fuzz_XMLProfiles/CMakeLists.txt index f40256d20a4..e06af4c0bdf 100644 --- a/fuzz/C++/fuzz_XMLProfiles/CMakeLists.txt +++ b/fuzz/C++/fuzz_XMLProfiles/CMakeLists.txt @@ -25,12 +25,12 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() message(STATUS "Configuring fuzz_XMLProfiles...") file(GLOB SOURCES_CXX "*.cxx") add_executable(fuzz_XMLProfiles ${SOURCES_CXX} ${SOURCES_CPP}) -target_link_libraries(fuzz_XMLProfiles fastrtps fastcdr foonathan_memory $ENV{LIB_FUZZING_ENGINE}) +target_link_libraries(fuzz_XMLProfiles fastdds fastcdr foonathan_memory $ENV{LIB_FUZZING_ENGINE}) diff --git a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx index c5f953147f5..60dfb3fe62c 100644 --- a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx +++ b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx @@ -1,7 +1,7 @@ -#include - #include "fuzz_utils.h" +#include + using namespace eprosima; using namespace eprosima::fastrtps; diff --git a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles_seed_corpus/1c82a2c60044985396a5dbbe58ad7fcc5d852d38 b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles_seed_corpus/1c82a2c60044985396a5dbbe58ad7fcc5d852d38 index 3ed7cce679a..e807c4c68d8 100644 --- a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles_seed_corpus/1c82a2c60044985396a5dbbe58ad7fcc5d852d38 +++ b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles_seed_corpus/1c82a2c60044985396a5dbbe58ad7fcc5d852d38 @@ -1,5 +1,5 @@ - + 80 diff --git a/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt b/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt index 0cf01c3bbd4..ea93ded57f6 100644 --- a/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt +++ b/fuzz/C++/fuzz_processCDRMsg/CMakeLists.txt @@ -11,12 +11,13 @@ if(NOT foonathan_memory_FOUND) find_package(foonathan_memory REQUIRED) endif() -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() message(STATUS "Configuring fuzz_processCDRMsg...") file(GLOB SOURCES_CXX "fuzz_*.cxx") add_executable(fuzz_processCDRMsg ${SOURCES_CXX}) -target_link_libraries(fuzz_processCDRMsg fastrtps fastcdr foonathan_memory $ENV{LIB_FUZZING_ENGINE}) +target_include_directories(fuzz_processCDRMsg PRIVATE ${CMAKE_SOURCE_DIR}/src/cpp/rtps/messages) +target_link_libraries(fuzz_processCDRMsg fastdds fastcdr foonathan_memory $ENV{LIB_FUZZING_ENGINE}) diff --git a/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx b/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx index 88c26a5b475..cc1d1faa45c 100644 --- a/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx +++ b/fuzz/C++/fuzz_processCDRMsg/fuzz_processCDRMsg.cxx @@ -4,9 +4,10 @@ #include #include -#include #include +#include + #define MIN_SIZE RTPSMESSAGE_HEADER_SIZE #define MAX_SIZE 64000 diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index d946f714f47..29c48a68c5b 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(fastrtps_FOUND TRUE) +set(fastdds_FOUND TRUE) add_subdirectory(C++/fuzz_XMLProfiles) add_subdirectory(C++/fuzz_processCDRMsg) \ No newline at end of file diff --git a/include/dds/core/BuiltinTopicTypes.hpp b/include/dds/core/BuiltinTopicTypes.hpp deleted file mode 100644 index 46bdcb9ef45..00000000000 --- a/include/dds/core/BuiltinTopicTypes.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_BUILTIN_TOPIC_TYPES_HPP_ -#define OMG_DDS_CORE_BUILTIN_TOPIC_TYPES_HPP_ - -#include -#include - -#if defined (OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT) -namespace dds { -namespace core { - -/** - * @brief - * Class that is a built-in topic type that can be used to readily create Topics, - * DataReaders and DataWriters for this type without the need for code generation. - * - * This built-in type allows for easy transfer of vectors of bytes. - */ -template -class TBytesTopicType : public Value -{ -public: - - /** - * Creates topic type with an empty byte vector. - */ - TBytesTopicType(); - - /** - * Creates topic type with the given byte vector. - */ - TBytesTopicType( - const std::vector& data); - - /** - * Conversion operator to a vector of bytes. - */ - operator std::vector&() const; - - /** - * Getter function for the internal vector of bytes. - */ - const std::vector& data() const; - - /** - * Setter function for the internal vector of bytes. - */ - void data( - const std::vector& data); -}; - - -/** - * @brief - * Class that is a built-in topic type that can be used to readily create Topics, - * DataReaders and DataWriters for this type without the need for code generation. - * - * This built-in type allows for easy transfer of strings. - */ -template -class TStringTopicType : public Value -{ -public: - - /** - * Creates topic type with an empty data string. - */ - TStringTopicType(); - - /** - * Creates topic type with the given string. - */ - TStringTopicType( - const std::string& data); - - /** - * Conversion operator to a string. - */ - operator std::string& () const; - - /** - * Getter function for the internal data string. - */ - const std::string& data() const; - - /** - * Setter function for the internal data string. - */ - void data( - const std::string& data); -}; - -/** - * @brief - * Class that is a built-in topic type that can be used to readily create Topics, - * DataReaders and DataWriters for this type without the need for code generation. - * - * This built-in type allows for easy transfer of keyed strings. - */ -template -class TKeyedStringTopicType : public Value -{ -public: - - /** - * Creates topic type with an empty key and data strings. - */ - TKeyedStringTopicType(); - - /** - * Creates topic type with the given key and data strings. - */ - TKeyedStringTopicType( - const std::string& key, - const std::string& value); - - /** - * Getter function for the key string. - */ - const std::string& key() const; - - /** - * Setter function for the key string. - */ - void key( - const std::string& key); - - /** - * Getter function for the internal data string. - */ - const std::string& value() const; - - /** - * Setter function for the internal data string. - */ - void value( - const std::string& value); -}; - -/** - * @brief - * Class that is a built-in topic type that can be used to readily create Topics, - * DataReaders and DataWriters for this type without the need for code generation. - * - * This built-in type allows for easy transfer of keyed vectors of bytes. - */ -template -class TKeyedBytesTopicType : public Value -{ -public: - - /** - * Creates topic type with an empty key string and data vector. - */ - TKeyedBytesTopicType(); - - /** - * Creates topic type with given key string and data vector. - */ - TKeyedBytesTopicType( - const std::string& key, - const std::vector& value); - - /** - * Getter function for the key string. - */ - const std::string& key() const; - - /** - * Setter function for the key string. - */ - void key( - const std::string& key); - - /** - * Getter function for the internal vector of bytes. - */ - const std::vector& value() const; - - /** - * Setter function for the internal vector of bytes. - */ - void value( - const std::vector& value); -}; - -/** - * @file - * This file contains the type definitions for BuiltinTopicTypes - */ -typedef dds::core::detail::BytesTopicType BytesTopicType; -typedef dds::core::detail::StringTopicType StringTopicType; -typedef dds::core::detail::KeyedBytesTopicType KeyedBytesTopicType; -typedef dds::core::detail::KeyedStringTopicType KeyedStringTopicType; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT - -#endif //OMG_DDS_CORE_BUILTIN_TOPIC_TYPES_HPP_ diff --git a/include/dds/core/Duration.hpp b/include/dds/core/Duration.hpp deleted file mode 100644 index ae7cbff1e73..00000000000 --- a/include/dds/core/Duration.hpp +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_DURATION_HPP_ -#define OMG_DDS_CORE_DURATION_HPP_ - -#include - -namespace dds { -namespace core { - -/** - * @file - * This class represents a time interval. - */ - -/** - * Duration represents a time interval and - - * * Can be incremented by durations expressed as seconds, nanoseconds - * milliseconds, or Duration objects. - * - * * Can be converted to and from Durations expressed in - * milliseconds (or other units) as integer types. - */ -class OMG_DDS_API Duration -{ -public: - - /** - * Create a Duration elapsing zero seconds. - */ - static const Duration zero(); // {0, 0} - - /** - * Create an infinite Duration. - */ - static const Duration infinite(); // {0x7fffffff, 0x7fffffff} - - /** - * Create a Duration elapsing the default amount of time (zero seconds). - */ - Duration(); - - /** - * Create a Duration elapsing a specific amount of time. - * - * @param sec Amount of seconds for the Duration. - * @param nanosec Amount of nanoseconds for the Duration. - */ - explicit Duration( - int32_t sec, - uint32_t nanosec = 0); - -#if __cplusplus >= 199711L - /** @copydoc dds::core::Duration::Duration(int32_t sec, uint32_t nanosec = 0) */ - explicit Duration( - int64_t sec, - uint32_t nanosec = 0); -#endif - - /** - * Create a Duration from a number of microseconds - * @param microseconds number of microseconds - */ - static const Duration from_microsecs( - int64_t microseconds); - - /** - * Create a Duration from a number of milliseconds - * @param miliseconds number of milliseconds - */ - static const Duration from_millisecs( - int64_t milliseconds); - - /** - * Create a Duration from a number of seconds - * @param seconds number of seconds - */ - static const Duration from_secs( - double seconds); - - /** - * Get seconds part of the Duration. - * @return number of seconds - */ - int64_t sec() const; - /** - * Set number of seconds - * @param s number of seconds - */ - void sec( - int64_t s); - - /** - * Get nanoseconds part of the Duration. - * @return number of nanoseconds - */ - uint32_t nanosec() const; - /** - * Set number of nanoseconds - * @param ns number of nanoseconds - */ - void nanosec( - uint32_t ns); - - /** - * Returns an integer value for a comparison of two Durations: - * 1 if this Duration is greater than the comparator (that) - * -1 if the Duration is less than the comparator (that) - * 0 if the Duration matches the comparator (that) - * - * @param that Duration to compare - * - * @return comparison result - */ - int compare( - const Duration& that) const; - - /** - * Returns true if the Duration is greater than the comparator - * - * @param that Duration to compare - * @return comparison result - */ - bool operator >( - const Duration& that) const; - - /** - * Returns true if the Duration is greater than or equal to the comparator - * @param Duration &that - */ - bool operator >=( - const Duration& that) const; - - /** - * Returns true if the Duration is not equal to the comparator - * - * @param that Duration to compare - * @return comparison result - */ - bool operator !=( - const Duration& that) const; - - /** - * Returns true if the Duration is equal to the comparator - * - * @param that Duration to compare - * @return comparison result - */ - bool operator ==( - const Duration& that) const; - - /** - * Returns true if the Duration is less than or equal to the comparator - * - * @param that Duration to compare - * @return comparison result - */ - bool operator <=( - const Duration& that) const; - - /** - * Returns true if the Duration is less than the comparator - * - * @param that Duration to compare - * @return comparison result - */ - bool operator <( - const Duration& that) const; - - /** - * Add a Duration to this Duration - * - * @param a_ti Duration to add - * @return this Duration + a_ti - */ - Duration& operator +=( - const Duration& a_ti); - - /** - * Subtract a Duration from this Duration - * - * @param a_ti Duration to subtract - * @return this Duration - a_ti - */ - Duration& operator -=( - const Duration& a_ti); - - /** - * Multiply this Duration by a factor - * - * @param factor the factor to multiply this Duration by - * @return this Duration * factor - */ - Duration& operator *=( - uint64_t factor); - - /** - * Add a Duration to Duration - * - * @param other a Duration - * @return Duration + other - */ - const Duration operator +( - const Duration& other) const; - - /** - * Subtract a Duration from Duration - * - * @param other a Duration - * @return the Duration - other - */ - const Duration operator -( - const Duration& other) const; - /** - * Returns this Duration in milliseconds. - * - * @return the duration in milliseconds - */ - int64_t to_millisecs() const; - - /** - * Returns this Duration in micro-seconds. - * - * @return the duration in micro-seconds - */ - int64_t to_microsecs() const; - - /** - * Returns this Duration in seconds. - * - * @return the duration in seconds - */ - double to_secs() const; - -private: - - int32_t sec_ = 0; - uint32_t nsec_ = 0; -}; - -/** - * Multiply Duration by a factor - * - * @param lhs factor by which to multiply - * @param rhs Duration to multiply - * - * @return factor * Duration - */ -const Duration OMG_DDS_API operator *( - uint64_t lhs, - const Duration& rhs); - -/** - * Multiply Duration by a factor - * - * @param lhs Duration to multiply - * @param rhs factor by which to multiply - * - * @return Duration * factor - */ -const Duration OMG_DDS_API operator *( - const Duration& lhs, - uint64_t rhs); - -/** - * Divide Duration by a factor - * - * @param lhs Duration to divide - * @param rhs factor by which to divide - */ -const Duration OMG_DDS_API operator /( - const Duration& lhs, - uint64_t rhs); - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_DURATION_HPP_ diff --git a/include/dds/core/Entity.hpp b/include/dds/core/Entity.hpp deleted file mode 100644 index db5c970b61d..00000000000 --- a/include/dds/core/Entity.hpp +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_ENTITY_HPP_ -#define OMG_DDS_CORE_ENTITY_HPP_ - -#include -#include -#include - -#include - -namespace dds { -namespace core { - -/** - * @brief This class is the abstract base class for all the DCPS objects. - * - * This class is the abstract base class for all of the DCPS objects - * that support QoS policies a listener and a status condition: - * - * - dds::domain::DomainParticipant - * - dds::sub::Subscriber - * - dds::sub::DataReader - * - dds::pub::Publisher - * - dds::pub::DataWriter - * - dds::topic::Topic - * - * In the ISO C++ PSM each DDS entity behaves like a polymorphic reference - * in that it automatically manages its resource and it can be - * safely assigned up and down the DDS Entity type hierarchy. - * - */ -template -class TEntity : public virtual Reference -{ -public: - - OMG_DDS_REF_TYPE_PROTECTED_DC( - TEntity, - Reference, - DELEGATE) - - OMG_DDS_IMPLICIT_REF_BASE( - TEntity) - - /** @cond */ - virtual ~TEntity() - { - } - - /** @endcond */ - - /** - * Enable entity. - * - * This operation enables the Entity. Entity objects can be created - * either enabled or disabled. This is controlled by the value of - * the dds::core::policy::EntityFactory QoS policy on the corresponding - * factory for the Entity. - * - * Enabled entities are immediately activated at creation time meaning all their - * immutable QoS settings can no longer be changed. Disabled Entities are not yet - * activated, so it is still possible to change there immutable QoS settings. However, - * once activated the immutable QoS settings can no longer be changed. - * - * Creating disabled entities can make sense when the creator of the Entity does not - * yet know which QoS settings to apply, thus allowing another piece of code to set the - * QoS later on. - * - * The default setting of dds::core::policy::EntityFactory is such that, - * by default, it is not necessary to explicitly call enable on newly- - * created entities. - * - * The enable operation is idempotent. Calling enable on an already- - * enabled Entity does not raise exceptions and has no effect. - * - * If an Entity has not yet been enabled, the only operations that can be invoked on it - * are: the ones to set, get or copy the QosPolicy settings, the ones that set (or get) the - * listener, the ones that get the StatusCondition, the get_status_changes - * operation (although the status of a disabled entity never changes), and the β€˜factory’ - * operations that create, delete or lookup other Entities. Other operations will - * throw the exception dds::core::NotEnabledError. - * - * Entities created from a factory that is disabled are created - * disabled regardless of the setting of the dds::core::policy::EntityFactory - * Qos policy. Calling enable on an Entity whose factory is not - * enabled will fail and throw an dds::core::PreconditionNotMetError - * exception. - * - * If the dds::core::policy::EntityFactory QoS policy has autoenable_created_entities - * set to TRUE, the enable operation on the factory will automatically - * enable all entities created from the factory. - * - * The Listeners associated with an entity are not called until - * the entity is enabled. Conditions associated with an entity that - * is not enabled are inactive; that is, they have a trigger_value==false - * (dds::core::cond::Condition and dds::core::cond::WaitSet). - * - * eg. - * @code{.cpp} - * dds::domain::qos::DomainParticipantQos dpq; - * dpq << dds::core::policy::EntityFactory::ManuallyEnable(); - * ... - * dds::sub::DataReader dr(dp, topic, drqos); - * dr.enable(); - * @endcode - * - * In addition to the general description, the enable operation on a dds::sub::Subscriber - * has special meaning in specific usecases. This applies only to Subscribers with PresentationQoS - * coherent-access set to true with access-scope set to group. - * - * In this case the subscriber is always created in a disabled state, regardless of the auto-enable - * created entities setting on the corresponding participant. While the subscriber remains disabled, - * DataReaders can be created that will participate in coherent transactions of the subscriber. - * - * See dds::sub::CoherentAccess for more information. - * - * All DataReaders will also be created in a disabled state. Coherency with group access-scope requires - * data to be delivered as a transaction, atomically, to all eligible readers. Therefore data should not be - * delivered to any single DataReader immediately after it's created, as usual, but only after the application - * has finished creating all DataReaders for a given Subscriber. At this point, the application should enable the - * Subscriber which in turn enables all its DataReaders. - * - * Note that for a dds::pub::DataWriter which has a corresponding dds::pub::Publisher - * with a PresentationQoS with coherent-access set to true and access-scope set to topic or group - * that the HistoryQoS of the dds::pub::DataWriter should be set to keep-all otherwise the enable operation - * will fail. - * - * See dds::pup::DataWriter for more information. - * - * @return void - * @throw dds::core::PreconditionNotMetError - * Entities' factory is not enabled. - */ - OMG_DDS_API void enable() - { - this->delegate()->enable(); - } - - /** - * This operation returns a mask with the communication statuses in the Entity that - * are β€œtriggered”. - * - * This operation retrieves the list of communication statuses in the Entity - * that are triggered. That is the set of communication statuses whose value have changed - * since the last time the application called this operation. This operation shows - * whether a change has occurred even when the status seems unchanged because the - * status changed back to the original status. - * - * When the Entity is first created or if the Entity is not enabled, all - * communication statuses are in the β€œun-triggered” state so the mask returned by the - * operation is empty. - * - * The result value is a bit mask in which each bit shows which value has changed. The - * relevant bits represent one of the following statuses: - * - dds::core::status::StatusMask::inconsistent_topic() - * - dds::core::status::StatusMask::offered_deadline_missed() - * - dds::core::status::StatusMask::requested_deadline_missed() - * - dds::core::status::StatusMask::offered_incompatible_qos() - * - dds::core::status::StatusMask::requested_incompatible_qos() - * - dds::core::status::StatusMask::sample_lost() - * - dds::core::status::StatusMask::sample_rejected() - * - dds::core::status::StatusMask::data_on_readers() - * - dds::core::status::StatusMask::data_available() - * - dds::core::status::StatusMask::liveliness_lost() - * - dds::core::status::StatusMask::liveliness_changed() - * - dds::core::status::StatusMask::publication_matched() - * - dds::core::status::StatusMask::subscription_matched() - * - dds::core::status::StatusMask::all_data_disposed_topic() - * - * Each status bit is declared as a constant and can be used in an AND operation to - * check the status bit against the result of type StatusMask. Not all statuses are - * relevant to all Entity objects. See the respective Listener interfaces for each - * Entity for more information. - * - * The list of statuses returned by the status_changes operation refers - * to the statuses that are triggered on the Entity itself, and does not - * include statuses that apply to contained entities. - * - * @return dds::core::status::StatusMask - * a bit mask in which each bit shows which value has changed. - */ - OMG_DDS_API const dds::core::status::StatusMask status_changes() - { - return this->delegate()->get_status_changes(); - } - - /** - * This operation returns the InstanceHandle_t that represents the Entity. - * - * The relevant state of some Entity objects are distributed using built-in topics. - * Each built-in topic sample represents the state of a specific Entity and has a - * unique instance_handle. This operation returns the instance_handle of the - * built-in topic sample that represents the specified Entity.
- * Some Entities (dds::pub::Publisher and dds::sub::Subscriber) do not have a corresponding - * built-in topic sample, but they still have an instance_handle that uniquely - * identifies the Entity. The instance_handles obtained this way can also be used - * to check whether a specific Entity is located in a specific DomainParticipant - * (dds::domain::DomainParticipant::contains_entity()). - * - * @return dds::core::InstanceHandle - * Result value is the instance_handle of the built-in topic - * sample that represents the state of this Entity. - */ - OMG_DDS_API const InstanceHandle instance_handle() const - { - return this->delegate()->get_instance_handle(); - } - - /** - * This function closes the entity and releases related resources. - * - * Resource management for some reference types might involve relatively heavyweight - * operating- system resources β€” such as e.g., threads, mutexes, and network sockets β€” - * in addition to memory. These objects therefore provide a method close() that shall - * halt network communication (in the case of entities) and dispose of any appropriate - * operating-system resources. - * - * Users of this PSM are recommended to call close on objects of all reference types once - * they are finished using them. In addition, implementations may automatically close - * objects that they deem to be no longer in use, subject to the following restrictions: - * - Any object to which the application has a direct reference is still in use. - * - Any object that has been explicitly retained is still in use - * - The creator of any object that is still in use is itself still in use. - * - * @return void - */ - OMG_DDS_API void close() - { - this->delegate()->close(); - } - - /** - * Retain the Entity, even when it goes out of scope. - * - * This function indicates that references to this object may go out of - * scope but that the application expects to look it up again later. - * Therefore the Service must consider this object to be still in use - * and may not close it automatically. - * - * @return void - */ - OMG_DDS_API void retain() - { - // this->delegate()->retain(); - } - -}; - -typedef dds::core::detail::Entity Entity; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_ENTITY_HPP_ diff --git a/include/dds/core/EntityQos.hpp b/include/dds/core/EntityQos.hpp deleted file mode 100644 index 026d0800d5b..00000000000 --- a/include/dds/core/EntityQos.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_TDDS_CORE_QOS_ENTITY_QOS_HPP_ -#define OMG_TDDS_CORE_QOS_ENTITY_QOS_HPP_ - -#include - - -namespace dds { -namespace core { -template -class TEntityQos; - -/** - * @brief - * QoS Container - * - * Acts as a container for Qos policies allowing all the policies of - * an entity to be set and retrieved as a unit. - * - * For more information see \ref DCPS_Modules_Infrastructure "Infrastructure Module" - * and \ref DCPS_QoS "Supported Quality of Service" - */ -template -class TEntityQos : public Value -{ -public: - - /** - * Create default QoS. - */ - TEntityQos(); - - /** - * Create copied QoS. - * - * @param other the QoS to copy. - */ - TEntityQos( - const TEntityQos& other); - - /** - * Create/copy QoS from different QoS type. - * - * @param qos the QoS to copy policies from. - */ - template - TEntityQos( - const TEntityQos& qos); - -public: - - /** @cond */ - ~TEntityQos(); - /** @endcond */ - -public: - - /** - * Generic function for setting a policy applicable to this QoS object. - * Available policies depend on the actual instantiation of the template - * class, which might be DomainParticipantQos, TopicQos, PublisherQos, etc. - * - * @param p the policy to be set for this QoS instance. - */ - template - TEntityQos& policy( - const POLICY& p); - - /** - * Generic function for obtaining the value of a specific policy - * belonging to this QoS instance. - * - * @return policy - */ - template - const POLICY& policy() const; - - /** - * Generic function for obtaining the value of a specific policy - * belonging to this QoS instance. - * - * @return policy - */ - template - POLICY& policy(); - - /** - * Generic function for setting a policy applicable to this QoS object. - * Available policies depend on the actual instantiation of the template - * class, which might be DomainParticipantQos, TopicQos, PublisherQos, etc. - * - * @param p the policy to be set for this QoS instance. - */ - template - TEntityQos& operator <<( - const POLICY& p); - - /** - * Generic function for obtaining the value of a specific policy - * belonging to this QoS instance. - * - * @return policy - */ - template - const TEntityQos& operator >>( - POLICY& p) const; - - /** - * Generic function for setting a policy applicable to this QoS object. - * Available policies depend on the actual instantiation of the template - * class, which might be DomainParticipantQos, TopicQos, PublisherQos, etc. - * - * @param TEntityQos the TEntityQos to set - */ - template - TEntityQos& operator =( - const TEntityQos& other); - -}; - -} //namespace core -} //namespace dds - -#endif //OMG_TDDS_CORE_QOS_ENTITY_QOS_HPP_ diff --git a/include/dds/core/Exception.hpp b/include/dds/core/Exception.hpp deleted file mode 100644 index 003912179e8..00000000000 --- a/include/dds/core/Exception.hpp +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_EXCEPTION_HPP_ -#define OMG_DDS_CORE_EXCEPTION_HPP_ - -#include - -#include -#include - -#if defined _MSC_VER -# pragma warning (push) -# pragma warning (disable:4275) // non dll-interface class 'std::foo_error' used as base for dll-interface class 'dds::core::BarError' -#endif - -namespace dds { -namespace core { - -/** - * @brief - * %Exception: base class for specified DDS Exceptions. - * - * DDS PIM Return Code | DDS-PSM-CXX Exception Class | std C++ Parent Exception - * ------------------- | --------------------------- | ------------------------ - * RETCODE_OK | Normal return; no exception | N/A - * RETCODE_NO_DATA | Normal return with informational state attached | N/A - * RETCODE_ERROR | Error | std::logic_error - * RETCODE_BAD_PARAMETER | InvalidArgumentError | std::invalid_argument - * RETCODE_TIMEOUT | TimeoutError | std::runtime_error - * RETCODE_UNSUPPORTED | UnsupportedError | std::logic_error - * RETCODE_ALREADY_DELETED | AlreadyClosedError | std::logic_error - * RETCODE_ILLEGAL_OPERATION | IllegalOperationError | std::logic_error - * RETCODE_NOT_ENABLED | NotEnabledError | std::logic_error - * RETCODE_PRECONDITION_NOT_MET | PreconditionNotMetError | std::logic_error - * RETCODE_IMMUTABLE_POLICY | ImmutablePolicyError | std::logic_error - * RETCODE_INCONSISTENT_POLICY | InconsistentPolicyError | std::logic_error - * RETCODE_OUT_OF_RESOURCES | OutOfResourcesError | std::runtime_error - * - * The DDS-PSM-Cxx maps error codes to C++ exceptions defined in the dds::core namespace and - * inheriting from a base Exception class and the appropriate standard C++ exception. - * Table 7.3 lists the mapping between error codes as defined in the DDS PIM and C++ exceptions - * as used in this specification. Exceptions have value semantics; this means that they must - * always have deep copy semantics. - * The full list of exceptions is included in the file dds/core/Exceptions.hpp. - * - */ -class Exception -{ -protected: - - OMG_DDS_API Exception() - { - } - -public: - - /** @cond */ - OMG_DDS_API virtual ~Exception() throw() - { - } - - /** @endcond */ - -public: - - /** - * Retrieve information about the exception that was thrown. - * - * Example - * @code{.cpp} - * try { - * // Do something that will trigger a dds exception, like: - * dds::domain::DomainParticipant participant = dds::core::null; - * participant.domain_id(); - * } catch (const dds::core::Exception& e) { - * std::cout << e.what() << std::endl; - * } - * @endcode - * %Exception information (of the NullReferenceError in this case) - * @code - * Null reference: Reference[157] == dds::core::null - * ======================================================================================== - * Context : dds::domain::DomainParticipant::domain_id - * Date : Wed Oct 21 19:28:00 CET 2015 - * Node : DeLorean - * Process : flux_capacitor <15423> - * Thread : mr_fusion b6f25700 - * Internals : ReferenceImpl.hpp/157/V6.6.0 - * ---------------------------------------------------------------------------------------- - * Report : Null reference: Reference[157] == dds::core::null - * Internals : dds::core::Reference::delegate/ReferenceImpl.hpp/157 - * @endcode - * - * @return Exception information - */ - OMG_DDS_API virtual const char* what() const throw() = 0; -}; - -/** - * @brief - * %Exception: Generic, unspecified error. - */ -class Error : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit Error( - const std::string& msg); - - OMG_DDS_API Error( - const Error& src); - - OMG_DDS_API virtual ~Error() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: The object target of this operation has already been closed. - */ -class AlreadyClosedError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit AlreadyClosedError( - const std::string& msg); - - OMG_DDS_API AlreadyClosedError( - const AlreadyClosedError& src); - - OMG_DDS_API virtual ~AlreadyClosedError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: An operation was invoked on an inappropriate object or at an inappropriate time. - * - * This is determined by policies set by the specification or the Service implementation. - * - * There is no precondition that could be changed to make the operation succeed. - */ -class IllegalOperationError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit IllegalOperationError( - const std::string& msg); - - OMG_DDS_API IllegalOperationError( - const IllegalOperationError& src); - - OMG_DDS_API virtual ~IllegalOperationError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application attempted to modify an immutable QosPolicy. - */ -class ImmutablePolicyError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit ImmutablePolicyError( - const std::string& msg); - - OMG_DDS_API ImmutablePolicyError( - const ImmutablePolicyError& src); - - OMG_DDS_API virtual ~ImmutablePolicyError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application specified a set of policies that are not - * consistent with each other. - */ -class InconsistentPolicyError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit InconsistentPolicyError( - const std::string& msg); - - OMG_DDS_API InconsistentPolicyError( - const InconsistentPolicyError& src); - - OMG_DDS_API virtual ~InconsistentPolicyError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application is passing an invalid argument. - */ -class InvalidArgumentError : public Exception, public std::invalid_argument -{ - /** @cond */ - -public: - - OMG_DDS_API explicit InvalidArgumentError( - const std::string& msg); - - OMG_DDS_API InvalidArgumentError( - const InvalidArgumentError& src); - - OMG_DDS_API virtual ~InvalidArgumentError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Operation invoked on an Entity that is not yet enabled. - */ -class NotEnabledError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit NotEnabledError( - const std::string& msg); - - OMG_DDS_API NotEnabledError( - const NotEnabledError& src); - - OMG_DDS_API virtual ~NotEnabledError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Service ran out of the resources needed to complete the - * operation. - */ -class OutOfResourcesError : public Exception, public std::runtime_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit OutOfResourcesError( - const std::string& msg); - - OMG_DDS_API OutOfResourcesError( - const OutOfResourcesError& src); - - OMG_DDS_API virtual ~OutOfResourcesError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - - -/** - * @brief - * %Exception: A pre-condition for the operation was not met. - */ -class PreconditionNotMetError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit PreconditionNotMetError( - const std::string& msg); - - OMG_DDS_API PreconditionNotMetError( - const PreconditionNotMetError& src); - - OMG_DDS_API virtual ~PreconditionNotMetError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: The operation timed out. - */ -class TimeoutError : public Exception, public std::runtime_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit TimeoutError( - const std::string& msg); - - OMG_DDS_API TimeoutError( - const TimeoutError& src); - - OMG_DDS_API virtual ~TimeoutError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Unsupported operation. - * - * This can only be thrown by operations that are optional. - */ -class UnsupportedError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit UnsupportedError( - const std::string& msg); - - OMG_DDS_API UnsupportedError( - const UnsupportedError& src); - - OMG_DDS_API virtual ~UnsupportedError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application has attempted to cast incompatible types. - */ -class InvalidDowncastError : public Exception, public std::runtime_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit InvalidDowncastError( - const std::string& msg); - - OMG_DDS_API InvalidDowncastError( - const InvalidDowncastError& src); - - OMG_DDS_API virtual ~InvalidDowncastError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application used a null reference. - * - * Very likely, the used DDS object is a dds::core::null object. - * @code{.cpp} - * dds::domain::DomainParticipant participant = dds::core::null; - * try { - * participant.domain_id(); - * } catch (const dds::core::NullReferenceError& e) { - * std::cout << e.what() << std::endl; - * } - * @endcode - */ -class NullReferenceError : public Exception, public std::runtime_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit NullReferenceError( - const std::string& msg); - - OMG_DDS_API NullReferenceError( - const NullReferenceError& src); - - OMG_DDS_API virtual ~NullReferenceError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -/** - * @brief - * %Exception: Application provided invalid data - */ -class InvalidDataError : public Exception, public std::logic_error -{ - /** @cond */ - -public: - - OMG_DDS_API explicit InvalidDataError( - const std::string& msg); - - OMG_DDS_API InvalidDataError( - const InvalidDataError& src); - - OMG_DDS_API virtual ~InvalidDataError() throw(); - -public: - - OMG_DDS_API virtual const char* what() const throw(); - /** @endcond */ -}; - -} //namespace core -} //namespace dds - -#if defined _MSC_VER -# pragma warning (pop) -#endif - -#endif //OMG_DDS_CORE_EXCEPTION_HPP_ - diff --git a/include/dds/core/InstanceHandle.hpp b/include/dds/core/InstanceHandle.hpp deleted file mode 100644 index 50be1bcd824..00000000000 --- a/include/dds/core/InstanceHandle.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_INSTANCE_HANDLE_HPP_ -#define OMG_DDS_CORE_INSTANCE_HANDLE_HPP_ - -#include -#include - -#include -#include - -#include - -namespace dds { -namespace core { - -/** - * @brief - * Class to hold the handle associated with in sample instance. - */ -class InstanceHandle : public Value -{ -public: - - /** - * Create an nil instance handle. - */ - OMG_DDS_API InstanceHandle(); - - /** - * Create an nil instance handle. - * - * @param nullHandle placeholder - */ - OMG_DDS_API InstanceHandle( - const null_type& nullHandle); - - - /** - * Copy an existing InstancHandle - * - * @param other InstanceHandle to copy - */ - OMG_DDS_API InstanceHandle( - const InstanceHandle& other); - - /** @cond */ - OMG_DDS_API ~InstanceHandle(); - /** @endcond */ - - /** - * @cond - * Parametric constructor for creating an instance-handle - * from some other type. This function is intended for internal - * usage. - */ - OMG_DDS_API InstanceHandle( - const detail::InstanceHandle& arg0); - /** @endcond */ - -public: - - /** - * Assign an existing InstancHandle to this InstancHandle - * - * @param that The InstanceHandle to assign to this - */ - OMG_DDS_API InstanceHandle& operator =( - const InstanceHandle& that); - - /** - * Compare this InstanceHandle to another InstanceHandle - * - * @param that The InstanceHandle to compare - * @return true if they match - */ - OMG_DDS_API bool operator ==( - const InstanceHandle& that) const; - - /** - * Compare this InstanceHandle to another InstanceHandle - * - * @param that The InstanceHandle to compare - * @return true if this is less than that - */ - OMG_DDS_API bool operator <( - const InstanceHandle& that) const; - - /** - * Compare this InstanceHandle to another InstanceHandle - * - * @param that The InstanceHandle to compare - * @return true if this is greater than that - */ - OMG_DDS_API bool operator >( - const InstanceHandle& that) const; - -public: - - /** - * Create an nil instance handle. - * - * @return a nil InstanceHandle - */ - OMG_DDS_API static const InstanceHandle nil(); - - /** - * Check if the InstanceHandle is nil. - * - * @return true if the InstanceHandle is nil - */ - OMG_DDS_API bool is_nil() const; -}; - -typedef std::vector InstanceHandleSeq; - -} //namespace core -} //namespace dds - -inline std::ostream& operator <<( - std::ostream& os, - const dds::core::InstanceHandle& h); - - -#endif //OMG_DDS_CORE_INSTANCE_HANDLE_HPP_ diff --git a/include/dds/core/LengthUnlimited.hpp b/include/dds/core/LengthUnlimited.hpp deleted file mode 100644 index 1199cdd2dda..00000000000 --- a/include/dds/core/LengthUnlimited.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_LENGTH_UNLIMITED_HPP_ -#define OMG_DDS_CORE_LENGTH_UNLIMITED_HPP_ - -#include - -namespace dds { -namespace core { - -const uint32_t LENGTH_UNLIMITED = 0; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_LENGTH_UNLIMITED_HPP_ diff --git a/include/dds/core/Optional.hpp b/include/dds/core/Optional.hpp deleted file mode 100644 index 0225998cd43..00000000000 --- a/include/dds/core/Optional.hpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_OPTIONAL_HPP_ -#define OMG_DDS_CORE_OPTIONAL_HPP_ - -#include - -namespace dds { -namespace core { - -/** - * The optional class is used to wrap attributes annotated in the idl with the - * \@optional annotation. This class provides a simple and safe way of - * accessing, setting and resetting the stored attribute. - * - * IDL: - * @code - * struct RadarTrack { - * string id; - * long x; - * long y; - * long z; //@Optional - * }; - * @endcode - * - * C++ Representation: - * @code{.cpp} - * class RadarTrack { - * public: - * RadarTrack(); - * RadarTrack(const std::string& id, - * int32_t x, - * int32_t y, - * int32_t z); - * public: - * std::string& id() const; - * void id(const std::string& s); - * - * int32_t x() const; - * void x(int32_t v); - * - * int32_t y() const; - * void y(int32_t v); - * - * dds::core::optional& z() const; - * void z(int32_t v); - * void z(const dds::core::optional& z) - * }; - * @endcode - */ -template< - typename T, - template class DELEGATE> -class optional : public dds::core::Value< DELEGATE > -{ -public: - - optional( - const T& t); - -public: - - /** - * Returns true only if the attribute is set. - */ - bool is_set() const; - - /** - * Reset the attribute. - */ - void reset(); - - /** - * Get the attribute. An exception is thrown if the attribute is not set. - */ - const T& get() const; - - /** - * Get the attribute. An exception is thrown if the attribute is not set. - */ - T& get(); -}; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_OPTIONAL_HPP_ diff --git a/include/dds/core/QosProvider.hpp b/include/dds/core/QosProvider.hpp deleted file mode 100644 index 9b22297e9da..00000000000 --- a/include/dds/core/QosProvider.hpp +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_QOS_PROVIDER_HPP_ -#define OMG_DDS_CORE_QOS_PROVIDER_HPP_ - -#include - -//#include - -//#include - -//#include -//#include - -//#include -//#include - -#include - - -namespace dds { -namespace core { - -/** - * @brief - * The QosProvider API allows users to specify the QoS settings of their DCPS - * entities outside of application code in XML. - * - * The QosProvider is delivered as part of the DCPS API of Vortex OpenSplice. - * - * @see @ref DCPS_QoS_Provider "QoS Provider extensive information." - */ -template -class TQosProvider : public Reference -{ -public: - - /** - * Constructs a new QosProvider based on the provided uri and profile. - * - * A QosProvider instance that is instantiated with all profiles and/or QoS’s loaded - * from the location specified by the provided uri. - * - * Initialization of the QosProvider will fail under the following conditions:
- * - No uri is provided. - * - The resource pointed to by uri cannot be found. - * - The content of the resource pointed to by uri is malformed (e.g., malformed XML). - * When initialization fails (for example, due to a parse error or when the resource - * identified by uri cannot be found), then PreconditionNotMetError will be thrown. - * - * Look @ref DCPS_QoS_Provider "here" for more information. - * - * @param uri A Uniform Resource Identifier (URI) that points to the location - * where the QoS profile needs to be loaded from. Currently only URI’s with a - * β€˜file’ scheme that point to an XML file are supported. If profiles and/or QoS - * settings are not uniquely identifiable by name within the resource pointed to by - * uri, a random one of them will be stored. - * @param profile The name of the QoS profile within the xml file that serves as the default QoS - * profile for the get qos operations. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - explicit TQosProvider( - const std::string& uri, - const std::string& profile); - - /** - * Constructs a new QosProvider based on the provided uri. - * - * A QosProvider instance that is instantiated with all profiles and/or QoS’s loaded - * from the location specified by the provided uri. - * - * Initialization of the QosProvider will fail under the following conditions:
- * - No uri is provided. - * - The resource pointed to by uri cannot be found. - * - The content of the resource pointed to by uri is malformed (e.g., malformed XML). - * When initialization fails (for example, due to a parse error or when the resource - * identified by uri cannot be found), then PreconditionNotMetError will be thrown. - * - * Look @ref DCPS_QoS_Provider "here" for more information. - * - * @param uri A Uniform Resource Identifier (URI) that points to the location - * where the QoS profile needs to be loaded from. Currently only URI’s with a - * β€˜file’ scheme that point to an XML file are supported. If profiles and/or QoS - * settings are not uniquely identifiable by name within the resource pointed to by - * uri, a random one of them will be stored. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - explicit TQosProvider( - const std::string& uri); - - /** - * Resolves the DomainParticipantQos from the uri this QosProvider is associated with. - * - * @return DomainParticipantQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DomainParticipantQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::domain::qos::DomainParticipantQos participant_qos(); - - /** - * Resolves the DomainParticipantQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return DomainParticipantQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DomainParticipantQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::domain::qos::DomainParticipantQos participant_qos( - const std::string& id); - - /** - * Resolves the TopicQos from the uri this QosProvider is associated with. - * - * @return TopicQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no TopicQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::topic::qos::TopicQos topic_qos(); - - /** - * Resolves the TopicQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return TopicQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no TopicQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::topic::qos::TopicQos topic_qos( - const std::string& id); - - /** - * Resolves the SubscriberQos from the uri this QosProvider is associated with. - * - * @return SubscriberQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no SubscriberQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::sub::qos::SubscriberQos subscriber_qos(); - - /** - * Resolves the SubscriberQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return SubscriberQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no SubscriberQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::sub::qos::SubscriberQos subscriber_qos( - const std::string& id); - - /** - * Resolves the DataReaderQos from the uri this QosProvider is associated with. - * - * @return DataReadertQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DataReaderQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::sub::qos::DataReaderQos datareader_qos(); - - /** - * Resolves the DataReaderQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return DataReaderQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DataReaderQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::sub::qos::DataReaderQos datareader_qos( - const std::string& id); - - /** - * Resolves the PublisherQos from the uri this QosProvider is associated with. - * - * @return PublisherQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no PublisherQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::pub::qos::PublisherQos publisher_qos(); - - /** - * Resolves the PublisherQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return PublisherQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no PublisherQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::pub::qos::PublisherQos publisher_qos( - const std::string& id); - - /** - * Resolves the DataWriterQos from the uri this QosProvider is associated with. - * - * @return DataWriterQos from the given URI (and profile) - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DataWriterQos can be found within the uri associated - * with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::pub::qos::DataWriterQos datawriter_qos(); - - /** - * Resolves the DataWriterQos identified by the id from the uri this - * QosProvider is associated with. - * - * @param id The fully-qualified name that identifies a QoS within the uri - * associated with the QosProvider or a name that identifies a QoS within the - * uri associated with the QosProvider instance relative to its default QoS - * profile. Id’s starting with β€˜::’ are interpreted as fully-qualified names and all - * others are interpreted as names relative to the default QoS profile of the - * QosProvider instance. When id is NULL it is interpreted as a non-named QoS - * within the default QoS profile associated with the QosProvider. - * @return DataWriterQos from the given URI (and profile) using the id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::PreconditionNotMetError - * If no DataWriterQos that matches the provided id can be - * found within the uri associated with the QosProvider. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - dds::pub::qos::DataWriterQos datawriter_qos( - const std::string& id); -}; - -typedef dds::core::detail::QosProvider QosProvider; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_QOS_PROVIDER_HPP_ diff --git a/include/dds/core/Reference.hpp b/include/dds/core/Reference.hpp deleted file mode 100644 index f93cdcdeae5..00000000000 --- a/include/dds/core/Reference.hpp +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_REFERENCE_HPP_ -#define OMG_DDS_CORE_REFERENCE_HPP_ - -#include -#include -#include //used when macros of refmacros.hpp expand - -namespace dds { -namespace core { - -/** - * @brief - * Base class for reference-counted objects. - * - * All objects that have a reference-type have an associated shallow (polymorphic) - * assignment operator that simply changes the value of the reference. - * Furthermore, reference-types are safe, meaning that under no circumstances can - * a reference point to an invalid object. - * At any single point in time a reference can either refer to the null object or - * to a valid object. - * - * The semantics for Reference types is defined by the DDS-PSM-Cxx class - * dds::core::Reference. In the context of this specification the semantics implied - * by the ReferenceType is mandatory, yet the implementation supplied as part of - * this standard is provided to show one possible way of implementing this semantics. - * - * List of reference types: - * - * * Entity - * * Condition - * * GuardCondition - * * ReadCondition - * * QueryCondition - * * Waitset - * * DomainParticipant - * * AnyDataWriter - * * Publisher - * * DataWriter - * * AnyDataReader - * * Subscriber - * * DataReader - * * SharedSamples - * * AnyTopic - * * Topic - * - * Instances of reference types are created using C++ constructors. - * The trivial constructor is not defined for reference types; the only - * alternative to properly constructing a reference is to initialize it to a - * null reference by assigning dds::core::null. - * - * Resource management for some reference types might involve relatively - * heavyweight operating-system resources (such as threads, mutexes, - * and network sockets) in addition to memory. - * These objects therefore provide a function close() that shall halt network - * communication (in the case of entities) and dispose of any appropriate - * operating-system resources. - * - * Users of this PSM are recommended to call close on objects of all reference - * types once they are finished using them. In addition, implementations may - * automatically close objects that they deem to be no longer in use, - * subject to the following restrictions: - * - * * Any object to which the application has a direct reference - * (not including a WeakReference) is still in use. - * - * * Any object that has been explicitly retained is still in use. - * - * * The creator of any object that is still in use is itself still in use. - * - */ -template -class Reference -{ -public: - - DECLARE_TYPE_TRAITS( - DELEGATE) - - /** - * Creates a "null" Reference. - * - * @param null - */ - explicit Reference( - dds::core::null_type& n) - : impl_(n) - { - } - - /** - * Creates a Reference from another. - * - * @param ref the other reference - */ - explicit Reference( - const Reference& ref) - : impl_(ref.impl_) - { - } - - /** - * Assign a Reference from another. - * - * @param ref the other reference - */ - Reference& operator = ( - const Reference& ref) - { - impl_ = ref.impl_; - return *this; - } - - /** - * Creates a Reference from other Reference type safely. - * - * @param ref the other reference - */ - template - explicit Reference( - const Reference& ref) - { - impl_ = std::dynamic_pointer_cast(ref.impl_); - if (impl_ != ref.impl_) - { - throw - IllegalOperationError(std::string("Attempted invalid cast: ") + - typeid(ref).name() + " to " + typeid(*this).name()); - } - - } - - /** @cond - * The following two constructors create a dds Reference from a vendor - * specific delegate. - * - * They are public, because the implementation of other delegates may - * need to be able to create References in that manner. - * - * However, it shouldn't actually be part of the API. So, leave it from - * the doxygen generated API documentation. - */ - explicit Reference( - DELEGATE_T* p) - : impl_(p) - { - } - - explicit Reference( - const DELEGATE_REF_T& p) - : impl_(p) - { - } - - /** @endcond */ - - /** - * Destroys a Reference. - * - * There might be an associated garbage collection activity when - * the current reference is not empty. When the underlaying delegate - * is referenced by another Reference object as well, then that - * delegate will not be destroyed. - */ - ~Reference() - { - } - - /** @cond - * Function possibly needed for delegate implementation, but not recommended - * for application usage: exclude from the API documentation for clarity. - * - * Returns an object to the underlying delegate. - */ - operator DELEGATE_REF_T() const - { - return impl_; - } - /** @endcond */ - - /** - * Compares two Reference objects and returns true if they are equal. - * - * Equality is based on the referential equality of the object being - * pointed. - * - * @param ref the other Reference object - * @return true when equal - */ - template - bool operator ==( - const R& ref) const - { - bool equal = false; - if (this->is_nil() && ref.is_nil()) - { - /* Both delegates are null. */ - equal = true; - } - else if (!this->is_nil() && !ref.is_nil()) - { - /* Check delegates. */ - equal = (this->delegate() == ref.delegate()); - } - return equal; - } - - /** - * Compares two Reference objects and returns true if they are not - * equal. - * - * Inequality is based on the referential inequality of the object - * being pointed to. - * - * @param ref the other Reference object - * @return true when not equal - */ - template - bool operator !=( - const R& ref) const - { - // FRANAVA read something removing the this keyword. - return !(*this == ref); - } - - /** - * Assign new referenced object to this dds reference. - * - * There might be an associated garbage collection activity when - * the current reference is not empty. - * - * @return reference pointing to the new object. - */ - template - Reference& operator =( - const Reference& that) - { - //To implement - static_assert((is_base_of::value), "value error"); - if (this != (Reference*)&that) - { - *this = Reference(that); - } - return *this; - - } - - /** @copydoc dds::core::Reference::operator=(const Reference& that) */ - template - Reference& operator =( - const R& rhs) - { - static_assert( - is_base_of< DELEGATE_T, typename R::DELEGATE_T>::value, - "location: operator=()" ); - if (this != (Reference*)&rhs) - { - *this = Reference(rhs); - } - return *this; - - } - - /** - * Special assignment operators that takes care of assigning - * dds::core::null to this reference. - * - * When assigning null, there might be an associated garbage collection - * activity. - * - * @return reference pointing to a null object. - */ - - Reference& operator =( - const null_type nil) - { - this = nil; - return this; - } - - /** - * Check if the referenced object is nil. - * - * In other words, check if the reference is pointing to a null object. - * - * @return true if the referenced object is null. - */ - bool is_nil() const - { - return impl_.get() == 0; - } - - /** - * Special operator== used to check if this reference object - * equals the dds::core::null reference. - * - * The null-check can be done like this: - * @code{.cpp} - * if (r == dds::core::null) { - * // Do not use the dds reference object r in its current state - * } - * @endcode - * - * @return true if this reference is null. - */ - bool operator ==( - const null_type) const - { - return this->is_nil(); - } - - /** - * Special operator!= used to check if this reference object - * does not equal the dds::core::null reference. - * - * The non-null-check can be done like this: - * @code{.cpp} - * if (r != dds::core::null) { - * // Use the dds reference object r - * } - * @endcode - * - * @return true if this reference is not null. - */ - bool operator !=( - const null_type) const - { - return !(this->is_nil()); - } - -private: - - // -- disallow dynamic allocation for reference types - void* operator new( - size_t); - -public: - - /** @cond - * Functions possibly needed for delegate implementation, but not recommended - * for application usage: exclude from the API documentation for clarity. - * - * Returns an object to the underlying delegate. - */ - DELEGATE_REF_T& delegate() - { - return impl_; - } - - const DELEGATE_REF_T& delegate() const - { - return impl_; - } - - /** @endcond */ - - /** - * The operator->() is provided to be able to directly invoke - * functions on the delegate. - * - * The decision to provide direct access to - * the delegate was motivated by the need for providing a way that - * was not invasive with respect to the CXXDDS API and yet would allow - * for vendor-specific extension. - * Thus vendor-specific extensions can be invoked on the Reference - * and on all its subclasses as follows: - * @code{.cpp} - * my_dds_entity.standard_function(); - * my_dds_entity->vendor_specific_extension(); - * @endcode - * - * @return a reference to delegate. - */ - DELEGATE* operator ->() - { - return impl_.get(); - - } - - /** @copydoc dds::core::Reference::operator->() */ - const DELEGATE* operator ->() const - { - return impl_.get(); - } - - /** @cond - * Functions possibly needed for delegate implementation, but not recommended - * for application usage: exclude from the API documentation for clarity. - * - * Returns an object to the underlying delegate. - */ - operator DELEGATE_REF_T& () - { - return impl_; - } - - operator const DELEGATE_REF_T& () const - { - return impl_; - } - /** @endcond */ - -protected: - - Reference() - { - } - - void set_ref( - DELEGATE_T* p) - { - impl_.reset(p); - } - -protected: - - DELEGATE_REF_T impl_; -}; - - -} //namespace core -} //namespace dds - - -/** - * Special operator== used to check if this reference object - * does not equal the dds::core::null reference. - * - * The non-null-check can be done like this: - * @code{.cpp} - * if (dds::core::null == r) { - * // Do not use the dds reference object r in its current state - * } - * @endcode - * - * @return true if this reference is not null. - */ -template -bool operator ==( - dds::core::null_type, - const dds::core::Reference& r) -{ - return r.is_nil(); -} - -/** - * Special operator!= used to check if this reference object - * does not equal the dds::core::null reference. - * - * The non-null-check can be done like this: - * @code{.cpp} - * if (dds::core::null != r) { - * // Use the dds reference object r - * } - * @endcode - * - * @return true if this reference is not null. - */ -template -bool operator !=( - dds::core::null_type, - const dds::core::Reference& r) -{ - return !r.is_nil(); -} - -#endif // OMG_DDS_CORE_REFERENCE_HPP_ diff --git a/include/dds/core/SafeEnumeration.hpp b/include/dds/core/SafeEnumeration.hpp deleted file mode 100644 index 8dc6720dcb8..00000000000 --- a/include/dds/core/SafeEnumeration.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_SAFEENUMERATION_HPP_ -#define OMG_DDS_CORE_SAFEENUMERATION_HPP_ - -namespace dds { -namespace core { - -/** - * SafeEnum provides a wrapper for enumerated types in a typesafe - * manner. - * - * SafeEnums allow specification of the underlying type, - * do not implictly convert to integers, and resolve scoping issues. - */ -template< - typename Def, - typename Inner = typename Def::Type> -class SafeEnum : public Def -{ -public: - - constexpr SafeEnum( - Inner v) - : val(v) - { - } - - Inner underlying() const - { - return val; - } - - bool operator ==( - const SafeEnum& s) const - { - return this->val == s.val; - } - - bool operator !=( - const SafeEnum& s) const - { - return this->val != s.val; - } - - bool operator <( - const SafeEnum& s) const - { - return this->val < s.val; - } - - bool operator <=( - const SafeEnum& s) const - { - return this->val <= s.val; - } - - bool operator >( - const SafeEnum& s) const - { - return this->val > s.val; - } - - bool operator >=( - const SafeEnum& s) const - { - return this->val >= s.val; - } - -private: - - Inner val; - -}; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_SAFEENUMERATION_HPP_ - diff --git a/include/dds/core/Time.hpp b/include/dds/core/Time.hpp deleted file mode 100644 index ba4f3439662..00000000000 --- a/include/dds/core/Time.hpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_TIME_HPP_ -#define OMG_DDS_CORE_TIME_HPP_ - -#include - -namespace dds { -namespace core { - -class Duration; -class Time; - -/** - * Time represents a time value and can: - * - * * Be incremented by Duration expressed as seconds, - * nanoseconds, milliseconds, or Duration objects. - * - * * Be converted to and from Times expressed in - * milliseconds (or other units) as integer types. - */ -class OMG_DDS_API Time -{ -public: - - static const Time invalid(); // {-1, 0xffffffff} - - /** - * Create a Time from a number of microseconds - * - * @param microseconds number of microseconds - */ - static const Time from_microsecs( - int64_t microseconds); - - /** - * Create a Time from a number of milliseconds - * - * @param milliseconds number of miliseconds - */ - static const Time from_millisecs( - int64_t milliseconds); - - /** - * Create a Time from a number of seconds - * - * @param seconds number of seconds - */ - static const Time from_secs( - double seconds); - - /** - * Create a Time of zero seconds. - */ - Time(); - - /** - * Create a Time elapsing a specific amount of time. - */ - explicit Time( - int64_t sec, - uint32_t nanosec = 0); - - /** - * @return number of seconds - */ - int64_t sec() const; - - /** - * Set number of seconds - * @param s number of seconds - */ - void sec( - int64_t s); - - /** - * @return number of nanoseconds - */ - uint32_t nanosec() const; - - /** - * Set number of nanoseconds - * @param ns number of nanoseconds - */ - void nanosec( - uint32_t ns); - - /** - * Returns an integer indicating the result of a comparison - * of two Times: - * 1 if this Time is greater than the comparator (that) - * -1 if the Time is less than the comparator (that) - * 0 if the Time matches the comparator (that) - * - * @param that Time to compare - * @return comparison result - */ - int compare( - const Time& that) const; - - /** - * @param that Time to compare - * @return true if the Time is greater than the comparator - */ - bool operator >( - const Time& that) const; - - /** - * @param that Time to compare - * @return true if the Time is greater than or equal to the comparator - */ - bool operator >=( - const Time& that) const; - - /** - * @param that Time to compare - * @return true if the Time is not equal to the comparator - */ - bool operator !=( - const Time& that) const; - - /** - * @param that Time to compare - * @return true if the Time is equal to the comparator - */ - bool operator ==( - const Time& that) const; - /** - * @param that Time to compare - * @return true if the Time is less than or equal to the comparator - */ - bool operator <=( - const Time& that) const; - /** - * @param that Time to compare - * @return true if the Time is less than the comparator - */ - bool operator <( - const Time& that) const; - - /** - * @param a_ti Duration to add - * @return Time value + Duration - */ - Time& operator +=( - const Duration& a_ti); - /** - * @param a_ti Duration to subtract - * @return Time value - Duration - */ - Time& operator -=( - const Duration& a_ti); - - /** - * Returns this Time in milliseconds. - * - * @return this Time in milliseconds - */ - int64_t to_millisecs() const; - - /** - * Returns this Time in micro-seconds. - * - * @return this Time in micro-seconds - */ - int64_t to_microsecs() const; - - /** - * Returns this Time in seconds. - * - * @return this Time in seconds - */ - double to_secs() const; - -private: - - int64_t sec_ = 0; - uint32_t nsec_ = 0; -}; - -// Time arithmetic operators. -/** - * Add a Duration to a Time value - * @param lhs Time - * @param rhs Duration - * @return Time * Duration - */ -const Time OMG_DDS_API operator +( - const Time& lhs, - const Duration& rhs); - -/** - * Add a Duration to a Time value - * @param lhs Duration - * @param rhs Time - * @return Duration + Time - */ -const Time OMG_DDS_API operator +( - const Duration& lhs, - const Time& rhs); - -/** - * Subtract a Duration from a Time value - * @param lhs Time - * @param rhs Duration - * @return Time - Duration - */ -const Time OMG_DDS_API operator -( - const Time& lhs, - const Duration& rhs); - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_TIME_HPP_ diff --git a/include/dds/core/Value.hpp b/include/dds/core/Value.hpp deleted file mode 100644 index 30aa7e42892..00000000000 --- a/include/dds/core/Value.hpp +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_VALUE_HPP_ -#define OMG_DDS_CORE_VALUE_HPP_ - -namespace dds { -namespace core { - -/** - * @brief - * This class is the base for various value-type dds objects. - * - * QoS, Policy, Statuses, and Topic samples are all modeled as value-types. - * - * All objects that have a value-type have a deep-copy assignment and copy - * construction semantics. - * It should also be pointed out that value-types are not 'pure-value-types' in - * the sense that they are immutable (as in functional programming languages). - * - * The DDS-PSM-Cxx makes value-types mutable to limit the number of copies as well - * as to limit the time-overhead necessary to change a value-type - * (note that for immutable value-types the only form of change is to create a new - * value-type). - */ -template -class Value -{ -protected: - - Value(); - Value( - const Value& p); - -public: - - /** @cond - * The following Constructors are not really relevant for the API. - * So, leave them from the doxygen generated API documentation for clarity. - */ - - /** - * Create a value-type object of one internal value - * - * @param arg VALUETYPE value - */ - template - Value( - const ARG& arg); - - /** - * Create a value-type object of two internal value - * - * @param arg1 VALUETYPES value - * @param arg2 VALUETYPES value - */ - template< - typename ARG1, - typename ARG2> - Value( - const ARG1& arg1, - const ARG2& arg2); - - /** - * Create a value-type object of three internal value - * - * @param arg1 VALUETYPES value - * @param arg2 VALUETYPES value - * @param arg3 VALUETYPES value - */ - template< - typename ARG1, - typename ARG2, - typename ARG3> - Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3); - - /** - * Create a value-type object of four internal value - * - * @param arg1 VALUETYPES value - * @param arg2 VALUETYPES value - * @param arg3 VALUETYPES value - * @param arg4 VALUETYPES value - */ - template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4> - Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4); - - /** - * Create a value-type object of five internal value - * - * @param arg1 VALUETYPES value - * @param arg2 VALUETYPES value - * @param arg3 VALUETYPES value - * @param arg4 VALUETYPES value - * @param arg5 VALUETYPES value - */ - template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4, - typename ARG5> - Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4, - const ARG5& arg5); - - /** - * Create a value-type object of six internal value - * - * @param arg1 VALUETYPES value - * @param arg2 VALUETYPES value - * @param arg3 VALUETYPES value - * @param arg4 VALUETYPES value - * @param arg5 VALUETYPES value - * @param arg6 VALUETYPES value - */ - template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4, - typename ARG5, - typename ARG6> - Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4, - const ARG5& arg5, - const ARG6& arg6); - /** @endcond */ - - /** @cond */ - ~Value(); - /** @endcond */ - - /** - * Assigns new delegate to this Value - * @param other Value - */ - Value& operator =( - const Value& other); - - /** - * Compare this Value with another Value - * - * @param other Value - * @return true if equal - */ - bool operator ==( - const Value& other) const; - - /** - * Compare this Value with another Value - * - * @param other Value - * @return true if not equal - */ - bool operator !=( - const Value& other) const; - - /** - * The operator->() is provided to be able to directly invoke - * functions on the delegate. - * - * The decision to provide direct access to - * the delegate was motivated by the need for providing a way that - * was not invasive with respect to the CXXDDS API and yet would allow - * for vendor-specific extension. - * Thus vendor-specific extensions can be invoked on the Value - * and on all its subclasses as follows: - * @code{.cpp} - * my_dds_value.standard_function(); - * my_dds_value->vendor_specific_extension(); - * @endcode - * - * @return a reference to delegate. - */ - D* operator ->(); - - /** @copydoc dds::core::Value::operator->() */ - const D* operator ->() const; - - /** @cond - * Functions possibly needed for delegate implementation, but not recommended - * for application usage: exclude from the API documentation for clarity. - * - * Returns an object to the underlying delegate. - */ - const D& delegate() const; - - D& delegate(); - - operator D& (); - - operator const D& () const; - /** @endcond */ - -protected: - - D d_; -}; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_VALUE_HPP_ diff --git a/include/dds/core/WeakReference.hpp b/include/dds/core/WeakReference.hpp deleted file mode 100644 index ffbc4c3e485..00000000000 --- a/include/dds/core/WeakReference.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_WEAK_REFERENCE_HPP_ -#define OMG_DDS_CORE_WEAK_REFERENCE_HPP_ - -#include - -namespace dds { -namespace core { - -/** - * @brief - * The WeakReference class enables you to maintain a weak - * reference to a DDS reference type. - * - * The existence of a weak link will not prevent the garbage - * collection of the reference type. - */ -template -class WeakReference -{ -public: - - typedef T ReferenceType; - -public: - - /** - * Creates a weak reference without an referenced dds object. - */ - WeakReference(); - - /** - * Creates a weak reference for the reference type passed as argument. - * - * @tparam t dds object the new weak reference will refer to - */ - WeakReference( - const T& t); - - /** @cond */ - ~WeakReference(); - /** @endcond */ - - /** - * Checks whether the underlying reference has been deleted. - * - * @returns true if the underlying reference has expired, false otherwise - */ - bool expired(); - - /** - * Gives access to the underlying shared reference. - * - * If the reference has expired the returned object will be referencing 'dds::core::null'. - * - * @return referenced dds object - */ - T lock(); - -private: - - typename T::DELEGATE_WEAK_REF_T impl_; -}; - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_WEAK_REFERENCE_HPP_ diff --git a/include/dds/core/array.hpp b/include/dds/core/array.hpp deleted file mode 100644 index 96055173a54..00000000000 --- a/include/dds/core/array.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ORG_OMG_DDS_CORE_ARRAY_HPP_ -#define ORG_OMG_DDS_CORE_ARRAY_HPP_ - -#include - -namespace dds { -namespace core { - -using dds::core::detail::array; - -} //namespace core -} //namespace dds - -#endif //ORG_OMG_DDS_CORE_ARRAY_HPP_ diff --git a/include/dds/core/cond/Condition.hpp b/include/dds/core/cond/Condition.hpp deleted file mode 100644 index 54466aff8c9..00000000000 --- a/include/dds/core/cond/Condition.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_COND_CONDITION_HPP_ -#define OMG_DDS_CORE_COND_CONDITION_HPP_ - -#include - -#include -#include -#include -//#include -//#include - -namespace dds { -namespace core { -namespace cond { - -/** - * @brief - * This class is the base class for all the conditions that may be attached to a dds::core::cond::WaitSet. - * - * This base class is specialized in three classes by the Data Distribution Service: - * - dds::core::cond::GuardCondition - * - dds::core::cond::StatusCondition - * - dds::sub::cond::ReadCondition - * - dds::sub::cond::QueryCondition - * - * Each Condition has a trigger_value that can be TRUE or FALSE and is set by - * the Data Distribution Service (except a GuardCondition) depending on the - * evaluation of the Condition. - * - * @see @ref DCPS_Modules_Infrastructure_Status "Status concept" - * @see @ref DCPS_Modules_Infrastructure_Waitset "WaitSet concept" - */ -template -class TCondition : public virtual Reference -{ -public: - - OMG_DDS_REF_TYPE_PROTECTED_DC( - TCondition, - dds::core::Reference, - DELEGATE) - - OMG_DDS_EXPLICIT_REF_BASE_DECL( - TCondition, - detail::StatusCondition) - - OMG_DDS_EXPLICIT_REF_BASE_DECL( - TCondition, - detail::GuardCondition) - - OMG_DDS_EXPLICIT_REF_BASE_DECL( - TCondition, - dds::sub::cond::detail::ReadCondition) - - OMG_DDS_EXPLICIT_REF_BASE_DECL( - TCondition, - dds::sub::cond::detail::QueryCondition) - - /** @cond */ - OMG_DDS_API ~TCondition(); - /** @endcond */ - - /** - * Registers a functor as custom handler with this Condition. - * - * The supplied functor will be called when this Condition is triggered - * and either the dds::core::cond::Condition::dispatch() is called or the - * dds::core::cond::WaitSet::dispatch() on the WaitSet to which this - * Condition is attached to. - * - * @tparam Functor The functor to be called when the StatusCondition triggers. - * @return void - * @throw dds::core::Exception - */ - template - OMG_DDS_API void handler( - Functor& func); - - /** @copydoc dds::core::cond::TCondition::handler(Functor& func) */ - template - OMG_DDS_API void handler( - const Functor& func); - - /** - * Resets the handler for this Condition. - * - * After the invocation of this function no handler will be registered with - * this Condition. - * - * @return void - * @throw dds::core::Exception - */ - OMG_DDS_API void reset_handler(); - - /** - * Dispatches the functor that have been registered with the Condition. - * - * The Condition has to have been triggered for the functor will be called - * by this function. - * - * @return void - * @throw dds::core::Exception - */ - OMG_DDS_API void dispatch(); - - /** - * This operation retrieves the trigger_value of the Condition. - * - * A Condition has a trigger_value that can be TRUE or FALSE and is set by the - * Data Distribution Service (except a GuardCondition). This operation returns the - * trigger_value of the Condition. - * - * @return bool The boolean value to which the Condition is set. - * @throw dds::core::Exception - */ - OMG_DDS_API bool trigger_value() const; - -}; - -typedef TCondition Condition; - -} //namespace cond -} //namespace core -} //namespace dds - -#include - -#endif //OMG_DDS_CORE_COND_CONDITION_HPP_ diff --git a/include/dds/core/cond/GuardCondition.hpp b/include/dds/core/cond/GuardCondition.hpp deleted file mode 100644 index e011040b64b..00000000000 --- a/include/dds/core/cond/GuardCondition.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_COND_GUARDCONDITION_HPP_ -#define OMG_DDS_CORE_COND_GUARDCONDITION_HPP_ - -#include -#include - -namespace dds { -namespace core { -namespace cond { - -/** - * @brief - * A GuardCondition object is a specific Condition whose trigger_value is - * completely under the control of the application. - * - * When a GuardCondition is initially created, the trigger_value is FALSE. - * - * The purpose of the GuardCondition is to provide the means for the - * application to manually triggering a WaitSet to stop waiting. This is accomplished by - * attaching the GuardCondition to the WaitSet and then setting the - * trigger_value by means of the set trigger_value operation. - * - * @code{.cpp} - * dds::core::cond::GuardCondition guard; - * dds::core::cond::WaitSet waitset; - * waitset.attach_condition(guard); - * waitset.wait(); - * ... - * // To wakeup waitset, do in another thread: - * guard.trigger_value(true); - * @endcode - * See the @ref anchor_dds_core_cond_waitset_examples "WaitSet examples" for more examples.
- * Although the WaitSet examples use the StatusCondition, the basic usage of this Condition - * with a WaitSet is the same. - * - * @see dds::core::cond::Condition - * @see @ref DCPS_Modules_Infrastructure_Waitset "WaitSet concept" - * @see @ref anchor_dds_core_cond_waitset_examples "WaitSet examples" - */ -template -class TGuardCondition : public TCondition -{ -public: - - OMG_DDS_REF_TYPE_NO_DC( - TGuardCondition, - TCondition, - DELEGATE) - - OMG_DDS_EXPLICIT_REF_BASE( - TGuardCondition, - dds::core::cond::Condition) - /** - * Create a dds::core::cond::GuardCondition. - * - * The GuardCondition can then be added to a dds::core::cond::WaitSet so that the - * application can manually wake up a thread that is blocked on that WaitSet. - * - * @throw dds::core::Exception - */ - TGuardCondition(); - - /** - * Create a dds::core::cond::GuardCondition. - * - * The GuardCondition can then be added to a dds::core::cond::WaitSet so that the - * application can manually wake up a thread that is blocked on that WaitSet. - * - * The supplied functor will be called when this GuardCondition is triggered - * and either the inherited dds::core::cond::Condition::dispatch() is called or the - * dds::core::cond::WaitSet::dispatch() on the WaitSet to which this GuardCondition is - * attached to. - * - * @tparam functor The functor to be called when the GuardCondition triggers. - * @throw dds::core::Exception - */ - template - TGuardCondition( - FUN& functor); - - /** - * @copydoc dds::core::cond::TGuardCondition::TGuardCondition(FUN& functor) - */ - template - TGuardCondition( - const FUN& functor); - - /** @cond */ - ~TGuardCondition(); - /** @endcond */ - - /** - * This operation sets the trigger_value of the GuardCondition. - * - * A GuardCondition object is a specific Condition which trigger_value is - * completely under the control of the application. This operation must be used by the - * application to manually wake-up a WaitSet. This operation sets the - * trigger_value of the GuardCondition to the parameter value. The - * GuardCondition is directly created using the GuardCondition constructor. - * When a GuardCondition is initially created, the trigger_value is FALSE. - * - * @param value The boolean value to which the GuardCondition is set. - * @throw dds::core::Exception - */ - void trigger_value( - bool value); - - /** - * @copydoc dds::core::cond::TCondition::trigger_value() - */ - bool trigger_value(); -}; - -typedef dds::core::cond::detail::GuardCondition GuardCondition; - -} //namespace cond -} //namespace core -} //namespace dds - -#include - -#endif //OMG_DDS_CORE_COND_GUARDCONDITION_HPP_ diff --git a/include/dds/core/cond/StatusCondition.hpp b/include/dds/core/cond/StatusCondition.hpp deleted file mode 100644 index 83829721137..00000000000 --- a/include/dds/core/cond/StatusCondition.hpp +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_STATUSCONDITION_HPP_ -#define OMG_DDS_CORE_STATUSCONDITION_HPP_ - -#include -#include -#include - -namespace dds { -namespace core { -namespace cond { - -/** - * @brief - * A StatusCondition object is a specific Condition that is associated with each Entity. - * - * Entity objects that have status attributes also have a StatusCondition, access is - * provided to the application by the get_statuscondition operation. - * The communication statuses whose changes can be communicated to the application - * depend on the Entity. The following table shows the relevant statuses for each - * Entity. - * - * Entity | Status Name - * -------------------- | -------------------- - * dds::topic::Topic | dds::core::status::StatusMask::inconsistent_topic()
dds::core::status::StatusMask::all_data_disposed_topic() - * dds::sub::Subscriber | dds::core::status::StatusMask::data_on_readers() - * dds::sub::DataReader | dds::core::status::StatusMask::sample_rejected()
dds::core::status::StatusMask::liveliness_changed()
dds::core::status::StatusMask::requested_deadline_missed()
dds::core::status::StatusMask::requested_incompatible_qos()
dds::core::status::StatusMask::data_available()
dds::core::status::StatusMask::sample_lost()
dds::core::status::StatusMask::subscription_matched() - * dds::pub::DataWriter | dds::core::status::StatusMask::liveliness_lost()
dds::core::status::StatusMask::offered_deadline_missed()
dds::core::status::StatusMask::offered_incompatible_qos()
dds::core::status::StatusMask::publication_matched() - * - * The inherited dds::core::cond::Condition::trigger_value() of the StatusCondition - * depends on the communication statuses of that Entity (e.g., missed deadline) and - * also depends on the value of the dds::core::status::StatusMask. - * - * A StatusCondition can be attached to a WaitSet in order to allow an application - * to suspend until the trigger_value has become TRUE. - * - * The trigger_value of a StatusCondition will be TRUE if one of the enabled - * StatusChangedFlags is set. That is, trigger_value==FALSE only if all the - * values of the StatusChangedFlags are FALSE. - * - * The sensitivity of the StatusCondition to a particular communication status is - * controlled by the list of enabled_statuses set on the condition by means of - * dds::core::cond::StatusCondition::enabled_statuses(const ::dds::core::status::StatusMask& status) - * When the enabled_statuses are not changed by that - * operation, all statuses are enabled by default. - * - * See the @ref anchor_dds_core_cond_waitset_examples "WaitSet examples" for examples - * how to use this Condition. - * - * @see dds::core::cond::Condition - * @see @ref DCPS_Modules_Infrastructure_Status "Status concept" - * @see @ref DCPS_Modules_Infrastructure_Waitset "WaitSet concept" - * @see @ref anchor_dds_core_cond_waitset_examples "WaitSet examples" - */ -template -class TStatusCondition : public TCondition -{ -public: - - OMG_DDS_REF_TYPE_DELEGATE_C( - TStatusCondition, - TCondition, - DELEGATE) - - OMG_DDS_EXPLICIT_REF_BASE( - TStatusCondition, - dds::core::cond::Condition) - - /** - * Create a dds::core::cond::StatusCondition associated with an Entity. - * - * The StatusCondition can then be added to a dds::core::cond::WaitSet so that the - * application can wait for specific status changes that affect the Entity. - * - * @param e The Entity to associate with the StatusCondition. - * @throw dds::core::Exception - */ - TStatusCondition( - const dds::core::Entity& e); - - /** - * Create a dds::core::cond::StatusCondition associated with an Entity. - * - * The StatusCondition can then be added to a dds::core::cond::WaitSet so that the - * application can wait for specific status changes that affect the Entity. - * - * The supplied functor will be called when this StatusCondition is triggered - * and either the inherited dds::core::cond::Condition::dispatch() is called or the - * dds::core::cond::WaitSet::dispatch() on the WaitSet to which this StatusCondition is - * attached to. - * - * @param e The Entity to associate with the StatusCondition. - * @tparam functor The functor to be called when the StatusCondition triggers. - * @throw dds::core::Exception - */ - template - TStatusCondition( - const dds::core::Entity& e, - FUN& functor); - - /** @copydoc dds::core::cond::TStatusCondition::TStatusCondition(const dds::core::Entity& e, FUN& functor) */ - template - TStatusCondition( - const dds::core::Entity& e, - const FUN& functor); - - /** @cond */ - ~TStatusCondition(); - /** @endcond */ - - /** - * This operation sets the list of communication statuses that are taken into account to - * determine the trigger_value of the StatusCondition. - * - * The inherited dds::core::cond::Condition::trigger_value() of the StatusCondition - * depends on the communication status of that Entity (e.g., missed deadline, - * loss of information, etc.), β€˜filtered’ by the set of enabled_statuses on the StatusCondition. - * - * This operation sets the list of communication statuses that are taken into account to - * determine the trigger_value of the StatusCondition. This operation may - * change the trigger_value of the StatusCondition. - * - * dds::core::cond::WaitSet objects behaviour depend on the changes of the trigger_value of - * their attached Conditions. Therefore, any WaitSet to which the StatusCondition - * is attached is potentially affected by this operation. - * If this function is not invoked, the default list of enabled_statuses includes all - * the statuses. - * - * The result value is a bit mask in which each bit shows which value has changed. The - * relevant bits represent one of the following statuses: - * - dds::core::status::StatusMask::inconsistent_topic() - * - dds::core::status::StatusMask::offered_deadline_missed() - * - dds::core::status::StatusMask::requested_deadline_missed() - * - dds::core::status::StatusMask::offered_incompatible_qos() - * - dds::core::status::StatusMask::requested_incompatible_qos() - * - dds::core::status::StatusMask::sample_lost() - * - dds::core::status::StatusMask::sample_rejected() - * - dds::core::status::StatusMask::data_on_readers() - * - dds::core::status::StatusMask::data_available() - * - dds::core::status::StatusMask::liveliness_lost() - * - dds::core::status::StatusMask::liveliness_changed() - * - dds::core::status::StatusMask::publication_matched() - * - dds::core::status::StatusMask::subscription_matched() - * - dds::core::status::StatusMask::all_data_disposed_topic() - * - * Each status bit is declared as a constant and can be used in an AND operation to - * check the status bit against the result of type StatusMask. Not all statuses are - * relevant to all Entity objects. See the respective Listener interfaces for each - * Entity for more information. - * - * @param status A bit mask in which each bit sets the status which is taken - * into account for the StatusCondition.the enabled statuses. - * @return void - * @throw dds::core::AlreadyClosedError - * @throw dds::core::Error - */ - void enabled_statuses( - const ::dds::core::status::StatusMask& status) const; - - /** - * This operation returns the list of enabled communication statuses of the - * StatusCondition. - * - * The inherited dds::core::cond::Condition::trigger_value() of the StatusCondition - * depends on the communication status of that Entity (e.g., missed deadline, - * loss of information, etc.), β€˜filtered’ by the set of enabled_statuses on the StatusCondition. - * - * This operation returns the list of communication statuses that are taken into account - * to determine the trigger_value of the StatusCondition. This operation - * returns the statuses that were explicitly set on the last call to - * dds::core::cond::StatusCondition::enabled_statuses(const ::dds::core::status::StatusMask& status) const - * or, if enabled_statuses(status) was never called, the default list. - * - * The result value is a bit mask in which each bit shows which value has changed. The - * relevant bits represent one of the following statuses: - * - dds::core::status::StatusMask::inconsistent_topic() - * - dds::core::status::StatusMask::offered_deadline_missed() - * - dds::core::status::StatusMask::requested_deadline_missed() - * - dds::core::status::StatusMask::offered_incompatible_qos() - * - dds::core::status::StatusMask::requested_incompatible_qos() - * - dds::core::status::StatusMask::sample_lost() - * - dds::core::status::StatusMask::sample_rejected() - * - dds::core::status::StatusMask::data_on_readers() - * - dds::core::status::StatusMask::data_available() - * - dds::core::status::StatusMask::liveliness_lost() - * - dds::core::status::StatusMask::liveliness_changed() - * - dds::core::status::StatusMask::publication_matched() - * - dds::core::status::StatusMask::subscription_matched() - * - dds::core::status::StatusMask::all_data_disposed_topic() - * - * Each status bit is declared as a constant and can be used in an AND operation to - * check the status bit against the result of type StatusMask. Not all statuses are - * relevant to all Entity objects. See the respective Listener interfaces for each - * Entity for more information. - * - * @return dds::core::status::StatusMask - * A bit mask in which each bit shows which status is taken into - * account for the StatusCondition. - * @throw dds::core::Exception - */ - const ::dds::core::status::StatusMask enabled_statuses() const; - - /** - * This operation returns the Entity associated with the StatusCondition - * - * Note that there is exactly one Entity associated with each StatusCondition. - * - * @return dds::core::Entity The Entity associated with the StatusCondition. - * @throw dds::core::AlreadyClosedError - */ - const dds::core::Entity& entity() const; - -}; - -typedef detail::StatusCondition StatusCondition; - -} //namespace cond -} //namespace core -} //namespace dds - -#include - -#endif //OMG_DDS_CORE_STATUSCONDITION_HPP_ diff --git a/include/dds/core/cond/WaitSet.hpp b/include/dds/core/cond/WaitSet.hpp deleted file mode 100644 index 8550e0bb7da..00000000000 --- a/include/dds/core/cond/WaitSet.hpp +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_WAITSET_HPP_ -#define OMG_DDS_CORE_WAITSET_HPP_ - -#include -#include -#include -#include - -namespace dds { -namespace core { -namespace cond { - -/** - * @brief - * A WaitSet object allows an application to wait until one or more of - * the attached Condition objects has a trigger_value of TRUE or else - * until the timeout expires. - * - * A WaitSet is not necessarily associated with a single DomainParticipant - * and could be used to wait for Condition objects associated with different - * DomainParticipant objects. - * - * @anchor anchor_dds_core_cond_waitset_examples - * Example with wait()
- * When using the wait() operation, the triggered Conditions are returned in a list. - * @code{.cpp} - * // Create a Condition to attach to a Waitset - * dds::core::cond::StatusCondition readerSC = dds::core::cond::StatusCondition(reader); - * readerSC.enabled_statuses(dds::core::status::StatusMask::data_available()); - * - * // Create WaitSet and attach Condition - * dds::core::cond::WaitSet waitset; - * waitset.attach_condition(readerSC); // or waitset += readerSC; - * - * dds::core::cond::WaitSet::ConditionSeq conditions; - * while(true) { - * // Wait for any Condition to trigger. - * conditions = waitset.wait(); - * - * // Loop through the triggered conditions. - * for (int i=0; i < conditions.size(); i++) { - * // Handle data_available when right Condition triggered. - * if (conditions[i] == readerSC) { - * // Read samples from the DataReader - * } - * } - * } - * @endcode - - * Example with dispatch()
- * When using the dispatch() operation, the Functors of the triggered Conditions - * will be called. - * @code{.cpp} - * // Functor to add to a Condition - * class FunctorStatusCondition { - * public: - * void operator()(const dds::core::cond::StatusCondition& condition) { - * // Possibly get reader from the condition and read some samples. - * } - * }; - * FunctorStatusCondition functor; - * - * // Create a Condition with functor to attach to a Waitset - * dds::core::cond::StatusCondition readerSC = dds::core::cond::StatusCondition(reader, functor); - * readerSC.enabled_statuses(dds::core::status::StatusMask::data_available()); - * - * // Create WaitSet and attach Condition - * dds::core::cond::WaitSet waitset; - * waitset.attach_condition(readerSC); // or waitset += readerSC; - * - * while(true) { - * // Wait for any Condition to trigger. - * // The functors of the Conditions are automatically called - * // when the Condition triggers. - * waitset.dispatch(); - * } - * @endcode - * - * @see @ref DCPS_Modules_Infrastructure_Waitset "WaitSet concept" - */ -template -class TWaitSet : public Reference -{ -public: - - typedef std::vector ConditionSeq; - -public: - - OMG_DDS_REF_TYPE_NO_DC( - TWaitSet, - Reference, - DELEGATE) - - OMG_DDS_IMPLICIT_REF_BASE( - TWaitSet) - - /** - * Create a WaitSet instance. - * - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - TWaitSet(); - - /** @cond */ - ~TWaitSet(); - /** @endcond */ - - /** - * This operation allows an application thread to wait for the occurrence - * of at least one of the conditions that is attached to the WaitSet. - * - * This operation allows an application thread to wait for the occurrence - * of certain Conditions. If none of the Conditions attached to the - * WaitSet have a trigger_value of TRUE, the wait operation will block - * suspending the calling thread. - * - * The wait operation takes a timeout argument that specifies the maximum - * duration for the wait. If this duration is exceeded and none of - * the attached Condition objects is true, a TimeoutError will be thrown. - * - * It is not allowed for more than one application thread to be waiting - * on the same WaitSet. If the wait operation is invoked on a WaitSet that - * already has a thread blocking on it, the operation will immediately - * raise a PreconditionNotMetError exception. - * - * The result of the wait operation is the list of all the attached - * Conditions that have a trigger_value of TRUE (i.e., the Conditions - * that unblocked the wait). - * - * @param timeout The maximum amount of time for which the wait - * should block while waiting for a Condition to be triggered. - * @return ConditionSeq - * A vector containing the triggered Conditions - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::TimeoutError - * The timeout has elapsed without any of the attached - * conditions becoming TRUE. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - const ConditionSeq wait( - const dds::core::Duration& timeout); - - /** - * This operation allows an application thread to wait for the occurrence - * of at least one of the conditions that is attached to the WaitSet. - * - * This operation allows an application thread to wait for the occurrence - * of certain Conditions. If none of the Conditions attached to the - * WaitSet have a trigger_value of TRUE, the wait operation will block - * suspending the calling thread. - * - * It is not allowed for more than one application thread to be waiting - * on the same WaitSet. If the wait operation is invoked on a WaitSet that - * already has a thread blocking on it, the operation will immediately - * raise a PreconditionNotMetError exception. - * - * The result of the wait operation is the list of all the attached - * Conditions that have a trigger_value of TRUE (i.e., the Conditions - * that unblocked the wait). - * - * @return ConditionSeq - * A vector containing the triggered Conditions - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - const ConditionSeq wait(); - - /** - * This operation allows an application thread to wait for the occurrence - * of at least one of the conditions that is attached to the WaitSet. - * - * This operation allows an application thread to wait for the occurrence - * of certain Conditions. If none of the Conditions attached to the - * WaitSet have a trigger_value of TRUE, the wait operation will block - * suspending the calling thread. - * - * The wait operation takes a timeout argument that specifies the maximum - * duration for the wait. If this duration is exceeded and none of - * the attached Condition objects is true, a TimeoutError will be thrown. - * - * It is not allowed for more than one application thread to be waiting - * on the same WaitSet. If the wait operation is invoked on a WaitSet that - * already has a thread blocking on it, the operation will immediately - * raise a PreconditionNotMetError exception. - * - * The result of the wait operation is the list of all the attached - * Conditions that have a trigger_value of TRUE (i.e., the Conditions - * that unblocked the wait). - * - * @param triggered A ConditionSeq in which to put Conditions that were - * triggered during the wait. - * @param timeout The maximum amount of time for which the wait should - * block while waiting for a Condition to be triggered. - * @return ConditionSeq - * A vector containing the triggered Conditions - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::TimeoutError - * The timeout has elapsed without any of the attached - * conditions becoming TRUE. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - ConditionSeq& wait( - ConditionSeq& triggered, - const dds::core::Duration& timeout); - - /** - * This operation allows an application thread to wait for the occurrence - * of at least one of the conditions that is attached to the WaitSet. - * - * This operation allows an application thread to wait for the occurrence - * of certain Conditions. If none of the Conditions attached to the - * WaitSet have a trigger_value of TRUE, the wait operation will block - * suspending the calling thread. - * - * It is not allowed for more than one application thread to be waiting - * on the same WaitSet. If the wait operation is invoked on a WaitSet that - * already has a thread blocking on it, the operation will immediately - * raise a PreconditionNotMetError exception. - * - * The result of the wait operation is the list of all the attached - * Conditions that have a trigger_value of TRUE (i.e., the Conditions - * that unblocked the wait). - * - * @param triggered A ConditionSeq in which to put Conditions that were - * triggered during the wait. - * @return ConditionSeq - * A vector containing the triggered Conditions - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - ConditionSeq& wait( - ConditionSeq& triggered); - - /** - * Waits for at least one of the attached Conditions to trigger and then - * dispatches the functor associated with the Condition. - * - * @return void - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - void dispatch(); - - /** - * Waits for at least one of the attached Conditions to trigger and then - * dispatches the functor associated with the Condition, or, times - * out and throws a TimeoutError. - * - * @param timeout The maximum amount of time for which the dispatch should - * block while waiting for a Condition to be triggered. - * @return void - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::TimeoutError - * The timeout has elapsed without any of the attached - * conditions becoming TRUE. - * @throws dds::core::PreconditionNotMetError - * When multiple thread try to invoke the function concurrently. - */ - void dispatch( - const dds::core::Duration& timeout); - - /** @copydoc dds::core::cond::TWaitSet::attach_condition(const dds::core::cond::Condition& cond) */ - TWaitSet& operator +=( - const Condition& cond); - - /** @copydoc dds::core::cond::TWaitSet::detach_condition(const dds::core::cond::Condition& cond) */ - TWaitSet& operator -=( - const Condition& cond); - - /** - * This operation attaches a Condition to the WaitSet. - * - * Attaches a Condition to the WaitSet. It is possible to attach a - * Condition on a WaitSet that is currently being waited upon - * (via the wait operation). In this case, if the Condition has a - * trigger_value of TRUE, then attaching the Condition will unblock - * the WaitSet. Adding a Condition that is already attached to the WaitSet - * has no effect. - * - * @param cond The Condition to be attached to this WaitSet. - * @return WaitSet The WaitSet itself so that attaching Conditions - * can be chained. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - TWaitSet& attach_condition( - const Condition& cond); - - /** - * This operation detaches a Condition to the WaitSet. - * - * Detaches a Condition from the WaitSet. If the Condition was not - * attached to the WaitSet, the operation will return false. - * - * @param cond The Condition to detach from this WaitSet - * @return bool True if the Condition was found and detached, False - * if the Condition was not part of the WaitSet. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - bool detach_condition( - const Condition& cond); - - /** - * This operation retrieves the list of attached Conditions. - * - * The resulting sequence will either be an empty sequence, meaning there were - * no conditions attached, or will contain a list of ReadCondition, - * QueryCondition, StatusCondition and GuardCondition. - * - * @return ConditionSeq - * The list of attached Conditions. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - const ConditionSeq conditions() const; - - /** - * This operation retrieves the list of attached Conditions. - * - * The resulting sequence will either be an empty sequence, meaning there were - * no conditions attached, or will contain a list of ReadCondition, - * QueryCondition, StatusCondition and GuardCondition. - * - * @param conds A ConditionSeq in which to put the attached Conditions. - * @return ConditionSeq - * The list of attached Conditions. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The WaitSet was not properly created and references to dds::core::null. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - ConditionSeq& conditions( - ConditionSeq& conds) const; -}; - -typedef dds::core::cond::detail::WaitSet WaitSet; - -} //namespace cond -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_DETAIL_WAITSET_HPP_ diff --git a/include/dds/core/cond/detail/Condition.hpp b/include/dds/core/cond/detail/Condition.hpp deleted file mode 100644 index 2762d81a5ab..00000000000 --- a/include/dds/core/cond/detail/Condition.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_DETAIL_CONDITION_HPP_ -#define EPROSIMA_DDS_CORE_COND_DETAIL_CONDITION_HPP_ - -/** - * @cond - * Ignore this file in the API - */ - -//#include - -namespace dds { -namespace core { -namespace cond { -namespace detail { - -//using Condition = eprosima::fastdds::dds::Condition; -class Condition -{ -}; - -} //namespace detail -} //namespace cond -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROISMA_DDS_CORE_COND_DETAIL_CONDITION_HPP_ diff --git a/include/dds/core/cond/detail/ConditionImpl.hpp b/include/dds/core/cond/detail/ConditionImpl.hpp deleted file mode 100644 index 42f2b1b4a98..00000000000 --- a/include/dds/core/cond/detail/ConditionImpl.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_TCONDITION_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_COND_TCONDITION_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include - -namespace dds { -namespace core { -namespace cond { - -template -TCondition::~TCondition() -{ -} - -/** @cond - * Somehow, these cause functions duplicates in doxygen documentation. - */ -template -template -void TCondition::handler( - Functor& func) -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->delegate()->set_handler(func); - -} - -template -template -void TCondition::handler( - const Functor& func) -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->delegate()->set_handler(func); -} - -/** @endcond */ - -template -void TCondition::reset_handler() -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->delegate()->reset_handler(); -} - -template -void TCondition::dispatch() -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->delegate()->dispatch(); -} - -template -bool TCondition::trigger_value() const -{ - // return this->delegate()->get_trigger_value(); -} - -} //namespace cond -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_COND_TCONDITION_IMPL_HPP_ diff --git a/include/dds/core/cond/detail/GuardCondition.hpp b/include/dds/core/cond/detail/GuardCondition.hpp deleted file mode 100644 index c698f86fadc..00000000000 --- a/include/dds/core/cond/detail/GuardCondition.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_DETAIL_GUARDCONDITION_HPP_ -#define EPROSIMA_DDS_CORE_COND_DETAIL_GUARDCONDITION_HPP_ - -/** - * @cond - * Ignore this file in the API - */ - -//#include - -namespace dds { -namespace core { -namespace cond { - -template -class TGuardCondition; - -namespace detail { - -//using GuardCondition = eprosima::fastdds::dds::GuardCondition; -class GuardCondition -{ -}; - -} //namespace detail -} //namespace cond -} //namespace core -} //namespace dds - - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_COND_DETAIL_GUARDCONDITION_HPP_ diff --git a/include/dds/core/cond/detail/GuardConditionImpl.hpp b/include/dds/core/cond/detail/GuardConditionImpl.hpp deleted file mode 100644 index 4952d8a4095..00000000000 --- a/include/dds/core/cond/detail/GuardConditionImpl.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_TGUARDCONDITION_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_COND_TGUARDCONDITION_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { -namespace cond { - -template -TGuardCondition::TGuardCondition() -{ -} - -/** @cond - * Somehow, these cause functions duplicates in doxygen documentation. - */ -template -template -TGuardCondition::TGuardCondition( - FUN& functor) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // this->set_ref(new DELEGATE); - // this->delegate()->init(this->impl_); - // this->delegate()->set_handler(functor); -} - -template -template -TGuardCondition::TGuardCondition( - const FUN& functor) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // this->set_ref(new DELEGATE); - // this->delegate()->init(this->impl_); - // this->delegate()->set_handler(functor); -} - -/** @endcond */ - -template -TGuardCondition::~TGuardCondition() -{ -} - -template -void TGuardCondition::trigger_value( - bool /*value*/) -{ - // this->delegate()->set_trigger_value(value); -} - -template -bool TGuardCondition::trigger_value() -{ - return TCondition::trigger_value(); -} - -template -TCondition::TCondition( - /*const dds::core::cond::TGuardCondition& h*/) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // if (h.is_nil()) { - // /* We got a null object and are not really able to do a typecheck here. */ - // /* So, just set a null object. */ - // *this = dds::core::null; - // } else { - // this->::dds::core::Reference::impl_ = OSPL_CXX11_STD_MODULE::dynamic_pointer_cast(h.delegate()); - // if (h.delegate() != this->::dds::core::Reference::impl_) { - // throw dds::core::IllegalOperationError(std::string("Attempted invalid cast: ") + typeid(h).name() + " to " + typeid(*this).name()); - // } - // } -} - -template -TCondition& TCondition::operator =( - /*const dds::core::cond::TGuardCondition& rhs*/) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // if (this != (TCondition*)&rhs) { - // if (rhs.is_nil()) { - // /* We got a null object and are not really able to do a typecheck here. */ - // /* So, just set a null object. */ - // *this = dds::core::null; - // } else { - // TCondition other(rhs); - // /* Dont have to copy when the delegate is the same. */ - // if (other.delegate() != this->::dds::core::Reference::impl_) { - // *this = other; - // } - // } - // } - // return *this; -} - -} //namespace cond -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_COND_TGUARDCONDITION_IMPL_HPP_ diff --git a/include/dds/core/cond/detail/StatusCondition.hpp b/include/dds/core/cond/detail/StatusCondition.hpp deleted file mode 100644 index ef4fd1da47b..00000000000 --- a/include/dds/core/cond/detail/StatusCondition.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_DETAIL_STATUSCONDITION_HPP_ -#define EPROSIMA_DDS_CORE_COND_DETAIL_STATUSCONDITION_HPP_ - -/** - * @cond - * Ignore this file in the API - */ - -//#include - -namespace dds { -namespace core { -namespace cond { - -template -class TStatusCondition; - -namespace detail { - -//using StatusCondition = eprosima::fastdds::dds::StatusCondition; -class StatusCondition -{ -}; - -} //namespace detail -} //namespace cond -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_COND_DETAIL_STATUSCONDITION_HPP_ diff --git a/include/dds/core/cond/detail/StatusConditionImpl.hpp b/include/dds/core/cond/detail/StatusConditionImpl.hpp deleted file mode 100644 index 91824c86429..00000000000 --- a/include/dds/core/cond/detail/StatusConditionImpl.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_TSTATUSCONDITION_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_COND_TSTATUSCONDITION_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { -namespace cond { - -template -TStatusCondition::TStatusCondition( - const dds::core::Entity& /*e*/) -// : ::dds::core::cond::TCondition(new detail::StatusCondition(e)) -{ -} - -/** @cond - * Somehow, these cause functions duplicates in doxygen documentation. - */ -template -template -TStatusCondition::TStatusCondition( - const dds::core::Entity& /*e*/, - FUN& /*functor*/) -// : ::dds::core::cond::TCondition(new detail::StatusCondition(e, functor)) -{ -} - -template -template -TStatusCondition::TStatusCondition( - const dds::core::Entity& /*e*/, - const FUN& /*functor*/) -// : ::dds::core::cond::TCondition(new detail::StatusCondition(e, functor)) -{ -} - -/** @endcond */ - -template -TStatusCondition::~TStatusCondition() -{ -} - -template -void TStatusCondition::enabled_statuses( - const dds::core::status::StatusMask& /*status*/) const -{ - // this->delegate()->set_enabled_statuses(status); -} - -template -const dds::core::status::StatusMask TStatusCondition::enabled_statuses() const -{ - // return this->delegate()->get_enabled_statuses(); -} - -template -const dds::core::Entity& TStatusCondition::entity() const -{ - // return this->delegate()->get_entity(); -} - -template -TCondition::TCondition( - /*const TStatusCondition& h*/) -{ - //To implement - // if (h.is_nil()) { - // /* We got a null object and are not really able to do a typecheck here. */ - // /* So, just set a null object. */ - // *this = dds::core::null; - // } else { - // ISOCPP_REPORT_STACK_DDS_BEGIN(h); - - // this->::dds::core::Reference::impl_ = OSPL_CXX11_STD_MODULE::dynamic_pointer_cast(h.delegate()); - // if (h.delegate() != this->::dds::core::Reference::impl_) { - // throw dds::core::IllegalOperationError(std::string("Attempted invalid cast: ") + typeid(h).name() + " to " + typeid(*this).name()); - // } - // } -} - -template -TCondition& TCondition::operator =( - /*const dds::core::cond::TStatusCondition& rhs*/) -{ - //To implement - // if (this != (TCondition*)&rhs) { - // if (rhs.is_nil()) { - // /* We got a null object and are not really able to do a typecheck here. */ - // /* So, just set a null object. */ - // *this = dds::core::null; - // } else { - // TCondition other(rhs); - // /* Dont have to copy when the delegate is the same. */ - // if (other.delegate() != this->::dds::core::Reference::impl_) { - // *this = other; - // } - // } - // } - // return *this; -} - -} //namespace cond -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_COND_TSTATUSCONDITION_IMPL_HPP_ diff --git a/include/dds/core/cond/detail/WaitSet.hpp b/include/dds/core/cond/detail/WaitSet.hpp deleted file mode 100644 index 114341c6441..00000000000 --- a/include/dds/core/cond/detail/WaitSet.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_DETAIL_WAITSET_HPP_ -#define EPROSIMA_DDS_CORE_COND_DETAIL_WAITSET_HPP_ - -/** - * @cond - * Ignore this file in the API - */ -//#include - -namespace dds { -namespace core { -namespace cond { -namespace detail { - -//using WaitSet = eprosima::fastdds::dds::WaitSet; -class WaitSet -{ -}; - -} //namespace detail -} //namespace cond -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_COND_DETAIL_WAITSET_HPP_ diff --git a/include/dds/core/cond/detail/WaitSetImpl.hpp b/include/dds/core/cond/detail/WaitSetImpl.hpp deleted file mode 100644 index 59f26f34961..00000000000 --- a/include/dds/core/cond/detail/WaitSetImpl.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_COND_TWAITSET_HPP_ -#define EPROSIMA_DDS_CORE_COND_TWAITSET_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { -namespace cond { - -template -TWaitSet::TWaitSet() -{ -} - -template -TWaitSet::~TWaitSet() -{ -} - -template -const typename TWaitSet::ConditionSeq TWaitSet::wait( - const dds::core::Duration& timeout) -{ - ConditionSeq triggered; - return this->wait(triggered, timeout); -} - -template -const typename TWaitSet::ConditionSeq TWaitSet::wait() -{ - ConditionSeq triggered; - return this->wait(triggered, dds::core::Duration::infinite()); -} - -template -typename TWaitSet::ConditionSeq& TWaitSet::wait( - ConditionSeq& /*triggered*/, - const dds::core::Duration& /*timeout*/) -{ - // this->delegate()->wait(triggered, timeout); - // return triggered; -} - -template -typename TWaitSet::ConditionSeq& TWaitSet::wait( - ConditionSeq & triggered) -{ - this->wait(triggered, dds::core::Duration::infinite()); - return triggered; -} - -template -void TWaitSet::dispatch() -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->dispatch(dds::core::Duration::infinite()); -} - -template -void TWaitSet::dispatch( - const dds::core::Duration& timeout) -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // this->delegate()->dispatch(timeout); -} - -template -TWaitSet& TWaitSet::operator +=( - const Condition& cond) -{ - this->attach_condition(cond); - return *this; -} - -template -TWaitSet& TWaitSet::operator -=( - const Condition& cond) -{ - this->detach_condition(cond); - return *this; -} - -template -TWaitSet& TWaitSet::attach_condition( - const Condition& /*cond*/) -{ - // this->delegate()->attach_condition(cond); - // return *this; -} - -template -bool TWaitSet::detach_condition( - const Condition& /*cond*/) -{ - // if (this->delegate()->detach_condition(cond.delegate().get()) == - // eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK) - // { - // return true; - // } - // return false; -} - -template -const typename TWaitSet::ConditionSeq TWaitSet::conditions() const -{ - ConditionSeq conds; - return this->conditions(conds); -} - -template -typename TWaitSet::ConditionSeq& TWaitSet::conditions( - ConditionSeq& /*conds*/) const -{ - // this->delegate()->get_conditions(conds); - // return conds; -} - -} //namespace cond -} //namespace core -} //namespace dds - - -#endif //EPROSIMA_DDS_CORE_COND_TWAITSET_HPP_ diff --git a/include/dds/core/conformance.hpp b/include/dds/core/conformance.hpp deleted file mode 100644 index 5fa6404ff3a..00000000000 --- a/include/dds/core/conformance.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_CONFORMANCE_HPP_ -#define OMG_DDS_CORE_CONFORMANCE_HPP_ - -#include - -#endif //OMG_DDS_CORE_CONFORMANCE_HPP_ diff --git a/include/dds/core/ddscore.hpp b/include/dds/core/ddscore.hpp deleted file mode 100644 index e0e2ef93823..00000000000 --- a/include/dds/core/ddscore.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_PACKAGE_INCLUDE_HPP_ -#define OMG_DDS_CORE_PACKAGE_INCLUDE_HPP_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#endif //OMG_DDS_CORE_PACKAGE_INCLUDE_HPP_ \ No newline at end of file diff --git a/include/dds/core/detail/BuiltinTopicTypes.hpp b/include/dds/core/detail/BuiltinTopicTypes.hpp deleted file mode 100644 index f0ad0a0fa29..00000000000 --- a/include/dds/core/detail/BuiltinTopicTypes.hpp +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_ -#define EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_ - -//#include -//TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented -//#include -//#include - -#if defined (OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT) - -namespace dds { -namespace core { -namespace detail { - -//TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented -//typedef dds::core::TBytesTopicType BytesTopicType; -class BytesTopicType -{ -}; - -//TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented -//typedef dds::core::TStringTopicType StringTopicType; -class StringTopicType -{ -}; - -//TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented -//typedef dds::core::TKeyedBytesTopicType KeyedBytesTopicType; -class KeyedBytesTopicType -{ -}; - -//TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented -//typedef dds::core::TKeyedStringTopicType KeyedStringTopicType; -class KeyedStringTopicType -{ -}; - -} //namespace detail - - -//============================================================================== -// Bytes Template -//============================================================================== - -template -TBytesTopicType::TBytesTopicType() - : Value( - std::vector()) -{ -} - -template -TBytesTopicType::TBytesTopicType( - const std::vector& data) - : dds::core::Value( - data) -{ -} - -template -TBytesTopicType::operator std::vector&() const -{ - return this->delegate().value(); -} - -template -const std::vector& TBytesTopicType::data() const -{ - return this->delegate().value(); -} - -template -void TBytesTopicType::data( - const std::vector& data) -{ - this->delegate().value(data); -} - -//============================================================================== -// String Template -//============================================================================== - -template -TStringTopicType::TStringTopicType() - : Value( - std::string()) -{ -} - -template -TStringTopicType::TStringTopicType( - const std::string& data) - : dds::core::Value( - data) -{ -} - -template -TStringTopicType::operator std::string& () const -{ - return this->delegate().value(); -} - -template -const std::string& TStringTopicType::data() const -{ - return this->delegate().value(); -} - -template -void TStringTopicType::data( - const std::string& data) -{ - this->delegate().value(data); -} - -//============================================================================== -// KeyedBytes Template -//============================================================================== - -template -TKeyedBytesTopicType::TKeyedBytesTopicType() - : Value( - std::string(), - std::vector()) -{ -} - -template -TKeyedBytesTopicType::TKeyedBytesTopicType( - const std::string& key, - const std::vector& value) - : Value( - key, - value) -{ -} - -template -const std::string& TKeyedBytesTopicType::key() const -{ - return this->delegate().key(); -} - -template -void TKeyedBytesTopicType::key( - const std::string& key) -{ - this->delegate().key(key); -} - -template -const std::vector& TKeyedBytesTopicType::value() const -{ - return this->delegate().value(); -} - -template -void TKeyedBytesTopicType::value( - const std::vector& value) -{ - this->delegate().value(value); -} - -//============================================================================== -// KeyedString Template -//============================================================================== - -template -TKeyedStringTopicType::TKeyedStringTopicType() - : Value( - std::string(), - std::string()) -{ -} - -template -TKeyedStringTopicType::TKeyedStringTopicType( - const std::string& key, - const std::string& value) - : Value( - key, - value) -{ -} - -template -const std::string& TKeyedStringTopicType::key() const -{ - return this->delegate().key(); -} - -template -void TKeyedStringTopicType::key( - const std::string& key) -{ - this->delegate().key(key); -} - -template -const std::string& TKeyedStringTopicType::value() const -{ - return this->delegate().value(); -} - -template -void TKeyedStringTopicType::value( - const std::string& value) -{ - this->delegate().value(value); -} - -} //namespace core -} //namespace dds - -#endif //OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT - -#endif //EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_ diff --git a/include/dds/core/detail/Entity.hpp b/include/dds/core/detail/Entity.hpp deleted file mode 100644 index 8f6a74ab48e..00000000000 --- a/include/dds/core/detail/Entity.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_ENTITY_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_ENTITY_IMPL_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace detail { - -using Entity = eprosima::fastdds::dds::Entity; - -} //namespace detail -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_DETAIL_ENTITY_IMPL_HPP_ diff --git a/include/dds/core/detail/EntityQosImpl.hpp b/include/dds/core/detail/EntityQosImpl.hpp deleted file mode 100644 index 9c3773001d4..00000000000 --- a/include/dds/core/detail/EntityQosImpl.hpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_TENTITYQOS_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_TENTITYQOS_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { - -template -TEntityQos::TEntityQos() - : dds::core::Value() -{ -} - -template -TEntityQos::TEntityQos( - const TEntityQos& other) - : dds::core::Value(other.delegate()) -{ -} - -/** @cond - * Somehow, these cause functions duplicates in doxygen documentation. - */ -template -template -TEntityQos::TEntityQos( - const TEntityQos& qos) - : dds::core::Value(qos.delegate()) -{ -} - -/** @endcond */ - -template -TEntityQos::~TEntityQos() -{ -} - -/** @cond - * Somehow, these cause functions duplicates in doxygen documentation. - */ -template -template -TEntityQos& TEntityQos::policy( - const POLICY& p) -{ - //To implement - // this->dds::core::Value::delegate().policy(p); - // return *this; -} - -template -template -const POLICY& TEntityQos::policy() const -{ - //To implement - // return this->delegate().template policy(); -} - -template -template -POLICY& TEntityQos::policy() -{ - //To implement - // return this->delegate().template policy(); -} - -template -template -TEntityQos& TEntityQos::operator <<( - const POLICY& p) -{ - //To implement - // this->policy(p); - // return *this; -} - -template -template -const TEntityQos& TEntityQos::operator >>( - POLICY& p) const -{ - //To implement - // p = this->policy(); - // return *this; -} - -template -template -TEntityQos& TEntityQos::operator =( - const TEntityQos& other) -{ - //To implement - // if(this != (TEntityQos*)&other) - // { - // this->d_ = other.delegate(); - // } - // return *this; -} - -/** @endcond */ - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_TENTITYQOS_IMPL_HPP_ diff --git a/include/dds/core/detail/InstanceHandle.hpp b/include/dds/core/detail/InstanceHandle.hpp deleted file mode 100644 index 62a14389a31..00000000000 --- a/include/dds/core/detail/InstanceHandle.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_INSTANCE_HANDLE_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_INSTANCE_HANDLE_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace detail { - -using InstanceHandle = eprosima::fastdds::dds::InstanceHandle_t; - -} //namespace detail -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_DETAIL_INSTANCE_HANDLE_HPP_ diff --git a/include/dds/core/detail/QosProvider.hpp b/include/dds/core/detail/QosProvider.hpp deleted file mode 100644 index 62eb2529a5b..00000000000 --- a/include/dds/core/detail/QosProvider.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_QOS_PROVIDER_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_QOS_PROVIDER_HPP_ - -//#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace detail { - -//TODO: Fix when QosProviderDelegate is implemented -class QosProvider -{ -}; - -} //namespace detail -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_DETAIL_QOS_PROVIDER_HPP_ diff --git a/include/dds/core/detail/QosProviderImpl.hpp b/include/dds/core/detail/QosProviderImpl.hpp deleted file mode 100644 index ee015cde06e..00000000000 --- a/include/dds/core/detail/QosProviderImpl.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_TQOSPROVIDERIMPL_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_TQOSPROVIDERIMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { - -template -TQosProvider::TQosProvider( - const std::string& uri, - const std::string& profile) - : Reference(new DELEGATE(uri, profile)) -{ -} - -template -TQosProvider::TQosProvider( - const std::string& uri) - : Reference(new DELEGATE(uri)) -{ -} - -template -dds::domain::qos::DomainParticipantQos TQosProvider::participant_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->participant_qos(NULL); -} - -template -dds::domain::qos::DomainParticipantQos TQosProvider::participant_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->participant_qos(id.c_str()); -} - -template -dds::topic::qos::TopicQos TQosProvider::topic_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->topic_qos(NULL); -} - -template -dds::topic::qos::TopicQos TQosProvider::topic_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->topic_qos(id.c_str()); -} - -template -dds::sub::qos::SubscriberQos TQosProvider::subscriber_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->subscriber_qos(NULL); -} - -template -dds::sub::qos::SubscriberQos TQosProvider::subscriber_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->subscriber_qos(id.c_str()); -} - -template -dds::sub::qos::DataReaderQos TQosProvider::datareader_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->datareader_qos(NULL); -} - -template -dds::sub::qos::DataReaderQos TQosProvider::datareader_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->datareader_qos(id.c_str()); -} - -template -dds::pub::qos::PublisherQos TQosProvider::publisher_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->publisher_qos(NULL); -} - -template -dds::pub::qos::PublisherQos TQosProvider::publisher_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->publisher_qos(id.c_str()); -} - -template -dds::pub::qos::DataWriterQos TQosProvider::datawriter_qos() -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->datawriter_qos(NULL); -} - -template -dds::pub::qos::DataWriterQos TQosProvider::datawriter_qos( - const std::string& id) -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // return this->delegate()->datawriter_qos(id.c_str()); -} - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_DETAIL_TQOSPROVIDERIMPL_HPP_ diff --git a/include/dds/core/detail/ReferenceImpl.hpp b/include/dds/core/detail/ReferenceImpl.hpp deleted file mode 100644 index 05f20625264..00000000000 --- a/include/dds/core/detail/ReferenceImpl.hpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_REFERENCE_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_REFERENCE_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { - -// Implementation -template -Reference::Reference( - null_type&) - : impl_() -{ -} - -template -Reference::Reference( - const Reference& ref) - : impl_(ref.impl_) -{ -} - -template -template -Reference::Reference( - const Reference& ref) -{ - //To Implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // impl_ = OSPL_CXX11_STD_MODULE::dynamic_pointer_cast(ref.impl_); - // if (impl_ != ref.impl_) { - // throw dds::core::IllegalOperationError(std::string("Attempted invalid cast: ") + typeid(ref).name() + " to " + typeid(*this).name()); - // } - -} - -template -Reference::Reference( - DELEGATE_T* p) - : impl_(p) -{ -} - -template -Reference::Reference( - const DELEGATE_REF_T& p) - : impl_(p) -{ - //OMG_DDS_LOG("MM", "Reference(DELEGATE_REF_T& p)"); -} - -template -Reference::~Reference() -{ -} - -template -Reference::operator DELEGATE_REF_T() const -{ - //To implement - // ISOCPP_REPORT_STACK_NC_BEGIN(); - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_; -} - -template -template -bool Reference::operator ==( - const R& ref) const -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // bool equal = false; - // if (this->is_nil() && ref.is_nil()) { - // /* Both delegates are null. */ - // equal = true; - // } else if (!this->is_nil() && !ref.is_nil()) { - // /* Check delegates. */ - // equal = (this->delegate() == ref.delegate()); - // } - // return equal; -} - -template -template -bool Reference::operator !=( - const R& ref) const -{ - //To implement - // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); - // return !(*this == ref); -} - -template -template -Reference& Reference::operator =( - const Reference& that) -{ - //To implement - // OMG_DDS_STATIC_ASSERT((dds::core::is_base_of::value)); - // if(this != (Reference*)&that) - // { - // *this = Reference(that); - // } - // return *this; -} - -template -template -Reference& Reference::operator =( - const R& rhs) -{ - //To implement - // OMG_DDS_STATIC_ASSERT((dds::core::is_base_of< DELEGATE_T, typename R::DELEGATE_T>::value)); - // if(this != (Reference*)&rhs) - // { - // *this = Reference(rhs); - // } - // return *this; -} - -template -Reference& Reference::operator =( - const null_type) -{ - //To implement - // DELEGATE_REF_T tmp; - // impl_ = tmp; - // return *this; -} - -template -bool Reference::is_nil() const -{ - //To implement - // return impl_.get() == 0; -} - -template -bool Reference::operator ==( - const null_type) const -{ - //To implement - // return this->is_nil(); -} - -template -bool Reference::operator !=( - const null_type) const -{ - //To implement - // return !(this->is_nil()); -} - -template -const typename Reference::DELEGATE_REF_T& Reference::delegate() const -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_; -} - -template -typename Reference::DELEGATE_REF_T& Reference::delegate() -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_; -} - -template -DELEGATE* Reference::operator ->() -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_.get(); -} - -template -const DELEGATE* Reference::operator ->() const -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_.get(); -} - -template -Reference::operator const typename Reference::DELEGATE_REF_T& () const -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_; -} - -template -Reference::operator typename Reference::DELEGATE_REF_T& () -{ - //To implement - // ISOCPP_BOOL_CHECK_AND_THROW(impl_, ISOCPP_NULL_REFERENCE_ERROR, "Reference[%d] == dds::core::null", __LINE__); - // return impl_; -} - -template -void Reference::set_ref( - DELEGATE_T* p) -{ - //To implement - // impl_.reset(p); -} - -template -bool operator ==( - null_type, - const Reference& r) -{ - //To implement - // return r.is_nil(); -} - -template -bool operator !=( - null_type, - const Reference& r) -{ - //To implement - // return !r.is_nil(); -} - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_REFERENCE_IMPL_HPP_ diff --git a/include/dds/core/detail/Value.hpp b/include/dds/core/detail/Value.hpp deleted file mode 100644 index 4da652d4851..00000000000 --- a/include/dds/core/detail/Value.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_VALUE_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_VALUE_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { - -/** - * @internal @todo We can't assume that the compiler supports variadic templates, yet. - * This code should be refactored to take advantage of compilers that do support variadic - * templates. - */ - -template -Value::Value() -{ -} - -template -Value::Value( - const Value& p) - : d_(p.d_) -{ -} - -template -template -Value::Value( - const ARG& arg) - : d_(arg) -{ -} - -template -template< - typename ARG1, - typename ARG2> -Value::Value( - const ARG1& arg1, - const ARG2& arg2) - : d_(arg1, arg2) -{ -} - -template -template< - typename ARG1, - typename ARG2, - typename ARG3> -Value::Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3) - : d_(arg1, arg2, arg3) -{ -} - -template -template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4> -Value::Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4) - : d_(arg1, arg2, arg3, arg4) -{ -} - -template -template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4, - typename ARG5> -Value::Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4, - const ARG5& arg5) - : d_(arg1, arg2, arg3, arg4, arg5) -{ -} - -template -template< - typename ARG1, - typename ARG2, - typename ARG3, - typename ARG4, - typename ARG5, - typename ARG6> -Value::Value( - const ARG1& arg1, - const ARG2& arg2, - const ARG3& arg3, - const ARG4& arg4, - const ARG5& arg5, - const ARG6& arg6) - : d_(arg1, arg2, arg3, arg4, arg5, arg6) -{ -} - -template -Value::~Value() -{ -} - -template -Value& Value::operator =( - const Value& other) -{ - if (this != &other) - { - d_ = other.d_; - } - return *this; -} - -template -bool Value::operator ==( - const Value& other) const -{ - return (d_ == other.d_); -} - -template -bool Value::operator !=( - const Value& other) const -{ - return !(d_ == other.d_); -} - -template -const D* Value::operator ->() const -{ - return &d_; -} - -template -D* Value::operator ->() -{ - return &d_; -} - -template -const D& Value::delegate() const -{ - return d_; -} - -template -D& Value::delegate() -{ - return d_; -} - -template -Value::operator D& () -{ - return d_; -} - -template -Value::operator const D& () const -{ - return d_; -} - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_DETAIL_VALUE_HPP_ diff --git a/include/dds/core/detail/WeakReferenceImpl.hpp b/include/dds/core/detail/WeakReferenceImpl.hpp deleted file mode 100644 index 63d79b61833..00000000000 --- a/include/dds/core/detail/WeakReferenceImpl.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_WEAK_REFERENCE_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_WEAK_REFERENCE_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include - -namespace dds { -namespace core { - -template -WeakReference::WeakReference() -{ -} - -template -WeakReference::WeakReference( - const T& t) -{ - //To implement - // if (!t.is_nil()) { - // impl_ = t.delegate(); - // } -} - -template -WeakReference::~WeakReference() -{ -} - -template -bool WeakReference::expired() -{ - //To implement - // return impl_.expired(); -} - -template -T WeakReference::lock() -{ - //To implement - // return T(impl_.lock()); -} - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_WEAK_REFERENCE_IMPL_HPP_ diff --git a/include/dds/core/detail/array.hpp b/include/dds/core/detail/array.hpp deleted file mode 100644 index 285d53960ae..00000000000 --- a/include/dds/core/detail/array.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_ARRAY_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_ARRAY_HPP_ - -#include - -namespace dds { -namespace core { -namespace detail { - -using ::std::array; - -} //namespace detail -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_DETAIL_ARRAY_HPP_ - diff --git a/include/dds/core/detail/conformance.hpp b/include/dds/core/detail/conformance.hpp deleted file mode 100644 index f33f7d997e6..00000000000 --- a/include/dds/core/detail/conformance.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_CONFORMANCE_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_CONFORMANCE_HPP_ - -/* The following macros correspond to the compliance "profiles" of the DDS - * specification. Implementations shall modify this header to indicate their - * level of support: - * - An implementation fully implementing a given profile shall define - * the corresponding macro to "FULL". - * - An implementation partially supporting a given profile shall define - * the corresponding macro to "PARTIAL". - * - And implementation with no support for a given profile shall leave - * the corresponding macro undefined. - * - * DDS Minimum Profile support is required of all DDS implementations; - * therefore no corresponding macro is provided. - */ - -//#define OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT FULL -//#define OMG_DDS_MULTI_TOPIC_SUPPORT FULL -#define OMG_DDS_PERSISTENCE_SUPPORT FULL -#define OMG_DDS_OWNERSHIP_SUPPORT PARTIAL -#define OMG_DDS_OBJECT_MODEL_SUPPORT PARTIAL -#define OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT PARTIAL -#define OMG_DDS_X_TYPES_DYNAMIC_TYPE_SUPPORT FULL -//#define OMG_DDS_HAS_PRETTY_PRINT_COUT 1 - -#endif //EPROSIMA_DDS_CORE_DETAIL_CONFORMANCE_HPP_ diff --git a/include/dds/core/detail/dds_builtinTopics.h b/include/dds/core/detail/dds_builtinTopics.h deleted file mode 100644 index 36acc130aca..00000000000 --- a/include/dds/core/detail/dds_builtinTopics.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_BUILTINTOPICS_H_ -#define EPROSIMA_DDS_BUILTINTOPICS_H_ - -#include -#include -//TODO: Fix when DataRepresentation and TypeHash are implemented -//#include -//#include - -namespace DDS { - -typedef dds::core::ByteSeq octSeq; - -typedef dds::topic::BuiltinTopicKey BuiltinTopicKey_t; -typedef dds::core::StringSeq StringSeq; - -//TODO: Fix when DataRepresentation and TypeHash are implemented -// using org::opensplice::topic::DataRepresentationId_t; -// using org::opensplice::topic::XCDR_REPRESENTATION; -// using org::opensplice::topic::XML_REPRESENTATION; -// using org::opensplice::topic::OSPL_REPRESENTATION; -// using org::opensplice::topic::GPB_REPRESENTATION; -// using org::opensplice::topic::INVALID_REPRESENTATION; - -typedef dds::core::Duration Duration_t; - -typedef dds::core::policy::UserData UserDataQosPolicy; -typedef dds::core::policy::TopicData TopicDataQosPolicy; -typedef dds::core::policy::GroupData GroupDataQosPolicy; -typedef dds::core::policy::TransportPriority TransportPriorityQosPolicy; -typedef dds::core::policy::Lifespan LifespanQosPolicy; -typedef dds::core::policy::DurabilityKind DurabilityQosPolicyKind; -typedef dds::core::policy::Durability DurabilityQosPolicy; -typedef dds::core::policy::PresentationAccessScopeKind PresentationQosPolicyAccessScopeKind; -typedef dds::core::policy::Presentation PresentationQosPolicy; -typedef dds::core::policy::Deadline DeadlineQosPolicy; -typedef dds::core::policy::LatencyBudget LatencyBudgetQosPolicy; -typedef dds::core::policy::OwnershipKind OwnershipQosPolicyKind; -typedef dds::core::policy::Ownership OwnershipQosPolicy; -#ifdef OMG_DDS_OWNERSHIP_SUPPORT -typedef dds::core::policy::OwnershipStrength OwnershipStrengthQosPolicy; -#endif //OMG_DDS_OWNERSHIP_SUPPORT -typedef dds::core::policy::LivelinessKind LivelinessQosPolicyKind; -typedef dds::core::policy::Liveliness LivelinessQosPolicy; -typedef dds::core::policy::TimeBasedFilter TimeBasedFilterQosPolicy; -typedef dds::core::policy::Partition PartitionQosPolicy; -typedef dds::core::policy::ReliabilityKind ReliabilityQosPolicyKind; -typedef dds::core::policy::Reliability ReliabilityQosPolicy; -typedef dds::core::policy::DestinationOrderKind DestinationOrderQosPolicyKind; -typedef dds::core::policy::DestinationOrder DestinationOrderQosPolicy; -typedef dds::core::policy::HistoryKind HistoryQosPolicyKind; -typedef dds::core::policy::History HistoryQosPolicy; -typedef dds::core::policy::ResourceLimits ResourceLimitsQosPolicy; -#ifdef OMG_DDS_PERSISTENCE_SUPPORT -typedef dds::core::policy::DurabilityService DurabilityServiceQosPolicy; -#endif //OMG_DDS_PERSISTENCE_SUPPORT -//TODO: Fix when DataRepresentation and TypeHash are implemented -// typedef org::opensplice::core::policy::ProductData ProductDataQosPolicy; -typedef dds::core::policy::EntityFactory EntityFactoryQosPolicy; -// typedef org::opensplice::core::policy::Share ShareQosPolicy; -typedef dds::core::policy::WriterDataLifecycle WriterDataLifecycleQosPolicy; -// typedef org::opensplice::core::policy::InvalidSampleVisibility InvalidSampleVisibilityQosPolicyKind; -// typedef org::opensplice::core::policy::SubscriptionKey SubscriptionKeyQosPolicy; -typedef dds::core::policy::ReaderDataLifecycle ReaderDataLifecycleQosPolicy; -// typedef org::opensplice::core::policy::SubscriptionKey UserKeyQosPolicy; -// typedef org::opensplice::core::policy::ReaderLifespan ReaderLifespanQosPolicy; -// typedef org::opensplice::topic::TypeHash TypeHash; -typedef dds::topic::ParticipantBuiltinTopicData ParticipantBuiltinTopicData; -typedef dds::topic::TopicBuiltinTopicData TopicBuiltinTopicData; -// typedef org::opensplice::topic::TypeBuiltinTopicData TypeBuiltinTopicData; -typedef dds::topic::PublicationBuiltinTopicData PublicationBuiltinTopicData; -typedef dds::topic::SubscriptionBuiltinTopicData SubscriptionBuiltinTopicData; -// typedef org::opensplice::topic::CMParticipantBuiltinTopicData CMParticipantBuiltinTopicData; -// typedef org::opensplice::topic::CMPublisherBuiltinTopicData CMPublisherBuiltinTopicData; -// typedef org::opensplice::topic::CMSubscriberBuiltinTopicData CMSubscriberBuiltinTopicData; -// typedef org::opensplice::topic::CMDataWriterBuiltinTopicData CMDataWriterBuiltinTopicData; -// typedef org::opensplice::topic::CMDataReaderBuiltinTopicData CMDataReaderBuiltinTopicData; - -} //namespace DDS - -#endif //EPROSIMA_DDS_BUILTINTOPICS_H_ diff --git a/include/dds/core/detail/dds_builtinTopicsSplDcps.h b/include/dds/core/detail/dds_builtinTopicsSplDcps.h deleted file mode 100644 index 34f0ef970ca..00000000000 --- a/include/dds/core/detail/dds_builtinTopicsSplDcps.h +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_BUILTINTOPICSSPLTYPES_H_ -#define EPROSIMA_DDS_BUILTINTOPICSSPLTYPES_H_ - -//#include -//#include -//#include -//#include -//#include -#include -#include -//#include -//#include "v_copyIn.h" - -//typedef os_uchar *_DDS_octSeq; -//v_copyin_result -//__DDS_octSeq__copyIn( -// c_type dbType, -// const dds::core::ByteSeq *from, -// _DDS_octSeq *to); - - -//typedef c_long _DDS_BuiltinTopicKey_t[3]; -//v_copyin_result -//__DDS_BuiltinTopicKey_t__copyIn( -// c_type dbType, -// const dds::topic::BuiltinTopicKey *from, -// _DDS_BuiltinTopicKey_t *to); - -//typedef c_sequence _DDS_StringSeq; -//v_copyin_result -//__DDS_StringSeq__copyIn( -// c_type dbType, -// const dds::core::StringSeq *from, -// _DDS_StringSeq *to); - -//typedef c_short _DDS_DataRepresentationId_t; - -struct _DDS_Duration_t; -//OMG_DDS_API v_copyin_result __DDS_Duration_t__copyIn(c_type dbType, const struct dds::core::Duration *from, struct _DDS_Duration_t *to); -OMG_DDS_API void __DDS_Duration_t__copyOut( - const void* _from, - void* _to); -//struct _DDS_Duration_t { -// c_long sec; -// c_ulong nanosec; -//}; - - -struct _DDS_UserDataQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_UserDataQosPolicy__copyIn(c_type dbType, const dds::core::policy::UserData *from, struct _DDS_UserDataQosPolicy *to); -OMG_DDS_API void __DDS_UserDataQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_UserDataQosPolicy { -// _DDS_octSeq value; -//}; - -struct _DDS_TopicDataQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_TopicDataQosPolicy__copyIn(c_type dbType, const dds::core::policy::TopicData *from, struct _DDS_TopicDataQosPolicy *to); -OMG_DDS_API void __DDS_TopicDataQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_TopicDataQosPolicy { -// _DDS_octSeq value; -//}; - -struct _DDS_GroupDataQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_GroupDataQosPolicy__copyIn(c_type dbType, const dds::core::policy::GroupData *from, struct _DDS_GroupDataQosPolicy *to); -OMG_DDS_API void __DDS_GroupDataQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_GroupDataQosPolicy { -// _DDS_octSeq value; -//}; - -struct _DDS_TransportPriorityQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_TransportPriorityQosPolicy__copyIn(c_type dbType, const dds::core::policy::TransportPriority *from, struct _DDS_TransportPriorityQosPolicy *to); -OMG_DDS_API void __DDS_TransportPriorityQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_TransportPriorityQosPolicy { -// c_long value; -//}; - -struct _DDS_LifespanQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_LifespanQosPolicy__copyIn(c_type dbType, const dds::core::policy::Lifespan *from, struct _DDS_LifespanQosPolicy *to); -OMG_DDS_API void __DDS_LifespanQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_LifespanQosPolicy { -// struct _DDS_Duration_t duration; -//}; - -enum _DDS_DurabilityQosPolicyKind -{ - _DDS_VOLATILE_DURABILITY_QOS, - _DDS_TRANSIENT_LOCAL_DURABILITY_QOS, - _DDS_TRANSIENT_DURABILITY_QOS, - _DDS_PERSISTENT_DURABILITY_QOS -}; -struct _DDS_DurabilityQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_DurabilityQosPolicy__copyIn(c_type dbType, const dds::core::policy::Durability *from, struct _DDS_DurabilityQosPolicy *to); -OMG_DDS_API void __DDS_DurabilityQosPolicy__copyOut( - const void* _from, - void* _to); -struct _DDS_DurabilityQosPolicy -{ - enum _DDS_DurabilityQosPolicyKind kind; -}; - -enum _DDS_PresentationQosPolicyAccessScopeKind -{ - _DDS_INSTANCE_PRESENTATION_QOS, - _DDS_TOPIC_PRESENTATION_QOS, - _DDS_GROUP_PRESENTATION_QOS -}; -struct _DDS_PresentationQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_PresentationQosPolicy__copyIn(c_type dbType, const dds::core::policy::Presentation *from, struct _DDS_PresentationQosPolicy *to); -OMG_DDS_API void __DDS_PresentationQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_PresentationQosPolicy { -// enum _DDS_PresentationQosPolicyAccessScopeKind access_scope; -// c_bool coherent_access; -// c_bool ordered_access; -//}; - -struct _DDS_DeadlineQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_DeadlineQosPolicy__copyIn(c_type dbType, const dds::core::policy::Deadline *from, struct _DDS_DeadlineQosPolicy *to); -OMG_DDS_API void __DDS_DeadlineQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_DeadlineQosPolicy { -// struct _DDS_Duration_t period; -//}; - -struct _DDS_LatencyBudgetQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_LatencyBudgetQosPolicy__copyIn(c_type dbType, const dds::core::policy::LatencyBudget *from, struct _DDS_LatencyBudgetQosPolicy *to); -OMG_DDS_API void __DDS_LatencyBudgetQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_LatencyBudgetQosPolicy { -// struct _DDS_Duration_t duration; -//}; - -enum _DDS_OwnershipQosPolicyKind -{ - _DDS_SHARED_OWNERSHIP_QOS, - _DDS_EXCLUSIVE_OWNERSHIP_QOS -}; -struct _DDS_OwnershipQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_OwnershipQosPolicy__copyIn(c_type dbType, const dds::core::policy::Ownership *from, struct _DDS_OwnershipQosPolicy *to); -OMG_DDS_API void __DDS_OwnershipQosPolicy__copyOut( - const void* _from, - void* _to); -struct _DDS_OwnershipQosPolicy -{ - enum _DDS_OwnershipQosPolicyKind kind; -}; - -#ifdef OMG_DDS_OWNERSHIP_SUPPORT -struct _DDS_OwnershipStrengthQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_OwnershipStrengthQosPolicy__copyIn(c_type dbType, const dds::core::policy::OwnershipStrength *from, struct _DDS_OwnershipStrengthQosPolicy *to); -OMG_DDS_API void __DDS_OwnershipStrengthQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_OwnershipStrengthQosPolicy { -// c_long value; -//}; -#endif // OMG_DDS_OWNERSHIP_SUPPORT - -enum _DDS_LivelinessQosPolicyKind -{ - _DDS_AUTOMATIC_LIVELINESS_QOS, - _DDS_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, - _DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS -}; -struct _DDS_LivelinessQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_LivelinessQosPolicy__copyIn(c_type dbType, const dds::core::policy::Liveliness *from, struct _DDS_LivelinessQosPolicy *to); -OMG_DDS_API void __DDS_LivelinessQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_LivelinessQosPolicy { -// enum _DDS_LivelinessQosPolicyKind kind; -// struct _DDS_Duration_t lease_duration; -//}; - -struct _DDS_TimeBasedFilterQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_TimeBasedFilterQosPolicy__copyIn(c_type dbType, const dds::core::policy::TimeBasedFilter *from, struct _DDS_TimeBasedFilterQosPolicy *to); -OMG_DDS_API void __DDS_TimeBasedFilterQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_TimeBasedFilterQosPolicy { -// struct _DDS_Duration_t minimum_separation; -//}; - -struct _DDS_PartitionQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_PartitionQosPolicy__copyIn(c_type dbType, const dds::core::policy::Partition *from, struct _DDS_PartitionQosPolicy *to); -OMG_DDS_API void __DDS_PartitionQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_PartitionQosPolicy { -// _DDS_StringSeq name; -//}; - -enum _DDS_ReliabilityQosPolicyKind -{ - _DDS_BEST_EFFORT_RELIABILITY_QOS, - _DDS_RELIABLE_RELIABILITY_QOS -}; -struct _DDS_ReliabilityQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ReliabilityQosPolicy__copyIn(c_type dbType, const dds::core::policy::Reliability *from, struct _DDS_ReliabilityQosPolicy *to); -OMG_DDS_API void __DDS_ReliabilityQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ReliabilityQosPolicy { -// enum _DDS_ReliabilityQosPolicyKind kind; -// struct _DDS_Duration_t max_blocking_time; -// c_bool synchronous; -//}; - -enum _DDS_DestinationOrderQosPolicyKind -{ - _DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS, - _DDS_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS -}; -struct _DDS_DestinationOrderQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_DestinationOrderQosPolicy__copyIn(c_type dbType, const dds::core::policy::DestinationOrder *from, struct _DDS_DestinationOrderQosPolicy *to); -OMG_DDS_API void __DDS_DestinationOrderQosPolicy__copyOut( - const void* _from, - void* _to); -struct _DDS_DestinationOrderQosPolicy -{ - enum _DDS_DestinationOrderQosPolicyKind kind; -}; - -enum _DDS_HistoryQosPolicyKind -{ - _DDS_KEEP_LAST_HISTORY_QOS, - _DDS_KEEP_ALL_HISTORY_QOS -}; -struct _DDS_HistoryQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_HistoryQosPolicy__copyIn(c_type dbType, const dds::core::policy::History *from, struct _DDS_HistoryQosPolicy *to); -OMG_DDS_API void __DDS_HistoryQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_HistoryQosPolicy { -// enum _DDS_HistoryQosPolicyKind kind; -// c_long depth; -//}; - -struct _DDS_ResourceLimitsQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ResourceLimitsQosPolicy__copyIn(c_type dbType, const dds::core::policy::ResourceLimits *from, struct _DDS_ResourceLimitsQosPolicy *to); -OMG_DDS_API void __DDS_ResourceLimitsQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ResourceLimitsQosPolicy { -// c_long max_samples; -// c_long max_instances; -// c_long max_samples_per_instance; -//}; - -#ifdef OMG_DDS_PERSISTENCE_SUPPORT -struct _DDS_DurabilityServiceQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_DurabilityServiceQosPolicy__copyIn(c_type dbType, const dds::core::policy::DurabilityService *from, struct _DDS_DurabilityServiceQosPolicy *to); -OMG_DDS_API void __DDS_DurabilityServiceQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_DurabilityServiceQosPolicy { -// struct _DDS_Duration_t service_cleanup_delay; -// enum _DDS_HistoryQosPolicyKind history_kind; -// c_long history_depth; -// c_long max_samples; -// c_long max_instances; -// c_long max_samples_per_instance; -//}; -#endif // OMG_DDS_PERSISTENCE_SUPPORT - -struct _DDS_ProductDataQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ProductDataQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::ProductData *from, struct _DDS_ProductDataQosPolicy *to); -OMG_DDS_API void __DDS_ProductDataQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ProductDataQosPolicy { -// c_string value; -//}; - -struct _DDS_EntityFactoryQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_EntityFactoryQosPolicy__copyIn(c_type dbType, const dds::core::policy::EntityFactory *from, struct _DDS_EntityFactoryQosPolicy *to); -OMG_DDS_API void __DDS_EntityFactoryQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_EntityFactoryQosPolicy { -// c_bool autoenable_created_entities; -//}; - -struct _DDS_ShareQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ShareQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::Share *from, struct _DDS_ShareQosPolicy *to); -OMG_DDS_API void __DDS_ShareQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ShareQosPolicy { -// c_string name; -// c_bool enable; -//}; - -struct _DDS_WriterDataLifecycleQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_WriterDataLifecycleQosPolicy__copyIn(c_type dbType, const dds::core::policy::WriterDataLifecycle *from, struct _DDS_WriterDataLifecycleQosPolicy *to); -OMG_DDS_API void __DDS_WriterDataLifecycleQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_WriterDataLifecycleQosPolicy { -// c_bool autodispose_unregistered_instances; -// struct _DDS_Duration_t autopurge_suspended_samples_delay; -// struct _DDS_Duration_t autounregister_instance_delay; -//}; - -enum _DDS_InvalidSampleVisibilityQosPolicyKind -{ - _DDS_NO_INVALID_SAMPLES, - _DDS_MINIMUM_INVALID_SAMPLES, - _DDS_ALL_INVALID_SAMPLES -}; -struct _DDS_InvalidSampleVisibilityQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_InvalidSampleVisibilityQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::InvalidSampleVisibility *from, struct _DDS_InvalidSampleVisibilityQosPolicy *to); -OMG_DDS_API void __DDS_InvalidSampleVisibilityQosPolicy__copyOut( - const void* _from, - void* _to); -struct _DDS_InvalidSampleVisibilityQosPolicy -{ - enum _DDS_InvalidSampleVisibilityQosPolicyKind kind; -}; - -struct _DDS_SubscriptionKeyQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_SubscriptionKeyQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::SubscriptionKey *from, struct _DDS_SubscriptionKeyQosPolicy *to); -OMG_DDS_API void __DDS_SubscriptionKeyQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_SubscriptionKeyQosPolicy { -// c_bool use_key_list; -// _DDS_StringSeq key_list; -//}; - -struct _DDS_ReaderDataLifecycleQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ReaderDataLifecycleQosPolicy__copyIn(c_type dbType, const dds::core::policy::ReaderDataLifecycle *from, struct _DDS_ReaderDataLifecycleQosPolicy *to); -OMG_DDS_API void __DDS_ReaderDataLifecycleQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ReaderDataLifecycleQosPolicy { -// struct _DDS_Duration_t autopurge_nowriter_samples_delay; -// struct _DDS_Duration_t autopurge_disposed_samples_delay; -// c_bool autopurge_dispose_all; -// c_bool enable_invalid_samples; -// struct _DDS_InvalidSampleVisibilityQosPolicy invalid_sample_visibility; -//}; - -struct _DDS_UserKeyQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_UserKeyQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::SubscriptionKey *from, struct _DDS_UserKeyQosPolicy *to); -OMG_DDS_API void __DDS_UserKeyQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_UserKeyQosPolicy { -// c_bool enable; -// c_string expression; -//}; - -struct _DDS_ReaderLifespanQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_ReaderLifespanQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::ReaderLifespan *from, struct _DDS_ReaderLifespanQosPolicy *to); -OMG_DDS_API void __DDS_ReaderLifespanQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_ReaderLifespanQosPolicy { -// c_bool use_lifespan; -// struct _DDS_Duration_t duration; -//}; - -struct _DDS_TypeHash; -//OMG_DDS_API v_copyin_result __DDS_TypeHash__copyIn(c_type dbType, const class org::opensplice::topic::TypeHash *from, struct _DDS_TypeHash *to); -OMG_DDS_API void __DDS_TypeHash__copyOut( - const void* _from, - void* _to); -//struct _DDS_TypeHash { -// c_ulonglong msb; -// c_ulonglong lsb; -//}; - -struct _DDS_ParticipantBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_ParticipantBuiltinTopicData__copyIn(c_type dbType, const dds::topic::ParticipantBuiltinTopicData *from, struct _DDS_ParticipantBuiltinTopicData *to); -OMG_DDS_API void __DDS_ParticipantBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_ParticipantBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_UserDataQosPolicy user_data; -//}; - -struct _DDS_TopicBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_TopicBuiltinTopicData__copyIn(c_type dbType, const dds::topic::TopicBuiltinTopicData *from, struct _DDS_TopicBuiltinTopicData *to); -OMG_DDS_API void __DDS_TopicBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_TopicBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// c_string name; -// c_string type_name; -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DurabilityServiceQosPolicy durability_service; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_TransportPriorityQosPolicy transport_priority; -// struct _DDS_LifespanQosPolicy lifespan; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_OwnershipQosPolicy ownership; -// struct _DDS_TopicDataQosPolicy topic_data; -//}; - -struct _DDS_TypeBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_TypeBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::TypeBuiltinTopicData *from, struct _DDS_TypeBuiltinTopicData *to); -OMG_DDS_API void __DDS_TypeBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_TypeBuiltinTopicData { -// c_string name; -// _DDS_DataRepresentationId_t data_representation_id; -// struct _DDS_TypeHash type_hash; -// _DDS_octSeq meta_data; -// _DDS_octSeq extentions; -//}; - -struct _DDS_PublicationBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_PublicationBuiltinTopicData__copyIn(c_type dbType, const dds::topic::PublicationBuiltinTopicData *from, struct _DDS_PublicationBuiltinTopicData *to); -OMG_DDS_API void __DDS_PublicationBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_PublicationBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// _DDS_BuiltinTopicKey_t participant_key; -// c_string topic_name; -// c_string type_name; -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_LifespanQosPolicy lifespan; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_UserDataQosPolicy user_data; -// struct _DDS_OwnershipQosPolicy ownership; -// struct _DDS_OwnershipStrengthQosPolicy ownership_strength; -// struct _DDS_PresentationQosPolicy presentation; -// struct _DDS_PartitionQosPolicy partition; -// struct _DDS_TopicDataQosPolicy topic_data; -// struct _DDS_GroupDataQosPolicy group_data; -//}; - -struct _DDS_SubscriptionBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_SubscriptionBuiltinTopicData__copyIn(c_type dbType, const dds::topic::SubscriptionBuiltinTopicData *from, struct _DDS_SubscriptionBuiltinTopicData *to); -OMG_DDS_API void __DDS_SubscriptionBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_SubscriptionBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// _DDS_BuiltinTopicKey_t participant_key; -// c_string topic_name; -// c_string type_name; -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_OwnershipQosPolicy ownership; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_UserDataQosPolicy user_data; -// struct _DDS_TimeBasedFilterQosPolicy time_based_filter; -// struct _DDS_PresentationQosPolicy presentation; -// struct _DDS_PartitionQosPolicy partition; -// struct _DDS_TopicDataQosPolicy topic_data; -// struct _DDS_GroupDataQosPolicy group_data; -//}; - -struct _DDS_CMParticipantBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_CMParticipantBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::CMParticipantBuiltinTopicData *from, struct _DDS_CMParticipantBuiltinTopicData *to); -OMG_DDS_API void __DDS_CMParticipantBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_CMParticipantBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_ProductDataQosPolicy product; -//}; - - -struct _DDS_CMPublisherBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_CMPublisherBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::CMPublisherBuiltinTopicData *from, struct _DDS_CMPublisherBuiltinTopicData *to); -OMG_DDS_API void __DDS_CMPublisherBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_CMPublisherBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_ProductDataQosPolicy product; -// _DDS_BuiltinTopicKey_t participant_key; -// c_string name; -// struct _DDS_EntityFactoryQosPolicy entity_factory; -// struct _DDS_PartitionQosPolicy partition; -//}; - -struct _DDS_CMSubscriberBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_CMSubscriberBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::CMSubscriberBuiltinTopicData *from, struct _DDS_CMSubscriberBuiltinTopicData *to); -OMG_DDS_API void __DDS_CMSubscriberBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_CMSubscriberBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_ProductDataQosPolicy product; -// _DDS_BuiltinTopicKey_t participant_key; -// c_string name; -// struct _DDS_EntityFactoryQosPolicy entity_factory; -// struct _DDS_ShareQosPolicy share; -// struct _DDS_PartitionQosPolicy partition; -//}; - -struct _DDS_CMDataWriterBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_CMDataWriterBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::CMDataWriterBuiltinTopicData *from, struct _DDS_CMDataWriterBuiltinTopicData *to); -OMG_DDS_API void __DDS_CMDataWriterBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_CMDataWriterBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_ProductDataQosPolicy product; -// _DDS_BuiltinTopicKey_t publisher_key; -// c_string name; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_WriterDataLifecycleQosPolicy writer_data_lifecycle; -//}; - -struct _DDS_CMDataReaderBuiltinTopicData; -//OMG_DDS_API v_copyin_result __DDS_CMDataReaderBuiltinTopicData__copyIn(c_type dbType, const org::opensplice::topic::CMDataReaderBuiltinTopicData *from, struct _DDS_CMDataReaderBuiltinTopicData *to); -OMG_DDS_API void __DDS_CMDataReaderBuiltinTopicData__copyOut( - const void* _from, - void* _to); -//struct _DDS_CMDataReaderBuiltinTopicData { -// _DDS_BuiltinTopicKey_t key; -// struct _DDS_ProductDataQosPolicy product; -// _DDS_BuiltinTopicKey_t subscriber_key; -// c_string name; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_ReaderDataLifecycleQosPolicy reader_data_lifecycle; -// struct _DDS_UserKeyQosPolicy subscription_keys; -// struct _DDS_ReaderLifespanQosPolicy reader_lifespan; -// struct _DDS_ShareQosPolicy share; -//}; - - - -#endif //EPROSIMA_DDS_BUILTINTOPICSSPLTYPES_H_ diff --git a/include/dds/core/detail/dds_builtinTopics_DCPS.hpp b/include/dds/core/detail/dds_builtinTopics_DCPS.hpp deleted file mode 100644 index f0b769b667e..00000000000 --- a/include/dds/core/detail/dds_builtinTopics_DCPS.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_BUILTINTOPICS_HPP_ -#define EPROSIMA_DDS_BUILTINTOPICS_HPP_ - -#include "dds/dds.hpp" - -#include "dds/core/detail/dds_builtinTopics.h" -#include "dds/core/detail/dds_builtinTopicsSplDcps.h" - -#endif //EPROSIMA_DDS_BUILTINTOPICS_HPP_ diff --git a/include/dds/core/detail/dds_dcps_builtintopics.h b/include/dds/core/detail/dds_dcps_builtintopics.h deleted file mode 100644 index d6281dedd16..00000000000 --- a/include/dds/core/detail/dds_dcps_builtintopics.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_DCPS_BUILTINTOPICS_H_ -#define EPROSIMA_DDS_DCPS_BUILTINTOPICS_H_ - -#include - -namespace DDS { -typedef dds::core::Time Time_t; - -// typedef org::opensplice::core::policy::SchedulingKind::Type SchedulingClassQosPolicyKind; -// typedef org::opensplice::core::policy::SchedulingKind::Type SchedulingClassQosPolicy; -// typedef org::opensplice::core::policy::SchedulingPriorityKind::Type SchedulingPriorityQosPolicyKind; -// typedef org::opensplice::core::policy::SchedulingPriorityKind::Type SchedulingPriorityQosPolicy; -// typedef org::opensplice::core::policy::TScheduling< -// org::opensplice::core::policy::SchedulingDelegate> SchedulingQosPolicy; - -typedef dds::domain::qos::DomainParticipantQos DomainParticipantQos; -typedef dds::topic::qos::TopicQos TopicQos; -typedef dds::pub::qos::DataWriterQos DataWriterQos; -typedef dds::pub::qos::PublisherQos PublisherQos; -typedef dds::sub::qos::DataReaderQos DataReaderQos; -typedef dds::sub::qos::SubscriberQos SubscriberQos; -} //namespace DDS - -#endif //EPROSIMA_DDS_DCPS_BUILTINTOPICS_H_ diff --git a/include/dds/core/detail/dds_dcps_builtintopicsSplDcps.h b/include/dds/core/detail/dds_dcps_builtintopicsSplDcps.h deleted file mode 100644 index f06a177d5b0..00000000000 --- a/include/dds/core/detail/dds_dcps_builtintopicsSplDcps.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_DCPS_BUILTINTOPICSSPLTYPES_H_ -#define EPROSIMA_DDS_DCPS_BUILTINTOPICSSPLTYPES_H_ - -#include - -struct _DDS_Time_t; -//OMG_DDS_API v_copyin_result __DDS_Time_t__copyIn(c_type dbType, const dds::core::Time *from, struct _DDS_Time_t *to); -OMG_DDS_API void __DDS_Time_t__copyOut( - const void* _from, - void* _to); -//struct _DDS_Time_t { -// c_long sec; -// c_ulong nanosec; -//}; - -enum _DDS_SchedulingClassQosPolicyKind -{ - _DDS_SCHEDULE_DEFAULT, - _DDS_SCHEDULE_TIMESHARING, - _DDS_SCHEDULE_REALTIME -}; - -struct _DDS_SchedulingClassQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_SchedulingClassQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::SchedulingKind *from, struct _DDS_SchedulingClassQosPolicy *to); -OMG_DDS_API void __DDS_SchedulingClassQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_SchedulingClassQosPolicy { -// enum _DDS_SchedulingClassQosPolicyKind kind; -//}; - -enum _DDS_SchedulingPriorityQosPolicyKind -{ - _DDS_PRIORITY_RELATIVE, - _DDS_PRIORITY_ABSOLUTE -}; - -struct _DDS_SchedulingPriorityQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_SchedulingPriorityQosPolicy__copyIn(c_type dbType, const org::opensplice::core::policy::SchedulingPriorityKind *from, struct _DDS_SchedulingPriorityQosPolicy *to); -OMG_DDS_API void __DDS_SchedulingPriorityQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_SchedulingPriorityQosPolicy { -// enum _DDS_SchedulingPriorityQosPolicyKind kind; -//}; - -struct _DDS_SchedulingQosPolicy; -//OMG_DDS_API v_copyin_result __DDS_SchedulingQosPolicy__copyIn(c_type dbType, const DDS::SchedulingQosPolicy *from, struct _DDS_SchedulingQosPolicy *to); -OMG_DDS_API void __DDS_SchedulingQosPolicy__copyOut( - const void* _from, - void* _to); -//struct _DDS_SchedulingQosPolicy { -// struct _DDS_SchedulingClassQosPolicy scheduling_class; -// struct _DDS_SchedulingPriorityQosPolicy scheduling_priority_kind; -// c_long scheduling_priority; -//}; - -struct _DDS_DomainParticipantQos; -//OMG_DDS_API v_copyin_result __DDS_DomainParticipantQos__copyIn(c_type dbType, const dds::domain::qos::DomainParticipantQos *from, struct _DDS_DomainParticipantQos *to); -OMG_DDS_API void __DDS_DomainParticipantQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_DomainParticipantQos { -// struct _DDS_UserDataQosPolicy user_data; -// struct _DDS_EntityFactoryQosPolicy entity_factory; -// struct _DDS_SchedulingQosPolicy watchdog_scheduling; -// struct _DDS_SchedulingQosPolicy listener_scheduling; -//}; - -struct _DDS_TopicQos; -//OMG_DDS_API v_copyin_result __DDS_TopicQos__copyIn(c_type dbType, const dds::topic::qos::TopicQos *from, struct _DDS_TopicQos *to); -OMG_DDS_API void __DDS_TopicQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_TopicQos { -// struct _DDS_TopicDataQosPolicy topic_data; -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DurabilityServiceQosPolicy durability_service; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_TransportPriorityQosPolicy transport_priority; -// struct _DDS_LifespanQosPolicy lifespan; -// struct _DDS_OwnershipQosPolicy ownership; -//}; - -struct _DDS_DataWriterQos; -//OMG_DDS_API v_copyin_result __DDS_DataWriterQos__copyIn(c_type dbType, const dds::pub::qos::DataWriterQos *from, struct _DDS_DataWriterQos *to); -OMG_DDS_API void __DDS_DataWriterQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_DataWriterQos { -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_TransportPriorityQosPolicy transport_priority; -// struct _DDS_LifespanQosPolicy lifespan; -// struct _DDS_UserDataQosPolicy user_data; -// struct _DDS_OwnershipQosPolicy ownership; -// struct _DDS_OwnershipStrengthQosPolicy ownership_strength; -// struct _DDS_WriterDataLifecycleQosPolicy writer_data_lifecycle; -//}; - -struct _DDS_PublisherQos; -//OMG_DDS_API v_copyin_result __DDS_PublisherQos__copyIn(c_type dbType, const dds::pub::qos::PublisherQos *from, struct _DDS_PublisherQos *to); -OMG_DDS_API void __DDS_PublisherQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_PublisherQos { -// struct _DDS_PresentationQosPolicy presentation; -// struct _DDS_PartitionQosPolicy partition; -// struct _DDS_GroupDataQosPolicy group_data; -// struct _DDS_EntityFactoryQosPolicy entity_factory; -//}; - -struct _DDS_DataReaderQos; -//OMG_DDS_API v_copyin_result __DDS_DataReaderQos__copyIn(c_type dbType, const dds::sub::qos::DataReaderQos *from, struct _DDS_DataReaderQos *to); -OMG_DDS_API void __DDS_DataReaderQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_DataReaderQos { -// struct _DDS_DurabilityQosPolicy durability; -// struct _DDS_DeadlineQosPolicy deadline; -// struct _DDS_LatencyBudgetQosPolicy latency_budget; -// struct _DDS_LivelinessQosPolicy liveliness; -// struct _DDS_ReliabilityQosPolicy reliability; -// struct _DDS_DestinationOrderQosPolicy destination_order; -// struct _DDS_HistoryQosPolicy history; -// struct _DDS_ResourceLimitsQosPolicy resource_limits; -// struct _DDS_UserDataQosPolicy user_data; -// struct _DDS_OwnershipQosPolicy ownership; -// struct _DDS_TimeBasedFilterQosPolicy time_based_filter; -// struct _DDS_ReaderDataLifecycleQosPolicy reader_data_lifecycle; -// struct _DDS_SubscriptionKeyQosPolicy subscription_keys; -// struct _DDS_ReaderLifespanQosPolicy reader_lifespan; -// struct _DDS_ShareQosPolicy share; -//}; - -struct _DDS_SubscriberQos; -//OMG_DDS_API v_copyin_result __DDS_SubscriberQos__copyIn(c_type dbType, const dds::sub::qos::SubscriberQos *from, struct _DDS_SubscriberQos *to); -OMG_DDS_API void __DDS_SubscriberQos__copyOut( - const void* _from, - void* _to); -//struct _DDS_SubscriberQos { -// struct _DDS_PresentationQosPolicy presentation; -// struct _DDS_PartitionQosPolicy partition; -// struct _DDS_GroupDataQosPolicy group_data; -// struct _DDS_EntityFactoryQosPolicy entity_factory; -// struct _DDS_ShareQosPolicy share; -//}; - -#endif //EPROSIMA_DDS_DCPS_BUILTINTOPICSSPLTYPES_H_ diff --git a/include/dds/core/detail/dds_dcps_builtintopics_DCPS.hpp b/include/dds/core/detail/dds_dcps_builtintopics_DCPS.hpp deleted file mode 100644 index d6a2c5c0837..00000000000 --- a/include/dds/core/detail/dds_dcps_builtintopics_DCPS.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_DCPS_BUILTINTOPICS_DCPS_HPP_ -#define EPROSIMA_DDS_DCPS_BUILTINTOPICS_DCPS_HPP_ - -#include "dds/core/detail/dds_dcps_builtintopics.h" -#include "dds/core/detail/dds_dcps_builtintopicsSplDcps.h" - -#endif //EPROSIMA_DDS_DCPS_BUILTINTOPICS_DCPS_HPP_ diff --git a/include/dds/core/detail/ddscore.hpp b/include/dds/core/detail/ddscore.hpp deleted file mode 100644 index 25aaf457bf5..00000000000 --- a/include/dds/core/detail/ddscore.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_PACKAGE_DETAIL_INCLUDE_HPP_ -#define EPROSIMA_DDS_CORE_PACKAGE_DETAIL_INCLUDE_HPP_ - -/* Nothing to 'post' include. */ - -#endif //EPROSIMA_DDS_CORE_PACKAGE_DETAIL_INCLUDE_HPP_ diff --git a/include/dds/core/detail/inttypes.hpp b/include/dds/core/detail/inttypes.hpp deleted file mode 100644 index 226a0a409aa..00000000000 --- a/include/dds/core/detail/inttypes.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_INTTYPES_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_INTTYPES_HPP_ - -#include - -#endif //EPROSIMA_DDS_CORE_DETAIL_INTTYPES_HPP_ - diff --git a/include/dds/core/detail/macros.hpp b/include/dds/core/detail/macros.hpp deleted file mode 100644 index 5c1446be7bd..00000000000 --- a/include/dds/core/detail/macros.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_MACROS_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_MACROS_HPP_ - -#include - -#include - -// Constants -#define OMG_DDS_DEFAULT_STATE_BIT_COUNT_DETAIL size_t(16) -#define OMG_DDS_DEFAULT_STATUS_COUNT_DETAIL size_t(16) -// ========================================================================== - -// Static Assert -#define OMG_DDS_STATIC_ASSERT_DETAIL(...) static_assert(__VA_ARGS__, #__VA_ARGS__) -// ========================================================================== - -// Logging Macros -#define OMG_DDS_LOG_DETAIL(kind, msg) \ - std::cout << "[" << kind << "]: " << msg << std::endl; -// ========================================================================== - - -#define OMG_DDS_API_DETAIL RTPS_DllAPI -// ========================================================================== - - -#endif //EPROSIMA_DDS_CORE_DETAIL_MACROS_HPP_ diff --git a/include/dds/core/detail/module_docs.hpp b/include/dds/core/detail/module_docs.hpp deleted file mode 100644 index 534e274d0f9..00000000000 --- a/include/dds/core/detail/module_docs.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_MODULE_DOCS_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_MODULE_DOCS_HPP_ - -/** - * @file - * This file exists only to be fed to doxygen. There is quite - * literally nothing else to see here. - */ - -/** - * @addtogroup isocpp2_dcps ISO/IEC C++ 2 API for DDS Data-centric Publish-Subscribe (DCPS) - */ -/** @{*/ -/** @dir dds */ -/** @}*/ - -/** - * @addtogroup isocpp2_dcps_domain Domain Module - ::dds::domain - * @ingroup isocpp2_dcps */ -/** @{*/ -/** @dir dds/domain */ -/** @}*/ - - -/** - * @addtogroup isocpp2_dcps_topic Topic Module- ::dds::topic - * @ingroup isocpp2_dcps */ -/** @{*/ -/** @dir dds/topic */ -/** @}*/ - -/** - * @addtogroup isocpp2_dcps_pub Publication Module - ::dds::pub - * @ingroup isocpp2_dcps */ -/** @{*/ -/** @dir dds/pub */ -/** @}*/ - - -/** - * @addtogroup isocpp2_dcps_sub Subscription Module - ::dds::sub - * @ingroup isocpp2_dcps */ -/** @{*/ -/** @dir dds/sub */ -/** @}*/ - -/** - * @addtogroup isocpp2_dcps_core Core / Common Module - ::dds::core - * @ingroup isocpp2_dcps */ -/** @{*/ -/** @dir dds/core */ -/** @}*/ - - -/** - * @addtogroup examplesdcpsisocpp ISO/IEC C++ DCPS PSM Examples - */ -/** @{*/ -/** @dir examples/common */ -/** @}*/ - - - -/** - * @ingroup isocpp2_dcps - */ -namespace dds { -/** - * @ingroup isocpp2_dcps_domain - * @ingroup isocpp2_dcps */ -namespace domain { -/** @ingroup isocpp2_dcps_domain - * @ingroup isocpp2_dcps */ -namespace qos { -namespace detail {} -} //namespace qos -namespace detail {} -} //namespace domain -/** - * @ingroup isocpp2_dcps_topic - * @ingroup isocpp2_dcps */ -namespace topic { -/** @ingroup isocpp2_dcps_topic - * @ingroup isocpp2_dcps */ -namespace qos { -namespace detail {} -} //namespace qos -namespace detail {} -} //namespace topic -/** - * @ingroup isocpp2_dcps_pub - * @ingroup isocpp2_dcps */ -namespace pub { -/** @ingroup isocpp2_dcps_pub - * @ingroup isocpp2_dcps */ -namespace qos { -namespace detail {} -} //namespace qos -namespace detail {} -} //namespace pub -/** - * @ingroup isocpp2_dcps_sub - * @ingroup isocpp2_dcps */ -namespace sub { -/** @ingroup isocpp2_dcps_sub - * @ingroup isocpp2_dcps */ -namespace cond { -namespace detail {} -} //namespace cond -/** @ingroup isocpp2_dcps_sub - * @ingroup isocpp2_dcps */ -namespace functors { -namespace detail {} -} //namespace functors -/** @ingroup isocpp2_dcps_sub - * @ingroup isocpp2_dcps */ -namespace status {} -/** @ingroup isocpp2_dcps_sub - * @ingroup isocpp2_dcps */ -namespace qos { -namespace detail {} -} //namespace qos -} //namespace sub -/** - * @ingroup isocpp2_dcps_core - * @ingroup isocpp2_dcps */ -namespace core { -/** @ingroup isocpp2_dcps_core - * @ingroup isocpp2_dcps */ -namespace policy { -namespace detail {} -} //namespace policy -/** @ingroup isocpp2_dcps_core - * @ingroup isocpp2_dcps */ -namespace cond { -namespace detail {} -} //namespace cond -/** @ingroup isocpp2_dcps_core - * @ingroup isocpp2_dcps */ -namespace status { -namespace detail {} -} //namespace status -namespace detail {} -} //namespace core -} //namespace dds - - -#endif //EPROSIMA_DDS_CORE_DETAIL_MODULE_DOCS_HPP_ diff --git a/include/dds/core/detail/old_win_stdint.h b/include/dds/core/detail/old_win_stdint.h deleted file mode 100644 index 26fa0a1b7b3..00000000000 --- a/include/dds/core/detail/old_win_stdint.h +++ /dev/null @@ -1,247 +0,0 @@ -/** - * @file - * This file provides definitions for stdint header types for versions of - * Windows that didn't have it. It was discovered on the intahwebs at - * http://snipplr.com/view/18199/stdinth/ where it was described thus: - * "A public domain stdint.h. Original code is from a public domain version - * in the MinGW distribution. This one has been modified to fix a couple bugs - * (to make some macros 64-bit aware) and to make it compatible with VC6." - * It was published there on 08/12/09 - * @see dds/core/detail/inttypes.h - */ - -/* ISO C9x 7.18 Integer types - * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * Contributor: Danny Smith - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Date: 2000-12-02 - * - * mwb: This was modified in the following ways: - * - * - make it compatible with Visual C++ 6 (which uses - * non-standard keywords and suffixes for 64-bit types) - * - some environments need stddef.h included (for wchar stuff?) - * - handle the fact that Microsoft's limits.h header defines - * SIZE_MAX - * - make corrections for SIZE_MAX, INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX, - * PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, and SIG_ATOMIC_MAX - * to be 64-bit aware. - */ - - -#ifndef _STDINT_H -#define _STDINT_H -#define __need_wint_t -#define __need_wchar_t -#include -#include - -#if _MSC_VER && (_MSC_VER < 1300) -/* using MSVC 6 or earlier - no "long long" type, but might have _int64 type */ -#define __STDINT_LONGLONG __int64 -#define __STDINT_LONGLONG_SUFFIX i64 -#else -#define __STDINT_LONGLONG long long -#define __STDINT_LONGLONG_SUFFIX LL -#endif - -#if !defined( PASTE) -#define PASTE2( x, y) x ## y -#define PASTE( x, y) PASTE2( x, y) -#endif /* PASTE */ - - -/* 7.18.1.1 Exact-width integer types */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; -typedef unsigned short uint16_t; -typedef int int32_t; -typedef unsigned uint32_t; -typedef __STDINT_LONGLONG int64_t; -typedef unsigned __STDINT_LONGLONG uint64_t; - -/* 7.18.1.2 Minimum-width integer types */ -typedef signed char int_least8_t; -typedef unsigned char uint_least8_t; -typedef short int_least16_t; -typedef unsigned short uint_least16_t; -typedef int int_least32_t; -typedef unsigned uint_least32_t; -typedef __STDINT_LONGLONG int_least64_t; -typedef unsigned __STDINT_LONGLONG uint_least64_t; - -/* 7.18.1.3 Fastest minimum-width integer types - * Not actually guaranteed to be fastest for all purposes - * Here we use the exact-width types for 8 and 16-bit ints. - */ -typedef char int_fast8_t; -typedef unsigned char uint_fast8_t; -typedef short int_fast16_t; -typedef unsigned short uint_fast16_t; -typedef int int_fast32_t; -typedef unsigned int uint_fast32_t; -typedef __STDINT_LONGLONG int_fast64_t; -typedef unsigned __STDINT_LONGLONG uint_fast64_t; - -/* 7.18.1.4 Integer types capable of holding object pointers */ -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 -typedef __STDINT_LONGLONG intptr_t -#else -typedef int intptr_t; -#endif /* _WIN64 */ -#endif /* _INTPTR_T_DEFINED */ - -#ifndef _UINTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __STDINT_LONGLONG uintptr_t -#else -typedef unsigned int uintptr_t; -#endif /* _WIN64 */ -#endif /* _UINTPTR_T_DEFINED */ - -/* 7.18.1.5 Greatest-width integer types */ -typedef __STDINT_LONGLONG intmax_t; -typedef unsigned __STDINT_LONGLONG uintmax_t; - -/* 7.18.2 Limits of specified-width integer types */ -#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) - -/* 7.18.2.1 Limits of exact-width integer types */ -#define INT8_MIN (-128) -#define INT16_MIN (-32768) -#define INT32_MIN (-2147483647 - 1) -#define INT64_MIN (PASTE( -9223372036854775807, __STDINT_LONGLONG_SUFFIX) - 1) - -#define INT8_MAX 127 -#define INT16_MAX 32767 -#define INT32_MAX 2147483647 -#define INT64_MAX (PASTE( 9223372036854775807, __STDINT_LONGLONG_SUFFIX)) - -#define UINT8_MAX 0xff /* 255U */ -#define UINT16_MAX 0xffff /* 65535U */ -#define UINT32_MAX 0xffffffff /* 4294967295U */ -#define UINT64_MAX (PASTE( 0xffffffffffffffffU, __STDINT_LONGLONG_SUFFIX)) /* 18446744073709551615ULL */ - -/* 7.18.2.2 Limits of minimum-width integer types */ -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST64_MIN INT64_MIN - -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MAX INT64_MAX - -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -/* 7.18.2.3 Limits of fastest minimum-width integer types */ -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST64_MIN INT64_MIN - -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MAX INT64_MAX - -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -/* 7.18.2.4 Limits of integer types capable of holding - object pointers */ -#ifdef _WIN64 -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#else -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#endif /* _WIN64 */ - -/* 7.18.2.5 Limits of greatest-width integer types */ -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -/* 7.18.3 Limits of other integer types */ -#define PTRDIFF_MIN INTPTR_MIN -#define PTRDIFF_MAX INTPTR_MAX - -#define SIG_ATOMIC_MIN INTPTR_MIN -#define SIG_ATOMIC_MAX INTPTR_MAX - -/* we need to check for SIZE_MAX already defined because MS defines it in limits.h */ -#ifndef SIZE_MAX -#define SIZE_MAX UINTPTR_MAX -#endif - -#ifndef WCHAR_MIN /* also in wchar.h */ -#define WCHAR_MIN 0 -#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ -#endif - -/* - * wint_t is unsigned short for compatibility with MS runtime - */ -#define WINT_MIN 0 -#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */ - -#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ - - -/* 7.18.4 Macros for integer constants */ -#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) - -/* 7.18.4.1 Macros for minimum-width integer constants - - Accoding to Douglas Gwyn : - "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC - 9899:1999 as initially published, the expansion was required - to be an integer constant of precisely matching type, which - is impossible to accomplish for the shorter types on most - platforms, because C99 provides no standard way to designate - an integer constant with width less than that of type int. - TC1 changed this to require just an integer constant - * expression* with *promoted* type." - */ - -#define INT8_C(val) ((int8_t) + (val)) -#define UINT8_C(val) ((uint8_t) + (val ## U)) -#define INT16_C(val) ((int16_t) + (val)) -#define UINT16_C(val) ((uint16_t) + (val ## U)) - -#define INT32_C(val) val ## L -#define UINT32_C(val) val ## UL -#define INT64_C(val) (PASTE( val, __STDINT_LONGLONG_SUFFIX)) -#define UINT64_C(val)(PASTE( PASTE( val, U), __STDINT_LONGLONG_SUFFIX)) - -/* 7.18.4.2 Macros for greatest-width integer constants */ -#define INTMAX_C(val) INT64_C(val) -#define UINTMAX_C(val) UINT64_C(val) - -#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ - -#endif diff --git a/include/dds/core/detail/ref_traits.hpp b/include/dds/core/detail/ref_traits.hpp deleted file mode 100644 index 831eac10456..00000000000 --- a/include/dds/core/detail/ref_traits.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_DETAIL_REF_TRAITS_HPP_ -#define EPROSIMA_DDS_CORE_DETAIL_REF_TRAITS_HPP_ - -#include //null -#include //InvalidDowncastError - -#include -#include - -namespace dds { -namespace core { - -template< - typename T1, - typename T2> -struct is_base_of : public ::std::is_base_of { }; - -template< - typename T1, - typename T2> -struct is_same : public ::std::is_same { }; - -template -struct smart_ptr_traits -{ - typedef ::std::shared_ptr ref_type; - typedef ::std::weak_ptr weak_ref_type; -}; - -template< - typename TO, - typename FROM> -TO polymorphic_cast( - FROM& from) -{ - - typename TO::DELEGATE_REF_T dr = ::std::dynamic_pointer_cast(from.delegate()); - - TO to(dr); - if (to == null) - { - throw InvalidDowncastError("Attempted invalid downcast."); - } - return to; -} - -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_DETAIL_REF_TRAITS_HPP_ diff --git a/include/dds/core/macros.hpp b/include/dds/core/macros.hpp deleted file mode 100644 index d8065397f6b..00000000000 --- a/include/dds/core/macros.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_MACROS_HPP_ -#define OMG_DDS_CORE_MACROS_HPP_ - -#include - -// == Static Assert ========================================================= -#define OMG_DDS_STATIC_ASSERT OMG_DDS_STATIC_ASSERT_DETAIL -// ========================================================================== - - -// == Logging Macros ======================================================== -#define OMG_DDS_LOG(kind, msg) OMG_DDS_LOG_DETAIL(kind, msg) -// ========================================================================== - - -// == State Width Constants ================================================= -/* By default, there can be up to 32 unique statuses. However, a - * DDS implementation may extend this number if necessary. - */ -#define OMG_DDS_DEFAULT_STATE_BIT_COUNT OMG_DDS_DEFAULT_STATE_BIT_COUNT_DETAIL -#define OMG_DDS_DEFAULT_STATUS_COUNT OMG_DDS_DEFAULT_STATUS_COUNT_DETAIL - -#ifndef OMG_DDS_STATE_BIT_COUNT -#define OMG_DDS_STATE_BIT_COUNT OMG_DDS_DEFAULT_STATE_BIT_COUNT -#endif // !defined(OMG_DDS_STATE_BIT_COUNT) - -#ifndef OMG_DDS_STATUS_COUNT -#define OMG_DDS_STATUS_COUNT OMG_DDS_DEFAULT_STATUS_COUNT -#endif // !defined(OMG_DDS_STATUS_COUNT) -// ========================================================================== - - -// == DLL Export Macros ===================================================== -#define OMG_DDS_API OMG_DDS_API_DETAIL -// ========================================================================== - -#endif //OMG_DDS_CORE_MACROS_HPP_ diff --git a/include/dds/core/policy/CorePolicy.hpp b/include/dds/core/policy/CorePolicy.hpp deleted file mode 100644 index c21dd817aa8..00000000000 --- a/include/dds/core/policy/CorePolicy.hpp +++ /dev/null @@ -1,1705 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_ -#define OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_ - -#include -#include -#include - -#include -#include -#include -#include -#include - -//============================================================================== -// MACROS -// *INDENT-OFF* -#define OMG_DDS_POLICY_TRAITS(POLICY, ID) \ - template<> \ - class policy_id { \ - public: \ - static const dds::core::policy::QosPolicyId value = ID; \ - }; \ - template<> \ - class policy_name { \ - public: \ - static const std::string& name(); \ - }; - -#define OMG_DDS_DEFINE_POLICY_TRAITS(POLICY, NAME) \ - const std::string& dds::core::policy::policy_name::name() { \ - static std::string name = #NAME; \ - return name; \ - } -// *INDENT-OFF* - - -namespace dds { -namespace core { -namespace policy { - -//============================================================================== -/** - * \copydoc DCPS_QoS_UserData - */ -class UserData : public dds::core::Value -{ -public: - - /** - * Creates a UserData QoS instance with an empty UserData - */ - UserData(); - - /** - * Creates a UserData QoS instance - * - * @param sequence the sequence of octets - */ - explicit UserData( - const dds::core::ByteSeq& sequence); - - /** - * Creates a UserData QoS instance - * - * @param value_begin a pointer to the beginning of a sequence - * of octets - * @param value_end a pointer to the end of a sequence - * of octets - */ - UserData( - const uint8_t* value_begin, - const uint8_t* value_end); - - /** - * Copies a UserData QoS instance - * - * @param other the UserData QoS instance to copy - */ - UserData( - const UserData& other); - - /** - * Sets the sequence - * - * @param sequence a sequence of octets - */ - UserData& value( - const dds::core::ByteSeq& sequence); - - /** - * Sets the sequence - * - * @param begin an iterator pointing to the beginning of a sequence - * of octets - * @param end an iterator pointing to the end of a sequence of octets - */ - template - UserData& value( - OCTET_ITER begin, - OCTET_ITER end); - - /** - * Gets the sequence - * - * @return a sequence of octets - */ - const dds::core::ByteSeq value() const; - - /** - * Gets a pointer to the first octet in the sequence - * - * @return a pointer to the first octet in the sequence - */ - const uint8_t* begin() const; - - /** - * Gets a pointer to the last octet in the sequence - * - * @return a pointer to the first octet in the sequence - */ - const uint8_t* end() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_GroupData - */ -class GroupData : public dds::core::Value -{ -public: - - /** - * Creates a GroupData QoS instance - */ - GroupData(); - - /** - * Creates a GroupData QoS instance - * - * @param sequence the sequence of octets representing the GroupData - */ - explicit GroupData( - const dds::core::ByteSeq& sequence); - - /** - * Copies a GroupData QoS instance - * - * @param other the GroupData QoS instance to copy - */ - GroupData( - const GroupData& other); - - /** - * Creates a GroupData QoS instance - * - * @param value_begin a pointer to the beginning of a sequence - * of octets - * @param value_end a pointer to the end of a sequence - * of octets - */ - GroupData( - const uint8_t* value_begin, - const uint8_t* value_end); - - /** - * Set the sequence - * - * @param sequence a sequence of octets - */ - GroupData& value( - const dds::core::ByteSeq& sequence); - - /** - * Set the sequence - * - * @param begin an iterator pointing to the beginning of a sequence - * of octets - * @param end an iterator pointing to the end of a sequence of octets - */ - template - GroupData& value( - OCTET_ITER begin, - OCTET_ITER end); - - /** - * Get the sequence - * - * @return a sequence of octets - */ - const dds::core::ByteSeq value() const; - - /** - * Gets a pointer to the first octet in the sequence - * - * @return a pointer to the first octet in the sequence - */ - const uint8_t* begin() const; - - /** - * Gets a pointer to the last octet in the sequence - * - * @return a pointer to the last octet in the sequence - */ - const uint8_t* end() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_TopicData - */ -class TopicData : public dds::core::Value -{ -public: - - /** - * Creates a TopicData QoS instance - */ - TopicData(); - - /** - * Creates a TopicData QoS instance - * - * @param sequence the sequence of octets representing the TopicData - */ - explicit TopicData( - const dds::core::ByteSeq& sequence); - - /** - * Copies a TopicData QoS instance - * - * @param other the TopicData QoS instance to copy - */ - TopicData( - const TopicData& other); - - /** - * Creates a TopicData QoS instance - * - * @param value_begin a pointer to the beginning of a sequence - * of octets - * @param value_end a pointer to the end of a sequence - * of octets - */ - TopicData( - const uint8_t* value_begin, - const uint8_t* value_end); - - /** - * Set the sequence - * - * @param sequence a sequence of octets - */ - TopicData& value( - const dds::core::ByteSeq& sequence); - - /** - * Set the sequence - * - * @param begin an iterator pointing to the beginning of a sequence - * of octets - * @param end an iterator pointing to the end of a sequence of octets - */ - template - TopicData& value( - OCTET_ITER begin, - OCTET_ITER end); - - /** - * Get the sequence - * - * @return a sequence of octets - */ - const dds::core::ByteSeq value() const; - - /** - * Gets a pointer to the first octet in the sequence - * - * @return a pointer to the first octet in the sequence - */ - const uint8_t* begin() const; - - /** - * Gets a pointer to the last octet in the sequence - * - * @return a pointer to the last octet in the sequence - */ - const uint8_t* end() const; -}; - - -//============================================================================== - -/** - * \copydoc DCPS_QoS_EntityFactory - */ -class EntityFactory : public dds::core::Value -{ -public: - - /** - * Creates an EntityFactory QoS instance - * - * @param autoenable_created_entities boolean indicating whether - * created Entities should be automatically enabled - */ - explicit EntityFactory( - bool autoenable_created_entities = true); - - /** - * Copies an EntityFactory QoS instance - * - * @param other the EntityFactory QoS instance to copy - */ - EntityFactory( - const EntityFactory& other); - - /** - * Sets a boolean indicating whether created Entities should be - * automatically enabled - * - * @param autoenable_created_entities boolean indicating whether - * created Entities should be automatically enabled - */ - EntityFactory& autoenable_created_entities( - bool autoenable_created_entities); - - /** - * Gets a boolean indicating whether Entities should be automatically enabled - * - * @return boolean indicating whether created Entities should be automatically - * enabled - */ - bool autoenable_created_entities() const; - - /** - * @return an EntityFactory QoS instance with autoenable_created_entities - * set to true - */ - static EntityFactory AutoEnable(); - - /** - * @return an EntityFactory QoS instance with autoenable_created_entities - * set to false - */ - static EntityFactory ManuallyEnable(); -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_TransportPriority - */ -class TransportPriority : public dds::core::Value -{ -public: - - /** - * Creates a TransportPriority QoS instance - * - * @param priority the priority value - */ - explicit TransportPriority( - int32_t priority = 0); - - /** - * Copies a TransportPriority QoS instance - * - * @param other the TransportPriority QoS instance to copy - */ - TransportPriority( - const TransportPriority& other); - - /** - * Sets the priority value - * - * @param priority the priority value - */ - TransportPriority& value( - int32_t priority); - - /** - * Gets the priority value - * - * @return the priority value - */ - int32_t value() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Lifespan - */ -class Lifespan : public dds::core::Value -{ -public: - - /** - * Creates a Lifespan QoS instance - * - * @param duration Lifespan expiration duration - */ - explicit Lifespan( - const dds::core::Duration& duration = dds::core::Duration::infinite()); - - /** - * Copies a Lifespan QoS instance - * - * @param other the Lifespan QoS instance to copy - */ - Lifespan( - const Lifespan& other); - - /** - * Sets the expiration duration - * - * @param duration expiration duration - */ - Lifespan& duration( - const dds::core::Duration& duration); - - /** - * Gets the expiration duration - * - * @return expiration duration - */ - const dds::core::Duration duration() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Deadline - */ -class Deadline : public dds::core::Value -{ -public: - - /** - * Creates a Deadline QoS instance - * - * @param period deadline period - */ - explicit Deadline( - const dds::core::Duration& period = dds::core::Duration::infinite()); - - /** - * Copies a Deadline QoS instance - * - * @param other the Deadline QoS instance to copy - */ - Deadline( - const Deadline& other); - - /** - * Sets the deadline period - * - * @param period deadline period - */ - Deadline& period( - const dds::core::Duration& period); - - /** - * Gets the deadline period - * - * @return deadline period - */ - const dds::core::Duration period() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_LatencyBudget - */ -class LatencyBudget : public dds::core::Value -{ -public: - - /** - * Creates a LatencyBudget QoS instance - * - * @param duration duration - */ - explicit LatencyBudget( - const dds::core::Duration& duration = dds::core::Duration::zero()); - - /** - * Copies a LatencyBudget QoS instance - * - * @param other the LatencyBudget QoS instance to copy - */ - LatencyBudget( - const LatencyBudget& other); - - /** - * Sets the duration - * - * @param duration duration - */ - LatencyBudget& duration( - const dds::core::Duration& duration); - - /** - * Gets the duration - * - * @return duration - */ - const dds::core::Duration duration() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_TimeBasedFilter - */ -class TimeBasedFilter : public dds::core::Value -{ -public: - - /** - * Creates a TimeBasedFilter QoS instance - * - * @param period minimum separation period - */ - explicit TimeBasedFilter( - const dds::core::Duration& period = dds::core::Duration::zero()); - - /** - * Copies a TimeBasedFilter QoS instance - * - * @param other the TimeBasedFilter QoS instance to copy - */ - TimeBasedFilter( - const TimeBasedFilter& other); - - /** - * Sets the minimum separation period - * - * @param period minimum separation period - */ - TimeBasedFilter& minimum_separation( - const dds::core::Duration& period); - - /** - * Gets the minimum separation period - * - * @return minimum separation period - */ - const dds::core::Duration minimum_separation() const; -}; - - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Partition - */ -class Partition : public dds::core::Value -{ -public: - - Partition(); - - /** - * Creates a Partition QoS instance - * - * @param in_length partition length - */ - explicit Partition( - uint16_t in_length); - - /** - * Copies a Partition QoS instance - * - * @param other the Partition QoS instance to copy - */ - Partition( - const Partition& other); - - /** - * Sets the partition name - * - * @param name the partition name - */ - Partition& name( - const std::string& name); - - /** - * Sets multiple partition names - * - * @param names a sequence containing multiple partition names - */ - Partition& names( - dds::core::StringSeq& names); - - /** - * Gets the partition names - * - * @return a sequence containing the partition names - */ - const dds::core::StringSeq names() const; - - /** - * Appends a name to the list of partition names. - * @param name Name to append. - */ - void push_back( - const char* name); - - void clear(); -}; - -//============================================================================== -//#ifdef OMG_DDS_OWNERSHIP_SUPPORT - -/** - * \copydoc DCPS_QoS_Ownership - */ -class Ownership : public dds::core::Value -{ -public: - - # if defined (__SUNPRO_CC) && defined(SHARED) - # undef SHARED - # endif // if defined (__SUNPRO_CC) && defined(SHARED) - /** - * Creates an Ownership QoS instance - * - * @param kind the kind - */ - explicit Ownership( - dds::core::policy::OwnershipKind::Type kind = dds::core::policy::OwnershipKind::SHARED); - - /** - * Copies an Ownership QoS instance - * - * @param other the Ownership QoS instance to copy - */ - Ownership( - const Ownership& other); - - /** - * Set the kind - * - * @param kind the kind - */ - Ownership& kind( - dds::core::policy::OwnershipKind::Type kind); - - /** - * Get the kind - * - * @param kind the kind - */ - dds::core::policy::OwnershipKind::Type kind() const; - - /** - * @return an Ownership QoS instance with the kind set to EXCLUSIVE - */ - static Ownership Exclusive(); - - /** - * @return an Ownership QoS instance with the kind set to SHARED - */ - static Ownership Shared(); - -private: - - static eprosima::fastdds::dds::OwnershipQosPolicyKind to_native( - OwnershipKind::Type kind); - - static OwnershipKind::Type from_native( - eprosima::fastdds::dds::OwnershipQosPolicyKind kind); -}; - - -//============================================================================== - -/** - * \copydoc DCPS_QoS_OwnershipStrength - */ -class OwnershipStrength : public dds::core::Value -{ -public: - - /** - * Creates an OwnershipStrength QoS instance - * - * @param strength ownership strength - */ - explicit OwnershipStrength( - int32_t strength = 0); - - /** - * Copies an OwnershipStrength QoS instance - * - * @param other the OwnershipStrength QoS instance to copy - */ - OwnershipStrength( - const OwnershipStrength& other); - - /** - * Gets the ownership strength value - * - * @return the ownership strength value - */ - int32_t value() const; - - /** - * Sets the ownership strength value - * - * @param strength the ownership strength value - */ - OwnershipStrength& value( - int32_t strength); -}; - -//#endif // OMG_DDS_OWNERSHIP_SUPPORT -//============================================================================== - -/** - * \copydoc DCPS_QoS_WriterDataLifecycle - */ -class WriterDataLifecycle : public dds::core::Value -{ -public: - - /** - * Creates a WriterDataLifecycle QoS instance - * - * @param autodispose_unregistered_instances Specifies the behavior of the DataWriter - * with regards to the lifecycle of the data-instances it manages. - */ - explicit WriterDataLifecycle( - bool autodispose_unregistered_instances = true); - - /** - * Copies a WriterDataLifecycle QoS instance - * - * @param other the WriterDataLifecycle QoS instance to copy - */ - WriterDataLifecycle( - const WriterDataLifecycle& other); - - /** - * Gets a boolean indicating if unregistered instances should be autodisposed - * - * @return a boolean indicating if unregistered instances should be autodisposed - */ - bool autodispose_unregistered_instances() const; - - /** - * Sets a boolean indicating if unregistered instances should be autodisposed - * - * @param autodispose_unregistered_instances a boolean indicating if unregistered - * instances should be autodisposed - */ - WriterDataLifecycle& autodispose_unregistered_instances( - bool autodispose_unregistered_instances); - - /** - * @return a WriterDataLifecycle QoS instance with autodispose_unregistered_instances - * set to true - */ - static WriterDataLifecycle AutoDisposeUnregisteredInstances(); - - /** - * @return a WriterDataLifecycle QoS instance with autodispose_unregistered_instances - * set to false - */ - static WriterDataLifecycle ManuallyDisposeUnregisteredInstances(); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_ReaderDataLifecycle - */ -class ReaderDataLifecycle : public dds::core::Value -{ -public: - - /** - * Creates a ReaderDataLifecycle QoS instance - * - * @param autopurge_nowriter_samples_delay the autopurge nowriter samples delay - * @param autopurge_disposed_samples_delay the autopurge disposed samples delay - */ - ReaderDataLifecycle( - const dds::core::Duration& autopurge_nowriter_samples_delay = dds::core::Duration::infinite(), - const dds::core::Duration& autopurge_disposed_samples_delay = dds::core::Duration::infinite()); - - /** - * Copies a ReaderDataLifecycle QoS instance - * - * @param other the ReaderDataLifecycle QoS instance to copy - */ - ReaderDataLifecycle( - const ReaderDataLifecycle& other); - /** - * Gets the autopurge nowriter samples delay - * - * @return the autopurge nowriter samples delay - */ - const dds::core::Duration autopurge_nowriter_samples_delay() const; - - /** - * Sets the autopurge nowriter samples delay - * - * @param autopurge_nowriter_samples_delay the autopurge nowriter samples delay - */ - ReaderDataLifecycle& autopurge_nowriter_samples_delay( - const dds::core::Duration& autopurge_nowriter_samples_delay); - - /** - * Gets the autopurge_disposed_samples_delay - * - * @return the autopurge disposed samples delay - */ - const dds::core::Duration autopurge_disposed_samples_delay() const; - - /** - * Sets the autopurge_disposed_samples_delay - * - * @return the autopurge disposed samples delay - */ - ReaderDataLifecycle& autopurge_disposed_samples_delay( - const dds::core::Duration& autopurge_disposed_samples_delay); - - /** - * @return a ReaderDataLifecycle QoS instance which will not autopurge disposed - * samples - */ - static ReaderDataLifecycle NoAutoPurgeDisposedSamples(); - - /** - * @param autopurge_disposed_samples_delay the autopurge disposed samples delay - * @return a ReaderDataLifecycle QoS instance with autopurge_disposed_samples_delay - * set to a specified value - */ - static ReaderDataLifecycle AutoPurgeDisposedSamples( - const dds::core::Duration& autopurge_disposed_samples_delay); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Durability - */ -class Durability : public dds::core::Value -{ -public: - - /** - * Creates a Durability QoS instance - * - * @param kind the kind - */ - explicit Durability( - dds::core::policy::DurabilityKind::Type kind = dds::core::policy::DurabilityKind::VOLATILE); - - /** - * Copies a Durability QoS instance - * - * @param other the Durability QoS instance to copy - */ - Durability( - const Durability& other); - - /** - * Set the kind - * - * @param kind the kind - */ - Durability& kind( - dds::core::policy::DurabilityKind::Type kind); - - /** - * Get the kind - * - * @param kind the kind - */ - dds::core::policy::DurabilityKind::Type kind() const; - - /** - * @return a Durability QoS instance with the kind set to VOLATILE - */ - static Durability Volatile(); - - /** - * @return a Durability QoS instance with the kind set to TRANSIENT_LOCAL - */ - static Durability TransientLocal(); - - /** - * @return a Durability QoS instance with the kind set to TRANSIENT - */ - static Durability Transient(); - - /** - * @return a Durability QoS instance with the kind set to PERSISTENT - */ - static Durability Persistent(); - -private: - - static eprosima::fastdds::dds::DurabilityQosPolicyKind to_native( - DurabilityKind::Type kind); - - static DurabilityKind::Type from_native( - eprosima::fastdds::dds::DurabilityQosPolicyKind kind); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Presentation - */ -class Presentation : public dds::core::Value -{ -public: - - /** - * Creates a Presentation QoS instance - * - * @param access_scope the access_scope kind - * @param coherent_access the coherent_access setting - * @param ordered_access the ordered_access setting - */ - Presentation( - dds::core::policy::PresentationAccessScopeKind::Type access_scope = - dds::core::policy::PresentationAccessScopeKind::INSTANCE, - bool coherent_access = false, - bool ordered_access = false); - - /** - * Copies a Presentation QoS instance - * - * @param other the Presentation QoS instance to copy - */ - Presentation( - const Presentation& other); - - /** - * Sets the access_scope kind - * - * @param access_scope the access_scope kind - */ - Presentation& access_scope( - dds::core::policy::PresentationAccessScopeKind::Type access_scope); - - /** - * Gets the access_scope kind - * - * @return the access_scope kind - */ - dds::core::policy::PresentationAccessScopeKind::Type access_scope() const; - - /** - * Sets the coherent_access setting - * - * @param coherent_access the coherent_access setting - */ - Presentation& coherent_access( - bool coherent_access); - - /** - * Gets the coherent_access setting - * - * @return the coherent_access setting - */ - bool coherent_access() const; - - /** - * Sets the ordered_access setting - * - * @param ordered_access the ordered_access setting - */ - Presentation& ordered_access( - bool ordered_access); - - /** - * Gets the ordered_access setting - * - * @return the ordered_access setting - */ - bool ordered_access() const; - - /** - * @param coherent_access the coherent_access setting - * @param ordered_access the ordered_access setting - * - * @return a Presentation QoS instance with a GROUP access_score and coherent_access - * and ordered_access set to the specified values - */ - static Presentation GroupAccessScope( - bool coherent_access = false, - bool ordered_access = false); - - /** - * @param coherent_access the coherent_access setting - * @param ordered_access the ordered_access setting - * - * @return a Presentation QoS instance with a INSTANCE access_score and coherent_access - * and ordered_access set to the specified values - */ - static Presentation InstanceAccessScope( - bool coherent_access = false, - bool ordered_access = false); - - /** - * @param coherent_access the coherent_access setting - * @param ordered_access the ordered_access setting - * - * @return a Presentation QoS instance with a TOPIC access_score and coherent_access - * and ordered_access set to the specified values - */ - static Presentation TopicAccessScope( - bool coherent_access = false, - bool ordered_access = false); - -private: - - static eprosima::fastdds::dds::PresentationQosPolicyAccessScopeKind to_native( - PresentationAccessScopeKind::Type kind); - - static PresentationAccessScopeKind::Type from_native( - eprosima::fastdds::dds::PresentationQosPolicyAccessScopeKind kind); -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Reliability - */ -class Reliability : public dds::core::Value -{ -public: - - /** - * Creates a Reliability QoS instance - * - * @param kind the kind - * @param max_blocking_time the max_blocking_time - */ - Reliability( - dds::core::policy::ReliabilityKind::Type kind = dds::core::policy::ReliabilityKind::BEST_EFFORT, - const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100)); - - /** - * Copies a Reliability QoS instance - * - * @param other the Reliability QoS instance to copy - */ - Reliability( - const Reliability& other); - - /** - * Sets the kind - * - * @param kind the kind - */ - Reliability& kind( - dds::core::policy::ReliabilityKind::Type kind); - - /** - * Gets the kind - * - * @return the kind - */ - dds::core::policy::ReliabilityKind::Type kind() const; - - /** - * Sets the max_blocking_time - * - * @param max_blocking_time the max_blocking_time - */ - Reliability& max_blocking_time( - const dds::core::Duration& max_blocking_time); - - /** - * Gets the max_blocking_time - * - * @return the max_blocking_time - */ - const dds::core::Duration max_blocking_time() const; - - /** - * @param the max_blocking_time - * @return a Reliability QoS instance with the kind set to RELIABLE and the max_blocking_time - * set to the supplied value - */ - static OMG_DDS_API Reliability Reliable( - const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100)); - - /** - * @return a Reliability QoS instance with the kind set to BEST_EFFORT - */ - static Reliability BestEffort( - const dds::core::Duration& max_blocking_time = dds::core::Duration::from_millisecs(100)); - -private: - - static ReliabilityKind::Type from_native( - eprosima::fastdds::dds::ReliabilityQosPolicyKind kind); - - static eprosima::fastdds::dds::ReliabilityQosPolicyKind to_native( - ReliabilityKind::Type kind); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_DestinationOrder - */ -class DestinationOrder : public dds::core::Value -{ -public: - - /** - * Creates a DestinationOrder QoS instance - * - * @param kind the kind - */ - explicit DestinationOrder( - dds::core::policy::DestinationOrderKind::Type kind = - dds::core::policy::DestinationOrderKind::BY_RECEPTION_TIMESTAMP); - - /** - * Copies a DestinationOrder QoS instance - * - * @param other the Reliability QoS instance to copy - */ - DestinationOrder( - const DestinationOrder& other); - - /** - * Sets the kind - * - * @param kind the kind - */ - DestinationOrder& kind( - dds::core::policy::DestinationOrderKind::Type kind); - - /** - * Gets the kind - * - * @return the kind - */ - dds::core::policy::DestinationOrderKind::Type kind() const; - - /** - * @return a DestinationOrder QoS instance with the kind set to BY_SOURCE_TIMESTAMP - */ - static DestinationOrder SourceTimestamp(); - - /** - * @return a DestinationOrder QoS instance with the kind set to BY_RECEPTION_TIMESTAMP - */ - static DestinationOrder ReceptionTimestamp(); - -private: - - static eprosima::fastdds::dds::DestinationOrderQosPolicyKind to_native( - DestinationOrderKind::Type kind); - - static DestinationOrderKind::Type from_native( - eprosima::fastdds::dds::DestinationOrderQosPolicyKind kind); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_History - */ -class History : public dds::core::Value -{ -public: - - /** - * Creates a History QoS instance - * - * @param kind the kind - * @param depth the history depth - */ - History( - dds::core::policy::HistoryKind::Type kind = dds::core::policy::HistoryKind::KEEP_LAST, - int32_t depth = 1); - - /** - * Copies a History QoS instance - * - * @param other the History QoS instance to copy - */ - History( - const History& other); - - /** - * Gets the kind - * - * @return the kind - */ - dds::core::policy::HistoryKind::Type kind() const; - - /** - * Sets the kind - * - * @param kind the kind - */ - History& kind( - dds::core::policy::HistoryKind::Type kind); - - /** - * Gets the history depth - * - * @return the history depth - */ - int32_t depth() const; - - /** - * Sets the history depth - * - * @param the history depth - */ - History& depth( - int32_t depth); - - /** - * @return a History QoS instance with the kind set to KEEP_ALL - */ - static History KeepAll(); - - /** - * @param depth the history depth - * @return a History QoS instance with the kind set to KEEP_LAST and the - * depth set to the supplied value - */ - static History KeepLast( - uint32_t depth); - -private: - - friend class DurabilityService; - - static eprosima::fastdds::dds::HistoryQosPolicyKind to_native( - HistoryKind::Type kind); - - static HistoryKind::Type from_native( - eprosima::fastdds::dds::HistoryQosPolicyKind kind); - -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_ResourceLimits - */ -class ResourceLimits : public dds::core::Value -{ -public: - - /** - * Creates a ResourceLimits QoS instance - * - * @param max_samples the max_samples value - * @param max_instances the max_instances value - * @param max_samples_per_instance the max_samples_per_instance value - */ - ResourceLimits( - uint32_t max_samples = dds::core::LENGTH_UNLIMITED, - uint32_t max_instances = dds::core::LENGTH_UNLIMITED, - uint32_t max_samples_per_instance = dds::core::LENGTH_UNLIMITED); - - /** - * Copies a ResourceLimits QoS instance - * - * @param other the ResourceLimits QoS instance to copy - */ - ResourceLimits( - const ResourceLimits& other); - -public: - - /** - * Sets the max_samples value - * - * @param max_samples the max_samples value - */ - ResourceLimits& max_samples( - int32_t max_samples); - - /** - * Gets the max_samples value - * - * @return the max_samples value - */ - int32_t max_samples() const; - - /** - * Sets the max_instances value - * - * @param max_instances the max_instances value - */ - ResourceLimits& max_instances( - int32_t max_instances); - - /** - * Gets the max_instances value - * - * @return the max_instances value - */ - int32_t max_instances() const; - - /** - * Sets the max_samples_per_instance value - * - * @param max_samples_per_instance the max_samples_per_instance value - */ - ResourceLimits& max_samples_per_instance( - int32_t max_samples_per_instance); - - /** - * Gets the max_samples_per_instance value - * - * @return the max_samples_per_instance value - */ - int32_t max_samples_per_instance() const; -}; - -//============================================================================== - -/** - * \copydoc DCPS_QoS_Liveliness - */ -class Liveliness : public dds::core::Value -{ -public: - - /** - * Creates a Liveliness QoS instance - * - * @param kind the kind - * @param lease_duration the lease_duration - */ - Liveliness( - dds::core::policy::LivelinessKind::Type kind = dds::core::policy::LivelinessKind::AUTOMATIC, - const dds::core::Duration& lease_duration = dds::core::Duration::infinite()); - - /** - * Copies a Liveliness QoS instance - * - * @param other the Liveliness QoS instance to copy - */ - Liveliness( - const Liveliness& other); - - /** - * Sets the kind - * - * @param kind the kind - */ - Liveliness& kind( - dds::core::policy::LivelinessKind::Type kind); - - /** - * Gets the kind - * - * @return the kind - */ - dds::core::policy::LivelinessKind::Type kind() const; - - /** - * Sets the lease_duration - * - * @return the lease_duration - */ - Liveliness& lease_duration( - const dds::core::Duration& lease_duration); - - /** - * Gets the lease_duration - * - * @return the lease_duration - */ - const dds::core::Duration lease_duration() const; - - /** - * @return a Liveliness QoS instance with the kind set to AUTOMATIC - */ - static Liveliness Automatic(); - - /** - * @return a Liveliness QoS instance with the kind set to MANUAL_BY_PARTICIPANT - * and the lease_duration set to the supplied value - */ - static Liveliness ManualByParticipant( - const dds::core::Duration& lease_duration = dds::core::Duration::infinite()); - - /** - * @return a Liveliness QoS instance with the kind set to MANUAL_BY_TOPIC - * and the lease_duration set to the supplied value - */ - static Liveliness ManualByTopic( - const dds::core::Duration& lease_duration = dds::core::Duration::infinite()); - -private: - - static eprosima::fastdds::dds::LivelinessQosPolicyKind to_native( - LivelinessKind::Type kind); - - static LivelinessKind::Type from_native( - eprosima::fastdds::dds::LivelinessQosPolicyKind kind); - -}; - - -//============================================================================== -//#ifdef OMG_DDS_PERSISTENCE_SUPPORT - -/** - * \copydoc DCPS_QoS_DurabilityService - */ -class DurabilityService : public dds::core::Value -{ -public: - - /** - * Creates a DurabilityService QoS instance - * - * @param service_cleanup_delay the service_cleanup_delay - * @param history_kind the history_kind value - * @param history_depth the history_depth value - * @param max_samples the max_samples value - * @param max_instances the max_instances value - * @param max_samples_per_instance the max_samples_per_instance value - */ - DurabilityService( - const dds::core::Duration& service_cleanup_delay = dds::core::Duration::zero(), - dds::core::policy::HistoryKind::Type history_kind = dds::core::policy::HistoryKind::KEEP_LAST, - int32_t history_depth = 1, - int32_t max_samples = dds::core::LENGTH_UNLIMITED, - int32_t max_instances = dds::core::LENGTH_UNLIMITED, - int32_t max_samples_per_instance = dds::core::LENGTH_UNLIMITED); - - /** - * Copies a DurabilityService QoS instance - * - * @param other the DurabilityService QoS instance to copy - */ - DurabilityService( - const DurabilityService& other); - - /** - * Sets the service_cleanup_delay value - * - * @param service_cleanup_delay the service_cleanup_delay value - */ - DurabilityService& service_cleanup_delay( - const dds::core::Duration& service_cleanup_delay); - - /** - * Gets the service_cleanup_delay value - * - * @return the service_cleanup_delay - */ - const dds::core::Duration service_cleanup_delay() const; - - /** - * Sets the history_kind - * - * @param the history_kind - */ - DurabilityService& history_kind( - dds::core::policy::HistoryKind::Type history_kind); - - /** - * Gets the history_kind - * - * @return history_kind - */ - dds::core::policy::HistoryKind::Type history_kind() const; - - /** - * Sets the history_depth value - * - * @param history_depth the history_depth value - */ - DurabilityService& history_depth( - int32_t history_depth); - - /** - * Gets the history_depth value - * - * @return history_depth - */ - int32_t history_depth() const; - - /** - * Sets the max_samples value - * - * @param max_samples the max_samples value - */ - DurabilityService& max_samples( - int32_t max_samples); - - /** - * Gets the max_samples value - * - * @return the max_samples value - */ - int32_t max_samples() const; - - /** - * Sets the max_instances value - * - * @param max_instances the max_instances value - */ - DurabilityService& max_instances( - int32_t max_instances); - - /** Gets the max_instances value - * - * @return the max_instances value - */ - int32_t max_instances() const; - - /** - * Sets the max_samples_per_instance value - * - * @param max_samples_per_instance the max_samples_per_instance value - */ - DurabilityService& max_samples_per_instance( - int32_t max_samples_per_instance); - - /** - * Gets the max_samples_per_instance value - * - * @return the max_samples_per_instance value - */ - int32_t max_samples_per_instance() const; -}; - -//#endif //OMG_DDS_PERSISTENCE_SUPPORT - -//============================================================================== - -//#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -typedef uint16_t DataRepresentationId; - -typedef std::vector DataRepresentationIdSeq; - -class DataRepresentation : public dds::core::Value -{ - -public: - - explicit DataRepresentation( - const dds::core::policy::DataRepresentationIdSeq& value); - - DataRepresentation( - const DataRepresentation& other) - : dds::core::Value(other) - { - } - - DataRepresentation& value( - const dds::core::policy::DataRepresentationIdSeq& value); - - const dds::core::policy::DataRepresentationIdSeq value() const; - - dds::core::policy::DataRepresentationIdSeq& value(); - -private: - - static std::vector to_native( - const DataRepresentationIdSeq& seq); - -}; - -//#endif //OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - - -//============================================================================ - -//#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -class TypeConsistencyEnforcement : public dds::core::Value -{ -public: - - explicit TypeConsistencyEnforcement( - dds::core::policy::TypeConsistencyEnforcementKind::Type kind); - - TypeConsistencyEnforcement& kind( - dds::core::policy::TypeConsistencyEnforcementKind::Type kind); - - dds::core::policy::TypeConsistencyEnforcementKind::Type kind() const; - - TypeConsistencyEnforcement& ignore_sequence_bounds( - bool ignore_sequence_bounds); - - TypeConsistencyEnforcement& ignore_string_bounds( - bool ignore_string_bounds); - - TypeConsistencyEnforcement& ignore_member_names( - bool ignore_member_names); - - TypeConsistencyEnforcement& prevent_type_widening( - bool prevent_type_widening); - - TypeConsistencyEnforcement& force_type_validation( - bool force_type_validation); - - bool ignore_sequence_bounds(); - - bool ignore_string_bounds(); - - bool ignore_member_names(); - - bool prevent_type_widening(); - - bool force_type_validation(); - -}; - -//#endif //OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -//============================================================================== -// Policy Trait Classes - -template -class policy_id; - -template -class policy_name; - -#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT -/** @todo - Known issue. */ -#endif // ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -OMG_DDS_POLICY_TRAITS(UserData, eprosima::fastdds::dds::USERDATA_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Durability, eprosima::fastdds::dds::DURABILITY_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Presentation, eprosima::fastdds::dds::PRESENTATION_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Deadline, eprosima::fastdds::dds::DEADLINE_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(LatencyBudget, eprosima::fastdds::dds::LATENCYBUDGET_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Ownership, eprosima::fastdds::dds::OWNERSHIP_QOS_POLICY_ID) - -//#ifdef OMG_DDS_OWNERSHIP_SUPPORT -OMG_DDS_POLICY_TRAITS(OwnershipStrength, eprosima::fastdds::dds::OWNERSHIPSTRENGTH_QOS_POLICY_ID) -//#endif //OMG_DDS_OWNERSHIP_SUPPORT - -OMG_DDS_POLICY_TRAITS(Liveliness, eprosima::fastdds::dds::LIVELINESS_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(TimeBasedFilter, eprosima::fastdds::dds::TIMEBASEDFILTER_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Partition, eprosima::fastdds::dds::PARTITION_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Reliability, eprosima::fastdds::dds::RELIABILITY_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(DestinationOrder, eprosima::fastdds::dds::DESTINATIONORDER_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(History, eprosima::fastdds::dds::HISTORY_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(ResourceLimits, eprosima::fastdds::dds::RESOURCELIMITS_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(EntityFactory, eprosima::fastdds::dds::ENTITYFACTORY_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(WriterDataLifecycle, eprosima::fastdds::dds::WRITERDATALIFECYCLE_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(ReaderDataLifecycle, eprosima::fastdds::dds::READERDATALIFECYCLE_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(TopicData, eprosima::fastdds::dds::TOPICDATA_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(GroupData, eprosima::fastdds::dds::GROUPDATA_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(TransportPriority, eprosima::fastdds::dds::TRANSPORTPRIORITY_QOS_POLICY_ID) -OMG_DDS_POLICY_TRAITS(Lifespan, eprosima::fastdds::dds::LIFESPAN_QOS_POLICY_ID) - -//#ifdef OMG_DDS_PERSISTENCE_SUPPORT -OMG_DDS_POLICY_TRAITS(DurabilityService, eprosima::fastdds::dds::DURABILITYSERVICE_QOS_POLICY_ID) -//#endif //OMG_DDS_PERSISTENCE_SUPPORT - -} //namespace policy -} //namespace core -} //namespace dds - - -#endif //OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_ diff --git a/include/dds/core/policy/PolicyKind.hpp b/include/dds/core/policy/PolicyKind.hpp deleted file mode 100644 index d09d312adc9..00000000000 --- a/include/dds/core/policy/PolicyKind.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_POLICY_POLICYKIND_HPP_ -#define OMG_DDS_CORE_POLICY_POLICYKIND_HPP_ - -#include -#include - -#include - -namespace dds { -namespace core { -namespace policy { - -#if defined (__SUNPRO_CC) && defined(SHARED) -#undef SHARED -#endif -struct OwnershipKind_def -{ - enum Type - { - SHARED /**< The same instance can be written by - * multiple DataWriter objects. All updates will be made available to the - * DataReader objects. In other words it does not have a specific owner. - */ - #ifdef OMG_DDS_OWNERSHIP_SUPPORT - , - EXCLUSIVE /**< The instance will only be accepted from one - * DataWriter which is the only one whose modifications will be visible to the - * DataReader objects. - */ - #endif //OMG_DDS_OWNERSHIP_SUPPORT - }; -}; - -typedef dds::core::SafeEnum OwnershipKind; - -struct DurabilityKind_def -{ - enum Type - { - VOLATILE, /**< The samples are not available to late-joining - * DataReaders. In other words, only DataReaders, which were present at the - * time of the writing and have subscribed to this Topic, will receive the sample. - * When a DataReader subscribes afterwards (late-joining), it will only be able to - * read the next written sample. This setting is typically used for data, which is - * updated quickly. - */ - TRANSIENT_LOCAL /**< Currently behaves identically to the - * TRANSIENT_DURABILITY_QOS, except for its RxO properties. The desired - * behaviour of TRANSIENT_LOCAL_DURABILITY_QOS can be achieved from the - * TRANSIENT_DURABILITY_QOS with the default (TRUE) setting of the - * autodispose_unregistered_instances flag on the DataWriter and the - * service_cleanup_delay set to 0 on the durability service. This is because for - * TRANSIENT_LOCAL, the data should only remain available for late-joining - * readers during the lifetime of its source writer, so it is not required to survive after - * its source writer has been deleted. Since the deletion of a writer implicitly - * unregisters all its instances, an autodispose_unregistered_instances - * value of TRUE will also dispose the affected data from the durability store, and - * thus prevent it from remaining available to late joining readers. - */ - #ifdef OMG_DDS_PERSISTENCE_SUPPORT - , - TRANSIENT, /**< Some samples are available to late-joining - * DataReaders (stored in memory). This means that the late-joining - * DataReaders are able to read these previously written samples. The - * DataReader does not necessarily have to exist at the time of writing. Not all - * samples are stored (depending on QosPolicy History and QosPolicy - * resource_limits). The storage does not depend on the DataWriter and will - * outlive the DataWriter. This may be used to implement reallocation of - * applications because the data is saved in the Data Distribution Service (not in the - * DataWriter). This setting is typically used for state related information of an - * application. In this case also the DurabilityServiceQosPolicy settings are - * relevant for the behaviour of the Data Distribution Service. - */ - PERSISTENT /**< The data is stored in permanent storage (e.g. - * hard disk). This means that the samples are also available after a system restart. - * The samples not only outlives the DataWriters, but even the Data Distribution - * Service and the system. This setting is typically used for attributes and settings for - * an application or the system. In this case also the - * DurabilityServiceQosPolicy settings are relevant for the behaviour of the - * Data Distribution Service. - */ - #endif //OMG_DDS_PERSISTENCE_SUPPORT - }; -}; -typedef dds::core::SafeEnum DurabilityKind; - -struct PresentationAccessScopeKind_def -{ - enum Type - { - INSTANCE, /**< Presentation Access Scope is per instance. */ - TOPIC /**< Presentation Access Scope is per topic. */ - - #ifdef OMG_DDS_OBJECT_MODEL_SUPPORT - , - GROUP /**< Presentation Access Scope is per group. */ - #endif // OMG_DDS_OBJECT_MODEL_SUPPORT - }; -}; -typedef dds::core::SafeEnum PresentationAccessScopeKind; - - -struct ReliabilityKind_def -{ - enum Type - { - BEST_EFFORT, /**< The Data Distribution Service will only - * attempt to deliver the data; no arrival-checks are being performed and any lost - * data is not re-transmitted (non-reliable). Presumably new values for the samples - * are generated often enough by the application so that it is not necessary to resent - * or acknowledge any samples. - */ - RELIABLE /**< The Data Distribution Service will attempt to - * deliver all samples in the DataWriters history; arrival-checks are performed - * and data may get re-transmitted in case of lost data. In the steady-state (no - * modifications communicated via the DataWriter) the Data Distribution Service - * guarantees that all samples in the DataWriter history will eventually be - * delivered to the all DataReader objects. Outside the steady-state the - * HistoryQosPolicy and ResourceLimitsQosPolicy determine how - * samples become part of the history and whether samples can be discarded from it. - * In this case also the max_blocking_time must be set. - */ - }; -}; -typedef dds::core::SafeEnum ReliabilityKind; - - -struct DestinationOrderKind_def -{ - enum Type - { - BY_RECEPTION_TIMESTAMP, /**< The order is based on the timestamp, at the moment the sample was - * received by the DataReader. - */ - BY_SOURCE_TIMESTAMP /**< The order is based on the timestamp, which was set by the - * DataWriter. This means that the system needs some time synchronization. - */ - }; -}; - -typedef dds::core::SafeEnum DestinationOrderKind; - -struct HistoryKind_def -{ - enum Type - { - KEEP_LAST, /**< The Data Distribution Service will only attempt to - * keep the latest values of the instance and discard the older ones. The attribute - * β€œdepth” determines how many samples in history will be stored. In other words, - * only the most recent samples in history are stored. On the publishing side, the - * Data Distribution Service will only keep the most recent β€œdepth” samples of each - * instance of data (identified by its key) managed by the DataWriter. On the - * subscribing side, the DataReader will only keep the most recent β€œdepth” - * samples received for each instance (identified by its key) until the application - * β€œtakes” them via the DataReader::take operation. - * KEEP_LAST_HISTORY_QOS - is the default kind. The default value of depth is - * 1, indicating that only the most recent value should be delivered. If a depth other - * than 1 is specified, it should be compatible with the settings of the - * ResourcelimitsQosPolicy max_samples_per_instance. For these two - * QosPolicy settings to be compatible, they must verify that depth <= - * max_samples_per_instance, otherwise a - * RETCODE_INCONSISTENT_POLICY is generated on relevant operations. - */ - KEEP_ALL /**< All samples are stored, provided, the resources are - * available. On the publishing side, the Data Distribution Service will attempt to - * keep all samples (representing each value written) of each instance of data - * (identified by its key) managed by the DataWriter until they can be delivered to - * all subscribers. On the subscribing side, the Data Distribution Service will - * attempt to keep all samples of each instance of data (identified by its key) - * managed by the DataReader. These samples are kept until the application - * β€œtakes” them from the Data Distribution Service via the DataReader::take - * operation. The setting of depth has no effect. Its implied value is - * LENGTH_UNLIMITED. The resources that the Data Distribution Service can use to - * keep this history are limited by the settings of the ResourceLimitsQosPolicy. - * If the limit is reached, the behaviour of the Data Distribution Service will depend - * on the ReliabilityQosPolicy. If the ReliabilityQosPolicy is - * BEST_EFFORT_RELIABILITY_QOS, the old values are discarded. If - * ReliabilityQosPolicy is RELIABLE_RELIABILITY_QOS, the Data - * Distribution Service will block the DataWriter until it can deliver the necessary - * old values to all subscribers. - */ - }; -}; - -typedef dds::core::SafeEnum HistoryKind; - -struct LivelinessKind_def -{ - enum Type - { - AUTOMATIC, /**< The Data Distribution Service will take care of - * reporting the Liveliness automatically with a rate determined by the - * lease_duration. - */ - MANUAL_BY_PARTICIPANT, /**< The application must take care - * of reporting the liveliness before the lease_duration expires. If an Entity - * reports its liveliness, all Entities within the same DomainParticipant that - * have their liveliness kind set to MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, - * can be considered alive by the Data Distribution Service. Liveliness can reported - * explicitly by calling the operation assert_liveliness on the - * DomainParticipant or implicitly by writing some data. - */ - MANUAL_BY_TOPIC /**< The application must take care of - * reporting the liveliness before the lease_duration expires. This can explicitly - * be done by calling the operation assert_liveliness on the DataWriter or - * implicitly by writing some data. - */ - }; -}; -typedef dds::core::SafeEnum LivelinessKind; - -/* This isn't standard! -struct TypeConsistencyEnforcementKind_def -{ - enum Type - { - EXACT_TYPE_TYPE_CONSISTENCY, - EXACT_NAME_TYPE_CONSISTENCY, - DECLARED_TYPE_CONSISTENCY, - ASSIGNABLE_TYPE_CONSISTENCY - }; -}; -*/ -struct TypeConsistencyEnforcementKind_def -{ - using Type = eprosima::fastdds::dds::TypeConsistencyKind; -}; - -typedef dds::core::SafeEnum TypeConsistencyEnforcementKind; - -} //namespace policy -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_POLICY_POLICYKIND_HPP_ diff --git a/include/dds/core/policy/QosPolicyCount.hpp b/include/dds/core/policy/QosPolicyCount.hpp deleted file mode 100644 index 5ab1e2256c3..00000000000 --- a/include/dds/core/policy/QosPolicyCount.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_POLICY_QOS_POLICY_COUNT_HPP_ -#define OMG_DDS_CORE_POLICY_QOS_POLICY_COUNT_HPP_ - -#include -#include - -namespace dds { -namespace core { -namespace policy { - -using QosPolicyId = detail::QosPolicyId; -using QosPolicyCountSeq = detail::QosPolicyCountSeq; - -/** - * The QosPolicyCount object shows, for a QosPolicy, the total number of - * times that the concerned DataWriter discovered a DataReader for the - * same Topic and a requested DataReaderQos that is incompatible with - * the one offered by the DataWriter. - */ -class QosPolicyCount : public dds::core::Value -{ -public: - - /** - * Creates a QosPolicyCount instance - * - * @param policy_id the policy_id - * @param count the count - */ - QosPolicyCount( - QosPolicyId policy_id, - int32_t count) - : dds::core::Value(policy_id, count) - { - } - - /** - * Copies a QosPolicyCount instance - * - * @param other the QosPolicyCount instance to copy - */ - QosPolicyCount( - const QosPolicyCount& other) - : dds::core::Value(other.policy_id(), other.count()) - { - } - - /** - * Gets the policy_id - * - * @return the policy_id - */ - QosPolicyId policy_id() const - { - return this->delegate().policy_id; - } - - /** - * Gets the count - * - * @return the count - */ - int32_t count() const - { - return this->delegate().count; - } - -}; - -} //namespace policy -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_POLICY_QOS_POLICY_COUNT_HPP_ diff --git a/include/dds/core/policy/detail/CorePolicy.hpp b/include/dds/core/policy/detail/CorePolicy.hpp deleted file mode 100644 index 69ced6d4c3d..00000000000 --- a/include/dds/core/policy/detail/CorePolicy.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_POLICY_DETAIL_CORE_POLICY_HPP_ -#define EPROSIMA_DDS_CORE_POLICY_DETAIL_CORE_POLICY_HPP_ - -#include -#include -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace policy { -namespace detail { - -// #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT -using DataRepresentation = eprosima::fastdds::dds::DataRepresentationQosPolicy; -// #endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -using Deadline = eprosima::fastdds::dds::DeadlineQosPolicy; - -using DestinationOrder = eprosima::fastdds::dds::DestinationOrderQosPolicy; - -using Durability = eprosima::fastdds::dds::DurabilityQosPolicy; - -// #ifdef OMG_DDS_PERSISTENCE_SUPPORT -using DurabilityService = eprosima::fastdds::dds::DurabilityServiceQosPolicy; -// #endif // OMG_DDS_PERSISTENCE_SUPPORT - -using EntityFactory = eprosima::fastdds::dds::EntityFactoryQosPolicy; - -using GroupData = eprosima::fastdds::dds::GroupDataQosPolicy; - -using History = eprosima::fastdds::dds::HistoryQosPolicy; - -using LatencyBudget = eprosima::fastdds::dds::LatencyBudgetQosPolicy; - -using Lifespan = eprosima::fastdds::dds::LifespanQosPolicy; - -using Liveliness = eprosima::fastdds::dds::LivelinessQosPolicy; - -using Ownership = eprosima::fastdds::dds::OwnershipQosPolicy; - -// #ifdef OMG_DDS_OWNERSHIP_SUPPORT -using OwnershipStrength = eprosima::fastdds::dds::OwnershipStrengthQosPolicy; -// #endif //OMG_DDS_OWNERSHIP_SUPPORT - -using Partition = eprosima::fastdds::dds::PartitionQosPolicy; - -using Presentation = eprosima::fastdds::dds::PresentationQosPolicy; - -using ReaderDataLifecycle = eprosima::fastdds::dds::ReaderDataLifecycleQosPolicy; - -using Reliability = eprosima::fastdds::dds::ReliabilityQosPolicy; - -using ResourceLimits = eprosima::fastdds::dds::ResourceLimitsQosPolicy; - -using TimeBasedFilter = eprosima::fastdds::dds::TimeBasedFilterQosPolicy; - -using TopicData = eprosima::fastdds::dds::TopicDataQosPolicy; - -using TransportPriority = eprosima::fastdds::dds::TransportPriorityQosPolicy; - -// #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT -using TypeConsistencyEnforcement = eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy; -// #endif //OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -using UserData = eprosima::fastdds::dds::UserDataQosPolicy; - -using WriterDataLifecycle = eprosima::fastdds::dds::WriterDataLifecycleQosPolicy; - -} //namespace detail -} //namespace policy -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_POLICY_DETAIL_CORE_POLICY_HPP_ diff --git a/include/dds/core/policy/detail/CorePolicyImpl.hpp b/include/dds/core/policy/detail/CorePolicyImpl.hpp deleted file mode 100644 index 66b95039c63..00000000000 --- a/include/dds/core/policy/detail/CorePolicyImpl.hpp +++ /dev/null @@ -1,1424 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_POLICY_TCOREPOLICY_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_POLICY_TCOREPOLICY_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { -namespace policy { - -//TUserData - -template -TUserData::TUserData() - : dds::core::Value() -{ -} - -template -TUserData::TUserData( - const dds::core::ByteSeq& sequence) - : dds::core::Value(sequence) -{ -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -TUserData::TUserData( - const uint8_t* value_begin, - const uint8_t* value_end) -{ - //To implement -} - -template -TUserData::TUserData( - const TUserData& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TUserData& TUserData::value( - const dds::core::ByteSeq& sequence) -{ - //To implement - // this->delegate().value(sequence); - // return *this; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -template -TUserData& TUserData::value( - OCTET_ITER begin, - OCTET_ITER end) -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return *this; -} - -template -const dds::core::ByteSeq TUserData::value() const -{ - //To implement - // return this->delegate().value(); -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TUserData::begin() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TUserData::end() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -//TGroupData - -template -TGroupData::TGroupData() - : dds::core::Value() -{ -} - -template -TGroupData::TGroupData( - const dds::core::ByteSeq& sequence) - : dds::core::Value(sequence) -{ -} - -template -TGroupData::TGroupData( - const TGroupData& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TGroupData::TGroupData( - const uint8_t* value_begin, - const uint8_t* value_end) -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif -} - -template -TGroupData& TGroupData::value( - const dds::core::ByteSeq& sequence) -{ - //To implement - // this->delegate().value(sequence); - // return *this; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -template -TGroupData& TGroupData::value( - OCTET_ITER begin, - OCTET_ITER end) -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return *this; -} - -template -const dds::core::ByteSeq TGroupData::value() const -{ - //To implement - // return this->delegate().value(); -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TGroupData::begin() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TGroupData::end() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -//TTopicData - -template -TTopicData::TTopicData() - : dds::core::Value() -{ -} - -template -TTopicData::TTopicData( - const dds::core::ByteSeq& sequence) - : dds::core::Value(sequence) -{ -} - -template -TTopicData::TTopicData( - const TTopicData& other) - : dds::core::Value(other.delegate()) -{ -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -TTopicData::TTopicData( - const uint8_t* value_begin, - const uint8_t* value_end) -{ - //To implement - -} - -template -TTopicData& TTopicData::value( - const dds::core::ByteSeq& sequence) -{ - //To implement - // this->delegate().value(sequence); - // return *this; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -template -TTopicData& TTopicData::value( - OCTET_ITER begin, - OCTET_ITER end) -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return *this; -} - -template -const dds::core::ByteSeq TTopicData::value() const -{ - //To implement - // return this->delegate().value(); -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TTopicData::begin() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -const uint8_t* TTopicData::end() const -{ - //To implement - //#ifdef _WIN32 - //#pragma warning( push ) - //#pragma warning( disable : 4702 ) //disable warning caused by temporary exception, remove later - //#endif - // ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "Function not currently supported"); - //#ifdef _WIN32 - //#pragma warning ( pop ) //re-enable warning to prevent leaking to user code, remove later - //#endif - // return NULL; -} - -//TEntityFactory - -template -TEntityFactory::TEntityFactory( - bool autoenable_created_entities) - : dds::core::Value(autoenable_created_entities) -{ -} - -template -TEntityFactory::TEntityFactory( - const TEntityFactory& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TEntityFactory& TEntityFactory::autoenable_created_entities( - bool autoenable_created_entities) -{ - //To implement - // this->delegate().auto_enable(autoenable_created_entities); - // return *this; -} - -template -bool TEntityFactory::autoenable_created_entities() const -{ - //To implement - // return this->delegate().auto_enable(); -} - -template -TEntityFactory TEntityFactory::AutoEnable() -{ - //To implement - // return TEntityFactory(true); -} - -template -TEntityFactory TEntityFactory::ManuallyEnable() -{ - //To implement - // return TEntityFactory(false); -} - -//TTransportPriority - -template -TTransportPriority::TTransportPriority( - int32_t priority) - : dds::core::Value(priority) -{ -} - -template -TTransportPriority::TTransportPriority( - const TTransportPriority& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TTransportPriority& TTransportPriority::value( - int32_t priority) -{ - //To implement - // this->delegate().value(priority); - // return *this; -} - -template -int32_t TTransportPriority::value() const -{ - //To implement - // return this->delegate().value(); -} - -//TLifeSpan - -template -TLifespan::TLifespan( - const dds::core::Duration& duration) - : dds::core::Value(duration) -{ -} - -template -TLifespan::TLifespan( - const TLifespan& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TLifespan& TLifespan::duration( - const dds::core::Duration& duration) -{ - //To implement - // this->delegate().duration(duration); - // return *this; -} - -template -const dds::core::Duration TLifespan::duration() const -{ - //To implement - // return this->delegate().duration(); -} - -//TDeadline - -template -TDeadline::TDeadline( - const dds::core::Duration& period) - : dds::core::Value(period) -{ -} - -template -TDeadline::TDeadline( - const TDeadline& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TDeadline& TDeadline::period( - const dds::core::Duration& period) -{ - //To implement - // this->delegate().period(period); - // return *this; -} - -template -const dds::core::Duration TDeadline::period() const -{ - //To implement - // return this->delegate().period(); -} - -//TLatencyBudget - -template -TLatencyBudget::TLatencyBudget( - const dds::core::Duration& duration) - : dds::core::Value(duration) -{ -} - -template -TLatencyBudget::TLatencyBudget( - const TLatencyBudget& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TLatencyBudget& TLatencyBudget::duration( - const dds::core::Duration& duration) -{ - //To implement - // this->delegate().duration(duration); - // return *this; -} - -template -const dds::core::Duration TLatencyBudget::duration() const -{ - //To implement - // return this->delegate().duration(); -} - -//TTimeBasedFilter -template -TTimeBasedFilter::TTimeBasedFilter( - const dds::core::Duration& minimum_separation) - : dds::core::Value(minimum_separation) -{ -} - -template -TTimeBasedFilter::TTimeBasedFilter( - const TTimeBasedFilter& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TTimeBasedFilter& TTimeBasedFilter::minimum_separation( - const dds::core::Duration& minimum_separation) -{ - //To implement - // this->delegate().min_separation(minimum_separation); - // return *this; - -} - -template -const dds::core::Duration TTimeBasedFilter::minimum_separation() const -{ - //To implement - // return this->delegate().min_separation(); -} - -//TPartition - -template -TPartition::TPartition( - const std::string& name) - : dds::core::Value(name) -{ -} - -template -TPartition::TPartition( - const dds::core::StringSeq& names) - : dds::core::Value(names) -{ -} - -template -TPartition::TPartition( - const TPartition& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TPartition& TPartition::name( - const std::string& name) -{ - //To implement - // this->delegate().name(name); - // return *this; -} - -template -TPartition& TPartition::name( - const dds::core::StringSeq& names) -{ - //To implement - // this->delegate().name(names); - // return *this; -} - -template -const dds::core::StringSeq TPartition::name() const -{ - //To implement - // return this->delegate().name(); -} - -#ifdef OMG_DDS_OWNERSHIP_SUPPORT - -//TOwnership - -template -TOwnership::TOwnership( - dds::core::policy::OwnershipKind::Type kind) - : dds::core::Value(kind) -{ -} - -template -TOwnership::TOwnership( - const TOwnership& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TOwnership& TOwnership::kind( - dds::core::policy::OwnershipKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -dds::core::policy::OwnershipKind::Type TOwnership::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -TOwnership TOwnership::Exclusive() -{ - //To implement - // return TOwnership(dds::core::policy::OwnershipKind::EXCLUSIVE); -} - -template -TOwnership TOwnership::Shared() -{ - //To implement - // return TOwnership(dds::core::policy::OwnershipKind::SHARED); -} - -//TOwnershipStrength -template -TOwnershipStrength::TOwnershipStrength( - int32_t strength) - : dds::core::Value(strength) -{ -} - -template -TOwnershipStrength::TOwnershipStrength( - const TOwnershipStrength& other) - : dds::core::Value(other.delegate()) -{ -} - -template -int32_t TOwnershipStrength::value() const -{ - //To implement - // return this->delegate().strength(); -} - -template -TOwnershipStrength& TOwnershipStrength::value( - int32_t strength) -{ - //To implement - // this->delegate().strength(strength); - // return *this; -} - -#endif //OMG_DDS_OWNERSHIP_SUPPORT - -//TWriterDataLifeCycle -template -TWriterDataLifecycle::TWriterDataLifecycle( - bool autodispose_unregistered_instances) - : dds::core::Value(autodispose_unregistered_instances) -{ -} - -template -TWriterDataLifecycle::TWriterDataLifecycle( - const TWriterDataLifecycle& other) - : dds::core::Value(other.delegate()) -{ -} - -template -bool TWriterDataLifecycle::autodispose_unregistered_instances() const -{ - //To implement - // return this->delegate().autodispose(); -} - -template -TWriterDataLifecycle& TWriterDataLifecycle::autodispose_unregistered_instances( - bool autodispose_unregistered_instances) -{ - //To implement - // this->delegate().autodispose(autodispose_unregistered_instances); - // return *this; -} - -template -TWriterDataLifecycle TWriterDataLifecycle::AutoDisposeUnregisteredInstances() -{ - //To implement - // return TWriterDataLifecycle(true); -} - -template -TWriterDataLifecycle TWriterDataLifecycle::ManuallyDisposeUnregisteredInstances() -{ - //To implement - // return TWriterDataLifecycle(false); -} - -//TReaderDataLifecycle -template -TReaderDataLifecycle::TReaderDataLifecycle( - const dds::core::Duration& autopurge_nowriter_samples_delay, - const dds::core::Duration& autopurge_disposed_samples_delay) - : dds::core::Value(autopurge_nowriter_samples_delay, autopurge_disposed_samples_delay) -{ -} - -template -TReaderDataLifecycle::TReaderDataLifecycle( - const TReaderDataLifecycle& other) - : dds::core::Value(other.delegate()) -{ -} - -template -const dds::core::Duration TReaderDataLifecycle::autopurge_nowriter_samples_delay() const -{ - //To implement - // return this->delegate().autopurge_nowriter_samples_delay(); -} - -template -TReaderDataLifecycle& TReaderDataLifecycle::autopurge_nowriter_samples_delay( - const dds::core::Duration& autopurge_nowriter_samples_delay) -{ - //To implement - // this->delegate().autopurge_nowriter_samples_delay(autopurge_nowriter_samples_delay); - // return *this; -} - -template -const dds::core::Duration TReaderDataLifecycle::autopurge_disposed_samples_delay() const -{ - //To implement - // return this->delegate().autopurge_disposed_samples_delay(); -} - -template -TReaderDataLifecycle& TReaderDataLifecycle::autopurge_disposed_samples_delay( - const dds::core::Duration& autopurge_disposed_samples_delay) -{ - //To implement - // this->delegate().autopurge_disposed_samples_delay(autopurge_disposed_samples_delay); - // return *this; -} - -template -TReaderDataLifecycle TReaderDataLifecycle::NoAutoPurgeDisposedSamples() -{ - //To implement - // return TReaderDataLifecycle(); -} - -template -TReaderDataLifecycle TReaderDataLifecycle::AutoPurgeDisposedSamples( - const dds::core::Duration& autopurge_disposed_samples_delay) -{ - //To implement - // return TReaderDataLifecycle().autopurge_disposed_samples_delay(autopurge_disposed_samples_delay); -} - -//TDurability - -template -TDurability::TDurability( - dds::core::policy::DurabilityKind::Type kind) - : dds::core::Value(kind) -{ -} - -template -TDurability::TDurability( - const TDurability& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TDurability& TDurability::kind( - dds::core::policy::DurabilityKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -dds::core::policy::DurabilityKind::Type TDurability::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -TDurability TDurability::Volatile() -{ - //To implement - // return TDurability(dds::core::policy::DurabilityKind::VOLATILE); -} - -template -TDurability TDurability::TransientLocal() -{ - //To implement - // return TDurability(dds::core::policy::DurabilityKind::TRANSIENT_LOCAL); -} - -template -TDurability TDurability::Transient() -{ - //To implement - // return TDurability(dds::core::policy::DurabilityKind::TRANSIENT); -} - -template -TDurability TDurability::Persistent() -{ - //To implement - // return TDurability(dds::core::policy::DurabilityKind::PERSISTENT); -} - -//TPresentation -template -TPresentation::TPresentation( - dds::core::policy::PresentationAccessScopeKind::Type access_scope, - bool coherent_access, - bool ordered_access) - : dds::core::Value(access_scope, coherent_access, ordered_access) -{ -} - -template -TPresentation::TPresentation( - const TPresentation& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TPresentation& TPresentation::access_scope( - dds::core::policy::PresentationAccessScopeKind::Type access_scope) -{ - //To implement - // this->delegate().access_scope(access_scope); - // return *this; -} - -template -dds::core::policy::PresentationAccessScopeKind::Type TPresentation::access_scope() const -{ - //To implement - // return this->delegate().access_scope(); -} - -template -TPresentation& TPresentation::coherent_access( - bool coherent_access) -{ - //To implement - // this->delegate().coherent_access(coherent_access); - // return *this; -} - -template -bool TPresentation::coherent_access() const -{ - //To implement - // return this->delegate().coherent_access(); -} - -template -TPresentation& TPresentation::ordered_access( - bool ordered_access) -{ - //To implement - // this->delegate().ordered_access(ordered_access); - // return *this; -} - -template -bool TPresentation::ordered_access() const -{ - //To implement - // return this->delegate().ordered_access(); -} - -template -TPresentation TPresentation::GroupAccessScope( - bool coherent_access, - bool ordered_access) -{ - //To implement - // return TPresentation(dds::core::policy::PresentationAccessScopeKind::GROUP, coherent_access, ordered_access); -} - -template -TPresentation TPresentation::InstanceAccessScope( - bool coherent_access, - bool ordered_access) -{ - //To implement - // return TPresentation(dds::core::policy::PresentationAccessScopeKind::INSTANCE, coherent_access, ordered_access); -} - -template -TPresentation TPresentation::TopicAccessScope( - bool coherent_access, - bool ordered_access) -{ - //To implement - // return TPresentation(dds::core::policy::PresentationAccessScopeKind::TOPIC, coherent_access, ordered_access); -} - -//TReliability -template -TReliability::TReliability( - dds::core::policy::ReliabilityKind::Type kind, - const dds::core::Duration& max_blocking_time) - : dds::core::Value(kind, max_blocking_time) -{ -} - -template -TReliability::TReliability( - const TReliability& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TReliability& TReliability::kind( - dds::core::policy::ReliabilityKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -dds::core::policy::ReliabilityKind::Type TReliability::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -TReliability& TReliability::max_blocking_time( - const dds::core::Duration& max_blocking_time) -{ - //To implement - // this->delegate().max_blocking_time(max_blocking_time); - // return *this; -} - -template -const dds::core::Duration TReliability::max_blocking_time() const -{ - //To implement - // return this->delegate().max_blocking_time(); -} - -template -TReliability TReliability::Reliable( - const dds::core::Duration& max_blocking_time) -{ - //To implement - // return TReliability(dds::core::policy::ReliabilityKind::RELIABLE, max_blocking_time); -} - -template -TReliability TReliability::BestEffort( - const dds::core::Duration& max_blocking_time) -{ - //To implement - // return TReliability(dds::core::policy::ReliabilityKind::BEST_EFFORT, max_blocking_time); -} - -//TDestinationOrder - -template -TDestinationOrder::TDestinationOrder( - dds::core::policy::DestinationOrderKind::Type kind) - : dds::core::Value(kind) -{ -} - -template -TDestinationOrder::TDestinationOrder( - const TDestinationOrder& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TDestinationOrder& TDestinationOrder::kind( - dds::core::policy::DestinationOrderKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -dds::core::policy::DestinationOrderKind::Type TDestinationOrder::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -TDestinationOrder TDestinationOrder::SourceTimestamp() -{ - //To implement - // return TDestinationOrder(dds::core::policy::DestinationOrderKind::BY_SOURCE_TIMESTAMP); -} - -template -TDestinationOrder TDestinationOrder::ReceptionTimestamp() -{ - //To implement - // return TDestinationOrder(dds::core::policy::DestinationOrderKind::BY_RECEPTION_TIMESTAMP); -} - -//THistory -template -THistory::THistory( - dds::core::policy::HistoryKind::Type kind, - int32_t depth) - : dds::core::Value(kind, depth) -{ -} - -template -THistory::THistory( - const THistory& other) - : dds::core::Value(other.delegate()) -{ -} - -template -dds::core::policy::HistoryKind::Type THistory::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -THistory& THistory::kind( - dds::core::policy::HistoryKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -int32_t THistory::depth() const -{ - //To implement - // return this->delegate().depth(); -} - -template -THistory& THistory::depth( - int32_t depth) -{ - //To implement - // this->delegate().depth(depth); - // return *this; -} - -template -THistory THistory::KeepAll() -{ - //To implement - // return THistory(dds::core::policy::HistoryKind::KEEP_ALL, 1); -} - -template -THistory THistory::KeepLast( - uint32_t depth) -{ - //To implement - // return THistory(dds::core::policy::HistoryKind::KEEP_LAST, depth); -} - -//TResourceLimits -template -TResourceLimits::TResourceLimits( - int32_t max_samples, - int32_t max_instances, - int32_t max_samples_per_instance) - : dds::core::Value(max_samples, max_instances, max_samples_per_instance) -{ -} - -template -TResourceLimits::TResourceLimits( - const TResourceLimits& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TResourceLimits& TResourceLimits::max_samples( - int32_t max_samples) -{ - //To implement - // this->delegate().max_samples(max_samples); - // return *this; -} - -template -int32_t TResourceLimits::max_samples() const -{ - //To implement - // return this->delegate().max_samples(); -} - -template -TResourceLimits& TResourceLimits::max_instances( - int32_t max_instances) -{ - //To implement - // this->delegate().max_instances(max_instances); - // return *this; -} - -template -int32_t TResourceLimits::max_instances() const -{ - //To implement - // return this->delegate().max_instances(); -} - -template -TResourceLimits& TResourceLimits::max_samples_per_instance( - int32_t max_samples_per_instance) -{ - //To implement - // this->delegate().max_samples_per_instance(max_samples_per_instance); - // return *this; -} - -template -int32_t TResourceLimits::max_samples_per_instance() const -{ - //To implement - // return this->delegate().max_samples_per_instance(); -} - -//TLiveliness -template -TLiveliness::TLiveliness( - dds::core::policy::LivelinessKind::Type kind, - const dds::core::Duration& lease_duration) - : dds::core::Value(kind, lease_duration) -{ -} - -template -TLiveliness::TLiveliness( - const TLiveliness& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TLiveliness& TLiveliness::kind( - dds::core::policy::LivelinessKind::Type kind) -{ - //To implement - // this->delegate().kind(kind); - // return *this; -} - -template -dds::core::policy::LivelinessKind::Type TLiveliness::kind() const -{ - //To implement - // return this->delegate().kind(); -} - -template -TLiveliness& TLiveliness::lease_duration( - const dds::core::Duration& lease_duration) -{ - //To implement - // this->delegate().lease_duration(lease_duration); - // return *this; -} - -template -const dds::core::Duration TLiveliness::lease_duration() const -{ - //To implement - // return this->delegate().lease_duration(); -} - -template -TLiveliness TLiveliness::Automatic() -{ - //To implement - // return TLiveliness(dds::core::policy::LivelinessKind::AUTOMATIC, dds::core::Duration::infinite()); -} - -template -TLiveliness TLiveliness::ManualByParticipant( - const dds::core::Duration& lease_duration) -{ - //To implement - // return TLiveliness(dds::core::policy::LivelinessKind::MANUAL_BY_PARTICIPANT, lease_duration); -} - -template -TLiveliness TLiveliness::ManualByTopic( - const dds::core::Duration& lease_duration) -{ - //To implement - // return TLiveliness(dds::core::policy::LivelinessKind::MANUAL_BY_TOPIC, lease_duration); -} - -#ifdef OMG_DDS_PERSISTENCE_SUPPORT - -//TDurabilityService - -template -TDurabilityService::TDurabilityService( - const dds::core::Duration& service_cleanup_delay, - dds::core::policy::HistoryKind::Type history_kind, - int32_t history_depth, - int32_t max_samples, - int32_t max_instances, - int32_t max_samples_per_instance) - : dds::core::Value(service_cleanup_delay, - history_kind, - history_depth, - max_samples, - max_instances, - max_samples_per_instance) -{ -} - -template -TDurabilityService::TDurabilityService( - const TDurabilityService& other) - : dds::core::Value(other.delegate()) -{ -} - -template -TDurabilityService& TDurabilityService::service_cleanup_delay( - const dds::core::Duration& service_cleanup_delay) -{ - //To implement - // this->delegate().service_cleanup_delay(service_cleanup_delay); - // return *this; -} - -template -const dds::core::Duration TDurabilityService::service_cleanup_delay() const -{ - //To implement - return this->delegate().service_cleanup_delay(); -} - -template -TDurabilityService& TDurabilityService::history_kind( - dds::core::policy::HistoryKind::Type kind) -{ - //To implement - // this->delegate().history_kind(kind); - // return *this; -} - -template -dds::core::policy::HistoryKind::Type TDurabilityService::history_kind() const -{ - //To implement - // return this->delegate().history_kind(); -} - -template -TDurabilityService& TDurabilityService::history_depth( - int32_t history_depth) -{ - //To implement - // this->delegate().history_depth(history_depth); - // return *this; -} - -template -int32_t TDurabilityService::history_depth() const -{ - //To implement - // return this->delegate().history_depth(); -} - -template -TDurabilityService& TDurabilityService::max_samples( - int32_t max_samples) -{ - //To implement - // this->delegate().max_samples(max_samples); - // return *this; -} - -template -int32_t TDurabilityService::max_samples() const -{ - //To implement - // return this->delegate().max_samples(); -} - -template -TDurabilityService& TDurabilityService::max_instances( - int32_t max_instances) -{ - //To implement - // this->delegate().max_instances(max_instances); - // return *this; -} - -template -int32_t TDurabilityService::max_instances() const -{ - //To implement - // return this->delegate().max_instances(); -} - -template -TDurabilityService& TDurabilityService::max_samples_per_instance( - int32_t max_samples_per_instance) -{ - //To implement - // this->delegate().max_samples_per_instance(max_samples_per_instance); - // return *this; -} - -template -int32_t TDurabilityService::max_samples_per_instance() const -{ - //To implement - // return this->delegate().max_samples_per_instance(); -} - -#endif // OMG_DDS_PERSISTENCE_SUPPORT - - -#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -//TDataRepresentation - -/** @internal @bug OSPL-1746 Implementation required */ -template -TDataRepresentation::TDataRepresentation( - const dds::core::policy::DataRepresentationIdSeq& value); - -template -TDataRepresentation::TDataRepresentation( - const TDataRepresentation& other) - : dds::core::Value(other.delegate()) -{ -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -TDataRepresentation& TDataRepresentation::value( - const dds::core::policy::DataRepresentationIdSeq& value); - -/** @internal @bug OSPL-1746 Implementation required */ -template -const dds::core::policy::DataRepresentationIdSeq TDataRepresentation::value() const; - -#endif //OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -//TTypeConsistencyEnforcement - -/** @internal @bug OSPL-1746 Implementation required */ -template -TTypeConsistencyEnforcement::TTypeConsistencyEnforcement( - dds::core::policy::TypeConsistencyEnforcementKind::Type kind) -{ -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -TTypeConsistencyEnforcement& TTypeConsistencyEnforcement::kind( - dds::core::policy::TypeConsistencyEnforcementKind::Typekind) -{ -} - -/** @internal @bug OSPL-1746 Implementation required */ -template -dds::core::policy::TypeConsistencyEnforcementKind::Type TTypeConsistencyEnforcement::kind() const -{ -} - -#endif //OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT - -} //namespace policy -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_POLICY_TCOREPOLICY_IMPL_HPP_ diff --git a/include/dds/core/policy/detail/QosPolicyCount.hpp b/include/dds/core/policy/detail/QosPolicyCount.hpp deleted file mode 100644 index b384edd470c..00000000000 --- a/include/dds/core/policy/detail/QosPolicyCount.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_POLICY_DETAIL_QOS_POLICY_COUNT_HPP_ -#define EPROSIMA_DDS_CORE_POLICY_DETAIL_QOS_POLICY_COUNT_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace policy { -namespace detail { - -using QosPolicyId = eprosima::fastdds::dds::QosPolicyId_t; - -using QosPolicyCount = eprosima::fastdds::dds::QosPolicyCount; - -using QosPolicyCountSeq = eprosima::fastdds::dds::QosPolicyCountSeq; - -} //namespace detail -} //namespace policy -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_POLICY_DETAIL_QOS_POLICY_COUNT_HPP_ diff --git a/include/dds/core/ref_traits.hpp b/include/dds/core/ref_traits.hpp deleted file mode 100644 index 8c93fcf439f..00000000000 --- a/include/dds/core/ref_traits.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_REF_TRAITS_H_ -#define OMG_DDS_CORE_REF_TRAITS_H_ - -namespace dds { -namespace core { - -/** @cond - * These traits must be provided by compliant implementations - * to enable safe polymorphic casts. - */ - -template< - typename T1, - typename T2> -struct is_base_of; - -template< - typename T1, - typename T2> -struct is_same; - -template -struct smart_ptr_traits; - -template< - typename TO, - typename FROM> -TO polymorphic_cast( - FROM& from); - -/** @endcond */ - -} //namespace core -} //namespace dds - -// This include should stay here as it provides implementations -// for the declaration immediately above. -#include - -#endif //OMG_DDS_CORE_REF_TRAITS_H diff --git a/include/dds/core/refmacros.hpp b/include/dds/core/refmacros.hpp deleted file mode 100644 index f7589b0c2b9..00000000000 --- a/include/dds/core/refmacros.hpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_REFMACROS_HPP_ -#define OMG_DDS_CORE_REFMACROS_HPP_ - -//////////////////////////////////////////////////////////////////////////////// -// Macros -//////////////////////////////////////////////////////////////////////////////// - -#define DECLARE_TYPE_TRAITS(TYPE) \ - typedef TYPE TYPE ## _T; \ - typedef typename ::dds::core::smart_ptr_traits::ref_type TYPE ## _REF_T; \ - typedef typename ::dds::core::smart_ptr_traits::weak_ref_type TYPE ## _WEAK_REF_T; - - -/* - * This macro defines all the functions that Reference Types have to implement. - */ -//////////////////////////////////////////////////////////////////////////////// -// Defines all the types, functions and attributes required for a Reference type -// without default ctor. -// - -#define OMG_DDS_REF_TYPE_BASE(TYPE, BASE, DELEGATE) \ -public: \ - typedef typename ::dds::core::smart_ptr_traits< DELEGATE >::ref_type DELEGATE_REF_T; \ - typedef typename ::dds::core::smart_ptr_traits< DELEGATE >::weak_ref_type DELEGATE_WEAK_REF_T; \ - \ -protected: \ - const typename ::dds::core::Reference< DELEGATE >::DELEGATE_REF_T& impl() const \ - { return ::dds::core::Reference< DELEGATE >::impl_; } \ - typename ::dds::core::Reference< DELEGATE >::DELEGATE_REF_T& impl() \ - { return ::dds::core::Reference< DELEGATE >::impl_; } \ - \ -public: \ - typedef BASE< DELEGATE > BASE_T; \ - \ -public: \ - TYPE(const dds::core::null_type&) : dds::core::Reference< DELEGATE >(static_cast(NULL)) { } \ - \ - TYPE& operator =( \ - const dds::core::null_type& rhs) { \ - *this = TYPE(rhs); \ - return *this; \ - } \ - \ -public: \ - TYPE(const DELEGATE_REF_T &ref) \ - : dds::core::Reference< DELEGATE >(ref) \ - { } - -#define OMG_DDS_IMPLICIT_REF_BASE(TYPE) \ -public: \ - template \ - TYPE(const H__ &h) \ - { \ - if (h.is_nil()){ \ - /* We got a null object and are not really able to do a typecheck here. */ \ - /* So, just set a null object. */ \ - *this = dds::core::null; \ - } else { \ - this->impl_ = h.delegate(); \ - if (h.delegate() != this->::dds::core::Reference< DELEGATE_T >::impl_){ \ - throw dds::core::IllegalOperationError(std::string( \ - "Attempted invalid cast: ") + typeid(h).name() + " to " + typeid(*this).name()); \ - } \ - } \ - } \ - \ - template \ - TYPE& \ - operator =( \ - const T__& rhs) { \ - if (this != (TYPE*)&rhs){ \ - if (rhs.is_nil()){ \ - /* We got a null object and are not really able to do a typecheck here. */ \ - /* So, just set a null object. */ \ - *this = dds::core::null; \ - } else { \ - TYPE other(rhs); \ - /* Dont have to copy when the delegate impl is the same. */ \ - if (other.delegate() != this->::dds::core::Reference< DELEGATE_T >::impl_){ \ - *this = other; \ - } \ - } \ - } \ - return *this; \ - } - -#define OMG_DDS_EXPLICIT_REF_BASE_DECL(TYPE, FROM) \ -public: \ - TYPE(const FROM &h); \ - \ - TYPE& \ - operator =( \ - const FROM& rhs); - -#define OMG_DDS_EXPLICIT_REF_BASE(TYPE, FROM) \ -public: \ - /* We need to support both const and non-const conversion explicitly, because it could */ \ - /* be that the class has a constructor that takes a single non-const template argument. */ \ - /* That non-const templated constructor is a closer match than TYPE(const FROM& h); when */ \ - /* creating the TYPE class from a non-const FROM object. */ \ - TYPE(FROM & h) { this->explicit_conversion(const_cast(h)); } \ - TYPE(const FROM &h) { this->explicit_conversion(h); } \ -private: \ - void explicit_conversion(const FROM &h) \ - { \ - if (h.is_nil()){ \ - /* We got a null object and are not really able to do a typecheck here. */ \ - /* So, just set a null object. */ \ - *this = dds::core::null; \ - } else { \ - this->impl_ = h.delegate(); \ - if (h.delegate() != this->::dds::core::Reference< DELEGATE_T >::impl_){ \ - throw dds::core::IllegalOperationError(std::string( \ - "Attempted invalid cast: ") + typeid(h).name() + " to " + typeid(*this).name()); \ - } \ - } \ - } \ - \ -public: \ - TYPE& \ - operator =( \ - const FROM& rhs) { \ - if (this != (TYPE*)&rhs){ \ - if (rhs.is_nil()){ \ - /* We got a null object and are not really able to do a typecheck here. */ \ - /* So, just set a null object. */ \ - *this = dds::core::null; \ - } else { \ - TYPE other(rhs); \ - /* Dont have to copy when the delegate is the same. */ \ - if (other.delegate() != this->::dds::core::Reference< DELEGATE_T >::impl_){ \ - *this = other; \ - } \ - } \ - } \ - return *this; \ - } - -//////////////////////////////////////////////////////////////////////////////// -// Declares a reference type equipped with a default ctor. -// -#define OMG_DDS_REF_TYPE_PROTECTED_DC(TYPE, BASE, DELEGATE) \ -public: \ - typedef DELEGATE DELEGATE_T; \ - OMG_DDS_REF_TYPE_BASE(TYPE, BASE, DELEGATE_T) \ -protected: \ - TYPE() { } - -#define OMG_DDS_REF_TYPE_PROTECTED_DC_T(TYPE, BASE, T_PARAM, DELEGATE) \ -public: \ - typedef DELEGATE DELEGATE_T; \ - OMG_DDS_REF_TYPE_BASE(TYPE, BASE, DELEGATE_T) \ -protected: \ - TYPE() { } - -#define OMG_DDS_REF_TYPE_NO_DC(TYPE, BASE, DELEGATE) \ -public: \ - typedef DELEGATE DELEGATE_T; \ - OMG_DDS_REF_TYPE_BASE(TYPE, BASE, DELEGATE_T) - -#define OMG_DDS_REF_TYPE_DELEGATE_C(TYPE, BASE, DELEGATE) \ - OMG_DDS_REF_TYPE_PROTECTED_DC(TYPE, BASE, DELEGATE) \ -public: \ - TYPE(DELEGATE_T * impl) : dds::core::Reference< DELEGATE_T >(impl) { } - -#endif //OMG_DDS_CORE_REFMACROS_HPP_ diff --git a/include/dds/core/status/State.hpp b/include/dds/core/status/State.hpp deleted file mode 100644 index 0f62dfc9912..00000000000 --- a/include/dds/core/status/State.hpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_STATUS_STATE_HPP_ -#define OMG_DDS_CORE_STATUS_STATE_HPP_ - -#include -#include -#include - -#include - - -namespace dds { -namespace core { -namespace status { - -/** - * @brief - * Class to contain the statistics about samples that have been rejected. - * - * @see @ref DCPS_Modules_Subscription_SampleInfo "SampleInfo" for more information - */ -class OMG_DDS_API SampleRejectedState : public std::bitset -{ -public: - - /** - * Convenience typedef for std::bitset. - */ - typedef std::bitset MaskType; - - /** - * Construct an empty SampleRejectedState. - */ - SampleRejectedState() - : std::bitset() - { - } - - /** - * Copy constructor. - * - * Construct an SampleRejectedState with existing SampleRejectedState. - * - * @param src the SampleRejectedState to copy from - */ - SampleRejectedState( - const SampleRejectedState& src) - : std::bitset(src) - { - } - - /** - * Construct a SampleRejectedState with existing MaskType. - * - * @param src the MaskType to copy from - */ - SampleRejectedState( - const MaskType& src) - : std::bitset(src) - { - } - - /** - * Get the NOT_REJECTED. - * - *not_rejected - * - No sample has been rejected yet. - * - * @return the not_rejected SampleRejectedState - */ - inline static SampleRejectedState not_rejected() - { - return SampleRejectedState(0u); - } - - /** - * Get the REJECTED_BY_SAMPLES_LIMIT. - * - *rejected_by_samples_limit - * - The sample was rejected because it would - * exceed the maximum number of samples set by the ResourceLimits - * QosPolicy. - * - * @return the rejected_by_samples_limit SampleRejectedState - */ - inline static SampleRejectedState rejected_by_samples_limit() - { - return SampleRejectedState(0x0001 << 1u); - } - - /** - * Get the REJECTED_BY_INSTANCES_LIMIT. - * - *rejected_by_instances_limit - * - The sample was rejected because it would - * exceed the maximum number of instances set by the - * ResourceLimits QosPolicy. - * - * @return the rejected_by_instances_limit SampleRejectedState - */ - inline static SampleRejectedState rejected_by_instances_limit() - { - return SampleRejectedState(0x0001 << 0u); - } - - /** - * Get the REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT. - * - *rejected_by_samples_per_instance_limit - * - The sample was rejected - * because it would exceed the maximum number of samples per - * instance set by the ResourceLimits QosPolicy. - * - * @return the rejected_by_samples_per_instance_limit SampleRejectedState - */ - inline static SampleRejectedState rejected_by_samples_per_instance_limit() - { - return SampleRejectedState(0x0001 << 2u); - } - -private: - - SampleRejectedState( - uint32_t s) - : std::bitset(s) - { - } - -}; - -/** - * @brief - * StatusMask is a bitmap or bitset field. - * - * This bitset is used to: - * - determine which listener functions to call - * - set conditions in dds::core::cond::StatusCondition - * - indicate status changes when calling dds::core::Entity::status_changes - * - * @see @ref DCPS_Modules_Infrastructure_Status "Status concept" - */ -using StatusMask = eprosima::fastdds::dds::StatusMask; - -} //namespace status -} //namespace core -} //namespace dds - - -#endif //OMG_DDS_CORE_STATUS_STATE_HPP_ diff --git a/include/dds/core/status/Status.hpp b/include/dds/core/status/Status.hpp deleted file mode 100644 index 57171463ee3..00000000000 --- a/include/dds/core/status/Status.hpp +++ /dev/null @@ -1,449 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_STATUS_STATUS_HPP_ -#define OMG_DDS_CORE_STATUS_STATUS_HPP_ - -#include - -#include -#include -#include -#include - -#include - -namespace dds { -namespace core { -namespace status { - -/** - * \copydoc DCPS_Status_InconsistentTopic - */ -class InconsistentTopicStatus : public dds::core::Value -{ -public: - - OMG_DDS_API InconsistentTopicStatus(); - - /** - * @return Total cumulative count of all inconsistent topics detected. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The incremental number of inconsistent topics since the last time - * the listener was called or the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; -}; - -/** - * \copydoc DCPS_Status_SampleLost - */ -class SampleLostStatus : public dds::core::Value -{ -public: - - OMG_DDS_API SampleLostStatus(); - - /** - * @return Total cumulative count of all samples lost across of instances of data - * published under the Topic. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The incremental number of samples lost since the last time the listener - * was called or the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; -}; - - -/** - * \copydoc DCPS_Status_SampleRejected - */ -class SampleRejectedStatus : public dds::core::Value -{ -public: - - SampleRejectedStatus(); - - /** - * @return Total cumulative count of samples rejected by the DataReader. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The incremental number of samples rejected since the last time the - * listener was called or the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return Reason for rejecting the last sample rejected. If no samples have been - * rejected, the reason is the special value NOT_REJECTED. - */ - OMG_DDS_API const dds::core::status::SampleRejectedState last_reason() const; - - /** - * @return Handle to the instance being updated by the last sample that was - * rejected. - */ - OMG_DDS_API const dds::core::InstanceHandle last_instance_handle() const; -}; - -/** - * \copydoc DCPS_Status_LivelinessLost - */ -class LivelinessLostStatus : public dds::core::Value -{ -public: - - OMG_DDS_API LivelinessLostStatus(); - - /** - * @return Total cumulative number of times that a previously-alive DataWriter - * became 'not alive' due to a failure to actively signal its liveliness within - * its offered liveliness period. This count does not change when an - * already not alive DataWriter simply remains not alive for another - * liveliness period. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; -}; - -/** - * \copydoc DCPS_Status_LivelinessChanged - */ -class LivelinessChangedStatus : public dds::core::Value -{ -public: - - OMG_DDS_API LivelinessChangedStatus(); - - /** - * @return The total number of currently active DataWriters that write the Topic - * read by the DataReader. This count increases when a newly-matched - * DataWriter asserts its liveliness for the first time or when a DataWriter - * previously considered to be not alive reasserts its liveliness. The count - * decreases when a DataWriter considered alive fails to assert its - * liveliness and becomes not alive, whether because it was deleted - * normally or for some other reason. - */ - OMG_DDS_API int32_t alive_count() const; - - /** - * @return The total count of currently DataWriters that write the Topic read by - * the DataReader that are no longer asserting their liveliness. This count - * increases when a DataWriter considered alive fails to assert its - * liveliness and becomes not alive for some reason other than the normal - * deletion of that DataWriter. It decreases when a previously not alive - * DataWriter either reasserts its liveliness or is deleted normally. - */ - OMG_DDS_API int32_t not_alive_count() const; - - /** - * @return The change in the alive_count since the last time the listener was - * called or the status was read. - */ - OMG_DDS_API int32_t alive_count_change() const; - - /** - * @return The change in the not_alive_count since the last time the listener was - * called or the status was read. - */ - OMG_DDS_API int32_t not_alive_count_change() const; - - /** - * @return Handle to the last DataWriter whose change in liveliness caused this - * status to change. - */ - OMG_DDS_API const dds::core::InstanceHandle last_publication_handle() const; -}; - -/** - * \copydoc DCPS_Status_OfferedDeadlineMissed - */ -class OfferedDeadlineMissedStatus : public dds::core::Value -{ -public: - - OMG_DDS_API OfferedDeadlineMissedStatus(); - - /** - * @return Total cumulative number of offered deadline periods elapsed during - * which a DataWriter failed to provide data. Missed deadlines - * accumulate; that is, each deadline period the total_count will be - * incremented by one. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return Handle to the last instance in the DataWriter for which an offered - * deadline was missed. - */ - OMG_DDS_API const dds::core::InstanceHandle last_instance_handle() const; -}; - -/** - * \copydoc DCPS_Status_RequestedDeadlineMissed - */ -class RequestedDeadlineMissedStatus : public dds::core::Value -{ -public: - - OMG_DDS_API RequestedDeadlineMissedStatus(); - - /** - * @return Total cumulative number of missed deadlines detected for any instance - * read by the DataReader. Missed deadlines accumulate; that is, each - * deadline period the total_count will be incremented by one for each - * instance for which data was not received. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The incremental number of deadlines detected since the last time the - * listener was called or the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return Handle to the last instance in the DataReader for which a deadline was - * detected. - */ - OMG_DDS_API const dds::core::InstanceHandle last_instance_handle() const; -}; - - -/** - * \copydoc DCPS_Status_OfferedIncompatibleQoS - */ -class OfferedIncompatibleQosStatus : public dds::core::Value -{ -public: - - OMG_DDS_API OfferedIncompatibleQosStatus(); - - /** - * @return Total cumulative number of times the concerned DataWriter - * discovered a DataReader for the same Topic with a requested QoS that - * is incompatible with that offered by the DataWriter. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return The PolicyId of one of the policies that was found to be - * incompatible the last time an incompatibility was detected. - */ - OMG_DDS_API dds::core::policy::QosPolicyId last_policy_id() const; - - /** - * @return A list containing for each policy the total number of times that the - * concerned DataWriter discovered a DataReader for the same Topic - * with a requested QoS that is incompatible with that offered by the - * DataWriter. - */ - OMG_DDS_API const dds::core::policy::QosPolicyCountSeq policies() const; - - /** - * @return A list containing for each policy the total number of times that the - * concerned DataWriter discovered a DataReader for the same Topic - * with a requested QoS that is incompatible with that offered by the - * DataWriter. - * - * @param dst The destination QosPolicyCountSeq the policies will be returned to - */ - OMG_DDS_API const dds::core::policy::QosPolicyCountSeq& policies( - dds::core::policy::QosPolicyCountSeq& dst) const; -}; - -/** - * \copydoc DCPS_Status_RequestedIncompatibleQoS - */ -class RequestedIncompatibleQosStatus : public dds::core::Value -{ -public: - - OMG_DDS_API RequestedIncompatibleQosStatus(); - - /** - * @return Total cumulative number of times the concerned DataReader - * discovered a DataWriter for the same Topic with an offered QoS that - * was incompatible with that requested by the DataReader. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return The QosPolicyId of one of the policies that was found to be - * incompatible the last time an incompatibility was detected. - */ - OMG_DDS_API dds::core::policy::QosPolicyId last_policy_id() const; - - /** - * @return A list containing for each policy the total number of times that the - * concerned DataReader discovered a DataWriter for the same Topic - * with an offered QoS that is incompatible with that requested by the - * DataReader. - */ - OMG_DDS_API const dds::core::policy::QosPolicyCountSeq policies() const; - - /** - * @return A list containing for each policy the total number of times that the - * concerned DataReader discovered a DataWriter for the same Topic - * with an offered QoS that is incompatible with that requested by the - * DataReader. - * - * @param dst The destination QosPolicyCountSeq the policies will be returned to - */ - OMG_DDS_API const dds::core::policy::QosPolicyCountSeq& policies( - dds::core::policy::QosPolicyCountSeq& dst) const; -}; - -/** - * \copydoc DCPS_Status_PublicationMatched - */ -class PublicationMatchedStatus : public dds::core::Value -{ -public: - - OMG_DDS_API PublicationMatchedStatus(); - - /** - * @return Total cumulative count the concerned DataWriter discovered a - * "match" with a DataReader. That is, it found a DataReader for the - * same Topic with a requested QoS that is compatible with that offered - * by the DataWriter. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return The number of DataReaders currently matched to the concerned - * DataWriter. - */ - OMG_DDS_API int32_t current_count() const; - - /** - * @return The change in current_count since the last time the listener was called - * or the status was read. - */ - OMG_DDS_API int32_t current_count_change() const; - - /** - * @return Handle to the last DataReader that matched the DataWriter causing the - * status to change. - */ - OMG_DDS_API const dds::core::InstanceHandle last_subscription_handle() const; -}; - -/** - * \copydoc DCPS_Status_SubscriptionMatched - */ -class SubscriptionMatchedStatus : public dds::core::Value -{ -public: - - OMG_DDS_API SubscriptionMatchedStatus(); - - /** - * @return Total cumulative count the concerned DataReader discovered a - * "match" with a DataWriter. That is, it found a DataWriter for the same - * Topic with a requested QoS that is compatible with that offered by the - * DataReader. - */ - OMG_DDS_API int32_t total_count() const; - - /** - * @return The change in total_count since the last time the listener was called or - * the status was read. - */ - OMG_DDS_API int32_t total_count_change() const; - - /** - * @return The number of DataWriters currently matched to the concerned - * DataReader. - */ - OMG_DDS_API int32_t current_count() const; - - /** - * @return The change in current_count since the last time the listener was called - * or the status was read. - */ - OMG_DDS_API int32_t current_count_change() const; - - /** - * @return Handle to the last DataWriter that matched the DataReader causing the - * status to change. - */ - OMG_DDS_API const dds::core::InstanceHandle last_publication_handle() const; -}; - - -class DataAvailableStatus -{ - // empty -}; - - -class DataOnReadersStatus -{ - // empty -}; - -// This trait is used to get the state associated with each status -template -StatusMask get_status(); - -} //namespace status -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_STATUS_STATUS_HPP_ diff --git a/include/dds/core/status/detail/Status.hpp b/include/dds/core/status/detail/Status.hpp deleted file mode 100644 index 8282d822af4..00000000000 --- a/include/dds/core/status/detail/Status.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_STATUS_DETAIL_STATUS_HPP_ -#define EPROSIMA_DDS_CORE_STATUS_DETAIL_STATUS_HPP_ - -#include -#include -#include -#include -#include -#include -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace core { -namespace status { -namespace detail { - -using InconsistentTopicStatus = eprosima::fastdds::dds::InconsistentTopicStatus; - -using LivelinessChangedStatus = eprosima::fastdds::dds::LivelinessChangedStatus; - -using LivelinessLostStatus = eprosima::fastdds::dds::LivelinessLostStatus; - -using OfferedDeadlineMissedStatus = eprosima::fastdds::dds::OfferedDeadlineMissedStatus; - -using OfferedIncompatibleQosStatus = eprosima::fastdds::dds::OfferedIncompatibleQosStatus; - -using PublicationMatchedStatus = eprosima::fastdds::dds::PublicationMatchedStatus; - -using SampleRejectedStatus = eprosima::fastdds::dds::SampleRejectedStatus; - -using RequestedDeadlineMissedStatus = eprosima::fastdds::dds::RequestedDeadlineMissedStatus; - -using RequestedIncompatibleQosStatus = eprosima::fastdds::dds::RequestedIncompatibleQosStatus; - -using SampleLostStatus = eprosima::fastdds::dds::SampleLostStatus; - -using SubscriptionMatchedStatus = eprosima::fastdds::dds::SubscriptionMatchedStatus; - -} //namespace detail -} //namespace status -} //namespace core -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_CORE_STATUS_DETAIL_STATUS_HPP_ diff --git a/include/dds/core/status/detail/StatusImpl.hpp b/include/dds/core/status/detail/StatusImpl.hpp deleted file mode 100644 index c83ab09383a..00000000000 --- a/include/dds/core/status/detail/StatusImpl.hpp +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_STATUS_TSTATUS_IMPL_HPP_ -#define EPROSIMA_DDS_CORE_STATUS_TSTATUS_IMPL_HPP_ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace core { -namespace status { - -//TInconsistentTopicStatus - -template -TInconsistentTopicStatus::TInconsistentTopicStatus() - : dds::core::Value() -{ -} - -template -int32_t TInconsistentTopicStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TInconsistentTopicStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -//TSampleLostStatus - -template -TSampleLostStatus::TSampleLostStatus() - : dds::core::Value() -{ -} - -template -int32_t TSampleLostStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TSampleLostStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -//TSampleRejectedStatus - -template -TSampleRejectedStatus::TSampleRejectedStatus() - : dds::core::Value() -{ -} - -template -int32_t TSampleRejectedStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TSampleRejectedStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -const dds::core::status::SampleRejectedState TSampleRejectedStatus::last_reason() const -{ - //To implement - // return this->delegate().last_reason(); -} - -template -const dds::core::InstanceHandle TSampleRejectedStatus::last_instance_handle() const -{ - //To implement - // return this->delegate().last_instance_handle(); -} - -//TLivelinessLostStatus -template -TLivelinessLostStatus::TLivelinessLostStatus() - : dds::core::Value() -{ -} - -template -int32_t TLivelinessLostStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TLivelinessLostStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -//TLivelinessChangedStatus - -template -TLivelinessChangedStatus::TLivelinessChangedStatus() - : dds::core::Value() -{ -} - -template -int32_t TLivelinessChangedStatus::alive_count() const -{ - //To implement - // return this->delegate().alive_count(); -} - -template -int32_t TLivelinessChangedStatus::not_alive_count() const -{ - //To implement - // return this->delegate().not_alive_count(); -} - -template -int32_t TLivelinessChangedStatus::alive_count_change() const -{ - //To implement - // return this->delegate().alive_count(); -} - -template -int32_t TLivelinessChangedStatus::not_alive_count_change() const -{ - //To implement - // return this->delegate().not_alive_count(); -} - -template -const dds::core::InstanceHandle TLivelinessChangedStatus::last_publication_handle() const -{ - //To implement - // return this->delegate().last_publication_handle(); -} - -//TOfferedDeadlineMissedStatus - -template -TOfferedDeadlineMissedStatus::TOfferedDeadlineMissedStatus() - : dds::core::Value() -{ -} - -template -int32_t TOfferedDeadlineMissedStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TOfferedDeadlineMissedStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -const dds::core::InstanceHandle TOfferedDeadlineMissedStatus::last_instance_handle() const -{ - //To implement - // return this->delegate().last_instance_handle(); -} - -//TRequestedDeadlineMissedStatus - -template -TRequestedDeadlineMissedStatus::TRequestedDeadlineMissedStatus() - : dds::core::Value() -{ -} - -template -int32_t TRequestedDeadlineMissedStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TRequestedDeadlineMissedStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -const dds::core::InstanceHandle TRequestedDeadlineMissedStatus::last_instance_handle() const -{ - //To implement - // return this->delegate().last_instance_handle(); -} - -//TOfferedIncompatibleQosStatus - -template -TOfferedIncompatibleQosStatus::TOfferedIncompatibleQosStatus() - : dds::core::Value() -{ -} - -template -int32_t TOfferedIncompatibleQosStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TOfferedIncompatibleQosStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -dds::core::policy::QosPolicyId TOfferedIncompatibleQosStatus::last_policy_id() const -{ - //To implement - // return this->delegate().last_policy_id(); -} - -template -const dds::core::policy::QosPolicyCountSeq TOfferedIncompatibleQosStatus::policies() const -{ - //To implement - // return this->delegate().policies(); -} - -template -const dds::core::policy::QosPolicyCountSeq& TOfferedIncompatibleQosStatus::policies( - dds::core::policy::QosPolicyCountSeq& dst) const -{ - //To implement - // return this->delegate().policies(dst); -} - -//TRequestedIncompatibleQosStatus - -template -TRequestedIncompatibleQosStatus::TRequestedIncompatibleQosStatus() - : dds::core::Value() -{ -} - -template -int32_t TRequestedIncompatibleQosStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TRequestedIncompatibleQosStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -dds::core::policy::QosPolicyId TRequestedIncompatibleQosStatus::last_policy_id() const -{ - //To implement - // return this->delegate().last_policy_id(); -} - -template -const dds::core::policy::QosPolicyCountSeq TRequestedIncompatibleQosStatus::policies() const -{ - //To implement - // return this->delegate().policies(); -} - -template -const dds::core::policy::QosPolicyCountSeq& TRequestedIncompatibleQosStatus::policies( - dds::core::policy::QosPolicyCountSeq& dst) const -{ - //To implement - // return this->delegate().policies(dst); -} - -//TPublicationMatchedStatus - -template -TPublicationMatchedStatus::TPublicationMatchedStatus() - : dds::core::Value() -{ -} - -template -int32_t TPublicationMatchedStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TPublicationMatchedStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -int32_t TPublicationMatchedStatus::current_count() const -{ - //To implement - // return this->delegate().current_count(); -} - -template -int32_t TPublicationMatchedStatus::current_count_change() const -{ - //To implement - // return this->delegate().current_count_change(); -} - -template -const dds::core::InstanceHandle TPublicationMatchedStatus::last_subscription_handle() const -{ - //To implement - // return this->delegate().last_subscription_handle(); -} - -//TSubscriptionMatchedStatus - -template -TSubscriptionMatchedStatus::TSubscriptionMatchedStatus() - : dds::core::Value() -{ -} - -template -int32_t TSubscriptionMatchedStatus::total_count() const -{ - //To implement - // return this->delegate().total_count(); -} - -template -int32_t TSubscriptionMatchedStatus::total_count_change() const -{ - //To implement - // return this->delegate().total_count_change(); -} - -template -int32_t TSubscriptionMatchedStatus::current_count() const -{ - //To implement - // return this->delegate().current_count(); -} - -template -int32_t TSubscriptionMatchedStatus::current_count_change() const -{ - //To implement - // return this->delegate().current_count_change(); -} - -template -const dds::core::InstanceHandle TSubscriptionMatchedStatus::last_publication_handle() const -{ - //To implement - // return this->delegate().last_publication_handle(); -} - -} //namespace status -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_STATUS_TSTATUS_IMPL_HPP_ diff --git a/include/dds/core/types.hpp b/include/dds/core/types.hpp deleted file mode 100644 index 0f973ee8839..00000000000 --- a/include/dds/core/types.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_TYPES_HPP_ -#define OMG_DDS_CORE_TYPES_HPP_ - -#include -#include -#include - -#include -#include - -namespace dds { -namespace core { - -/** - * Use a std::vector to hold a sequence of bytes. - */ -typedef std::vector ByteSeq; - -/** - * Use a std::vector to hold a sequence of bytes. - */ -typedef std::vector StringSeq; - -/** - * @brief This class is used to create dds::core::null objects. - */ -class OMG_DDS_API null_type -{ -}; - -/** - * This is the DDS Null-Reference.
- * A dds reference object that doesn't reference to anything can be compared with this object. - * @code{.cpp} - * dds::domain::DomainParticipant participant = dds::core::null; - * ... - * if (participant == dds::core::null) { - * // The participant is not yet properly created. - * // Using it now will trigger the dds::core::NullReferenceError exception. - * } - * @endcode - */ -extern const null_type OMG_DDS_API null; - -} //namespace core -} //namespace dds - -#endif // OMG_DDS_CORE_TYPES_HPP_ diff --git a/include/dds/core/xtypes/Annotation.hpp b/include/dds/core/xtypes/Annotation.hpp deleted file mode 100644 index 0cfa3c71730..00000000000 --- a/include/dds/core/xtypes/Annotation.hpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_ANNOTATION_HPP_ -#define OMG_DDS_CORE_XTYPES_ANNOTATION_HPP_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include - -namespace dds { -namespace core { -namespace xtypes { - -template -class TIdAnnotation; - -template -class TAnnotation : public Reference -{ - - OMG_DDS_REF_TYPE_BASE( - TAnnotation, - dds::core::Reference, - DELEGATE) - -public: - - virtual ~TAnnotation(); - - TypeKind kind() const; - - template class K> - operator K&() - { - return reinterpret_cast&>(*this); - } - - const AnnotationKind& akind() const - { - return impl()->akind(); - } - -protected: - - TAnnotation( - const TypeKind& kind); -}; - -template -class TIdAnnotation : public TAnnotation -{ - using TAnnotation::impl; - -public: - - TIdAnnotation( - uint32_t id) - : TAnnotation(TypeKind::ANNOTATION_TYPE) - { - impl()->id(id); - } - - uint32_t id() const - { - return impl()->id(); - } - -}; - -template -class TKeyAnnotation : public TAnnotation -{ - using TAnnotation::impl; - -public: - - TKeyAnnotation() - { - } - -}; - -template -class TSharedAnnotation : public TAnnotation -{ -public: - - TSharedAnnotation() - { - } - -}; - -template -class TNestedAnnotation : public TAnnotation -{ -public: - - TNestedAnnotation() - { - } - -}; - -template -class TExtensibilityAnnotation : public TAnnotation -{ - using TAnnotation::impl; - -public: - - TExtensibilityAnnotation( - ExtensibilityKind xkind) - { - impl()->xKind(); - } - - ExtensibilityKind extensibility_kind() const - { - return impl()->xKind(); - } - -}; - -template -class TMustUnderstandAnnotation : public TAnnotation -{ -public: - - TMustUnderstandAnnotation() - { - } - -}; - -template -class TVerbatimAnnotation : public TAnnotation -{ - using TAnnotation::impl; - -public: - - TVerbatimAnnotation( - const std::string& text) - { - impl()->vbt(text); - } - - const std::string& verbatim_text() const - { - return impl()->vbt(); - } - -}; - -template -class TBitsetAnnotation : public TAnnotation -{ -public: - - TBitsetAnnotation() - { - } - -}; - -template -class TBitBoundAnnotation : public TAnnotation -{ - using TAnnotation::impl; - -public: - - TBitBoundAnnotation( - uint32_t bound) - { - impl()->bsb(bound); - } - - virtual uint32_t bound() const - { - return impl()->bsb(); - } - - void bound( - uint32_t bound) - { - impl()->bsb(bound); - } - -}; - -typedef TAnnotation Annotation; - -typedef TIdAnnotation IdAnnotation; - -typedef TKeyAnnotation KeyAnnotation; - -typedef TSharedAnnotation SharedAnnotation; - -typedef TNestedAnnotation NestedAnnotation; - -typedef TExtensibilityAnnotation ExtensibilityAnnotation; - -typedef TMustUnderstandAnnotation MustUnderstandAnnotation; - -typedef TVerbatimAnnotation VerbatimAnnotation; - -typedef TBitsetAnnotation BitsetAnnotation; - -typedef TBitBoundAnnotation BitBoundAnnotation; - -//FRANAVA We must think about the fact that previous API has a way of creating a -//dynamically defined Annotation. -/* - namespace converter - { - IdAnnotation convert(const Annotation& a) - { - uint32_t idav = reinterpret_cast(a).id(); - return IdAnnotation(idav); - } - } - */ -namespace annotation { - -// These functions can be used to get cached instances, -// to avoid the proliferation of small annotation objects. -IdAnnotation id( - uint32_t); - -KeyAnnotation key(); - -SharedAnnotation shared(); - -NestedAnnotation nested(); - -ExtensibilityAnnotation extensibility( - ExtensibilityKind kind); - -ExtensibilityAnnotation get_final(); - -ExtensibilityAnnotation extensible(); - -ExtensibilityAnnotation get_mutable(); - -MustUnderstandAnnotation must_understand(); - -VerbatimAnnotation verbatim( - const std::string& text); - -BitsetAnnotation bitset(); - -BitsetAnnotation bit_bound( - uint32_t bound); - -} //namespace annotation -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif -#endif //OMG_DDS_CORE_XTYPES_TANNOTATION_HPP_ diff --git a/include/dds/core/xtypes/AnnotationKind.hpp b/include/dds/core/xtypes/AnnotationKind.hpp deleted file mode 100644 index cd2f04cad65..00000000000 --- a/include/dds/core/xtypes/AnnotationKind.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef OMG_DDS_CORE_ANNOTATIONKIND_H -#define OMG_DDS_CORE_ANNOTATIONKIND_H - - -#include - -namespace dds { -namespace core { -namespace xtypes { - -struct AnnotationKind_def -{ - enum Type - { - ID_ANNOTATION_TYPE, - OPTIONAL_ANNOTATION_TYPE, - KEY_ANNOTATION_TYPE, - SHARED_ANNOTATION_TYPE, - NESTED_ANNOTATION_TYPE, - EXTENSIBILITY_ANNOTATION_TYPE, - MUST_UNDERSTAND_ANNOTATION_TYPE, - VERBATIM_ANNOTATION_TYPE, - BITSET_ANNOTATION_TYPE, - BITSETBOUND_ANNOTATION_TYPE - }; -}; - -typedef dds::core::SafeEnum AnnotationKind; - -struct ExtensibilityKind_def -{ - enum Type - { - FINAL, - EXTENSIBLE, - MUTABLE - }; -}; - -typedef dds::core::SafeEnum ExtensibilityKind; - -} //xtypes -} //core -} //dds - -#endif //OMG_DDS_CORE_ANNOTATIONKIND_H - diff --git a/include/dds/core/xtypes/CollectionTypes.hpp b/include/dds/core/xtypes/CollectionTypes.hpp deleted file mode 100644 index 4efc50d4ae4..00000000000 --- a/include/dds/core/xtypes/CollectionTypes.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_COLLECTION_TYPES_HPP_ -#define OMG_DDS_CORE_XTYPES_COLLECTION_TYPES_HPP_ - -#include -#include - -namespace dds { -namespace core { -namespace xtypes { - - -template -class TCollectionType : public TDynamicType -{ -public: - - constexpr static uint32_t UNBOUNDED = 0xFFFFFFFF; - - uint32_t bounds() const - { - throw "Not implemented"; - } - -protected: - - TCollectionType( - const std::string& name, - TypeKind kind) - { - throw "Not implemented"; - } - -}; - -template< - typename DELEGATE, - typename DELEGATE_K, - typename DELEGATE_V> -class TMapType : public TCollectionType -{ -public: - - TMapType( - const TDynamicType& key_type, - const TDynamicType& value_type) - { - throw "Not implemented"; - } - - TMapType( - const TDynamicType& key_type, - const TDynamicType& value_type, - uint32_t bounds) - { - throw "Not implemented"; - } - - const TDynamicType& key_type() - { - throw "Not implemented"; - } - - const TDynamicType& value_type() - { - throw "Not implemented"; - } - -}; - - -template< - typename DELEGATE, - typename DELEGATE_T> -class TSequenceType : public TCollectionType -{ -public: - - TSequenceType( - const TDynamicType& type) - { - throw "Not implemented"; - } - - TSequenceType( - const TDynamicType& type, - uint32_t bounds) - { - throw "Not implemented"; - } - -public: - - const TDynamicType& key_type() const - { - throw "Not implemented"; - } - -}; - - -template -class TStringType : public TCollectionType -{ -public: - - TStringType( - uint32_t bounds) - { - throw "Not implemented"; - } - -}; - -typedef TCollectionType CollectionType; -typedef TMapType TypeMap; -typedef TSequenceType SequenceType; -typedef TStringType StringType; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_COLLECTION_TYPES_HPP_ diff --git a/include/dds/core/xtypes/DynamicData.hpp b/include/dds/core/xtypes/DynamicData.hpp deleted file mode 100644 index d18b6241883..00000000000 --- a/include/dds/core/xtypes/DynamicData.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_DYNAMIC_DATA_HPP_ -#define OMG_DDS_CORE_XTYPES_DYNAMIC_DATA_HPP_ - -#include - -#include -#include - -#include - -namespace dds { -namespace core { -namespace xtypes { - -/** - * This class is used to read/write data for DynamicTypes. It allows reading and - * writing of samples in a type-safe manner but without any compile-time knowledge - * of the type being read or written. - */ -template< - typename DELEGATE, - typename DELEGATE_TYPE> -class TDynamicData : Reference -{ - OMG_DDS_REF_TYPE_PROTECTED_DC( - TDynamicData, - Reference, - DELEGATE) - -public: - - TDynamicData( - const TDynamicType& type) - { - throw "Not implemented"; - } - - template - void value( - uint32_t mid, - const T& v) const - { - throw "Not implemented"; - } - - template - T value( - const std::string& mid, - const T& v) const - { - throw "Not implemented"; - } - - template - T value( - uint32_t mid) const - { - throw "Not implemented"; - } - - template - T value( - const std::string& mid) const - { - throw "Not implemented"; - } - - TDynamicType type() const - { - throw "Not implemented"; - } - - MemberType member_type( - uint32_t id) const - { - throw "Not implemented"; - } - - MemberType member_type( - const std::string& name) const - { - throw "Not implemented"; - } - - uint32_t member_id( - const std::string& name) const - { - throw "Not implemented"; - } - -}; - -typedef TDynamicData DynamicData; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_DYNAMIC_DATA_HPP_ diff --git a/include/dds/core/xtypes/DynamicType.hpp b/include/dds/core/xtypes/DynamicType.hpp deleted file mode 100644 index 8a90e572957..00000000000 --- a/include/dds/core/xtypes/DynamicType.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_DYNAMIC_TYPE_HPP_ -#define OMG_DDS_CORE_XTYPES_DYNAMIC_TYPE_HPP_ - -#include - -#include -#include - -namespace dds { -namespace core { -namespace xtypes { - -template -class TDynamicType : public Reference -{ - OMG_DDS_REF_TYPE_PROTECTED_DC( - TDynamicType, - Reference, - DELEGATE) - -public: - - const std::string& name() const - { - return impl()->name(); - } - - TypeKind kind() const - { - return impl()->kind(); - } - - const std::vector& annotations() const - { - return impl()->annotations(); - } - - bool operator ==( - const TDynamicType& that) const - { - return *(impl()) == *(that.impl()); - } - - bool operator !=( - const TDynamicType& that) const - { - return !(*this == that); - } - - bool is_primitive_type() - { - return (impl()->kind().underlying() & 0x4000 ) != 0; - } - - bool is_collection_type() - { - return (impl()->kind().underlying() & 0x0200 ) != 0; - } - - bool is_aggregation_type() - { - return (impl()->kind().underlying() & 0x0100 ) != 0; - } - - bool is_constructed_type() - { - return (impl()->kind().underlying() & 0x8000 ) != 0; - } - -protected: - - TDynamicType( - const std::string& name, - TypeKind kind) - { - impl()->name(name); - impl()->kind(kind); - } - - TDynamicType( - const std::string& name, - TypeKind kind, - const Annotation& annotation) - { - impl()->name(name); - impl()->kind(kind); - impl()->annotation(annotation); - } - - TDynamicType( - const std::string& name, - TypeKind kind, - const std::vector& annotations) - { - impl()->name(name); - impl()->kind(kind); - impl()->annotation(annotations); - } - - template - TDynamicType( - const std::string& name, - TypeKind kind, - const AnnotationIter& begin, - const AnnotationIter& end) - { - impl()->name(name); - impl()->kind(kind); - impl()->annotation(begin, end); - } - -public: - - TDynamicType( - const TDynamicType& other) = default; -}; - -template -bool is_primitive_type( - const TDynamicType& t) -{ - return t.is_primitive_type(); -} - -template -bool is_constructed_type( - const TDynamicType& t) -{ - return t.is_constructed_type(); -} - -template -bool is_collection_type( - const TDynamicType& t) -{ - return t.is_collection_type(); -} - -template -bool is_aggregation_type( - const TDynamicType& t) -{ - return t.is_aggregation_type(); -} - -typedef TDynamicType DynamicType; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_DYNAMIC_TYPE_HPP_ diff --git a/include/dds/core/xtypes/MemberType.hpp b/include/dds/core/xtypes/MemberType.hpp deleted file mode 100644 index 5b3815c4fda..00000000000 --- a/include/dds/core/xtypes/MemberType.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_MEMBER_TYPE_HPP -#define OMG_DDS_CORE_XTYPES_MEMBER_TYPE_HPP - -#include -#include - -#include -#include - - - -namespace dds { -namespace core { -namespace xtypes { - -template< - typename DELEGATE, - typename OTHER_DELEGATE> -class TMemberType : public Reference -{ - OMG_DDS_REF_TYPE_PROTECTED_DC( - TMemberType, - Reference, - DELEGATE) - -public: - - TMemberType( - const std::string& name, - const TDynamicType& type) - { - impl()->name(name); - impl()->dt(type); - } - - TMemberType( - const std::string& name, - const xtypes::DynamicType& type, - const Annotation& annotation) - { - impl()->name(name); - impl()->dt(type); - impl()->annotation(annotation); - } - - TMemberType( - const std::string& name, - const TDynamicType& type, - const std::vector& annotations) - { - impl()->name(name); - impl()->dt(type); - impl()->annotation(annotations); - } - - template - TMemberType( - const std::string& name, - const TDynamicType& type, - const AnnotationIter& begin, - const AnnotationIter& end) - { - impl()->name(name); - impl()->dt(type); - impl()->annotation(begin, end); - } - - const std::string& name() const - { - return impl()->name(); - } - - const TDynamicType& type() const - { - return impl()->dt(); - } - - TMemberType add_annotation( - const Annotation& annotation) - { - impl()->annotation(annotation); - return *this; - } - - TMemberType remove_annotation( - const Annotation& annotation) - { - impl().remove_annotation(annotation); - return *this; - } - - bool is_optional() const - { - return impl()->is_optional(); - } - - bool is_shared() const - { - return impl()->is_shared(); - } - - bool is_key() const - { - return impl()->is_key(); - } - - bool is_must_understand() const - { - return impl()->is_must_understand(); - } - - bool is_bitset() const - { - return impl()->is_bitset(); - } - - bool has_bitbound() const - { - return impl()->has_bitbound(); - } - - uint32_t get_bitbound() const - { - return impl()->get_bitbound(); - } - - bool has_id() const - { - return impl()->has_id(); - } - - uint32_t get_id() const - { - return impl()->get_bitbound(); - } - -}; - -typedef TMemberType MemberType; -typedef MemberType Member; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_MEMBER_TYPE_HPP diff --git a/include/dds/core/xtypes/PrimitiveTypes.hpp b/include/dds/core/xtypes/PrimitiveTypes.hpp deleted file mode 100644 index 5eeb634a2f9..00000000000 --- a/include/dds/core/xtypes/PrimitiveTypes.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_PRIMITIVE_TYPES_HPP_ -#define OMG_DDS_CORE_XTYPES_PRIMITIVE_TYPES_HPP_ - -#include -#include - -namespace dds { -namespace core { -namespace xtypes { - -template -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::NO_TYPE; - static constexpr const char* const NAME = "no_type"; -}; - -template< - typename T, - typename DELEGATE> -class TPrimitiveType : public TDynamicType -{ -public: - - TPrimitiveType() - : TDynamicType( - dynamic_type_traits::NAME, - dynamic_type_traits::TYPE_ID) - { - } - -}; - - -/** - * Primitive type constructor. This function can be used - * as follows: - * - * DynamicType int16Type = primitive_type(); - */ -template -TPrimitiveType primitive_type() -{ - throw "Not implemented"; -} - -} //namespace xtypes -} //namespace core -} //namespace dds - -// This include should be at the end since it provides -// template specializations. -#include - -#endif //OMG_DDS_CORE_XTYPES_PRIMITIVE_TYPES_HPP_ diff --git a/include/dds/core/xtypes/StructType.hpp b/include/dds/core/xtypes/StructType.hpp deleted file mode 100644 index da61706f918..00000000000 --- a/include/dds/core/xtypes/StructType.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_STRUCT_TYPE_HPP_ -#define OMG_DDS_CORE_XTYPES_STRUCT_TYPE_HPP_ - -#include - -#include -#include - -namespace dds { -namespace core { -namespace xtypes { - -template -class TStructForwardDeclaration : public TDynamicType -{ -public: - - TStructForwardDeclaration( - const std::string& name) - { - throw "Not implemented"; - } - -}; - -/** - * Create a dynamic structure type. If the members don't have Id associated - * explicitly, then their ID will be the same as the ordinal position on the - * members vector. - */ -template -class TStructType : public TDynamicType -{ - - TStructType& parent_ts_; - -public: - - explicit TStructType( - const std::string& name) - { - throw "Not implemented"; - } - - TStructType( - const std::string& name, - const std::vector& members) - { - TDynamicType::impl()->name(name); - } - - TStructType( - const std::string& name, - const TStructType& parent, - const std::vector& members) - { - TDynamicType::impl()->name(name); - parent_ts_ = parent; - TDynamicType::impl()->members(members); - } - - template - TStructType( - const std::string& name, - const TStructType& parent, - const MemberIter& begin, - const MemberIter& end) - { - TDynamicType::impl()->name(name); - parent_ts_ = parent; - TDynamicType::impl()->members(begin, end); - } - - TStructType( - const std::string& name, - const TStructType& parent, - const std::vector& members, - const Annotation& annotation) - { - TDynamicType::impl()->name(name); - parent_ts_ = parent; - TDynamicType::impl()->members(members); - TDynamicType::impl()->annotation(annotation); - } - - TStructType( - const std::string& name, - const TStructType& parent, - const std::vector& members, - const std::vector& annotations) - { - TDynamicType::impl()->name(name); - parent_ts_ = parent; - TDynamicType::impl()->members(members); - TDynamicType::impl()->annotations(annotations); - } - - template< - typename AnnotationIter, - typename MemberIter> - TStructType( - const std::string& name, - const TStructType& parent, - const MemberIter& member_begin, - const MemberIter& member_end, - const AnnotationIter& annotation_begin, - const AnnotationIter& annotation_end) - { - TDynamicType::impl()->name(name); - parent_ts_ = parent; - TDynamicType::impl()->members(member_begin, member_end); - TDynamicType::impl()->annotations(annotation_begin, annotation_end); - } - - template - operator TDynamicType() const - { - throw "Not implemented"; - } - - TStructType parent() const - { - return parent_ts_; - } - - const std::vector& members() const - { - return TDynamicType::impl()->members(); - } - - const MemberType& member( - uint32_t id) const - { - return TDynamicType::impl()->member(id); - } - - const MemberType& member( - const std::string& name) const - { - return TDynamicType::impl()->member(name); - } - - const std::vector& annotations() const - { - return TDynamicType::impl()->annotations(); - } - - TStructType add_member( - const MemberType& member) const - { - TDynamicType::impl()->member(member); - return *this; - } - - TStructType remove_member( - const MemberType& member) const - { - TDynamicType::impl()->remove_member(); - return *this; - } - - TStructType add_annotation( - const Annotation& annotation) const - { - TDynamicType::impl()->annotation(annotation); - return *this; - } - - TStructType remove_annotation( - const Annotation& annotation) const - { - TDynamicType::impl()->remove_annotation(annotation); - return *this; - } - -}; - -typedef TStructType StructType; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_STRUCT_TYPE_HPP_ diff --git a/include/dds/core/xtypes/TypeKind.hpp b/include/dds/core/xtypes/TypeKind.hpp deleted file mode 100644 index bea53d35bc4..00000000000 --- a/include/dds/core/xtypes/TypeKind.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_XTYPES_TYPE_KIND_HPP_ -#define OMG_DDS_XTYPES_TYPE_KIND_HPP_ - -#include -#include - -#include - -#if defined(OMG_DDS_X_TYPES_DYNAMIC_TYPE_SUPPORT) - -namespace dds { -namespace core { -namespace xtypes { - -enum class TypeKind -{ - NO_TYPE = 0, // sentinel indicating "null" value - PRIMITIVE_TYPE = 0x4000, - CONSTRUCTED_TYPE = 0x8000, - COLLECTION_TYPE = 0x0200, - AGGREGATION_TYPE = 0x0100, - ANNOTATION_TYPE = 0x0080, - - BOOLEAN_TYPE = PRIMITIVE_TYPE | 0x0001, - UINT_8_TYPE = PRIMITIVE_TYPE | 0x0002, - INT_16_TYPE = PRIMITIVE_TYPE | 0x0003, - UINT_16_TYPE = PRIMITIVE_TYPE | 0x0004, - INT_32_TYPE = PRIMITIVE_TYPE | 0x0005, - UINT_32_TYPE = PRIMITIVE_TYPE | 0x0006, - INT_64_TYPE = PRIMITIVE_TYPE | 0x0007, - UINT_64_TYPE = PRIMITIVE_TYPE | 0x0008, - FLOAT_32_TYPE = PRIMITIVE_TYPE | 0x0009, - FLOAT_64_TYPE = PRIMITIVE_TYPE | 0x000A, - FLOAT_128_TYPE = PRIMITIVE_TYPE | 0x000B, - CHAR_8_TYPE = PRIMITIVE_TYPE | 0x000C, - CHAR_32_TYPE = PRIMITIVE_TYPE | 0x000D, - - ENUMERATION_TYPE = CONSTRUCTED_TYPE | 0x0001, - BITSET_TYPE = CONSTRUCTED_TYPE | 0x0002, - ALIAS_TYPE = CONSTRUCTED_TYPE | 0x0003, - - ARRAY_TYPE = CONSTRUCTED_TYPE | COLLECTION_TYPE | 0x0004, - SEQUENCE_TYPE = CONSTRUCTED_TYPE | COLLECTION_TYPE | 0x0005, - STRING_TYPE = CONSTRUCTED_TYPE | COLLECTION_TYPE | 0x0006, - MAP_TYPE = CONSTRUCTED_TYPE | COLLECTION_TYPE | 0x0007, - - UNION_TYPE = CONSTRUCTED_TYPE | AGGREGATION_TYPE | 0x0008, - STRUCTURE_TYPE = CONSTRUCTED_TYPE | AGGREGATION_TYPE | 0x0009, - UNION_FWD_DECL_TYPE = CONSTRUCTED_TYPE | AGGREGATION_TYPE | 0x000A, - STRUCTURE_FWD_DECL_TYPE = CONSTRUCTED_TYPE | AGGREGATION_TYPE | 0x000B -}; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_X_TYPES_DYNAMIC_TYPE_SUPPORT - -#endif //OMG_DDS_XTYPES_TYPE_KIND_HPP_ - diff --git a/include/dds/core/xtypes/TypeProvider.hpp b/include/dds/core/xtypes/TypeProvider.hpp deleted file mode 100644 index 81542677af9..00000000000 --- a/include/dds/core/xtypes/TypeProvider.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_TYPE_PROVIDER_HPP_ -#define OMG_DDS_CORE_XTYPES_TYPE_PROVIDER_HPP_ - -#include - -#include - -namespace dds { -namespace core { -namespace xtypes { - -/** - * TypeProvider that allows creation of types from external representations. - */ -template -class TTypeProvider -{ -public: - - /** - * Load a type from the specified URI. If multiple types are defined - * only the first one is returned. - */ - static TDynamicType load_type( - const std::string& uri) - { - throw "Not implemented"; - } - - /** - * Load a type from the specified URI. If multiple types are defined - * only the first one is returned. - */ - static std::vector > load_types( - const std::string& uri) - { - throw "Not implemented"; - } - - /** - * Load a named type from the specified URI. - */ - static TDynamicType load_type( - const std::string& uri, - const std::string& name) - { - throw "Not implemented"; - } - -}; - -typedef TTypeProvider TypeProvider; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_TYPE_PROVIDER_HPP_ diff --git a/include/dds/core/xtypes/UnionCase.hpp b/include/dds/core/xtypes/UnionCase.hpp deleted file mode 100644 index 75d682041a6..00000000000 --- a/include/dds/core/xtypes/UnionCase.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_UNION_CASE_HPP_ -#define OMG_DDS_CORE_XTYPES_UNION_CASE_HPP_ - -#include -#include - -#include - -namespace dds { -namespace core { -namespace xtypes { - -template< - typename T, - template class DELEGATE> -class TUnionCase : public Reference< DELEGATE > -{ -public: - - TUnionCase() - { - } - - TUnionCase( - T discriminator, - const MemberType& member) - { - throw "Not implemented"; - } - - T discriminator() - { - throw "Not implemented"; - } - - const MemberType& member() - { - throw "Not implemented"; - } - -}; - -template -struct UnionCase : public TUnionCase {}; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_T_UNION_CASE_HPP_ diff --git a/include/dds/core/xtypes/UnionType.hpp b/include/dds/core/xtypes/UnionType.hpp deleted file mode 100644 index 88d1170914f..00000000000 --- a/include/dds/core/xtypes/UnionType.hpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_CORE_XTYPES_T_UNION_TYPE_HPP_ -#define OMG_DDS_CORE_XTYPES_T_UNION_TYPE_HPP_ - -#include - -#include -#include -#include - -#include - -namespace dds { -namespace core { -namespace xtypes { - -/** - * Declares a forward declaration for a union type. - */ -template -class TUnionForwardDeclaration : public TDynamicType -{ -public: - - TUnionForwardDeclaration( - const std::string& name) - { - throw "Not implemented"; - } - -}; - -template< - typename T, - template class DELEGATE> -class TUnionType : public TDynamicType > -{ -public: - - TUnionType( - const std::string& name, - const TPrimitiveType >& discriminator_type, - const std::vector >& cases) - { - throw "Not implemented"; - } - - TUnionType( - const std::string& name, - const TPrimitiveType >& discriminator_type, - const std::vector >& cases, - const Annotation& annotation) - { - throw "Not implemented"; - } - - TUnionType( - const std::string& name, - const TPrimitiveType >& discriminator_type, - const std::vector >& cases, - const std::vector& annotations) - { - throw "Not implemented"; - } - - const std::vector >& members() const - { - throw "Not implemented"; - } - - const MemberType& member( - uint32_t id) const - { - throw "Not implemented"; - } - - const MemberType& member( - const std::string& name) const - { - throw "Not implemented"; - } - - const std::vector& annotations() const - { - throw "Not implemented"; - } - - TUnionType add_member( - const UnionCase& member) const - { - throw "Not implemented"; - } - - TUnionType remove_member( - const UnionCase& member) const - { - throw "Not implemented"; - } - - TUnionType add_annotation( - const Annotation& annotation) const - { - throw "Not implemented"; - } - - TUnionType remove_annotation( - const Annotation& annotation) const - { - throw "Not implemented"; - } - -}; - -template -class UnionType : public TUnionType -{ -}; - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //OMG_DDS_CORE_XTYPES_T_STRUCT_TYPE_HPP_ diff --git a/include/dds/core/xtypes/detail/Annotation.hpp b/include/dds/core/xtypes/detail/Annotation.hpp deleted file mode 100644 index a7a4e0515b6..00000000000 --- a/include/dds/core/xtypes/detail/Annotation.hpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_ANNOTATION_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_ANNOTATION_HPP_ -#include -#include -#include - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class Annotation -{ -public: - - Annotation( - AnnotationKind ak) - : ak_(ak) - { - } - - const AnnotationKind& akind() - { - return ak_; - } - -private: - - AnnotationKind ak_; -}; - -class IdAnnotation : public Annotation -{ -public: - - IdAnnotation() - : Annotation(AnnotationKind::OPTIONAL_ANNOTATION_TYPE) - , id_() - { - } - - void id( - uint32_t id ) - { - id_ = id; - } - - uint32_t id() const noexcept - { - return id_; - } - - template class K> - operator K&() - { - return reinterpret_cast&>(*this); - } - - IdAnnotation( - Annotation& a) - : Annotation(AnnotationKind::ID_ANNOTATION_TYPE) - , id_(static_cast(a).id()) - { - } - -private: - - uint32_t id_; -}; - -class KeyAnnotation : public Annotation -{ -public: - - KeyAnnotation() - : Annotation(AnnotationKind::KEY_ANNOTATION_TYPE) - { - } - -}; - -class SharedAnnotation : public Annotation -{ -public: - - SharedAnnotation() - : Annotation(AnnotationKind::SHARED_ANNOTATION_TYPE) - { - } - -}; - -class NestedAnnotation : public Annotation -{ -public: - - NestedAnnotation() - : Annotation(AnnotationKind::NESTED_ANNOTATION_TYPE) - { - } - -}; - -class ExtensibilityAnnotation : public Annotation -{ -public: - - ExtensibilityAnnotation( - ExtensibilityKind xkind) - : Annotation(AnnotationKind::EXTENSIBILITY_ANNOTATION_TYPE) - , xk_(xkind) - { - } - - const ExtensibilityKind& xKind() const noexcept - { - return xk_; - } - - void xKind( - ExtensibilityKind xk) - { - xk_ = xk; - } - -private: - - ExtensibilityKind xk_; - -}; - -class MustUnderstandAnnotation : public Annotation -{ - MustUnderstandAnnotation() - : Annotation(AnnotationKind::MUST_UNDERSTAND_ANNOTATION_TYPE) - { - } - -}; - -class VerbatimAnnotation : public Annotation -{ -public: - - VerbatimAnnotation( - const std::string& vbt) - : Annotation(AnnotationKind::VERBATIM_ANNOTATION_TYPE) - , vbt_(vbt) - { - } - - void vbt( - const std::string& vbt) - { - vbt_ = vbt; - } - - const std::string& vbt() const noexcept - { - return vbt_; - } - -private: - - std::string vbt_; -}; - - -class BitsetAnnotation : public Annotation -{ - BitsetAnnotation() - : Annotation(AnnotationKind::BITSET_ANNOTATION_TYPE) - { - } - -}; - -class BitBoundAnnotation : public Annotation -{ - BitBoundAnnotation( - uint32_t bsb ) - : Annotation(AnnotationKind::BITSETBOUND_ANNOTATION_TYPE) - , bsb_(bsb) - { - } - - uint32_t bsb() const noexcept - { - return bsb_; - } - - void bsb( - uint32_t bsb) - { - bsb_ = bsb; - } - -private: - - uint32_t bsb_; -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_ANNOTATION_HPP_ diff --git a/include/dds/core/xtypes/detail/CollectionTypes.hpp b/include/dds/core/xtypes/detail/CollectionTypes.hpp deleted file mode 100644 index c7fa286a3fe..00000000000 --- a/include/dds/core/xtypes/detail/CollectionTypes.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_COLLECTION_TYPES_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_COLLECTION_TYPES_HPP_ - -#include - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class CollectionType : public DynamicType -{ -}; -class MapType : public CollectionType -{ -}; -class SequenceType : public CollectionType -{ -}; -class StringType : public CollectionType -{ -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_COLLECTION_TYPES_HPP_ - diff --git a/include/dds/core/xtypes/detail/DynamicData.hpp b/include/dds/core/xtypes/detail/DynamicData.hpp deleted file mode 100644 index accccbce86a..00000000000 --- a/include/dds/core/xtypes/detail/DynamicData.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMICDATA_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMICDATA_HPP_ - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class DynamicData -{ -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMICDATA_HPP_ diff --git a/include/dds/core/xtypes/detail/DynamicType.hpp b/include/dds/core/xtypes/detail/DynamicType.hpp deleted file mode 100644 index 13eca3b1024..00000000000 --- a/include/dds/core/xtypes/detail/DynamicType.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMIC_TYPE_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMIC_TYPE_HPP_ - -#include -#include -#include -#include - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class DynamicType -{ -public: - - const std::string& name() const noexcept - { - return name_; - } - - const TypeKind& kind() const noexcept - { - return kind_; - } - - void name( - const std::string& name) - { - name_ = name; - } - - void kind( - const TypeKind& kind) - { - kind_ = kind; - } - - void annotation( - xtypes::Annotation& a) - { - ann_.push_back(a); - } - - void annotation( - const std::vector& annotations) - { - ann_.reserve(annotations.size() + ann_.size()); - for (auto it = annotations.begin(); it != annotations.end(); ++it) - { - ann_.emplace_back(*it); - } - } - - template - void annotation( - AnnoIter begin, - AnnoIter end) - { - ann_.reserve(ann_.size() + ( end - begin) ); - for (auto it = begin; it != end; ++it) - { - ann_.emplace_back(*it); - } - } - - const std::vector& annotations() const - { - return ann_; - } - -private: - - std::string name_; - TypeKind kind_; - std::vector ann_; -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_DYNAMIC_TYPE_HPP_ diff --git a/include/dds/core/xtypes/detail/MemberType.hpp b/include/dds/core/xtypes/detail/MemberType.hpp deleted file mode 100644 index df02f4d6884..00000000000 --- a/include/dds/core/xtypes/detail/MemberType.hpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_MEMBER_TYPE_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_MEMBER_TYPE_HPP_ - -#include -#include - -#include -#include -#include - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class MemberType -{ -public: - - MemberType( - const std::string& name, - xtypes::DynamicType& dt) - : name_(name) -#if (0) - , dt_(dt.name(), dt.kind(), dt.annotations()) -#else - , dt_(dt) -#endif - , ann_() - { - } - - MemberType( - const std::string& name, - xtypes::DynamicType& dt, - xtypes::Annotation& a) - : name_(name) - , dt_(dt) - , ann_() - { - ann_.push_back(a); - } - - void name( - const std::string& name) - { - name_ = name; - } - - void dt( - const xtypes::DynamicType& dt) - { - dt_ = dt; - } - - void annotations( - std::vector& ann) - { - ann_.reserve(ann.size() + ann_.size()); - for (auto it = ann.begin(); it != ann.end(); ++it) - { - ann_.emplace_back(*it); - } - } - - template - void annotations( - AnnoIter begin, - AnnoIter end) - { - ann_.reserve(ann_.size() + ( end - begin) ); - for (auto it = begin; it != end; ++it) - { - ann_.emplace_back(*it); - } - } - - void annotation( - xtypes::Annotation& ann) - { - ann_.push_back(ann); - } - - const std::string& name() const noexcept - { - return name_; - } - - const xtypes::DynamicType& dynamic_type() const noexcept - { - return dt_; - } - - const std::vector& annotations() - { - return ann_; - } - - void remove_annotation( - const xtypes::Annotation& a) - { - auto rem = std::find_if( - ann_.begin(), - ann_.end(), - [&]( xtypes::Annotation& b) - { - return b.akind() == a.akind(); - } - ); - if ( rem != ann_.end() ) - { - ann_.erase(rem); - } - } - - bool annotation_iterator( - AnnotationKind& annotation_kind, - xtypes::Annotation& retAnn) - { - auto retVal = std::find_if( - ann_.begin(), - ann_.end(), - [&]( xtypes::Annotation& a) - { - return (a.akind() == annotation_kind); - } - ); - - if (retVal == ann_.end()) - { - return false; - } - retAnn = *retVal; - return true; - } - - bool find_annotation( - AnnotationKind& annotation_kind) - { - return ann_.end() != std::find_if( - ann_.begin(), - ann_.end(), - [&]( xtypes::Annotation& a) - { - return (a.akind() == annotation_kind); - } - ); - } - - bool is_optional() - { - AnnotationKind a = AnnotationKind_def::Type::OPTIONAL_ANNOTATION_TYPE; - return find_annotation(a); - } - - bool is_shared() - { - AnnotationKind a = AnnotationKind_def::Type::SHARED_ANNOTATION_TYPE; - return find_annotation(a); - } - - bool is_key() - { - AnnotationKind a = AnnotationKind_def::Type::KEY_ANNOTATION_TYPE; - return find_annotation(a); - } - - bool is_must_understand() - { - AnnotationKind a = AnnotationKind_def::Type::MUST_UNDERSTAND_ANNOTATION_TYPE; - return find_annotation(a); - } - - bool is_bitset() - { - AnnotationKind a = AnnotationKind_def::Type::BITSET_ANNOTATION_TYPE; - return find_annotation(a); - } - - bool has_bitbound() - { - AnnotationKind a = AnnotationKind_def::Type::BITSETBOUND_ANNOTATION_TYPE; - return find_annotation(a); - } - - /* - uint32_t get_bitbound() - { - if(false == has_bitbound()) - { - throw IllegalOperationError("No Bitsetbound Annotation found"); - } - AnnotationKind a = AnnotationKind_def::Type::BITSETBOUND_ANNOTATION_TYPE; - return annIt(a)->bound(); - } - */ - bool has_id() - { - AnnotationKind a = AnnotationKind_def::Type::ID_ANNOTATION_TYPE; - return find_annotation(a); - } - - uint32_t get_id() - { - AnnotationKind a = AnnotationKind_def::Type::ID_ANNOTATION_TYPE; - - // creting a generic IdAnnotation that will be filled by annotation_iterator() - xtypes::IdAnnotation ida(0); - if (not annotation_iterator(a, ida)) - { - throw IllegalOperationError("No Id Annotation found"); - } - return ida->id(); - } - -private: - - std::string name_; - xtypes::DynamicType dt_; - std::vector ann_; -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_MEMBER_TYPE_HPP_ diff --git a/include/dds/core/xtypes/detail/PrimitiveTypes.hpp b/include/dds/core/xtypes/detail/PrimitiveTypes.hpp deleted file mode 100644 index 6c2e225dd19..00000000000 --- a/include/dds/core/xtypes/detail/PrimitiveTypes.hpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_ - -#include - -// This template specialization have the intent to provide guidelines -// implementors of this specification. Notice that this define only a subset -// of primitive types, thus more work for you to do... - -namespace dds { -namespace core { -namespace xtypes { - -// Notice that const char* const is used instead of std::string -// to limit initialization issues with ctors. - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::BOOLEAN_TYPE; - static constexpr const char* NAME = "bool"; -}; - - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::UINT_8_TYPE; - static constexpr const char* NAME = "uint8_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::INT_16_TYPE; - static constexpr const char* NAME = "int16_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::UINT_16_TYPE; - static constexpr const char* NAME = "uint16_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::INT_32_TYPE; - static constexpr const char* NAME = "int32_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::UINT_32_TYPE; - static constexpr const char* NAME = "uint32_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::INT_64_TYPE; - static constexpr const char* NAME = "int64_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::UINT_64_TYPE; - static constexpr const char* NAME = "uint64_t"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::FLOAT_32_TYPE; - static constexpr const char* NAME = "float"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::FLOAT_64_TYPE; - static constexpr const char* NAME = "double"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::FLOAT_128_TYPE; - static constexpr const char* NAME = "longdouble"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::CHAR_8_TYPE; - static constexpr const char* NAME = "char"; -}; - -template<> -struct dynamic_type_traits -{ - static constexpr TypeKind TYPE_ID = TypeKind::CHAR_32_TYPE; - static constexpr const char* NAME = "char32_t"; -}; - - -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_ diff --git a/include/dds/core/xtypes/detail/StructType.hpp b/include/dds/core/xtypes/detail/StructType.hpp deleted file mode 100644 index a8682b1a526..00000000000 --- a/include/dds/core/xtypes/detail/StructType.hpp +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_STRUCT_TYPE_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_STRUCT_TYPE_HPP_ - -#include -#include - -#define COND_EXCEP_THROW(EXPR, CONT) if (EXPR){ \ - throw IllegalOperationError(CONT); \ -} - - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - - -class StructType -{ -public: - - StructType() - { - } - - void name( - const std::string& s) - { - name_ = s; - } - - void member( - const xtypes::MemberType& m) - { - members_.push_back(m); - } - - void members( - std::vector& v) - { - members_.reserve( v.size() + members_.size() ); - - for (auto it = v.begin(); v.end() != it; ++it) - { - members_.emplace_back(*it); - } - } - - template - void members( - MemberIter& begin, - MemberIter& end) - { - members_.reserve( (end - begin) + members_.size() ); - - for (auto it = begin; end != it; ++it) - { - members_.emplace_back(*it); - } - } - - void annotation( - xtypes::Annotation& a ) - { - annotations_.emplace_back(a); - } - - void annotations( - std::vector& v) - { - annotations_.reserve( v.size() + annotations_.size() ); - - for (auto it = v.begin(); v.end() != it; ++it) - { - annotations_.emplace_back(*it); - } - } - - template - void annotations( - AnnotationIter& begin, - AnnotationIter& end) - { - annotations_.reserve( (end - begin) + annotations_.size() ); - - for (auto it = begin; end != it; ++it) - { - annotations_.emplace_back(*it); - } - } - - const std::vector& members() const noexcept - { - return members_; - } - - const xtypes::MemberType& member( - uint32_t id) const - { - COND_EXCEP_THROW(id >= members_.size(), "no such member_id could be found"); - - return members_[id]; - } - - const xtypes::MemberType& member( - const std::string& s) const - { - auto retval = find_if( - members_.begin(), - members_.end(), - [&](const xtypes::MemberType& m) - { - return m.name() == s; - } - ); - - COND_EXCEP_THROW(retval == members_.end(), "member" + s + "not found"); - return *retval; - } - - const std::vector& annotations() - { - return annotations_; - } - - void remove_member( - const xtypes::MemberType& m) - { - auto rv = find_if( - members_.begin(), - members_.end(), - [&](xtypes::MemberType& t) - { - return t.name() == m.name(); - } - ); - - COND_EXCEP_THROW(rv == members_.end(), "could not find " + m.name() + " member"); - members_.erase(rv); - } - - void remove_annotation( - const xtypes::Annotation& a) - { - auto rv = find_if( - annotations_.begin(), - annotations_.end(), - [&]( xtypes::Annotation& aa) - { - return aa.akind() == a.akind(); - } - ); - - COND_EXCEP_THROW(rv == annotations_.end(), "could not find such annotation"); - annotations_.erase(rv); - } - -private: - - std::string name_; - std::vector members_; - std::vector annotations_; -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_STRUCT_TYPE_HPP_ diff --git a/include/dds/core/xtypes/detail/TypeProvider.hpp b/include/dds/core/xtypes/detail/TypeProvider.hpp deleted file mode 100644 index e818fde4c77..00000000000 --- a/include/dds/core/xtypes/detail/TypeProvider.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_TYPE_PROVIDER_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_TYPE_PROVIDER_HPP_ - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -class TypeProvider -{ -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_TYPE_PROVIDER_HPP_ diff --git a/include/dds/core/xtypes/detail/UnionCase.hpp b/include/dds/core/xtypes/detail/UnionCase.hpp deleted file mode 100644 index 3eb31999aff..00000000000 --- a/include/dds/core/xtypes/detail/UnionCase.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_UNION_CASE_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_UNION_CASE_HPP_ - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -template -class UnionCase -{ -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DELEGATE_UNION_CASE_HPP_ diff --git a/include/dds/core/xtypes/detail/UnionType.hpp b/include/dds/core/xtypes/detail/UnionType.hpp deleted file mode 100644 index cbf9400e0e2..00000000000 --- a/include/dds/core/xtypes/detail/UnionType.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_CORE_XTYPES_DETAIL_UNION_TYPE_HPP_ -#define EPROSIMA_DDS_CORE_XTYPES_DETAIL_UNION_TYPE_HPP_ - -namespace dds { -namespace core { -namespace xtypes { -namespace detail { - -template -class UnionType -{ -}; - -} //namespace detail -} //namespace xtypes -} //namespace core -} //namespace dds - -#endif //EPROSIMA_DDS_CORE_XTYPES_DETAIL_UNION_TYPE_HPP_ diff --git a/include/dds/domain/DomainParticipant.hpp b/include/dds/domain/DomainParticipant.hpp deleted file mode 100644 index 4bcbe58b218..00000000000 --- a/include/dds/domain/DomainParticipant.hpp +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_DOMAIN_DOMAINPARTICIPANT_HPP_ -#define OMG_DDS_DOMAIN_DOMAINPARTICIPANT_HPP_ - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -namespace dds { -namespace domain { - -class DomainParticipantListener; - -/** - * @brief - * A DomainParticipant represents the local membership of the application in a - * Domain. - * - * The DomainParticipant represents the participation of the application on - * a communication plane that isolates applications running on the same - * set of physical computers from each other. A domain establishes a virtual - * network linking all applications that share the same domainId and isolating - * them from applications running on different domains. In this way, several - * independent distributed applications can coexist in the same physical - * network without interfering, or even being aware of each other. - * - * @see @ref DCPS_Modules_DomainParticipant "Domain Participant" - */ -class DomainParticipant : public ::dds::core::TEntity -{ -public: - - /** - * Local representation of the dds::domain::DomainParticipantListener - */ - using Listener = DomainParticipantListener; - -public: - - OMG_DDS_REF_TYPE_PROTECTED_DC( - DomainParticipant, - dds::core::TEntity, - detail::DomainParticipant) - OMG_DDS_EXPLICIT_REF_BASE_DECL( - DomainParticipant, - dds::core::Entity) - - /** - * Creates a new DomainParticipant object. The DomainParticipant signifies - * that the calling application intends to join the Domain identified by - * the domain_id argument. - * - * The DomainParticipant will be created with the QoS values specified on the last - * successful call to - * @link dds::domain::DomainParticipant::default_participant_qos(const ::dds::domain::qos::DomainParticipantQos& qos) - * DomainParticipant::default_publisher_qos(qos) @endlink or, if the call was never - * made, the @ref anchor_dds_domain_domainparticipant_qos_defaults "default" values. - * - * @param id the id of the domain joined by the new DomainParticipant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DomainParticipant( - uint32_t id); - - /** - * Creates a new DomainParticipant object. The DomainParticipant signifies - * that the calling application intends to join the Domain identified by - * the domain_id argument. - * - * The DomainParticipant will be created with the DomainParticipantQos - * passed as an argument. - * - * @param id the id of the domain joined by the new DomainParticipant - * @param qos the QoS settings for the new DomainParticipant - * @param listener the listener - * @param event_mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DomainParticipant( - uint32_t id, - const dds::domain::qos::DomainParticipantQos& qos, - dds::domain::DomainParticipantListener* listener = NULL, - const dds::core::status::StatusMask& event_mask = dds::core::status::StatusMask::all()); - - /** @cond */ - virtual OMG_DDS_API ~DomainParticipant(); - /** @endcond */ - - /** - * Register a listener with the DomainParticipant. - * - * The notifications received by the listener depend on the - * status mask with which it was registered. - * - * Listener un-registration is performed by setting the listener to NULL. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @param listener the listener - * @param event_mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * A status was selected that cannot be supported because - * the infrastructure does not maintain the required connectivity information. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void listener( - Listener* listener, - const ::dds::core::status::StatusMask& event_mask); - - /** - * Get the listener of this DomainParticipant. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @return the listener - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - */ - OMG_DDS_API Listener* listener() const; - - /** - * Gets the DomainParticipantQos setting for this instance. - * - * @return the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const qos::DomainParticipantQos& qos() const; - - /** - * Sets the DomainParticipantQos setting for this instance. - * - * @param qos the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void qos( - const qos::DomainParticipantQos& qos); - - /** - * This operation retrieves the domain_id used to create the - * DomainParticipant. The domain_id identifies the DDS domain - * to which the DomainParticipant belongs. - * - * Each DDS domain represents a separate data communication - * plane isolated from other domains. - * - * @return the domain id - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API uint32_t domain_id() const; - - - /** - * This operation will manually assert the liveliness for the DomainParticipant. - * - * This way, the Data Distribution Service is informed that the DomainParticipant - * is still alive. This operation only needs to be used when the DomainParticipant - * contains DataWriters with the dds:core::policy::LivelinessQosPolicy::ManualByParticipant(), - * and it will only affect the liveliness of those DataWriters. - * - * Writing data via the write operation of a DataWriter will assert the liveliness on - * the DataWriter itself and its DomainParticipant. Therefore, - * assert_liveliness is only needed when not writing regularly. - * The liveliness should be asserted by the application, depending on the - * LivelinessQosPolicy. - * - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API void assert_liveliness(); - - - /** - * This operation checks whether or not the given handle represents - * an Entity that was created by using this DomainParticipant. - * - * The containment applies recursively. That is, it applies both to - * entities (TopicDescription, Publisher, or Subscriber) created directly - * using the DomainParticipant as well as entities created using a - * contained Publisher, or Subscriber as the factory, and so forth. - * - * @param handle the instance handle for which the containement - * relationship has to be checked - * @return true if the handle belongs to an Entity belonging - * to this DomainParticipant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API bool contains_entity( - const ::dds::core::InstanceHandle& handle); - - /** - * This operation returns the current value of the time that the service - * uses to time-stamp data writes and to set the reception timestamp - * for the data updates it receives. - * - * @return the current time - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API dds::core::Time current_time() const; - - /** @copydoc dds::domain::DomainParticipant::qos(const dds::domain::qos::DomainParticipantQos& qos) */ - OMG_DDS_API DomainParticipant& operator <<( - const qos::DomainParticipantQos& qos); - - /** @copydoc dds::domain::DomainParticipant::qos() */ - OMG_DDS_API const DomainParticipant& operator >>( - qos::DomainParticipantQos& qos) const; - - /** - * Gets the default DomainParticipantQos. - * - * This operation gets an object with the default global DomainParticipant - * QosPolicy settings which is used for newly - * created DomainParticipant objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::domain::DomainParticipant::default_participant_qos(const ::dds::domain::qos::DomainParticipantQos& qos), - * or, if the call was never made, the @ref anchor_dds_domain_domainparticipant_qos_defaults "default" values. - * - * @return the default DomainParticipantQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API static qos::DomainParticipantQos default_participant_qos(); - - /** - * Sets the default DomainParticipantQos. - * - * This QoS will be used by all following DomainParticipant creations when no - * QoS was given during those creations or the QoS is given that was returned - * by dds::domain::DomainParticipant::default_participant_qos(). - * - * @param qos the default DomainParticipantQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API static void default_participant_qos( - const ::dds::domain::qos::DomainParticipantQos& qos); - - /** - * Gets the default PublisherQos of the DomainParticipant. - * - * This operation gets an object with the default Publisher QosPolicy settings of - * the DomainParticipant (that is the PublisherQos) which is used for newly - * created Publisher objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::domain::DomainParticipant::default_publisher_qos(const ::dds::pub::qos::PublisherQos& qos), - * or, if the call was never made, the @ref anchor_dds_pub_publisher_qos_defaults "default" values. - * - * @return the default PublisherQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API dds::pub::qos::PublisherQos default_publisher_qos() const; - - /** - * Sets the default PublisherQos of the DomainParticipant. - * - * This operation sets the default PublisherQos of the DomainParticipant which - * is used for newly created Publisher objects, when no QoS is provided. - * - * The PublisherQos is always self consistent, because its policies do not depend on each - * other. This means that this operation never throws dds::core::InconsistentPolicyError. - * - * The values set by this operation are returned by dds::domain::DomainParticipant::default_publisher_qos(). - * - * @param qos the default PublisherQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * One or more of the selected QosPolicy values are - * currently not supported by OpenSplice. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DomainParticipant& default_publisher_qos( - const ::dds::pub::qos::PublisherQos& qos); - - /** - * Gets the default SubscriberQos of the DomainParticipant. - * - * This operation gets an object with the default Subscriber QosPolicy settings of - * the DomainParticipant (that is the SubscriberQos) which is used for newly - * created Subscriber objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::domain::DomainParticipant::default_subscriber_qos(const :dds::sub::qos::SubscriberQos& qos), - * or, if the call was never made, the @ref anchor_dds_sub_subscriber_qos_defaults "default" values. - * - * @return the default SubscriberQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API dds::sub::qos::SubscriberQos default_subscriber_qos() const; - - /** - * Sets the default SubscriberQos of the DomainParticipant. - * - * This operation sets the default SubscriberQos of the DomainParticipant which - * is used for newly created Subscriber objects, when no QoS is provided. - * - * The SubscriberQos is always self consistent, because its policies do not depend on each - * other. This means that this operation never throws dds::core::InconsistentPolicyError. - * - * The values set by this operation are returned by dds::domain::DomainParticipant::default_subscriber_qos(). - * - * @param qos the default SubscriberQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * One or more of the selected QosPolicy values are - * currently not supported by OpenSplice. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DomainParticipant& default_subscriber_qos( - const ::dds::sub::qos::SubscriberQos& qos); - - /** - * Gets the default TopicQos of the DomainParticipant. - * - * This operation gets an object with the default Topic QosPolicy settings of - * the DomainParticipant (that is the TopicQos) which is used for newly - * created Topic objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::domain::DomainParticipant::default_topic_qos(const dds::topic::qos::TopicQos& qos), - * or, if the call was never made, the @ref anchor_dds_topic_qos_defaults "default" values. - * - * @return the default TopicQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API dds::topic::qos::TopicQos default_topic_qos() const; - - /** - * Sets the default TopicQos of the DomainParticipant. - * - * This operation sets the default SubscriberQos of the DomainParticipant which - * is used for newly created Subscriber objects, when no QoS is provided. - * - * This operation checks if the TopicQos is self consistent. If it is not, the - * operation has no effect and throws dds::core::InconsistentPolicyError. - * - * The values set by this operation are returned by dds::domain::DomainParticipant::default_topic_qos(). - * - * @param qos the default TopicQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * One or more of the selected QosPolicy values are - * currently not supported by OpenSplice. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings, - * e.g. a history depth that is higher than the specified resource limits. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DomainParticipant& default_topic_qos( - const dds::topic::qos::TopicQos& qos); - - //============================================================================= -}; - -} //namespace domain -} //namespace dds - -#endif //OMG_DDS_DOMAIN_DOMAINPARTICIPANT_HPP_ diff --git a/include/dds/domain/DomainParticipantListener.hpp b/include/dds/domain/DomainParticipantListener.hpp deleted file mode 100644 index 2d3581082b0..00000000000 --- a/include/dds/domain/DomainParticipantListener.hpp +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_DOMAIN_DOMAINPARTICIPANT_LISTENER_HPP_ -#define OMG_DDS_DOMAIN_DOMAINPARTICIPANT_LISTENER_HPP_ - -// TODO Remove when PSM DDS Listeners are ready to be used. -#include - -// TODO uncomment when PSM DDS Listeners are ready to be used. -/* -#include -#include -#include -*/ - -namespace dds { -namespace domain { - -/** - * @brief - * DomainParticipant events Listener - * - * Since a DomainParticipant is an Entity, it has the ability to have a Listener - * associated with it. In this case, the associated Listener should be of type - * DomainParticipantListener. This interface must be implemented by the - * application. A user-defined class must be provided by the application which must - * extend from the DomainParticipantListener class. - * - * - * All operations for this interface must be implemented in the user-defined class, it is - * up to the application whether an operation is empty or contains some functionality. - * - * - * The DomainParticipantListener provides a generic mechanism (actually a - * callback function) for the Data Distribution Service to notify the application of - * relevant asynchronous status change events, such as a missed deadline, violation of - * a QosPolicy setting, etc. The DomainParticipantListener is related to - * changes in communication status StatusConditions. - * - * @code{.cpp} - * // Application example listener - * class ExampleListener : - * public virtual dds::domain::DomainParticipantListener - * { - * public: - * virtual void on_inconsistent_topic ( - * dds::topic::AnyTopic& topic, - * const dds::core::status::InconsistentTopicStatus& status) - * { - * std::cout << "on_inconsistent_topic" << std::endl; - * } - * - * virtual void on_offered_deadline_missed ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::OfferedDeadlineMissedStatus& status) - * { - * std::cout << "on_offered_deadline_missed" << std::endl; - * } - * - * virtual void on_offered_incompatible_qos ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::OfferedIncompatibleQosStatus& status) - * { - * std::cout << "on_offered_incompatible_qos" << std::endl; - * } - * - * virtual void on_liveliness_lost ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::LivelinessLostStatus& status) - * { - * std::cout << "on_liveliness_lost" << std::endl; - * } - * - * virtual void on_publication_matched ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::PublicationMatchedStatus& status) - * { - * std::cout << "on_publication_matched" << std::endl; - * } - * - * virtual void on_requested_deadline_missed ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::RequestedDeadlineMissedStatus & status) - * { - * std::cout << "on_requested_deadline_missed" << std::endl; - * } - * - * virtual void on_requested_incompatible_qos ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::RequestedIncompatibleQosStatus & status) - * { - * std::cout << "on_requested_incompatible_qos" << std::endl; - * } - * - * virtual void on_sample_rejected ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::SampleRejectedStatus & status) - * { - * std::cout << "on_sample_rejected" << std::endl; - * } - * - * virtual void on_liveliness_changed ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::LivelinessChangedStatus & status) - * { - * std::cout << "on_liveliness_changed" << std::endl; - * } - * - * virtual void on_data_available ( - * dds::sub::AnyDataReader& reader) - * { - * std::cout << "on_data_available" << std::endl; - * } - * - * virtual void on_subscription_matched ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::SubscriptionMatchedStatus & status) - * { - * std::cout << "on_subscription_matched" << std::endl; - * } - * - * virtual void on_sample_lost ( - * dds::sub::AnyDataReader& reader, - * const dds::core::status::SampleLostStatus & status) - * { - * std::cout << "on_sample_lost" << std::endl; - * } - * - * virtual void on_data_on_readers ( - * dds::sub::Subscriber& subs) - * { - * std::cout << "on_data_on_readers" << std::endl; - * } - * }; - * - * // Create DomainParticipant with the listener - * dds::domain::DomainParticipant participant(org::opensplice::domain::default_id(), - * dds::domain::DomainParticipant::default_participant_qos(), - * new ExampleListener(), - * dds::core::status::StatusMask::all()); - * - * @endcode - * - * @see @ref DCPS_Modules_DomainParticipant "Domain Participant" - * @see @ref DCPS_Modules_Infrastructure_Listener "Listener information" - */ - -// TODO Uncomment when PSM DDS listeners are ready to be used -/* -class OMG_DDS_API DomainParticipantListener : - public virtual dds::pub::PublisherListener, - public virtual dds::sub::SubscriberListener, - public virtual dds::topic::AnyTopicListener -{ -public: - - virtual ~DomainParticipantListener() - { - } - -}; -*/ -class DomainParticipantListener : public eprosima::fastdds::dds::DomainParticipantListener -{ -public: - - virtual ~DomainParticipantListener() - { - } - -}; - - -/** - * @brief - * DomainParticipant events Listener - * - * This listener is just like DomainParticipantListener, except - * that the application doesn't have to implement all operations. - * - * @code{.cpp} - * class ExampleListener : - * public virtual dds::domain::NoOpDomainParticipantListener - * { - * // Not necessary to implement any Listener operations. - * }; - * @endcode - * - * @see dds::domain::DomainParticipantListener - */ -// TODO Uncomment when PSM DDS listeners are ready to be used -/* -class OMG_DDS_API NoOpDomainParticipantListener : - public virtual DomainParticipantListener, - public virtual dds::pub::NoOpPublisherListener, - public virtual dds::sub::NoOpSubscriberListener, - public virtual dds::topic::NoOpAnyTopicListener -{ -public: - - virtual ~NoOpDomainParticipantListener() - { - } - -}; -*/ -class NoOpDomainParticipantListener : public eprosima::fastdds::dds::DomainParticipantListener -{ -public: - ~NoOpDomainParticipantListener() - { - } -}; - -} //namespace domain -} //namespace dds - -#endif //OMG_DDS_DOMAIN_DOMAINPARTICIPANT_LISTENER_HPP_ diff --git a/include/dds/domain/detail/DomainParticipant.hpp b/include/dds/domain/detail/DomainParticipant.hpp deleted file mode 100644 index 97f857f4be9..00000000000 --- a/include/dds/domain/detail/DomainParticipant.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_DOMAIN_DETAIL_DOMAINPARTICIPANT_HPP_ -#define EPROSIMA_DDS_DOMAIN_DETAIL_DOMAINPARTICIPANT_HPP_ - -#include - -namespace dds { -namespace domain { -namespace detail { - -using DomainParticipant = eprosima::fastdds::dds::DomainParticipant; - -} //namespace detail -} //namespace domain -} //namespace dds - - -#endif //EPROSIMA_DDS_DOMAIN_DETAIL_DOMAINPARTICIPANT_HPP_ diff --git a/include/dds/domain/qos/DomainParticipantQos.hpp b/include/dds/domain/qos/DomainParticipantQos.hpp deleted file mode 100644 index 6f7b111e2ee..00000000000 --- a/include/dds/domain/qos/DomainParticipantQos.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_DOMAIN_QOS_DOMAINPARTICIPANTQOS_HPP_ -#define OMG_DDS_DOMAIN_QOS_DOMAINPARTICIPANTQOS_HPP_ - -#include - -namespace dds { -namespace domain { -namespace qos { - -using DomainParticipantQos = dds::domain::qos::detail::DomainParticipantQos; - -} //namespace qos -} //namespace domain -} //namespace dds - -#endif //OMG_DDS_DOMAIN_QOS_DOMAINPARTICIPANTQOS_HPP_ diff --git a/include/dds/domain/qos/detail/DomainParticipantQos.hpp b/include/dds/domain/qos/detail/DomainParticipantQos.hpp deleted file mode 100644 index e3c5de2d0a2..00000000000 --- a/include/dds/domain/qos/detail/DomainParticipantQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_DOMAIN_QOS_DETAIL_DOMAINPARTICIPANTQOS_HPP_ -#define EPROSIMA_DDS_DOMAIN_QOS_DETAIL_DOMAINPARTICIPANTQOS_HPP_ - -#include - -namespace dds { -namespace domain { -namespace qos { -namespace detail { - -using DomainParticipantQos = eprosima::fastdds::dds::DomainParticipantQos; - -} //namespace detail -} //namespace qos -} //namespace domain -} //namespace dds - -#endif //EPROSIMA_DDS_DOMAIN_QOS_DETAIL_DOMAINPARTICIPANTQOS_HPP_ diff --git a/include/dds/pub/AnyDataWriter.hpp b/include/dds/pub/AnyDataWriter.hpp deleted file mode 100644 index 126c52ed5aa..00000000000 --- a/include/dds/pub/AnyDataWriter.hpp +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_PUB_ANY_DATA_WRITER_HPP_ -#define OMG_DDS_PUB_ANY_DATA_WRITER_HPP_ - -#include - -#include -#include - -#include -//#include - -namespace dds { -namespace pub { - -/** - * @brief - * Typeless base class for the typed DataWriter. - * - * DataWriters are created type specific (fi DataWriter writer). However, there - * are many places in the API (and possibly application) where the type can not be known - * while still some DataWriter has to be passed around, stored or even typeless functionality - * called.
- * Main examples in the API that need typeless DataWriter are: Publisher, PublisherListener - * and DomainParticipantListener. - * - */ -template -class TAnyDataWriter : public dds::core::TEntity -{ -public: - - OMG_DDS_REF_TYPE_PROTECTED_DC( - TAnyDataWriter, - dds::core::TEntity, - DELEGATE) - - OMG_DDS_IMPLICIT_REF_BASE( - TAnyDataWriter) - - /** @cond */ - virtual ~TAnyDataWriter(); - /** @endcond */ - - //========================================================================== - //== Entity Navigation - - /** - * Get the Publisher that owns this DataWriter. - * - * @return the Publisher - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API const Publisher& publisher() const; - - /** - * Get the TopicDescription associated with this DataWriter. - * - * @return the TopicDescription - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - // const dds::topic::TopicDescription& topic_description() const; - - - - //========================================================================== - //== QoS Management - - /** - * Gets the DataWriterQos setting for this instance. - * - * @return the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API qos::DataWriterQos qos() const; - - /** - * This operation replaces the existing set of QosPolicy settings for a DataWriter. - * - * The parameter qos contains the object with the QosPolicy settings which is - * checked for self-consistency and mutability. - * - * When the application tries to change a - * QosPolicy setting for an enabled DataWriter, which can only be set before the - * DataWriter is enabled, the operation will fail and a - * ImmutablePolicyError is thrown. In other words, the application must - * provide the presently set QosPolicy settings in case of the immutable QosPolicy - * settings. Only the mutable QosPolicy settings can be changed. - * - * When the qos contains conflicting QosPolicy settings (not self-consistent), - * the operation will fail and an InconsistentPolicyError is thrown. - * - * @param qos the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::ImmutablePolicyError - * The parameter qos contains an immutable QosPolicy setting with a - * different value than set during enabling of the DataWriter. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings, - */ - OMG_DDS_API void qos( - const qos::DataWriterQos& qos); - - /** @copydoc dds::pub::TAnyDataWriter::qos(const dds::pub::qos::DataWriterQos& qos) */ - OMG_DDS_API TAnyDataWriter& operator <<( - const qos::DataWriterQos& qos); - - /** @copydoc dds::pub::TAnyDataWriter::qos() */ - OMG_DDS_API const TAnyDataWriter& operator >>( - qos::DataWriterQos& qos) const; - - - //========================================================================== - //== ACKs - - /** - * This operation blocks the calling thread until either all data written - * by the DataWriter is acknowledged by the local infrastructure, or until - * the duration specified by the timeout parameter elapses, - * whichever happens first. - * - * Data is acknowledged by the local infrastructure when it does not need to be stored - * in its DataWriter’s local history. When a locally-connected subscription (including - * the networking service) has no more resources to store incoming samples it will start - * to reject these samples, resulting in their source DataWriters to store them - * temporarily in their own local history to be retransmitted at a later moment in time.
- * In such scenarios, the wait_for_acknowledgments operation will block until the - * DataWriter has retransmitted its entire history, which is therefore effectively - * empty, or until the timeout expires, whichever happens first. In the latter - * case, this operation will throw a TimeoutError. - * - * - * Be aware that in case the operation returns normally, the data has only been - * acknowledged by the local infrastructure: it does not mean all remote subscriptions - * have already received the data. However, delivering the data to remote nodes is then - * the sole responsibility of the networking service: even when the publishing - * application would terminate, all data that has not yet been received may be - * considered β€˜on-route’ and will therefore eventually arrive (unless the networking - * service itself will crash). In contrast, if a DataWriter would still have data in it’s - * local history buffer when it terminates, this data is considered β€˜lost’. - * - * - * This operation is intended to be used only if one or more of the contained - * DataWriters has its ReliabilityQosPolicyKind set to RELIABLE. - * Otherwise the operation will return immediately, since best-effort DataWriters will - * never store rejected samples in their local history: - * they will just drop them and continue business as usual. - * - * @param timeout the time out duration - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::TimeoutError - * Not all data is acknowledged before timeout elapsed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void wait_for_acknowledgments( - const dds::core::Duration& timeout); - - //========================================================================== - //== Status Management - - /** - * This operation obtains the LivelinessLostStatus object of the DataWriter. - * - * The LivelinessLostStatus contains the information whether the liveliness (that the - * DataWriter has committed through its Liveliness QosPolicy) was respected. - * This means that the status represents whether the DataWriter failed to actively - * signal its liveliness within the offered liveliness period. If the liveliness is lost, the - * DataReader objects will consider the DataWriter as no longer β€œalive”. - * - * The LivelinessLostStatus can also be monitored using a - * DataWriterListener or by using the associated StatusCondition. - * - * @return the LivelinessLostStatus - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const dds::core::status::LivelinessLostStatus liveliness_lost_status(); - - /** - * This operation obtains the OfferedDeadlineMissedStatus object of the DataWriter. - * - * The OfferedDeadlineMissedStatus contains the information whether the deadline (that the - * DataWriter has committed through its Deadline QosPolicy) was respected for - * each instance. - * - * The OfferedDeadlineMissedStatus can also be monitored using a - * DataWriterListener or by using the associated StatusCondition. - * - * @return the OfferedDeadlineMissedStatus - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const dds::core::status::OfferedDeadlineMissedStatus offered_deadline_missed_status(); - - /** - * This operation obtains the OfferedIncompatibleQosStatus object of the DataWriter. - * - * The OfferedIncompatibleQosStatus contains the information whether a QosPolicy setting - * was incompatible with the requested QosPolicy setting. - * - * This means that the status represents whether a DataReader object has been - * discovered by the DataWriter with the same Topic and a requested - * DataReaderQos that was incompatible with the one offered by the DataWriter. - * - * The OfferedIncompatibleQosStatus can also be monitored using a - * DataWriterListener or by using the associated StatusCondition. - * - * @return the OfferedIncompatibleQosStatus - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const dds::core::status::OfferedIncompatibleQosStatus offered_incompatible_qos_status(); - - /** - * This operation obtains the PublicationMatchedStatus object of the DataWriter. - * - * The PublicationMatchedStatus contains the information whether a new match has been - * discovered for the current publication, or whether an existing match has ceased to - * exist. - * - * This means that the status represents that either a DataReader object has been - * discovered by the DataWriter with the same Topic and a compatible Qos, or that a - * previously discovered DataReader has ceased to be matched to the current - * DataWriter. A DataReader may cease to match when it gets deleted, when it - * changes its Qos to a value that is incompatible with the current DataWriter or - * when either the DataWriter or the DataReader has chosen to put its matching - * counterpart on its ignore-list using the dds::sub::ignore or - * dds::pub::ignore operations. - * - * The operation may fail if the infrastructure does not hold the information necessary - * to fill in the PublicationMatchedStatus. This is the case when OpenSplice is - * configured not to maintain discovery information in the Networking Service. (See - * the description for the NetworkingService/Discovery/enabled property in - * the Deployment Manual for more information about this subject.) In this case the - * operation will throw UnsupportedError. - * - * The PublicationMatchedStatus can also be monitored using a - * DataWriterListener or by using the associated StatusCondition. - * - * @return the PublicationMatchedStatus - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::UnsupportedError - * OpenSplice is configured not to maintain the information - * about β€œassociated” subscriptions. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const dds::core::status::PublicationMatchedStatus publication_matched_status(); - - - //========================================================================== - //== Liveliness Management - - /** - * This operation asserts the liveliness for the DataWriter. - * - * This operation will manually assert the liveliness for the DataWriter. This way, - * the Data Distribution Service is informed that the corresponding DataWriter is - * still alive. This operation is used in combination with the Liveliness QosPolicy - * set to Liveliness::ManualByParticipant or Liveliness::ManualByTopic. - * - * Writing data via the write operation of a DataWriter will assert the liveliness on - * the DataWriter itself and its containing DomainParticipant. Therefore, - * assert_liveliness is only needed when not writing regularly. - * - * The liveliness should be asserted by the application, depending on the - * LivelinessQosPolicy. Asserting the liveliness for this DataWriter can also - * be achieved by asserting the liveliness to the DomainParticipant. - * - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The entity has not yet been enabled. - */ - OMG_DDS_API void assert_liveliness(); - -protected: - - const Publisher* publisher_; - -}; - -typedef ::dds::pub::detail::AnyDataWriter AnyDataWriter; - -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_PUB_ANY_DATA_WRITER_HPP_ diff --git a/include/dds/pub/DataWriter.hpp b/include/dds/pub/DataWriter.hpp deleted file mode 100644 index a28d6b2c2b2..00000000000 --- a/include/dds/pub/DataWriter.hpp +++ /dev/null @@ -1,1611 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_PUB_DATA_WRITER_HPP_ -#define OMG_DDS_PUB_DATA_WRITER_HPP_ - -#include -//#include -//#include -#include -#include - -#include - -/** @cond */ -namespace dds { -namespace pub { - -template -class DataWriter; - -template -class DataWriterListener; - -/** @endcond */ - -/** - * @brief - * DataWriter allows the application to set the value of the sample to be published - * under a given Topic. - * - * A DataWriter is attached to exactly one Publisher. - * - * A DataWriter is bound to exactly one Topic and therefore to exactly one data - * type. The Topic must exist prior to the DataWriter's creation. - * DataWriter is an abstract class. It must be specialized for each particular - * application data type. For a fictional application data type Bar (defined in the - * module Foo) the specialized class would be dds::pub::DataWriter. - * - * The pre-processor generates from IDL type descriptions the application - * DataWriter classes. For each application data type that is used as Topic - * data type, a typed class DataWriter is derived from the AnyDataWriter - * class. - * - * For instance, for an application, the definitions are located in the Foo.idl file. - * The pre-processor will generate a ccpp_Foo.h include file. - * - * General note: The name ccpp_Foo.h is derived from the IDL file Foo.idl, - * that defines Foo::Bar, for all relevant DataWriter operations. - * - * @note Apart from idl files, Google protocol buffers are also supported. For the - * API itself, it doesn't matter if the type header files were generated from - * idl or protocol buffers. The resulting API usage and includes remain the same. - * - * @code{.cpp} - * // Default creation of a DataWriter - * dds::domain::DomainParticipant participant(org::opensplice::domain::default_id()); - * dds::topic::Topic topic(participant, "TopicName"); - * dds::pub::Publisher publisher(participant); - * dds::pub::DataWriter writer(publisher, topic); - * - * // Default write of a sample on the DataWriter - * Foo::Bar sample; - * writer.write(sample); - * @endcode - * - * @see @ref DCPS_Modules_Publication "Publication concept" - * @see @ref DCPS_Modules_Publication_DataWriter "DataWriter concept" - */ -template -class DataWriter : public TAnyDataWriter -{ -public: - - /** - * Local convenience typedef for dds::pub::DataWriterListener. - */ - using Listener = DataWriterListener; - - OMG_DDS_REF_TYPE_PROTECTED_DC( - DataWriter, - dds::pub::TAnyDataWriter, - detail::DataWriter) - - OMG_DDS_IMPLICIT_REF_BASE( - DataWriter) - - /** - * Create a new DataWriter for the desired Topic, using the given Publisher. - * - * The DataWriter will be created with the QoS values specified on the last - * successful call to @link dds::pub::Publisher::default_datawriter_qos(const dds::pub::qos::DataWriterQos& qos) - * pub.default_datawriter_qos(qos) @endlink or, if the call was never made, the - * @ref anchor_dds_pub_datawriter_qos_defaults "default" values. - * - * Implicit Publisher
- * It is expected to provide a Publisher when creating a DataWriter. However, it is - * allowed to provide dds::core::null. When dds::core::null is provided, then an implicit - * Publisher is created with a default QoS and the DomainParticipant from the provided - * Topic. - * - * @param pub the Publisher that will contain this DataWriter - * (or dds::core::null for an implicit publisher) - * @param topic the Topic associated with this DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - // DataWriter( - // const Publisher& pub, - // const ::dds::topic::Topic& topic); - - /** - * Create a new DataWriter for the desired Topic, using the given Publisher and - * DataWriterQos and attaches the optionally specified DataWriterListener to it. - * - * QoS
- * A possible application pattern to construct the DataWriterQos for the - * DataWriter is to: - * @code{.cpp} - * // 1) Retrieve the QosPolicy settings on the associated Topic - * dds::topic::qos::TopicQos topicQos = topic.qos(); - * // 2) Retrieve the default DataWriterQos from the related Publisher - * dds::pub::qos::DataWriterQos writerQos = publisher.default_datawriter_qos(); - * // 3) Combine those two lists of QosPolicy settings by overwriting DataWriterQos - * // policies that are also present TopicQos - * writerQos = topicQos; - * // 4) Selectively modify QosPolicy settings as desired. - * writerQos << dds::core::policy::WriterDataLifecycle::ManuallyDisposeUnregisteredInstances(); - * // 5) Use the resulting QoS to construct the DataWriter. - * dds::pub::DataWriter writer(publisher, topic, writerQos); - * @endcode - * - * Restictions on QoS policies - * For a coherent writer there exists a constraint on the setting of the History QoS policy. - * When a writer is created with publisher that has a presentation QosPolicy with - * coherent_access enabled and where the access_scope is either TOPIC or GROUP - * then the History QoS policy of the coherent writer should be set to KEEP_ALL. - * Applying this constraint is necessary because in case of a keep-last writer the - * samples in the writers history could be pushed out by a new sample which causes that - * the transaction would not become complete. - * - * Implicit Publisher
- * It is expected to provide a Publisher when creating a DataWriter. However, it is - * allowed to provide dds::core::null. When dds::core::null is provided, then an implicit - * Publisher is created with a default QoS and the DomainParticipant from the provided - * Topic. - * - * Listener
- * The following statuses are applicable to the DataWriterListener: - * - dds::core::status::StatusMask::offered_deadline_missed() - * - dds::core::status::StatusMask::offered_incompatible_qos() - * - dds::core::status::StatusMask::liveliness_lost() - * - dds::core::status::StatusMask::publication_matched() - * - * See @ref DCPS_Modules_Infrastructure_Listener "listener concept", - * @ref anchor_dds_pub_datawriter_commstatus "communication status" and - * @ref anchor_dds_pub_datawriter_commpropagation "communication propagation" - * for more information. - * - * @param pub the Publisher that will contain this DataWriter - * (or dds::core::null for an implicit publisher) - * @param topic the Topic associated with this DataWriter - * @param qos the DataWriter qos. - * @param listener the DataWriter listener. - * @param mask the listener event mask. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings. - * @throws dds::core::PreconditionNotMetError - * The History QosPolicy is not KEEP_ALL when applied to a coherent writer. - */ - // DataWriter( - // const Publisher& pub, - // const ::dds::topic::Topic& topic, - // const qos::DataWriterQos& qos, - // DataWriterListener* listener = nullptr, - // const dds::core::status::StatusMask& mask = ::dds::core::status::StatusMask::all()); - - /** @cond */ - virtual ~DataWriter(); - /** @endcond */ - - //========================================================================== - //== Write API - - /** - * This operation modifies the value of a data instance. - * - * Detailed Description
- * This operation modifies the value of a data instance. When this operation is used, - * the Data Distribution Service will automatically supply the value of the - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * @anchor anchor_dds_pub_datawriter_write_blocking - * Blocking
- * If the dds::core::policy::History QosPolicy is set to KEEP_ALL, the write - * operation on the DataWriter may block if the modification would cause data to be - * lost because one of the limits, specified in the dds::core::policy::ResourceLimits, is - * exceeded. In case the synchronous attribute value of the - * dds::core::policy::Reliability is set to TRUE for communicating DataWriters and - * DataReaders then the DataWriter will wait until all synchronous - * DataReaders have acknowledged the data. Under these circumstances, the - * max_blocking_time attribute of the dds::core::policy::Reliability configures the - * maximum time the write operation may block (either waiting for space to become - * available or data to be acknowledged). If max_blocking_time elapses before the - * DataWriter is able to store the modification without exceeding the limits and all - * expected acknowledgements are received, the write operation will fail and throw - * TimeoutError. - * - * @param sample the sample to be written - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API void write( - const T& sample); - - /** - * This operation modifies the value of a data instance and provides a value for the - * source_timestamp explicitly. - * - * Detailed Description
- * It modifies the values of the given data instances. When this operation is used, - * the application provides the value for the parameter source_timestamp that is made - * available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param sample the sample to be written - * @param timestamp the timestamp used for this sample - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API void write( - const T& sample, - const dds::core::Time& timestamp); - - /** - * This operation modifies the value of a data instance. - * - * Detailed Description
- * This operation modifies the value of a data instance. When this operation is used, - * the Data Distribution Service will automatically supply the value of the - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Before writing data to an instance, the instance may be registered with the - * @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"" - * The handle returned by one of the register_instance operations can be supplied to - * the parameter handle of the write operation. However, it is also possible to - * supply a default InstanceHandle (InstanceHandle.is_nil() == true), which means - * that the identity of the instance is automatically deduced from the instance_data - * (identified by the key). - * - * @anchor anchor_dds_pub_datawriter_write_instance_handle - * Instance Handle
- * The default InstanceHandle (InstanceHandle.is_nil() == true) can be used for the - * parameter handle. This indicates the identity of the instance is automatically deduced - * from the instance_data (by means of the key). - * - * If handle is not nil, it must correspond to the value returned by - * @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"" - * when the instance (identified by its key) was registered. Passing such a registered - * handle helps the Data Distribution Service to process the sample more efficiently.
- * If there is no correspondence between handle and sample, the result of the operation - * is unspecified. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param sample the sample to be written - * @param instance the handle representing the instance written - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API void write( - const T& sample, - const ::dds::core::InstanceHandle& instance); - - /** - * This operation modifies the value of a data instance and provides a value for the - * source_timestamp explicitly. - * - * Detailed Description
- * It modifies the values of the given data instances. When this operation is used, - * the application provides the value for the parameter source_timestamp that is made - * available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Instance Handle
- * See @ref anchor_dds_pub_datawriter_write_instance_handle "write instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param sample the sample to be written - * @param instance the handle representing the instance written - * @param timestamp the timestamp to use for this sample - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API void write( - const T& data, - const ::dds::core::InstanceHandle& instance, - const dds::core::Time& timestamp); - - - /** - * This operation modifies the value of a data instance. - * - * Detailed Description
- * This operation modifies the value of a data instance. When this operation is used, - * the Data Distribution Service will automatically supply the value of the - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Topic Instance
- * A TopicInstance encapsulates a sample and its associated - * @ref anchor_dds_pub_datawriter_write_instance_handle "instance handle". - * - * - * @param i the instance to write - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - // void write( - // const dds::topic::TopicInstance& i); - - /** - * This operation modifies the value of a data instance and provides a value for the - * source_timestamp explicitly. - * - * Detailed Description
- * It modifies the values of the given data instances. When this operation is used, - * the application provides the value for the parameter source_timestamp that is made - * available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Topic Instance
- * A TopicInstance encapsulates a sample and its associated - * @ref anchor_dds_pub_datawriter_write_instance_handle "instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param i the instance to write - * @param timestamp the timestamp for this sample - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - // void write( - // const dds::topic::TopicInstance& i, - // const dds::core::Time& timestamp); - - /** - * This operation writes a series of typed Samples or TopicInstances. - * - * Detailed Description
- * This operation takes a sequence of typed Samples or TopicInstances, which - * is determined by the template specialization. - * - * It modifies the values of the given data instances. When this operation is used, - * the Data Distribution Service will automatically supply the value of the - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Topic Instance
- * A TopicInstance encapsulates a typed Sample and its associated - * @ref anchor_dds_pub_datawriter_write_instance_handle "instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param begin An iterator pointing to the beginning of a sequence of - * Samples or a sequence of TopicInstances - * @param end An iterator pointing to the end of a sequence of - * Samples or a sequence of TopicInstances - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - template - OMG_DDS_API void write( - const FWIterator& begin, - const FWIterator& end); - - /** - * This operation writes a series of typed Samples or TopicInstances and provides - * a value for the source_timestamp for these samples explicitly. - * - * Detailed Description
- * This operation takes a sequence of typed Samples or TopicInstances, which - * is determined by the template specialization. - * - * It modifies the values of the given data instances. When this operation is used, - * the application provides the value for the parameter source_timestamp that is made - * available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Topic Instance
- * A TopicInstance encapsulates a sample and its associated - * @ref anchor_dds_pub_datawriter_write_instance_handle "instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param begin an iterator pointing to the beginning of a sequence of - * TopicInstances - * @param end an iterator pointing to the end of a sequence of - * TopicInstances - * @param timestamp the time stamp - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - template - OMG_DDS_API void write( - const FWIterator& begin, - const FWIterator& end, - const dds::core::Time& timestamp); - - /** - * This operation writes a series of typed Samples and their parallel instance handles. - * - * Detailed Description
- * It modifies the values of the given data instances. When this operation is used, - * the Data Distribution Service will automatically supply the value of the - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Instance Handle
- * See @ref anchor_dds_pub_datawriter_write_instance_handle "write instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param data_begin an iterator pointing to the beginning of a sequence of samples - * @param data_end an iterator pointing to the end of a sequence of samples - * @param handle_begin an iterator pointing to the beginning of a sequence of InstanceHandles - * @param handle_end an iterator pointing to the end of a sequence of InstanceHandles - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - template< - typename SamplesFWIterator, - typename HandlesFWIterator> - OMG_DDS_API void write( - const SamplesFWIterator& data_begin, - const SamplesFWIterator& data_end, - const HandlesFWIterator& handle_begin, - const HandlesFWIterator& handle_end); - - /** - * This operation writes a series of typed Samples or TopicInstances and provides - * a value for the source_timestamp for these samples explicitly. - * - * Detailed Description
- * It modifies the values of the given data instances. When this operation is used, - * the application provides the value for the parameter source_timestamp that is made - * available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Instance Handle
- * See @ref anchor_dds_pub_datawriter_write_instance_handle "write instance handle". - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_write_blocking "write blocking"). - * - * @param data_begin an iterator pointing to the beginning of a sequence of samples - * @param data_end an iterator pointing to the end of a sequence of samples - * @param handle_begin an iterator pointing to the beginning of a sequence of InstanceHandles - * @param handle_end an iterator pointing to the end of a sequence of InstanceHandles - * @param timestamp the time stamp - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - template< - typename SamplesFWIterator, - typename HandlesFWIterator> - OMG_DDS_API void write( - const SamplesFWIterator& data_begin, - const SamplesFWIterator& data_end, - const HandlesFWIterator& handle_begin, - const HandlesFWIterator& handle_end, - const dds::core::Time& timestamp); - - - /** @copydoc dds::pub::DataWriter::write(const T& data) */ - OMG_DDS_API DataWriter& operator <<( - const T& data); - - /** @copydoc dds::pub::DataWriter::write(const T& sample, const dds::core::Time& timestamp) */ - OMG_DDS_API DataWriter& operator <<( - const std::pair& data); - - /** @copydoc dds::pub::DataWriter::write(const T& sample, const ::dds::core::InstanceHandle& instance) */ - OMG_DDS_API DataWriter& operator <<( - const std::pair& data); - - /** @cond - * This can be useful for the DataReader (see fi MaxSamplesManipulatorFunctor), but not - * really for the DataWriter. Leave it from the API documentation for clarity. - */ - OMG_DDS_API DataWriter& operator <<( - DataWriter& (*manipulator)(DataWriter&)); - /** @endcond */ - - //========================================================================== - //== Instance Management - - /** - * This operation informs the Data Distribution Service that the application will be - * modifying a particular instance. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will be - * modifying a particular instance. This operation may be invoked prior to calling any - * operation that modifies the instance, such as write, unregister_instance or - * dispose_instance.
- * When the application does register the instance before modifying, the Data - * Distribution Service will handle the instance more efficiently. It takes as a parameter - * (instance_data) an instance (to get the key value) and returns a handle that can - * be used in successive DataWriter operations. In case of an error, a HANDLE_NIL - * handle (InstanceHandle.is_nil() == true) is returned. - * - * The explicit use of this operation is optional as the application can directly call the - * write, unregister_instance or dispose_instance operations without InstanceHandle, - * which indicate that the sample should be examined to identify the instance. - * - * When this operation is used, the Data Distribution Service will automatically supply - * the value of the source_timestamp that is made available to connected - * DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * @anchor anchor_dds_pub_datawriter_register_blocking - * Blocking
- * If the dds::core::policy::History QosPolicy is set to KEEP_ALL, the register_instance - * operation on the DataWriter may block if the modification would cause data to be - * lost because one of the limits, specified in the dds::core::policy::ResourceLimits, is - * exceeded. In case the synchronous attribute value of the - * dds::core::policy::Reliability is set to TRUE for communicating DataWriters and - * DataReaders then the DataWriter will wait until all synchronous - * DataReaders have acknowledged the data. Under these circumstances, the - * max_blocking_time attribute of the dds::core::policy::Reliability configures the - * maximum time the register operation may block (either waiting for space to become - * available or data to be acknowledged). If max_blocking_time elapses before the - * DataWriter is able to store the modification without exceeding the limits and all - * expected acknowledgements are received, the register_instance operation will fail - * will return a nil InstanceHandle. - * - * Multiple Calls
- * If this operation is called for an already registered instance, it just returns the already - * allocated instance handle. This may be used to look up and retrieve the handle - * allocated to a given instance. - * - * Key
- * The key is a typed Sample of which the key fields are set so that the instance - * can be identified. - * - * @param key the key of the instance to register - * @return the instance handle - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - */ - OMG_DDS_API const ::dds::core::InstanceHandle register_instance( - const T& key); - - /** - * This operation will inform the Data Distribution Service that the application will be - * modifying a particular instance and provides a value for the source_timestamp - * explicitly. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will be - * modifying a particular instance. This operation may be invoked prior to calling any - * operation that modifies the instance, such as write, unregister_instance or - * dispose_instance.
- * When the application does register the instance before modifying, the Data - * Distribution Service will handle the instance more efficiently. It takes as a parameter - * (instance_data) an instance (to get the key value) and returns a handle that can - * be used in successive DataWriter operations. In case of an error, a HANDLE_NIL - * handle (InstanceHandle.is_nil() == true) is returned. - * - * The explicit use of this operation is optional as the application can directly call the - * write, unregister_instance or dispose_instance operations without InstanceHandle, - * which indicate that the sample should be examined to identify the instance. - * - * When this operation is used, the application provides the value for the parameter - * source_timestamp that is made available to connected DataReader objects.
- * This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_register_blocking "register blocking"). - * - * Multiple Calls
- * If this operation is called for an already registered instance, it just returns the already - * allocated instance handle. The source_timestamp is ignored in that case. - * - * Key
- * The key is a typed Sample of which the key fields are set so that the instance - * can be identified. - * - * @param key the key of the instance to register - * @param timestamp the timestamp used for registration - * @return the instance handle - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - */ - OMG_DDS_API const ::dds::core::InstanceHandle register_instance( - const T& key, - const dds::core::Time& timestamp); - - /** - * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. Therefore, this operation reverses the - * action of @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"". - * register_instance or register_instance_w_timestamp.
- * It should only be called on an instance that is currently registered. This operation - * should be called just once per instance, regardless of how many times - * @ref dds::pub::DataWriter::register_instance(const T& key) "register_instance" was called - * for that instance.
- * This operation also indicates - * that the Data Distribution Service can locally remove all information regarding that - * instance. The application should not attempt to use the handle, previously - * allocated to that instance, after calling this operation. - * - * When this operation is used, the Data Distribution Service will automatically supply - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * @anchor anchor_dds_pub_datawriter_unregister_effects - * Effects
- * If, after unregistering, the application wants to modify (write or dispose) the - * instance, it has to register the instance again, or it has to use the default - * instance handle (InstanceHandle.is_nil() == true). - * This operation does not indicate that the instance should be deleted (that is the - * purpose of the @ref dds::pub::DataWriter::dispose_instance(const T& key) "dispose". - * This operation just indicates that the DataWriter no longer - * has β€œanything to say” about the instance. If there is no other DataWriter that - * has registered the instance as well, then the dds::sub::status::InstanceState in all - * connected DataReaders will be changed to not_alive_no_writers, provided this - * InstanceState was not already set to not_alive_disposed. In the last case the - * InstanceState will not be effected by the unregister_instance call, - * see also @ref DCPS_Modules_Subscription_SampleInfo "Sample info concept". - * - * This operation can affect the ownership of the data instance. If the - * DataWriter was the exclusive owner of the instance, calling this operation will - * release that ownership, meaning ownership may be transferred to another, - * possibly lower strength, DataWriter. - * - * The operation must be called only on registered instances. Otherwise the operation - * trow PreconditionNotMetError. - * - * @anchor anchor_dds_pub_datawriter_unregister_blocking - * Blocking
- * If the dds::core::policy::History QosPolicy is set to KEEP_ALL, the unregister_instance - * operation on the DataWriter may block if the modification would cause data to be - * lost because one of the limits, specified in the dds::core::policy::ResourceLimits, is - * exceeded. In case the synchronous attribute value of the - * dds::core::policy::Reliability is set to TRUE for communicating DataWriters and - * DataReaders then the DataWriter will wait until all synchronous - * DataReaders have acknowledged the data. Under these circumstances, the - * max_blocking_time attribute of the dds::core::policy::Reliability configures the - * maximum time the unregister operation may block (either waiting for space to become - * available or data to be acknowledged). If max_blocking_time elapses before the - * DataWriter is able to store the modification without exceeding the limits and all - * expected acknowledgements are received, the unregister_instance operation will fail - * and throw TimeoutError. - * - * @param i the instance to unregister - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& unregister_instance( - const ::dds::core::InstanceHandle& i); - - /** - * This operation will inform the Data Distribution Service that the application will not - * be modifying a particular instance any more and provides a value for the - * source_timestamp explicitly. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. Therefore, this operation reverses the - * action of @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"". - * register_instance or register_instance_w_timestamp.
- * It should only be called on an instance that is currently registered. This operation - * should be called just once per instance, regardless of how many times - * @ref dds::pub::DataWriter::register_instance(const T& key) "register_instance" was called - * for that instance.
- * This operation also indicates - * that the Data Distribution Service can locally remove all information regarding that - * instance. The application should not attempt to use the handle, previously - * allocated to that instance, after calling this operation. - * - * When this operation is used, the application itself supplied - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * Effects
- * See @ref anchor_dds_pub_datawriter_unregister_effects "here" for the unregister effects. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_unregister_blocking "unregister blocking"). - * - * @param i the instance to unregister - * @param timestamp the timestamp - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& unregister_instance( - const ::dds::core::InstanceHandle& i, - const dds::core::Time& timestamp); - - /** - * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. Therefore, this operation reverses the - * action of @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"". - * register_instance or register_instance_w_timestamp.
- * It should only be called on an instance that is currently registered. This operation - * should be called just once per instance, regardless of how many times - * @ref dds::pub::DataWriter::register_instance(const T& key) "register_instance" was called - * for that instance.
- * This operation also indicates - * that the Data Distribution Service can locally remove all information regarding that - * instance. The application should not attempt to use the handle, previously - * allocated to that instance, after calling this operation. - * - * When this operation is used, the Data Distribution Service will automatically supply - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * Effects
- * See @ref anchor_dds_pub_datawriter_unregister_effects "here" for the unregister effects. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_unregister_blocking "unregister blocking"). - * - * Instance
- * The instance is identified by the key fields of the given typed data sample, instead - * of an InstanceHandle. - * - * @param key sample of the instance to dispose - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& unregister_instance( - const T& key); - - /** - * This operation will inform the Data Distribution Service that the application will not - * be modifying a particular instance any more and provides a value for the - * source_timestamp explicitly. - * - * Detailed Description
- * This operation informs the Data Distribution Service that the application will not be - * modifying a particular instance any more. Therefore, this operation reverses the - * action of @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"". - * register_instance or register_instance_w_timestamp.
- * It should only be called on an instance that is currently registered. This operation - * should be called just once per instance, regardless of how many times - * @ref dds::pub::DataWriter::register_instance(const T& key) "register_instance" was called - * for that instance.
- * This operation also indicates - * that the Data Distribution Service can locally remove all information regarding that - * instance. The application should not attempt to use the handle, previously - * allocated to that instance, after calling this operation. - * - * When this operation is used, the application itself supplied - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * Effects
- * See @ref anchor_dds_pub_datawriter_unregister_effects "here" for the unregister effects. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_unregister_blocking "unregister blocking"). - * - * Instance
- * The instance is identified by the key fields of the given typed data sample, instead - * of an InstanceHandle. - * - * @param key sample of the instance to dispose - * @param timestamp the timestamp - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& unregister_instance( - const T& key, - const dds::core::Time& timestamp); - - /** - * This operation requests the Data Distribution Service to mark the instance for - * deletion. - * - * Detailed Description
- * This operation requests the Data Distribution Service to mark the instance for - * deletion. Copies of the instance and its corresponding samples, which are stored in - * every connected DataReader and, dependent on the QosPolicy settings, also in - * the Transient and Persistent stores, will be marked for deletion by setting their - * dds::sub::status::InstanceState to not_alive_disposed state. - * - * When this operation is used, the Data Distribution Service will automatically supply - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * @anchor anchor_dds_pub_datawriter_dispose_effect_readers - * Effects on DataReaders
- * Actual deletion of the instance administration in a connected DataReader will be - * postponed until the following conditions have been met: - * - the instance must be unregistered (either implicitly or explicitly) by all connected - * DataWriters that have previously registered it. - * - A DataWriter can register an instance explicitly by using the special - * register_instance operations. - * - A DataWriter can register an instance implicitly by using no or the default (nil) - * InstanceHandle in any of the other DataWriter operations. - * - A DataWriter can unregister an instance explicitly by using one of the special - * unregister_instance operations. - * - A DataWriter will unregister all its contained instances implicitly when it is - * deleted. - * - When a DataReader detects a loss of liveliness in one of its connected - * DataWriters, it will consider all instances registered by that DataWriter as - * being implicitly unregistered. - * - and the application must have consumed all samples belonging to the instance, - * either implicitly or explicitly. - * - An application can consume samples explicitly by invoking the take operation, - * or one of its variants, on its DataReaders. - * - The DataReader can consume disposed samples implicitly when the - * autopurge_disposed_samples_delay of the ReaderData - * Lifecycle QosPolicy has expired. - * - * The DataReader may also remove instances that haven’t been disposed first: this - * happens when the autopurge_nowriter_samples_delay of the - * ReaderDataLifecycle QosPolicy has expired after the instance is considered - * unregistered by all connected DataWriters (i.e. when it has a - * InstanceState of not_alive_no_writers.
- * See also dds::core::policy::ReaderDataLifecycle QosPolicy. - * - * @anchor anchor_dds_pub_datawriter_dispose_effect_stores - * Effects on Transient/Persistent Stores
- * Actual deletion of the instance administration in the connected Transient and - * Persistent stores will be postponed until the following conditions have been met: - * - the instance must be unregistered (either implicitly or explicitly) by all connected - * DataWriters that have previously registered it. (See above.) - * - and the period of time specified by the service_cleanup_delay attribute in - * the DurabilityServiceQosPolicy on the Topic must have elapsed after the - * instance is considered unregistered by all connected DataWriters. - * - * See also dds::core::policy::Durability QosPolicy. - * - * Instance Handle
- * If handle is not nil, it must correspond to the value returned by - * @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"" - * when the instance (identified by its key) was registered. Passing such a registered - * handle helps the Data Distribution Service to process the sample more efficiently. - * - * @anchor anchor_dds_pub_datawriter_dispose_blocking - * Blocking
- * If the dds::core::policy::History QosPolicy is set to KEEP_ALL, the dispose - * operation on the DataWriter may block if the modification would cause data to be - * lost because one of the limits, specified in the dds::core::policy::ResourceLimits, is - * exceeded. In case the synchronous attribute value of the - * dds::core::policy::Reliability is set to TRUE for communicating DataWriters and - * DataReaders then the DataWriter will wait until all synchronous - * DataReaders have acknowledged the data. Under these circumstances, the - * max_blocking_time attribute of the dds::core::policy::Reliability configures the - * maximum time the dispose operation may block (either waiting for space to become - * available or data to be acknowledged). If max_blocking_time elapses before the - * DataWriter is able to store the modification without exceeding the limits and all - * expected acknowledgements are received, the dispose operation will fail and throw - * TimeoutError. - * - * @param i the instance to dispose - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& dispose_instance( - const ::dds::core::InstanceHandle& i); - - /** - * This operation requests the Data Distribution Service to mark the instance for - * deletion and provides a value for the source_timestamp explicitly. - * - * Detailed Description
- * This operation requests the Data Distribution Service to mark the instance for - * deletion. Copies of the instance and its corresponding samples, which are stored in - * every connected DataReader and, dependent on the QosPolicy settings, also in - * the Transient and Persistent stores, will be marked for deletion by setting their - * dds::sub::status::InstanceState to not_alive_disposed state. - * - * When this operation is used, the application explicitly supplies - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Effects
- * This operation @ref anchor_dds_pub_datawriter_dispose_effect_readers "effects DataReaders" - * and @ref anchor_dds_pub_datawriter_dispose_effect_stores "effects Transient/Persistent Stores". - * - * Instance Handle
- * If handle is not nil, it must correspond to the value returned by - * @ref dds::pub::DataWriter::register_instance(const T& key) "\"register_instance\"" or - * @ref dds::pub::DataWriter::register_instance(const T& key, const dds::core::Time& timestamp) "\"register_instance_w_timestamp\"" - * when the instance (identified by its key) was registered. Passing such a registered - * handle helps the Data Distribution Service to process the sample more efficiently. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_dispose_blocking "dispose blocking"). - * - * - * @param i the instance to dispose - * @param timestamp the timestamp - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& dispose_instance( - const ::dds::core::InstanceHandle& i, - const dds::core::Time& timestamp); - - /** - * This operation requests the Data Distribution Service to mark the instance for - * deletion. - * - * Detailed Description
- * This operation requests the Data Distribution Service to mark the instance for - * deletion. Copies of the instance and its corresponding samples, which are stored in - * every connected DataReader and, dependent on the QosPolicy settings, also in - * the Transient and Persistent stores, will be marked for deletion by setting their - * dds::sub::status::InstanceState to not_alive_disposed state. - * - * When this operation is used, the Data Distribution Service will automatically supply - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Effects
- * This operation @ref anchor_dds_pub_datawriter_dispose_effect_readers "effects DataReaders" - * and @ref anchor_dds_pub_datawriter_dispose_effect_stores "effects Transient/Persistent Stores". - * - * Instance
- * The instance is identified by the key fields of the given typed data sample, instead - * of an InstanceHandle. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_dispose_blocking "dispose blocking"). - * - * @param key sample of the instance to dispose - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& dispose_instance( - const T& key); - - /** - * This operation requests the Data Distribution Service to mark the instance for - * deletion and provides a value for the source_timestamp explicitly. - * - * Detailed Description
- * This operation requests the Data Distribution Service to mark the instance for - * deletion. Copies of the instance and its corresponding samples, which are stored in - * every connected DataReader and, dependent on the QosPolicy settings, also in - * the Transient and Persistent stores, will be marked for deletion by setting their - * dds::sub::status::InstanceState to not_alive_disposed state. - * - * When this operation is used, the application explicitly supplies - * the value of the source_timestamp that is made available to connected - * DataReader objects. This timestamp is important for the interpretation of the - * dds::core::policy::DestinationOrder QosPolicy. - * - * As a side effect, this operation asserts liveliness on the DataWriter itself and on - * the containing DomainParticipant. - * - * Effects
- * This operation @ref anchor_dds_pub_datawriter_dispose_effect_readers "effects DataReaders" - * and @ref anchor_dds_pub_datawriter_dispose_effect_stores "effects Transient/Persistent Stores". - * - * Instance
- * The instance is identified by the key fields of the given typed data sample, instead - * of an InstanceHandle. - * - * Blocking
- * This operation can be blocked (see @ref anchor_dds_pub_datawriter_dispose_blocking "dispose blocking"). - * - * @param key sample of the instance to dispose - * @param timestamp the timestamp - * @return a reference to the DataWriter - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - * @throws dds::core::TimeoutError - * Either the current action overflowed the available resources - * as specified by the combination of the Reliability QosPolicy, - * History QosPolicy and ResourceLimits QosPolicy, or the current action - * was waiting for data delivery acknowledgement by synchronous DataReaders. - * This caused blocking of the write operation, which could not be resolved before - * max_blocking_time of the Reliability QosPolicy elapsed. - */ - OMG_DDS_API DataWriter& dispose_instance( - const T& key, - const dds::core::Time& timestamp); - - /** - * This operation retrieves the key value of a specific instance. - * - * This operation can be used to retrieve the instance key that corresponds - * to an instance_handle. The operation will only fill the fields that form - * the key inside the sample instance. - * - * This operation may raise a InvalidArgumentError exception if the InstanceHandle - * does not correspond to an existing data-object known to the DataWriter. - * If the implementation is not able to check invalid handles, then the - * result in this situation is unspecified. - * - * The TopicInstance is added as parameter to be able to overload this operation. - * - * @param[out] i A topic instance to set the handle and sample key fields of - * @param[in] h The instance handle - * @return The given topic instance with the handle and key fields set - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::InvalidArgumentError - * The InstanceHandle is not a valid handle. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - */ - // dds::topic::TopicInstance& key_value( - // dds::topic::TopicInstance& i, - // const ::dds::core::InstanceHandle& h); - - /** - * This operation retrieves the key value of a specific instance. - * - * This operation can be used to retrieve the instance key that corresponds - * to an instance_handle. The operation will only fill the fields that form - * the key inside the sample instance. - * - * This operation may raise a InvalidArgumentError exception if the InstanceHandle - * does not correspond to an existing data-object known to the DataWriter. - * If the implementation is not able to check invalid handles, then the - * result in this situation is unspecified. - * - * The Sample is added as parameter to be able to overload this operation. - * - * @param[out] sample A sample to set the key fields of - * @param[in] h The instance handle - * @return The given sample with the key fields set - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::InvalidArgumentError - * The InstanceHandle is not a valid handle. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::NotEnabledError - * The DataWriter has not yet been enabled. - * @throws dds::core::PreconditionNotMetError - * The handle has not been registered with this DataWriter. - */ - OMG_DDS_API T& key_value( - T& sample, - const ::dds::core::InstanceHandle& h); - - /** - * This operation returns the value of the instance handle which corresponds - * to the instance_data. - * - * The instance_data parameter is only used for the purpose of - * examining the fields that define the key. The instance handle can be used in any - * write, dispose or unregister operations (or their time stamped variants) that - * operate on a specific instance. Note that DataWriter instance handles are local, - * and are not interchangeable with DataReader instance handles nor with instance - * handles of an other DataWriter. - * - * This operation does not register the instance in question. If the instance has not been - * previously registered or if for any other - * reason the Service is unable to provide an instance handle, the Service will return - * the default nil handle (InstanceHandle.is_nil() == true). - * - * @param key the sample - * @return the instance handle - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API dds::core::InstanceHandle lookup_instance( - const T& key); - - //========================================================================== - //== QoS Management - - /** @copydoc dds::pub::TAnyDataWriter::qos(const dds::pub::qos::DataWriterQos& qos) */ - OMG_DDS_API DataWriter& operator <<( - const qos::DataWriterQos& qos); - - - //========================================================================== - //== Entity Navigation - - /** - * Get the Topic associated with this DataWriter. - * - * @return the Topic - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - // const dds::topic::Topic& topic() const; - - //========================================================================== - //== Listeners Management - - /** - * Register a listener with the DataWriter. - * - * This operation attaches a DataWriterListener to the DataWriter. Only one - * DataWriterListener can be attached to each DataWriter. If a - * DataWriterListener was already attached, the operation will replace it with the - * new one. When the listener is the NULL pointer, it represents a listener that is - * treated as a NOOP for all statuses activated in the bit mask. - * - * Listener un-registration is performed by setting the listener to NULL and mask none(). - * - * @anchor anchor_dds_pub_datawriter_commstatus - * Communication Status
- * For each communication status, the StatusChangedFlag flag is initially set to - * FALSE. It becomes TRUE whenever that communication status changes. For each - * communication status activated in the mask, the associated DataWriterListener - * operation is invoked and the communication status is reset to FALSE, as the listener - * implicitly accesses the status which is passed as a parameter to that operation. The - * status is reset prior to calling the listener, so if the application calls the - * get__status from inside the listener it will see the status - * already reset. An exception to this rule is the NULL listener, which does not reset the - * communication statuses for which it is invoked. - * - * The following statuses are applicable to the DataWriterListener: - * - dds::core::status::StatusMask::offered_deadline_missed() - * - dds::core::status::StatusMask::offered_incompatible_qos() - * - dds::core::status::StatusMask::liveliness_lost() - * - dds::core::status::StatusMask::publication_matched() - * - * Be aware that the PUBLICATION_MATCHED_STATUS is not applicable when the - * infrastructure does not have the information available to determine connectivity. - * This is the case when OpenSplice is configured not to maintain discovery - * information in the Networking Service. (See the description for the - * NetworkingService/Discovery/enabled property in the Deployment - * Manual for more information about this subject.) In this case the operation will - * throw UnsupportedError. - * - * Status bits are declared as a constant and can be used by the application in an OR - * operation to create a tailored mask. The special constant dds::core::status::StatusMask::none() - * can be used to indicate that the created entity should not respond to any of its available - * statuses. The DDS will therefore attempt to propagate these statuses to its factory. - * The special constant dds::core::status::StatusMask::all() can be used to select all applicable - * statuses specified in the β€œData Distribution Service for Real-time Systems Version - * 1.2” specification which are applicable to the PublisherListener. - * - * @anchor anchor_dds_pub_datawriter_commpropagation - * Status Propagation
- * In case a communication status is not activated in the mask of the - * DataWriterListener, the PublisherListener of the containing Publisher - * is invoked (if attached and activated for the status that occurred). This allows the - * application to set a default behaviour in the PublisherListener of the containing - * Publisher and a DataWriter specific behaviour when needed. In case the - * communication status is not activated in the mask of the PublisherListener as - * well, the communication status will be propagated to the - * DomainParticipantListener of the containing DomainParticipant. In case - * the DomainParticipantListener is also not attached or the communication - * status is not activated in its mask, the application is not notified of the change. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @param listener the listener - * @param mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * A status was selected that cannot be supported because - * the infrastructure does not maintain the required connectivity information. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void listener( - DataWriterListener* listener, - const ::dds::core::status::StatusMask& mask); - - /** - * Get the listener of this DataWriter. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @return the listener - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - */ - OMG_DDS_API DataWriterListener* listener() const; -}; - -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_PUB_DATA_WRITER_HPP_ diff --git a/include/dds/pub/Publisher.hpp b/include/dds/pub/Publisher.hpp deleted file mode 100644 index 9b1bd7a6444..00000000000 --- a/include/dds/pub/Publisher.hpp +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_PUB_PUBLISHER_HPP_ -#define OMG_DDS_PUB_PUBLISHER_HPP_ - -#include - -#include -#include -#include -#include - -namespace dds { -namespace pub { - -class PublisherListener; - -/** - * @brief - * The Publisher acts on the behalf of one or several DataWriter objects - * that belong to it. - * - * When it is informed of a change to the data associated - * with one of its DataWriter objects, it decides when it is appropriate - * to actually send the data-update message. In making this decision, it - * considers any extra information that goes with the data (timestamp, - * writer, etc.) as well as the QoS of the Publisher and the DataWriter. - * - * @see @ref DCPS_Modules_Publisher "Publisher" - */ -class Publisher : public dds::core::TEntity -{ -public: - - /** - * Local convenience typedef for dds::pub::PublisherListener. - */ - typedef PublisherListener Listener; - - OMG_DDS_REF_TYPE_PROTECTED_DC( - Publisher, - dds::core::TEntity, - detail::Publisher) - - OMG_DDS_IMPLICIT_REF_BASE( - Publisher) - - /** - * Create a new Publisher. - * - * The Publisher will be created with the QoS values specified on the last - * successful call to @link dds::domain::DomainParticipant::default_publisher_qos(const ::dds::pub::qos::PublisherQos& qos) - * dp.default_publisher_qos(qos) @endlink or, if the call was never made, the - * @ref anchor_dds_pub_publisher_qos_defaults "default" values. - * - * @param dp the domain participant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API Publisher( - const dds::domain::DomainParticipant& dp); - - /** - * Create a new Publisher. - * - * The Publisher will be created with the given QosPolicy settings and if - * applicable, attaches the optionally specified PublisherListener to it. - * - * See @ref DCPS_Modules_Infrastructure_Listener "listener" for more information - * about listeners and possible status propagation to other entities. - * - * @param dp the domain participant to create the Publisher with. - * @param qos a collection of QosPolicy settings for the new Publisher. In case - * these settings are not self consistent, no Publisher is created. - * @param listener the publisher listener - * @param mask the mask of events notified to the listener - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings. - */ - OMG_DDS_API Publisher( - const dds::domain::DomainParticipant& dp, - const qos::PublisherQos& qos, - PublisherListener* listener = NULL, - const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none()); - - /** @cond */ - virtual OMG_DDS_API ~Publisher(); - /** @endcond */ - - //========================================================================== - - /** - * Gets the PublisherQos setting for this instance. - * - * @return the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const qos::PublisherQos& qos() const; - - - /** - * Sets the PublisherQos setting for this instance. - * - * @param qos the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void qos( - const qos::PublisherQos& qos); - - /** @copydoc dds::pub::Publisher::qos(const dds::pub::qos::PublisherQos& qos) */ - OMG_DDS_API Publisher& operator <<( - const qos::PublisherQos& qos); - - /** @copydoc dds::pub::Publisher::qos() */ - OMG_DDS_API Publisher& operator >>( - qos::PublisherQos& qos); - - /** - * Sets the default DataWriterQos of the Publisher. - * - * This operation sets the default SubscriberQos of the Publisher which - * is used for newly created Subscriber objects, when no QoS is provided. - * - * This operation checks if the DataWriterQos is self consistent. If it is not, the - * operation has no effect and throws dds::core::InconsistentPolicyError. - * - * The values set by this operation are returned by dds::pub::Publisher::default_datawriter_qos(). - * - * @param qos the default DataWriterQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * One or more of the selected QosPolicy values are - * currently not supported by OpenSplice. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings, - * e.g. a history depth that is higher than the specified resource limits. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API Publisher& default_datawriter_qos( - const qos::DataWriterQos& qos); - - /** - * Gets the default DataWriterQos of the Publisher. - * - * This operation gets an object with the default DataWriter QosPolicy settings of - * the Publisher (that is the DataWriterQos) which is used for newly - * created DataWriter objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::pub::Publisher::default_datawriter_qos(const dds::pub::qos::DataWriterQos& qos), - * or, if the call was never made, the @ref anchor_dds_pub_datawriter_qos_defaults "default" values. - * - * @return the default DataWriterQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API qos::DataWriterQos default_datawriter_qos() const; - - //========================================================================== - - /** - * Register a listener with the Publisher. - * - * The notifications received by the listener depend on the - * status mask with which it was registered. - * - * Listener un-registration is performed by setting the listener to NULL. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @param plistener the listener - * @param mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * A status was selected that cannot be supported because - * the infrastructure does not maintain the required connectivity information. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void listener( - Listener* plistener, - const dds::core::status::StatusMask& mask); - - /** - * Get the listener of this Publisher. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @return the listener - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - */ - OMG_DDS_API Listener* listener() const; - - //========================================================================== - - /** - * This operation blocks the calling thread until either all data written - * by the reliable DataWriter entities is acknowledged by all matched - * reliable DataReader entities, or else the duration specified by the - * timeout parameter elapses, whichever happens first. - * - * Data is acknowledged by the local infrastructure when it does not need to be stored - * in its DataWriter’s local history. When a locally-connected subscription (including - * the networking service) has no more resources to store incoming samples it will start - * to reject these samples, resulting in their source DataWriters to store them - * temporarily in their own local history to be retransmitted at a later moment in time.
- * In such scenarios, the wait_for_acknowledgments operation will block until all - * contained DataWriters have retransmitted their entire history, which is therefore - * effectively empty, or until the max_wait timeout expires, whichever happens first. - * In the latter case it will throw dds::core::TimeoutError. - * - * - * Be aware that in case the operation returns normally, the data has only been - * acknowledged by the local infrastructure: it does not mean all remote subscriptions - * have already received the data. However, delivering the data to remote nodes is then - * the sole responsibility of the networking service: even when the publishing - * application would terminate, all data that has not yet been received may be - * considered β€˜on-route’ and will therefore eventually arrive (unless the networking - * service itself will crash). In contrast, if a DataWriter would still have data in it’s - * local history buffer when it terminates, this data is considered β€˜lost’. - * - * - * This operation is intended to be used only if one or more of the contained - * DataWriters has its ReliabilityQosPolicyKind set to RELIABLE. - * Otherwise the operation will return immediately, since best-effort DataWriters will - * never store rejected samples in their local history: - * they will just drop them and continue business as usual. - * - * @param timeout the time out duration - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::TimeoutError - * Not all data is acknowledged before timeout elapsed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void wait_for_acknowledgments( - const dds::core::Duration& timeout); - - //========================================================================== - - /** - * Return the DomainParticipant that owns this Publisher. - * - * @return the DomainParticipant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API const dds::domain::DomainParticipant& participant() const; - - const dds::domain::DomainParticipant* participant_; - -}; - -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_PUB_PUBLISHER_HPP_ diff --git a/include/dds/pub/PublisherListener.hpp b/include/dds/pub/PublisherListener.hpp deleted file mode 100644 index 271c9455358..00000000000 --- a/include/dds/pub/PublisherListener.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_PUB_PUBLISHER_LISTENER_HPP_ -#define OMG_DDS_PUB_PUBLISHER_LISTENER_HPP_ - -// TODO Remove when PSM DDS Listeners are ready to be used. -#include - -// TODO uncomment when PSM DDS Listeners are ready to be used. -//#include - -namespace dds { -namespace pub { - -class PublisherListener; -class NoOpPublisherListener; - -/** - * @brief - * Publisher events Listener - * - * Since a Publisher is an Entity, it has the ability to have a Listener - * associated with it. In this case, the associated Listener should be of type - * PublisherListener. This interface must be implemented by the - * application. A user-defined class must be provided by the application which must - * extend from the PublisherListener class. - * - * - * All operations for this interface must be implemented in the user-defined class, it is - * up to the application whether an operation is empty or contains some functionality. - * - * - * The PublisherListener provides a generic mechanism (actually a - * callback function) for the Data Distribution Service to notify the application of - * relevant asynchronous status change events, such as a missed deadline, violation of - * a QosPolicy setting, etc. The PublisherListener is related to - * changes in communication status StatusConditions. - * - * @code{.cpp} - * // Application example listener - * class ExampleListener : - * public virtual dds::pub::PublisherListener - * { - * public: - * virtual void on_offered_deadline_missed ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::OfferedDeadlineMissedStatus& status) - * { - * std::cout << "on_offered_deadline_missed" << std::endl; - * } - * - * virtual void on_offered_incompatible_qos ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::OfferedIncompatibleQosStatus& status) - * { - * std::cout << "on_offered_incompatible_qos" << std::endl; - * } - * - * virtual void on_liveliness_lost ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::LivelinessLostStatus& status) - * { - * std::cout << "on_liveliness_lost" << std::endl; - * } - * - * virtual void on_publication_matched ( - * dds::pub::AnyDataWriter& writer, - * const dds::core::status::PublicationMatchedStatus& status) - * { - * std::cout << "on_publication_matched" << std::endl; - * } - * }; - * - * // Create Publisher with the listener - * dds::domain::DomainParticipant participant(org::opensplice::domain::default_id()); - * dds::pub::Publisher publisher(participant, - * participant.default_publisher_qos(), - * new ExampleListener(), - * dds::core::status::StatusMask::all()); - * - * @endcode - * - * @see @ref DCPS_Modules_Publisher "Publisher" - * @see @ref DCPS_Modules_Infrastructure_Listener "Listener information" - */ -// TODO Uncomment when PSM listeners are implemented. -//class OMG_DDS_API PublisherListener : public virtual AnyDataWriterListener -// TODO Remove the PSM listeners are implemented. -class PublisherListener : public eprosima::fastdds::dds::PublisherListener -{ -public: - - /** @cond */ - virtual ~PublisherListener() - { - } - - /** @endcond */ -}; - -/** - * @brief - * Publisher events Listener - * - * This listener is just like PublisherListener, except - * that the application doesn't have to implement all operations. - * - * @code{.cpp} - * class ExampleListener : public virtual dds::pub::NoOpPublisherListener - * { - * // Not necessary to implement any Listener operations. - * }; - * @endcode - * - * @see dds::pub::PublisherListener - */ - -// TODO Uncomment when PSM DDS listeners are ready to be used -/* - class OMG_DDS_API NoOpPublisherListener : - public virtual PublisherListener, - public virtual NoOpAnyDataWriterListener - */ -// TODO Remove the PSM listeners are implemented. -class NoOpPublisherListener : public virtual PublisherListener -{ -public: - - /** @cond */ - virtual ~NoOpPublisherListener() - { - } - - /** @endcond */ -}; - -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_PUB_PUBLISHER_LISTENER_HPP_ diff --git a/include/dds/pub/detail/AnyDataWriter.hpp b/include/dds/pub/detail/AnyDataWriter.hpp deleted file mode 100644 index 1a992ebd2d2..00000000000 --- a/include/dds/pub/detail/AnyDataWriter.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_DETAIL_ANYDATAWRITER_HPP_ -#define EPROSIMA_DDS_PUB_DETAIL_ANYDATAWRITER_HPP_ - -//TODO Remove this include when AnyDataWriter is implemented. -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace pub { -namespace detail { - -using AnyDataWriter = eprosima::fastdds::dds::DataWriter; - -} //namespace detail -} //namespace pub -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_PUB_DETAIL_ANYDATAWRITER_HPP_ diff --git a/include/dds/pub/detail/DataWriter.hpp b/include/dds/pub/detail/DataWriter.hpp deleted file mode 100644 index 18fae527578..00000000000 --- a/include/dds/pub/detail/DataWriter.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_DETAIL_DATA_WRITER_HPP_ -#define EPROSIMA_DDS_PUB_DETAIL_DATA_WRITER_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace pub { -namespace detail { - -using DataWriter = eprosima::fastdds::dds::DataWriter; - -} //namespace detail -} //namespace pub -} //namespace dds - -/** @endcond */ - - -#endif //EPROSIMA_DDS_PUB_DETAIL_DATA_WRITER_HPP_ diff --git a/include/dds/pub/detail/Publisher.hpp b/include/dds/pub/detail/Publisher.hpp deleted file mode 100644 index 1ebe827764e..00000000000 --- a/include/dds/pub/detail/Publisher.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_DETAIL_PUBLISHER_HPP_ -#define EPROSIMA_DDS_PUB_DETAIL_PUBLISHER_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace eprosima { -namespace fastdds { -namespace dds { -class Publisher; -} -} -} - -namespace dds { -namespace pub { -namespace detail { - -using Publisher = eprosima::fastdds::dds::Publisher; - -} //namespace detail -} //namespace pub -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_PUB_DETAIL_PUBLISHER_HPP_ diff --git a/include/dds/pub/qos/DataWriterQos.hpp b/include/dds/pub/qos/DataWriterQos.hpp deleted file mode 100644 index 857c43e8284..00000000000 --- a/include/dds/pub/qos/DataWriterQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_QOS_DATA_WRITER_QOS_HPP_ -#define OMG_DDS_QOS_DATA_WRITER_QOS_HPP_ - -#include - -namespace dds { -namespace pub { -namespace qos { - -typedef dds::pub::qos::detail::DataWriterQos DataWriterQos; - -} //namespace qos -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_QOS_DATA_WRITER_QOS_HPP_ diff --git a/include/dds/pub/qos/PublisherQos.hpp b/include/dds/pub/qos/PublisherQos.hpp deleted file mode 100644 index adc2384054d..00000000000 --- a/include/dds/pub/qos/PublisherQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_QOS_PUBLISER_QOS_HPP_ -#define OMG_DDS_QOS_PUBLISER_QOS_HPP_ - -#include - -namespace dds { -namespace pub { -namespace qos { - -typedef dds::pub::qos::detail::PublisherQos PublisherQos; - -} //namespace qos -} //namespace pub -} //namespace dds - -#endif //OMG_DDS_QOS_PUBLISER_QOS_HPP_ diff --git a/include/dds/pub/qos/detail/DataWriterQos.hpp b/include/dds/pub/qos/detail/DataWriterQos.hpp deleted file mode 100644 index 7fe983c50b3..00000000000 --- a/include/dds/pub/qos/detail/DataWriterQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_QOS_DETAIL_DATAWRITER_QOS_HPP_ -#define EPROSIMA_DDS_PUB_QOS_DETAIL_DATAWRITER_QOS_HPP_ - -#include - -namespace dds { -namespace pub { -namespace qos { -namespace detail { - -using DataWriterQos = eprosima::fastdds::dds::DataWriterQos; - -} //namespace detail -} //namespace qos -} //namespace pub -} //namespace dds - -#endif //EPROSIMA_DDS_PUB_QOS_DETAIL_DATAWRITER_QOS_HPP_ diff --git a/include/dds/pub/qos/detail/PublisherQos.hpp b/include/dds/pub/qos/detail/PublisherQos.hpp deleted file mode 100644 index 666b871109d..00000000000 --- a/include/dds/pub/qos/detail/PublisherQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_QOS_DETAIL_PUBLISER_QOS_HPP_ -#define EPROSIMA_DDS_PUB_QOS_DETAIL_PUBLISER_QOS_HPP_ - -#include - -namespace dds { -namespace pub { -namespace qos { -namespace detail { - -using PublisherQos = eprosima::fastdds::dds::PublisherQos; - -} //namespace detail -} //namespace qos -} //namespace pub -} //namespace detail - -#endif //EPROSIMA_DDS_PUB_QOS_DETAIL_PUBLISER_QOS_HPP_ diff --git a/include/dds/sub/DataReader.hpp b/include/dds/sub/DataReader.hpp deleted file mode 100644 index 0ef7bb4e1d5..00000000000 --- a/include/dds/sub/DataReader.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_SUB_DATAREADER_HPP_ -#define OMG_DDS_SUB_DATAREADER_HPP_ - -#include - -#include -#include -#include - -namespace dds { -namespace sub { - -class DataReaderListener; - -//TODO: [ILG] Decide if we need to templatize the DataReader and derive from a AnyDataReader - -/** - * @brief - * A DataReader allows the application to declare the data it wishes to receive. - * - * @see @ref DCPS_Modules_Datareader "Datareader" - */ -class DataReader : public dds::core::TEntity -{ -public: - - /** - * Local convenience typedef for dds::pub::DataReaderListener. - */ - typedef DataReaderListener Listener; - - OMG_DDS_REF_TYPE_PROTECTED_DC( - DataReader, - dds::core::TEntity, - detail::DataReader) - - OMG_DDS_IMPLICIT_REF_BASE( - DataReader) - - /** - * Create a new DataReader. - * - * The DataReader will be created with the QoS values specified on the last - * successful call to @link dds::sub::Subscriber::default_DataReader_qos(const ::dds::sub::qos::DataReaderQos& qos) - * sub.default_DataReader_qos(qos) @endlink or, if the call was never made, the - * @ref anchor_dds_sub_DataReader_qos_defaults "default" values. - * - * @param sub the subscriber - * @param topic the topic the DataReader will be listening. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API DataReader( - const dds::sub::Subscriber& sub, - const dds::topic::Topic& topic); - - /** - * Create a new DataReader. - * - * The DataReader will be created with the given QosPolicy settings and if - * applicable, attaches the optionally specified DataReaderListener to it. - * - * See @ref DCPS_Modules_Infrastructure_Listener "listener" for more information - * about listeners and possible status propagation to other entities. - * - * @param sub the subscriber to create the DataReader with. - * @param topic the topic the DataReader will be listening. - * @param qos a collection of QosPolicy settings for the new DataReader. In case - * these settings are not self consistent, no DataReader is created. - * @param listener the DataReader listener - * @param mask the mask of events notified to the listener - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings. - */ - OMG_DDS_API DataReader( - const dds::sub::Subscriber& sub, - const dds::topic::Topic& topic, - const qos::DataReaderQos& qos, - DataReaderListener* listener = NULL, - const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none()); - - /** @cond */ - virtual OMG_DDS_API ~DataReader(); - /** @endcond */ - - //========================================================================== - - /** - * Gets the DataReaderQos setting for this instance. - * - * @return the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const qos::DataReaderQos& qos() const; - - - /** - * Sets the DataReaderQos setting for this instance. - * - * @param qos the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void qos( - const qos::DataReaderQos& qos); - - /** @copydoc dds::pub::DataReader::qos(const dds::pub::qos::DataReaderQos& qos) */ - OMG_DDS_API DataReader& operator <<( - const qos::DataReaderQos& qos); - - /** @copydoc dds::pub::DataReader::qos() */ - OMG_DDS_API DataReader& operator >>( - qos::DataReaderQos& qos); - - //========================================================================== - - /** - * Register a listener with the DataReader. - * - * The notifications received by the listener depend on the - * status mask with which it was registered. - * - * Listener un-registration is performed by setting the listener to NULL. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @param plistener the listener - * @param mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * A status was selected that cannot be supported because - * the infrastructure does not maintain the required connectivity information. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void listener( - Listener* plistener, - const dds::core::status::StatusMask& mask); - - /** - * Get the listener of this DataReader. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @return the listener - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - */ - OMG_DDS_API Listener* listener() const; - - /** - * Return the Subscriber that owns this DataReader. - * - * @return the Subscriber - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API const dds::sub::Subscriber& subscriber() const; - - dds::sub::Subscriber* subscriber_; - -}; - -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_SUB_DATAREADER_HPP_ diff --git a/include/dds/sub/DataReaderListener.hpp b/include/dds/sub/DataReaderListener.hpp deleted file mode 100644 index a4a7f95728c..00000000000 --- a/include/dds/sub/DataReaderListener.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_SUB_DATAREADER_LISTENER_HPP_ -#define OMG_DDS_SUB_DATAREADER_LISTENER_HPP_ - -// TODO Remove when PSM DDS Listeners are ready to be used. -#include - -// TODO uncomment when PSM DDS Listeners are ready to be used. -//#include - -namespace dds { -namespace sub { - -class SubscriberListener; -class NoOpSubscriberListener; - -/** - * @brief - * DataReader events Listener - * - * Since a DataReader is an Entity, it has the ability to have a Listener - * associated with it. In this case, the associated Listener should be of type - * DataReaderListener. This interface must be implemented by the - * application. A user-defined class must be provided by the application which must - * extend from the DataReaderListener class. - * - * - * All operations for this interface must be implemented in the user-defined class, it is - * up to the application whether an operation is empty or contains some functionality. - * - * - * The DataReaderListener provides a generic mechanism (actually a - * callback function) for the Data Distribution Service to notify the application of - * relevant asynchronous status change events, such as a missed deadline, violation of - * a QosPolicy setting, etc. The DataReaderListener is related to - * changes in communication status StatusConditions. - */ -// TODO Uncomment when PSM listeners are implemented. -//class OMG_DDS_API DataReaderListener : public virtual AnyDataReaderListener -// TODO Remove the PSM listeners are implemented. -class DataReaderListener : public eprosima::fastdds::dds::DataReaderListener -{ -public: - - /** @cond */ - virtual ~DataReaderListener() - { - } - - /** @endcond */ -}; - -/** - * @brief - * DataReader events Listener - * - * This listener is just like DataReaderListener, except - * that the application doesn't have to implement all operations. - * - * @code{.cpp} - * class ExampleListener : public virtual dds::sub::NoOpDataReaderListener - * { - * // Not necessary to implement any Listener operations. - * }; - * @endcode - * - * @see dds::pub::DataReaderListener - */ - -// TODO Uncomment when PSM DDS listeners are ready to be used -/* - class OMG_DDS_API NoOpDataReaderListener : - public virtual DataReaderListener, - public virtual NoOpAnyDataReaderListener - */ -// TODO Remove the PSM listeners are implemented. -class NoOpDataReaderListener : public virtual DataReaderListener -{ -public: - - /** @cond */ - virtual ~NoOpDataReaderListener() - { - } - - /** @endcond */ -}; - -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_SUB_DATAREADER_LISTENER_HPP_ diff --git a/include/dds/sub/Subscriber.hpp b/include/dds/sub/Subscriber.hpp deleted file mode 100644 index 38377d736a2..00000000000 --- a/include/dds/sub/Subscriber.hpp +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_SUB_SUBSCRIBER_HPP_ -#define OMG_DDS_SUB_SUBSCRIBER_HPP_ - -#include - -#include -#include -#include -#include - -namespace dds { -namespace sub { - -class SubscriberListener; - -/** - * @brief - * The Subscriber acts on the behalf of one or several DataReader objects - * that belong to it. - * - * @see @ref DCPS_Modules_Subscriber "Subscriber" - */ -class Subscriber : public dds::core::TEntity -{ -public: - - /** - * Local convenience typedef for dds::pub::SubscriberListener. - */ - typedef SubscriberListener Listener; - - OMG_DDS_REF_TYPE_PROTECTED_DC( - Subscriber, - dds::core::TEntity, - detail::Subscriber) - - OMG_DDS_IMPLICIT_REF_BASE( - Subscriber) - - /** - * Create a new Subscriber. - * - * The Subscriber will be created with the QoS values specified on the last - * successful call to @link dds::domain::DomainParticipant::default_subscriber_qos(const ::dds::pub::qos::SubscriberQos& qos) - * dp.default_subscriber_qos(qos) @endlink or, if the call was never made, the - * @ref anchor_dds_pub_subscriber_qos_defaults "default" values. - * - * @param dp the domain participant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API Subscriber( - const dds::domain::DomainParticipant& dp); - - /** - * Create a new Subscriber. - * - * The Subscriber will be created with the given QosPolicy settings and if - * applicable, attaches the optionally specified SubscriberListener to it. - * - * See @ref DCPS_Modules_Infrastructure_Listener "listener" for more information - * about listeners and possible status propagation to other entities. - * - * @param dp the domain participant to create the Subscriber with. - * @param qos a collection of QosPolicy settings for the new Subscriber. In case - * these settings are not self consistent, no Subscriber is created. - * @param listener the subscriber listener - * @param mask the mask of events notified to the listener - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings. - */ - OMG_DDS_API Subscriber( - const dds::domain::DomainParticipant& dp, - const qos::SubscriberQos& qos, - SubscriberListener* listener = NULL, - const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none()); - - /** @cond */ - virtual OMG_DDS_API ~Subscriber(); - /** @endcond */ - - //========================================================================== - - /** - * Gets the SubscriberQos setting for this instance. - * - * @return the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API const qos::SubscriberQos& qos() const; - - - /** - * Sets the SubscriberQos setting for this instance. - * - * @param qos the qos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void qos( - const qos::SubscriberQos& qos); - - /** @copydoc dds::pub::Subscriber::qos(const dds::pub::qos::SubscriberQos& qos) */ - OMG_DDS_API Subscriber& operator <<( - const qos::SubscriberQos& qos); - - /** @copydoc dds::pub::Subscriber::qos() */ - OMG_DDS_API Subscriber& operator >>( - qos::SubscriberQos& qos); - - /** - * Sets the default DataWriterQos of the Subscriber. - * - * This operation sets the default SubscriberQos of the Subscriber which - * is used for newly created Subscriber objects, when no QoS is provided. - * - * This operation checks if the DataReaderQos is self consistent. If it is not, the - * operation has no effect and throws dds::core::InconsistentPolicyError. - * - * The values set by this operation are returned by dds::pub::Subscriber::default_datareader_qos(). - * - * @param qos the default DataReaderQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * One or more of the selected QosPolicy values are - * currently not supported. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings, - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API Subscriber& default_datareader_qos( - const qos::DataReaderQos& qos); - - /** - * Gets the default DataReaderQos of the Subscriber. - * - * This operation gets an object with the default DataReader QosPolicy settings of - * the Subscriber (that is the DataReaderQos) which is used for newly - * created DataReader objects, in case no QoS was provided during the creation. - * - * The values retrieved by this operation match the set of values specified on the last - * successful call to - * dds::pub::Subscriber::default_datareader_qos(const dds::pub::qos::DataReaderQos& qos), - * or, if the call was never made, the @ref anchor_dds_pub_datareader_qos_defaults "default" values. - * - * @return the default DataReaderQos - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API qos::DataReaderQos default_datareader_qos() const; - - //========================================================================== - - /** - * Register a listener with the Subscriber. - * - * The notifications received by the listener depend on the - * status mask with which it was registered. - * - * Listener un-registration is performed by setting the listener to NULL. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @param plistener the listener - * @param mask the mask defining the events for which the listener - * will be notified. - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - * @throws dds::core::UnsupportedError - * A status was selected that cannot be supported because - * the infrastructure does not maintain the required connectivity information. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API void listener( - Listener* plistener, - const dds::core::status::StatusMask& mask); - - /** - * Get the listener of this Subscriber. - * - * See also @ref DCPS_Modules_Infrastructure_Listener "listener information". - * - * @return the listener - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - */ - OMG_DDS_API Listener* listener() const; - - /** - * Return the DomainParticipant that owns this Subscriber. - * - * @return the DomainParticipant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::NullReferenceError - * The entity was not properly created and references to dds::core::null. - * @throws dds::core::AlreadyClosedError - * The entity has already been closed. - */ - OMG_DDS_API const dds::domain::DomainParticipant& participant() const; - - const dds::domain::DomainParticipant* participant_; - -}; - -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_SUB_SUBSCRIBER_HPP_ diff --git a/include/dds/sub/SubscriberListener.hpp b/include/dds/sub/SubscriberListener.hpp deleted file mode 100644 index 2bea6ddca13..00000000000 --- a/include/dds/sub/SubscriberListener.hpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_SUB_SUBSCRIBER_LISTENER_HPP_ -#define OMG_DDS_SUB_SUBSCRIBER_LISTENER_HPP_ - -// TODO Remove when PSM DDS Listeners are ready to be used. -#include - -// TODO uncomment when PSM DDS Listeners are ready to be used. -//#include - -namespace dds { -namespace sub { - -class SubscriberListener; -class NoOpSubscriberListener; - -/** - * @brief - * Subscriber events Listener - * - * Since a Subscriber is an Entity, it has the ability to have a Listener - * associated with it. In this case, the associated Listener should be of type - * SubscriberListener. This interface must be implemented by the - * application. A user-defined class must be provided by the application which must - * extend from the SubscriberListener class. - * - * - * All operations for this interface must be implemented in the user-defined class, it is - * up to the application whether an operation is empty or contains some functionality. - * - * - * The SubscriberListener provides a generic mechanism (actually a - * callback function) for the Data Distribution Service to notify the application of - * relevant asynchronous status change events, such as a missed deadline, violation of - * a QosPolicy setting, etc. The SubscriberListener is related to - * changes in communication status StatusConditions. - * - * @code{.cpp} - * // Application example listener - * class ExampleListener : - * public virtual dds::sub::SubscriberListener - * { - * public: - * virtual void on_new_data_message ( - * dds::pub::AnyDataReader& reader, - * const dds::core::status::NewDataMessageStatus& status) - * { - * std::cout << "on_new_data_message" << std::endl; - * } - * - * virtual void on_subscription_matched ( - * dds::pub::AnyDataReader& reader, - * const dds::core::status::SubscriptionMatchedStatus& status) - * { - * std::cout << "on_subscription_matched" << std::endl; - * } - * - * virtual void on_requested_deadline_missed ( - * dds::pub::AnyDataReader& reader, - * const dds::core::status::RequestedDeadlineMissedStatus& status) - * { - * std::cout << "on_requested_deadline_missed" << std::endl; - * } - * - * virtual void on_liveliness_changed ( - * dds::pub::AnyDataReader& reader, - * const dds::core::status::LivelinessChangedStatus& status) - * { - * std::cout << "on_liveliness_changed" << std::endl; - * } - * }; - * - * // Create Publisher with the listener - * dds::domain::DomainParticipant participant(org::opensplice::domain::default_id()); - * dds::sub::Subscriber subscriber(participant, - * participant.default_Subscriber_qos(), - * new ExampleListener(), - * dds::core::status::StatusMask::all()); - * - * @endcode - * - * @see @ref DCPS_Modules_Subscriber "Subscriber" - * @see @ref DCPS_Modules_Infrastructure_Listener "Listener information" - */ -// TODO Uncomment when PSM listeners are implemented. -//class OMG_DDS_API SubscriberListener : public virtual AnyDataReaderListener -// TODO Remove the PSM listeners are implemented. -class SubscriberListener : public eprosima::fastdds::dds::SubscriberListener -{ -public: - - /** @cond */ - virtual ~SubscriberListener() - { - } - - /** @endcond */ -}; - -/** - * @brief - * Subscriber events Listener - * - * This listener is just like SubscriberListener, except - * that the application doesn't have to implement all operations. - * - * @code{.cpp} - * class ExampleListener : public virtual dds::sub::NoOpSubscriberListener - * { - * // Not necessary to implement any Listener operations. - * }; - * @endcode - * - * @see dds::pub::SubscriberListener - */ - -// TODO Uncomment when PSM DDS listeners are ready to be used -/* - class OMG_DDS_API NoOpSubscriberListener : - public virtual SubscriberListener, - public virtual NoOpAnySubscriberListener - */ -// TODO Remove the PSM listeners are implemented. -class NoOpSubscriberListener : public virtual SubscriberListener -{ -public: - - /** @cond */ - virtual ~NoOpSubscriberListener() - { - } - - /** @endcond */ -}; - -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_SUB_SUBSCRIBER_LISTENER_HPP_ diff --git a/include/dds/sub/detail/DataReader.hpp b/include/dds/sub/detail/DataReader.hpp deleted file mode 100644 index d8ca18c75a2..00000000000 --- a/include/dds/sub/detail/DataReader.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_SUB_DETAIL_DATAREADER_HPP_ -#define EPROSIMA_DDS_SUB_DETAIL_DATAREADER_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace sub { -namespace detail { - -using DataReader = eprosima::fastdds::dds::DataReader; - -} //namespace detail -} //namespace sub -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_SUB_DETAIL_DATAREADER_HPP_ diff --git a/include/dds/sub/detail/Subscriber.hpp b/include/dds/sub/detail/Subscriber.hpp deleted file mode 100644 index 9a7a7fbb0e9..00000000000 --- a/include/dds/sub/detail/Subscriber.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_SUB_DETAIL_SUBSCRIBER_HPP_ -#define EPROSIMA_DDS_SUB_DETAIL_SUBSCRIBER_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace eprosima { -namespace fastdds { -namespace dds { -class Subscriber; -} -} -} - -namespace dds { -namespace sub { -namespace detail { - -using Subscriber = eprosima::fastdds::dds::Subscriber; - -} //namespace detail -} //namespace sub -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_SUB_DETAIL_SUBSCRIBER_HPP_ diff --git a/include/dds/sub/qos/DataReaderQos.hpp b/include/dds/sub/qos/DataReaderQos.hpp deleted file mode 100644 index 1c601ea3d92..00000000000 --- a/include/dds/sub/qos/DataReaderQos.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_QOS_DATA_READER_QOS_HPP_ -#define OMG_DDS_QOS_DATA_READER_QOS_HPP_ - -#include - -namespace dds { -namespace sub { -namespace qos { - -typedef detail::DataReaderQos DataReaderQos; - -} //namespace qos -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_QOS_DATA_READER_QOS_HPP_ diff --git a/include/dds/sub/qos/SubscriberQos.hpp b/include/dds/sub/qos/SubscriberQos.hpp deleted file mode 100644 index 350c8998b9e..00000000000 --- a/include/dds/sub/qos/SubscriberQos.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_QOS_SUBSCRIBER_QOS_HPP_ -#define OMG_DDS_QOS_SUBSCRIBER_QOS_HPP_ - -#include - -namespace dds { -namespace sub { -namespace qos { - -typedef dds::sub::qos::detail::SubscriberQos SubscriberQos; - -} //namespace qos -} //namespace sub -} //namespace dds - -#endif //OMG_DDS_QOS_SUBSCRIBER_QOS_HPP_ diff --git a/include/dds/sub/qos/detail/DataReaderQos.hpp b/include/dds/sub/qos/detail/DataReaderQos.hpp deleted file mode 100644 index e89b554ef86..00000000000 --- a/include/dds/sub/qos/detail/DataReaderQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_PUB_QOS_DETAIL_DATAREADER_QOS_HPP_ -#define EPROSIMA_DDS_PUB_QOS_DETAIL_DATAREADER_QOS_HPP_ - -#include - -namespace dds { -namespace sub { -namespace qos { -namespace detail { - -using DataReaderQos = eprosima::fastdds::dds::DataReaderQos; - -} //namespace detail -} //namespace qos -} //namespace sub -} //namespace dds - -#endif //EPROSIMA_DDS_PUB_QOS_DETAIL_DATAREADER_QOS_HPP_ diff --git a/include/dds/sub/qos/detail/SubscriberQos.hpp b/include/dds/sub/qos/detail/SubscriberQos.hpp deleted file mode 100644 index dd679721242..00000000000 --- a/include/dds/sub/qos/detail/SubscriberQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_SUB_QOS_DETAIL_SUBSCRIBER_QOS_HPP_ -#define EPROSIMA_DDS_SUB_QOS_DETAIL_SUBSCRIBER_QOS_HPP_ - -#include - -namespace dds { -namespace sub { -namespace qos { -namespace detail { - -using SubscriberQos = eprosima::fastdds::dds::SubscriberQos; - -} //namespace detail -} //namespace qos -} //namespace sub -} //namespace detail - -#endif //EPROSIMA_DDS_SUB_QOS_DETAIL_SUBSCRIBER_QOS_HPP_ diff --git a/include/dds/topic/Topic.hpp b/include/dds/topic/Topic.hpp deleted file mode 100644 index 068ef0643d9..00000000000 --- a/include/dds/topic/Topic.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Topic.hpp - */ - -#ifndef OMG_DDS_TOPIC_HPP_ -#define OMG_DDS_TOPIC_HPP_ - - -#include -#include -#include -#include - -namespace dds { -namespace topic { - -class TopicListener; - - -class Topic : public dds::core::TEntity -{ - friend class DomainParticipantImpl; - -public: - - OMG_DDS_REF_TYPE_PROTECTED_DC( - Topic, - dds::core::TEntity, - detail::Topic) - - OMG_DDS_IMPLICIT_REF_BASE( - Topic) - - /** - * Create a new Topic. - * - * The Topic will be created with the QoS values specified on the last - * successful call to @link dds::domain::DomainParticipant::default_topic_qos(const ::dds::pub::qos::TopicQos& qos) - * dp.default_topic_qos(qos) @endlink or, if the call was never made, the - * @ref anchor_dds_pub_topic_qos_defaults "default" values. - * - * @param dp the domain participant - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - */ - OMG_DDS_API Topic( - const dds::domain::DomainParticipant& dp, - const std::string& topic_name, - const std::string& type_name); - - /** - * Create a new Topic. - * - * The Topic will be created with the given QosPolicy settings and if - * applicable, attaches the optionally specified TopicListener to it. - * - * See @ref DCPS_Modules_Infrastructure_Listener "listener" for more information - * about listeners and possible status propagation to other entities. - * - * @param dp the domain participant to create the Topic with. - * @param qos a collection of QosPolicy settings for the new Topic. In case - * these settings are not self consistent, no Topic is created. - * @param listener the Topic listener - * @param mask the mask of events notified to the listener - * @throws dds::core::Error - * An internal error has occurred. - * @throws dds::core::OutOfResourcesError - * The Data Distribution Service ran out of resources to - * complete this operation. - * @throws dds::core::InconsistentPolicyError - * The parameter qos contains conflicting QosPolicy settings. - */ - OMG_DDS_API Topic( - const dds::domain::DomainParticipant& dp, - const std::string& topic_name, - const std::string& type_name, - const qos::TopicQos& qos, - TopicListener* listener = nullptr, - const dds::core::status::StatusMask& mask = dds::core::status::StatusMask::none()); - - /** @cond */ - virtual OMG_DDS_API ~Topic(); - /** @endcond */ - -private: - - dds::domain::DomainParticipant* participant_; - -}; - -} /* namespace topic */ -} /* namespace dds */ - -#endif /* OMG_DDS_TOPIC_HPP_ */ diff --git a/include/dds/topic/TopicListener.hpp b/include/dds/topic/TopicListener.hpp deleted file mode 100644 index e0a5d9ca663..00000000000 --- a/include/dds/topic/TopicListener.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_SUB_TOPIC_LISTENER_HPP_ -#define OMG_DDS_SUB_TOPIC_LISTENER_HPP_ - -// TODO Remove when PSM DDS Listeners are ready to be used. -#include - -// TODO uncomment when PSM DDS Listeners are ready to be used. -//#include - -namespace dds { -namespace topic { - -/** - * @brief - * Topic events Listener - * - * Since a Topic is an Entity, it has the ability to have a Listener - * associated with it. In this case, the associated Listener should be of type - * TopicListener. This interface must be implemented by the - * application. A user-defined class must be provided by the application which must - * extend from the TopicListener class. - * - * - * All operations for this interface must be implemented in the user-defined class, it is - * up to the application whether an operation is empty or contains some functionality. - * - * - * The TopicListener provides a generic mechanism (actually a - * callback function) for the Data Distribution Service to notify the application of - * relevant asynchronous status change events, such as a missed deadline, violation of - * a QosPolicy setting, etc. The TopicListener is related to - * changes in communication status StatusConditions. - * - * @see @ref DCPS_Modules_Topic "Topic" - * @see @ref DCPS_Modules_Infrastructure_Listener "Listener information" - */ -// TODO Uncomment when PSM listeners are implemented. -//class OMG_DDS_API TopicListener : public virtual AnyDataReaderListener -// TODO Remove the PSM listeners are implemented. -class TopicListener : public eprosima::fastdds::dds::TopicListener -{ -public: - - /** @cond */ - virtual ~TopicListener() - { - } - - /** @endcond */ -}; - -/** - * @brief - * Topic events Listener - * - * This listener is just like TopicListener, except - * that the application doesn't have to implement all operations. - * - * @code{.cpp} - * class ExampleListener : public virtual dds::pub::NoOpTopicListener - * { - * // Not necessary to implement any Listener operations. - * }; - * @endcode - * - * @see dds::pub::TopicListener - */ - -// TODO Uncomment when PSM DDS listeners are ready to be used -/* - class OMG_DDS_API NoOpTopicListener : - public virtual TopicListener, - public virtual NoOpAnyDataReaderListener - */ -// TODO Remove the PSM listeners are implemented. -class NoOpTopicListener : public virtual TopicListener -{ -public: - - /** @cond */ - virtual ~NoOpTopicListener() - { - } - - /** @endcond */ -}; - -} //namespace topic -} //namespace dds - -#endif //OMG_DDS_SUB_TOPIC_LISTENER_HPP_ diff --git a/include/dds/topic/detail/Topic.hpp b/include/dds/topic/detail/Topic.hpp deleted file mode 100644 index a2a606d1a3e..00000000000 --- a/include/dds/topic/detail/Topic.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_TOPIC_DETAIL_TOPIC_HPP_ -#define EPROSIMA_DDS_TOPIC_DETAIL_TOPIC_HPP_ - -#include - -/** - * @cond - * Ignore this file in the API - */ - -namespace dds { -namespace topic { -namespace detail { - -using Topic = eprosima::fastdds::dds::Topic; - -} //namespace detail -} //namespace topic -} //namespace dds - -/** @endcond */ - -#endif //EPROSIMA_DDS_TOPIC_DETAIL_TOPIC_HPP_ diff --git a/include/dds/topic/qos/TopicQos.hpp b/include/dds/topic/qos/TopicQos.hpp deleted file mode 100644 index d105d470709..00000000000 --- a/include/dds/topic/qos/TopicQos.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Object Management Group, Inc. - * Copyright 2010, PrismTech, Corp. - * Copyright 2010, Real-Time Innovations, Inc. - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_ -#define OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_ - -#include - -namespace dds { -namespace topic { -namespace qos { - -typedef dds::topic::qos::detail::TopicQos TopicQos; - -} //namespace qos -} //namespace topic -} //namespace dds - - -#endif //OMG_DDS_TOPIC_QOS_TOPIC_QOS_HPP_ diff --git a/include/dds/topic/qos/detail/TopicQos.hpp b/include/dds/topic/qos/detail/TopicQos.hpp deleted file mode 100644 index 120c37714dd..00000000000 --- a/include/dds/topic/qos/detail/TopicQos.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef EPROSIMA_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_ -#define EPROSIMA_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_ - -#include - -namespace dds { -namespace topic { -namespace qos { -namespace detail { - -using TopicQos = eprosima::fastdds::dds::TopicQos; - -} //namespace detail -} //namespace qos -} //namespace topic -} //namespace dds - -#endif //EPROSIMA_DDS_TOPIC_QOS_DETAIL_TOPIC_QOS_HPP_ diff --git a/include/fastdds/LibrarySettings.hpp b/include/fastdds/LibrarySettings.hpp new file mode 100644 index 00000000000..a84dd5eb96d --- /dev/null +++ b/include/fastdds/LibrarySettings.hpp @@ -0,0 +1,66 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file LibrarySettings.hpp + * + */ + +#ifndef _FASTDDS_LIBRARY_SETTINGS_HPP_ +#define _FASTDDS_LIBRARY_SETTINGS_HPP_ + +namespace eprosima { +namespace fastdds { + +enum IntraprocessDeliveryType +{ + INTRAPROCESS_OFF, + INTRAPROCESS_USER_DATA_ONLY, + INTRAPROCESS_FULL +}; + +/** + * Class LibraySettings, used by the user to define the Fast DDS library behaviour + * @ingroup FASTDDS_MODULE + */ +class LibrarySettings +{ +public: + + LibrarySettings() + { + } + + virtual ~LibrarySettings() + { + } + + bool operator ==( + const LibrarySettings& b) const + { + return (intraprocess_delivery == b.intraprocess_delivery); + } + + IntraprocessDeliveryType intraprocess_delivery = +#if HAVE_STRICT_REALTIME + INTRAPROCESS_OFF; +#else + INTRAPROCESS_FULL; +#endif // if HAVE_STRICT_REALTIME +}; + +} // namespace fastdds +} // namespace eprosima + +#endif /* _FASTDDS_LIBRARY_SETTINGS_HPP_ */ diff --git a/include/fastrtps/config.h.in b/include/fastdds/config.h.in similarity index 76% rename from include/fastrtps/config.h.in rename to include/fastdds/config.h.in index 9c380a933f9..8b3d118edfb 100644 --- a/include/fastrtps/config.h.in +++ b/include/fastdds/config.h.in @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef _FASTRTPS_CONFIG_H_ -#define _FASTRTPS_CONFIG_H_ +#ifndef _FASTDDS_CONFIG_H_ +#define _FASTDDS_CONFIG_H_ -#define FASTRTPS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ -#define FASTRTPS_VERSION_MINOR @PROJECT_VERSION_MINOR@ -#define FASTRTPS_VERSION_MICRO @PROJECT_VERSION_PATCH@ -#define FASTRTPS_VERSION_STR "@PROJECT_VERSION@" +#define FASTDDS_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define FASTDDS_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define FASTDDS_VERSION_MICRO @PROJECT_VERSION_PATCH@ +#define FASTDDS_VERSION_STR "@PROJECT_VERSION@" #define GEN_API_VER 2 @@ -85,7 +85,7 @@ // Log Info #ifndef FASTDDS_ENFORCE_LOG_INFO #cmakedefine FASTDDS_ENFORCE_LOG_INFO -#endif +#endif // ifndef FASTDDS_ENFORCE_LOG_INFO #ifndef HAVE_LOG_NO_INFO #define HAVE_LOG_NO_INFO @HAVE_LOG_NO_INFO@ #endif /* ifndef HAVE_LOG_NO_INFO */ @@ -105,29 +105,29 @@ // Deprecated macro #if __cplusplus >= 201402L -#define FASTRTPS_DEPRECATED(msg) [[ deprecated(msg) ]] +#define FASTDDS_DEPRECATED(msg) [[ deprecated(msg) ]] #elif defined(__GNUC__) || defined(__clang__) -#define FASTRTPS_DEPRECATED(msg) __attribute__ ((deprecated(msg))) +#define FASTDDS_DEPRECATED(msg) __attribute__ ((deprecated(msg))) #elif defined(_MSC_VER) -#define FASTRTPS_DEPRECATED(msg) __declspec(deprecated(msg)) +#define FASTDDS_DEPRECATED(msg) __declspec(deprecated(msg)) #else -#define FASTRTPS_DEPRECATED(msg) +#define FASTDDS_DEPRECATED(msg) #endif /* if __cplusplus >= 201402L */ // Deprecation with version #define FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg) \ - static_assert(FASTRTPS_VERSION_MAJOR < major, #entity_name " reached deprecation version " #major); \ - FASTRTPS_DEPRECATED(#entity_name " has been deprecated and will be removed on major version " #major ". " msg) + static_assert(FASTDDS_VERSION_MAJOR < major, #entity_name " reached deprecation version " #major); \ + FASTDDS_DEPRECATED(#entity_name " has been deprecated and will be removed on major version " #major ". " msg) #define FASTDDS_TODO_BEFORE(major, minor, msg) \ - static_assert((FASTRTPS_VERSION_MAJOR < major) || \ - (FASTRTPS_VERSION_MAJOR == major && FASTRTPS_VERSION_MINOR < minor), \ + static_assert((FASTDDS_VERSION_MAJOR < major) || \ + (FASTDDS_VERSION_MAJOR == major && FASTDDS_VERSION_MINOR < minor), \ "TODO before version " #major "." #minor " : " #msg) #if FASTCDR_VERSION_MAJOR > 1 #define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg) #else #define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) -#endif +#endif // if FASTCDR_VERSION_MAJOR > 1 -#endif // _FASTRTPS_CONFIG_H_ +#endif // _FASTDDS_CONFIG_H_ diff --git a/include/fastdds/dds/builtin/common/ReplyHeader.hpp b/include/fastdds/dds/builtin/common/ReplyHeader.hpp deleted file mode 100644 index f643a5789eb..00000000000 --- a/include/fastdds/dds/builtin/common/ReplyHeader.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file RequestHeader.hpp - * - */ - -#ifndef REPLYHEADER_HPP -#define REPLYHEADER_HPP - -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // fastcdr - -namespace fastdds { -namespace dds { -namespace rpc { - -struct ReplyHeader -{ - fastrtps::rtps::SampleIdentity relatedRequestId; - - RemoteExceptionCode_t remoteEx; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const ReplyHeader& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -} // namespace rpc -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -#endif // REPLYHEADER_HPP diff --git a/include/fastdds/dds/builtin/common/RequestHeader.hpp b/include/fastdds/dds/builtin/common/RequestHeader.hpp deleted file mode 100644 index bf7edd4fb8f..00000000000 --- a/include/fastdds/dds/builtin/common/RequestHeader.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file RequestHeader.hpp - * - */ - -#ifndef REQUESTHEADER_HPP -#define REQUESTHEADER_HPP - -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // fastcdr - -namespace fastdds { -namespace dds { -namespace rpc { - -struct RequestHeader -{ - eprosima::fastrtps::rtps::SampleIdentity requestId; - - InstanceName instanceName; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const RequestHeader& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -} // namespace rpc -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -#endif // REQUESTHEADER_HPP diff --git a/include/fastdds/dds/builtin/common/Types.hpp b/include/fastdds/dds/builtin/common/Types.hpp deleted file mode 100644 index b7e1e02b34a..00000000000 --- a/include/fastdds/dds/builtin/common/Types.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Types.hpp - * - */ - -#ifndef TYPES_HPP -#define TYPES_HPP - -#include -#if FASTCDR_VERSION_MAJOR == 1 -#include -#else -#include -#endif // FASTCDR_VERSION_MAJOR == 1 - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace rpc { - -using InstanceName = -#if FASTCDR_VERSION_MAJOR == 1 - fastrtps::string_255; -#else - fastcdr::string_255; -#endif // FASTCDR_VERSION_MAJOR == 1 - -enum RemoteExceptionCode_t -{ - REMOTE_EX_OK, - REMOTE_EX_UNSUPPORTED, - REMOTE_EX_INVALID_ARGUMENT, - REMOTE_EX_OUT_OF_RESOURCES, - REMOTE_EX_UNKNOWN_OPERATION, - REMOTE_EX_UNKNOWN_EXCEPTION -}; - -} // namespace rpc -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -#endif // TYPES_HPP diff --git a/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp b/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp deleted file mode 100644 index c6465905c80..00000000000 --- a/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupManager.hpp - * - */ - -#ifndef _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP -#define _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { - -class BuiltinProtocols; -class ReaderHistory; -class RTPSParticipantImpl; -class StatefulReader; -class StatefulWriter; -class ParticipantProxyData; -class WriterHistory; - -} // namespace rtps -} // namespace fastrtps - -namespace fastdds { -namespace dds { -namespace builtin { - -extern const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -/** - * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.2 specification. - * @ingroup XTYPES - */ -class TypeLookupManager -{ - friend class TypeLookupRequestListener; - friend class TypeLookupReplyListener; - -public: - - /** - * Constructor - * @param prot Pointer to the BuiltinProtocols object. - */ - TypeLookupManager( - fastrtps::rtps::BuiltinProtocols* prot); - - virtual ~TypeLookupManager(); - - /** - * Initialize the TypeLookupManager protocol. - * @param p Pointer to the RTPS participant implementation. - * @return true if the initialziacion was successful. - */ - bool init_typelookup_service( - fastrtps::rtps::RTPSParticipantImpl* p); - - /** - * Assign the remote endpoints for a newly discovered RTPSParticipant. - * @param pdata Pointer to the RTPSParticipantProxyData object. - * @return True if correct. - */ - bool assign_remote_endpoints( - const fastrtps::rtps::ParticipantProxyData& pdata); - - /** - * Remove remote endpoints from the typelookup service. - * @param pdata Pointer to the ParticipantProxyData to remove - */ - void remove_remote_endpoints( - fastrtps::rtps::ParticipantProxyData* pdata); - - /** - * Get the builtin protocols - * @return Builtin protocols - */ - fastrtps::rtps::BuiltinProtocols* get_builtin_protocols() - { - return builtin_protocols_; - } - - /** - * Get the builtin request writer - * @return stateful writer - */ - fastrtps::rtps::StatefulWriter* get_builtin_request_writer(); - - /** - * Get the builtin reply writer - * @return stateful writer - */ - fastrtps::rtps::StatefulWriter* get_builtin_reply_writer(); - - /** - * Get the builtin request writer's history - * @return writer history - */ - fastrtps::rtps::WriterHistory* get_builtin_request_writer_history(); - - /** - * Get the builtin reply writer's history - * @return writer history - */ - fastrtps::rtps::WriterHistory* get_builtin_reply_writer_history(); - - /** - * Get the builtin request reader - * @return stateful reader - */ - fastrtps::rtps::StatefulReader* get_builtin_request_reader(); - - /** - * Get the builtin reply reader - * @return stateful reader - */ - fastrtps::rtps::StatefulReader* get_builtin_reply_reader(); - - /** - * Get the builtin request reader's history - * @return reader history - */ - fastrtps::rtps::ReaderHistory* get_builtin_request_reader_history(); - - /** - * Get the builtin reply reader's history - * @return reader history - */ - fastrtps::rtps::ReaderHistory* get_builtin_reply_reader_history(); - - /* TODO Uncomment if security is implemented. - #if HAVE_SECURITY - bool pairing_remote_reader_with_local_writer_after_security( - const fastrtps::rtps::GUID_t& local_writer, - const fastrtps::rtps::ReaderProxyData& remote_reader_data); - - bool pairing_remote_writer_with_local_reader_after_security( - const fastrtps::rtps::GUID_t& local_reader, - const fastrtps::rtps::WriterProxyData& remote_writer_data); - #endif - */ - - fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const; - - fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const; - -private: - - /** - * Create the endpoints used in the TypeLookupManager. - * @return true if correct. - */ - bool create_endpoints(); - - /** - * Get the RTPS participant - * @return RTPS participant - */ - inline fastrtps::rtps::RTPSParticipantImpl* get_RTPS_participant() - { - return participant_; - } - - //! Get out instanceName as defined in 7.6.2.3.4 of the XTypes 1.2 document - std::string get_instanceName() const; - - //! Aux method to send requests - bool send_request( - TypeLookup_Request& req) const; - - //! Aux method to send replies - bool send_reply( - TypeLookup_Reply& rep) const; - - //! Aux method to received requests - bool recv_request( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Request& req) const; - - //! Aux method to received replies - bool recv_reply( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Reply& rep) const; - - const fastrtps::rtps::GUID_t& get_builtin_request_writer_guid() const; - - //!Pointer to the local RTPSParticipant. - fastrtps::rtps::RTPSParticipantImpl* participant_; - - //!Pointer to the builtinprotocol class. - fastrtps::rtps::BuiltinProtocols* builtin_protocols_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_request_writer_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_request_reader_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_reply_writer_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_reply_reader_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_request_writer_history_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_reply_writer_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_request_reader_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_reply_reader_history_; - - //!Request Listener object. - TypeLookupRequestListener* request_listener_; - - //!Reply Listener object. - TypeLookupReplyListener* reply_listener_; - - std::mutex temp_data_lock_; - fastrtps::rtps::ReaderProxyData temp_reader_proxy_data_; - fastrtps::rtps::WriterProxyData temp_writer_proxy_data_; - - mutable fastrtps::rtps::SequenceNumber_t request_seq_number_; - - mutable TypeLookup_RequestTypeSupport request_type_; - - mutable TypeLookup_ReplyTypeSupport reply_type_; - - /* TODO Uncomment if security is implemented. - #if HAVE_SECURITY - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_request_writer_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_reply_writer_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_request_reader_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_reply_reader_secure_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_request_writer_secure_history_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_reply_writer_secure_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_request_reader_secure_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_reply_reader_secure_history_; - - bool create_secure_endpoints(); - #endif - */ - - void request_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); - - void reply_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); -}; - -} /* namespace builtin */ -} /* namespace dds */ -} /* namespace fastdds */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP */ diff --git a/include/fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp b/include/fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp deleted file mode 100644 index adc4b6c6499..00000000000 --- a/include/fastdds/dds/builtin/typelookup/TypeLookupReplyListener.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupReplyListener.hpp - * - */ - -#ifndef TYPELOOKUP_REPLY_LISTENER_HPP_ -#define TYPELOOKUP_REPLY_LISTENER_HPP_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include - - -namespace eprosima { -namespace fastrtps { - -namespace types { -class TypeObjectFactory; -} // namespace types - -namespace rtps { - -class RTPSReader; -struct CacheChange_t; - -} // namespace rtps -} // namespace fastrtp - -namespace fastdds { -namespace dds { -namespace builtin { - -class TypeLookupManager; - -/** - * Class TypeLookupReplyListener that receives the typelookup request messages of remote endpoints. - * @ingroup TYPES_MODULE - */ -class TypeLookupReplyListener : public fastrtps::rtps::ReaderListener, public fastrtps::rtps::WriterListener -{ -public: - - /** - * @brief Constructor - * @param pwlp Pointer to the writer liveliness protocol - */ - TypeLookupReplyListener( - TypeLookupManager* pwlp); - - /** - * @brief Destructor - */ - virtual ~TypeLookupReplyListener() override; - - /** - * @brief Method call when this class is notified of a new cache change - * @param reader The reader receiving the cache change - * @param change The cache change - */ - void onNewCacheChangeAdded( - fastrtps::rtps::RTPSReader* reader, - const fastrtps::rtps::CacheChange_t* const change) override; - - /** - * @brief This method is called when all the readers matched with this Writer acknowledge that a cache - * change has been received. - * @param change The cache change - */ - void onWriterChangeReceivedByAll( - fastrtps::rtps::RTPSWriter*, - fastrtps::rtps::CacheChange_t* change) override; - -private: - - //! A pointer to the typelookup manager - TypeLookupManager* tlm_; - - //! A pointer to the TypeObject factory. - fastrtps::types::TypeObjectFactory* factory_; -}; - -} /* namespace builtin */ -} /* namespace dds */ -} /* namespace fastdds */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* TYPELOOKUP_REPLY_LISTENER_HPP_*/ diff --git a/include/fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp b/include/fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp deleted file mode 100644 index 87741fc84c5..00000000000 --- a/include/fastdds/dds/builtin/typelookup/TypeLookupRequestListener.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupRequestListener.hpp - * - */ - -#ifndef TYPELOOKUP_REQUEST_LISTENER_HPP_ -#define TYPELOOKUP_REQUEST_LISTENER_HPP_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include - - -namespace eprosima { -namespace fastrtps { - -namespace types { -class TypeObjectFactory; -} // namespace types - -namespace rtps { - -class RTPSReader; -struct CacheChange_t; - -} // namespace rtps -} // namespace fastrtp - -namespace fastdds { -namespace dds { -namespace builtin { - -class TypeLookupManager; - -/** - * Class TypeLookupRequestListener that receives the typelookup request messages of remote endpoints. - * @ingroup TYPES_MODULE - */ -class TypeLookupRequestListener : public fastrtps::rtps::ReaderListener, public fastrtps::rtps::WriterListener -{ -public: - - /** - * @brief Constructor - * @param pwlp Pointer to the writer liveliness protocol - */ - TypeLookupRequestListener( - TypeLookupManager* pwlp); - - /** - * @brief Destructor - */ - virtual ~TypeLookupRequestListener() override; - - /** - * @brief Method call when this class is notified of a new cache change - * @param reader The reader receiving the cache change - * @param change The cache change - */ - void onNewCacheChangeAdded( - fastrtps::rtps::RTPSReader* reader, - const fastrtps::rtps::CacheChange_t* const change) override; - - /** - * @brief This method is called when all the readers matched with this Writer acknowledge that a cache - * change has been received. - * @param change The cache change - */ - void onWriterChangeReceivedByAll( - fastrtps::rtps::RTPSWriter*, - fastrtps::rtps::CacheChange_t* change) override; - -private: - - //! A pointer to the typelookup manager - TypeLookupManager* tlm_; - - //! A pointer to the TypeObject factory. - fastrtps::types::TypeObjectFactory* factory_; - -}; - -} /* namespace builtin */ -} /* namespace dds */ -} /* namespace fastdds */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* TYPELOOKUP_REQUEST_LISTENER_HPP_*/ diff --git a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp deleted file mode 100644 index 23ebf8ec020..00000000000 --- a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupTypes.hpp - * - */ - -#ifndef TYPELOOKUPTYPES_HPP -#define TYPELOOKUPTYPES_HPP - -#include -#include - -#include -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // namespace fastcdr - -namespace fastdds { -namespace dds { -namespace builtin { - -const int32_t TypeLookup_getTypes_Hash = static_cast(0xd35282d1); -const int32_t TypeLookup_getDependencies_Hash = static_cast(0x31fbaa35); - -struct TypeLookup_getTypes_In -{ - std::vector type_ids; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypes_In& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -struct TypeLookup_getTypes_Out -{ - std::vector types; - - std::vector complete_to_minimal; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypes_Out& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypes_Result -{ -public: - - RTPS_DllAPI TypeLookup_getTypes_Result(); - - RTPS_DllAPI ~TypeLookup_getTypes_Result(); - - RTPS_DllAPI TypeLookup_getTypes_Result( - const TypeLookup_getTypes_Result& x); - - RTPS_DllAPI TypeLookup_getTypes_Result( - TypeLookup_getTypes_Result&& x); - - RTPS_DllAPI TypeLookup_getTypes_Result& operator =( - const TypeLookup_getTypes_Result& x); - - RTPS_DllAPI TypeLookup_getTypes_Result& operator =( - TypeLookup_getTypes_Result&& x); - - RTPS_DllAPI void _d( - int32_t __d); - - RTPS_DllAPI int32_t _d() const; - - RTPS_DllAPI int32_t& _d(); - - RTPS_DllAPI void result( - const TypeLookup_getTypes_Out& _result); - - RTPS_DllAPI void result( - TypeLookup_getTypes_Out&& _result); - - RTPS_DllAPI const TypeLookup_getTypes_Out& result() const; - - RTPS_DllAPI TypeLookup_getTypes_Out& result(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypes_Result& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - TypeLookup_getTypes_Out m_result; -}; - -class TypeLookup_getTypeDependencies_In -{ -public: - - std::vector type_ids; - - std::vector continuation_point; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_In& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypeDependencies_Out -{ -public: - - std::vector dependent_typeids; - - std::vector continuation_point; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Out& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypeDependencies_Result -{ -public: - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result(); - - RTPS_DllAPI ~TypeLookup_getTypeDependencies_Result(); - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result( - const TypeLookup_getTypeDependencies_Result& x); - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result( - TypeLookup_getTypeDependencies_Result&& x); - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result& operator =( - const TypeLookup_getTypeDependencies_Result& x); - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result& operator =( - TypeLookup_getTypeDependencies_Result&& x); - - RTPS_DllAPI void _d( - int32_t __d); - - RTPS_DllAPI int32_t _d() const; - - RTPS_DllAPI int32_t& _d(); - - RTPS_DllAPI void result( - const TypeLookup_getTypeDependencies_Out& _result); - - RTPS_DllAPI void result( - TypeLookup_getTypeDependencies_Out&& _result); - - RTPS_DllAPI const TypeLookup_getTypeDependencies_Out& result() const; - - RTPS_DllAPI TypeLookup_getTypeDependencies_Out& result(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Result& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypeDependencies_Out m_result; -}; -class TypeLookup_Call -{ -public: - - RTPS_DllAPI TypeLookup_Call(); - - RTPS_DllAPI ~TypeLookup_Call(); - - RTPS_DllAPI TypeLookup_Call( - const TypeLookup_Call& x); - - RTPS_DllAPI TypeLookup_Call( - TypeLookup_Call&& x); - - RTPS_DllAPI TypeLookup_Call& operator =( - const TypeLookup_Call& x); - - RTPS_DllAPI TypeLookup_Call& operator =( - TypeLookup_Call&& x); - - RTPS_DllAPI void _d( - int32_t __d); - - RTPS_DllAPI int32_t _d() const; - - RTPS_DllAPI int32_t& _d(); - - RTPS_DllAPI void getTypes( - const TypeLookup_getTypes_In& _getTypes); - - RTPS_DllAPI void getTypes( - TypeLookup_getTypes_In&& _getTypes); - - RTPS_DllAPI const TypeLookup_getTypes_In& getTypes() const; - - RTPS_DllAPI TypeLookup_getTypes_In& getTypes(); - - RTPS_DllAPI void getTypeDependencies( - const TypeLookup_getTypeDependencies_In& _getTypeDependencies); - - RTPS_DllAPI void getTypeDependencies( - TypeLookup_getTypeDependencies_In&& _getTypeDependencies); - - RTPS_DllAPI const TypeLookup_getTypeDependencies_In& getTypeDependencies() const; - - RTPS_DllAPI TypeLookup_getTypeDependencies_In& getTypeDependencies(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_Call& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypes_In m_getTypes; - TypeLookup_getTypeDependencies_In m_getTypeDependencies; -}; - -class TypeLookup_Request -{ -public: - - rpc::RequestHeader header; - - TypeLookup_Call data; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_Request& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_Return -{ -public: - - RTPS_DllAPI TypeLookup_Return(); - - RTPS_DllAPI ~TypeLookup_Return(); - - RTPS_DllAPI TypeLookup_Return( - const TypeLookup_Return& x); - - RTPS_DllAPI TypeLookup_Return( - TypeLookup_Return&& x); - - RTPS_DllAPI TypeLookup_Return& operator =( - const TypeLookup_Return& x); - - RTPS_DllAPI TypeLookup_Return& operator =( - TypeLookup_Return&& x); - - RTPS_DllAPI void _d( - int32_t __d); - - RTPS_DllAPI int32_t _d() const; - - RTPS_DllAPI int32_t& _d(); - - RTPS_DllAPI void getType( - const TypeLookup_getTypes_Result& _getType); - - RTPS_DllAPI void getType( - TypeLookup_getTypes_Result&& _getType); - - RTPS_DllAPI const TypeLookup_getTypes_Result& getType() const; - - RTPS_DllAPI TypeLookup_getTypes_Result& getType(); - - RTPS_DllAPI void getTypeDependencies( - const TypeLookup_getTypeDependencies_Result& _getTypeDependencies); - - RTPS_DllAPI void getTypeDependencies( - TypeLookup_getTypeDependencies_Result&& _getTypeDependencies); - - RTPS_DllAPI const TypeLookup_getTypeDependencies_Result& getTypeDependencies() const; - - RTPS_DllAPI TypeLookup_getTypeDependencies_Result& getTypeDependencies(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_Return& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypes_Result m_getType; - TypeLookup_getTypeDependencies_Result m_getTypeDependencies; -}; - -class TypeLookup_Reply -{ -public: - - rpc::RequestHeader header; - - TypeLookup_Return return_value; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeLookup_Reply& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static bool isKeyDefined() - { - return false; - } - -}; - -// TypeSupports -class TypeLookup_RequestPubSubType : public TopicDataType -{ -public: - - TypeLookup_RequestPubSubType(); - - virtual ~TypeLookup_RequestPubSubType() override; - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - void* createData() override; - - void deleteData( - void* data) override; -}; - -class TypeLookup_ReplyPubSubType : public TopicDataType -{ -public: - - TypeLookup_ReplyPubSubType(); - - virtual ~TypeLookup_ReplyPubSubType() override; - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - void* createData() override; - - void deleteData( - void* data) override; -}; - -class TypeLookup_RequestTypeSupport : public TypeSupport -{ -public: - - RTPS_DllAPI bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - RTPS_DllAPI bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - RTPS_DllAPI bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - RTPS_DllAPI void* create_data() override; - - RTPS_DllAPI void delete_data( - void* data) override; -}; - -class TypeLookup_ReplyTypeSupport : public TypeSupport -{ -public: - - RTPS_DllAPI bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - RTPS_DllAPI bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - RTPS_DllAPI bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - RTPS_DllAPI void* create_data() override; - - RTPS_DllAPI void delete_data( - void* data) override; -}; - - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -#endif // TYPELOOKUPTYPES_HPP diff --git a/include/fastdds/dds/common/InstanceHandle.hpp b/include/fastdds/dds/common/InstanceHandle.hpp index 144af61e0dd..8f55182cb21 100644 --- a/include/fastdds/dds/common/InstanceHandle.hpp +++ b/include/fastdds/dds/common/InstanceHandle.hpp @@ -21,7 +21,7 @@ #define _FASTDDS_DDS_COMMON_INSTANCEHANDLE_HPP_ #include -#include +#include namespace eprosima { @@ -30,7 +30,7 @@ namespace dds { using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -extern RTPS_DllAPI const InstanceHandle_t HANDLE_NIL; +extern FASTDDS_EXPORTED_API const InstanceHandle_t HANDLE_NIL; } // namespace dds } // namespace fastdds diff --git a/include/fastdds/dds/core/Entity.hpp b/include/fastdds/dds/core/Entity.hpp index e4399624e80..c1d22d9269e 100644 --- a/include/fastdds/dds/core/Entity.hpp +++ b/include/fastdds/dds/core/Entity.hpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include namespace eprosima { namespace fastdds { @@ -43,7 +43,7 @@ class Entity * * @param mask StatusMask (default: all) */ - RTPS_DllAPI Entity( + FASTDDS_EXPORTED_API Entity( const StatusMask& mask = StatusMask::all()) : status_mask_(mask) , status_condition_(this) @@ -56,10 +56,10 @@ class Entity * * @return RETCODE_OK */ - virtual fastrtps::types::ReturnCode_t enable() + virtual ReturnCode_t enable() { enable_ = true; - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } /** @@ -75,7 +75,7 @@ class Entity * * @return Reference to the StatusMask with the relevant statuses set to 1 */ - RTPS_DllAPI const StatusMask& get_status_mask() const + FASTDDS_EXPORTED_API const StatusMask& get_status_mask() const { return status_mask_; } @@ -94,7 +94,7 @@ class Entity * * @return const reference to the StatusMask with the triggered statuses set to 1 */ - RTPS_DllAPI const StatusMask& get_status_changes() const; + FASTDDS_EXPORTED_API const StatusMask& get_status_changes() const; /** * @brief Retrieves the instance handler that represents the Entity @@ -111,12 +111,12 @@ class Entity * * @return true if enabled, false if not */ - RTPS_DllAPI bool is_enabled() const + FASTDDS_EXPORTED_API bool is_enabled() const { return enable_; } - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const Entity& other) const { return (this->instance_handle_ == other.instance_handle_); @@ -127,7 +127,7 @@ class Entity * * @return Reference to StatusCondition object */ - RTPS_DllAPI StatusCondition& get_statuscondition() + FASTDDS_EXPORTED_API StatusCondition& get_statuscondition() { return status_condition_; } @@ -139,7 +139,7 @@ class Entity * * @param handle Instance Handle */ - RTPS_DllAPI void set_instance_handle( + FASTDDS_EXPORTED_API void set_instance_handle( const InstanceHandle_t& handle) { instance_handle_ = handle; diff --git a/include/fastdds/dds/core/ReturnCode.hpp b/include/fastdds/dds/core/ReturnCode.hpp new file mode 100644 index 00000000000..607e091c670 --- /dev/null +++ b/include/fastdds/dds/core/ReturnCode.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ReturnCode.hpp + */ + +#ifndef _FASTDDS_DDS_CORE_RETURNCODE_HPP_ +#define _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + +#include "detail/DDSReturnCode.hpp" +#include "detail/DDSSecurityReturnCode.hpp" + +#endif // _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + diff --git a/include/fastdds/dds/core/Types.hpp b/include/fastdds/dds/core/Types.hpp new file mode 100644 index 00000000000..8f24af6545b --- /dev/null +++ b/include/fastdds/dds/core/Types.hpp @@ -0,0 +1,32 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_CORE_TYPES_HPP +#define FASTDDS_DDS_CORE_TYPES_HPP + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +typedef uint32_t DomainId_t; + +const int32_t LENGTH_UNLIMITED = -1; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_CORE_TYPES_HPP diff --git a/include/fastdds/dds/core/condition/Condition.hpp b/include/fastdds/dds/core/condition/Condition.hpp index ef364c418b3..3879bef7880 100644 --- a/include/fastdds/dds/core/condition/Condition.hpp +++ b/include/fastdds/dds/core/condition/Condition.hpp @@ -24,7 +24,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -46,7 +46,7 @@ class Condition * @brief Retrieves the trigger_value of the Condition * @return true if trigger_value is set to 'true', 'false' otherwise */ - RTPS_DllAPI virtual bool get_trigger_value() const + FASTDDS_EXPORTED_API virtual bool get_trigger_value() const { EPROSIMA_LOG_WARNING(CONDITION, "get_trigger_value public member function not implemented"); return false; // TODO return trigger value diff --git a/include/fastdds/dds/core/condition/GuardCondition.hpp b/include/fastdds/dds/core/condition/GuardCondition.hpp index 1912fb8c92f..e4329556a6b 100644 --- a/include/fastdds/dds/core/condition/GuardCondition.hpp +++ b/include/fastdds/dds/core/condition/GuardCondition.hpp @@ -23,10 +23,8 @@ #include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include +#include namespace eprosima { namespace fastdds { @@ -45,18 +43,18 @@ class GuardCondition : public Condition { public: - RTPS_DllAPI GuardCondition(); + FASTDDS_EXPORTED_API GuardCondition(); - RTPS_DllAPI ~GuardCondition(); + FASTDDS_EXPORTED_API ~GuardCondition(); - RTPS_DllAPI bool get_trigger_value() const override; + FASTDDS_EXPORTED_API bool get_trigger_value() const override; /** * @brief Set the trigger_value * @param value new value for trigger * @return RETURN_OK */ - RTPS_DllAPI ReturnCode_t set_trigger_value( + FASTDDS_EXPORTED_API ReturnCode_t set_trigger_value( bool value); private: diff --git a/include/fastdds/dds/core/condition/StatusCondition.hpp b/include/fastdds/dds/core/condition/StatusCondition.hpp index 49fd0adc920..a3d1b1ca285 100644 --- a/include/fastdds/dds/core/condition/StatusCondition.hpp +++ b/include/fastdds/dds/core/condition/StatusCondition.hpp @@ -21,11 +21,9 @@ #define _FASTDDS_STATUS_CONDITION_HPP_ #include +#include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace eprosima { namespace fastdds { @@ -68,27 +66,27 @@ class StatusCondition final : public Condition * @brief Retrieves the trigger_value of the Condition * @return true if trigger_value is set to 'true', 'false' otherwise */ - RTPS_DllAPI bool get_trigger_value() const override; + FASTDDS_EXPORTED_API bool get_trigger_value() const override; /** * @brief Defines the list of communication statuses that are taken into account to determine the trigger_value * @param mask defines the mask for the status * @return RETCODE_OK with everything ok, error code otherwise */ - RTPS_DllAPI ReturnCode_t set_enabled_statuses( + FASTDDS_EXPORTED_API ReturnCode_t set_enabled_statuses( const StatusMask& mask); /** * @brief Retrieves the list of communication statuses that are taken into account to determine the trigger_value * @return Status set or default status if it has not been set */ - RTPS_DllAPI const StatusMask& get_enabled_statuses() const; + FASTDDS_EXPORTED_API const StatusMask& get_enabled_statuses() const; /** * @brief Returns the Entity associated * @return Entity */ - RTPS_DllAPI Entity* get_entity() const; + FASTDDS_EXPORTED_API Entity* get_entity() const; detail::StatusConditionImpl* get_impl() const { diff --git a/include/fastdds/dds/core/condition/WaitSet.hpp b/include/fastdds/dds/core/condition/WaitSet.hpp index 2066aaede7f..367fd591ce2 100644 --- a/include/fastdds/dds/core/condition/WaitSet.hpp +++ b/include/fastdds/dds/core/condition/WaitSet.hpp @@ -23,11 +23,9 @@ #include #include +#include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace eprosima { namespace fastdds { @@ -47,9 +45,9 @@ class WaitSet { public: - RTPS_DllAPI WaitSet(); + FASTDDS_EXPORTED_API WaitSet(); - RTPS_DllAPI ~WaitSet(); + FASTDDS_EXPORTED_API ~WaitSet(); WaitSet( const WaitSet&) = delete; @@ -65,7 +63,7 @@ class WaitSet * @param cond Condition * @return RETCODE_OK if attached correctly, error code otherwise */ - RTPS_DllAPI ReturnCode_t attach_condition( + FASTDDS_EXPORTED_API ReturnCode_t attach_condition( const Condition& cond); @@ -74,7 +72,7 @@ class WaitSet * @param cond Condition * @return RETCODE_OK if detached correctly, PRECONDITION_NOT_MET if condition was not attached */ - RTPS_DllAPI ReturnCode_t detach_condition( + FASTDDS_EXPORTED_API ReturnCode_t detach_condition( const Condition& cond); /** @@ -86,7 +84,7 @@ class WaitSet * @return RETCODE_OK if everything correct, PRECONDITION_NOT_MET if WaitSet already waiting, TIMEOUT if maximum * time expired, error code otherwise */ - RTPS_DllAPI ReturnCode_t wait( + FASTDDS_EXPORTED_API ReturnCode_t wait( ConditionSeq& active_conditions, const fastrtps::Duration_t timeout) const; @@ -95,7 +93,7 @@ class WaitSet * @param attached_conditions Reference to the collection of attached conditions * @return RETCODE_OK if everything correct, error code otherwise */ - RTPS_DllAPI ReturnCode_t get_conditions( + FASTDDS_EXPORTED_API ReturnCode_t get_conditions( ConditionSeq& attached_conditions) const; private: diff --git a/include/fastdds/dds/core/detail/DDSReturnCode.hpp b/include/fastdds/dds/core/detail/DDSReturnCode.hpp new file mode 100644 index 00000000000..24c32e8e8e8 --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSReturnCode.hpp @@ -0,0 +1,84 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DDSReturnCode.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDSRETURNCODE_SOURCE) +#define DDSRETURNCODE_DllAPI __declspec( dllexport ) +#else +#define DDSRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSRETURNCODE_SOURCE +#else +#define DDSRETURNCODE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDSRETURNCODE_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef int32_t ReturnCode_t; + +const ReturnCode_t RETCODE_OK = 0; +const ReturnCode_t RETCODE_ERROR = 1; +const ReturnCode_t RETCODE_UNSUPPORTED = 2; +const ReturnCode_t RETCODE_BAD_PARAMETER = 3; +const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; +const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; +const ReturnCode_t RETCODE_NOT_ENABLED = 6; +const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; +const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; +const ReturnCode_t RETCODE_ALREADY_DELETED = 9; +const ReturnCode_t RETCODE_TIMEOUT = 10; +const ReturnCode_t RETCODE_NO_DATA = 11; +const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ + + diff --git a/include/fastdds/dds/core/detail/DDSReturnCode.idl b/include/fastdds/dds/core/detail/DDSReturnCode.idl new file mode 100644 index 00000000000..0d286676f0c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSReturnCode.idl @@ -0,0 +1,25 @@ +// The content of this file, related to the DDS's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS/20140501/dds_dcps.idl + +module DDS { + + typedef long ReturnCode_t; + + // ---------------------------------------------------------------------- + // Return codes + // ---------------------------------------------------------------------- + const ReturnCode_t RETCODE_OK = 0; + const ReturnCode_t RETCODE_ERROR = 1; + const ReturnCode_t RETCODE_UNSUPPORTED = 2; + const ReturnCode_t RETCODE_BAD_PARAMETER = 3; + const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; + const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; + const ReturnCode_t RETCODE_NOT_ENABLED = 6; + const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; + const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; + const ReturnCode_t RETCODE_ALREADY_DELETED = 9; + const ReturnCode_t RETCODE_TIMEOUT = 10; + const ReturnCode_t RETCODE_NO_DATA = 11; + const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; + +}; diff --git a/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp new file mode 100644 index 00000000000..36955743934 --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp @@ -0,0 +1,71 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file DDSSecurityReturnCode.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ + +#include +#include +#include "DDSReturnCode.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDSSECURITYRETURNCODE_SOURCE) +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllexport ) +#else +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSSECURITYRETURNCODE_SOURCE +#else +#define DDSSECURITYRETURNCODE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDSSECURITYRETURNCODE_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ + + diff --git a/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl new file mode 100644 index 00000000000..3248239741c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl @@ -0,0 +1,10 @@ +// The content of this file, related to the DDS Security's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS-SECURITY/20170901/dds_security_plugins_spis.idl +#include "DDSReturnCode.idl" + +module DDS { + + // DDSSEC11-24 + const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +}; diff --git a/include/fastdds/dds/core/policy/ParameterTypes.hpp b/include/fastdds/dds/core/policy/ParameterTypes.hpp index ba68867dcb1..3fc0a760456 100644 --- a/include/fastdds/dds/core/policy/ParameterTypes.hpp +++ b/include/fastdds/dds/core/policy/ParameterTypes.hpp @@ -21,20 +21,20 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include +#include + +#include + #include #include #include -#include - #if HAVE_SECURITY #include #include #endif // if HAVE_SECURITY -#include -#include - namespace eprosima { namespace fastrtps { @@ -174,7 +174,7 @@ class Parameter_t /** * @brief Constructor without parameters */ - RTPS_DllAPI Parameter_t() + FASTDDS_EXPORTED_API Parameter_t() : Pid(PID_PAD) , length(0) { @@ -186,7 +186,7 @@ class Parameter_t * @param pid Pid of the parameter * @param length Its associated length */ - RTPS_DllAPI Parameter_t( + FASTDDS_EXPORTED_API Parameter_t( ParameterId_t pid, uint16_t length) : Pid(pid) @@ -197,7 +197,7 @@ class Parameter_t /** * @brief Destructor */ - virtual RTPS_DllAPI ~Parameter_t() + virtual FASTDDS_EXPORTED_API ~Parameter_t() { } @@ -352,7 +352,7 @@ class ParameterString_t : public Parameter_t ParameterString_t( ParameterId_t pid, uint16_t in_length, - const fastrtps::string_255& strin) + const fastcdr::string_255& strin) : Parameter_t(pid, in_length) , string_(strin) { @@ -392,7 +392,7 @@ class ParameterString_t : public Parameter_t private: //!Name.
By default, empty string. - fastrtps::string_255 string_; + fastcdr::string_255 string_; }; /** diff --git a/include/fastdds/dds/core/policy/QosPolicies.hpp b/include/fastdds/dds/core/policy/QosPolicies.hpp index 26b5c0b6ac9..b28c77f6137 100644 --- a/include/fastdds/dds/core/policy/QosPolicies.hpp +++ b/include/fastdds/dds/core/policy/QosPolicies.hpp @@ -20,9 +20,12 @@ #ifndef _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ #define _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ +#include #include #include +#include +#include #include #include #include @@ -35,8 +38,7 @@ #include #include -#include -#include +#include namespace eprosima { namespace fastdds { @@ -195,7 +197,7 @@ class EntityFactoryQosPolicy /** * @brief Constructor without parameters */ - RTPS_DllAPI EntityFactoryQosPolicy() + FASTDDS_EXPORTED_API EntityFactoryQosPolicy() : autoenable_created_entities(true) { } @@ -205,7 +207,7 @@ class EntityFactoryQosPolicy * * @param autoenable Value for the autoenable_created_entities boolean */ - RTPS_DllAPI EntityFactoryQosPolicy( + FASTDDS_EXPORTED_API EntityFactoryQosPolicy( bool autoenable) : autoenable_created_entities(autoenable) { @@ -214,7 +216,7 @@ class EntityFactoryQosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~EntityFactoryQosPolicy() + virtual FASTDDS_EXPORTED_API ~EntityFactoryQosPolicy() { } @@ -277,7 +279,7 @@ class DurabilityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DurabilityQosPolicy() + FASTDDS_EXPORTED_API DurabilityQosPolicy() : Parameter_t(PID_DURABILITY, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(VOLATILE_DURABILITY_QOS) @@ -287,7 +289,7 @@ class DurabilityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DurabilityQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DurabilityQosPolicy() = default; /** * Translates kind to rtps layer equivalent @@ -362,7 +364,7 @@ class DeadlineQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DeadlineQosPolicy() + FASTDDS_EXPORTED_API DeadlineQosPolicy() : Parameter_t(PID_DEADLINE, PARAMETER_TIME_LENGTH) , QosPolicy(true) , period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) @@ -372,7 +374,7 @@ class DeadlineQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DeadlineQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DeadlineQosPolicy() = default; bool operator ==( const DeadlineQosPolicy& b) const @@ -415,7 +417,7 @@ class LatencyBudgetQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI LatencyBudgetQosPolicy() + FASTDDS_EXPORTED_API LatencyBudgetQosPolicy() : Parameter_t(PID_LATENCY_BUDGET, PARAMETER_TIME_LENGTH) , QosPolicy(true) , duration(0, 0) @@ -425,7 +427,7 @@ class LatencyBudgetQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~LatencyBudgetQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~LatencyBudgetQosPolicy() = default; bool operator ==( const LatencyBudgetQosPolicy& b) const @@ -487,7 +489,7 @@ class LivelinessQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI LivelinessQosPolicy() + FASTDDS_EXPORTED_API LivelinessQosPolicy() : Parameter_t(PID_LIVELINESS, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH) , QosPolicy(true) , kind(AUTOMATIC_LIVELINESS_QOS) @@ -499,7 +501,7 @@ class LivelinessQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~LivelinessQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~LivelinessQosPolicy() = default; bool operator ==( const LivelinessQosPolicy& b) const @@ -569,7 +571,7 @@ class ReliabilityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI ReliabilityQosPolicy() + FASTDDS_EXPORTED_API ReliabilityQosPolicy() : Parameter_t(PID_RELIABILITY, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH) , QosPolicy(true) //indicate send always , kind(BEST_EFFORT_RELIABILITY_QOS) @@ -580,7 +582,7 @@ class ReliabilityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~ReliabilityQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~ReliabilityQosPolicy() = default; bool operator ==( const ReliabilityQosPolicy& b) const @@ -651,7 +653,7 @@ class OwnershipQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI OwnershipQosPolicy() + FASTDDS_EXPORTED_API OwnershipQosPolicy() : Parameter_t(PID_OWNERSHIP, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(SHARED_OWNERSHIP_QOS) @@ -661,7 +663,7 @@ class OwnershipQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~OwnershipQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~OwnershipQosPolicy() = default; bool operator ==( const OwnershipQosPolicy& b) const @@ -718,7 +720,7 @@ class DestinationOrderQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DestinationOrderQosPolicy() + FASTDDS_EXPORTED_API DestinationOrderQosPolicy() : Parameter_t(PID_DESTINATION_ORDER, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS) @@ -728,7 +730,7 @@ class DestinationOrderQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DestinationOrderQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DestinationOrderQosPolicy() = default; bool operator ==( const DestinationOrderQosPolicy& b) const @@ -761,7 +763,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, public: - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid) : Parameter_t(pid, 0) , QosPolicy(false) @@ -769,7 +771,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, { } - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid, uint16_t in_length) : Parameter_t(pid, in_length) @@ -786,7 +788,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @param data data to copy in the newly created object */ - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( const GenericDataQosPolicy& data) : Parameter_t(data.Pid, data.length) , QosPolicy(false) @@ -803,7 +805,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * @param pid Id of the parameter * @param data data to copy in the newly created object */ - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid, const collection_type& data) : Parameter_t(pid, 0) @@ -814,7 +816,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, length = static_cast((size() + 7u) & ~3u); } - virtual RTPS_DllAPI ~GenericDataQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~GenericDataQosPolicy() = default; /** * Copies data from underlying collection type. @@ -919,7 +921,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @return raw data as vector of octets. * */ - RTPS_DllAPI inline const collection_type& data_vec() const + FASTDDS_EXPORTED_API inline const collection_type& data_vec() const { return collection_; } @@ -929,7 +931,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @return raw data as vector of octets. * */ - RTPS_DllAPI inline collection_type& data_vec() + FASTDDS_EXPORTED_API inline collection_type& data_vec() { return collection_; } @@ -939,7 +941,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @param vec raw data to set. * */ - RTPS_DllAPI inline void data_vec( + FASTDDS_EXPORTED_API inline void data_vec( const collection_type& vec) { if (collection_ != vec) @@ -955,7 +957,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @return raw data as vector of octets. * */ - RTPS_DllAPI inline const collection_type& getValue() const + FASTDDS_EXPORTED_API inline const collection_type& getValue() const { return collection_; } @@ -965,7 +967,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @param vec raw data to set. * */ - RTPS_DllAPI inline void setValue( + FASTDDS_EXPORTED_API inline void setValue( const collection_type& vec) { data_vec(vec); @@ -986,12 +988,12 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, { \ public: \ \ - RTPS_DllAPI TClassName() \ + FASTDDS_EXPORTED_API TClassName() \ : GenericDataQosPolicy(TPid) \ { \ } \ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ uint16_t in_length) \ : GenericDataQosPolicy(TPid, in_length) \ { \ @@ -1005,7 +1007,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * \ * @param data data to copy in the newly created object \ */ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ const TClassName &data) = default; \ \ /** \ @@ -1016,13 +1018,13 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * \ * @param data data to copy in the newly created object \ */ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ const collection_type &data) \ : GenericDataQosPolicy(TPid, data) \ { \ } \ \ - virtual RTPS_DllAPI ~TClassName() = default; \ + virtual FASTDDS_EXPORTED_API ~TClassName() = default; \ \ /** \ * Copies another TClassName. \ @@ -1103,7 +1105,7 @@ class TimeBasedFilterQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI TimeBasedFilterQosPolicy() + FASTDDS_EXPORTED_API TimeBasedFilterQosPolicy() : Parameter_t(PID_TIME_BASED_FILTER, PARAMETER_TIME_LENGTH) , QosPolicy(false) , minimum_separation(0, 0) @@ -1113,7 +1115,7 @@ class TimeBasedFilterQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TimeBasedFilterQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~TimeBasedFilterQosPolicy() = default; bool operator ==( const TimeBasedFilterQosPolicy& b) const @@ -1177,7 +1179,7 @@ class PresentationQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor without parameters */ - RTPS_DllAPI PresentationQosPolicy() + FASTDDS_EXPORTED_API PresentationQosPolicy() : Parameter_t(PID_PRESENTATION, PARAMETER_PRESENTATION_LENGTH) , QosPolicy(false) , access_scope(INSTANCE_PRESENTATION_QOS) @@ -1189,7 +1191,7 @@ class PresentationQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~PresentationQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~PresentationQosPolicy() = default; bool operator ==( const PresentationQosPolicy& b) const @@ -1390,7 +1392,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor without parameters */ - RTPS_DllAPI PartitionQosPolicy() + FASTDDS_EXPORTED_API PartitionQosPolicy() : Parameter_t(PID_PARTITION, 0) , QosPolicy(false) , max_size_ (0) @@ -1403,7 +1405,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @param in_length Length of the parameter */ - RTPS_DllAPI PartitionQosPolicy( + FASTDDS_EXPORTED_API PartitionQosPolicy( uint16_t in_length) : Parameter_t(PID_PARTITION, in_length) , QosPolicy(false) @@ -1418,7 +1420,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @param b Another PartitionQosPolicy instance */ - RTPS_DllAPI PartitionQosPolicy( + FASTDDS_EXPORTED_API PartitionQosPolicy( const PartitionQosPolicy& b) : Parameter_t(b) , QosPolicy(b) @@ -1434,7 +1436,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~PartitionQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~PartitionQosPolicy() = default; bool operator ==( const PartitionQosPolicy& b) const @@ -1528,7 +1530,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @param name Name to append. */ - RTPS_DllAPI inline void push_back( + FASTDDS_EXPORTED_API inline void push_back( const char* name) { //Realloc if needed; @@ -1560,7 +1562,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy /** * Clears list of partition names */ - RTPS_DllAPI inline void clear() override + FASTDDS_EXPORTED_API inline void clear() override { partitions_.length = 0; Npartitions_ = 0; @@ -1572,7 +1574,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @return Vector of partition name strings. */ - RTPS_DllAPI inline const std::vector getNames() const + FASTDDS_EXPORTED_API inline const std::vector getNames() const { return names(); } @@ -1582,7 +1584,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @param nam Vector of partition name strings. */ - RTPS_DllAPI inline void setNames( + FASTDDS_EXPORTED_API inline void setNames( std::vector& nam) { names(nam); @@ -1593,7 +1595,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @return Vector of partition name strings. */ - RTPS_DllAPI inline const std::vector names() const + FASTDDS_EXPORTED_API inline const std::vector names() const { std::vector names; if (Npartitions_ > 0) @@ -1611,7 +1613,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * * @param nam Vector of partition name strings. */ - RTPS_DllAPI inline void names( + FASTDDS_EXPORTED_API inline void names( std::vector& nam) { clear(); @@ -1672,7 +1674,7 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI HistoryQosPolicy() + FASTDDS_EXPORTED_API HistoryQosPolicy() : Parameter_t(PID_HISTORY, PARAMETER_KIND_LENGTH + 4) , QosPolicy(true) , kind(KEEP_LAST_HISTORY_QOS) @@ -1683,7 +1685,7 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~HistoryQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~HistoryQosPolicy() = default; bool operator ==( const HistoryQosPolicy& b) const @@ -1712,9 +1714,6 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy int32_t depth; }; -//! A special value indicating an unlimited quantity -constexpr int32_t LENGTH_UNLIMITED = -1; - /** * Specifies the resources that the Service can consume in order to meet the requested QoS * @@ -1761,7 +1760,7 @@ class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI ResourceLimitsQosPolicy() + FASTDDS_EXPORTED_API ResourceLimitsQosPolicy() : Parameter_t(PID_RESOURCE_LIMITS, 4 + 4 + 4) , QosPolicy(false) , max_samples(5000) @@ -1775,7 +1774,7 @@ class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~ResourceLimitsQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~ResourceLimitsQosPolicy() = default; bool operator ==( const ResourceLimitsQosPolicy& b) const @@ -1813,7 +1812,7 @@ class DurabilityServiceQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DurabilityServiceQosPolicy() + FASTDDS_EXPORTED_API DurabilityServiceQosPolicy() : Parameter_t(PID_DURABILITY_SERVICE, PARAMETER_TIME_LENGTH + PARAMETER_KIND_LENGTH + 4 + 4 + 4 + 4) , QosPolicy(false) , history_kind(KEEP_LAST_HISTORY_QOS) @@ -1827,7 +1826,7 @@ class DurabilityServiceQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DurabilityServiceQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DurabilityServiceQosPolicy() = default; bool operator ==( const DurabilityServiceQosPolicy& b) const @@ -1901,7 +1900,7 @@ class LifespanQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI LifespanQosPolicy() + FASTDDS_EXPORTED_API LifespanQosPolicy() : Parameter_t(PID_LIFESPAN, PARAMETER_TIME_LENGTH) , QosPolicy(true) , duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) @@ -1911,7 +1910,7 @@ class LifespanQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~LifespanQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~LifespanQosPolicy() = default; bool operator ==( const LifespanQosPolicy& b) const @@ -1947,7 +1946,7 @@ class OwnershipStrengthQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI OwnershipStrengthQosPolicy() + FASTDDS_EXPORTED_API OwnershipStrengthQosPolicy() : Parameter_t(PID_OWNERSHIP_STRENGTH, 4) , QosPolicy(false) , value(0) @@ -1957,7 +1956,7 @@ class OwnershipStrengthQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~OwnershipStrengthQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~OwnershipStrengthQosPolicy() = default; bool operator ==( const OwnershipStrengthQosPolicy& b) const @@ -1997,7 +1996,7 @@ class TransportPriorityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI TransportPriorityQosPolicy() + FASTDDS_EXPORTED_API TransportPriorityQosPolicy() : Parameter_t(PID_TRANSPORT_PRIORITY, 4) , QosPolicy(false) , value(0) @@ -2007,7 +2006,7 @@ class TransportPriorityQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TransportPriorityQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~TransportPriorityQosPolicy() = default; bool operator ==( const TransportPriorityQosPolicy& b) const @@ -2099,7 +2098,7 @@ class DataRepresentationQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DataRepresentationQosPolicy() + FASTDDS_EXPORTED_API DataRepresentationQosPolicy() : Parameter_t(PID_DATA_REPRESENTATION, 0) , QosPolicy(false) { @@ -2108,7 +2107,7 @@ class DataRepresentationQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DataRepresentationQosPolicy() override = default; + virtual FASTDDS_EXPORTED_API ~DataRepresentationQosPolicy() override = default; /** * Compares the given policy to check if it's equal. @@ -2198,7 +2197,7 @@ class TypeConsistencyEnforcementQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI TypeConsistencyEnforcementQosPolicy() + FASTDDS_EXPORTED_API TypeConsistencyEnforcementQosPolicy() : Parameter_t(PID_TYPE_CONSISTENCY_ENFORCEMENT, 8) // 2 + 5 + 1 alignment byte , QosPolicy(true) { @@ -2213,7 +2212,7 @@ class TypeConsistencyEnforcementQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TypeConsistencyEnforcementQosPolicy() override = default; + virtual FASTDDS_EXPORTED_API ~TypeConsistencyEnforcementQosPolicy() override = default; bool operator ==( const TypeConsistencyEnforcementQosPolicy& b) const @@ -2248,7 +2247,7 @@ class DisablePositiveACKsQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DisablePositiveACKsQosPolicy() + FASTDDS_EXPORTED_API DisablePositiveACKsQosPolicy() : Parameter_t(PID_DISABLE_POSITIVE_ACKS, PARAMETER_BOOL_LENGTH) , QosPolicy(true) , enabled(false) @@ -2259,7 +2258,7 @@ class DisablePositiveACKsQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DisablePositiveACKsQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DisablePositiveACKsQosPolicy() = default; bool operator ==( const DisablePositiveACKsQosPolicy& b) const @@ -2292,13 +2291,13 @@ class TypeIdV1 : public Parameter_t, public QosPolicy public: //!Type Identifier - fastrtps::types::TypeIdentifier m_type_identifier; + xtypes::TypeIdentifier m_type_identifier; /** * @brief Constructor without parameters */ - RTPS_DllAPI TypeIdV1() + FASTDDS_EXPORTED_API TypeIdV1() : Parameter_t(PID_TYPE_IDV1, 0) , QosPolicy(false) , m_type_identifier() @@ -2310,7 +2309,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * * @param type Another instance of TypeIdV1 */ - RTPS_DllAPI TypeIdV1( + FASTDDS_EXPORTED_API TypeIdV1( const TypeIdV1& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) @@ -2323,8 +2322,8 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * * @param identifier TypeIdentifier to be set */ - RTPS_DllAPI TypeIdV1( - const fastrtps::types::TypeIdentifier& identifier) + FASTDDS_EXPORTED_API TypeIdV1( + const xtypes::TypeIdentifier& identifier) : Parameter_t(PID_TYPE_IDV1, 0) , QosPolicy(false) , m_type_identifier(identifier) @@ -2336,7 +2335,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * * @param type Another instance of TypeIdV1 */ - RTPS_DllAPI TypeIdV1( + FASTDDS_EXPORTED_API TypeIdV1( TypeIdV1&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) @@ -2344,7 +2343,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy { } - RTPS_DllAPI TypeIdV1& operator =( + FASTDDS_EXPORTED_API TypeIdV1& operator =( const TypeIdV1& type) { Pid = type.Pid; @@ -2356,7 +2355,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy return *this; } - RTPS_DllAPI TypeIdV1& operator =( + FASTDDS_EXPORTED_API TypeIdV1& operator =( TypeIdV1&& type) { Pid = type.Pid; @@ -2371,15 +2370,15 @@ class TypeIdV1 : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TypeIdV1() override = default; + virtual FASTDDS_EXPORTED_API ~TypeIdV1() override = default; inline void clear() override { *this = TypeIdV1(); } - RTPS_DllAPI TypeIdV1& operator =( - const fastrtps::types::TypeIdentifier& type_id) + FASTDDS_EXPORTED_API TypeIdV1& operator =( + const xtypes::TypeIdentifier& type_id) { m_type_identifier = type_id; return *this; @@ -2390,7 +2389,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * * @return TypeIdentifier reference */ - RTPS_DllAPI const fastrtps::types::TypeIdentifier& get() const + FASTDDS_EXPORTED_API const xtypes::TypeIdentifier& get() const { return m_type_identifier; } @@ -2405,12 +2404,12 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy public: //!Type Object - fastrtps::types::TypeObject m_type_object; + xtypes::TypeObject m_type_object; /** * @brief Constructor */ - RTPS_DllAPI TypeObjectV1() + FASTDDS_EXPORTED_API TypeObjectV1() : Parameter_t(PID_TYPE_OBJECTV1, 0) , QosPolicy(false) , m_type_object() @@ -2422,7 +2421,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * * @param type Another instance of TypeObjectV1 */ - RTPS_DllAPI TypeObjectV1( + FASTDDS_EXPORTED_API TypeObjectV1( const TypeObjectV1& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) @@ -2435,8 +2434,8 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * * @param type TypeObject to be set */ - RTPS_DllAPI TypeObjectV1( - const fastrtps::types::TypeObject& type) + FASTDDS_EXPORTED_API TypeObjectV1( + const xtypes::TypeObject& type) : Parameter_t(PID_TYPE_OBJECTV1, 0) , QosPolicy(false) , m_type_object(type) @@ -2448,7 +2447,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * * @param type Another instance of TypeObjectV1 */ - RTPS_DllAPI TypeObjectV1( + FASTDDS_EXPORTED_API TypeObjectV1( TypeObjectV1&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) @@ -2456,7 +2455,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy { } - RTPS_DllAPI TypeObjectV1& operator =( + FASTDDS_EXPORTED_API TypeObjectV1& operator =( const TypeObjectV1& type) { Pid = type.Pid; @@ -2468,7 +2467,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy return *this; } - RTPS_DllAPI TypeObjectV1& operator =( + FASTDDS_EXPORTED_API TypeObjectV1& operator =( TypeObjectV1&& type) { Pid = type.Pid; @@ -2483,15 +2482,15 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TypeObjectV1() override = default; + virtual FASTDDS_EXPORTED_API ~TypeObjectV1() override = default; inline void clear() override { *this = TypeObjectV1(); } - RTPS_DllAPI TypeObjectV1& operator =( - const fastrtps::types::TypeObject& type_object) + FASTDDS_EXPORTED_API TypeObjectV1& operator =( + const xtypes::TypeObject& type_object) { m_type_object = type_object; return *this; @@ -2502,7 +2501,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * * @return TypeObject reference */ - RTPS_DllAPI const fastrtps::types::TypeObject& get() const + FASTDDS_EXPORTED_API const xtypes::TypeObject& get() const { return m_type_object; } @@ -2512,19 +2511,19 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy namespace xtypes { /** - * Class xtypes::TypeInformation + * Class xtypes::TypeInformationParameter */ -class TypeInformation : public Parameter_t, public QosPolicy +class TypeInformationParameter : public Parameter_t, public QosPolicy { public: //!Type Information - fastrtps::types::TypeInformation type_information; + eprosima::fastdds::dds::xtypes::TypeInformation type_information; /** * @brief Constructor */ - RTPS_DllAPI TypeInformation() + FASTDDS_EXPORTED_API TypeInformationParameter() : Parameter_t(PID_TYPE_INFORMATION, 0) , QosPolicy(false) , type_information() @@ -2535,10 +2534,10 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Copy constructor * - * @param type Another instance of TypeInformation + * @param type Another instance of TypeInformationParameter */ - RTPS_DllAPI TypeInformation( - const TypeInformation& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + const TypeInformationParameter& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) , type_information(type.type_information) @@ -2547,12 +2546,12 @@ class TypeInformation : public Parameter_t, public QosPolicy } /** - * @brief Constructor using a fastrtps::types::TypeInformation + * @brief Constructor using a TypeInformation * - * @param info fastrtps::types::TypeInformation to be set + * @param info TypeInformation to be set */ - RTPS_DllAPI TypeInformation( - const fastrtps::types::TypeInformation& info) + FASTDDS_EXPORTED_API TypeInformationParameter( + const eprosima::fastdds::dds::xtypes::TypeInformation& info) : Parameter_t(PID_TYPE_INFORMATION, 0) , QosPolicy(false) , type_information(info) @@ -2563,10 +2562,10 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Move Constructor * - * @param type Another instance of TypeInformation + * @param type Another instance of TypeInformationParameter */ - RTPS_DllAPI TypeInformation( - TypeInformation&& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + TypeInformationParameter&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) , type_information(std::move(type.type_information)) @@ -2574,8 +2573,8 @@ class TypeInformation : public Parameter_t, public QosPolicy { } - RTPS_DllAPI TypeInformation& operator =( - const TypeInformation& type) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const TypeInformationParameter& type) { Pid = type.Pid; length = type.length; @@ -2587,8 +2586,8 @@ class TypeInformation : public Parameter_t, public QosPolicy return *this; } - RTPS_DllAPI TypeInformation& operator =( - TypeInformation&& type) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + TypeInformationParameter&& type) { Pid = type.Pid; length = type.length; @@ -2603,11 +2602,11 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TypeInformation() override = default; + virtual FASTDDS_EXPORTED_API ~TypeInformationParameter() override = default; inline void clear() override { - *this = TypeInformation(); + *this = TypeInformationParameter(); } /** @@ -2615,7 +2614,7 @@ class TypeInformation : public Parameter_t, public QosPolicy * * @return true if assigned, false if not */ - RTPS_DllAPI bool assigned() const + FASTDDS_EXPORTED_API bool assigned() const { return assigned_; } @@ -2625,14 +2624,14 @@ class TypeInformation : public Parameter_t, public QosPolicy * * @param value Boolean to be set */ - RTPS_DllAPI void assigned( + FASTDDS_EXPORTED_API void assigned( bool value) { assigned_ = value; } - RTPS_DllAPI TypeInformation& operator =( - const fastrtps::types::TypeInformation& type_info) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const TypeInformation& type_info) { type_information = type_info; assigned_ = true; @@ -2641,7 +2640,7 @@ class TypeInformation : public Parameter_t, public QosPolicy private: - //!Boolean that states if the TypeInformation has been asigned manually or not. + //!Boolean that states if the TypeInformationParameter has been asigned manually or not. bool assigned_; }; @@ -2662,7 +2661,7 @@ class WireProtocolConfigQos : public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI WireProtocolConfigQos() + FASTDDS_EXPORTED_API WireProtocolConfigQos() : QosPolicy(false) , participant_id(-1) { @@ -2671,7 +2670,7 @@ class WireProtocolConfigQos : public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~WireProtocolConfigQos() = default; + virtual FASTDDS_EXPORTED_API ~WireProtocolConfigQos() = default; bool operator ==( const WireProtocolConfigQos& b) const @@ -2744,7 +2743,7 @@ class TransportConfigQos : public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI TransportConfigQos() + FASTDDS_EXPORTED_API TransportConfigQos() : QosPolicy(false) , use_builtin_transports(true) , send_socket_buffer_size(0) @@ -2757,7 +2756,7 @@ class TransportConfigQos : public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TransportConfigQos() = default; + virtual FASTDDS_EXPORTED_API ~TransportConfigQos() = default; bool operator ==( const TransportConfigQos& b) const @@ -2798,8 +2797,10 @@ class TransportConfigQos : public QosPolicy //! Thread settings for the builtin transports reception threads rtps::ThreadSettings builtin_transports_reception_threads_; - /*! Maximum message size used to avoid fragmentation, set ONLY in LARGE_DATA. If this value is - * not zero, the network factory will allow the initialization of UDP transports with maxMessageSize + /*! + * @brief Maximum message size used to avoid fragmentation, set ONLY in LARGE_DATA. + * + * If this value is not zero, the network factory will allow the initialization of UDP transports with maxMessageSize * higher than 65500K. */ uint32_t max_msg_size_no_frag; @@ -2813,9 +2814,9 @@ class RTPSEndpointQos { public: - RTPS_DllAPI RTPSEndpointQos() = default; + FASTDDS_EXPORTED_API RTPSEndpointQos() = default; - virtual RTPS_DllAPI ~RTPSEndpointQos() = default; + virtual FASTDDS_EXPORTED_API ~RTPSEndpointQos() = default; bool operator ==( const RTPSEndpointQos& b) const @@ -2864,7 +2865,7 @@ class WriterResourceLimitsQos /** * @brief Constructor */ - RTPS_DllAPI WriterResourceLimitsQos() + FASTDDS_EXPORTED_API WriterResourceLimitsQos() : matched_subscriber_allocation() , reader_filters_allocation(0, 32u, 1u) { @@ -2873,7 +2874,7 @@ class WriterResourceLimitsQos /** * @brief Destructor */ - virtual RTPS_DllAPI ~WriterResourceLimitsQos() = default; + virtual FASTDDS_EXPORTED_API ~WriterResourceLimitsQos() = default; bool operator ==( const WriterResourceLimitsQos& b) const @@ -2922,7 +2923,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI DataSharingQosPolicy() + FASTDDS_EXPORTED_API DataSharingQosPolicy() : Parameter_t(PID_DATASHARING, 0) , QosPolicy(true) { @@ -2933,14 +2934,14 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~DataSharingQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DataSharingQosPolicy() = default; /** * @brief Copy constructor * * @param b Another DataSharingQosPolicy instance */ - RTPS_DllAPI DataSharingQosPolicy( + FASTDDS_EXPORTED_API DataSharingQosPolicy( const DataSharingQosPolicy& b) : Parameter_t(b) , QosPolicy(b) @@ -2954,7 +2955,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy domain_ids_ = b.domain_ids(); } - RTPS_DllAPI DataSharingQosPolicy& operator =( + FASTDDS_EXPORTED_API DataSharingQosPolicy& operator =( const DataSharingQosPolicy& b) { QosPolicy::operator =(b); @@ -2991,7 +2992,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @return the current DataSharing configuration mode */ - RTPS_DllAPI const DataSharingKind& kind() const + FASTDDS_EXPORTED_API const DataSharingKind& kind() const { return kind_; } @@ -2999,7 +3000,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @return the current DataSharing shared memory directory */ - RTPS_DllAPI const std::string& shm_directory() const + FASTDDS_EXPORTED_API const std::string& shm_directory() const { return shm_directory_; } @@ -3017,7 +3018,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * * @return the current DataSharing domain IDs */ - RTPS_DllAPI const std::vector& domain_ids() const + FASTDDS_EXPORTED_API const std::vector& domain_ids() const { return domain_ids_; } @@ -3025,7 +3026,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @param size the new maximum number of domain IDs */ - RTPS_DllAPI void set_max_domains( + FASTDDS_EXPORTED_API void set_max_domains( uint32_t size) { domain_ids_.reserve(size); @@ -3035,7 +3036,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @return the current configured maximum number of domain IDs */ - RTPS_DllAPI const uint32_t& max_domains() const + FASTDDS_EXPORTED_API const uint32_t& max_domains() const { return max_domains_; } @@ -3046,7 +3047,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * The default shared memory directory of the OS is used. * A default domain ID is automatically computed. */ - RTPS_DllAPI void automatic() + FASTDDS_EXPORTED_API void automatic() { setup (AUTO, "", std::vector()); } @@ -3058,7 +3059,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * * @param domain_ids the user configured DataSharing domain IDs (16 bits). */ - RTPS_DllAPI void automatic( + FASTDDS_EXPORTED_API void automatic( const std::vector& domain_ids) { setup (AUTO, "", domain_ids); @@ -3071,7 +3072,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * * @param directory The shared memory directory to use. */ - RTPS_DllAPI void automatic( + FASTDDS_EXPORTED_API void automatic( const std::string& directory) { setup (AUTO, directory, std::vector()); @@ -3083,7 +3084,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * @param directory The shared memory directory to use. * @param domain_ids the user configured DataSharing domain IDs (16 bits). */ - RTPS_DllAPI void automatic( + FASTDDS_EXPORTED_API void automatic( const std::string& directory, const std::vector& domain_ids) { @@ -3098,7 +3099,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * @param directory The shared memory directory to use. * It is mandatory to provide a non-empty name or the creation of endpoints will fail. */ - RTPS_DllAPI void on( + FASTDDS_EXPORTED_API void on( const std::string& directory) { // TODO [ILG]: This parameter is unused right now. Activate the assert once it is used @@ -3113,7 +3114,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * It is mandatory to provide a non-empty name or the creation of endpoints will fail. * @param domain_ids the user configured DataSharing domain IDs (16 bits). */ - RTPS_DllAPI void on( + FASTDDS_EXPORTED_API void on( const std::string& directory, const std::vector& domain_ids) { @@ -3125,7 +3126,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @brief Configures the DataSharing in disabled mode */ - RTPS_DllAPI void off() + FASTDDS_EXPORTED_API void off() { setup (OFF, "", std::vector()); } @@ -3135,7 +3136,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy * * @param id 16 bit identifier */ - RTPS_DllAPI void add_domain_id( + FASTDDS_EXPORTED_API void add_domain_id( uint16_t id) { if (max_domains_ == 0 || domain_ids_.size() < max_domains_) diff --git a/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp b/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp index 9e848d80068..2a3dd9f2a98 100644 --- a/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp +++ b/include/fastdds/dds/core/policy/ReaderDataLifecycleQosPolicy.hpp @@ -48,7 +48,7 @@ class ReaderDataLifecycleQosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~ReaderDataLifecycleQosPolicy() + virtual FASTDDS_EXPORTED_API ~ReaderDataLifecycleQosPolicy() { } diff --git a/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp b/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp index d4d075bfab1..6f412f513c1 100644 --- a/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp +++ b/include/fastdds/dds/core/policy/WriterDataLifecycleQosPolicy.hpp @@ -41,7 +41,7 @@ class WriterDataLifecycleQosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~WriterDataLifecycleQosPolicy() + virtual FASTDDS_EXPORTED_API ~WriterDataLifecycleQosPolicy() { } diff --git a/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp b/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp index c5ee4908d34..d9c1dbd216b 100644 --- a/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp +++ b/include/fastdds/dds/core/status/IncompatibleQosStatus.hpp @@ -16,14 +16,14 @@ * @file IncompatibleQosStatus.hpp */ -#ifndef _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_ -#define _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_ - -#include +#ifndef _FASTDDS_INCOMPATIBLE_QOS_STATUS_HPP_ +#define _FASTDDS_INCOMPATIBLE_QOS_STATUS_HPP_ #include #include +#include + namespace eprosima { namespace fastdds { namespace dds { @@ -93,4 +93,4 @@ using OfferedIncompatibleQosStatus = IncompatibleQosStatus; } //end of namespace fastdds } //end of namespace eprosima -#endif // _FASTRTPS_INCOMPATIBLE_QOS_STATUS_HPP_ +#endif // _FASTDDS_INCOMPATIBLE_QOS_STATUS_HPP_ diff --git a/include/fastdds/dds/core/status/StatusMask.hpp b/include/fastdds/dds/core/status/StatusMask.hpp index 2718869d75c..6e21b87ca9f 100644 --- a/include/fastdds/dds/core/status/StatusMask.hpp +++ b/include/fastdds/dds/core/status/StatusMask.hpp @@ -21,7 +21,7 @@ #ifndef _FASTDDS_STATUSMASK_HPP_ #define _FASTDDS_STATUSMASK_HPP_ -#include +#include #include #include @@ -44,7 +44,7 @@ namespace dds { * - indicate status changes when calling dds::core::Entity::status_changes */ -class RTPS_DllAPI StatusMask : public std::bitset +class FASTDDS_EXPORTED_API StatusMask : public std::bitset { public: diff --git a/include/fastdds/dds/domain/DomainParticipant.hpp b/include/fastdds/dds/domain/DomainParticipant.hpp index 7ac5f4b8998..fb6b3be24d2 100644 --- a/include/fastdds/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/dds/domain/DomainParticipant.hpp @@ -27,22 +27,20 @@ #include #include -#include #include +#include +#include #include +#include +#include #include #include -#include #include #include -#include +#include #include #include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace dds { namespace domain { @@ -55,15 +53,6 @@ namespace fastrtps { namespace rtps { class ResourceEvent; } // namespace rtps - -namespace types { -class TypeInformation; -} // namespace types - -class ParticipantAttributes; -class PublisherAttributes; -class SubscriberAttributes; - } //namespace fastrtps namespace fastdds { @@ -104,7 +93,7 @@ class DomainParticipant : public Entity * @param qos DomainParticipantQos reference where the qos is going to be returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( DomainParticipantQos& qos) const; /** @@ -112,7 +101,7 @@ class DomainParticipant : public Entity * * @return A reference to the DomainParticipantQos */ - RTPS_DllAPI const DomainParticipantQos& get_qos() const; + FASTDDS_EXPORTED_API const DomainParticipantQos& get_qos() const; /** * This operation sets the value of the DomainParticipant QoS policies. @@ -121,7 +110,7 @@ class DomainParticipant : public Entity * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not * self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const DomainParticipantQos& qos) const; /** @@ -129,7 +118,7 @@ class DomainParticipant : public Entity * * @return DomainParticipantListener pointer */ - RTPS_DllAPI const DomainParticipantListener* get_listener() const; + FASTDDS_EXPORTED_API const DomainParticipantListener* get_listener() const; /** * Modifies the DomainParticipantListener, sets the mask to StatusMask::all() @@ -138,7 +127,7 @@ class DomainParticipant : public Entity * @return RETCODE_OK if successful, RETCODE_ERROR otherwise. * @warning Do not call this method from a \c DomainParticipantListener callback. */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DomainParticipantListener* listener); /** @@ -149,7 +138,7 @@ class DomainParticipant : public Entity * @return RETCODE_OK if successful, RETCODE_ERROR if failed (timeout expired). * @warning Do not call this method from a \c DomainParticipantListener callback. */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DomainParticipantListener* listener, const std::chrono::seconds timeout); @@ -161,7 +150,7 @@ class DomainParticipant : public Entity * @return RETCODE_OK if successful, RETCODE_ERROR otherwise. * @warning Do not call this method from a \c DomainParticipantListener callback. */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DomainParticipantListener* listener, const StatusMask& mask); @@ -174,7 +163,7 @@ class DomainParticipant : public Entity * @return RETCODE_OK if successful, RETCODE_ERROR if failed (timeout expired) * @warning Do not call this method from a \c DomainParticipantListener callback. */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DomainParticipantListener* listener, const StatusMask& mask, const std::chrono::seconds timeout); @@ -184,7 +173,7 @@ class DomainParticipant : public Entity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t enable() override; + FASTDDS_EXPORTED_API ReturnCode_t enable() override; // DomainParticipant specific methods from DDS API @@ -196,7 +185,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Publisher. */ - RTPS_DllAPI Publisher* create_publisher( + FASTDDS_EXPORTED_API Publisher* create_publisher( const PublisherQos& qos, PublisherListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); @@ -209,7 +198,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Publisher. */ - RTPS_DllAPI Publisher* create_publisher_with_profile( + FASTDDS_EXPORTED_API Publisher* create_publisher_with_profile( const std::string& profile_name, PublisherListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); @@ -221,7 +210,7 @@ class DomainParticipant : public Entity * @return RETCODE_PRECONDITION_NOT_MET if the publisher does not belong to this participant or if it has active DataWriters, * RETCODE_OK if it is correctly deleted and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t delete_publisher( + FASTDDS_EXPORTED_API ReturnCode_t delete_publisher( const Publisher* publisher); /** @@ -232,7 +221,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Subscriber. */ - RTPS_DllAPI Subscriber* create_subscriber( + FASTDDS_EXPORTED_API Subscriber* create_subscriber( const SubscriberQos& qos, SubscriberListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); @@ -245,7 +234,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Subscriber. */ - RTPS_DllAPI Subscriber* create_subscriber_with_profile( + FASTDDS_EXPORTED_API Subscriber* create_subscriber_with_profile( const std::string& profile_name, SubscriberListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); @@ -257,7 +246,7 @@ class DomainParticipant : public Entity * @return RETCODE_PRECONDITION_NOT_MET if the subscriber does not belong to this participant or if it has active DataReaders, * RETCODE_OK if it is correctly deleted and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t delete_subscriber( + FASTDDS_EXPORTED_API ReturnCode_t delete_subscriber( const Subscriber* subscriber); /** @@ -270,7 +259,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Topic. */ - RTPS_DllAPI Topic* create_topic( + FASTDDS_EXPORTED_API Topic* create_topic( const std::string& topic_name, const std::string& type_name, const TopicQos& qos, @@ -287,7 +276,7 @@ class DomainParticipant : public Entity * @param mask StatusMask that holds statuses the listener responds to (default: all) * @return Pointer to the created Topic. */ - RTPS_DllAPI Topic* create_topic_with_profile( + FASTDDS_EXPORTED_API Topic* create_topic_with_profile( const std::string& topic_name, const std::string& type_name, const std::string& profile_name, @@ -301,7 +290,7 @@ class DomainParticipant : public Entity * @return RETCODE_BAD_PARAMETER if the topic passed is a nullptr, RETCODE_PRECONDITION_NOT_MET if the topic does not belong to * this participant or if it is referenced by any entity and RETCODE_OK if the Topic was deleted. */ - RTPS_DllAPI ReturnCode_t delete_topic( + FASTDDS_EXPORTED_API ReturnCode_t delete_topic( const Topic* topic); /** @@ -317,7 +306,7 @@ class DomainParticipant : public Entity * @return nullptr if a filter cannot be created with the specified @c filter_expression and * @c expression_parameters. */ - RTPS_DllAPI ContentFilteredTopic* create_contentfilteredtopic( + FASTDDS_EXPORTED_API ContentFilteredTopic* create_contentfilteredtopic( const std::string& name, Topic* related_topic, const std::string& filter_expression, @@ -339,7 +328,7 @@ class DomainParticipant : public Entity * @c expression_parameters. * @return nullptr if the specified @c filter_class_name has not been registered. */ - RTPS_DllAPI ContentFilteredTopic* create_contentfilteredtopic( + FASTDDS_EXPORTED_API ContentFilteredTopic* create_contentfilteredtopic( const std::string& name, Topic* related_topic, const std::string& filter_expression, @@ -353,7 +342,7 @@ class DomainParticipant : public Entity * @return RETCODE_BAD_PARAMETER if the topic passed is a nullptr, RETCODE_PRECONDITION_NOT_MET if the topic does not belong to * this participant or if it is referenced by any entity and RETCODE_OK if the ContentFilteredTopic was deleted. */ - RTPS_DllAPI ReturnCode_t delete_contentfilteredtopic( + FASTDDS_EXPORTED_API ReturnCode_t delete_contentfilteredtopic( const ContentFilteredTopic* a_contentfilteredtopic); /** @@ -365,7 +354,7 @@ class DomainParticipant : public Entity * @param expression_parameters Parameters to subscription content * @return Pointer to the created ContentFilteredTopic, nullptr in error case */ - RTPS_DllAPI MultiTopic* create_multitopic( + FASTDDS_EXPORTED_API MultiTopic* create_multitopic( const std::string& name, const std::string& type_name, const std::string& subscription_expression, @@ -381,7 +370,7 @@ class DomainParticipant : public Entity * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED * */ - RTPS_DllAPI ReturnCode_t delete_multitopic( + FASTDDS_EXPORTED_API ReturnCode_t delete_multitopic( const MultiTopic* a_multitopic); /** @@ -397,7 +386,7 @@ class DomainParticipant : public Entity * @param timeout Maximum time to wait for the Topic * @return Pointer to the existing Topic, nullptr in case of error or timeout */ - RTPS_DllAPI Topic* find_topic( + FASTDDS_EXPORTED_API Topic* find_topic( const std::string& topic_name, const fastrtps::Duration_t& timeout); @@ -410,7 +399,7 @@ class DomainParticipant : public Entity * * @remark UNSAFE. It is unsafe to lookup a topic description while another thread is creating a topic. */ - RTPS_DllAPI TopicDescription* lookup_topicdescription( + FASTDDS_EXPORTED_API TopicDescription* lookup_topicdescription( const std::string& topic_name) const; /** @@ -418,7 +407,7 @@ class DomainParticipant : public Entity * * @return Pointer to the builtin Subscriber, nullptr in error case */ - RTPS_DllAPI const Subscriber* get_builtin_subscriber() const; + FASTDDS_EXPORTED_API const Subscriber* get_builtin_subscriber() const; /** * Locally ignore a remote domain participant. @@ -429,7 +418,7 @@ class DomainParticipant : public Entity * @return RETURN_OK code if everything correct, RETCODE_BAD_PARAMENTER otherwise * */ - RTPS_DllAPI ReturnCode_t ignore_participant( + FASTDDS_EXPORTED_API ReturnCode_t ignore_participant( const InstanceHandle_t& handle); /** @@ -443,7 +432,7 @@ class DomainParticipant : public Entity * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED * */ - RTPS_DllAPI ReturnCode_t ignore_topic( + FASTDDS_EXPORTED_API ReturnCode_t ignore_topic( const InstanceHandle_t& handle); /** @@ -457,7 +446,7 @@ class DomainParticipant : public Entity * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED * */ - RTPS_DllAPI ReturnCode_t ignore_publication( + FASTDDS_EXPORTED_API ReturnCode_t ignore_publication( const InstanceHandle_t& handle); /** @@ -471,7 +460,7 @@ class DomainParticipant : public Entity * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED * */ - RTPS_DllAPI ReturnCode_t ignore_subscription( + FASTDDS_EXPORTED_API ReturnCode_t ignore_subscription( const InstanceHandle_t& handle); /** @@ -480,14 +469,14 @@ class DomainParticipant : public Entity * * @return The Participant's domain_id */ - RTPS_DllAPI DomainId_t get_domain_id() const; + FASTDDS_EXPORTED_API DomainId_t get_domain_id() const; /** * Deletes all the entities that were created by means of the β€œcreate” methods * * @return RETURN_OK code if everything correct, error code otherwise */ - RTPS_DllAPI ReturnCode_t delete_contained_entities(); + FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities(); /** * This operation manually asserts the liveliness of the DomainParticipant. @@ -504,7 +493,7 @@ class DomainParticipant : public Entity * * @return RETCODE_OK if the liveliness was asserted, RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t assert_liveliness(); + FASTDDS_EXPORTED_API ReturnCode_t assert_liveliness(); /** * This operation sets a default value of the Publisher QoS policies which will be used for newly created @@ -520,7 +509,7 @@ class DomainParticipant : public Entity * @param qos PublisherQos to be set * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_publisher_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_publisher_qos( const PublisherQos& qos); /** @@ -533,7 +522,7 @@ class DomainParticipant : public Entity * * @return Current default publisher qos. */ - RTPS_DllAPI const PublisherQos& get_default_publisher_qos() const; + FASTDDS_EXPORTED_API const PublisherQos& get_default_publisher_qos() const; /** * This operation retrieves the default value of the Publisher QoS, that is, the QoS policies which will be used @@ -546,7 +535,7 @@ class DomainParticipant : public Entity * @param qos PublisherQos reference where the default_publisher_qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_publisher_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_publisher_qos( PublisherQos& qos) const; /** @@ -556,7 +545,7 @@ class DomainParticipant : public Entity * @param qos PublisherQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_publisher_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_publisher_qos_from_profile( const std::string& profile_name, PublisherQos& qos) const; @@ -574,7 +563,7 @@ class DomainParticipant : public Entity * @param qos SubscriberQos to be set * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_subscriber_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_subscriber_qos( const SubscriberQos& qos); /** @@ -587,7 +576,7 @@ class DomainParticipant : public Entity * * @return Current default subscriber qos. */ - RTPS_DllAPI const SubscriberQos& get_default_subscriber_qos() const; + FASTDDS_EXPORTED_API const SubscriberQos& get_default_subscriber_qos() const; /** * This operation retrieves the default value of the Subscriber QoS, that is, the QoS policies which will be used @@ -600,7 +589,7 @@ class DomainParticipant : public Entity * @param qos SubscriberQos reference where the default_subscriber_qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_subscriber_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_subscriber_qos( SubscriberQos& qos) const; /** @@ -610,7 +599,7 @@ class DomainParticipant : public Entity * @param qos SubscriberQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_subscriber_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_subscriber_qos_from_profile( const std::string& profile_name, SubscriberQos& qos) const; @@ -628,7 +617,7 @@ class DomainParticipant : public Entity * @param qos TopicQos to be set * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_topic_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_topic_qos( const TopicQos& qos); /** @@ -641,7 +630,7 @@ class DomainParticipant : public Entity * * @return Current default topic qos. */ - RTPS_DllAPI const TopicQos& get_default_topic_qos() const; + FASTDDS_EXPORTED_API const TopicQos& get_default_topic_qos() const; /** * This operation retrieves the default value of the Topic QoS, that is, the QoS policies that will be used @@ -654,7 +643,7 @@ class DomainParticipant : public Entity * @param qos TopicQos reference where the default_topic_qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_topic_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_topic_qos( TopicQos& qos) const; /** @@ -664,18 +653,41 @@ class DomainParticipant : public Entity * @param qos TopicQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_topic_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_topic_qos_from_profile( const std::string& profile_name, TopicQos& qos) const; + /** + * Fills the ReplierQos with the values of the XML profile. + * + * @param profile_name Replier profile name. + * @param qos ReplierQos object where the qos is returned. + * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t get_replier_qos_from_profile( + const std::string& profile_name, + ReplierQos& qos) const; + + /** + * Fills the RequesterQos with the values of the XML profile. + * + * @param profile_name Requester profile name. + * @param qos RequesterQos object where the qos is returned. + * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t get_requester_qos_from_profile( + const std::string& profile_name, + RequesterQos& qos) const; + /** * Retrieves the list of DomainParticipants that have been discovered in the domain and are not "ignored". * * @param[out] participant_handles Reference to the vector where discovered participants will be returned * @return RETCODE_OK if everything correct, error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_discovered_participants( + FASTDDS_EXPORTED_API ReturnCode_t get_discovered_participants( std::vector& participant_handles) const; /** @@ -684,9 +696,10 @@ class DomainParticipant : public Entity * @param[out] participant_data Reference to the ParticipantBuiltinTopicData object to return the data * @param participant_handle InstanceHandle of DomainParticipant to retrieve the data from * @return RETCODE_OK if everything correct, PRECONDITION_NOT_MET if participant does not exist + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_discovered_participant_data( + FASTDDS_EXPORTED_API ReturnCode_t get_discovered_participant_data( builtin::ParticipantBuiltinTopicData& participant_data, const InstanceHandle_t& participant_handle) const; @@ -695,9 +708,10 @@ class DomainParticipant : public Entity * * @param[out] topic_handles Reference to the vector where discovered topics will be returned * @return RETCODE_OK if everything correct, error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_discovered_topics( + FASTDDS_EXPORTED_API ReturnCode_t get_discovered_topics( std::vector& topic_handles) const; /** @@ -709,7 +723,7 @@ class DomainParticipant : public Entity * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_discovered_topic_data( + FASTDDS_EXPORTED_API ReturnCode_t get_discovered_topic_data( builtin::TopicBuiltinTopicData& topic_data, const InstanceHandle_t& topic_handle) const; @@ -723,7 +737,7 @@ class DomainParticipant : public Entity * entities created using a contained Publisher, or Subscriber as the factory, and so forth. (default: true) * @return True if entity is contained. False otherwise. */ - RTPS_DllAPI bool contains_entity( + FASTDDS_EXPORTED_API bool contains_entity( const InstanceHandle_t& a_handle, bool recursive = true) const; @@ -734,10 +748,10 @@ class DomainParticipant : public Entity * @param current_time Time_t reference where the current time is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_current_time( + FASTDDS_EXPORTED_API ReturnCode_t get_current_time( fastrtps::Time_t& current_time) const; - // DomainParticipant methods specific from Fast-DDS + // DomainParticipant methods specific from Fast DDS /** * Register a type in this participant. @@ -747,7 +761,7 @@ class DomainParticipant : public Entity * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there is another TypeSupport * with the same name and RETCODE_OK if it is correctly registered. */ - RTPS_DllAPI ReturnCode_t register_type( + FASTDDS_EXPORTED_API ReturnCode_t register_type( TypeSupport type, const std::string& type_name); @@ -758,7 +772,7 @@ class DomainParticipant : public Entity * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there is another TypeSupport * with the same name and RETCODE_OK if it is correctly registered. */ - RTPS_DllAPI ReturnCode_t register_type( + FASTDDS_EXPORTED_API ReturnCode_t register_type( TypeSupport type); /** @@ -768,7 +782,7 @@ class DomainParticipant : public Entity * @return RETCODE_BAD_PARAMETER if the size of the name is 0, RERCODE_PRECONDITION_NOT_MET if there are entities using that * TypeSupport and RETCODE_OK if it is correctly unregistered. */ - RTPS_DllAPI ReturnCode_t unregister_type( + FASTDDS_EXPORTED_API ReturnCode_t unregister_type( const std::string& typeName); /** @@ -777,7 +791,7 @@ class DomainParticipant : public Entity * @param type_name Name of the type * @return TypeSupport corresponding to the type_name */ - RTPS_DllAPI TypeSupport find_type( + FASTDDS_EXPORTED_API TypeSupport find_type( const std::string& type_name) const; /** @@ -785,7 +799,7 @@ class DomainParticipant : public Entity * * @return InstanceHandle of this DomainParticipant. */ - RTPS_DllAPI const InstanceHandle_t& get_instance_handle() const; + FASTDDS_EXPORTED_API const InstanceHandle_t& get_instance_handle() const; // From here legacy RTPS methods. @@ -794,14 +808,14 @@ class DomainParticipant : public Entity * * @return A reference to the GUID */ - RTPS_DllAPI const fastrtps::rtps::GUID_t& guid() const; + FASTDDS_EXPORTED_API const fastrtps::rtps::GUID_t& guid() const; /** * @brief Getter for the participant names * * @return Vector with the names */ - RTPS_DllAPI std::vector get_participant_names() const; + FASTDDS_EXPORTED_API std::vector get_participant_names() const; /** * This method can be used when using a StaticEndpointDiscovery mechanism different that the one @@ -814,7 +828,7 @@ class DomainParticipant : public Entity * @param kind EndpointKind (WRITER or READER) * @return True if correctly found and activated. */ - RTPS_DllAPI bool new_remote_endpoint_discovered( + FASTDDS_EXPORTED_API bool new_remote_endpoint_discovered( const fastrtps::rtps::GUID_t& partguid, uint16_t userId, fastrtps::rtps::EndpointKind_t kind); @@ -826,50 +840,7 @@ class DomainParticipant : public Entity * * @return A reference to the resource event */ - RTPS_DllAPI fastrtps::rtps::ResourceEvent& get_resource_event() const; - - /** - * When a DomainParticipant receives an incomplete list of TypeIdentifiers in a - * PublicationBuiltinTopicData or SubscriptionBuiltinTopicData, it may request the additional type - * dependencies by invoking the getTypeDependencies operation. - * - * @param in TypeIdentifier sequence - * @return SampleIdentity - */ - RTPS_DllAPI fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const; - - /** - * A DomainParticipant may invoke the operation getTypes to retrieve the TypeObjects associated with a - * list of TypeIdentifiers. - * - * @param in TypeIdentifier sequence - * @return SampleIdentity - */ - RTPS_DllAPI fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const; - - /** - * Helps the user to solve all dependencies calling internally to the type lookup service and - * registers the resulting dynamic type. - * The registration may be perform asynchronously, case in which the user will be notified - * through the given callback, which receives the type_name as unique argument. - * - * @param type_information - * @param type_name - * @param callback - * @return RETCODE_OK If the given type_information is enough to build the type without using - * the typelookup service (callback will not be called). - * @return RETCODE_OK if the given type is already available (callback will not be called). - * @return RETCODE_NO_DATA if type is not available yet (the callback will be called if - * negotiation is success, and ignored in other case). - * @return RETCODE_NOT_ENABLED if the DomainParticipant is not enabled. - * @return RETCODE_PRECONDITION_NOT_MET if the DomainParticipant type lookup service is disabled. - */ - RTPS_DllAPI ReturnCode_t register_remote_type( - const fastrtps::types::TypeInformation& type_information, - const std::string& type_name, - std::function& callback); + FASTDDS_EXPORTED_API fastrtps::rtps::ResourceEvent& get_resource_event() const; /** * Register a custom content filter factory, which can be used to create a ContentFilteredTopic. @@ -901,7 +872,7 @@ class DomainParticipant : public Entity * @return RETCODE_PRECONDITION_NOT_MET if filter_class_name is FASTDDS_SQLFILTER_NAME. * @return RETCODE_OK if the filter is correctly registered. */ - RTPS_DllAPI ReturnCode_t register_content_filter_factory( + FASTDDS_EXPORTED_API ReturnCode_t register_content_filter_factory( const char* filter_class_name, IContentFilterFactory* const filter_factory); @@ -913,7 +884,7 @@ class DomainParticipant : public Entity * @return nullptr if the given filter_class_name has not been previously registered on this DomainParticipant. * Otherwise, the content filter factory previously registered with the given filter_class_name. */ - RTPS_DllAPI IContentFilterFactory* lookup_content_filter_factory( + FASTDDS_EXPORTED_API IContentFilterFactory* lookup_content_filter_factory( const char* filter_class_name); /** @@ -935,7 +906,7 @@ class DomainParticipant : public Entity * @return RERCODE_PRECONDITION_NOT_MET if there is any ContentFilteredTopic referencing the filter. * @return RETCODE_OK if the filter is correctly unregistered. */ - RTPS_DllAPI ReturnCode_t unregister_content_filter_factory( + FASTDDS_EXPORTED_API ReturnCode_t unregister_content_filter_factory( const char* filter_class_name); /** diff --git a/include/fastdds/dds/domain/DomainParticipantFactory.hpp b/include/fastdds/dds/domain/DomainParticipantFactory.hpp index 475b36a8a54..09df4a26027 100644 --- a/include/fastdds/dds/domain/DomainParticipantFactory.hpp +++ b/include/fastdds/dds/domain/DomainParticipantFactory.hpp @@ -17,20 +17,20 @@ * */ -#ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_ -#define _FASTDDS_DOMAINPARTICIPANT_HPP_ - -#include -#include -#include -#include -#include +#ifndef _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ +#define _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ #include #include #include -using eprosima::fastrtps::types::ReturnCode_t; +#include +#include +#include +#include +#include +#include +#include namespace eprosima { @@ -71,14 +71,14 @@ class DomainParticipantFactory * * @return A raw pointer to the DomainParticipantFactory singleton instance. */ - RTPS_DllAPI static DomainParticipantFactory* get_instance(); + FASTDDS_EXPORTED_API static DomainParticipantFactory* get_instance(); /** * Returns the DomainParticipantFactory singleton instance. * * @return A shared pointer to the DomainParticipantFactory singleton instance. */ - RTPS_DllAPI static std::shared_ptr get_shared_instance(); + FASTDDS_EXPORTED_API static std::shared_ptr get_shared_instance(); /** * Create a Participant. @@ -89,12 +89,31 @@ class DomainParticipantFactory * @param mask StatusMask Reference (default: all) * @return DomainParticipant pointer. (nullptr if not created.) */ - RTPS_DllAPI DomainParticipant* create_participant( + FASTDDS_EXPORTED_API DomainParticipant* create_participant( DomainId_t domain_id, const DomainParticipantQos& qos, DomainParticipantListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); + /** + * Create a Participant with default domain id and qos. + * + * @return DomainParticipant pointer. (nullptr if not created.) + */ + FASTDDS_EXPORTED_API DomainParticipant* create_participant_with_default_profile(); + + + /** + * Create a Participant with default domain id and qos. + * + * @return DomainParticipant pointer. (nullptr if not created.) + * @param listener DomainParticipantListener Pointer + * @param mask StatusMask Reference + */ + FASTDDS_EXPORTED_API DomainParticipant* create_participant_with_default_profile( + DomainParticipantListener* listener, + const StatusMask& mask); + /** * Create a Participant. * @@ -104,7 +123,7 @@ class DomainParticipantFactory * @param mask StatusMask Reference (default: all) * @return DomainParticipant pointer. (nullptr if not created.) */ - RTPS_DllAPI DomainParticipant* create_participant_with_profile( + FASTDDS_EXPORTED_API DomainParticipant* create_participant_with_profile( DomainId_t domain_id, const std::string& profile_name, DomainParticipantListener* listener = nullptr, @@ -118,7 +137,7 @@ class DomainParticipantFactory * @param mask StatusMask Reference (default: all) * @return DomainParticipant pointer. (nullptr if not created.) */ - RTPS_DllAPI DomainParticipant* create_participant_with_profile( + FASTDDS_EXPORTED_API DomainParticipant* create_participant_with_profile( const std::string& profile_name, DomainParticipantListener* listener = nullptr, const StatusMask& mask = StatusMask::all()); @@ -132,7 +151,7 @@ class DomainParticipantFactory * @param domain_id * @return previously created DomainParticipant within the specified domain */ - RTPS_DllAPI DomainParticipant* lookup_participant( + FASTDDS_EXPORTED_API DomainParticipant* lookup_participant( DomainId_t domain_id) const; /** @@ -141,7 +160,7 @@ class DomainParticipantFactory * @param domain_id * @return previously created DomainParticipants within the specified domain */ - RTPS_DllAPI std::vector lookup_participants( + FASTDDS_EXPORTED_API std::vector lookup_participants( DomainId_t domain_id) const; /** @@ -154,7 +173,7 @@ class DomainParticipantFactory * @param qos DomainParticipantQos where the qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_participant_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_participant_qos( DomainParticipantQos& qos) const; /** @@ -166,7 +185,7 @@ class DomainParticipantFactory * * @return A reference to the default DomainParticipantQos */ - RTPS_DllAPI const DomainParticipantQos& get_default_participant_qos() const; + FASTDDS_EXPORTED_API const DomainParticipantQos& get_default_participant_qos() const; /** * @brief This operation sets a default value of the DomainParticipant QoS policies which will be used for @@ -183,7 +202,7 @@ class DomainParticipantFactory * @param qos DomainParticipantQos to be set * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_participant_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_participant_qos( const DomainParticipantQos& qos); /** @@ -193,7 +212,7 @@ class DomainParticipantFactory * @param qos DomainParticipantQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_participant_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_participant_qos_from_profile( const std::string& profile_name, DomainParticipantQos& qos) const; @@ -204,7 +223,7 @@ class DomainParticipantFactory * @return RETCODE_PRECONDITION_NOT_MET if the participant has active entities, RETCODE_OK if the participant is correctly * deleted and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t delete_participant( + FASTDDS_EXPORTED_API ReturnCode_t delete_participant( DomainParticipant* part); /** @@ -212,7 +231,7 @@ class DomainParticipantFactory * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t load_profiles(); + FASTDDS_EXPORTED_API ReturnCode_t load_profiles(); /** * Load profiles from XML file. @@ -220,7 +239,7 @@ class DomainParticipantFactory * @param xml_profile_file XML profile file. * @return RETCODE_OK if it is correctly loaded, RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t load_XML_profiles_file( + FASTDDS_EXPORTED_API ReturnCode_t load_XML_profiles_file( const std::string& xml_profile_file); /** @@ -230,7 +249,7 @@ class DomainParticipantFactory * @param length length of data * @return RETCODE_OK if it is correctly loaded, RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t load_XML_profiles_string( + FASTDDS_EXPORTED_API ReturnCode_t load_XML_profiles_string( const char* data, size_t length); @@ -240,7 +259,7 @@ class DomainParticipantFactory * @param xml_file xml file path * @return RETCODE_OK if the validation is successful, RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t check_xml_static_discovery( + FASTDDS_EXPORTED_API ReturnCode_t check_xml_static_discovery( std::string& xml_file); /** @@ -249,7 +268,7 @@ class DomainParticipantFactory * @param qos DomaParticipantFactoryQos reference where the qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( DomainParticipantFactoryQos& qos) const; /** @@ -265,9 +284,52 @@ class DomainParticipantFactory * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not * self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const DomainParticipantFactoryQos& qos); + /** + * @brief This operation returns the value of the DomainParticipant library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return RETCODE_OK + */ + FASTDDS_EXPORTED_API ReturnCode_t get_library_settings( + LibrarySettings& library_settings) const; + + /** + * @brief This operation sets the library settings. + * + * Library settings must be set before enabling the DomainParticipants. + * Otherwise, failure of the setting operation is expected. + * + * @param library_settings LibrarySettings to be set. + * @return RETCODE_PRECONDITION_NOT_MET if any DomainParticipant is already enabled. + * RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t set_library_settings( + const LibrarySettings& library_settings); + + /** + * @brief Get the @ref DynamicType defined in XML file. + * The XML file shall be previously loaded. + * + * @param type_name Dynamic type name. + * @param type Reference where the Dynamic type builder is returned. + * @return RETCODE_BAD_PARAMETER if type_name is empty. + * RETCODE_NO_DATA if type_name is unknown. + * RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API ReturnCode_t get_dynamic_type_builder_from_xml_by_name( + const std::string& type_name, + DynamicType::_ref_type& type); + + /** + * @brief Return the TypeObjectRegistry member to access the public API. + * + * @return const xtypes::TypeObjectRegistry reference. + */ + FASTDDS_EXPORTED_API xtypes::ITypeObjectRegistry& type_object_registry(); + protected: friend class DomainParticipant; @@ -305,6 +367,8 @@ class DomainParticipantFactory mutable bool default_xml_profiles_loaded; + DomainId_t default_domain_id_; + DomainParticipantFactoryQos factory_qos_; DomainParticipantQos default_participant_qos_; @@ -327,4 +391,4 @@ class DomainParticipantFactory } // namespace fastdds } // namespace eprosima -#endif /* _FASTDDS_DOMAINPARTICIPANT_HPP_*/ +#endif /* _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_*/ diff --git a/include/fastdds/dds/domain/DomainParticipantListener.hpp b/include/fastdds/dds/domain/DomainParticipantListener.hpp index 4d6c98c8131..9455729d6e5 100644 --- a/include/fastdds/dds/domain/DomainParticipantListener.hpp +++ b/include/fastdds/dds/domain/DomainParticipantListener.hpp @@ -20,16 +20,12 @@ #ifndef __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__ #define __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__ -#include -#include -#include #include #include #include - -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -63,22 +59,6 @@ class DomainParticipantListener : { } - /*! - * This method is called when a new Participant is discovered, or a previously discovered participant changes - * its QOS or is removed. - * - * @param[out] participant Pointer to the Participant which discovered the remote participant. - * @param[out] info Remote participant information. User can take ownership of the object. - */ - FASTDDS_TODO_BEFORE(3, 0, "Remove this overload"); - virtual void on_participant_discovery( - DomainParticipant* participant, - fastrtps::rtps::ParticipantDiscoveryInfo&& info) - { - static_cast(participant); - static_cast(info); - } - /*! * This method is called when a new Participant is discovered, or a previously discovered participant changes * its QOS or is removed. @@ -120,26 +100,9 @@ class DomainParticipantListener : * * @param[out] participant Pointer to the Participant which discovered the remote DataReader. * @param[out] info Remote DataReader information. User can take ownership of the object. - */ - virtual void on_subscriber_discovery( - DomainParticipant* participant, - fastrtps::rtps::ReaderDiscoveryInfo&& info) - { - static_cast(participant); - static_cast(info); - } - - /*! - * This method is called when a new DataReader is discovered, or a previously discovered DataReader changes - * its QOS or is removed. - * - * @warning Not Supported. This callback will never be called in the current version. - * - * @param[out] participant Pointer to the Participant which discovered the remote DataReader. - * @param[out] info Remote DataReader information. User can take ownership of the object. * @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader. */ - virtual void on_subscriber_discovery( + virtual void on_data_reader_discovery( DomainParticipant* participant, fastrtps::rtps::ReaderDiscoveryInfo&& info, bool& should_be_ignored) @@ -155,26 +118,9 @@ class DomainParticipantListener : * * @param[out] participant Pointer to the Participant which discovered the remote DataWriter. * @param[out] info Remote DataWriter information. User can take ownership of the object. - */ - virtual void on_publisher_discovery( - DomainParticipant* participant, - fastrtps::rtps::WriterDiscoveryInfo&& info) - { - static_cast(participant); - static_cast(info); - } - - /*! - * This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes - * its QOS or is removed. - * - * @warning Not Supported. This callback will never be called in the current version. - * - * @param[out] participant Pointer to the Participant which discovered the remote DataWriter. - * @param[out] info Remote DataWriter information. User can take ownership of the object. * @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter. */ - virtual void on_publisher_discovery( + virtual void on_data_writer_discovery( DomainParticipant* participant, fastrtps::rtps::WriterDiscoveryInfo&& info, bool& should_be_ignored) @@ -184,59 +130,6 @@ class DomainParticipantListener : static_cast(should_be_ignored); } - /*! - * This method is called when a participant discovers a new Type - * The ownership of all object belongs to the caller so if needs to be used after the - * method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature. - * For example: - * fastrtps::types::TypeIdentifier new_type_id = \*identifier; - */ - virtual void on_type_discovery( - DomainParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::string_255& topic, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(topic); - static_cast(identifier); - static_cast(object); - static_cast(dyn_type); - } - - /*! - * This method is called when the typelookup client received a reply to a getTypeDependencies request. - * The user may want to retrieve these new types using the getTypes request and create a new - * DynamicType using the retrieved TypeObject. - */ - virtual void on_type_dependencies_reply( - DomainParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(dependencies); - } - - /*! - * This method is called when a participant receives a TypeInformation while discovering another participant. - */ - virtual void on_type_information_received( - DomainParticipant* participant, - const fastrtps::string_255 topic_name, - const fastrtps::string_255 type_name, - const fastrtps::types::TypeInformation& type_information) - { - static_cast(participant); - static_cast(topic_name); - static_cast(type_name); - static_cast(type_information); - } - // TODO: Methods in DomainParticipantListener (p.33 - DDS) }; diff --git a/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp b/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp index 12e46cc1535..be0c1c1ccef 100644 --- a/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp +++ b/include/fastdds/dds/domain/qos/DomainParticipantFactoryQos.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -40,14 +40,14 @@ class DomainParticipantFactoryQos /** * @brief Constructor */ - RTPS_DllAPI DomainParticipantFactoryQos() + FASTDDS_EXPORTED_API DomainParticipantFactoryQos() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~DomainParticipantFactoryQos() + FASTDDS_EXPORTED_API virtual ~DomainParticipantFactoryQos() { } @@ -162,7 +162,7 @@ class DomainParticipantFactoryQos }; -RTPS_DllAPI extern const DomainParticipantFactoryQos PARTICIPANT_FACTORY_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const DomainParticipantFactoryQos PARTICIPANT_FACTORY_QOS_DEFAULT; } /* namespace dds */ } /* namespace fastdds */ diff --git a/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp b/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp index 4397791390e..9fdb758501a 100644 --- a/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp +++ b/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -52,7 +52,7 @@ class DomainParticipantQos /** * @brief Constructor */ - RTPS_DllAPI DomainParticipantQos() + FASTDDS_EXPORTED_API DomainParticipantQos() { #ifdef FASTDDS_STATISTICS /* @@ -69,7 +69,7 @@ class DomainParticipantQos /** * @brief Destructor */ - RTPS_DllAPI virtual ~DomainParticipantQos() + FASTDDS_EXPORTED_API virtual ~DomainParticipantQos() { } @@ -86,6 +86,7 @@ class DomainParticipantQos (this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) && (this->timed_events_thread_ == b.timed_events_thread()) && (this->discovery_server_thread_ == b.discovery_server_thread()) && + (this->typelookup_service_thread_ == b.typelookup_service_thread()) && #if HAVE_SECURITY (this->security_log_thread_ == b.security_log_thread()) && #endif // if HAVE_SECURITY @@ -283,7 +284,7 @@ class DomainParticipantQos * * @return name */ - const fastrtps::string_255& name() const + const fastcdr::string_255& name() const { return name_; } @@ -293,7 +294,7 @@ class DomainParticipantQos * * @return name */ - fastrtps::string_255& name() + fastcdr::string_255& name() { return name_; } @@ -304,7 +305,7 @@ class DomainParticipantQos * @param value New name to be set */ void name( - const fastrtps::string_255& value) + const fastcdr::string_255& value) { name_ = value; } @@ -356,7 +357,7 @@ class DomainParticipantQos * @param transports Defines the transport configuration scenario to setup. * @param options Defines the options to be used in the transport configuration. */ - RTPS_DllAPI void setup_transports( + FASTDDS_EXPORTED_API void setup_transports( rtps::BuiltinTransports transports, const rtps::BuiltinTransportsOptions& options = rtps::BuiltinTransportsOptions()); @@ -433,6 +434,37 @@ class DomainParticipantQos discovery_server_thread_ = value; } + /** + * Getter for TypeLookup service ThreadSettings + * + * @return rtps::ThreadSettings reference + */ + rtps::ThreadSettings& typelookup_service_thread() + { + return typelookup_service_thread_; + } + + /** + * Getter for TypeLookup service ThreadSettings + * + * @return rtps::ThreadSettings reference + */ + const rtps::ThreadSettings& typelookup_service_thread() const + { + return typelookup_service_thread_; + } + + /** + * Setter for the TypeLookup service ThreadSettings + * + * @param value New ThreadSettings to be set + */ + void typelookup_service_thread( + const rtps::ThreadSettings& value) + { + typelookup_service_thread_ = value; + } + #if HAVE_SECURITY /** * Getter for security log ThreadSettings @@ -488,7 +520,7 @@ class DomainParticipantQos TransportConfigQos transport_; //!Name of the participant. - fastrtps::string_255 name_ = "RTPSParticipant"; + fastcdr::string_255 name_ = "RTPSParticipant"; /*! User defined flow controller to use alongside. * @@ -505,6 +537,9 @@ class DomainParticipantQos //! Thread settings for the discovery server thread rtps::ThreadSettings discovery_server_thread_; + //! Thread settings for the builtin TypeLookup service requests and replies threads + rtps::ThreadSettings typelookup_service_thread_; + #if HAVE_SECURITY //! Thread settings for the security log thread rtps::ThreadSettings security_log_thread_; @@ -512,7 +547,7 @@ class DomainParticipantQos }; -RTPS_DllAPI extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT; } /* namespace dds */ diff --git a/include/fastdds/dds/domain/qos/ReplierQos.hpp b/include/fastdds/dds/domain/qos/ReplierQos.hpp new file mode 100644 index 00000000000..3b992a202b3 --- /dev/null +++ b/include/fastdds/dds/domain/qos/ReplierQos.hpp @@ -0,0 +1,80 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file ReplierQos.hpp + */ + +#ifndef _FASTDDS_REPLIERQOS_HPP_ +#define _FASTDDS_REPLIERQOS_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class ReplierQos +{ +public: + + /** + * @brief Constructor + */ + FASTDDS_EXPORTED_API ReplierQos() = default; + + /** + * @brief Equal comparison operator + */ + FASTDDS_EXPORTED_API bool operator ==( + const ReplierQos& b) const + { + return (this->service_name == b.service_name) && + (this->request_topic_name == b.request_topic_name) && + (this->reply_topic_name == b.reply_topic_name) && + (this->writer_qos == b.writer_qos) && + (this->reader_qos == b.reader_qos); + } + + //! Service name + std::string service_name; + + //! Request type + std::string request_type; + + //! Reply type + std::string reply_type; + + //! Request topic name + std::string request_topic_name; + + //! Reply topic name + std::string reply_topic_name; + + //! DataWriter QoS for the reply writer + DataWriterQos writer_qos; + + //! DataReader QoS for the reply reader + DataReaderQos reader_qos; +}; + +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_REPLIERQOS_HPP_ */ diff --git a/include/fastdds/dds/domain/qos/RequesterQos.hpp b/include/fastdds/dds/domain/qos/RequesterQos.hpp new file mode 100644 index 00000000000..fb31447c4bc --- /dev/null +++ b/include/fastdds/dds/domain/qos/RequesterQos.hpp @@ -0,0 +1,80 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file RequesterQos.hpp + */ + +#ifndef _FASTDDS_REQUESTERQOS_HPP_ +#define _FASTDDS_REQUESTERQOS_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class RequesterQos +{ +public: + + /** + * @brief Constructor + */ + FASTDDS_EXPORTED_API RequesterQos() = default; + + /** + * @brief Equal comparison operator + */ + FASTDDS_EXPORTED_API bool operator ==( + const RequesterQos& b) const + { + return (this->service_name == b.service_name) && + (this->request_topic_name == b.request_topic_name) && + (this->reply_topic_name == b.reply_topic_name) && + (this->writer_qos == b.writer_qos) && + (this->reader_qos == b.reader_qos); + } + + //! Service name + std::string service_name; + + //! Request type + std::string request_type; + + //! Reply type + std::string reply_type; + + //! Request topic name + std::string request_topic_name; + + //! Reply topic name + std::string reply_topic_name; + + //! DataWriter QoS for the request writer + DataWriterQos writer_qos; + + //! DataReader QoS for the request reader + DataReaderQos reader_qos; +}; + +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_REQUESTERQOS_HPP_ */ diff --git a/include/fastdds/dds/log/FileConsumer.hpp b/include/fastdds/dds/log/FileConsumer.hpp index a8f0e3a76b3..7bafbe1844a 100644 --- a/include/fastdds/dds/log/FileConsumer.hpp +++ b/include/fastdds/dds/log/FileConsumer.hpp @@ -39,13 +39,13 @@ class FileConsumer : public OStreamConsumer public: //! Default constructor: filename = "output.log", append = false. - RTPS_DllAPI FileConsumer(); + FASTDDS_EXPORTED_API FileConsumer(); /** Constructor with parameters. * @param filename path of the output file where the log will be wrote. * @param append indicates if the consumer must append the content in the filename. */ - RTPS_DllAPI FileConsumer( + FASTDDS_EXPORTED_API FileConsumer( const std::string& filename, bool append = false); @@ -57,7 +57,7 @@ class FileConsumer : public OStreamConsumer * Called by Log consume to get the correct stream * @param entry Log::Entry to consume. */ - RTPS_DllAPI virtual std::ostream& get_stream( + FASTDDS_EXPORTED_API virtual std::ostream& get_stream( const Log::Entry& entry) override; std::string output_file_; diff --git a/include/fastdds/dds/log/Log.hpp b/include/fastdds/dds/log/Log.hpp index 3ad9e655201..51c9bb68b02 100644 --- a/include/fastdds/dds/log/Log.hpp +++ b/include/fastdds/dds/log/Log.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include /** * eProsima log layer. Logging categories and verbosity can be specified dynamically at runtime. @@ -98,51 +98,60 @@ class Log * There is a default stdout consumer active as default. * @param consumer r-value to a consumer unique_ptr. It will be invalidated after the call. */ - RTPS_DllAPI static void RegisterConsumer( + FASTDDS_EXPORTED_API static void RegisterConsumer( std::unique_ptr&& consumer); //! Removes all registered consumers, including the default stdout. - RTPS_DllAPI static void ClearConsumers(); + FASTDDS_EXPORTED_API static void ClearConsumers(); //! Enables the reporting of filenames in log entries. Disabled by default. - RTPS_DllAPI static void ReportFilenames( + FASTDDS_EXPORTED_API static void ReportFilenames( bool); //! Enables the reporting of function names in log entries. Enabled by default when supported. - RTPS_DllAPI static void ReportFunctions( + FASTDDS_EXPORTED_API static void ReportFunctions( bool); //! Sets the verbosity level, allowing for messages equal or under that priority to be logged. - RTPS_DllAPI static void SetVerbosity( + FASTDDS_EXPORTED_API static void SetVerbosity( Log::Kind); //! Returns the current verbosity level. - RTPS_DllAPI static Log::Kind GetVerbosity(); + FASTDDS_EXPORTED_API static Log::Kind GetVerbosity(); //! Sets a filter that will pattern-match against log categories, dropping any unmatched categories. - RTPS_DllAPI static void SetCategoryFilter( + FASTDDS_EXPORTED_API static void SetCategoryFilter( const std::regex&); + //! Returns a copy of the current category filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetCategoryFilter(); + //! Sets a filter that will pattern-match against filenames, dropping any unmatched categories. - RTPS_DllAPI static void SetFilenameFilter( + FASTDDS_EXPORTED_API static void SetFilenameFilter( const std::regex&); + //! Returns a copy of the current filename filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetFilenameFilter(); + //! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories. - RTPS_DllAPI static void SetErrorStringFilter( + FASTDDS_EXPORTED_API static void SetErrorStringFilter( const std::regex&); //! Sets thread configuration for the logging thread. - RTPS_DllAPI static void SetThreadConfig( + FASTDDS_EXPORTED_API static void SetThreadConfig( const rtps::ThreadSettings&); + //! Returns a copy of the current error string filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetErrorStringFilter(); + //! Returns the logging engine to configuration defaults. - RTPS_DllAPI static void Reset(); + FASTDDS_EXPORTED_API static void Reset(); //! Waits until all info logged up to the call time is consumed - RTPS_DllAPI static void Flush(); + FASTDDS_EXPORTED_API static void Flush(); //! Stops the logging thread. It will re-launch on the next call to a successful log macro. - RTPS_DllAPI static void KillThread(); + FASTDDS_EXPORTED_API static void KillThread(); // Note: In VS2013, if you're linking this class statically, you will have to call KillThread before leaving // main, due to an unsolved MSVC bug. @@ -172,7 +181,7 @@ class Log * @todo this method takes 2 mutexes (same mutex) internally. * This is a very high sensible point of the code and it should be refactored to be as efficient as possible. */ - RTPS_DllAPI static void QueueLog( + FASTDDS_EXPORTED_API static void QueueLog( const std::string& message, const Log::Context&, Log::Kind); @@ -218,27 +227,27 @@ class LogConsumer protected: - RTPS_DllAPI void print_timestamp( + FASTDDS_EXPORTED_API void print_timestamp( std::ostream& stream, const Log::Entry&, bool color) const; - RTPS_DllAPI void print_header( + FASTDDS_EXPORTED_API void print_header( std::ostream& stream, const Log::Entry&, bool color) const; - RTPS_DllAPI void print_context( + FASTDDS_EXPORTED_API void print_context( std::ostream& stream, const Log::Entry&, bool color) const; - RTPS_DllAPI void print_message( + FASTDDS_EXPORTED_API void print_message( std::ostream& stream, const Log::Entry&, bool color) const; - RTPS_DllAPI void print_new_line( + FASTDDS_EXPORTED_API void print_new_line( std::ostream& stream, bool color) const; }; @@ -273,17 +282,18 @@ class LogConsumer // Name of variables inside macros must be unique, or it could produce an error with external variables #if !HAVE_LOG_NO_ERROR -#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \ +#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \ do { \ - using namespace eprosima::fastdds::dds; \ std::stringstream fastdds_log_ss_tmp__; \ fastdds_log_ss_tmp__ << msg; \ - Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Error); \ + eprosima::fastdds::dds::Log::QueueLog( \ + fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \ + eprosima::fastdds::dds::Log::Kind::Error); \ } while (0) #elif (__INTERNALDEBUG || _INTERNALDEBUG) -#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \ +#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \ do { \ auto fastdds_log_lambda_tmp__ = [&]() \ { \ @@ -303,21 +313,21 @@ class LogConsumer ***********/ #if !HAVE_LOG_NO_WARNING -#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \ - do { \ - using namespace eprosima::fastdds::dds; \ - if (Log::GetVerbosity() >= Log::Kind::Warning) \ - { \ - std::stringstream fastdds_log_ss_tmp__; \ - fastdds_log_ss_tmp__ << msg; \ - Log::QueueLog( \ - fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Warning); \ - } \ +#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \ + do { \ + if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Warning) \ + { \ + std::stringstream fastdds_log_ss_tmp__; \ + fastdds_log_ss_tmp__ << msg; \ + eprosima::fastdds::dds::Log::QueueLog( \ + fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \ + eprosima::fastdds::dds::Log::Kind::Warning); \ + } \ } while (0) #elif (__INTERNALDEBUG || _INTERNALDEBUG) -#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \ +#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \ do { \ auto fastdds_log_lambda_tmp__ = [&]() \ { \ @@ -342,16 +352,16 @@ class LogConsumer ((defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG)) && (defined(_DEBUG) || defined(__DEBUG) || \ !defined(NDEBUG)))) -#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \ - do { \ - using namespace eprosima::fastdds::dds; \ - if (Log::GetVerbosity() >= Log::Kind::Info) \ - { \ - std::stringstream fastdds_log_ss_tmp__; \ - fastdds_log_ss_tmp__ << msg; \ - Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, \ - Log::Kind::Info); \ - } \ +#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \ + do { \ + if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Info) \ + { \ + std::stringstream fastdds_log_ss_tmp__; \ + fastdds_log_ss_tmp__ << msg; \ + eprosima::fastdds::dds::Log::QueueLog( \ + fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \ + eprosima::fastdds::dds::Log::Kind::Info); \ + } \ } while (0) #elif (__INTERNALDEBUG || _INTERNALDEBUG) diff --git a/include/fastdds/dds/log/OStreamConsumer.hpp b/include/fastdds/dds/log/OStreamConsumer.hpp index b8a5a1c1cda..50550671b28 100644 --- a/include/fastdds/dds/log/OStreamConsumer.hpp +++ b/include/fastdds/dds/log/OStreamConsumer.hpp @@ -38,7 +38,7 @@ class OStreamConsumer : public LogConsumer * Called by Log to ask us to consume the Entry. * @param Log::Entry to consume. */ - RTPS_DllAPI void Consume( + FASTDDS_EXPORTED_API void Consume( const Log::Entry& entry) override; protected: @@ -47,7 +47,7 @@ class OStreamConsumer : public LogConsumer * Called by Log consume to get the correct stream * @param Log::Entry to consume. */ - RTPS_DllAPI virtual std::ostream& get_stream( + FASTDDS_EXPORTED_API virtual std::ostream& get_stream( const Log::Entry& entry) = 0; }; diff --git a/include/fastdds/dds/log/StdoutConsumer.hpp b/include/fastdds/dds/log/StdoutConsumer.hpp index 1c7e304a6ac..f1a73f443a7 100644 --- a/include/fastdds/dds/log/StdoutConsumer.hpp +++ b/include/fastdds/dds/log/StdoutConsumer.hpp @@ -34,7 +34,7 @@ class StdoutConsumer : public OStreamConsumer * Called by Log consume to get the correct stream * @param Log::Entry to consume. */ - RTPS_DllAPI virtual std::ostream& get_stream( + FASTDDS_EXPORTED_API virtual std::ostream& get_stream( const Log::Entry& entry) override; }; diff --git a/include/fastdds/dds/log/StdoutErrConsumer.hpp b/include/fastdds/dds/log/StdoutErrConsumer.hpp index 1464645058a..1f71506f420 100644 --- a/include/fastdds/dds/log/StdoutErrConsumer.hpp +++ b/include/fastdds/dds/log/StdoutErrConsumer.hpp @@ -44,14 +44,14 @@ class StdoutErrConsumer : public OStreamConsumer * std::cout. * @param kind The Log::Kind to which stderr_threshold is set. */ - RTPS_DllAPI virtual void stderr_threshold( + FASTDDS_EXPORTED_API virtual void stderr_threshold( const Log::Kind& kind); /** * @brief Retrieve the stderr_threshold. * @return The Log::Kind to which stderr_threshold is set. */ - RTPS_DllAPI virtual Log::Kind stderr_threshold() const; + FASTDDS_EXPORTED_API virtual Log::Kind stderr_threshold() const; /** * @brief Default value of stderr_threshold. @@ -64,7 +64,7 @@ class StdoutErrConsumer : public OStreamConsumer * Called by Log consume to get the correct stream * @param Log::Entry to consume. */ - RTPS_DllAPI virtual std::ostream& get_stream( + FASTDDS_EXPORTED_API virtual std::ostream& get_stream( const Log::Entry& entry) override; private: diff --git a/include/fastdds/dds/publisher/DataWriter.hpp b/include/fastdds/dds/publisher/DataWriter.hpp index 239e9ee5851..58e0c9b64c0 100644 --- a/include/fastdds/dds/publisher/DataWriter.hpp +++ b/include/fastdds/dds/publisher/DataWriter.hpp @@ -21,21 +21,16 @@ #include #include +#include #include +#include #include #include #include #include - #include #include - -#include - -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace eprosima { namespace fastrtps { @@ -129,7 +124,7 @@ class DataWriter : public DomainEntity * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the Publisher creating this * DataWriter is not enabled. */ - RTPS_DllAPI ReturnCode_t enable() override; + FASTDDS_EXPORTED_API ReturnCode_t enable() override; /** * Write data to the topic. @@ -137,7 +132,7 @@ class DataWriter : public DomainEntity * @param data Pointer to the data * @return True if correct, false otherwise */ - RTPS_DllAPI bool write( + FASTDDS_EXPORTED_API bool write( void* data); /** @@ -147,7 +142,7 @@ class DataWriter : public DomainEntity * @param params Extra write parameters. * @return True if correct, false otherwise */ - RTPS_DllAPI bool write( + FASTDDS_EXPORTED_API bool write( void* data, fastrtps::rtps::WriteParams& params); @@ -162,7 +157,7 @@ class DataWriter : public DomainEntity * @return RETCODE_PRECONDITION_NOT_MET if the handle introduced does not match with the one associated to the data, * RETCODE_OK if the data is correctly sent and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t write( + FASTDDS_EXPORTED_API ReturnCode_t write( void* data, const InstanceHandle_t& handle); @@ -182,20 +177,11 @@ class DataWriter : public DomainEntity * @param timestamp Time_t used to set the source_timestamp. * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t write_w_timestamp( + FASTDDS_EXPORTED_API ReturnCode_t write_w_timestamp( void* data, const InstanceHandle_t& handle, const fastrtps::Time_t& timestamp); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds:DataWriter::write_w_timestamp()", - "In favor of version using eprosima::fastrtps::Time_t.") - RTPS_DllAPI ReturnCode_t write_w_timestamp( - void* data, - const InstanceHandle_t& handle, - const fastrtps::rtps::Time_t& timestamp); -#endif // DOXYGEN_SHOULD_SKIP_THIS - /*! * @brief Informs that the application will be modifying a particular instance. * It gives an opportunity to the middleware to pre-configure itself to improve performance. @@ -205,7 +191,7 @@ class DataWriter : public DomainEntity * This handle could be used in successive `write` or `dispose` operations. * In case of error, HANDLE_NIL will be returned. */ - RTPS_DllAPI InstanceHandle_t register_instance( + FASTDDS_EXPORTED_API InstanceHandle_t register_instance( void* instance); /** @@ -226,18 +212,10 @@ class DataWriter : public DomainEntity * @param timestamp Time_t used to set the source_timestamp. * @return Handle containing the instance's key. */ - RTPS_DllAPI InstanceHandle_t register_instance_w_timestamp( + FASTDDS_EXPORTED_API InstanceHandle_t register_instance_w_timestamp( void* instance, const fastrtps::Time_t& timestamp); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds:DataWriter::register_instance_w_timestamp()", - "In favor of version using eprosima::fastrtps::Time_t.") - RTPS_DllAPI InstanceHandle_t register_instance_w_timestamp( - void* instance, - const fastrtps::rtps::Time_t& timestamp); -#endif // DOXYGEN_SHOULD_SKIP_THIS - /*! * @brief This operation reverses the action of `register_instance`. * It should only be called on an instance that is currently registered. @@ -247,9 +225,9 @@ class DataWriter : public DomainEntity * @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. * @param[in] handle Instance's key to be unregistered. * @return Returns the operation's result. - * If the operation finishes successfully, ReturnCode_t::RETCODE_OK is returned. + * If the operation finishes successfully, RETCODE_OK is returned. */ - RTPS_DllAPI ReturnCode_t unregister_instance( + FASTDDS_EXPORTED_API ReturnCode_t unregister_instance( void* instance, const InstanceHandle_t& handle); @@ -272,20 +250,11 @@ class DataWriter : public DomainEntity * @param timestamp Time_t used to set the source_timestamp. * @return Handle containing the instance's key. */ - RTPS_DllAPI ReturnCode_t unregister_instance_w_timestamp( + FASTDDS_EXPORTED_API ReturnCode_t unregister_instance_w_timestamp( void* instance, const InstanceHandle_t& handle, const fastrtps::Time_t& timestamp); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds:DataWriter::unregister_instance_w_timestamp()", - "In favor of version using eprosima::fastrtps::Time_t.") - RTPS_DllAPI ReturnCode_t unregister_instance_w_timestamp( - void* instance, - const InstanceHandle_t& handle, - const fastrtps::rtps::Time_t& timestamp); -#endif // DOXYGEN_SHOULD_SKIP_THIS - /** * This operation can be used to retrieve the instance key that corresponds to an * @ref eprosima::fastdds::dds::Entity::instance_handle_ "instance_handle". @@ -300,7 +269,7 @@ class DataWriter : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t get_key_value( + FASTDDS_EXPORTED_API ReturnCode_t get_key_value( void* key_holder, const InstanceHandle_t& handle); @@ -315,7 +284,7 @@ class DataWriter : public DomainEntity * * @return handle of the given instance */ - RTPS_DllAPI InstanceHandle_t lookup_instance( + FASTDDS_EXPORTED_API InstanceHandle_t lookup_instance( const void* instance) const; /** @@ -323,21 +292,21 @@ class DataWriter : public DomainEntity * * @return Reference to the DataWriter GUID */ - RTPS_DllAPI const fastrtps::rtps::GUID_t& guid() const; + FASTDDS_EXPORTED_API const fastrtps::rtps::GUID_t& guid() const; /** * Returns the DataWriter's InstanceHandle * * @return Copy of the DataWriter InstanceHandle */ - RTPS_DllAPI InstanceHandle_t get_instance_handle() const; + FASTDDS_EXPORTED_API InstanceHandle_t get_instance_handle() const; /** * Get data type associated to the DataWriter * * @return Copy of the TypeSupport */ - RTPS_DllAPI TypeSupport get_type() const; + FASTDDS_EXPORTED_API TypeSupport get_type() const; /** * Waits the current thread until all writers have received their acknowledgments. @@ -345,7 +314,7 @@ class DataWriter : public DomainEntity * @param max_wait Maximum blocking time for this operation * @return RETCODE_OK if the DataWriter receive the acknowledgments before the time expires and RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t wait_for_acknowledgments( + FASTDDS_EXPORTED_API ReturnCode_t wait_for_acknowledgments( const fastrtps::Duration_t& max_wait); /** @@ -354,7 +323,7 @@ class DataWriter : public DomainEntity * @param[out] status Deadline missed status struct * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_offered_deadline_missed_status( + FASTDDS_EXPORTED_API ReturnCode_t get_offered_deadline_missed_status( OfferedDeadlineMissedStatus& status); /** @@ -363,7 +332,7 @@ class DataWriter : public DomainEntity * @param[out] status Offered incompatible qos status struct * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_offered_incompatible_qos_status( + FASTDDS_EXPORTED_API ReturnCode_t get_offered_incompatible_qos_status( OfferedIncompatibleQosStatus& status); /** @@ -372,7 +341,7 @@ class DataWriter : public DomainEntity * @param[out] status publication matched status struct * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_publication_matched_status( + FASTDDS_EXPORTED_API ReturnCode_t get_publication_matched_status( PublicationMatchedStatus& status) const; /** @@ -382,7 +351,7 @@ class DataWriter : public DomainEntity * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not * self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const DataWriterQos& qos); /** @@ -390,7 +359,7 @@ class DataWriter : public DomainEntity * * @return Reference to the current DataWriterQos */ - RTPS_DllAPI const DataWriterQos& get_qos() const; + FASTDDS_EXPORTED_API const DataWriterQos& get_qos() const; /** * Fills the DataWriterQos with the values of this DataWriter. @@ -398,7 +367,7 @@ class DataWriter : public DomainEntity * @param qos DataWriterQos object where the qos is returned. * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( DataWriterQos& qos) const; /** @@ -406,14 +375,14 @@ class DataWriter : public DomainEntity * * @return Pointer to the associated Topic */ - RTPS_DllAPI Topic* get_topic() const; + FASTDDS_EXPORTED_API Topic* get_topic() const; /** * Retrieves the listener for this DataWriter. * * @return Pointer to the DataWriterListener */ - RTPS_DllAPI const DataWriterListener* get_listener() const; + FASTDDS_EXPORTED_API const DataWriterListener* get_listener() const; /** * Modifies the DataWriterListener, sets the mask to StatusMask::all() @@ -421,7 +390,7 @@ class DataWriter : public DomainEntity * @param listener new value for the DataWriterListener * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DataWriterListener* listener); /** @@ -431,7 +400,7 @@ class DataWriter : public DomainEntity * @param mask StatusMask that holds statuses the listener responds to (default: all). * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DataWriterListener* listener, const StatusMask& mask); @@ -450,7 +419,7 @@ class DataWriter : public DomainEntity * @return RETCODE_PRECONDITION_NOT_MET if the handle introduced does not match with the one associated to the data, * RETCODE_OK if the data is correctly sent and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t dispose( + FASTDDS_EXPORTED_API ReturnCode_t dispose( void* data, const InstanceHandle_t& handle); @@ -472,9 +441,9 @@ class DataWriter : public DomainEntity * @param instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. * @param handle Instance's key to be disposed. * @param timestamp Time_t used to set the source_timestamp. - * @return RTPS_DllAPI + * @return FASTDDS_EXPORTED_API */ - RTPS_DllAPI ReturnCode_t dispose_w_timestamp( + FASTDDS_EXPORTED_API ReturnCode_t dispose_w_timestamp( void* instance, const InstanceHandle_t& handle, const fastrtps::Time_t& timestamp); @@ -484,7 +453,7 @@ class DataWriter : public DomainEntity * @param status Liveliness lost status struct * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_liveliness_lost_status( + FASTDDS_EXPORTED_API ReturnCode_t get_liveliness_lost_status( LivelinessLostStatus& status); /** @@ -492,7 +461,7 @@ class DataWriter : public DomainEntity * * @return Pointer to the Publisher */ - RTPS_DllAPI const Publisher* get_publisher() const; + FASTDDS_EXPORTED_API const Publisher* get_publisher() const; /** * @brief This operation manually asserts the liveliness of the DataWriter. This is used in combination with the @@ -506,7 +475,7 @@ class DataWriter : public DomainEntity * * @return RETCODE_OK if asserted, RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t assert_liveliness(); + FASTDDS_EXPORTED_API ReturnCode_t assert_liveliness(); /** * @brief Retrieves in a subscription associated with the DataWriter @@ -514,9 +483,10 @@ class DataWriter : public DomainEntity * @param[out] subscription_data subscription data struct * @param subscription_handle InstanceHandle_t of the subscription * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_matched_subscription_data( + FASTDDS_EXPORTED_API ReturnCode_t get_matched_subscription_data( builtin::SubscriptionBuiltinTopicData& subscription_data, const InstanceHandle_t& subscription_handle) const; @@ -525,25 +495,19 @@ class DataWriter : public DomainEntity * * @param[out] subscription_handles Vector where the InstanceHandle_t are returned * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_matched_subscriptions( + FASTDDS_EXPORTED_API ReturnCode_t get_matched_subscriptions( std::vector& subscription_handles) const; -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds:DataWriter::get_matched_subscriptions()", - "In favor of version using std::vector.") - RTPS_DllAPI ReturnCode_t get_matched_subscriptions( - std::vector& subscription_handles) const; -#endif // DOXYGEN_SHOULD_SKIP_THIS - /** * @brief Clears the DataWriter history * * @param removed size_t pointer to return the size of the data removed * @return RETCODE_OK if the samples are removed and RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t clear_history( + FASTDDS_EXPORTED_API ReturnCode_t clear_history( size_t* removed); /** @@ -566,12 +530,12 @@ class DataWriter : public DomainEntity * @param [out] sample Pointer to the sample on the internal pool. * @param [in] initialization How to initialize the loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the data type does not support loans. - * @return ReturnCode_t::RETCODE_NOT_ENABLED if the writer has not been enabled. - * @return ReturnCode_t::RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. - * @return ReturnCode_t::RETCODE_OK if a pointer to a sample is successfully obtained. + * @return RETCODE_ILLEGAL_OPERATION when the data type does not support loans. + * @return RETCODE_NOT_ENABLED if the writer has not been enabled. + * @return RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. + * @return RETCODE_OK if a pointer to a sample is successfully obtained. */ - RTPS_DllAPI ReturnCode_t loan_sample( + FASTDDS_EXPORTED_API ReturnCode_t loan_sample( void*& sample, LoanInitializationKind initialization = LoanInitializationKind::NO_LOAN_INITIALIZATION); @@ -582,12 +546,12 @@ class DataWriter : public DomainEntity * * @param [in,out] sample Pointer to the previously loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the data type does not support loans. - * @return ReturnCode_t::RETCODE_NOT_ENABLED if the writer has not been enabled. - * @return ReturnCode_t::RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. - * @return ReturnCode_t::RETCODE_OK if the loan is successfully discarded. + * @return RETCODE_ILLEGAL_OPERATION when the data type does not support loans. + * @return RETCODE_NOT_ENABLED if the writer has not been enabled. + * @return RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. + * @return RETCODE_OK if the loan is successfully discarded. */ - RTPS_DllAPI ReturnCode_t discard_loan( + FASTDDS_EXPORTED_API ReturnCode_t discard_loan( void*& sample); /** @@ -598,7 +562,7 @@ class DataWriter : public DomainEntity * @return NOT_ENABLED if the reader has not been enabled. * @return OK if a list of locators is returned. */ - RTPS_DllAPI ReturnCode_t get_sending_locators( + FASTDDS_EXPORTED_API ReturnCode_t get_sending_locators( rtps::LocatorList& locators) const; /** @@ -617,7 +581,7 @@ class DataWriter : public DomainEntity * @return RETCODE_OK if the DataWriter received the acknowledgments before the time expired. * @return RETCODE_TIMEOUT otherwise. */ - RTPS_DllAPI ReturnCode_t wait_for_acknowledgments( + FASTDDS_EXPORTED_API ReturnCode_t wait_for_acknowledgments( void* instance, const InstanceHandle_t& handle, const fastrtps::Duration_t& max_wait); diff --git a/include/fastdds/dds/publisher/DataWriterListener.hpp b/include/fastdds/dds/publisher/DataWriterListener.hpp index db0f6723968..b75bf6bbcc1 100644 --- a/include/fastdds/dds/publisher/DataWriterListener.hpp +++ b/include/fastdds/dds/publisher/DataWriterListener.hpp @@ -16,8 +16,8 @@ * @file DataWriterListener.hpp */ -#ifndef _FASTRTPS_DATAWRITERLISTENER_HPP_ -#define _FASTRTPS_DATAWRITERLISTENER_HPP_ +#ifndef _FASTDDS_DATAWRITERLISTENER_HPP_ +#define _FASTDDS_DATAWRITERLISTENER_HPP_ #include #include @@ -35,7 +35,7 @@ class DataWriter; * Class DataWriterListener, allows the end user to implement callbacks triggered by certain events. * @ingroup FASTDDS_MODULE */ -class RTPS_DllAPI DataWriterListener +class FASTDDS_EXPORTED_API DataWriterListener { public: @@ -129,4 +129,4 @@ class RTPS_DllAPI DataWriterListener } /* namespace fastdds */ } /* namespace eprosima */ -#endif /* _FASTRTPS_DATAWRITERLISTENER_HPP_ */ +#endif /* _FASTDDS_DATAWRITERLISTENER_HPP_ */ diff --git a/include/fastdds/dds/publisher/Publisher.hpp b/include/fastdds/dds/publisher/Publisher.hpp index 326add33f17..867d15134b7 100644 --- a/include/fastdds/dds/publisher/Publisher.hpp +++ b/include/fastdds/dds/publisher/Publisher.hpp @@ -21,15 +21,13 @@ #define _FASTDDS_PUBLISHER_HPP_ #include +#include #include #include #include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace dds { namespace pub { @@ -93,21 +91,21 @@ class Publisher : public DomainEntity * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the participant creating this * Publisher is not enabled. */ - RTPS_DllAPI ReturnCode_t enable() override; + FASTDDS_EXPORTED_API ReturnCode_t enable() override; /** * Allows accessing the Publisher Qos. * * @return PublisherQos reference */ - RTPS_DllAPI const PublisherQos& get_qos() const; + FASTDDS_EXPORTED_API const PublisherQos& get_qos() const; /** * Retrieves the Publisher Qos. * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( PublisherQos& qos) const; /** @@ -118,7 +116,7 @@ class Publisher : public DomainEntity * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not * self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const PublisherQos& qos); /** @@ -126,7 +124,7 @@ class Publisher : public DomainEntity * * @return PublisherListener pointer */ - RTPS_DllAPI const PublisherListener* get_listener() const; + FASTDDS_EXPORTED_API const PublisherListener* get_listener() const; /** * Modifies the PublisherListener, sets the mask to StatusMask::all() @@ -134,7 +132,7 @@ class Publisher : public DomainEntity * @param listener new value for the PublisherListener * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( PublisherListener* listener); /** @@ -144,7 +142,7 @@ class Publisher : public DomainEntity * @param mask StatusMask that holds statuses the listener responds to * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( PublisherListener* listener, const StatusMask& mask); @@ -158,7 +156,7 @@ class Publisher : public DomainEntity * @param payload_pool IPayloadPool shared pointer that defines writer payload (default: nullptr). * @return Pointer to the created DataWriter. nullptr if failed. */ - RTPS_DllAPI DataWriter* create_datawriter( + FASTDDS_EXPORTED_API DataWriter* create_datawriter( Topic* topic, const DataWriterQos& qos, DataWriterListener* listener = nullptr, @@ -175,7 +173,7 @@ class Publisher : public DomainEntity * @param payload_pool IPayloadPool shared pointer that defines writer payload (default: nullptr). * @return Pointer to the created DataWriter. nullptr if failed. */ - RTPS_DllAPI DataWriter* create_datawriter_with_profile( + FASTDDS_EXPORTED_API DataWriter* create_datawriter_with_profile( Topic* topic, const std::string& profile_name, DataWriterListener* listener = nullptr, @@ -197,7 +195,7 @@ class Publisher : public DomainEntity * @return RETCODE_PRECONDITION_NOT_MET if it does not belong to this Publisher, RETCODE_OK if it is correctly deleted and * RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t delete_datawriter( + FASTDDS_EXPORTED_API ReturnCode_t delete_datawriter( const DataWriter* writer); /** @@ -210,40 +208,44 @@ class Publisher : public DomainEntity * @param topic_name Name of the Topic * @return Pointer to a previously created DataWriter associated to a Topic with the requested topic_name */ - RTPS_DllAPI DataWriter* lookup_datawriter( + FASTDDS_EXPORTED_API DataWriter* lookup_datawriter( const std::string& topic_name) const; /** * @brief Indicates to FastDDS that the contained DataWriters are about to be modified * * @return RETCODE_OK if successful, an error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t suspend_publications(); + FASTDDS_EXPORTED_API ReturnCode_t suspend_publications(); /** * @brief Indicates to FastDDS that the modifications to the DataWriters are complete. * * @return RETCODE_OK if successful, an error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t resume_publications(); + FASTDDS_EXPORTED_API ReturnCode_t resume_publications(); /** * @brief Signals the beginning of a set of coherent cache changes using the Datawriters attached to the publisher * * @return RETCODE_OK if successful, an error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t begin_coherent_changes(); + FASTDDS_EXPORTED_API ReturnCode_t begin_coherent_changes(); /** * @brief Signals the end of a set of coherent cache changes * * @return RETCODE_OK if successful, an error code otherwise + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t end_coherent_changes(); + FASTDDS_EXPORTED_API ReturnCode_t end_coherent_changes(); /** * This operation blocks the calling thread until either all data written by the reliable DataWriter entities @@ -256,7 +258,7 @@ class Publisher : public DomainEntity * @return RETCODE_TIMEOUT if the function takes more than the maximum blocking time established, RETCODE_OK if the * Publisher receives the acknowledgments and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t wait_for_acknowledgments( + FASTDDS_EXPORTED_API ReturnCode_t wait_for_acknowledgments( const fastrtps::Duration_t& max_wait); /** @@ -264,14 +266,14 @@ class Publisher : public DomainEntity * * @return Pointer to the DomainParticipant */ - RTPS_DllAPI const DomainParticipant* get_participant() const; + FASTDDS_EXPORTED_API const DomainParticipant* get_participant() const; /** * @brief Deletes all contained DataWriters * * @return RETCODE_OK if successful, an error code otherwise */ - RTPS_DllAPI ReturnCode_t delete_contained_entities(); + FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities(); /** * This operation sets a default value of the DataWriter QoS policies which will be used for newly created @@ -287,7 +289,7 @@ class Publisher : public DomainEntity * @param qos DataWriterQos to be set * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_datawriter_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_datawriter_qos( const DataWriterQos& qos); /** @@ -300,7 +302,7 @@ class Publisher : public DomainEntity * * @return Current default WriterQos */ - RTPS_DllAPI const DataWriterQos& get_default_datawriter_qos() const; + FASTDDS_EXPORTED_API const DataWriterQos& get_default_datawriter_qos() const; /** * This operation retrieves the default value of the DataWriter QoS, that is, the QoS policies which will be used @@ -313,7 +315,7 @@ class Publisher : public DomainEntity * @param qos Reference to the current default WriterQos. * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_datawriter_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_datawriter_qos( DataWriterQos& qos) const; /** @@ -322,8 +324,10 @@ class Publisher : public DomainEntity * @param[out] writer_qos * @param[in] topic_qos * @return RETCODE_OK if successful, an error code otherwise + * + * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI static ReturnCode_t copy_from_topic_qos( + FASTDDS_EXPORTED_API static ReturnCode_t copy_from_topic_qos( fastdds::dds::DataWriterQos& writer_qos, const fastdds::dds::TopicQos& topic_qos); @@ -334,7 +338,7 @@ class Publisher : public DomainEntity * @param qos DataWriterQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_datawriter_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_datawriter_qos_from_profile( const std::string& profile_name, DataWriterQos& qos) const; @@ -343,7 +347,7 @@ class Publisher : public DomainEntity * * @return InstanceHandle of this Publisher. */ - RTPS_DllAPI const InstanceHandle_t& get_instance_handle() const; + FASTDDS_EXPORTED_API const InstanceHandle_t& get_instance_handle() const; /** * Fills the given vector with all the datawriters of this publisher. @@ -351,7 +355,7 @@ class Publisher : public DomainEntity * @param writers Vector where the DataWriters are returned * @return true */ - RTPS_DllAPI bool get_datawriters( + FASTDDS_EXPORTED_API bool get_datawriters( std::vector& writers) const; /** @@ -359,7 +363,7 @@ class Publisher : public DomainEntity * * @return true if the publisher has one or several DataWriters, false otherwise */ - RTPS_DllAPI bool has_datawriters() const; + FASTDDS_EXPORTED_API bool has_datawriters() const; protected: diff --git a/include/fastdds/dds/publisher/PublisherListener.hpp b/include/fastdds/dds/publisher/PublisherListener.hpp index 1045c544a2c..2a27ae26d57 100644 --- a/include/fastdds/dds/publisher/PublisherListener.hpp +++ b/include/fastdds/dds/publisher/PublisherListener.hpp @@ -19,8 +19,8 @@ #ifndef _FASTDDS_PUBLISHERLISTENER_HPP_ #define _FASTDDS_PUBLISHERLISTENER_HPP_ -#include #include +#include #include #include @@ -42,14 +42,14 @@ class PublisherListener : public DataWriterListener /** * @brief Constructor */ - RTPS_DllAPI PublisherListener() + FASTDDS_EXPORTED_API PublisherListener() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~PublisherListener() + FASTDDS_EXPORTED_API virtual ~PublisherListener() { } diff --git a/include/fastdds/dds/publisher/qos/DataWriterQos.hpp b/include/fastdds/dds/publisher/qos/DataWriterQos.hpp index d14ba2ea9f5..291982d6829 100644 --- a/include/fastdds/dds/publisher/qos/DataWriterQos.hpp +++ b/include/fastdds/dds/publisher/qos/DataWriterQos.hpp @@ -41,14 +41,14 @@ class RTPSReliableWriterQos /** * @brief Constructor */ - RTPS_DllAPI RTPSReliableWriterQos() + FASTDDS_EXPORTED_API RTPSReliableWriterQos() { } /** * @brief Destructor */ - virtual RTPS_DllAPI ~RTPSReliableWriterQos() = default; + virtual FASTDDS_EXPORTED_API ~RTPSReliableWriterQos() = default; bool operator ==( const RTPSReliableWriterQos& b) const @@ -83,14 +83,14 @@ class DataWriterQos /** * @brief Constructor */ - RTPS_DllAPI DataWriterQos(); + FASTDDS_EXPORTED_API DataWriterQos(); /** * @brief Destructor */ - RTPS_DllAPI ~DataWriterQos() = default; + FASTDDS_EXPORTED_API ~DataWriterQos() = default; - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const DataWriterQos& b) const { return (this->durability_ == b.durability()) && @@ -118,7 +118,7 @@ class DataWriterQos (this->data_sharing_ == b.data_sharing()); } - RTPS_DllAPI WriterQos get_writerqos( + FASTDDS_EXPORTED_API WriterQos get_writerqos( const PublisherQos& pqos, const TopicQos& tqos) const; @@ -127,7 +127,7 @@ class DataWriterQos * * @return DurabilityQosPolicy reference */ - RTPS_DllAPI DurabilityQosPolicy& durability() + FASTDDS_EXPORTED_API DurabilityQosPolicy& durability() { return durability_; } @@ -137,7 +137,7 @@ class DataWriterQos * * @return DurabilityQosPolicy reference */ - RTPS_DllAPI const DurabilityQosPolicy& durability() const + FASTDDS_EXPORTED_API const DurabilityQosPolicy& durability() const { return durability_; } @@ -147,7 +147,7 @@ class DataWriterQos * * @param durability new value for the DurabilityQosPolicy */ - RTPS_DllAPI void durability( + FASTDDS_EXPORTED_API void durability( const DurabilityQosPolicy& durability) { durability_ = durability; @@ -158,7 +158,7 @@ class DataWriterQos * * @return DurabilityServiceQosPolicy reference */ - RTPS_DllAPI DurabilityServiceQosPolicy& durability_service() + FASTDDS_EXPORTED_API DurabilityServiceQosPolicy& durability_service() { return durability_service_; } @@ -168,7 +168,7 @@ class DataWriterQos * * @return DurabilityServiceQosPolicy reference */ - RTPS_DllAPI const DurabilityServiceQosPolicy& durability_service() const + FASTDDS_EXPORTED_API const DurabilityServiceQosPolicy& durability_service() const { return durability_service_; } @@ -178,7 +178,7 @@ class DataWriterQos * * @param durability_service new value for the DurabilityServiceQosPolicy */ - RTPS_DllAPI void durability_service( + FASTDDS_EXPORTED_API void durability_service( const DurabilityServiceQosPolicy& durability_service) { durability_service_ = durability_service; @@ -189,7 +189,7 @@ class DataWriterQos * * @return DeadlineQosPolicy reference */ - RTPS_DllAPI DeadlineQosPolicy& deadline() + FASTDDS_EXPORTED_API DeadlineQosPolicy& deadline() { return deadline_; } @@ -199,7 +199,7 @@ class DataWriterQos * * @return DeadlineQosPolicy reference */ - RTPS_DllAPI const DeadlineQosPolicy& deadline() const + FASTDDS_EXPORTED_API const DeadlineQosPolicy& deadline() const { return deadline_; } @@ -209,7 +209,7 @@ class DataWriterQos * * @param deadline new value for the DeadlineQosPolicy */ - RTPS_DllAPI void deadline( + FASTDDS_EXPORTED_API void deadline( const DeadlineQosPolicy& deadline) { deadline_ = deadline; @@ -220,7 +220,7 @@ class DataWriterQos * * @return LatencyBudgetQosPolicy reference */ - RTPS_DllAPI LatencyBudgetQosPolicy& latency_budget() + FASTDDS_EXPORTED_API LatencyBudgetQosPolicy& latency_budget() { return latency_budget_; } @@ -230,7 +230,7 @@ class DataWriterQos * * @return LatencyBudgetQosPolicy reference */ - RTPS_DllAPI const LatencyBudgetQosPolicy& latency_budget() const + FASTDDS_EXPORTED_API const LatencyBudgetQosPolicy& latency_budget() const { return latency_budget_; } @@ -240,7 +240,7 @@ class DataWriterQos * * @param latency_budget new value for the LatencyBudgetQosPolicy */ - RTPS_DllAPI void latency_budget( + FASTDDS_EXPORTED_API void latency_budget( const LatencyBudgetQosPolicy& latency_budget) { latency_budget_ = latency_budget; @@ -251,7 +251,7 @@ class DataWriterQos * * @return LivelinessQosPolicy reference */ - RTPS_DllAPI LivelinessQosPolicy& liveliness() + FASTDDS_EXPORTED_API LivelinessQosPolicy& liveliness() { return liveliness_; } @@ -261,7 +261,7 @@ class DataWriterQos * * @return LivelinessQosPolicy reference */ - RTPS_DllAPI const LivelinessQosPolicy& liveliness() const + FASTDDS_EXPORTED_API const LivelinessQosPolicy& liveliness() const { return liveliness_; } @@ -271,7 +271,7 @@ class DataWriterQos * * @param liveliness new value for the LivelinessQosPolicy */ - RTPS_DllAPI void liveliness( + FASTDDS_EXPORTED_API void liveliness( const LivelinessQosPolicy& liveliness) { liveliness_ = liveliness; @@ -282,7 +282,7 @@ class DataWriterQos * * @return ReliabilityQosPolicy reference */ - RTPS_DllAPI ReliabilityQosPolicy& reliability() + FASTDDS_EXPORTED_API ReliabilityQosPolicy& reliability() { return reliability_; } @@ -292,7 +292,7 @@ class DataWriterQos * * @return ReliabilityQosPolicy reference */ - RTPS_DllAPI const ReliabilityQosPolicy& reliability() const + FASTDDS_EXPORTED_API const ReliabilityQosPolicy& reliability() const { return reliability_; } @@ -302,7 +302,7 @@ class DataWriterQos * * @param reliability new value for the ReliabilityQosPolicy */ - RTPS_DllAPI void reliability( + FASTDDS_EXPORTED_API void reliability( const ReliabilityQosPolicy& reliability) { reliability_ = reliability; @@ -313,7 +313,7 @@ class DataWriterQos * * @return DestinationOrderQosPolicy reference */ - RTPS_DllAPI DestinationOrderQosPolicy& destination_order() + FASTDDS_EXPORTED_API DestinationOrderQosPolicy& destination_order() { return destination_order_; } @@ -323,7 +323,7 @@ class DataWriterQos * * @return DestinationOrderQosPolicy reference */ - RTPS_DllAPI const DestinationOrderQosPolicy& destination_order() const + FASTDDS_EXPORTED_API const DestinationOrderQosPolicy& destination_order() const { return destination_order_; } @@ -333,7 +333,7 @@ class DataWriterQos * * @param destination_order new value for the DestinationOrderQosPolicy */ - RTPS_DllAPI void destination_order( + FASTDDS_EXPORTED_API void destination_order( const DestinationOrderQosPolicy& destination_order) { destination_order_ = destination_order; @@ -344,7 +344,7 @@ class DataWriterQos * * @return HistoryQosPolicy reference */ - RTPS_DllAPI HistoryQosPolicy& history() + FASTDDS_EXPORTED_API HistoryQosPolicy& history() { return history_; } @@ -354,7 +354,7 @@ class DataWriterQos * * @return HistoryQosPolicy reference */ - RTPS_DllAPI const HistoryQosPolicy& history() const + FASTDDS_EXPORTED_API const HistoryQosPolicy& history() const { return history_; } @@ -364,7 +364,7 @@ class DataWriterQos * * @param history new value for the HistoryQosPolicy */ - RTPS_DllAPI void history( + FASTDDS_EXPORTED_API void history( const HistoryQosPolicy& history) { history_ = history; @@ -375,7 +375,7 @@ class DataWriterQos * * @return ResourceLimitsQosPolicy reference */ - RTPS_DllAPI ResourceLimitsQosPolicy& resource_limits() + FASTDDS_EXPORTED_API ResourceLimitsQosPolicy& resource_limits() { return resource_limits_; } @@ -385,7 +385,7 @@ class DataWriterQos * * @return ResourceLimitsQosPolicy reference */ - RTPS_DllAPI const ResourceLimitsQosPolicy& resource_limits() const + FASTDDS_EXPORTED_API const ResourceLimitsQosPolicy& resource_limits() const { return resource_limits_; } @@ -395,7 +395,7 @@ class DataWriterQos * * @param resource_limits new value for the ResourceLimitsQosPolicy */ - RTPS_DllAPI void resource_limits( + FASTDDS_EXPORTED_API void resource_limits( const ResourceLimitsQosPolicy& resource_limits) { resource_limits_ = resource_limits; @@ -406,7 +406,7 @@ class DataWriterQos * * @return TransportPriorityQosPolicy reference */ - RTPS_DllAPI TransportPriorityQosPolicy& transport_priority() + FASTDDS_EXPORTED_API TransportPriorityQosPolicy& transport_priority() { return transport_priority_; } @@ -416,7 +416,7 @@ class DataWriterQos * * @return TransportPriorityQosPolicy reference */ - RTPS_DllAPI const TransportPriorityQosPolicy& transport_priority() const + FASTDDS_EXPORTED_API const TransportPriorityQosPolicy& transport_priority() const { return transport_priority_; } @@ -426,7 +426,7 @@ class DataWriterQos * * @param transport_priority new value for the TransportPriorityQosPolicy */ - RTPS_DllAPI void transport_priority( + FASTDDS_EXPORTED_API void transport_priority( const TransportPriorityQosPolicy& transport_priority) { transport_priority_ = transport_priority; @@ -437,7 +437,7 @@ class DataWriterQos * * @return LifespanQosPolicy reference */ - RTPS_DllAPI LifespanQosPolicy& lifespan() + FASTDDS_EXPORTED_API LifespanQosPolicy& lifespan() { return lifespan_; } @@ -447,7 +447,7 @@ class DataWriterQos * * @return LifespanQosPolicy reference */ - RTPS_DllAPI const LifespanQosPolicy& lifespan() const + FASTDDS_EXPORTED_API const LifespanQosPolicy& lifespan() const { return lifespan_; } @@ -457,7 +457,7 @@ class DataWriterQos * * @param lifespan new value for the LifespanQosPolicy */ - RTPS_DllAPI void lifespan( + FASTDDS_EXPORTED_API void lifespan( const LifespanQosPolicy& lifespan) { lifespan_ = lifespan; @@ -468,7 +468,7 @@ class DataWriterQos * * @return UserDataQosPolicy reference */ - RTPS_DllAPI UserDataQosPolicy& user_data() + FASTDDS_EXPORTED_API UserDataQosPolicy& user_data() { return user_data_; } @@ -478,7 +478,7 @@ class DataWriterQos * * @return UserDataQosPolicy reference */ - RTPS_DllAPI const UserDataQosPolicy& user_data() const + FASTDDS_EXPORTED_API const UserDataQosPolicy& user_data() const { return user_data_; } @@ -488,7 +488,7 @@ class DataWriterQos * * @param user_data new value for the UserDataQosPolicy */ - RTPS_DllAPI void user_data( + FASTDDS_EXPORTED_API void user_data( const UserDataQosPolicy& user_data) { user_data_ = user_data; @@ -499,7 +499,7 @@ class DataWriterQos * * @return OwnershipQosPolicy reference */ - RTPS_DllAPI OwnershipQosPolicy& ownership() + FASTDDS_EXPORTED_API OwnershipQosPolicy& ownership() { return ownership_; } @@ -509,7 +509,7 @@ class DataWriterQos * * @return OwnershipQosPolicy reference */ - RTPS_DllAPI const OwnershipQosPolicy& ownership() const + FASTDDS_EXPORTED_API const OwnershipQosPolicy& ownership() const { return ownership_; } @@ -519,7 +519,7 @@ class DataWriterQos * * @param ownership new value for the OwnershipQosPolicy */ - RTPS_DllAPI void ownership( + FASTDDS_EXPORTED_API void ownership( const OwnershipQosPolicy& ownership) { ownership_ = ownership; @@ -530,7 +530,7 @@ class DataWriterQos * * @return OwnershipStrengthQosPolicy reference */ - RTPS_DllAPI OwnershipStrengthQosPolicy& ownership_strength() + FASTDDS_EXPORTED_API OwnershipStrengthQosPolicy& ownership_strength() { return ownership_strength_; } @@ -540,7 +540,7 @@ class DataWriterQos * * @return OwnershipStrengthQosPolicy reference */ - RTPS_DllAPI const OwnershipStrengthQosPolicy& ownership_strength() const + FASTDDS_EXPORTED_API const OwnershipStrengthQosPolicy& ownership_strength() const { return ownership_strength_; } @@ -550,7 +550,7 @@ class DataWriterQos * * @param ownership_strength new value for the OwnershipStrengthQosPolicy */ - RTPS_DllAPI void ownership_strength( + FASTDDS_EXPORTED_API void ownership_strength( const OwnershipStrengthQosPolicy& ownership_strength) { ownership_strength_ = ownership_strength; @@ -561,7 +561,7 @@ class DataWriterQos * * @return WriterDataLifecycleQosPolicy reference */ - RTPS_DllAPI WriterDataLifecycleQosPolicy& writer_data_lifecycle() + FASTDDS_EXPORTED_API WriterDataLifecycleQosPolicy& writer_data_lifecycle() { return writer_data_lifecycle_; } @@ -571,7 +571,7 @@ class DataWriterQos * * @return WriterDataLifecycleQosPolicy reference */ - RTPS_DllAPI const WriterDataLifecycleQosPolicy& writer_data_lifecycle() const + FASTDDS_EXPORTED_API const WriterDataLifecycleQosPolicy& writer_data_lifecycle() const { return writer_data_lifecycle_; } @@ -581,7 +581,7 @@ class DataWriterQos * * @param writer_data_lifecycle new value for the WriterDataLifecycleQosPolicy */ - RTPS_DllAPI void writer_data_lifecycle( + FASTDDS_EXPORTED_API void writer_data_lifecycle( const WriterDataLifecycleQosPolicy& writer_data_lifecycle) { writer_data_lifecycle_ = writer_data_lifecycle; @@ -592,7 +592,7 @@ class DataWriterQos * * @return PublishModeQosPolicy reference */ - RTPS_DllAPI PublishModeQosPolicy& publish_mode() + FASTDDS_EXPORTED_API PublishModeQosPolicy& publish_mode() { return publish_mode_; } @@ -602,7 +602,7 @@ class DataWriterQos * * @return PublishModeQosPolicy reference */ - RTPS_DllAPI const PublishModeQosPolicy& publish_mode() const + FASTDDS_EXPORTED_API const PublishModeQosPolicy& publish_mode() const { return publish_mode_; } @@ -612,7 +612,7 @@ class DataWriterQos * * @param publish_mode new value for the PublishModeQosPolicy */ - RTPS_DllAPI void publish_mode( + FASTDDS_EXPORTED_API void publish_mode( const PublishModeQosPolicy& publish_mode) { publish_mode_ = publish_mode; @@ -623,7 +623,7 @@ class DataWriterQos * * @return DataRepresentationQosPolicy reference */ - RTPS_DllAPI DataRepresentationQosPolicy& representation() + FASTDDS_EXPORTED_API DataRepresentationQosPolicy& representation() { return representation_; } @@ -633,7 +633,7 @@ class DataWriterQos * * @return DataRepresentationQosPolicy reference */ - RTPS_DllAPI const DataRepresentationQosPolicy& representation() const + FASTDDS_EXPORTED_API const DataRepresentationQosPolicy& representation() const { return representation_; } @@ -643,7 +643,7 @@ class DataWriterQos * * @param representation new value for the DataRepresentationQosPolicy */ - RTPS_DllAPI void representation( + FASTDDS_EXPORTED_API void representation( const DataRepresentationQosPolicy& representation) { representation_ = representation; @@ -654,7 +654,7 @@ class DataWriterQos * * @return PropertyPolicyQos reference */ - RTPS_DllAPI PropertyPolicyQos& properties() + FASTDDS_EXPORTED_API PropertyPolicyQos& properties() { return properties_; } @@ -664,7 +664,7 @@ class DataWriterQos * * @return PropertyPolicyQos reference */ - RTPS_DllAPI const PropertyPolicyQos& properties() const + FASTDDS_EXPORTED_API const PropertyPolicyQos& properties() const { return properties_; } @@ -674,7 +674,7 @@ class DataWriterQos * * @param properties new value for the PropertyPolicyQos */ - RTPS_DllAPI void properties( + FASTDDS_EXPORTED_API void properties( const PropertyPolicyQos& properties) { properties_ = properties; @@ -685,7 +685,7 @@ class DataWriterQos * * @return RTPSReliableWriterQos reference */ - RTPS_DllAPI RTPSReliableWriterQos& reliable_writer_qos() + FASTDDS_EXPORTED_API RTPSReliableWriterQos& reliable_writer_qos() { return reliable_writer_qos_; } @@ -695,7 +695,7 @@ class DataWriterQos * * @return RTPSReliableWriterQos reference */ - RTPS_DllAPI const RTPSReliableWriterQos& reliable_writer_qos() const + FASTDDS_EXPORTED_API const RTPSReliableWriterQos& reliable_writer_qos() const { return reliable_writer_qos_; } @@ -705,7 +705,7 @@ class DataWriterQos * * @param reliable_writer_qos new value for the RTPSReliableWriterQos */ - RTPS_DllAPI void reliable_writer_qos( + FASTDDS_EXPORTED_API void reliable_writer_qos( const RTPSReliableWriterQos& reliable_writer_qos) { reliable_writer_qos_ = reliable_writer_qos; @@ -716,7 +716,7 @@ class DataWriterQos * * @return RTPSEndpointQos reference */ - RTPS_DllAPI RTPSEndpointQos& endpoint() + FASTDDS_EXPORTED_API RTPSEndpointQos& endpoint() { return endpoint_; } @@ -725,7 +725,7 @@ class DataWriterQos * Getter for RTPSEndpointQos * @return RTPSEndpointQos reference */ - RTPS_DllAPI const RTPSEndpointQos& endpoint() const + FASTDDS_EXPORTED_API const RTPSEndpointQos& endpoint() const { return endpoint_; } @@ -735,7 +735,7 @@ class DataWriterQos * * @param endpoint new value for the RTPSEndpointQos */ - RTPS_DllAPI void endpoint( + FASTDDS_EXPORTED_API void endpoint( const RTPSEndpointQos& endpoint) { endpoint_ = endpoint; @@ -746,7 +746,7 @@ class DataWriterQos * * @return WriterResourceLimitsQos reference */ - RTPS_DllAPI WriterResourceLimitsQos& writer_resource_limits() + FASTDDS_EXPORTED_API WriterResourceLimitsQos& writer_resource_limits() { return writer_resource_limits_; } @@ -756,7 +756,7 @@ class DataWriterQos * * @return WriterResourceLimitsQos reference */ - RTPS_DllAPI const WriterResourceLimitsQos& writer_resource_limits() const + FASTDDS_EXPORTED_API const WriterResourceLimitsQos& writer_resource_limits() const { return writer_resource_limits_; } @@ -766,7 +766,7 @@ class DataWriterQos * * @param writer_resource_limits new value for the WriterResourceLimitsQos */ - RTPS_DllAPI void writer_resource_limits( + FASTDDS_EXPORTED_API void writer_resource_limits( const WriterResourceLimitsQos& writer_resource_limits) { writer_resource_limits_ = writer_resource_limits; @@ -778,7 +778,7 @@ class DataWriterQos * @return ThroughputControllerDescriptor reference * @deprecated Use flow_controllers() on DomainParticipantQoS */ - RTPS_DllAPI fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller() + FASTDDS_EXPORTED_API fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller() { return throughput_controller_; } @@ -789,7 +789,7 @@ class DataWriterQos * @return ThroughputControllerDescriptor reference * @deprecated Use flow_controllers() on DomainParticipantQoS */ - RTPS_DllAPI const fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller() const + FASTDDS_EXPORTED_API const fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller() const { return throughput_controller_; } @@ -800,7 +800,7 @@ class DataWriterQos * @param throughput_controller new value for the ThroughputControllerDescriptor * @deprecated Use flow_controllers() on DomainParticipantQoS */ - RTPS_DllAPI void throughput_controller( + FASTDDS_EXPORTED_API void throughput_controller( const fastrtps::rtps::ThroughputControllerDescriptor& throughput_controller) { throughput_controller_ = throughput_controller; @@ -811,7 +811,7 @@ class DataWriterQos * * @return DataSharingQosPolicy reference */ - RTPS_DllAPI DataSharingQosPolicy& data_sharing() + FASTDDS_EXPORTED_API DataSharingQosPolicy& data_sharing() { return data_sharing_; } @@ -821,7 +821,7 @@ class DataWriterQos * * @return DataSharingQosPolicy reference */ - RTPS_DllAPI const DataSharingQosPolicy& data_sharing() const + FASTDDS_EXPORTED_API const DataSharingQosPolicy& data_sharing() const { return data_sharing_; } @@ -831,7 +831,7 @@ class DataWriterQos * * @param data_sharing new value for the DataSharingQosPolicy */ - RTPS_DllAPI void data_sharing( + FASTDDS_EXPORTED_API void data_sharing( const DataSharingQosPolicy& data_sharing) { data_sharing_ = data_sharing; @@ -909,8 +909,8 @@ class DataWriterQos DataSharingQosPolicy data_sharing_; }; -RTPS_DllAPI extern const DataWriterQos DATAWRITER_QOS_DEFAULT; -RTPS_DllAPI extern const DataWriterQos DATAWRITER_QOS_USE_TOPIC_QOS; +FASTDDS_EXPORTED_API extern const DataWriterQos DATAWRITER_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const DataWriterQos DATAWRITER_QOS_USE_TOPIC_QOS; } // namespace dds } // namespace fastdds diff --git a/include/fastdds/dds/publisher/qos/PublisherQos.hpp b/include/fastdds/dds/publisher/qos/PublisherQos.hpp index 52151c4cbdc..42e12a8e0ad 100644 --- a/include/fastdds/dds/publisher/qos/PublisherQos.hpp +++ b/include/fastdds/dds/publisher/qos/PublisherQos.hpp @@ -21,7 +21,6 @@ #define _FASTDDS_PUBLISHERQOS_HPP_ #include -#include namespace eprosima { namespace fastdds { @@ -43,14 +42,14 @@ class PublisherQos /** * @brief Constructor */ - RTPS_DllAPI PublisherQos() + FASTDDS_EXPORTED_API PublisherQos() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~PublisherQos() = default; + FASTDDS_EXPORTED_API virtual ~PublisherQos() = default; bool operator ==( const PublisherQos& b) const @@ -201,7 +200,7 @@ class PublisherQos }; -RTPS_DllAPI extern const PublisherQos PUBLISHER_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const PublisherQos PUBLISHER_QOS_DEFAULT; } // namespace dds } // namespace fastdds diff --git a/include/fastdds/dds/publisher/qos/WriterQos.hpp b/include/fastdds/dds/publisher/qos/WriterQos.hpp index 9178fda89b0..337f44769ea 100644 --- a/include/fastdds/dds/publisher/qos/WriterQos.hpp +++ b/include/fastdds/dds/publisher/qos/WriterQos.hpp @@ -31,14 +31,14 @@ namespace dds { * Although these values can be set and are transmitted * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library. * Please consult each of them to check for implementation details and default values. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE + * @ingroup FASTDDS_QOS_MODULE */ class WriterQos { public: - RTPS_DllAPI WriterQos(); - RTPS_DllAPI virtual ~WriterQos(); + FASTDDS_EXPORTED_API WriterQos(); + FASTDDS_EXPORTED_API virtual ~WriterQos(); bool operator ==( const WriterQos& b) const @@ -133,7 +133,7 @@ class WriterQos * @param qos Reference from a WriterQos object. * @param first_time Boolean indicating whether is the first time (If not some parameters cannot be set). */ - RTPS_DllAPI void setQos( + FASTDDS_EXPORTED_API void setQos( const WriterQos& qos, bool first_time); @@ -141,15 +141,15 @@ class WriterQos * Check if the Qos values are compatible between each other. * @return True if correct. */ - RTPS_DllAPI bool checkQos() const; + FASTDDS_EXPORTED_API bool checkQos() const; - RTPS_DllAPI bool canQosBeUpdated( + FASTDDS_EXPORTED_API bool canQosBeUpdated( const WriterQos& qos) const; void clear(); }; -//RTPS_DllAPI extern const WriterQos DATAWRITER_QOS_DEFAULT; +//FASTDDS_EXPORTED_API extern const WriterQos DATAWRITER_QOS_DEFAULT; } //namespace dds } //namespace fastdds diff --git a/include/fastdds/dds/subscriber/DataReader.hpp b/include/fastdds/dds/subscriber/DataReader.hpp index 61846b6a91b..107800c1e5f 100644 --- a/include/fastdds/dds/subscriber/DataReader.hpp +++ b/include/fastdds/dds/subscriber/DataReader.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -37,15 +38,11 @@ #include #include -#include +#include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; - namespace dds { namespace sub { @@ -117,7 +114,7 @@ class DataReader : public DomainEntity * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the Subscriber creating this * DataReader is not enabled. */ - RTPS_DllAPI ReturnCode_t enable() override; + FASTDDS_EXPORTED_API ReturnCode_t enable() override; /** * Method to block the current thread until an unread message is available. @@ -126,7 +123,7 @@ class DataReader : public DomainEntity * * @return true if there is new unread message, false if timeout */ - RTPS_DllAPI bool wait_for_unread_message( + FASTDDS_EXPORTED_API bool wait_for_unread_message( const fastrtps::Duration_t& timeout); /** @@ -135,10 +132,11 @@ class DataReader : public DomainEntity * @brief Method to block the current thread until an unread message is available. * * @param[in] max_wait Max blocking time for this operation. - * @return RETCODE_OK if there is new unread message, ReturnCode_t::RETCODE_TIMEOUT if timeout + * @return RETCODE_OK if there is new unread message, RETCODE_TIMEOUT if timeout + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t wait_for_historical_data( + FASTDDS_EXPORTED_API ReturnCode_t wait_for_historical_data( const fastrtps::Duration_t& max_wait) const; @@ -305,7 +303,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read( + FASTDDS_EXPORTED_API ReturnCode_t read( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -336,7 +334,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read_w_condition( + FASTDDS_EXPORTED_API ReturnCode_t read_w_condition( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples, @@ -376,7 +374,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read_instance( + FASTDDS_EXPORTED_API ReturnCode_t read_instance( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -441,7 +439,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read_next_instance( + FASTDDS_EXPORTED_API ReturnCode_t read_next_instance( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -479,7 +477,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read_next_instance_w_condition( + FASTDDS_EXPORTED_API ReturnCode_t read_next_instance_w_condition( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples, @@ -505,7 +503,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t read_next_sample( + FASTDDS_EXPORTED_API ReturnCode_t read_next_sample( void* data, SampleInfo* info); @@ -540,7 +538,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take( + FASTDDS_EXPORTED_API ReturnCode_t take( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -569,7 +567,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take_w_condition( + FASTDDS_EXPORTED_API ReturnCode_t take_w_condition( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples, @@ -603,7 +601,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take_instance( + FASTDDS_EXPORTED_API ReturnCode_t take_instance( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -642,7 +640,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take_next_instance( + FASTDDS_EXPORTED_API ReturnCode_t take_next_instance( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples = LENGTH_UNLIMITED, @@ -679,7 +677,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take_next_instance_w_condition( + FASTDDS_EXPORTED_API ReturnCode_t take_next_instance_w_condition( LoanableCollection& data_values, SampleInfoSeq& sample_infos, int32_t max_samples, @@ -707,7 +705,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t take_next_sample( + FASTDDS_EXPORTED_API ReturnCode_t take_next_sample( void* data, SampleInfo* info); @@ -733,9 +731,9 @@ class DataReader : public DomainEntity * * The use of the @ref return_loan operation is only necessary if the read or take calls "loaned" buffers to the * application. This only occurs if the @c data_values and @c sample_infos collections had max_len == 0 - * at the time read or take was called. The application may also examine the @c owns property of the collection to - * determine if there is an outstanding loan. However, calling @ref return_loan on a collection that does not have - * a loan is safe and has no side effects. + * at the time read or take was called. The application may also examine the @c has_ownership property of the + * collection to determine if there is an outstanding loan. However, calling @ref return_loan on a collection that + * does not have a loan is safe, has no side effects, and returns RETCODE_OK. * * If the collections had a loan, upon return from return_loan the collections will have max_len == 0 . * @@ -746,7 +744,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t return_loan( + FASTDDS_EXPORTED_API ReturnCode_t return_loan( LoanableCollection& data_values, SampleInfoSeq& sample_infos); @@ -764,9 +762,10 @@ class DataReader : public DomainEntity * @param[in] handle * * @return Any of the standard return codes. + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_key_value( + FASTDDS_EXPORTED_API ReturnCode_t get_key_value( void* key_holder, const InstanceHandle_t& handle); @@ -781,7 +780,7 @@ class DataReader : public DomainEntity * @return HANDLE_NIL if @c instance is nullptr. * @return HANDLE_NIL if there is no instance on the DataReader's history with the same key as @c instance. */ - RTPS_DllAPI InstanceHandle_t lookup_instance( + FASTDDS_EXPORTED_API InstanceHandle_t lookup_instance( const void* instance) const; /** @@ -793,7 +792,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK if sample info was returned. RETCODE_NO_DATA if there is no sample to take. */ - RTPS_DllAPI ReturnCode_t get_first_untaken_info( + FASTDDS_EXPORTED_API ReturnCode_t get_first_untaken_info( SampleInfo* info); /** @@ -803,7 +802,7 @@ class DataReader : public DomainEntity * * @return the number of samples on the reader history that have never been read. */ - RTPS_DllAPI uint64_t get_unread_count() const; + FASTDDS_EXPORTED_API uint64_t get_unread_count() const; /** * Get the number of samples pending to be read. @@ -812,7 +811,7 @@ class DataReader : public DomainEntity * * @return the number of samples on the reader history that have never been read. */ - RTPS_DllAPI uint64_t get_unread_count( + FASTDDS_EXPORTED_API uint64_t get_unread_count( bool mark_as_read) const; /** @@ -820,42 +819,42 @@ class DataReader : public DomainEntity * * @return Associated GUID */ - RTPS_DllAPI const fastrtps::rtps::GUID_t& guid(); + FASTDDS_EXPORTED_API const fastrtps::rtps::GUID_t& guid(); /** * Get associated GUID. * * @return Associated GUID */ - RTPS_DllAPI const fastrtps::rtps::GUID_t& guid() const; + FASTDDS_EXPORTED_API const fastrtps::rtps::GUID_t& guid() const; /** * @brief Getter for the associated InstanceHandle. * * @return Copy of the InstanceHandle */ - RTPS_DllAPI InstanceHandle_t get_instance_handle() const; + FASTDDS_EXPORTED_API InstanceHandle_t get_instance_handle() const; /** * Getter for the data type. * * @return TypeSupport associated to the DataReader. */ - RTPS_DllAPI TypeSupport type(); + FASTDDS_EXPORTED_API TypeSupport type(); /** * Get TopicDescription. * * @return TopicDescription pointer. */ - RTPS_DllAPI const TopicDescription* get_topicdescription() const; + FASTDDS_EXPORTED_API const TopicDescription* get_topicdescription() const; /** * @brief Get the requested deadline missed status. * * @return The deadline missed status. */ - RTPS_DllAPI ReturnCode_t get_requested_deadline_missed_status( + FASTDDS_EXPORTED_API ReturnCode_t get_requested_deadline_missed_status( RequestedDeadlineMissedStatus& status); /** @@ -865,7 +864,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_requested_incompatible_qos_status( + FASTDDS_EXPORTED_API ReturnCode_t get_requested_incompatible_qos_status( RequestedIncompatibleQosStatus& status); /** @@ -876,7 +875,7 @@ class DataReader : public DomainEntity * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is * not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const DataReaderQos& qos); /** @@ -884,7 +883,7 @@ class DataReader : public DomainEntity * * @return Pointer to the DataReaderQos. */ - RTPS_DllAPI const DataReaderQos& get_qos() const; + FASTDDS_EXPORTED_API const DataReaderQos& get_qos() const; /** * @brief Getter for the DataReaderQos. @@ -893,7 +892,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( DataReaderQos& qos) const; /** @@ -903,7 +902,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DataReaderListener* listener); /** @@ -914,7 +913,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( DataReaderListener* listener, const StatusMask& mask); /** @@ -922,10 +921,10 @@ class DataReader : public DomainEntity * * @return Pointer to the DataReaderListener */ - RTPS_DllAPI const DataReaderListener* get_listener() const; + FASTDDS_EXPORTED_API const DataReaderListener* get_listener() const; /* TODO - RTPS_DllAPI bool get_key_value( + FASTDDS_EXPORTED_API bool get_key_value( void* data, const InstanceHandle_t& handle); */ @@ -937,7 +936,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_liveliness_changed_status( + FASTDDS_EXPORTED_API ReturnCode_t get_liveliness_changed_status( LivelinessChangedStatus& status) const; @@ -948,7 +947,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_sample_lost_status( + FASTDDS_EXPORTED_API ReturnCode_t get_sample_lost_status( SampleLostStatus& status) const; /** @@ -958,7 +957,7 @@ class DataReader : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_sample_rejected_status( + FASTDDS_EXPORTED_API ReturnCode_t get_sample_rejected_status( SampleRejectedStatus& status) const; /** @@ -967,7 +966,7 @@ class DataReader : public DomainEntity * @param[out] status subscription matched status struct * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_subscription_matched_status( + FASTDDS_EXPORTED_API ReturnCode_t get_subscription_matched_status( SubscriptionMatchedStatus& status) const; /** @@ -976,9 +975,10 @@ class DataReader : public DomainEntity * @param[out] publication_data publication data struct * @param publication_handle InstanceHandle_t of the publication * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_matched_publication_data( + FASTDDS_EXPORTED_API ReturnCode_t get_matched_publication_data( builtin::PublicationBuiltinTopicData& publication_data, const fastrtps::rtps::InstanceHandle_t& publication_handle) const; @@ -987,9 +987,10 @@ class DataReader : public DomainEntity * * @param[out] publication_handles Vector where the InstanceHandle_t are returned * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_matched_publications( + FASTDDS_EXPORTED_API ReturnCode_t get_matched_publications( std::vector& publication_handles) const; /** @@ -1002,7 +1003,7 @@ class DataReader : public DomainEntity * * @return pointer to the created ReadCondition, nullptr in case of error. */ - RTPS_DllAPI ReadCondition* create_readcondition( + FASTDDS_EXPORTED_API ReadCondition* create_readcondition( SampleStateMask sample_states, ViewStateMask view_states, InstanceStateMask instance_states); @@ -1019,7 +1020,7 @@ class DataReader : public DomainEntity * * @return pointer to the created QueryCondition, nullptr in case of error. */ - RTPS_DllAPI QueryCondition* create_querycondition( + FASTDDS_EXPORTED_API QueryCondition* create_querycondition( SampleStateMask sample_states, ViewStateMask view_states, InstanceStateMask instance_states, @@ -1032,14 +1033,14 @@ class DataReader : public DomainEntity * @param a_condition pointer to a ReadCondition belonging to the DataReader * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t delete_readcondition( + FASTDDS_EXPORTED_API ReturnCode_t delete_readcondition( ReadCondition* a_condition); /** * @brief Getter for the Subscriber * @return Subscriber pointer */ - RTPS_DllAPI const Subscriber* get_subscriber() const; + FASTDDS_EXPORTED_API const Subscriber* get_subscriber() const; /** * This operation deletes all the entities that were created by means of the β€œcreate” operations on the DataReader. @@ -1050,7 +1051,7 @@ class DataReader : public DomainEntity * * @return Any of the standard return codes. */ - RTPS_DllAPI ReturnCode_t delete_contained_entities(); + FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities(); /** * Checks whether a loaned sample is still valid or is corrupted. @@ -1062,7 +1063,7 @@ class DataReader : public DomainEntity * * @return true if the sample is valid */ - RTPS_DllAPI bool is_sample_valid( + FASTDDS_EXPORTED_API bool is_sample_valid( const void* data, const SampleInfo* info) const; @@ -1074,7 +1075,7 @@ class DataReader : public DomainEntity * @return NOT_ENABLED if the reader has not been enabled. * @return OK if a list of locators is returned. */ - RTPS_DllAPI ReturnCode_t get_listening_locators( + FASTDDS_EXPORTED_API ReturnCode_t get_listening_locators( rtps::LocatorList& locators) const; protected: diff --git a/include/fastdds/dds/subscriber/DataReaderListener.hpp b/include/fastdds/dds/subscriber/DataReaderListener.hpp index 0c6dbcbe903..aad9d3c3574 100644 --- a/include/fastdds/dds/subscriber/DataReaderListener.hpp +++ b/include/fastdds/dds/subscriber/DataReaderListener.hpp @@ -16,16 +16,16 @@ * @file DataReaderListener.hpp */ -#ifndef _FASTRTPS_DATAREADERLISTENER_HPP_ -#define _FASTRTPS_DATAREADERLISTENER_HPP_ +#ifndef _FASTDDS_DATAREADERLISTENER_HPP_ +#define _FASTDDS_DATAREADERLISTENER_HPP_ -#include -#include -#include -#include -#include #include +#include +#include +#include +#include #include +#include namespace eprosima { namespace fastdds { @@ -44,14 +44,14 @@ class DataReaderListener /** * @brief Constructor */ - RTPS_DllAPI DataReaderListener() + FASTDDS_EXPORTED_API DataReaderListener() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~DataReaderListener() + FASTDDS_EXPORTED_API virtual ~DataReaderListener() { } @@ -60,7 +60,7 @@ class DataReaderListener * * @param reader DataReader */ - RTPS_DllAPI virtual void on_data_available( + FASTDDS_EXPORTED_API virtual void on_data_available( DataReader* reader) { (void)reader; @@ -72,7 +72,7 @@ class DataReaderListener * @param reader DataReader * @param info The subscription matched status */ - RTPS_DllAPI virtual void on_subscription_matched( + FASTDDS_EXPORTED_API virtual void on_subscription_matched( DataReader* reader, const fastdds::dds::SubscriptionMatchedStatus& info) { @@ -86,9 +86,9 @@ class DataReaderListener * @param reader DataReader * @param status The requested deadline missed status */ - RTPS_DllAPI virtual void on_requested_deadline_missed( + FASTDDS_EXPORTED_API virtual void on_requested_deadline_missed( DataReader* reader, - const fastrtps::RequestedDeadlineMissedStatus& status) + const RequestedDeadlineMissedStatus& status) { (void)reader; (void)status; @@ -100,9 +100,9 @@ class DataReaderListener * @param reader The DataReader * @param status The liveliness changed status */ - RTPS_DllAPI virtual void on_liveliness_changed( + FASTDDS_EXPORTED_API virtual void on_liveliness_changed( DataReader* reader, - const fastrtps::LivelinessChangedStatus& status) + const LivelinessChangedStatus& status) { (void)reader; (void)status; @@ -114,9 +114,9 @@ class DataReaderListener * @param reader The DataReader * @param status The rejected status */ - RTPS_DllAPI virtual void on_sample_rejected( + FASTDDS_EXPORTED_API virtual void on_sample_rejected( DataReader* reader, - const fastrtps::SampleRejectedStatus& status) + const SampleRejectedStatus& status) { (void)reader; (void)status; @@ -128,7 +128,7 @@ class DataReaderListener * @param reader The DataReader * @param status The requested incompatible QoS status */ - RTPS_DllAPI virtual void on_requested_incompatible_qos( + FASTDDS_EXPORTED_API virtual void on_requested_incompatible_qos( DataReader* reader, const RequestedIncompatibleQosStatus& status) { @@ -142,7 +142,7 @@ class DataReaderListener * @param reader The DataReader * @param status The sample lost status */ - RTPS_DllAPI virtual void on_sample_lost( + FASTDDS_EXPORTED_API virtual void on_sample_lost( DataReader* reader, const SampleLostStatus& status) { @@ -156,4 +156,4 @@ class DataReaderListener } /* namespace fastdds */ } /* namespace eprosima */ -#endif /* _FASTRTPS_DATAREADERLISTENER_HPP_ */ +#endif /* _FASTDDS_DATAREADERLISTENER_HPP_ */ diff --git a/include/fastdds/dds/subscriber/ReadCondition.hpp b/include/fastdds/dds/subscriber/ReadCondition.hpp index b4d530efdc9..7e79732b308 100644 --- a/include/fastdds/dds/subscriber/ReadCondition.hpp +++ b/include/fastdds/dds/subscriber/ReadCondition.hpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -74,7 +74,7 @@ class ReadCondition : public Condition * @brief Retrieves the trigger_value of the Condition * @return true if trigger_value is set to 'true', 'false' otherwise */ - RTPS_DllAPI bool get_trigger_value() const noexcept override; + FASTDDS_EXPORTED_API bool get_trigger_value() const noexcept override; /** * @brief Retrieves the DataReader associated with the ReadCondition. @@ -83,28 +83,28 @@ class ReadCondition : public Condition * * @return pointer to the DataReader associated with this ReadCondition. */ - RTPS_DllAPI DataReader* get_datareader() const noexcept; + FASTDDS_EXPORTED_API DataReader* get_datareader() const noexcept; /** * @brief Retrieves the set of sample_states taken into account to determine the trigger_value of this condition. * * @return the sample_states specified when the ReadCondition was created. */ - RTPS_DllAPI SampleStateMask get_sample_state_mask() const noexcept; + FASTDDS_EXPORTED_API SampleStateMask get_sample_state_mask() const noexcept; /** * @brief Retrieves the set of view_states taken into account to determine the trigger_value of this condition. * * @return the view_states specified when the ReadCondition was created. */ - RTPS_DllAPI ViewStateMask get_view_state_mask() const noexcept; + FASTDDS_EXPORTED_API ViewStateMask get_view_state_mask() const noexcept; /** * @brief Retrieves the set of instance_states taken into account to determine the trigger_value of this condition. * * @return the instance_states specified when the ReadCondition was created. */ - RTPS_DllAPI InstanceStateMask get_instance_state_mask() const noexcept; + FASTDDS_EXPORTED_API InstanceStateMask get_instance_state_mask() const noexcept; detail::ReadConditionImpl* get_impl() const noexcept { diff --git a/include/fastdds/dds/subscriber/SampleInfo.hpp b/include/fastdds/dds/subscriber/SampleInfo.hpp index 4c1f2354495..ccc173fc78c 100644 --- a/include/fastdds/dds/subscriber/SampleInfo.hpp +++ b/include/fastdds/dds/subscriber/SampleInfo.hpp @@ -34,34 +34,6 @@ namespace eprosima { namespace fastdds { namespace dds { -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::READ", - "Use eprosima::fastdds::dds::READ_SAMPLE_STATE instead.") -constexpr SampleStateKind READ = READ_SAMPLE_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_READ", - "Use eprosima::fastdds::dds::NOT_READ_SAMPLE_STATE instead.") -constexpr SampleStateKind NOT_READ = NOT_READ_SAMPLE_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NEW", - "Use eprosima::fastdds::dds::NEW_VIEW_STATE instead.") -constexpr ViewStateKind NEW = NEW_VIEW_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_NEW", - "Use eprosima::fastdds::dds::NOT_NEW_VIEW_STATE instead.") -constexpr ViewStateKind NOT_NEW = NOT_NEW_VIEW_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::ALIVE", - "Use eprosima::fastdds::dds::ALIVE_INSTANCE_STATE instead.") -constexpr InstanceStateKind ALIVE = ALIVE_INSTANCE_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_ALIVE_DISPOSED", - "Use eprosima::fastdds::dds::NOT_ALIVE_DISPOSED_INSTANCE_STATE instead.") -constexpr InstanceStateKind NOT_ALIVE_DISPOSED = NOT_ALIVE_DISPOSED_INSTANCE_STATE; - -FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::NOT_ALIVE_NO_WRITERS", - "Use eprosima::fastdds::dds::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE instead.") -constexpr InstanceStateKind NOT_ALIVE_NO_WRITERS = NOT_ALIVE_NO_WRITERS_INSTANCE_STATE; - /*! * @brief SampleInfo is the information that accompanies each sample that is β€˜read’ or β€˜taken.’ */ diff --git a/include/fastdds/dds/subscriber/Subscriber.hpp b/include/fastdds/dds/subscriber/Subscriber.hpp index 265a7bb16d1..15d900c8d95 100644 --- a/include/fastdds/dds/subscriber/Subscriber.hpp +++ b/include/fastdds/dds/subscriber/Subscriber.hpp @@ -20,6 +20,7 @@ #define _FASTDDS_SUBSCRIBER_HPP_ #include +#include #include #include #include @@ -28,9 +29,6 @@ #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace dds { namespace sub { @@ -100,14 +98,14 @@ class Subscriber : public DomainEntity * @return RETCODE_OK is successfully enabled. RETCODE_PRECONDITION_NOT_MET if the participant creating this * Subscriber is not enabled. */ - RTPS_DllAPI ReturnCode_t enable() override; + FASTDDS_EXPORTED_API ReturnCode_t enable() override; /** * Allows accessing the Subscriber Qos. * * @return SubscriberQos reference */ - RTPS_DllAPI const SubscriberQos& get_qos() const; + FASTDDS_EXPORTED_API const SubscriberQos& get_qos() const; /** * Retrieves the Subscriber Qos. @@ -115,7 +113,7 @@ class Subscriber : public DomainEntity * @param qos SubscriberQos where the qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( SubscriberQos& qos) const; /** @@ -126,7 +124,7 @@ class Subscriber : public DomainEntity * @return RETCODE_IMMUTABLE_POLICY if any of the Qos cannot be changed, RETCODE_INCONSISTENT_POLICY if the Qos is not * self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const SubscriberQos& qos); /** @@ -134,7 +132,7 @@ class Subscriber : public DomainEntity * * @return Pointer to the SubscriberListener */ - RTPS_DllAPI const SubscriberListener* get_listener() const; + FASTDDS_EXPORTED_API const SubscriberListener* get_listener() const; /** * Modifies the SubscriberListener, sets the mask to StatusMask::all() @@ -142,7 +140,7 @@ class Subscriber : public DomainEntity * @param listener new value for SubscriberListener * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( SubscriberListener* listener); /** @@ -152,7 +150,7 @@ class Subscriber : public DomainEntity * @param mask StatusMask that holds statuses the listener responds to. * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( SubscriberListener* listener, const StatusMask& mask); /** @@ -165,7 +163,7 @@ class Subscriber : public DomainEntity * @param payload_pool IPayloadPool shared pointer that defines reader payload (default: nullptr). * @return Pointer to the created DataReader. nullptr if failed. */ - RTPS_DllAPI DataReader* create_datareader( + FASTDDS_EXPORTED_API DataReader* create_datareader( TopicDescription* topic, const DataReaderQos& reader_qos, DataReaderListener* listener = nullptr, @@ -182,7 +180,7 @@ class Subscriber : public DomainEntity * @param payload_pool IPayloadPool shared pointer that defines reader payload (default: nullptr). * @return Pointer to the created DataReader. nullptr if failed. */ - RTPS_DllAPI DataReader* create_datareader_with_profile( + FASTDDS_EXPORTED_API DataReader* create_datareader_with_profile( TopicDescription* topic, const std::string& profile_name, DataReaderListener* listener = nullptr, @@ -200,7 +198,7 @@ class Subscriber : public DomainEntity * @return RETCODE_PRECONDITION_NOT_MET if the datareader does not belong to this subscriber, RETCODE_OK if it is correctly * deleted and RETCODE_ERROR otherwise. */ - RTPS_DllAPI ReturnCode_t delete_datareader( + FASTDDS_EXPORTED_API ReturnCode_t delete_datareader( const DataReader* reader); /** @@ -213,7 +211,7 @@ class Subscriber : public DomainEntity * @param topic_name Name of the topic associated to the DataReader * @return Pointer to a previously created DataReader created on a Topic with that topic_name */ - RTPS_DllAPI DataReader* lookup_datareader( + FASTDDS_EXPORTED_API DataReader* lookup_datareader( const std::string& topic_name) const; /** @@ -222,7 +220,7 @@ class Subscriber : public DomainEntity * @param readers Vector of DataReader where the list of existing readers is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_datareaders( + FASTDDS_EXPORTED_API ReturnCode_t get_datareaders( std::vector& readers) const; /** @@ -234,9 +232,10 @@ class Subscriber : public DomainEntity * @param view_states Vector of ViewStateKind * @param instance_states Vector of InstanceStateKind * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_datareaders( + FASTDDS_EXPORTED_API ReturnCode_t get_datareaders( std::vector& readers, const std::vector& sample_states, const std::vector& view_states, @@ -247,25 +246,27 @@ class Subscriber : public DomainEntity * * @return true if the subscriber has one or several DataReaders, false in other case */ - RTPS_DllAPI bool has_datareaders() const; + FASTDDS_EXPORTED_API bool has_datareaders() const; /** * @brief Indicates that the application is about to access the data samples in any of the DataReader objects * attached to the Subscriber. * * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t begin_access(); + FASTDDS_EXPORTED_API ReturnCode_t begin_access(); /** * @brief Indicates that the application has finished accessing the data samples in DataReader objects managed by * the Subscriber. * * @return RETCODE_OK + * * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t end_access(); + FASTDDS_EXPORTED_API ReturnCode_t end_access(); /** @@ -277,7 +278,7 @@ class Subscriber : public DomainEntity * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t notify_datareaders() const; + FASTDDS_EXPORTED_API ReturnCode_t notify_datareaders() const; /** * @brief Deletes all contained DataReaders. If the DataReaders have any QueryCondition or ReadCondition, they are @@ -285,7 +286,7 @@ class Subscriber : public DomainEntity * * @return RETCODE_OK if successful, an error code otherwise */ - RTPS_DllAPI ReturnCode_t delete_contained_entities(); + FASTDDS_EXPORTED_API ReturnCode_t delete_contained_entities(); /** * This operation sets a default value of the DataReader QoS policies which will be used for newly created @@ -301,7 +302,7 @@ class Subscriber : public DomainEntity * @param qos new value for DataReaderQos to set as default * @return RETCODE_INCONSISTENT_POLICY if the Qos is not self consistent and RETCODE_OK if the qos is changed correctly. */ - RTPS_DllAPI ReturnCode_t set_default_datareader_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_default_datareader_qos( const DataReaderQos& qos); /** @@ -314,7 +315,7 @@ class Subscriber : public DomainEntity * * @return Current default DataReaderQos. */ - RTPS_DllAPI const DataReaderQos& get_default_datareader_qos() const; + FASTDDS_EXPORTED_API const DataReaderQos& get_default_datareader_qos() const; /** @@ -327,7 +328,7 @@ class Subscriber : public DomainEntity * * @return Current default DataReaderQos. */ - RTPS_DllAPI DataReaderQos& get_default_datareader_qos(); + FASTDDS_EXPORTED_API DataReaderQos& get_default_datareader_qos(); /** * This operation retrieves the default value of the DataReader QoS, that is, the QoS policies which will be @@ -340,7 +341,7 @@ class Subscriber : public DomainEntity * @param qos DataReaderQos where the default_qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_default_datareader_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_default_datareader_qos( DataReaderQos& qos) const; /** @@ -350,7 +351,7 @@ class Subscriber : public DomainEntity * @param qos DataReaderQos object where the qos is returned. * @return RETCODE_OK if the profile exists. RETCODE_BAD_PARAMETER otherwise. */ - RTPS_DllAPI ReturnCode_t get_datareader_qos_from_profile( + FASTDDS_EXPORTED_API ReturnCode_t get_datareader_qos_from_profile( const std::string& profile_name, DataReaderQos& qos) const; @@ -360,8 +361,10 @@ class Subscriber : public DomainEntity * @param[in, out] reader_qos * @param[in] topic_qos * @return RETCODE_OK if successful, an error code otherwise + * + * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI static ReturnCode_t copy_from_topic_qos( + FASTDDS_EXPORTED_API static ReturnCode_t copy_from_topic_qos( DataReaderQos& reader_qos, const TopicQos& topic_qos); @@ -370,14 +373,14 @@ class Subscriber : public DomainEntity * * @return DomainParticipant Pointer */ - RTPS_DllAPI const DomainParticipant* get_participant() const; + FASTDDS_EXPORTED_API const DomainParticipant* get_participant() const; /** * Returns the Subscriber's handle. * * @return InstanceHandle of this Subscriber. */ - RTPS_DllAPI const InstanceHandle_t& get_instance_handle() const; + FASTDDS_EXPORTED_API const InstanceHandle_t& get_instance_handle() const; protected: diff --git a/include/fastdds/dds/subscriber/SubscriberListener.hpp b/include/fastdds/dds/subscriber/SubscriberListener.hpp index 080921f06a5..c70af5f5f8e 100644 --- a/include/fastdds/dds/subscriber/SubscriberListener.hpp +++ b/include/fastdds/dds/subscriber/SubscriberListener.hpp @@ -19,11 +19,11 @@ #ifndef _FASTDDS_SUBLISTENER_HPP_ #define _FASTDDS_SUBLISTENER_HPP_ -#include -#include -#include +#include +#include #include #include +#include namespace eprosima { namespace fastdds { @@ -44,14 +44,14 @@ class SubscriberListener : public DataReaderListener /** * @brief Constructor */ - RTPS_DllAPI SubscriberListener() + FASTDDS_EXPORTED_API SubscriberListener() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~SubscriberListener() + FASTDDS_EXPORTED_API virtual ~SubscriberListener() { } @@ -61,7 +61,7 @@ class SubscriberListener : public DataReaderListener * * @param sub Subscriber */ - RTPS_DllAPI virtual void on_data_on_readers( + FASTDDS_EXPORTED_API virtual void on_data_on_readers( Subscriber* sub) { (void)sub; diff --git a/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp b/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp index b5a8e005ae9..44cee767427 100644 --- a/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp +++ b/include/fastdds/dds/subscriber/qos/DataReaderQos.hpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include namespace eprosima { namespace fastdds { @@ -42,14 +42,14 @@ class RTPSReliableReaderQos /** * @brief Constructor */ - RTPS_DllAPI RTPSReliableReaderQos() + FASTDDS_EXPORTED_API RTPSReliableReaderQos() { } /** * @brief Destructor */ - virtual RTPS_DllAPI ~RTPSReliableReaderQos() = default; + virtual FASTDDS_EXPORTED_API ~RTPSReliableReaderQos() = default; bool operator ==( const RTPSReliableReaderQos& b) const @@ -83,12 +83,12 @@ class ReaderResourceLimitsQos /** * @brief Constructor */ - RTPS_DllAPI ReaderResourceLimitsQos() = default; + FASTDDS_EXPORTED_API ReaderResourceLimitsQos() = default; /** * @brief Destructor */ - virtual RTPS_DllAPI ~ReaderResourceLimitsQos() = default; + virtual FASTDDS_EXPORTED_API ~ReaderResourceLimitsQos() = default; bool operator ==( const ReaderResourceLimitsQos& b) const @@ -134,7 +134,7 @@ class TypeConsistencyQos : public QosPolicy /** * @brief Constructor */ - RTPS_DllAPI TypeConsistencyQos() + FASTDDS_EXPORTED_API TypeConsistencyQos() : QosPolicy(false) { } @@ -142,7 +142,7 @@ class TypeConsistencyQos : public QosPolicy /** * @brief Destructor */ - virtual RTPS_DllAPI ~TypeConsistencyQos() = default; + virtual FASTDDS_EXPORTED_API ~TypeConsistencyQos() = default; bool operator ==( const TypeConsistencyQos& b) const @@ -179,12 +179,12 @@ class DataReaderQos /** * @brief Constructor */ - RTPS_DllAPI DataReaderQos() + FASTDDS_EXPORTED_API DataReaderQos() : expects_inline_qos_(false) { } - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const DataReaderQos& b) const { return (durability_ == b.durability()) && @@ -210,7 +210,7 @@ class DataReaderQos (data_sharing_ == b.data_sharing()); } - RTPS_DllAPI ReaderQos get_readerqos( + FASTDDS_EXPORTED_API ReaderQos get_readerqos( const SubscriberQos& sqos) const; /** @@ -218,7 +218,7 @@ class DataReaderQos * * @return DurabilityQosPolicy reference */ - RTPS_DllAPI DurabilityQosPolicy& durability() + FASTDDS_EXPORTED_API DurabilityQosPolicy& durability() { return durability_; } @@ -228,7 +228,7 @@ class DataReaderQos * * @return DurabilityQosPolicy const reference */ - RTPS_DllAPI const DurabilityQosPolicy& durability() const + FASTDDS_EXPORTED_API const DurabilityQosPolicy& durability() const { return durability_; } @@ -238,7 +238,7 @@ class DataReaderQos * * @param new_value new value for the DurabilityQosPolicy */ - RTPS_DllAPI void durability( + FASTDDS_EXPORTED_API void durability( const DurabilityQosPolicy& new_value) { durability_ = new_value; @@ -249,7 +249,7 @@ class DataReaderQos * * @return DeadlineQosPolicy reference */ - RTPS_DllAPI DeadlineQosPolicy& deadline() + FASTDDS_EXPORTED_API DeadlineQosPolicy& deadline() { return deadline_; } @@ -259,7 +259,7 @@ class DataReaderQos * * @return DeadlineQosPolicy const reference */ - RTPS_DllAPI const DeadlineQosPolicy& deadline() const + FASTDDS_EXPORTED_API const DeadlineQosPolicy& deadline() const { return deadline_; } @@ -269,7 +269,7 @@ class DataReaderQos * * @param new_value new value for the DeadlineQosPolicy */ - RTPS_DllAPI void deadline( + FASTDDS_EXPORTED_API void deadline( const DeadlineQosPolicy& new_value) { deadline_ = new_value; @@ -280,7 +280,7 @@ class DataReaderQos * * @return LatencyBudgetQosPolicy reference */ - RTPS_DllAPI LatencyBudgetQosPolicy& latency_budget() + FASTDDS_EXPORTED_API LatencyBudgetQosPolicy& latency_budget() { return latency_budget_; } @@ -290,7 +290,7 @@ class DataReaderQos * * @return LatencyBudgetQosPolicy const reference */ - RTPS_DllAPI const LatencyBudgetQosPolicy& latency_budget() const + FASTDDS_EXPORTED_API const LatencyBudgetQosPolicy& latency_budget() const { return latency_budget_; } @@ -300,7 +300,7 @@ class DataReaderQos * * @param new_value new value for the LatencyBudgetQosPolicy */ - RTPS_DllAPI void latency_budget( + FASTDDS_EXPORTED_API void latency_budget( const LatencyBudgetQosPolicy& new_value) { latency_budget_ = new_value; @@ -311,7 +311,7 @@ class DataReaderQos * * @return LivelinessQosPolicy reference */ - RTPS_DllAPI LivelinessQosPolicy& liveliness() + FASTDDS_EXPORTED_API LivelinessQosPolicy& liveliness() { return liveliness_; } @@ -321,7 +321,7 @@ class DataReaderQos * * @return LivelinessQosPolicy const reference */ - RTPS_DllAPI const LivelinessQosPolicy& liveliness() const + FASTDDS_EXPORTED_API const LivelinessQosPolicy& liveliness() const { return liveliness_; } @@ -331,7 +331,7 @@ class DataReaderQos * * @param new_value new value for the LivelinessQosPolicy */ - RTPS_DllAPI void liveliness( + FASTDDS_EXPORTED_API void liveliness( const LivelinessQosPolicy& new_value) { liveliness_ = new_value; @@ -342,7 +342,7 @@ class DataReaderQos * * @return ReliabilityQosPolicy reference */ - RTPS_DllAPI ReliabilityQosPolicy& reliability() + FASTDDS_EXPORTED_API ReliabilityQosPolicy& reliability() { return reliability_; } @@ -352,7 +352,7 @@ class DataReaderQos * * @return ReliabilityQosPolicy const reference */ - RTPS_DllAPI const ReliabilityQosPolicy& reliability() const + FASTDDS_EXPORTED_API const ReliabilityQosPolicy& reliability() const { return reliability_; } @@ -362,7 +362,7 @@ class DataReaderQos * * @param new_value new value for the ReliabilityQosPolicy */ - RTPS_DllAPI void reliability( + FASTDDS_EXPORTED_API void reliability( const ReliabilityQosPolicy& new_value) { reliability_ = new_value; @@ -373,7 +373,7 @@ class DataReaderQos * * @return DestinationOrderQosPolicy reference */ - RTPS_DllAPI DestinationOrderQosPolicy& destination_order() + FASTDDS_EXPORTED_API DestinationOrderQosPolicy& destination_order() { return destination_order_; } @@ -383,7 +383,7 @@ class DataReaderQos * * @return DestinationOrderQosPolicy const reference */ - RTPS_DllAPI const DestinationOrderQosPolicy& destination_order() const + FASTDDS_EXPORTED_API const DestinationOrderQosPolicy& destination_order() const { return destination_order_; } @@ -393,7 +393,7 @@ class DataReaderQos * * @param new_value new value for the DestinationOrderQosPolicy */ - RTPS_DllAPI void destination_order( + FASTDDS_EXPORTED_API void destination_order( const DestinationOrderQosPolicy& new_value) { destination_order_ = new_value; @@ -404,7 +404,7 @@ class DataReaderQos * * @return HistoryQosPolicy reference */ - RTPS_DllAPI HistoryQosPolicy& history() + FASTDDS_EXPORTED_API HistoryQosPolicy& history() { return history_; } @@ -414,7 +414,7 @@ class DataReaderQos * * @return HistoryQosPolicy const reference */ - RTPS_DllAPI const HistoryQosPolicy& history() const + FASTDDS_EXPORTED_API const HistoryQosPolicy& history() const { return history_; } @@ -424,7 +424,7 @@ class DataReaderQos * * @param new_value new value for the HistoryQosPolicy */ - RTPS_DllAPI void history( + FASTDDS_EXPORTED_API void history( const HistoryQosPolicy& new_value) { history_ = new_value; @@ -435,7 +435,7 @@ class DataReaderQos * * @return ResourceLimitsQosPolicy reference */ - RTPS_DllAPI ResourceLimitsQosPolicy& resource_limits() + FASTDDS_EXPORTED_API ResourceLimitsQosPolicy& resource_limits() { return resource_limits_; } @@ -445,7 +445,7 @@ class DataReaderQos * * @return ResourceLimitsQosPolicy const reference */ - RTPS_DllAPI const ResourceLimitsQosPolicy& resource_limits() const + FASTDDS_EXPORTED_API const ResourceLimitsQosPolicy& resource_limits() const { return resource_limits_; } @@ -455,7 +455,7 @@ class DataReaderQos * * @param new_value new value for the ResourceLimitsQosPolicy */ - RTPS_DllAPI void resource_limits( + FASTDDS_EXPORTED_API void resource_limits( const ResourceLimitsQosPolicy& new_value) { resource_limits_ = new_value; @@ -466,7 +466,7 @@ class DataReaderQos * * @return UserDataQosPolicy reference */ - RTPS_DllAPI UserDataQosPolicy& user_data() + FASTDDS_EXPORTED_API UserDataQosPolicy& user_data() { return user_data_; } @@ -476,7 +476,7 @@ class DataReaderQos * * @return UserDataQosPolicy const reference */ - RTPS_DllAPI const UserDataQosPolicy& user_data() const + FASTDDS_EXPORTED_API const UserDataQosPolicy& user_data() const { return user_data_; } @@ -486,7 +486,7 @@ class DataReaderQos * * @param new_value new value for the UserDataQosPolicy */ - RTPS_DllAPI void user_data( + FASTDDS_EXPORTED_API void user_data( const UserDataQosPolicy& new_value) { user_data_ = new_value; @@ -497,7 +497,7 @@ class DataReaderQos * * @return OwnershipQosPolicy reference */ - RTPS_DllAPI OwnershipQosPolicy& ownership() + FASTDDS_EXPORTED_API OwnershipQosPolicy& ownership() { return ownership_; } @@ -507,7 +507,7 @@ class DataReaderQos * * @return OwnershipQosPolicy const reference */ - RTPS_DllAPI const OwnershipQosPolicy& ownership() const + FASTDDS_EXPORTED_API const OwnershipQosPolicy& ownership() const { return ownership_; } @@ -517,7 +517,7 @@ class DataReaderQos * * @param new_value new value for the OwnershipQosPolicy */ - RTPS_DllAPI void ownership( + FASTDDS_EXPORTED_API void ownership( const OwnershipQosPolicy& new_value) { ownership_ = new_value; @@ -528,7 +528,7 @@ class DataReaderQos * * @return TimeBasedFilterQosPolicy reference */ - RTPS_DllAPI TimeBasedFilterQosPolicy& time_based_filter() + FASTDDS_EXPORTED_API TimeBasedFilterQosPolicy& time_based_filter() { return time_based_filter_; } @@ -538,7 +538,7 @@ class DataReaderQos * * @return TimeBasedFilterQosPolicy const reference */ - RTPS_DllAPI const TimeBasedFilterQosPolicy& time_based_filter() const + FASTDDS_EXPORTED_API const TimeBasedFilterQosPolicy& time_based_filter() const { return time_based_filter_; } @@ -548,7 +548,7 @@ class DataReaderQos * * @param new_value new value for the TimeBasedFilterQosPolicy */ - RTPS_DllAPI void time_based_filter( + FASTDDS_EXPORTED_API void time_based_filter( const TimeBasedFilterQosPolicy& new_value) { time_based_filter_ = new_value; @@ -559,7 +559,7 @@ class DataReaderQos * * @return ReaderDataLifecycleQosPolicy reference */ - RTPS_DllAPI ReaderDataLifecycleQosPolicy& reader_data_lifecycle() + FASTDDS_EXPORTED_API ReaderDataLifecycleQosPolicy& reader_data_lifecycle() { return reader_data_lifecycle_; } @@ -569,7 +569,7 @@ class DataReaderQos * * @return ReaderDataLifecycleQosPolicy const reference */ - RTPS_DllAPI const ReaderDataLifecycleQosPolicy& reader_data_lifecycle() const + FASTDDS_EXPORTED_API const ReaderDataLifecycleQosPolicy& reader_data_lifecycle() const { return reader_data_lifecycle_; } @@ -579,7 +579,7 @@ class DataReaderQos * * @param new_value new value for the ReaderDataLifecycleQosPolicy */ - RTPS_DllAPI void reader_data_lifecycle( + FASTDDS_EXPORTED_API void reader_data_lifecycle( const ReaderDataLifecycleQosPolicy& new_value) { reader_data_lifecycle_ = new_value; @@ -590,7 +590,7 @@ class DataReaderQos * * @return LifespanQosPolicy reference */ - RTPS_DllAPI LifespanQosPolicy& lifespan() + FASTDDS_EXPORTED_API LifespanQosPolicy& lifespan() { return lifespan_; } @@ -600,7 +600,7 @@ class DataReaderQos * * @return LifespanQosPolicy const reference */ - RTPS_DllAPI const LifespanQosPolicy& lifespan() const + FASTDDS_EXPORTED_API const LifespanQosPolicy& lifespan() const { return lifespan_; } @@ -610,7 +610,7 @@ class DataReaderQos * * @param new_value new value for the LifespanQosPolicy */ - RTPS_DllAPI void lifespan( + FASTDDS_EXPORTED_API void lifespan( const LifespanQosPolicy& new_value) { lifespan_ = new_value; @@ -621,7 +621,7 @@ class DataReaderQos * * @return DurabilityServiceQosPolicy reference */ - RTPS_DllAPI DurabilityServiceQosPolicy& durability_service() + FASTDDS_EXPORTED_API DurabilityServiceQosPolicy& durability_service() { return durability_service_; } @@ -631,7 +631,7 @@ class DataReaderQos * * @return DurabilityServiceQosPolicy const reference */ - RTPS_DllAPI const DurabilityServiceQosPolicy& durability_service() const + FASTDDS_EXPORTED_API const DurabilityServiceQosPolicy& durability_service() const { return durability_service_; } @@ -641,7 +641,7 @@ class DataReaderQos * * @param new_value new value for the DurabilityServiceQosPolicy */ - RTPS_DllAPI void durability_service( + FASTDDS_EXPORTED_API void durability_service( const DurabilityServiceQosPolicy& new_value) { durability_service_ = new_value; @@ -652,7 +652,7 @@ class DataReaderQos * * @return RTPSReliableReaderQos reference */ - RTPS_DllAPI RTPSReliableReaderQos& reliable_reader_qos() + FASTDDS_EXPORTED_API RTPSReliableReaderQos& reliable_reader_qos() { return reliable_reader_qos_; } @@ -662,7 +662,7 @@ class DataReaderQos * * @return RTPSReliableReaderQos const reference */ - RTPS_DllAPI const RTPSReliableReaderQos& reliable_reader_qos() const + FASTDDS_EXPORTED_API const RTPSReliableReaderQos& reliable_reader_qos() const { return reliable_reader_qos_; } @@ -672,7 +672,7 @@ class DataReaderQos * * @param new_value new value for the RTPSReliableReaderQos */ - RTPS_DllAPI void reliable_reader_qos( + FASTDDS_EXPORTED_API void reliable_reader_qos( const RTPSReliableReaderQos& new_value) { reliable_reader_qos_ = new_value; @@ -683,7 +683,7 @@ class DataReaderQos * * @return TypeConsistencyQos reference */ - RTPS_DllAPI TypeConsistencyQos& type_consistency() + FASTDDS_EXPORTED_API TypeConsistencyQos& type_consistency() { return type_consistency_; } @@ -693,7 +693,7 @@ class DataReaderQos * * @return TypeConsistencyQos const reference */ - RTPS_DllAPI const TypeConsistencyQos& type_consistency() const + FASTDDS_EXPORTED_API const TypeConsistencyQos& type_consistency() const { return type_consistency_; } @@ -703,7 +703,7 @@ class DataReaderQos * * @param new_value new value for the TypeConsistencyQos */ - RTPS_DllAPI void type_consistency( + FASTDDS_EXPORTED_API void type_consistency( const TypeConsistencyQos& new_value) { type_consistency_ = new_value; @@ -714,7 +714,7 @@ class DataReaderQos * * @return expectsInlineQos */ - RTPS_DllAPI bool expects_inline_qos() const + FASTDDS_EXPORTED_API bool expects_inline_qos() const { return expects_inline_qos_; } @@ -724,7 +724,7 @@ class DataReaderQos * * @param new_value new value for the expectsInlineQos */ - RTPS_DllAPI void expects_inline_qos( + FASTDDS_EXPORTED_API void expects_inline_qos( bool new_value) { expects_inline_qos_ = new_value; @@ -735,7 +735,7 @@ class DataReaderQos * * @return PropertyPolicyQos reference */ - RTPS_DllAPI PropertyPolicyQos& properties() + FASTDDS_EXPORTED_API PropertyPolicyQos& properties() { return properties_; } @@ -745,7 +745,7 @@ class DataReaderQos * * @return PropertyPolicyQos const reference */ - RTPS_DllAPI const PropertyPolicyQos& properties() const + FASTDDS_EXPORTED_API const PropertyPolicyQos& properties() const { return properties_; } @@ -755,7 +755,7 @@ class DataReaderQos * * @param new_value new value for the PropertyPolicyQos */ - RTPS_DllAPI void properties( + FASTDDS_EXPORTED_API void properties( const PropertyPolicyQos& new_value) { properties_ = new_value; @@ -766,7 +766,7 @@ class DataReaderQos * * @return RTPSEndpointQos reference */ - RTPS_DllAPI RTPSEndpointQos& endpoint() + FASTDDS_EXPORTED_API RTPSEndpointQos& endpoint() { return endpoint_; } @@ -776,7 +776,7 @@ class DataReaderQos * * @return RTPSEndpointQos const reference */ - RTPS_DllAPI const RTPSEndpointQos& endpoint() const + FASTDDS_EXPORTED_API const RTPSEndpointQos& endpoint() const { return endpoint_; } @@ -786,7 +786,7 @@ class DataReaderQos * * @param new_value new value for the RTPSEndpointQos */ - RTPS_DllAPI void endpoint( + FASTDDS_EXPORTED_API void endpoint( const RTPSEndpointQos& new_value) { endpoint_ = new_value; @@ -797,7 +797,7 @@ class DataReaderQos * * @return ReaderResourceLimitsQos reference */ - RTPS_DllAPI ReaderResourceLimitsQos& reader_resource_limits() + FASTDDS_EXPORTED_API ReaderResourceLimitsQos& reader_resource_limits() { return reader_resource_limits_; } @@ -807,7 +807,7 @@ class DataReaderQos * * @return ReaderResourceLimitsQos const reference */ - RTPS_DllAPI const ReaderResourceLimitsQos& reader_resource_limits() const + FASTDDS_EXPORTED_API const ReaderResourceLimitsQos& reader_resource_limits() const { return reader_resource_limits_; } @@ -817,7 +817,7 @@ class DataReaderQos * * @param new_value new value for the ReaderResourceLimitsQos */ - RTPS_DllAPI void reader_resource_limits( + FASTDDS_EXPORTED_API void reader_resource_limits( const ReaderResourceLimitsQos& new_value) { reader_resource_limits_ = new_value; @@ -828,7 +828,7 @@ class DataReaderQos * * @return DataSharingQosPolicy reference */ - RTPS_DllAPI DataSharingQosPolicy& data_sharing() + FASTDDS_EXPORTED_API DataSharingQosPolicy& data_sharing() { return data_sharing_; } @@ -838,7 +838,7 @@ class DataReaderQos * * @return DataSharingQosPolicy reference */ - RTPS_DllAPI const DataSharingQosPolicy& data_sharing() const + FASTDDS_EXPORTED_API const DataSharingQosPolicy& data_sharing() const { return data_sharing_; } @@ -848,7 +848,7 @@ class DataReaderQos * * @param data_sharing new value for the DataSharingQosPolicy */ - RTPS_DllAPI void data_sharing( + FASTDDS_EXPORTED_API void data_sharing( const DataSharingQosPolicy& data_sharing) { data_sharing_ = data_sharing; @@ -920,8 +920,8 @@ class DataReaderQos DataSharingQosPolicy data_sharing_; }; -RTPS_DllAPI extern const DataReaderQos DATAREADER_QOS_DEFAULT; -RTPS_DllAPI extern const DataReaderQos DATAREADER_QOS_USE_TOPIC_QOS; +FASTDDS_EXPORTED_API extern const DataReaderQos DATAREADER_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const DataReaderQos DATAREADER_QOS_USE_TOPIC_QOS; } // namespace dds } // namespace fastdds diff --git a/include/fastdds/dds/subscriber/qos/ReaderQos.hpp b/include/fastdds/dds/subscriber/qos/ReaderQos.hpp index 84b3e8154d2..ac8a42a9126 100644 --- a/include/fastdds/dds/subscriber/qos/ReaderQos.hpp +++ b/include/fastdds/dds/subscriber/qos/ReaderQos.hpp @@ -31,17 +31,17 @@ namespace dds { * Although these values can be set and are transmitted * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library. * Please consult each of them to check for implementation details and default values. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE + * @ingroup FASTDDS_QOS_MODULE */ class ReaderQos { public: - RTPS_DllAPI ReaderQos() + FASTDDS_EXPORTED_API ReaderQos() { } - RTPS_DllAPI virtual ~ReaderQos() + FASTDDS_EXPORTED_API virtual ~ReaderQos() { } @@ -131,7 +131,7 @@ class ReaderQos * @param readerqos Reference from a ReaderQos object. * @param first_time Boolean indicating whether is the first time (If not some parameters cannot be set). */ - RTPS_DllAPI void setQos( + FASTDDS_EXPORTED_API void setQos( const ReaderQos& readerqos, bool first_time); @@ -139,14 +139,14 @@ class ReaderQos * Check if the Qos values are compatible between each other. * @return True if correct. */ - RTPS_DllAPI bool checkQos() const; + FASTDDS_EXPORTED_API bool checkQos() const; /** * Check if the Qos can be update with the values provided. This method DOES NOT update anything. * @param qos Reference to the new qos. * @return True if they can be updated. */ - RTPS_DllAPI bool canQosBeUpdated( + FASTDDS_EXPORTED_API bool canQosBeUpdated( const ReaderQos& qos) const; void clear(); diff --git a/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp b/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp index 3f1e029d65c..11c74a871c9 100644 --- a/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp +++ b/include/fastdds/dds/subscriber/qos/SubscriberQos.hpp @@ -21,7 +21,6 @@ #define _FASTDDS_SUBSCRIBERQOS_HPP_ #include -#include namespace eprosima { namespace fastdds { @@ -42,14 +41,14 @@ class SubscriberQos /** * @brief Constructor */ - RTPS_DllAPI SubscriberQos() + FASTDDS_EXPORTED_API SubscriberQos() { } /** * @brief Destructor */ - RTPS_DllAPI virtual ~SubscriberQos() + FASTDDS_EXPORTED_API virtual ~SubscriberQos() { } @@ -201,7 +200,7 @@ class SubscriberQos EntityFactoryQosPolicy entity_factory_; }; -RTPS_DllAPI extern const SubscriberQos SUBSCRIBER_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const SubscriberQos SUBSCRIBER_QOS_DEFAULT; } /* namespace dds */ diff --git a/include/fastdds/dds/topic/ContentFilteredTopic.hpp b/include/fastdds/dds/topic/ContentFilteredTopic.hpp index 0935c408a48..bda635de270 100644 --- a/include/fastdds/dds/topic/ContentFilteredTopic.hpp +++ b/include/fastdds/dds/topic/ContentFilteredTopic.hpp @@ -19,14 +19,13 @@ #ifndef _FASTDDS_DDS_TOPIC_CONTENTFILTEREDTOPIC_HPP_ #define _FASTDDS_DDS_TOPIC_CONTENTFILTEREDTOPIC_HPP_ -#include +#include #include #include +#include #define FASTDDS_SQLFILTER_NAME eprosima::fastdds::dds::sqlfilter_name -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -64,7 +63,7 @@ class ContentFilteredTopic : public TopicDescription * This operation returns the Topic associated with the ContentFilteredTopic. * That is, the Topic specified when the ContentFilteredTopic was created. */ - RTPS_DllAPI Topic* get_related_topic() const; + FASTDDS_EXPORTED_API Topic* get_related_topic() const; /** * @brief Get the filter expression. @@ -75,7 +74,7 @@ class ContentFilteredTopic : public TopicDescription * * @return the @c filter_expression. */ - RTPS_DllAPI const std::string& get_filter_expression() const; + FASTDDS_EXPORTED_API const std::string& get_filter_expression() const; /** * @brief Get the expression parameters. @@ -91,7 +90,7 @@ class ContentFilteredTopic : public TopicDescription * * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_expression_parameters( + FASTDDS_EXPORTED_API ReturnCode_t get_expression_parameters( std::vector& expression_parameters) const; /** @@ -104,7 +103,7 @@ class ContentFilteredTopic : public TopicDescription * @return RETCODE_OK if the expression parameters where correctly updated. * @return RETCODE_BAD_PARAMETER if the expression parameters do not match with the current @c filter_expression. */ - RTPS_DllAPI ReturnCode_t set_expression_parameters( + FASTDDS_EXPORTED_API ReturnCode_t set_expression_parameters( const std::vector& expression_parameters); /** @@ -120,7 +119,7 @@ class ContentFilteredTopic : public TopicDescription * @return RETCODE_BAD_PARAMETER if @c filter_expression is not valid for this ContentFilteredTopic. * @return RETCODE_BAD_PARAMETER if the expression parameters do not match with the @c filter_expression. */ - RTPS_DllAPI ReturnCode_t set_filter_expression( + FASTDDS_EXPORTED_API ReturnCode_t set_filter_expression( const std::string& filter_expression, const std::vector& expression_parameters); @@ -128,7 +127,7 @@ class ContentFilteredTopic : public TopicDescription * @brief Getter for the DomainParticipant * @return DomainParticipant pointer */ - RTPS_DllAPI DomainParticipant* get_participant() const override; + FASTDDS_EXPORTED_API DomainParticipant* get_participant() const override; TopicDescriptionImpl* get_impl() const override; diff --git a/include/fastdds/dds/topic/IContentFilter.hpp b/include/fastdds/dds/topic/IContentFilter.hpp index 62449bc68f9..aef9f387a59 100644 --- a/include/fastdds/dds/topic/IContentFilter.hpp +++ b/include/fastdds/dds/topic/IContentFilter.hpp @@ -19,17 +19,12 @@ #ifndef _FASTDDS_DDS_TOPIC_ICONTENTFILTER_HPP_ #define _FASTDDS_DDS_TOPIC_ICONTENTFILTER_HPP_ -#include - -#include +#include #include #include #include -#include -#include - namespace eprosima { namespace fastdds { namespace dds { diff --git a/include/fastdds/dds/topic/IContentFilterFactory.hpp b/include/fastdds/dds/topic/IContentFilterFactory.hpp index 598767b1b81..b61219d4151 100644 --- a/include/fastdds/dds/topic/IContentFilterFactory.hpp +++ b/include/fastdds/dds/topic/IContentFilterFactory.hpp @@ -19,14 +19,13 @@ #ifndef _FASTDDS_DDS_TOPIC_ICONTENTFILTERFACTORY_HPP_ #define _FASTDDS_DDS_TOPIC_ICONTENTFILTERFACTORY_HPP_ -#include +#include #include +#include #include #include -#include - namespace eprosima { namespace fastdds { namespace dds { @@ -36,9 +35,7 @@ namespace dds { */ struct IContentFilterFactory { - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; using ParameterSeq = LoanableTypedCollection; - using TypeDescriptor = eprosima::fastrtps::types::TypeDescriptor; /** * Create or update an IContentFilter instance. diff --git a/include/fastdds/dds/topic/Topic.hpp b/include/fastdds/dds/topic/Topic.hpp index e44afb4e605..c10e34f9793 100644 --- a/include/fastdds/dds/topic/Topic.hpp +++ b/include/fastdds/dds/topic/Topic.hpp @@ -19,14 +19,13 @@ #ifndef _FASTDDS_TOPIC_HPP_ #define _FASTDDS_TOPIC_HPP_ -#include +#include #include +#include #include #include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace dds { namespace topic { @@ -91,7 +90,7 @@ class Topic : public DomainEntity, public TopicDescription * @return RETCODE_OK * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t get_inconsistent_topic_status( + FASTDDS_EXPORTED_API ReturnCode_t get_inconsistent_topic_status( InconsistentTopicStatus& status); /** @@ -99,7 +98,7 @@ class Topic : public DomainEntity, public TopicDescription * * @return reference to TopicQos */ - RTPS_DllAPI const TopicQos& get_qos() const; + FASTDDS_EXPORTED_API const TopicQos& get_qos() const; /** * Retrieves the Topic Qos. @@ -107,7 +106,7 @@ class Topic : public DomainEntity, public TopicDescription * @param qos TopicQos where the qos is returned * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t get_qos( + FASTDDS_EXPORTED_API ReturnCode_t get_qos( TopicQos& qos) const; /** @@ -119,7 +118,7 @@ class Topic : public DomainEntity, public TopicDescription * @retval RETCODE_INCONSISTENT_POLICY if new qos has inconsistent values. * @retval RETCODE_OK if qos was updated. */ - RTPS_DllAPI ReturnCode_t set_qos( + FASTDDS_EXPORTED_API ReturnCode_t set_qos( const TopicQos& qos); /** @@ -127,7 +126,7 @@ class Topic : public DomainEntity, public TopicDescription * * @return pointer to TopicListener */ - RTPS_DllAPI const TopicListener* get_listener() const; + FASTDDS_EXPORTED_API const TopicListener* get_listener() const; /** * Modifies the TopicListener. @@ -136,7 +135,7 @@ class Topic : public DomainEntity, public TopicDescription * @param mask StatusMask that holds statuses the listener responds to (default: all). * @return RETCODE_OK */ - RTPS_DllAPI ReturnCode_t set_listener( + FASTDDS_EXPORTED_API ReturnCode_t set_listener( TopicListener* listener, const StatusMask& mask = StatusMask::all()); diff --git a/include/fastdds/dds/topic/TopicDataType.hpp b/include/fastdds/dds/topic/TopicDataType.hpp index 3bd5072444a..3262574fd78 100644 --- a/include/fastdds/dds/topic/TopicDataType.hpp +++ b/include/fastdds/dds/topic/TopicDataType.hpp @@ -24,12 +24,11 @@ #include #include +#include #include #include #include - -#include -#include +#include // This version of TypeSupport has `is_bounded()` #define TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED @@ -57,7 +56,7 @@ class TypeSupport; /** * Class TopicDataType used to provide the DomainRTPSParticipant with the methods to serialize, deserialize and get the key of a specific data type. * The user should created a class that inherits from this one, where Serialize and deserialize methods MUST be implemented. - * @ingroup FASTRTPS_MODULE, FASTDDS_MODULE + * @ingroup FASTDDS_MODULE */ class TopicDataType { @@ -66,12 +65,12 @@ class TopicDataType /** * @brief Constructor */ - RTPS_DllAPI TopicDataType(); + FASTDDS_EXPORTED_API TopicDataType(); /** * @brief Destructor */ - RTPS_DllAPI virtual ~TopicDataType(); + FASTDDS_EXPORTED_API virtual ~TopicDataType(); /** * Serialize method, it should be implemented by the user, since it is abstract. @@ -81,8 +80,9 @@ class TopicDataType * @param[out] payload Pointer to the payload * @return True if correct. */ + // TODO(jlbueno) Remove when Fast DDS-Gen is updated // FASTDDS_TODO_BEFORE(3, 0, "Remove this overload") - RTPS_DllAPI virtual bool serialize( + FASTDDS_EXPORTED_API virtual bool serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload) = 0; @@ -96,7 +96,7 @@ class TopicDataType * @param[in] data_representation Representation that should be used to encode the data into the payload. * @return True if correct. */ - RTPS_DllAPI virtual bool serialize( + FASTDDS_EXPORTED_API virtual bool serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload, DataRepresentationId_t data_representation); @@ -108,7 +108,7 @@ class TopicDataType * @param[out] data Pointer to the data * @return True if correct. */ - RTPS_DllAPI virtual bool deserialize( + FASTDDS_EXPORTED_API virtual bool deserialize( fastrtps::rtps::SerializedPayload_t* payload, void* data) = 0; @@ -118,7 +118,8 @@ class TopicDataType * @param[in] data Pointer to data. * @return Functor which calculates the serialized size of the data. */ - RTPS_DllAPI virtual std::function getSerializedSizeProvider( + // FASTDDS_TODO_BEFORE(3, 0, "Remove this overload") + FASTDDS_EXPORTED_API virtual std::function getSerializedSizeProvider( void* data) = 0; /*! @@ -128,7 +129,7 @@ class TopicDataType * @param[in] data_representation Representation that should be used for calculating the serialized size. * @return Functor which calculates the serialized size of the data. */ - RTPS_DllAPI virtual std::function getSerializedSizeProvider( + FASTDDS_EXPORTED_API virtual std::function getSerializedSizeProvider( void* data, DataRepresentationId_t data_representation); @@ -137,13 +138,13 @@ class TopicDataType * * @return Void pointer to the created object. */ - RTPS_DllAPI virtual void* createData() = 0; + FASTDDS_EXPORTED_API virtual void* createData() = 0; /** * Remove a previously created object. * * @param data Pointer to the created Data. */ - RTPS_DllAPI virtual void deleteData( + FASTDDS_EXPORTED_API virtual void deleteData( void* data) = 0; /** @@ -154,7 +155,7 @@ class TopicDataType * @param[in] force_md5 Force MD5 checking. * @return True if correct. */ - RTPS_DllAPI virtual bool getKey( + FASTDDS_EXPORTED_API virtual bool getKey( void* data, fastrtps::rtps::InstanceHandle_t* ihandle, bool force_md5 = false) = 0; @@ -164,7 +165,7 @@ class TopicDataType * * @param nam Topic data type name */ - RTPS_DllAPI inline void setName( + FASTDDS_EXPORTED_API inline void setName( const char* nam) { m_topicDataTypeName = std::string(nam); @@ -175,38 +176,17 @@ class TopicDataType * * @return Topic data type name */ - RTPS_DllAPI inline const char* getName() const + FASTDDS_EXPORTED_API inline const char* getName() const { return m_topicDataTypeName.c_str(); } - /** - * Get the type object auto-fill configuration - * - * @return true if the type object should be auto-filled - */ - RTPS_DllAPI inline bool auto_fill_type_object() const - { - return auto_fill_type_object_; - } - - /** - * Set the type object auto-fill configuration - * - * @param auto_fill_type_object new value to set - */ - RTPS_DllAPI inline void auto_fill_type_object( - bool auto_fill_type_object) - { - auto_fill_type_object_ = auto_fill_type_object; - } - /** * Get the type information auto-fill configuration * * @return true if the type information should be auto-filled */ - RTPS_DllAPI inline bool auto_fill_type_information() const + FASTDDS_EXPORTED_API inline bool auto_fill_type_information() const { return auto_fill_type_information_; } @@ -216,7 +196,7 @@ class TopicDataType * * @param auto_fill_type_information new value to set */ - RTPS_DllAPI inline void auto_fill_type_information( + FASTDDS_EXPORTED_API inline void auto_fill_type_information( bool auto_fill_type_information) { auto_fill_type_information_ = auto_fill_type_information; @@ -227,7 +207,7 @@ class TopicDataType * * @return TypeIdV1 */ - RTPS_DllAPI inline const std::shared_ptr type_identifier() const + FASTDDS_EXPORTED_API inline const std::shared_ptr type_identifier() const { return type_identifier_; } @@ -237,7 +217,7 @@ class TopicDataType * * @param id new value for TypeIdV1 */ - RTPS_DllAPI inline void type_identifier( + FASTDDS_EXPORTED_API inline void type_identifier( const TypeIdV1& id) { type_identifier_ = std::make_shared(id); @@ -248,7 +228,7 @@ class TopicDataType * * @param id shared pointer to TypeIdV1 */ - RTPS_DllAPI inline void type_identifier( + FASTDDS_EXPORTED_API inline void type_identifier( const std::shared_ptr id) { type_identifier_ = std::move(id); @@ -259,7 +239,7 @@ class TopicDataType * * @return TypeObjectV1 */ - RTPS_DllAPI inline const std::shared_ptr type_object() const + FASTDDS_EXPORTED_API inline const std::shared_ptr type_object() const { return type_object_; } @@ -269,7 +249,7 @@ class TopicDataType * * @param object new value for TypeObjectV1 */ - RTPS_DllAPI inline void type_object( + FASTDDS_EXPORTED_API inline void type_object( const TypeObjectV1& object) { type_object_ = std::make_shared(object); @@ -280,7 +260,7 @@ class TopicDataType * * @param object shared pointer to TypeObjectV1 */ - RTPS_DllAPI inline void type_object( + FASTDDS_EXPORTED_API inline void type_object( std::shared_ptr object) { type_object_ = std::move(object); @@ -289,9 +269,9 @@ class TopicDataType /** * Get the type information * - * @return TypeInformation + * @return TypeInformationParameter */ - RTPS_DllAPI inline const std::shared_ptr type_information() const + FASTDDS_EXPORTED_API inline const std::shared_ptr type_information() const { return type_information_; } @@ -299,21 +279,21 @@ class TopicDataType /** * Set type information * - * @param info new value for TypeInformation + * @param info new value for TypeInformationParameter */ - RTPS_DllAPI inline void type_information( - const xtypes::TypeInformation& info) + FASTDDS_EXPORTED_API inline void type_information( + const xtypes::TypeInformationParameter& info) { - type_information_ = std::make_shared(info); + type_information_ = std::make_shared(info); } /** * Set type information * - * @param info shared pointer to TypeInformation + * @param info shared pointer to TypeInformationParameter */ - RTPS_DllAPI inline void type_information( - std::shared_ptr info) + FASTDDS_EXPORTED_API inline void type_information( + std::shared_ptr info) { type_information_ = std::move(info); } @@ -321,7 +301,7 @@ class TopicDataType /** * Checks if the type is bounded. */ - RTPS_DllAPI virtual inline bool is_bounded() const + FASTDDS_EXPORTED_API virtual inline bool is_bounded() const { return false; } @@ -329,7 +309,7 @@ class TopicDataType /** * Checks if the type is plain when using default encoding. */ - RTPS_DllAPI virtual inline bool is_plain() const + FASTDDS_EXPORTED_API virtual inline bool is_plain() const { return false; } @@ -337,7 +317,7 @@ class TopicDataType /** * Checks if the type is plain when using a specific encoding. */ - RTPS_DllAPI virtual inline bool is_plain( + FASTDDS_EXPORTED_API virtual inline bool is_plain( DataRepresentationId_t) const { return false; @@ -350,13 +330,20 @@ class TopicDataType * * @return whether this type supports in-place construction or not. */ - RTPS_DllAPI virtual inline bool construct_sample( + FASTDDS_EXPORTED_API virtual inline bool construct_sample( void* memory) const { static_cast(memory); return false; } + /** + * @brief Register TypeObject type representation + */ + FASTDDS_EXPORTED_API virtual inline void register_type_object_representation() const + { + } + //! Maximum serialized size of the type in bytes. //! If the type has unbounded fields, and therefore cannot have a maximum size, use 0. uint32_t m_typeSize; @@ -371,14 +358,13 @@ class TopicDataType //!Type Object XTYPES 1.1 std::shared_ptr type_object_; //!XTYPES 1.2 - std::shared_ptr type_information_; + std::shared_ptr type_information_; private: //! Data Type Name. std::string m_topicDataTypeName; - - bool auto_fill_type_object_; + //TODO(XTypes) bool auto_fill_type_information_; friend class fastdds::dds::TypeSupport; diff --git a/include/fastdds/dds/topic/TopicListener.hpp b/include/fastdds/dds/topic/TopicListener.hpp index 61344fc52fd..6f5dd31a482 100644 --- a/include/fastdds/dds/topic/TopicListener.hpp +++ b/include/fastdds/dds/topic/TopicListener.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_TOPICLISTENER_HPP_ #define _FASTDDS_TOPICLISTENER_HPP_ -#include +#include #include namespace eprosima { @@ -33,7 +33,7 @@ class Topic; * * @ingroup FASTDDS_MODULE */ -class RTPS_DllAPI TopicListener +class FASTDDS_EXPORTED_API TopicListener { public: diff --git a/include/fastdds/dds/topic/TypeSupport.hpp b/include/fastdds/dds/topic/TypeSupport.hpp index 549dcd03e79..e2b3b9c0d56 100644 --- a/include/fastdds/dds/topic/TypeSupport.hpp +++ b/include/fastdds/dds/topic/TypeSupport.hpp @@ -19,15 +19,16 @@ #ifndef _FASTDDS_TYPE_SUPPORT_HPP_ #define _FASTDDS_TYPE_SUPPORT_HPP_ -#include -#include -#include -#include - #include #include #include +#include +#include +#include +#include +#include + namespace eprosima { namespace fastdds { namespace dds { @@ -42,25 +43,23 @@ class DomainParticipant; * where Serialize and deserialize methods MUST be implemented. * @ingroup FASTDDS_MODULE */ -class TypeSupport : public std::shared_ptr +class TypeSupport : public std::shared_ptr { public: - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - - using Base = std::shared_ptr; + using Base = std::shared_ptr; /** * @brief Constructor */ - RTPS_DllAPI TypeSupport() noexcept = default; + FASTDDS_EXPORTED_API TypeSupport() noexcept = default; /** * @brief Copy Constructor * * @param type Another instance of TypeSupport */ - RTPS_DllAPI TypeSupport( + FASTDDS_EXPORTED_API TypeSupport( const TypeSupport& type) noexcept = default; /** @@ -68,7 +67,7 @@ class TypeSupport : public std::shared_ptr * * @param type Another instance of TypeSupport */ - RTPS_DllAPI TypeSupport( + FASTDDS_EXPORTED_API TypeSupport( TypeSupport&& type) noexcept = default; /** @@ -76,7 +75,7 @@ class TypeSupport : public std::shared_ptr * * @param type Another instance of TypeSupport */ - RTPS_DllAPI TypeSupport& operator = ( + FASTDDS_EXPORTED_API TypeSupport& operator = ( const TypeSupport& type) noexcept = default; /** @@ -84,7 +83,7 @@ class TypeSupport : public std::shared_ptr * * @param type Another instance of TypeSupport */ - RTPS_DllAPI TypeSupport& operator = ( + FASTDDS_EXPORTED_API TypeSupport& operator = ( TypeSupport&& type) noexcept = default; /*! @@ -94,9 +93,9 @@ class TypeSupport : public std::shared_ptr * * @param ptr */ - RTPS_DllAPI explicit TypeSupport( - fastdds::dds::TopicDataType* ptr) - : std::shared_ptr(ptr) + FASTDDS_EXPORTED_API explicit TypeSupport( + TopicDataType* ptr) + : std::shared_ptr(ptr) { } @@ -106,10 +105,9 @@ class TypeSupport : public std::shared_ptr * * @param ptr */ - RTPS_DllAPI TypeSupport( - fastrtps::types::DynamicPubSubType ptr) - : std::shared_ptr(std::make_shared(std::move( - ptr))) + FASTDDS_EXPORTED_API TypeSupport( + DynamicPubSubType ptr) + : std::shared_ptr(std::make_shared(std::move(ptr))) { } @@ -120,7 +118,7 @@ class TypeSupport : public std::shared_ptr * @return RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with * the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly */ - RTPS_DllAPI virtual ReturnCode_t register_type( + FASTDDS_EXPORTED_API virtual ReturnCode_t register_type( DomainParticipant* participant) const; /** @@ -131,7 +129,7 @@ class TypeSupport : public std::shared_ptr * @return RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with * the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly */ - RTPS_DllAPI virtual ReturnCode_t register_type( + FASTDDS_EXPORTED_API virtual ReturnCode_t register_type( DomainParticipant* participant, std::string type_name) const; @@ -140,7 +138,7 @@ class TypeSupport : public std::shared_ptr * * @return name of the data type */ - RTPS_DllAPI virtual const std::string& get_type_name() const + FASTDDS_EXPORTED_API virtual const std::string& get_type_name() const { return get()->m_topicDataTypeName; } @@ -153,7 +151,7 @@ class TypeSupport : public std::shared_ptr * @return true if it is serialized correctly, false if not */ - RTPS_DllAPI virtual bool serialize( + FASTDDS_EXPORTED_API virtual bool serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload) { @@ -168,7 +166,7 @@ class TypeSupport : public std::shared_ptr * @param[in] data_representation Representation that should be used to encode the data into the payload. * @return true if it is serialized correctly, false if not */ - RTPS_DllAPI virtual bool serialize( + FASTDDS_EXPORTED_API virtual bool serialize( void* data, fastrtps::rtps::SerializedPayload_t* payload, DataRepresentationId_t data_representation); @@ -180,7 +178,7 @@ class TypeSupport : public std::shared_ptr * @param data Pointer to data * @return true if it is deserialized correctly, false if not */ - RTPS_DllAPI virtual bool deserialize( + FASTDDS_EXPORTED_API virtual bool deserialize( fastrtps::rtps::SerializedPayload_t* payload, void* data); @@ -190,7 +188,7 @@ class TypeSupport : public std::shared_ptr * @param[in] data Pointer to data. * @return Functor which calculates the serialized size of the data. */ - RTPS_DllAPI virtual std::function get_serialized_size_provider( + FASTDDS_EXPORTED_API virtual std::function get_serialized_size_provider( void* data) { return get_serialized_size_provider(data, DEFAULT_DATA_REPRESENTATION); @@ -203,7 +201,7 @@ class TypeSupport : public std::shared_ptr * @param[in] data_representation Representation that should be used for calculating the serialized size. * @return Functor which calculates the serialized size of the data. */ - RTPS_DllAPI virtual std::function get_serialized_size_provider( + FASTDDS_EXPORTED_API virtual std::function get_serialized_size_provider( void* data, DataRepresentationId_t data_representation) { @@ -215,7 +213,7 @@ class TypeSupport : public std::shared_ptr * * @return Pointer to the data */ - RTPS_DllAPI virtual void* create_data() + FASTDDS_EXPORTED_API virtual void* create_data() { return get()->createData(); } @@ -225,7 +223,7 @@ class TypeSupport : public std::shared_ptr * * @param data Pointer to the data to delete */ - RTPS_DllAPI virtual void delete_data( + FASTDDS_EXPORTED_API virtual void delete_data( void* data) { return get()->deleteData(data); @@ -239,7 +237,7 @@ class TypeSupport : public std::shared_ptr * @param force_md5 boolean to force md5 (default: false) * @return true if the key is returned, false if not */ - RTPS_DllAPI virtual bool get_key( + FASTDDS_EXPORTED_API virtual bool get_key( void* data, InstanceHandle_t* i_handle, bool force_md5 = false) @@ -247,7 +245,7 @@ class TypeSupport : public std::shared_ptr return get()->getKey(data, i_handle, force_md5); } - RTPS_DllAPI virtual bool operator ==( + FASTDDS_EXPORTED_API virtual bool operator ==( const TypeSupport& type_support) { return get()->m_typeSize == type_support->m_typeSize @@ -263,7 +261,7 @@ class TypeSupport : public std::shared_ptr * * @return true if empty, false if not */ - RTPS_DllAPI bool empty() const + FASTDDS_EXPORTED_API bool empty() const { return get() == nullptr; } @@ -271,7 +269,7 @@ class TypeSupport : public std::shared_ptr /** * Checks if the type is bounded. */ - RTPS_DllAPI virtual inline bool is_bounded() const + FASTDDS_EXPORTED_API virtual inline bool is_bounded() const { return get()->is_bounded(); } @@ -279,7 +277,7 @@ class TypeSupport : public std::shared_ptr /** * Checks if the type is plain when using default encoding. */ - RTPS_DllAPI virtual inline bool is_plain() const + FASTDDS_EXPORTED_API virtual inline bool is_plain() const { return is_plain(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); } @@ -287,19 +285,19 @@ class TypeSupport : public std::shared_ptr /** * Checks if the type is plain when using a specific encoding. */ - RTPS_DllAPI virtual inline bool is_plain( + FASTDDS_EXPORTED_API virtual inline bool is_plain( DataRepresentationId_t data_representation) const { return get()->is_plain(data_representation); } - RTPS_DllAPI bool operator !=( + FASTDDS_EXPORTED_API bool operator !=( std::nullptr_t) const { return bool(*this); } - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( std::nullptr_t) const { return !*this; diff --git a/include/fastdds/dds/topic/qos/TopicQos.hpp b/include/fastdds/dds/topic/qos/TopicQos.hpp index 0c64050bd35..7970e1af73d 100644 --- a/include/fastdds/dds/topic/qos/TopicQos.hpp +++ b/include/fastdds/dds/topic/qos/TopicQos.hpp @@ -21,7 +21,7 @@ #define _FASTDDS_TOPICQOS_HPP #include -#include +#include #include @@ -44,7 +44,7 @@ class TopicQos /** * @brief Constructor */ - RTPS_DllAPI TopicQos(); + FASTDDS_EXPORTED_API TopicQos(); bool operator ==( const TopicQos& b) const @@ -543,7 +543,7 @@ class TopicQos DataRepresentationQosPolicy representation_; }; -RTPS_DllAPI extern const TopicQos TOPIC_QOS_DEFAULT; +FASTDDS_EXPORTED_API extern const TopicQos TOPIC_QOS_DEFAULT; } // namespace dds } // namespace fastdds diff --git a/include/fastdds/dds/xtypes/common.hpp b/include/fastdds/dds/xtypes/common.hpp new file mode 100644 index 00000000000..3a2032fb38b --- /dev/null +++ b/include/fastdds/dds/xtypes/common.hpp @@ -0,0 +1,114 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file common.hpp + * This file contains common definitions for the different XTypes modules. + */ + +#ifndef _FASTDDS_DDS_XTYPES_COMMON_HPP_ +#define _FASTDDS_DDS_XTYPES_COMMON_HPP_ + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +enum class ExtensibilityKind : uint32_t +{ + NOT_APPLIED, + FINAL, + APPENDABLE, + MUTABLE +}; + +enum class TryConstructKind : uint32_t +{ + NOT_APPLIED, + USE_DEFAULT, + DISCARD, + TRIM +}; + +/*! + * @brief PlacementKind values (verbatim annotation) + */ +enum class PlacementKind : uint32_t +{ + BEGIN_FILE, + BEFORE_DECLARATION, + BEGIN_DECLARATION, + END_DECLARATION, + AFTER_DECLARATION, + END_FILE +}; + +// Primitive type names +constexpr const char* boolean_type_name = "_bool"; +constexpr const char* byte_type_name = "_byte"; +constexpr const char* int16_type_name = "_int16_t"; +constexpr const char* int32_type_name = "_int32_t"; +constexpr const char* int64_type_name = "_int64_t"; +constexpr const char* uint16_type_name = "_uint16_t"; +constexpr const char* uint32_type_name = "_uint32_t"; +constexpr const char* uint64_type_name = "_uint64_t"; +constexpr const char* float32_type_name = "_float"; +constexpr const char* float64_type_name = "_double"; +constexpr const char* float128_type_name = "_longdouble"; +constexpr const char* int8_type_name = "_int8_t"; +constexpr const char* uint8_type_name = "_uint8_t"; +constexpr const char* char8_type_name = "_char"; +constexpr const char* char16_type_name = "_wchar_t"; + +// Builtin annotation names +constexpr const char* id_annotation_name = "id"; +constexpr const char* autoid_annotation_name = "autoid"; +constexpr const char* optional_annotation_name = "optional"; +constexpr const char* position_annotation_name = "position"; +constexpr const char* value_annotation_name = "value"; // Pending implementation +constexpr const char* extensibility_annotation_name = "extensibility"; +constexpr const char* final_annotation_name = "final"; +constexpr const char* appendable_annotation_name = "appendable"; +constexpr const char* mutable_annotation_name = "mutable"; +constexpr const char* key_annotation_name = "key"; +constexpr const char* must_understand_annotation_name = "must_understand"; +constexpr const char* default_literal_annotation_name = "default_literal"; +constexpr const char* default_annotation_name = "default"; // Pending implementation +constexpr const char* range_annotation_name = "range"; // Pending implementation +constexpr const char* min_annotation_name = "min"; // Pending implementation +constexpr const char* max_annotation_name = "max"; // Pending implementation +constexpr const char* unit_annotation_name = "unit"; +constexpr const char* bit_bound_annotation_name = "bit_bound"; +constexpr const char* external_annotation_name = "external"; +constexpr const char* nested_annotation_name = "nested"; +constexpr const char* verbatim_annotation_name = "verbatim"; +constexpr const char* service_annotation_name = "service"; +constexpr const char* oneway_annotation_name = "oneway"; +constexpr const char* ami_annotation_name = "ami"; +constexpr const char* hashid_annotation_name = "hashid"; +constexpr const char* default_nested_annotation_name = "default_nested"; +constexpr const char* ignore_literal_names_annotation_name = "ignore_literal_names"; +constexpr const char* try_construct_annotation_name = "try_construct"; +constexpr const char* non_serialized_annotation_name = "non_serialized"; +constexpr const char* data_representation_annotation_name = "data_representation"; +constexpr const char* topic_annotation_name = "topic"; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_COMMON_HPP_ diff --git a/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp new file mode 100644 index 00000000000..781bed34cf9 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp @@ -0,0 +1,131 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +class FASTDDS_EXPORTED_API AnnotationDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns a reference to the type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type type() const = 0; + + /*! + * Returns a reference to the type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& type() = 0; + + /*! + * Modifies the underlying type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void type( + traits::ref_type type) = 0; + + /** + * Getter given a key for the @b value property. + * @param[inout] value The value. + * @param[in] key Key used to retrieve the value. + * @return @ref ReturnCode_t returns operation success + */ + virtual ReturnCode_t get_value( + ObjectName& value, + const ObjectName& key) = 0; + + /** + * Getter for all the values. + * @param[inout] value @ref Parameters interface to the strings map. + * @return @ref ReturnCode_t returns operation success. + */ + virtual ReturnCode_t get_all_value( + Parameters& value) = 0; + + /** + * Setter given a key for the @b value property. + * @param[in] key null terminated string + * @param[in] value null terminated string + * @return @ref ReturnCode_t returns operation success + */ + virtual ReturnCode_t set_value( + const ObjectName& key, + const ObjectName& value) = 0; + + /** + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.3.1) + * @param[in] descriptor object + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.3.2 + * @param[in] descriptor reference. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.3.3. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + AnnotationDescriptor() = default; + + AnnotationDescriptor( + const AnnotationDescriptor&) = default; + + AnnotationDescriptor( + AnnotationDescriptor&&) = default; + + virtual ~AnnotationDescriptor() = default; + +private: + + AnnotationDescriptor& operator =( + const AnnotationDescriptor&) = delete; + + AnnotationDescriptor& operator =( + AnnotationDescriptor&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp new file mode 100644 index 00000000000..d1c29039eb3 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp @@ -0,0 +1,1042 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP + +#include +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicData : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Retrieve the @ref DynamicType reference associated to this @ref DynamicData + * @return Non-nil @ref DynamicType reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type type() = 0; + + /*! + * Retrieves the @ref MemberDescriptor associated to a member. + * @param[inout] value Non-nil @ref MemberDescriptor reference where the information is copied. + * @param[in] id Identifier of the member to be retrieved. + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or member identifier is not found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& value, + MemberId id) = 0; + + /*! + * Compares two @ref DynamicData, equality requires: + * - Their respective type definitions are equal + * - All contained values are equal and occur in the same order + * - If the samples' type is an aggregated type, previous rule shall be amended as follows: + * -# Members shall be compared without regard to their order. + * @param [in] other @ref DynamicData reference to compare to + * @return `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /*! + * Queries @ref MemberId by name. + * The query result depends on the type of the sample. + * Only next types support accessing by name. + * @li Aggregated type. + * @li Map type. + * @li Bitmask type. + * @param[in] name string + * @return MemberId or MEMBER_ID_INVALID on failure + */ + FASTDDS_EXPORTED_API virtual MemberId get_member_id_by_name( + const ObjectName& name) = 0; + + /*! + * Queries @ref MemberId by index + * The query result depends on the type of the sample. + * Only next types support accessing by index. + * @li Aggregated type. + * @li Sequence type. + * @li String type. + * @li Map type. + * @li Array type. + * @li Bitmask type. + * @param[in] index Index. + * @return MemberId or MEMBER_ID_INVALID on failure + */ + FASTDDS_EXPORTED_API virtual MemberId get_member_id_at_index( + uint32_t index) = 0; + + /*! + * Provides the @b item @b count of the data and depends on the type of object: + * @li If the object is of a collection type, returns the number of elements currently in the collection. + * In the case of an array type, this value will always be equal to the product of the bounds of all array + * dimensions. + * @li If the object is of a bitmask type, return the number of named flags that are currently set in the bitmask. + * @li If the object is of a structure or annotation type, return the number of members in the object. + * This value may be different than the number of members in the corresponding @ref DynamicType. + * @li If the object is of a union type, return the number of members in the object. This number will be two if the + * discriminator value selects a member and one otherwise. + * @li if the object is of a primitive or enumerated type, it is atomic: return one. + * @li if the object is of an alias type, return the value appropriate for the alias base type. + * @return count as defined above + */ + FASTDDS_EXPORTED_API virtual uint32_t get_item_count() = 0; + + /*! + * Clear all members associated to the object. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_all_values() = 0; + + /*! + * Clear all members not associated to the key + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_nonkey_values() = 0; + + /*! + * Clear a member. + * The meaning of "clearing" depends on the type of the sample: + * @li If aggregated type, set it to its default value. + * @li If variable-length collection type, remove the indicated element, shifting any subsequence elements to the + * next-lowest index. + * @li If array type, set the indicated element to its default value. + * @li If bitmask type, clear the indicated bit. + * @li If enumerated type, set it to the first value of the enumerated type. + * @li If primitive type, set it to its default value. + * @param[in] id Identifier of the member to purge + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_value( + MemberId id) = 0; + + /*! + * \b Loans a @ref DynamicData reference within the sample + * @remarks This loan shall be returned by the @ref DynamicData::return_loaned_value operation + * @param[in] id identifier of the object to retrieve + * @return @ref DynamicData reference loaned or \b nil on outstanding loaned data + */ + FASTDDS_EXPORTED_API virtual traits::ref_type loan_value( + MemberId id) = 0; + + /*! + * Returns a loan retrieved using @ref DynamicData::loan_value. + * @param[in] value @ref DynamicData reference previously loaned + * @retval RETCODE_OK when the loan was returned successfully. + * @retval RETCODE_PRECONDITION_NOT_MET when the loan is invalid. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t return_loaned_value( + traits::ref_type value) = 0; + + /*! + * Creates and returns a new data sample with the same contents as this one. + * A comparison of this object and the clone using equals immediately following this call will return `true`. + * @return @ref DynamicData reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type clone() = 0; + + /*! + * Retrieves an \b int32 value associated to an identifier. + * @param[inout] value \b int32 to populate + * @param[in] id identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int32_value( + int32_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int32_value( + MemberId id, + int32_t value) = 0; + + /*! + * Retrieves an \b uint32 value associated to an identifier. + * @param[inout] value \b uint32 to populate + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint32_value( + uint32_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint32 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint32_value( + MemberId id, + uint32_t value) = 0; + + /*! + * Retrieves an \b int8 value associated to an identifier. + * @param[inout] value \b int8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int8_value( + int8_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int8 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int8_value( + MemberId id, + int8_t value) = 0; + + /*! + * Retrieves an \b uint8 value associated to an identifier. + * @param[inout] value \b uint8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint8_value( + uint8_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint8 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint8_value( + MemberId id, + uint8_t value) = 0; + + /*! + * Retrieves an \b int16 value associated to an identifier. + * @param[inout] value \b int16 to populate. + * @param [in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int16_value( + int16_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int16_value( + MemberId id, + int16_t value) = 0; + + /*! + * Retrieves an \b uint16 value associated to an identifier. + * @param[inout] value \b uint16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint16_value( + uint16_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint16_value( + MemberId id, + uint16_t value) = 0; + + /*! + * Retrieves an \b int64 value associated to an identifier. + * @param[inout] value \b int64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int64_value( + int64_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int64_value( + MemberId id, + int64_t value) = 0; + + /*! + * Retrieves an \b uint64 value associated to an identifier. + * @param[inout] value \b uint64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint64_value( + uint64_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint64_value( + MemberId id, + uint64_t value) = 0; + + /*! + * Retrieves an \b float32 value associated to an identifier. + * @param[inout] value \b float32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float32_value( + float& value, + MemberId id) = 0; + + /*! + * Sets an \b float32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float32 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float32_value( + MemberId id, + float value) = 0; + + /*! + * Retrieves an \b float64 value associated to an identifier. + * @param[inout] value \b float64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float64_value( + double& value, + MemberId id) = 0; + + /*! + * Sets an \b float64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float64_value( + MemberId id, + double value) = 0; + + /*! + * Retrieves an \b float128 value associated to an identifier. + * @param[inout] value \b float128 to populate. + * @param[in] id Identifier of the member to query. + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float128_value( + long double& value, + MemberId id) = 0; + + /*! + * Sets an \b float128 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float128 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float128_value( + MemberId id, + long double value) = 0; + + /*! + * Retrieves an \b char8 value associated to an identifier. + * @param[inout] value \b char8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char8_value( + char& value, + MemberId id) = 0; + + /*! + * Sets an \b char8 value associated to an identifier + * @param[in] id Identifier of the member to set. + * @param[in] value \b char8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char8_value( + MemberId id, + char value) = 0; + + /*! + * Retrieves an \b char16 value associated to an identifier. + * @param[inout] value \b char16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char16_value( + wchar_t& value, + MemberId id) = 0; + + /*! + * Sets an \b char16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b char16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char16_value( + MemberId id, + wchar_t value) = 0; + + /*! + * Retrieves an \b byte value associated to an identifier. + * @param[inout] value \b byte to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) = 0; + + /*! + * Sets an \b byte value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b byte to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_byte_value( + MemberId id, + eprosima::fastrtps::rtps::octet value) = 0; + + /*! + * Retrieves an \b bool value associated to an identifier. + * @param[in] id Identifier of the member to query. + * @param[inout] value \b bool to populate. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_boolean_value( + bool& value, + MemberId id) = 0; + + /*! + * Sets an \b bool value associated to an identifier + * @param[in] id identifier of the member to set. + * @param[in] value \b bool to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_boolean_value( + MemberId id, + bool value) = 0; + + /*! + * Retrieves an \b string value associated to an identifier. + * @param[inout] value \b string to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_string_value( + std::string& value, + MemberId id) = 0; + + /*! + * Sets an \b string value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b string to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b string + * or the string length is greater than the string bound. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_string_value( + MemberId id, + const std::string& value) = 0; + + /*! + * Retrieves an \b wstring value associated to an identifier. + * @param[inout] value \b wstring to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_wstring_value( + std::wstring& value, + MemberId id) = 0; + + /*! + * Sets an \b wstring value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b wstring to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b wstring + * or the string length is greater than the string bound. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_wstring_value( + MemberId id, + const std::wstring& value) = 0; + + /*! + * Retrieves a \b complex value associated to an identifier. + * @param[inout] value @ref DynamicData reference to populate + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b complex. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_complex_value( + traits::ref_type& value, + MemberId id) = 0; + + /*! + * Sets a \b complex value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value @ref DynamicData reference to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the value reference is nil or @ref MemberId is invalid or the member type is + * not promotable to \b complex. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_complex_value( + MemberId id, + traits::ref_type value) = 0; + + /*! + * Retrieves a sequence of \b int32 values associated to an identifier. + * @param[inout] value \b Sequence of \b int32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int32_values( + Int32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int32_values( + MemberId id, + const Int32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint32 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint32_values( + UInt32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint32_values( + MemberId id, + const UInt32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int8 values associated to an identifier. + * @param[inout] value \b Sequence of \b int8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int8_values( + Int8Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int8_values( + MemberId id, + const Int8Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint8 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint8_values( + UInt8Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint8_values( + MemberId id, + const UInt8Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int16 values associated to an identifier. + * @param[inout] value \b Sequence of \b int16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int16_values( + Int16Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int16_values( + MemberId id, + const Int16Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint16 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint16_values( + UInt16Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint16_values( + MemberId id, + const UInt16Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int64 values associated to an identifier. + * @param[inout] value \b Sequence of \b int64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int64_values( + Int64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int64_values( + MemberId id, + const Int64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint64 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint64_values( + UInt64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint64_values( + MemberId id, + const UInt64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float32 values associated to an identifier. + * @param[inout] value \b Sequence of \b float32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float32_values( + Float32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float32_values( + MemberId id, + const Float32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float64 values associated to an identifier. + * @param[inout] value \b Sequence of \b float64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float64_values( + Float64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float64_values( + MemberId id, + const Float64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float128 values associated to an identifier. + * @param[inout] value \b Sequence of \b float128 to populate. + * @param[in] id Identifier of the member to query. + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b + * float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float128_values( + Float128Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float128 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float128 to set + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float128_values( + MemberId id, + const Float128Seq& value) = 0; + + /*! + * Retrieves a sequence of \b char8 values associated to an identifier. + * @param[inout] value \b Sequence of \b char8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char8_values( + CharSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b char8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b char8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char8_values( + MemberId id, + const CharSeq& value) = 0; + + /*! + * Retrieves a sequence of \b char16 values associated to an identifier. + * @param[inout] value \b Sequence of \b char16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char16_values( + WcharSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b char16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b char16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char16_values( + MemberId id, + const WcharSeq& value) = 0; + + /*! + * Retrieves a sequence of \b byte values associated to an identifier. + * @param[inout] value \b Sequence of \b byte to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_byte_values( + ByteSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b byte values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b byte to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_byte_values( + MemberId id, + const ByteSeq& value) = 0; + + /*! + * Retrieves a sequence of \b bool values associated to an identifier. + * @param[inout] value \b Sequence of \b bool to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_boolean_values( + BooleanSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b bool values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b bool to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_boolean_values( + MemberId id, + const BooleanSeq& value) = 0; + + /*! + * Retrieves a sequence of \b string values associated to an identifier. + * @param[inout] value \b Sequence of \b string to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_string_values( + StringSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b string values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b string to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_string_values( + MemberId id, + const StringSeq& value) = 0; + + /*! + * Retrieves a sequence of \b wstring values associated to an identifier. + * @param[inout] value \b Sequence of \b wstring to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_wstring_values( + WstringSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b wstring values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b wstring to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_wstring_values( + MemberId id, + const WstringSeq& value) = 0; + +protected: + + DynamicData() = default; + + virtual ~DynamicData() = default; + + traits::ref_type _this(); + +private: + + DynamicData( + const DynamicData&) = delete; + + DynamicData( + DynamicData&&) = delete; + + DynamicData& operator =( + const DynamicData&) = delete; + + DynamicData& operator =( + DynamicData&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp new file mode 100644 index 00000000000..688363347e8 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp @@ -0,0 +1,78 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicDataFactory : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the singleton factory object + * @remark This method is non thread-safe. + * @return @ref DynamicDataFactory reference. + */ + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); + + /*! + * Resets the singleton reference. + * @return @ref ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); + + /** + * Creates a new @ref DynamicData reference based on the given @ref DynamicType reference. + * All objects returned by this operation should eventually be deleted by calling delete_data. + * @param[in] type @ref DynamicType reference associated. + * @return new @ref DynamicData reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_data( + traits::ref_type type) = 0; + + /** + * Resets the internal reference if it is cached. + * @param[in] data @ref DynamicData reference whose internal cached reference to reset. + * @return standard ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if reference is nil. + * @retval RETCODE_OK is otherwise returned. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_data( + traits::ref_type& data) = 0; + +protected: + + virtual ~DynamicDataFactory() = default; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp new file mode 100644 index 00000000000..2b76b316162 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp @@ -0,0 +1,154 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; +class DynamicData; + +class DynamicPubSubType : public virtual eprosima::fastdds::dds::TopicDataType +{ + traits::ref_type dynamic_type_; + + unsigned char* key_buffer_ {nullptr}; + + MD5 md5_; + +public: + + //{{{ Public functions + + FASTDDS_EXPORTED_API DynamicPubSubType() = default; + + /* + * Constructs a @ref DynamicPubSubType from a @ref DynamicType + * @param type @ref DynamicType object associated to the data + * @remark Ownership is not transferred. + */ + FASTDDS_EXPORTED_API DynamicPubSubType( + traits::ref_type type); + + FASTDDS_EXPORTED_API virtual ~DynamicPubSubType(); + + /* + * Create a new data object of the specified type + * @return pointer to the new object + * @remark Ownership is transferred. This object must be removed using @ref deleteData + */ + FASTDDS_EXPORTED_API void* createData() override; + + /* + * Deletes an object previously allocated via @ref createData + * @param data pointer to the object to be deleted + * @remark Ownership is transferred. This object must be allocated using @ref createData + */ + FASTDDS_EXPORTED_API void deleteData ( + void* data) override; + + /* + * Deserialize an object from the given payload + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to parse + * @param data object to fill in with payload data + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool deserialize ( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + /* + * Returns a copy of the internal @ref DynamicType object + * @return pointer to the new object + */ + FASTDDS_EXPORTED_API traits::ref_type get_dynamic_type() const noexcept; + + /* + * Calculate the key associated to a given object + * @param data object whose key is calculated + * @param ihandle @ref eprosima::fastrtps::rtps::InstanceHandle_t to fill in + * @param force_md5 use always md5 even if key payload footprint is smaller than the hash + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + /* + * Provide a functor that calculates a specified object serialized size + * @param data object whose payload footprint to calculate + * @return functor that calculates the size + */ + // FASTDDS_TODO_BEFORE(3, 0, "Remove this overload") + FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( + void* data) override; + + FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) override; + + /* + * Serialize an object into a given payload + * @param data object to serialize + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to fill in + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + /* + * Serialize an object into a given payload + * @param data object to serialize + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to fill in + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + fastdds::dds::DataRepresentationId_t data_representation) override; + + /* + * Sets up the internal @ref DynamicType object + * @param @ref DynamicType to copy + * @return @ref ReturnCode_t with operation status + * @remark Ownership is not transferred. + */ + FASTDDS_EXPORTED_API ReturnCode_t set_dynamic_type( + traits::ref_type type); + + //}}} + +private: + + void update_dynamic_type(); +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp new file mode 100644 index 00000000000..f9082159f40 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp @@ -0,0 +1,191 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object (see [standard] 7.5.2.8.7) + * @param[inout] descriptor @ref TypeDescriptor reference where copied the information. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the fully qualified name of this type + * @return Type name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + + /*! + * Returns the @ref TypeKind associated + * @return @ref TypeKind + */ + FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0; + + /*! + * Returns the member that corresponds to the specified name. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @param[in] name Member name of the member being queried. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the member doesn't exist. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) = 0; + + /*! + * Returns all members by @ref ObjectName. + * @param[inout] member @ref DynamicTypeMembersByName reference where the information is copied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) = 0; + + /*! + * Returns the member that corresponds to the specified @ref MemberId. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @param[in] id @ref MemberId + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the member doesn't exist. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) = 0; + + /*! + * Returns all members by @ref MemberId. + * @param[inout] member @ref DynamicTypeMembersById reference where the information is copied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members( + DynamicTypeMembersById& member) = 0; + + /*! + * This operation returns the current number of members. + * @return Current number of members + */ + FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0; + + /** + * This operation returns the member that corresponds to the specified index. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @param[in] index Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) = 0; + + /*! + * Returns the number of applied annotations to the type. + * @return Number of annotations. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * Returns an applied annotation by index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Returns the number of applied verbatim text to the type. + * @return Number of verbatim texts. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; + + /*! + * Returns an applied verbatim text by index. + * @param[inout] descriptor @ref VerbatimTextDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.8.4 + * @param[in] other @ref DynamicType reference to compare to + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + +protected: + + DynamicType() = default; + + virtual ~DynamicType() = default; + + traits::ref_type _this(); + +private: + + DynamicType( + const DynamicType&) = delete; + + DynamicType( + DynamicType&&) = delete; + + DynamicType& operator =( + const DynamicType&) = delete; + + DynamicType& operator =( + DynamicType&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp new file mode 100644 index 00000000000..dcda644b415 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp @@ -0,0 +1,211 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeBuilder : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object. + * @param[inout] descriptor @ref TypeDescriptor + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the fully qualified name of this type + * @return Type name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + + /*! + * Returns the @ref TypeKind associated + * @return @ref TypeKind + */ + FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0; + + /*! + * Returns a member looked for by name. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] name Member name. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when member wasn't found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) = 0; + + /*! + * Returns all members sorted by name. + * @param[inout] member DynamicTypeMemberByName reference used to return all members. + * @return @ref ReturnCode_t + * @retval RETCODE_OK always. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) = 0; + /*! + * Returns a member looked for by @ref MemberId. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] id Member identifier. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when member wasn't found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) = 0; + + /*! + * Returns all members sorted by MemberId. + * @param[inout] member DynamicTypeMemberById reference used to return all members. + * @return @ref ReturnCode_t + * @retval RETCODE_OK always. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members( + DynamicTypeMembersById& member) = 0; + + /*! + * This operation returns the current number of members. + * @return Current number of members + */ + FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0; + + /*! + * This operation returns the member that corresponds to the specified index. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] index Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) = 0; + + /*! + * This operation returns the current number of annotations to the type. + * @return Current number of annotations + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * This operation returns the annotation that corresponds to the specified index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where information is copied. + * @param[in] idx Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Compares current state against a @ref DynamicType reference. + * @param[in] other @ref DynamicType reference to compare to. + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /*! + * Adds a 'member' to this type, where the new 'member' has the meaning defined in the specification of + * the DynamicTypeMember class. + * @param[in] descriptor @ref MemberDescriptor reference used for the new member. + * @return ReturnCode_t + * @retval RETCODE_OK when the member was created successfully. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + * @retval RETCODE_PRECONDITION_NOT_MET when the type does not have members. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t add_member( + traits::ref_type descriptor) = 0; + + /*! + * Apply the given annotation to this type. + * @param[in] descriptor @ref AnnotationDescriptor reference to be applied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the annotation was applied successful. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation( + traits::ref_type descriptor) = 0; + + /*! + * Apply the given annotation to a member of this type. + * @param[in] member_id Member identifier. + * @param[in] descriptor @ref AnnotationDescriptor reference to be applied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the annotation was applied successful. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation_to_member( + MemberId member_id, + traits::ref_type descriptor) = 0; + + /*! + * Create an immutable DynamicType object containing a snapshot of this builder's current state. + * @return @ref DynamicType reference. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type build() = 0; + +protected: + + DynamicTypeBuilder() = default; + + virtual ~DynamicTypeBuilder() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeBuilder( + const DynamicTypeBuilder&) = delete; + + DynamicTypeBuilder( + DynamicTypeBuilder&&) = delete; + + DynamicTypeBuilder& operator =( + const DynamicTypeBuilder&) = delete; + + DynamicTypeBuilder& operator =( + DynamicTypeBuilder&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp new file mode 100644 index 00000000000..dce68614534 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp @@ -0,0 +1,213 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP + +#include +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +namespace xtypes { +class TypeObject; +} // namespace xtypes + +class DynamicTypeBuilderFactory : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the singleton factory object + * @remark This method is non thread-safe. + * @return @ref DynamicTypeBuilderFactory reference. + */ + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); + + /*! + * Resets the singleton reference. + * @return @ref ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); + + /*! + * Retrieves the cached @ref DynamicType reference associated to a given primitive + * @param[in] kind Type identifying the primitive type to retrieve. + * @return @ref DynamicType reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type get_primitive_type( + TypeKind kind) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref TypeDescriptor state. + * @param[in] descriptor @ref TypeDescriptor to be copied. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type( + traits::ref_type descriptor) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref DynamicType reference. + * @param[in] type @ref DynamicType reference to be used. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_copy( + traits::ref_type type) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref xtypes::TypeObject instance. + * @param[in] type_object @ref xtypes::TypeObject instance to be used. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_type_object( + const xtypes::TypeObject& type_object) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bounded string type. + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the string type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference.. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_string_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bounded wstring type. + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the wstring type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference.. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_wstring_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a sequence. + * @param[in] element_type @ref DynamicType reference which becomes the element type + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the sequence type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_sequence_type( + traits::ref_type element_type, + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing an array. + * @param[in] element_type @ref DynamicType reference which becomes the element type + * @param[in] bound `uint32_t` sequence representing the desired dimensions. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_array_type( + traits::ref_type element_type, + const BoundSeq& bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a map. + * @param[in] key_element_type @ref DynamicType reference which becomes the map's key type + * @param[in] element_type @ref DynamicType reference which becomes the map's value type + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_map_type( + traits::ref_type key_element_type, + traits::ref_type element_type, + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bitmask + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_bitmask_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference by parsing the type description at the given URL. + * @remark Not implemented yet. + * @param[in] document_url pointing to the url containing the type description. + * @param[in] type_name Fully qualified name of the type to be loaded from the document. + * @param[in] include_paths A collection of URLs to directories to be searched for additional type description + * documents. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference by parsing the type description contained in the given string. + * @remark Not implemented yet. + * @param[in] document containing the type description. + * @param[in] type_name Fully qualified name of the type to be loaded from the string. + * @param[in] include_paths A collection of URLs to directories to be searched for additional type description + * documents. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) = 0; + + /*! + * Resets the internal reference if it is cached. + * @param[in] type @ref DynamicType reference whose internal cached reference to reset. + * @return standard ReturnCode_t + * @retval RETCODE_OK is always returned. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_type( + traits::ref_type type) = 0; + +protected: + + DynamicTypeBuilderFactory() = default; + + virtual ~DynamicTypeBuilderFactory() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeBuilderFactory( + const DynamicTypeBuilderFactory&) = delete; + + DynamicTypeBuilderFactory( + DynamicTypeBuilderFactory&&) = delete; + + DynamicTypeBuilderFactory& operator =( + const DynamicTypeBuilderFactory&) = delete; + + DynamicTypeBuilderFactory& operator =( + DynamicTypeBuilderFactory&&) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp new file mode 100644 index 00000000000..e1c3c9fadb9 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp @@ -0,0 +1,139 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +/*! + * Represents a "member" of a type. A "member" in this sense may be a member of an aggregated type, a constant within an + * enumeration, or some other type substructure. + */ +class DynamicTypeMember : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object (see [standard] 7.5.2.6.2) + * @param[inout] descriptor @ref MemberDescriptor reference where the information is copied. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the number of applied annotations to the member. + * @return Number of annotations. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * Returns an applied annotation by index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Returns the number of applied verbatim text to the member. + * @return Number of verbatim texts. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; + + /*! + * Returns an applied verbatim text by index. + * @param[inout] descriptor @ref VerbatimTextDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.6.3 + * @param[in] other @ref DynamicTypeMember reference to compare to + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /** + * Getter for @b id property according with the [standard] section \b 7.5.2.6.4 + * @return @ref MemberId + */ + FASTDDS_EXPORTED_API virtual MemberId get_id() = 0; + + /** + * Returns the name of this member. + * @return Member name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + +protected: + + DynamicTypeMember() = default; + + virtual ~DynamicTypeMember() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeMember( + const DynamicTypeMember&) = delete; + + DynamicTypeMember( + DynamicTypeMember&&) = delete; + + DynamicTypeMember& operator =( + const DynamicTypeMember&) = delete; + + DynamicTypeMember& operator =( + DynamicTypeMember&&) = delete; +}; + +typedef std::map::ref_type> DynamicTypeMembersByName; + +typedef std::map::ref_type> DynamicTypeMembersById; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp new file mode 100644 index 00000000000..9c6f7b111ee --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp @@ -0,0 +1,331 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP + +#include +#include +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +class FASTDDS_EXPORTED_API MemberDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the name of this member. + * @return Member's name. + */ + virtual ObjectName& name() = 0; + + /*! + * Returns the name of this member. + * @return Member's name. + */ + virtual const ObjectName& name() const = 0; + + /*! + * Modifies the underlying member's name by copy. + * @param[in] name Member's name. + */ + virtual void name( + const ObjectName& name) = 0; + + /*! + * Modifies the underlying member's name by move. + * @param[in] name Member's name. + */ + virtual void name( + ObjectName&& name) = 0; + + /*! + * Returns the @ref MemberId of the member. + * @return @ref MemberId. + */ + virtual MemberId id() const = 0; + + /*! + * Returns the @ref MemberId of the member. + * @return @ref MemberId. + */ + virtual MemberId& id() = 0; + + /*! + * Modifies the underlying @ref MemberId. + * @param[in] id @ref MemberId to be set. + */ + virtual void id( + MemberId id) = 0; + + /*! + * Returns a reference to the member's type. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type type() const = 0; + + /*! + * Returns a reference to the member's type. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& type() = 0; + + /*! + * Modifies the underlying member's type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void type( + traits::ref_type type) = 0; + + /*! + * Returns the default value. + * @return Default value. + */ + virtual std::string& default_value() = 0; + + /*! + * Returns the default value. + * @return Default value. + */ + virtual const std::string& default_value() const = 0; + + /*! + * Modifies the underlying default value by copy. + * @param[in] default_value Default value. + */ + virtual void default_value( + const std::string& default_value) = 0; + + /*! + * Modifies the underlying default value by move. + * @param[in] default_value Default value. + */ + virtual void default_value( + std::string&& default_value) = 0; + + /*! + * Returns the order of definition of the member. + * @return Order of definition. + */ + virtual uint32_t& index() = 0; + + /*! + * Returns the order of definition of the member. + * @return Order of definition. + */ + virtual uint32_t index() const = 0; + + /*! + * Returns the labels the member belongs to. + * @return @ref UnionCaseLabelSeq. + */ + virtual const UnionCaseLabelSeq& label() const = 0; + + /*! + * Returns the labels the member belongs to. + * @return @ref UnionCaseLabelSeq. + */ + virtual UnionCaseLabelSeq& label() = 0; + + /*! + * Modifies the labels the member belongs to by copy. + * @param[in] label @ref UnionCaseLabelSeq + */ + virtual void label( + const UnionCaseLabelSeq& label) = 0; + + /*! + * Modifies the labels the member belongs to by move. + * @param[in] label @ref UnionCaseLabelSeq + */ + virtual void label( + UnionCaseLabelSeq&& label) = 0; + + /*! + * Returns the @ref TryConstructKind of the member. + * @return @ref TryConstructKind. + */ + virtual TryConstructKind try_construct_kind() const = 0; + + /*! + * Returns the @ref TryConstructKind of the member. + * @return @ref TryConstructKind. + */ + virtual TryConstructKind& try_construct_kind() = 0; + + /*! + * Modifies the @ref TryConstructKind of the member. + * @param[in] try_construct_kind @ref TryConstructKind. + */ + virtual void try_construct_kind( + TryConstructKind try_construct_kind) = 0; + + /*! + * Returns the if the member is key. + * @return If the member is key. + */ + virtual bool is_key() const = 0; + + /*! + * Returns the if the member is key. + * @return If the member is key. + */ + virtual bool& is_key() = 0; + + /*! + * Modifies if the member is key. + * @param[in] is_key Boolean + */ + virtual void is_key( + bool is_key) = 0; + + /*! + * Returns the if the member is optional. + * @return If the member is optional. + */ + virtual bool is_optional() const = 0; + + /*! + * Returns the if the member is optional. + * @return If the member is optional. + */ + virtual bool& is_optional() = 0; + + /*! + * Modifies if the member is optional. + * @param[in] is_optional Boolean + */ + virtual void is_optional( + bool is_optional) = 0; + + /*! + * Returns the if the member is must_understand. + * @return If the member is must_understand. + */ + virtual bool is_must_understand() const = 0; + + /*! + * Returns the if the member is must_understand. + * @return If the member is must_understand. + */ + virtual bool& is_must_understand() = 0; + + /*! + * Modifies if the member is must_understand. + * @param[in] is_must_understand Boolean + */ + virtual void is_must_understand( + bool is_must_understand) = 0; + + /*! + * Returns the if the member is shared. + * @return If the member is shared. + */ + virtual bool is_shared() const = 0; + + /*! + * Returns the if the member is shared. + * @return If the member is shared. + */ + virtual bool& is_shared() = 0; + + /*! + * Modifies if the member is shared. + * @param[in] is_shared Boolean + */ + virtual void is_shared( + bool is_shared) = 0; + + /*! + * Returns the if the member is default_label. + * @return If the member is default_label. + */ + virtual bool is_default_label() const = 0; + + /*! + * Returns the if the member is default_label. + * @return If the member is default_label. + */ + virtual bool& is_default_label() = 0; + + /*! + * Modifies if the member is default_label. + * @param[in] is_default_label Boolean + */ + virtual void is_default_label( + bool is_default_label) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.7.1). + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares according with the [standard] section \b 7.5.2.7.4. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.7.7. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + MemberDescriptor() = default; + + MemberDescriptor( + const MemberDescriptor& type) = default; + + MemberDescriptor( + MemberDescriptor&& type) = default; + + virtual ~MemberDescriptor() = default; + +private: + + MemberDescriptor& operator =( + const MemberDescriptor& type) = delete; + + MemberDescriptor& operator =( + MemberDescriptor&& type) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp new file mode 100644 index 00000000000..b7a5b10b6d7 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp @@ -0,0 +1,274 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +/*! + * TypeDescriptor definition according to [standard] section \b 7.5.2.4. + */ +class FASTDDS_EXPORTED_API TypeDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the @ref TypeKind associated. + * @return standard @ref TypeKind. + */ + virtual TypeKind kind() const = 0; + + /*! + * Returns the @ref TypeKind associated. + * @return standard @ref TypeKind. + */ + virtual TypeKind& kind() = 0; + + /*! + * Modifies the underlying @ref TypeKind. + * @param[in] kind @ref TypeKind to be set. + */ + virtual void kind( + TypeKind kind) = 0; + + /*! + * Returns the fully qualified name of this type. + * @return Fully qualified name. + */ + virtual ObjectName& name() = 0; + + /*! + * Returns the fully qualified name of this type. + * @return Fully qualified name. + */ + virtual const ObjectName& name() const = 0; + + /*! + * Modifies the underlying type name by copy. + * @param[in] name Fully qualified name. + */ + virtual void name( + const ObjectName& name) = 0; + + /*! + * Modifies the underlying type name by move. + * @param[in] name Fully qualified name. + */ + virtual void name( + ObjectName&& name) = 0; + + /*! + * Returns a reference to the base type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type base_type() const = 0; + + /*! + * Returns a reference to the base type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& base_type() = 0; + + /*! + * Modifies the underlying base type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void base_type( + traits::ref_type type) = 0; + + /*! + * Returns a reference discriminator type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type discriminator_type() const = 0; + + /*! + * Returns a reference discriminator type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& discriminator_type() = 0; + + /*! + * Modifies the underlying discriminator type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void discriminator_type( + traits::ref_type type) = 0; + + /*! + * Returns the bound. + * @return @ref BoundSeq. + */ + virtual const BoundSeq& bound() const = 0; + + /*! + * Returns the bound. + * @return @ref BoundSeq. + */ + virtual BoundSeq& bound() = 0; + + /*! + * Modifies the underlying bound by copy. + * @param[in] bound @ref BoundSeq + */ + virtual void bound( + const BoundSeq& bound) = 0; + + /*! + * Modifies the underlying bound by move. + * @param[in] bound @ref BoundSeq + */ + virtual void bound( + BoundSeq&& bound) = 0; + + /*! + * Returns a reference element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type element_type() const = 0; + + /*! + * Returns a reference element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& element_type() = 0; + + /*! + * Modifies the underlying element type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void element_type( + traits::ref_type type) = 0; + + /*! + * Returns a reference key element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type key_element_type() const = 0; + + /*! + * Returns a reference key element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& key_element_type() = 0; + + /*! + * Modifies the underlying key element type reference. + * @param[in] type @ref DynamicType reference. + */ + virtual void key_element_type( + traits::ref_type type) = 0; + + + /*! + * Returns the extensibility kind. + * return @ref ExtensibilityKind + */ + virtual ExtensibilityKind extensibility_kind() const = 0; + + /*! + * Returns the extensibility kind. + * return @ref ExtensibilityKind + */ + virtual ExtensibilityKind& extensibility_kind() = 0; + + /*! + * Modifies the extensibility kind. + * @param[in] extensibility_kind @ref ExtensibilityKind + */ + virtual void extensibility_kind( + ExtensibilityKind extensibility_kind) = 0; + + /*! + * Returns the is_nested property. + * return Boolean + */ + virtual bool is_nested() const = 0; + + /*! + * Returns the is_nested property. + * return Boolean + */ + virtual bool& is_nested() = 0; + + /*! + * Modifies the is_nested property. + * @param[in] is_nested Boolean value to be set. + */ + virtual void is_nested( + bool is_nested) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.4.3). + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares according with the [standard] section \b 7.5.2.4.6. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.4.7. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + TypeDescriptor() = default; + + TypeDescriptor( + const TypeDescriptor& type) = default; + + TypeDescriptor( + TypeDescriptor&& type) = default; + + virtual ~TypeDescriptor() = default; + +private: + + TypeDescriptor& operator =( + const TypeDescriptor& type) = delete; + + TypeDescriptor& operator =( + TypeDescriptor&& type) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/Types.hpp b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp new file mode 100644 index 00000000000..544fa49427a --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp @@ -0,0 +1,83 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Types.hpp + */ + +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ + +#include "detail/dynamic_language_binding.hpp" +#include "type_traits.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +constexpr MemberId MEMBER_ID_INVALID {0x0FFFFFFF}; + +class DynamicData; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicData; +}; + +class DynamicDataFactory; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicDataFactory; +}; + +class DynamicType; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicType; +}; + +class DynamicTypeBuilder; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeBuilder; +}; + +class DynamicTypeBuilderFactory; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeBuilderFactory; +}; + +class DynamicTypeMember; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeMember; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ diff --git a/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp new file mode 100644 index 00000000000..7b38ccf8b31 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp @@ -0,0 +1,133 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class FASTDDS_EXPORTED_API VerbatimTextDescriptor +{ +public: + + /*! + * Returns the location within the generated output at which the output text should be inserted. + * @return The location. + */ + virtual std::string& placement() = 0; + + /*! + * Returns the location within the generated output at which the output text should be inserted. + * @return The location. + */ + virtual const std::string& placement() const = 0; + + /*! + * Sets the location within the generated output at which the output text should be inserted. + * @param[in] placement The location. + */ + virtual void placement( + const std::string& placement) = 0; + + /*! + * Sets the location within the generated output at which the output text should be inserted. + * @param[in] placement The location. + */ + virtual void placement( + std::string&& placement) = 0; + + /*! + * Returns the literal output text. + * @return The text. + */ + virtual std::string& text() = 0; + + /*! + * Returns the literal output text. + * @return The text. + */ + virtual const std::string& text() const = 0; + + /*! + * Sets the literal output text. + * @param[in] text The text. + */ + virtual void text( + const std::string& text) = 0; + + /*! + * Sets the literal output text. + * @param[in] text The text. + */ + virtual void text( + std::string&& text) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor. + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + VerbatimTextDescriptor() = default; + + VerbatimTextDescriptor( + const VerbatimTextDescriptor& type) = default; + + VerbatimTextDescriptor( + VerbatimTextDescriptor&& type) = default; + + virtual ~VerbatimTextDescriptor() = default; + +private: + + VerbatimTextDescriptor& operator =( + const VerbatimTextDescriptor& type) = delete; + + VerbatimTextDescriptor& operator =( + VerbatimTextDescriptor&& type) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp new file mode 100644 index 00000000000..fb0d0fdea46 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp @@ -0,0 +1,170 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dynamic_language_binding.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ +#define _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ + +#include +#include +#include +#include +#include + +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DYNAMIC_LANGUAGE_BINDING_SOURCE) +#define DYNAMIC_LANGUAGE_BINDING_DllAPI __declspec( dllexport ) +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI __declspec( dllimport ) +#endif // DYNAMIC_LANGUAGE_BINDING_SOURCE +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef std::vector IncludePathSeq; + +typedef eprosima::fastcdr::fixed_string<256> ObjectName; + +typedef std::vector BoundSeq; + +typedef uint8_t TypeKind; + +const TypeKind TK_NONE = 0x00; +const TypeKind TK_BOOLEAN = 0x01; +const TypeKind TK_BYTE = 0x02; +const TypeKind TK_INT16 = 0x03; +const TypeKind TK_INT32 = 0x04; +const TypeKind TK_INT64 = 0x05; +const TypeKind TK_UINT16 = 0x06; +const TypeKind TK_UINT32 = 0x07; +const TypeKind TK_UINT64 = 0x08; +const TypeKind TK_FLOAT32 = 0x09; +const TypeKind TK_FLOAT64 = 0x0A; +const TypeKind TK_FLOAT128 = 0x0B; +const TypeKind TK_INT8 = 0x0C; +const TypeKind TK_UINT8 = 0x0D; +const TypeKind TK_CHAR8 = 0x10; +const TypeKind TK_CHAR16 = 0x11; +const TypeKind TK_STRING8 = 0x20; +const TypeKind TK_STRING16 = 0x21; +const TypeKind TK_ALIAS = 0x30; +const TypeKind TK_ENUM = 0x40; +const TypeKind TK_BITMASK = 0x41; +const TypeKind TK_ANNOTATION = 0x50; +const TypeKind TK_STRUCTURE = 0x51; +const TypeKind TK_UNION = 0x52; +const TypeKind TK_BITSET = 0x53; +const TypeKind TK_SEQUENCE = 0x60; +const TypeKind TK_ARRAY = 0x61; +const TypeKind TK_MAP = 0x62; +typedef std::map Parameters; + +/*! + * @brief This class represents the enumeration ExtensibilityKind defined by the user in the IDL file. + * @ingroup dynamic_language_binding + */ +enum class ExtensibilityKind : uint32_t +{ + FINAL, + APPENDABLE, + MUTABLE +}; +/*! + * @brief This class represents the enumeration TryConstructKind defined by the user in the IDL file. + * @ingroup dynamic_language_binding + */ +enum class TryConstructKind : uint32_t +{ + USE_DEFAULT, + DISCARD, + TRIM +}; +typedef uint32_t MemberId; + +typedef std::vector UnionCaseLabelSeq; + +typedef std::vector Int32Seq; + +typedef std::vector UInt32Seq; + +typedef std::vector Int8Seq; + +typedef std::vector UInt8Seq; + +typedef std::vector Int16Seq; + +typedef std::vector UInt16Seq; + +typedef std::vector Int64Seq; + +typedef std::vector UInt64Seq; + +typedef std::vector Float32Seq; + +typedef std::vector Float64Seq; + +typedef std::vector Float128Seq; + +typedef std::vector CharSeq; + +typedef std::vector WcharSeq; + +typedef std::vector BooleanSeq; + +typedef std::vector ByteSeq; + +typedef std::vector StringSeq; + +typedef std::vector WstringSeq; + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ + + diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl new file mode 100644 index 00000000000..c36032ad8db --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl @@ -0,0 +1,89 @@ +// The content of this file, was extracted from DDS-XTypes v1.3 standard. + +module DDS +{ + typedef sequence IncludePathSeq; + typedef string<256> ObjectName; + + // Inserted until defined in standard. + typedef sequence BoundSeq; + + // ---------- TypeKinds (begin) ------------------- + typedef octet TypeKind; + + // Primitive TKs + const TypeKind TK_NONE= 0x00; + const TypeKind TK_BOOLEAN= 0x01; + const TypeKind TK_BYTE= 0x02; + const TypeKind TK_INT16= 0x03; + const TypeKind TK_INT32= 0x04; + const TypeKind TK_INT64= 0x05; + const TypeKind TK_UINT16= 0x06; + const TypeKind TK_UINT32= 0x07; + const TypeKind TK_UINT64= 0x08; + const TypeKind TK_FLOAT32= 0x09; + const TypeKind TK_FLOAT64= 0x0A; + const TypeKind TK_FLOAT128= 0x0B; + const TypeKind TK_INT8= 0x0C; + const TypeKind TK_UINT8= 0x0D; + const TypeKind TK_CHAR8= 0x10; + const TypeKind TK_CHAR16= 0x11; + + // String TKs + const TypeKind TK_STRING8= 0x20; + const TypeKind TK_STRING16= 0x21; + + // Constructed/Named types + const TypeKind TK_ALIAS = 0x30; + + // Enumerated TKs + const TypeKind TK_ENUM= 0x40; + const TypeKind TK_BITMASK= 0x41; + + // Structured TKs + const TypeKind TK_ANNOTATION = 0x50; + const TypeKind TK_STRUCTURE= 0x51; + const TypeKind TK_UNION= 0x52; + const TypeKind TK_BITSET= 0x53; + + // Collection TKs + const TypeKind TK_SEQUENCE= 0x60; + const TypeKind TK_ARRAY= 0x61; + const TypeKind TK_MAP= 0x62; + // ---------- TypeKinds (end) ------------------- + + typedef map Parameters; + + enum ExtensibilityKind { + FINAL, + APPENDABLE, + MUTABLE + }; + + enum TryConstructKind { + USE_DEFAULT, + DISCARD, + TRIM + }; + + typedef unsigned long MemberId; + typedef sequence UnionCaseLabelSeq; + + typedef sequenceInt32Seq; + typedef sequenceUInt32Seq; + typedef sequenceInt8Seq; + typedef sequenceUInt8Seq; + typedef sequenceInt16Seq; + typedef sequenceUInt16Seq; + typedef sequenceInt64Seq; + typedef sequenceUInt64Seq; + typedef sequenceFloat32Seq; + typedef sequenceFloat64Seq; + typedef sequenceFloat128Seq; + typedef sequenceCharSeq; + typedef sequenceWcharSeq; + typedef sequenceBooleanSeq; + typedef sequenceByteSeq; + typedef sequenceStringSeq; + typedef sequenceWstringSeq; +}; diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp new file mode 100644 index 00000000000..d3b4dbddd39 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp @@ -0,0 +1,65 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +template +struct traits +{ + using ref_type = typename ::std::shared_ptr; + using weak_ref_type = typename ::std::weak_ptr; + + template::value>::type> + inline static std::shared_ptr<_Tp> narrow ( + ref_type obj) + { + return std::dynamic_pointer_cast<_Tp>(obj); + } + + FASTDDS_EXPORTED_API static std::shared_ptr make_shared(); + +}; + +template +struct object_traits +{ + using ref_type = typename ::std::shared_ptr; + using weak_ref_type = typename ::std::weak_ptr; + + template::value>::type> + inline static std::shared_ptr<_Tp> narrow ( + ref_type obj) + { + return std::dynamic_pointer_cast<_Tp>(obj); + } + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ + diff --git a/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp b/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp new file mode 100644 index 00000000000..5ce20f7cda8 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp @@ -0,0 +1,34 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ + +namespace eprosima { +namespace fastdds { +namespace dds { + +template +struct traits; + +template +struct object_traits; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#include "detail/type_traits.hpp" + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ diff --git a/include/fastdds/dds/xtypes/exception/Exception.hpp b/include/fastdds/dds/xtypes/exception/Exception.hpp new file mode 100644 index 00000000000..31d15ffc2c7 --- /dev/null +++ b/include/fastdds/dds/xtypes/exception/Exception.hpp @@ -0,0 +1,79 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file is based on the DDS-PSM-CXX Exception.hpp file. + */ + +#ifndef _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ +#define _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ + +#include +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +/** + * @brief Exception: base class for specified DDS Exceptions. + */ +class Exception +{ +protected: + + Exception() = default; + +public: + + FASTDDS_EXPORTED_API virtual ~Exception() throw() = default; + + /** + * @brief Retrieve information about the exception that was thrown. + * + * @return Exception information. + */ + FASTDDS_EXPORTED_API virtual const char* what() const throw() = 0; + +}; + +/** + * @brief Application is passing an invalid argument. + */ +class InvalidArgumentError : public Exception, public std::invalid_argument +{ +public: + + FASTDDS_EXPORTED_API explicit InvalidArgumentError( + const std::string& msg); + + FASTDDS_EXPORTED_API InvalidArgumentError( + const InvalidArgumentError& src); + + FASTDDS_EXPORTED_API virtual ~InvalidArgumentError() throw(); + + FASTDDS_EXPORTED_API virtual const char* what() const throw(); + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ diff --git a/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp b/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp new file mode 100644 index 00000000000..287ce381f90 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp @@ -0,0 +1,144 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file contains the required classes to keep a TypeObject/TypeIdentifier registry. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +namespace xtypes { + +struct TypeObjectPair +{ + // Minimal TypeObject + TypeObject minimal_type_object; + // Complete TypeObject + TypeObject complete_type_object; +}; + +class ITypeObjectRegistry +{ +public: + + /** + * @brief Register a local TypeObject. + * The MinimalTypeObject is generated from the CompleteTypeObject, and both are registered into the registry + * with the corresponding TypeIdentifiers and TypeObject serialized sizes. + * + * @pre type_name must not be empty. + * @pre complete_type_object must be consistent (only checked in Debug build mode). + * + * @param[in] type_name Name of the type being registered. + * @param[in] complete_type_object CompleteTypeObject related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with the + * given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given type_name is empty or if the type_object + * is inconsistent. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t register_type_object( + const std::string& type_name, + const CompleteTypeObject& complete_type_object) = 0; + + /** + * @brief Register an indirect hash TypeIdentifier. + * + * @pre TypeIdentifier must not be a direct hash TypeIdentifier. + * @pre TypeIdentifier must be consistent (only checked in Debug build mode). + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being registered. + * @param[in] type_identifier TypeIdentier related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given TypeIdentifier is inconsistent or a direct hash + * TypeIdentifier or if the given type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t register_type_identifier( + const std::string& type_name, + const TypeIdentifier& type_identifier) = 0; + + /** + * @brief Get the TypeObjects related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_objects Both complete and minimal TypeObjects related with the given type_name. + * @return ReturnCode_t RETCODE_OK if the TypeObjects are found in the registry. + * RETCODE_NO_DATA if the given type_name has not been registered. + * RETCODE_BAD_PARAMETER if the type_name correspond to a indirect hash TypeIdentifier. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_objects( + const std::string& type_name, + TypeObjectPair& type_objects) = 0; + + /** + * @brief Get the TypeIdentifiers related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_identifiers For direct hash TypeIdentifiers, both minimal and complete TypeIdentifiers are + * returned. + * For indirect hash TypeIdentifiers, only the corresponding TypeIdentifier is returned + * @return ReturnCode_t RETCODE_OK if the TypeIdentifiers are found in the registry. + * RETCODE_NO_DATA if the type_name has not been registered. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_identifiers( + const std::string& type_name, + TypeIdentifierPair& type_identifiers) = 0; + + /** + * @brief Get the TypeObject related to the given TypeIdentifier. + * + * @pre TypeIdentifier must be a direct hash TypeIdentifier. + * + * @param[in] type_identifier TypeIdentifier being queried. + * @param[out] type_object TypeObject related with the given TypeIdentifier. + * @return ReturnCode_t RETCODE_OK if the TypeObject is found within the registry. + * RETCODE_NO_DATA if the given TypeIdentifier is not found in the registry. + * RETCODE_PRECONDITION_NOT_MET if the TypeIdentifier is not a direct hash. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_object( + const TypeIdentifier& type_identifier, + TypeObject& type_object) = 0; + +}; + + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ + + diff --git a/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp b/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp new file mode 100644 index 00000000000..3be6383ca03 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp @@ -0,0 +1,30 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeObject.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ + +#include +#include +#include + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ + diff --git a/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp b/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp new file mode 100644 index 00000000000..960bd72b36a --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp @@ -0,0 +1,3056 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file contains static functions to help build a TypeObject. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeBuilderFactoryImpl; + +namespace xtypes { + +class TypeObjectRegistry; + +using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; + +class TypeObjectUtils +{ +public: + + /** + * @brief Build TypeObjectHashId instance. + * + * @param[in] discriminator TypeObjectHashId discriminator to be set. + * @param[in] hash StronglyConnectedComponent equivalence hash to be set. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given discriminator is not + * EK_COMPLETE/EK_MINIMAL. + * @return const TypeObjectHashId instance. + */ + FASTDDS_EXPORTED_API static const TypeObjectHashId build_type_object_hash_id( + uint8_t discriminator, + const EquivalenceHash& hash); + + /** + * @brief Build CollectionElementFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] external external annotation value. + * @return CollectionElementFlag instance. + */ + FASTDDS_EXPORTED_API static CollectionElementFlag build_collection_element_flag( + TryConstructKind try_construct_kind, + bool external); + + /** + * @brief Build StructMemberFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] optional optional annotation value. + * @param[in] must_understand must_understand annotation value. + * @param[in] key key annotation value. + * @param[in] external external annotation value. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if both key and optional flags are + * enabled. + * @return StructMemberFlag instance. + */ + FASTDDS_EXPORTED_API static StructMemberFlag build_struct_member_flag( + TryConstructKind try_construct_kind, + bool optional, + bool must_understand, + bool key, + bool external); + + /** + * @brief Build UnionMemberFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] default_member is default member. + * @param[in] external external annotation value. + * @return UnionMemberFlag instance. + */ + FASTDDS_EXPORTED_API static UnionMemberFlag build_union_member_flag( + TryConstructKind try_construct_kind, + bool default_member, + bool external); + + /** + * @brief Build UnionDiscriminatorFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] key key annotation value. + * @return UnionDiscriminatorFlag instance. + */ + FASTDDS_EXPORTED_API static UnionDiscriminatorFlag build_union_discriminator_flag( + TryConstructKind try_construct_kind, + bool key); + + /** + * @brief Build EnumeratedLiteralFlag instance. + * + * @param[in] default_literal default_literal annotation value. + * @return EnumeratedLiteralFlag instance. + */ + FASTDDS_EXPORTED_API static EnumeratedLiteralFlag build_enumerated_literal_flag( + bool default_literal); + + /** + * AnnotationParameterFlag: Unused. No flags apply. + * AliasMemberFlag: Unused. No flags apply. + * BitflagFlag: Unused. No flags apply. + * BitsetMemberFlag: Unused. No flags apply. + */ + + /** + * @brief Build StructTypeFlag instance. + * + * @param[in] extensibility_kind extensibility annotation value. + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + * @return StructTypeFlag instance. + */ + FASTDDS_EXPORTED_API static StructTypeFlag build_struct_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * @brief Build UnionTypeFlag instance. + * + * @param[in] extensibility_kind extensibility annotation value. + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + * @return UnionTypeFlag instance. + */ + FASTDDS_EXPORTED_API static UnionTypeFlag build_union_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * CollectionTypeFlag: Unused. No flags apply. + * AnnotationTypeFlag: Unused. No flags apply. + * AliasTypeFlag: Unused. No flags apply. + * EnumTypeFlag: Unused. No flags apply. + * BitmaskTypeFlag: Unused. No flags apply. + * BitsetTypeFlag: Unused. No flags apply. + */ + + /*************** Indirect Hash TypeIdentifiers ***************************/ + + /** + * @brief Build StringSTypeDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @param[in] bound Bound for the small string/wstring. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if bound is 0. + * @return const StringSTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const StringSTypeDefn build_string_s_type_defn( + SBound bound); + + /** + * @brief Build StringLTypeDefn instance. + * + * @pre bound > 255 + * @param[in] bound Bound for the large string/wstring. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if bound is lower than 256. + * @return const StringLTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const StringLTypeDefn build_string_l_type_defn( + LBound bound); + + /** + * @brief Build PlainCollectionHeader instance. + * + * @param[in] equiv_kind EquivalenceKind: EK_MINIMAL/EK_COMPLETE/EK_BOTH + * @param[in] element_flags CollectionElementFlags to be set. This element must be constructed with the corresponding + * builder to ensure its consistency. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError if the given element_flags are inconsistent. + * This exception is only thrown in Debug build mode. + * @return const PlainCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const PlainCollectionHeader build_plain_collection_header( + EquivalenceKind equiv_kind, + CollectionElementFlag element_flags); + + /** + * @brief Build PlainSequenceSElemDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] s_bound Sequence bound. + * @param[in] element_identifier Sequence element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. The given bound is 0. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainSequenceSElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainSequenceSElemDefn build_plain_sequence_s_elem_defn( + const PlainCollectionHeader& header, + SBound s_bound, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainSequenceLElemDefn instance. + * + * @pre bound > 255 + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] l_bound Sequence bound. + * @param[in] element_identifier Sequence element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. Bound lower than 256. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainSequenceLElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainSequenceLElemDefn build_plain_sequence_l_elem_defn( + const PlainCollectionHeader& header, + LBound l_bound, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Add dimension bound to the array bound sequence. + * + * @tparam array Either a SBoundSeq or LBoundSeq. + * @tparam element Either a SBound or LBound. + * @param[in out] array_bound_seq Sequence with the array bounds. + * @param[in] dimension_bound Dimension bound to be added into the sequence. + */ + template + static void add_array_dimension( + std::vector& array_bound_seq, + element dimension_bound) + { + if (dimension_bound == INVALID_LBOUND) + { + throw InvalidArgumentError("bound parameter must be greater than 0"); + } + array_bound_seq.push_back(dimension_bound); + } + + /** + * @brief Build PlainArraySElemDefn instance. + * + * @pre Any element in array_bound_seq must be greater than 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] array_bound_seq Bounds for the array dimensions. + * @param[in] element_identifier Array element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. Any given bound in array_bound_seq is 0. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainArraySElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainArraySElemDefn build_plain_array_s_elem_defn( + const PlainCollectionHeader& header, + const SBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainArrayLElemDefn instance. + * + * @pre At least one element of array_bound_seq must be greater than 255 and no element must be 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] array_bound_seq Bounds for the array dimensions. + * @param[in] element_identifier Array element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. Any given bound in array_bound_seq is 0. + * 2. There is no dimension with a bound greater than 255. + * 3. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 4. Inconsistent header (only in Debug build mode). + * 5. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainArrayLElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainArrayLElemDefn build_plain_array_l_elem_defn( + const PlainCollectionHeader& header, + const LBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainMapSTypeDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @pre Both element_identifier and key_identifier have been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Map bound. + * @param[in] element_identifier Map element TypeIdentifier. + * @param[in] key_flags Flags applying to map key. + * @param[in] key_identifier Map key TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. Given bound is zero (INVALID_SBOUND) + * 2. Inconsistent element_identifier EquivalenceKind with the one contained in the header. + * 3. Direct hash key_identifier or indirect hash TypeIdentifier with exception to string/wstring. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements + * of signed and unsigned integer types and of narrow and wide string types. + * 4. Inconsistent key_flags. + * 5. Inconsistent header (only in Debug build mode). + * 6. Inconsistent element_identifier or key_identifier (only in Debug build mode). + * @return const PlainMapSTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainMapSTypeDefn build_plain_map_s_type_defn( + const PlainCollectionHeader& header, + const SBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier); + + /** + * @brief Build PlainMapLTypeDefn instance. + * + * @pre bound > 255 + * @pre Both element_identifier and key_identifier have been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Map bound. + * @param[in] element_identifier Map element TypeIdentifier. + * @param[in] key_flags Flags applying to map key. + * @param[in] key_identifier Map key TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception + * 1. Given bound is lower than 256 + * 2. Inconsistent element_identifier EquivalenceKind with the one contained in the header. + * 3. Direct hash key_identifier or indirect hash TypeIdentifier with exception to string/wstring. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements + * of signed and unsigned integer types and of narrow and wide string types. + * 4. Inconsistent key_flags. + * 5. Inconsistent header (only in Debug build mode). + * 6. Inconsistent element_identifier or key_identifier (only in Debug build mode). + * @return const PlainMapLTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainMapLTypeDefn build_plain_map_l_type_defn( + const PlainCollectionHeader& header, + const LBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier); + + /** + * @brief Build StronglyConnectedComponentId instance. + * + * @param[in] sc_component_id Strongly Connected Component (SCC) ID. + * @param[in] scc_length Number of components within SCC. + * @param[in] scc_index Identify specific component within SCC. + * @return const StronglyConnectedComponentId instance. + */ + FASTDDS_EXPORTED_API static const StronglyConnectedComponentId build_strongly_connected_component_id( + const TypeObjectHashId& sc_component_id, + int32_t scc_length, + int32_t scc_index); + + /** + * @brief Build ExtendedTypeDefn instance (empty. Available for future extension). + * + * @return const ExtendedTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const ExtendedTypeDefn build_extended_type_defn(); + + /*************** Register Indirect Hash TypeIdentifiers ***************************/ + /** + * Primitive types are registered when TypeObjectRegistry is instantiated. + */ + + /** + * @brief Register small string/wstring TypeIdentifier into TypeObjectRegistry. + * + * @param[in] string StringSTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @param[in] wstring Flag to build a wstring. Default false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_string_type_identifier( + const StringSTypeDefn& string, + const std::string& type_name, + bool wstring = false); + + /** + * @brief Register large string/wstring TypeIdentifier into TypeObjectRegistry. + * + * @param[in] string StringLTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @param[in] wstring Flag to build a wstring. Default false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_string_type_identifier( + const StringLTypeDefn& string, + const std::string& type_name, + bool wstring = false); + + /** + * @brief Register small sequence TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_seq PlainSequenceSElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_sequence_type_identifier( + const PlainSequenceSElemDefn& plain_seq, + const std::string& type_name); + + /** + * @brief Register large sequence TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_seq PlainSequenceLElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_sequence_type_identifier( + const PlainSequenceLElemDefn& plain_seq, + const std::string& type_name); + + /** + * @brief Register small array TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_array PlainArraySElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_array_type_identifier( + const PlainArraySElemDefn& plain_array, + const std::string& type_name); + + /** + * @brief Register large array TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_array PlainArrayLElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_array_type_identifier( + const PlainArrayLElemDefn& plain_array, + const std::string& type_name); + + /** + * @brief Register small map TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_map PlainMapSTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_map_type_identifier( + const PlainMapSTypeDefn& plain_map, + const std::string& type_name); + + /** + * @brief Register large map TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_map PlainMapLTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_map_type_identifier( + const PlainMapLTypeDefn& plain_map, + const std::string& type_name); + + /** + * @brief Register StronglyConnectedComponent TypeIdentifier into TypeObjectRegistry. + * + * @param[in] scc StronglyConnectedComponent union member to set. + * @param[in] type_name Type name to be registered. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_scc_type_identifier( + const StronglyConnectedComponentId& scc, + const std::string& type_name); + + /*************** Annotation usage ***************************/ + /** + * @brief Build ExtendedAnnotationParameterValue instance (empty. Available for future extension). + * + * @return const ExtendedAnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const ExtendedAnnotationParameterValue build_extended_annotation_parameter_value(); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] boolean_value Boolean value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + bool boolean_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] byte_value Byte value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value_byte( + uint8_t byte_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int8_value Int8 value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int8_t int8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint8_value Unsigned int8 value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint8_t uint8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int16_value Short value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int16_t int16_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint16_value Unsigned short value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint16_t uint16_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int32_value Long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int32_t int32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint32_value Unsigned long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint32_t uint32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int64_value Long long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int64_t int64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint64_value Unsigned long long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint64_t uint64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float32_value Float value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + float float32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float64_value Double value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + double float64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float128_value Long double value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + long double float128_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] char_value Char value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + char char_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] wchar_value Wide char value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + wchar_t wchar_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] enumerated_value Enumerated value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value_enum( + int32_t enumerated_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] string8_value String value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + const eprosima::fastcdr::fixed_string<128>& string8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] string16_value Wide string value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + const std::wstring& string16_value); + + /** + * @brief Build AppliedAnnotationParameter instance. + * + * @param[in] paramname_hash Parameter name hash. + * @param[in] value Parameter value. + * @return const AppliedAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const AppliedAnnotationParameter build_applied_annotation_parameter( + const NameHash& paramname_hash, + const AnnotationParameterValue& value); + + /** + * @brief Add AppliedAnnotationParameter to the sequence. + * + * @param[in out] param_seq AppliedAnnotationParameter sequence to be modified. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the parameter being added has + * already been included in the sequence. + * @param[in] param AppliedAnnotationParameter to be added. + */ + FASTDDS_EXPORTED_API static void add_applied_annotation_parameter( + AppliedAnnotationParameterSeq& param_seq, + const AppliedAnnotationParameter& param); + + /** + * @brief Build AppliedAnnotation instance. + * + * @param[in] annotation_typeid Annotation TypeIdentifier. + * @param[in] param_seq Annotation parameters. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given annotation_typeid TypeIdentifier does not correspond to an annotation TypeObject (only in + * Debug build mode). + * 2. Given AppliedAnnotationParameterSeq is inconsistent (only in Debug build mode). + * 3. Given annotation TypeIdentifier corresponds to a builtin annotation and the given parameters are + * inconsistent (only in Debug build mode). + * @return const AppliedAnnotation instance. + */ + FASTDDS_EXPORTED_API static const AppliedAnnotation build_applied_annotation( + const TypeIdentifier& annotation_typeid, + const eprosima::fastcdr::optional& param_seq); + + /** + * @brief Add AppliedAnnotation to the sequence. + * + * @param[in out] ann_custom_seq AppliedAnnotation sequence to be modified. + * @param[in] ann_custom AppliedAnnotation to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given AppliedAnnotation is not consistent (only in Debug build mode). + * 2. Given AppliedAnnotation is already present in the sequence. + */ + FASTDDS_EXPORTED_API static void add_applied_annotation( + AppliedAnnotationSeq& ann_custom_seq, + const AppliedAnnotation& ann_custom); + + /** + * @brief Build AppliedVerbatimAnnotation instance. + * + * @param[in] placement Verbatim annotation placement parameter. + * @param[in] language Verbatim annotation language parameter. + * @param[in] text Verbatim annotation text parameter. + * @return const AppliedVerbatimAnnotation instance. + */ + FASTDDS_EXPORTED_API static const AppliedVerbatimAnnotation build_applied_verbatim_annotation( + PlacementKind placement, + const eprosima::fastcdr::fixed_string<32>& language, + const std::string& text); + + /*************** Aggregate types: ***************************/ + /** + * @brief Build AppliedBuiltinMemberAnnotations instance. + * + * @param[in] unit Unit annotation value. + * @param[in] min Min annotation value. + * @param[in] max Max annotation value. + * @param[in] hash_id Hashid annotation value. + * @return const AppliedBuiltinMemberAnnotations instance. + */ + FASTDDS_EXPORTED_API static const AppliedBuiltinMemberAnnotations build_applied_builtin_member_annotations( + const eprosima::fastcdr::optional& unit, + const eprosima::fastcdr::optional& min, + const eprosima::fastcdr::optional& max, + const eprosima::fastcdr::optional& hash_id); + + /** + * @brief Build CommonStructMember instance. + * + * @param[in] member_id Member identifier. + * @param[in] member_flags Member flags: optional, must_understand, key, and external. + * @param[in] member_type_id Member TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception: + * 1. The given flags are not consistent (only in Debug build mode). + * 2. The given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonStructMember instance. + */ + FASTDDS_EXPORTED_API static const CommonStructMember build_common_struct_member( + MemberId member_id, + StructMemberFlag member_flags, + const TypeIdentifier& member_type_id); + + /** + * @brief Build CompleteMemberDetail instance. + * + * @param[in] name Member name. + * @param[in] ann_builtin Member builtin annotations. + * @param[in] ann_custom Member custom annotations. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Empty member name. + * 2. Given AppliedAnnotationSeq is not consistent (only Debug build mode). + * @return const CompleteMemberDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteMemberDetail build_complete_member_detail( + const MemberName& name, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalMemberDetail constructed from CompleteMemberDetail + */ + + /** + * @brief Build CompleteStructMember instance. + * + * @param[in] common CommonStructMember to be set. + * @param[in] detail CompleteMemberDetail to be set. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonStructMember is inconsistent (only Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only Debug build mode). + * @return const CompleteMemberDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructMember build_complete_struct_member( + const CommonStructMember& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteStructMember to the sequence. + * + * @param[in out] member_seq CompleteStructMember sequence to be modified. + * @param[in] member CompleteStructMember to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CompleteStructMember is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_struct_member( + CompleteStructMemberSeq& member_seq, + const CompleteStructMember& member); + + /** + * MinimalStructMember constructed from CompleteStructMember + */ + + /** + * @brief Build AppliedBuiltinTypeAnnotations instance. + * + * @param[in] verbatim AppliedVerbatimAnnotation to be set. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given verbatim annotation + * is inconsistent (only in Debug build mode). + * @return const AppliedBuiltinTypeAnnotations instance. + */ + FASTDDS_EXPORTED_API static const AppliedBuiltinTypeAnnotations build_applied_builtin_type_annotations( + const eprosima::fastcdr::optional& verbatim); + + /** + * MinimalTypeDetail constructed from CompleteTypeDetail: empty. Available for future extension. + */ + + /** + * @brief Build CompleteTypeDetail instance. + * + * @param[in] ann_builtin Verbatim annotation. + * @param[in] ann_custom Applied annotations. + * @param[in] type_name Name of the type. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given type_name is empty. + * 2. any applied annotation is not consistent (only Debug build mode). + * @return const CompleteTypeDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteTypeDetail build_complete_type_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom, + const QualifiedTypeName& type_name); + + /** + * @brief Build CompleteStructHeader instance. + * + * @param[in] base_type TypeIdentifier of the parent structure (inheritance). + * @param[in] detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given TypeIdentifier is not consistent (direct HASH or empty TypeIdentifier). In Debug build + * mode the corresponding TypeObject is also checked in case of direct HASH TypeIdentifier. + * 2. Given CompleteTypeDetail is not consistent (only in Debug build mode). + * @return const CompleteStructHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructHeader build_complete_struct_header( + const TypeIdentifier& base_type, + const CompleteTypeDetail& detail); + + /** + * MinimalStructHeader constructed from CompleteStructHeader. + */ + + /** + * @brief Build CompleteStructType instance. + * + * @param[in] struct_flags StructTypeFlags. + * @param[in] header CompleteStructHeader. + * @param[in] member_seq Sequence of CompleteStructMembers. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given StructTypeFlag is not consistent (only in Debug build mode). + * 2. Given CompleteStructHeader is not consistent (only in Debug build mode). + * 3. Given CompleteStructMemberSeq is not consistent (only in Debug build mode). + * 4. Given flags are not consistent with the builtin annotations. + * @return const CompleteStructType instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructType build_complete_struct_type( + StructTypeFlag struct_flags, + const CompleteStructHeader& header, + const CompleteStructMemberSeq& member_seq); + + /** + * MinimalStructType constructed from CompleteStructType. + */ + + /*************** Union: *********************************************/ + + /** + * @brief Add label to the union case label sequence. + * + * @param[in out] label_seq Sequence to be modified. + * @param[in] label Label to be added. + */ + FASTDDS_EXPORTED_API static void add_union_case_label( + UnionCaseLabelSeq& label_seq, + int32_t label); + + /** + * @brief Build CommonUnionMember instance. + * + * @param[in] member_id Member identifier. + * @param[in] member_flags Member flags. + * @param[in] type_id Member TypeIdentifier. + * @param[in] label_seq Member applicable case labels. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given UnionMemberFlags are not consistent (only Debug build mode). + * 2. Given TypeIdentifier is not consistent (only Debug build mode). + * @return const CommonUnionMember instance. + */ + FASTDDS_EXPORTED_API static const CommonUnionMember build_common_union_member( + MemberId member_id, + UnionMemberFlag member_flags, + const TypeIdentifier& type_id, + const UnionCaseLabelSeq& label_seq); + + /** + * @brief Build CompleteUnionMember instance. + * + * @param[in] common CommonUnionMember. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonUnionMember is not consistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is not consistent (only in Debug build mode). + * @return const CompleteUnionMember instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionMember build_complete_union_member( + const CommonUnionMember& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteUnionMember to sequence. + * + * @param[in out] complete_union_member_seq Sequence to be modified. + * @param[in] member Complete union member to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CompleteUnionMember is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + * 3. If the given member is marked as default, if there is already another member marked as default + * (only in Debug build mode). + * 4. There are repeated union case labels (only in Debug build mode). + * 5. Member name is protected ("discriminator"). + */ + FASTDDS_EXPORTED_API static void add_complete_union_member( + CompleteUnionMemberSeq& complete_union_member_seq, + const CompleteUnionMember& member); + + /** + * MinimalUnionMember constructed from CompleteUnionMember. + */ + + /** + * @brief Build CommonDiscriminatorMember instance. + * + * @param[in] member_flags Discriminator flags. + * @param[in] type_id Discriminator TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given discriminator flags are inconsistent (only in Debug build mode). + * 2. Given TypeIdentifier is not consistent. + * XTypes v1.3 Clause 7.2.2.4.4.3 The discriminator of a union must be one of the following types: + * Boolean, Byte, Char8, Char16, Int8, Uint8, Int16, Uint16, Int32, Uint32, Int64, Uint64, any + * enumerated type, any alias type that resolves, directly or indirectly, to one of the + * aforementioned types. + * @return const CommonDiscriminatorMember instance. + */ + FASTDDS_EXPORTED_API static const CommonDiscriminatorMember build_common_discriminator_member( + UnionDiscriminatorFlag member_flags, + const TypeIdentifier& type_id); + + /** + * @brief Build CompleteDiscriminatorMember instance. + * + * @param[in] common CommonDiscriminatorMember. + * @param[in] ann_builtin Verbatim annotation. + * @param[in] ann_custom Applied annotations. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonDiscriminatorMember is inconsistent (only in Debug build mode). + * 2. AppliedBuiltinTypeAnnotation is inconsistent (only in Debug build mode). + * 3. Any given AppliedAnnotation is inconsistent (only in Debug build mode). + * 4. CommonDiscriminatorMember is inconsistent with given builtin annotations. + * @return const CompleteDiscriminatorMember instance. + */ + FASTDDS_EXPORTED_API static const CompleteDiscriminatorMember build_complete_discriminator_member( + const CommonDiscriminatorMember& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalDiscriminatorMember constructed from CompleteDiscriminatorMember. + */ + + /** + * @brief Build CompleteUnionHeader instance. + * + * @param detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteTypeDetail is + * not consistent (only in Debug build mode). + * @return const CompleteUnionHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionHeader build_complete_union_header( + const CompleteTypeDetail& detail); + + /** + * MinimalUnionHeader constructed from CompleteUnionHeader. + */ + + /** + * @brief Build CompleteUnionType instance. + * + * @param[in] union_flags + * @param[in] header + * @param[in] discriminator + * @param[in] member_seq + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given UnionTypeFlags are not consistent (only in Debug build mode). + * 2. Given CompleteUnionHeader is not consistent (only in Debug build mode). + * 3. Given CompleteDiscriminatorMember inconsistent (only in Debug build mode). + * 4. Given CompleteUnionMemberSeq is not consistent (only in Debug build mode). + * 5. Given flags are not consistent with the builtin annotations. + * @return const CompleteUnionType instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionType build_complete_union_type( + UnionTypeFlag union_flags, + const CompleteUnionHeader& header, + const CompleteDiscriminatorMember& discriminator, + const CompleteUnionMemberSeq& member_seq); + + /** + * MinimalUnionType constructed from CompleteUnionType. + */ + + /*************** Annotation: ****************************************/ + + /** + * @brief Build CommonAnnotationParameter instance. + * + * @param[in] member_flags AnnotationParameterFlag: empty. No flags apply. It must be zero. + * @param[in] member_type_id Member TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given AnnotationParameterFlag are not empty. + * 2. Given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const CommonAnnotationParameter build_common_annotation_parameter( + AnnotationParameterFlag member_flags, + const TypeIdentifier& member_type_id); + + /** + * @brief Build CompleteAnnotationParameter instance. + * + * @param[in] common CommonAnnotationParameter. + * @param[in] name Member name. + * @param[in] default_value Annotation default value. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonAnnotationParameter is inconsistent (only in Debug build mode). + * 2. CommonAnnotationParameter TypeIdentifier is inconsistent with AnnotationParameterValue type. + * 3. Given parameter name is empty. + * @return const CompleteAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationParameter build_complete_annotation_parameter( + const CommonAnnotationParameter& common, + const MemberName& name, + const AnnotationParameterValue& default_value); + + /** + * @brief Add CompleteAnnotationParameter to sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] param Complete annotation parameter to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CompleteAnnotationParameter is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_annotation_parameter( + CompleteAnnotationParameterSeq& sequence, + const CompleteAnnotationParameter& param); + + /** + * MinimalAnnotationParameter constructed from CompleteAnnotationParameter. + */ + + /** + * @brief Build CompleteAnnotationHeader instance. + * + * @param[in] annotation_name Qualified annotation type name. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError if the annotation_name is empty. + * @return const CompleteAnnotationHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationHeader build_complete_annotation_header( + const QualifiedTypeName& annotation_name); + + /** + * MinimalAnnotationHeader constructed from CompleteAnnotationHeader: empty. Available for future extension. + */ + + /** + * @brief Build CompleteAnnotationType instance. + * + * @param[in] annotation_flag Unused. No flags apply. It must be 0. + * @param[in] header CompleteAnnotationHeader. + * @param[in] member_seq CompleteAnnotationParameter sequence. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any annotation flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Any CompleteAnnotationParameter in the sequence is inconsistent (only in Debug build mode). + * @return const CompleteAnnotationType instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationType build_complete_annotation_type( + AnnotationTypeFlag annotation_flag, + const CompleteAnnotationHeader& header, + const CompleteAnnotationParameterSeq& member_seq); + + /** + * MinimalAnnotationType constructed from CompleteAnnotationType. + */ + + /*************** Alias: *********************************************/ + + /** + * @brief Build CommonAliasBody instance. + * + * @param[in] related_flags AliasMemberFlag: unused. No flags apply. It must be 0. + * @param[in] related_type Related TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any alias member flag is set. + * 2. Non-consistent TypeIdentifier (only in Debug build mode). + * @return const CommonAliasBody instance. + */ + FASTDDS_EXPORTED_API static const CommonAliasBody build_common_alias_body( + AliasMemberFlag related_flags, + const TypeIdentifier& related_type); + + /** + * @brief Build CompleteAliasBody instance. + * + * @param[in] common CommonAliasBody. + * @param[in] ann_builtin Applied builtin member annotations: unit, max, min, range, hashid + * @param[in] ann_custom Applied custom annotations + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonAliasBody is inconsistent (only Debug build mode). + * 2. AppliedAnnotationSeq is inconsistent (only Debug build mode). + * 3. hashid builtin annotation is set. + * @return const CompleteAliasBody instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasBody build_complete_alias_body( + const CommonAliasBody& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalAliasBody constructed from CompleteAliasBody. + */ + + /** + * @brief Build CompleteAliasHeader instance. + * + * @param[in] detail Complete type detail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteTypeDetail is + * inconsistent (only in Debug build mode). + * @return const CompleteAliasHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasHeader build_complete_alias_header( + const CompleteTypeDetail& detail); + + /** + * MinimalAliasHeader constructed from CompleteAliasHeader: empty. Available for future extension. + */ + + /** + * @brief Build CompleteAliasType instance. + * + * @param[in] alias_flags Alias type flags: unused. No flags apply. It must be zero. + * @param[in] header CompleteAliasHeader. + * @param[in] body CompleteAliasBody. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any alias type flag is set. + * 2. Inconsistent header and/or body (only in Debug build mode). + * @return const CompleteAliasType instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasType build_complete_alias_type( + AliasTypeFlag alias_flags, + const CompleteAliasHeader& header, + const CompleteAliasBody& body); + + /** + * MinimalAliasType constructed from CompleteAliasType. + */ + + /*************** Collections: ***************************************/ + + /** + * @brief Build CompleteElementDetail instance. + * + * @param[in] ann_builtin Applied builtin member annotations: unit, max, min, range, hashid + * @param[in] ann_custom Applied custom annotations + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. AppliedAnnotationSeq is inconsistent (only Debug build mode). + * 2. hashid builtin annotation is applied. + * @return const CompleteElementDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteElementDetail build_complete_element_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * @brief Build CommonCollectionElement instance. + * + * @param[in] element_flags CollectionElementFlag. + * @param[in] type TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given collection element flags are not consistent (only in Debug build mode). + * 2. Given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonCollectionElement instance + */ + FASTDDS_EXPORTED_API static const CommonCollectionElement build_common_collection_element( + CollectionElementFlag element_flags, + const TypeIdentifier& type); + + /** + * @brief Build CompleteCollectionElement instance. + * + * @param[in] common CommonCollectionElement. + * @param[in] detail CompleteElementDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonCollectionElement is not consistent (only in Debug build mode). + * 2. Given CompleteElementDetail is not consistent (only in Debug build mode). + * @return const CompleteCollectionElement instance + */ + FASTDDS_EXPORTED_API static const CompleteCollectionElement build_complete_collection_element( + const CommonCollectionElement& common, + const CompleteElementDetail& detail); + + /** + * MinimalCollectionElement constructed from CompleteCollectionElement. + */ + + /** + * @brief Build CommonCollectionHeader instance. + * + * @param[in] bound Collection bound. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given bound is not + * consistent. + * @return const CommonCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonCollectionHeader build_common_collection_header( + LBound bound); + + /** + * @brief Build CompleteCollectionHeader instance. + * + * @param[in] common CommonCollectionHeader + * @param[in] detail CompleteTypeDetail + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonCollectionHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteCollectionHeader build_complete_collection_header( + const CommonCollectionHeader& common, + const eprosima::fastcdr::optional& detail); + + /** + * MinimalCollectionHeader constructed from CompleteCollectionHeader. + */ + + /*************** Sequence: ******************************************/ + + /** + * @brief Build CompleteSequenceType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteCollectionHeader. + * @param[in] element CompleteCollectionElement. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given element is inconsistent (only in Debug build mode). + * @return const CompleteSequenceType instance + */ + FASTDDS_EXPORTED_API static const CompleteSequenceType build_complete_sequence_type( + CollectionTypeFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& element); + + /** + * MinimalSequenceType constructed from CompleteSequenceType. + */ + + /*************** Array: *********************************************/ + + /** + * @brief Build CommonArrayHeader instance. + * + * @param[in] bound_seq Sequence of the dimension's bounds. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if any given bound is 0 (invalid). + * @return const CommonArrayHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonArrayHeader build_common_array_header( + const LBoundSeq& bound_seq); + + /** + * @brief Build CompleteArrayHeader instance. + * + * @param[in] common CommonArrayHeader. + * @param[in] detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonArrayHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteArrayHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteArrayHeader build_complete_array_header( + const CommonArrayHeader& common, + const CompleteTypeDetail& detail); + + /** + * MinimalArrayHeader constructed from CompleteArrayHeader. + */ + + /** + * @brief Build CompleteArrayType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteArrayHeader. + * @param[in] element CompleteCollectionElement. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given element is inconsistent (only in Debug build mode). + * @return const CompleteArrayType instance. + */ + FASTDDS_EXPORTED_API static const CompleteArrayType build_complete_array_type( + CollectionTypeFlag collection_flag, + const CompleteArrayHeader& header, + const CompleteCollectionElement& element); + + /** + * MinimalArrayType constructed from CompleteArrayType. + */ + + /*************** Map: ***********************************************/ + + /** + * @brief Build CompleteMapType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteArrayHeader. + * @param[in] key CompleteCollectionElement describing map key. + * @param[in] element CompleteCollectionElement describing map element. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given key TypeIdentifier is inconsistent. + * 4. Given key description is inconsistent (only in Debug build mode). + * 5. Given element is inconsistent (only in Debug build mode). + * @return const CompleteMapType instance. + */ + FASTDDS_EXPORTED_API static const CompleteMapType build_complete_map_type( + CollectionTypeFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& key, + const CompleteCollectionElement& element); + + /** + * MinimalMapType constructed from CompleteMapType. + */ + + /*************** Enumeration: **************************************/ + + /** + * @brief Build CommonEnumeratedLiteral instance. + * + * @param[in] value Enumerated literal value. + * @param[in] flags Enumerated literal flags: only default flag apply. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if any other flag different from + * default is set (only in Debug build mode). + * @return const CommonEnumeratedLiteral instance. + */ + FASTDDS_EXPORTED_API static const CommonEnumeratedLiteral build_common_enumerated_literal( + int32_t value, + EnumeratedLiteralFlag flags); + + /** + * @brief Build CompleteEnumeratedLiteral instance. + * + * @param[in] common CommonEnumeratedLiteral. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedLiteral is inconsistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedLiteral instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedLiteral build_complete_enumerated_literal( + const CommonEnumeratedLiteral& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteEnumeratedLiteral to sequence. + * + * @param[in] sequence Sequence to be modified. + * @param[in out] enum_literal CompleteEnumeratedLiteral to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedLiteral is not consistent (only in Debug build mode). + * 2. There is already another literal in the sequence with the same value or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_enumerated_literal( + CompleteEnumeratedLiteralSeq& sequence, + const CompleteEnumeratedLiteral& enum_literal); + + /** + * MinimalEnumeratedLiteral constructed from CompleteEnumeratedLiteral. + */ + + /** + * @brief Build CommonEnumeratedHeader instance. + * + * @param[in] bit_bound XTypes v1.3 Clause 7.3.1.2.1.5 It is important to note that the value member of the + * [bit_bound] annotation may take any value from 1 to 32, inclusive, when this annotation is + * applied to an enumerated type. + * @param[in] bitmask Flag in case that the header being built corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given bit_bound is not + * consistent. + * @return const CommonEnumeratedHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonEnumeratedHeader build_common_enumerated_header( + BitBound bit_bound, + bool bitmask = false); + + /** + * @brief Build CompleteEnumeratedHeader instance. + * + * @param[in] common CommonEnumeratedHeader. + * @param[in] detail CompleteTypeDetail. + * @param[in] bitmask flag set if the given header corresponds to a bitmask. Only required in Debug build mode. + * Set to false by default. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedHeader build_complete_enumerated_header( + const CommonEnumeratedHeader& common, + const CompleteTypeDetail& detail, + bool bitmask = false); + + /** + * MinimalEnumeratedHeader constructed from CompleteEnumeratedHeader. + */ + + /** + * @brief Build CompleteEnumeratedType instance. + * + * @param[in] enum_flags Enumeration flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteEnumeratedHeader. + * @param[in] literal_seq Sequence of CompleteEnumeratedLiterals. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any flag is set. + * 2. Given CompleteEnumeratedHeader is inconsistent (only in Debug build mode). + * 3. Given CompleteEnumeratedLiteralSeq is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedType instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedType build_complete_enumerated_type( + EnumTypeFlag enum_flags, + const CompleteEnumeratedHeader& header, + const CompleteEnumeratedLiteralSeq& literal_seq); + + /** + * MinimalEnumeratedType constructed from CompleteEnumeratedType. + */ + + /*************** Bitmask: *******************************************/ + + /** + * @brief Build CommonBitflag instance. + * + * @param[in] position Bit position in the bitmask. + * @param[in] flags Bit flags: unused. No flags apply. It must be 0. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. any given flag is set. + * 2. given position is inconsistent. XTypes v1.3 Clause 7.2.2.4.1.2 Each bit in this subset is + * identified by name and by an index, numbered from 0 to (bound-1). The bound must be greater than + * zero and no greater than 64. + * @return const CommonBitflag instance. + */ + FASTDDS_EXPORTED_API static const CommonBitflag build_common_bitflag( + uint16_t position, + BitflagFlag flags); + + /** + * @brief Build CompleteBitflag instance. + * + * @param[in] common CommonBitflag. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonBitflag is inconsistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only in Debug build mode). + * 3. Non-applicable builtin annotations applied. + * @return const CompleteBitflag instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitflag build_complete_bitflag( + const CommonBitflag& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add complete bitflag to the sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] bitflag CompleteBitflag to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given bitflag is inconsistent (only in Debug build mode). + * 2. There is already another bitflag in the sequence with the same position or the same name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_bitflag( + CompleteBitflagSeq& sequence, + const CompleteBitflag& bitflag); + + /** + * MinimalBitflag constructed from CompleteBitflag. + */ + + /** + * CommonBitmaskHeader is not used. + * CompleteBitmaskHeader is defined as CompleteEnumeratedHeader. + * MinimalBitmaskHeader is defined as MinimalEnumeratedHeader. + */ + + /** + * @brief Build CompleteBitmaskType instance. + * + * @param[in] bitmask_flags Bitmask flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteBitmaskHeader/CompleteEnumeratedHeader + * @param[in] flag_seq Sequence of CompleteBitflag. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. any given flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given Bitflag sequence is inconsistent (only in Debug build mode). + * @return const CompleteBitmaskType instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitmaskType build_complete_bitmask_type( + BitmaskTypeFlag bitmask_flags, + const CompleteBitmaskHeader& header, + const CompleteBitflagSeq& flag_seq); + + /*************** Bitset: ********************************************/ + + /** + * @brief Build CommonBitfield instance. + * + * @param[in] position Bitfield starting position bit. + * @param[in] flags Bitfield flags: unused. No flags apply. It must be 0. + * @param[in] bitcount Bitfield number of bits. IDL v4.2 Clause 7.4.13.4.3.2 The first one (positive_int_const) is + * the number of bits that can be stored (its [bitfield] size). The maximum value is 64. + * @param[in] holder_type Type used to manipulate the bitfield. IDL v4.2 Clause 7.4.13.4.3.2 The second optional one + * (destination_type) specifies the type that will be used to manipulate the bit field as a + * whole. This type can be boolean, octet or any integer type either signed or unsigned. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given position is not consistent. + * 2. Any flag is set. + * 3. Given bitcount is not consistent. + * 4. Given holder_type is not consistent. + * @return const CommonBitfield instance. + */ + FASTDDS_EXPORTED_API static const CommonBitfield build_common_bitfield( + uint16_t position, + BitsetMemberFlag flags, + uint8_t bitcount, + TypeKind holder_type); + + /** + * @brief Build CompleteBitfield instance. + * + * @param[in] common CommonBitfield. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given CommonBitfield is inconsistent (only Debug build mode). + * 2. Give CompleteMemberDetail is inconsistent (only Debug build mode). + * 3. Non-applicable builtin annotations are applied. + * @return const CompleteBitfield instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitfield build_complete_bitfield( + const CommonBitfield& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add complete bitfield to the sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] bitfield CompleteBitfield to be added. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Given bitfield is inconsistent (only in Debug build mode). + * 2. There is another bitfield with the same name and/or the same position. + */ + FASTDDS_EXPORTED_API static void add_complete_bitfield( + CompleteBitfieldSeq& sequence, + const CompleteBitfield& bitfield); + + /** + * MinimalBitfield constructed from CompleteBitfield. + */ + + /** + * @brief Build CompleteBitsetHeader instance. + * + * @param[in] detail CompleteTypeDetail + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteTypeDetail is + * inconsistent (only in Debug build mode). + * @return const CompleteBitsetHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitsetHeader build_complete_bitset_header( + const CompleteTypeDetail& detail); + + /** + * MinimalBitsetHeader constructed from CompleteBitsetHeader. + */ + + /** + * @brief Build CompleteBitsetType instance. + * + * @param[in] bitset_flags Bitset flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteBitsetHeader. + * @param[in] field_seq Sequence of complete bitfields. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if: + * 1. Any given flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given bitfield sequence is inconsistent (only in Debug build mode). + * @return const CompleteBitsetType instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitsetType build_complete_bitset_type( + BitsetTypeFlag bitset_flags, + const CompleteBitsetHeader& header, + const CompleteBitfieldSeq& field_seq); + + /** + * MinimalBitsetType constructed from CompleteBitsetType. + */ + + /*************** Type Object: ***************************************/ + + /** + * @brief Build CompleteExtendedType instance. (empty. Available for future extension) + * + * @return const CompleteExtendedType instance. + */ + FASTDDS_EXPORTED_API static const CompleteExtendedType build_complete_extended_type(); + + /** + * @brief Register alias TypeObject into TypeObjectRegistry. + * CompleteAliasType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] alias_type CompleteAliasType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_alias_type_object( + const CompleteAliasType& alias_type, + const std::string& type_name); + + /** + * @brief Register annotation TypeObject into TypeObjectRegistry. + * CompleteAnnotationType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] annotation_type CompleteAnnotationType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_annotation_type_object( + const CompleteAnnotationType& annotation_type, + const std::string& type_name); + + /** + * @brief Register structure TypeObject into TypeObjectRegistry. + * CompleteStructType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] struct_type CompleteStructType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_struct_type_object( + const CompleteStructType& struct_type, + const std::string& type_name); + + /** + * @brief Register union TypeObject into TypeObjectRegistry. + * CompleteUnionType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] union_type CompleteUnionType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_union_type_object( + const CompleteUnionType& union_type, + const std::string& type_name); + + /** + * @brief Register bitset TypeObject into TypeObjectRegistry. + * CompleteBitsetType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] bitset_type CompleteBitsetType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_bitset_type_object( + const CompleteBitsetType& bitset_type, + const std::string& type_name); + + /** + * @brief Register sequence TypeObject into TypeObjectRegistry. + * CompleteSequenceType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] sequence_type CompleteSequenceType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_sequence_type_object( + const CompleteSequenceType& sequence_type, + const std::string& type_name); + + /** + * @brief Register array TypeObject into TypeObjectRegistry. + * CompleteArrayType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] array_type CompleteArrayType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_array_type_object( + const CompleteArrayType& array_type, + const std::string& type_name); + + /** + * @brief Register map TypeObject into TypeObjectRegistry. + * CompleteMapType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] map_type CompleteMapType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_map_type_object( + const CompleteMapType& map_type, + const std::string& type_name); + + /** + * @brief Register enumeration TypeObject into TypeObjectRegistry. + * CompleteEnumeratedType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] enumerated_type CompleteEnumeratedType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_enumerated_type_object( + const CompleteEnumeratedType& enumerated_type, + const std::string& type_name); + + /** + * @brief Register bitmask TypeObject into TypeObjectRegistry. + * CompleteBitmaskType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] bitmask_type CompleteBitmaskType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_bitmask_type_object( + const CompleteBitmaskType& bitmask_type, + const std::string& type_name); + + /*************** Auxiliary public methods ***************************/ + + /** + * @brief Calculate the MD5 hash of the provided name. + * + * @param[in] name String which hash is calculated. + * @return const NameHash Hash of the given string. + */ + FASTDDS_EXPORTED_API static const NameHash name_hash( + const std::string& name); + + /** + * @brief Check TypeObject consistency. + * + * @param[in] type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * TypeObject is not consistent. + */ + static void type_object_consistency( + const TypeObject& type_object); + +private: + + friend class TypeObjectRegistry; + friend class eprosima::fastdds::dds::DynamicTypeBuilderFactoryImpl; + + // Class with only static methods + TypeObjectUtils() = delete; + ~TypeObjectUtils() = delete; + +protected: + + /*************** Auxiliary methods ***************************/ + + /** + * @brief Set the try construct behavior in a given MemberFlag + * + * @param[in out] member_flag Bitmask to be set. + * @param[in] try_construct_kind TryConstructKind. + */ + static void set_try_construct_behavior( + MemberFlag& member_flag, + TryConstructKind try_construct_kind); + + /** + * @brief Set the TypeFlag object. + * + * @param[in out] type_flag Bitmask to be set. + * @param[in] extensibility_kind ExtensibilityKind + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + */ + static void set_type_flag( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * @brief Set the extensibility kind in a given TypeFlag. + * + * @param[in out] type_flag Bitmask to be set. + * @param[in] extensibility_kind ExtensibilityKind. + */ + static void set_extensibility_kind( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind); + + /** + * @brief Check if a given TypeIdentifier is fully-descriptive. + * XTypes v1.3 Clause 7.3.4.6.1 Fully-descriptive TypeIdentifiers + * Some TypeIdentifiers do not involve computing the Hash of any TypeObject. These are called + * Fully-descriptive TypeIdentifiers because they fully describe the Type. These are: + * - The TypeIdentifiers for Primitive and String types. + * - The TypeIdentifiers of plain collections where the element (and key) TypeIdentifier is a fully + * descriptive TypeIdentifier. They are recognized by the contained PlainCollectionHeader having + * EquivalenceKind set to EK_BOTH. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is fully-descriptive. false otherwise. + */ + static bool is_fully_descriptive_type_identifier( + const TypeIdentifier& type_identifier); + + /** + * @brief Check if a given TypeIdentifier is direct hash. + * XTypes v1.3 Clause 7.3.4.6.3 + * These are HASH TypeIdentifiers with discriminator EK_MINIMAL, EK_COMPLETE or + * TI_STRONGLY_CONNECTED_COMPONENT. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is direct hash. false otherwise. + */ + static bool is_direct_hash_type_identifier( + const TypeIdentifier& type_identifier); + + /** + * @brief Check if a given TypeIdentifier is indirect hash. + * XTypes v1.3 Clause 7.3.4.6.4 + * These are the TypeIdentifiers for plain collections with the element type identified using a HASH + * TypeIdentifier. They are distinguished by: + * 1. Having discriminator TI_PLAIN_SEQUENCE_SMALL, TI_PLAIN_SEQUENCE_LARGE, TI_PLAIN_ARRAY_SMALL, + * TI_PLAIN_ARRAY_LARGE, TI_PLAIN_MAP_SMALL, or TI_PLAIN_MAP_LARGE. + * 2. Having the contained PlainCollectionHeader with EquivalenceKind EK_MINIMAL or EK_COMPLETE. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is indirect hash. false otherwise. + */ + static bool is_indirect_hash_type_identifier( + const TypeIdentifier& type_identifier); + + /*************** Consistency methods (Debug) ***************************/ + + /** + * TypeObjectHashId is always consistent. Default constructor already sets the discriminator to one valid value. + * Union setters prevent changing the discriminator value without setting the corresponding union member. + */ + + /** + * @brief Check LBound consistency: must be greater than 255. + * + * @param[in] bound LBound to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given LBound is not + * consistent. + */ + static void l_bound_consistency( + LBound bound); + + /** + * @brief Check that the array_bound_seq is consistent: non-empty. + * + * @tparam T Either SBoundSeq or LBoundSeq + * @param[in] array Sequence to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given array is not + * consistent. + */ + template + static void array_bound_seq_consistency( + const T& array) + { + if (array.empty()) + { + throw InvalidArgumentError("array_bound_seq parameter must not be empty"); + } + for (auto bound : array) + { + if (INVALID_LBOUND == bound) + { + throw InvalidArgumentError("bound parameter must be greater than 0"); + } + } + } + + /** + * @brief Check LBoundSeq consistency. + * + * @param[in] bound_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given LBoundSeq is + * not consistent. + */ + static void l_bound_seq_consistency( + const LBoundSeq& bound_seq); + + /** + * @brief Check CollectionElementFlag consistency. + * + * @param[in] collection_element_flag CollectionElementFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CollectionElementFlag + * is not consistent. + */ + static void collection_element_flag_consistency( + CollectionElementFlag collection_element_flag); + + /** + * @brief Check StructMemberFlag consistency: MemberFlag consistency (try construct annotation). + * XTypes v1.3 Clause 7.2.2.4.4.4.8 Key members shall never be optional, and they shall always have their + * "must understand" attribute set to true. + * + * @param[in] member_flags MemberFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given StructMemberFlag is not + * consistent. + */ + static void struct_member_flag_consistency( + StructMemberFlag member_flags); + + /** + * @brief Check UnionMemberFlag consistency. + * + * @param[in] union_member_flag UnionMemberFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionMemberFlag + * is not consistent. + */ + static void union_member_flag_consistency( + UnionMemberFlag union_member_flag); + + /** + * @brief Check UnionDiscriminatorFlag consistency. + * + * @param[in] union_discriminator_flag UnionDiscriminatorFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionDiscriminatorFlag + * is not consistent. + */ + static void union_discriminator_flag_consistency( + UnionDiscriminatorFlag union_discriminator_flag); + + /** + * @brief Check EnumeratedLiteralFlag consistency: any flag different from default are not set. + * + * @param[in] enumerated_literal_flag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given EnumeratedLiteralFlag + * is not consistent. + */ + static void enumerated_literal_flag_consistency( + EnumeratedLiteralFlag enumerated_literal_flag); + + /** + * @brief Check TypeFlag consistency: exactly one extensibility flag is set. + * + * @param[in] type_flag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeFlag + * is not consistent. + */ + static void type_flag_consistency( + TypeFlag type_flag); + + /** + * @brief Check empty flags consistency. + * + * @tparam T Either MemberFlag or TypeFlag. + * @param[in] flags Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * flags are not consistent: empty (0). + */ + template + static void empty_flags_consistency( + T flags) + { + if (flags != 0) + { + throw InvalidArgumentError("Flags should be empty. No flags apply"); + } + } + + /** + * @brief Check EquivalenceKind consistency. + * + * @param[in] equiv_kind Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given EquivalenceKind + * is not consistent. + */ + static void equivalence_kind_consistency( + EquivalenceKind equiv_kind); + + /** + * @brief Check PlainCollectionHeader consistency: + * - CollectionElementFlag consistent + * - Consistent EquivalenceKind + * + * @param[in] header PlainCollectionHeader to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainCollectionHeader + * is not consistent. + */ + static void plain_collection_header_consistency( + const PlainCollectionHeader& header); + + /** + * @brief Check consistency between a given PlainCollectionHeader and the related TypeIdentifier: + * 1. TypeIdentifier initialized + * 2. Consistency of EquivalenceKinds + * + * @param[in] header PlainCollectionHeader to be checked. + * @param[in] element_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given parameters are not + * consistent. + */ + static void plain_collection_type_identifier_header_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& element_identifier); + + /** + * @brief Retrieves the equivalence kind of a component within a map. + * + * @param[in] identifier TypeIdentifier of the component to be checked. + * @return EK_COMPLETE if the component equivalence kind is EK_COMPLETE. + * @return EK_MINIMAL if the component equivalence kind is EK_MINIMAL. + * @return EK_BOTH if the component equivalence kind is EK_BOTH. + * @return TK_NONE if the component type is invalid. + */ + static EquivalenceKind get_map_component_equiv_kind_for_consistency( + const TypeIdentifier& identifier); + + /** + * @brief Check consistency between a given PlainCollectionHeader of a map and the related TypeIdentifier: + * 1. Key TypeIdentifier is valid + * 2. TypeIdentifier initialized + * 3. Consistency of EquivalenceKinds + * + * @param[in] header PlainCollectionHeader of the map to be checked. + * @param[in] type_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given parameters are not + * consistent. + */ + static void plain_map_type_components_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& type_identifier); + + /** + * @brief Check map key_identifier consistency. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements of signed + * and unsigned integer types and of narrow and wide string types. + * In Debug build mode, this method also checks that the string/wstring bound is consistent. + * + * @param[in] key_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is not + * consistent. + */ + static void map_key_type_identifier_consistency( + const TypeIdentifier& key_identifier); + + /** + * @brief Check StringLTypeDefn consistency. + * + * @param[in] string Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given StringLTypeDefn is not + * consistent. + */ + static void string_ldefn_consistency( + const StringLTypeDefn& string); + + /** + * @brief Check PlainSequenceSElemDefn consistency. + * + * @param[in] plain_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainSequenceSElemDefn + * is not consistent. + */ + static void seq_sdefn_consistency( + const PlainSequenceSElemDefn& plain_seq); + + /** + * @brief Check PlainSequenceLElemDefn consistency. + * + * @param[in] plain_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainSequenceLElemDefn + * is not consistent. + */ + static void seq_ldefn_consistency( + const PlainSequenceLElemDefn& plain_seq); + + /** + * @brief Check PlainArraySElemDefn consistency. + * + * @param[in] plain_array Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainArraySElemDefn is + * not consistent. + */ + static void array_sdefn_consistency( + const PlainArraySElemDefn& plain_array); + + /** + * @brief Check PlainArrayLElemDefn consistency. + * + * @param[in] plain_array Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainArrayLElemDefn is + * not consistent. + */ + static void array_ldefn_consistency( + const PlainArrayLElemDefn& plain_array); + + /** + * @brief Check PlainMapSTypeDefn consistency. + * + * @param[in] plain_map Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainMapSTypeDefn is + * not consistent. + */ + static void map_sdefn_consistency( + const PlainMapSTypeDefn& plain_map); + + /** + * @brief Check PlainMapLTypeDefn consistency. + * + * @param[in] plain_map Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainMapLTypeDefn is + * not consistent. + */ + static void map_ldefn_consistency( + const PlainMapLTypeDefn& plain_map); + + /** + * @brief Check direct hash TypeIdentifier consistency. + * + * @param[in] type_id Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void direct_hash_type_identifier_consistency( + const TypeIdentifier& type_id); + + /** + * @brief Check TypeIdentifier consistency. + * + * @param[in] type_identifier Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void type_identifier_consistency( + const TypeIdentifier& type_identifier); + + /** + * @brief Check AppliedAnnotationParameterSeq consistency. + * + * @param[in] applied_annotation_parameter_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedAnnotationParameterSeq is not consistent. + */ + static void applied_annotation_parameter_seq_consistency( + const AppliedAnnotationParameterSeq& applied_annotation_parameter_seq); + + /** + * @brief Check AppliedAnnotation TypeIdentifier consistency. + * + * @param[in] annotation_type_id Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedAnnotation TypeIdentifier is not consistent. + */ + static void applied_annotation_type_identifier_consistency( + const TypeIdentifier& annotation_type_id); + + /** + * @brief Check AppliedAnnotation consistency. + * + * @param[in] applied_annotation Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given AppliedAnnotation is + * not consistent. + */ + static void applied_annotation_consistency( + const AppliedAnnotation& applied_annotation); + + /** + * @brief Check AppliedAnnotationSeq consistency. + * + * @param[in] applied_annotation_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given AppliedAnnotationSeq is + * not consistent. + */ + static void applied_annotation_seq_consistency( + const AppliedAnnotationSeq& applied_annotation_seq); + + /** + * @brief Check AppliedVerbatimAnnotation consistency. + * + * @param[in] applied_verbatim_annotation Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedVerbatimAnnotation is not consistent. + */ + static void applied_verbatim_annotation_consistency( + const AppliedVerbatimAnnotation& applied_verbatim_annotation); + + /** + * @brief Check CommonStructMember consistency. + * + * @param[in] common_struct_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CommonStructMember is + * not consistent. + */ + static void common_struct_member_consistency( + const CommonStructMember& common_struct_member); + + /** + * @brief Check CompleteMemberDetail consistency. + * + * @param[in] complete_member_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteMemberDetail is + * not consistent. + */ + static void complete_member_detail_consistency( + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check cross-consistency between CommonStructMember and CompleteMemberDetail. + * + * @param[in] common_struct_member CommonStructMember to be checked. + * @param[in] complete_member_detail CompleteMemberDetail to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the hashid builtin applied + * annotation is set and inconsistent with the member id. + */ + static void common_struct_member_and_complete_member_detail_consistency( + const CommonStructMember& common_struct_member, + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check consistency between a string value and the MemberId (algorithm XTypes v1.3 Clause 7.3.1.2.1.1) + * + * @param[in] member_id MemberId to be checked. + * @param[in] string_value String provided with either hashid annotation or the member name. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given data is inconsistent. + */ + static void string_member_id_consistency( + MemberId member_id, + const std::string& string_value); + + /** + * @brief Check CompleteStructMember consistency. + * + * @param[in] complete_struct_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructMember is + * not consistent. + */ + static void complete_struct_member_consistency( + const CompleteStructMember& complete_struct_member); + + /** + * @brief Check CompleteStructMemberSeq consistency. + * + * @param[in] complete_struct_member_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructMemberSeq + * is not consistent. + */ + static void complete_struct_member_seq_consistency( + const CompleteStructMemberSeq& complete_struct_member_seq); + + /** + * @brief Check AppliedBuiltinTypeAnnotations consistency. + * + * @param[in] applied_builtin_type_annotations Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedBuiltinTypeAnnotations is not consistent. + */ + static void applied_builtin_type_annotations_consistency( + const AppliedBuiltinTypeAnnotations& applied_builtin_type_annotations); + + /** + * @brief Check CompleteTypeDetail consistency. + * + * @param[in] complete_type_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteTypeDetail is + * not consistent. + */ + static void complete_type_detail_consistency( + const CompleteTypeDetail& complete_type_detail); + + /** + * @brief Check CompleteStructHeader base_type TypeIdentifier consistency. + * + * @param[in] base_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void structure_base_type_consistency( + const TypeIdentifier& base_type); + + /** + * @brief Check CompleteStructHeader consistency. + * + * @param[in] complete_struct_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructHeader + * is not consistent. + */ + static void complete_struct_header_consistency( + const CompleteStructHeader& complete_struct_header); + + /** + * @brief Check CompleteStructType consistency. + * + * @param[in] complete_struct_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructType + * is not consistent. + */ + static void complete_struct_type_consistency( + const CompleteStructType& complete_struct_type); + + /** + * @brief Check MinimalStructType consistency. + * + * @param[in] minimal_struct_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given MinimalStructType + * is not consistent. + */ + static void minimal_struct_type_consistency( + const MinimalStructType& minimal_struct_type); + + /** + * @brief Check UnionCaseLabelSeq consistency. + * + * @param[in] union_case_label_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionCaseLabelSeq + * is not consistent. + */ + static void union_case_label_seq_consistency( + const UnionCaseLabelSeq& union_case_label_seq); + + /** + * @brief Check CommonUnionMember consistency. + * + * @param[in] common_union_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CommonUnionMember + * is not consistent. + */ + static void common_union_member_consistency( + const CommonUnionMember& common_union_member); + + /** + * @brief Check cross-consistency between CommonStructMember and CompleteMemberDetail. + * + * @param[in] common_union_member CommonStructMember to be checked. + * @param[in] complete_member_detail CompleteMemberDetail to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the hashid builtin annotation is + * set and the member id is not consistent. + */ + static void common_union_member_complete_member_detail_consistency( + const CommonUnionMember& common_union_member, + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check CompleteUnionMember consistency. + * + * @param[in] complete_union_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteUnionMember + * is not consistent. + */ + static void complete_union_member_consistency( + const CompleteUnionMember& complete_union_member); + + /** + * @brief Check CompleteUnionMemberSeq consistency. + * + * @param[in] complete_union_member_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteUnionMemberSeq + * is not consistent. + */ + static void complete_union_member_seq_consistency( + const CompleteUnionMemberSeq& complete_union_member_seq); + + /** + * @brief Check discriminator TypeIdentifier consistency. + * + * @param[in] type_id Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier + * is not consistent. + */ + static void common_discriminator_member_type_identifier_consistency( + const TypeIdentifier& type_id); + + /** + * @brief Check CommonDiscriminatorMember consistency. + * + * @param[in] common_discriminator_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonDiscriminatorMember is not consistent. + */ + static void common_discriminator_member_consistency( + const CommonDiscriminatorMember& common_discriminator_member); + + /** + * @brief Check CompleteDiscriminatorMember consistency. + * + * @param[in] complete_discriminator_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteDiscriminatorMember is not consistent. + */ + static void complete_discriminator_member_consistency( + const CompleteDiscriminatorMember& complete_discriminator_member); + + /** + * @brief Check CompleteUnionHeader consistency. + * + * @param[in] complete_union_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteUnionHeader is not consistent. + */ + static void complete_union_header_consistency( + const CompleteUnionHeader& complete_union_header); + + /** + * @brief Check CompleteUnionType consistency. + * + * @param[in] complete_union_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteUnionType is not consistent. + */ + static void complete_union_type_consistency( + const CompleteUnionType& complete_union_type); + + /** + * @brief Check MinimalUnionType consistency. + * + * @param[in] minimal_union_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalUnionType is not consistent. + */ + static void minimal_union_type_consistency( + const MinimalUnionType& minimal_union_type); + + /** + * @brief Check that the annotation value is of the same type as the given TypeIdentifier. + * + * @param type_id TypeIdentifier. + * @param value AnnotationParameterValue. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is not + * consistent with the given value. + */ + static void common_annotation_parameter_type_identifier_default_value_consistency( + const TypeIdentifier& type_id, + const AnnotationParameterValue& value); + + /** + * @brief Check CommonAnnotationParameter consistency. + * + * @param[in] common_annotation_parameter Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonAnnotationParameter is not consistent. + */ + static void common_annotation_parameter_consistency( + const CommonAnnotationParameter& common_annotation_parameter); + + /** + * @brief Check CompleteAnnotationParameter consistency. + * + * @param[in] complete_annotation_parameter Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationParameter is not consistent. + */ + static void complete_annotation_parameter_consistency( + const CompleteAnnotationParameter& complete_annotation_parameter); + + /** + * @brief Check CompleteAnnotationParameterSeq consistency. + * + * @param[in] complete_annotation_parameter_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationParameterSeq is not consistent. + */ + static void complete_annotation_parameter_seq_consistency( + const CompleteAnnotationParameterSeq& complete_annotation_parameter_seq); + + /** + * @brief Check CompleteAnnotationHeader consistency. + * + * @param[in] complete_annotation_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationHeader is not consistent. + */ + static void complete_annotation_header_consistency( + const CompleteAnnotationHeader& complete_annotation_header); + + /** + * @brief Check CompleteAnnotationType consistency. + * + * @param[in] complete_annotation_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationType is not consistent. + */ + static void complete_annotation_type_consistency( + const CompleteAnnotationType& complete_annotation_type); + + /** + * @brief Check MinimalAnnotationType consistency. + * + * @param[in] minimal_annotation_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalAnnotationType is not consistent. + */ + static void minimal_annotation_type_consistency( + const MinimalAnnotationType& minimal_annotation_type); + + /** + * @brief Check CommonAliasBody consistency. + * + * @param[in] common_alias_body Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonAliasBody is not consistent. + */ + static void common_alias_body_consistency( + const CommonAliasBody& common_alias_body); + + /** + * @brief Check that hashid builtin annotation has not been set. + * + * @param[in] ann_builtin Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedBuiltinMemberAnnotations is not consistent. + */ + static void hashid_builtin_annotation_not_applied_consistency( + const eprosima::fastcdr::optional& ann_builtin); + + /** + * @brief Check CompleteAliasBody consistency. + * + * @param[in] complete_alias_body Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasBody is not consistent. + */ + static void complete_alias_body_consistency( + const CompleteAliasBody& complete_alias_body); + + /** + * @brief Check CompleteAliasHeader consistency. + * + * @param[in] complete_alias_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasHeader is not consistent. + */ + static void complete_alias_header_consistency( + const CompleteAliasHeader& complete_alias_header); + + /** + * @brief Check CompleteAliasType consistency. + * + * @param[in] complete_alias_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasType is not consistent. + */ + static void complete_alias_type_consistency( + const CompleteAliasType& complete_alias_type); + + /** + * @brief Check MinimalAliasType consistency. + * + * @param[in] minimal_alias_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalAliasType is not consistent. + */ + static void minimal_alias_type_consistency( + const MinimalAliasType& minimal_alias_type); + + /** + * @brief Check CompleteElementDetail consistency. + * + * @param[in] complete_element_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteElementDetail is not consistent. + */ + static void complete_element_detail_consistency( + const CompleteElementDetail& complete_element_detail); + + /** + * @brief Check CommonCollectionElement consistency. + * + * @param[in] common_collection_element Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonCollectionElement is not consistent. + */ + static void common_collection_element_consistency( + const CommonCollectionElement& common_collection_element); + + /** + * @brief Check CompleteCollectionElement consistency. + * + * @param[in] complete_collection_element Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteCollectionElement is not consistent. + */ + static void complete_collection_element_consistency( + const CompleteCollectionElement& complete_collection_element); + + /** + * @brief Check CompleteCollectionHeader consistency. + * + * @param[in] complete_collection_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteCollectionHeader is not consistent. + */ + static void complete_collection_header_consistency( + const CompleteCollectionHeader& complete_collection_header); + + /** + * @brief Check CompleteSequenceType consistency. + * + * @param[in] complete_sequence_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteSequenceType is not consistent. + */ + static void complete_sequence_type_consistency( + const CompleteSequenceType& complete_sequence_type); + + /** + * @brief Check MinimalSequenceType consistency. + * + * @param[in] minimal_sequence_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalSequenceType is not consistent. + */ + static void minimal_sequence_type_consistency( + const MinimalSequenceType& minimal_sequence_type); + + /** + * @brief Check CommonArrayHeader consistency. + * + * @param[in] common_array_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonArrayHeader is not consistent. + */ + static void common_array_header_consistency( + const CommonArrayHeader& common_array_header); + + /** + * @brief Check CompleteArrayHeader consistency. + * + * @param[in] complete_array_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteArrayHeader is not consistent. + */ + static void complete_array_header_consistency( + const CompleteArrayHeader& complete_array_header); + + /** + * @brief Check CompleteArrayType consistency. + * + * @param[in] complete_array_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteArrayType is not consistent. + */ + static void complete_array_type_consistency( + const CompleteArrayType& complete_array_type); + + /** + * @brief Check MinimalArrayType consistency. + * + * @param[in] minimal_array_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalArrayType is not consistent. + */ + static void minimal_array_type_consistency( + const MinimalArrayType& minimal_array_type); + + /** + * @brief Check CompleteMapType consistency. + * + * @param[in] complete_map_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteMapType is not consistent. + */ + static void complete_map_type_consistency( + const CompleteMapType& complete_map_type); + + /** + * @brief Check MinimalMapType consistency. + * + * @param[in] minimal_map_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalMapType is not consistent. + */ + static void minimal_map_type_consistency( + const MinimalMapType& minimal_map_type); + + /** + * @brief Check CommonEnumeratedLiteral consistency. + * + * @param[in] common_enumerated_literal Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonEnumeratedLiteral is not consistent. + */ + static void common_enumerated_literal_consistency( + const CommonEnumeratedLiteral& common_enumerated_literal); + + /** + * @brief Check CompleteEnumeratedLiteral consistency. + * + * @param[in] complete_enumerated_literal Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedLiteral is not consistent. + */ + static void complete_enumerated_literal_consistency( + const CompleteEnumeratedLiteral& complete_enumerated_literal); + + /** + * @brief Check CompleteEnumeratedLiteralSeq consistency. + * + * @param[in] complete_enumerated_literal_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedLiteralSeq is not consistent. + */ + static void complete_enumerated_literal_seq_consistency( + const CompleteEnumeratedLiteralSeq& complete_enumerated_literal_seq); + + /** + * @brief Check enumeration BitBound consistency. + * + * @param[in] bit_bound Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * BitBound is not consistent. + */ + static void enum_bit_bound_consistency( + BitBound bit_bound); + + /** + * @brief Check bitmask BitBound consistency. + * + * @param[in] bit_bound Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * BitBound is not consistent. + */ + static void bitmask_bit_bound_consistency( + BitBound bit_bound); + + /** + * @brief Check CommonEnumeratedHeader consistency. + * + * @param[in] common_enumerated_header Instance to be checked. + * @param[in] bitmask flag in case that the header corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonEnumeratedHeader is not consistent. + */ + static void common_enumerated_header_consistency( + const CommonEnumeratedHeader& common_enumerated_header, + bool bitmask = false); + + /** + * @brief Check CompleteEnumeratedHeader consistency. + * + * @param[in] complete_enumerated_header Instance to be checked. + * @param[in] bitmask Flag in case that the header corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedHeader is not consistent. + */ + static void complete_enumerated_header_consistency( + const CompleteEnumeratedHeader& complete_enumerated_header, + bool bitmask = false); + + /** + * @brief Check CompleteEnumeratedType consistency. + * + * @param[in] complete_enumerated_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedType is not consistent. + */ + static void complete_enumerated_type_consistency( + const CompleteEnumeratedType& complete_enumerated_type); + + /** + * @brief Check MinimalEnumeratedType consistency. + * + * @param[in] minimal_enumerated_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalEnumeratedType is not consistent. + */ + static void minimal_enumerated_type_consistency( + const MinimalEnumeratedType& minimal_enumerated_type); + + /** + * @brief Check bitflag position consistency. + * + * @param[in] position Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * bitflag position is not consistent. + */ + static void bit_position_consistency( + uint16_t position); + + /** + * @brief Check CommonBitflag consistency. + * + * @param[in] common_bitflag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonBitflag is not consistent. + */ + static void common_bitflag_consistency( + const CommonBitflag& common_bitflag); + + /** + * @brief Check CompleteBitflag consistency. + * + * @param[in] complete_bitflag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitflag is not consistent. + */ + static void complete_bitflag_consistency( + const CompleteBitflag& complete_bitflag); + + /** + * @brief Check CompleteBitflagSeq consistency. + * + * @param[in] complete_bitflag_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitflagSeq is not consistent. + */ + static void complete_bitflag_seq_consistency( + const CompleteBitflagSeq& complete_bitflag_seq); + + /** + * @brief Check CompleteBitmaskType consistency. + * + * @param[in] complete_bitmask_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitmaskType is not consistent. + */ + static void complete_bitmask_type_consistency( + const CompleteBitmaskType& complete_bitmask_type); + + /** + * @brief Check MinimalBitmaskType consistency. + * + * @param[in] minimal_bitmask_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalBitmaskType is not consistent. + */ + static void minimal_bitmask_type_consistency( + const MinimalBitmaskType& minimal_bitmask_type); + + /** + * @brief Check consistency between the holder type and the bitcount. + * + * @param[in] holder_type TypeKind of the bitfield holder type. + * @param[in] bitcount Bitfield number of bits. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given data is inconsistent. + */ + static void bitfield_holder_type_consistency( + TypeKind holder_type, + uint8_t bitcount); + + /** + * @brief Check CommonBitfield consistency. + * + * @param[in] common_bitfield Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonBitfield is not consistent. + */ + static void common_bitfield_consistency( + const CommonBitfield& common_bitfield); + + /** + * @brief Check CompleteBitfield consistency. + * + * @param[in] complete_bitfield Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitfield is not consistent. + */ + static void complete_bitfield_consistency( + const CompleteBitfield& complete_bitfield); + + /** + * @brief Check CompleteBitfieldSeq consistency. + * + * @param[in] complete_bitfield_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitfieldSeq is not consistent. + */ + static void complete_bitfield_seq_consistency( + const CompleteBitfieldSeq& complete_bitfield_seq); + + /** + * @brief Check CompleteBitsetHeader consistency. + * + * @param[in] complete_bitset_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitsetHeader is not consistent. + */ + static void complete_bitset_header_consistency( + const CompleteBitsetHeader& complete_bitset_header); + + /** + * @brief Check CompleteBitsetType consistency. + * + * @param[in] complete_bitset_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitsetType is not consistent. + */ + static void complete_bitset_type_consistency( + const CompleteBitsetType& complete_bitset_type); + + /** + * @brief Check MinimalBitsetType consistency. + * + * @param[in] minimal_bitset_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalBitsetType is not consistent. + */ + static void minimal_bitset_type_consistency( + const MinimalBitsetType& minimal_bitset_type); + + /** + * @brief Check CompleteTypeObject consistency. + * + * @param[in] complete_type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteTypeObject is not consistent. + */ + static void complete_type_object_consistency( + const CompleteTypeObject& complete_type_object); + + /** + * @brief Check MinimalTypeObject consistency. + * + * @param[in] minimal_type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalTypeObject is not consistent. + */ + static void minimal_type_object_consistency( + const MinimalTypeObject& minimal_type_object); +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl b/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl new file mode 100644 index 00000000000..0d4b5798529 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl @@ -0,0 +1,1077 @@ +/* dds-xtypes_typeobject.idl */ + +// The types in this file shall be serialized with XCDR encoding version 2 +module DDS { module XTypes { + + // ---------- Equivalence Kinds ------------------- + typedef octet EquivalenceKind; + const octet EK_MINIMAL = 0xF1; // 0x1111 0001 + const octet EK_COMPLETE = 0xF2; // 0x1111 0010 + const octet EK_BOTH = 0xF3; // 0x1111 0011 + + // ---------- TypeKinds (begin) ------------------- + typedef octet TypeKind; + + // Primitive TKs + const octet TK_NONE = 0x00; + const octet TK_BOOLEAN = 0x01; + const octet TK_BYTE = 0x02; + const octet TK_INT16 = 0x03; + const octet TK_INT32 = 0x04; + const octet TK_INT64 = 0x05; + const octet TK_UINT16 = 0x06; + const octet TK_UINT32 = 0x07; + const octet TK_UINT64 = 0x08; + const octet TK_FLOAT32 = 0x09; + const octet TK_FLOAT64 = 0x0A; + const octet TK_FLOAT128 = 0x0B; + const octet TK_INT8 = 0x0C; + const octet TK_UINT8 = 0x0D; + const octet TK_CHAR8 = 0x10; + const octet TK_CHAR16 = 0x11; + + // String TKs + const octet TK_STRING8 = 0x20; + const octet TK_STRING16 = 0x21; + + // Constructed/Named types + const octet TK_ALIAS = 0x30; + + // Enumerated TKs + const octet TK_ENUM = 0x40; + const octet TK_BITMASK = 0x41; + + // Structured TKs + const octet TK_ANNOTATION = 0x50; + const octet TK_STRUCTURE = 0x51; + const octet TK_UNION = 0x52; + const octet TK_BITSET = 0x53; + + // Collection TKs + const octet TK_SEQUENCE = 0x60; + const octet TK_ARRAY = 0x61; + const octet TK_MAP = 0x62; + // ---------- TypeKinds (end) ------------------- + + // ---------- Extra TypeIdentifiers (begin) ------------ + typedef octet TypeIdentiferKind; + const octet TI_STRING8_SMALL = 0x70; + const octet TI_STRING8_LARGE = 0x71; + const octet TI_STRING16_SMALL = 0x72; + const octet TI_STRING16_LARGE = 0x73; + + const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; + const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; + + const octet TI_PLAIN_ARRAY_SMALL = 0x90; + const octet TI_PLAIN_ARRAY_LARGE = 0x91; + + const octet TI_PLAIN_MAP_SMALL = 0xA0; + const octet TI_PLAIN_MAP_LARGE = 0xA1; + + const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; + // ---------- Extra TypeIdentifiers (end) -------------- + + // The name of some element (e.g. type, type member, module) + // Valid characters are alphanumeric plus the "_" cannot start with digit + const long MEMBER_NAME_MAX_LENGTH = 256; + typedef string MemberName; + + // Qualified type name includes the name of containing modules + // using "::" as separator. No leading "::". E.g. "MyModule::MyType" + const long TYPE_NAME_MAX_LENGTH = 256; + typedef string QualifiedTypeName; + + // Every type has an ID. Those of the primitive types are pre-defined. + typedef octet PrimitiveTypeId; + + // First 14 bytes of MD5 of the serialized TypeObject using XCDR + // version 2 with Little Endian encoding + typedef octet EquivalenceHash[14]; + + // First 4 bytes of MD5 of of a member name converted to bytes + // using UTF-8 encoding and without a 'nul' terminator. + // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} + typedef octet NameHash[4]; + + // Long Bound of a collection type + typedef unsigned long LBound; + typedef sequence LBoundSeq; + const LBound INVALID_LBOUND = 0; + + // Short Bound of a collection type + typedef octet SBound; + typedef sequence SBoundSeq; + const SBound INVALID_SBOUND = 0; + + @extensibility(FINAL) @nested + union TypeObjectHashId switch (octet) { + case EK_COMPLETE: + case EK_MINIMAL: + EquivalenceHash hash; + }; + + // Flags that apply to struct/union/collection/enum/bitmask/bitset + // members/elements and DO affect type assignability + // Depending on the flag it may not apply to members of all types + // When not all, the applicable member types are listed + @bit_bound(16) + bitmask MemberFlag { + @position(0) TRY_CONSTRUCT1, // T1 | 00 = INVALID, 01 = DISCARD + @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM + @position(2) IS_EXTERNAL, // X StructMember, UnionMember, + // CollectionElement + @position(3) IS_OPTIONAL, // O StructMember + @position(4) IS_MUST_UNDERSTAND, // M StructMember + @position(5) IS_KEY, // K StructMember, UnionDiscriminator + @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral + }; + typedef MemberFlag CollectionElementFlag; // T1, T2, X + typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X + typedef MemberFlag UnionMemberFlag; // T1, T2, D, X + typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K + typedef MemberFlag EnumeratedLiteralFlag; // D + typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply + typedef MemberFlag AliasMemberFlag; // Unused. No flags apply + typedef MemberFlag BitflagFlag; // Unused. No flags apply + typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply + + // Mask used to remove the flags that do no affect assignability + // Selects T1, T2, O, M, K, D + const unsigned short MemberFlagMinimalMask = 0x003f; + + // Flags that apply to type declarationa and DO affect assignability + // Depending on the flag it may not apply to all types + // When not all, the applicable types are listed + @bit_bound(16) + bitmask TypeFlag { + @position(0) IS_FINAL, // F | + @position(1) IS_APPENDABLE, // A |- Struct, Union + @position(2) IS_MUTABLE, // M | (exactly one flag) + + @position(3) IS_NESTED, // N Struct, Union + @position(4) IS_AUTOID_HASH // H Struct + }; + typedef TypeFlag StructTypeFlag; // All flags apply + typedef TypeFlag UnionTypeFlag; // All flags apply + typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply + typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply + typedef TypeFlag AliasTypeFlag; // Unused. No flags apply + typedef TypeFlag EnumTypeFlag; // Unused. No flags apply + typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply + typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply + + // Mask used to remove the flags that do no affect assignability + const unsigned short TypeFlagMinimalMask = 0x0007; // Selects M, A, F + + // Forward declaration + union TypeIdentifier; + + // 1 Byte + @extensibility(FINAL) @nested + struct StringSTypeDefn { + SBound bound; + }; + + // 4 Bytes + @extensibility(FINAL) @nested + struct StringLTypeDefn { + LBound bound; + }; + + @extensibility(FINAL) @nested + struct PlainCollectionHeader { + EquivalenceKind equiv_kind; + CollectionElementFlag element_flags; + }; + + @extensibility(FINAL) @nested + struct PlainSequenceSElemDefn { + PlainCollectionHeader header; + SBound bound; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainSequenceLElemDefn { + PlainCollectionHeader header; + LBound bound; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainArraySElemDefn { + PlainCollectionHeader header; + SBoundSeq array_bound_seq; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainArrayLElemDefn { + PlainCollectionHeader header; + LBoundSeq array_bound_seq; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainMapSTypeDefn { + PlainCollectionHeader header; + SBound bound; + @external TypeIdentifier element_identifier; + CollectionElementFlag key_flags; + @external TypeIdentifier key_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainMapLTypeDefn { + PlainCollectionHeader header; + LBound bound; + @external TypeIdentifier element_identifier; + CollectionElementFlag key_flags; + @external TypeIdentifier key_identifier; + }; + + // Used for Types that have cyclic depencencies with other types + @extensibility(APPENDABLE) @nested + struct StronglyConnectedComponentId { + TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent + long scc_length; // StronglyConnectedComponent.length + long scc_index ; // identify type in Strongly Connected Comp. + }; + + // Future extensibility + @extensibility(MUTABLE) @nested + struct ExtendedTypeDefn { + // Empty. Available for future extension + }; + + + + // The TypeIdentifier uniquely identifies a type (a set of equivalent + // types according to an equivalence relationship: COMPLETE, MNIMAL). + // + // In some cases (primitive types, strings, plain types) the identifier + // is a explicit description of the type. + // In other cases the Identifier is a Hash of the type description + // + // In the case of primitive types and strings the implied equivalence + // relation is the identity. + // + // For Plain Types and Hash-defined TypeIdentifiers there are three + // possibilities: MINIMAL, COMPLETE, and COMMON: + // - MINIMAL indicates the TypeIdentifier identifies equivalent types + // according to the MINIMAL equivalence relation + // - COMPLETE indicates the TypeIdentifier identifies equivalent types + // according to the COMPLETE equivalence relation + // - COMMON indicates the TypeIdentifier identifies equivalent types + // according to both the MINIMAL and the COMMON equivalence relation. + // This means the TypeIdentifier is the same for both relationships + // + @extensibility(FINAL) @nested + union TypeIdentifier switch (octet) { + // ============ Primitive types - use TypeKind ==================== + // All primitive types fall here. + // Commented-out because Unions cannot have cases with no member. + /* + case TK_NONE: + case TK_BOOLEAN: + case TK_BYTE_TYPE: + case TK_INT8_TYPE: + case TK_INT16_TYPE: + case TK_INT32_TYPE: + case TK_INT64_TYPE: + case TK_UINT8_TYPE: + case TK_UINT16_TYPE: + case TK_UINT32_TYPE: + case TK_UINT64_TYPE: + case TK_FLOAT32_TYPE: + case TK_FLOAT64_TYPE: + case TK_FLOAT128_TYPE: + case TK_CHAR8_TYPE: + case TK_CHAR16_TYPE: + // No Value + */ + + // ============ Strings - use TypeIdentifierKind =================== + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + StringSTypeDefn string_sdefn; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + StringLTypeDefn string_ldefn; + + // ============ Plain collectios - use TypeIdentifierKind ========= + case TI_PLAIN_SEQUENCE_SMALL: + PlainSequenceSElemDefn seq_sdefn; + case TI_PLAIN_SEQUENCE_LARGE: + PlainSequenceLElemDefn seq_ldefn; + + case TI_PLAIN_ARRAY_SMALL: + PlainArraySElemDefn array_sdefn; + case TI_PLAIN_ARRAY_LARGE: + PlainArrayLElemDefn array_ldefn; + + case TI_PLAIN_MAP_SMALL: + PlainMapSTypeDefn map_sdefn; + case TI_PLAIN_MAP_LARGE: + PlainMapLTypeDefn map_ldefn; + + // ============ Types that are mutually dependent on each other === + case TI_STRONGLY_CONNECTED_COMPONENT: + StronglyConnectedComponentId sc_component_id; + + // ============ The remaining cases - use EquivalenceKind ========= + case EK_COMPLETE: + case EK_MINIMAL: + EquivalenceHash equivalence_hash; + + // =================== Future extensibility ============ + // Future extensions + default: + ExtendedTypeDefn extended_defn; + }; + typedef sequence TypeIdentifierSeq; + + + // --- Annotation usage: ----------------------------------------------- + + // ID of a type member + typedef unsigned long MemberId; + const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128; + const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; + + @extensibility(MUTABLE) @nested + struct ExtendedAnnotationParameterValue { + // Empty. Available for future extension + }; + + /* Literal value of an annotation member: either the default value in its + * definition or the value applied in its usage. + */ + @extensibility(FINAL) @nested + union AnnotationParameterValue switch (octet) { + case TK_BOOLEAN: + boolean boolean_value; + case TK_BYTE: + octet byte_value; + case TK_INT8: + int8 int8_value; + case TK_UINT8: + uint8 uint8_value; + case TK_INT16: + short int16_value; + case TK_UINT16: + unsigned short uint_16_value; + case TK_INT32: + long int32_value; + case TK_UINT32: + unsigned long uint32_value; + case TK_INT64: + long long int64_value; + case TK_UINT64: + unsigned long long uint64_value; + case TK_FLOAT32: + float float32_value; + case TK_FLOAT64: + double float64_value; + case TK_FLOAT128: + long double float128_value; + case TK_CHAR8: + char char_value; + case TK_CHAR16: + wchar wchar_value; + case TK_ENUM: + long enumerated_value; + case TK_STRING8: + string string8_value; + case TK_STRING16: + wstring string16_value; + default: + ExtendedAnnotationParameterValue extended_value; + }; + + // The application of an annotation to some type or type member + @extensibility(APPENDABLE) @nested + struct AppliedAnnotationParameter { + NameHash paramname_hash; + AnnotationParameterValue value; + }; + // Sorted by AppliedAnnotationParameter.paramname_hash + typedef + sequence AppliedAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct AppliedAnnotation { + TypeIdentifier annotation_typeid; + @optional AppliedAnnotationParameterSeq param_seq; + }; + // Sorted by AppliedAnnotation.annotation_typeid + typedef sequence AppliedAnnotationSeq; + + // @verbatim(placement="", language="", text="") + @extensibility(FINAL) @nested + struct AppliedVerbatimAnnotation { + string<32> placement; + string<32> language; + string text; + }; + + + // --- Aggregate types: ------------------------------------------------ + @extensibility(APPENDABLE) @nested + struct AppliedBuiltinMemberAnnotations { + @optional string unit; // @unit("") + @optional AnnotationParameterValue min; // @min , @range + @optional AnnotationParameterValue max; // @max , @range + @optional string hash_id; // @hash_id("") + }; + + @extensibility(FINAL) @nested + struct CommonStructMember { + MemberId member_id; + StructMemberFlag member_flags; + TypeIdentifier member_type_id; + }; + + // COMPLETE Details for a member of an aggregate type + @extensibility(FINAL) @nested + struct CompleteMemberDetail { + MemberName name; + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + // MINIMAL Details for a member of an aggregate type + @extensibility(FINAL) @nested + struct MinimalMemberDetail { + NameHash name_hash; + }; + + // Member of an aggregate type + @extensibility(APPENDABLE) @nested + struct CompleteStructMember { + CommonStructMember common; + CompleteMemberDetail detail; + }; + // Ordered by the member_index + typedef sequence CompleteStructMemberSeq; + + // Member of an aggregate type + @extensibility(APPENDABLE) @nested + struct MinimalStructMember { + CommonStructMember common; + MinimalMemberDetail detail; + }; + // Ordered by common.member_id + typedef sequence MinimalStructMemberSeq; + + + @extensibility(APPENDABLE) @nested + struct AppliedBuiltinTypeAnnotations { + @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...) + }; + + @extensibility(FINAL) @nested + struct MinimalTypeDetail { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteTypeDetail { + @optional AppliedBuiltinTypeAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + QualifiedTypeName type_name; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteStructHeader { + TypeIdentifier base_type; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalStructHeader { + TypeIdentifier base_type; + MinimalTypeDetail detail; + }; + + @extensibility(FINAL) @nested + struct CompleteStructType { + StructTypeFlag struct_flags; + CompleteStructHeader header; + CompleteStructMemberSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalStructType { + StructTypeFlag struct_flags; + MinimalStructHeader header; + MinimalStructMemberSeq member_seq; + }; + + // --- Union: ---------------------------------------------------------- + + // Case labels that apply to a member of a union type + // Ordered by their values + typedef sequence UnionCaseLabelSeq; + + @extensibility(FINAL) @nested + struct CommonUnionMember { + MemberId member_id; + UnionMemberFlag member_flags; + TypeIdentifier type_id; + UnionCaseLabelSeq label_seq; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct CompleteUnionMember { + CommonUnionMember common; + CompleteMemberDetail detail; + }; + // Ordered by member_index + typedef sequence CompleteUnionMemberSeq; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct MinimalUnionMember { + CommonUnionMember common; + MinimalMemberDetail detail; + }; + // Ordered by MinimalUnionMember.common.member_id + typedef sequence MinimalUnionMemberSeq; + + @extensibility(FINAL) @nested + struct CommonDiscriminatorMember { + UnionDiscriminatorFlag member_flags; + TypeIdentifier type_id; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct CompleteDiscriminatorMember { + CommonDiscriminatorMember common; + @optional AppliedBuiltinTypeAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct MinimalDiscriminatorMember { + CommonDiscriminatorMember common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteUnionHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalUnionHeader { + MinimalTypeDetail detail; + }; + + @extensibility(FINAL) @nested + struct CompleteUnionType { + UnionTypeFlag union_flags; + CompleteUnionHeader header; + CompleteDiscriminatorMember discriminator; + CompleteUnionMemberSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalUnionType { + UnionTypeFlag union_flags; + MinimalUnionHeader header; + MinimalDiscriminatorMember discriminator; + MinimalUnionMemberSeq member_seq; + }; + + // --- Annotation: ---------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonAnnotationParameter { + AnnotationParameterFlag member_flags; + TypeIdentifier member_type_id; + }; + + // Member of an annotation type + @extensibility(APPENDABLE) @nested + struct CompleteAnnotationParameter { + CommonAnnotationParameter common; + MemberName name; + AnnotationParameterValue default_value; + }; + // Ordered by CompleteAnnotationParameter.name + typedef + sequence CompleteAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalAnnotationParameter { + CommonAnnotationParameter common; + NameHash name_hash; + AnnotationParameterValue default_value; + }; + // Ordered by MinimalAnnotationParameter.name_hash + typedef + sequence MinimalAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct CompleteAnnotationHeader { + QualifiedTypeName annotation_name; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAnnotationHeader { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteAnnotationType { + AnnotationTypeFlag annotation_flag; + CompleteAnnotationHeader header; + CompleteAnnotationParameterSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalAnnotationType { + AnnotationTypeFlag annotation_flag; + MinimalAnnotationHeader header; + MinimalAnnotationParameterSeq member_seq; + }; + + + // --- Alias: ---------------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonAliasBody { + AliasMemberFlag related_flags; + TypeIdentifier related_type; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteAliasBody { + CommonAliasBody common; + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAliasBody { + CommonAliasBody common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteAliasHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAliasHeader { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteAliasType { + AliasTypeFlag alias_flags; + CompleteAliasHeader header; + CompleteAliasBody body; + }; + + @extensibility(FINAL) @nested + struct MinimalAliasType { + AliasTypeFlag alias_flags; + MinimalAliasHeader header; + MinimalAliasBody body; + }; + + // --- Collections: ---------------------------------------------------- + @extensibility(FINAL) @nested + struct CompleteElementDetail { + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + @extensibility(FINAL) @nested + struct CommonCollectionElement { + CollectionElementFlag element_flags; + TypeIdentifier type; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteCollectionElement { + CommonCollectionElement common; + CompleteElementDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalCollectionElement { + CommonCollectionElement common; + }; + + @extensibility(FINAL) @nested + struct CommonCollectionHeader { + LBound bound; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteCollectionHeader { + CommonCollectionHeader common; + @optional CompleteTypeDetail detail; // not present for anonymous + }; + + @extensibility(APPENDABLE) @nested + struct MinimalCollectionHeader { + CommonCollectionHeader common; + }; + + // --- Sequence: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CompleteSequenceType { + CollectionTypeFlag collection_flag; + CompleteCollectionHeader header; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalSequenceType { + CollectionTypeFlag collection_flag; + MinimalCollectionHeader header; + MinimalCollectionElement element; + }; + + // --- Array: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CommonArrayHeader { + LBoundSeq bound_seq; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteArrayHeader { + CommonArrayHeader common; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalArrayHeader { + CommonArrayHeader common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteArrayType { + CollectionTypeFlag collection_flag; + CompleteArrayHeader header; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalArrayType { + CollectionTypeFlag collection_flag; + MinimalArrayHeader header; + MinimalCollectionElement element; + }; + + // --- Map: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CompleteMapType { + CollectionTypeFlag collection_flag; + CompleteCollectionHeader header; + CompleteCollectionElement key; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalMapType { + CollectionTypeFlag collection_flag; + MinimalCollectionHeader header; + MinimalCollectionElement key; + MinimalCollectionElement element; + }; + + // --- Enumeration: ---------------------------------------------------- + typedef unsigned short BitBound; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct CommonEnumeratedLiteral { + long value; + EnumeratedLiteralFlag flags; + }; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct CompleteEnumeratedLiteral { + CommonEnumeratedLiteral common; + CompleteMemberDetail detail; + }; + // Ordered by EnumeratedLiteral.common.value + typedef sequence CompleteEnumeratedLiteralSeq; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct MinimalEnumeratedLiteral { + CommonEnumeratedLiteral common; + MinimalMemberDetail detail; + }; + // Ordered by EnumeratedLiteral.common.value + typedef sequence MinimalEnumeratedLiteralSeq; + + @extensibility(FINAL) @nested + struct CommonEnumeratedHeader { + BitBound bit_bound; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteEnumeratedHeader { + CommonEnumeratedHeader common; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalEnumeratedHeader { + CommonEnumeratedHeader common; + }; + + // Enumerated type + @extensibility(FINAL) @nested + struct CompleteEnumeratedType { + EnumTypeFlag enum_flags; // unused + CompleteEnumeratedHeader header; + CompleteEnumeratedLiteralSeq literal_seq; + }; + + // Enumerated type + @extensibility(FINAL) @nested + struct MinimalEnumeratedType { + EnumTypeFlag enum_flags; // unused + MinimalEnumeratedHeader header; + MinimalEnumeratedLiteralSeq literal_seq; + }; + + // --- Bitmask: -------------------------------------------------------- + // Bit in a bit mask + @extensibility(FINAL) @nested + struct CommonBitflag { + unsigned short position; + BitflagFlag flags; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitflag { + CommonBitflag common; + CompleteMemberDetail detail; + }; + // Ordered by Bitflag.position + typedef sequence CompleteBitflagSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalBitflag { + CommonBitflag common; + MinimalMemberDetail detail; + }; + // Ordered by Bitflag.position + typedef sequence MinimalBitflagSeq; + + @extensibility(FINAL) @nested + struct CommonBitmaskHeader { + BitBound bit_bound; + }; + + typedef CompleteEnumeratedHeader CompleteBitmaskHeader; + + typedef MinimalEnumeratedHeader MinimalBitmaskHeader; + + @extensibility(APPENDABLE) @nested + struct CompleteBitmaskType { + BitmaskTypeFlag bitmask_flags; // unused + CompleteBitmaskHeader header; + CompleteBitflagSeq flag_seq; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitmaskType { + BitmaskTypeFlag bitmask_flags; // unused + MinimalBitmaskHeader header; + MinimalBitflagSeq flag_seq; + }; + + // --- Bitset: ---------------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonBitfield { + unsigned short position; + BitsetMemberFlag flags; + octet bitcount; + TypeKind holder_type; // Must be primitive integer type + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitfield { + CommonBitfield common; + CompleteMemberDetail detail; + }; + // Ordered by Bitfield.position + typedef sequence CompleteBitfieldSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalBitfield { + CommonBitfield common; + NameHash name_hash; + }; + // Ordered by Bitfield.position + typedef sequence MinimalBitfieldSeq; + + @extensibility(APPENDABLE) @nested + struct CompleteBitsetHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitsetHeader { + // Empty. Available for future extension + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitsetType { + BitsetTypeFlag bitset_flags; // unused + CompleteBitsetHeader header; + CompleteBitfieldSeq field_seq; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitsetType { + BitsetTypeFlag bitset_flags; // unused + MinimalBitsetHeader header; + MinimalBitfieldSeq field_seq; + }; + + // --- Type Object: --------------------------------------------------- + // The types associated with each case selection must have extensibility + // kind APPENDABLE or MUTABLE so that they can be extended in the future + + @extensibility(MUTABLE) @nested + struct CompleteExtendedType { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + union CompleteTypeObject switch (octet) { + case TK_ALIAS: + CompleteAliasType alias_type; + case TK_ANNOTATION: + CompleteAnnotationType annotation_type; + case TK_STRUCTURE: + CompleteStructType struct_type; + case TK_UNION: + CompleteUnionType union_type; + case TK_BITSET: + CompleteBitsetType bitset_type; + case TK_SEQUENCE: + CompleteSequenceType sequence_type; + case TK_ARRAY: + CompleteArrayType array_type; + case TK_MAP: + CompleteMapType map_type; + case TK_ENUM: + CompleteEnumeratedType enumerated_type; + case TK_BITMASK: + CompleteBitmaskType bitmask_type; + + // =================== Future extensibility ============ + default: + CompleteExtendedType extended_type; + }; + + @extensibility(MUTABLE) @nested + struct MinimalExtendedType { + // Empty. Available for future extension + }; + + + @extensibility(FINAL) @nested + union MinimalTypeObject switch (octet) { + case TK_ALIAS: + MinimalAliasType alias_type; + case TK_ANNOTATION: + MinimalAnnotationType annotation_type; + case TK_STRUCTURE: + MinimalStructType struct_type; + case TK_UNION: + MinimalUnionType union_type; + case TK_BITSET: + MinimalBitsetType bitset_type; + case TK_SEQUENCE: + MinimalSequenceType sequence_type; + case TK_ARRAY: + MinimalArrayType array_type; + case TK_MAP: + MinimalMapType map_type; + case TK_ENUM: + MinimalEnumeratedType enumerated_type; + case TK_BITMASK: + MinimalBitmaskType bitmask_type; + + // =================== Future extensibility ============ + default: + MinimalExtendedType extended_type; + }; + + @extensibility(APPENDABLE) @nested + union TypeObject switch (octet) { // EquivalenceKind + case EK_COMPLETE: + CompleteTypeObject complete; + case EK_MINIMAL: + MinimalTypeObject minimal; + }; + typedef sequence TypeObjectSeq; + + // Set of TypeObjects representing a strong component: Equivalence class + // for the Strong Connectivity relationship (mutual reachability between + // types). + // Ordered by fully qualified typename lexicographic order + typedef TypeObjectSeq StronglyConnectedComponent; + + @extensibility(FINAL) @nested + struct TypeIdentifierTypeObjectPair { + TypeIdentifier type_identifier; + TypeObject type_object; + }; + typedef + sequence TypeIdentifierTypeObjectPairSeq; + + @extensibility(FINAL) @nested + struct TypeIdentifierPair { + TypeIdentifier type_identifier1; + TypeIdentifier type_identifier2; + }; + typedef sequence TypeIdentifierPairSeq; + + @extensibility(APPENDABLE) @nested + struct TypeIdentfierWithSize { + DDS::XTypes::TypeIdentifier type_id; + unsigned long typeobject_serialized_size; + }; + typedef sequence TypeIdentfierWithSizeSeq; + + @extensibility(APPENDABLE) @nested + struct TypeIdentifierWithDependencies { + TypeIdentfierWithSize typeid_with_size; + // The total additional types related to minimal_type + long dependent_typeid_count; + sequence dependent_typeids; + }; + typedef + sequence TypeIdentifierWithDependenciesSeq; + + // This appears in the builtin DDS topics PublicationBuiltinTopicData + // and SubscriptionBuiltinTopicData + @extensibility(MUTABLE) @nested + struct TypeInformation { + @id(0x1001) TypeIdentifierWithDependencies minimal; + @id(0x1002) TypeIdentifierWithDependencies complete; + }; + typedef sequence TypeInformationSeq; + +}; // end of module XTypes +}; // end module DDS + + + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp new file mode 100644 index 00000000000..e230483cdce --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp @@ -0,0 +1,24387 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dds_xtypes_typeobject.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDS_XTYPES_TYPEOBJECT_SOURCE) +#define DDS_XTYPES_TYPEOBJECT_DllAPI __declspec( dllexport ) +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI __declspec( dllimport ) +#endif // DDS_XTYPES_TYPEOBJECT_SOURCE +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace xtypes { + + +typedef uint8_t EquivalenceKind; + +const uint8_t EK_MINIMAL = 0xF1; +const uint8_t EK_COMPLETE = 0xF2; +const uint8_t EK_BOTH = 0xF3; +typedef uint8_t TypeKind; + +const uint8_t TK_NONE = 0x00; +const uint8_t TK_BOOLEAN = 0x01; +const uint8_t TK_BYTE = 0x02; +const uint8_t TK_INT16 = 0x03; +const uint8_t TK_INT32 = 0x04; +const uint8_t TK_INT64 = 0x05; +const uint8_t TK_UINT16 = 0x06; +const uint8_t TK_UINT32 = 0x07; +const uint8_t TK_UINT64 = 0x08; +const uint8_t TK_FLOAT32 = 0x09; +const uint8_t TK_FLOAT64 = 0x0A; +const uint8_t TK_FLOAT128 = 0x0B; +const uint8_t TK_INT8 = 0x0C; +const uint8_t TK_UINT8 = 0x0D; +const uint8_t TK_CHAR8 = 0x10; +const uint8_t TK_CHAR16 = 0x11; +const uint8_t TK_STRING8 = 0x20; +const uint8_t TK_STRING16 = 0x21; +const uint8_t TK_ALIAS = 0x30; +const uint8_t TK_ENUM = 0x40; +const uint8_t TK_BITMASK = 0x41; +const uint8_t TK_ANNOTATION = 0x50; +const uint8_t TK_STRUCTURE = 0x51; +const uint8_t TK_UNION = 0x52; +const uint8_t TK_BITSET = 0x53; +const uint8_t TK_SEQUENCE = 0x60; +const uint8_t TK_ARRAY = 0x61; +const uint8_t TK_MAP = 0x62; +typedef uint8_t TypeIdentiferKind; + +const uint8_t TI_STRING8_SMALL = 0x70; +const uint8_t TI_STRING8_LARGE = 0x71; +const uint8_t TI_STRING16_SMALL = 0x72; +const uint8_t TI_STRING16_LARGE = 0x73; +const uint8_t TI_PLAIN_SEQUENCE_SMALL = 0x80; +const uint8_t TI_PLAIN_SEQUENCE_LARGE = 0x81; +const uint8_t TI_PLAIN_ARRAY_SMALL = 0x90; +const uint8_t TI_PLAIN_ARRAY_LARGE = 0x91; +const uint8_t TI_PLAIN_MAP_SMALL = 0xA0; +const uint8_t TI_PLAIN_MAP_LARGE = 0xA1; +const uint8_t TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; +const int32_t MEMBER_NAME_MAX_LENGTH = 256; +typedef eprosima::fastcdr::fixed_string MemberName; + +const int32_t TYPE_NAME_MAX_LENGTH = 256; +typedef eprosima::fastcdr::fixed_string QualifiedTypeName; + +typedef uint8_t PrimitiveTypeId; + +typedef std::array EquivalenceHash; + +typedef std::array NameHash; + +typedef uint32_t LBound; + +typedef std::vector LBoundSeq; + +const LBound INVALID_LBOUND = 0; +typedef uint8_t SBound; + +typedef std::vector SBoundSeq; + +const SBound INVALID_SBOUND = 0; +/*! + * @brief This class represents the union TypeObjectHashId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeObjectHashId +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeObjectHashId() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeObjectHashId() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId( + const TypeObjectHashId& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = x.m_hash; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId( + TypeObjectHashId&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = std::move(x.m_hash); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId& operator =( + const TypeObjectHashId& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = x.m_hash; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId& operator =( + TypeObjectHashId&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = std::move(x.m_hash); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeObjectHashId object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeObjectHashId& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_hash == x.m_hash); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeObjectHashId object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeObjectHashId& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EK_COMPLETE: + case EK_MINIMAL: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member hash + * @param _hash New value to be copied in member hash + */ + eProsima_user_DllExport void hash( + const EquivalenceHash& _hash) + { + hash_() = _hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member hash + * @param _hash New value to be moved in member hash + */ + eProsima_user_DllExport void hash( + EquivalenceHash&& _hash) + { + hash_() = _hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member hash + * @return Constant reference to member hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EquivalenceHash& hash() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_hash; + } + + /*! + * @brief This function returns a reference to member hash + * @return Reference to member hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EquivalenceHash& hash() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_hash; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + EquivalenceHash& hash_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_hash.~EquivalenceHash();}; + new(&m_hash) EquivalenceHash(); + ; + } + + return m_hash; + } + + + uint8_t m__d {0}; + + union + { + EquivalenceHash m_hash; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This enumeration represents the MemberFlag bitflags defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +enum MemberFlagBits : uint16_t +{ + TRY_CONSTRUCT1 = 0x01ull << 0, + TRY_CONSTRUCT2 = 0x01ull << 1, + IS_EXTERNAL = 0x01ull << 2, + IS_OPTIONAL = 0x01ull << 3, + IS_MUST_UNDERSTAND = 0x01ull << 4, + IS_KEY = 0x01ull << 5, + IS_DEFAULT = 0x01ull << 6 +}; +typedef uint16_t MemberFlag; +typedef MemberFlag CollectionElementFlag; + +typedef MemberFlag StructMemberFlag; + +typedef MemberFlag UnionMemberFlag; + +typedef MemberFlag UnionDiscriminatorFlag; + +typedef MemberFlag EnumeratedLiteralFlag; + +typedef MemberFlag AnnotationParameterFlag; + +typedef MemberFlag AliasMemberFlag; + +typedef MemberFlag BitflagFlag; + +typedef MemberFlag BitsetMemberFlag; + +const uint16_t MemberFlagMinimalMask = 0x003f; +/*! + * @brief This enumeration represents the TypeFlag bitflags defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +enum TypeFlagBits : uint16_t +{ + IS_FINAL = 0x01ull << 0, + IS_APPENDABLE = 0x01ull << 1, + IS_MUTABLE = 0x01ull << 2, + IS_NESTED = 0x01ull << 3, + IS_AUTOID_HASH = 0x01ull << 4 +}; +typedef uint16_t TypeFlag; +typedef TypeFlag StructTypeFlag; + +typedef TypeFlag UnionTypeFlag; + +typedef TypeFlag CollectionTypeFlag; + +typedef TypeFlag AnnotationTypeFlag; + +typedef TypeFlag AliasTypeFlag; + +typedef TypeFlag EnumTypeFlag; + +typedef TypeFlag BitmaskTypeFlag; + +typedef TypeFlag BitsetTypeFlag; + +const uint16_t TypeFlagMinimalMask = 0x0007; +class TypeIdentifier; + +/*! + * @brief This class represents the structure StringSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringSTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringSTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringSTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn( + const StringSTypeDefn& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn( + StringSTypeDefn&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn& operator =( + const StringSTypeDefn& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn& operator =( + StringSTypeDefn&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StringSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringSTypeDefn& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x StringSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringSTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + +private: + + SBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure StringLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringLTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringLTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringLTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn( + const StringLTypeDefn& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn( + StringLTypeDefn&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn& operator =( + const StringLTypeDefn& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn& operator =( + StringLTypeDefn&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StringLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringLTypeDefn& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x StringLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringLTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + +private: + + LBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure PlainCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader( + const PlainCollectionHeader& x) + { + m_equiv_kind = x.m_equiv_kind; + + m_element_flags = x.m_element_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader( + PlainCollectionHeader&& x) noexcept + { + m_equiv_kind = x.m_equiv_kind; + m_element_flags = std::move(x.m_element_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader& operator =( + const PlainCollectionHeader& x) + { + + m_equiv_kind = x.m_equiv_kind; + + m_element_flags = x.m_element_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader& operator =( + PlainCollectionHeader&& x) noexcept + { + + m_equiv_kind = x.m_equiv_kind; + m_element_flags = std::move(x.m_element_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainCollectionHeader& x) const + { + return (m_equiv_kind == x.m_equiv_kind && + m_element_flags == x.m_element_flags); + } + + /*! + * @brief Comparison operator. + * @param x PlainCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member equiv_kind + * @param _equiv_kind New value for member equiv_kind + */ + eProsima_user_DllExport void equiv_kind( + EquivalenceKind _equiv_kind) + { + m_equiv_kind = _equiv_kind; + } + + /*! + * @brief This function returns the value of member equiv_kind + * @return Value of member equiv_kind + */ + eProsima_user_DllExport EquivalenceKind equiv_kind() const + { + return m_equiv_kind; + } + + /*! + * @brief This function returns a reference to member equiv_kind + * @return Reference to member equiv_kind + */ + eProsima_user_DllExport EquivalenceKind& equiv_kind() + { + return m_equiv_kind; + } + + + /*! + * @brief This function copies the value in member element_flags + * @param _element_flags New value to be copied in member element_flags + */ + eProsima_user_DllExport void element_flags( + const CollectionElementFlag& _element_flags) + { + m_element_flags = _element_flags; + } + + /*! + * @brief This function moves the value in member element_flags + * @param _element_flags New value to be moved in member element_flags + */ + eProsima_user_DllExport void element_flags( + CollectionElementFlag&& _element_flags) + { + m_element_flags = std::move(_element_flags); + } + + /*! + * @brief This function returns a constant reference to member element_flags + * @return Constant reference to member element_flags + */ + eProsima_user_DllExport const CollectionElementFlag& element_flags() const + { + return m_element_flags; + } + + /*! + * @brief This function returns a reference to member element_flags + * @return Reference to member element_flags + */ + eProsima_user_DllExport CollectionElementFlag& element_flags() + { + return m_element_flags; + } + + + +private: + + EquivalenceKind m_equiv_kind{0}; + CollectionElementFlag m_element_flags{0}; + +}; +/*! + * @brief This class represents the structure PlainSequenceSElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceSElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainSequenceSElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainSequenceSElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn( + const PlainSequenceSElemDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn( + PlainSequenceSElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& operator =( + const PlainSequenceSElemDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& operator =( + PlainSequenceSElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceSElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainSequenceSElemDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceSElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainSequenceSElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainSequenceLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceLElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainSequenceLElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainSequenceLElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn( + const PlainSequenceLElemDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn( + PlainSequenceLElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& operator =( + const PlainSequenceLElemDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& operator =( + PlainSequenceLElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainSequenceLElemDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainSequenceLElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainArraySElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArraySElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainArraySElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainArraySElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn( + const PlainArraySElemDefn& x) + { + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn( + PlainArraySElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn& operator =( + const PlainArraySElemDefn& x) + { + + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn& operator =( + PlainArraySElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainArraySElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainArraySElemDefn& x) const + { + return (m_header == x.m_header && + m_array_bound_seq == x.m_array_bound_seq && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainArraySElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainArraySElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member array_bound_seq + * @param _array_bound_seq New value to be copied in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + const SBoundSeq& _array_bound_seq) + { + m_array_bound_seq = _array_bound_seq; + } + + /*! + * @brief This function moves the value in member array_bound_seq + * @param _array_bound_seq New value to be moved in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + SBoundSeq&& _array_bound_seq) + { + m_array_bound_seq = std::move(_array_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member array_bound_seq + * @return Constant reference to member array_bound_seq + */ + eProsima_user_DllExport const SBoundSeq& array_bound_seq() const + { + return m_array_bound_seq; + } + + /*! + * @brief This function returns a reference to member array_bound_seq + * @return Reference to member array_bound_seq + */ + eProsima_user_DllExport SBoundSeq& array_bound_seq() + { + return m_array_bound_seq; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBoundSeq m_array_bound_seq; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainArrayLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArrayLElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainArrayLElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainArrayLElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn( + const PlainArrayLElemDefn& x) + { + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn( + PlainArrayLElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn& operator =( + const PlainArrayLElemDefn& x) + { + + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn& operator =( + PlainArrayLElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainArrayLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainArrayLElemDefn& x) const + { + return (m_header == x.m_header && + m_array_bound_seq == x.m_array_bound_seq && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainArrayLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainArrayLElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member array_bound_seq + * @param _array_bound_seq New value to be copied in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + const LBoundSeq& _array_bound_seq) + { + m_array_bound_seq = _array_bound_seq; + } + + /*! + * @brief This function moves the value in member array_bound_seq + * @param _array_bound_seq New value to be moved in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + LBoundSeq&& _array_bound_seq) + { + m_array_bound_seq = std::move(_array_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member array_bound_seq + * @return Constant reference to member array_bound_seq + */ + eProsima_user_DllExport const LBoundSeq& array_bound_seq() const + { + return m_array_bound_seq; + } + + /*! + * @brief This function returns a reference to member array_bound_seq + * @return Reference to member array_bound_seq + */ + eProsima_user_DllExport LBoundSeq& array_bound_seq() + { + return m_array_bound_seq; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBoundSeq m_array_bound_seq; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainMapSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapSTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainMapSTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainMapSTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn( + const PlainMapSTypeDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn( + PlainMapSTypeDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn& operator =( + const PlainMapSTypeDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn& operator =( + PlainMapSTypeDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainMapSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainMapSTypeDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier && + m_key_flags == x.m_key_flags && + m_key_identifier == x.m_key_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainMapSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainMapSTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + /*! + * @brief This function copies the value in member key_flags + * @param _key_flags New value to be copied in member key_flags + */ + eProsima_user_DllExport void key_flags( + const CollectionElementFlag& _key_flags) + { + m_key_flags = _key_flags; + } + + /*! + * @brief This function moves the value in member key_flags + * @param _key_flags New value to be moved in member key_flags + */ + eProsima_user_DllExport void key_flags( + CollectionElementFlag&& _key_flags) + { + m_key_flags = std::move(_key_flags); + } + + /*! + * @brief This function returns a constant reference to member key_flags + * @return Constant reference to member key_flags + */ + eProsima_user_DllExport const CollectionElementFlag& key_flags() const + { + return m_key_flags; + } + + /*! + * @brief This function returns a reference to member key_flags + * @return Reference to member key_flags + */ + eProsima_user_DllExport CollectionElementFlag& key_flags() + { + return m_key_flags; + } + + + /*! + * @brief This function copies the value in member key_identifier + * @param _key_identifier New value to be copied in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + const eprosima::fastcdr::external& _key_identifier) + { + m_key_identifier = _key_identifier; + } + + /*! + * @brief This function moves the value in member key_identifier + * @param _key_identifier New value to be moved in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + eprosima::fastcdr::external&& _key_identifier) + { + m_key_identifier = std::move(_key_identifier); + } + + /*! + * @brief This function returns a constant reference to member key_identifier + * @return Constant reference to member key_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& key_identifier() const + { + return m_key_identifier; + } + + /*! + * @brief This function returns a reference to member key_identifier + * @return Reference to member key_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& key_identifier() + { + return m_key_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + CollectionElementFlag m_key_flags{0}; + eprosima::fastcdr::external m_key_identifier; + +}; +/*! + * @brief This class represents the structure PlainMapLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapLTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainMapLTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainMapLTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn( + const PlainMapLTypeDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn( + PlainMapLTypeDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn& operator =( + const PlainMapLTypeDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn& operator =( + PlainMapLTypeDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainMapLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainMapLTypeDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier && + m_key_flags == x.m_key_flags && + m_key_identifier == x.m_key_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainMapLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainMapLTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + /*! + * @brief This function copies the value in member key_flags + * @param _key_flags New value to be copied in member key_flags + */ + eProsima_user_DllExport void key_flags( + const CollectionElementFlag& _key_flags) + { + m_key_flags = _key_flags; + } + + /*! + * @brief This function moves the value in member key_flags + * @param _key_flags New value to be moved in member key_flags + */ + eProsima_user_DllExport void key_flags( + CollectionElementFlag&& _key_flags) + { + m_key_flags = std::move(_key_flags); + } + + /*! + * @brief This function returns a constant reference to member key_flags + * @return Constant reference to member key_flags + */ + eProsima_user_DllExport const CollectionElementFlag& key_flags() const + { + return m_key_flags; + } + + /*! + * @brief This function returns a reference to member key_flags + * @return Reference to member key_flags + */ + eProsima_user_DllExport CollectionElementFlag& key_flags() + { + return m_key_flags; + } + + + /*! + * @brief This function copies the value in member key_identifier + * @param _key_identifier New value to be copied in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + const eprosima::fastcdr::external& _key_identifier) + { + m_key_identifier = _key_identifier; + } + + /*! + * @brief This function moves the value in member key_identifier + * @param _key_identifier New value to be moved in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + eprosima::fastcdr::external&& _key_identifier) + { + m_key_identifier = std::move(_key_identifier); + } + + /*! + * @brief This function returns a constant reference to member key_identifier + * @return Constant reference to member key_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& key_identifier() const + { + return m_key_identifier; + } + + /*! + * @brief This function returns a reference to member key_identifier + * @return Reference to member key_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& key_identifier() + { + return m_key_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + CollectionElementFlag m_key_flags{0}; + eprosima::fastcdr::external m_key_identifier; + +}; +/*! + * @brief This class represents the structure StronglyConnectedComponentId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StronglyConnectedComponentId +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StronglyConnectedComponentId() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StronglyConnectedComponentId() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId( + const StronglyConnectedComponentId& x) + { + m_sc_component_id = x.m_sc_component_id; + + m_scc_length = x.m_scc_length; + + m_scc_index = x.m_scc_index; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId( + StronglyConnectedComponentId&& x) noexcept + { + m_sc_component_id = std::move(x.m_sc_component_id); + m_scc_length = x.m_scc_length; + m_scc_index = x.m_scc_index; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId& operator =( + const StronglyConnectedComponentId& x) + { + + m_sc_component_id = x.m_sc_component_id; + + m_scc_length = x.m_scc_length; + + m_scc_index = x.m_scc_index; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId& operator =( + StronglyConnectedComponentId&& x) noexcept + { + + m_sc_component_id = std::move(x.m_sc_component_id); + m_scc_length = x.m_scc_length; + m_scc_index = x.m_scc_index; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StronglyConnectedComponentId object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StronglyConnectedComponentId& x) const + { + return (m_sc_component_id == x.m_sc_component_id && + m_scc_length == x.m_scc_length && + m_scc_index == x.m_scc_index); + } + + /*! + * @brief Comparison operator. + * @param x StronglyConnectedComponentId object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StronglyConnectedComponentId& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member sc_component_id + * @param _sc_component_id New value to be copied in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + const TypeObjectHashId& _sc_component_id) + { + m_sc_component_id = _sc_component_id; + } + + /*! + * @brief This function moves the value in member sc_component_id + * @param _sc_component_id New value to be moved in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + TypeObjectHashId&& _sc_component_id) + { + m_sc_component_id = std::move(_sc_component_id); + } + + /*! + * @brief This function returns a constant reference to member sc_component_id + * @return Constant reference to member sc_component_id + */ + eProsima_user_DllExport const TypeObjectHashId& sc_component_id() const + { + return m_sc_component_id; + } + + /*! + * @brief This function returns a reference to member sc_component_id + * @return Reference to member sc_component_id + */ + eProsima_user_DllExport TypeObjectHashId& sc_component_id() + { + return m_sc_component_id; + } + + + /*! + * @brief This function sets a value in member scc_length + * @param _scc_length New value for member scc_length + */ + eProsima_user_DllExport void scc_length( + int32_t _scc_length) + { + m_scc_length = _scc_length; + } + + /*! + * @brief This function returns the value of member scc_length + * @return Value of member scc_length + */ + eProsima_user_DllExport int32_t scc_length() const + { + return m_scc_length; + } + + /*! + * @brief This function returns a reference to member scc_length + * @return Reference to member scc_length + */ + eProsima_user_DllExport int32_t& scc_length() + { + return m_scc_length; + } + + + /*! + * @brief This function sets a value in member scc_index + * @param _scc_index New value for member scc_index + */ + eProsima_user_DllExport void scc_index( + int32_t _scc_index) + { + m_scc_index = _scc_index; + } + + /*! + * @brief This function returns the value of member scc_index + * @return Value of member scc_index + */ + eProsima_user_DllExport int32_t scc_index() const + { + return m_scc_index; + } + + /*! + * @brief This function returns a reference to member scc_index + * @return Reference to member scc_index + */ + eProsima_user_DllExport int32_t& scc_index() + { + return m_scc_index; + } + + + +private: + + TypeObjectHashId m_sc_component_id; + int32_t m_scc_length{0}; + int32_t m_scc_index{0}; + +}; +/*! + * @brief This class represents the structure ExtendedTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExtendedTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExtendedTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn( + const ExtendedTypeDefn& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn( + ExtendedTypeDefn&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn& operator =( + const ExtendedTypeDefn& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn& operator =( + ExtendedTypeDefn&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExtendedTypeDefn& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExtendedTypeDefn& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union TypeIdentifier defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifier +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifier() + { + extended_defn_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifier() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier( + const TypeIdentifier& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = x.m_string_sdefn; + break; + + case 0x00000002: + string_ldefn_() = x.m_string_ldefn; + break; + + case 0x00000003: + seq_sdefn_() = x.m_seq_sdefn; + break; + + case 0x00000004: + seq_ldefn_() = x.m_seq_ldefn; + break; + + case 0x00000005: + array_sdefn_() = x.m_array_sdefn; + break; + + case 0x00000006: + array_ldefn_() = x.m_array_ldefn; + break; + + case 0x00000007: + map_sdefn_() = x.m_map_sdefn; + break; + + case 0x00000008: + map_ldefn_() = x.m_map_ldefn; + break; + + case 0x00000009: + sc_component_id_() = x.m_sc_component_id; + break; + + case 0x0000000a: + equivalence_hash_() = x.m_equivalence_hash; + break; + + case 0x0000000b: + extended_defn_() = x.m_extended_defn; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier( + TypeIdentifier&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = std::move(x.m_string_sdefn); + break; + + case 0x00000002: + string_ldefn_() = std::move(x.m_string_ldefn); + break; + + case 0x00000003: + seq_sdefn_() = std::move(x.m_seq_sdefn); + break; + + case 0x00000004: + seq_ldefn_() = std::move(x.m_seq_ldefn); + break; + + case 0x00000005: + array_sdefn_() = std::move(x.m_array_sdefn); + break; + + case 0x00000006: + array_ldefn_() = std::move(x.m_array_ldefn); + break; + + case 0x00000007: + map_sdefn_() = std::move(x.m_map_sdefn); + break; + + case 0x00000008: + map_ldefn_() = std::move(x.m_map_ldefn); + break; + + case 0x00000009: + sc_component_id_() = std::move(x.m_sc_component_id); + break; + + case 0x0000000a: + equivalence_hash_() = std::move(x.m_equivalence_hash); + break; + + case 0x0000000b: + extended_defn_() = std::move(x.m_extended_defn); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier& operator =( + const TypeIdentifier& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = x.m_string_sdefn; + break; + + case 0x00000002: + string_ldefn_() = x.m_string_ldefn; + break; + + case 0x00000003: + seq_sdefn_() = x.m_seq_sdefn; + break; + + case 0x00000004: + seq_ldefn_() = x.m_seq_ldefn; + break; + + case 0x00000005: + array_sdefn_() = x.m_array_sdefn; + break; + + case 0x00000006: + array_ldefn_() = x.m_array_ldefn; + break; + + case 0x00000007: + map_sdefn_() = x.m_map_sdefn; + break; + + case 0x00000008: + map_ldefn_() = x.m_map_ldefn; + break; + + case 0x00000009: + sc_component_id_() = x.m_sc_component_id; + break; + + case 0x0000000a: + equivalence_hash_() = x.m_equivalence_hash; + break; + + case 0x0000000b: + extended_defn_() = x.m_extended_defn; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier& operator =( + TypeIdentifier&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = std::move(x.m_string_sdefn); + break; + + case 0x00000002: + string_ldefn_() = std::move(x.m_string_ldefn); + break; + + case 0x00000003: + seq_sdefn_() = std::move(x.m_seq_sdefn); + break; + + case 0x00000004: + seq_ldefn_() = std::move(x.m_seq_ldefn); + break; + + case 0x00000005: + array_sdefn_() = std::move(x.m_array_sdefn); + break; + + case 0x00000006: + array_ldefn_() = std::move(x.m_array_ldefn); + break; + + case 0x00000007: + map_sdefn_() = std::move(x.m_map_sdefn); + break; + + case 0x00000008: + map_ldefn_() = std::move(x.m_map_ldefn); + break; + + case 0x00000009: + sc_component_id_() = std::move(x.m_sc_component_id); + break; + + case 0x0000000a: + equivalence_hash_() = std::move(x.m_equivalence_hash); + break; + + case 0x0000000b: + extended_defn_() = std::move(x.m_extended_defn); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifier object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifier& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_string_sdefn == x.m_string_sdefn); + break; + + case 0x00000002: + ret_value = (m_string_ldefn == x.m_string_ldefn); + break; + + case 0x00000003: + ret_value = (m_seq_sdefn == x.m_seq_sdefn); + break; + + case 0x00000004: + ret_value = (m_seq_ldefn == x.m_seq_ldefn); + break; + + case 0x00000005: + ret_value = (m_array_sdefn == x.m_array_sdefn); + break; + + case 0x00000006: + ret_value = (m_array_ldefn == x.m_array_ldefn); + break; + + case 0x00000007: + ret_value = (m_map_sdefn == x.m_map_sdefn); + break; + + case 0x00000008: + ret_value = (m_map_ldefn == x.m_map_ldefn); + break; + + case 0x00000009: + ret_value = (m_sc_component_id == x.m_sc_component_id); + break; + + case 0x0000000a: + ret_value = (m_equivalence_hash == x.m_equivalence_hash); + break; + + case 0x0000000b: + ret_value = (m_extended_defn == x.m_extended_defn); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifier object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifier& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_SEQUENCE_SMALL: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_SEQUENCE_LARGE: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_ARRAY_SMALL: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_ARRAY_LARGE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_MAP_SMALL: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_MAP_LARGE: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EK_COMPLETE: + case EK_MINIMAL: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member string_sdefn + * @param _string_sdefn New value to be copied in member string_sdefn + */ + eProsima_user_DllExport void string_sdefn( + const StringSTypeDefn& _string_sdefn) + { + string_sdefn_() = _string_sdefn; + m__d = TI_STRING8_SMALL; + } + + /*! + * @brief This function moves the value in member string_sdefn + * @param _string_sdefn New value to be moved in member string_sdefn + */ + eProsima_user_DllExport void string_sdefn( + StringSTypeDefn&& _string_sdefn) + { + string_sdefn_() = _string_sdefn; + m__d = TI_STRING8_SMALL; + } + + /*! + * @brief This function returns a constant reference to member string_sdefn + * @return Constant reference to member string_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StringSTypeDefn& string_sdefn() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_sdefn; + } + + /*! + * @brief This function returns a reference to member string_sdefn + * @return Reference to member string_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StringSTypeDefn& string_sdefn() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_sdefn; + } + + + /*! + * @brief This function copies the value in member string_ldefn + * @param _string_ldefn New value to be copied in member string_ldefn + */ + eProsima_user_DllExport void string_ldefn( + const StringLTypeDefn& _string_ldefn) + { + string_ldefn_() = _string_ldefn; + m__d = TI_STRING8_LARGE; + } + + /*! + * @brief This function moves the value in member string_ldefn + * @param _string_ldefn New value to be moved in member string_ldefn + */ + eProsima_user_DllExport void string_ldefn( + StringLTypeDefn&& _string_ldefn) + { + string_ldefn_() = _string_ldefn; + m__d = TI_STRING8_LARGE; + } + + /*! + * @brief This function returns a constant reference to member string_ldefn + * @return Constant reference to member string_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StringLTypeDefn& string_ldefn() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_ldefn; + } + + /*! + * @brief This function returns a reference to member string_ldefn + * @return Reference to member string_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StringLTypeDefn& string_ldefn() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_ldefn; + } + + + /*! + * @brief This function copies the value in member seq_sdefn + * @param _seq_sdefn New value to be copied in member seq_sdefn + */ + eProsima_user_DllExport void seq_sdefn( + const PlainSequenceSElemDefn& _seq_sdefn) + { + seq_sdefn_() = _seq_sdefn; + m__d = TI_PLAIN_SEQUENCE_SMALL; + } + + /*! + * @brief This function moves the value in member seq_sdefn + * @param _seq_sdefn New value to be moved in member seq_sdefn + */ + eProsima_user_DllExport void seq_sdefn( + PlainSequenceSElemDefn&& _seq_sdefn) + { + seq_sdefn_() = _seq_sdefn; + m__d = TI_PLAIN_SEQUENCE_SMALL; + } + + /*! + * @brief This function returns a constant reference to member seq_sdefn + * @return Constant reference to member seq_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainSequenceSElemDefn& seq_sdefn() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_sdefn; + } + + /*! + * @brief This function returns a reference to member seq_sdefn + * @return Reference to member seq_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& seq_sdefn() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_sdefn; + } + + + /*! + * @brief This function copies the value in member seq_ldefn + * @param _seq_ldefn New value to be copied in member seq_ldefn + */ + eProsima_user_DllExport void seq_ldefn( + const PlainSequenceLElemDefn& _seq_ldefn) + { + seq_ldefn_() = _seq_ldefn; + m__d = TI_PLAIN_SEQUENCE_LARGE; + } + + /*! + * @brief This function moves the value in member seq_ldefn + * @param _seq_ldefn New value to be moved in member seq_ldefn + */ + eProsima_user_DllExport void seq_ldefn( + PlainSequenceLElemDefn&& _seq_ldefn) + { + seq_ldefn_() = _seq_ldefn; + m__d = TI_PLAIN_SEQUENCE_LARGE; + } + + /*! + * @brief This function returns a constant reference to member seq_ldefn + * @return Constant reference to member seq_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainSequenceLElemDefn& seq_ldefn() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_ldefn; + } + + /*! + * @brief This function returns a reference to member seq_ldefn + * @return Reference to member seq_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& seq_ldefn() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_ldefn; + } + + + /*! + * @brief This function copies the value in member array_sdefn + * @param _array_sdefn New value to be copied in member array_sdefn + */ + eProsima_user_DllExport void array_sdefn( + const PlainArraySElemDefn& _array_sdefn) + { + array_sdefn_() = _array_sdefn; + m__d = TI_PLAIN_ARRAY_SMALL; + } + + /*! + * @brief This function moves the value in member array_sdefn + * @param _array_sdefn New value to be moved in member array_sdefn + */ + eProsima_user_DllExport void array_sdefn( + PlainArraySElemDefn&& _array_sdefn) + { + array_sdefn_() = _array_sdefn; + m__d = TI_PLAIN_ARRAY_SMALL; + } + + /*! + * @brief This function returns a constant reference to member array_sdefn + * @return Constant reference to member array_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainArraySElemDefn& array_sdefn() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_sdefn; + } + + /*! + * @brief This function returns a reference to member array_sdefn + * @return Reference to member array_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainArraySElemDefn& array_sdefn() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_sdefn; + } + + + /*! + * @brief This function copies the value in member array_ldefn + * @param _array_ldefn New value to be copied in member array_ldefn + */ + eProsima_user_DllExport void array_ldefn( + const PlainArrayLElemDefn& _array_ldefn) + { + array_ldefn_() = _array_ldefn; + m__d = TI_PLAIN_ARRAY_LARGE; + } + + /*! + * @brief This function moves the value in member array_ldefn + * @param _array_ldefn New value to be moved in member array_ldefn + */ + eProsima_user_DllExport void array_ldefn( + PlainArrayLElemDefn&& _array_ldefn) + { + array_ldefn_() = _array_ldefn; + m__d = TI_PLAIN_ARRAY_LARGE; + } + + /*! + * @brief This function returns a constant reference to member array_ldefn + * @return Constant reference to member array_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainArrayLElemDefn& array_ldefn() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_ldefn; + } + + /*! + * @brief This function returns a reference to member array_ldefn + * @return Reference to member array_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainArrayLElemDefn& array_ldefn() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_ldefn; + } + + + /*! + * @brief This function copies the value in member map_sdefn + * @param _map_sdefn New value to be copied in member map_sdefn + */ + eProsima_user_DllExport void map_sdefn( + const PlainMapSTypeDefn& _map_sdefn) + { + map_sdefn_() = _map_sdefn; + m__d = TI_PLAIN_MAP_SMALL; + } + + /*! + * @brief This function moves the value in member map_sdefn + * @param _map_sdefn New value to be moved in member map_sdefn + */ + eProsima_user_DllExport void map_sdefn( + PlainMapSTypeDefn&& _map_sdefn) + { + map_sdefn_() = _map_sdefn; + m__d = TI_PLAIN_MAP_SMALL; + } + + /*! + * @brief This function returns a constant reference to member map_sdefn + * @return Constant reference to member map_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainMapSTypeDefn& map_sdefn() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_sdefn; + } + + /*! + * @brief This function returns a reference to member map_sdefn + * @return Reference to member map_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainMapSTypeDefn& map_sdefn() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_sdefn; + } + + + /*! + * @brief This function copies the value in member map_ldefn + * @param _map_ldefn New value to be copied in member map_ldefn + */ + eProsima_user_DllExport void map_ldefn( + const PlainMapLTypeDefn& _map_ldefn) + { + map_ldefn_() = _map_ldefn; + m__d = TI_PLAIN_MAP_LARGE; + } + + /*! + * @brief This function moves the value in member map_ldefn + * @param _map_ldefn New value to be moved in member map_ldefn + */ + eProsima_user_DllExport void map_ldefn( + PlainMapLTypeDefn&& _map_ldefn) + { + map_ldefn_() = _map_ldefn; + m__d = TI_PLAIN_MAP_LARGE; + } + + /*! + * @brief This function returns a constant reference to member map_ldefn + * @return Constant reference to member map_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainMapLTypeDefn& map_ldefn() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_ldefn; + } + + /*! + * @brief This function returns a reference to member map_ldefn + * @return Reference to member map_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainMapLTypeDefn& map_ldefn() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_ldefn; + } + + + /*! + * @brief This function copies the value in member sc_component_id + * @param _sc_component_id New value to be copied in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + const StronglyConnectedComponentId& _sc_component_id) + { + sc_component_id_() = _sc_component_id; + m__d = TI_STRONGLY_CONNECTED_COMPONENT; + } + + /*! + * @brief This function moves the value in member sc_component_id + * @param _sc_component_id New value to be moved in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + StronglyConnectedComponentId&& _sc_component_id) + { + sc_component_id_() = _sc_component_id; + m__d = TI_STRONGLY_CONNECTED_COMPONENT; + } + + /*! + * @brief This function returns a constant reference to member sc_component_id + * @return Constant reference to member sc_component_id + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StronglyConnectedComponentId& sc_component_id() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sc_component_id; + } + + /*! + * @brief This function returns a reference to member sc_component_id + * @return Reference to member sc_component_id + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StronglyConnectedComponentId& sc_component_id() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sc_component_id; + } + + + /*! + * @brief This function copies the value in member equivalence_hash + * @param _equivalence_hash New value to be copied in member equivalence_hash + */ + eProsima_user_DllExport void equivalence_hash( + const EquivalenceHash& _equivalence_hash) + { + equivalence_hash_() = _equivalence_hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member equivalence_hash + * @param _equivalence_hash New value to be moved in member equivalence_hash + */ + eProsima_user_DllExport void equivalence_hash( + EquivalenceHash&& _equivalence_hash) + { + equivalence_hash_() = _equivalence_hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member equivalence_hash + * @return Constant reference to member equivalence_hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EquivalenceHash& equivalence_hash() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_equivalence_hash; + } + + /*! + * @brief This function returns a reference to member equivalence_hash + * @return Reference to member equivalence_hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EquivalenceHash& equivalence_hash() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_equivalence_hash; + } + + + /*! + * @brief This function copies the value in member extended_defn + * @param _extended_defn New value to be copied in member extended_defn + */ + eProsima_user_DllExport void extended_defn( + const ExtendedTypeDefn& _extended_defn) + { + extended_defn_() = _extended_defn; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_defn + * @param _extended_defn New value to be moved in member extended_defn + */ + eProsima_user_DllExport void extended_defn( + ExtendedTypeDefn&& _extended_defn) + { + extended_defn_() = _extended_defn; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_defn + * @return Constant reference to member extended_defn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const ExtendedTypeDefn& extended_defn() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_defn; + } + + /*! + * @brief This function returns a reference to member extended_defn + * @return Reference to member extended_defn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport ExtendedTypeDefn& extended_defn() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_defn; + } + + + +private: + + StringSTypeDefn& string_sdefn_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_string_sdefn.~StringSTypeDefn();}; + new(&m_string_sdefn) StringSTypeDefn(); + ; + } + + return m_string_sdefn; + } + + StringLTypeDefn& string_ldefn_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_string_ldefn.~StringLTypeDefn();}; + new(&m_string_ldefn) StringLTypeDefn(); + ; + } + + return m_string_ldefn; + } + + PlainSequenceSElemDefn& seq_sdefn_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_seq_sdefn.~PlainSequenceSElemDefn();}; + new(&m_seq_sdefn) PlainSequenceSElemDefn(); + ; + } + + return m_seq_sdefn; + } + + PlainSequenceLElemDefn& seq_ldefn_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_seq_ldefn.~PlainSequenceLElemDefn();}; + new(&m_seq_ldefn) PlainSequenceLElemDefn(); + ; + } + + return m_seq_ldefn; + } + + PlainArraySElemDefn& array_sdefn_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_array_sdefn.~PlainArraySElemDefn();}; + new(&m_array_sdefn) PlainArraySElemDefn(); + ; + } + + return m_array_sdefn; + } + + PlainArrayLElemDefn& array_ldefn_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_array_ldefn.~PlainArrayLElemDefn();}; + new(&m_array_ldefn) PlainArrayLElemDefn(); + ; + } + + return m_array_ldefn; + } + + PlainMapSTypeDefn& map_sdefn_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_map_sdefn.~PlainMapSTypeDefn();}; + new(&m_map_sdefn) PlainMapSTypeDefn(); + ; + } + + return m_map_sdefn; + } + + PlainMapLTypeDefn& map_ldefn_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_ldefn.~PlainMapLTypeDefn();}; + new(&m_map_ldefn) PlainMapLTypeDefn(); + ; + } + + return m_map_ldefn; + } + + StronglyConnectedComponentId& sc_component_id_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_sc_component_id.~StronglyConnectedComponentId();}; + new(&m_sc_component_id) StronglyConnectedComponentId(); + ; + } + + return m_sc_component_id; + } + + EquivalenceHash& equivalence_hash_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_equivalence_hash.~EquivalenceHash();}; + new(&m_equivalence_hash) EquivalenceHash(); + ; + } + + return m_equivalence_hash; + } + + ExtendedTypeDefn& extended_defn_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_defn.~ExtendedTypeDefn();}; + new(&m_extended_defn) ExtendedTypeDefn(); + ; + } + + return m_extended_defn; + } + + + uint8_t m__d {0}; + + union + { + StringSTypeDefn m_string_sdefn; + StringLTypeDefn m_string_ldefn; + PlainSequenceSElemDefn m_seq_sdefn; + PlainSequenceLElemDefn m_seq_ldefn; + PlainArraySElemDefn m_array_sdefn; + PlainArrayLElemDefn m_array_ldefn; + PlainMapSTypeDefn m_map_sdefn; + PlainMapLTypeDefn m_map_ldefn; + StronglyConnectedComponentId m_sc_component_id; + EquivalenceHash m_equivalence_hash; + ExtendedTypeDefn m_extended_defn; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +typedef std::vector TypeIdentifierSeq; + +typedef uint32_t MemberId; + +const uint32_t ANNOTATION_STR_VALUE_MAX_LEN = 128; +const uint32_t ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; +/*! + * @brief This class represents the structure ExtendedAnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedAnnotationParameterValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExtendedAnnotationParameterValue() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue( + const ExtendedAnnotationParameterValue& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue( + ExtendedAnnotationParameterValue&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& operator =( + const ExtendedAnnotationParameterValue& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& operator =( + ExtendedAnnotationParameterValue&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedAnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExtendedAnnotationParameterValue& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedAnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExtendedAnnotationParameterValue& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union AnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AnnotationParameterValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AnnotationParameterValue() + { + extended_value_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AnnotationParameterValue() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue( + const AnnotationParameterValue& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = x.m_boolean_value; + break; + + case 0x00000002: + byte_value_() = x.m_byte_value; + break; + + case 0x00000003: + int8_value_() = x.m_int8_value; + break; + + case 0x00000004: + uint8_value_() = x.m_uint8_value; + break; + + case 0x00000005: + int16_value_() = x.m_int16_value; + break; + + case 0x00000006: + uint_16_value_() = x.m_uint_16_value; + break; + + case 0x00000007: + int32_value_() = x.m_int32_value; + break; + + case 0x00000008: + uint32_value_() = x.m_uint32_value; + break; + + case 0x00000009: + int64_value_() = x.m_int64_value; + break; + + case 0x0000000a: + uint64_value_() = x.m_uint64_value; + break; + + case 0x0000000b: + float32_value_() = x.m_float32_value; + break; + + case 0x0000000c: + float64_value_() = x.m_float64_value; + break; + + case 0x0000000d: + float128_value_() = x.m_float128_value; + break; + + case 0x0000000e: + char_value_() = x.m_char_value; + break; + + case 0x0000000f: + wchar_value_() = x.m_wchar_value; + break; + + case 0x00000010: + enumerated_value_() = x.m_enumerated_value; + break; + + case 0x00000011: + string8_value_() = x.m_string8_value; + break; + + case 0x00000012: + string16_value_() = x.m_string16_value; + break; + + case 0x00000013: + extended_value_() = x.m_extended_value; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue( + AnnotationParameterValue&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = std::move(x.m_boolean_value); + break; + + case 0x00000002: + byte_value_() = std::move(x.m_byte_value); + break; + + case 0x00000003: + int8_value_() = std::move(x.m_int8_value); + break; + + case 0x00000004: + uint8_value_() = std::move(x.m_uint8_value); + break; + + case 0x00000005: + int16_value_() = std::move(x.m_int16_value); + break; + + case 0x00000006: + uint_16_value_() = std::move(x.m_uint_16_value); + break; + + case 0x00000007: + int32_value_() = std::move(x.m_int32_value); + break; + + case 0x00000008: + uint32_value_() = std::move(x.m_uint32_value); + break; + + case 0x00000009: + int64_value_() = std::move(x.m_int64_value); + break; + + case 0x0000000a: + uint64_value_() = std::move(x.m_uint64_value); + break; + + case 0x0000000b: + float32_value_() = std::move(x.m_float32_value); + break; + + case 0x0000000c: + float64_value_() = std::move(x.m_float64_value); + break; + + case 0x0000000d: + float128_value_() = std::move(x.m_float128_value); + break; + + case 0x0000000e: + char_value_() = std::move(x.m_char_value); + break; + + case 0x0000000f: + wchar_value_() = std::move(x.m_wchar_value); + break; + + case 0x00000010: + enumerated_value_() = std::move(x.m_enumerated_value); + break; + + case 0x00000011: + string8_value_() = std::move(x.m_string8_value); + break; + + case 0x00000012: + string16_value_() = std::move(x.m_string16_value); + break; + + case 0x00000013: + extended_value_() = std::move(x.m_extended_value); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue& operator =( + const AnnotationParameterValue& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = x.m_boolean_value; + break; + + case 0x00000002: + byte_value_() = x.m_byte_value; + break; + + case 0x00000003: + int8_value_() = x.m_int8_value; + break; + + case 0x00000004: + uint8_value_() = x.m_uint8_value; + break; + + case 0x00000005: + int16_value_() = x.m_int16_value; + break; + + case 0x00000006: + uint_16_value_() = x.m_uint_16_value; + break; + + case 0x00000007: + int32_value_() = x.m_int32_value; + break; + + case 0x00000008: + uint32_value_() = x.m_uint32_value; + break; + + case 0x00000009: + int64_value_() = x.m_int64_value; + break; + + case 0x0000000a: + uint64_value_() = x.m_uint64_value; + break; + + case 0x0000000b: + float32_value_() = x.m_float32_value; + break; + + case 0x0000000c: + float64_value_() = x.m_float64_value; + break; + + case 0x0000000d: + float128_value_() = x.m_float128_value; + break; + + case 0x0000000e: + char_value_() = x.m_char_value; + break; + + case 0x0000000f: + wchar_value_() = x.m_wchar_value; + break; + + case 0x00000010: + enumerated_value_() = x.m_enumerated_value; + break; + + case 0x00000011: + string8_value_() = x.m_string8_value; + break; + + case 0x00000012: + string16_value_() = x.m_string16_value; + break; + + case 0x00000013: + extended_value_() = x.m_extended_value; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue& operator =( + AnnotationParameterValue&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = std::move(x.m_boolean_value); + break; + + case 0x00000002: + byte_value_() = std::move(x.m_byte_value); + break; + + case 0x00000003: + int8_value_() = std::move(x.m_int8_value); + break; + + case 0x00000004: + uint8_value_() = std::move(x.m_uint8_value); + break; + + case 0x00000005: + int16_value_() = std::move(x.m_int16_value); + break; + + case 0x00000006: + uint_16_value_() = std::move(x.m_uint_16_value); + break; + + case 0x00000007: + int32_value_() = std::move(x.m_int32_value); + break; + + case 0x00000008: + uint32_value_() = std::move(x.m_uint32_value); + break; + + case 0x00000009: + int64_value_() = std::move(x.m_int64_value); + break; + + case 0x0000000a: + uint64_value_() = std::move(x.m_uint64_value); + break; + + case 0x0000000b: + float32_value_() = std::move(x.m_float32_value); + break; + + case 0x0000000c: + float64_value_() = std::move(x.m_float64_value); + break; + + case 0x0000000d: + float128_value_() = std::move(x.m_float128_value); + break; + + case 0x0000000e: + char_value_() = std::move(x.m_char_value); + break; + + case 0x0000000f: + wchar_value_() = std::move(x.m_wchar_value); + break; + + case 0x00000010: + enumerated_value_() = std::move(x.m_enumerated_value); + break; + + case 0x00000011: + string8_value_() = std::move(x.m_string8_value); + break; + + case 0x00000012: + string16_value_() = std::move(x.m_string16_value); + break; + + case 0x00000013: + extended_value_() = std::move(x.m_extended_value); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AnnotationParameterValue& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_boolean_value == x.m_boolean_value); + break; + + case 0x00000002: + ret_value = (m_byte_value == x.m_byte_value); + break; + + case 0x00000003: + ret_value = (m_int8_value == x.m_int8_value); + break; + + case 0x00000004: + ret_value = (m_uint8_value == x.m_uint8_value); + break; + + case 0x00000005: + ret_value = (m_int16_value == x.m_int16_value); + break; + + case 0x00000006: + ret_value = (m_uint_16_value == x.m_uint_16_value); + break; + + case 0x00000007: + ret_value = (m_int32_value == x.m_int32_value); + break; + + case 0x00000008: + ret_value = (m_uint32_value == x.m_uint32_value); + break; + + case 0x00000009: + ret_value = (m_int64_value == x.m_int64_value); + break; + + case 0x0000000a: + ret_value = (m_uint64_value == x.m_uint64_value); + break; + + case 0x0000000b: + ret_value = (m_float32_value == x.m_float32_value); + break; + + case 0x0000000c: + ret_value = (m_float64_value == x.m_float64_value); + break; + + case 0x0000000d: + ret_value = (m_float128_value == x.m_float128_value); + break; + + case 0x0000000e: + ret_value = (m_char_value == x.m_char_value); + break; + + case 0x0000000f: + ret_value = (m_wchar_value == x.m_wchar_value); + break; + + case 0x00000010: + ret_value = (m_enumerated_value == x.m_enumerated_value); + break; + + case 0x00000011: + ret_value = (m_string8_value == x.m_string8_value); + break; + + case 0x00000012: + ret_value = (m_string16_value == x.m_string16_value); + break; + + case 0x00000013: + ret_value = (m_extended_value == x.m_extended_value); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x AnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AnnotationParameterValue& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_BOOLEAN: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BYTE: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT8: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT8: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT16: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT16: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT32: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT32: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT64: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT64: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT32: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT64: + if (0x0000000c == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT128: + if (0x0000000d == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_CHAR8: + if (0x0000000e == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_CHAR16: + if (0x0000000f == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000010 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRING8: + if (0x00000011 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRING16: + if (0x00000012 == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x00000013 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function sets a value in member boolean_value + * @param _boolean_value New value for member boolean_value + */ + eProsima_user_DllExport void boolean_value( + bool _boolean_value) + { + boolean_value_() = _boolean_value; + m__d = TK_BOOLEAN; + } + + /*! + * @brief This function returns the value of member boolean_value + * @return Value of member boolean_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport bool boolean_value() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_boolean_value; + } + + /*! + * @brief This function returns a reference to member boolean_value + * @return Reference to member boolean_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport bool& boolean_value() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_boolean_value; + } + + + /*! + * @brief This function sets a value in member byte_value + * @param _byte_value New value for member byte_value + */ + eProsima_user_DllExport void byte_value( + uint8_t _byte_value) + { + byte_value_() = _byte_value; + m__d = TK_BYTE; + } + + /*! + * @brief This function returns the value of member byte_value + * @return Value of member byte_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t byte_value() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_byte_value; + } + + /*! + * @brief This function returns a reference to member byte_value + * @return Reference to member byte_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& byte_value() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_byte_value; + } + + + /*! + * @brief This function sets a value in member int8_value + * @param _int8_value New value for member int8_value + */ + eProsima_user_DllExport void int8_value( + int8_t _int8_value) + { + int8_value_() = _int8_value; + m__d = TK_INT8; + } + + /*! + * @brief This function returns the value of member int8_value + * @return Value of member int8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int8_t int8_value() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int8_value; + } + + /*! + * @brief This function returns a reference to member int8_value + * @return Reference to member int8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int8_t& int8_value() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int8_value; + } + + + /*! + * @brief This function sets a value in member uint8_value + * @param _uint8_value New value for member uint8_value + */ + eProsima_user_DllExport void uint8_value( + uint8_t _uint8_value) + { + uint8_value_() = _uint8_value; + m__d = TK_UINT8; + } + + /*! + * @brief This function returns the value of member uint8_value + * @return Value of member uint8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t uint8_value() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint8_value; + } + + /*! + * @brief This function returns a reference to member uint8_value + * @return Reference to member uint8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& uint8_value() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint8_value; + } + + + /*! + * @brief This function sets a value in member int16_value + * @param _int16_value New value for member int16_value + */ + eProsima_user_DllExport void int16_value( + int16_t _int16_value) + { + int16_value_() = _int16_value; + m__d = TK_INT16; + } + + /*! + * @brief This function returns the value of member int16_value + * @return Value of member int16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int16_t int16_value() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int16_value; + } + + /*! + * @brief This function returns a reference to member int16_value + * @return Reference to member int16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int16_t& int16_value() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int16_value; + } + + + /*! + * @brief This function sets a value in member uint_16_value + * @param _uint_16_value New value for member uint_16_value + */ + eProsima_user_DllExport void uint_16_value( + uint16_t _uint_16_value) + { + uint_16_value_() = _uint_16_value; + m__d = TK_UINT16; + } + + /*! + * @brief This function returns the value of member uint_16_value + * @return Value of member uint_16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint16_t uint_16_value() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint_16_value; + } + + /*! + * @brief This function returns a reference to member uint_16_value + * @return Reference to member uint_16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint16_t& uint_16_value() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint_16_value; + } + + + /*! + * @brief This function sets a value in member int32_value + * @param _int32_value New value for member int32_value + */ + eProsima_user_DllExport void int32_value( + int32_t _int32_value) + { + int32_value_() = _int32_value; + m__d = TK_INT32; + } + + /*! + * @brief This function returns the value of member int32_value + * @return Value of member int32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t int32_value() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int32_value; + } + + /*! + * @brief This function returns a reference to member int32_value + * @return Reference to member int32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& int32_value() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int32_value; + } + + + /*! + * @brief This function sets a value in member uint32_value + * @param _uint32_value New value for member uint32_value + */ + eProsima_user_DllExport void uint32_value( + uint32_t _uint32_value) + { + uint32_value_() = _uint32_value; + m__d = TK_UINT32; + } + + /*! + * @brief This function returns the value of member uint32_value + * @return Value of member uint32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint32_t uint32_value() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint32_value; + } + + /*! + * @brief This function returns a reference to member uint32_value + * @return Reference to member uint32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint32_t& uint32_value() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint32_value; + } + + + /*! + * @brief This function sets a value in member int64_value + * @param _int64_value New value for member int64_value + */ + eProsima_user_DllExport void int64_value( + int64_t _int64_value) + { + int64_value_() = _int64_value; + m__d = TK_INT64; + } + + /*! + * @brief This function returns the value of member int64_value + * @return Value of member int64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t int64_value() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int64_value; + } + + /*! + * @brief This function returns a reference to member int64_value + * @return Reference to member int64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& int64_value() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int64_value; + } + + + /*! + * @brief This function sets a value in member uint64_value + * @param _uint64_value New value for member uint64_value + */ + eProsima_user_DllExport void uint64_value( + uint64_t _uint64_value) + { + uint64_value_() = _uint64_value; + m__d = TK_UINT64; + } + + /*! + * @brief This function returns the value of member uint64_value + * @return Value of member uint64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint64_t uint64_value() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint64_value; + } + + /*! + * @brief This function returns a reference to member uint64_value + * @return Reference to member uint64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint64_t& uint64_value() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint64_value; + } + + + /*! + * @brief This function sets a value in member float32_value + * @param _float32_value New value for member float32_value + */ + eProsima_user_DllExport void float32_value( + float _float32_value) + { + float32_value_() = _float32_value; + m__d = TK_FLOAT32; + } + + /*! + * @brief This function returns the value of member float32_value + * @return Value of member float32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport float float32_value() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float32_value; + } + + /*! + * @brief This function returns a reference to member float32_value + * @return Reference to member float32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport float& float32_value() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float32_value; + } + + + /*! + * @brief This function sets a value in member float64_value + * @param _float64_value New value for member float64_value + */ + eProsima_user_DllExport void float64_value( + double _float64_value) + { + float64_value_() = _float64_value; + m__d = TK_FLOAT64; + } + + /*! + * @brief This function returns the value of member float64_value + * @return Value of member float64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport double float64_value() const + { + if (0x0000000c != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float64_value; + } + + /*! + * @brief This function returns a reference to member float64_value + * @return Reference to member float64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport double& float64_value() + { + if (0x0000000c != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float64_value; + } + + + /*! + * @brief This function sets a value in member float128_value + * @param _float128_value New value for member float128_value + */ + eProsima_user_DllExport void float128_value( + long double _float128_value) + { + float128_value_() = _float128_value; + m__d = TK_FLOAT128; + } + + /*! + * @brief This function returns the value of member float128_value + * @return Value of member float128_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport long double float128_value() const + { + if (0x0000000d != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float128_value; + } + + /*! + * @brief This function returns a reference to member float128_value + * @return Reference to member float128_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport long double& float128_value() + { + if (0x0000000d != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float128_value; + } + + + /*! + * @brief This function sets a value in member char_value + * @param _char_value New value for member char_value + */ + eProsima_user_DllExport void char_value( + char _char_value) + { + char_value_() = _char_value; + m__d = TK_CHAR8; + } + + /*! + * @brief This function returns the value of member char_value + * @return Value of member char_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport char char_value() const + { + if (0x0000000e != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_char_value; + } + + /*! + * @brief This function returns a reference to member char_value + * @return Reference to member char_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport char& char_value() + { + if (0x0000000e != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_char_value; + } + + + /*! + * @brief This function sets a value in member wchar_value + * @param _wchar_value New value for member wchar_value + */ + eProsima_user_DllExport void wchar_value( + wchar_t _wchar_value) + { + wchar_value_() = _wchar_value; + m__d = TK_CHAR16; + } + + /*! + * @brief This function returns the value of member wchar_value + * @return Value of member wchar_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport wchar_t wchar_value() const + { + if (0x0000000f != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_wchar_value; + } + + /*! + * @brief This function returns a reference to member wchar_value + * @return Reference to member wchar_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport wchar_t& wchar_value() + { + if (0x0000000f != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_wchar_value; + } + + + /*! + * @brief This function sets a value in member enumerated_value + * @param _enumerated_value New value for member enumerated_value + */ + eProsima_user_DllExport void enumerated_value( + int32_t _enumerated_value) + { + enumerated_value_() = _enumerated_value; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns the value of member enumerated_value + * @return Value of member enumerated_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t enumerated_value() const + { + if (0x00000010 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_value; + } + + /*! + * @brief This function returns a reference to member enumerated_value + * @return Reference to member enumerated_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& enumerated_value() + { + if (0x00000010 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_value; + } + + + /*! + * @brief This function copies the value in member string8_value + * @param _string8_value New value to be copied in member string8_value + */ + eProsima_user_DllExport void string8_value( + const eprosima::fastcdr::fixed_string& _string8_value) + { + string8_value_() = _string8_value; + m__d = TK_STRING8; + } + + /*! + * @brief This function moves the value in member string8_value + * @param _string8_value New value to be moved in member string8_value + */ + eProsima_user_DllExport void string8_value( + eprosima::fastcdr::fixed_string&& _string8_value) + { + string8_value_() = _string8_value; + m__d = TK_STRING8; + } + + /*! + * @brief This function returns a constant reference to member string8_value + * @return Constant reference to member string8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string& string8_value() const + { + if (0x00000011 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string8_value; + } + + /*! + * @brief This function returns a reference to member string8_value + * @return Reference to member string8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string& string8_value() + { + if (0x00000011 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string8_value; + } + + + /*! + * @brief This function copies the value in member string16_value + * @param _string16_value New value to be copied in member string16_value + */ + eProsima_user_DllExport void string16_value( + const std::wstring& _string16_value) + { + string16_value_() = _string16_value; + m__d = TK_STRING16; + } + + /*! + * @brief This function moves the value in member string16_value + * @param _string16_value New value to be moved in member string16_value + */ + eProsima_user_DllExport void string16_value( + std::wstring&& _string16_value) + { + string16_value_() = _string16_value; + m__d = TK_STRING16; + } + + /*! + * @brief This function returns a constant reference to member string16_value + * @return Constant reference to member string16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::wstring& string16_value() const + { + if (0x00000012 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string16_value; + } + + /*! + * @brief This function returns a reference to member string16_value + * @return Reference to member string16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::wstring& string16_value() + { + if (0x00000012 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string16_value; + } + + + /*! + * @brief This function copies the value in member extended_value + * @param _extended_value New value to be copied in member extended_value + */ + eProsima_user_DllExport void extended_value( + const ExtendedAnnotationParameterValue& _extended_value) + { + extended_value_() = _extended_value; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_value + * @param _extended_value New value to be moved in member extended_value + */ + eProsima_user_DllExport void extended_value( + ExtendedAnnotationParameterValue&& _extended_value) + { + extended_value_() = _extended_value; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_value + * @return Constant reference to member extended_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const ExtendedAnnotationParameterValue& extended_value() const + { + if (0x00000013 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_value; + } + + /*! + * @brief This function returns a reference to member extended_value + * @return Reference to member extended_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& extended_value() + { + if (0x00000013 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_value; + } + + + +private: + + bool& boolean_value_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = nullptr; + m_boolean_value = {false}; + ; + } + + return m_boolean_value; + } + + uint8_t& byte_value_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = nullptr; + m_byte_value = {0}; + ; + } + + return m_byte_value; + } + + int8_t& int8_value_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = nullptr; + m_int8_value = {0}; + ; + } + + return m_int8_value; + } + + uint8_t& uint8_value_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = nullptr; + m_uint8_value = {0}; + ; + } + + return m_uint8_value; + } + + int16_t& int16_value_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = nullptr; + m_int16_value = {0}; + ; + } + + return m_int16_value; + } + + uint16_t& uint_16_value_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = nullptr; + m_uint_16_value = {0}; + ; + } + + return m_uint_16_value; + } + + int32_t& int32_value_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = nullptr; + m_int32_value = {0}; + ; + } + + return m_int32_value; + } + + uint32_t& uint32_value_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = nullptr; + m_uint32_value = {0}; + ; + } + + return m_uint32_value; + } + + int64_t& int64_value_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = nullptr; + m_int64_value = {0}; + ; + } + + return m_int64_value; + } + + uint64_t& uint64_value_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = nullptr; + m_uint64_value = {0}; + ; + } + + return m_uint64_value; + } + + float& float32_value_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = nullptr; + m_float32_value = {0.0}; + ; + } + + return m_float32_value; + } + + double& float64_value_() + { + if (0x0000000c != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000c; + member_destructor_ = nullptr; + m_float64_value = {0.0}; + ; + } + + return m_float64_value; + } + + long double& float128_value_() + { + if (0x0000000d != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000d; + member_destructor_ = nullptr; + m_float128_value = {0.0}; + ; + } + + return m_float128_value; + } + + char& char_value_() + { + if (0x0000000e != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000e; + member_destructor_ = nullptr; + m_char_value = {0}; + ; + } + + return m_char_value; + } + + wchar_t& wchar_value_() + { + if (0x0000000f != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000f; + member_destructor_ = nullptr; + m_wchar_value = {0}; + ; + } + + return m_wchar_value; + } + + int32_t& enumerated_value_() + { + if (0x00000010 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000010; + member_destructor_ = nullptr; + m_enumerated_value = {0}; + ; + } + + return m_enumerated_value; + } + + eprosima::fastcdr::fixed_string& string8_value_() + { + if (0x00000011 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000011; + member_destructor_ = [&]() {m_string8_value.~fixed_string();}; + new(&m_string8_value) eprosima::fastcdr::fixed_string(); + ; + } + + return m_string8_value; + } + + std::wstring& string16_value_() + { + if (0x00000012 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000012; + member_destructor_ = [&]() {m_string16_value.~basic_string();}; + new(&m_string16_value) std::wstring(); + ; + } + + return m_string16_value; + } + + ExtendedAnnotationParameterValue& extended_value_() + { + if (0x00000013 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000013; + member_destructor_ = [&]() {m_extended_value.~ExtendedAnnotationParameterValue();}; + new(&m_extended_value) ExtendedAnnotationParameterValue(); + ; + } + + return m_extended_value; + } + + + uint8_t m__d {0}; + + union + { + bool m_boolean_value; + uint8_t m_byte_value; + int8_t m_int8_value; + uint8_t m_uint8_value; + int16_t m_int16_value; + uint16_t m_uint_16_value; + int32_t m_int32_value; + uint32_t m_uint32_value; + int64_t m_int64_value; + uint64_t m_uint64_value; + float m_float32_value; + double m_float64_value; + long double m_float128_value; + char m_char_value; + wchar_t m_wchar_value; + int32_t m_enumerated_value; + eprosima::fastcdr::fixed_string m_string8_value; + std::wstring m_string16_value; + ExtendedAnnotationParameterValue m_extended_value; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure AppliedAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter( + const AppliedAnnotationParameter& x) + { + m_paramname_hash = x.m_paramname_hash; + + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter( + AppliedAnnotationParameter&& x) noexcept + { + m_paramname_hash = std::move(x.m_paramname_hash); + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter& operator =( + const AppliedAnnotationParameter& x) + { + + m_paramname_hash = x.m_paramname_hash; + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter& operator =( + AppliedAnnotationParameter&& x) noexcept + { + + m_paramname_hash = std::move(x.m_paramname_hash); + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedAnnotationParameter& x) const + { + return (m_paramname_hash == x.m_paramname_hash && + m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member paramname_hash + * @param _paramname_hash New value to be copied in member paramname_hash + */ + eProsima_user_DllExport void paramname_hash( + const NameHash& _paramname_hash) + { + m_paramname_hash = _paramname_hash; + } + + /*! + * @brief This function moves the value in member paramname_hash + * @param _paramname_hash New value to be moved in member paramname_hash + */ + eProsima_user_DllExport void paramname_hash( + NameHash&& _paramname_hash) + { + m_paramname_hash = std::move(_paramname_hash); + } + + /*! + * @brief This function returns a constant reference to member paramname_hash + * @return Constant reference to member paramname_hash + */ + eProsima_user_DllExport const NameHash& paramname_hash() const + { + return m_paramname_hash; + } + + /*! + * @brief This function returns a reference to member paramname_hash + * @return Reference to member paramname_hash + */ + eProsima_user_DllExport NameHash& paramname_hash() + { + return m_paramname_hash; + } + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const AnnotationParameterValue& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + AnnotationParameterValue&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const AnnotationParameterValue& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport AnnotationParameterValue& value() + { + return m_value; + } + + + +private: + + NameHash m_paramname_hash{0}; + AnnotationParameterValue m_value; + +}; +typedef std::vector AppliedAnnotationParameterSeq; + +/*! + * @brief This class represents the structure AppliedAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedAnnotation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedAnnotation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation( + const AppliedAnnotation& x) + { + m_annotation_typeid = x.m_annotation_typeid; + + m_param_seq = x.m_param_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation( + AppliedAnnotation&& x) noexcept + { + m_annotation_typeid = std::move(x.m_annotation_typeid); + m_param_seq = std::move(x.m_param_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation& operator =( + const AppliedAnnotation& x) + { + + m_annotation_typeid = x.m_annotation_typeid; + + m_param_seq = x.m_param_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation& operator =( + AppliedAnnotation&& x) noexcept + { + + m_annotation_typeid = std::move(x.m_annotation_typeid); + m_param_seq = std::move(x.m_param_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedAnnotation& x) const + { + return (m_annotation_typeid == x.m_annotation_typeid && + m_param_seq == x.m_param_seq); + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedAnnotation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_typeid + * @param _annotation_typeid New value to be copied in member annotation_typeid + */ + eProsima_user_DllExport void annotation_typeid( + const TypeIdentifier& _annotation_typeid) + { + m_annotation_typeid = _annotation_typeid; + } + + /*! + * @brief This function moves the value in member annotation_typeid + * @param _annotation_typeid New value to be moved in member annotation_typeid + */ + eProsima_user_DllExport void annotation_typeid( + TypeIdentifier&& _annotation_typeid) + { + m_annotation_typeid = std::move(_annotation_typeid); + } + + /*! + * @brief This function returns a constant reference to member annotation_typeid + * @return Constant reference to member annotation_typeid + */ + eProsima_user_DllExport const TypeIdentifier& annotation_typeid() const + { + return m_annotation_typeid; + } + + /*! + * @brief This function returns a reference to member annotation_typeid + * @return Reference to member annotation_typeid + */ + eProsima_user_DllExport TypeIdentifier& annotation_typeid() + { + return m_annotation_typeid; + } + + + /*! + * @brief This function copies the value in member param_seq + * @param _param_seq New value to be copied in member param_seq + */ + eProsima_user_DllExport void param_seq( + const eprosima::fastcdr::optional& _param_seq) + { + m_param_seq = _param_seq; + } + + /*! + * @brief This function moves the value in member param_seq + * @param _param_seq New value to be moved in member param_seq + */ + eProsima_user_DllExport void param_seq( + eprosima::fastcdr::optional&& _param_seq) + { + m_param_seq = std::move(_param_seq); + } + + /*! + * @brief This function returns a constant reference to member param_seq + * @return Constant reference to member param_seq + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& param_seq() const + { + return m_param_seq; + } + + /*! + * @brief This function returns a reference to member param_seq + * @return Reference to member param_seq + */ + eProsima_user_DllExport eprosima::fastcdr::optional& param_seq() + { + return m_param_seq; + } + + + +private: + + TypeIdentifier m_annotation_typeid; + eprosima::fastcdr::optional m_param_seq; + +}; +typedef std::vector AppliedAnnotationSeq; + +/*! + * @brief This class represents the structure AppliedVerbatimAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedVerbatimAnnotation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedVerbatimAnnotation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation( + const AppliedVerbatimAnnotation& x) + { + m_placement = x.m_placement; + + m_language = x.m_language; + + m_text = x.m_text; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation( + AppliedVerbatimAnnotation&& x) noexcept + { + m_placement = std::move(x.m_placement); + m_language = std::move(x.m_language); + m_text = std::move(x.m_text); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation& operator =( + const AppliedVerbatimAnnotation& x) + { + + m_placement = x.m_placement; + + m_language = x.m_language; + + m_text = x.m_text; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation& operator =( + AppliedVerbatimAnnotation&& x) noexcept + { + + m_placement = std::move(x.m_placement); + m_language = std::move(x.m_language); + m_text = std::move(x.m_text); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedVerbatimAnnotation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedVerbatimAnnotation& x) const + { + return (m_placement == x.m_placement && + m_language == x.m_language && + m_text == x.m_text); + } + + /*! + * @brief Comparison operator. + * @param x AppliedVerbatimAnnotation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedVerbatimAnnotation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member placement + * @param _placement New value to be copied in member placement + */ + eProsima_user_DllExport void placement( + const eprosima::fastcdr::fixed_string<32>& _placement) + { + m_placement = _placement; + } + + /*! + * @brief This function moves the value in member placement + * @param _placement New value to be moved in member placement + */ + eProsima_user_DllExport void placement( + eprosima::fastcdr::fixed_string<32>&& _placement) + { + m_placement = std::move(_placement); + } + + /*! + * @brief This function returns a constant reference to member placement + * @return Constant reference to member placement + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<32>& placement() const + { + return m_placement; + } + + /*! + * @brief This function returns a reference to member placement + * @return Reference to member placement + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<32>& placement() + { + return m_placement; + } + + + /*! + * @brief This function copies the value in member language + * @param _language New value to be copied in member language + */ + eProsima_user_DllExport void language( + const eprosima::fastcdr::fixed_string<32>& _language) + { + m_language = _language; + } + + /*! + * @brief This function moves the value in member language + * @param _language New value to be moved in member language + */ + eProsima_user_DllExport void language( + eprosima::fastcdr::fixed_string<32>&& _language) + { + m_language = std::move(_language); + } + + /*! + * @brief This function returns a constant reference to member language + * @return Constant reference to member language + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<32>& language() const + { + return m_language; + } + + /*! + * @brief This function returns a reference to member language + * @return Reference to member language + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<32>& language() + { + return m_language; + } + + + /*! + * @brief This function copies the value in member text + * @param _text New value to be copied in member text + */ + eProsima_user_DllExport void text( + const std::string& _text) + { + m_text = _text; + } + + /*! + * @brief This function moves the value in member text + * @param _text New value to be moved in member text + */ + eProsima_user_DllExport void text( + std::string&& _text) + { + m_text = std::move(_text); + } + + /*! + * @brief This function returns a constant reference to member text + * @return Constant reference to member text + */ + eProsima_user_DllExport const std::string& text() const + { + return m_text; + } + + /*! + * @brief This function returns a reference to member text + * @return Reference to member text + */ + eProsima_user_DllExport std::string& text() + { + return m_text; + } + + + +private: + + eprosima::fastcdr::fixed_string<32> m_placement; + eprosima::fastcdr::fixed_string<32> m_language; + std::string m_text; + +}; +/*! + * @brief This class represents the structure AppliedBuiltinMemberAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinMemberAnnotations +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedBuiltinMemberAnnotations() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations( + const AppliedBuiltinMemberAnnotations& x) + { + m_unit = x.m_unit; + + m_min = x.m_min; + + m_max = x.m_max; + + m_hash_id = x.m_hash_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations( + AppliedBuiltinMemberAnnotations&& x) noexcept + { + m_unit = std::move(x.m_unit); + m_min = std::move(x.m_min); + m_max = std::move(x.m_max); + m_hash_id = std::move(x.m_hash_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations& operator =( + const AppliedBuiltinMemberAnnotations& x) + { + + m_unit = x.m_unit; + + m_min = x.m_min; + + m_max = x.m_max; + + m_hash_id = x.m_hash_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations& operator =( + AppliedBuiltinMemberAnnotations&& x) noexcept + { + + m_unit = std::move(x.m_unit); + m_min = std::move(x.m_min); + m_max = std::move(x.m_max); + m_hash_id = std::move(x.m_hash_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinMemberAnnotations object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedBuiltinMemberAnnotations& x) const + { + return (m_unit == x.m_unit && + m_min == x.m_min && + m_max == x.m_max && + m_hash_id == x.m_hash_id); + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinMemberAnnotations object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedBuiltinMemberAnnotations& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member unit + * @param _unit New value to be copied in member unit + */ + eProsima_user_DllExport void unit( + const eprosima::fastcdr::optional& _unit) + { + m_unit = _unit; + } + + /*! + * @brief This function moves the value in member unit + * @param _unit New value to be moved in member unit + */ + eProsima_user_DllExport void unit( + eprosima::fastcdr::optional&& _unit) + { + m_unit = std::move(_unit); + } + + /*! + * @brief This function returns a constant reference to member unit + * @return Constant reference to member unit + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& unit() const + { + return m_unit; + } + + /*! + * @brief This function returns a reference to member unit + * @return Reference to member unit + */ + eProsima_user_DllExport eprosima::fastcdr::optional& unit() + { + return m_unit; + } + + + /*! + * @brief This function copies the value in member min + * @param _min New value to be copied in member min + */ + eProsima_user_DllExport void min( + const eprosima::fastcdr::optional& _min) + { + m_min = _min; + } + + /*! + * @brief This function moves the value in member min + * @param _min New value to be moved in member min + */ + eProsima_user_DllExport void min( + eprosima::fastcdr::optional&& _min) + { + m_min = std::move(_min); + } + + /*! + * @brief This function returns a constant reference to member min + * @return Constant reference to member min + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& min() const + { + return m_min; + } + + /*! + * @brief This function returns a reference to member min + * @return Reference to member min + */ + eProsima_user_DllExport eprosima::fastcdr::optional& min() + { + return m_min; + } + + + /*! + * @brief This function copies the value in member max + * @param _max New value to be copied in member max + */ + eProsima_user_DllExport void max( + const eprosima::fastcdr::optional& _max) + { + m_max = _max; + } + + /*! + * @brief This function moves the value in member max + * @param _max New value to be moved in member max + */ + eProsima_user_DllExport void max( + eprosima::fastcdr::optional&& _max) + { + m_max = std::move(_max); + } + + /*! + * @brief This function returns a constant reference to member max + * @return Constant reference to member max + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& max() const + { + return m_max; + } + + /*! + * @brief This function returns a reference to member max + * @return Reference to member max + */ + eProsima_user_DllExport eprosima::fastcdr::optional& max() + { + return m_max; + } + + + /*! + * @brief This function copies the value in member hash_id + * @param _hash_id New value to be copied in member hash_id + */ + eProsima_user_DllExport void hash_id( + const eprosima::fastcdr::optional& _hash_id) + { + m_hash_id = _hash_id; + } + + /*! + * @brief This function moves the value in member hash_id + * @param _hash_id New value to be moved in member hash_id + */ + eProsima_user_DllExport void hash_id( + eprosima::fastcdr::optional&& _hash_id) + { + m_hash_id = std::move(_hash_id); + } + + /*! + * @brief This function returns a constant reference to member hash_id + * @return Constant reference to member hash_id + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& hash_id() const + { + return m_hash_id; + } + + /*! + * @brief This function returns a reference to member hash_id + * @return Reference to member hash_id + */ + eProsima_user_DllExport eprosima::fastcdr::optional& hash_id() + { + return m_hash_id; + } + + + +private: + + eprosima::fastcdr::optional m_unit; + eprosima::fastcdr::optional m_min; + eprosima::fastcdr::optional m_max; + eprosima::fastcdr::optional m_hash_id; + +}; +/*! + * @brief This class represents the structure CommonStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember( + const CommonStructMember& x) + { + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember( + CommonStructMember&& x) noexcept + { + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember& operator =( + const CommonStructMember& x) + { + + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember& operator =( + CommonStructMember&& x) noexcept + { + + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonStructMember& x) const + { + return (m_member_id == x.m_member_id && + m_member_flags == x.m_member_flags && + m_member_type_id == x.m_member_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member member_id + * @param _member_id New value for member member_id + */ + eProsima_user_DllExport void member_id( + MemberId _member_id) + { + m_member_id = _member_id; + } + + /*! + * @brief This function returns the value of member member_id + * @return Value of member member_id + */ + eProsima_user_DllExport MemberId member_id() const + { + return m_member_id; + } + + /*! + * @brief This function returns a reference to member member_id + * @return Reference to member member_id + */ + eProsima_user_DllExport MemberId& member_id() + { + return m_member_id; + } + + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const StructMemberFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + StructMemberFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const StructMemberFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport StructMemberFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member member_type_id + * @param _member_type_id New value to be copied in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + const TypeIdentifier& _member_type_id) + { + m_member_type_id = _member_type_id; + } + + /*! + * @brief This function moves the value in member member_type_id + * @param _member_type_id New value to be moved in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + TypeIdentifier&& _member_type_id) + { + m_member_type_id = std::move(_member_type_id); + } + + /*! + * @brief This function returns a constant reference to member member_type_id + * @return Constant reference to member member_type_id + */ + eProsima_user_DllExport const TypeIdentifier& member_type_id() const + { + return m_member_type_id; + } + + /*! + * @brief This function returns a reference to member member_type_id + * @return Reference to member member_type_id + */ + eProsima_user_DllExport TypeIdentifier& member_type_id() + { + return m_member_type_id; + } + + + +private: + + MemberId m_member_id{0}; + StructMemberFlag m_member_flags{0}; + TypeIdentifier m_member_type_id; + +}; +/*! + * @brief This class represents the structure CompleteMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMemberDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteMemberDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteMemberDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail( + const CompleteMemberDetail& x) + { + m_name = x.m_name; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail( + CompleteMemberDetail&& x) noexcept + { + m_name = std::move(x.m_name); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail& operator =( + const CompleteMemberDetail& x) + { + + m_name = x.m_name; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail& operator =( + CompleteMemberDetail&& x) noexcept + { + + m_name = std::move(x.m_name); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteMemberDetail& x) const + { + return (m_name == x.m_name && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteMemberDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const MemberName& _name) + { + m_name = _name; + } + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + MemberName&& _name) + { + m_name = std::move(_name); + } + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const MemberName& name() const + { + return m_name; + } + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport MemberName& name() + { + return m_name; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + MemberName m_name; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMemberDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalMemberDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalMemberDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail( + const MinimalMemberDetail& x) + { + m_name_hash = x.m_name_hash; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail( + MinimalMemberDetail&& x) noexcept + { + m_name_hash = std::move(x.m_name_hash); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail& operator =( + const MinimalMemberDetail& x) + { + + m_name_hash = x.m_name_hash; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail& operator =( + MinimalMemberDetail&& x) noexcept + { + + m_name_hash = std::move(x.m_name_hash); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalMemberDetail& x) const + { + return (m_name_hash == x.m_name_hash); + } + + /*! + * @brief Comparison operator. + * @param x MinimalMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalMemberDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + +private: + + NameHash m_name_hash{0}; + +}; +/*! + * @brief This class represents the structure CompleteStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember( + const CompleteStructMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember( + CompleteStructMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember& operator =( + const CompleteStructMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember& operator =( + CompleteStructMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonStructMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonStructMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonStructMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonStructMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonStructMember m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteStructMemberSeq; + +/*! + * @brief This class represents the structure MinimalStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember( + const MinimalStructMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember( + MinimalStructMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember& operator =( + const MinimalStructMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember& operator =( + MinimalStructMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonStructMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonStructMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonStructMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonStructMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonStructMember m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalStructMemberSeq; + +/*! + * @brief This class represents the structure AppliedBuiltinTypeAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinTypeAnnotations +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedBuiltinTypeAnnotations() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations( + const AppliedBuiltinTypeAnnotations& x) + { + m_verbatim = x.m_verbatim; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations( + AppliedBuiltinTypeAnnotations&& x) noexcept + { + m_verbatim = std::move(x.m_verbatim); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations& operator =( + const AppliedBuiltinTypeAnnotations& x) + { + + m_verbatim = x.m_verbatim; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations& operator =( + AppliedBuiltinTypeAnnotations&& x) noexcept + { + + m_verbatim = std::move(x.m_verbatim); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinTypeAnnotations object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedBuiltinTypeAnnotations& x) const + { + return (m_verbatim == x.m_verbatim); + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinTypeAnnotations object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedBuiltinTypeAnnotations& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member verbatim + * @param _verbatim New value to be copied in member verbatim + */ + eProsima_user_DllExport void verbatim( + const eprosima::fastcdr::optional& _verbatim) + { + m_verbatim = _verbatim; + } + + /*! + * @brief This function moves the value in member verbatim + * @param _verbatim New value to be moved in member verbatim + */ + eProsima_user_DllExport void verbatim( + eprosima::fastcdr::optional&& _verbatim) + { + m_verbatim = std::move(_verbatim); + } + + /*! + * @brief This function returns a constant reference to member verbatim + * @return Constant reference to member verbatim + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& verbatim() const + { + return m_verbatim; + } + + /*! + * @brief This function returns a reference to member verbatim + * @return Reference to member verbatim + */ + eProsima_user_DllExport eprosima::fastcdr::optional& verbatim() + { + return m_verbatim; + } + + + +private: + + eprosima::fastcdr::optional m_verbatim; + +}; +/*! + * @brief This class represents the structure MinimalTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalTypeDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalTypeDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail( + const MinimalTypeDetail& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail( + MinimalTypeDetail&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail& operator =( + const MinimalTypeDetail& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail& operator =( + MinimalTypeDetail&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalTypeDetail& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalTypeDetail& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteTypeDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteTypeDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail( + const CompleteTypeDetail& x) + { + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + m_type_name = x.m_type_name; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail( + CompleteTypeDetail&& x) noexcept + { + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + m_type_name = std::move(x.m_type_name); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail& operator =( + const CompleteTypeDetail& x) + { + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + m_type_name = x.m_type_name; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail& operator =( + CompleteTypeDetail&& x) noexcept + { + + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + m_type_name = std::move(x.m_type_name); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteTypeDetail& x) const + { + return (m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom && + m_type_name == x.m_type_name); + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteTypeDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + /*! + * @brief This function copies the value in member type_name + * @param _type_name New value to be copied in member type_name + */ + eProsima_user_DllExport void type_name( + const QualifiedTypeName& _type_name) + { + m_type_name = _type_name; + } + + /*! + * @brief This function moves the value in member type_name + * @param _type_name New value to be moved in member type_name + */ + eProsima_user_DllExport void type_name( + QualifiedTypeName&& _type_name) + { + m_type_name = std::move(_type_name); + } + + /*! + * @brief This function returns a constant reference to member type_name + * @return Constant reference to member type_name + */ + eProsima_user_DllExport const QualifiedTypeName& type_name() const + { + return m_type_name; + } + + /*! + * @brief This function returns a reference to member type_name + * @return Reference to member type_name + */ + eProsima_user_DllExport QualifiedTypeName& type_name() + { + return m_type_name; + } + + + +private: + + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + QualifiedTypeName m_type_name; + +}; +/*! + * @brief This class represents the structure CompleteStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader( + const CompleteStructHeader& x) + { + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader( + CompleteStructHeader&& x) noexcept + { + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader& operator =( + const CompleteStructHeader& x) + { + + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader& operator =( + CompleteStructHeader&& x) noexcept + { + + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructHeader& x) const + { + return (m_base_type == x.m_base_type && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const TypeIdentifier& _base_type) + { + m_base_type = _base_type; + } + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + TypeIdentifier&& _base_type) + { + m_base_type = std::move(_base_type); + } + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const TypeIdentifier& base_type() const + { + return m_base_type; + } + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport TypeIdentifier& base_type() + { + return m_base_type; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + TypeIdentifier m_base_type; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader( + const MinimalStructHeader& x) + { + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader( + MinimalStructHeader&& x) noexcept + { + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader& operator =( + const MinimalStructHeader& x) + { + + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader& operator =( + MinimalStructHeader&& x) noexcept + { + + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructHeader& x) const + { + return (m_base_type == x.m_base_type && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const TypeIdentifier& _base_type) + { + m_base_type = _base_type; + } + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + TypeIdentifier&& _base_type) + { + m_base_type = std::move(_base_type); + } + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const TypeIdentifier& base_type() const + { + return m_base_type; + } + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport TypeIdentifier& base_type() + { + return m_base_type; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalTypeDetail& detail() + { + return m_detail; + } + + + +private: + + TypeIdentifier m_base_type; + MinimalTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure CompleteStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType( + const CompleteStructType& x) + { + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType( + CompleteStructType&& x) noexcept + { + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType& operator =( + const CompleteStructType& x) + { + + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType& operator =( + CompleteStructType&& x) noexcept + { + + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructType& x) const + { + return (m_struct_flags == x.m_struct_flags && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member struct_flags + * @param _struct_flags New value to be copied in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + const StructTypeFlag& _struct_flags) + { + m_struct_flags = _struct_flags; + } + + /*! + * @brief This function moves the value in member struct_flags + * @param _struct_flags New value to be moved in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + StructTypeFlag&& _struct_flags) + { + m_struct_flags = std::move(_struct_flags); + } + + /*! + * @brief This function returns a constant reference to member struct_flags + * @return Constant reference to member struct_flags + */ + eProsima_user_DllExport const StructTypeFlag& struct_flags() const + { + return m_struct_flags; + } + + /*! + * @brief This function returns a reference to member struct_flags + * @return Reference to member struct_flags + */ + eProsima_user_DllExport StructTypeFlag& struct_flags() + { + return m_struct_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteStructHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteStructHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteStructHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteStructHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteStructMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteStructMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteStructMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteStructMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + StructTypeFlag m_struct_flags{0}; + CompleteStructHeader m_header; + CompleteStructMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType( + const MinimalStructType& x) + { + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType( + MinimalStructType&& x) noexcept + { + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType& operator =( + const MinimalStructType& x) + { + + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType& operator =( + MinimalStructType&& x) noexcept + { + + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructType& x) const + { + return (m_struct_flags == x.m_struct_flags && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member struct_flags + * @param _struct_flags New value to be copied in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + const StructTypeFlag& _struct_flags) + { + m_struct_flags = _struct_flags; + } + + /*! + * @brief This function moves the value in member struct_flags + * @param _struct_flags New value to be moved in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + StructTypeFlag&& _struct_flags) + { + m_struct_flags = std::move(_struct_flags); + } + + /*! + * @brief This function returns a constant reference to member struct_flags + * @return Constant reference to member struct_flags + */ + eProsima_user_DllExport const StructTypeFlag& struct_flags() const + { + return m_struct_flags; + } + + /*! + * @brief This function returns a reference to member struct_flags + * @return Reference to member struct_flags + */ + eProsima_user_DllExport StructTypeFlag& struct_flags() + { + return m_struct_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalStructHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalStructHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalStructHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalStructHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalStructMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalStructMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalStructMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalStructMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + StructTypeFlag m_struct_flags{0}; + MinimalStructHeader m_header; + MinimalStructMemberSeq m_member_seq; + +}; +typedef std::vector UnionCaseLabelSeq; + +/*! + * @brief This class represents the structure CommonUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember( + const CommonUnionMember& x) + { + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + m_label_seq = x.m_label_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember( + CommonUnionMember&& x) noexcept + { + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + m_label_seq = std::move(x.m_label_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember& operator =( + const CommonUnionMember& x) + { + + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + m_label_seq = x.m_label_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember& operator =( + CommonUnionMember&& x) noexcept + { + + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + m_label_seq = std::move(x.m_label_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonUnionMember& x) const + { + return (m_member_id == x.m_member_id && + m_member_flags == x.m_member_flags && + m_type_id == x.m_type_id && + m_label_seq == x.m_label_seq); + } + + /*! + * @brief Comparison operator. + * @param x CommonUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member member_id + * @param _member_id New value for member member_id + */ + eProsima_user_DllExport void member_id( + MemberId _member_id) + { + m_member_id = _member_id; + } + + /*! + * @brief This function returns the value of member member_id + * @return Value of member member_id + */ + eProsima_user_DllExport MemberId member_id() const + { + return m_member_id; + } + + /*! + * @brief This function returns a reference to member member_id + * @return Reference to member member_id + */ + eProsima_user_DllExport MemberId& member_id() + { + return m_member_id; + } + + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const UnionMemberFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + UnionMemberFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const UnionMemberFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport UnionMemberFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + /*! + * @brief This function copies the value in member label_seq + * @param _label_seq New value to be copied in member label_seq + */ + eProsima_user_DllExport void label_seq( + const UnionCaseLabelSeq& _label_seq) + { + m_label_seq = _label_seq; + } + + /*! + * @brief This function moves the value in member label_seq + * @param _label_seq New value to be moved in member label_seq + */ + eProsima_user_DllExport void label_seq( + UnionCaseLabelSeq&& _label_seq) + { + m_label_seq = std::move(_label_seq); + } + + /*! + * @brief This function returns a constant reference to member label_seq + * @return Constant reference to member label_seq + */ + eProsima_user_DllExport const UnionCaseLabelSeq& label_seq() const + { + return m_label_seq; + } + + /*! + * @brief This function returns a reference to member label_seq + * @return Reference to member label_seq + */ + eProsima_user_DllExport UnionCaseLabelSeq& label_seq() + { + return m_label_seq; + } + + + +private: + + MemberId m_member_id{0}; + UnionMemberFlag m_member_flags{0}; + TypeIdentifier m_type_id; + UnionCaseLabelSeq m_label_seq; + +}; +/*! + * @brief This class represents the structure CompleteUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember( + const CompleteUnionMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember( + CompleteUnionMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember& operator =( + const CompleteUnionMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember& operator =( + CompleteUnionMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonUnionMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonUnionMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonUnionMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonUnionMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonUnionMember m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteUnionMemberSeq; + +/*! + * @brief This class represents the structure MinimalUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember( + const MinimalUnionMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember( + MinimalUnionMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember& operator =( + const MinimalUnionMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember& operator =( + MinimalUnionMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonUnionMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonUnionMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonUnionMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonUnionMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonUnionMember m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalUnionMemberSeq; + +/*! + * @brief This class represents the structure CommonDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember( + const CommonDiscriminatorMember& x) + { + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember( + CommonDiscriminatorMember&& x) noexcept + { + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember& operator =( + const CommonDiscriminatorMember& x) + { + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember& operator =( + CommonDiscriminatorMember&& x) noexcept + { + + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonDiscriminatorMember& x) const + { + return (m_member_flags == x.m_member_flags && + m_type_id == x.m_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const UnionDiscriminatorFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + UnionDiscriminatorFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const UnionDiscriminatorFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport UnionDiscriminatorFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + +private: + + UnionDiscriminatorFlag m_member_flags{0}; + TypeIdentifier m_type_id; + +}; +/*! + * @brief This class represents the structure CompleteDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember( + const CompleteDiscriminatorMember& x) + { + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember( + CompleteDiscriminatorMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember& operator =( + const CompleteDiscriminatorMember& x) + { + + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember& operator =( + CompleteDiscriminatorMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteDiscriminatorMember& x) const + { + return (m_common == x.m_common && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonDiscriminatorMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonDiscriminatorMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonDiscriminatorMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonDiscriminatorMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + CommonDiscriminatorMember m_common; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember( + const MinimalDiscriminatorMember& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember( + MinimalDiscriminatorMember&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember& operator =( + const MinimalDiscriminatorMember& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember& operator =( + MinimalDiscriminatorMember&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalDiscriminatorMember& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonDiscriminatorMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonDiscriminatorMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonDiscriminatorMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonDiscriminatorMember& common() + { + return m_common; + } + + + +private: + + CommonDiscriminatorMember m_common; + +}; +/*! + * @brief This class represents the structure CompleteUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader( + const CompleteUnionHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader( + CompleteUnionHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader& operator =( + const CompleteUnionHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader& operator =( + CompleteUnionHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader( + const MinimalUnionHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader( + MinimalUnionHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader& operator =( + const MinimalUnionHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader& operator =( + MinimalUnionHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalTypeDetail& detail() + { + return m_detail; + } + + + +private: + + MinimalTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure CompleteUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType( + const CompleteUnionType& x) + { + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType( + CompleteUnionType&& x) noexcept + { + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType& operator =( + const CompleteUnionType& x) + { + + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType& operator =( + CompleteUnionType&& x) noexcept + { + + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionType& x) const + { + return (m_union_flags == x.m_union_flags && + m_header == x.m_header && + m_discriminator == x.m_discriminator && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member union_flags + * @param _union_flags New value to be copied in member union_flags + */ + eProsima_user_DllExport void union_flags( + const UnionTypeFlag& _union_flags) + { + m_union_flags = _union_flags; + } + + /*! + * @brief This function moves the value in member union_flags + * @param _union_flags New value to be moved in member union_flags + */ + eProsima_user_DllExport void union_flags( + UnionTypeFlag&& _union_flags) + { + m_union_flags = std::move(_union_flags); + } + + /*! + * @brief This function returns a constant reference to member union_flags + * @return Constant reference to member union_flags + */ + eProsima_user_DllExport const UnionTypeFlag& union_flags() const + { + return m_union_flags; + } + + /*! + * @brief This function returns a reference to member union_flags + * @return Reference to member union_flags + */ + eProsima_user_DllExport UnionTypeFlag& union_flags() + { + return m_union_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteUnionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteUnionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteUnionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteUnionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member discriminator + * @param _discriminator New value to be copied in member discriminator + */ + eProsima_user_DllExport void discriminator( + const CompleteDiscriminatorMember& _discriminator) + { + m_discriminator = _discriminator; + } + + /*! + * @brief This function moves the value in member discriminator + * @param _discriminator New value to be moved in member discriminator + */ + eProsima_user_DllExport void discriminator( + CompleteDiscriminatorMember&& _discriminator) + { + m_discriminator = std::move(_discriminator); + } + + /*! + * @brief This function returns a constant reference to member discriminator + * @return Constant reference to member discriminator + */ + eProsima_user_DllExport const CompleteDiscriminatorMember& discriminator() const + { + return m_discriminator; + } + + /*! + * @brief This function returns a reference to member discriminator + * @return Reference to member discriminator + */ + eProsima_user_DllExport CompleteDiscriminatorMember& discriminator() + { + return m_discriminator; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteUnionMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteUnionMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteUnionMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteUnionMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + UnionTypeFlag m_union_flags{0}; + CompleteUnionHeader m_header; + CompleteDiscriminatorMember m_discriminator; + CompleteUnionMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType( + const MinimalUnionType& x) + { + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType( + MinimalUnionType&& x) noexcept + { + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType& operator =( + const MinimalUnionType& x) + { + + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType& operator =( + MinimalUnionType&& x) noexcept + { + + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionType& x) const + { + return (m_union_flags == x.m_union_flags && + m_header == x.m_header && + m_discriminator == x.m_discriminator && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member union_flags + * @param _union_flags New value to be copied in member union_flags + */ + eProsima_user_DllExport void union_flags( + const UnionTypeFlag& _union_flags) + { + m_union_flags = _union_flags; + } + + /*! + * @brief This function moves the value in member union_flags + * @param _union_flags New value to be moved in member union_flags + */ + eProsima_user_DllExport void union_flags( + UnionTypeFlag&& _union_flags) + { + m_union_flags = std::move(_union_flags); + } + + /*! + * @brief This function returns a constant reference to member union_flags + * @return Constant reference to member union_flags + */ + eProsima_user_DllExport const UnionTypeFlag& union_flags() const + { + return m_union_flags; + } + + /*! + * @brief This function returns a reference to member union_flags + * @return Reference to member union_flags + */ + eProsima_user_DllExport UnionTypeFlag& union_flags() + { + return m_union_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalUnionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalUnionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalUnionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalUnionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member discriminator + * @param _discriminator New value to be copied in member discriminator + */ + eProsima_user_DllExport void discriminator( + const MinimalDiscriminatorMember& _discriminator) + { + m_discriminator = _discriminator; + } + + /*! + * @brief This function moves the value in member discriminator + * @param _discriminator New value to be moved in member discriminator + */ + eProsima_user_DllExport void discriminator( + MinimalDiscriminatorMember&& _discriminator) + { + m_discriminator = std::move(_discriminator); + } + + /*! + * @brief This function returns a constant reference to member discriminator + * @return Constant reference to member discriminator + */ + eProsima_user_DllExport const MinimalDiscriminatorMember& discriminator() const + { + return m_discriminator; + } + + /*! + * @brief This function returns a reference to member discriminator + * @return Reference to member discriminator + */ + eProsima_user_DllExport MinimalDiscriminatorMember& discriminator() + { + return m_discriminator; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalUnionMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalUnionMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalUnionMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalUnionMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + UnionTypeFlag m_union_flags{0}; + MinimalUnionHeader m_header; + MinimalDiscriminatorMember m_discriminator; + MinimalUnionMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure CommonAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter( + const CommonAnnotationParameter& x) + { + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter( + CommonAnnotationParameter&& x) noexcept + { + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter& operator =( + const CommonAnnotationParameter& x) + { + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter& operator =( + CommonAnnotationParameter&& x) noexcept + { + + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonAnnotationParameter& x) const + { + return (m_member_flags == x.m_member_flags && + m_member_type_id == x.m_member_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const AnnotationParameterFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + AnnotationParameterFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const AnnotationParameterFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport AnnotationParameterFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member member_type_id + * @param _member_type_id New value to be copied in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + const TypeIdentifier& _member_type_id) + { + m_member_type_id = _member_type_id; + } + + /*! + * @brief This function moves the value in member member_type_id + * @param _member_type_id New value to be moved in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + TypeIdentifier&& _member_type_id) + { + m_member_type_id = std::move(_member_type_id); + } + + /*! + * @brief This function returns a constant reference to member member_type_id + * @return Constant reference to member member_type_id + */ + eProsima_user_DllExport const TypeIdentifier& member_type_id() const + { + return m_member_type_id; + } + + /*! + * @brief This function returns a reference to member member_type_id + * @return Reference to member member_type_id + */ + eProsima_user_DllExport TypeIdentifier& member_type_id() + { + return m_member_type_id; + } + + + +private: + + AnnotationParameterFlag m_member_flags{0}; + TypeIdentifier m_member_type_id; + +}; +/*! + * @brief This class represents the structure CompleteAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter( + const CompleteAnnotationParameter& x) + { + m_common = x.m_common; + + m_name = x.m_name; + + m_default_value = x.m_default_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter( + CompleteAnnotationParameter&& x) noexcept + { + m_common = std::move(x.m_common); + m_name = std::move(x.m_name); + m_default_value = std::move(x.m_default_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter& operator =( + const CompleteAnnotationParameter& x) + { + + m_common = x.m_common; + + m_name = x.m_name; + + m_default_value = x.m_default_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter& operator =( + CompleteAnnotationParameter&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name = std::move(x.m_name); + m_default_value = std::move(x.m_default_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationParameter& x) const + { + return (m_common == x.m_common && + m_name == x.m_name && + m_default_value == x.m_default_value); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAnnotationParameter& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAnnotationParameter&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAnnotationParameter& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAnnotationParameter& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const MemberName& _name) + { + m_name = _name; + } + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + MemberName&& _name) + { + m_name = std::move(_name); + } + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const MemberName& name() const + { + return m_name; + } + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport MemberName& name() + { + return m_name; + } + + + /*! + * @brief This function copies the value in member default_value + * @param _default_value New value to be copied in member default_value + */ + eProsima_user_DllExport void default_value( + const AnnotationParameterValue& _default_value) + { + m_default_value = _default_value; + } + + /*! + * @brief This function moves the value in member default_value + * @param _default_value New value to be moved in member default_value + */ + eProsima_user_DllExport void default_value( + AnnotationParameterValue&& _default_value) + { + m_default_value = std::move(_default_value); + } + + /*! + * @brief This function returns a constant reference to member default_value + * @return Constant reference to member default_value + */ + eProsima_user_DllExport const AnnotationParameterValue& default_value() const + { + return m_default_value; + } + + /*! + * @brief This function returns a reference to member default_value + * @return Reference to member default_value + */ + eProsima_user_DllExport AnnotationParameterValue& default_value() + { + return m_default_value; + } + + + +private: + + CommonAnnotationParameter m_common; + MemberName m_name; + AnnotationParameterValue m_default_value; + +}; +typedef std::vector CompleteAnnotationParameterSeq; + +/*! + * @brief This class represents the structure MinimalAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter( + const MinimalAnnotationParameter& x) + { + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + m_default_value = x.m_default_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter( + MinimalAnnotationParameter&& x) noexcept + { + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + m_default_value = std::move(x.m_default_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter& operator =( + const MinimalAnnotationParameter& x) + { + + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + m_default_value = x.m_default_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter& operator =( + MinimalAnnotationParameter&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + m_default_value = std::move(x.m_default_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationParameter& x) const + { + return (m_common == x.m_common && + m_name_hash == x.m_name_hash && + m_default_value == x.m_default_value); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAnnotationParameter& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAnnotationParameter&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAnnotationParameter& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAnnotationParameter& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + /*! + * @brief This function copies the value in member default_value + * @param _default_value New value to be copied in member default_value + */ + eProsima_user_DllExport void default_value( + const AnnotationParameterValue& _default_value) + { + m_default_value = _default_value; + } + + /*! + * @brief This function moves the value in member default_value + * @param _default_value New value to be moved in member default_value + */ + eProsima_user_DllExport void default_value( + AnnotationParameterValue&& _default_value) + { + m_default_value = std::move(_default_value); + } + + /*! + * @brief This function returns a constant reference to member default_value + * @return Constant reference to member default_value + */ + eProsima_user_DllExport const AnnotationParameterValue& default_value() const + { + return m_default_value; + } + + /*! + * @brief This function returns a reference to member default_value + * @return Reference to member default_value + */ + eProsima_user_DllExport AnnotationParameterValue& default_value() + { + return m_default_value; + } + + + +private: + + CommonAnnotationParameter m_common; + NameHash m_name_hash{0}; + AnnotationParameterValue m_default_value; + +}; +typedef std::vector MinimalAnnotationParameterSeq; + +/*! + * @brief This class represents the structure CompleteAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader( + const CompleteAnnotationHeader& x) + { + m_annotation_name = x.m_annotation_name; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader( + CompleteAnnotationHeader&& x) noexcept + { + m_annotation_name = std::move(x.m_annotation_name); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader& operator =( + const CompleteAnnotationHeader& x) + { + + m_annotation_name = x.m_annotation_name; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader& operator =( + CompleteAnnotationHeader&& x) noexcept + { + + m_annotation_name = std::move(x.m_annotation_name); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationHeader& x) const + { + return (m_annotation_name == x.m_annotation_name); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_name + * @param _annotation_name New value to be copied in member annotation_name + */ + eProsima_user_DllExport void annotation_name( + const QualifiedTypeName& _annotation_name) + { + m_annotation_name = _annotation_name; + } + + /*! + * @brief This function moves the value in member annotation_name + * @param _annotation_name New value to be moved in member annotation_name + */ + eProsima_user_DllExport void annotation_name( + QualifiedTypeName&& _annotation_name) + { + m_annotation_name = std::move(_annotation_name); + } + + /*! + * @brief This function returns a constant reference to member annotation_name + * @return Constant reference to member annotation_name + */ + eProsima_user_DllExport const QualifiedTypeName& annotation_name() const + { + return m_annotation_name; + } + + /*! + * @brief This function returns a reference to member annotation_name + * @return Reference to member annotation_name + */ + eProsima_user_DllExport QualifiedTypeName& annotation_name() + { + return m_annotation_name; + } + + + +private: + + QualifiedTypeName m_annotation_name; + +}; +/*! + * @brief This class represents the structure MinimalAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader( + const MinimalAnnotationHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader( + MinimalAnnotationHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader& operator =( + const MinimalAnnotationHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader& operator =( + MinimalAnnotationHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType( + const CompleteAnnotationType& x) + { + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType( + CompleteAnnotationType&& x) noexcept + { + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType& operator =( + const CompleteAnnotationType& x) + { + + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType& operator =( + CompleteAnnotationType&& x) noexcept + { + + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationType& x) const + { + return (m_annotation_flag == x.m_annotation_flag && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_flag + * @param _annotation_flag New value to be copied in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + const AnnotationTypeFlag& _annotation_flag) + { + m_annotation_flag = _annotation_flag; + } + + /*! + * @brief This function moves the value in member annotation_flag + * @param _annotation_flag New value to be moved in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + AnnotationTypeFlag&& _annotation_flag) + { + m_annotation_flag = std::move(_annotation_flag); + } + + /*! + * @brief This function returns a constant reference to member annotation_flag + * @return Constant reference to member annotation_flag + */ + eProsima_user_DllExport const AnnotationTypeFlag& annotation_flag() const + { + return m_annotation_flag; + } + + /*! + * @brief This function returns a reference to member annotation_flag + * @return Reference to member annotation_flag + */ + eProsima_user_DllExport AnnotationTypeFlag& annotation_flag() + { + return m_annotation_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteAnnotationHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteAnnotationHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteAnnotationHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteAnnotationHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteAnnotationParameterSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteAnnotationParameterSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteAnnotationParameterSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteAnnotationParameterSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + AnnotationTypeFlag m_annotation_flag{0}; + CompleteAnnotationHeader m_header; + CompleteAnnotationParameterSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType( + const MinimalAnnotationType& x) + { + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType( + MinimalAnnotationType&& x) noexcept + { + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType& operator =( + const MinimalAnnotationType& x) + { + + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType& operator =( + MinimalAnnotationType&& x) noexcept + { + + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationType& x) const + { + return (m_annotation_flag == x.m_annotation_flag && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_flag + * @param _annotation_flag New value to be copied in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + const AnnotationTypeFlag& _annotation_flag) + { + m_annotation_flag = _annotation_flag; + } + + /*! + * @brief This function moves the value in member annotation_flag + * @param _annotation_flag New value to be moved in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + AnnotationTypeFlag&& _annotation_flag) + { + m_annotation_flag = std::move(_annotation_flag); + } + + /*! + * @brief This function returns a constant reference to member annotation_flag + * @return Constant reference to member annotation_flag + */ + eProsima_user_DllExport const AnnotationTypeFlag& annotation_flag() const + { + return m_annotation_flag; + } + + /*! + * @brief This function returns a reference to member annotation_flag + * @return Reference to member annotation_flag + */ + eProsima_user_DllExport AnnotationTypeFlag& annotation_flag() + { + return m_annotation_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalAnnotationHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalAnnotationHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalAnnotationHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalAnnotationHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalAnnotationParameterSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalAnnotationParameterSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalAnnotationParameterSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalAnnotationParameterSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + AnnotationTypeFlag m_annotation_flag{0}; + MinimalAnnotationHeader m_header; + MinimalAnnotationParameterSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure CommonAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody( + const CommonAliasBody& x) + { + m_related_flags = x.m_related_flags; + + m_related_type = x.m_related_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody( + CommonAliasBody&& x) noexcept + { + m_related_flags = std::move(x.m_related_flags); + m_related_type = std::move(x.m_related_type); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody& operator =( + const CommonAliasBody& x) + { + + m_related_flags = x.m_related_flags; + + m_related_type = x.m_related_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody& operator =( + CommonAliasBody&& x) noexcept + { + + m_related_flags = std::move(x.m_related_flags); + m_related_type = std::move(x.m_related_type); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonAliasBody& x) const + { + return (m_related_flags == x.m_related_flags && + m_related_type == x.m_related_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member related_flags + * @param _related_flags New value to be copied in member related_flags + */ + eProsima_user_DllExport void related_flags( + const AliasMemberFlag& _related_flags) + { + m_related_flags = _related_flags; + } + + /*! + * @brief This function moves the value in member related_flags + * @param _related_flags New value to be moved in member related_flags + */ + eProsima_user_DllExport void related_flags( + AliasMemberFlag&& _related_flags) + { + m_related_flags = std::move(_related_flags); + } + + /*! + * @brief This function returns a constant reference to member related_flags + * @return Constant reference to member related_flags + */ + eProsima_user_DllExport const AliasMemberFlag& related_flags() const + { + return m_related_flags; + } + + /*! + * @brief This function returns a reference to member related_flags + * @return Reference to member related_flags + */ + eProsima_user_DllExport AliasMemberFlag& related_flags() + { + return m_related_flags; + } + + + /*! + * @brief This function copies the value in member related_type + * @param _related_type New value to be copied in member related_type + */ + eProsima_user_DllExport void related_type( + const TypeIdentifier& _related_type) + { + m_related_type = _related_type; + } + + /*! + * @brief This function moves the value in member related_type + * @param _related_type New value to be moved in member related_type + */ + eProsima_user_DllExport void related_type( + TypeIdentifier&& _related_type) + { + m_related_type = std::move(_related_type); + } + + /*! + * @brief This function returns a constant reference to member related_type + * @return Constant reference to member related_type + */ + eProsima_user_DllExport const TypeIdentifier& related_type() const + { + return m_related_type; + } + + /*! + * @brief This function returns a reference to member related_type + * @return Reference to member related_type + */ + eProsima_user_DllExport TypeIdentifier& related_type() + { + return m_related_type; + } + + + +private: + + AliasMemberFlag m_related_flags{0}; + TypeIdentifier m_related_type; + +}; +/*! + * @brief This class represents the structure CompleteAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody( + const CompleteAliasBody& x) + { + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody( + CompleteAliasBody&& x) noexcept + { + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody& operator =( + const CompleteAliasBody& x) + { + + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody& operator =( + CompleteAliasBody&& x) noexcept + { + + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasBody& x) const + { + return (m_common == x.m_common && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAliasBody& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAliasBody&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAliasBody& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAliasBody& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + CommonAliasBody m_common; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody( + const MinimalAliasBody& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody( + MinimalAliasBody&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody& operator =( + const MinimalAliasBody& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody& operator =( + MinimalAliasBody&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasBody& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAliasBody& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAliasBody&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAliasBody& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAliasBody& common() + { + return m_common; + } + + + +private: + + CommonAliasBody m_common; + +}; +/*! + * @brief This class represents the structure CompleteAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader( + const CompleteAliasHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader( + CompleteAliasHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader& operator =( + const CompleteAliasHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader& operator =( + CompleteAliasHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader( + const MinimalAliasHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader( + MinimalAliasHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader& operator =( + const MinimalAliasHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader& operator =( + MinimalAliasHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType( + const CompleteAliasType& x) + { + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType( + CompleteAliasType&& x) noexcept + { + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType& operator =( + const CompleteAliasType& x) + { + + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType& operator =( + CompleteAliasType&& x) noexcept + { + + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasType& x) const + { + return (m_alias_flags == x.m_alias_flags && + m_header == x.m_header && + m_body == x.m_body); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member alias_flags + * @param _alias_flags New value to be copied in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + const AliasTypeFlag& _alias_flags) + { + m_alias_flags = _alias_flags; + } + + /*! + * @brief This function moves the value in member alias_flags + * @param _alias_flags New value to be moved in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + AliasTypeFlag&& _alias_flags) + { + m_alias_flags = std::move(_alias_flags); + } + + /*! + * @brief This function returns a constant reference to member alias_flags + * @return Constant reference to member alias_flags + */ + eProsima_user_DllExport const AliasTypeFlag& alias_flags() const + { + return m_alias_flags; + } + + /*! + * @brief This function returns a reference to member alias_flags + * @return Reference to member alias_flags + */ + eProsima_user_DllExport AliasTypeFlag& alias_flags() + { + return m_alias_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteAliasHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteAliasHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteAliasHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteAliasHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member body + * @param _body New value to be copied in member body + */ + eProsima_user_DllExport void body( + const CompleteAliasBody& _body) + { + m_body = _body; + } + + /*! + * @brief This function moves the value in member body + * @param _body New value to be moved in member body + */ + eProsima_user_DllExport void body( + CompleteAliasBody&& _body) + { + m_body = std::move(_body); + } + + /*! + * @brief This function returns a constant reference to member body + * @return Constant reference to member body + */ + eProsima_user_DllExport const CompleteAliasBody& body() const + { + return m_body; + } + + /*! + * @brief This function returns a reference to member body + * @return Reference to member body + */ + eProsima_user_DllExport CompleteAliasBody& body() + { + return m_body; + } + + + +private: + + AliasTypeFlag m_alias_flags{0}; + CompleteAliasHeader m_header; + CompleteAliasBody m_body; + +}; +/*! + * @brief This class represents the structure MinimalAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType( + const MinimalAliasType& x) + { + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType( + MinimalAliasType&& x) noexcept + { + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType& operator =( + const MinimalAliasType& x) + { + + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType& operator =( + MinimalAliasType&& x) noexcept + { + + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasType& x) const + { + return (m_alias_flags == x.m_alias_flags && + m_header == x.m_header && + m_body == x.m_body); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member alias_flags + * @param _alias_flags New value to be copied in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + const AliasTypeFlag& _alias_flags) + { + m_alias_flags = _alias_flags; + } + + /*! + * @brief This function moves the value in member alias_flags + * @param _alias_flags New value to be moved in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + AliasTypeFlag&& _alias_flags) + { + m_alias_flags = std::move(_alias_flags); + } + + /*! + * @brief This function returns a constant reference to member alias_flags + * @return Constant reference to member alias_flags + */ + eProsima_user_DllExport const AliasTypeFlag& alias_flags() const + { + return m_alias_flags; + } + + /*! + * @brief This function returns a reference to member alias_flags + * @return Reference to member alias_flags + */ + eProsima_user_DllExport AliasTypeFlag& alias_flags() + { + return m_alias_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalAliasHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalAliasHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalAliasHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalAliasHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member body + * @param _body New value to be copied in member body + */ + eProsima_user_DllExport void body( + const MinimalAliasBody& _body) + { + m_body = _body; + } + + /*! + * @brief This function moves the value in member body + * @param _body New value to be moved in member body + */ + eProsima_user_DllExport void body( + MinimalAliasBody&& _body) + { + m_body = std::move(_body); + } + + /*! + * @brief This function returns a constant reference to member body + * @return Constant reference to member body + */ + eProsima_user_DllExport const MinimalAliasBody& body() const + { + return m_body; + } + + /*! + * @brief This function returns a reference to member body + * @return Reference to member body + */ + eProsima_user_DllExport MinimalAliasBody& body() + { + return m_body; + } + + + +private: + + AliasTypeFlag m_alias_flags{0}; + MinimalAliasHeader m_header; + MinimalAliasBody m_body; + +}; +/*! + * @brief This class represents the structure CompleteElementDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteElementDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteElementDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteElementDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail( + const CompleteElementDetail& x) + { + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail( + CompleteElementDetail&& x) noexcept + { + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail& operator =( + const CompleteElementDetail& x) + { + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail& operator =( + CompleteElementDetail&& x) noexcept + { + + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteElementDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteElementDetail& x) const + { + return (m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteElementDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteElementDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure CommonCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement( + const CommonCollectionElement& x) + { + m_element_flags = x.m_element_flags; + + m_type = x.m_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement( + CommonCollectionElement&& x) noexcept + { + m_element_flags = std::move(x.m_element_flags); + m_type = std::move(x.m_type); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement& operator =( + const CommonCollectionElement& x) + { + + m_element_flags = x.m_element_flags; + + m_type = x.m_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement& operator =( + CommonCollectionElement&& x) noexcept + { + + m_element_flags = std::move(x.m_element_flags); + m_type = std::move(x.m_type); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonCollectionElement& x) const + { + return (m_element_flags == x.m_element_flags && + m_type == x.m_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member element_flags + * @param _element_flags New value to be copied in member element_flags + */ + eProsima_user_DllExport void element_flags( + const CollectionElementFlag& _element_flags) + { + m_element_flags = _element_flags; + } + + /*! + * @brief This function moves the value in member element_flags + * @param _element_flags New value to be moved in member element_flags + */ + eProsima_user_DllExport void element_flags( + CollectionElementFlag&& _element_flags) + { + m_element_flags = std::move(_element_flags); + } + + /*! + * @brief This function returns a constant reference to member element_flags + * @return Constant reference to member element_flags + */ + eProsima_user_DllExport const CollectionElementFlag& element_flags() const + { + return m_element_flags; + } + + /*! + * @brief This function returns a reference to member element_flags + * @return Reference to member element_flags + */ + eProsima_user_DllExport CollectionElementFlag& element_flags() + { + return m_element_flags; + } + + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const TypeIdentifier& _type) + { + m_type = _type; + } + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + TypeIdentifier&& _type) + { + m_type = std::move(_type); + } + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const TypeIdentifier& type() const + { + return m_type; + } + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport TypeIdentifier& type() + { + return m_type; + } + + + +private: + + CollectionElementFlag m_element_flags{0}; + TypeIdentifier m_type; + +}; +/*! + * @brief This class represents the structure CompleteCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement( + const CompleteCollectionElement& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement( + CompleteCollectionElement&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement& operator =( + const CompleteCollectionElement& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement& operator =( + CompleteCollectionElement&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteCollectionElement& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionElement& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionElement&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionElement& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionElement& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteElementDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteElementDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteElementDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteElementDetail& detail() + { + return m_detail; + } + + + +private: + + CommonCollectionElement m_common; + CompleteElementDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement( + const MinimalCollectionElement& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement( + MinimalCollectionElement&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement& operator =( + const MinimalCollectionElement& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement& operator =( + MinimalCollectionElement&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalCollectionElement& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionElement& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionElement&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionElement& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionElement& common() + { + return m_common; + } + + + +private: + + CommonCollectionElement m_common; + +}; +/*! + * @brief This class represents the structure CommonCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader( + const CommonCollectionHeader& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader( + CommonCollectionHeader&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader& operator =( + const CommonCollectionHeader& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader& operator =( + CommonCollectionHeader&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonCollectionHeader& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + +private: + + LBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure CompleteCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader( + const CompleteCollectionHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader( + CompleteCollectionHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader& operator =( + const CompleteCollectionHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader& operator =( + CompleteCollectionHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteCollectionHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const eprosima::fastcdr::optional& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + eprosima::fastcdr::optional&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport eprosima::fastcdr::optional& detail() + { + return m_detail; + } + + + +private: + + CommonCollectionHeader m_common; + eprosima::fastcdr::optional m_detail; + +}; +/*! + * @brief This class represents the structure MinimalCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader( + const MinimalCollectionHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader( + MinimalCollectionHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader& operator =( + const MinimalCollectionHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader& operator =( + MinimalCollectionHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalCollectionHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionHeader& common() + { + return m_common; + } + + + +private: + + CommonCollectionHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteSequenceType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteSequenceType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteSequenceType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType( + const CompleteSequenceType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType( + CompleteSequenceType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType& operator =( + const CompleteSequenceType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType& operator =( + CompleteSequenceType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteSequenceType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteSequenceType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteSequenceType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteSequenceType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteCollectionHeader m_header; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalSequenceType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalSequenceType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalSequenceType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType( + const MinimalSequenceType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType( + MinimalSequenceType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType& operator =( + const MinimalSequenceType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType& operator =( + MinimalSequenceType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalSequenceType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalSequenceType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalSequenceType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalSequenceType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalCollectionHeader m_header; + MinimalCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure CommonArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader( + const CommonArrayHeader& x) + { + m_bound_seq = x.m_bound_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader( + CommonArrayHeader&& x) noexcept + { + m_bound_seq = std::move(x.m_bound_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader& operator =( + const CommonArrayHeader& x) + { + + m_bound_seq = x.m_bound_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader& operator =( + CommonArrayHeader&& x) noexcept + { + + m_bound_seq = std::move(x.m_bound_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonArrayHeader& x) const + { + return (m_bound_seq == x.m_bound_seq); + } + + /*! + * @brief Comparison operator. + * @param x CommonArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bound_seq + * @param _bound_seq New value to be copied in member bound_seq + */ + eProsima_user_DllExport void bound_seq( + const LBoundSeq& _bound_seq) + { + m_bound_seq = _bound_seq; + } + + /*! + * @brief This function moves the value in member bound_seq + * @param _bound_seq New value to be moved in member bound_seq + */ + eProsima_user_DllExport void bound_seq( + LBoundSeq&& _bound_seq) + { + m_bound_seq = std::move(_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member bound_seq + * @return Constant reference to member bound_seq + */ + eProsima_user_DllExport const LBoundSeq& bound_seq() const + { + return m_bound_seq; + } + + /*! + * @brief This function returns a reference to member bound_seq + * @return Reference to member bound_seq + */ + eProsima_user_DllExport LBoundSeq& bound_seq() + { + return m_bound_seq; + } + + + +private: + + LBoundSeq m_bound_seq; + +}; +/*! + * @brief This class represents the structure CompleteArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader( + const CompleteArrayHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader( + CompleteArrayHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader& operator =( + const CompleteArrayHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader& operator =( + CompleteArrayHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteArrayHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonArrayHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonArrayHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonArrayHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonArrayHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CommonArrayHeader m_common; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader( + const MinimalArrayHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader( + MinimalArrayHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader& operator =( + const MinimalArrayHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader& operator =( + MinimalArrayHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalArrayHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonArrayHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonArrayHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonArrayHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonArrayHeader& common() + { + return m_common; + } + + + +private: + + CommonArrayHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteArrayType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteArrayType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType( + const CompleteArrayType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType( + CompleteArrayType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType& operator =( + const CompleteArrayType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType& operator =( + CompleteArrayType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteArrayType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteArrayType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteArrayHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteArrayHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteArrayHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteArrayHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteArrayHeader m_header; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalArrayType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalArrayType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType( + const MinimalArrayType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType( + MinimalArrayType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType& operator =( + const MinimalArrayType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType& operator =( + MinimalArrayType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalArrayType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalArrayType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalArrayHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalArrayHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalArrayHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalArrayHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalArrayHeader m_header; + MinimalCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure CompleteMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMapType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteMapType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteMapType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType( + const CompleteMapType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType( + CompleteMapType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType& operator =( + const CompleteMapType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType& operator =( + CompleteMapType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteMapType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteMapType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_key == x.m_key && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteMapType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteMapType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key( + const CompleteCollectionElement& _key) + { + m_key = _key; + } + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key( + CompleteCollectionElement&& _key) + { + m_key = std::move(_key); + } + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const CompleteCollectionElement& key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport CompleteCollectionElement& key() + { + return m_key; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteCollectionHeader m_header; + CompleteCollectionElement m_key; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMapType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalMapType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalMapType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType( + const MinimalMapType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType( + MinimalMapType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType& operator =( + const MinimalMapType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType& operator =( + MinimalMapType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalMapType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalMapType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_key == x.m_key && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalMapType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalMapType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key( + const MinimalCollectionElement& _key) + { + m_key = _key; + } + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key( + MinimalCollectionElement&& _key) + { + m_key = std::move(_key); + } + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const MinimalCollectionElement& key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport MinimalCollectionElement& key() + { + return m_key; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalCollectionHeader m_header; + MinimalCollectionElement m_key; + MinimalCollectionElement m_element; + +}; +typedef uint16_t BitBound; + +/*! + * @brief This class represents the structure CommonEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral( + const CommonEnumeratedLiteral& x) + { + m_value = x.m_value; + + m_flags = x.m_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral( + CommonEnumeratedLiteral&& x) noexcept + { + m_value = x.m_value; + m_flags = std::move(x.m_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral& operator =( + const CommonEnumeratedLiteral& x) + { + + m_value = x.m_value; + + m_flags = x.m_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral& operator =( + CommonEnumeratedLiteral&& x) noexcept + { + + m_value = x.m_value; + m_flags = std::move(x.m_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonEnumeratedLiteral& x) const + { + return (m_value == x.m_value && + m_flags == x.m_flags); + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value) + { + m_value = _value; + } + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value() + { + return m_value; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const EnumeratedLiteralFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + EnumeratedLiteralFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const EnumeratedLiteralFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport EnumeratedLiteralFlag& flags() + { + return m_flags; + } + + + +private: + + int32_t m_value{0}; + EnumeratedLiteralFlag m_flags{0}; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral( + const CompleteEnumeratedLiteral& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral( + CompleteEnumeratedLiteral&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral& operator =( + const CompleteEnumeratedLiteral& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral& operator =( + CompleteEnumeratedLiteral&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedLiteral& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedLiteral& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedLiteral&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedLiteral& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedLiteral& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedLiteral m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteEnumeratedLiteralSeq; + +/*! + * @brief This class represents the structure MinimalEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral( + const MinimalEnumeratedLiteral& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral( + MinimalEnumeratedLiteral&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral& operator =( + const MinimalEnumeratedLiteral& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral& operator =( + MinimalEnumeratedLiteral&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedLiteral& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedLiteral& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedLiteral&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedLiteral& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedLiteral& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedLiteral m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalEnumeratedLiteralSeq; + +/*! + * @brief This class represents the structure CommonEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader( + const CommonEnumeratedHeader& x) + { + m_bit_bound = x.m_bit_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader( + CommonEnumeratedHeader&& x) noexcept + { + m_bit_bound = x.m_bit_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader& operator =( + const CommonEnumeratedHeader& x) + { + + m_bit_bound = x.m_bit_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader& operator =( + CommonEnumeratedHeader&& x) noexcept + { + + m_bit_bound = x.m_bit_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonEnumeratedHeader& x) const + { + return (m_bit_bound == x.m_bit_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bit_bound + * @param _bit_bound New value for member bit_bound + */ + eProsima_user_DllExport void bit_bound( + BitBound _bit_bound) + { + m_bit_bound = _bit_bound; + } + + /*! + * @brief This function returns the value of member bit_bound + * @return Value of member bit_bound + */ + eProsima_user_DllExport BitBound bit_bound() const + { + return m_bit_bound; + } + + /*! + * @brief This function returns a reference to member bit_bound + * @return Reference to member bit_bound + */ + eProsima_user_DllExport BitBound& bit_bound() + { + return m_bit_bound; + } + + + +private: + + BitBound m_bit_bound{0}; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader( + const CompleteEnumeratedHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader( + CompleteEnumeratedHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader& operator =( + const CompleteEnumeratedHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader& operator =( + CompleteEnumeratedHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedHeader m_common; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader( + const MinimalEnumeratedHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader( + MinimalEnumeratedHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader& operator =( + const MinimalEnumeratedHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader& operator =( + MinimalEnumeratedHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedHeader& common() + { + return m_common; + } + + + +private: + + CommonEnumeratedHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType( + const CompleteEnumeratedType& x) + { + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType( + CompleteEnumeratedType&& x) noexcept + { + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType& operator =( + const CompleteEnumeratedType& x) + { + + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType& operator =( + CompleteEnumeratedType&& x) noexcept + { + + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedType& x) const + { + return (m_enum_flags == x.m_enum_flags && + m_header == x.m_header && + m_literal_seq == x.m_literal_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member enum_flags + * @param _enum_flags New value to be copied in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + const EnumTypeFlag& _enum_flags) + { + m_enum_flags = _enum_flags; + } + + /*! + * @brief This function moves the value in member enum_flags + * @param _enum_flags New value to be moved in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + EnumTypeFlag&& _enum_flags) + { + m_enum_flags = std::move(_enum_flags); + } + + /*! + * @brief This function returns a constant reference to member enum_flags + * @return Constant reference to member enum_flags + */ + eProsima_user_DllExport const EnumTypeFlag& enum_flags() const + { + return m_enum_flags; + } + + /*! + * @brief This function returns a reference to member enum_flags + * @return Reference to member enum_flags + */ + eProsima_user_DllExport EnumTypeFlag& enum_flags() + { + return m_enum_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteEnumeratedHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteEnumeratedHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteEnumeratedHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteEnumeratedHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member literal_seq + * @param _literal_seq New value to be copied in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + const CompleteEnumeratedLiteralSeq& _literal_seq) + { + m_literal_seq = _literal_seq; + } + + /*! + * @brief This function moves the value in member literal_seq + * @param _literal_seq New value to be moved in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + CompleteEnumeratedLiteralSeq&& _literal_seq) + { + m_literal_seq = std::move(_literal_seq); + } + + /*! + * @brief This function returns a constant reference to member literal_seq + * @return Constant reference to member literal_seq + */ + eProsima_user_DllExport const CompleteEnumeratedLiteralSeq& literal_seq() const + { + return m_literal_seq; + } + + /*! + * @brief This function returns a reference to member literal_seq + * @return Reference to member literal_seq + */ + eProsima_user_DllExport CompleteEnumeratedLiteralSeq& literal_seq() + { + return m_literal_seq; + } + + + +private: + + EnumTypeFlag m_enum_flags{0}; + CompleteEnumeratedHeader m_header; + CompleteEnumeratedLiteralSeq m_literal_seq; + +}; +/*! + * @brief This class represents the structure MinimalEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType( + const MinimalEnumeratedType& x) + { + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType( + MinimalEnumeratedType&& x) noexcept + { + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType& operator =( + const MinimalEnumeratedType& x) + { + + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType& operator =( + MinimalEnumeratedType&& x) noexcept + { + + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedType& x) const + { + return (m_enum_flags == x.m_enum_flags && + m_header == x.m_header && + m_literal_seq == x.m_literal_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member enum_flags + * @param _enum_flags New value to be copied in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + const EnumTypeFlag& _enum_flags) + { + m_enum_flags = _enum_flags; + } + + /*! + * @brief This function moves the value in member enum_flags + * @param _enum_flags New value to be moved in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + EnumTypeFlag&& _enum_flags) + { + m_enum_flags = std::move(_enum_flags); + } + + /*! + * @brief This function returns a constant reference to member enum_flags + * @return Constant reference to member enum_flags + */ + eProsima_user_DllExport const EnumTypeFlag& enum_flags() const + { + return m_enum_flags; + } + + /*! + * @brief This function returns a reference to member enum_flags + * @return Reference to member enum_flags + */ + eProsima_user_DllExport EnumTypeFlag& enum_flags() + { + return m_enum_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalEnumeratedHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalEnumeratedHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalEnumeratedHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalEnumeratedHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member literal_seq + * @param _literal_seq New value to be copied in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + const MinimalEnumeratedLiteralSeq& _literal_seq) + { + m_literal_seq = _literal_seq; + } + + /*! + * @brief This function moves the value in member literal_seq + * @param _literal_seq New value to be moved in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + MinimalEnumeratedLiteralSeq&& _literal_seq) + { + m_literal_seq = std::move(_literal_seq); + } + + /*! + * @brief This function returns a constant reference to member literal_seq + * @return Constant reference to member literal_seq + */ + eProsima_user_DllExport const MinimalEnumeratedLiteralSeq& literal_seq() const + { + return m_literal_seq; + } + + /*! + * @brief This function returns a reference to member literal_seq + * @return Reference to member literal_seq + */ + eProsima_user_DllExport MinimalEnumeratedLiteralSeq& literal_seq() + { + return m_literal_seq; + } + + + +private: + + EnumTypeFlag m_enum_flags{0}; + MinimalEnumeratedHeader m_header; + MinimalEnumeratedLiteralSeq m_literal_seq; + +}; +/*! + * @brief This class represents the structure CommonBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag( + const CommonBitflag& x) + { + m_position = x.m_position; + + m_flags = x.m_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag( + CommonBitflag&& x) noexcept + { + m_position = x.m_position; + m_flags = std::move(x.m_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag& operator =( + const CommonBitflag& x) + { + + m_position = x.m_position; + + m_flags = x.m_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag& operator =( + CommonBitflag&& x) noexcept + { + + m_position = x.m_position; + m_flags = std::move(x.m_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitflag& x) const + { + return (m_position == x.m_position && + m_flags == x.m_flags); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member position + * @param _position New value for member position + */ + eProsima_user_DllExport void position( + uint16_t _position) + { + m_position = _position; + } + + /*! + * @brief This function returns the value of member position + * @return Value of member position + */ + eProsima_user_DllExport uint16_t position() const + { + return m_position; + } + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport uint16_t& position() + { + return m_position; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const BitflagFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + BitflagFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const BitflagFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport BitflagFlag& flags() + { + return m_flags; + } + + + +private: + + uint16_t m_position{0}; + BitflagFlag m_flags{0}; + +}; +/*! + * @brief This class represents the structure CompleteBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag( + const CompleteBitflag& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag( + CompleteBitflag&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag& operator =( + const CompleteBitflag& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag& operator =( + CompleteBitflag&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitflag& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitflag& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitflag&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitflag& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitflag& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitflag m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteBitflagSeq; + +/*! + * @brief This class represents the structure MinimalBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag( + const MinimalBitflag& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag( + MinimalBitflag&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag& operator =( + const MinimalBitflag& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag& operator =( + MinimalBitflag&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitflag& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitflag& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitflag&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitflag& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitflag& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitflag m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalBitflagSeq; + +/*! + * @brief This class represents the structure CommonBitmaskHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitmaskHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitmaskHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitmaskHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader( + const CommonBitmaskHeader& x) + { + m_bit_bound = x.m_bit_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader( + CommonBitmaskHeader&& x) noexcept + { + m_bit_bound = x.m_bit_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader& operator =( + const CommonBitmaskHeader& x) + { + + m_bit_bound = x.m_bit_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader& operator =( + CommonBitmaskHeader&& x) noexcept + { + + m_bit_bound = x.m_bit_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitmaskHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitmaskHeader& x) const + { + return (m_bit_bound == x.m_bit_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitmaskHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitmaskHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bit_bound + * @param _bit_bound New value for member bit_bound + */ + eProsima_user_DllExport void bit_bound( + BitBound _bit_bound) + { + m_bit_bound = _bit_bound; + } + + /*! + * @brief This function returns the value of member bit_bound + * @return Value of member bit_bound + */ + eProsima_user_DllExport BitBound bit_bound() const + { + return m_bit_bound; + } + + /*! + * @brief This function returns a reference to member bit_bound + * @return Reference to member bit_bound + */ + eProsima_user_DllExport BitBound& bit_bound() + { + return m_bit_bound; + } + + + +private: + + BitBound m_bit_bound{0}; + +}; +typedef CompleteEnumeratedHeader CompleteBitmaskHeader; + +typedef MinimalEnumeratedHeader MinimalBitmaskHeader; + +/*! + * @brief This class represents the structure CompleteBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitmaskType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitmaskType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitmaskType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType( + const CompleteBitmaskType& x) + { + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType( + CompleteBitmaskType&& x) noexcept + { + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType& operator =( + const CompleteBitmaskType& x) + { + + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType& operator =( + CompleteBitmaskType&& x) noexcept + { + + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitmaskType& x) const + { + return (m_bitmask_flags == x.m_bitmask_flags && + m_header == x.m_header && + m_flag_seq == x.m_flag_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitmaskType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitmask_flags + * @param _bitmask_flags New value to be copied in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + const BitmaskTypeFlag& _bitmask_flags) + { + m_bitmask_flags = _bitmask_flags; + } + + /*! + * @brief This function moves the value in member bitmask_flags + * @param _bitmask_flags New value to be moved in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + BitmaskTypeFlag&& _bitmask_flags) + { + m_bitmask_flags = std::move(_bitmask_flags); + } + + /*! + * @brief This function returns a constant reference to member bitmask_flags + * @return Constant reference to member bitmask_flags + */ + eProsima_user_DllExport const BitmaskTypeFlag& bitmask_flags() const + { + return m_bitmask_flags; + } + + /*! + * @brief This function returns a reference to member bitmask_flags + * @return Reference to member bitmask_flags + */ + eProsima_user_DllExport BitmaskTypeFlag& bitmask_flags() + { + return m_bitmask_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteBitmaskHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteBitmaskHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteBitmaskHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteBitmaskHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member flag_seq + * @param _flag_seq New value to be copied in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + const CompleteBitflagSeq& _flag_seq) + { + m_flag_seq = _flag_seq; + } + + /*! + * @brief This function moves the value in member flag_seq + * @param _flag_seq New value to be moved in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + CompleteBitflagSeq&& _flag_seq) + { + m_flag_seq = std::move(_flag_seq); + } + + /*! + * @brief This function returns a constant reference to member flag_seq + * @return Constant reference to member flag_seq + */ + eProsima_user_DllExport const CompleteBitflagSeq& flag_seq() const + { + return m_flag_seq; + } + + /*! + * @brief This function returns a reference to member flag_seq + * @return Reference to member flag_seq + */ + eProsima_user_DllExport CompleteBitflagSeq& flag_seq() + { + return m_flag_seq; + } + + + +private: + + BitmaskTypeFlag m_bitmask_flags{0}; + CompleteBitmaskHeader m_header; + CompleteBitflagSeq m_flag_seq; + +}; +/*! + * @brief This class represents the structure MinimalBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitmaskType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitmaskType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitmaskType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType( + const MinimalBitmaskType& x) + { + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType( + MinimalBitmaskType&& x) noexcept + { + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType& operator =( + const MinimalBitmaskType& x) + { + + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType& operator =( + MinimalBitmaskType&& x) noexcept + { + + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitmaskType& x) const + { + return (m_bitmask_flags == x.m_bitmask_flags && + m_header == x.m_header && + m_flag_seq == x.m_flag_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitmaskType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitmask_flags + * @param _bitmask_flags New value to be copied in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + const BitmaskTypeFlag& _bitmask_flags) + { + m_bitmask_flags = _bitmask_flags; + } + + /*! + * @brief This function moves the value in member bitmask_flags + * @param _bitmask_flags New value to be moved in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + BitmaskTypeFlag&& _bitmask_flags) + { + m_bitmask_flags = std::move(_bitmask_flags); + } + + /*! + * @brief This function returns a constant reference to member bitmask_flags + * @return Constant reference to member bitmask_flags + */ + eProsima_user_DllExport const BitmaskTypeFlag& bitmask_flags() const + { + return m_bitmask_flags; + } + + /*! + * @brief This function returns a reference to member bitmask_flags + * @return Reference to member bitmask_flags + */ + eProsima_user_DllExport BitmaskTypeFlag& bitmask_flags() + { + return m_bitmask_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalBitmaskHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalBitmaskHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalBitmaskHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalBitmaskHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member flag_seq + * @param _flag_seq New value to be copied in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + const MinimalBitflagSeq& _flag_seq) + { + m_flag_seq = _flag_seq; + } + + /*! + * @brief This function moves the value in member flag_seq + * @param _flag_seq New value to be moved in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + MinimalBitflagSeq&& _flag_seq) + { + m_flag_seq = std::move(_flag_seq); + } + + /*! + * @brief This function returns a constant reference to member flag_seq + * @return Constant reference to member flag_seq + */ + eProsima_user_DllExport const MinimalBitflagSeq& flag_seq() const + { + return m_flag_seq; + } + + /*! + * @brief This function returns a reference to member flag_seq + * @return Reference to member flag_seq + */ + eProsima_user_DllExport MinimalBitflagSeq& flag_seq() + { + return m_flag_seq; + } + + + +private: + + BitmaskTypeFlag m_bitmask_flags{0}; + MinimalBitmaskHeader m_header; + MinimalBitflagSeq m_flag_seq; + +}; +/*! + * @brief This class represents the structure CommonBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield( + const CommonBitfield& x) + { + m_position = x.m_position; + + m_flags = x.m_flags; + + m_bitcount = x.m_bitcount; + + m_holder_type = x.m_holder_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield( + CommonBitfield&& x) noexcept + { + m_position = x.m_position; + m_flags = std::move(x.m_flags); + m_bitcount = x.m_bitcount; + m_holder_type = x.m_holder_type; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield& operator =( + const CommonBitfield& x) + { + + m_position = x.m_position; + + m_flags = x.m_flags; + + m_bitcount = x.m_bitcount; + + m_holder_type = x.m_holder_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield& operator =( + CommonBitfield&& x) noexcept + { + + m_position = x.m_position; + m_flags = std::move(x.m_flags); + m_bitcount = x.m_bitcount; + m_holder_type = x.m_holder_type; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitfield& x) const + { + return (m_position == x.m_position && + m_flags == x.m_flags && + m_bitcount == x.m_bitcount && + m_holder_type == x.m_holder_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member position + * @param _position New value for member position + */ + eProsima_user_DllExport void position( + uint16_t _position) + { + m_position = _position; + } + + /*! + * @brief This function returns the value of member position + * @return Value of member position + */ + eProsima_user_DllExport uint16_t position() const + { + return m_position; + } + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport uint16_t& position() + { + return m_position; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const BitsetMemberFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + BitsetMemberFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const BitsetMemberFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport BitsetMemberFlag& flags() + { + return m_flags; + } + + + /*! + * @brief This function sets a value in member bitcount + * @param _bitcount New value for member bitcount + */ + eProsima_user_DllExport void bitcount( + uint8_t _bitcount) + { + m_bitcount = _bitcount; + } + + /*! + * @brief This function returns the value of member bitcount + * @return Value of member bitcount + */ + eProsima_user_DllExport uint8_t bitcount() const + { + return m_bitcount; + } + + /*! + * @brief This function returns a reference to member bitcount + * @return Reference to member bitcount + */ + eProsima_user_DllExport uint8_t& bitcount() + { + return m_bitcount; + } + + + /*! + * @brief This function sets a value in member holder_type + * @param _holder_type New value for member holder_type + */ + eProsima_user_DllExport void holder_type( + TypeKind _holder_type) + { + m_holder_type = _holder_type; + } + + /*! + * @brief This function returns the value of member holder_type + * @return Value of member holder_type + */ + eProsima_user_DllExport TypeKind holder_type() const + { + return m_holder_type; + } + + /*! + * @brief This function returns a reference to member holder_type + * @return Reference to member holder_type + */ + eProsima_user_DllExport TypeKind& holder_type() + { + return m_holder_type; + } + + + +private: + + uint16_t m_position{0}; + BitsetMemberFlag m_flags{0}; + uint8_t m_bitcount{0}; + TypeKind m_holder_type{0}; + +}; +/*! + * @brief This class represents the structure CompleteBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield( + const CompleteBitfield& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield( + CompleteBitfield&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield& operator =( + const CompleteBitfield& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield& operator =( + CompleteBitfield&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitfield& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitfield& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitfield&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitfield& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitfield& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitfield m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteBitfieldSeq; + +/*! + * @brief This class represents the structure MinimalBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield( + const MinimalBitfield& x) + { + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield( + MinimalBitfield&& x) noexcept + { + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield& operator =( + const MinimalBitfield& x) + { + + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield& operator =( + MinimalBitfield&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitfield& x) const + { + return (m_common == x.m_common && + m_name_hash == x.m_name_hash); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitfield& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitfield&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitfield& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitfield& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + +private: + + CommonBitfield m_common; + NameHash m_name_hash{0}; + +}; +typedef std::vector MinimalBitfieldSeq; + +/*! + * @brief This class represents the structure CompleteBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitsetHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitsetHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader( + const CompleteBitsetHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader( + CompleteBitsetHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader& operator =( + const CompleteBitsetHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader& operator =( + CompleteBitsetHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitsetHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitsetHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitsetHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitsetHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader( + const MinimalBitsetHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader( + MinimalBitsetHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader& operator =( + const MinimalBitsetHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader& operator =( + MinimalBitsetHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitsetHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitsetHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitsetType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitsetType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType( + const CompleteBitsetType& x) + { + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType( + CompleteBitsetType&& x) noexcept + { + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType& operator =( + const CompleteBitsetType& x) + { + + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType& operator =( + CompleteBitsetType&& x) noexcept + { + + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitsetType& x) const + { + return (m_bitset_flags == x.m_bitset_flags && + m_header == x.m_header && + m_field_seq == x.m_field_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitsetType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitset_flags + * @param _bitset_flags New value to be copied in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + const BitsetTypeFlag& _bitset_flags) + { + m_bitset_flags = _bitset_flags; + } + + /*! + * @brief This function moves the value in member bitset_flags + * @param _bitset_flags New value to be moved in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + BitsetTypeFlag&& _bitset_flags) + { + m_bitset_flags = std::move(_bitset_flags); + } + + /*! + * @brief This function returns a constant reference to member bitset_flags + * @return Constant reference to member bitset_flags + */ + eProsima_user_DllExport const BitsetTypeFlag& bitset_flags() const + { + return m_bitset_flags; + } + + /*! + * @brief This function returns a reference to member bitset_flags + * @return Reference to member bitset_flags + */ + eProsima_user_DllExport BitsetTypeFlag& bitset_flags() + { + return m_bitset_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteBitsetHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteBitsetHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteBitsetHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteBitsetHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member field_seq + * @param _field_seq New value to be copied in member field_seq + */ + eProsima_user_DllExport void field_seq( + const CompleteBitfieldSeq& _field_seq) + { + m_field_seq = _field_seq; + } + + /*! + * @brief This function moves the value in member field_seq + * @param _field_seq New value to be moved in member field_seq + */ + eProsima_user_DllExport void field_seq( + CompleteBitfieldSeq&& _field_seq) + { + m_field_seq = std::move(_field_seq); + } + + /*! + * @brief This function returns a constant reference to member field_seq + * @return Constant reference to member field_seq + */ + eProsima_user_DllExport const CompleteBitfieldSeq& field_seq() const + { + return m_field_seq; + } + + /*! + * @brief This function returns a reference to member field_seq + * @return Reference to member field_seq + */ + eProsima_user_DllExport CompleteBitfieldSeq& field_seq() + { + return m_field_seq; + } + + + +private: + + BitsetTypeFlag m_bitset_flags{0}; + CompleteBitsetHeader m_header; + CompleteBitfieldSeq m_field_seq; + +}; +/*! + * @brief This class represents the structure MinimalBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitsetType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitsetType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType( + const MinimalBitsetType& x) + { + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType( + MinimalBitsetType&& x) noexcept + { + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType& operator =( + const MinimalBitsetType& x) + { + + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType& operator =( + MinimalBitsetType&& x) noexcept + { + + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitsetType& x) const + { + return (m_bitset_flags == x.m_bitset_flags && + m_header == x.m_header && + m_field_seq == x.m_field_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitsetType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitset_flags + * @param _bitset_flags New value to be copied in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + const BitsetTypeFlag& _bitset_flags) + { + m_bitset_flags = _bitset_flags; + } + + /*! + * @brief This function moves the value in member bitset_flags + * @param _bitset_flags New value to be moved in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + BitsetTypeFlag&& _bitset_flags) + { + m_bitset_flags = std::move(_bitset_flags); + } + + /*! + * @brief This function returns a constant reference to member bitset_flags + * @return Constant reference to member bitset_flags + */ + eProsima_user_DllExport const BitsetTypeFlag& bitset_flags() const + { + return m_bitset_flags; + } + + /*! + * @brief This function returns a reference to member bitset_flags + * @return Reference to member bitset_flags + */ + eProsima_user_DllExport BitsetTypeFlag& bitset_flags() + { + return m_bitset_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalBitsetHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalBitsetHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalBitsetHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalBitsetHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member field_seq + * @param _field_seq New value to be copied in member field_seq + */ + eProsima_user_DllExport void field_seq( + const MinimalBitfieldSeq& _field_seq) + { + m_field_seq = _field_seq; + } + + /*! + * @brief This function moves the value in member field_seq + * @param _field_seq New value to be moved in member field_seq + */ + eProsima_user_DllExport void field_seq( + MinimalBitfieldSeq&& _field_seq) + { + m_field_seq = std::move(_field_seq); + } + + /*! + * @brief This function returns a constant reference to member field_seq + * @return Constant reference to member field_seq + */ + eProsima_user_DllExport const MinimalBitfieldSeq& field_seq() const + { + return m_field_seq; + } + + /*! + * @brief This function returns a reference to member field_seq + * @return Reference to member field_seq + */ + eProsima_user_DllExport MinimalBitfieldSeq& field_seq() + { + return m_field_seq; + } + + + +private: + + BitsetTypeFlag m_bitset_flags{0}; + MinimalBitsetHeader m_header; + MinimalBitfieldSeq m_field_seq; + +}; +/*! + * @brief This class represents the structure CompleteExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteExtendedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteExtendedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteExtendedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType( + const CompleteExtendedType& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType( + CompleteExtendedType&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType& operator =( + const CompleteExtendedType& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType& operator =( + CompleteExtendedType&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteExtendedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteExtendedType& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x CompleteExtendedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteExtendedType& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union CompleteTypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteTypeObject() + { + extended_type_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteTypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject( + const CompleteTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject( + CompleteTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject& operator =( + const CompleteTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject& operator =( + CompleteTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteTypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_alias_type == x.m_alias_type); + break; + + case 0x00000002: + ret_value = (m_annotation_type == x.m_annotation_type); + break; + + case 0x00000003: + ret_value = (m_struct_type == x.m_struct_type); + break; + + case 0x00000004: + ret_value = (m_union_type == x.m_union_type); + break; + + case 0x00000005: + ret_value = (m_bitset_type == x.m_bitset_type); + break; + + case 0x00000006: + ret_value = (m_sequence_type == x.m_sequence_type); + break; + + case 0x00000007: + ret_value = (m_array_type == x.m_array_type); + break; + + case 0x00000008: + ret_value = (m_map_type == x.m_map_type); + break; + + case 0x00000009: + ret_value = (m_enumerated_type == x.m_enumerated_type); + break; + + case 0x0000000a: + ret_value = (m_bitmask_type == x.m_bitmask_type); + break; + + case 0x0000000b: + ret_value = (m_extended_type == x.m_extended_type); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteTypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_ALIAS: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ANNOTATION: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRUCTURE: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UNION: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITSET: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_SEQUENCE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ARRAY: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_MAP: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITMASK: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member alias_type + * @param _alias_type New value to be copied in member alias_type + */ + eProsima_user_DllExport void alias_type( + const CompleteAliasType& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function moves the value in member alias_type + * @param _alias_type New value to be moved in member alias_type + */ + eProsima_user_DllExport void alias_type( + CompleteAliasType&& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function returns a constant reference to member alias_type + * @return Constant reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteAliasType& alias_type() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + /*! + * @brief This function returns a reference to member alias_type + * @return Reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteAliasType& alias_type() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + + /*! + * @brief This function copies the value in member annotation_type + * @param _annotation_type New value to be copied in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + const CompleteAnnotationType& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function moves the value in member annotation_type + * @param _annotation_type New value to be moved in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + CompleteAnnotationType&& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function returns a constant reference to member annotation_type + * @return Constant reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteAnnotationType& annotation_type() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + /*! + * @brief This function returns a reference to member annotation_type + * @return Reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteAnnotationType& annotation_type() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + + /*! + * @brief This function copies the value in member struct_type + * @param _struct_type New value to be copied in member struct_type + */ + eProsima_user_DllExport void struct_type( + const CompleteStructType& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function moves the value in member struct_type + * @param _struct_type New value to be moved in member struct_type + */ + eProsima_user_DllExport void struct_type( + CompleteStructType&& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function returns a constant reference to member struct_type + * @return Constant reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteStructType& struct_type() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + /*! + * @brief This function returns a reference to member struct_type + * @return Reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteStructType& struct_type() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + + /*! + * @brief This function copies the value in member union_type + * @param _union_type New value to be copied in member union_type + */ + eProsima_user_DllExport void union_type( + const CompleteUnionType& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function moves the value in member union_type + * @param _union_type New value to be moved in member union_type + */ + eProsima_user_DllExport void union_type( + CompleteUnionType&& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function returns a constant reference to member union_type + * @return Constant reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteUnionType& union_type() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + /*! + * @brief This function returns a reference to member union_type + * @return Reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteUnionType& union_type() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + + /*! + * @brief This function copies the value in member bitset_type + * @param _bitset_type New value to be copied in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + const CompleteBitsetType& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function moves the value in member bitset_type + * @param _bitset_type New value to be moved in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + CompleteBitsetType&& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function returns a constant reference to member bitset_type + * @return Constant reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteBitsetType& bitset_type() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + /*! + * @brief This function returns a reference to member bitset_type + * @return Reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteBitsetType& bitset_type() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + + /*! + * @brief This function copies the value in member sequence_type + * @param _sequence_type New value to be copied in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + const CompleteSequenceType& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function moves the value in member sequence_type + * @param _sequence_type New value to be moved in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + CompleteSequenceType&& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function returns a constant reference to member sequence_type + * @return Constant reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteSequenceType& sequence_type() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + /*! + * @brief This function returns a reference to member sequence_type + * @return Reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteSequenceType& sequence_type() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + + /*! + * @brief This function copies the value in member array_type + * @param _array_type New value to be copied in member array_type + */ + eProsima_user_DllExport void array_type( + const CompleteArrayType& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function moves the value in member array_type + * @param _array_type New value to be moved in member array_type + */ + eProsima_user_DllExport void array_type( + CompleteArrayType&& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function returns a constant reference to member array_type + * @return Constant reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteArrayType& array_type() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + /*! + * @brief This function returns a reference to member array_type + * @return Reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteArrayType& array_type() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + + /*! + * @brief This function copies the value in member map_type + * @param _map_type New value to be copied in member map_type + */ + eProsima_user_DllExport void map_type( + const CompleteMapType& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function moves the value in member map_type + * @param _map_type New value to be moved in member map_type + */ + eProsima_user_DllExport void map_type( + CompleteMapType&& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function returns a constant reference to member map_type + * @return Constant reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteMapType& map_type() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + /*! + * @brief This function returns a reference to member map_type + * @return Reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteMapType& map_type() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + + /*! + * @brief This function copies the value in member enumerated_type + * @param _enumerated_type New value to be copied in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + const CompleteEnumeratedType& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function moves the value in member enumerated_type + * @param _enumerated_type New value to be moved in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + CompleteEnumeratedType&& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns a constant reference to member enumerated_type + * @return Constant reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteEnumeratedType& enumerated_type() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + /*! + * @brief This function returns a reference to member enumerated_type + * @return Reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteEnumeratedType& enumerated_type() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + + /*! + * @brief This function copies the value in member bitmask_type + * @param _bitmask_type New value to be copied in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + const CompleteBitmaskType& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function moves the value in member bitmask_type + * @param _bitmask_type New value to be moved in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + CompleteBitmaskType&& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function returns a constant reference to member bitmask_type + * @return Constant reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteBitmaskType& bitmask_type() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + /*! + * @brief This function returns a reference to member bitmask_type + * @return Reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteBitmaskType& bitmask_type() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + + /*! + * @brief This function copies the value in member extended_type + * @param _extended_type New value to be copied in member extended_type + */ + eProsima_user_DllExport void extended_type( + const CompleteExtendedType& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_type + * @param _extended_type New value to be moved in member extended_type + */ + eProsima_user_DllExport void extended_type( + CompleteExtendedType&& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_type + * @return Constant reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteExtendedType& extended_type() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + /*! + * @brief This function returns a reference to member extended_type + * @return Reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteExtendedType& extended_type() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + + +private: + + CompleteAliasType& alias_type_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_alias_type.~CompleteAliasType();}; + new(&m_alias_type) CompleteAliasType(); + ; + } + + return m_alias_type; + } + + CompleteAnnotationType& annotation_type_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_annotation_type.~CompleteAnnotationType();}; + new(&m_annotation_type) CompleteAnnotationType(); + ; + } + + return m_annotation_type; + } + + CompleteStructType& struct_type_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_struct_type.~CompleteStructType();}; + new(&m_struct_type) CompleteStructType(); + ; + } + + return m_struct_type; + } + + CompleteUnionType& union_type_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_union_type.~CompleteUnionType();}; + new(&m_union_type) CompleteUnionType(); + ; + } + + return m_union_type; + } + + CompleteBitsetType& bitset_type_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_bitset_type.~CompleteBitsetType();}; + new(&m_bitset_type) CompleteBitsetType(); + ; + } + + return m_bitset_type; + } + + CompleteSequenceType& sequence_type_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_sequence_type.~CompleteSequenceType();}; + new(&m_sequence_type) CompleteSequenceType(); + ; + } + + return m_sequence_type; + } + + CompleteArrayType& array_type_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_array_type.~CompleteArrayType();}; + new(&m_array_type) CompleteArrayType(); + ; + } + + return m_array_type; + } + + CompleteMapType& map_type_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_type.~CompleteMapType();}; + new(&m_map_type) CompleteMapType(); + ; + } + + return m_map_type; + } + + CompleteEnumeratedType& enumerated_type_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_enumerated_type.~CompleteEnumeratedType();}; + new(&m_enumerated_type) CompleteEnumeratedType(); + ; + } + + return m_enumerated_type; + } + + CompleteBitmaskType& bitmask_type_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_bitmask_type.~CompleteBitmaskType();}; + new(&m_bitmask_type) CompleteBitmaskType(); + ; + } + + return m_bitmask_type; + } + + CompleteExtendedType& extended_type_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_type.~CompleteExtendedType();}; + new(&m_extended_type) CompleteExtendedType(); + ; + } + + return m_extended_type; + } + + + uint8_t m__d {0}; + + union + { + CompleteAliasType m_alias_type; + CompleteAnnotationType m_annotation_type; + CompleteStructType m_struct_type; + CompleteUnionType m_union_type; + CompleteBitsetType m_bitset_type; + CompleteSequenceType m_sequence_type; + CompleteArrayType m_array_type; + CompleteMapType m_map_type; + CompleteEnumeratedType m_enumerated_type; + CompleteBitmaskType m_bitmask_type; + CompleteExtendedType m_extended_type; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure MinimalExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalExtendedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalExtendedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalExtendedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType( + const MinimalExtendedType& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType( + MinimalExtendedType&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType& operator =( + const MinimalExtendedType& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType& operator =( + MinimalExtendedType&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalExtendedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalExtendedType& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalExtendedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalExtendedType& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union MinimalTypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalTypeObject() + { + extended_type_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalTypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject( + const MinimalTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject( + MinimalTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject& operator =( + const MinimalTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject& operator =( + MinimalTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalTypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_alias_type == x.m_alias_type); + break; + + case 0x00000002: + ret_value = (m_annotation_type == x.m_annotation_type); + break; + + case 0x00000003: + ret_value = (m_struct_type == x.m_struct_type); + break; + + case 0x00000004: + ret_value = (m_union_type == x.m_union_type); + break; + + case 0x00000005: + ret_value = (m_bitset_type == x.m_bitset_type); + break; + + case 0x00000006: + ret_value = (m_sequence_type == x.m_sequence_type); + break; + + case 0x00000007: + ret_value = (m_array_type == x.m_array_type); + break; + + case 0x00000008: + ret_value = (m_map_type == x.m_map_type); + break; + + case 0x00000009: + ret_value = (m_enumerated_type == x.m_enumerated_type); + break; + + case 0x0000000a: + ret_value = (m_bitmask_type == x.m_bitmask_type); + break; + + case 0x0000000b: + ret_value = (m_extended_type == x.m_extended_type); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalTypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_ALIAS: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ANNOTATION: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRUCTURE: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UNION: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITSET: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_SEQUENCE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ARRAY: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_MAP: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITMASK: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member alias_type + * @param _alias_type New value to be copied in member alias_type + */ + eProsima_user_DllExport void alias_type( + const MinimalAliasType& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function moves the value in member alias_type + * @param _alias_type New value to be moved in member alias_type + */ + eProsima_user_DllExport void alias_type( + MinimalAliasType&& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function returns a constant reference to member alias_type + * @return Constant reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalAliasType& alias_type() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + /*! + * @brief This function returns a reference to member alias_type + * @return Reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalAliasType& alias_type() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + + /*! + * @brief This function copies the value in member annotation_type + * @param _annotation_type New value to be copied in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + const MinimalAnnotationType& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function moves the value in member annotation_type + * @param _annotation_type New value to be moved in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + MinimalAnnotationType&& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function returns a constant reference to member annotation_type + * @return Constant reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalAnnotationType& annotation_type() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + /*! + * @brief This function returns a reference to member annotation_type + * @return Reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalAnnotationType& annotation_type() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + + /*! + * @brief This function copies the value in member struct_type + * @param _struct_type New value to be copied in member struct_type + */ + eProsima_user_DllExport void struct_type( + const MinimalStructType& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function moves the value in member struct_type + * @param _struct_type New value to be moved in member struct_type + */ + eProsima_user_DllExport void struct_type( + MinimalStructType&& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function returns a constant reference to member struct_type + * @return Constant reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalStructType& struct_type() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + /*! + * @brief This function returns a reference to member struct_type + * @return Reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalStructType& struct_type() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + + /*! + * @brief This function copies the value in member union_type + * @param _union_type New value to be copied in member union_type + */ + eProsima_user_DllExport void union_type( + const MinimalUnionType& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function moves the value in member union_type + * @param _union_type New value to be moved in member union_type + */ + eProsima_user_DllExport void union_type( + MinimalUnionType&& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function returns a constant reference to member union_type + * @return Constant reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalUnionType& union_type() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + /*! + * @brief This function returns a reference to member union_type + * @return Reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalUnionType& union_type() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + + /*! + * @brief This function copies the value in member bitset_type + * @param _bitset_type New value to be copied in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + const MinimalBitsetType& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function moves the value in member bitset_type + * @param _bitset_type New value to be moved in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + MinimalBitsetType&& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function returns a constant reference to member bitset_type + * @return Constant reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalBitsetType& bitset_type() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + /*! + * @brief This function returns a reference to member bitset_type + * @return Reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalBitsetType& bitset_type() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + + /*! + * @brief This function copies the value in member sequence_type + * @param _sequence_type New value to be copied in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + const MinimalSequenceType& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function moves the value in member sequence_type + * @param _sequence_type New value to be moved in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + MinimalSequenceType&& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function returns a constant reference to member sequence_type + * @return Constant reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalSequenceType& sequence_type() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + /*! + * @brief This function returns a reference to member sequence_type + * @return Reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalSequenceType& sequence_type() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + + /*! + * @brief This function copies the value in member array_type + * @param _array_type New value to be copied in member array_type + */ + eProsima_user_DllExport void array_type( + const MinimalArrayType& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function moves the value in member array_type + * @param _array_type New value to be moved in member array_type + */ + eProsima_user_DllExport void array_type( + MinimalArrayType&& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function returns a constant reference to member array_type + * @return Constant reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalArrayType& array_type() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + /*! + * @brief This function returns a reference to member array_type + * @return Reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalArrayType& array_type() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + + /*! + * @brief This function copies the value in member map_type + * @param _map_type New value to be copied in member map_type + */ + eProsima_user_DllExport void map_type( + const MinimalMapType& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function moves the value in member map_type + * @param _map_type New value to be moved in member map_type + */ + eProsima_user_DllExport void map_type( + MinimalMapType&& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function returns a constant reference to member map_type + * @return Constant reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalMapType& map_type() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + /*! + * @brief This function returns a reference to member map_type + * @return Reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalMapType& map_type() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + + /*! + * @brief This function copies the value in member enumerated_type + * @param _enumerated_type New value to be copied in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + const MinimalEnumeratedType& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function moves the value in member enumerated_type + * @param _enumerated_type New value to be moved in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + MinimalEnumeratedType&& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns a constant reference to member enumerated_type + * @return Constant reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalEnumeratedType& enumerated_type() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + /*! + * @brief This function returns a reference to member enumerated_type + * @return Reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalEnumeratedType& enumerated_type() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + + /*! + * @brief This function copies the value in member bitmask_type + * @param _bitmask_type New value to be copied in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + const MinimalBitmaskType& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function moves the value in member bitmask_type + * @param _bitmask_type New value to be moved in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + MinimalBitmaskType&& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function returns a constant reference to member bitmask_type + * @return Constant reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalBitmaskType& bitmask_type() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + /*! + * @brief This function returns a reference to member bitmask_type + * @return Reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalBitmaskType& bitmask_type() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + + /*! + * @brief This function copies the value in member extended_type + * @param _extended_type New value to be copied in member extended_type + */ + eProsima_user_DllExport void extended_type( + const MinimalExtendedType& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_type + * @param _extended_type New value to be moved in member extended_type + */ + eProsima_user_DllExport void extended_type( + MinimalExtendedType&& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_type + * @return Constant reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalExtendedType& extended_type() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + /*! + * @brief This function returns a reference to member extended_type + * @return Reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalExtendedType& extended_type() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + + +private: + + MinimalAliasType& alias_type_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_alias_type.~MinimalAliasType();}; + new(&m_alias_type) MinimalAliasType(); + ; + } + + return m_alias_type; + } + + MinimalAnnotationType& annotation_type_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_annotation_type.~MinimalAnnotationType();}; + new(&m_annotation_type) MinimalAnnotationType(); + ; + } + + return m_annotation_type; + } + + MinimalStructType& struct_type_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_struct_type.~MinimalStructType();}; + new(&m_struct_type) MinimalStructType(); + ; + } + + return m_struct_type; + } + + MinimalUnionType& union_type_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_union_type.~MinimalUnionType();}; + new(&m_union_type) MinimalUnionType(); + ; + } + + return m_union_type; + } + + MinimalBitsetType& bitset_type_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_bitset_type.~MinimalBitsetType();}; + new(&m_bitset_type) MinimalBitsetType(); + ; + } + + return m_bitset_type; + } + + MinimalSequenceType& sequence_type_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_sequence_type.~MinimalSequenceType();}; + new(&m_sequence_type) MinimalSequenceType(); + ; + } + + return m_sequence_type; + } + + MinimalArrayType& array_type_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_array_type.~MinimalArrayType();}; + new(&m_array_type) MinimalArrayType(); + ; + } + + return m_array_type; + } + + MinimalMapType& map_type_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_type.~MinimalMapType();}; + new(&m_map_type) MinimalMapType(); + ; + } + + return m_map_type; + } + + MinimalEnumeratedType& enumerated_type_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_enumerated_type.~MinimalEnumeratedType();}; + new(&m_enumerated_type) MinimalEnumeratedType(); + ; + } + + return m_enumerated_type; + } + + MinimalBitmaskType& bitmask_type_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_bitmask_type.~MinimalBitmaskType();}; + new(&m_bitmask_type) MinimalBitmaskType(); + ; + } + + return m_bitmask_type; + } + + MinimalExtendedType& extended_type_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_type.~MinimalExtendedType();}; + new(&m_extended_type) MinimalExtendedType(); + ; + } + + return m_extended_type; + } + + + uint8_t m__d {0}; + + union + { + MinimalAliasType m_alias_type; + MinimalAnnotationType m_annotation_type; + MinimalStructType m_struct_type; + MinimalUnionType m_union_type; + MinimalBitsetType m_bitset_type; + MinimalSequenceType m_sequence_type; + MinimalArrayType m_array_type; + MinimalMapType m_map_type; + MinimalEnumeratedType m_enumerated_type; + MinimalBitmaskType m_bitmask_type; + MinimalExtendedType m_extended_type; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the union TypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeObject() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject( + const TypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = x.m_complete; + break; + + case 0x00000002: + minimal_() = x.m_minimal; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject( + TypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = std::move(x.m_complete); + break; + + case 0x00000002: + minimal_() = std::move(x.m_minimal); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject& operator =( + const TypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = x.m_complete; + break; + + case 0x00000002: + minimal_() = x.m_minimal; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject& operator =( + TypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = std::move(x.m_complete); + break; + + case 0x00000002: + minimal_() = std::move(x.m_minimal); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_complete == x.m_complete); + break; + + case 0x00000002: + ret_value = (m_minimal == x.m_minimal); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EK_COMPLETE: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EK_MINIMAL: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member complete + * @param _complete New value to be copied in member complete + */ + eProsima_user_DllExport void complete( + const CompleteTypeObject& _complete) + { + complete_() = _complete; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member complete + * @param _complete New value to be moved in member complete + */ + eProsima_user_DllExport void complete( + CompleteTypeObject&& _complete) + { + complete_() = _complete; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member complete + * @return Constant reference to member complete + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteTypeObject& complete() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_complete; + } + + /*! + * @brief This function returns a reference to member complete + * @return Reference to member complete + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteTypeObject& complete() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_complete; + } + + + /*! + * @brief This function copies the value in member minimal + * @param _minimal New value to be copied in member minimal + */ + eProsima_user_DllExport void minimal( + const MinimalTypeObject& _minimal) + { + minimal_() = _minimal; + m__d = EK_MINIMAL; + } + + /*! + * @brief This function moves the value in member minimal + * @param _minimal New value to be moved in member minimal + */ + eProsima_user_DllExport void minimal( + MinimalTypeObject&& _minimal) + { + minimal_() = _minimal; + m__d = EK_MINIMAL; + } + + /*! + * @brief This function returns a constant reference to member minimal + * @return Constant reference to member minimal + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalTypeObject& minimal() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_minimal; + } + + /*! + * @brief This function returns a reference to member minimal + * @return Reference to member minimal + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalTypeObject& minimal() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_minimal; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + CompleteTypeObject& complete_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_complete.~CompleteTypeObject();}; + new(&m_complete) CompleteTypeObject(); + ; + } + + return m_complete; + } + + MinimalTypeObject& minimal_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_minimal.~MinimalTypeObject();}; + new(&m_minimal) MinimalTypeObject(); + ; + } + + return m_minimal; + } + + + uint8_t m__d {0}; + + union + { + CompleteTypeObject m_complete; + MinimalTypeObject m_minimal; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +typedef std::vector TypeObjectSeq; + +typedef TypeObjectSeq StronglyConnectedComponent; + +/*! + * @brief This class represents the structure TypeIdentifierTypeObjectPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierTypeObjectPair +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierTypeObjectPair() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair( + const TypeIdentifierTypeObjectPair& x) + { + m_type_identifier = x.m_type_identifier; + + m_type_object = x.m_type_object; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair( + TypeIdentifierTypeObjectPair&& x) noexcept + { + m_type_identifier = std::move(x.m_type_identifier); + m_type_object = std::move(x.m_type_object); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair& operator =( + const TypeIdentifierTypeObjectPair& x) + { + + m_type_identifier = x.m_type_identifier; + + m_type_object = x.m_type_object; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair& operator =( + TypeIdentifierTypeObjectPair&& x) noexcept + { + + m_type_identifier = std::move(x.m_type_identifier); + m_type_object = std::move(x.m_type_object); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierTypeObjectPair object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierTypeObjectPair& x) const + { + return (m_type_identifier == x.m_type_identifier && + m_type_object == x.m_type_object); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierTypeObjectPair object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierTypeObjectPair& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_identifier + * @param _type_identifier New value to be copied in member type_identifier + */ + eProsima_user_DllExport void type_identifier( + const TypeIdentifier& _type_identifier) + { + m_type_identifier = _type_identifier; + } + + /*! + * @brief This function moves the value in member type_identifier + * @param _type_identifier New value to be moved in member type_identifier + */ + eProsima_user_DllExport void type_identifier( + TypeIdentifier&& _type_identifier) + { + m_type_identifier = std::move(_type_identifier); + } + + /*! + * @brief This function returns a constant reference to member type_identifier + * @return Constant reference to member type_identifier + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier() const + { + return m_type_identifier; + } + + /*! + * @brief This function returns a reference to member type_identifier + * @return Reference to member type_identifier + */ + eProsima_user_DllExport TypeIdentifier& type_identifier() + { + return m_type_identifier; + } + + + /*! + * @brief This function copies the value in member type_object + * @param _type_object New value to be copied in member type_object + */ + eProsima_user_DllExport void type_object( + const TypeObject& _type_object) + { + m_type_object = _type_object; + } + + /*! + * @brief This function moves the value in member type_object + * @param _type_object New value to be moved in member type_object + */ + eProsima_user_DllExport void type_object( + TypeObject&& _type_object) + { + m_type_object = std::move(_type_object); + } + + /*! + * @brief This function returns a constant reference to member type_object + * @return Constant reference to member type_object + */ + eProsima_user_DllExport const TypeObject& type_object() const + { + return m_type_object; + } + + /*! + * @brief This function returns a reference to member type_object + * @return Reference to member type_object + */ + eProsima_user_DllExport TypeObject& type_object() + { + return m_type_object; + } + + + +private: + + TypeIdentifier m_type_identifier; + TypeObject m_type_object; + +}; +typedef std::vector TypeIdentifierTypeObjectPairSeq; + +/*! + * @brief This class represents the structure TypeIdentifierPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierPair +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierPair() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierPair() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair( + const TypeIdentifierPair& x) + { + m_type_identifier1 = x.m_type_identifier1; + + m_type_identifier2 = x.m_type_identifier2; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair( + TypeIdentifierPair&& x) noexcept + { + m_type_identifier1 = std::move(x.m_type_identifier1); + m_type_identifier2 = std::move(x.m_type_identifier2); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair& operator =( + const TypeIdentifierPair& x) + { + + m_type_identifier1 = x.m_type_identifier1; + + m_type_identifier2 = x.m_type_identifier2; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair& operator =( + TypeIdentifierPair&& x) noexcept + { + + m_type_identifier1 = std::move(x.m_type_identifier1); + m_type_identifier2 = std::move(x.m_type_identifier2); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierPair object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierPair& x) const + { + return (m_type_identifier1 == x.m_type_identifier1 && + m_type_identifier2 == x.m_type_identifier2); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierPair object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierPair& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_identifier1 + * @param _type_identifier1 New value to be copied in member type_identifier1 + */ + eProsima_user_DllExport void type_identifier1( + const TypeIdentifier& _type_identifier1) + { + m_type_identifier1 = _type_identifier1; + } + + /*! + * @brief This function moves the value in member type_identifier1 + * @param _type_identifier1 New value to be moved in member type_identifier1 + */ + eProsima_user_DllExport void type_identifier1( + TypeIdentifier&& _type_identifier1) + { + m_type_identifier1 = std::move(_type_identifier1); + } + + /*! + * @brief This function returns a constant reference to member type_identifier1 + * @return Constant reference to member type_identifier1 + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier1() const + { + return m_type_identifier1; + } + + /*! + * @brief This function returns a reference to member type_identifier1 + * @return Reference to member type_identifier1 + */ + eProsima_user_DllExport TypeIdentifier& type_identifier1() + { + return m_type_identifier1; + } + + + /*! + * @brief This function copies the value in member type_identifier2 + * @param _type_identifier2 New value to be copied in member type_identifier2 + */ + eProsima_user_DllExport void type_identifier2( + const TypeIdentifier& _type_identifier2) + { + m_type_identifier2 = _type_identifier2; + } + + /*! + * @brief This function moves the value in member type_identifier2 + * @param _type_identifier2 New value to be moved in member type_identifier2 + */ + eProsima_user_DllExport void type_identifier2( + TypeIdentifier&& _type_identifier2) + { + m_type_identifier2 = std::move(_type_identifier2); + } + + /*! + * @brief This function returns a constant reference to member type_identifier2 + * @return Constant reference to member type_identifier2 + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier2() const + { + return m_type_identifier2; + } + + /*! + * @brief This function returns a reference to member type_identifier2 + * @return Reference to member type_identifier2 + */ + eProsima_user_DllExport TypeIdentifier& type_identifier2() + { + return m_type_identifier2; + } + + + +private: + + TypeIdentifier m_type_identifier1; + TypeIdentifier m_type_identifier2; + +}; +typedef std::vector TypeIdentifierPairSeq; + +/*! + * @brief This class represents the structure TypeIdentfierWithSize defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentfierWithSize +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentfierWithSize() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentfierWithSize() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize( + const TypeIdentfierWithSize& x) + { + m_type_id = x.m_type_id; + + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize( + TypeIdentfierWithSize&& x) noexcept + { + m_type_id = std::move(x.m_type_id); + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize& operator =( + const TypeIdentfierWithSize& x) + { + + m_type_id = x.m_type_id; + + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize& operator =( + TypeIdentfierWithSize&& x) noexcept + { + + m_type_id = std::move(x.m_type_id); + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentfierWithSize object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentfierWithSize& x) const + { + return (m_type_id == x.m_type_id && + m_typeobject_serialized_size == x.m_typeobject_serialized_size); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentfierWithSize object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentfierWithSize& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + /*! + * @brief This function sets a value in member typeobject_serialized_size + * @param _typeobject_serialized_size New value for member typeobject_serialized_size + */ + eProsima_user_DllExport void typeobject_serialized_size( + uint32_t _typeobject_serialized_size) + { + m_typeobject_serialized_size = _typeobject_serialized_size; + } + + /*! + * @brief This function returns the value of member typeobject_serialized_size + * @return Value of member typeobject_serialized_size + */ + eProsima_user_DllExport uint32_t typeobject_serialized_size() const + { + return m_typeobject_serialized_size; + } + + /*! + * @brief This function returns a reference to member typeobject_serialized_size + * @return Reference to member typeobject_serialized_size + */ + eProsima_user_DllExport uint32_t& typeobject_serialized_size() + { + return m_typeobject_serialized_size; + } + + + +private: + + TypeIdentifier m_type_id; + uint32_t m_typeobject_serialized_size{0}; + +}; +typedef std::vector TypeIdentfierWithSizeSeq; + +/*! + * @brief This class represents the structure TypeIdentifierWithDependencies defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierWithDependencies +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierWithDependencies() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies( + const TypeIdentifierWithDependencies& x) + { + m_typeid_with_size = x.m_typeid_with_size; + + m_dependent_typeid_count = x.m_dependent_typeid_count; + + m_dependent_typeids = x.m_dependent_typeids; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies( + TypeIdentifierWithDependencies&& x) noexcept + { + m_typeid_with_size = std::move(x.m_typeid_with_size); + m_dependent_typeid_count = x.m_dependent_typeid_count; + m_dependent_typeids = std::move(x.m_dependent_typeids); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& operator =( + const TypeIdentifierWithDependencies& x) + { + + m_typeid_with_size = x.m_typeid_with_size; + + m_dependent_typeid_count = x.m_dependent_typeid_count; + + m_dependent_typeids = x.m_dependent_typeids; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& operator =( + TypeIdentifierWithDependencies&& x) noexcept + { + + m_typeid_with_size = std::move(x.m_typeid_with_size); + m_dependent_typeid_count = x.m_dependent_typeid_count; + m_dependent_typeids = std::move(x.m_dependent_typeids); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierWithDependencies object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierWithDependencies& x) const + { + return (m_typeid_with_size == x.m_typeid_with_size && + m_dependent_typeid_count == x.m_dependent_typeid_count && + m_dependent_typeids == x.m_dependent_typeids); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierWithDependencies object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierWithDependencies& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member typeid_with_size + * @param _typeid_with_size New value to be copied in member typeid_with_size + */ + eProsima_user_DllExport void typeid_with_size( + const TypeIdentfierWithSize& _typeid_with_size) + { + m_typeid_with_size = _typeid_with_size; + } + + /*! + * @brief This function moves the value in member typeid_with_size + * @param _typeid_with_size New value to be moved in member typeid_with_size + */ + eProsima_user_DllExport void typeid_with_size( + TypeIdentfierWithSize&& _typeid_with_size) + { + m_typeid_with_size = std::move(_typeid_with_size); + } + + /*! + * @brief This function returns a constant reference to member typeid_with_size + * @return Constant reference to member typeid_with_size + */ + eProsima_user_DllExport const TypeIdentfierWithSize& typeid_with_size() const + { + return m_typeid_with_size; + } + + /*! + * @brief This function returns a reference to member typeid_with_size + * @return Reference to member typeid_with_size + */ + eProsima_user_DllExport TypeIdentfierWithSize& typeid_with_size() + { + return m_typeid_with_size; + } + + + /*! + * @brief This function sets a value in member dependent_typeid_count + * @param _dependent_typeid_count New value for member dependent_typeid_count + */ + eProsima_user_DllExport void dependent_typeid_count( + int32_t _dependent_typeid_count) + { + m_dependent_typeid_count = _dependent_typeid_count; + } + + /*! + * @brief This function returns the value of member dependent_typeid_count + * @return Value of member dependent_typeid_count + */ + eProsima_user_DllExport int32_t dependent_typeid_count() const + { + return m_dependent_typeid_count; + } + + /*! + * @brief This function returns a reference to member dependent_typeid_count + * @return Reference to member dependent_typeid_count + */ + eProsima_user_DllExport int32_t& dependent_typeid_count() + { + return m_dependent_typeid_count; + } + + + /*! + * @brief This function copies the value in member dependent_typeids + * @param _dependent_typeids New value to be copied in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + const std::vector& _dependent_typeids) + { + m_dependent_typeids = _dependent_typeids; + } + + /*! + * @brief This function moves the value in member dependent_typeids + * @param _dependent_typeids New value to be moved in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + std::vector&& _dependent_typeids) + { + m_dependent_typeids = std::move(_dependent_typeids); + } + + /*! + * @brief This function returns a constant reference to member dependent_typeids + * @return Constant reference to member dependent_typeids + */ + eProsima_user_DllExport const std::vector& dependent_typeids() const + { + return m_dependent_typeids; + } + + /*! + * @brief This function returns a reference to member dependent_typeids + * @return Reference to member dependent_typeids + */ + eProsima_user_DllExport std::vector& dependent_typeids() + { + return m_dependent_typeids; + } + + + +private: + + TypeIdentfierWithSize m_typeid_with_size; + int32_t m_dependent_typeid_count{0}; + std::vector m_dependent_typeids; + +}; +typedef std::vector TypeIdentifierWithDependenciesSeq; + +/*! + * @brief This class represents the structure TypeInformation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeInformation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeInformation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeInformation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation( + const TypeInformation& x) + { + m_minimal = x.m_minimal; + + m_complete = x.m_complete; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation( + TypeInformation&& x) noexcept + { + m_minimal = std::move(x.m_minimal); + m_complete = std::move(x.m_complete); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation& operator =( + const TypeInformation& x) + { + + m_minimal = x.m_minimal; + + m_complete = x.m_complete; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation& operator =( + TypeInformation&& x) noexcept + { + + m_minimal = std::move(x.m_minimal); + m_complete = std::move(x.m_complete); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeInformation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeInformation& x) const + { + return (m_minimal == x.m_minimal && + m_complete == x.m_complete); + } + + /*! + * @brief Comparison operator. + * @param x TypeInformation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeInformation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member minimal + * @param _minimal New value to be copied in member minimal + */ + eProsima_user_DllExport void minimal( + const TypeIdentifierWithDependencies& _minimal) + { + m_minimal = _minimal; + } + + /*! + * @brief This function moves the value in member minimal + * @param _minimal New value to be moved in member minimal + */ + eProsima_user_DllExport void minimal( + TypeIdentifierWithDependencies&& _minimal) + { + m_minimal = std::move(_minimal); + } + + /*! + * @brief This function returns a constant reference to member minimal + * @return Constant reference to member minimal + */ + eProsima_user_DllExport const TypeIdentifierWithDependencies& minimal() const + { + return m_minimal; + } + + /*! + * @brief This function returns a reference to member minimal + * @return Reference to member minimal + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& minimal() + { + return m_minimal; + } + + + /*! + * @brief This function copies the value in member complete + * @param _complete New value to be copied in member complete + */ + eProsima_user_DllExport void complete( + const TypeIdentifierWithDependencies& _complete) + { + m_complete = _complete; + } + + /*! + * @brief This function moves the value in member complete + * @param _complete New value to be moved in member complete + */ + eProsima_user_DllExport void complete( + TypeIdentifierWithDependencies&& _complete) + { + m_complete = std::move(_complete); + } + + /*! + * @brief This function returns a constant reference to member complete + * @return Constant reference to member complete + */ + eProsima_user_DllExport const TypeIdentifierWithDependencies& complete() const + { + return m_complete; + } + + /*! + * @brief This function returns a reference to member complete + * @return Reference to member complete + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& complete() + { + return m_complete; + } + + + +private: + + TypeIdentifierWithDependencies m_minimal; + TypeIdentifierWithDependencies m_complete; + +}; +typedef std::vector TypeInformationSeq; + + +} // namespace xtypes + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ + + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp new file mode 100644 index 00000000000..4a9d0b5e4da --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp @@ -0,0 +1,808 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dds_xtypes_typeobjectCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ + +#include "dds_xtypes_typeobject.hpp" + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructMember_max_cdr_typesize {1436UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitflag_max_cdr_typesize {1404UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitflag_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_cdr_typesize {10UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetType_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitflag_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitflag_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasType_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_max_cdr_typesize {672UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructType_max_cdr_typesize {700UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionElement_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionElement_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainCollectionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationType_max_cdr_typesize {16UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonUnionMember_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonUnionMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetType_max_cdr_typesize {672UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAliasBody_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitfield_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitfield_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructHeader_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_max_cdr_typesize {304UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteExtendedType_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteExtendedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_max_cdr_typesize {265UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_cdr_typesize {18UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasType_max_cdr_typesize {1828UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_max_cdr_typesize {2UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructMember_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteTypeDetail_max_cdr_typesize {649UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteTypeDetail_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitmaskType_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitmaskType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayHeader_max_cdr_typesize {657UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayHeader_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructType_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMapType_max_cdr_typesize {3012UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMapType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_cdr_typesize {657UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitfield_max_cdr_typesize {1408UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitfield_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierPair_max_cdr_typesize {64UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierPair_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_cdr_typesize {1100UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMemberDetail_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMemberDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_cdr_typesize {356UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_max_cdr_typesize {669UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMapType_max_cdr_typesize {84UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMapType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeInformation_max_cdr_typesize {140UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeInformation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_cdr_typesize {1412UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionElement_max_cdr_typesize {1168UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayType_max_cdr_typesize {1836UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructHeader_max_cdr_typesize {685UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationType_max_cdr_typesize {280UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_max_cdr_typesize {272UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_max_cdr_typesize {68UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasBody_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringSTypeDefn_max_cdr_typesize {1UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringSTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteElementDetail_max_cdr_typesize {1132UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteElementDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasBody_max_cdr_typesize {1168UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringLTypeDefn_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringLTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteSequenceType_max_cdr_typesize {1844UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteSequenceType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitmaskType_max_cdr_typesize {676UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitmaskType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionMember_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionMember_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_max_cdr_typesize {72UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_max_cdr_typesize {2UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_cdr_typesize {3048UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalSequenceType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalSequenceType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitflag_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitflag_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_max_cdr_typesize {560UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotation_max_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonStructMember_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonStructMember_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonArrayHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonArrayHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalTypeDetail_max_cdr_typesize {0UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalTypeDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_cdr_typesize {424UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionType_max_cdr_typesize {52UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitfield_max_cdr_typesize {14UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitfield_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalExtendedType_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalExtendedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayHeader_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_cdr_typesize {340UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMemberDetail_max_cdr_typesize {1396UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMemberDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionMember_max_cdr_typesize {1440UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionType_max_cdr_typesize {1092UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionType_max_key_cdr_typesize {0UL}; + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringSTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringLTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data); + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotation& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonStructMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonUnionMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteElementDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteSequenceType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalSequenceType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMapType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMapType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitflag& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitflag& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitflag& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitfield& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitfield& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitfield& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteExtendedType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalExtendedType& data); + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeInformation& data); + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h new file mode 100644 index 00000000000..e0ab20d2983 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h @@ -0,0 +1,9261 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dds_xtypes_typeobjectPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "dds_xtypes_typeobject.hpp" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated dds_xtypes_typeobject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace xtypes { + + +typedef uint8_t EquivalenceKind; + + + +typedef uint8_t TypeKind; + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef uint8_t TypeIdentiferKind; + + + + + + + + + + + + +typedef eprosima::fastcdr::fixed_string MemberName; + +typedef eprosima::fastcdr::fixed_string QualifiedTypeName; +typedef uint8_t PrimitiveTypeId; +typedef std::array EquivalenceHash; +typedef std::array NameHash; +typedef uint32_t LBound; +typedef std::vector LBoundSeq; + +typedef uint8_t SBound; +typedef std::vector SBoundSeq; + + + +typedef eprosima::fastdds::dds::xtypes::MemberFlag CollectionElementFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag StructMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag UnionMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag UnionDiscriminatorFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag EnumeratedLiteralFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag AnnotationParameterFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag AliasMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag BitflagFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag BitsetMemberFlag; + + +typedef eprosima::fastdds::dds::xtypes::TypeFlag StructTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag UnionTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag CollectionTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag AnnotationTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag AliasTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag EnumTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag BitmaskTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag BitsetTypeFlag; + + + +#ifndef SWIG +namespace detail { + +template +struct StringSTypeDefn_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct StringSTypeDefn_f +{ + typedef eprosima::fastdds::dds::xtypes::SBound StringSTypeDefn::* type; + friend constexpr type get( + StringSTypeDefn_f); +}; + +template struct StringSTypeDefn_rob; + +template +inline size_t constexpr StringSTypeDefn_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type StringSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringSTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StringSTypeDefn type; + + eProsima_user_DllExport StringSTypeDefnPubSubType(); + + eProsima_user_DllExport ~StringSTypeDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) StringSTypeDefn(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 1ULL == + (detail::StringSTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::SBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 1ULL == + (detail::StringSTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::SBound)); + } + +}; + +#ifndef SWIG +namespace detail { + +template +struct StringLTypeDefn_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct StringLTypeDefn_f +{ + typedef eprosima::fastdds::dds::xtypes::LBound StringLTypeDefn::* type; + friend constexpr type get( + StringLTypeDefn_f); +}; + +template struct StringLTypeDefn_rob; + +template +inline size_t constexpr StringLTypeDefn_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type StringLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringLTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StringLTypeDefn type; + + eProsima_user_DllExport StringLTypeDefnPubSubType(); + + eProsima_user_DllExport ~StringLTypeDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) StringLTypeDefn(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::StringLTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::StringLTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainCollectionHeader type; + + eProsima_user_DllExport PlainCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~PlainCollectionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainSequenceSElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceSElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainSequenceSElemDefn type; + + eProsima_user_DllExport PlainSequenceSElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainSequenceSElemDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainSequenceLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceLElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainSequenceLElemDefn type; + + eProsima_user_DllExport PlainSequenceLElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainSequenceLElemDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainArraySElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArraySElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainArraySElemDefn type; + + eProsima_user_DllExport PlainArraySElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainArraySElemDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainArrayLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArrayLElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainArrayLElemDefn type; + + eProsima_user_DllExport PlainArrayLElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainArrayLElemDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainMapSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapSTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainMapSTypeDefn type; + + eProsima_user_DllExport PlainMapSTypeDefnPubSubType(); + + eProsima_user_DllExport ~PlainMapSTypeDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainMapLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapLTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainMapLTypeDefn type; + + eProsima_user_DllExport PlainMapLTypeDefnPubSubType(); + + eProsima_user_DllExport ~PlainMapLTypeDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type StronglyConnectedComponentId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StronglyConnectedComponentIdPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StronglyConnectedComponentId type; + + eProsima_user_DllExport StronglyConnectedComponentIdPubSubType(); + + eProsima_user_DllExport ~StronglyConnectedComponentIdPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type ExtendedTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ExtendedTypeDefn type; + + eProsima_user_DllExport ExtendedTypeDefnPubSubType(); + + eProsima_user_DllExport ~ExtendedTypeDefnPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +typedef std::vector TypeIdentifierSeq; +typedef uint32_t MemberId; + + + +/*! + * @brief This class represents the TopicDataType of the type ExtendedAnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedAnnotationParameterValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ExtendedAnnotationParameterValue type; + + eProsima_user_DllExport ExtendedAnnotationParameterValuePubSubType(); + + eProsima_user_DllExport ~ExtendedAnnotationParameterValuePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +/*! + * @brief This class represents the TopicDataType of the type AppliedAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedAnnotationParameter type; + + eProsima_user_DllExport AppliedAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~AppliedAnnotationParameterPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector AppliedAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedAnnotation type; + + eProsima_user_DllExport AppliedAnnotationPubSubType(); + + eProsima_user_DllExport ~AppliedAnnotationPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector AppliedAnnotationSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedVerbatimAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedVerbatimAnnotationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedVerbatimAnnotation type; + + eProsima_user_DllExport AppliedVerbatimAnnotationPubSubType(); + + eProsima_user_DllExport ~AppliedVerbatimAnnotationPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type AppliedBuiltinMemberAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinMemberAnnotationsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedBuiltinMemberAnnotations type; + + eProsima_user_DllExport AppliedBuiltinMemberAnnotationsPubSubType(); + + eProsima_user_DllExport ~AppliedBuiltinMemberAnnotationsPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonStructMember type; + + eProsima_user_DllExport CommonStructMemberPubSubType(); + + eProsima_user_DllExport ~CommonStructMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMemberDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteMemberDetail type; + + eProsima_user_DllExport CompleteMemberDetailPubSubType(); + + eProsima_user_DllExport ~CompleteMemberDetailPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +#ifndef SWIG +namespace detail { + +template +struct MinimalMemberDetail_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct MinimalMemberDetail_f +{ + typedef eprosima::fastdds::dds::xtypes::NameHash MinimalMemberDetail::* type; + friend constexpr type get( + MinimalMemberDetail_f); +}; + +template struct MinimalMemberDetail_rob; + +template +inline size_t constexpr MinimalMemberDetail_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type MinimalMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMemberDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalMemberDetail type; + + eProsima_user_DllExport MinimalMemberDetailPubSubType(); + + eProsima_user_DllExport ~MinimalMemberDetailPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) MinimalMemberDetail(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::MinimalMemberDetail_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::NameHash)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::MinimalMemberDetail_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::NameHash)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructMember type; + + eProsima_user_DllExport CompleteStructMemberPubSubType(); + + eProsima_user_DllExport ~CompleteStructMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteStructMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructMember type; + + eProsima_user_DllExport MinimalStructMemberPubSubType(); + + eProsima_user_DllExport ~MinimalStructMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalStructMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedBuiltinTypeAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinTypeAnnotationsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedBuiltinTypeAnnotations type; + + eProsima_user_DllExport AppliedBuiltinTypeAnnotationsPubSubType(); + + eProsima_user_DllExport ~AppliedBuiltinTypeAnnotationsPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalTypeDetail type; + + eProsima_user_DllExport MinimalTypeDetailPubSubType(); + + eProsima_user_DllExport ~MinimalTypeDetailPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) MinimalTypeDetail(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return true; + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return true; + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteTypeDetail type; + + eProsima_user_DllExport CompleteTypeDetailPubSubType(); + + eProsima_user_DllExport ~CompleteTypeDetailPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructHeader type; + + eProsima_user_DllExport CompleteStructHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteStructHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructHeader type; + + eProsima_user_DllExport MinimalStructHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalStructHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructType type; + + eProsima_user_DllExport CompleteStructTypePubSubType(); + + eProsima_user_DllExport ~CompleteStructTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructType type; + + eProsima_user_DllExport MinimalStructTypePubSubType(); + + eProsima_user_DllExport ~MinimalStructTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector UnionCaseLabelSeq; + +/*! + * @brief This class represents the TopicDataType of the type CommonUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonUnionMember type; + + eProsima_user_DllExport CommonUnionMemberPubSubType(); + + eProsima_user_DllExport ~CommonUnionMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionMember type; + + eProsima_user_DllExport CompleteUnionMemberPubSubType(); + + eProsima_user_DllExport ~CompleteUnionMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteUnionMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionMember type; + + eProsima_user_DllExport MinimalUnionMemberPubSubType(); + + eProsima_user_DllExport ~MinimalUnionMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalUnionMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type CommonDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonDiscriminatorMember type; + + eProsima_user_DllExport CommonDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~CommonDiscriminatorMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteDiscriminatorMember type; + + eProsima_user_DllExport CompleteDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~CompleteDiscriminatorMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalDiscriminatorMember type; + + eProsima_user_DllExport MinimalDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~MinimalDiscriminatorMemberPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionHeader type; + + eProsima_user_DllExport CompleteUnionHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteUnionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionHeader type; + + eProsima_user_DllExport MinimalUnionHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalUnionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionType type; + + eProsima_user_DllExport CompleteUnionTypePubSubType(); + + eProsima_user_DllExport ~CompleteUnionTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionType type; + + eProsima_user_DllExport MinimalUnionTypePubSubType(); + + eProsima_user_DllExport ~MinimalUnionTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonAnnotationParameter type; + + eProsima_user_DllExport CommonAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~CommonAnnotationParameterPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationParameter type; + + eProsima_user_DllExport CompleteAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationParameterPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationParameter type; + + eProsima_user_DllExport MinimalAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationParameterPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationHeader type; + + eProsima_user_DllExport CompleteAnnotationHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationHeader type; + + eProsima_user_DllExport MinimalAnnotationHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationType type; + + eProsima_user_DllExport CompleteAnnotationTypePubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationType type; + + eProsima_user_DllExport MinimalAnnotationTypePubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonAliasBody type; + + eProsima_user_DllExport CommonAliasBodyPubSubType(); + + eProsima_user_DllExport ~CommonAliasBodyPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasBody type; + + eProsima_user_DllExport CompleteAliasBodyPubSubType(); + + eProsima_user_DllExport ~CompleteAliasBodyPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasBody type; + + eProsima_user_DllExport MinimalAliasBodyPubSubType(); + + eProsima_user_DllExport ~MinimalAliasBodyPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasHeader type; + + eProsima_user_DllExport CompleteAliasHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteAliasHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasHeader type; + + eProsima_user_DllExport MinimalAliasHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalAliasHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasType type; + + eProsima_user_DllExport CompleteAliasTypePubSubType(); + + eProsima_user_DllExport ~CompleteAliasTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasType type; + + eProsima_user_DllExport MinimalAliasTypePubSubType(); + + eProsima_user_DllExport ~MinimalAliasTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteElementDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteElementDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteElementDetail type; + + eProsima_user_DllExport CompleteElementDetailPubSubType(); + + eProsima_user_DllExport ~CompleteElementDetailPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonCollectionElement type; + + eProsima_user_DllExport CommonCollectionElementPubSubType(); + + eProsima_user_DllExport ~CommonCollectionElementPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteCollectionElement type; + + eProsima_user_DllExport CompleteCollectionElementPubSubType(); + + eProsima_user_DllExport ~CompleteCollectionElementPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalCollectionElement type; + + eProsima_user_DllExport MinimalCollectionElementPubSubType(); + + eProsima_user_DllExport ~MinimalCollectionElementPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +#ifndef SWIG +namespace detail { + +template +struct CommonCollectionHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonCollectionHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::LBound CommonCollectionHeader::* type; + friend constexpr type get( + CommonCollectionHeader_f); +}; + +template struct CommonCollectionHeader_rob; + +template +inline size_t constexpr CommonCollectionHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonCollectionHeader type; + + eProsima_user_DllExport CommonCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~CommonCollectionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) CommonCollectionHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::CommonCollectionHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::CommonCollectionHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteCollectionHeader type; + + eProsima_user_DllExport CompleteCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteCollectionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalCollectionHeader type; + + eProsima_user_DllExport MinimalCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalCollectionHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteSequenceTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteSequenceType type; + + eProsima_user_DllExport CompleteSequenceTypePubSubType(); + + eProsima_user_DllExport ~CompleteSequenceTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalSequenceTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalSequenceType type; + + eProsima_user_DllExport MinimalSequenceTypePubSubType(); + + eProsima_user_DllExport ~MinimalSequenceTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonArrayHeader type; + + eProsima_user_DllExport CommonArrayHeaderPubSubType(); + + eProsima_user_DllExport ~CommonArrayHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteArrayHeader type; + + eProsima_user_DllExport CompleteArrayHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteArrayHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalArrayHeader type; + + eProsima_user_DllExport MinimalArrayHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalArrayHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteArrayType type; + + eProsima_user_DllExport CompleteArrayTypePubSubType(); + + eProsima_user_DllExport ~CompleteArrayTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalArrayType type; + + eProsima_user_DllExport MinimalArrayTypePubSubType(); + + eProsima_user_DllExport ~MinimalArrayTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMapTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteMapType type; + + eProsima_user_DllExport CompleteMapTypePubSubType(); + + eProsima_user_DllExport ~CompleteMapTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMapTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalMapType type; + + eProsima_user_DllExport MinimalMapTypePubSubType(); + + eProsima_user_DllExport ~MinimalMapTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef uint16_t BitBound; + +/*! + * @brief This class represents the TopicDataType of the type CommonEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonEnumeratedLiteral type; + + eProsima_user_DllExport CommonEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~CommonEnumeratedLiteralPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedLiteral type; + + eProsima_user_DllExport CompleteEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedLiteralPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteEnumeratedLiteralSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedLiteral type; + + eProsima_user_DllExport MinimalEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedLiteralPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalEnumeratedLiteralSeq; + +#ifndef SWIG +namespace detail { + +template +struct CommonEnumeratedHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonEnumeratedHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::BitBound CommonEnumeratedHeader::* type; + friend constexpr type get( + CommonEnumeratedHeader_f); +}; + +template struct CommonEnumeratedHeader_rob; + +template +inline size_t constexpr CommonEnumeratedHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonEnumeratedHeader type; + + eProsima_user_DllExport CommonEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~CommonEnumeratedHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) CommonEnumeratedHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 2ULL == + (detail::CommonEnumeratedHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 2ULL == + (detail::CommonEnumeratedHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedHeader type; + + eProsima_user_DllExport CompleteEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedHeader type; + + eProsima_user_DllExport MinimalEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedType type; + + eProsima_user_DllExport CompleteEnumeratedTypePubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedType type; + + eProsima_user_DllExport MinimalEnumeratedTypePubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitflag type; + + eProsima_user_DllExport CommonBitflagPubSubType(); + + eProsima_user_DllExport ~CommonBitflagPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitflag type; + + eProsima_user_DllExport CompleteBitflagPubSubType(); + + eProsima_user_DllExport ~CompleteBitflagPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteBitflagSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitflag type; + + eProsima_user_DllExport MinimalBitflagPubSubType(); + + eProsima_user_DllExport ~MinimalBitflagPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalBitflagSeq; + +#ifndef SWIG +namespace detail { + +template +struct CommonBitmaskHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonBitmaskHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::BitBound CommonBitmaskHeader::* type; + friend constexpr type get( + CommonBitmaskHeader_f); +}; + +template struct CommonBitmaskHeader_rob; + +template +inline size_t constexpr CommonBitmaskHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonBitmaskHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitmaskHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitmaskHeader type; + + eProsima_user_DllExport CommonBitmaskHeaderPubSubType(); + + eProsima_user_DllExport ~CommonBitmaskHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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 is_plain_xcdrv1_impl(); + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + if(data_representation == eprosima::fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION) + { + return is_plain_xcdrv2_impl(); + } + else + { + return is_plain_xcdrv1_impl(); + } + } + +#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 + { + new (memory) CommonBitmaskHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 2ULL == + (detail::CommonBitmaskHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 2ULL == + (detail::CommonBitmaskHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + +}; +typedef eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader CompleteBitmaskHeader; +typedef eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader MinimalBitmaskHeader; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitmaskTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitmaskType type; + + eProsima_user_DllExport CompleteBitmaskTypePubSubType(); + + eProsima_user_DllExport ~CompleteBitmaskTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitmaskTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitmaskType type; + + eProsima_user_DllExport MinimalBitmaskTypePubSubType(); + + eProsima_user_DllExport ~MinimalBitmaskTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitfield type; + + eProsima_user_DllExport CommonBitfieldPubSubType(); + + eProsima_user_DllExport ~CommonBitfieldPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitfield type; + + eProsima_user_DllExport CompleteBitfieldPubSubType(); + + eProsima_user_DllExport ~CompleteBitfieldPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteBitfieldSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitfield type; + + eProsima_user_DllExport MinimalBitfieldPubSubType(); + + eProsima_user_DllExport ~MinimalBitfieldPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalBitfieldSeq; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitsetHeader type; + + eProsima_user_DllExport CompleteBitsetHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteBitsetHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitsetHeader type; + + eProsima_user_DllExport MinimalBitsetHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalBitsetHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitsetType type; + + eProsima_user_DllExport CompleteBitsetTypePubSubType(); + + eProsima_user_DllExport ~CompleteBitsetTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitsetType type; + + eProsima_user_DllExport MinimalBitsetTypePubSubType(); + + eProsima_user_DllExport ~MinimalBitsetTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteExtendedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteExtendedType type; + + eProsima_user_DllExport CompleteExtendedTypePubSubType(); + + eProsima_user_DllExport ~CompleteExtendedTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +/*! + * @brief This class represents the TopicDataType of the type MinimalExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalExtendedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalExtendedType type; + + eProsima_user_DllExport MinimalExtendedTypePubSubType(); + + eProsima_user_DllExport ~MinimalExtendedTypePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +typedef std::vector TypeObjectSeq; +typedef eprosima::fastdds::dds::xtypes::TypeObjectSeq StronglyConnectedComponent; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierTypeObjectPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierTypeObjectPairPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierTypeObjectPair type; + + eProsima_user_DllExport TypeIdentifierTypeObjectPairPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierTypeObjectPairPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierTypeObjectPairSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierPairPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierPair type; + + eProsima_user_DllExport TypeIdentifierPairPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierPairPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierPairSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentfierWithSize defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentfierWithSizePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentfierWithSize type; + + eProsima_user_DllExport TypeIdentfierWithSizePubSubType(); + + eProsima_user_DllExport ~TypeIdentfierWithSizePubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentfierWithSizeSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierWithDependencies defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierWithDependenciesPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierWithDependencies type; + + eProsima_user_DllExport TypeIdentifierWithDependenciesPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierWithDependenciesPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierWithDependenciesSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeInformation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeInformationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeInformation type; + + eProsima_user_DllExport TypeInformationPubSubType(); + + eProsima_user_DllExport ~TypeInformationPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#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 + +#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; + } + +#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; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeInformationSeq; + +} // namespace xtypes + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ + diff --git a/include/fastdds/fastdds_auto_link.hpp b/include/fastdds/fastdds_auto_link.hpp new file mode 100644 index 00000000000..ba102ea87b7 --- /dev/null +++ b/include/fastdds/fastdds_auto_link.hpp @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + Expected defines. + + - EPROSIMA_LIB_NAME + - FASTDDS_VERSION_MAJOR + - FASTDDS_VERSION_MINOR + */ + +#if defined(_MSC_VER) + #define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X) + #define EPROSIMA_DO_STRINGIZE(X) #X + + #if defined(_DEBUG) + #define EPROSIMA_LIB_DEBUG_TAG "d" + #else + #define EPROSIMA_LIB_DEBUG_TAG + #endif // _DEBUG + +// Select linkage option. + #if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK) + #define EPROSIMA_LIB_PREFIX + #elif defined(EPROSIMA_DYN_LINK) + #error "Mixing a dll eprosima library with a static runtime is a bad idea" + #else + #define EPROSIMA_LIB_PREFIX "lib" + #endif // if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK) + +// Include library + #if defined(EPROSIMA_LIB_NAME) \ + && defined(EPROSIMA_LIB_PREFIX) \ + && defined(EPROSIMA_LIB_DEBUG_TAG) \ + && defined(FASTDDS_VERSION_MAJOR) \ + && defined(FASTDDS_VERSION_MINOR) + #pragma \ + comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG "-" EPROSIMA_STRINGIZE(FASTDDS_VERSION_MAJOR) "." EPROSIMA_STRINGIZE(FASTDDS_VERSION_MINOR) ".lib") + #else + #error "Some required macros where not defined" + #endif // if defined(EPROSIMA_LIB_NAME) && defined(EPROSIMA_LIB_PREFIX) && defined(EPROSIMA_LIB_DEBUG_TAG) && defined(FASTDDS_VERSION_MAJOR) && defined(FASTDDS_VERSION_MINOR) + +#endif // _MSC_VER + +// Undef macros +#ifdef EPROSIMA_LIB_PREFIX +#undef EPROSIMA_LIB_PREFIX +#endif // ifdef EPROSIMA_LIB_PREFIX + +#ifdef EPROSIMA_LIB_NAME +#undef EPROSIMA_LIB_NAME +#endif // ifdef EPROSIMA_LIB_NAME + +#ifdef EPROSIMA_LIB_DEBUG_TAG +#undef EPROSIMA_LIB_DEBUG_TAG +#endif // ifdef EPROSIMA_LIB_DEBUG_TAG diff --git a/include/fastdds/fastdds_dll.hpp b/include/fastdds/fastdds_dll.hpp new file mode 100644 index 00000000000..7e1d58bc5a7 --- /dev/null +++ b/include/fastdds/fastdds_dll.hpp @@ -0,0 +1,69 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_FASTDDS_DLL_H_ +#define _FASTDDS_FASTDDS_DLL_H_ + +#include + +// normalize macros +#if !defined(FASTDDS_DYN_LINK) && !defined(FASTDDS_STATIC_LINK) \ + && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK) +#define FASTDDS_STATIC_LINK +#endif // if !defined(FASTDDS_DYN_LINK) && !defined(FASTDDS_STATIC_LINK) && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK) + +#if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTDDS_DYN_LINK) +#define FASTDDS_DYN_LINK +#endif // if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTDDS_DYN_LINK) + +#if defined(FASTDDS_DYN_LINK) && defined(FASTDDS_STATIC_LINK) +#error Must not define both FASTDDS_DYN_LINK and FASTDDS_STATIC_LINK +#endif // if defined(FASTDDS_DYN_LINK) && defined(FASTDDS_STATIC_LINK) + +#if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTDDS_NO_LIB) +#define FASTDDS_NO_LIB +#endif // if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTDDS_NO_LIB) + +// enable dynamic linking + +#if defined(_WIN32) +#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK) +#if defined(fastdds_EXPORTS) +#define FASTDDS_EXPORTED_API __declspec( dllexport ) +#else +#define FASTDDS_EXPORTED_API __declspec( dllimport ) +#endif // FASTDDS_SOURCE +#else +#define FASTDDS_EXPORTED_API +#endif // if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK) +#else +#define FASTDDS_EXPORTED_API +#endif // _WIN32 + +// Auto linking. + +#if !defined(FASTDDS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \ + && !defined(FASTDDS_NO_LIB) + +// Set properties. +#define EPROSIMA_LIB_NAME fastdds + +#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK) +#define EPROSIMA_DYN_LINK +#endif // if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK) + +#include +#endif // auto-linking disabled + +#endif // _FASTDDS_FASTDDS_DLL_H_ diff --git a/include/fastdds/rtps/Endpoint.h b/include/fastdds/rtps/Endpoint.h index e33588c0b14..fd34fc14b72 100644 --- a/include/fastdds/rtps/Endpoint.h +++ b/include/fastdds/rtps/Endpoint.h @@ -20,15 +20,12 @@ #define _FASTDDS_RTPS_ENDPOINT_H_ #include - #include #include #include - #include #include - -#include +#include namespace eprosima { namespace fastrtps { @@ -78,7 +75,7 @@ class Endpoint * Get associated GUID * @return Associated GUID */ - RTPS_DllAPI inline const GUID_t& getGuid() const + FASTDDS_EXPORTED_API inline const GUID_t& getGuid() const { return m_guid; } @@ -87,7 +84,7 @@ class Endpoint * Get mutex * @return Associated Mutex */ - RTPS_DllAPI inline RecursiveTimedMutex& getMutex() + FASTDDS_EXPORTED_API inline RecursiveTimedMutex& getMutex() { return mp_mutex; } @@ -96,7 +93,7 @@ class Endpoint * Get associated attributes * @return Endpoint attributes */ - RTPS_DllAPI inline EndpointAttributes& getAttributes() + FASTDDS_EXPORTED_API inline EndpointAttributes& getAttributes() { return m_att; } diff --git a/include/fastdds/rtps/RTPSDomain.h b/include/fastdds/rtps/RTPSDomain.h index 401a1d1a6b3..ac2da360cc0 100644 --- a/include/fastdds/rtps/RTPSDomain.h +++ b/include/fastdds/rtps/RTPSDomain.h @@ -23,11 +23,13 @@ #include #include +#include #include #include #include #include #include +#include namespace eprosima { namespace fastrtps { @@ -63,7 +65,7 @@ class RTPSDomain * @param watch_thread Settings for the thread watching the environment file. * @param callback_thread Settings for the thread executing the callback when the environment file changed. */ - RTPS_DllAPI static void set_filewatch_thread_config( + FASTDDS_EXPORTED_API static void set_filewatch_thread_config( const fastdds::rtps::ThreadSettings& watch_thread, const fastdds::rtps::ThreadSettings& callback_thread); @@ -75,7 +77,7 @@ class RTPSDomain * \post After this call, all the pointers to RTPS entities are invalidated and their use may * result in undefined behaviour. */ - RTPS_DllAPI static void stopAll(); + FASTDDS_EXPORTED_API static void stopAll(); /** * @brief Create a RTPSParticipant. @@ -87,7 +89,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSParticipant* createParticipant( + FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant( uint32_t domain_id, const RTPSParticipantAttributes& attrs, RTPSParticipantListener* plisten = nullptr); @@ -103,7 +105,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSParticipant() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSParticipant* createParticipant( + FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant( uint32_t domain_id, bool enabled, const RTPSParticipantAttributes& attrs, @@ -120,7 +122,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSWriter* createRTPSWriter( + FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter( RTPSParticipant* p, WriterAttributes& watt, WriterHistory* hist, @@ -138,7 +140,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSWriter* createRTPSWriter( + FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter( RTPSParticipant* p, WriterAttributes& watt, const std::shared_ptr& payload_pool, @@ -158,7 +160,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSWriter* createRTPSWriter( + FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter( RTPSParticipant* p, WriterAttributes& watt, const std::shared_ptr& payload_pool, @@ -180,7 +182,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSWriter* createRTPSWriter( + FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter( RTPSParticipant* p, const EntityId_t& entity_id, WriterAttributes& watt, @@ -202,7 +204,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSWriter() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSWriter* createRTPSWriter( + FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter( RTPSParticipant* p, const EntityId_t& entity_id, WriterAttributes& watt, @@ -215,7 +217,7 @@ class RTPSDomain * @param writer Pointer to the writer you want to remove. * @return True if correctly removed. */ - RTPS_DllAPI static bool removeRTPSWriter( + FASTDDS_EXPORTED_API static bool removeRTPSWriter( RTPSWriter* writer); /** @@ -229,7 +231,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSReader* createRTPSReader( + FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader( RTPSParticipant* p, ReaderAttributes& ratt, ReaderHistory* hist, @@ -247,7 +249,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSReader* createRTPSReader( + FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader( RTPSParticipant* p, ReaderAttributes& ratt, const std::shared_ptr& payload_pool, @@ -267,7 +269,7 @@ class RTPSDomain * \warning The returned pointer is invalidated after a call to removeRTPSReader() or stopAll(), * so its use may result in undefined behaviour. */ - RTPS_DllAPI static RTPSReader* createRTPSReader( + FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader( RTPSParticipant* p, const EntityId_t& entity_id, ReaderAttributes& ratt, @@ -280,7 +282,7 @@ class RTPSDomain * @param reader Pointer to the reader you want to remove. * @return True if correctly removed. */ - RTPS_DllAPI static bool removeRTPSReader( + FASTDDS_EXPORTED_API static bool removeRTPSReader( RTPSReader* reader); /** @@ -288,9 +290,40 @@ class RTPSDomain * @param[in] p Pointer to the RTPSParticipant; * @return True if correct. */ - RTPS_DllAPI static bool removeRTPSParticipant( + FASTDDS_EXPORTED_API static bool removeRTPSParticipant( RTPSParticipant* p); + /** + * @brief Get the library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return True. + */ + FASTDDS_EXPORTED_API static bool get_library_settings( + fastdds::LibrarySettings& library_settings); + + /** + * @brief Set the library settings- + * + * @param library_settings LibrarySettings to be set. + * @return False if there is any RTPSParticipant already created. + * True if correctly set. + */ + FASTDDS_EXPORTED_API static bool set_library_settings( + const fastdds::LibrarySettings& library_settings); + + /** + * @brief Get the TopicAttributes from XML profile. + * + * @param profile_name Topic profile name. + * @param topic_att TopicAttributes object where the attributes are returned. + * @return bool true if the profile exists. + * false otherwise. + */ + FASTDDS_EXPORTED_API static bool get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_att); + private: RTPSDomain() = delete; diff --git a/include/fastdds/rtps/attributes/BuiltinTransports.hpp b/include/fastdds/rtps/attributes/BuiltinTransports.hpp index c3038cb618e..fe38051ccb7 100644 --- a/include/fastdds/rtps/attributes/BuiltinTransports.hpp +++ b/include/fastdds/rtps/attributes/BuiltinTransports.hpp @@ -21,9 +21,9 @@ #include #include -#include -#include +#include +#include namespace eprosima { namespace fastdds { @@ -33,7 +33,7 @@ namespace rtps { /** * @brief Options for configuring the built-in transports when using LARGE_DATA mode. */ -struct RTPS_DllAPI BuiltinTransportsOptions +struct FASTDDS_EXPORTED_API BuiltinTransportsOptions { //! Whether to use non-blocking send operation. bool non_blocking_send = false; diff --git a/include/fastdds/rtps/attributes/EndpointAttributes.h b/include/fastdds/rtps/attributes/EndpointAttributes.h index 7317b4b4379..09ff7d02ee2 100644 --- a/include/fastdds/rtps/attributes/EndpointAttributes.h +++ b/include/fastdds/rtps/attributes/EndpointAttributes.h @@ -19,12 +19,11 @@ #ifndef _FASTDDS_ENDPOINTATTRIBUTES_H_ #define _FASTDDS_ENDPOINTATTRIBUTES_H_ +#include #include #include -#include - #include -#include +#include #include #if HAVE_SECURITY @@ -77,7 +76,7 @@ class EndpointAttributes PropertyPolicy properties; //!Ownership - OwnershipQosPolicyKind ownershipKind = SHARED_OWNERSHIP_QOS; + fastdds::dds::OwnershipQosPolicyKind ownershipKind = fastdds::dds::OwnershipQosPolicyKind::SHARED_OWNERSHIP_QOS; EndpointAttributes() { @@ -129,7 +128,7 @@ class EndpointAttributes * @param cfg Configuration to be set */ inline void set_data_sharing_configuration( - DataSharingQosPolicy cfg) + fastdds::dds::DataSharingQosPolicy cfg) { datasharing_ = cfg; } @@ -138,7 +137,7 @@ class EndpointAttributes * Get the DataSharing configuration * @return Configuration of data sharing */ - inline const DataSharingQosPolicy& data_sharing_configuration() const + inline const fastdds::dds::DataSharingQosPolicy& data_sharing_configuration() const { return datasharing_; } @@ -170,7 +169,7 @@ class EndpointAttributes #endif // HAVE_SECURITY //! Settings for datasharing - DataSharingQosPolicy datasharing_; + fastdds::dds::DataSharingQosPolicy datasharing_; }; } /* namespace rtps */ diff --git a/include/fastdds/rtps/attributes/HistoryAttributes.h b/include/fastdds/rtps/attributes/HistoryAttributes.h index be1c6fccc36..1f45ec99ae2 100644 --- a/include/fastdds/rtps/attributes/HistoryAttributes.h +++ b/include/fastdds/rtps/attributes/HistoryAttributes.h @@ -21,7 +21,7 @@ #define _FASTDDS_HISTORYATTRIBUTES_H_ #include -#include +#include #include @@ -35,7 +35,7 @@ namespace rtps { * The Publisher-Subscriber API has other fields to define this values (HistoryQosPolicy and ResourceLimitsQosPolicy). * @ingroup RTPS_ATTRIBUTES_MODULE */ -class RTPS_DllAPI HistoryAttributes +class FASTDDS_EXPORTED_API HistoryAttributes { public: diff --git a/include/fastdds/rtps/attributes/PropertyPolicy.h b/include/fastdds/rtps/attributes/PropertyPolicy.h index 92f78e9c769..c38e495b8a7 100644 --- a/include/fastdds/rtps/attributes/PropertyPolicy.h +++ b/include/fastdds/rtps/attributes/PropertyPolicy.h @@ -20,7 +20,7 @@ #include #include -#include +#include namespace eprosima { namespace fastrtps { @@ -30,25 +30,25 @@ class PropertyPolicy { public: - RTPS_DllAPI PropertyPolicy() + FASTDDS_EXPORTED_API PropertyPolicy() { } - RTPS_DllAPI PropertyPolicy( + FASTDDS_EXPORTED_API PropertyPolicy( const PropertyPolicy& property_policy) : properties_(property_policy.properties_) , binary_properties_(property_policy.binary_properties_) { } - RTPS_DllAPI PropertyPolicy( + FASTDDS_EXPORTED_API PropertyPolicy( PropertyPolicy&& property_policy) : properties_(std::move(property_policy.properties_)) , binary_properties_(std::move(property_policy.binary_properties_)) { } - RTPS_DllAPI PropertyPolicy& operator =( + FASTDDS_EXPORTED_API PropertyPolicy& operator =( const PropertyPolicy& property_policy) { properties_ = property_policy.properties_; @@ -56,7 +56,7 @@ class PropertyPolicy return *this; } - RTPS_DllAPI PropertyPolicy& operator =( + FASTDDS_EXPORTED_API PropertyPolicy& operator =( PropertyPolicy&& property_policy) { properties_ = std::move(property_policy.properties_); @@ -64,7 +64,7 @@ class PropertyPolicy return *this; } - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const PropertyPolicy& b) const { return (this->properties_ == b.properties_) && @@ -72,25 +72,25 @@ class PropertyPolicy } //!Get properties - RTPS_DllAPI const PropertySeq& properties() const + FASTDDS_EXPORTED_API const PropertySeq& properties() const { return properties_; } //!Set properties - RTPS_DllAPI PropertySeq& properties() + FASTDDS_EXPORTED_API PropertySeq& properties() { return properties_; } //!Get binary_properties - RTPS_DllAPI const BinaryPropertySeq& binary_properties() const + FASTDDS_EXPORTED_API const BinaryPropertySeq& binary_properties() const { return binary_properties_; } //!Set binary_properties - RTPS_DllAPI BinaryPropertySeq& binary_properties() + FASTDDS_EXPORTED_API BinaryPropertySeq& binary_properties() { return binary_properties_; } @@ -113,21 +113,21 @@ class PropertyPolicyHelper * @param prefix Prefix used to search properties. * @return A copy of properties whose name starts with the prefix. */ - RTPS_DllAPI static PropertyPolicy get_properties_with_prefix( + FASTDDS_EXPORTED_API static PropertyPolicy get_properties_with_prefix( const PropertyPolicy& property_policy, const std::string& prefix); //!Get the length of the property_policy - RTPS_DllAPI static size_t length( + FASTDDS_EXPORTED_API static size_t length( const PropertyPolicy& property_policy); //!Look for a property_policy by name - RTPS_DllAPI static std::string* find_property( + FASTDDS_EXPORTED_API static std::string* find_property( PropertyPolicy& property_policy, const std::string& name); //!Retrieves a property_policy by name - RTPS_DllAPI static const std::string* find_property( + FASTDDS_EXPORTED_API static const std::string* find_property( const PropertyPolicy& property_policy, const std::string& name); @@ -137,7 +137,7 @@ class PropertyPolicyHelper * @param name Name of the property to be searched. * @return A pointer to the property if found, nullptr otherwise. */ - RTPS_DllAPI static const Property* get_property( + FASTDDS_EXPORTED_API static const Property* get_property( const PropertyPolicy& property_policy, const std::string& name); }; diff --git a/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp b/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp index 5472aefad86..5d3019b6eb5 100644 --- a/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp +++ b/include/fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp @@ -21,7 +21,7 @@ #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h index 9a826b3933c..307f8f6d4d0 100644 --- a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h +++ b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h @@ -22,6 +22,8 @@ #include #include +#include + #include #include #include @@ -37,8 +39,7 @@ #include #include #include -#include -#include +#include namespace eprosima { namespace fastdds { @@ -301,28 +302,6 @@ class DiscoverySettings (this->ignoreParticipantFlags == b.ignoreParticipantFlags); } - /** - * Get the static endpoint XML filename - * @return Static endpoint XML filename - */ - FASTRTPS_DEPRECATED("Use static_edp_xml_config()") - const char* getStaticEndpointXMLFilename() const - { - return static_edp_xml_config(); - } - - /** - * Set the static endpoint XML filename - * @param str Static endpoint XML filename - * @deprecated - */ - FASTRTPS_DEPRECATED("Use static_edp_xml_config()") - void setStaticEndpointXMLFilename( - const char* str) - { - static_edp_xml_config_ = "file://" + std::string(str); - } - /** * Set the static endpoint XML configuration. * @param str URI specifying the static endpoint XML configuration. @@ -351,21 +330,6 @@ class DiscoverySettings std::string static_edp_xml_config_ = ""; }; -/** - * TypeLookupService settings. - */ -class TypeLookupSettings -{ -public: - - //!Indicates to use the TypeLookup Service client endpoints - bool use_client = false; - - //!Indicates to use the TypeLookup Service server endpoints - bool use_server = false; - -}; - /** * Class BuiltinAttributes, to define the behavior of the RTPSParticipant builtin protocols. * @ingroup RTPS_ATTRIBUTES_MODULE @@ -380,9 +344,6 @@ class BuiltinAttributes //! Indicates to use the WriterLiveliness protocol. bool use_WriterLivelinessProtocol = true; - //! TypeLookup Service settings - TypeLookupSettings typelookup_config; - //! Network Configuration NetworkConfigSet_t network_configuration = 0; @@ -427,8 +388,6 @@ class BuiltinAttributes { return (this->discovery_config == b.discovery_config) && (this->use_WriterLivelinessProtocol == b.use_WriterLivelinessProtocol) && - (typelookup_config.use_client == b.typelookup_config.use_client) && - (typelookup_config.use_server == b.typelookup_config.use_server) && (this->network_configuration == b.network_configuration) && (this->metatrafficUnicastLocatorList == b.metatrafficUnicastLocatorList) && (this->metatrafficMulticastLocatorList == b.metatrafficMulticastLocatorList) && @@ -484,6 +443,7 @@ class RTPSParticipantAttributes (this->security_log_thread == b.security_log_thread) && #endif // if HAVE_SECURITY (this->discovery_server_thread == b.discovery_server_thread) && + (this->typelookup_service_thread == b.typelookup_service_thread) && (this->builtin_transports_reception_threads == b.builtin_transports_reception_threads); } @@ -495,7 +455,7 @@ class RTPSParticipantAttributes * @param transports Defines the transport configuration scenario to setup. * @param options Defines the options to be used in the transport configuration. */ - RTPS_DllAPI void setup_transports( + FASTDDS_EXPORTED_API void setup_transports( fastdds::rtps::BuiltinTransports transports, const fastdds::rtps::BuiltinTransportsOptions& options = fastdds::rtps::BuiltinTransportsOptions()); @@ -538,7 +498,7 @@ class RTPSParticipantAttributes //! Optionally allows user to define the GuidPrefix_t GuidPrefix_t prefix; - RTPS_DllAPI inline bool ReadguidPrefix( + FASTDDS_EXPORTED_API inline bool ReadguidPrefix( const char* pfx) { return bool(std::istringstream(pfx) >> prefix); @@ -600,6 +560,9 @@ class RTPSParticipantAttributes //! Thread settings for the discovery server thread fastdds::rtps::ThreadSettings discovery_server_thread; + //! Thread settings for the builtin TypeLookup service requests and replies threads + fastdds::rtps::ThreadSettings typelookup_service_thread; + //! Thread settings for the builtin transports reception threads fastdds::rtps::ThreadSettings builtin_transports_reception_threads; @@ -617,7 +580,7 @@ class RTPSParticipantAttributes private: //! Name of the participant. - string_255 name{"RTPSParticipant"}; + fastcdr::string_255 name{"RTPSParticipant"}; }; } // namespace rtps diff --git a/include/fastdds/rtps/attributes/ReaderAttributes.h b/include/fastdds/rtps/attributes/ReaderAttributes.h index 890623425eb..4c0d5e67f61 100644 --- a/include/fastdds/rtps/attributes/ReaderAttributes.h +++ b/include/fastdds/rtps/attributes/ReaderAttributes.h @@ -20,11 +20,11 @@ #ifndef _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_ #define _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_ +#include #include #include #include -#include -#include +#include namespace eprosima { namespace fastrtps { @@ -70,7 +70,7 @@ class ReaderAttributes public: ReaderAttributes() - : liveliness_kind_(AUTOMATIC_LIVELINESS_QOS) + : liveliness_kind_(fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) , expectsInlineQos(false) , disable_positive_acks(false) @@ -91,7 +91,7 @@ class ReaderAttributes ReaderTimes times; //! Liveliness kind - LivelinessQosPolicyKind liveliness_kind_; + fastdds::dds::LivelinessQosPolicyKind liveliness_kind_; //! Liveliness lease duration Duration_t liveliness_lease_duration; diff --git a/include/fastdds/rtps/attributes/ServerAttributes.h b/include/fastdds/rtps/attributes/ServerAttributes.h index 13f58753c43..4076cba29e2 100644 --- a/include/fastdds/rtps/attributes/ServerAttributes.h +++ b/include/fastdds/rtps/attributes/ServerAttributes.h @@ -22,7 +22,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include +#include #include #include @@ -48,7 +48,7 @@ class RemoteServerAttributes { public: - RTPS_DllAPI inline bool operator ==( + FASTDDS_EXPORTED_API inline bool operator ==( const RemoteServerAttributes& r) const { return guidPrefix == r.guidPrefix @@ -56,7 +56,7 @@ class RemoteServerAttributes && metatrafficMulticastLocatorList == r.metatrafficMulticastLocatorList; } - RTPS_DllAPI void clear() + FASTDDS_EXPORTED_API void clear() { guidPrefix = fastrtps::rtps::GuidPrefix_t::unknown(); metatrafficUnicastLocatorList.clear(); @@ -64,28 +64,12 @@ class RemoteServerAttributes is_connected = false; } - RTPS_DllAPI fastrtps::rtps::GUID_t GetParticipant() const; + FASTDDS_EXPORTED_API fastrtps::rtps::GUID_t GetParticipant() const; - RTPS_DllAPI fastrtps::rtps::GUID_t GetPDPReader() const; - RTPS_DllAPI fastrtps::rtps::GUID_t GetPDPWriter() const; + FASTDDS_EXPORTED_API fastrtps::rtps::GUID_t GetPDPReader() const; + FASTDDS_EXPORTED_API fastrtps::rtps::GUID_t GetPDPWriter() const; -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::rtps:GetEDPPublicationsReader()", - "Not implemented nor used functions.") - RTPS_DllAPI fastrtps::rtps::GUID_t GetEDPPublicationsReader() const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::rtps:GetEDPSubscriptionsWriter()", - "Not implemented nor used functions.") - RTPS_DllAPI fastrtps::rtps::GUID_t GetEDPSubscriptionsWriter() const; - - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::rtps:GetEDPPublicationsWriter()", - "Not implemented nor used functions.") - RTPS_DllAPI fastrtps::rtps::GUID_t GetEDPPublicationsWriter() const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::rtps:GetEDPSubscriptionsReader()", - "Not implemented nor used functions.") - RTPS_DllAPI fastrtps::rtps::GUID_t GetEDPSubscriptionsReader() const; -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI inline bool ReadguidPrefix( + FASTDDS_EXPORTED_API inline bool ReadguidPrefix( const char* pfx) { return bool(std::istringstream(pfx) >> guidPrefix); @@ -117,8 +101,8 @@ typedef std::list RemoteServerList_t; template struct server_ostream_separators { - RTPS_DllAPI static const charT* list_separator; - RTPS_DllAPI static const charT* locator_separator; + FASTDDS_EXPORTED_API static const charT* list_separator; + FASTDDS_EXPORTED_API static const charT* locator_separator; }; #ifndef _MSC_VER @@ -195,7 +179,7 @@ const char* const ROS_SUPER_CLIENT = "ROS_SUPER_CLIENT"; * @param[out] attributes reference to a RemoteServerList_t to populate. * @return true if parsing succeeds, false otherwise (or if the list is empty) */ -RTPS_DllAPI bool load_environment_server_info( +FASTDDS_EXPORTED_API bool load_environment_server_info( const std::string& list, RemoteServerList_t& attributes); @@ -212,20 +196,20 @@ RTPS_DllAPI bool load_environment_server_info( * @param[out] attributes reference to a RemoteServerList_t to populate. * @return true if parsing succeeds, false otherwise */ -RTPS_DllAPI bool load_environment_server_info( +FASTDDS_EXPORTED_API bool load_environment_server_info( RemoteServerList_t& attributes); /** * Get the value of environment variable DEFAULT_ROS2_MASTER_URI * @return The value of environment variable DEFAULT_ROS2_MASTER_URI. Empty string if the variable is not defined. */ -RTPS_DllAPI const std::string& ros_discovery_server_env(); +FASTDDS_EXPORTED_API const std::string& ros_discovery_server_env(); /** * Get the value of environment variable ROS_SUPER_CLIENT * @return The value of environment variable ROS_SUPER_CLIENT. False if the variable is not defined. */ -RTPS_DllAPI bool ros_super_client_env(); +FASTDDS_EXPORTED_API bool ros_super_client_env(); /** * Returns the guidPrefix associated to the given server id @@ -233,7 +217,7 @@ RTPS_DllAPI bool ros_super_client_env(); * @param[out] guid reference to the guidPrefix to modify * @return true if the server guid can be delivered */ -RTPS_DllAPI bool get_server_client_default_guidPrefix( +FASTDDS_EXPORTED_API bool get_server_client_default_guidPrefix( int id, fastrtps::rtps::GuidPrefix_t& guid); diff --git a/include/fastdds/rtps/attributes/ThreadSettings.hpp b/include/fastdds/rtps/attributes/ThreadSettings.hpp index ed2a85f0b9b..d6d39524ee3 100644 --- a/include/fastdds/rtps/attributes/ThreadSettings.hpp +++ b/include/fastdds/rtps/attributes/ThreadSettings.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #ifndef _FASTDDS_THREADSETTINGS_HPP_ #define _FASTDDS_THREADSETTINGS_HPP_ @@ -33,7 +33,7 @@ namespace rtps { * This class is used to define attributes across a wide set of Qos and APIs. * @ingroup RTPS_ATTRIBUTES_MODULE */ -struct RTPS_DllAPI ThreadSettings +struct FASTDDS_EXPORTED_API ThreadSettings { /** * @brief The scheduling policy used for this thread. diff --git a/include/fastdds/rtps/attributes/TopicAttributes.h b/include/fastdds/rtps/attributes/TopicAttributes.h new file mode 100644 index 00000000000..7234ce4242c --- /dev/null +++ b/include/fastdds/rtps/attributes/TopicAttributes.h @@ -0,0 +1,156 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TopicAttributes.h + */ + +#ifndef TOPICPARAMETERS_H_ +#define TOPICPARAMETERS_H_ + +#include + +#include +#include + + +namespace eprosima { +namespace fastrtps { + +/** + * Class TopicAttributes, used by the user to define the attributes of the topic associated with a Publisher or Subscriber. + * @ingroup FASTRTPS_ATTRIBUTES_MODULE + */ +class TopicAttributes +{ +public: + + /** + * Default constructor + */ + TopicAttributes() + : topicKind(rtps::NO_KEY) + , topicName("UNDEF") + , topicDataType("UNDEF") + , auto_fill_type_information(true) + { + } + + //!Constructor, you need to provide the topic name and the topic data type. + TopicAttributes( + const char* name, + const char* dataType, + rtps::TopicKind_t tKind = rtps::NO_KEY) + { + topicKind = tKind; + topicName = name; + topicDataType = dataType; + auto_fill_type_information = true; + } + + virtual ~TopicAttributes() + { + } + + bool operator ==( + const TopicAttributes& b) const + { + return (this->topicKind == b.topicKind) && + (this->topicName == b.topicName) && + (this->topicDataType == b.topicDataType) && + (this->historyQos == b.historyQos); + } + + /** + * Get the topic data type + * @return Topic data type + */ + const fastcdr::string_255& getTopicDataType() const + { + return topicDataType; + } + + /** + * Get the topic kind + * @return Topic kind + */ + rtps::TopicKind_t getTopicKind() const + { + return topicKind; + } + + /** + * Get the topic name + * @return Topic name + */ + const fastcdr::string_255& getTopicName() const + { + return topicName; + } + + //! TopicKind_t, default value NO_KEY. + rtps::TopicKind_t topicKind; + //! Topic Name. + fastcdr::string_255 topicName; + //!Topic Data Type. + fastcdr::string_255 topicDataType; + //!QOS Regarding the History to be saved. + HistoryQosPolicy historyQos; + //!QOS Regarding the resources to allocate. + ResourceLimitsQosPolicy resourceLimitsQos; + //!Type Identifier XTYPES 1.1 + TypeIdV1 type_id; + //!Type Object XTYPES 1.1 + TypeObjectV1 type; + //!XTYPES 1.2 + xtypes::TypeInformationParameter type_information; + //!Tries to complete type information (TypeObjectV2) + bool auto_fill_type_information; + + /** + * Method to check whether the defined QOS are correct. + * @return True if they are valid. + */ + bool checkQos() const; +}; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * Check if two topic attributes are not equal + * @param t1 First instance of TopicAttributes to compare + * @param t2 Second instance of TopicAttributes to compare + * @return True if the instances are not equal. False if the instances are equal. + */ +bool inline operator !=( + const TopicAttributes& t1, + const TopicAttributes& t2) +{ + if (t1.topicKind != t2.topicKind + || t1.topicName != t2.topicName + || t1.topicDataType != t2.topicDataType + || t1.historyQos.kind != t2.historyQos.kind + || (t1.historyQos.kind == KEEP_LAST_HISTORY_QOS && t1.historyQos.depth != t2.historyQos.depth)) + { + return true; + } + return false; +} + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif /* TOPICPARAMETERS_H_ */ diff --git a/include/fastdds/rtps/attributes/WriterAttributes.h b/include/fastdds/rtps/attributes/WriterAttributes.h index 7c9dd2d5ac1..adf951ee14e 100644 --- a/include/fastdds/rtps/attributes/WriterAttributes.h +++ b/include/fastdds/rtps/attributes/WriterAttributes.h @@ -19,15 +19,15 @@ #ifndef _FASTDDS_WRITERATTRIBUTES_H_ #define _FASTDDS_WRITERATTRIBUTES_H_ -#include -#include -#include +#include + +#include #include +#include +#include #include -#include -#include - -#include +#include +#include namespace eprosima { namespace fastrtps { @@ -88,7 +88,7 @@ class WriterAttributes public: WriterAttributes() - : liveliness_kind(AUTOMATIC_LIVELINESS_QOS) + : liveliness_kind(fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) , liveliness_announcement_period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) , mode(SYNCHRONOUS_WRITER) @@ -112,7 +112,7 @@ class WriterAttributes WriterTimes times; //! Liveliness kind - fastrtps::LivelinessQosPolicyKind liveliness_kind; + fastdds::dds::LivelinessQosPolicyKind liveliness_kind; //! Liveliness lease duration Duration_t liveliness_lease_duration; diff --git a/include/fastdds/rtps/builtin/BuiltinProtocols.h b/include/fastdds/rtps/builtin/BuiltinProtocols.h deleted file mode 100644 index 12e1dd1d682..00000000000 --- a/include/fastdds/rtps/builtin/BuiltinProtocols.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file BuiltinProtocols.h - * - */ - -#ifndef _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ -#define _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include - -#include -#include - -#include - -namespace eprosima { - -namespace fastdds { -namespace dds { -namespace builtin { - -class TypeLookupManager; - -} // namespace builtin - -class ReaderQos; -class WriterQos; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { - -class TopicAttributes; - -namespace rtps { - -class PDP; -class WLP; -class RTPSParticipantImpl; -class RTPSWriter; -class RTPSReader; -class NetworkFactory; - -/** - * Class BuiltinProtocols that contains builtin endpoints implementing the discovery and liveliness protocols. - * *@ingroup BUILTIN_MODULE - */ -class BuiltinProtocols -{ - friend class RTPSParticipantImpl; - -private: - - BuiltinProtocols(); - virtual ~BuiltinProtocols(); - - /* - * Mutex to protect the m_DiscoveryServers collection. Element access is not protected by this mutex, the PDP mutex - * needs to be used when querying or modifying mutable members of the collection. - */ - mutable eprosima::shared_mutex discovery_mutex_; - -public: - - /** - * Initialize the builtin protocols. - * @param attributes Discovery configuration attributes - * @param p_part Pointer to the Participant implementation - * @return True if correct. - */ - bool initBuiltinProtocols( - RTPSParticipantImpl* p_part, - BuiltinAttributes& attributes); - - /** - * Enable the builtin protocols - */ - void enable(); - - /** - * Update the metatraffic locatorlist after it was created. Because when you create - * the EDP readers you are not sure the selected endpoints can be used. - * @param loclist LocatorList to update - * @return True on success - */ - bool updateMetatrafficLocators( - LocatorList_t& loclist); - - /** - * Traverses the list of discover servers filtering out unsupported or not allowed remote locators - * @param nf NetworkFactory used to make the filtering - */ - void filter_server_remote_locators( - NetworkFactory& nf); - - //!BuiltinAttributes of the builtin protocols. - BuiltinAttributes m_att; - //!Pointer to the RTPSParticipantImpl. - RTPSParticipantImpl* mp_participantImpl; - //!Pointer to the PDPSimple. - PDP* mp_PDP; - //!Pointer to the WLP - WLP* mp_WLP; - //!Pointer to the TypeLookupManager - fastdds::dds::builtin::TypeLookupManager* tlm_; - //!Locator list for metatraffic - LocatorList_t m_metatrafficMulticastLocatorList; - //!Locator List for metatraffic unicast - LocatorList_t m_metatrafficUnicastLocatorList; - //! Initial peers - LocatorList_t m_initialPeersList; - //! Known discovery and backup server container - std::list m_DiscoveryServers; - - /** - * Add a local Writer to the BuiltinProtocols. - * @param w Pointer to the RTPSWriter - * @param topicAtt Attributes of the associated topic - * @param wqos QoS policies dictated by the publisher - * @return True if correct. - */ - bool addLocalWriter( - RTPSWriter* w, - const TopicAttributes& topicAtt, - const fastdds::dds::WriterQos& wqos); - /** - * Add a local Reader to the BuiltinProtocols. - * @param R Pointer to the RTPSReader. - * @param topicAtt Attributes of the associated topic - * @param rqos QoS policies dictated by the subscriber - * @param content_filter Optional content filtering information. - * @return True if correct. - */ - bool addLocalReader( - RTPSReader* R, - const TopicAttributes& topicAtt, - const fastdds::dds::ReaderQos& rqos, - const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); - - /** - * Update a local Writer QOS - * @param W Writer to update - * @param topicAtt Attributes of the associated topic - * @param wqos New Writer QoS - * @return - */ - bool updateLocalWriter( - RTPSWriter* W, - const TopicAttributes& topicAtt, - const fastdds::dds::WriterQos& wqos); - /** - * Update a local Reader QOS - * @param R Reader to update - * @param topicAtt Attributes of the associated topic - * @param qos New Reader QoS - * @param content_filter Optional content filtering information. - * @return - */ - bool updateLocalReader( - RTPSReader* R, - const TopicAttributes& topicAtt, - const fastdds::dds::ReaderQos& qos, - const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); - /** - * Remove a local Writer from the builtinProtocols. - * @param W Pointer to the writer. - * @return True if correctly removed. - */ - bool removeLocalWriter( - RTPSWriter* W); - /** - * Remove a local Reader from the builtinProtocols. - * @param R Pointer to the reader. - * @return True if correctly removed. - */ - bool removeLocalReader( - RTPSReader* R); - - //! Announce RTPSParticipantState (force the sending of a DPD message.) - void announceRTPSParticipantState(); - //!Stop the RTPSParticipant Announcement (used in tests to avoid multiple packets being send) - void stopRTPSParticipantAnnouncement(); - //!Reset to timer to make periodic RTPSParticipant Announcements. - void resetRTPSParticipantAnnouncement(); - - /** - * Get Discovery mutex - * @return Associated Mutex - */ - inline eprosima::shared_mutex& getDiscoveryMutex() const - { - return discovery_mutex_; - } - -}; - -} // namespace rtps -} /* namespace rtps */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ */ diff --git a/include/fastdds/rtps/builtin/data/ContentFilterProperty.hpp b/include/fastdds/rtps/builtin/data/ContentFilterProperty.hpp index 2a23a32d278..ec174f85cea 100644 --- a/include/fastdds/rtps/builtin/data/ContentFilterProperty.hpp +++ b/include/fastdds/rtps/builtin/data/ContentFilterProperty.hpp @@ -21,9 +21,9 @@ #include -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -62,17 +62,17 @@ class ContentFilterProperty } /// Name of the content filtered topic on which the reader was created - fastrtps::string_255 content_filtered_topic_name; + fastcdr::string_255 content_filtered_topic_name; /// Name of the related topic being filtered - fastrtps::string_255 related_topic_name; + fastcdr::string_255 related_topic_name; /// Class name of the filter being used. /// May be empty to indicate the ContentFilterProperty is not present. - fastrtps::string_255 filter_class_name; + fastcdr::string_255 filter_class_name; /// Filter expression indicating which content the reader wants to receive. /// May be empty to indicate the ContentFilterProperty is not present. std::string filter_expression; /// List of values for the parameters present on the filter expression - fastrtps::ResourceLimitedVector expression_parameters; + fastrtps::ResourceLimitedVector expression_parameters; }; } // namespace rtps diff --git a/include/fastdds/rtps/builtin/data/ParticipantProxyData.h b/include/fastdds/rtps/builtin/data/ParticipantProxyData.h index 101d0249c9b..3b87103de14 100644 --- a/include/fastdds/rtps/builtin/data/ParticipantProxyData.h +++ b/include/fastdds/rtps/builtin/data/ParticipantProxyData.h @@ -21,6 +21,10 @@ #define _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include + +#include #include #include #include @@ -31,10 +35,6 @@ #if HAVE_SECURITY #include #endif // if HAVE_SECURITY -#include - - -#include #define BUILTIN_PARTICIPANT_DATA_MAX_SIZE 100 #define TYPELOOKUP_DATA_MAX_SIZE 5000 @@ -63,13 +63,13 @@ class ParticipantProxyData { public: - RTPS_DllAPI ParticipantProxyData( + FASTDDS_EXPORTED_API ParticipantProxyData( const RTPSParticipantAllocationAttributes& allocation); - RTPS_DllAPI ParticipantProxyData( + FASTDDS_EXPORTED_API ParticipantProxyData( const ParticipantProxyData& pdata); - RTPS_DllAPI virtual ~ParticipantProxyData(); + FASTDDS_EXPORTED_API virtual ~ParticipantProxyData(); //!Protocol version ProtocolVersion_t m_protocolVersion; @@ -90,7 +90,7 @@ class ParticipantProxyData //!Manual liveliness count Count_t m_manualLivelinessCount; //!Participant name - string_255 m_participantName; + fastcdr::string_255 m_participantName; //! InstanceHandle_t m_key; //! @@ -108,9 +108,9 @@ class ParticipantProxyData //! bool isAlive; //! - ParameterPropertyList_t m_properties; + fastdds::dds::ParameterPropertyList_t m_properties; //! - UserDataQosPolicy m_userData; + fastdds::dds::UserDataQosPolicy m_userData; //! TimedEvent* lease_duration_event; //! @@ -127,7 +127,7 @@ class ParticipantProxyData * @param pdata Object to copy the data from * @return True on success */ - RTPS_DllAPI bool updateData( + FASTDDS_EXPORTED_API bool updateData( ParticipantProxyData& pdata); /** @@ -135,14 +135,14 @@ class ParticipantProxyData * @param include_encapsulation Whether to include the size of the encapsulation info. * @return size in bytes of the CDR serialization. */ - RTPS_DllAPI uint32_t get_serialized_size( + FASTDDS_EXPORTED_API uint32_t get_serialized_size( bool include_encapsulation) const; /** * Write as a parameter list on a CDRMessage_t * @return True on success */ - RTPS_DllAPI bool writeToCDRMessage( + FASTDDS_EXPORTED_API bool writeToCDRMessage( CDRMessage_t* msg, bool write_encapsulation); @@ -150,7 +150,7 @@ class ParticipantProxyData * Read the parameter list from a received CDRMessage_t * @return True on success */ - RTPS_DllAPI bool readFromCDRMessage( + FASTDDS_EXPORTED_API bool readFromCDRMessage( CDRMessage_t* msg, bool use_encapsulation, const NetworkFactory& network, @@ -159,62 +159,62 @@ class ParticipantProxyData fastdds::rtps::VendorId_t source_vendor_id = c_VendorId_eProsima); //! Clear the data (restore to default state). - RTPS_DllAPI void clear(); + FASTDDS_EXPORTED_API void clear(); /** * Copy the data from another object. * @param pdata Object to copy the data from */ - RTPS_DllAPI void copy( + FASTDDS_EXPORTED_API void copy( const ParticipantProxyData& pdata); /** * Set participant persistent GUID_t * @param guid valid GUID_t */ - RTPS_DllAPI void set_persistence_guid( + FASTDDS_EXPORTED_API void set_persistence_guid( const GUID_t& guid); /** * Retrieve participant persistent GUID_t * @return guid persistent GUID_t or c_Guid_Unknown */ - RTPS_DllAPI GUID_t get_persistence_guid() const; + FASTDDS_EXPORTED_API GUID_t get_persistence_guid() const; /** * Set participant client server sample identity * @param sid valid SampleIdentity */ - RTPS_DllAPI void set_sample_identity( + FASTDDS_EXPORTED_API void set_sample_identity( const SampleIdentity& sid); /** * Retrieve participant SampleIdentity * @return SampleIdentity */ - RTPS_DllAPI SampleIdentity get_sample_identity() const; + FASTDDS_EXPORTED_API SampleIdentity get_sample_identity() const; /** * Identifies the participant as client of the given server * @param guid valid backup server GUID */ - RTPS_DllAPI void set_backup_stamp( + FASTDDS_EXPORTED_API void set_backup_stamp( const GUID_t& guid); /** * Retrieves BACKUP server stamp. On deserialization hints if lease duration must be enforced * @return GUID */ - RTPS_DllAPI GUID_t get_backup_stamp() const; + FASTDDS_EXPORTED_API GUID_t get_backup_stamp() const; - RTPS_DllAPI void assert_liveliness(); + FASTDDS_EXPORTED_API void assert_liveliness(); - RTPS_DllAPI const std::chrono::steady_clock::time_point& last_received_message_tm() const + FASTDDS_EXPORTED_API const std::chrono::steady_clock::time_point& last_received_message_tm() const { return last_received_message_tm_; } - RTPS_DllAPI const std::chrono::microseconds& lease_duration() const + FASTDDS_EXPORTED_API const std::chrono::microseconds& lease_duration() const { return lease_duration_; } diff --git a/include/fastdds/rtps/builtin/data/ReaderProxyData.h b/include/fastdds/rtps/builtin/data/ReaderProxyData.h index ba3fa8e0013..774b78625e8 100644 --- a/include/fastdds/rtps/builtin/data/ReaderProxyData.h +++ b/include/fastdds/rtps/builtin/data/ReaderProxyData.h @@ -21,6 +21,7 @@ #define _FASTDDS_RTPS_BUILTIN_DATA_READERPROXYDATA_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include #include #include #include @@ -29,10 +30,7 @@ #if HAVE_SECURITY #include #endif // if HAVE_SECURITY -#include -#include - - +#include namespace eprosima { namespace fastrtps { @@ -50,80 +48,80 @@ class ReaderProxyData { public: - RTPS_DllAPI ReaderProxyData( + FASTDDS_EXPORTED_API ReaderProxyData( const size_t max_unicast_locators, const size_t max_multicast_locators, const fastdds::rtps::ContentFilterProperty::AllocationConfiguration& content_filter_limits = {}); - RTPS_DllAPI ReaderProxyData( + FASTDDS_EXPORTED_API ReaderProxyData( const size_t max_unicast_locators, const size_t max_multicast_locators, const VariableLengthDataLimits& data_limits, const fastdds::rtps::ContentFilterProperty::AllocationConfiguration& content_filter_limits = {}); - RTPS_DllAPI virtual ~ReaderProxyData(); + FASTDDS_EXPORTED_API virtual ~ReaderProxyData(); - RTPS_DllAPI ReaderProxyData( + FASTDDS_EXPORTED_API ReaderProxyData( const ReaderProxyData& readerInfo); - RTPS_DllAPI ReaderProxyData& operator =( + FASTDDS_EXPORTED_API ReaderProxyData& operator =( const ReaderProxyData& readerInfo); - RTPS_DllAPI void guid( + FASTDDS_EXPORTED_API void guid( const GUID_t& guid) { m_guid = guid; } - RTPS_DllAPI void guid( + FASTDDS_EXPORTED_API void guid( GUID_t&& guid) { m_guid = std::move(guid); } - RTPS_DllAPI const GUID_t& guid() const + FASTDDS_EXPORTED_API const GUID_t& guid() const { return m_guid; } - RTPS_DllAPI GUID_t& guid() + FASTDDS_EXPORTED_API GUID_t& guid() { return m_guid; } - RTPS_DllAPI void networkConfiguration( + FASTDDS_EXPORTED_API void networkConfiguration( const NetworkConfigSet_t& networkConfiguration) { m_networkConfiguration = networkConfiguration; } - RTPS_DllAPI void networkConfiguration( + FASTDDS_EXPORTED_API void networkConfiguration( NetworkConfigSet_t&& networkConfiguration) { m_networkConfiguration = std::move(networkConfiguration); } - RTPS_DllAPI const NetworkConfigSet_t& networkConfiguration() const + FASTDDS_EXPORTED_API const NetworkConfigSet_t& networkConfiguration() const { return m_networkConfiguration; } - RTPS_DllAPI NetworkConfigSet_t& networkConfiguration() + FASTDDS_EXPORTED_API NetworkConfigSet_t& networkConfiguration() { return m_networkConfiguration; } - RTPS_DllAPI bool has_locators() const + FASTDDS_EXPORTED_API bool has_locators() const { return !remote_locators_.unicast.empty() || !remote_locators_.multicast.empty(); } - RTPS_DllAPI const RemoteLocatorList& remote_locators() const + FASTDDS_EXPORTED_API const RemoteLocatorList& remote_locators() const { return remote_locators_; } - RTPS_DllAPI void add_unicast_locator( + FASTDDS_EXPORTED_API void add_unicast_locator( const Locator_t& locator); void set_announced_unicast_locators( @@ -133,7 +131,7 @@ class ReaderProxyData const LocatorList_t& locators, const NetworkFactory& network); - RTPS_DllAPI void add_multicast_locator( + FASTDDS_EXPORTED_API void add_multicast_locator( const Locator_t& locator); void set_multicast_locators( @@ -148,177 +146,177 @@ class ReaderProxyData const NetworkFactory& network, bool use_multicast_locators); - RTPS_DllAPI void key( + FASTDDS_EXPORTED_API void key( const InstanceHandle_t& key) { m_key = key; } - RTPS_DllAPI void key( + FASTDDS_EXPORTED_API void key( InstanceHandle_t&& key) { m_key = std::move(key); } - RTPS_DllAPI InstanceHandle_t key() const + FASTDDS_EXPORTED_API InstanceHandle_t key() const { return m_key; } - RTPS_DllAPI InstanceHandle_t& key() + FASTDDS_EXPORTED_API InstanceHandle_t& key() { return m_key; } - RTPS_DllAPI void RTPSParticipantKey( + FASTDDS_EXPORTED_API void RTPSParticipantKey( const InstanceHandle_t& RTPSParticipantKey) { m_RTPSParticipantKey = RTPSParticipantKey; } - RTPS_DllAPI void RTPSParticipantKey( + FASTDDS_EXPORTED_API void RTPSParticipantKey( InstanceHandle_t&& RTPSParticipantKey) { m_RTPSParticipantKey = std::move(RTPSParticipantKey); } - RTPS_DllAPI InstanceHandle_t RTPSParticipantKey() const + FASTDDS_EXPORTED_API InstanceHandle_t RTPSParticipantKey() const { return m_RTPSParticipantKey; } - RTPS_DllAPI InstanceHandle_t& RTPSParticipantKey() + FASTDDS_EXPORTED_API InstanceHandle_t& RTPSParticipantKey() { return m_RTPSParticipantKey; } - RTPS_DllAPI void typeName( - const string_255& typeName) + FASTDDS_EXPORTED_API void typeName( + const fastcdr::string_255& typeName) { m_typeName = typeName; } - RTPS_DllAPI void typeName( - string_255&& typeName) + FASTDDS_EXPORTED_API void typeName( + fastcdr::string_255&& typeName) { m_typeName = std::move(typeName); } - RTPS_DllAPI const string_255& typeName() const + FASTDDS_EXPORTED_API const fastcdr::string_255& typeName() const { return m_typeName; } - RTPS_DllAPI string_255& typeName() + FASTDDS_EXPORTED_API fastcdr::string_255& typeName() { return m_typeName; } - RTPS_DllAPI void topicName( - const string_255& topicName) + FASTDDS_EXPORTED_API void topicName( + const fastcdr::string_255& topicName) { m_topicName = topicName; } - RTPS_DllAPI void topicName( - string_255&& topicName) + FASTDDS_EXPORTED_API void topicName( + fastcdr::string_255&& topicName) { m_topicName = std::move(topicName); } - RTPS_DllAPI const string_255& topicName() const + FASTDDS_EXPORTED_API const fastcdr::string_255& topicName() const { return m_topicName; } - RTPS_DllAPI string_255& topicName() + FASTDDS_EXPORTED_API fastcdr::string_255& topicName() { return m_topicName; } - RTPS_DllAPI void userDefinedId( + FASTDDS_EXPORTED_API void userDefinedId( uint16_t userDefinedId) { m_userDefinedId = userDefinedId; } - RTPS_DllAPI uint16_t userDefinedId() const + FASTDDS_EXPORTED_API uint16_t userDefinedId() const { return m_userDefinedId; } - RTPS_DllAPI uint16_t& userDefinedId() + FASTDDS_EXPORTED_API uint16_t& userDefinedId() { return m_userDefinedId; } - RTPS_DllAPI void content_filter( + FASTDDS_EXPORTED_API void content_filter( const fastdds::rtps::ContentFilterProperty& filter) { content_filter_ = filter; } - RTPS_DllAPI void content_filter( + FASTDDS_EXPORTED_API void content_filter( fastdds::rtps::ContentFilterProperty&& filter) { content_filter_ = std::move(filter); } - RTPS_DllAPI const fastdds::rtps::ContentFilterProperty& content_filter() const + FASTDDS_EXPORTED_API const fastdds::rtps::ContentFilterProperty& content_filter() const { return content_filter_; } - RTPS_DllAPI fastdds::rtps::ContentFilterProperty& content_filter() + FASTDDS_EXPORTED_API fastdds::rtps::ContentFilterProperty& content_filter() { return content_filter_; } - RTPS_DllAPI void isAlive( + FASTDDS_EXPORTED_API void isAlive( bool isAlive) { m_isAlive = isAlive; } - RTPS_DllAPI bool isAlive() const + FASTDDS_EXPORTED_API bool isAlive() const { return m_isAlive; } - RTPS_DllAPI bool& isAlive() + FASTDDS_EXPORTED_API bool& isAlive() { return m_isAlive; } - RTPS_DllAPI void topicKind( + FASTDDS_EXPORTED_API void topicKind( TopicKind_t topicKind) { m_topicKind = topicKind; } - RTPS_DllAPI TopicKind_t topicKind() const + FASTDDS_EXPORTED_API TopicKind_t topicKind() const { return m_topicKind; } - RTPS_DllAPI TopicKind_t& topicKind() + FASTDDS_EXPORTED_API TopicKind_t& topicKind() { return m_topicKind; } - RTPS_DllAPI void type_id( + FASTDDS_EXPORTED_API void type_id( const TypeIdV1& other_type_id) { type_id() = other_type_id; } - RTPS_DllAPI const TypeIdV1& type_id() const + FASTDDS_EXPORTED_API const TypeIdV1& type_id() const { assert(m_type_id != nullptr); return *m_type_id; } - RTPS_DllAPI TypeIdV1& type_id() + FASTDDS_EXPORTED_API TypeIdV1& type_id() { if (m_type_id == nullptr) { @@ -327,24 +325,24 @@ class ReaderProxyData return *m_type_id; } - RTPS_DllAPI bool has_type_id() const + FASTDDS_EXPORTED_API bool has_type_id() const { return m_type_id != nullptr; } - RTPS_DllAPI void type( + FASTDDS_EXPORTED_API void type( const TypeObjectV1& other_type) { type() = other_type; } - RTPS_DllAPI const TypeObjectV1& type() const + FASTDDS_EXPORTED_API const TypeObjectV1& type() const { assert(m_type != nullptr); return *m_type; } - RTPS_DllAPI TypeObjectV1& type() + FASTDDS_EXPORTED_API TypeObjectV1& type() { if (m_type == nullptr) { @@ -353,33 +351,33 @@ class ReaderProxyData return *m_type; } - RTPS_DllAPI bool has_type() const + FASTDDS_EXPORTED_API bool has_type() const { return m_type != nullptr; } - RTPS_DllAPI void type_information( - const xtypes::TypeInformation& other_type_information) + FASTDDS_EXPORTED_API void type_information( + const xtypes::TypeInformationParameter& other_type_information) { type_information() = other_type_information; } - RTPS_DllAPI const xtypes::TypeInformation& type_information() const + FASTDDS_EXPORTED_API const xtypes::TypeInformationParameter& type_information() const { assert(m_type_information != nullptr); return *m_type_information; } - RTPS_DllAPI xtypes::TypeInformation& type_information() + FASTDDS_EXPORTED_API xtypes::TypeInformationParameter& type_information() { if (m_type_information == nullptr) { - m_type_information = new xtypes::TypeInformation(); + m_type_information = new xtypes::TypeInformationParameter(); } return *m_type_information; } - RTPS_DllAPI bool has_type_information() const + FASTDDS_EXPORTED_API bool has_type_information() const { return m_type_information != nullptr; } @@ -444,7 +442,7 @@ class ReaderProxyData //! bool m_expectsInlineQos; //!Reader Qos - ReaderQos m_qos; + fastdds::dds::ReaderQos m_qos; #if HAVE_SECURITY //!EndpointSecurityInfo.endpoint_security_attributes @@ -494,9 +492,9 @@ class ReaderProxyData //!GUID_t of the participant converted to InstanceHandle InstanceHandle_t m_RTPSParticipantKey; //!Type name - string_255 m_typeName; + fastcdr::string_255 m_typeName; //!Topic name - string_255 m_topicName; + fastcdr::string_255 m_topicName; //!User defined ID uint16_t m_userDefinedId; //!Field to indicate if the Reader is Alive. @@ -508,7 +506,7 @@ class ReaderProxyData //!Type Object TypeObjectV1* m_type; //!Type Information - xtypes::TypeInformation* m_type_information; + xtypes::TypeInformationParameter* m_type_information; //! ParameterPropertyList_t m_properties; //!Information on the content filter applied by the reader. diff --git a/include/fastdds/rtps/builtin/data/WriterProxyData.h b/include/fastdds/rtps/builtin/data/WriterProxyData.h index 14ffcb079ed..f538232dbfd 100644 --- a/include/fastdds/rtps/builtin/data/WriterProxyData.h +++ b/include/fastdds/rtps/builtin/data/WriterProxyData.h @@ -21,15 +21,18 @@ #define _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include + +#include #include +#include +#include #include #include #if HAVE_SECURITY #include #endif // if HAVE_SECURITY -#include -#include -#include +#include namespace eprosima { namespace fastrtps { @@ -46,106 +49,106 @@ class WriterProxyData { public: - RTPS_DllAPI WriterProxyData( + FASTDDS_EXPORTED_API WriterProxyData( const size_t max_unicast_locators, const size_t max_multicast_locators); - RTPS_DllAPI WriterProxyData( + FASTDDS_EXPORTED_API WriterProxyData( const size_t max_unicast_locators, const size_t max_multicast_locators, const VariableLengthDataLimits& data_limits); - virtual RTPS_DllAPI ~WriterProxyData(); + virtual FASTDDS_EXPORTED_API ~WriterProxyData(); - RTPS_DllAPI WriterProxyData( + FASTDDS_EXPORTED_API WriterProxyData( const WriterProxyData& writerInfo); - RTPS_DllAPI WriterProxyData& operator =( + FASTDDS_EXPORTED_API WriterProxyData& operator =( const WriterProxyData& writerInfo); - RTPS_DllAPI void guid( + FASTDDS_EXPORTED_API void guid( const GUID_t& guid) { m_guid = guid; } - RTPS_DllAPI void guid( + FASTDDS_EXPORTED_API void guid( GUID_t&& guid) { m_guid = std::move(guid); } - RTPS_DllAPI const GUID_t& guid() const + FASTDDS_EXPORTED_API const GUID_t& guid() const { return m_guid; } - RTPS_DllAPI GUID_t& guid() + FASTDDS_EXPORTED_API GUID_t& guid() { return m_guid; } - RTPS_DllAPI void networkConfiguration( + FASTDDS_EXPORTED_API void networkConfiguration( const NetworkConfigSet_t& networkConfiguration) { m_networkConfiguration = networkConfiguration; } - RTPS_DllAPI void networkConfiguration( + FASTDDS_EXPORTED_API void networkConfiguration( NetworkConfigSet_t&& networkConfiguration) { m_networkConfiguration = std::move(networkConfiguration); } - RTPS_DllAPI const NetworkConfigSet_t& networkConfiguration() const + FASTDDS_EXPORTED_API const NetworkConfigSet_t& networkConfiguration() const { return m_networkConfiguration; } - RTPS_DllAPI NetworkConfigSet_t& networkConfiguration() + FASTDDS_EXPORTED_API NetworkConfigSet_t& networkConfiguration() { return m_networkConfiguration; } - RTPS_DllAPI void persistence_guid( + FASTDDS_EXPORTED_API void persistence_guid( const GUID_t& guid) { persistence_guid_ = guid; } - RTPS_DllAPI void persistence_guid( + FASTDDS_EXPORTED_API void persistence_guid( GUID_t&& guid) { persistence_guid_ = std::move(guid); } - RTPS_DllAPI GUID_t persistence_guid() const + FASTDDS_EXPORTED_API GUID_t persistence_guid() const { return persistence_guid_; } - RTPS_DllAPI GUID_t& persistence_guid() + FASTDDS_EXPORTED_API GUID_t& persistence_guid() { return persistence_guid_; } - RTPS_DllAPI void set_persistence_entity_id( + FASTDDS_EXPORTED_API void set_persistence_entity_id( const EntityId_t& nid) { persistence_guid_.entityId = persistence_guid_.guidPrefix != c_GuidPrefix_Unknown ? nid : c_EntityId_Unknown; } - RTPS_DllAPI bool has_locators() const + FASTDDS_EXPORTED_API bool has_locators() const { return !remote_locators_.unicast.empty() || !remote_locators_.multicast.empty(); } - RTPS_DllAPI const RemoteLocatorList& remote_locators() const + FASTDDS_EXPORTED_API const RemoteLocatorList& remote_locators() const { return remote_locators_; } - RTPS_DllAPI void add_unicast_locator( + FASTDDS_EXPORTED_API void add_unicast_locator( const Locator_t& locator); void set_announced_unicast_locators( @@ -155,7 +158,7 @@ class WriterProxyData const LocatorList_t& locators, const NetworkFactory& network); - RTPS_DllAPI void add_multicast_locator( + FASTDDS_EXPORTED_API void add_multicast_locator( const Locator_t& locator); void set_multicast_locators( @@ -170,155 +173,155 @@ class WriterProxyData const NetworkFactory& network, bool use_multicast_locators); - RTPS_DllAPI void key( + FASTDDS_EXPORTED_API void key( const InstanceHandle_t& key) { m_key = key; } - RTPS_DllAPI void key( + FASTDDS_EXPORTED_API void key( InstanceHandle_t&& key) { m_key = std::move(key); } - RTPS_DllAPI InstanceHandle_t key() const + FASTDDS_EXPORTED_API InstanceHandle_t key() const { return m_key; } - RTPS_DllAPI InstanceHandle_t& key() + FASTDDS_EXPORTED_API InstanceHandle_t& key() { return m_key; } - RTPS_DllAPI void RTPSParticipantKey( + FASTDDS_EXPORTED_API void RTPSParticipantKey( const InstanceHandle_t& RTPSParticipantKey) { m_RTPSParticipantKey = RTPSParticipantKey; } - RTPS_DllAPI void RTPSParticipantKey( + FASTDDS_EXPORTED_API void RTPSParticipantKey( InstanceHandle_t&& RTPSParticipantKey) { m_RTPSParticipantKey = std::move(RTPSParticipantKey); } - RTPS_DllAPI InstanceHandle_t RTPSParticipantKey() const + FASTDDS_EXPORTED_API InstanceHandle_t RTPSParticipantKey() const { return m_RTPSParticipantKey; } - RTPS_DllAPI InstanceHandle_t& RTPSParticipantKey() + FASTDDS_EXPORTED_API InstanceHandle_t& RTPSParticipantKey() { return m_RTPSParticipantKey; } - RTPS_DllAPI void typeName( - const string_255& typeName) + FASTDDS_EXPORTED_API void typeName( + const fastcdr::string_255& typeName) { m_typeName = typeName; } - RTPS_DllAPI void typeName( - string_255&& typeName) + FASTDDS_EXPORTED_API void typeName( + fastcdr::string_255&& typeName) { m_typeName = std::move(typeName); } - RTPS_DllAPI const string_255& typeName() const + FASTDDS_EXPORTED_API const fastcdr::string_255& typeName() const { return m_typeName; } - RTPS_DllAPI string_255& typeName() + FASTDDS_EXPORTED_API fastcdr::string_255& typeName() { return m_typeName; } - RTPS_DllAPI void topicName( - const string_255& topicName) + FASTDDS_EXPORTED_API void topicName( + const fastcdr::string_255& topicName) { m_topicName = topicName; } - RTPS_DllAPI void topicName( - string_255&& topicName) + FASTDDS_EXPORTED_API void topicName( + fastcdr::string_255&& topicName) { m_topicName = std::move(topicName); } - RTPS_DllAPI const string_255& topicName() const + FASTDDS_EXPORTED_API const fastcdr::string_255& topicName() const { return m_topicName; } - RTPS_DllAPI string_255& topicName() + FASTDDS_EXPORTED_API fastcdr::string_255& topicName() { return m_topicName; } - RTPS_DllAPI void userDefinedId( + FASTDDS_EXPORTED_API void userDefinedId( uint16_t userDefinedId) { m_userDefinedId = userDefinedId; } - RTPS_DllAPI uint16_t userDefinedId() const + FASTDDS_EXPORTED_API uint16_t userDefinedId() const { return m_userDefinedId; } - RTPS_DllAPI uint16_t& userDefinedId() + FASTDDS_EXPORTED_API uint16_t& userDefinedId() { return m_userDefinedId; } - RTPS_DllAPI void typeMaxSerialized( + FASTDDS_EXPORTED_API void typeMaxSerialized( uint32_t typeMaxSerialized) { m_typeMaxSerialized = typeMaxSerialized; } - RTPS_DllAPI uint32_t typeMaxSerialized() const + FASTDDS_EXPORTED_API uint32_t typeMaxSerialized() const { return m_typeMaxSerialized; } - RTPS_DllAPI uint32_t& typeMaxSerialized() + FASTDDS_EXPORTED_API uint32_t& typeMaxSerialized() { return m_typeMaxSerialized; } - RTPS_DllAPI void topicKind( + FASTDDS_EXPORTED_API void topicKind( TopicKind_t topicKind) { m_topicKind = topicKind; } - RTPS_DllAPI TopicKind_t topicKind() const + FASTDDS_EXPORTED_API TopicKind_t topicKind() const { return m_topicKind; } - RTPS_DllAPI TopicKind_t& topicKind() + FASTDDS_EXPORTED_API TopicKind_t& topicKind() { return m_topicKind; } - RTPS_DllAPI void type_id( + FASTDDS_EXPORTED_API void type_id( const TypeIdV1& other_type_id) { type_id() = other_type_id; } - RTPS_DllAPI const TypeIdV1& type_id() const + FASTDDS_EXPORTED_API const TypeIdV1& type_id() const { assert(m_type_id != nullptr); return *m_type_id; } - RTPS_DllAPI TypeIdV1& type_id() + FASTDDS_EXPORTED_API TypeIdV1& type_id() { if (m_type_id == nullptr) { @@ -327,24 +330,24 @@ class WriterProxyData return *m_type_id; } - RTPS_DllAPI bool has_type_id() const + FASTDDS_EXPORTED_API bool has_type_id() const { return m_type_id != nullptr; } - RTPS_DllAPI void type( + FASTDDS_EXPORTED_API void type( const TypeObjectV1& other_type) { type() = other_type; } - RTPS_DllAPI const TypeObjectV1& type() const + FASTDDS_EXPORTED_API const TypeObjectV1& type() const { assert(m_type != nullptr); return *m_type; } - RTPS_DllAPI TypeObjectV1& type() + FASTDDS_EXPORTED_API TypeObjectV1& type() { if (m_type == nullptr) { @@ -353,39 +356,39 @@ class WriterProxyData return *m_type; } - RTPS_DllAPI bool has_type() const + FASTDDS_EXPORTED_API bool has_type() const { return m_type != nullptr; } - RTPS_DllAPI void type_information( - const xtypes::TypeInformation& other_type_information) + FASTDDS_EXPORTED_API void type_information( + const xtypes::TypeInformationParameter& other_type_information) { type_information() = other_type_information; } - RTPS_DllAPI const xtypes::TypeInformation& type_information() const + FASTDDS_EXPORTED_API const xtypes::TypeInformationParameter& type_information() const { assert(m_type_information != nullptr); return *m_type_information; } - RTPS_DllAPI xtypes::TypeInformation& type_information() + FASTDDS_EXPORTED_API xtypes::TypeInformationParameter& type_information() { if (m_type_information == nullptr) { - m_type_information = new xtypes::TypeInformation(); + m_type_information = new xtypes::TypeInformationParameter(); } return *m_type_information; } - RTPS_DllAPI bool has_type_information() const + FASTDDS_EXPORTED_API bool has_type_information() const { return m_type_information != nullptr; } //!WriterQOS - WriterQos m_qos; + fastdds::dds::WriterQos m_qos; /** * Set participant client server sample identity @@ -475,10 +478,10 @@ class WriterProxyData InstanceHandle_t m_RTPSParticipantKey; //!Type name - string_255 m_typeName; + fastcdr::string_255 m_typeName; //!Topic name - string_255 m_topicName; + fastcdr::string_255 m_topicName; //!User defined ID uint16_t m_userDefinedId; @@ -499,7 +502,7 @@ class WriterProxyData TypeObjectV1* m_type; //!Type Information - xtypes::TypeInformation* m_type_information; + xtypes::TypeInformationParameter* m_type_information; //! ParameterPropertyList_t m_properties; diff --git a/include/fastdds/rtps/builtin/discovery/endpoint/EDP.h b/include/fastdds/rtps/builtin/discovery/endpoint/EDP.h deleted file mode 100644 index bcdc927919a..00000000000 --- a/include/fastdds/rtps/builtin/discovery/endpoint/EDP.h +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDP.h - * - */ - -#ifndef _FASTDDS_RTPS_EDP_H_ -#define _FASTDDS_RTPS_EDP_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define MATCH_FAILURE_REASON_COUNT size_t(16) - -namespace eprosima { -namespace fastrtps { - -namespace types { -class TypeIdentifier; -} // namespace types - -class TopicAttributes; - -namespace rtps { - -class PDP; -class ParticipantProxyData; -class RTPSWriter; -class RTPSReader; -class WriterProxyData; -class RTPSParticipantImpl; - -/** - * Class EDP, base class for Endpoint Discovery Protocols. It contains generic methods used by the two EDP implemented (EDPSimple and EDPStatic), as well as abstract methods - * definitions required by the specific implementations. - * @ingroup DISCOVERY_MODULE - */ -class EDP -{ -public: - - /** - * Mask to hold the reasons why two endpoints do not match. - */ - class MatchingFailureMask : public std::bitset - { - public: - - //! Bit index for matching failing due to different topic - static const uint32_t different_topic = (0x00000001 << 0u); - - //! Bit index for matching failing due to inconsistent topic (same topic name but different characteristics) - static const uint32_t inconsistent_topic = (0x00000001 << 1u); - - //! Bit index for matching failing due to incompatible QoS - static const uint32_t incompatible_qos = (0x00000001 << 2u); - - //! Bit index for matching failing due to inconsistent partitions - static const uint32_t partitions = (0x00000001 << 3u); - }; - - /** - * Constructor. - * @param p Pointer to the PDPSimple - * @param part Pointer to the RTPSParticipantImpl - */ - EDP( - PDP* p, - RTPSParticipantImpl* part); - virtual ~EDP(); - - /** - * Abstract method to initialize the EDP. - * @param attributes DiscoveryAttributes structure. - * @return True if correct. - */ - virtual bool initEDP( - BuiltinAttributes& attributes) = 0; - /** - * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered. - * @param pdata Discovered ParticipantProxyData - * @param assign_secure_endpoints Whether to try assigning secure endpoints - */ - virtual void assignRemoteEndpoints( - const ParticipantProxyData& pdata, - bool assign_secure_endpoints) = 0; - /** - * Remove remote endpoints from the endpoint discovery protocol - * @param pdata Pointer to the ParticipantProxyData to remove - */ - virtual void removeRemoteEndpoints( - ParticipantProxyData* pdata) - { - (void) pdata; - } - - //! Verify whether the given participant EDP endpoints are matched with us - virtual bool areRemoteEndpointsMatched( - const ParticipantProxyData*) - { - return false; - } - - /** - * Abstract method that removes a local Reader from the discovery method - * @param R Pointer to the Reader to remove. - * @return True if correctly removed. - */ - virtual bool removeLocalReader( - RTPSReader* R) = 0; - /** - * Abstract method that removes a local Writer from the discovery method - * @param W Pointer to the Writer to remove. - * @return True if correctly removed. - */ - virtual bool removeLocalWriter( - RTPSWriter* W) = 0; - - /** - * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation). - * @param reader Pointer to the Reader object. - * @param rdata Pointer to the ReaderProxyData object. - * @return True if correct. - */ - virtual bool processLocalReaderProxyData( - RTPSReader* reader, - ReaderProxyData* rdata) = 0; - - /** - * After a new local WriterProxyData has been created some processing is needed (depends on the implementation). - * @param writer Pointer to the Writer object. - * @param wdata Pointer to the Writer ProxyData object. - * @return True if correct. - */ - virtual bool processLocalWriterProxyData( - RTPSWriter* writer, - WriterProxyData* wdata) = 0; - - /** - * Create a new ReaderPD for a local Reader. - * @param R Pointer to the RTPSReader. - * @param att Attributes of the associated topic - * @param qos QoS policies dictated by the subscriber - * @param content_filter Optional content filtering information. - * @return True if correct. - */ - bool newLocalReaderProxyData( - RTPSReader* R, - const TopicAttributes& att, - const ReaderQos& qos, - const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); - /** - * Create a new ReaderPD for a local Writer. - * @param W Pointer to the RTPSWriter. - * @param att Attributes of the associated topic - * @param qos QoS policies dictated by the publisher - * @return True if correct. - */ - bool newLocalWriterProxyData( - RTPSWriter* W, - const TopicAttributes& att, - const WriterQos& qos); - /** - * A previously created Reader has been updated - * @param R Pointer to the reader - * @param att Attributes of the associated topic - * @param qos QoS policies dictated by the subscriber - * @param content_filter Optional content filtering information. - * @return True if correctly updated - */ - bool updatedLocalReader( - RTPSReader* R, - const TopicAttributes& att, - const ReaderQos& qos, - const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); - /** - * A previously created Writer has been updated - * @param W Pointer to the Writer - * @param att Attributes of the associated topic - * @param qos QoS policies dictated by the publisher - * @return True if correctly updated - */ - bool updatedLocalWriter( - RTPSWriter* W, - const TopicAttributes& att, - const WriterQos& qos); - - /** - * Check the validity of a matching between a local RTPSWriter and a ReaderProxyData object. - * @param wdata Pointer to the WriterProxyData object of the local RTPSWriter. - * @param rdata Pointer to the ReaderProxyData object. - * @return True if the two can be matched. - */ - bool validMatching( - const WriterProxyData* wdata, - const ReaderProxyData* rdata); - - /** - * Check the validity of a matching between a local RTPSReader and a WriterProxyData object. - * @param rdata Pointer to the ReaderProxyData object of the local RTPSReader. - * @param wdata Pointer to the WriterProxyData object. - * @return True if the two can be matched. - */ - bool validMatching( - const ReaderProxyData* rdata, - const WriterProxyData* wdata); - - /** - * Check the validity of a matching between a local RTPSWriter and a ReaderProxyData object. - * @param wdata Pointer to the WriterProxyData object of the local RTPSWriter. - * @param rdata Pointer to the ReaderProxyData object. - * @param [out] reason On return will specify the reason of failed matching (if any). - * @param [out] incompatible_qos On return will specify all the QoS values that were incompatible (if any). - * @return True if the two can be matched. - */ - bool valid_matching( - const WriterProxyData* wdata, - const ReaderProxyData* rdata, - MatchingFailureMask& reason, - fastdds::dds::PolicyMask& incompatible_qos); - - /** - * Check the validity of a matching between a local RTPSReader and a WriterProxyData object. - * @param rdata Pointer to the ReaderProxyData object of the local RTPSReader. - * @param wdata Pointer to the WriterProxyData object. - * @param [out] reason On return will specify the reason of failed matching (if any). - * @param [out] incompatible_qos On return will specify all the QoS values that were incompatible (if any). - * @return True if the two can be matched. - */ - bool valid_matching( - const ReaderProxyData* rdata, - const WriterProxyData* wdata, - MatchingFailureMask& reason, - fastdds::dds::PolicyMask& incompatible_qos); - - /** - * Unpair a WriterProxyData object from all local readers. - * @param participant_guid GUID of the participant. - * @param writer_guid GUID of the writer. - * @param removed_by_lease Whether the writer is being unpaired due to a participant drop. - * @return True if correct. - */ - bool unpairWriterProxy( - const GUID_t& participant_guid, - const GUID_t& writer_guid, - bool removed_by_lease); - - /** - * Unpair a ReaderProxyData object from all local writers. - * @param participant_guid GUID of the participant. - * @param reader_guid GUID of the reader. - * @return True if correct. - */ - bool unpairReaderProxy( - const GUID_t& participant_guid, - const GUID_t& reader_guid); - - /** - * Try to pair/unpair ReaderProxyData. - * @param participant_guid Identifier of the participant. - * @param rdata Pointer to the ReaderProxyData object. - * @return True. - */ - bool pairing_reader_proxy_with_any_local_writer( - const GUID_t& participant_guid, - ReaderProxyData* rdata); - -#if HAVE_SECURITY - bool pairing_reader_proxy_with_local_writer( - const GUID_t& local_writer, - const GUID_t& remote_participant_guid, - ReaderProxyData& rdata); - - bool pairing_remote_reader_with_local_writer_after_security( - const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data); -#endif // if HAVE_SECURITY - - /** - * Try to pair/unpair WriterProxyData. - * @param participant_guid Identifier of the participant. - * @param wdata Pointer to the WriterProxyData. - * @return True. - */ - bool pairing_writer_proxy_with_any_local_reader( - const GUID_t& participant_guid, - WriterProxyData* wdata); - -#if HAVE_SECURITY - bool pairing_writer_proxy_with_local_reader( - const GUID_t& local_reader, - const GUID_t& remote_participant_guid, - WriterProxyData& wdata); - - bool pairing_remote_writer_with_local_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data); - - virtual bool pairing_remote_writer_with_local_builtin_reader_after_security( - const GUID_t& /*local_reader*/, - const WriterProxyData& /*remote_writer_data*/) - { - return false; - } - - virtual bool pairing_remote_reader_with_local_builtin_writer_after_security( - const GUID_t& /*local_writer*/, - const ReaderProxyData& /*remote_reader_data*/) - { - return false; - } - -#endif // if HAVE_SECURITY - const fastdds::dds::SubscriptionMatchedStatus& update_subscription_matched_status( - const GUID_t& reader_guid, - const GUID_t& writer_guid, - int change); - - const fastdds::dds::PublicationMatchedStatus& update_publication_matched_status( - const GUID_t& reader_guid, - const GUID_t& writer_guid, - int change); - - //! Pointer to the PDP object that contains the endpoint discovery protocol. - PDP* mp_PDP; - //! Pointer to the RTPSParticipant. - RTPSParticipantImpl* mp_RTPSParticipant; - - /** - * Access the temporary proxy pool for reader proxies - * @return pool reference - */ - ProxyPool& get_temporary_reader_proxies_pool(); - - /** - * Access the temporary proxy pool for writer proxies - * @return pool reference - */ - ProxyPool& get_temporary_writer_proxies_pool(); - -private: - - /** - * Try to pair/unpair a local Reader against all possible writerProxy Data. - * @param R Pointer to the Reader - * @param participant_guid - * @param rdata - * @return True - */ - bool pairingReader( - RTPSReader* R, - const GUID_t& participant_guid, - const ReaderProxyData& rdata); - /** - * Try to pair/unpair a local Writer against all possible readerProxy Data. - * @param W Pointer to the Writer - * @param participant_guid - * @param wdata - * @return True - */ - bool pairingWriter( - RTPSWriter* W, - const GUID_t& participant_guid, - const WriterProxyData& wdata); - - bool checkDataRepresentationQos( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - bool checkTypeValidation( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - bool checkTypeIdentifier( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - bool hasTypeIdentifier( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - bool checkTypeObject( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - bool hasTypeObject( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const; - - using pool_allocator_t = - foonathan::memory::memory_pool; - - pool_allocator_t reader_status_allocator_; - pool_allocator_t writer_status_allocator_; - - foonathan::memory::map reader_status_; - foonathan::memory::map writer_status_; -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_EDP_H_ */ diff --git a/include/fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h b/include/fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h deleted file mode 100644 index c2f5e940d78..00000000000 --- a/include/fastdds/rtps/builtin/discovery/endpoint/EDPSimple.h +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDPSimple.h - * - */ - -#ifndef _FASTDDS_RTPS_EDPSIMPLE_H_ -#define _FASTDDS_RTPS_EDPSIMPLE_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class StatefulReader; -class StatefulWriter; -class RTPSWriter; -class RTPSReader; -class ReaderHistory; -class WriterHistory; -class HistoryAttributes; -class ReaderAttributes; -class WriterAttributes; -class EDPListener; -class ITopicPayloadPool; - -/** - * Class EDPSimple, implements the Simple Endpoint Discovery Protocol defined in the RTPS specification. - * Inherits from EDP class. - *@ingroup DISCOVERY_MODULE - */ -class EDPSimple : public EDP -{ - using t_p_StatefulWriter = std::pair; - using t_p_StatefulReader = std::pair; - -public: - - typedef std::set key_list; - - /** - * Constructor. - * @param p Pointer to the PDP - * @param part Pointer to the RTPSParticipantImpl - */ - EDPSimple( - PDP* p, - RTPSParticipantImpl* part); - - virtual ~EDPSimple(); - //!Discovery attributes. - BuiltinAttributes m_discovery; - //!Pointer to the Publications Writer (only created if indicated in the DiscoveryAtributes). - t_p_StatefulWriter publications_writer_; - //!Pointer to the Subscriptions Writer (only created if indicated in the DiscoveryAtributes). - t_p_StatefulWriter subscriptions_writer_; - //!Pointer to the Publications Reader (only created if indicated in the DiscoveryAtributes). - t_p_StatefulReader publications_reader_; - //!Pointer to the Subscriptions Reader (only created if indicated in the DiscoveryAtributes). - t_p_StatefulReader subscriptions_reader_; - -#if HAVE_SECURITY - t_p_StatefulWriter publications_secure_writer_; - - t_p_StatefulReader publications_secure_reader_; - - t_p_StatefulWriter subscriptions_secure_writer_; - - t_p_StatefulReader subscriptions_secure_reader_; -#endif // if HAVE_SECURITY - - //!Pointer to the listener associated with PubReader and PubWriter. - EDPListener* publications_listener_; - - //!Pointer to the listener associated with SubReader and SubWriter. - EDPListener* subscriptions_listener_; - - /** - * Initialization method. - * @param attributes Reference to the DiscoveryAttributes. - * @return True if correct. - */ - bool initEDP( - BuiltinAttributes& attributes) override; - /** - * This method assigns the remote builtin endpoints that the remote RTPSParticipant indicates is using to our local builtin endpoints. - * @param pdata Pointer to the RTPSParticipantProxyData object. - * @param assign_secure_endpoints Whether to try assigning secure endpoints - */ - void assignRemoteEndpoints( - const ParticipantProxyData& pdata, - bool assign_secure_endpoints) override; - /** - * Remove remote endpoints from the endpoint discovery protocol - * @param pdata Pointer to the ParticipantProxyData to remove - */ - void removeRemoteEndpoints( - ParticipantProxyData* pdata) override; - - //! Verify whether the given participant EDP endpoints are matched with us - bool areRemoteEndpointsMatched( - const ParticipantProxyData* pdata) override; - - /** - * This method generates the corresponding change in the subscription writer and send it to all known remote endpoints. - * @param reader Pointer to the Reader object. - * @param rdata Pointer to the ReaderProxyData object. - * @return true if correct. - */ - bool processLocalReaderProxyData( - RTPSReader* reader, - ReaderProxyData* rdata) override; - /** - * This method generates the corresponding change in the publciations writer and send it to all known remote endpoints. - * @param writer Pointer to the Writer object. - * @param wdata Pointer to the WriterProxyData object. - * @return true if correct. - */ - bool processLocalWriterProxyData( - RTPSWriter* writer, - WriterProxyData* wdata) override; - /** - * This methods generates the change disposing of the local Reader and calls the unpairing and removal methods of the base class. - * @param R Pointer to the RTPSReader object. - * @return True if correct. - */ - bool removeLocalReader( - RTPSReader* R) override; - /** - * This methods generates the change disposing of the local Writer and calls the unpairing and removal methods of the base class. - * @param W Pointer to the RTPSWriter object. - * @return True if correct. - */ - bool removeLocalWriter( - RTPSWriter* W) override; - -protected: - - /** - * Initialization of history attributes for EDP built-in readers - * - * @param [out] attributes History attributes to initialize - */ - virtual void set_builtin_reader_history_attributes( - HistoryAttributes& attributes); - - /** - * Initialization of history attributes for EDP built-in writers - * - * @param [out] attributes History attributes to initialize - */ - virtual void set_builtin_writer_history_attributes( - HistoryAttributes& attributes); - - /** - * Initialization of reader attributes for EDP built-in readers - * - * @param [out] attributes Reader attributes to initialize - */ - virtual void set_builtin_reader_attributes( - ReaderAttributes& attributes); - - /** - * Initialization of writer attributes for EDP built-in writers - * - * @param [out] attributes Writer attributes to initialize - */ - virtual void set_builtin_writer_attributes( - WriterAttributes& attributes); - - /** - * Create local SEDP Endpoints based on the DiscoveryAttributes. - * @return True if correct. - */ - virtual bool createSEDPEndpoints(); - - /** - * Create a cache change on a builtin writer and serialize a WriterProxyData on it. - * @param [in] data The WriterProxyData object to be serialized. - * @param [in] writer The writer,history pair where the change should be added. - * @param [in] remove_same_instance Should previous changes with same key be removed? - * @param [out] created_change Where the pointer to the created change should be returned. - * @return false if data could not be serialized into the created change. - */ - bool serialize_writer_proxy_data( - const WriterProxyData& data, - const t_p_StatefulWriter& writer, - bool remove_same_instance, - CacheChange_t** created_change); - - /** - * Create a cache change on a builtin writer and serialize a ReaderProxyData on it. - * @param [in] data The ReaderProxyData object to be serialized. - * @param [in] writer The writer,history pair where the change should be added. - * @param [in] remove_same_instance Should previous changes with same key be removed? - * @param [out] created_change Where the pointer to the created change should be returned. - * @return false if data could not be serialized into the created change. - */ - bool serialize_reader_proxy_data( - const ReaderProxyData& data, - const t_p_StatefulWriter& writer, - bool remove_same_instance, - CacheChange_t** created_change); - - //! Process the info recorded in the persistence database - void processPersistentData( - t_p_StatefulReader& reader, - t_p_StatefulWriter& writer, - key_list& demises); - - /** - * Get a pointer pair of the corresponding writer builtin endpoint for the entity_id - * @param [in] entity_id The entity_id to obtain the pair from. - * @return A pair of nullptrs if operation was unsuccessful - */ - t_p_StatefulWriter get_builtin_writer_history_pair_by_entity( - const EntityId_t& entity_id); - - /** - * Get a pointer pair of the corresponding reader builtin endpoint for the entity_id. - * If a builtin writer Entity is passed, the equivalent reader entity builtin is returned. - * @param [in] entity_id The entity_id to obtain the pair from. - * @return A pair of nullptrs if operation was unsuccessful - */ - t_p_StatefulReader get_builtin_reader_history_pair_by_entity( - const EntityId_t& entity_id); - - std::shared_ptr pub_writer_payload_pool_; - std::shared_ptr pub_reader_payload_pool_; - std::shared_ptr sub_writer_payload_pool_; - std::shared_ptr sub_reader_payload_pool_; - -#if HAVE_SECURITY - std::shared_ptr sec_pub_writer_payload_pool_; - std::shared_ptr sec_pub_reader_payload_pool_; - std::shared_ptr sec_sub_writer_payload_pool_; - std::shared_ptr sec_sub_reader_payload_pool_; -#endif // if HAVE_SECURITY - -private: - - /** - * Create a cache change on a builtin writer and serialize a ProxyData on it. - * @param [in] data The ProxyData object to be serialized. - * @param [in] writer The writer,history pair where the change should be added. - * @param [in] remove_same_instance Should previous changes with same key be removed? - * @param [out] created_change Where the pointer to the created change should be returned. - * @return false if data could not be serialized into the created change. - */ - template - bool serialize_proxy_data( - const ProxyData& data, - const t_p_StatefulWriter& writer, - bool remove_same_instance, - CacheChange_t** created_change); - -#if HAVE_SECURITY - bool create_sedp_secure_endpoints(); - - bool pairing_remote_writer_with_local_builtin_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data) override; - - bool pairing_remote_reader_with_local_builtin_writer_after_security( - const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data) override; -#endif // if HAVE_SECURITY -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_EDPSIMPLE_H_ */ diff --git a/include/fastdds/rtps/builtin/discovery/endpoint/EDPStatic.h b/include/fastdds/rtps/builtin/discovery/endpoint/EDPStatic.h deleted file mode 100644 index bb3d0d85b73..00000000000 --- a/include/fastdds/rtps/builtin/discovery/endpoint/EDPStatic.h +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDPStatic.h - * - */ - -#ifndef _FASTDDS_RTPS_EDPSTATIC_H_ -#define _FASTDDS_RTPS_EDPSTATIC_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include - -namespace eprosima { - -namespace fastrtps { -namespace xmlparser { -class XMLEndpointParser; -} // namespace xmlparser - -namespace rtps { - -/** - * Class EDPStatic, implements a static endpoint discovery module. - * @ingroup DISCOVERYMODULE - */ -class EDPStatic : public EDP -{ -public: - - //! Different exchange formats supported by Static Discovery. - enum class ExchangeFormat : uint32_t - { - v1, //! Standard exchange format for Static Discovery. - v1_Reduced //! Exchange format that reduces the used network bandwidth. - }; - - /** - * Constructor. - * @param p Pointer to the PDPSimple. - * @param part Pointer to the RTPSParticipantImpl. - */ - EDPStatic( - PDP* p, - RTPSParticipantImpl* part); - virtual ~EDPStatic(); - /** - * Abstract method to initialize the EDP. - * @param attributes DiscoveryAttributes structure. - * @return True if correct. - */ - bool initEDP( - BuiltinAttributes& attributes) override; - /** - * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered. - * @param pdata Pointer to the ParticipantProxyData. - * @param assign_secure_endpoints Whether to try assigning secure endpoints - */ - void assignRemoteEndpoints( - const ParticipantProxyData& pdata, - bool assign_secure_endpoints) override; - /** - * Abstract method that removes a local Reader from the discovery method - * @param R Pointer to the Reader to remove. - * @return True if correctly removed. - */ - bool removeLocalReader( - RTPSReader* R) override; - /** - * Abstract method that removes a local Writer from the discovery method - * @param W Pointer to the Writer to remove. - * @return True if correctly removed. - */ - bool removeLocalWriter( - RTPSWriter* W) override; - - /** - * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation). - * @param reader Pointer to the RTPSReader object. - * @param rdata Pointer to the ReaderProxyData object. - * @return True if correct. - */ - bool processLocalReaderProxyData( - RTPSReader* reader, - ReaderProxyData* rdata) override; - /** - * After a new local WriterProxyData has been created some processing is needed (depends on the implementation). - * @param writer Pointer to the RTPSWriter object. - * @param wdata Pointer to the Writer ProxyData object. - * @return True if correct. - */ - bool processLocalWriterProxyData( - RTPSWriter* writer, - WriterProxyData* wdata) override; - - /** - * New Remote Writer has been found and this method process it and calls the pairing methods. - * @param participant_guid GUID of the participant. - * @param participant_name Name of the participant. - * @param user_id User Id. - * @param ent_id Entity Id. - * @param persistence_guid GUID used for persistence. - * @return True if correct. - */ - bool newRemoteWriter( - const GUID_t& participant_guid, - const string_255& participant_name, - uint16_t user_id, - EntityId_t ent_id = c_EntityId_Unknown, - const GUID_t& persistence_guid = GUID_t::unknown()); - /** - * New Remote Reader has been found and this method process it and calls the pairing methods. - * @param participant_guid GUID of the participant. - * @param participant_name Name of the participant. - * @param user_id User Id. - * @param ent_id Entity Id. - * @return true if correct. - */ - bool newRemoteReader( - const GUID_t& participant_guid, - const string_255& participant_name, - uint16_t user_id, - EntityId_t ent_id = c_EntityId_Unknown); - - /** - * This method checks the provided entityId against the topic type to see if it matches - * @param rdata Pointer to the readerProxyData - * @return True if its correct. - **/ - bool checkEntityId( - ReaderProxyData* rdata); - /** - * This method checks the provided entityId against the topic type to see if it matches - * @param wdata Pointer to the writerProxyData - * @return True if its correct. - **/ - bool checkEntityId( - WriterProxyData* wdata); - -private: - - xmlparser::XMLEndpointParser* mp_edpXML; - - BuiltinAttributes m_attributes; - - ExchangeFormat exchange_format_ = ExchangeFormat::v1; -}; - -} // namespace rtps -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_EDPSTATIC_H_ */ diff --git a/include/fastdds/rtps/builtin/discovery/participant/PDP.h b/include/fastdds/rtps/builtin/discovery/participant/PDP.h deleted file mode 100644 index a94d40a4e37..00000000000 --- a/include/fastdds/rtps/builtin/discovery/participant/PDP.h +++ /dev/null @@ -1,658 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDP.h - * - */ - -#ifndef _FASTDDS_RTPS_PDP_H_ -#define _FASTDDS_RTPS_PDP_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { - -namespace fastdds { -namespace statistics { -namespace rtps { - -struct IProxyObserver; - -} // namespace rtps -} // namespace statistics - -namespace rtps { - -class PDPServerListener; -class PDPEndpoints; - -} // namespace rtps -} // namespace fastdds - -namespace fastrtps { -namespace types { - -class TypeObject; -class TypeIdentifier; - -} // namespace types -namespace rtps { - -class RTPSWriter; -class RTPSReader; -class WriterHistory; -class ReaderHistory; -class RTPSParticipantImpl; -class RTPSParticipantListener; -class BuiltinProtocols; -class EDP; -class TimedEvent; -class ReaderProxyData; -class WriterProxyData; -class ParticipantProxyData; -class ReaderListener; -class PDPListener; -class PDPServerListener; -class ITopicPayloadPool; - -/** - * Abstract class PDP that implements the basic interfaces for all Participant Discovery implementations - * It also keeps the Participant Discovery Data and provides interfaces to access it - *@ingroup DISCOVERY_MODULE - */ -class PDP : public fastdds::statistics::rtps::IProxyQueryable -{ - friend class PDPListener; - friend class PDPServerListener; - friend class fastdds::rtps::PDPServerListener; - friend class PDPSecurityInitiatorListener; - -public: - - /** - * Constructor - * @param builtin Pointer to the BuiltinProtocols object. - * @param allocation Participant allocation parameters. - */ - PDP( - BuiltinProtocols* builtin, - const RTPSParticipantAllocationAttributes& allocation); - - virtual ~PDP(); - - virtual void initializeParticipantProxyData( - ParticipantProxyData* participant_data); - - /** - * Initialize the PDP. - * @param part Pointer to the RTPSParticipant. - * @return True on success - */ - bool initPDP( - RTPSParticipantImpl* part); - - /** - * @brief Enable the Participant Discovery Protocol - * - * @return true if enabled correctly, or if already enabled; false otherwise - */ - bool enable(); - - virtual bool init( - RTPSParticipantImpl* part) = 0; - - /** - * Creates an initializes a new participant proxy from a DATA(p) raw info - * @param p from DATA msg deserialization - * @param writer_guid GUID of originating writer - * @return new ParticipantProxyData * or nullptr on failure - */ - virtual ParticipantProxyData* createParticipantProxyData( - const ParticipantProxyData& p, - const GUID_t& writer_guid) = 0; - - /** - * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. - * @param new_change If true a new change (with new seqNum) is created and sent;If false the last change is re-sent - * @param dispose sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED - * @param wparams allows to identify the change - */ - virtual void announceParticipantState( - bool new_change, - bool dispose, - WriteParams& wparams) = 0; - - /** - * \c announceParticipantState method without optional output parameter \c wparams . - */ - virtual void announceParticipantState( - bool new_change, - bool dispose = false); - - //!Stop the RTPSParticipantAnnouncement (only used in tests). - virtual void stopParticipantAnnouncement(); - - //!Reset the RTPSParticipantAnnouncement (only used in tests). - virtual void resetParticipantAnnouncement(); - - /** - * Add a ReaderProxyData to the correct ParticipantProxyData. - * @param [in] reader_guid GUID of the reader to add. - * @param [out] participant_guid GUID of the ParticipantProxyData where the reader was added. - * @param [in] initializer_func Function to be called in order to set the data of the ReaderProxyData. - * - * @return A pointer to the added ReaderProxyData (nullptr if it could not be added). - */ - ReaderProxyData* addReaderProxyData( - const GUID_t& reader_guid, - GUID_t& participant_guid, - std::function initializer_func); - - /** - * Add a WriterProxyData to the correct ParticipantProxyData. - * @param [in] writer_guid GUID of the writer to add. - * @param [out] participant_guid GUID of the ParticipantProxyData where the writer was added. - * @param [in] initializer_func Function to be called in order to set the data of the WriterProxyData. - * - * @return A pointer to the added WriterProxyData (nullptr if it could not be added). - */ - WriterProxyData* addWriterProxyData( - const GUID_t& writer_guid, - GUID_t& participant_guid, - std::function initializer_func); - - /** - * This method returns whether a ReaderProxyDataObject exists among the registered RTPSParticipants - * (including the local RTPSParticipant). - * @param [in] reader GUID_t of the reader we are looking for. - * @return True if found. - */ - bool has_reader_proxy_data( - const GUID_t& reader); - - /** - * This method gets a copy of a ReaderProxyData object if it is found among the registered RTPSParticipants - * (including the local RTPSParticipant). - * @param [in] reader GUID_t of the reader we are looking for. - * @param [out] rdata Reference to the ReaderProxyData object where data is to be returned. - * @return True if found. - */ - bool lookupReaderProxyData( - const GUID_t& reader, - ReaderProxyData& rdata); - - /** - * This method returns whether a WriterProxyData exists among the registered RTPSParticipants - * (including the local RTPSParticipant). - * @param [in] writer GUID_t of the writer we are looking for. - * @return True if found. - */ - bool has_writer_proxy_data( - const GUID_t& writer); - - /** - * This method gets a copy of a WriterProxyData object if it is found among the registered RTPSParticipants - * (including the local RTPSParticipant). - * @param [in] writer GUID_t of the writer we are looking for. - * @param [out] wdata Reference to the WriterProxyData object where data is to be returned. - * @return True if found. - */ - bool lookupWriterProxyData( - const GUID_t& writer, - WriterProxyData& wdata); - - /** - * This method returns the name of a participant if it is found among the registered RTPSParticipants. - * @param [in] guid GUID_t of the RTPSParticipant we are looking for. - * @param [out] name Copy of name on ParticipantProxyData object. - * @return True if found. - */ - bool lookup_participant_name( - const GUID_t& guid, - string_255& name); - - /** - * This method removes and deletes a ReaderProxyData object from its corresponding RTPSParticipant. - * - * @param[in] reader_guid GUID_t of the reader to remove. - * @return true if found and deleted. - */ - bool removeReaderProxyData( - const GUID_t& reader_guid); - - /** - * This method removes and deletes a ReaderProxyData object from its corresponding RTPSParticipant. - * - * @param[in] reader_guid GUID_t of the reader to remove. - * @param[in] reason Why the reader is being removed (dropped, removed, or ignored) - * @return true if found and deleted. - */ - bool removeReaderProxyData( - const GUID_t& reader_guid, - ReaderDiscoveryInfo::DISCOVERY_STATUS reason); - - /** - * This method removes and deletes a WriterProxyData object from its corresponding RTPSParticipant. - * - * @param[in] writer_guid GUID_t of the writer to remove. - * @return true if found and deleted. - */ - bool removeWriterProxyData( - const GUID_t& writer_guid); - - /** - * This method removes and deletes a WriterProxyData object from its corresponding RTPSParticipant. - * - * @param[in] writer_guid GUID_t of the writer to remove. - * @param[in] reason Why the writer is being removed (dropped, removed, or ignored) - * @return true if found and deleted. - */ - bool removeWriterProxyData( - const GUID_t& writer_guid, - WriterDiscoveryInfo::DISCOVERY_STATUS reason); - - /** - * Create the SPDP Writer and Reader - * @return True if correct. - */ - virtual bool createPDPEndpoints() = 0; - - /** - * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls the corresponding methods in EDP and WLP. - * @param pdata Pointer to the RTPSParticipantProxyData object. - */ - virtual void assignRemoteEndpoints( - ParticipantProxyData* pdata) = 0; - - /** - * Override to match additional endpoints to PDP. Like EDP or WLP. - * @param pdata Pointer to the ParticipantProxyData object. - * @param notify_secure_endpoints Whether to try notifying secure endpoints. - */ - virtual void notifyAboveRemoteEndpoints( - const ParticipantProxyData& pdata, - bool notify_secure_endpoints) = 0; - - /** - * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic - * @return true if EDP endpoinst must be match - */ - virtual bool updateInfoMatchesEDP() - { - return false; - } - - /** - * Remove remote endpoints from the participant discovery protocol - * @param pdata Pointer to the ParticipantProxyData to remove - */ - virtual void removeRemoteEndpoints( - ParticipantProxyData* pdata) = 0; - - /** - * This method removes a remote RTPSParticipant and all its writers and readers. - * @param participant_guid GUID_t of the remote RTPSParticipant. - * @param reason Why the participant is being removed (dropped, removed, or ignored) - * @return true if correct. - */ - virtual bool remove_remote_participant( - const GUID_t& participant_guid, - ParticipantDiscoveryInfo::DISCOVERY_STATUS reason); - - /** - * This method returns the BuiltinAttributes of the local participant. - * @return const reference to the BuiltinAttributes of the local participant. - */ - const BuiltinAttributes& builtin_attributes() const; - - /** - * Get a pointer to the local RTPSParticipant ParticipantProxyData object. - * @return Pointer to the local RTPSParticipant ParticipantProxyData object. - */ - ParticipantProxyData* getLocalParticipantProxyData() const - { - return participant_proxies_.empty() ? nullptr : participant_proxies_.front(); - } - - /** - * Get a pointer to the EDP object. - * @return pointer to the EDP object. - */ - inline EDP* getEDP() - { - return mp_EDP; - } - - /** - * Get a const_iterator to the beginning of the RTPSParticipant Proxies. - * @return const_iterator. - */ - ResourceLimitedVector::const_iterator ParticipantProxiesBegin() - { - return participant_proxies_.begin(); - } - - /** - * Get a const_iterator to the end of the RTPSParticipant Proxies. - * @return const_iterator. - */ - ResourceLimitedVector::const_iterator ParticipantProxiesEnd() - { - return participant_proxies_.end(); - } - - /** - * Get the number of participant proxies. - * @return size_t. - */ - size_t participant_proxies_number() - { - return participant_proxies_number_; - } - - /** - * Assert the liveliness of a Remote Participant. - * @param remote_guid GuidPrefix_t of the participant whose liveliness is being asserted. - */ - void assert_remote_participant_liveliness( - const GuidPrefix_t& remote_guid); - - /** - * Get the RTPS participant - * @return RTPS participant - */ - inline RTPSParticipantImpl* getRTPSParticipant() const - { - return mp_RTPSParticipant; - } - - /** - * Get the mutex. - * @return Pointer to the Mutex - */ - inline std::recursive_mutex* getMutex() const - { - return mp_mutex; - } - - CDRMessage_t get_participant_proxy_data_serialized( - Endianness_t endian); - - /** - * Retrive the ParticipantProxyData of a participant - * @param guid_prefix The GUID prefix of the participant of which the proxy data is retrieved - * @return A pointer to the ParticipantProxyData. nullptr if there is no such ParticipantProxyData - */ - ParticipantProxyData* get_participant_proxy_data( - const GuidPrefix_t& guid_prefix); - - /** - * Get the list of remote servers to which the client should connect - * @return A reference to the list of RemoteServerAttributes - */ - std::list& remote_server_attributes(); - - /** - * Access the temporary proxy pool for reader proxies - * @return pool reference - */ - ProxyPool& get_temporary_reader_proxies_pool() - { - return temp_reader_proxies_; - } - - /** - * Access the temporary proxy pool for writer proxies - * @return pool reference - */ - ProxyPool& get_temporary_writer_proxies_pool() - { - return temp_writer_proxies_; - } - - ReaderAttributes create_builtin_reader_attributes() const; - - WriterAttributes create_builtin_writer_attributes() const; - -#if HAVE_SECURITY - void add_builtin_security_attributes( - ReaderAttributes& ratt, - WriterAttributes& watt) const; - - virtual bool pairing_remote_writer_with_local_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data); - - virtual bool pairing_remote_reader_with_local_writer_after_security( - const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data); -#endif // HAVE_SECURITY - -#ifdef FASTDDS_STATISTICS - bool get_all_local_proxies( - std::vector& guids) override; - - bool get_serialized_proxy( - const GUID_t& guid, - CDRMessage_t* msg) override; - - void set_proxy_observer( - const fastdds::statistics::rtps::IProxyObserver* proxy_observer); - - const fastdds::statistics::rtps::IProxyObserver* get_proxy_observer() - { - return proxy_observer_.load(); - } - -#else - bool get_all_local_proxies( - std::vector&) override - { - return false; - } - - bool get_serialized_proxy( - const GUID_t&, - CDRMessage_t*) override - { - return false; - } - -#endif // FASTDDS_STATISTICS - -protected: - - //!Pointer to the builtin protocols object. - BuiltinProtocols* mp_builtin; - //!Pointer to the local RTPSParticipant. - RTPSParticipantImpl* mp_RTPSParticipant; - //!Discovery attributes. - BuiltinAttributes m_discovery; - //!Builtin PDP endpoints - std::unique_ptr builtin_endpoints_; - //!Pointer to the EDP object. - EDP* mp_EDP; - //!Number of participant proxy data objects created - size_t participant_proxies_number_; - //!Registered RTPSParticipants (including the local one, that is the first one.) - ResourceLimitedVector participant_proxies_; - //!Pool of participant proxy data objects ready for reuse - ResourceLimitedVector participant_proxies_pool_; - //!Number of reader proxy data objects created - size_t reader_proxies_number_; - //!Pool of reader proxy data objects ready for reuse - ResourceLimitedVector reader_proxies_pool_; - //!Number of writer proxy data objects created - size_t writer_proxies_number_; - //!Pool of writer proxy data objects ready for reuse - ResourceLimitedVector writer_proxies_pool_; - //!Variable to indicate if any parameter has changed. - std::atomic_bool m_hasChangedLocalPDP; - //! ProxyPool for temporary reader proxies - ProxyPool temp_reader_proxies_; - //! ProxyPool for temporary writer proxies - ProxyPool temp_writer_proxies_; - //!Participant data atomic access assurance - std::recursive_mutex* mp_mutex; - //!To protect callbacks (ParticipantProxyData&) - std::mutex callback_mtx_; - //!Tell if object is enabled - std::atomic enabled_ {false}; - - /** - * Adds an entry to the collection of participant proxy information. - * May use one of the entries present in the pool. - * - * @param participant_guid GUID of the participant for which to create the proxy object. - * @param with_lease_duration indicates whether lease duration event should be created. - * @param participant_proxy_data The participant proxy data from which the copy is made (if provided) - * - * @return pointer to the currently inserted entry, nullptr if allocation limits were reached. - */ - ParticipantProxyData* add_participant_proxy_data( - const GUID_t& participant_guid, - bool with_lease_duration, - const ParticipantProxyData* participant_proxy_data = nullptr); - - /** - * Checks whether two participant prefixes are equal by calculating the mangled - * GUID and comparing it with the remote participant prefix. - * - * @param guid_prefix the original desired guid_prefix to compare - * @param participant_data The participant proxy data to compare against - * - * @return true when prefixes are equivalent - */ - bool data_matches_with_prefix( - const GuidPrefix_t& guid_prefix, - const ParticipantProxyData& participant_data); - - /** - * Gets the key of a participant proxy data. - * - * @param [in] participant_guid GUID of the participant to look for. - * @param [out] key of the corresponding proxy object. - * - * @return true when input GUID is found. - */ - bool lookup_participant_key( - const GUID_t& participant_guid, - InstanceHandle_t& key); - - /** - * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. - * @param writer RTPSWriter to use for sending the announcement - * @param history history where the change should be added - * @param new_change If true a new change (with new seqNum) is created and sent;If false the last change is re-sent - * @param dispose sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED - * @param wparams allows to identify the change - */ - void announceParticipantState( - RTPSWriter& writer, - WriterHistory& history, - bool new_change, - bool dispose = false, - WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT); - - /** - * Called after creating the builtin endpoints to update the metatraffic unicast locators of BuiltinProtocols - */ - virtual void update_builtin_locators() = 0; - - void notify_and_maybe_ignore_new_participant( - ParticipantProxyData* pdata, - bool& should_be_ignored); - -#ifdef FASTDDS_STATISTICS - - std::atomic proxy_observer_; - -#endif // FASTDDS_STATISTICS - -private: - - //!TimedEvent to periodically resend the local RTPSParticipant information. - TimedEvent* resend_participant_info_event_; - - //!Participant's initial announcements config - InitialAnnouncementConfig initial_announcements_; - - void check_remote_participant_liveliness( - ParticipantProxyData* remote_participant); - - void check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const WriterProxyData& wdata) const; - - void check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const ReaderProxyData& rdata) const; - - void check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const string_255& topic_name, - const string_255& type_name, - const types::TypeIdentifier* type_id, - const types::TypeObject* type_obj, - const xtypes::TypeInformation* type_info) const; - - /** - * Calculates the next announcement interval - */ - void set_next_announcement_interval(); - - /** - * Calculates the initial announcement interval - */ - void set_initial_announcement_interval(); - - /** - * Set to a Participant Proxy those properties from this participant that must be sent. - */ - void set_external_participant_properties_( - ParticipantProxyData* participant_data); -}; - - -// configuration values for PDP reliable entities. -extern const Duration_t pdp_heartbeat_period; -extern const Duration_t pdp_nack_response_delay; -extern const Duration_t pdp_nack_supression_duration; -extern const Duration_t pdp_heartbeat_response_delay; - -extern const int32_t pdp_initial_reserved_caches; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_PDP_H_ */ diff --git a/include/fastdds/rtps/builtin/discovery/participant/PDPSimple.h b/include/fastdds/rtps/builtin/discovery/participant/PDPSimple.h deleted file mode 100644 index dadfcc8c7b0..00000000000 --- a/include/fastdds/rtps/builtin/discovery/participant/PDPSimple.h +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDPSimple.h - * - */ - -#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ -#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class StatelessWriter; -class StatelessReader; - -/** - * Class PDPSimple that implements the SimpleRTPSParticipantDiscoveryProtocol as defined in the RTPS specification. - * @ingroup DISCOVERY_MODULE - */ -class PDPSimple : public PDP -{ -public: - - /** - * Constructor - * @param builtin Pointer to the BuiltinProcols object. - * @param allocation Participant allocation parameters. - */ - PDPSimple( - BuiltinProtocols* builtin, - const RTPSParticipantAllocationAttributes& allocation); - - virtual ~PDPSimple(); - - /** - * Initialize the PDP. - * @param part Pointer to the RTPSParticipant. - * @return True on success - */ - bool init( - RTPSParticipantImpl* part) override; - - /** - * Creates an initializes a new participant proxy from a DATA(p) raw info - * @param p ParticipantProxyData from DATA msg deserialization - * @param writer_guid GUID of originating writer - * @return new ParticipantProxyData * or nullptr on failure - */ - ParticipantProxyData* createParticipantProxyData( - const ParticipantProxyData& p, - const GUID_t& writer_guid) override; - - /** - * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic - * @return true if EDP endpoinst must be match - */ - bool updateInfoMatchesEDP() override; - - /** - * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. - * @param new_change If true a new change (with new seqNum) is created and sent; if false the last change is re-sent - * @param dispose Sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED - * @param[in, out] wparams allows to identify the change - */ - void announceParticipantState( - bool new_change, - bool dispose, - WriteParams& wparams) override; - - /** - * \c announceParticipantState method without optional output parameter \c wparams . - */ - void announceParticipantState( - bool new_change, - bool dispose = false) override; - - /** - * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls - * the corresponding methods in EDP and WLP. - * @param pdata Pointer to the ParticipantProxyData object. - */ - void assignRemoteEndpoints( - ParticipantProxyData* pdata) override; - - /** - * Remove remote endpoints from the participant discovery protocol - * @param pdata Pointer to the ParticipantProxyData to remove - */ - void removeRemoteEndpoints( - ParticipantProxyData* pdata) override; - - /** - * Override to match additional endpoints to PDP. Like EDP or WLP. - * @param pdata Pointer to the ParticipantProxyData object. - * @param notify_secure_endpoints Whether to try notifying secure endpoints. - */ - void notifyAboveRemoteEndpoints( - const ParticipantProxyData& pdata, - bool notify_secure_endpoints) override; - - /** - * Activate a new Remote Endpoint that has been statically discovered. - * @param pguid GUID_t of the participant. - * @param userDefinedId User Defined ID. - * @param kind Kind of endpoint. - */ - bool newRemoteEndpointStaticallyDiscovered( - const GUID_t& pguid, - int16_t userDefinedId, - EndpointKind_t kind); - - void update_builtin_locators() override; - -private: - - void initializeParticipantProxyData( - ParticipantProxyData* participant_data) override; - - /** - * Create the SPDP Writer and Reader - * @return True if correct. - */ - bool createPDPEndpoints() override; - - bool create_dcps_participant_endpoints(); - - void match_pdp_remote_endpoints( - const ParticipantProxyData& pdata, - bool notify_secure_endpoints); - - void assign_low_level_remote_endpoints( - const ParticipantProxyData& pdata, - bool notify_secure_endpoints); - -#if HAVE_SECURITY - bool create_dcps_participant_secure_endpoints(); - - bool pairing_remote_writer_with_local_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data) override; - - bool pairing_remote_reader_with_local_writer_after_security( - const GUID_t& local_reader, - const ReaderProxyData& remote_reader_data) override; -#endif // HAVE_SECURITY - -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif //_FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/include/fastdds/rtps/builtin/liveliness/WLP.h b/include/fastdds/rtps/builtin/liveliness/WLP.h deleted file mode 100644 index a143bec57ba..00000000000 --- a/include/fastdds/rtps/builtin/liveliness/WLP.h +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file WLP.h - * - */ - -#ifndef _FASTDDS_RTPS_WLP_H_ -#define _FASTDDS_RTPS_WLP_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class BuiltinProtocols; -class LivelinessManager; -class ReaderHistory; -class ReaderProxyData; -class RTPSParticipantImpl; -class RTPSReader; -class RTPSWriter; -class StatefulReader; -class StatefulWriter; -class ParticipantProxyData; -class TimedEvent; -class WLPListener; -class WriterHistory; -class WriterProxyData; -class ITopicPayloadPool; - -/** - * Class WLP that implements the Writer Liveliness Protocol described in the RTPS specification. - * @ingroup LIVELINESS_MODULE - */ -class WLP -{ - friend class WLPListener; - friend class StatefulReader; - friend class StatelessReader; - -public: - - /** - * Constructor - * @param prot Pointer to the BuiltinProtocols object. - */ - WLP( - BuiltinProtocols* prot); - virtual ~WLP(); - /** - * Initialize the WLP protocol. - * @param p Pointer to the RTPS participant implementation. - * @return true if the initialziacion was successful. - */ - bool initWL( - RTPSParticipantImpl* p); - /** - * Assign the remote endpoints for a newly discovered RTPSParticipant. - * @param pdata Pointer to the RTPSParticipantProxyData object. - * @param assign_secure_endpoints Whether to try assigning secure endpoints. - * @return True if correct. - */ - bool assignRemoteEndpoints( - const ParticipantProxyData& pdata, - bool assign_secure_endpoints); - /** - * Remove remote endpoints from the liveliness protocol. - * @param pdata Pointer to the ParticipantProxyData to remove - */ - void removeRemoteEndpoints( - ParticipantProxyData* pdata); - /** - * Add a local writer to the liveliness protocol. - * @param W Pointer to the RTPSWriter. - * @param wqos Quality of service policies for the writer. - * @return True if correct. - */ - bool add_local_writer( - RTPSWriter* W, - const WriterQos& wqos); - /** - * Remove a local writer from the liveliness protocol. - * @param W Pointer to the RTPSWriter. - * @return True if removed. - */ - bool remove_local_writer( - RTPSWriter* W); - - /** - * @brief Adds a local reader to the liveliness protocol - * @param reader Pointer to the RTPS reader - * @param rqos Quality of service policies for the reader - * @return True if added successfully - */ - bool add_local_reader( - RTPSReader* reader, - const ReaderQos& rqos); - - /** - * @brief Removes a local reader from the livliness protocol - * @param reader Pointer to the reader to remove - * @return True if removed successfully - */ - bool remove_local_reader( - RTPSReader* reader); - - /** - * @brief A method to assert liveliness of a given writer - * @param writer The writer, specified via its id - * @param kind The writer liveliness kind - * @param lease_duration The writer lease duration - * @return True if liveliness was asserted - */ - bool assert_liveliness( - GUID_t writer, - LivelinessQosPolicyKind kind, - Duration_t lease_duration); - - /** - * @brief A method to assert liveliness of MANUAL_BY_PARTICIPANT writers - * @return True if there were any MANUAL_BY_PARTICIPANT writers - */ - bool assert_liveliness_manual_by_participant(); - - /** - * Get the livelines builtin writer - * @return stateful writer - */ - StatefulWriter* builtin_writer(); - - /** - * Get the livelines builtin writer's history - * @return writer history - */ - WriterHistory* builtin_writer_history(); - -#if HAVE_SECURITY - bool pairing_remote_reader_with_local_writer_after_security( - const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data); - - bool pairing_remote_writer_with_local_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data); -#endif // if HAVE_SECURITY - -private: - - /** - * Create the endpoints used in the WLP. - * @return true if correct. - */ - bool createEndpoints(); - - //! Minimum time among liveliness periods of automatic writers, in milliseconds - double min_automatic_ms_; - //! Minimum time among liveliness periods of manual by participant writers, in milliseconds - double min_manual_by_participant_ms_; - //!Pointer to the local RTPSParticipant. - RTPSParticipantImpl* mp_participant; - //!Pointer to the builtinprotocol class. - BuiltinProtocols* mp_builtinProtocols; - //!Pointer to the builtinRTPSParticipantMEssageWriter. - StatefulWriter* mp_builtinWriter; - //!Pointer to the builtinRTPSParticipantMEssageReader. - StatefulReader* mp_builtinReader; - //!Writer History - WriterHistory* mp_builtinWriterHistory; - //!Reader History - ReaderHistory* mp_builtinReaderHistory; - //!Listener object. - WLPListener* mp_listener; - //!Pointer to the periodic assertion timer object for automatic liveliness writers - TimedEvent* automatic_liveliness_assertion_; - //!Pointer to the periodic assertion timer object for manual by participant liveliness writers - TimedEvent* manual_liveliness_assertion_; - //! List of the writers using automatic liveliness. - std::vector automatic_writers_; - //! List of the writers using manual by participant liveliness. - std::vector manual_by_participant_writers_; - //! List of writers using manual by topic liveliness - std::vector manual_by_topic_writers_; - - //! List of readers - std::vector readers_; - //! A boolean indicating that there is at least one reader requesting automatic liveliness - bool automatic_readers_; - - //! A class used by writers in this participant to keep track of their liveliness - LivelinessManager* pub_liveliness_manager_; - //! A class used by readers in this participant to keep track of liveliness of matched writers - LivelinessManager* sub_liveliness_manager_; - - InstanceHandle_t automatic_instance_handle_; - InstanceHandle_t manual_by_participant_instance_handle_; - - /** - * @brief A method invoked by pub_liveliness_manager_ to inform that a writer changed its liveliness - * @param writer The writer losing liveliness - * @param kind The liveliness kind - * @param lease_duration The liveliness lease duration - * @param alive_change The change in the alive count - * @param not_alive_change The change in the not alive count - */ - void pub_liveliness_changed( - const GUID_t& writer, - const LivelinessQosPolicyKind& kind, - const Duration_t& lease_duration, - int32_t alive_change, - int32_t not_alive_change); - - /** - * @brief A method invoked by sub_liveliness_manager_ to inform that a writer changed its liveliness - * @param writer The writer losing liveliness - * @param kind The liveliness kind of the writer losing liveliness - * @param lease_duration The liveliness lease duration of the writer losing liveliness - * @param alive_change The change in the alive count - * @param not_alive_change The change in the not alive count - */ - void sub_liveliness_changed( - const GUID_t& writer, - const LivelinessQosPolicyKind& kind, - const Duration_t& lease_duration, - int32_t alive_change, - int32_t not_alive_change); - - /** - * @brief A method to update the liveliness changed status of a given reader - * @param writer The writer changing liveliness, specified by its guid - * @param reader The reader whose liveliness needs to be updated - * @param alive_change The change requested for alive count. Should be -1, 0 or +1 - * @param not_alive_change The change requested for not alive count. Should be -1, 0 or +1 - */ - void update_liveliness_changed_status( - GUID_t writer, - RTPSReader* reader, - int32_t alive_change, - int32_t not_alive_change); - - /** - * Implements the automatic liveliness timed event - */ - bool automatic_liveliness_assertion(); - - /** - * Implements the manual by participant liveliness timed event - */ - bool participant_liveliness_assertion(); - - /** - * Adds a cache change to the WLP writer - * @param instance key of the change to add - * @return true if change is correctly added - */ - bool send_liveliness_message( - const InstanceHandle_t& instance); - -#if HAVE_SECURITY - //!Pointer to the builtinRTPSParticipantMEssageWriter. - StatefulWriter* mp_builtinWriterSecure; - //!Pointer to the builtinRTPSParticipantMEssageReader. - StatefulReader* mp_builtinReaderSecure; - //!Writer History - WriterHistory* mp_builtinWriterSecureHistory; - //!Reader History - ReaderHistory* mp_builtinReaderSecureHistory; - - /** - * Create the secure endpoitns used in the WLP. - * @return true if correct. - */ - bool createSecureEndpoints(); -#endif // if HAVE_SECURITY - - std::mutex temp_data_lock_; - ReaderProxyData temp_reader_proxy_data_; - WriterProxyData temp_writer_proxy_data_; - - std::shared_ptr payload_pool_; -#if HAVE_SECURITY - std::shared_ptr secure_payload_pool_; -#endif // if HAVE_SECURITY -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_WLP_H_ */ diff --git a/include/fastdds/rtps/builtin/liveliness/WLPListener.h b/include/fastdds/rtps/builtin/liveliness/WLPListener.h deleted file mode 100644 index 825fe431933..00000000000 --- a/include/fastdds/rtps/builtin/liveliness/WLPListener.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file WLPListener.h - * - */ - -#ifndef _FASTDDS_RTPS_WLPLISTENER_H_ -#define _FASTDDS_RTPS_WLPLISTENER_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class WLP; -class RTPSReader; -struct CacheChange_t; - -/** - * Class WLPListener that receives the liveliness messages asserting the liveliness of remote endpoints. - * @ingroup LIVELINESS_MODULE - */ -class WLPListener : public ReaderListener -{ -public: - - /** - * @brief Constructor - * @param pwlp Pointer to the writer liveliness protocol - */ - WLPListener( - WLP* pwlp); - - /** - * @brief Destructor - */ - virtual ~WLPListener(); - - /** - * @brief Method call when this class is notified of a new cache change - * @param reader The reader receiving the cache change - * @param change The cache change - */ - void onNewCacheChangeAdded( - RTPSReader* reader, - const CacheChange_t* const change) override; - -private: - - /** - * Separate the Key between the GuidPrefix_t and the liveliness Kind - * @param key InstanceHandle_t to separate. - * @param guidP GuidPrefix_t pointer to store the info. - * @param liveliness Liveliness Kind Pointer. - * @return True if correctly separated. - */ - bool separateKey( - InstanceHandle_t& key, - GuidPrefix_t* guidP, - LivelinessQosPolicyKind* liveliness); - - /** - * Compute the key from a CacheChange_t - * @param change - */ - bool computeKey( - CacheChange_t* change); - - /** - * @brief Check that the ParticipantMessageData kind is a valid one for WLP and extract the liveliness kind. - * - * @param[in] serialized_kind A pointer to the first octet of the kind array. The function assumes 4 elements - * in the array. - * @param[out] liveliness_kind A reference to the LivelinessQosPolicyKind. - * - * @return True if the kind corresponds with one for WLP, false otherwise. - */ - bool get_wlp_kind( - const octet* serialized_kind, - LivelinessQosPolicyKind& liveliness_kind); - - //! A pointer to the writer liveliness protocol - WLP* mp_WLP; - -}; - -} /* namespace rtps */ -} /* namespace eprosima */ -} // namespace eprosima -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_WLPLISTENER_H_ */ diff --git a/include/fastdds/rtps/common/CDRMessage_t.h b/include/fastdds/rtps/common/CDRMessage_t.h index 567f4e314bd..d5e6e1f934a 100644 --- a/include/fastdds/rtps/common/CDRMessage_t.h +++ b/include/fastdds/rtps/common/CDRMessage_t.h @@ -47,7 +47,7 @@ namespace rtps { * @brief Structure CDRMessage_t, contains a serialized message. * @ingroup COMMON_MODULE */ -struct RTPS_DllAPI CDRMessage_t final +struct FASTDDS_EXPORTED_API CDRMessage_t final { // TODO(Miguel C): Deprecate when not used in mocks CDRMessage_t() diff --git a/include/fastdds/rtps/common/CacheChange.h b/include/fastdds/rtps/common/CacheChange.h index 3c0d30d19f7..cb88c738d38 100644 --- a/include/fastdds/rtps/common/CacheChange.h +++ b/include/fastdds/rtps/common/CacheChange.h @@ -72,7 +72,7 @@ struct CacheChangeReaderInfo_t * Structure CacheChange_t, contains information on a specific CacheChange. * @ingroup COMMON_MODULE */ -struct RTPS_DllAPI CacheChange_t +struct FASTDDS_EXPORTED_API CacheChange_t { //!Kind of change, default value ALIVE. ChangeKind_t kind = ALIVE; diff --git a/include/fastdds/rtps/common/CdrSerialization.hpp b/include/fastdds/rtps/common/CdrSerialization.hpp index 33f30ec5699..0547a46f6d8 100644 --- a/include/fastdds/rtps/common/CdrSerialization.hpp +++ b/include/fastdds/rtps/common/CdrSerialization.hpp @@ -24,7 +24,7 @@ #if FASTCDR_VERSION_MAJOR == 1 #include -#include +#include namespace eprosima { namespace fastcdr { @@ -74,7 +74,7 @@ class CdrSizeCalculator }; template -using fixed_string = eprosima::fastrtps::fixed_string; +using fastcdr::fixed_string = eprosima::fastcdr::fixed_string; } // namespace fastcdr } // namespace eprosima diff --git a/include/fastdds/rtps/common/ChangeKind_t.hpp b/include/fastdds/rtps/common/ChangeKind_t.hpp index 5ffbceb385b..69a500eeb04 100644 --- a/include/fastdds/rtps/common/ChangeKind_t.hpp +++ b/include/fastdds/rtps/common/ChangeKind_t.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_COMMON_CHANGEKINDT_HPP_ #define _FASTDDS_RTPS_COMMON_CHANGEKINDT_HPP_ -#include +#include namespace eprosima { namespace fastrtps { @@ -29,7 +29,7 @@ namespace rtps { * @enum ChangeKind_t, different types of CacheChange_t. * @ingroup COMMON_MODULE */ -enum RTPS_DllAPI ChangeKind_t +enum FASTDDS_EXPORTED_API ChangeKind_t { ALIVE, //!< ALIVE NOT_ALIVE_DISPOSED, //!< NOT_ALIVE_DISPOSED diff --git a/include/fastdds/rtps/common/EntityId_t.hpp b/include/fastdds/rtps/common/EntityId_t.hpp index 5a2a5754a68..fbbc675bdde 100644 --- a/include/fastdds/rtps/common/EntityId_t.hpp +++ b/include/fastdds/rtps/common/EntityId_t.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_COMMON_ENTITYID_T_HPP_ #define _FASTDDS_RTPS_COMMON_ENTITYID_T_HPP_ -#include +#include #include #include @@ -73,7 +73,7 @@ namespace rtps { //!@brief Structure EntityId_t, entity id part of GUID_t. //!@ingroup COMMON_MODULE -struct RTPS_DllAPI EntityId_t +struct FASTDDS_EXPORTED_API EntityId_t { static constexpr unsigned int size = 4; octet value[size]; diff --git a/include/fastdds/rtps/common/FragmentNumber.h b/include/fastdds/rtps/common/FragmentNumber.h index a1b5d1dcef0..99a90caf5f4 100644 --- a/include/fastdds/rtps/common/FragmentNumber.h +++ b/include/fastdds/rtps/common/FragmentNumber.h @@ -19,17 +19,17 @@ #ifndef _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_ #define _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_ -#include -#include +#include #include +#include #include #include #include -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ +namespace eprosima { +namespace fastrtps { +namespace rtps { using FragmentNumber_t = uint32_t; @@ -37,19 +37,21 @@ using FragmentNumber_t = uint32_t; //!@ingroup COMMON_MODULE using FragmentNumberSet_t = BitmapRange; -inline std::ostream& operator<<(std::ostream& output, const FragmentNumberSet_t& fns) +inline std::ostream& operator <<( + std::ostream& output, + const FragmentNumberSet_t& fns) { output << fns.base() << ":"; fns.for_each([&](FragmentNumber_t it) - { - output << it << "-"; - }); + { + output << it << "-"; + }); return output; } -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif /* _FASTDDS_RTPS_RPTS_ELEM_FRAGNUM_H_ */ diff --git a/include/fastdds/rtps/common/Guid.h b/include/fastdds/rtps/common/Guid.h index b82caac24bc..985466ae1d3 100644 --- a/include/fastdds/rtps/common/Guid.h +++ b/include/fastdds/rtps/common/Guid.h @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_RTPS_GUID_H_ #define _FASTDDS_RTPS_RTPS_GUID_H_ -#include +#include #include #include #include @@ -36,7 +36,7 @@ struct InstanceHandle_t; //!@brief Structure GUID_t, entity identifier, unique in DDS-RTPS Domain. //!@ingroup COMMON_MODULE -struct RTPS_DllAPI GUID_t +struct FASTDDS_EXPORTED_API GUID_t { //!Guid prefix GuidPrefix_t guidPrefix; diff --git a/include/fastdds/rtps/common/GuidPrefix_t.hpp b/include/fastdds/rtps/common/GuidPrefix_t.hpp index b7a0be73d4e..2174a0c5585 100644 --- a/include/fastdds/rtps/common/GuidPrefix_t.hpp +++ b/include/fastdds/rtps/common/GuidPrefix_t.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_COMMON_GUIDPREFIX_T_HPP_ #define _FASTDDS_RTPS_COMMON_GUIDPREFIX_T_HPP_ -#include +#include #include #include @@ -33,7 +33,7 @@ namespace rtps { //!@brief Structure GuidPrefix_t, Guid Prefix of GUID_t. //!@ingroup COMMON_MODULE -struct RTPS_DllAPI GuidPrefix_t +struct FASTDDS_EXPORTED_API GuidPrefix_t { static constexpr unsigned int size = 12; octet value[size]; diff --git a/include/fastdds/rtps/common/InstanceHandle.h b/include/fastdds/rtps/common/InstanceHandle.h index c7dfab81880..0697af118e3 100644 --- a/include/fastdds/rtps/common/InstanceHandle.h +++ b/include/fastdds/rtps/common/InstanceHandle.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -31,7 +31,7 @@ namespace rtps { using KeyHash_t = std::array; -struct RTPS_DllAPI InstanceHandleValue_t +struct FASTDDS_EXPORTED_API InstanceHandleValue_t { /** * Write access indexing operator. @@ -148,7 +148,7 @@ struct RTPS_DllAPI InstanceHandleValue_t * Struct InstanceHandle_t, used to contain the key for WITH_KEY topics. * @ingroup COMMON_MODULE */ -struct RTPS_DllAPI InstanceHandle_t +struct FASTDDS_EXPORTED_API InstanceHandle_t { //!Value InstanceHandleValue_t value; diff --git a/include/fastdds/rtps/common/Locator.h b/include/fastdds/rtps/common/Locator.h index 3b670d5e797..f19a558f83d 100644 --- a/include/fastdds/rtps/common/Locator.h +++ b/include/fastdds/rtps/common/Locator.h @@ -19,10 +19,10 @@ #ifndef _FASTDDS_RTPS_ELEM_LOCATOR_H_ #define _FASTDDS_RTPS_ELEM_LOCATOR_H_ -#include +#include #include -#include +#include #include @@ -68,7 +68,7 @@ namespace rtps { * For example, an address + port combination in the case of UDP. * @ingroup COMMON_MODULE */ -class RTPS_DllAPI Locator_t +class FASTDDS_EXPORTED_API Locator_t { public: @@ -523,19 +523,4 @@ using Locator = eprosima::fastrtps::rtps::Locator_t; } // namespace fastdds } // namespace eprosima -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -using LocatorsIterator = eprosima::fastdds::rtps::LocatorsIterator; -using Locators = eprosima::fastdds::rtps::Locators; -using LocatorList_t = eprosima::fastdds::rtps::LocatorList; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - #endif /* _FASTDDS_RTPS_ELEM_LOCATOR_H_ */ diff --git a/include/fastdds/rtps/common/LocatorList.hpp b/include/fastdds/rtps/common/LocatorList.hpp index 9801fb9426d..ce28a0c04fe 100644 --- a/include/fastdds/rtps/common/LocatorList.hpp +++ b/include/fastdds/rtps/common/LocatorList.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_COMMON_LOCATORLIST_HPP_ #define _FASTDDS_RTPS_COMMON_LOCATORLIST_HPP_ -#include +#include #include #include @@ -99,31 +99,31 @@ class LocatorList using value_type = typename std::vector::value_type; /// Constructor - RTPS_DllAPI LocatorList() + FASTDDS_EXPORTED_API LocatorList() { } /// Destructor - RTPS_DllAPI ~LocatorList() + FASTDDS_EXPORTED_API ~LocatorList() { } /// Copy constructor - RTPS_DllAPI LocatorList( + FASTDDS_EXPORTED_API LocatorList( const LocatorList& list) : m_locators(list.m_locators) { } /// Move constructor - RTPS_DllAPI LocatorList( + FASTDDS_EXPORTED_API LocatorList( LocatorList&& list) : m_locators(std::move(list.m_locators)) { } /// Copy assignment - RTPS_DllAPI LocatorList& operator =( + FASTDDS_EXPORTED_API LocatorList& operator =( const LocatorList& list) { m_locators = list.m_locators; @@ -131,7 +131,7 @@ class LocatorList } /// Move assignment - RTPS_DllAPI LocatorList& operator =( + FASTDDS_EXPORTED_API LocatorList& operator =( LocatorList&& list) { m_locators = std::move(list.m_locators); @@ -139,7 +139,7 @@ class LocatorList } /// Equal to operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const LocatorList& locator_list) const { if (locator_list.m_locators.size() == m_locators.size()) @@ -171,7 +171,7 @@ class LocatorList * * @return LocatorListIterator iterator to the first locator. */ - RTPS_DllAPI LocatorListIterator begin() + FASTDDS_EXPORTED_API LocatorListIterator begin() { return m_locators.begin(); } @@ -181,7 +181,7 @@ class LocatorList * * @return LocatorListIterator iterator to the element following the last element. */ - RTPS_DllAPI LocatorListIterator end() + FASTDDS_EXPORTED_API LocatorListIterator end() { return m_locators.end(); } @@ -191,7 +191,7 @@ class LocatorList * * @return LocatorListConstIterator iterator to the first locator. */ - RTPS_DllAPI LocatorListConstIterator begin() const + FASTDDS_EXPORTED_API LocatorListConstIterator begin() const { return m_locators.begin(); } @@ -201,7 +201,7 @@ class LocatorList * * @return LocatorListConstIterator iterator to the element following the last element. */ - RTPS_DllAPI LocatorListConstIterator end() const + FASTDDS_EXPORTED_API LocatorListConstIterator end() const { return m_locators.end(); } @@ -211,7 +211,7 @@ class LocatorList * * @return size_t The number of locators in the container. */ - RTPS_DllAPI size_t size() const + FASTDDS_EXPORTED_API size_t size() const { return m_locators.size(); } @@ -222,7 +222,7 @@ class LocatorList * @param list New content to be saved into the container. * @return LocatorList& reference to the container with the replaced content. */ - RTPS_DllAPI LocatorList& assign( + FASTDDS_EXPORTED_API LocatorList& assign( const LocatorList& list) { if (!(*this == list)) @@ -235,7 +235,7 @@ class LocatorList /** * @brief Erase all locators from the container. */ - RTPS_DllAPI void clear() + FASTDDS_EXPORTED_API void clear() { return m_locators.clear(); } @@ -245,7 +245,7 @@ class LocatorList * * @param num new capacity of the vector, in number of elements. */ - RTPS_DllAPI void reserve( + FASTDDS_EXPORTED_API void reserve( size_t num) { return m_locators.reserve(num); @@ -258,7 +258,7 @@ class LocatorList * * @param num new size of the container. */ - RTPS_DllAPI void resize( + FASTDDS_EXPORTED_API void resize( size_t num) { return m_locators.resize(num); @@ -269,7 +269,7 @@ class LocatorList * * @param loc locator to be appended. */ - RTPS_DllAPI void push_back( + FASTDDS_EXPORTED_API void push_back( const Locator& loc) { bool already = false; @@ -292,7 +292,7 @@ class LocatorList * * @param locList LocatorList with the locators to be appended. */ - RTPS_DllAPI void push_back( + FASTDDS_EXPORTED_API void push_back( const LocatorList& locList) { for (auto it = locList.m_locators.begin(); it != locList.m_locators.end(); ++it) @@ -306,7 +306,7 @@ class LocatorList * * @return true if the container is empty. False otherwise. */ - RTPS_DllAPI bool empty() const + FASTDDS_EXPORTED_API bool empty() const { return m_locators.empty(); } @@ -316,7 +316,7 @@ class LocatorList * * @param loc Locator to be removed. */ - RTPS_DllAPI void erase( + FASTDDS_EXPORTED_API void erase( const Locator& loc) { auto it = std::find(m_locators.begin(), m_locators.end(), loc); @@ -326,38 +326,12 @@ class LocatorList } } - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::rtps::LocatorList::contains(const Locator&)", - "Unused method.") - RTPS_DllAPI bool contains( - const Locator& loc) - { - for (LocatorListIterator it = this->begin(); it != this->end(); ++it) - { - if (IsAddressDefined(*it)) - { - if (loc == *it) - { - return true; - } - } - else - { - if (loc.kind == (*it).kind && loc.port == (*it).port) - { - return true; - } - } - } - - return false; - } - /** * @brief Check that every locator contained in the list is not LOCATOR_KIND_INVALID. * * @return true if all locators are valid. False otherwise. */ - RTPS_DllAPI bool isValid() const + FASTDDS_EXPORTED_API bool isValid() const { for (LocatorListConstIterator it = this->begin(); it != this->end(); ++it) { @@ -374,7 +348,7 @@ class LocatorList * * @param locatorList container to exchange the contents with. */ - RTPS_DllAPI void swap( + FASTDDS_EXPORTED_API void swap( LocatorList& locatorList) { this->m_locators.swap(locatorList.m_locators); @@ -484,6 +458,15 @@ inline std::istream& operator >>( } // namespace rtps } // namespace fastdds + +namespace fastrtps { +namespace rtps { + +using Locators = eprosima::fastdds::rtps::Locators; +using LocatorList_t = eprosima::fastdds::rtps::LocatorList; + +} // namespace rtps +} // namespace fastrtps } // namespace eprosima #endif /* _FASTDDS_RTPS_COMMON_LOCATORLIST_HPP_ */ diff --git a/include/fastdds/rtps/common/LocatorListComparisons.hpp b/include/fastdds/rtps/common/LocatorListComparisons.hpp index baf0456d83f..59591c3400d 100644 --- a/include/fastdds/rtps/common/LocatorListComparisons.hpp +++ b/include/fastdds/rtps/common/LocatorListComparisons.hpp @@ -20,7 +20,7 @@ #define _FASTDDS_RTPS_COMMON_LOCATORLISTCOMPARISONS_HPP_ #include -#include +#include #include namespace eprosima { diff --git a/include/fastdds/rtps/common/LocatorSelector.hpp b/include/fastdds/rtps/common/LocatorSelector.hpp index 399d104d3cc..0ed3418e9bd 100644 --- a/include/fastdds/rtps/common/LocatorSelector.hpp +++ b/include/fastdds/rtps/common/LocatorSelector.hpp @@ -22,8 +22,9 @@ #include #include #include -#include -#include +#include +#include +#include #include diff --git a/include/fastdds/rtps/common/LocatorSelectorEntry.hpp b/include/fastdds/rtps/common/LocatorSelectorEntry.hpp index 75c59df0458..b2b209d6cec 100644 --- a/include/fastdds/rtps/common/LocatorSelectorEntry.hpp +++ b/include/fastdds/rtps/common/LocatorSelectorEntry.hpp @@ -23,7 +23,8 @@ #include #include -#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/common/LocatorWithMask.hpp b/include/fastdds/rtps/common/LocatorWithMask.hpp index cc311c9b7a3..acba981f778 100644 --- a/include/fastdds/rtps/common/LocatorWithMask.hpp +++ b/include/fastdds/rtps/common/LocatorWithMask.hpp @@ -21,8 +21,7 @@ #include -#include - +#include #include namespace eprosima { @@ -32,7 +31,7 @@ namespace rtps { /** * A Locator with a mask that defines the number of significant bits of its address. */ -class RTPS_DllAPI LocatorWithMask : public Locator +class FASTDDS_EXPORTED_API LocatorWithMask : public Locator { public: @@ -70,7 +69,7 @@ class RTPS_DllAPI LocatorWithMask : public Locator uint8_t mask_ = 24; }; -RTPS_DllAPI std::ostream& operator <<( +FASTDDS_EXPORTED_API std::ostream& operator <<( std::ostream& output, const LocatorWithMask& loc); diff --git a/include/fastdds/rtps/common/LocatorsIterator.hpp b/include/fastdds/rtps/common/LocatorsIterator.hpp index b9480237f49..3d880e8db7b 100644 --- a/include/fastdds/rtps/common/LocatorsIterator.hpp +++ b/include/fastdds/rtps/common/LocatorsIterator.hpp @@ -65,6 +65,14 @@ struct LocatorsIterator } // namespace rtps } // namespace fastdds + +namespace fastrtps { +namespace rtps { + +using LocatorsIterator = eprosima::fastdds::rtps::LocatorsIterator; + +} // namespace rtps +} // namespace fastrtps } // namespace eprosima #endif /* _FASTDDS_RTPS_COMMON_LOCATORSITERATOR_HPP_ */ diff --git a/include/fastdds/rtps/common/MatchingInfo.h b/include/fastdds/rtps/common/MatchingInfo.h index f572b44f2b6..50025f870f9 100644 --- a/include/fastdds/rtps/common/MatchingInfo.h +++ b/include/fastdds/rtps/common/MatchingInfo.h @@ -22,9 +22,9 @@ #include -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ +namespace eprosima { +namespace fastrtps { +namespace rtps { /** * @enum MatchingStatus, indicates whether the matched publication/subscription method of the PublisherListener or SubscriberListener has @@ -32,10 +32,12 @@ namespace rtps{ * @ingroup COMMON_MODULE */ #if defined(_WIN32) - enum RTPS_DllAPI MatchingStatus{ +enum FASTDDS_EXPORTED_API MatchingStatus +{ #else - enum MatchingStatus{ -#endif +enum MatchingStatus +{ +#endif // if defined(_WIN32) MATCHED_MATCHING,//!< MATCHED_MATCHING, new publisher/subscriber found REMOVED_MATCHING //!< REMOVED_MATCHING, publisher/subscriber removed @@ -45,24 +47,39 @@ namespace rtps{ * Class MatchingInfo contains information about the matching between two endpoints. * @ingroup COMMON_MODULE */ -class RTPS_DllAPI MatchingInfo +class FASTDDS_EXPORTED_API MatchingInfo { public: + //!Default constructor - MatchingInfo():status(MATCHED_MATCHING){}; + MatchingInfo() + : status(MATCHED_MATCHING) + { + } + /** - * @param stat Status - * @param guid GUID - */ - MatchingInfo(MatchingStatus stat,const GUID_t&guid):status(stat),remoteEndpointGuid(guid){}; - ~MatchingInfo(){}; + * @param stat Status + * @param guid GUID + */ + MatchingInfo( + MatchingStatus stat, + const GUID_t& guid) + : status(stat) + , remoteEndpointGuid(guid) + { + } + + ~MatchingInfo() + { + } + //!Status MatchingStatus status; //!Remote endpoint GUID GUID_t remoteEndpointGuid; }; -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif /* _FASTDDS_RTPS_MATCHINGINFO_H_ */ diff --git a/include/fastdds/rtps/common/RemoteLocators.hpp b/include/fastdds/rtps/common/RemoteLocators.hpp index ea8d9c1c47f..8ef8eeb0058 100644 --- a/include/fastdds/rtps/common/RemoteLocators.hpp +++ b/include/fastdds/rtps/common/RemoteLocators.hpp @@ -20,7 +20,7 @@ #define _FASTDDS_RTPS_COMMON_REMOTELOCATORS_HPP_ #include -#include +#include #include namespace eprosima { diff --git a/include/fastdds/rtps/common/SampleIdentity.h b/include/fastdds/rtps/common/SampleIdentity.h index 2eb763cf187..d5657dcb8b5 100644 --- a/include/fastdds/rtps/common/SampleIdentity.h +++ b/include/fastdds/rtps/common/SampleIdentity.h @@ -30,7 +30,7 @@ namespace rtps { * @brief This class is used to specify a sample * @ingroup COMMON_MODULE */ -class RTPS_DllAPI SampleIdentity +class FASTDDS_EXPORTED_API SampleIdentity { public: diff --git a/include/fastdds/rtps/common/SequenceNumber.h b/include/fastdds/rtps/common/SequenceNumber.h index 90f737a1a56..a529ea0368d 100644 --- a/include/fastdds/rtps/common/SequenceNumber.h +++ b/include/fastdds/rtps/common/SequenceNumber.h @@ -24,9 +24,9 @@ #include #include -#include -#include +#include #include +#include namespace eprosima { namespace fastrtps { @@ -35,7 +35,7 @@ namespace rtps { //!@brief Structure SequenceNumber_t, different for each change in the same writer. //!@ingroup COMMON_MODULE -struct RTPS_DllAPI SequenceNumber_t +struct FASTDDS_EXPORTED_API SequenceNumber_t { //! int32_t high = 0; diff --git a/include/fastdds/rtps/common/SerializedPayload.h b/include/fastdds/rtps/common/SerializedPayload.h index 1125b1318b5..5b9d9e69847 100644 --- a/include/fastdds/rtps/common/SerializedPayload.h +++ b/include/fastdds/rtps/common/SerializedPayload.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include /*! @@ -53,7 +53,7 @@ namespace rtps { //!@brief Structure SerializedPayload_t. //!@ingroup COMMON_MODULE -struct RTPS_DllAPI SerializedPayload_t +struct FASTDDS_EXPORTED_API SerializedPayload_t { //!Size in bytes of the representation header as specified in the RTPS 2.3 specification chapter 10. static constexpr size_t representation_header_size = 4u; diff --git a/include/fastdds/rtps/common/Time_t.h b/include/fastdds/rtps/common/Time_t.h index 16f120fb7bb..24e21f36f29 100644 --- a/include/fastdds/rtps/common/Time_t.h +++ b/include/fastdds/rtps/common/Time_t.h @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_TIME_T_H_ #define _FASTDDS_RTPS_TIME_T_H_ -#include +#include #include #include @@ -32,7 +32,7 @@ namespace fastrtps { * Structure Time_t, used to describe times. * @ingroup COMMON_MODULE */ -struct RTPS_DllAPI Time_t +struct FASTDDS_EXPORTED_API Time_t { static constexpr int32_t INFINITE_SECONDS = 0x7fffffff; static constexpr uint32_t INFINITE_NANOSECONDS = 0xffffffffu; @@ -96,7 +96,7 @@ namespace rtps { * Structure Time_t, used to describe times at RTPS protocol. * @ingroup COMMON_MODULE */ -class RTPS_DllAPI Time_t +class FASTDDS_EXPORTED_API Time_t { public: diff --git a/include/fastdds/rtps/common/Token.h b/include/fastdds/rtps/common/Token.h index c2787378482..3f4bebc7b37 100644 --- a/include/fastdds/rtps/common/Token.h +++ b/include/fastdds/rtps/common/Token.h @@ -18,7 +18,7 @@ #ifndef _FASTDDS_RTPS_COMMON_TOKEN_H_ #define _FASTDDS_RTPS_COMMON_TOKEN_H_ -#include +#include #include #include @@ -28,90 +28,102 @@ namespace rtps { class DataHolder { - public: - - DataHolder() {} - - DataHolder(const DataHolder& data_holder) : - class_id_(data_holder.class_id_), - properties_(data_holder.properties_), - binary_properties_(data_holder.binary_properties_) {} - - DataHolder(DataHolder&& data_holder) : - class_id_(data_holder.class_id_), - properties_(data_holder.properties_), - binary_properties_(data_holder.binary_properties_) {} - - DataHolder& operator=(const DataHolder& data_holder) - { - class_id_ = data_holder.class_id_; - properties_ = data_holder.properties_; - binary_properties_ = data_holder.binary_properties_; - - return *this; - } - - DataHolder& operator=(DataHolder&& data_holder) - { - class_id_ = std::move(data_holder.class_id_); - properties_ = std::move(data_holder.properties_); - binary_properties_ = std::move(data_holder.binary_properties_); - - return *this; - } - - bool is_nil() const - { - return class_id_.empty(); - } - - void class_id(const std::string& class_id) - { - class_id_ = class_id; - } - - void class_id(std::string&& class_id) - { - class_id_ = std::move(class_id); - } - - std::string& class_id() - { - return class_id_; - } - - const std::string& class_id() const - { - return class_id_; - } - - const PropertySeq& properties() const - { - return properties_; - } - - PropertySeq& properties() - { - return properties_; - } - - const BinaryPropertySeq& binary_properties() const - { - return binary_properties_; - } - - BinaryPropertySeq& binary_properties() - { - return binary_properties_; - } - - private: - - std::string class_id_; - - PropertySeq properties_; - - BinaryPropertySeq binary_properties_; +public: + + DataHolder() + { + } + + DataHolder( + const DataHolder& data_holder) + : class_id_(data_holder.class_id_) + , properties_(data_holder.properties_) + , binary_properties_(data_holder.binary_properties_) + { + } + + DataHolder( + DataHolder&& data_holder) + : class_id_(data_holder.class_id_) + , properties_(data_holder.properties_) + , binary_properties_(data_holder.binary_properties_) + { + } + + DataHolder& operator =( + const DataHolder& data_holder) + { + class_id_ = data_holder.class_id_; + properties_ = data_holder.properties_; + binary_properties_ = data_holder.binary_properties_; + + return *this; + } + + DataHolder& operator =( + DataHolder&& data_holder) + { + class_id_ = std::move(data_holder.class_id_); + properties_ = std::move(data_holder.properties_); + binary_properties_ = std::move(data_holder.binary_properties_); + + return *this; + } + + bool is_nil() const + { + return class_id_.empty(); + } + + void class_id( + const std::string& class_id) + { + class_id_ = class_id; + } + + void class_id( + std::string&& class_id) + { + class_id_ = std::move(class_id); + } + + std::string& class_id() + { + return class_id_; + } + + const std::string& class_id() const + { + return class_id_; + } + + const PropertySeq& properties() const + { + return properties_; + } + + PropertySeq& properties() + { + return properties_; + } + + const BinaryPropertySeq& binary_properties() const + { + return binary_properties_; + } + + BinaryPropertySeq& binary_properties() + { + return binary_properties_; + } + +private: + + std::string class_id_; + + PropertySeq properties_; + + BinaryPropertySeq binary_properties_; }; typedef std::vector DataHolderSeq; @@ -124,31 +136,57 @@ typedef Token PermissionsCredentialToken; class DataHolderHelper { - public: +public: - static std::string* find_property_value(DataHolder& data_holder, const std::string& name); + static std::string* find_property_value( + DataHolder& data_holder, + const std::string& name); - static const std::string* find_property_value(const DataHolder& data_holder, const std::string& name); + static const std::string* find_property_value( + const DataHolder& data_holder, + const std::string& name); - static Property* find_property(DataHolder& data_holder, const std::string& name); + static Property* find_property( + DataHolder& data_holder, + const std::string& name); - static const Property* find_property(const DataHolder& data_holder, const std::string& name); + static const Property* find_property( + const DataHolder& data_holder, + const std::string& name); - static std::vector* find_binary_property_value(DataHolder& data_holder, const std::string& name); + static std::vector* find_binary_property_value( + DataHolder& data_holder, + const std::string& name); - static const std::vector* find_binary_property_value(const DataHolder& data_holder, const std::string& name); + static const std::vector* find_binary_property_value( + const DataHolder& data_holder, + const std::string& name); - static BinaryProperty* find_binary_property(DataHolder& data_holder, const std::string& name); + static BinaryProperty* find_binary_property( + DataHolder& data_holder, + const std::string& name); - static const BinaryProperty* find_binary_property(const DataHolder& data_holder, const std::string& name); + static const BinaryProperty* find_binary_property( + const DataHolder& data_holder, + const std::string& name); - static size_t serialized_size(const DataHolder& data_holder, size_t current_alignment = 0); + static size_t serialized_size( + const DataHolder& data_holder, + size_t current_alignment = 0); - static size_t serialized_size(const DataHolderSeq& data_holders, size_t current_alignment = 0); + static size_t serialized_size( + const DataHolderSeq& data_holders, + size_t current_alignment = 0); - private: +private: + + inline static size_t alignment( + size_t current_alignment, + size_t dataSize) + { + return (dataSize - (current_alignment % dataSize)) & (dataSize - 1); + } - inline static size_t alignment(size_t current_alignment, size_t dataSize) { return (dataSize - (current_alignment % dataSize)) & (dataSize-1);} }; } //namespace rtps diff --git a/include/fastdds/rtps/common/Types.h b/include/fastdds/rtps/common/Types.h index 7219bdd77a6..2834d1d7446 100644 --- a/include/fastdds/rtps/common/Types.h +++ b/include/fastdds/rtps/common/Types.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -103,7 +103,7 @@ using Count_t = uint32_t; #define BIT(i) (1U << static_cast(i)) //!@brief Structure ProtocolVersion_t, contains the protocol version. -struct RTPS_DllAPI ProtocolVersion_t +struct FASTDDS_EXPORTED_API ProtocolVersion_t { octet m_major; octet m_minor; @@ -163,7 +163,7 @@ const ProtocolVersion_t c_ProtocolVersion_2_3{2, 3}; const ProtocolVersion_t c_ProtocolVersion; //!@brief Structure VendorId_t, specifying the vendor Id of the implementation. -FASTDDS_TODO_BEFORE(3, 0, "Remove eprosima::fastrtps::rtps::VendorId_t usings"); +// FASTDDS_TODO_BEFORE(3, 0, "Remove eprosima::fastrtps::rtps::VendorId_t usings"); using VendorId_t = eprosima::fastdds::rtps::VendorId_t; using eprosima::fastdds::rtps::c_VendorId_Unknown; using eprosima::fastdds::rtps::c_VendorId_eProsima; diff --git a/include/fastdds/rtps/common/WriteParams.h b/include/fastdds/rtps/common/WriteParams.h index be7d2d66ab0..3214da72a48 100644 --- a/include/fastdds/rtps/common/WriteParams.h +++ b/include/fastdds/rtps/common/WriteParams.h @@ -30,7 +30,7 @@ namespace rtps { * * @ingroup COMMON_MODULE */ -class RTPS_DllAPI WriteParams +class FASTDDS_EXPORTED_API WriteParams { public: diff --git a/include/fastdds/rtps/exceptions/Exception.h b/include/fastdds/rtps/exceptions/Exception.h index db0b6ce1716..81eefd68ed7 100644 --- a/include/fastdds/rtps/exceptions/Exception.h +++ b/include/fastdds/rtps/exceptions/Exception.h @@ -15,7 +15,7 @@ #ifndef _FASTDDS_RTPS_EXCEPTIONS_EXCEPTION_H_ #define _FASTDDS_RTPS_EXCEPTIONS_EXCEPTION_H_ -#include +#include #include #include #include @@ -32,77 +32,87 @@ namespace rtps { */ class Exception : public std::exception { - public: - - RTPS_DllAPI Exception(){}; - - /// @brief Default destructor. - virtual RTPS_DllAPI ~Exception() throw(); - - /** - * @brief This function returns the number associated with the system exception. - * @return The number associated with the system exception. - */ - RTPS_DllAPI const int32_t& minor() const; - - /** - * @brief This function sets the number that will be associated with the system exception. - * @param minor The number that will be associated with the system exception. - */ - RTPS_DllAPI void minor(const int32_t &minor); - - /// @brief This function throws the object as exception. - virtual RTPS_DllAPI void raise() const = 0; - - /** - * @brief This function returns the error message. - * @return The error message. - */ - virtual RTPS_DllAPI const char* what() const throw(); - - protected: - - /** - * @brief Default constructor. - */ - RTPS_DllAPI explicit Exception(const char* const& message); - - /** - * @brief Default copy constructor. - * @param ex Exception that will be copied. - */ - RTPS_DllAPI Exception(const Exception &ex); - - /** - * @brief Default move constructor. - * @param ex Exception that will be moved. - */ - RTPS_DllAPI Exception(Exception&& ex); - - /** - * @brief Constructor. - * @param message An error message. This message is copied. - * @param minor The number that will be associated with the system exception. - */ - RTPS_DllAPI explicit Exception(const char* const& message, const int32_t minor); - - /** - * @brief Assigment operation. - * @param ex Exception that will be copied. - */ - RTPS_DllAPI Exception& operator=(const Exception& ex); - - /** - * @brief Assigment operation. - * @param ex Exception that will be moved. - */ - RTPS_DllAPI Exception& operator=(Exception&& ex); - - private: - - std::string message_; - - int32_t minor_; +public: + + FASTDDS_EXPORTED_API Exception() + { + } + + /// @brief Default destructor. + virtual FASTDDS_EXPORTED_API ~Exception() throw(); + + /** + * @brief This function returns the number associated with the system exception. + * @return The number associated with the system exception. + */ + FASTDDS_EXPORTED_API const int32_t& minor() const; + + /** + * @brief This function sets the number that will be associated with the system exception. + * @param minor The number that will be associated with the system exception. + */ + FASTDDS_EXPORTED_API void minor( + const int32_t& minor); + + /// @brief This function throws the object as exception. + virtual FASTDDS_EXPORTED_API void raise() const = 0; + + /** + * @brief This function returns the error message. + * @return The error message. + */ + virtual FASTDDS_EXPORTED_API const char* what() const throw(); + +protected: + + /** + * @brief Default constructor. + */ + FASTDDS_EXPORTED_API explicit Exception( + const char* const& message); + + /** + * @brief Default copy constructor. + * @param ex Exception that will be copied. + */ + FASTDDS_EXPORTED_API Exception( + const Exception& ex); + + /** + * @brief Default move constructor. + * @param ex Exception that will be moved. + */ + FASTDDS_EXPORTED_API Exception( + Exception&& ex); + + /** + * @brief Constructor. + * @param message An error message. This message is copied. + * @param minor The number that will be associated with the system exception. + */ + FASTDDS_EXPORTED_API explicit Exception( + const char* const& message, + const int32_t minor); + + /** + * @brief Assigment operation. + * @param ex Exception that will be copied. + */ + FASTDDS_EXPORTED_API Exception& operator =( + const Exception& ex); + + /** + * @brief Assigment operation. + * @param ex Exception that will be moved. + */ + FASTDDS_EXPORTED_API Exception& operator =( + Exception&& ex); + +private: + + std::string message_; + + int32_t minor_; }; } // namespace rtps diff --git a/include/fastdds/rtps/flowcontrol/FlowControllerConsts.hpp b/include/fastdds/rtps/flowcontrol/FlowControllerConsts.hpp index 88ceb6cb2eb..37bd42941c0 100644 --- a/include/fastdds/rtps/flowcontrol/FlowControllerConsts.hpp +++ b/include/fastdds/rtps/flowcontrol/FlowControllerConsts.hpp @@ -15,16 +15,16 @@ #ifndef FASTDDS_RTPS_FLOWCONTROL_FLOWCONTROLLERCONSTS_HPP #define FASTDDS_RTPS_FLOWCONTROL_FLOWCONTROLLERCONSTS_HPP -#include +#include namespace eprosima { namespace fastdds { namespace rtps { //! Name of the default flow controller. -extern RTPS_DllAPI const char* const FASTDDS_FLOW_CONTROLLER_DEFAULT; +extern FASTDDS_EXPORTED_API const char* const FASTDDS_FLOW_CONTROLLER_DEFAULT; //! Name of the default flow controller for statistics writers. -extern RTPS_DllAPI const char* const FASTDDS_STATISTICS_FLOW_CONTROLLER_DEFAULT; +extern FASTDDS_EXPORTED_API const char* const FASTDDS_STATISTICS_FLOW_CONTROLLER_DEFAULT; } // namespace rtps } // namespace fastdds diff --git a/include/fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h b/include/fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h index aa51c077026..cc6ddbaa13e 100644 --- a/include/fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h +++ b/include/fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h @@ -15,7 +15,7 @@ #ifndef _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H #define _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H -#include +#include #include namespace eprosima { @@ -35,8 +35,8 @@ struct ThroughputControllerDescriptor //! Window of time in which no more than 'bytesPerPeriod' bytes are allowed. uint32_t periodMillisecs; - RTPS_DllAPI ThroughputControllerDescriptor(); - RTPS_DllAPI ThroughputControllerDescriptor( + FASTDDS_EXPORTED_API ThroughputControllerDescriptor(); + FASTDDS_EXPORTED_API ThroughputControllerDescriptor( uint32_t size, uint32_t time); diff --git a/include/fastdds/rtps/history/History.h b/include/fastdds/rtps/history/History.h index 2270cc8802d..883d9c701bb 100644 --- a/include/fastdds/rtps/history/History.h +++ b/include/fastdds/rtps/history/History.h @@ -20,15 +20,13 @@ #ifndef _FASTDDS_RTPS_HISTORY_H_ #define _FASTDDS_RTPS_HISTORY_H_ -#include - +#include #include #include - #include #include #include -#include +#include #include #include @@ -64,53 +62,11 @@ class History //!Attributes of the History HistoryAttributes m_att; - /** - * Reserve a CacheChange_t from the CacheChange pool. - * @param[out] change Pointer to pointer to the CacheChange_t to reserve - * @param[in] calculateSizeFunc Function to calculate the size of the payload. - * @return True if reserved - * @warning This method has been deprecated and will be removed on v3.0.0 - */ - FASTRTPS_DEPRECATED("Use new_change on RTPSWriter or reserveCache on RTPSReader") - RTPS_DllAPI inline bool reserve_Cache( - CacheChange_t** change, - const std::function& calculateSizeFunc) - { - return do_reserve_cache(change, calculateSizeFunc()); - } - - /** - * Reserve a CacheChange_t from the CacheChange pool. - * @param[out] change Pointer to pointer to the CacheChange_t to reserve - * @param[in] dataSize Required size for the payload. - * @return True if reserved - * @warning This method has been deprecated and will be removed on v3.0.0 - */ - FASTRTPS_DEPRECATED("Use new_change on RTPSWriter or reserveCache on RTPSReader") - RTPS_DllAPI inline bool reserve_Cache( - CacheChange_t** change, - uint32_t dataSize) - { - return do_reserve_cache(change, dataSize); - } - - /** - * release a previously reserved CacheChange_t. - * @param ch Pointer to the CacheChange_t. - * @warning This method has been deprecated and will be removed on v3.0.0 - */ - FASTRTPS_DEPRECATED("Use release_change on RTPSWriter or releaseCache on RTPSReader") - RTPS_DllAPI inline void release_Cache( - CacheChange_t* ch) - { - do_release_cache(ch); - } - /** * Check if the history is full * @return true if the History is full. */ - RTPS_DllAPI bool isFull() + FASTDDS_EXPORTED_API bool isFull() { return m_isHistoryFull; } @@ -119,7 +75,7 @@ class History * Get the History size. * @return Size of the history. */ - RTPS_DllAPI size_t getHistorySize() + FASTDDS_EXPORTED_API size_t getHistorySize() { std::lock_guard guard(*mp_mutex); return m_changes.size(); @@ -131,7 +87,7 @@ class History * @param ch Pointer to the CacheChange_t to search for. * @return an iterator if a suitable change is found */ - RTPS_DllAPI const_iterator find_change_nts( + FASTDDS_EXPORTED_API const_iterator find_change_nts( CacheChange_t* ch); /** @@ -141,7 +97,7 @@ class History * @param release defaults to true and hints if the CacheChange_t should return to the pool * @return iterator to the next CacheChange_t or end iterator. */ - RTPS_DllAPI virtual iterator remove_change_nts( + FASTDDS_EXPORTED_API virtual iterator remove_change_nts( const_iterator removal, bool release = true); @@ -153,7 +109,7 @@ class History * @param release defaults to true and hints if the CacheChange_t should return to the pool * @return iterator to the next CacheChange_t or end iterator. */ - RTPS_DllAPI virtual iterator remove_change_nts( + FASTDDS_EXPORTED_API virtual iterator remove_change_nts( const_iterator removal, const std::chrono::time_point& max_blocking_time, bool release = true); @@ -162,14 +118,14 @@ class History * Remove all changes from the History * @return True if everything was correctly removed. */ - RTPS_DllAPI bool remove_all_changes(); + FASTDDS_EXPORTED_API bool remove_all_changes(); /** * Remove a specific change from the history. * @param ch Pointer to the CacheChange_t. * @return True if removed. */ - RTPS_DllAPI bool remove_change( + FASTDDS_EXPORTED_API bool remove_change( CacheChange_t* ch); /** @@ -178,7 +134,7 @@ class History * @param[in] max_blocking_time Maximum time this method has to complete the task. * @return True if removed. */ - RTPS_DllAPI bool remove_change( + FASTDDS_EXPORTED_API bool remove_change( CacheChange_t* ch, const std::chrono::time_point& max_blocking_time); @@ -187,7 +143,7 @@ class History * @param ch Pointer to the CacheChange_t to search for. * @return an iterator if a suitable change is found */ - RTPS_DllAPI const_iterator find_change( + FASTDDS_EXPORTED_API const_iterator find_change( CacheChange_t* ch) { std::lock_guard guard(*mp_mutex); @@ -201,7 +157,7 @@ class History * @param ch_outer Pointer to the CacheChange_t to identify. * @return true if the iterator identifies this change. */ - RTPS_DllAPI virtual bool matches_change( + FASTDDS_EXPORTED_API virtual bool matches_change( const CacheChange_t* ch_inner, CacheChange_t* ch_outer); @@ -211,7 +167,7 @@ class History * @param release defaults to true and hints if the CacheChange_t should return to the pool * @return iterator to the next CacheChange_t or end iterator. */ - RTPS_DllAPI iterator remove_change( + FASTDDS_EXPORTED_API iterator remove_change( const_iterator removal, bool release = true) { @@ -223,12 +179,12 @@ class History * Get the beginning of the changes history iterator. * @return Iterator to the beginning of the vector. */ - RTPS_DllAPI iterator changesBegin() + FASTDDS_EXPORTED_API iterator changesBegin() { return m_changes.begin(); } - RTPS_DllAPI reverse_iterator changesRbegin() + FASTDDS_EXPORTED_API reverse_iterator changesRbegin() { return m_changes.rbegin(); } @@ -237,12 +193,12 @@ class History * Get the end of the changes history iterator. * @return Iterator to the end of the vector. */ - RTPS_DllAPI iterator changesEnd() + FASTDDS_EXPORTED_API iterator changesEnd() { return m_changes.end(); } - RTPS_DllAPI reverse_iterator changesRend() + FASTDDS_EXPORTED_API reverse_iterator changesRend() { return m_changes.rend(); } @@ -252,7 +208,7 @@ class History * @param min_change Pointer to pointer to the minimum change. * @return True if correct. */ - RTPS_DllAPI bool get_min_change( + FASTDDS_EXPORTED_API bool get_min_change( CacheChange_t** min_change); /** @@ -260,14 +216,14 @@ class History * @param max_change Pointer to pointer to the maximum change. * @return True if correct. */ - RTPS_DllAPI bool get_max_change( + FASTDDS_EXPORTED_API bool get_max_change( CacheChange_t** max_change); /** * Get the maximum serialized payload size * @return Maximum serialized payload size */ - RTPS_DllAPI inline uint32_t getTypeMaxSerialized() + FASTDDS_EXPORTED_API inline uint32_t getTypeMaxSerialized() { return m_att.payloadMaxSize; } @@ -276,13 +232,13 @@ class History * Get the mutex * @return Mutex */ - RTPS_DllAPI inline RecursiveTimedMutex* getMutex() const + FASTDDS_EXPORTED_API inline RecursiveTimedMutex* getMutex() const { assert(mp_mutex != nullptr); return mp_mutex; } - RTPS_DllAPI bool get_change( + FASTDDS_EXPORTED_API bool get_change( const SequenceNumber_t& seq, const GUID_t& guid, CacheChange_t** change) const; @@ -315,11 +271,11 @@ class History //!Print the seqNum of the changes in the History (for debuggisi, mng purposes). void print_changes_seqNum2(); - RTPS_DllAPI virtual bool do_reserve_cache( + FASTDDS_EXPORTED_API virtual bool do_reserve_cache( CacheChange_t** change, uint32_t size) = 0; - RTPS_DllAPI virtual void do_release_cache( + FASTDDS_EXPORTED_API virtual void do_release_cache( CacheChange_t* ch) = 0; /** diff --git a/include/fastdds/rtps/history/ReaderHistory.h b/include/fastdds/rtps/history/ReaderHistory.h index 0625915264f..7ec05496277 100644 --- a/include/fastdds/rtps/history/ReaderHistory.h +++ b/include/fastdds/rtps/history/ReaderHistory.h @@ -49,9 +49,9 @@ class ReaderHistory : public History /** * Constructor of the ReaderHistory. It needs a HistoryAttributes. */ - RTPS_DllAPI ReaderHistory( + FASTDDS_EXPORTED_API ReaderHistory( const HistoryAttributes& att); - RTPS_DllAPI ~ReaderHistory() override; + FASTDDS_EXPORTED_API ~ReaderHistory() override; /** * Check if a new change can be added to this history. @@ -67,7 +67,7 @@ class ReaderHistory : public History * * @return Whether a call to received_change will succeed when called with the same arguments. */ - RTPS_DllAPI virtual bool can_change_be_added_nts( + FASTDDS_EXPORTED_API virtual bool can_change_be_added_nts( const GUID_t& writer_guid, uint32_t total_payload_size, size_t unknown_missing_changes_up_to, @@ -82,7 +82,7 @@ class ReaderHistory : public History * could potentially be received in the future. * @return True if added. */ - RTPS_DllAPI virtual bool received_change( + FASTDDS_EXPORTED_API virtual bool received_change( CacheChange_t* change, size_t unknown_missing_changes_up_to); @@ -96,7 +96,7 @@ class ReaderHistory : public History * @param[out] rejection_reason In case of been rejected the sample, it will contain the reason of the rejection. * @return True if added. */ - RTPS_DllAPI virtual bool received_change( + FASTDDS_EXPORTED_API virtual bool received_change( CacheChange_t* change, size_t unknown_missing_changes_up_to, fastdds::dds::SampleRejectedStatusKind& rejection_reason) @@ -111,7 +111,7 @@ class ReaderHistory : public History * @param[in] change The received change * @return */ - RTPS_DllAPI bool virtual completed_change( + FASTDDS_EXPORTED_API bool virtual completed_change( rtps::CacheChange_t* change) { (void)change; @@ -126,7 +126,7 @@ class ReaderHistory : public History * @param[out] rejection_reason In case of been rejected the sample, it will contain the reason of the rejection. * @return */ - RTPS_DllAPI virtual bool completed_change( + FASTDDS_EXPORTED_API virtual bool completed_change( CacheChange_t* change, size_t unknown_missing_changes_up_to, fastdds::dds::SampleRejectedStatusKind& rejection_reason) @@ -142,7 +142,7 @@ class ReaderHistory : public History * @param a_change Pointer to the CacheChange to add. * @return True if added. */ - RTPS_DllAPI bool add_change( + FASTDDS_EXPORTED_API bool add_change( CacheChange_t* a_change); /** @@ -152,7 +152,7 @@ class ReaderHistory : public History * @param release specifies if the change must be returned to the pool * @return iterator to the next change if any */ - RTPS_DllAPI iterator remove_change_nts( + FASTDDS_EXPORTED_API iterator remove_change_nts( const_iterator removal, bool release = true) override; @@ -164,7 +164,7 @@ class ReaderHistory : public History * @param release specifies if the change must be returned to the pool * @return iterator to the next change if any */ - RTPS_DllAPI iterator remove_change_nts( + FASTDDS_EXPORTED_API iterator remove_change_nts( const_iterator removal, const std::chrono::time_point& max_blocking_time, bool release = true) override; @@ -175,7 +175,7 @@ class ReaderHistory : public History * @param outer change for comparison * @return true if inner matches outer criteria */ - RTPS_DllAPI bool matches_change( + FASTDDS_EXPORTED_API bool matches_change( const CacheChange_t* inner, CacheChange_t* outer) override; @@ -187,7 +187,7 @@ class ReaderHistory : public History * @param a_guid Pointer to the target guid to search for. * @return True if successful, even if no changes have been removed. * */ - RTPS_DllAPI bool remove_changes_with_guid( + FASTDDS_EXPORTED_API bool remove_changes_with_guid( const GUID_t& a_guid); /** @@ -200,7 +200,7 @@ class ReaderHistory : public History const SequenceNumber_t& seq_num, const GUID_t& writer_guid); - RTPS_DllAPI bool get_min_change_from( + FASTDDS_EXPORTED_API bool get_min_change_from( CacheChange_t** min_change, const GUID_t& writerGuid); @@ -213,7 +213,7 @@ class ReaderHistory : public History * @param writer_guid GUID of the writer being unmatched. * @param last_notified_seq Last sequence number from the specified writer that was notified to the user. */ - RTPS_DllAPI virtual void writer_unmatched( + FASTDDS_EXPORTED_API virtual void writer_unmatched( const GUID_t& writer_guid, const SequenceNumber_t& last_notified_seq); @@ -223,7 +223,7 @@ class ReaderHistory : public History * @param[in] writer_guid Guid of the writer which changes its ownership strength. * @param[out] ownership_strength New value of the writer's Ownership strength. */ - RTPS_DllAPI virtual void writer_update_its_ownership_strength_nts( + FASTDDS_EXPORTED_API virtual void writer_update_its_ownership_strength_nts( const GUID_t& writer_guid, const uint32_t ownership_strength) { @@ -233,11 +233,11 @@ class ReaderHistory : public History protected: - RTPS_DllAPI bool do_reserve_cache( + FASTDDS_EXPORTED_API bool do_reserve_cache( CacheChange_t** change, uint32_t size) override; - RTPS_DllAPI void do_release_cache( + FASTDDS_EXPORTED_API void do_release_cache( CacheChange_t* ch) override; template diff --git a/include/fastdds/rtps/history/WriterHistory.h b/include/fastdds/rtps/history/WriterHistory.h index 74423a7f05b..031035fe255 100644 --- a/include/fastdds/rtps/history/WriterHistory.h +++ b/include/fastdds/rtps/history/WriterHistory.h @@ -50,16 +50,16 @@ class WriterHistory : public rtps::History /** * Constructor of the WriterHistory. */ - RTPS_DllAPI WriterHistory( + FASTDDS_EXPORTED_API WriterHistory( const HistoryAttributes& att); - RTPS_DllAPI virtual ~WriterHistory() override; + FASTDDS_EXPORTED_API virtual ~WriterHistory() override; /** * Add a CacheChange_t to the WriterHistory. * @param a_change Pointer to the CacheChange_t to be added. * @return True if added. */ - RTPS_DllAPI bool add_change( + FASTDDS_EXPORTED_API bool add_change( CacheChange_t* a_change); /** @@ -68,7 +68,7 @@ class WriterHistory : public rtps::History * @param wparams Extra write parameters. * @return True if added. */ - RTPS_DllAPI bool add_change( + FASTDDS_EXPORTED_API bool add_change( CacheChange_t* a_change, WriteParams& wparams); @@ -79,7 +79,7 @@ class WriterHistory : public rtps::History * @param release specifies if the change should be return to the pool * @return iterator to the next change if any */ - RTPS_DllAPI iterator remove_change_nts( + FASTDDS_EXPORTED_API iterator remove_change_nts( const_iterator removal, bool release = true) override; @@ -91,7 +91,7 @@ class WriterHistory : public rtps::History * @param[in] max_blocking_time Maximum time this method has to complete the task. * @return iterator to the next change if any */ - RTPS_DllAPI iterator remove_change_nts( + FASTDDS_EXPORTED_API iterator remove_change_nts( const_iterator removal, const std::chrono::time_point& max_blocking_time, bool release = true) override; @@ -102,52 +102,52 @@ class WriterHistory : public rtps::History * @param outer change for comparison * @return true if inner matches outer criteria */ - RTPS_DllAPI bool matches_change( + FASTDDS_EXPORTED_API bool matches_change( const CacheChange_t* inner, CacheChange_t* outer) override; //! Introduce base class method into scope using History::remove_change; - RTPS_DllAPI virtual bool remove_change_g( + FASTDDS_EXPORTED_API virtual bool remove_change_g( CacheChange_t* a_change); - RTPS_DllAPI virtual bool remove_change_g( + FASTDDS_EXPORTED_API virtual bool remove_change_g( CacheChange_t* a_change, const std::chrono::time_point& max_blocking_time); - RTPS_DllAPI bool remove_change( + FASTDDS_EXPORTED_API bool remove_change( const SequenceNumber_t& sequence_number); - RTPS_DllAPI CacheChange_t* remove_change_and_reuse( + FASTDDS_EXPORTED_API CacheChange_t* remove_change_and_reuse( const SequenceNumber_t& sequence_number); /** * Remove the CacheChange_t with the minimum sequenceNumber. * @return True if correctly removed. */ - RTPS_DllAPI bool remove_min_change(); + FASTDDS_EXPORTED_API bool remove_min_change(); /** * Remove the CacheChange_t with the minimum sequenceNumber. * @param[in] max_blocking_time Maximum time this method has to complete the task. * @return True if correctly removed. */ - RTPS_DllAPI bool remove_min_change( + FASTDDS_EXPORTED_API bool remove_min_change( const std::chrono::time_point& max_blocking_time); - RTPS_DllAPI SequenceNumber_t next_sequence_number() const + FASTDDS_EXPORTED_API SequenceNumber_t next_sequence_number() const { return m_lastCacheChangeSeqNum + 1; } protected: - RTPS_DllAPI bool do_reserve_cache( + FASTDDS_EXPORTED_API bool do_reserve_cache( CacheChange_t** change, uint32_t size) override; - RTPS_DllAPI void do_release_cache( + FASTDDS_EXPORTED_API void do_release_cache( CacheChange_t* ch) override; /** diff --git a/include/fastdds/rtps/messages/CDRMessage.h b/include/fastdds/rtps/messages/CDRMessage.h index cb6e73b3db3..d5fb563e08e 100644 --- a/include/fastdds/rtps/messages/CDRMessage.h +++ b/include/fastdds/rtps/messages/CDRMessage.h @@ -20,6 +20,8 @@ #define _FASTDDS_RTPS_CDRMESSAGE_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include + #include #include #include @@ -28,7 +30,6 @@ #include #include #include -#include #include @@ -124,7 +125,7 @@ inline bool readString( inline bool readString( CDRMessage_t* msg, - string_255* stri); + fastcdr::string_255* stri); inline bool readOctetVector( CDRMessage_t* msg, @@ -281,7 +282,7 @@ inline bool add_string( inline bool add_string( CDRMessage_t* msg, - const string_255& in_str); + const fastcdr::string_255& in_str); inline bool addOctetVector( CDRMessage_t* msg, diff --git a/include/fastdds/rtps/messages/CDRMessage.hpp b/include/fastdds/rtps/messages/CDRMessage.hpp index 4618dc361cb..414ec888f44 100644 --- a/include/fastdds/rtps/messages/CDRMessage.hpp +++ b/include/fastdds/rtps/messages/CDRMessage.hpp @@ -449,7 +449,7 @@ inline bool CDRMessage::readString( inline bool CDRMessage::readString( CDRMessage_t* msg, - string_255* stri) + fastcdr::string_255* stri) { uint32_t str_size = 1; bool valid = true; @@ -738,7 +738,7 @@ inline bool CDRMessage::add_string( inline bool CDRMessage::add_string( CDRMessage_t* msg, - const string_255& in_str) + const fastcdr::string_255& in_str) { return add_string(msg, in_str.c_str()); } diff --git a/include/fastdds/rtps/messages/MessageReceiver.h b/include/fastdds/rtps/messages/MessageReceiver.h deleted file mode 100644 index 5ea5daadcbc..00000000000 --- a/include/fastdds/rtps/messages/MessageReceiver.h +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file MessageReceiver.h - */ - -#ifndef _FASTDDS_RTPS_MESSAGERECEIVER_H_ -#define _FASTDDS_RTPS_MESSAGERECEIVER_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class RTPSParticipantImpl; -class Endpoint; -class RTPSWriter; -class RTPSReader; -struct SubmessageHeader_t; - -/** - * Class MessageReceiver, process the received messages. - * @ingroup MANAGEMENT_MODULE - */ -class MessageReceiver -{ -public: - - /** - * @param participant - * @param rec_buffer_size - */ - MessageReceiver( - RTPSParticipantImpl* participant, - uint32_t rec_buffer_size); - - virtual ~MessageReceiver(); - - /** - * Process a new CDR message. - * @param [in] source_locator Locator indicating the sending address. - * @param [in] reception_locator Locator indicating the listening address. - * @param [in] msg Pointer to the message - */ - void processCDRMsg( - const Locator_t& source_locator, - const Locator_t& reception_locator, - CDRMessage_t* msg); - - // Functions to associate/remove associatedendpoints - void associateEndpoint( - Endpoint* to_add); - void removeEndpoint( - Endpoint* to_remove); - -private: - - mutable eprosima::shared_mutex mtx_; - std::vector associated_writers_; - std::unordered_map> associated_readers_; - - RTPSParticipantImpl* participant_; - //!Protocol version of the message - ProtocolVersion_t source_version_; - //!VendorID that created the message - fastdds::rtps::VendorId_t source_vendor_id_; - //!GuidPrefix of the entity that created the message - GuidPrefix_t source_guid_prefix_; - //!GuidPrefix of the entity that receives the message. GuidPrefix of the RTPSParticipant. - GuidPrefix_t dest_guid_prefix_; - //!Has the message timestamp? - bool have_timestamp_; - //!Timestamp associated with the message - Time_t timestamp_; - -#if HAVE_SECURITY - //!Buffer to process the decoded RTPS message - CDRMessage_t crypto_msg_; - //!Buffer to process each decoded RTPS sub-message - CDRMessage_t crypto_submsg_; - //!Buffer to process a decoded payload - SerializedPayload_t crypto_payload_; -#endif // if HAVE_SECURITY - - //! Function used to process a received message - std::function process_data_message_function_; - //! Function used to process a received fragment message - std::function process_data_fragment_message_function_; - - //!Reset the MessageReceiver to process a new message. - void reset(); - - /** - * Check the RTPSHeader of a received message. - * @param msg Pointer to the message. - * @return True if correct. - */ - bool checkRTPSHeader( - CDRMessage_t* msg); - /** - * Read the submessage header of a message. - * @param msg Pointer to the CDRMessage_t to read. - * @param smh Pointer to the submessageheader structure. - * @return True if correctly read. - */ - bool readSubmessageHeader( - CDRMessage_t* msg, - SubmessageHeader_t* smh) const; - - /** - * Find if there is a reader (in associated_readers_) that will accept a msg directed - * to the given entity ID. - */ - bool willAReaderAcceptMsgDirectedTo( - const EntityId_t& readerID, - RTPSReader*& first_reader) const; - - /** - * Find all readers (in associated_readers_), with the given entity ID, and call the - * callback provided. - */ - template - void findAllReaders( - const EntityId_t& readerID, - const Functor& callback) const; - - /**@name Processing methods. - * These methods are designed to read a part of the message - * and perform the corresponding actions: - * -Modify the message receiver state if necessary. - * -Add information to the history. - * -Return an error if the message is malformed. - * @param[in,out] msg Pointer to the message - * @param[in] smh Pointer to the submessage header - * @param[out] WriterID Writer EntityID (only for DATA messages) - * @param[in] was_decoded Whether the submessage being processed came from decoding a secured submessage - * @return True if correct, false otherwise - */ - - ///@{ - /** - * - * @param msg - * @param smh - * @param writerID - * @param was_decoded - * @return - */ - bool proc_Submsg_Data( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - EntityId_t& writerID, - bool was_decoded) const; - bool proc_Submsg_DataFrag( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - bool proc_Submsg_Heartbeat( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - bool proc_Submsg_Acknack( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - bool proc_Submsg_Gap( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - bool proc_Submsg_InfoTS( - CDRMessage_t* msg, - SubmessageHeader_t* smh); - bool proc_Submsg_InfoDST( - CDRMessage_t* msg, - SubmessageHeader_t* smh); - bool proc_Submsg_InfoSRC( - CDRMessage_t* msg, - SubmessageHeader_t* smh); - bool proc_Submsg_NackFrag( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - bool proc_Submsg_HeartbeatFrag( - CDRMessage_t* msg, - SubmessageHeader_t* smh, - bool was_decoded) const; - ///@} - - - /** - * @name Variants of received data message processing functions. - * - * @param[in] reader_id The ID of the reader to which the changes is addressed - * @param[in] change The CacheChange with the received data to process - * @param[in] was_decoded Whether the submessage being processed came from decoding a secured submessage - */ - ///@{ - #if HAVE_SECURITY - void process_data_message_with_security( - const EntityId_t& reader_id, - CacheChange_t& change, - bool was_decoded); -#endif // HAVE_SECURITY - - void process_data_message_without_security( - const EntityId_t& reader_id, - CacheChange_t& change, - bool was_decoded); - ///@} - - /** - * @name Variants of received data fragment message processing functions. - * - * @param[in] reader_id The ID of the reader to which the changes is addressed - * @param[in] change The CacheChange with the received data to process - * - * @param[in] sample_size The size of the message - * @param[in] fragment_starting_num The index of the first fragment in the message - * @param[in] fragments_in_submessage The number of fragments in the message - * @param[in] was_decoded Whether the submessage being processed came from decoding a secured - * submessage - */ - ///@{ - #if HAVE_SECURITY - void process_data_fragment_message_with_security( - const EntityId_t& reader_id, - CacheChange_t& change, - uint32_t sample_size, - uint32_t fragment_starting_num, - uint16_t fragments_in_submessage, - bool was_decoded); -#endif // HAVE_SECURITY - - void process_data_fragment_message_without_security( - const EntityId_t& reader_id, - CacheChange_t& change, - uint32_t sample_size, - uint32_t fragment_starting_num, - uint16_t fragments_in_submessage, - bool was_decoded); - ///@} - - /** - * Looks for the statistics specific submessage and notifies statistics related to the received message. - * - * @param [in] source_locator Locator indicating the sending address. - * @param [in] reception_locator Locator indicating the listening address. - * @param [in] msg Pointer to the message - * - * @pre The message header has already been read and validated. - */ - void notify_network_statistics( - const Locator_t& source_locator, - const Locator_t& reception_locator, - CDRMessage_t* msg) const; - -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_MESSAGERECEIVER_H_ */ diff --git a/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.h b/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.h index ef0acb9752e..0e91d7f1388 100644 --- a/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.h +++ b/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.h @@ -20,7 +20,7 @@ #ifndef _FASTDDS_RTPS_PARTICIPANT_PARTICIPANTDISCOVERYINFO_H__ #define _FASTDDS_RTPS_PARTICIPANT_PARTICIPANTDISCOVERYINFO_H__ -#include +#include #include namespace eprosima { @@ -36,7 +36,7 @@ struct ParticipantDiscoveryInfo //!Enum DISCOVERY_STATUS, four different status for discovered participants. //!@ingroup RTPS_MODULE #if defined(_WIN32) - enum RTPS_DllAPI DISCOVERY_STATUS + enum FASTDDS_EXPORTED_API DISCOVERY_STATUS #else enum DISCOVERY_STATUS #endif // if defined(_WIN32) @@ -74,7 +74,7 @@ struct ParticipantDiscoveryInfo #if HAVE_SECURITY struct ParticipantAuthenticationInfo { - enum RTPS_DllAPI AUTHENTICATION_STATUS + enum FASTDDS_EXPORTED_API AUTHENTICATION_STATUS { AUTHORIZED_PARTICIPANT, UNAUTHORIZED_PARTICIPANT diff --git a/include/fastdds/rtps/participant/RTPSParticipant.h b/include/fastdds/rtps/participant/RTPSParticipant.h index 1b3a19abd56..df880e79b89 100644 --- a/include/fastdds/rtps/participant/RTPSParticipant.h +++ b/include/fastdds/rtps/participant/RTPSParticipant.h @@ -23,23 +23,23 @@ #include #include -#include +#include +#include #include #include +#include #include -#include -#include -#include +#include namespace eprosima { -namespace fastdds { - #ifdef FASTDDS_STATISTICS +namespace fastdds { namespace statistics { class MonitorServiceStatusData; + namespace rtps { struct IStatusQueryable; @@ -47,18 +47,10 @@ struct IStatusObserver; } // namespace rtps } // namespace statistics +} // namespace fastdds #endif //FASTDDS_STATISTICS -namespace dds { -namespace builtin { - -class TypeLookupManager; - -} // namespace builtin -} // namespace dds -} // namespace fastdds - namespace fastrtps { class TopicAttributes; @@ -81,7 +73,7 @@ class WLP; * @brief Class RTPSParticipant, contains the public API for a RTPSParticipant. * @ingroup RTPS_MODULE */ -class RTPS_DllAPI RTPSParticipant +class FASTDDS_EXPORTED_API RTPSParticipant { friend class RTPSParticipantImpl; friend class RTPSDomain; @@ -155,7 +147,7 @@ class RTPS_DllAPI RTPSParticipant bool registerWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos); + const fastdds::dds::WriterQos& wqos); /** * Register a RTPSReader in the builtin Protocols. @@ -168,7 +160,7 @@ class RTPS_DllAPI RTPSParticipant bool registerReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); /** @@ -188,7 +180,7 @@ class RTPS_DllAPI RTPSParticipant bool updateWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos); + const fastdds::dds::WriterQos& wqos); /** * Update reader QOS @@ -201,7 +193,7 @@ class RTPS_DllAPI RTPSParticipant bool updateReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); /** @@ -249,12 +241,6 @@ class RTPS_DllAPI RTPSParticipant void set_check_type_function( std::function&& check_type); - /** - * @brief Retrieves the built-in typelookup service manager. - * @return - */ - fastdds::dds::builtin::TypeLookupManager* typelookup_manager() const; - /** * @brief Modifies the participant listener * @param listener diff --git a/include/fastdds/rtps/participant/RTPSParticipantListener.h b/include/fastdds/rtps/participant/RTPSParticipantListener.h index deb8f7234ee..0e7406261e3 100644 --- a/include/fastdds/rtps/participant/RTPSParticipantListener.h +++ b/include/fastdds/rtps/participant/RTPSParticipantListener.h @@ -24,10 +24,6 @@ #include #include -#include -#include -#include - namespace eprosima { namespace fastrtps { namespace rtps { @@ -38,7 +34,7 @@ class RTPSParticipant; * Class RTPSParticipantListener with virtual method that the user can overload to respond to certain events. * @ingroup RTPS_MODULE */ -class RTPS_DllAPI RTPSParticipantListener +class FASTDDS_EXPORTED_API RTPSParticipantListener { public: @@ -159,63 +155,6 @@ class RTPS_DllAPI RTPSParticipantListener static_cast(should_be_ignored); } - /*! - * This method is called when a participant discovers a new Type - * The ownership of all object belongs to the caller so if needs to be used after the - * method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature. - * The field "topic" it is only available if the type was discovered using "Discovery-Time Data Typing", - * in which case the field request_sample_id will contain INVALID_SAMPLE_IDENTITY. - * If the type was discovered using TypeLookup Service then "topic" will be empty, but will have - * the request_sample_id of the petition that caused the discovery. - * For example: - * fastrtps::types::TypeIdentifier new_type_id = *identifier; - */ - virtual void on_type_discovery( - RTPSParticipant* participant, - const SampleIdentity& request_sample_id, - const string_255& topic, - const types::TypeIdentifier* identifier, - const types::TypeObject* object, - types::DynamicType_ptr dyn_type) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(topic); - static_cast(identifier); - static_cast(object); - static_cast(dyn_type); - } - - /*! - * This method is called when the typelookup client received a reply to a getTypeDependencies request. - * The user may want to retrieve these new types using the getTypes request and create a new - * DynamicType using the retrieved TypeObject. - */ - virtual void on_type_dependencies_reply( - RTPSParticipant* participant, - const SampleIdentity& request_sample_id, - const types::TypeIdentifierWithSizeSeq& dependencies) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(dependencies); - } - - /*! - * This method is called when a participant receives a TypeInformation while discovering another participant. - */ - virtual void on_type_information_received( - RTPSParticipant* participant, - const string_255& topic_name, - const string_255& type_name, - const types::TypeInformation& type_information) - { - static_cast(participant); - static_cast(topic_name); - static_cast(type_name); - static_cast(type_information); - } - }; } // namespace rtps diff --git a/include/fastdds/rtps/reader/RTPSReader.h b/include/fastdds/rtps/reader/RTPSReader.h index 6db4528e617..0a6de1de600 100644 --- a/include/fastdds/rtps/reader/RTPSReader.h +++ b/include/fastdds/rtps/reader/RTPSReader.h @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -31,8 +32,7 @@ #include #include #include -#include -#include +#include namespace eprosima { namespace fastrtps { @@ -96,7 +96,7 @@ class RTPSReader * @param wdata Attributes of the writer to add. * @return True if correctly added. */ - RTPS_DllAPI virtual bool matched_writer_add( + FASTDDS_EXPORTED_API virtual bool matched_writer_add( const WriterProxyData& wdata) = 0; /** @@ -105,7 +105,7 @@ class RTPSReader * @param removed_by_lease Whether the writer is being unmatched due to a participant drop. * @return True if correctly removed. */ - RTPS_DllAPI virtual bool matched_writer_remove( + FASTDDS_EXPORTED_API virtual bool matched_writer_remove( const GUID_t& writer_guid, bool removed_by_lease = false) = 0; @@ -114,7 +114,7 @@ class RTPSReader * @param writer_guid GUID of the writer to check. * @return True if it is matched. */ - RTPS_DllAPI virtual bool matched_writer_is_matched( + FASTDDS_EXPORTED_API virtual bool matched_writer_is_matched( const GUID_t& writer_guid) = 0; /** @@ -123,7 +123,7 @@ class RTPSReader * @param change Pointer to the CacheChange_t. * @return true if the reader accepts messages from the. */ - RTPS_DllAPI virtual bool processDataMsg( + FASTDDS_EXPORTED_API virtual bool processDataMsg( CacheChange_t* change) = 0; /** @@ -135,7 +135,7 @@ class RTPSReader * @param fragmentsInSubmessage Number of fragments on this particular message. * @return true if the reader accepts message. */ - RTPS_DllAPI virtual bool processDataFragMsg( + FASTDDS_EXPORTED_API virtual bool processDataFragMsg( CacheChange_t* change, uint32_t sampleSize, uint32_t fragmentStartingNum, @@ -152,7 +152,7 @@ class RTPSReader * @param origin_vendor_id * @return true if the reader accepts messages from the. */ - RTPS_DllAPI virtual bool processHeartbeatMsg( + FASTDDS_EXPORTED_API virtual bool processHeartbeatMsg( const GUID_t& writerGUID, uint32_t hbCount, const SequenceNumber_t& firstSN, @@ -169,7 +169,7 @@ class RTPSReader * @param origin_vendor_id * @return true if the reader accepts messages from the. */ - RTPS_DllAPI virtual bool processGapMsg( + FASTDDS_EXPORTED_API virtual bool processGapMsg( const GUID_t& writerGUID, const SequenceNumber_t& gapStart, const SequenceNumberSet_t& gapList, @@ -181,7 +181,7 @@ class RTPSReader * @param prox Pointer to the WriterProxy. * @return True if correctly removed. */ - RTPS_DllAPI virtual bool change_removed_by_history( + FASTDDS_EXPORTED_API virtual bool change_removed_by_history( CacheChange_t* change, WriterProxy* prox = nullptr) = 0; @@ -189,7 +189,7 @@ class RTPSReader * Get the associated listener, secondary attached Listener in case it is of compound type * @return Pointer to the associated reader listener. */ - RTPS_DllAPI ReaderListener* getListener() const; + FASTDDS_EXPORTED_API ReaderListener* getListener() const; /** * Switch the ReaderListener kind for the Reader. @@ -199,7 +199,7 @@ class RTPSReader * @param target Pointed to ReaderLister to attach * @return True is correctly set. */ - RTPS_DllAPI bool setListener( + FASTDDS_EXPORTED_API bool setListener( ReaderListener* target); /** @@ -208,14 +208,14 @@ class RTPSReader * @param dataCdrSerializedSize Size of the Cache. * @return True if correctly reserved. */ - RTPS_DllAPI bool reserveCache( + FASTDDS_EXPORTED_API bool reserveCache( CacheChange_t** change, uint32_t dataCdrSerializedSize); /** * Release a cacheChange. */ - RTPS_DllAPI void releaseCache( + FASTDDS_EXPORTED_API void releaseCache( CacheChange_t* change); /** @@ -224,7 +224,7 @@ class RTPSReader * @param wp Pointer to pointer to the WriterProxy * @return True if read. */ - RTPS_DllAPI virtual bool nextUnreadCache( + FASTDDS_EXPORTED_API virtual bool nextUnreadCache( CacheChange_t** change, WriterProxy** wp) = 0; @@ -234,34 +234,34 @@ class RTPSReader * @param wp Pointer to pointer to the WriterProxy. * @return True if read. */ - RTPS_DllAPI virtual bool nextUntakenCache( + FASTDDS_EXPORTED_API virtual bool nextUntakenCache( CacheChange_t** change, WriterProxy** wp) = 0; - RTPS_DllAPI bool wait_for_unread_cache( + FASTDDS_EXPORTED_API bool wait_for_unread_cache( const eprosima::fastrtps::Duration_t& timeout); - RTPS_DllAPI uint64_t get_unread_count() const; + FASTDDS_EXPORTED_API uint64_t get_unread_count() const; - RTPS_DllAPI uint64_t get_unread_count( + FASTDDS_EXPORTED_API uint64_t get_unread_count( bool mark_as_read); /** * @return True if the reader expects Inline QOS. */ - RTPS_DllAPI inline bool expectsInlineQos() + FASTDDS_EXPORTED_API inline bool expectsInlineQos() { return m_expectsInlineQos; } //! Returns a pointer to the associated History. - RTPS_DllAPI inline ReaderHistory* getHistory() + FASTDDS_EXPORTED_API inline ReaderHistory* getHistory() { return mp_history; } //! @return The content filter associated to this reader. - RTPS_DllAPI eprosima::fastdds::rtps::IReaderDataFilter* get_content_filter() const + FASTDDS_EXPORTED_API eprosima::fastdds::rtps::IReaderDataFilter* get_content_filter() const { std::lock_guard guard(mp_mutex); return data_filter_; @@ -269,7 +269,7 @@ class RTPSReader //! Set the content filter associated to this reader. //! @param filter Pointer to the content filter to associate to this reader. - RTPS_DllAPI void set_content_filter( + FASTDDS_EXPORTED_API void set_content_filter( eprosima::fastdds::rtps::IReaderDataFilter* filter) { std::lock_guard guard(mp_mutex); @@ -285,7 +285,7 @@ class RTPSReader virtual bool isInCleanState() = 0; //! The liveliness changed status struct as defined in the DDS - LivelinessChangedStatus liveliness_changed_status_; + fastdds::dds::LivelinessChangedStatus liveliness_changed_status_; inline void enableMessagesFromUnkownWriters( bool enable) @@ -354,7 +354,7 @@ class RTPSReader * * @return true if the sample is valid */ - RTPS_DllAPI bool is_sample_valid( + FASTDDS_EXPORTED_API bool is_sample_valid( const void* data, const GUID_t& writer, const SequenceNumber_t& sn) const; @@ -371,7 +371,7 @@ class RTPSReader * @param listener * @return true if successfully added */ - RTPS_DllAPI bool add_statistics_listener( + FASTDDS_EXPORTED_API bool add_statistics_listener( std::shared_ptr listener); /** @@ -379,7 +379,7 @@ class RTPSReader * @param listener * @return true if successfully removed */ - RTPS_DllAPI bool remove_statistics_listener( + FASTDDS_EXPORTED_API bool remove_statistics_listener( std::shared_ptr listener); /** @@ -387,7 +387,7 @@ class RTPSReader * * @param enabled_writers The new mask to set */ - RTPS_DllAPI void set_enabled_statistics_writers_mask( + FASTDDS_EXPORTED_API void set_enabled_statistics_writers_mask( uint32_t enabled_writers); /** @@ -396,7 +396,7 @@ class RTPSReader * @param [out] connection_list of the reader * @return True if could be retrieved */ - RTPS_DllAPI virtual bool get_connections( + FASTDDS_EXPORTED_API virtual bool get_connections( fastdds::statistics::rtps::ConnectionList& connection_list) = 0; #endif // FASTDDS_STATISTICS diff --git a/include/fastdds/rtps/reader/ReaderDiscoveryInfo.h b/include/fastdds/rtps/reader/ReaderDiscoveryInfo.h index b71fd8c217b..6fc5f52d359 100644 --- a/include/fastdds/rtps/reader/ReaderDiscoveryInfo.h +++ b/include/fastdds/rtps/reader/ReaderDiscoveryInfo.h @@ -20,7 +20,7 @@ #ifndef _FASTDDS_RTPS_READER_READERDISCOVERYINFO_H__ #define _FASTDDS_RTPS_READER_READERDISCOVERYINFO_H__ -#include +#include #include namespace eprosima { @@ -38,7 +38,7 @@ struct ReaderDiscoveryInfo //!Enum DISCOVERY_STATUS, four different status for discovered readers. //!@ingroup RTPS_MODULE #if defined(_WIN32) - enum RTPS_DllAPI DISCOVERY_STATUS + enum FASTDDS_EXPORTED_API DISCOVERY_STATUS #else enum DISCOVERY_STATUS #endif // if defined(_WIN32) diff --git a/include/fastdds/rtps/reader/ReaderListener.h b/include/fastdds/rtps/reader/ReaderListener.h index 5ebf826e62d..d579f93f78f 100644 --- a/include/fastdds/rtps/reader/ReaderListener.h +++ b/include/fastdds/rtps/reader/ReaderListener.h @@ -40,7 +40,7 @@ struct CacheChange_t; * certain events. * @ingroup READER_MODULE */ -class RTPS_DllAPI ReaderListener +class FASTDDS_EXPORTED_API ReaderListener { public: diff --git a/include/fastdds/rtps/reader/StatefulReader.h b/include/fastdds/rtps/reader/StatefulReader.h index 42790d1ce16..97cc36f91e9 100644 --- a/include/fastdds/rtps/reader/StatefulReader.h +++ b/include/fastdds/rtps/reader/StatefulReader.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/reader/StatelessReader.h b/include/fastdds/rtps/reader/StatelessReader.h index 6db00fa24dd..82cf03ab77c 100644 --- a/include/fastdds/rtps/reader/StatelessReader.h +++ b/include/fastdds/rtps/reader/StatelessReader.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/resources/ResourceEvent.h b/include/fastdds/rtps/resources/ResourceEvent.h index 33be690b67d..6016232d1e7 100644 --- a/include/fastdds/rtps/resources/ResourceEvent.h +++ b/include/fastdds/rtps/resources/ResourceEvent.h @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include namespace eprosima { diff --git a/include/fastdds/rtps/rtps_all.h b/include/fastdds/rtps/rtps_all.h deleted file mode 100644 index 02c9f8af78d..00000000000 --- a/include/fastdds/rtps/rtps_all.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file rtps_all.h - * - */ - -#ifndef _FASTDDS_RTPS_ALL_H_ -#define _FASTDDS_RTPS_ALL_H_ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include - -#endif /* _FASTDDS_RTPS_ALL_H_ */ diff --git a/include/fastdds/rtps/security/exceptions/SecurityException.h b/include/fastdds/rtps/security/exceptions/SecurityException.h index e638f1d2174..0838f4035fd 100644 --- a/include/fastdds/rtps/security/exceptions/SecurityException.h +++ b/include/fastdds/rtps/security/exceptions/SecurityException.h @@ -31,45 +31,55 @@ namespace security { */ class SecurityException : public Exception { - public: +public: - RTPS_DllAPI SecurityException() {} + FASTDDS_EXPORTED_API SecurityException() + { + } - /** - * @brief Default constructor. - * @param message An error message. This message is copied. - */ - RTPS_DllAPI SecurityException(const std::string& message) : Exception(message.c_str(), 1) {} + /** + * @brief Default constructor. + * @param message An error message. This message is copied. + */ + FASTDDS_EXPORTED_API SecurityException( + const std::string& message) + : Exception(message.c_str(), 1) + { + } - /** - * @brief Default copy constructor. - * @param ex SecurityException that will be copied. - */ - RTPS_DllAPI SecurityException(const SecurityException &ex); + /** + * @brief Default copy constructor. + * @param ex SecurityException that will be copied. + */ + FASTDDS_EXPORTED_API SecurityException( + const SecurityException& ex); - /** - * @brief Default move constructor. - * @param ex SecurityException that will be moved. - */ - RTPS_DllAPI SecurityException(SecurityException&& ex); + /** + * @brief Default move constructor. + * @param ex SecurityException that will be moved. + */ + FASTDDS_EXPORTED_API SecurityException( + SecurityException&& ex); - /** - * @brief Assigment operation. - * @param ex SecurityException that will be copied. - */ - RTPS_DllAPI SecurityException& operator=(const SecurityException &ex); + /** + * @brief Assigment operation. + * @param ex SecurityException that will be copied. + */ + FASTDDS_EXPORTED_API SecurityException& operator =( + const SecurityException& ex); - /** - * @brief Assigment operation. - * @param ex SecurityException that will be moved. - */ - RTPS_DllAPI SecurityException& operator=(SecurityException&& ex); + /** + * @brief Assigment operation. + * @param ex SecurityException that will be moved. + */ + FASTDDS_EXPORTED_API SecurityException& operator =( + SecurityException&& ex); - /// \brief Default constructor - virtual RTPS_DllAPI ~SecurityException() throw(); + /// \brief Default constructor + virtual FASTDDS_EXPORTED_API ~SecurityException() throw(); - /// \brief This function throws the object as an exception. - virtual RTPS_DllAPI void raise() const; + /// \brief This function throws the object as an exception. + virtual FASTDDS_EXPORTED_API void raise() const; }; } // namespace security } // namespace rtps diff --git a/include/fastdds/rtps/security/logging/Logging.h b/include/fastdds/rtps/security/logging/Logging.h index 340d5bf9a43..7e684b4faad 100644 --- a/include/fastdds/rtps/security/logging/Logging.h +++ b/include/fastdds/rtps/security/logging/Logging.h @@ -233,9 +233,9 @@ bool Logging::compose_header( // gcc expands __VA_ARGS___ before passing it into the macro. // Visual Studio expands __VA_ARGS__ after passing it. // This macro is a workaround to support both -#define __FASTRTPS_EXPAND(x) x +#define __FASTDDS_EXPAND(x) x -#define __FASTRTPS_SECURITY_LOGGING(LEVEL, CLASS, MESSAGE, EXCEPTION) \ +#define __FASTDDS_SECURITY_LOGGING(LEVEL, CLASS, MESSAGE, EXCEPTION) \ do { \ auto logger = get_logger(); \ if (logger){ \ @@ -243,40 +243,40 @@ bool Logging::compose_header( MESSAGE, \ std::string(CLASS ",") + __func__, \ EXCEPTION); \ - } \ - else { \ + } \ + else { \ switch (LEVEL){ \ case LoggingLevel::EMERGENCY_LEVEL: \ case LoggingLevel::ALERT_LEVEL: \ case LoggingLevel::CRITICAL_LEVEL: \ case LoggingLevel::ERROR_LEVEL: \ - EPROSIMA_LOG_ERROR(SECURITY, MESSAGE); \ + EPROSIMA_LOG_ERROR(SECURITY, MESSAGE); \ break; \ case LoggingLevel::WARNING_LEVEL: \ - EPROSIMA_LOG_WARNING(SECURITY, MESSAGE); \ + EPROSIMA_LOG_WARNING(SECURITY, MESSAGE); \ break; \ case LoggingLevel::NOTICE_LEVEL: \ case LoggingLevel::INFORMATIONAL_LEVEL: \ case LoggingLevel::DEBUG_LEVEL: \ - EPROSIMA_LOG_INFO(SECURITY, MESSAGE); \ + EPROSIMA_LOG_INFO(SECURITY, MESSAGE); \ break; \ } \ } \ } while (0); -#define __FASTRTPS_SECURITY_LOGGING_EX(LEVEL, CLASS, MESSAGE) \ +#define __FASTDDS_SECURITY_LOGGING_EX(LEVEL, CLASS, MESSAGE) \ do { \ eprosima::fastrtps::rtps::security::SecurityException lexception; \ - __FASTRTPS_SECURITY_LOGGING(LEVEL, CLASS, MESSAGE, lexception); \ + __FASTDDS_SECURITY_LOGGING(LEVEL, CLASS, MESSAGE, lexception); \ } while (0); -#define __FASTRTPS_MACRO_SELECTOR(_1, _2, _3, _4, NAME, ...) NAME +#define __FASTDDS_MACRO_SELECTOR(_1, _2, _3, _4, NAME, ...) NAME #define SECURITY_LOGGING(...) \ - __FASTRTPS_EXPAND( \ - __FASTRTPS_MACRO_SELECTOR(__VA_ARGS__, \ - __FASTRTPS_SECURITY_LOGGING, \ - __FASTRTPS_SECURITY_LOGGING_EX, \ + __FASTDDS_EXPAND( \ + __FASTDDS_MACRO_SELECTOR(__VA_ARGS__, \ + __FASTDDS_SECURITY_LOGGING, \ + __FASTDDS_SECURITY_LOGGING_EX, \ _UNUSED)(__VA_ARGS__)) #define EMERGENCY_SECURITY_LOGGING(...) SECURITY_LOGGING(LoggingLevel::EMERGENCY_LEVEL, __VA_ARGS__) diff --git a/include/fastdds/rtps/transport/ChainingTransport.h b/include/fastdds/rtps/transport/ChainingTransport.h index da3094ab958..364718c5499 100644 --- a/include/fastdds/rtps/transport/ChainingTransport.h +++ b/include/fastdds/rtps/transport/ChainingTransport.h @@ -56,7 +56,7 @@ class ChainingTransport : public TransportInterface public: //! Constructor - RTPS_DllAPI ChainingTransport( + FASTDDS_EXPORTED_API ChainingTransport( const ChainingTransportDescriptor& t) : TransportInterface(0) , low_level_transport_(t.low_level_descriptor->create_transport()) @@ -65,7 +65,7 @@ class ChainingTransport : public TransportInterface } //! Destructor - RTPS_DllAPI virtual ~ChainingTransport() = default; + FASTDDS_EXPORTED_API virtual ~ChainingTransport() = default; /*! * Initialize the low-level transport. This method will prepare all the internals of the transport. @@ -73,7 +73,7 @@ class ChainingTransport : public TransportInterface * @param max_msg_size_no_frag Optional maximum message size to avoid 65500 KB fragmentation limit. * @return True when the transport was correctly initialized. */ - RTPS_DllAPI bool init( + FASTDDS_EXPORTED_API bool init( const fastrtps::rtps::PropertyPolicy* properties = nullptr, const uint32_t& max_msg_size_no_frag = 0) override { @@ -85,7 +85,7 @@ class ChainingTransport : public TransportInterface * Must report whether the input channel associated to this locator is open. Channels must either be * fully closed or fully open, so that "open" and "close" operations are whole and definitive. */ - RTPS_DllAPI bool IsInputChannelOpen( + FASTDDS_EXPORTED_API bool IsInputChannelOpen( const fastrtps::rtps::Locator_t& loc) const override { return low_level_transport_->IsInputChannelOpen(loc); @@ -95,7 +95,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `IsLocatorSupported()`. * Must report whether the given locator is supported by this transport (typically inspecting its "kind" value). */ - RTPS_DllAPI bool IsLocatorSupported( + FASTDDS_EXPORTED_API bool IsLocatorSupported( const fastrtps::rtps::Locator_t& loc) const override { return low_level_transport_->IsLocatorSupported(loc); @@ -105,7 +105,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `RemoteToMainLocal()`. * Returns the locator describing the main (most general) channel that can write to the provided remote locator. */ - RTPS_DllAPI fastrtps::rtps::Locator_t RemoteToMainLocal( + FASTDDS_EXPORTED_API fastrtps::rtps::Locator_t RemoteToMainLocal( const fastrtps::rtps::Locator_t& loc) const override { return low_level_transport_->RemoteToMainLocal(loc); @@ -116,7 +116,7 @@ class ChainingTransport : public TransportInterface * Opens an input channel to receive incoming connections. * If there is an existing channel it registers the receiver interface. */ - RTPS_DllAPI bool OpenInputChannel( + FASTDDS_EXPORTED_API bool OpenInputChannel( const fastrtps::rtps::Locator_t& loc, TransportReceiverInterface* receiver_interface, uint32_t max_message_size) override; @@ -126,7 +126,7 @@ class ChainingTransport : public TransportInterface * Must open the channel that maps to/from the given locator. This method must allocate, reserve and mark * any resources that are needed for said channel. */ - RTPS_DllAPI bool OpenOutputChannel( + FASTDDS_EXPORTED_API bool OpenOutputChannel( SendResourceList& sender_resource_list, const fastrtps::rtps::Locator_t& loc) override; @@ -136,7 +136,7 @@ class ChainingTransport : public TransportInterface * IMPORTANT: It MUST be safe to call this method even during a Receive operation on another thread. You must implement * any necessary mutual exclusion and timeout mechanisms to make sure the channel can be closed without damage. */ - RTPS_DllAPI bool CloseInputChannel( + FASTDDS_EXPORTED_API bool CloseInputChannel( const fastrtps::rtps::Locator_t& loc) override { return low_level_transport_->CloseInputChannel(loc); @@ -146,7 +146,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `NormalizeLocator()`. * Performs locator normalization (assign valid IP if not defined by user) */ - RTPS_DllAPI fastrtps::rtps::LocatorList_t NormalizeLocator( + FASTDDS_EXPORTED_API fastrtps::rtps::LocatorList_t NormalizeLocator( const fastrtps::rtps::Locator_t& locator) override { return low_level_transport_->NormalizeLocator(locator); @@ -156,7 +156,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `is_local_locator()`. * Must report whether the given locator is from the local host */ - RTPS_DllAPI bool is_local_locator( + FASTDDS_EXPORTED_API bool is_local_locator( const fastrtps::rtps::Locator_t& locator) const override { return low_level_transport_->is_local_locator(locator); @@ -166,7 +166,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `is_localhost_allowed()`. * Must report whether localhost locator is allowed */ - RTPS_DllAPI bool is_localhost_allowed() const override + FASTDDS_EXPORTED_API bool is_localhost_allowed() const override { return low_level_transport_->is_localhost_allowed(); } @@ -175,7 +175,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `netmask_filter_info()`. * Returns netmask filter information (transport's netmask filter kind and allowlist) */ - RTPS_DllAPI NetmaskFilterInfo netmask_filter_info() const override + FASTDDS_EXPORTED_API NetmaskFilterInfo netmask_filter_info() const override { return low_level_transport_->netmask_filter_info(); } @@ -184,7 +184,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `DoInputLocatorsMatch()`. * Must report whether two locators map to the same internal channel. */ - RTPS_DllAPI bool DoInputLocatorsMatch( + FASTDDS_EXPORTED_API bool DoInputLocatorsMatch( const fastrtps::rtps::Locator_t& locator_1, const fastrtps::rtps::Locator_t& locator_2) const override { @@ -195,7 +195,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `select_locators()`. * Performs the locator selection algorithm for this transport. */ - RTPS_DllAPI void select_locators( + FASTDDS_EXPORTED_API void select_locators( fastrtps::rtps::LocatorSelector& selector) const override { return low_level_transport_->select_locators(selector); @@ -205,7 +205,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `AddDefaultOutputLocator()`. * Add default output locator to the locator list */ - RTPS_DllAPI void AddDefaultOutputLocator( + FASTDDS_EXPORTED_API void AddDefaultOutputLocator( fastrtps::rtps::LocatorList_t& defaultList) override { return low_level_transport_->AddDefaultOutputLocator(defaultList); @@ -215,7 +215,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `getDefaultMetatrafficMulticastLocators()`. * Add metatraffic multicast locator with the given port */ - RTPS_DllAPI bool getDefaultMetatrafficMulticastLocators( + FASTDDS_EXPORTED_API bool getDefaultMetatrafficMulticastLocators( fastrtps::rtps::LocatorList_t& locators, uint32_t metatraffic_multicast_port) const override { @@ -226,7 +226,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `getDefaultMetatrafficUnicastLocators()`. * Add metatraffic unicast locator with the given port */ - RTPS_DllAPI bool getDefaultMetatrafficUnicastLocators( + FASTDDS_EXPORTED_API bool getDefaultMetatrafficUnicastLocators( fastrtps::rtps::LocatorList_t& locators, uint32_t metatraffic_unicast_port) const override { @@ -237,7 +237,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `getDefaultUnicastLocators()`. * Add unicast locator with the given port */ - RTPS_DllAPI bool getDefaultUnicastLocators( + FASTDDS_EXPORTED_API bool getDefaultUnicastLocators( fastrtps::rtps::LocatorList_t& locators, uint32_t unicast_port) const override { @@ -248,7 +248,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `fillMetatrafficMulticastLocator()`. * Assign port to the given metatraffic multicast locator if not already defined */ - RTPS_DllAPI bool fillMetatrafficMulticastLocator( + FASTDDS_EXPORTED_API bool fillMetatrafficMulticastLocator( fastrtps::rtps::Locator_t& locator, uint32_t metatraffic_multicast_port) const override { @@ -259,7 +259,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `fillMetatrafficUnicastLocator()`. * Assign port to the given metatraffic unicast locator if not already defined */ - RTPS_DllAPI bool fillMetatrafficUnicastLocator( + FASTDDS_EXPORTED_API bool fillMetatrafficUnicastLocator( fastrtps::rtps::Locator_t& locator, uint32_t metatraffic_unicast_port) const override { @@ -270,7 +270,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `configureInitialPeerLocator()`. * Configure the initial peer locators list */ - RTPS_DllAPI bool configureInitialPeerLocator( + FASTDDS_EXPORTED_API bool configureInitialPeerLocator( fastrtps::rtps::Locator_t& locator, const fastrtps::rtps::PortParameters& port_params, uint32_t domainId, @@ -283,7 +283,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `fillUnicastLocator()`. * Assign port to the given unicast locator if not already defined */ - RTPS_DllAPI bool fillUnicastLocator( + FASTDDS_EXPORTED_API bool fillUnicastLocator( fastrtps::rtps::Locator_t& locator, uint32_t well_known_port) const override { @@ -292,7 +292,7 @@ class ChainingTransport : public TransportInterface //! Call the low-level transport `transform_remote_locator()`. //! Transforms a remote locator into a locator optimized for local communications. - RTPS_DllAPI bool transform_remote_locator( + FASTDDS_EXPORTED_API bool transform_remote_locator( const fastrtps::rtps::Locator_t& remote_locator, fastrtps::rtps::Locator_t& result_locator) const override { @@ -303,7 +303,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `max_recv_buffer_size()`. * @return The maximum datagram size for reception supported by the transport */ - RTPS_DllAPI uint32_t max_recv_buffer_size() const override + FASTDDS_EXPORTED_API uint32_t max_recv_buffer_size() const override { return low_level_transport_->max_recv_buffer_size(); } @@ -326,7 +326,7 @@ class ChainingTransport : public TransportInterface * we're sending to. * @param timeout Maximum blocking time. */ - RTPS_DllAPI virtual bool send( + FASTDDS_EXPORTED_API virtual bool send( fastrtps::rtps::SenderResource* low_sender_resource, const fastrtps::rtps::octet* send_buffer, uint32_t send_buffer_size, @@ -349,14 +349,14 @@ class ChainingTransport : public TransportInterface * @param local_locator Locator mapping to the local channel we're listening to. * @param[out] remote_locator Locator describing the remote destination we received a packet from. */ - RTPS_DllAPI virtual void receive( + FASTDDS_EXPORTED_API virtual void receive( TransportReceiverInterface* next_receiver, const fastrtps::rtps::octet* receive_buffer, uint32_t receive_buffer_size, const fastrtps::rtps::Locator_t& local_locator, const fastrtps::rtps::Locator_t& remote_locator) = 0; - RTPS_DllAPI void update_network_interfaces() override + FASTDDS_EXPORTED_API void update_network_interfaces() override { low_level_transport_->update_network_interfaces(); } @@ -364,7 +364,7 @@ class ChainingTransport : public TransportInterface //! Call the low-level transport `transform_remote_locator()`. //! Transforms a remote locator into a locator optimized for local communications, //! if allowed by both local and remote transports. - RTPS_DllAPI bool transform_remote_locator( + FASTDDS_EXPORTED_API bool transform_remote_locator( const fastrtps::rtps::Locator_t& remote_locator, fastrtps::rtps::Locator_t& result_locator, bool allowed_remote_localhost, @@ -378,7 +378,7 @@ class ChainingTransport : public TransportInterface * Call the low-level transport `is_locator_allowed()`. * Must report whether the given locator is allowed by this transport. */ - RTPS_DllAPI bool is_locator_allowed( + FASTDDS_EXPORTED_API bool is_locator_allowed( const fastrtps::rtps::Locator_t& locator) const override { return low_level_transport_->is_locator_allowed(locator); diff --git a/include/fastdds/rtps/transport/ChainingTransportDescriptor.h b/include/fastdds/rtps/transport/ChainingTransportDescriptor.h index dad7bf74884..8cfddb57638 100644 --- a/include/fastdds/rtps/transport/ChainingTransportDescriptor.h +++ b/include/fastdds/rtps/transport/ChainingTransportDescriptor.h @@ -36,14 +36,14 @@ namespace rtps { */ typedef struct ChainingTransportDescriptor : public TransportDescriptorInterface { - RTPS_DllAPI ChainingTransportDescriptor( + FASTDDS_EXPORTED_API ChainingTransportDescriptor( std::shared_ptr low_level) : TransportDescriptorInterface(low_level->maxMessageSize, low_level->maxInitialPeersRange) , low_level_descriptor(low_level) { } - RTPS_DllAPI ChainingTransportDescriptor( + FASTDDS_EXPORTED_API ChainingTransportDescriptor( const ChainingTransportDescriptor& t) : TransportDescriptorInterface(t) , low_level_descriptor(t.low_level_descriptor) @@ -51,25 +51,25 @@ typedef struct ChainingTransportDescriptor : public TransportDescriptorInterface } //! Returns the minimum size required for a send operation. - RTPS_DllAPI virtual uint32_t min_send_buffer_size() const override + FASTDDS_EXPORTED_API virtual uint32_t min_send_buffer_size() const override { return low_level_descriptor->min_send_buffer_size(); } //! Returns the maximum size expected for received messages. - RTPS_DllAPI virtual uint32_t max_message_size() const override + FASTDDS_EXPORTED_API virtual uint32_t max_message_size() const override { return low_level_descriptor->max_message_size(); } - RTPS_DllAPI virtual ~ChainingTransportDescriptor() = default; + FASTDDS_EXPORTED_API virtual ~ChainingTransportDescriptor() = default; //! Descriptor for lower level transport std::shared_ptr low_level_descriptor; } ChainingTransportDescriptor; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif // _FASTDDS_RTPS_TRANSPORT_CHAININGTRANSPORTDESCRIPTOR_H_ diff --git a/include/fastdds/rtps/transport/PortBasedTransportDescriptor.hpp b/include/fastdds/rtps/transport/PortBasedTransportDescriptor.hpp index 44f96e589f6..fa3714d9c52 100644 --- a/include/fastdds/rtps/transport/PortBasedTransportDescriptor.hpp +++ b/include/fastdds/rtps/transport/PortBasedTransportDescriptor.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -41,23 +41,23 @@ class PortBasedTransportDescriptor : public TransportDescriptorInterface using ReceptionThreadsConfigMap = std::map; //! Constructor - RTPS_DllAPI PortBasedTransportDescriptor( + FASTDDS_EXPORTED_API PortBasedTransportDescriptor( uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange); //! Copy constructor - RTPS_DllAPI PortBasedTransportDescriptor( + FASTDDS_EXPORTED_API PortBasedTransportDescriptor( const PortBasedTransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI PortBasedTransportDescriptor& operator =( + FASTDDS_EXPORTED_API PortBasedTransportDescriptor& operator =( const PortBasedTransportDescriptor& t) = default; //! Destructor - virtual RTPS_DllAPI ~PortBasedTransportDescriptor() = default; + virtual FASTDDS_EXPORTED_API ~PortBasedTransportDescriptor() = default; //! Comparison operator - bool RTPS_DllAPI operator ==( + bool FASTDDS_EXPORTED_API operator ==( const PortBasedTransportDescriptor& t) const; /** @@ -76,25 +76,25 @@ class PortBasedTransportDescriptor : public TransportDescriptorInterface * * @return The ThreadSettings for the given port. */ - virtual RTPS_DllAPI const ThreadSettings& get_thread_config_for_port( + virtual FASTDDS_EXPORTED_API const ThreadSettings& get_thread_config_for_port( uint32_t port) const; - virtual RTPS_DllAPI bool set_thread_config_for_port( + virtual FASTDDS_EXPORTED_API bool set_thread_config_for_port( const uint32_t& port, const ThreadSettings& thread_settings); //! Returns the ThreadSettings for the default reception threads - RTPS_DllAPI const ThreadSettings& default_reception_threads() const; + FASTDDS_EXPORTED_API const ThreadSettings& default_reception_threads() const; //! Set the ThreadSettings for the default reception threads - virtual RTPS_DllAPI void default_reception_threads( + virtual FASTDDS_EXPORTED_API void default_reception_threads( const ThreadSettings& default_reception_threads); //! Returns the ThreadSettings for the user-configured reception threads - RTPS_DllAPI const ReceptionThreadsConfigMap& reception_threads() const; + FASTDDS_EXPORTED_API const ReceptionThreadsConfigMap& reception_threads() const; //! Set the ThreadSettings for the user-configured reception threads - virtual RTPS_DllAPI bool reception_threads( + virtual FASTDDS_EXPORTED_API bool reception_threads( const ReceptionThreadsConfigMap& reception_threads); protected: diff --git a/include/fastdds/rtps/transport/SenderResource.h b/include/fastdds/rtps/transport/SenderResource.h index b6a2b060bc1..4a2f272451d 100644 --- a/include/fastdds/rtps/transport/SenderResource.h +++ b/include/fastdds/rtps/transport/SenderResource.h @@ -21,7 +21,8 @@ #include #include -#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/transport/SocketTransportDescriptor.h b/include/fastdds/rtps/transport/SocketTransportDescriptor.h index 80c5a3a6a19..421fde9f8be 100644 --- a/include/fastdds/rtps/transport/SocketTransportDescriptor.h +++ b/include/fastdds/rtps/transport/SocketTransportDescriptor.h @@ -47,7 +47,7 @@ constexpr uint8_t s_defaultTTL = 1; struct SocketTransportDescriptor : public PortBasedTransportDescriptor { //! Constructor - RTPS_DllAPI SocketTransportDescriptor( + FASTDDS_EXPORTED_API SocketTransportDescriptor( uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange) : PortBasedTransportDescriptor(maximumMessageSize, maximumInitialPeersRange) @@ -59,23 +59,23 @@ struct SocketTransportDescriptor : public PortBasedTransportDescriptor } //! Copy constructor - RTPS_DllAPI SocketTransportDescriptor( + FASTDDS_EXPORTED_API SocketTransportDescriptor( const SocketTransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI SocketTransportDescriptor& operator =( + FASTDDS_EXPORTED_API SocketTransportDescriptor& operator =( const SocketTransportDescriptor& t) = default; //! Destructor - virtual RTPS_DllAPI ~SocketTransportDescriptor() = default; + virtual FASTDDS_EXPORTED_API ~SocketTransportDescriptor() = default; - virtual RTPS_DllAPI uint32_t min_send_buffer_size() const override + virtual FASTDDS_EXPORTED_API uint32_t min_send_buffer_size() const override { return sendBufferSize; } //! Comparison operator - bool RTPS_DllAPI operator ==( + bool FASTDDS_EXPORTED_API operator ==( const SocketTransportDescriptor& t) const { return (this->sendBufferSize == t.min_send_buffer_size() && diff --git a/include/fastdds/rtps/transport/TCPTransportDescriptor.h b/include/fastdds/rtps/transport/TCPTransportDescriptor.h index d96a7d42903..c5cee7ae0b0 100644 --- a/include/fastdds/rtps/transport/TCPTransportDescriptor.h +++ b/include/fastdds/rtps/transport/TCPTransportDescriptor.h @@ -22,7 +22,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -266,10 +266,6 @@ struct TCPTransportDescriptor : public SocketTransportDescriptor //! Enables the TCP_NODELAY socket option bool enable_tcp_nodelay; - - FASTDDS_TODO_BEFORE(3, 0, "Eliminate wait_for_tcp_negotiation, variable not in use."); - bool wait_for_tcp_negotiation; - //! Enables the calculation and sending of CRC on message headers bool calculate_crc; //! Enables checking the CRC of incoming message headers @@ -308,21 +304,21 @@ struct TCPTransportDescriptor : public SocketTransportDescriptor } //! Constructor - RTPS_DllAPI TCPTransportDescriptor(); + FASTDDS_EXPORTED_API TCPTransportDescriptor(); //! Copy constructor - RTPS_DllAPI TCPTransportDescriptor( + FASTDDS_EXPORTED_API TCPTransportDescriptor( const TCPTransportDescriptor& t); //! Copy assignment - RTPS_DllAPI TCPTransportDescriptor& operator =( + FASTDDS_EXPORTED_API TCPTransportDescriptor& operator =( const TCPTransportDescriptor& t); //! Destructor virtual ~TCPTransportDescriptor() = default; //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const TCPTransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/transport/TCPv4TransportDescriptor.h b/include/fastdds/rtps/transport/TCPv4TransportDescriptor.h index f6f3c8e2c4f..6d33d0b40d5 100644 --- a/include/fastdds/rtps/transport/TCPv4TransportDescriptor.h +++ b/include/fastdds/rtps/transport/TCPv4TransportDescriptor.h @@ -81,18 +81,18 @@ struct TCPv4TransportDescriptor : public TCPTransportDescriptor } //! Constructor - RTPS_DllAPI TCPv4TransportDescriptor(); + FASTDDS_EXPORTED_API TCPv4TransportDescriptor(); //! Copy constructor - RTPS_DllAPI TCPv4TransportDescriptor( + FASTDDS_EXPORTED_API TCPv4TransportDescriptor( const TCPv4TransportDescriptor& t); //! Copy assignment - RTPS_DllAPI TCPv4TransportDescriptor& operator =( + FASTDDS_EXPORTED_API TCPv4TransportDescriptor& operator =( const TCPv4TransportDescriptor& t); //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const TCPv4TransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/transport/TCPv6TransportDescriptor.h b/include/fastdds/rtps/transport/TCPv6TransportDescriptor.h index 43513cde0a8..ad73604d97e 100644 --- a/include/fastdds/rtps/transport/TCPv6TransportDescriptor.h +++ b/include/fastdds/rtps/transport/TCPv6TransportDescriptor.h @@ -35,18 +35,18 @@ struct TCPv6TransportDescriptor : public TCPTransportDescriptor virtual TransportInterface* create_transport() const override; //! Constructor - RTPS_DllAPI TCPv6TransportDescriptor(); + FASTDDS_EXPORTED_API TCPv6TransportDescriptor(); //! Copy constructor - RTPS_DllAPI TCPv6TransportDescriptor( + FASTDDS_EXPORTED_API TCPv6TransportDescriptor( const TCPv6TransportDescriptor& t); //! Copy assignment - RTPS_DllAPI TCPv6TransportDescriptor& operator =( + FASTDDS_EXPORTED_API TCPv6TransportDescriptor& operator =( const TCPv6TransportDescriptor& t) = default; //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const TCPv6TransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/transport/TransportDescriptorInterface.h b/include/fastdds/rtps/transport/TransportDescriptorInterface.h index 255ac0c1e1b..2327566808c 100644 --- a/include/fastdds/rtps/transport/TransportDescriptorInterface.h +++ b/include/fastdds/rtps/transport/TransportDescriptorInterface.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -42,7 +42,7 @@ class TransportInterface; struct TransportDescriptorInterface { //! Constructor - RTPS_DllAPI TransportDescriptorInterface( + FASTDDS_EXPORTED_API TransportDescriptorInterface( uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange) : maxMessageSize(maximumMessageSize) @@ -51,7 +51,7 @@ struct TransportDescriptorInterface } //! Copy constructor - RTPS_DllAPI TransportDescriptorInterface( + FASTDDS_EXPORTED_API TransportDescriptorInterface( const TransportDescriptorInterface& t) : maxMessageSize(t.maxMessageSize) , maxInitialPeersRange(t.maxInitialPeersRange) @@ -59,7 +59,7 @@ struct TransportDescriptorInterface } //! Copy assignment - RTPS_DllAPI TransportDescriptorInterface& operator =( + FASTDDS_EXPORTED_API TransportDescriptorInterface& operator =( const TransportDescriptorInterface& t) { maxMessageSize = t.maxMessageSize; @@ -68,20 +68,20 @@ struct TransportDescriptorInterface } //! Destructor - virtual RTPS_DllAPI ~TransportDescriptorInterface() = default; + virtual FASTDDS_EXPORTED_API ~TransportDescriptorInterface() = default; /** * Factory method pattern. It will create and return a TransportInterface * corresponding to this descriptor. This provides an interface to the NetworkFactory * to create the transports without the need to know about their type */ - virtual RTPS_DllAPI TransportInterface* create_transport() const = 0; + virtual FASTDDS_EXPORTED_API TransportInterface* create_transport() const = 0; //! Returns the minimum size required for a send operation. - virtual RTPS_DllAPI uint32_t min_send_buffer_size() const = 0; + virtual FASTDDS_EXPORTED_API uint32_t min_send_buffer_size() const = 0; //! Returns the maximum size expected for received messages. - virtual RTPS_DllAPI uint32_t max_message_size() const + virtual FASTDDS_EXPORTED_API uint32_t max_message_size() const { return maxMessageSize; } @@ -89,13 +89,13 @@ struct TransportDescriptorInterface /** Returns the maximum number of opened channels for each initial remote peer * (maximum number of guessed initial peers to try to connect) */ - virtual RTPS_DllAPI uint32_t max_initial_peers_range() const + virtual FASTDDS_EXPORTED_API uint32_t max_initial_peers_range() const { return maxInitialPeersRange; } //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const TransportDescriptorInterface& t) const { return (this->maxMessageSize == t.max_message_size() && @@ -103,13 +103,13 @@ struct TransportDescriptorInterface } //! Lock internal mutex (for Fast-DDS internal use) - RTPS_DllAPI void lock() + FASTDDS_EXPORTED_API void lock() { mtx_.lock(); } //! Unlock internal mutex (for Fast-DDS internal use) - RTPS_DllAPI void unlock() + FASTDDS_EXPORTED_API void unlock() { mtx_.unlock(); } diff --git a/include/fastdds/rtps/transport/TransportInterface.h b/include/fastdds/rtps/transport/TransportInterface.h index 8ff96ee76f7..b016492476b 100644 --- a/include/fastdds/rtps/transport/TransportInterface.h +++ b/include/fastdds/rtps/transport/TransportInterface.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -50,13 +51,13 @@ using NetmaskFilterInfo = std::pair; /** - * Interface against which to implement a transport layer, decoupled from FastRTPS internals. + * Interface against which to implement a transport layer, decoupled from Fast DDS internals. * TransportInterface expects the user to implement a logical equivalence between Locators and protocol-specific "channels". * This equivalence can be narrowing: For instance in UDP/IP, a port would take the role of channel, and several different * locators can map to the same port, and hence the same channel. * @ingroup TRANSPORT_MODULE * */ -class RTPS_DllAPI TransportInterface +class FASTDDS_EXPORTED_API TransportInterface { public: diff --git a/include/fastdds/rtps/transport/TransportReceiverInterface.h b/include/fastdds/rtps/transport/TransportReceiverInterface.h index 779266a31bc..1c7e5d6f4c0 100644 --- a/include/fastdds/rtps/transport/TransportReceiverInterface.h +++ b/include/fastdds/rtps/transport/TransportReceiverInterface.h @@ -25,7 +25,7 @@ namespace rtps { * Interface against which to implement a data receiver, decoupled from transport internals. * @ingroup TRANSPORT_MODULE * */ -class RTPS_DllAPI TransportReceiverInterface +class FASTDDS_EXPORTED_API TransportReceiverInterface { public: diff --git a/include/fastdds/rtps/transport/UDPTransportDescriptor.h b/include/fastdds/rtps/transport/UDPTransportDescriptor.h index 18efac6128d..c06ae15d22a 100644 --- a/include/fastdds/rtps/transport/UDPTransportDescriptor.h +++ b/include/fastdds/rtps/transport/UDPTransportDescriptor.h @@ -16,7 +16,7 @@ #define _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_ #include -#include +#include namespace eprosima { namespace fastdds { @@ -39,18 +39,18 @@ struct UDPTransportDescriptor : public SocketTransportDescriptor virtual ~UDPTransportDescriptor() = default; //! Constructor - RTPS_DllAPI UDPTransportDescriptor(); + FASTDDS_EXPORTED_API UDPTransportDescriptor(); //! Copy constructor - RTPS_DllAPI UDPTransportDescriptor( + FASTDDS_EXPORTED_API UDPTransportDescriptor( const UDPTransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI UDPTransportDescriptor& operator =( + FASTDDS_EXPORTED_API UDPTransportDescriptor& operator =( const UDPTransportDescriptor& t) = default; //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const UDPTransportDescriptor& t) const; //! Source port to use for outgoing datagrams diff --git a/include/fastdds/rtps/transport/UDPv4TransportDescriptor.h b/include/fastdds/rtps/transport/UDPv4TransportDescriptor.h index d43f81160c6..7bdae6be2f4 100644 --- a/include/fastdds/rtps/transport/UDPv4TransportDescriptor.h +++ b/include/fastdds/rtps/transport/UDPv4TransportDescriptor.h @@ -35,17 +35,17 @@ struct UDPv4TransportDescriptor : public UDPTransportDescriptor virtual TransportInterface* create_transport() const override; //! Constructor - RTPS_DllAPI UDPv4TransportDescriptor(); + FASTDDS_EXPORTED_API UDPv4TransportDescriptor(); //! Copy constructor - RTPS_DllAPI UDPv4TransportDescriptor( + FASTDDS_EXPORTED_API UDPv4TransportDescriptor( const UDPv4TransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI UDPv4TransportDescriptor& operator =( + FASTDDS_EXPORTED_API UDPv4TransportDescriptor& operator =( const UDPv4TransportDescriptor& t) = default; - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const UDPv4TransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/transport/UDPv6TransportDescriptor.h b/include/fastdds/rtps/transport/UDPv6TransportDescriptor.h index 2fa2e730646..8ab8a970956 100644 --- a/include/fastdds/rtps/transport/UDPv6TransportDescriptor.h +++ b/include/fastdds/rtps/transport/UDPv6TransportDescriptor.h @@ -37,17 +37,17 @@ struct UDPv6TransportDescriptor : public UDPTransportDescriptor virtual TransportInterface* create_transport() const override; //! Constructor - RTPS_DllAPI UDPv6TransportDescriptor(); + FASTDDS_EXPORTED_API UDPv6TransportDescriptor(); //! Copy constructor - RTPS_DllAPI UDPv6TransportDescriptor( + FASTDDS_EXPORTED_API UDPv6TransportDescriptor( const UDPv6TransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI UDPv6TransportDescriptor& operator =( + FASTDDS_EXPORTED_API UDPv6TransportDescriptor& operator =( const UDPv6TransportDescriptor& t) = default; - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const UDPv6TransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/transport/network/AllowedNetworkInterface.hpp b/include/fastdds/rtps/transport/network/AllowedNetworkInterface.hpp index 3b832ff10ba..fee25c4e869 100644 --- a/include/fastdds/rtps/transport/network/AllowedNetworkInterface.hpp +++ b/include/fastdds/rtps/transport/network/AllowedNetworkInterface.hpp @@ -20,7 +20,7 @@ #define _FASTDDS_RTPS_TRANSPORT_NETWORK_ALLOWEDNETWORKINTERFACE_HPP_ #include -#include +#include namespace eprosima { namespace fastdds { @@ -37,22 +37,22 @@ struct AllowedNetworkInterface : public NetworkInterfaceWithFilter using NetworkInterfaceWithFilter::NetworkInterfaceWithFilter; //! Destructor - virtual RTPS_DllAPI ~AllowedNetworkInterface() = default; + virtual FASTDDS_EXPORTED_API ~AllowedNetworkInterface() = default; //! Copy constructor - RTPS_DllAPI AllowedNetworkInterface( + FASTDDS_EXPORTED_API AllowedNetworkInterface( const AllowedNetworkInterface& iface) = default; //! Copy assignment - RTPS_DllAPI AllowedNetworkInterface& operator =( + FASTDDS_EXPORTED_API AllowedNetworkInterface& operator =( const AllowedNetworkInterface& iface) = default; //! Move constructor - RTPS_DllAPI AllowedNetworkInterface( + FASTDDS_EXPORTED_API AllowedNetworkInterface( AllowedNetworkInterface&& iface) = default; //! Move assignment - RTPS_DllAPI AllowedNetworkInterface& operator =( + FASTDDS_EXPORTED_API AllowedNetworkInterface& operator =( AllowedNetworkInterface&& iface) = default; }; diff --git a/include/fastdds/rtps/transport/network/BlockedNetworkInterface.hpp b/include/fastdds/rtps/transport/network/BlockedNetworkInterface.hpp index b9ef6f7eb70..559bea4da90 100644 --- a/include/fastdds/rtps/transport/network/BlockedNetworkInterface.hpp +++ b/include/fastdds/rtps/transport/network/BlockedNetworkInterface.hpp @@ -20,7 +20,7 @@ #define _FASTDDS_RTPS_TRANSPORT_NETWORK_BLOCKEDNETWORKINTERFACE_HPP_ #include -#include +#include namespace eprosima { namespace fastdds { @@ -37,22 +37,22 @@ struct BlockedNetworkInterface : public NetworkInterface using NetworkInterface::NetworkInterface; //! Destructor - virtual RTPS_DllAPI ~BlockedNetworkInterface() = default; + virtual FASTDDS_EXPORTED_API ~BlockedNetworkInterface() = default; //! Copy constructor - RTPS_DllAPI BlockedNetworkInterface( + FASTDDS_EXPORTED_API BlockedNetworkInterface( const BlockedNetworkInterface& iface) = default; //! Copy assignment - RTPS_DllAPI BlockedNetworkInterface& operator =( + FASTDDS_EXPORTED_API BlockedNetworkInterface& operator =( const BlockedNetworkInterface& iface) = default; //! Move constructor - RTPS_DllAPI BlockedNetworkInterface( + FASTDDS_EXPORTED_API BlockedNetworkInterface( BlockedNetworkInterface&& iface) = default; //! Move assignment - RTPS_DllAPI BlockedNetworkInterface& operator =( + FASTDDS_EXPORTED_API BlockedNetworkInterface& operator =( BlockedNetworkInterface&& iface) = default; }; diff --git a/include/fastdds/rtps/transport/network/NetmaskFilterKind.hpp b/include/fastdds/rtps/transport/network/NetmaskFilterKind.hpp index f2ec8e67c32..09d0d8926cd 100644 --- a/include/fastdds/rtps/transport/network/NetmaskFilterKind.hpp +++ b/include/fastdds/rtps/transport/network/NetmaskFilterKind.hpp @@ -21,7 +21,7 @@ #include -#include +#include namespace eprosima { namespace fastdds { @@ -34,7 +34,7 @@ enum class NetmaskFilterKind ON }; -RTPS_DllAPI std::ostream& operator <<( +FASTDDS_EXPORTED_API std::ostream& operator <<( std::ostream& output, const NetmaskFilterKind& netmask_filter_kind); diff --git a/include/fastdds/rtps/transport/network/NetworkInterface.hpp b/include/fastdds/rtps/transport/network/NetworkInterface.hpp index 15fd5188827..be7c9c3cdf2 100644 --- a/include/fastdds/rtps/transport/network/NetworkInterface.hpp +++ b/include/fastdds/rtps/transport/network/NetworkInterface.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -37,36 +37,36 @@ namespace rtps { struct NetworkInterface { //! Constructor by name - RTPS_DllAPI NetworkInterface( + FASTDDS_EXPORTED_API NetworkInterface( const std::string& name); //! Constructor by device name, IP address string and locator with mask - RTPS_DllAPI NetworkInterface( + FASTDDS_EXPORTED_API NetworkInterface( const std::string& device, const std::string& ip, const LocatorWithMask& locator); //! Destructor - virtual RTPS_DllAPI ~NetworkInterface() = default; + virtual FASTDDS_EXPORTED_API ~NetworkInterface() = default; //! Copy constructor - RTPS_DllAPI NetworkInterface( + FASTDDS_EXPORTED_API NetworkInterface( const NetworkInterface& iface) = default; //! Copy assignment - RTPS_DllAPI NetworkInterface& operator =( + FASTDDS_EXPORTED_API NetworkInterface& operator =( const NetworkInterface& iface) = default; //! Move constructor - RTPS_DllAPI NetworkInterface( + FASTDDS_EXPORTED_API NetworkInterface( NetworkInterface&& iface) = default; //! Move assignment - RTPS_DllAPI NetworkInterface& operator =( + FASTDDS_EXPORTED_API NetworkInterface& operator =( NetworkInterface&& iface) = default; //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const NetworkInterface& iface) const; //! Interface device name or IP address in string format (to be filled by the user) diff --git a/include/fastdds/rtps/transport/network/NetworkInterfaceWithFilter.hpp b/include/fastdds/rtps/transport/network/NetworkInterfaceWithFilter.hpp index a37113b8e0d..bb428b58c3a 100644 --- a/include/fastdds/rtps/transport/network/NetworkInterfaceWithFilter.hpp +++ b/include/fastdds/rtps/transport/network/NetworkInterfaceWithFilter.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -38,12 +38,12 @@ namespace rtps { struct NetworkInterfaceWithFilter : public NetworkInterface { //! Constructor by name and netmask filter - RTPS_DllAPI NetworkInterfaceWithFilter( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter( const std::string& name, NetmaskFilterKind netmask_filter); //! Constructor by name - RTPS_DllAPI NetworkInterfaceWithFilter( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter( const std::string& name); //! Constructor by device name, IP address string, locator with mask and netmask filter @@ -54,32 +54,32 @@ struct NetworkInterfaceWithFilter : public NetworkInterface NetmaskFilterKind netmask_filter); //! Constructor by device name, IP address string and locator with mask - RTPS_DllAPI NetworkInterfaceWithFilter( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter( const std::string& device, const std::string& ip, const LocatorWithMask& locator); //! Destructor - virtual RTPS_DllAPI ~NetworkInterfaceWithFilter() = default; + virtual FASTDDS_EXPORTED_API ~NetworkInterfaceWithFilter() = default; //! Copy constructor - RTPS_DllAPI NetworkInterfaceWithFilter( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter( const NetworkInterfaceWithFilter& iface) = default; //! Copy assignment - RTPS_DllAPI NetworkInterfaceWithFilter& operator =( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter& operator =( const NetworkInterfaceWithFilter& iface) = default; //! Move constructor - RTPS_DllAPI NetworkInterfaceWithFilter( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter( NetworkInterfaceWithFilter&& iface) = default; //! Move assignment - RTPS_DllAPI NetworkInterfaceWithFilter& operator =( + FASTDDS_EXPORTED_API NetworkInterfaceWithFilter& operator =( NetworkInterfaceWithFilter&& iface) = default; //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const NetworkInterfaceWithFilter& iface) const; //! Netmask filter configuration diff --git a/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h b/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h index db8d1951607..54b0509bd1d 100644 --- a/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h +++ b/include/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -55,24 +55,24 @@ struct SharedMemTransportDescriptor : public PortBasedTransportDescriptor } //! Constructor - RTPS_DllAPI SharedMemTransportDescriptor(); + FASTDDS_EXPORTED_API SharedMemTransportDescriptor(); //! Copy constructor - RTPS_DllAPI SharedMemTransportDescriptor( + FASTDDS_EXPORTED_API SharedMemTransportDescriptor( const SharedMemTransportDescriptor& t) = default; //! Copy assignment - RTPS_DllAPI SharedMemTransportDescriptor& operator =( + FASTDDS_EXPORTED_API SharedMemTransportDescriptor& operator =( const SharedMemTransportDescriptor& t) = default; //! Return the size of the shared memory segment - RTPS_DllAPI uint32_t segment_size() const + FASTDDS_EXPORTED_API uint32_t segment_size() const { return segment_size_; } //! Set the size of the shared memory segment - RTPS_DllAPI void segment_size( + FASTDDS_EXPORTED_API void segment_size( uint32_t segment_size) { segment_size_ = segment_size; @@ -85,66 +85,66 @@ struct SharedMemTransportDescriptor : public PortBasedTransportDescriptor } //! Set the maximum size of a single message in the transport (in octets) - RTPS_DllAPI void max_message_size( + FASTDDS_EXPORTED_API void max_message_size( uint32_t max_message_size) { maxMessageSize = max_message_size; } //! Return the size of the listening port (in messages) - RTPS_DllAPI uint32_t port_queue_capacity() const + FASTDDS_EXPORTED_API uint32_t port_queue_capacity() const { return port_queue_capacity_; } //! Set the size of the listening port (in messages) - RTPS_DllAPI void port_queue_capacity( + FASTDDS_EXPORTED_API void port_queue_capacity( uint32_t port_queue_capacity) { port_queue_capacity_ = port_queue_capacity; } //! Return the timeout for the health check of ports (ms) - RTPS_DllAPI uint32_t healthy_check_timeout_ms() const + FASTDDS_EXPORTED_API uint32_t healthy_check_timeout_ms() const { return healthy_check_timeout_ms_; } //! Set the timeout for the health check of ports (ms) - RTPS_DllAPI void healthy_check_timeout_ms( + FASTDDS_EXPORTED_API void healthy_check_timeout_ms( uint32_t healthy_check_timeout_ms) { healthy_check_timeout_ms_ = healthy_check_timeout_ms; } //! Return the full path of the protocol dump file - RTPS_DllAPI std::string rtps_dump_file() const + FASTDDS_EXPORTED_API std::string rtps_dump_file() const { return rtps_dump_file_; } //! Set the full path of the protocol dump file - RTPS_DllAPI void rtps_dump_file( + FASTDDS_EXPORTED_API void rtps_dump_file( const std::string& rtps_dump_file) { rtps_dump_file_ = rtps_dump_file; } //! Return the thread settings for the transport dump thread - RTPS_DllAPI ThreadSettings dump_thread() const + FASTDDS_EXPORTED_API ThreadSettings dump_thread() const { return dump_thread_; } //! Set the thread settings for the transport dump thread - RTPS_DllAPI void dump_thread( + FASTDDS_EXPORTED_API void dump_thread( const ThreadSettings& dump_thread) { dump_thread_ = dump_thread; } //! Comparison operator - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const SharedMemTransportDescriptor& t) const; private: diff --git a/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h b/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h index dafa7798ae8..79665530133 100644 --- a/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h +++ b/include/fastdds/rtps/transport/test_UDPv4TransportDescriptor.h @@ -81,7 +81,7 @@ struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor uint32_t dropLogLength; //! Constructor - RTPS_DllAPI test_UDPv4TransportDescriptor(); + FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor(); //! Destructor virtual ~test_UDPv4TransportDescriptor() = default; @@ -90,24 +90,24 @@ struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor virtual TransportInterface* create_transport() const override; //! Copy constructor - RTPS_DllAPI test_UDPv4TransportDescriptor( + FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor( const test_UDPv4TransportDescriptor& t) = delete; //! Copy assignment - RTPS_DllAPI test_UDPv4TransportDescriptor& operator =( + FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor& operator =( const test_UDPv4TransportDescriptor& t) = delete; //! Move constructor - RTPS_DllAPI test_UDPv4TransportDescriptor( + FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor( test_UDPv4TransportDescriptor&& t) = delete; //! Move assignment - RTPS_DllAPI test_UDPv4TransportDescriptor& operator =( + FASTDDS_EXPORTED_API test_UDPv4TransportDescriptor& operator =( test_UDPv4TransportDescriptor&& t) = delete; //! Comparison operator // Filters are not included - RTPS_DllAPI bool operator ==( + FASTDDS_EXPORTED_API bool operator ==( const test_UDPv4TransportDescriptor& t) const; }; diff --git a/include/fastdds/rtps/writer/IReaderDataFilter.hpp b/include/fastdds/rtps/writer/IReaderDataFilter.hpp deleted file mode 100644 index 5331d7b8173..00000000000 --- a/include/fastdds/rtps/writer/IReaderDataFilter.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file IReaderDataFilter.hpp - */ - -// This file was moved as part of the implementation of content filtered topics -#include - -FASTDDS_TODO_BEFORE(3, 0, "This header should be removed"); diff --git a/include/fastdds/rtps/writer/LivelinessData.h b/include/fastdds/rtps/writer/LivelinessData.h deleted file mode 100644 index f33b7bbcf82..00000000000 --- a/include/fastdds/rtps/writer/LivelinessData.h +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2016-2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file LivelinessData.h - */ -#ifndef _FASTDDS_RTPS_LIVELINESS_DATA_H_ -#define _FASTDDS_RTPS_LIVELINESS_DATA_H_ - -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -/** - * @brief A struct keeping relevant liveliness information of a writer - * @ingroup WRITER_MODULE - */ -struct LivelinessData -{ - enum WriterStatus - { - //! Writer is matched but liveliness has not been asserted yet - NOT_ASSERTED = 0, - //! Writer is alive - ALIVE = 1, - //! Writer is not alive - NOT_ALIVE = 2 - }; - - /** - * @brief Constructor - * @param guid_in GUID of the writer - * @param kind_in Liveliness kind - * @param lease_duration_in Liveliness lease duration - */ - LivelinessData( - GUID_t guid_in, - LivelinessQosPolicyKind kind_in, - Duration_t lease_duration_in) - : guid(guid_in) - , kind(kind_in) - , lease_duration(lease_duration_in) - , status(WriterStatus::NOT_ASSERTED) - {} - - LivelinessData() - : guid() - , kind(LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) - , lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) - , status(WriterStatus::NOT_ASSERTED) - {} - - ~LivelinessData() - {} - - /** - * @brief Equality operator - * @param other Liveliness data to compare to - * @return True if equal - */ - bool operator==( - const LivelinessData& other) const - { - return ((guid == other.guid) && - (kind == other.kind) && - (lease_duration == other.lease_duration)); - } - - /** - * @brief Inequality operator - * @param other Liveliness data to compare to - * @return True if different - */ - bool operator!=( - const LivelinessData& other) const - { - return (!operator==(other)); - } - - //! GUID of the writer - GUID_t guid; - - //! Writer liveliness kind - LivelinessQosPolicyKind kind; - - //! The lease duration - Duration_t lease_duration; - - //! The number of times the writer is being counted - unsigned int count = 1; - - //! The writer status - WriterStatus status; - - //! The time when the writer will lose liveliness - std::chrono::steady_clock::time_point time; -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* _FASTDDS_RTPS_LIVELINESS_DATA_H_ */ diff --git a/include/fastdds/rtps/writer/LivelinessManager.h b/include/fastdds/rtps/writer/LivelinessManager.h deleted file mode 100644 index a8efa9fecfd..00000000000 --- a/include/fastdds/rtps/writer/LivelinessManager.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2016-2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file LivelinessManager.h - */ -#ifndef _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ -#define _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ - -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -using LivelinessCallback = std::function; - -/** - * @brief A class managing the liveliness of a set of writers. Writers are represented by their LivelinessData - * @details Uses a shared timed event and informs outside classes on liveliness changes - * @ingroup WRITER_MODULE - */ -class LivelinessManager -{ -public: - - /** - * @brief Constructor - * @param callback A callback that will be invoked when a writer changes its liveliness status - * @param service ResourceEvent object that will operate with the events. - * @param manage_automatic True to manage writers with automatic liveliness, false otherwise - */ - LivelinessManager( - const LivelinessCallback& callback, - ResourceEvent& service, - bool manage_automatic = true); - - /** - * @brief Constructor - */ - ~LivelinessManager(); - - /** - * @brief LivelinessManager - * @param other - */ - LivelinessManager( - const LivelinessManager& other) = delete; - - /** - * @brief Adds a writer to the set - * @param guid GUID of the writer - * @param kind Liveliness kind - * @param lease_duration Liveliness lease duration - * @return True if the writer was successfully added - */ - bool add_writer( - GUID_t guid, - LivelinessQosPolicyKind kind, - Duration_t lease_duration); - - /** - * @brief Removes a writer - * @param guid GUID of the writer - * @param kind Liveliness kind - * @param lease_duration Liveliness lease duration - * @return True if the writer was successfully removed - */ - bool remove_writer( - GUID_t guid, - LivelinessQosPolicyKind kind, - Duration_t lease_duration); - - /** - * @brief Asserts liveliness of a writer in the set - * @param guid The writer to assert liveliness of - * @param kind The kind of the writer - * @param lease_duration The lease duration - * @return True if liveliness was successfully asserted - */ - bool assert_liveliness( - GUID_t guid, - LivelinessQosPolicyKind kind, - Duration_t lease_duration); - - /** - * @brief Asserts liveliness of writers with given liveliness kind and GuidPrefix - * @param kind Liveliness kind - * @param guid_prefix The guid prefix of the writers to assert liveliness of - * @return True if liveliness was successfully asserted - */ - bool assert_liveliness( - LivelinessQosPolicyKind kind, - GuidPrefix_t guid_prefix); - - /** - * @brief A method to check any writer of the given kind is alive - * @param kind The liveliness kind to check for - * @return True if at least one writer of this kind is alive. False otherwise - */ - bool is_any_alive( - LivelinessQosPolicyKind kind); - - /** - * @brief A method to return liveliness data - * @details Should only be used for testing purposes - * @return Vector of liveliness data - */ - const ResourceLimitedVector& get_liveliness_data() const; - -private: - - /** - * @brief A method responsible for invoking the callback when liveliness is asserted - * @param writer The liveliness data of the writer asserting liveliness - * @pre The collection shared_mutex must be taken for reading - */ - void assert_writer_liveliness( - LivelinessData& writer); - - /** - * @brief A method to calculate the time when the next writer is going to lose liveliness - * @details This method is public for testing purposes but it should not be used from outside this class - * @pre std::mutex_ should not be taken on calling this method to avoid deadlock. - * @return True if at least one writer is alive - */ - bool calculate_next(); - - //! @brief A method called if the timer expires - //! @return True if the timer should be restarted - bool timer_expired(); - - //! A callback to inform outside classes that a writer changed its liveliness status - const LivelinessCallback callback_; - - //! A boolean indicating whether we are managing writers with automatic liveliness - const bool manage_automatic_; - - //! A vector of liveliness data - ResourceLimitedVector writers_; - - //! A mutex to protect the liveliness data included LivelinessData objects - std::mutex mutex_; - - //! A mutex devoted to protect the writers_ collection - eprosima::shared_mutex col_mutex_; - - //! The timer owner, i.e. the writer which is next due to lose its liveliness - LivelinessData* timer_owner_; - - //! A timed callback expiring when a writer (the timer owner) loses its liveliness - TimedEvent timer_; -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ */ diff --git a/include/fastdds/rtps/writer/LocatorSelectorSender.hpp b/include/fastdds/rtps/writer/LocatorSelectorSender.hpp index 8e691dff09f..149d948912c 100644 --- a/include/fastdds/rtps/writer/LocatorSelectorSender.hpp +++ b/include/fastdds/rtps/writer/LocatorSelectorSender.hpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/writer/RTPSWriter.h b/include/fastdds/rtps/writer/RTPSWriter.h index 6faad6b225a..1955bfafabf 100644 --- a/include/fastdds/rtps/writer/RTPSWriter.h +++ b/include/fastdds/rtps/writer/RTPSWriter.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -33,16 +34,12 @@ #include #include #include +#include +#include #include #include -#include - - -#include "DeliveryRetCode.hpp" -#include "LocatorSelectorSender.hpp" namespace eprosima { - namespace fastdds { namespace rtps { @@ -137,12 +134,12 @@ class RTPSWriter }, changeKind, handle); } - RTPS_DllAPI CacheChange_t* new_change( + FASTDDS_EXPORTED_API CacheChange_t* new_change( const std::function& dataCdrSerializedSize, ChangeKind_t changeKind, InstanceHandle_t handle = c_InstanceHandle_Unknown); - RTPS_DllAPI CacheChange_t* new_change( + FASTDDS_EXPORTED_API CacheChange_t* new_change( ChangeKind_t changeKind, InstanceHandle_t handle = c_InstanceHandle_Unknown); @@ -159,7 +156,7 @@ class RTPSWriter * * @post memory pointed to by @c change is not accessed */ - RTPS_DllAPI bool release_change( + FASTDDS_EXPORTED_API bool release_change( CacheChange_t* change); /** @@ -167,7 +164,7 @@ class RTPSWriter * @param data Pointer to the ReaderProxyData object added. * @return True if added. */ - RTPS_DllAPI virtual bool matched_reader_add( + FASTDDS_EXPORTED_API virtual bool matched_reader_add( const ReaderProxyData& data) = 0; /** @@ -175,7 +172,7 @@ class RTPSWriter * @param reader_guid GUID of the reader to remove. * @return True if removed. */ - RTPS_DllAPI virtual bool matched_reader_remove( + FASTDDS_EXPORTED_API virtual bool matched_reader_remove( const GUID_t& reader_guid) = 0; /** @@ -183,7 +180,7 @@ class RTPSWriter * @param reader_guid GUID of the reader to check. * @return True if it was matched. */ - RTPS_DllAPI virtual bool matched_reader_is_matched( + FASTDDS_EXPORTED_API virtual bool matched_reader_is_matched( const GUID_t& reader_guid) = 0; /** @@ -195,7 +192,7 @@ class RTPSWriter * @param filter The content filter to use on this writer. May be @c nullptr to remove the content filter * (i.e. treat all samples as relevant). */ - RTPS_DllAPI virtual void reader_data_filter( + FASTDDS_EXPORTED_API virtual void reader_data_filter( fastdds::rtps::IReaderDataFilter* filter) = 0; /** @@ -203,7 +200,7 @@ class RTPSWriter * * @return The content filter used on this writer. */ - RTPS_DllAPI virtual const fastdds::rtps::IReaderDataFilter* reader_data_filter() const = 0; + FASTDDS_EXPORTED_API virtual const fastdds::rtps::IReaderDataFilter* reader_data_filter() const = 0; /** * @brief Check if a specific change has been delivered to the transport layer of every matched remote RTPSReader @@ -212,7 +209,7 @@ class RTPSWriter * @param seq_num Sequence number of the change to check. * @return true if delivered. False otherwise. */ - RTPS_DllAPI virtual bool has_been_fully_delivered( + FASTDDS_EXPORTED_API virtual bool has_been_fully_delivered( const SequenceNumber_t& seq_num) const { static_cast(seq_num); @@ -224,7 +221,7 @@ class RTPSWriter * Is only useful in reliable Writer. In BE Writers returns false when pending to be sent. * @return True if acknowledged by all. */ - RTPS_DllAPI virtual bool is_acked_by_all( + FASTDDS_EXPORTED_API virtual bool is_acked_by_all( const CacheChange_t* /*a_change*/) const { return false; @@ -234,7 +231,7 @@ class RTPSWriter * Waits until all changes were acknowledged or max_wait. * @return True if all were acknowledged. */ - RTPS_DllAPI virtual bool wait_for_all_acked( + FASTDDS_EXPORTED_API virtual bool wait_for_all_acked( const Duration_t& /*max_wait*/) { return true; @@ -244,26 +241,26 @@ class RTPSWriter * Update the Attributes of the Writer. * @param att New attributes */ - RTPS_DllAPI virtual void updateAttributes( + FASTDDS_EXPORTED_API virtual void updateAttributes( const WriterAttributes& att) = 0; /** * Get Min Seq Num in History. * @return Minimum sequence number in history */ - RTPS_DllAPI SequenceNumber_t get_seq_num_min(); + FASTDDS_EXPORTED_API SequenceNumber_t get_seq_num_min(); /** * Get Max Seq Num in History. * @return Maximum sequence number in history */ - RTPS_DllAPI SequenceNumber_t get_seq_num_max(); + FASTDDS_EXPORTED_API SequenceNumber_t get_seq_num_max(); /** * Get maximum size of the serialized type * @return Maximum size of the serialized type */ - RTPS_DllAPI uint32_t getTypeMaxSerialized(); + FASTDDS_EXPORTED_API uint32_t getTypeMaxSerialized(); //!Get maximum size of the data uint32_t getMaxDataSize(); @@ -276,12 +273,12 @@ class RTPSWriter * Get listener * @return Listener */ - RTPS_DllAPI inline WriterListener* getListener() + FASTDDS_EXPORTED_API inline WriterListener* getListener() { return mp_listener; } - RTPS_DllAPI inline bool set_listener( + FASTDDS_EXPORTED_API inline bool set_listener( WriterListener* listener) { mp_listener = listener; @@ -292,7 +289,7 @@ class RTPSWriter * Get the publication mode * @return publication mode */ - RTPS_DllAPI inline bool isAsync() const + FASTDDS_EXPORTED_API inline bool isAsync() const { return is_async_; } @@ -302,7 +299,7 @@ class RTPSWriter * @param max Maximum number of changes to remove. * @return at least one change has been removed */ - RTPS_DllAPI bool remove_older_changes( + FASTDDS_EXPORTED_API bool remove_older_changes( unsigned int max = 0); /** @@ -311,7 +308,7 @@ class RTPSWriter * @return Best effort writers always return false. * Reliable writers override this method. */ - RTPS_DllAPI virtual bool get_disable_positive_acks() const + FASTDDS_EXPORTED_API virtual bool get_disable_positive_acks() const { return false; } @@ -345,7 +342,7 @@ class RTPSWriter * @param listener * @return true if successfully added */ - RTPS_DllAPI bool add_statistics_listener( + FASTDDS_EXPORTED_API bool add_statistics_listener( std::shared_ptr listener); /** @@ -353,7 +350,7 @@ class RTPSWriter * @param listener * @return true if successfully removed */ - RTPS_DllAPI bool remove_statistics_listener( + FASTDDS_EXPORTED_API bool remove_statistics_listener( std::shared_ptr listener); /** @@ -361,7 +358,7 @@ class RTPSWriter * * @param enabled_writers The new mask to set */ - RTPS_DllAPI void set_enabled_statistics_writers_mask( + FASTDDS_EXPORTED_API void set_enabled_statistics_writers_mask( uint32_t enabled_writers); /** @@ -370,7 +367,7 @@ class RTPSWriter * @param [out] connection_list of the writer * @return True if could be retrieved */ - RTPS_DllAPI virtual bool get_connections( + FASTDDS_EXPORTED_API virtual bool get_connections( fastdds::statistics::rtps::ConnectionList& connection_list) = 0; #endif // FASTDDS_STATISTICS diff --git a/include/fastdds/rtps/writer/ReaderProxy.h b/include/fastdds/rtps/writer/ReaderProxy.h index 2610e988ce2..39112baf6eb 100644 --- a/include/fastdds/rtps/writer/ReaderProxy.h +++ b/include/fastdds/rtps/writer/ReaderProxy.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include diff --git a/include/fastdds/rtps/writer/StatefulWriter.h b/include/fastdds/rtps/writer/StatefulWriter.h index 04207f2838b..64e8599f15d 100644 --- a/include/fastdds/rtps/writer/StatefulWriter.h +++ b/include/fastdds/rtps/writer/StatefulWriter.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastdds/rtps/writer/StatelessWriter.h b/include/fastdds/rtps/writer/StatelessWriter.h index 9fdaa368852..98c117d95d4 100644 --- a/include/fastdds/rtps/writer/StatelessWriter.h +++ b/include/fastdds/rtps/writer/StatelessWriter.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/fastdds/rtps/writer/WriterDiscoveryInfo.h b/include/fastdds/rtps/writer/WriterDiscoveryInfo.h index c3a1ae2b8b8..9167f72a09a 100644 --- a/include/fastdds/rtps/writer/WriterDiscoveryInfo.h +++ b/include/fastdds/rtps/writer/WriterDiscoveryInfo.h @@ -18,7 +18,7 @@ #ifndef _RTPS_WRITER_WRITERDISCOVERYINFO_H_ #define _RTPS_WRITER_WRITERDISCOVERYINFO_H_ -#include +#include #include namespace eprosima { @@ -36,7 +36,7 @@ struct WriterDiscoveryInfo //!Enum DISCOVERY_STATUS, four different status for discovered writers. //!@ingroup RTPS_MODULE #if defined(_WIN32) - enum RTPS_DllAPI DISCOVERY_STATUS + enum FASTDDS_EXPORTED_API DISCOVERY_STATUS #else enum DISCOVERY_STATUS #endif // if defined(_WIN32) @@ -65,8 +65,8 @@ struct WriterDiscoveryInfo const WriterProxyData& info; }; -} -} -} +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima #endif // _RTPS_WRITER_WRITERDISCOVERYINFO_H_ diff --git a/include/fastdds/rtps/writer/WriterListener.h b/include/fastdds/rtps/writer/WriterListener.h index 4dbd52290de..8932c7d99b9 100644 --- a/include/fastdds/rtps/writer/WriterListener.h +++ b/include/fastdds/rtps/writer/WriterListener.h @@ -37,7 +37,7 @@ struct CacheChange_t; * Class WriterListener with virtual method so the user can implement callbacks to certain events. * @ingroup WRITER_MODULE */ -class RTPS_DllAPI WriterListener +class FASTDDS_EXPORTED_API WriterListener { public: diff --git a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp index 5f254c9af36..e5ab3a6f559 100644 --- a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp @@ -22,12 +22,10 @@ #include +#include #include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace eprosima { namespace fastrtps { @@ -66,7 +64,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t enable_statistics_datawriter( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t enable_statistics_datawriter( const std::string& topic_name, const eprosima::fastdds::dds::DataWriterQos& dwqos); @@ -81,7 +79,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t enable_statistics_datawriter_with_profile( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t enable_statistics_datawriter_with_profile( const std::string& profile_name, const std::string& topic_name); @@ -93,7 +91,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been correctly deleted or does not exist, * and RETCODE_ERROR otherwise */ - RTPS_DllAPI ReturnCode_t disable_statistics_datawriter( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t disable_statistics_datawriter( const std::string& topic_name); /** @@ -102,7 +100,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return Reference to the Statistics DomainParticipant if successful. * nullptr otherwise. */ - RTPS_DllAPI static DomainParticipant* narrow( + FASTDDS_EXPORTED_API static DomainParticipant* narrow( eprosima::fastdds::dds::DomainParticipant* domain_participant); /** @@ -111,7 +109,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return Constant reference to the Statistics DomainParticipant if successful. * nullptr otherwise. */ - RTPS_DllAPI static const DomainParticipant* narrow( + FASTDDS_EXPORTED_API static const DomainParticipant* narrow( const eprosima::fastdds::dds::DomainParticipant* domain_participant); /** @@ -123,7 +121,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * * @note Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t enable_monitor_service(); + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t enable_monitor_service(); /** * Disables the monitor service in this DomainParticipant. Does nothing if the service was not enabled before. @@ -135,7 +133,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * * @note Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - RTPS_DllAPI ReturnCode_t disable_monitor_service(); + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t disable_monitor_service(); /** * fills in the ParticipantProxyData from a MonitorService Message @@ -146,7 +144,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -159,7 +157,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -172,7 +170,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -185,7 +183,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, const statistics::MonitorServiceStatusData& msg); @@ -198,7 +196,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, const statistics::MonitorServiceStatusData& msg); @@ -211,7 +209,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - RTPS_DllAPI ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, const statistics::MonitorServiceStatusData& msg); diff --git a/include/fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp b/include/fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp index 2e286b3269c..d09696544d8 100644 --- a/include/fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp +++ b/include/fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp @@ -20,7 +20,7 @@ #define _FASTDDS_STATISTICS_DDS_PUBLISHER_QOS_DATAWRITERQOS_HPP_ #include -#include +#include namespace eprosima { namespace fastdds { @@ -39,7 +39,7 @@ class DataWriterQos : public eprosima::fastdds::dds::DataWriterQos /** * @brief Constructor */ - RTPS_DllAPI DataWriterQos(); + FASTDDS_EXPORTED_API DataWriterQos(); }; //! Constant to access default Statistics DataWriter Qos diff --git a/include/fastdds/statistics/dds/subscriber/qos/DataReaderQos.hpp b/include/fastdds/statistics/dds/subscriber/qos/DataReaderQos.hpp index 82bc22f8abb..d5bcc23a3c6 100644 --- a/include/fastdds/statistics/dds/subscriber/qos/DataReaderQos.hpp +++ b/include/fastdds/statistics/dds/subscriber/qos/DataReaderQos.hpp @@ -38,7 +38,7 @@ class DataReaderQos : public eprosima::fastdds::dds::DataReaderQos /** * @brief Constructor */ - RTPS_DllAPI DataReaderQos(); + FASTDDS_EXPORTED_API DataReaderQos(); }; /** @@ -53,7 +53,7 @@ class MonitorServiceDataReaderQos : public eprosima::fastdds::dds::DataReaderQos /** * @brief Constructor */ - RTPS_DllAPI MonitorServiceDataReaderQos(); + FASTDDS_EXPORTED_API MonitorServiceDataReaderQos(); }; //! Constant to access default Statistics DataReader Qos diff --git a/include/fastdds/statistics/monitorservice_types.idl b/include/fastdds/statistics/monitorservice_types.idl index ff4bc1393ef..5ae98a8160b 100644 --- a/include/fastdds/statistics/monitorservice_types.idl +++ b/include/fastdds/statistics/monitorservice_types.idl @@ -74,49 +74,50 @@ module statistics { typedef BaseStatus_s InconsistentTopicStatus_s; typedef BaseStatus_s SampleLostStatus_s; - enum StatusKind + module StatusKind { - PROXY, - CONNECTION_LIST, - INCOMPATIBLE_QOS, - INCONSISTENT_TOPIC, - LIVELINESS_LOST, - LIVELINESS_CHANGED, - DEADLINE_MISSED, - SAMPLE_LOST, - STATUSES_SIZE - }; - - union MonitorServiceData switch(StatusKind) + typedef unsigned long StatusKind; + + const StatusKind PROXY = 0; + const StatusKind CONNECTION_LIST = 1; + const StatusKind INCOMPATIBLE_QOS = 2; + const StatusKind INCONSISTENT_TOPIC = 3; + const StatusKind LIVELINESS_LOST = 4; + const StatusKind LIVELINESS_CHANGED = 5; + const StatusKind DEADLINE_MISSED = 6; + const StatusKind SAMPLE_LOST = 7; + const StatusKind STATUSES_SIZE = 8; + }; // module StatusKind + + union MonitorServiceData switch(StatusKind::StatusKind) { - case PROXY: + case StatusKind::PROXY: sequence entity_proxy; - case CONNECTION_LIST: + case StatusKind::CONNECTION_LIST: sequence connection_list; - case INCOMPATIBLE_QOS: + case StatusKind::INCOMPATIBLE_QOS: IncompatibleQoSStatus_s incompatible_qos_status; - case INCONSISTENT_TOPIC: + case StatusKind::INCONSISTENT_TOPIC: InconsistentTopicStatus_s inconsistent_topic_status; - case LIVELINESS_LOST: + case StatusKind::LIVELINESS_LOST: LivelinessLostStatus_s liveliness_lost_status; - case LIVELINESS_CHANGED: + case StatusKind::LIVELINESS_CHANGED: LivelinessChangedStatus_s liveliness_changed_status; - case DEADLINE_MISSED: + case StatusKind::DEADLINE_MISSED: DeadlineMissedStatus_s deadline_missed_status; - case SAMPLE_LOST: + case StatusKind::SAMPLE_LOST: SampleLostStatus_s sample_lost_status; - case STATUSES_SIZE: + case StatusKind::STATUSES_SIZE: octet statuses_size; }; struct MonitorServiceStatusData { @Key detail::GUID_s local_entity; - @Key StatusKind status_kind; + @Key StatusKind::StatusKind status_kind; MonitorServiceData value; }; }; // namespace statisitcs }; // namespace fastdds }; // namespace eprosima - diff --git a/include/fastdds/statistics/rtps/StatisticsCommon.hpp b/include/fastdds/statistics/rtps/StatisticsCommon.hpp index 359bc9c70e2..c40a57e8da0 100644 --- a/include/fastdds/statistics/rtps/StatisticsCommon.hpp +++ b/include/fastdds/statistics/rtps/StatisticsCommon.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace eprosima { diff --git a/include/fastdds/statistics/types.idl b/include/fastdds/statistics/types.idl index 907a62d2544..96654a165b0 100644 --- a/include/fastdds/statistics/types.idl +++ b/include/fastdds/statistics/types.idl @@ -119,54 +119,53 @@ struct PhysicalData string process; }; -@bit_bound(32) -bitmask EventKind +module EventKind { - @position(0) HISTORY2HISTORY_LATENCY, - @position(1) NETWORK_LATENCY, - @position(2) PUBLICATION_THROUGHPUT, - @position(3) SUBSCRIPTION_THROUGHPUT, - @position(4) RTPS_SENT, - @position(5) RTPS_LOST, - @position(6) RESENT_DATAS, - @position(7) HEARTBEAT_COUNT, - @position(8) ACKNACK_COUNT, - @position(9) NACKFRAG_COUNT, - @position(10) GAP_COUNT, - @position(11) DATA_COUNT, - @position(12) PDP_PACKETS, - @position(13) EDP_PACKETS, - @position(14) DISCOVERED_ENTITY, - @position(15) SAMPLE_DATAS, - @position(16) PHYSICAL_DATA + const unsigned long HISTORY2HISTORY_LATENCY = 0x1; + const unsigned long NETWORK_LATENCY = 0x2; + const unsigned long PUBLICATION_THROUGHPUT = 0x4; + const unsigned long SUBSCRIPTION_THROUGHPUT = 0x8; + const unsigned long RTPS_SENT = 0x10; + const unsigned long RTPS_LOST = 0x20; + const unsigned long RESENT_DATAS = 0x40; + const unsigned long HEARTBEAT_COUNT = 0x80; + const unsigned long ACKNACK_COUNT = 0x100; + const unsigned long NACKFRAG_COUNT = 0x200; + const unsigned long GAP_COUNT = 0x400; + const unsigned long DATA_COUNT = 0x800; + const unsigned long PDP_PACKETS = 0x1000; + const unsigned long EDP_PACKETS = 0x2000; + const unsigned long DISCOVERED_ENTITY = 0x4000; + const unsigned long SAMPLE_DATAS = 0x8000; + const unsigned long PHYSICAL_DATA = 0x10000; }; -union Data switch(EventKind) +union Data switch(unsigned long) { - case HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: WriterReaderData writer_reader_data; - case NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: Locator2LocatorData locator2locator_data; - case PUBLICATION_THROUGHPUT: - case SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: EntityData entity_data; - case RTPS_SENT: - case RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: Entity2LocatorTraffic entity2locator_traffic; - case RESENT_DATAS: - case HEARTBEAT_COUNT: - case ACKNACK_COUNT: - case NACKFRAG_COUNT: - case GAP_COUNT: - case DATA_COUNT: - case PDP_PACKETS: - case EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: EntityCount entity_count; - case DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: DiscoveryTime discovery_time; - case SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: SampleIdentityCount sample_identity_count; - case PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: PhysicalData physical_data; }; diff --git a/include/fastrtps/utils/IPFinder.h b/include/fastdds/utils/IPFinder.h similarity index 86% rename from include/fastrtps/utils/IPFinder.h rename to include/fastdds/utils/IPFinder.h index c0ce5010975..1babd66fd4d 100644 --- a/include/fastrtps/utils/IPFinder.h +++ b/include/fastdds/utils/IPFinder.h @@ -20,12 +20,11 @@ #ifndef IPFINDER_H_ #define IPFINDER_H_ - - -#include #include +#include #include +#include #include namespace eprosima { @@ -81,7 +80,7 @@ class IPFinder IPFinder(); virtual ~IPFinder(); - RTPS_DllAPI static bool getIPs( + FASTDDS_EXPORTED_API static bool getIPs( std::vector* vec_name, bool return_loopback = false); @@ -89,36 +88,36 @@ class IPFinder * Get the IP4Adresses in all interfaces. * @param[out] locators List of locators to be populated with the IP4 addresses. */ - RTPS_DllAPI static bool getIP4Address( + FASTDDS_EXPORTED_API static bool getIP4Address( LocatorList_t* locators); /** * Get the IP6Adresses in all interfaces. * @param[out] locators List of locators to be populated with the IP6 addresses. */ - RTPS_DllAPI static bool getIP6Address( + FASTDDS_EXPORTED_API static bool getIP6Address( LocatorList_t* locators); /** * Get all IP Adresses in all interfaces. * @param[out] locators List of locators to be populated with the addresses. */ - RTPS_DllAPI static bool getAllIPAddress( + FASTDDS_EXPORTED_API static bool getAllIPAddress( LocatorList_t* locators); /** * Parses an IP4 string, populating a info_IP with its value. * @param[out] info info_IP to populate. * */ - RTPS_DllAPI static bool parseIP4( + FASTDDS_EXPORTED_API static bool parseIP4( info_IP& info); /** * Parses an IP6 string, populating a info_IP with its value. * @param[out] info info_IP to populate. * */ - RTPS_DllAPI static bool parseIP6( + FASTDDS_EXPORTED_API static bool parseIP6( info_IP& info); - RTPS_DllAPI static std::string getIPv4Address( + FASTDDS_EXPORTED_API static std::string getIPv4Address( const std::string& name); - RTPS_DllAPI static std::string getIPv6Address( + FASTDDS_EXPORTED_API static std::string getIPv6Address( const std::string& name); /** @@ -126,7 +125,7 @@ class IPFinder * Will return all unique MAC addresses for eadh of the interfaces returned by getAllIPAddress * @param[out] macs List of MAC addresses. */ - RTPS_DllAPI static bool getAllMACAddress( + FASTDDS_EXPORTED_API static bool getAllMACAddress( std::vector* macs); }; diff --git a/include/fastrtps/utils/IPLocator.h b/include/fastdds/utils/IPLocator.h similarity index 76% rename from include/fastrtps/utils/IPLocator.h rename to include/fastdds/utils/IPLocator.h index 656da36f3e7..d2df1cde930 100644 --- a/include/fastrtps/utils/IPLocator.h +++ b/include/fastdds/utils/IPLocator.h @@ -49,19 +49,19 @@ class IPLocator * @param portin Port of the locator. * @param locator Locator to be filled. */ - RTPS_DllAPI static void createLocator( + FASTDDS_EXPORTED_API static void createLocator( int32_t kindin, const std::string& address, uint32_t portin, Locator_t& locator); //! Sets locator's IPv4. - RTPS_DllAPI static bool setIPv4( + FASTDDS_EXPORTED_API static bool setIPv4( Locator_t& locator, const unsigned char* addr); //! Sets locator's IPv4. - RTPS_DllAPI static bool setIPv4( + FASTDDS_EXPORTED_API static bool setIPv4( Locator_t& locator, octet o1, octet o2, @@ -69,47 +69,47 @@ class IPLocator octet o4); //! Sets locator's IPv4. - RTPS_DllAPI static bool setIPv4( + FASTDDS_EXPORTED_API static bool setIPv4( Locator_t& locator, const std::string& ipv4); //! Copies locator's IPv4. - RTPS_DllAPI static bool setIPv4( + FASTDDS_EXPORTED_API static bool setIPv4( Locator_t& destlocator, const Locator_t& origlocator); //! Copies locator's IPv4. - RTPS_DllAPI static bool setIPv4address( + FASTDDS_EXPORTED_API static bool setIPv4address( Locator_t& destlocator, const std::string& lan, const std::string& wan, const std::string& ipv4); //! Retrieves locator's IPv4 as octet array. - RTPS_DllAPI static const octet* getIPv4( + FASTDDS_EXPORTED_API static const octet* getIPv4( const Locator_t& locator); //! Check if the locator has IPv4. - RTPS_DllAPI static bool hasIPv4( + FASTDDS_EXPORTED_API static bool hasIPv4( const Locator_t& locator); //! Returns a string representation of the locator's IPv4. - RTPS_DllAPI static std::string toIPv4string( + FASTDDS_EXPORTED_API static std::string toIPv4string( const Locator_t& locator); //! Copies locator's IPv4. - RTPS_DllAPI static bool copyIPv4( + FASTDDS_EXPORTED_API static bool copyIPv4( const Locator_t& locator, unsigned char* dest); // IPv6 //! Sets locator's IPv6. - RTPS_DllAPI static bool setIPv6( + FASTDDS_EXPORTED_API static bool setIPv6( Locator_t& locator, const unsigned char* addr); //! Sets locator's IPv6. - RTPS_DllAPI static bool setIPv6( + FASTDDS_EXPORTED_API static bool setIPv6( Locator_t& locator, uint16_t group0, uint16_t group1, @@ -121,63 +121,63 @@ class IPLocator uint16_t group7); //! Sets locator's IPv6. - RTPS_DllAPI static bool setIPv6( + FASTDDS_EXPORTED_API static bool setIPv6( Locator_t& locator, const std::string& ipv6); //! Copies locator's IPv6. - RTPS_DllAPI static bool setIPv6( + FASTDDS_EXPORTED_API static bool setIPv6( Locator_t& destlocator, const Locator_t& origlocator); //! Retrieves locator's IPv6 as octet array. - RTPS_DllAPI static const octet* getIPv6( + FASTDDS_EXPORTED_API static const octet* getIPv6( const Locator_t& locator); //! Check if the locator has IPv6. - RTPS_DllAPI static bool hasIPv6( + FASTDDS_EXPORTED_API static bool hasIPv6( const Locator_t& locator); //! Returns a string representation of the locator's IPv6 following RFC 5952 recommendation. - RTPS_DllAPI static std::string toIPv6string( + FASTDDS_EXPORTED_API static std::string toIPv6string( const Locator_t& locator); //! Copies locator's IPv6. - RTPS_DllAPI static bool copyIPv6( + FASTDDS_EXPORTED_API static bool copyIPv6( const Locator_t& locator, unsigned char* dest); //! Sets locator's IP - RTPS_DllAPI static bool ip( + FASTDDS_EXPORTED_API static bool ip( Locator_t& locator, const std::string& ip); //! Returns a string representation of the locator's IP. - RTPS_DllAPI static std::string ip_to_string( + FASTDDS_EXPORTED_API static std::string ip_to_string( const Locator_t& locator); // TCP //! Sets locator's logical port (as in RTCP protocol) - RTPS_DllAPI static bool setLogicalPort( + FASTDDS_EXPORTED_API static bool setLogicalPort( Locator_t& locator, uint16_t port); //! Gets locator's logical port (as in RTCP protocol) - RTPS_DllAPI static uint16_t getLogicalPort( + FASTDDS_EXPORTED_API static uint16_t getLogicalPort( const Locator_t& locator); //! Sets locator's physical port (as in RTCP protocol) - RTPS_DllAPI static bool setPhysicalPort( + FASTDDS_EXPORTED_API static bool setPhysicalPort( Locator_t& locator, uint16_t port); //! Gets locator's physical port (as in RTCP protocol) - RTPS_DllAPI static uint16_t getPhysicalPort( + FASTDDS_EXPORTED_API static uint16_t getPhysicalPort( const Locator_t& locator); // TCPv4 //! Sets locator's WAN address (as in RTCP protocol) - RTPS_DllAPI static bool setWan( + FASTDDS_EXPORTED_API static bool setWan( Locator_t& locator, octet o1, octet o2, @@ -185,96 +185,96 @@ class IPLocator octet o4); //! Sets locator's WAN address (as in RTCP protocol) - RTPS_DllAPI static bool setWan( + FASTDDS_EXPORTED_API static bool setWan( Locator_t& locator, const std::string& wan); //! Gets locator's WAN address (as in RTCP protocol) - RTPS_DllAPI static const octet* getWan( + FASTDDS_EXPORTED_API static const octet* getWan( const Locator_t& locator); //! Checks if the locator has WAN address (as in RTCP protocol) - RTPS_DllAPI static bool hasWan( + FASTDDS_EXPORTED_API static bool hasWan( const Locator_t& locator); //! Retrieves a string representation of the locator's WAN address (as in RTCP protocol) - RTPS_DllAPI static std::string toWanstring( + FASTDDS_EXPORTED_API static std::string toWanstring( const Locator_t& locator); //! This method is useful in the case of having a tcp client with an initial peer //! pointing to a WAN locator, and receiving a locator with LAN and WAN //! addresses (TCP Client from TCP Server) - RTPS_DllAPI static Locator_t WanToLanLocator( + FASTDDS_EXPORTED_API static Locator_t WanToLanLocator( const Locator_t& locator); //! Sets locator's LAN ID (as in RTCP protocol) - RTPS_DllAPI static bool setLanID( + FASTDDS_EXPORTED_API static bool setLanID( Locator_t& locator, const std::string& lanId); //! Gets locator's LAN ID (as in RTCP protocol) - RTPS_DllAPI static const octet* getLanID( + FASTDDS_EXPORTED_API static const octet* getLanID( const Locator_t& locator); //! Retrieves a string representation of the locator's LAN ID (as in RTCP protocol) - RTPS_DllAPI static std::string toLanIDstring( + FASTDDS_EXPORTED_API static std::string toLanIDstring( const Locator_t& locator); //! Returns a new locator without logical port (as in RTCP protocol). - RTPS_DllAPI static Locator_t toPhysicalLocator( + FASTDDS_EXPORTED_API static Locator_t toPhysicalLocator( const Locator_t& locator); //! Checks if a locator WAN address and IP address are the same (as in RTCP protocol). - RTPS_DllAPI static bool ip_equals_wan( + FASTDDS_EXPORTED_API static bool ip_equals_wan( const Locator_t& locator); // Common //! Sets locator's RTCP port. Physical for UDP and logical for TCP (as in RTCP protocol) - RTPS_DllAPI static bool setPortRTPS( + FASTDDS_EXPORTED_API static bool setPortRTPS( Locator_t& locator, uint16_t port); //! Gets locator's RTCP port. Physical for UDP and logical for TCP (as in RTCP protocol) - RTPS_DllAPI static uint16_t getPortRTPS( + FASTDDS_EXPORTED_API static uint16_t getPortRTPS( Locator_t& locator); //! Checks if a locator has local IP address. - RTPS_DllAPI static bool isLocal( + FASTDDS_EXPORTED_API static bool isLocal( const Locator_t& locator); //! Checks if a locator has any IP address. - RTPS_DllAPI static bool isAny( + FASTDDS_EXPORTED_API static bool isAny( const Locator_t& locator); //! Checks if both locators has the same IP address. - RTPS_DllAPI static bool compareAddress( + FASTDDS_EXPORTED_API static bool compareAddress( const Locator_t& loc1, const Locator_t& loc2, bool fullAddress = false); //! Checks if a both locators has the same IP address and physical port (as in RTCP protocol). - RTPS_DllAPI static bool compareAddressAndPhysicalPort( + FASTDDS_EXPORTED_API static bool compareAddressAndPhysicalPort( const Locator_t& loc1, const Locator_t& loc2); //! Returns a string representation of the given locator. - RTPS_DllAPI static std::string to_string( + FASTDDS_EXPORTED_API static std::string to_string( const Locator_t& locator); // UDP //! Checks if the locator has a multicast IP address. - RTPS_DllAPI static bool isMulticast( + FASTDDS_EXPORTED_API static bool isMulticast( const Locator_t& locator); //! Resolve an address name by a DNS request and return the IP that this address references by a DNS server - RTPS_DllAPI static std::pair, std::set> resolveNameDNS( + FASTDDS_EXPORTED_API static std::pair, std::set> resolveNameDNS( const std::string& address_name); //! Check whether a string contains an IPv4 format - RTPS_DllAPI static bool isIPv4( + FASTDDS_EXPORTED_API static bool isIPv4( const std::string& address); //! Check whether a string contains an IPv6 format - RTPS_DllAPI static bool isIPv6( + FASTDDS_EXPORTED_API static bool isIPv6( const std::string& address); protected: diff --git a/include/fastrtps/utils/TimedConditionVariable.hpp b/include/fastdds/utils/TimedConditionVariable.hpp similarity index 99% rename from include/fastrtps/utils/TimedConditionVariable.hpp rename to include/fastdds/utils/TimedConditionVariable.hpp index d2c4a795336..dbbb3e1267d 100644 --- a/include/fastrtps/utils/TimedConditionVariable.hpp +++ b/include/fastdds/utils/TimedConditionVariable.hpp @@ -18,7 +18,8 @@ #ifndef _UTILS_TIMEDCONDITIONVARIABLE_HPP_ #define _UTILS_TIMEDCONDITIONVARIABLE_HPP_ -#include + +#include /* NOTE: Windows implementation temporary disabled due to aleatory high CPU consumption when diff --git a/include/fastrtps/utils/TimedMutex.hpp b/include/fastdds/utils/TimedMutex.hpp similarity index 100% rename from include/fastrtps/utils/TimedMutex.hpp rename to include/fastdds/utils/TimedMutex.hpp diff --git a/include/fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp b/include/fastdds/utils/collections/ResourceLimitedContainerConfig.hpp similarity index 100% rename from include/fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp rename to include/fastdds/utils/collections/ResourceLimitedContainerConfig.hpp diff --git a/include/fastrtps/utils/collections/ResourceLimitedVector.hpp b/include/fastdds/utils/collections/ResourceLimitedVector.hpp similarity index 100% rename from include/fastrtps/utils/collections/ResourceLimitedVector.hpp rename to include/fastdds/utils/collections/ResourceLimitedVector.hpp diff --git a/include/fastrtps/utils/fixed_size_bitmap.hpp b/include/fastdds/utils/fixed_size_bitmap.hpp similarity index 100% rename from include/fastrtps/utils/fixed_size_bitmap.hpp rename to include/fastdds/utils/fixed_size_bitmap.hpp diff --git a/include/fastdds/utils/md5.h b/include/fastdds/utils/md5.h new file mode 100644 index 00000000000..20eda395745 --- /dev/null +++ b/include/fastdds/utils/md5.h @@ -0,0 +1,160 @@ +/* MD5 + converted to C++ class by Frank Thilo (thilo@unix-ag.org) + for bzflag (http://www.bzflag.org) + + based on: + + md5.h and md5.c + reference implementation of RFC 1321 + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + rights reserved. + + License to copy and use this software is granted provided that it + is identified as the "RSA Data Security, Inc. MD5 Message-Digest + Algorithm" in all material mentioning or referencing this software + or this function. + + License is also granted to make and use derivative works provided + that such works are identified as "derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm" in all material + mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided "as is" + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + + */ + +#ifndef BZF_MD5_H +#define BZF_MD5_H + +#include +#include + +#include +/** + * Class MD5, for calculating MD5 hashes of strings or byte arrays + * it is not meant to be fast or secure + * + * usage: 1) feed it blocks of uchars with update() + * 2) finalize() + * 3) get hexdigest() string + * or + * MD5(std::string).hexdigest() + * + * assumes that char is 8 bit and int is 32 bit + * @ingroup UTILITIES_MODULE + */ +class FASTDDS_EXPORTED_API MD5 +{ +public: + + typedef unsigned char uint1; // 8bit + typedef unsigned int size_type; // must be 32bit + + MD5(); + MD5( + const std::string& text); + void update( + const unsigned char* buf, + size_type length); + void update( + const char* buf, + size_type length); + MD5& finalize(); + std::string hexdigest() const; + friend std::ostream& operator <<( + std::ostream&, + MD5& md5); + uint1 digest[16]; // the result + + void init(); + +private: + + typedef unsigned int uint4; // 32bit + enum + { + blocksize = 64 + }; // VC6 won't eat a const static int here + + void transform( + const uint1 block[blocksize]); + static void decode( + uint4 output[], + const uint1 input[], + size_type len); + static void encode( + uint1 output[], + const uint4 input[], + size_type len); + + bool finalized; + uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk + uint4 count[2]; // 64bit counter for number of bits (lo, hi) + uint4 state[4]; // digest so far + + // low level logic operations + static inline uint4 F( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 G( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 H( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 I( + uint4 x, + uint4 y, + uint4 z); + static inline uint4 rotate_left( + uint4 x, + int n); + static inline void FF( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void GG( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void HH( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); + static inline void II( + uint4& a, + uint4 b, + uint4 c, + uint4 d, + uint4 x, + uint4 s, + uint4 ac); +}; + +std::string md5( + const std::string str); + +#endif // ifndef BZF_MD5_H + diff --git a/include/fastrtps/Domain.h b/include/fastrtps/Domain.h deleted file mode 100644 index db99b55fcd4..00000000000 --- a/include/fastrtps/Domain.h +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Domain.h - * - */ - -#ifndef DOMAIN_H_ -#define DOMAIN_H_ - -#include -#include -#include - -#ifdef USE_DEPRECATION -#if defined(__GNUC__) || defined(__clang__) -#define DEPRECATED __attribute__ ((deprecated)) -#elif defined(_MSC_VER) -#define DEPRECATED __declspec(deprecated) -#else -#define DEPRECATED /** --Deprecated-- */ -#endif // if defined(__GNUC__) || defined(__clang__) -#else -#define DEPRECATED -#endif // ifdef USE_DEPRECATION - -namespace eprosima { -namespace fastrtps { - -class ParticipantListener; -class Participant; -class ParticipantImpl; -class Publisher; -class PublisherAttributes; -class PublisherListener; -class Subscriber; -class SubscriberAttributes; -class SubscriberListener; - -namespace types { -class DynamicPubSubType; -} // namespace types - -/** - * Class Domain, use to interact with the Publisher Subscriber API of the Fast RTPS implementation. - * @ingroup FASTRTPS_MODULE - */ -class Domain -{ -public: - - /** - * Create a Participant from a profile name. - * @param participant_profile Participant profile name. - * @param listen ParticipantListener Pointer. - * @return Participant pointer. (nullptr if not created.) - */ - RTPS_DllAPI DEPRECATED static Participant* createParticipant( - const std::string& participant_profile, - ParticipantListener* listen = nullptr); - - /** - * Create a Participant. - * @param att Participant Attributes. - * @param listen ParticipantListener Pointer. - * @return Participant pointer. (nullptr if not created.) - */ - RTPS_DllAPI DEPRECATED static Participant* createParticipant( - const ParticipantAttributes& att, - ParticipantListener* listen = nullptr); - - //!Fills participant_attributes with the default values. - RTPS_DllAPI static void getDefaultParticipantAttributes( - ParticipantAttributes& participant_attributes); - - /** - * Create a Publisher in a Participant from a profile name. - * @param part Pointer to the participant where you want to create the Publisher. - * @param publisher_profile Publisher profile name. - * @param listen Pointer to the PublisherListener. - * @return Pointer to the created Publisher (nullptr if not created). - */ - RTPS_DllAPI static Publisher* createPublisher( - Participant* part, - const std::string& publisher_profile, - PublisherListener* listen = nullptr); - - /** - * Create a Publisher in a Participant. - * @param part Pointer to the participant where you want to create the Publisher. - * @param att PublisherAttributes. - * @param listen Pointer to the PublisherListener. - * @return Pointer to the created Publisher (nullptr if not created). - */ - RTPS_DllAPI static Publisher* createPublisher( - Participant* part, - const PublisherAttributes& att, - PublisherListener* listen = nullptr); - - //!Fills publisher_attributes with the default values. - RTPS_DllAPI static void getDefaultPublisherAttributes( - PublisherAttributes& publisher_attributes); - - /** - * Create a Subscriber in a Participant from a profile name. - * @param part Pointer to the participant where you want to create the Publisher. - * @param subscriber_profile Subscriber profile name. - * @param listen Pointer to the SubscriberListener. - * @return Pointer to the created Subscriber (nullptr if not created). - */ - RTPS_DllAPI static Subscriber* createSubscriber( - Participant* part, - const std::string& subscriber_profile, - SubscriberListener* listen = nullptr); - - /** - * Create a Subscriber in a Participant. - * @param part Pointer to the participant where you want to create the Publisher. - * @param att SubscriberAttributes. - * @param listen Pointer to the SubscriberListener. - * @return Pointer to the created Subscriber (nullptr if not created). - */ - RTPS_DllAPI static Subscriber* createSubscriber( - Participant* part, - const SubscriberAttributes& att, - SubscriberListener* listen = nullptr); - - //!Fills subscriber_attributes with the default values. - RTPS_DllAPI static void getDefaultSubscriberAttributes( - SubscriberAttributes& subscriber_attributes); - - /** - * Remove a Participant and all associated publishers and subscribers. - * @param part Pointer to the participant. - * @return True if correctly removed. - */ - RTPS_DllAPI static bool removeParticipant( - Participant* part); - - /** - * Remove a Publisher. - * @param pub Pointer to the Publisher. - * @return True if correctly removed. - */ - RTPS_DllAPI static bool removePublisher( - Publisher* pub); - - /** - * Remove a Subscriber. - * @param sub Pointer to the Subscriber. - * @return True if correctly removed. - */ - RTPS_DllAPI static bool removeSubscriber( - Subscriber* sub); - - /** - * Return a registered type. - * @param part Pointer to the Participant. - * @param typeName Name of the type. - * @param type Returned type. - * @return True if type was found. - */ - RTPS_DllAPI static bool getRegisteredType( - Participant* part, - const char* typeName, - fastdds::dds::TopicDataType** type); - - /** - * Register a type in a participant. - * @param part Pointer to the Participant. - * @param type Pointer to the Type. - * @return True if correctly registered. - */ - RTPS_DllAPI static bool registerType( - Participant* part, - fastdds::dds::TopicDataType* type); - - /** - * Register a type in a participant. - * @param part Pointer to the Participant. - * @param type Pointer to the Type. - * @return True if correctly registered. - */ - RTPS_DllAPI static bool registerDynamicType( - Participant* part, - types::DynamicPubSubType* type); - - /** - * Unregister a type in a participant. - * @param part Pointer to the Participant. - * @param typeName Name of the type. - * @return True if correctly unregistered. - */ - RTPS_DllAPI static bool unregisterType( - Participant* part, - const char* typeName); - - /** - * Stop and remove all participants, publishers and subscribers in this Domain. - */ - RTPS_DllAPI static void stopAll(); - - /** - * Load profiles from XML file. - * @param xml_profile_file XML profile file. - * @return True if correctly loaded. - */ - RTPS_DllAPI static bool loadXMLProfilesFile( - const std::string& xml_profile_file); - - /** - * Load profiles from XML string. - * @param data buffer containing XML data. - * @param length length of data. - * @return True if correctly loaded. - */ - RTPS_DllAPI static bool loadXMLProfilesString( - const char* data, - size_t length); - -private: - - typedef std::pair t_p_Participant; - - Domain(); - - virtual ~Domain(); - - static std::mutex m_mutex; - - static std::vector m_participants; - - static bool default_xml_profiles_loaded; -}; - -} /* namespace */ -} /* namespace eprosima */ - -#endif /* DOMAIN_H_ */ diff --git a/include/fastrtps/attributes/ParticipantAttributes.h b/include/fastrtps/attributes/ParticipantAttributes.h deleted file mode 100644 index 2ba001c0860..00000000000 --- a/include/fastrtps/attributes/ParticipantAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ParticipantAttributes.h - * - */ - -#ifndef PARTICIPANTATTRIBUTES_H_ -#define PARTICIPANTATTRIBUTES_H_ - -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class ParticipantAttributes, used by the user to define the attributes of a Participant. - * The Participants in the Publisher-Subscriber layer are only a container to a RTPSParticipant, so their attributes are the same. - * Still to maintain the equivalence this class is used to define them. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE - */ -class ParticipantAttributes -{ -public: - - //! DomainId to be used by the associated RTPSParticipant (default: 0) - uint32_t domainId = 0; - - //!Attributes of the associated RTPSParticipant. - rtps::RTPSParticipantAttributes rtps; - - ParticipantAttributes() - { - } - - virtual ~ParticipantAttributes() - { - } - - bool operator ==( - const ParticipantAttributes& b) const - { - return (this->domainId == b.domainId && this->rtps == b.rtps); - } - -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif /* PARTICIPANTATTRIBUTES_H_ */ diff --git a/include/fastrtps/attributes/PublisherAttributes.h b/include/fastrtps/attributes/PublisherAttributes.h deleted file mode 100644 index 1cba9819345..00000000000 --- a/include/fastrtps/attributes/PublisherAttributes.h +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PublisherAttributes.h - */ - -#ifndef PUBLISHERATTRIBUTES_H_ -#define PUBLISHERATTRIBUTES_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class PublisherAttributes, used by the user to define the attributes of a Publisher. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE - */ -class PublisherAttributes -{ -public: - - PublisherAttributes() = default; - - virtual ~PublisherAttributes() = default; - - bool operator ==( - const PublisherAttributes& b) const - { - return (this->m_userDefinedID == b.m_userDefinedID) && - (this->m_entityID == b.m_entityID) && - (this->topic == b.topic) && - (this->qos == b.qos) && - (this->times == b.times) && - (this->unicastLocatorList == b.unicastLocatorList) && - (this->multicastLocatorList == b.multicastLocatorList) && - (this->remoteLocatorList == b.remoteLocatorList) && - (this->historyMemoryPolicy == b.historyMemoryPolicy) && - (this->properties == b.properties); - } - - //! Topic Attributes for the Publisher - TopicAttributes topic; - - //! QOS for the Publisher - WriterQos qos; - - //! Writer Attributes - rtps::WriterTimes times; - - //! Unicast locator list - rtps::LocatorList_t unicastLocatorList; - - //! Multicast locator list - rtps::LocatorList_t multicastLocatorList; - - //! Remote locator list - rtps::LocatorList_t remoteLocatorList; - - //! The collection of external locators to use for communication. - fastdds::rtps::ExternalLocators external_unicast_locators; - - //! Whether locators that don't match with the announced locators should be kept. - bool ignore_non_matching_locators = false; - - //! Throughput controller - rtps::ThroughputControllerDescriptor throughputController; - - //! Underlying History memory policy - rtps::MemoryManagementPolicy_t historyMemoryPolicy = - rtps::MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - - //! Properties - rtps::PropertyPolicy properties; - - //! Allocation limits on the matched subscribers collections - ResourceLimitedContainerConfig matched_subscriber_allocation; - - /** - * Get the user defined ID - * @return User defined ID - */ - inline int16_t getUserDefinedID() const - { - return m_userDefinedID; - } - - /** - * Get the entity defined ID - * @return Entity ID - */ - inline int16_t getEntityID() const - { - return m_entityID; - } - - /** - * Set the user defined ID - * @param id User defined ID to be set - */ - inline void setUserDefinedID( - uint8_t id) - { - m_userDefinedID = id; - } - - /** - * Set the entity ID - * @param id Entity ID to be set - */ - inline void setEntityID( - uint8_t id) - { - m_entityID = id; - } - -private: - - //! User Defined ID, used for StaticEndpointDiscovery, default value -1. - int16_t m_userDefinedID = -1; - //! Entity ID, if the user want to specify the EntityID of the enpoint, default value -1. - int16_t m_entityID = -1; -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif /* PUBLISHERATTRIBUTES_H_ */ diff --git a/include/fastrtps/attributes/SubscriberAttributes.h b/include/fastrtps/attributes/SubscriberAttributes.h deleted file mode 100644 index f799fd51c45..00000000000 --- a/include/fastrtps/attributes/SubscriberAttributes.h +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberAttributes.h - */ - -#ifndef SUBSCRIBERATTRIBUTES_H_ -#define SUBSCRIBERATTRIBUTES_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class SubscriberAttributes, used by the user to define the attributes of a Subscriber. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE - */ -class SubscriberAttributes -{ -public: - - //! Topic Attributes - TopicAttributes topic; - - //! Reader QOs. - ReaderQos qos; - - //! Times for a RELIABLE Reader - rtps::ReaderTimes times; - - //! Unicast locator list - rtps::LocatorList_t unicastLocatorList; - - //! Multicast locator list - rtps::LocatorList_t multicastLocatorList; - - //! Remote locator list - rtps::LocatorList_t remoteLocatorList; - - //! The collection of external locators to use for communication. - fastdds::rtps::ExternalLocators external_unicast_locators; - - //! Whether locators that don't match with the announced locators should be kept. - bool ignore_non_matching_locators = false; - - //! Expects Inline QOS - bool expectsInlineQos = false; - - //! Underlying History memory policy - rtps::MemoryManagementPolicy_t historyMemoryPolicy = rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - - //! Properties - rtps::PropertyPolicy properties; - - //! Matched publishers allocation limits - ResourceLimitedContainerConfig matched_publisher_allocation; - - SubscriberAttributes() = default; - - virtual ~SubscriberAttributes() = default; - - bool operator ==( - const SubscriberAttributes& b) const - { - return (this->topic == b.topic) && - (this->qos == b.qos) && - (this->times == b.times) && - (this->unicastLocatorList == b.unicastLocatorList) && - (this->multicastLocatorList == b.multicastLocatorList) && - (this->remoteLocatorList == b.remoteLocatorList) && - (this->historyMemoryPolicy == b.historyMemoryPolicy) && - (this->properties == b.properties); - } - - bool operator !=( - const SubscriberAttributes& b) const - { - return !(*this == b); - } - - /** - * Get the user defined ID - * @return User defined ID - */ - inline int16_t getUserDefinedID() const - { - return m_userDefinedID; - } - - /** - * Get the entity defined ID - * @return Entity ID - */ - inline int16_t getEntityID() const - { - return m_entityID; - } - - /** - * Set the user defined ID - * @param id User defined ID to be set - */ - inline void setUserDefinedID( - uint8_t id) - { - m_userDefinedID = id; - } - - /** - * Set the entity ID - * @param id Entity ID to be set - */ - inline void setEntityID( - uint8_t id) - { - m_entityID = id; - } - -private: - - //! User Defined ID, used for StaticEndpointDiscovery, default value -1. - int16_t m_userDefinedID = -1; - - //! Entity ID, if the user want to specify the EntityID of the enpoint, default value -1. - int16_t m_entityID = -1; -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* SUBSCRIBERPARAMS_H_ */ diff --git a/include/fastrtps/attributes/TopicAttributes.h b/include/fastrtps/attributes/TopicAttributes.h deleted file mode 100644 index d02c082fe29..00000000000 --- a/include/fastrtps/attributes/TopicAttributes.h +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TopicAttributes.h - */ - -#ifndef TOPICPARAMETERS_H_ -#define TOPICPARAMETERS_H_ - -#include - -#include -#include - - -namespace eprosima { -namespace fastrtps{ - -/** - * Class TopicAttributes, used by the user to define the attributes of the topic associated with a Publisher or Subscriber. - * @ingroup FASTRTPS_ATTRIBUTES_MODULE - */ -class TopicAttributes -{ -public: - - /** - * Default constructor - */ - TopicAttributes() - : topicKind(rtps::NO_KEY) - , topicName("UNDEF") - , topicDataType("UNDEF") - , auto_fill_type_object(true) - , auto_fill_type_information(true) - { - } - - //!Constructor, you need to provide the topic name and the topic data type. - TopicAttributes( - const char* name, - const char* dataType, - rtps::TopicKind_t tKind= rtps::NO_KEY) - { - topicKind = tKind; - topicName = name; - topicDataType = dataType; - auto_fill_type_object = true; - auto_fill_type_information = true; - } - - virtual ~TopicAttributes() {} - - bool operator==(const TopicAttributes& b) const - { - return (this->topicKind == b.topicKind) && - (this->topicName == b.topicName) && - (this->topicDataType == b.topicDataType) && - (this->historyQos == b.historyQos); - } - - /** - * Get the topic data type - * @return Topic data type - */ - const string_255& getTopicDataType() const { - return topicDataType; - } - - /** - * Get the topic kind - * @return Topic kind - */ - rtps::TopicKind_t getTopicKind() const { - return topicKind; - } - - /** - * Get the topic name - * @return Topic name - */ - const string_255& getTopicName() const { - return topicName; - } - - //! TopicKind_t, default value NO_KEY. - rtps::TopicKind_t topicKind; - //! Topic Name. - string_255 topicName; - //!Topic Data Type. - string_255 topicDataType; - //!QOS Regarding the History to be saved. - HistoryQosPolicy historyQos; - //!QOS Regarding the resources to allocate. - ResourceLimitsQosPolicy resourceLimitsQos; - //!Type Identifier XTYPES 1.1 - TypeIdV1 type_id; - //!Type Object XTYPES 1.1 - TypeObjectV1 type; - //!XTYPES 1.2 - xtypes::TypeInformation type_information; - //!Tries to complete type identifier and type object (TypeObjectV1) - bool auto_fill_type_object; - //!Tries to complete type information (TypeObjectV2) - bool auto_fill_type_information; - - /** - * Method to check whether the defined QOS are correct. - * @return True if they are valid. - */ - bool checkQos() const; -}; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -/** - * Check if two topic attributes are not equal - * @param t1 First instance of TopicAttributes to compare - * @param t2 Second instance of TopicAttributes to compare - * @return True if the instances are not equal. False if the instances are equal. - */ -bool inline operator!=(const TopicAttributes& t1, const TopicAttributes& t2) -{ - if(t1.topicKind != t2.topicKind - || t1.topicName != t2.topicName - || t1.topicDataType != t2.topicDataType - || t1.historyQos.kind != t2.historyQos.kind - || (t1.historyQos.kind == KEEP_LAST_HISTORY_QOS && t1.historyQos.depth != t2.historyQos.depth)) - { - return true; - } - return false; -} -#endif - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* TOPICPARAMETERS_H_ */ diff --git a/include/fastrtps/attributes/all_attributes.h b/include/fastrtps/attributes/all_attributes.h deleted file mode 100644 index 6a4dfa84fba..00000000000 --- a/include/fastrtps/attributes/all_attributes.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file all_attributes.h - */ - -#ifndef ALL_ATTRIBUTES_H_ -#define ALL_ATTRIBUTES_H_ - -#include -#include -#include -#include -#include -#include - -#endif /* ALL_ATTRIBUTES_H_ */ diff --git a/include/fastrtps/config/doxygen_modules.h b/include/fastrtps/config/doxygen_modules.h index 9df7c40aa50..de263a30fdc 100644 --- a/include/fastrtps/config/doxygen_modules.h +++ b/include/fastrtps/config/doxygen_modules.h @@ -22,30 +22,27 @@ //Description of doxygen modules, not used in actual code. /*! - * @defgroup FASTRTPS_GENERAL_API eProsima Fast RTPS API Reference - * @brief eProsima Fast RTPS API grouped in modules. + * @defgroup FASTDDS_GENERAL_API eProsima Fast DDS API Reference + * @brief eProsima Fast DDS API grouped in modules. */ - - /*! * @defgroup RTPS_MODULE RTPS - * @ingroup FASTRTPS_GENERAL_API + * @ingroup FASTDDS_GENERAL_API * @brief RTPS API * This is an implementation of the RTPS communication standard defined by the OMG. */ - /*! - * @defgroup FASTRTPS_MODULE Publisher Subscriber Public API - * @ingroup FASTRTPS_GENERAL_API - * @brief Publisher Subscriber Public API - * This Module contains the Publisher Subscriber Layer created to facilitate the use of the RTPS protocol. + * @defgroup FASTDDS_MODULE DDS Public API + * @ingroup FASTDDS_GENERAL_API + * @brief DDS Public API + * This Module contains the DDS Layer defined by the OMG. */ -/** @defgroup FASTRTPS_ATTRIBUTES_MODULE Fast RTPS Attributes Module. - * @ingroup FASTRTPS_MODULE - * @brief Attributes class used to define the public entities that the user should use to control this library. +/** @defgroup FASTDDS_QOS_MODULE Fast DDS Quality of Service (QoS) Module. + * @ingroup FASTDDS_MODULE + * @brief QOS class used to define the public entities that the user should use to control this library. */ /** @defgroup RTPS_ATTRIBUTES_MODULE RTPS Attributes Module. @@ -53,7 +50,6 @@ * @brief Attributes class used to define the public entities that the user should use to control this library. */ - /** @defgroup COMMON_MODULE Common Module. * @ingroup RTPS_MODULE * Common structures used by multiple elements. @@ -61,8 +57,7 @@ /** @defgroup NETWORK_MODULE Network Module * @ingroup RTPS_MODULE - * Includes the elements necessary to interface between the - * transport layer and the FastRTPS library. + * Includes the elements necessary to interface between the transport layer and the Fast DDS library. */ /** @defgroup TRANSPORT_MODULE Transport Module. @@ -98,9 +93,9 @@ */ /** @defgroup MANAGEMENT_MODULE Management Module - * @ingroup FASTRTPS_GENERAL_API - * This module contains classes and methods associated with the management of all other objects. The most important ones - * are the communication (ResourceSend and ResourceListen) and event (ResourceEvent) resources. + * @ingroup FASTDDS_GENERAL_API + * This module contains classes and methods associated with the management of all other objects. + * The most important ones are the communication (ResourceSend and ResourceListen) and event (ResourceEvent) resources. */ /** @defgroup BUILTIN_MODULE Builtin Protocols Module @@ -126,23 +121,18 @@ #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC /** @defgroup UTILITIES_MODULE Shared Utilities - * @ingroup FASTRTPS_GENERAL_API - * Shared utilities that can be used by one or more classes in different modules. They are not strictly part of the RTPS implementation - * but very useful to implement different functionalities. + * @ingroup FASTDDS_GENERAL_API + * Shared utilities that can be used by one or more classes in different modules. + * They are not strictly part of the RTPS implementation but very useful to implement different functionalities. */ /** * @namespace eprosima eProsima namespace. - * @ingroup FASTRTPS_GENERAL_API - */ - -/** - * @namespace eprosima::fastrtps Contains the publisher subscriber layer. - * @ingroup FASTRTPS_MODULE + * @ingroup FASTDDS_GENERAL_API */ /** - * @namespace eprosima::fastrtps::rtps Contains the RTPS protocol implementation + * @namespace eprosima::fastdds::rtps Contains the RTPS protocol implementation * @ingroup RTPS_MODULE */ diff --git a/include/fastrtps/eProsima_auto_link.h b/include/fastrtps/eProsima_auto_link.h deleted file mode 100644 index 9819c40bfee..00000000000 --- a/include/fastrtps/eProsima_auto_link.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - Expected defines. - - - EPROSIMA_LIB_NAME - - FASTRTPS_VERSION_MAJOR - - FASTRTPS_VERSION_MINOR -*/ - -#if defined(_MSC_VER) - #define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X) - #define EPROSIMA_DO_STRINGIZE(X) #X - - #if defined(_DEBUG) - #define EPROSIMA_LIB_DEBUG_TAG "d" - #else - #define EPROSIMA_LIB_DEBUG_TAG - #endif // _DEBUG - - // Select linkage option. - #if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK) - #define EPROSIMA_LIB_PREFIX - #elif defined(EPROSIMA_DYN_LINK) - #error "Mixing a dll eprosima library with a static runtime is a bad idea" - #else - #define EPROSIMA_LIB_PREFIX "lib" - #endif - - // Include library - #if defined(EPROSIMA_LIB_NAME) \ - && defined(EPROSIMA_LIB_PREFIX) \ - && defined(EPROSIMA_LIB_DEBUG_TAG) \ - && defined(FASTRTPS_VERSION_MAJOR) \ - && defined(FASTRTPS_VERSION_MINOR) - #pragma comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG "-" EPROSIMA_STRINGIZE(FASTRTPS_VERSION_MAJOR) "." EPROSIMA_STRINGIZE(FASTRTPS_VERSION_MINOR) ".lib") - #else - #error "Some required macros where not defined" - #endif - -#endif // _MSC_VER - -// Undef macros -#ifdef EPROSIMA_LIB_PREFIX -#undef EPROSIMA_LIB_PREFIX -#endif - -#ifdef EPROSIMA_LIB_NAME -#undef EPROSIMA_LIB_NAME -#endif - -#ifdef EPROSIMA_LIB_DEBUG_TAG -#undef EPROSIMA_LIB_DEBUG_TAG -#endif diff --git a/include/fastrtps/fastrtps_all.h b/include/fastrtps/fastrtps_all.h deleted file mode 100644 index 7b63aa0ae72..00000000000 --- a/include/fastrtps/fastrtps_all.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file rtps_all.h - * - */ - -#ifndef FASTRTPS_ALL_H_ -#define FASTRTPS_ALL_H_ - -//USER THIS HEADER TO CREATE RAPID PROTOTYPES AND TESTS -//DO NOT INCLUDE IN PROJETCTS WERE COMPILATION TIME OR SIZE IS REVELANT -//SINCE IT INCLUDES ALL NECESSARY HEADERS. - -#include - -#include - -#include -#include -#include -#include -#include -#include - - -#include -#include -#include - -#include -#include - -#include -#include - -#include - -#include - - -#endif /* FASTRTPS_ALL_H_ */ diff --git a/include/fastrtps/fastrtps_dll.h b/include/fastrtps/fastrtps_dll.h deleted file mode 100644 index b03190a9807..00000000000 --- a/include/fastrtps/fastrtps_dll.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef _FASTRTPS_FASTRTPS_DLL_H_ -#define _FASTRTPS_FASTRTPS_DLL_H_ - -#include - -// normalize macros -#if !defined(FASTRTPS_DYN_LINK) && !defined(FASTRTPS_STATIC_LINK) \ - && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK) -#define FASTRTPS_STATIC_LINK -#endif - -#if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTRTPS_DYN_LINK) -#define FASTRTPS_DYN_LINK -#endif - -#if defined(FASTRTPS_DYN_LINK) && defined(FASTRTPS_STATIC_LINK) -#error Must not define both FASTRTPS_DYN_LINK and FASTRTPS_STATIC_LINK -#endif - -#if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTRTPS_NO_LIB) -#define FASTRTPS_NO_LIB -#endif - -// enable dynamic linking - -#if defined(_WIN32) -#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK) -#if defined(fastrtps_EXPORTS) -#define RTPS_DllAPI __declspec( dllexport ) -#else -#define RTPS_DllAPI __declspec( dllimport ) -#endif // FASTRTPS_SOURCE -#else -#define RTPS_DllAPI -#endif -#else -#define RTPS_DllAPI -#endif // _WIN32 - -// Auto linking. - -#if !defined(FASTRTPS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \ - && !defined(FASTRTPS_NO_LIB) - -// Set properties. -#define EPROSIMA_LIB_NAME fastrtps - -#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK) -#define EPROSIMA_DYN_LINK -#endif - -#include -#endif // auto-linking disabled - -#endif // _fastrtps_fastrtps_DLL_H_ diff --git a/include/fastrtps/participant/Participant.h b/include/fastrtps/participant/Participant.h deleted file mode 100644 index cecd26f9aa0..00000000000 --- a/include/fastrtps/participant/Participant.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Participant.h - * - */ - -#ifndef PARTICIPANT_H_ -#define PARTICIPANT_H_ - -#include -#include - -#include - -namespace eprosima { -namespace fastrtps{ - -class ParticipantImpl; -class ParticipantAttributes; - -namespace rtps -{ - class WriterProxyData; - class ReaderProxyData; - class ResourceEvent; - class RTPSParticipant; -} - -/** - * Class Participant used to group Publishers and Subscribers into a single working unit. - * @ingroup FASTRTPS_MODULE - */ -class RTPS_DllAPI Participant -{ - public: - /** - * Get the rtps::GUID_t of the associated RTPSParticipant. - * @return rtps::GUID_t - */ - const rtps::GUID_t& getGuid() const; - - /** - * Get the ParticipantAttributes. - * @return ParticipantAttributes. - */ - const ParticipantAttributes& getAttributes() const; - - /** - * Called when using a StaticEndpointDiscovery mechanism different that the one - * included in FastRTPS, for example when communicating with other implementations. - * It indicates to the Participant that an Endpoint from the XML has been discovered and - * should be activated. - * @param partguid Participant rtps::GUID_t. - * @param userId User defined ID as shown in the XML file. - * @param kind EndpointKind (WRITER or READER) - * @return True if correctly found and activated. - */ - bool newRemoteEndpointDiscovered( - const rtps::GUID_t& partguid, - uint16_t userId, - rtps::EndpointKind_t kind); - - /** - * Returns a list with the participant names. - * @return list of participant names. - */ - std::vector getParticipantNames() const; - - /** - * @brief Asserts liveliness of manual by participant publishers - */ - void assert_liveliness(); - - rtps::ResourceEvent& get_resource_event() const; - - private: - Participant(); - - virtual ~Participant(); - - ParticipantImpl* mp_impl; - - friend class Domain; - - friend class ParticipantImpl; -}; - -} -} /* namespace eprosima */ - -#endif /* PARTICIPANT_H_ */ diff --git a/include/fastrtps/participant/ParticipantListener.h b/include/fastrtps/participant/ParticipantListener.h deleted file mode 100644 index cde1fec1602..00000000000 --- a/include/fastrtps/participant/ParticipantListener.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ParticipantListener.h - * - */ - -#ifndef __PARTICIPANT_PARTICIPANTLISTENER_H__ -#define __PARTICIPANT_PARTICIPANTLISTENER_H__ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Participant; - -/** - * Class ParticipantListener, overrides behaviour towards certain events. - * @ingroup FASTRTPS_MODULE - */ -class ParticipantListener -{ - public: - - ParticipantListener() {} - - virtual ~ParticipantListener() {} - - /*! - * This method is called when a new Participant is discovered, or a previously discovered participant changes - * its QOS or is removed. - * @param participant Pointer to the Participant which discovered the remote participant. - * @param info Remote participant information. User can take ownership of the object. - */ - virtual void onParticipantDiscovery(Participant* participant, rtps::ParticipantDiscoveryInfo&& info) - { - (void)participant, (void)info; - } - -#if HAVE_SECURITY - virtual void onParticipantAuthentication(Participant* participant, rtps::ParticipantAuthenticationInfo&& info) - { - (void)participant, (void)info; - } -#endif - - /*! - * This method is called when a new Subscriber is discovered, or a previously discovered subscriber changes - * its QOS or is removed. - * @param participant Pointer to the Participant which discovered the remote subscriber. - * @param info Remote subscriber information. User can take ownership of the object. - */ - virtual void onSubscriberDiscovery(Participant* participant, rtps::ReaderDiscoveryInfo&& info) - { - (void)participant, (void)info; - } - - /*! - * This method is called when a new Publisher is discovered, or a previously discovered publisher changes - * its QOS or is removed. - * @param participant Pointer to the Participant which discovered the remote publisher. - * @param info Remote publisher information. User can take ownership of the object. - */ - virtual void onPublisherDiscovery(Participant* participant, rtps::WriterDiscoveryInfo&& info) - { - (void)participant, (void)info; - } -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif // __PARTICIPANT_PARTICIPANTLISTENER_H__ diff --git a/include/fastrtps/publisher/Publisher.h b/include/fastrtps/publisher/Publisher.h deleted file mode 100644 index 7f2ca22d864..00000000000 --- a/include/fastrtps/publisher/Publisher.h +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Publisher.h - * - */ - -#ifndef PUBLISHER_H_ -#define PUBLISHER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { -struct GUID_t; -class WriteParams; -class RTPSParticipant; -} // namespace rtps - -class Participant; -class PublisherImpl; - -/** - * Class Publisher, used to send data to associated subscribers. - * @ingroup FASTRTPS_MODULE - */ -class RTPS_DllAPI Publisher -{ - friend class PublisherImpl; - virtual ~Publisher(); - -public: - - /** - * Constructor from a PublisherImpl pointer - * @param pimpl Actual implementation of the publisher - */ - Publisher( - PublisherImpl* pimpl); - - /*! - * @brief Writes a sample of the topic. - * @param sample Pointer to the sample. - * @return true when operation works successfully. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time. - * @par Calling example: - * @snippet fastrtps_example.cpp ex_PublisherWrite - */ - bool write( - void* sample); - - /*! - * @brief Writes a sample of the topic with additional options. - * @param sample Pointer to the sample. - * @param wparams Extra write parameters. - * @return true when operation works successfully. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on PublisherAttributes defines this period of time. - * @par Calling example: - * @snippet fastrtps_example.cpp ex_PublisherWrite - */ - bool write( - void* sample, - rtps::WriteParams& wparams); - - /*! - * @brief Informs that the application will be modifying a particular instance. - * It gives and opportunity to the middleware to pre-configure itself to improve performance. - * @param[in] instance Sample used to get the instance's key. - * @return Handle containing the instance's key. - * This handle could be used in successive `write` or `dispose` operations. - * In case of error, HANDLE_NIL will be returned. - */ - fastrtps::rtps::InstanceHandle_t register_instance( - void* instance); - - /*! - * @brief Requests the middleware to delete the instance. - * Applications are made aware of the deletion through the DataReader objects. - * @param[in] data Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. - * @param[in] handle Instance's key to be unregistered. - * @return Returns the operation's result. - * If the operation finishes successfully, `true` is returned. - */ - bool dispose( - void* data, - const rtps::InstanceHandle_t& handle); - /*! - * @brief This operation reserves the action of `register_instance`. - * Informs the middleware that the DataWriter is not intending to modify any more of that data instance. - * Also indicates that the middleware can locally remove all information regarding that instance. - * @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. - * @param[in] handle Instance's key to be unregistered. - * @return Returns the operation's result. - * If the operation finishes successfully, `true` is returned. - */ - bool unregister_instance( - void* instance, - const rtps::InstanceHandle_t& handle); - - /** - * Remove all the Changes in the associated RTPSWriter. - * @param[out] removed Number of elements removed - * @return True if all elements were removed. - */ - bool removeAllChange( - size_t* removed = nullptr); - - /** - * Waits until all changes were acknowledged or max_wait. - * @param max_wait Maximum time to wait until all changes are acknowledged. - * @return True if all were acknowledged. - */ - bool wait_for_all_acked( - const Duration_t& max_wait); - - /** - * Get the GUID_t of the associated RTPSWriter. - * @return GUID_t. - */ - const rtps::GUID_t& getGuid(); - - /** - * Get the Attributes of the Publisher. - * @return Attributes of the publisher - */ - const PublisherAttributes& getAttributes() const; - - /** - * Update the Attributes of the publisher. - * @param att Reference to a PublisherAttributes object to update the parameters. - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated. - */ - bool updateAttributes( - const PublisherAttributes& att); - - /** - * @brief Returns the offered deadline missed status - * @param status missed status struct - */ - void get_offered_deadline_missed_status( - OfferedDeadlineMissedStatus& status); - - /** - * @brief Asserts liveliness - */ - void assert_liveliness(); - - /** - * @brief Returns the liveliness lost status - * @param status Liveliness lost status - */ - void get_liveliness_lost_status( - LivelinessLostStatus& status); - - /** - * Get the list of locators from which this publisher may send data. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_sending_locators( - rtps::LocatorList_t& locators) const; - -private: - - PublisherImpl* mp_impl; -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* PUBLISHER_H_ */ diff --git a/include/fastrtps/publisher/PublisherHistory.h b/include/fastrtps/publisher/PublisherHistory.h deleted file mode 100644 index 3198b650d2d..00000000000 --- a/include/fastrtps/publisher/PublisherHistory.h +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PublisherHistory.h - * - */ - -#ifndef PUBLISHERHISTORY_H_ -#define PUBLISHERHISTORY_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class PublisherHistory, implementing a WriterHistory with support for keyed topics and HistoryQOS. - * This class is created by the PublisherImpl and should not be used by the user directly. - * @ingroup FASTRTPS_MODULE - */ -class PublisherHistory : public rtps::WriterHistory -{ -public: - - /** - * Constructor of the PublisherHistory. - * @param topic_att TopicAttributed - * @param payloadMax Maximum payload size. - * @param mempolicy Set whether the payloads ccan dynamically resized or not. - */ - PublisherHistory( - const TopicAttributes& topic_att, - uint32_t payloadMax, - rtps::MemoryManagementPolicy_t mempolicy); - - virtual ~PublisherHistory(); - - /** - * Rebuild instances loaded from DB. Does nothing if the topic doesn't have key. - */ - void rebuild_instances(); - - /*! - * @brief Tries to reserve resources for the new instance. - * @param instance_handle Instance's key. - * @param lock Lock which should be unlock in case the operation has to wait. - * @param max_blocking_time Maximum time the operation should be waiting. - * @return True if resources was reserved successfully. - */ - bool register_instance( - const rtps::InstanceHandle_t& instance_handle, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - - /** - * Add a change comming from the Publisher. - * @param change Pointer to the change - * @param wparams Extra write parameters. - * @param lock - * @param max_blocking_time - * @return True if added. - */ - bool add_pub_change( - rtps::CacheChange_t* change, - rtps::WriteParams& wparams, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - - /** - * Remove all change from the associated history. - * @param removed Number of elements removed. - * @return True if all elements were removed. - */ - bool removeAllChange( - size_t* removed); - - /** - * Remove the change with the minimum sequence Number. - * @return True if removed. - */ - bool removeMinChange(); - - /** - * Remove a change by the publisher History. - * @param change Pointer to the CacheChange_t. - * @return True if removed. - */ - bool remove_change_pub( - rtps::CacheChange_t* change); - - bool remove_change_g( - rtps::CacheChange_t* a_change) override; - - bool remove_change_g( - rtps::CacheChange_t* a_change, - const std::chrono::time_point& max_blocking_time) override; - - bool remove_instance_changes( - const rtps::InstanceHandle_t& handle, - const rtps::SequenceNumber_t& seq_up_to); - - /** - * @brief Sets the next deadline for the given instance - * @param handle The instance handle - * @param next_deadline_us The time point when the deadline will occur - * @return True if deadline was set successfully - */ - bool set_next_deadline( - const rtps::InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us); - - /** - * @brief Returns the deadline for the instance that is next going to 'expire' - * @param handle The handle for the instance that will next miss the deadline - * @param next_deadline_us The time point when the deadline will occur - * @return True if deadline could be retrieved for the given instance - */ - bool get_next_deadline( - rtps::InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us); - - /*! - * @brief Checks if the instance's key is registered. - * @param[in] handle Instance's key. - * return `true` if instance's key is registered in the history. - */ - bool is_key_registered( - const rtps::InstanceHandle_t& handle); - - /** - * Waits till the last change in the instance history has been acknowledged. - * @param handle Instance's handle. - * @param lock Lock which should be unlock in case the operation has to wait. - * @param max_blocking_time Maximum time the operation should be waiting. - * @return true when the last change of the instance history is acknowleged, false when timeout is reached. - */ - bool wait_for_acknowledgement_last_change( - const rtps::InstanceHandle_t& handle, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); - -private: - - typedef std::map t_m_Inst_Caches; - - //!Map where keys are instance handles and values are vectors of cache changes associated - t_m_Inst_Caches keyed_changes_; - //!Time point when the next deadline will occur (only used for topics with no key) - std::chrono::steady_clock::time_point next_deadline_us_; - //!HistoryQosPolicy values. - HistoryQosPolicy history_qos_; - //!ResourceLimitsQosPolicy values. - ResourceLimitsQosPolicy resource_limited_qos_; - //!Topic Attributes - TopicAttributes topic_att_; - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param instance_handle Instance of the key. - * @param map_it A map iterator to the given key - * @return True if the key was found or could be added to the map - */ - bool find_or_add_key( - const rtps::InstanceHandle_t& instance_handle, - t_m_Inst_Caches::iterator* map_it); - - /** - * Add a change comming from the Publisher. - * @param change Pointer to the change - * @param lock - * @param max_blocking_time - * @return True if added. - */ - bool prepare_change( - rtps::CacheChange_t* change, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time); -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif // PUBLISHERHISTORY_H_ diff --git a/include/fastrtps/publisher/PublisherListener.h b/include/fastrtps/publisher/PublisherListener.h deleted file mode 100644 index 04107aa2dcf..00000000000 --- a/include/fastrtps/publisher/PublisherListener.h +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PublisherListener.h - */ - -#ifndef PUBLISHERLISTENER_H_ -#define PUBLISHERLISTENER_H_ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Publisher; - -/** - * Class PublisherListener, allows the end user to implement callbacks triggered by certain events. - * @ingroup FASTRTPS_MODULE - * @snippet fastrtps_example.cpp ex_PublisherListener - */ -class RTPS_DllAPI PublisherListener -{ -public: - - PublisherListener() - { - } - - virtual ~PublisherListener() - { - } - - /** - * This method is called when the Publisher is matched (or unmatched) against an endpoint. - * @param pub Pointer to the associated Publisher - * @param info Information regarding the matched subscriber - */ - virtual void onPublicationMatched( - Publisher* pub, - rtps::MatchingInfo& info) - { - (void)pub; - (void)info; - } - - /** - * A method called when a deadline is missed - * @param pub Pointer to the associated Publisher - * @param status The deadline missed status - */ - virtual void on_offered_deadline_missed( - Publisher* pub, - const OfferedDeadlineMissedStatus& status) - { - (void)pub; - (void)status; - } - - /** - * @brief Method called when the liveliness of a publisher is lost - * @param pub The publisher - * @param status The liveliness lost status - */ - virtual void on_liveliness_lost( - Publisher* pub, - const LivelinessLostStatus& status) - { - (void)pub; - (void)status; - } - -}; - -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif /* PUBLISHERLISTENER_H_ */ diff --git a/include/fastrtps/qos/ParameterTypes.h b/include/fastrtps/qos/ParameterTypes.h index cdcf8d333c9..e48a319b42f 100644 --- a/include/fastrtps/qos/ParameterTypes.h +++ b/include/fastrtps/qos/ParameterTypes.h @@ -20,13 +20,12 @@ #define PARAMETERTYPES_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include +#include #include #include -#include - #if HAVE_SECURITY #include #include diff --git a/include/fastrtps/qos/QosPolicies.h b/include/fastrtps/qos/QosPolicies.h index 940371b8c89..5c1348e16b1 100644 --- a/include/fastrtps/qos/QosPolicies.h +++ b/include/fastrtps/qos/QosPolicies.h @@ -103,7 +103,7 @@ using TypeIdV1 = fastdds::dds::TypeIdV1; using TypeObjectV1 = fastdds::dds::TypeObjectV1; namespace xtypes { -using TypeInformation = fastdds::dds::xtypes::TypeInformation; +using TypeInformationParameter = fastdds::dds::xtypes::TypeInformationParameter; } //namespace xtypes } // namespace fastrtps diff --git a/include/fastrtps/rtps/builtin/BuiltinProtocols.h b/include/fastrtps/rtps/builtin/BuiltinProtocols.h deleted file mode 100644 index ea38baed60e..00000000000 --- a/include/fastrtps/rtps/builtin/BuiltinProtocols.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file BuiltinProtocols.h - * - */ - -#ifndef BUILTINPROTOCOLS_H_ -#define BUILTINPROTOCOLS_H_ - -#include - -#endif /* BUILTINPROTOCOLS_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h deleted file mode 100644 index 4d125388162..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDP.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDP.h - * - */ - -#ifndef EDP_H_ -#define EDP_H_ - -#include - -#endif /* EDP_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h deleted file mode 100644 index 513ec92a66d..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDPSimple.h - * - */ - -#ifndef EDPSIMPLE_H_ -#define EDPSIMPLE_H_ - -#include - -#endif /* EDPSIMPLE_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h b/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h deleted file mode 100644 index 86a1c8892ad..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/endpoint/EDPStatic.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDPStatic.h - * - */ - -#ifndef EDPSTATIC_H_ -#define EDPSTATIC_H_ - -#include - -#endif /* EDPSTATIC_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDP.h b/include/fastrtps/rtps/builtin/discovery/participant/PDP.h deleted file mode 100644 index 3b8a8f6c549..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDP.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDP.h - * - */ - -#ifndef PDP_H_ -#define PDP_H_ - -#include - -#endif /* PDP_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h b/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h deleted file mode 100644 index 277d1a8c2e8..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDPListener.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDPListener.h - * - */ - -#ifndef PDPLISTENER_H_ -#define PDPLISTENER_H_ - -#include - -#endif /* PDPLISTENER_H_ */ diff --git a/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h b/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h deleted file mode 100644 index 55d338e9452..00000000000 --- a/include/fastrtps/rtps/builtin/discovery/participant/PDPSimple.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDPSimple.h - * - */ - -#ifndef _RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ -#define _RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ - -#include - -#endif //_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/include/fastrtps/rtps/builtin/liveliness/WLP.h b/include/fastrtps/rtps/builtin/liveliness/WLP.h deleted file mode 100644 index 380a170e384..00000000000 --- a/include/fastrtps/rtps/builtin/liveliness/WLP.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file WLP.h - * - */ - -#ifndef WLP_H_ -#define WLP_H_ - -#include - -#endif /* WLP_H_ */ diff --git a/include/fastrtps/rtps/builtin/liveliness/WLPListener.h b/include/fastrtps/rtps/builtin/liveliness/WLPListener.h deleted file mode 100644 index 49e76e8f8a8..00000000000 --- a/include/fastrtps/rtps/builtin/liveliness/WLPListener.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file WLPListener.h - * - */ - -#ifndef WLPLISTENER_H_ -#define WLPLISTENER_H_ - -#include - -#endif /* WLPLISTENER_H_ */ diff --git a/include/fastrtps/rtps/messages/MessageReceiver.h b/include/fastrtps/rtps/messages/MessageReceiver.h deleted file mode 100644 index 3ee6062aae8..00000000000 --- a/include/fastrtps/rtps/messages/MessageReceiver.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file MessageReceiver.h - */ - - - -#ifndef MESSAGERECEIVER_H_ -#define MESSAGERECEIVER_H_ - -#include - -#endif /* MESSAGERECEIVER_H_ */ diff --git a/include/fastrtps/rtps/rtps_all.h b/include/fastrtps/rtps/rtps_all.h deleted file mode 100644 index 78f0b99f7cf..00000000000 --- a/include/fastrtps/rtps/rtps_all.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file rtps_all.h - * - */ - -#ifndef RTPS_ALL_H_ -#define RTPS_ALL_H_ - -#include - -#endif /* RTPS_ALL_H_ */ diff --git a/include/fastrtps/rtps/writer/LivelinessData.h b/include/fastrtps/rtps/writer/LivelinessData.h deleted file mode 100644 index 980e1dadebc..00000000000 --- a/include/fastrtps/rtps/writer/LivelinessData.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016-2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file LivelinessData.h - */ -#ifndef LIVELINESS_DATA_H_ -#define LIVELINESS_DATA_H_ - -#include - -#endif /* LIVELINESS_DATA_H_ */ diff --git a/include/fastrtps/rtps/writer/LivelinessManager.h b/include/fastrtps/rtps/writer/LivelinessManager.h deleted file mode 100644 index f2cafe2155c..00000000000 --- a/include/fastrtps/rtps/writer/LivelinessManager.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016-2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file LivelinessManager.h - */ -#ifndef LIVELINESS_MANAGER_H_ -#define LIVELINESS_MANAGER_H_ - -#include - -#endif /* LIVELINESS_MANAGER_H_ */ diff --git a/include/fastrtps/subscriber/SampleInfo.h b/include/fastrtps/subscriber/SampleInfo.h deleted file mode 100644 index 81556d92761..00000000000 --- a/include/fastrtps/subscriber/SampleInfo.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SampleInfo.h - */ - -#ifndef SAMPLEINFO_H_ -#define SAMPLEINFO_H_ - -#include - -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class SampleInfo_t with information that is provided along a sample when reading data from a Subscriber. - * @ingroup FASTRTPS_MODULE - */ -class RTPS_DllAPI SampleInfo_t -{ -public: - - SampleInfo_t() - : sampleKind(rtps::ALIVE) - , ownershipStrength(0) - , sample_identity(rtps::SampleIdentity::unknown()) - , related_sample_identity(rtps::SampleIdentity::unknown()) - { - } - - virtual ~SampleInfo_t() - { - } - - //!Sample kind. - rtps::ChangeKind_t sampleKind; - //!Ownership Strength of the writer of the sample (0 if the ownership kind is set to SHARED_OWNERSHIP_QOS). - uint32_t ownershipStrength; - //!Source timestamp of the sample. - rtps::Time_t sourceTimestamp; - //!Reception timestamp of the sample. - rtps::Time_t receptionTimestamp; - //!InstanceHandle of the data - rtps::InstanceHandle_t iHandle; - - rtps::SampleIdentity sample_identity; - - rtps::SampleIdentity related_sample_identity; -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* SAMPLEINFO_H_ */ diff --git a/include/fastrtps/subscriber/Subscriber.h b/include/fastrtps/subscriber/Subscriber.h deleted file mode 100644 index 30913ec7d7c..00000000000 --- a/include/fastrtps/subscriber/Subscriber.h +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Subscriber.h - */ - - -#ifndef SUBSCRIBER_H_ -#define SUBSCRIBER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -class SubscriberImpl; -class SampleInfo_t; - -/** - * Class Subscriber, contains the public API that allows the user to control the reception of messages. - * This class should not be instantiated directly. - * DomainRTPSParticipant class should be used to correctly create this element. - * @ingroup FASTRTPS_MODULE - * @snippet fastrtps_example.cpp ex_Subscriber - */ -class RTPS_DllAPI Subscriber -{ - friend class SubscriberImpl; - - virtual ~Subscriber() - { - } - -public: - - /** - * Constructor from a SubscriberImpl pointer - * @param pimpl Actual implementation of the subscriber - */ - Subscriber( - SubscriberImpl* pimpl) - : mp_impl(pimpl) - { - } - - /** - * Get the associated GUID - * @return Associated GUID - */ - const rtps::GUID_t& getGuid(); - - /** - * Method to block the current thread until an unread message is available - */ - inline void waitForUnreadMessage() - { - const Duration_t one_day{ 24 * 3600, 0 }; - while (!wait_for_unread_samples(one_day)) - { - } - } - - /*! - * @brief Blocks the current thread until an unread sample is available. - * @param timeout Maximum time the function will be blocked if any sample is received. - * @return true in case unread samples are available. - * In other case, false. - */ - bool wait_for_unread_samples( - const Duration_t& timeout); - - /** - * @brief Reads next unread sample from the Subscriber. - * @param sample Pointer to the object where you want the sample stored. - * @param info Pointer to a SampleInfo_t structure that informs you about your sample. - * @return True if a sample was read. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on SubscriberAttributes defines this period of time. - */ - bool readNextData( - void* sample, - SampleInfo_t* info); - - /** - * @brief Takes next sample from the Subscriber. The sample is removed from the subscriber. - * @param sample Pointer to the object where you want the sample stored. - * @param info Pointer to a SampleInfo_t structure that informs you about your sample. - * @return True if a sample was taken. - * @note This method is blocked for a period of time. - * ReliabilityQosPolicy.max_blocking_time on SubscriberAttributes defines this period of time. - */ - bool takeNextData( - void* sample, - SampleInfo_t* info); - - /** - * @brief Returns information about the first untaken sample. - * @param [out] info Pointer to a SampleInfo_t structure to store first untaken sample information. - * @return true if sample info was returned. false if there is no sample to take. - */ - bool get_first_untaken_info( - SampleInfo_t* info); - - /** - * Update the Attributes of the subscriber; - * @param att Reference to a SubscriberAttributes object to update the parameters; - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated - */ - bool updateAttributes( - const SubscriberAttributes& att); - - /** - * Get the Attributes of the Subscriber. - * @return Attributes of the subscriber - */ - const SubscriberAttributes& getAttributes() const; - - /*! - * @brief Returns there is a clean state with all Publishers. - * It occurs when the Subscriber received all samples sent by Publishers. In other words, - * its WriterProxies are up to date. - * @return There is a clean state with all Publishers. - */ - bool isInCleanState() const; - - /** - * Get the unread count. - * @return Unread count - */ - inline uint64_t getUnreadCount() const - { - return get_unread_count(); - } - - /** - * Get the unread count. - * @return Unread count - */ - uint64_t get_unread_count() const; - - /** - * @brief Get the requested deadline missed status - * @param status The deadline missed status - */ - void get_requested_deadline_missed_status( - RequestedDeadlineMissedStatus& status); - - /** - * @brief Returns the liveliness changed status - * @param status Liveliness changed status - */ - void get_liveliness_changed_status( - LivelinessChangedStatus& status); - - /** - * Get the list of locators on which this subscriber is listening. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_listening_locators( - rtps::LocatorList_t& locators) const; - -private: - - SubscriberImpl* mp_impl; -}; - - - -} /* namespace pubsub */ -} /* namespace eprosima */ - -#endif /* SUBSCRIBER_H_ */ diff --git a/include/fastrtps/subscriber/SubscriberHistory.h b/include/fastrtps/subscriber/SubscriberHistory.h deleted file mode 100644 index eba33252b01..00000000000 --- a/include/fastrtps/subscriber/SubscriberHistory.h +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberHistory.h - * - */ - -#ifndef SUBSCRIBERHISTORY_H_ -#define SUBSCRIBERHISTORY_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Class SubscriberHistory, container of the different CacheChanges of a subscriber - * @ingroup FASTRTPS_MODULE - */ -class SubscriberHistory : public rtps::ReaderHistory -{ -public: - - /** - * Constructor. Requires information about the subscriber. - * @param topic_att TopicAttributes. - * @param type TopicDataType. - * @param qos ReaderQoS policy. - * @param payloadMax Maximum payload size per change. - * @param mempolicy Set whether the payloads ccan dynamically resized or not. - */ - SubscriberHistory( - const TopicAttributes& topic_att, - fastdds::dds::TopicDataType* type, - const fastrtps::ReaderQos& qos, - uint32_t payloadMax, - rtps::MemoryManagementPolicy_t mempolicy); - - ~SubscriberHistory() override; - - /** - * Remove a specific change from the history. - * No Thread Safe - * @param removal iterator to the CacheChange_t to remove. - * @param release defaults to true and hints if the CacheChange_t should return to the pool - * @return iterator to the next CacheChange_t or end iterator. - */ - iterator remove_change_nts( - const_iterator removal, - bool release = true) override; - - /** - * Check if a new change can be added to this history. - * - * @param [in] writer_guid GUID of the writer where the change came from. - * @param [in] total_payload_size Total payload size of the incoming change. - * @param [in] unknown_missing_changes_up_to The number of changes from the same writer with a lower sequence - * number that could potentially be received in the future. - * @param [out] will_never_be_accepted When the method returns @c false, this parameter will inform - * whether the change could be accepted in the future or not. - * - * @pre change should not be present in the history - * - * @return Whether a call to received_change will succeed when called with the same arguments. - */ - bool can_change_be_added_nts( - const rtps::GUID_t& writer_guid, - uint32_t total_payload_size, - size_t unknown_missing_changes_up_to, - bool& will_never_be_accepted) const override; - - /** - * Called when a change is received by the Subscriber. Will add the change to the history. - * @pre Change should not be already present in the history. - * @param[in] change The received change - * @param unknown_missing_changes_up_to Number of missing changes before this one - * @return - */ - bool received_change( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to) override; - - /** - * Called when a fragmented change is received completely by the Subscriber. Will find its instance and store it. - * @pre Change should be already present in the history. - * @param[in] change The received change - * @return - */ - bool completed_change( - rtps::CacheChange_t* change) override; - - /** @name Read or take data methods. - * Methods to read or take data from the History. - * @param data Pointer to the object where you want to read or take the information. - * @param info Pointer to a SampleInfo_t object where you want - * @param max_blocking_time Maximum time the function can be blocked. - * to store the information about the retrieved data - */ - ///@{ - bool readNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time); - - bool takeNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time); - ///@} - - /** - * @brief Returns information about the first untaken sample. - * @param [out] info Pointer to a SampleInfo_t structure to store first untaken sample information. - * @return true if sample info was returned. false if there is no sample to take. - */ - bool get_first_untaken_info( - SampleInfo_t* info); - - /** - * This method is called to remove a change from the SubscriberHistory. - * @param change Pointer to the CacheChange_t. - * @return True if removed. - */ - bool remove_change_sub( - rtps::CacheChange_t* change); - - /** - * This method is called to remove a change from the SubscriberHistory. - * @param [in] change Pointer to the CacheChange_t. - * @param [in,out] it Iterator pointing to change on input. Will point to next valid change on output. - * @return True if removed. - */ - bool remove_change_sub( - rtps::CacheChange_t* change, - iterator& it); - - /** - * @brief A method to set the next deadline for the given instance - * @param handle The handle to the instance - * @param next_deadline_us The time point when the deadline will occur - * @return True if the deadline was set correctly - */ - bool set_next_deadline( - const rtps::InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us); - - /** - * @brief A method to get the next instance handle that will miss the deadline and the time when the deadline will occur - * @param handle The handle to the instance - * @param next_deadline_us The time point when the instance will miss the deadline - * @return True if the deadline was retrieved successfully - */ - bool get_next_deadline( - rtps::InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us); - -private: - - using rtps::ReaderHistory::completed_change; - using rtps::ReaderHistory::received_change; - using rtps::ReaderHistory::remove_change_nts; - - using t_m_Inst_Caches = std::map; - - //!Map where keys are instance handles and values vectors of cache changes - t_m_Inst_Caches keyed_changes_; - //!Time point when the next deadline will occur (only used for topics with no key) - std::chrono::steady_clock::time_point next_deadline_us_; - //!HistoryQosPolicy values. - HistoryQosPolicy history_qos_; - //!ResourceLimitsQosPolicy values. - ResourceLimitsQosPolicy resource_limited_qos_; - //!Topic Attributes - TopicAttributes topic_att_; - //!TopicDataType - fastdds::dds::TopicDataType* type_; - //!ReaderQos - fastrtps::ReaderQos qos_; - - //!Type object to deserialize Key - void* get_key_object_; - - /// Function processing a received change - std::function receive_fn_; - - /// Function processing a completed fragmented change - std::function complete_fn_; - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param a_change The change to get the key from - * @param[out] map_it A map iterator to the given key - * @return True if it was found or could be added to the map - */ - bool find_key( - rtps::CacheChange_t* a_change, - t_m_Inst_Caches::iterator& map_it); - - /** - * @brief Method that finds a key in m_keyedChanges or tries to add it if not found - * @param a_change The change to get the key from - * @param map_it A map iterator to the given key - * @return True if it was found or could be added to the map - */ - bool find_key_for_change( - rtps::CacheChange_t* a_change, - t_m_Inst_Caches::iterator& map_it); - - /** - * @name Variants of incoming change processing. - * Will be called with the history mutex taken. - * @param[in] change The received change - * @param unknown_missing_changes_up_to Number of missing changes before this one - * @return - */ - ///@{ - bool received_change_keep_all_no_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_last_no_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_all_with_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool received_change_keep_last_with_key( - rtps::CacheChange_t* change, - size_t unknown_missing_changes_up_to); - - bool completed_change_keep_all_with_key( - rtps::CacheChange_t* change); - - bool completed_change_keep_last_with_key( - rtps::CacheChange_t* change); - ///@} - - bool add_received_change( - rtps::CacheChange_t* a_change); - - bool add_received_change_with_key( - rtps::CacheChange_t* a_change, - std::vector& instance_changes); - - bool deserialize_change( - rtps::CacheChange_t* change, - uint32_t ownership_strength, - void* data, - SampleInfo_t* info); -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif /* SUBSCRIBERHISTORY_H_ */ diff --git a/include/fastrtps/subscriber/SubscriberListener.h b/include/fastrtps/subscriber/SubscriberListener.h deleted file mode 100644 index 572c540d037..00000000000 --- a/include/fastrtps/subscriber/SubscriberListener.h +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberListener.h - */ - -#ifndef SUBLISTENER_H_ -#define SUBLISTENER_H_ - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { -class MatchingInfo; -} /* namespace rtps */ - -class Subscriber; - -/** - * Class SubscriberListener, it should be used by the end user to implement specific callbacks to certain actions. - * @ingroup FASTRTPS_MODULE - * @snippet fastrtps_example.cpp ex_SubscriberListener - */ -class RTPS_DllAPI SubscriberListener -{ - public: - - SubscriberListener(){} - - virtual ~SubscriberListener(){} - - /** - * Virtual function to be implemented by the user containing the actions to be performed when a new Data Message is received. - * @param sub Subscriber - */ - virtual void onNewDataMessage(Subscriber* sub) - { - (void)sub; - } - - /** - * Virtual method to be called when the subscriber is matched with a new Writer (or unmatched); i.e., when a writer publishing in the same topic is discovered. - * @param sub Subscriber - * @param info Matching information - */ - virtual void onSubscriptionMatched( - Subscriber* sub, - rtps::MatchingInfo& info) - { - (void)sub; - (void)info; - } - - /** - * Virtual method to be called when a topic misses the deadline period - * @param sub Subscriber - * @param status The requested deadline missed status - */ - virtual void on_requested_deadline_missed( - Subscriber* sub, - const RequestedDeadlineMissedStatus& status) - { - (void)sub; - (void)status; - } - - /** - * @brief Method called when the liveliness status associated to a subscriber changes - * @param sub The subscriber - * @param status The liveliness changed status - */ - virtual void on_liveliness_changed( - Subscriber* sub, - const LivelinessChangedStatus& status) - { - (void)sub; - (void)status; - } - -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* LISTENER_H_ */ diff --git a/include/fastrtps/types/AnnotationDescriptor.h b/include/fastrtps/types/AnnotationDescriptor.h deleted file mode 100644 index 2e67622774d..00000000000 --- a/include/fastrtps/types/AnnotationDescriptor.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_ANNOTATION_DESCRIPTOR_H -#define TYPES_ANNOTATION_DESCRIPTOR_H - -#include -#include - -namespace eprosima{ -namespace fastrtps{ -namespace types{ - -class MemberDescriptor; -class DynamicType; - -class AnnotationDescriptor -{ -protected: - friend class DynamicTypeBuilderFactory; - - DynamicType_ptr type_; - std::map value_; - -public: - AnnotationDescriptor(); - ~AnnotationDescriptor(); - AnnotationDescriptor(const AnnotationDescriptor* descriptor); - AnnotationDescriptor(DynamicType_ptr p_type); - - ReturnCode_t copy_from(const AnnotationDescriptor* other); - bool equals(const AnnotationDescriptor*) const; - bool is_consistent() const; - bool key_annotation() const; - - ReturnCode_t get_value( - std::string& value, - const std::string& key); - - ReturnCode_t get_value(std::string& value); // key = "value" - - ReturnCode_t get_all_value(std::map& value) const; - - ReturnCode_t set_value( - const std::string& key, - const std::string& value); - - void set_type(DynamicType_ptr pType); - - const DynamicType_ptr type() const - { - return type_; - } -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_ANNOTATION_DESCRIPTOR_H diff --git a/include/fastrtps/types/AnnotationParameterValue.h b/include/fastrtps/types/AnnotationParameterValue.h deleted file mode 100644 index 91f22781f8b..00000000000 --- a/include/fastrtps/types/AnnotationParameterValue.h +++ /dev/null @@ -1,1453 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AnnotationParameterValue.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _ANNOTATIONPARAMETERVALUE_H_ -#define _ANNOTATIONPARAMETERVALUE_H_ - -#if _MSC_VER - -#if defined(max) -#pragma push_macro("max") -#undef max -#define FASTDDS_RESTORE_MAX -#endif // defined(max) - -#if defined(min) -#pragma push_macro("min") -#undef min -#define FASTDDS_RESTORE_MIN -#endif // defined(min) - -#endif // if _MSC_VER - -#include -#include -#include - -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima -namespace eprosima { -namespace fastrtps { - -namespace types { - -/*! - * @brief This class represents the structure ExtendedAnnotationParameterValue defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class ExtendedAnnotationParameterValue -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~ExtendedAnnotationParameterValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue( - const ExtendedAnnotationParameterValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue( - ExtendedAnnotationParameterValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue& operator =( - const ExtendedAnnotationParameterValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue& operator =( - ExtendedAnnotationParameterValue&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const ExtendedAnnotationParameterValue& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - RTPS_DllAPI static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const ExtendedAnnotationParameterValue&) const - { - return true; - } - -private: -}; -/*! - * @brief This class represents the union AnnotationParameterValue defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class AnnotationParameterValue -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI AnnotationParameterValue(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~AnnotationParameterValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - RTPS_DllAPI AnnotationParameterValue( - const AnnotationParameterValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - RTPS_DllAPI AnnotationParameterValue( - AnnotationParameterValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - RTPS_DllAPI AnnotationParameterValue& operator =( - const AnnotationParameterValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - RTPS_DllAPI AnnotationParameterValue& operator =( - AnnotationParameterValue&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - RTPS_DllAPI void _d( - char __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - RTPS_DllAPI char _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - RTPS_DllAPI char& _d(); - - /*! - * @brief This function sets a value in member boolean_value - * @param _boolean_value New value for member boolean_value - */ - RTPS_DllAPI void boolean_value( - bool _boolean_value); - - /*! - * @brief This function returns the value of member boolean_value - * @return Value of member boolean_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI bool boolean_value() const; - - /*! - * @brief This function returns a reference to member boolean_value - * @return Reference to member boolean_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI bool& boolean_value(); - /*! - * @brief This function sets a value in member byte_value - * @param _byte_value New value for member byte_value - */ - RTPS_DllAPI void byte_value( - uint8_t _byte_value); - - /*! - * @brief This function returns the value of member byte_value - * @return Value of member byte_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint8_t byte_value() const; - - /*! - * @brief This function returns a reference to member byte_value - * @return Reference to member byte_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint8_t& byte_value(); - /*! - * @brief This function sets a value in member int16_value - * @param _int16_value New value for member int16_value - */ - RTPS_DllAPI void int16_value( - int16_t _int16_value); - - /*! - * @brief This function returns the value of member int16_value - * @return Value of member int16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int16_t int16_value() const; - - /*! - * @brief This function returns a reference to member int16_value - * @return Reference to member int16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int16_t& int16_value(); - /*! - * @brief This function sets a value in member uint_16_value - * @param _uint_16_value New value for member uint_16_value - */ - RTPS_DllAPI void uint_16_value( - uint16_t _uint_16_value); - - /*! - * @brief This function returns the value of member uint_16_value - * @return Value of member uint_16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint16_t uint_16_value() const; - - /*! - * @brief This function returns a reference to member uint_16_value - * @return Reference to member uint_16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint16_t& uint_16_value(); - /*! - * @brief This function sets a value in member int32_value - * @param _int32_value New value for member int32_value - */ - RTPS_DllAPI void int32_value( - int32_t _int32_value); - - /*! - * @brief This function returns the value of member int32_value - * @return Value of member int32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int32_t int32_value() const; - - /*! - * @brief This function returns a reference to member int32_value - * @return Reference to member int32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int32_t& int32_value(); - /*! - * @brief This function sets a value in member uint32_value - * @param _uint32_value New value for member uint32_value - */ - RTPS_DllAPI void uint32_value( - uint32_t _uint32_value); - - /*! - * @brief This function returns the value of member uint32_value - * @return Value of member uint32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint32_t uint32_value() const; - - /*! - * @brief This function returns a reference to member uint32_value - * @return Reference to member uint32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint32_t& uint32_value(); - /*! - * @brief This function sets a value in member int64_value - * @param _int64_value New value for member int64_value - */ - RTPS_DllAPI void int64_value( - int64_t _int64_value); - - /*! - * @brief This function returns the value of member int64_value - * @return Value of member int64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int64_t int64_value() const; - - /*! - * @brief This function returns a reference to member int64_value - * @return Reference to member int64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int64_t& int64_value(); - - /*! - * @brief This function sets a value in member uint64_value - * @param _uint64_value New value for member uint64_value - */ - RTPS_DllAPI void uint64_value( - uint64_t _uint64_value); - - /*! - * @brief This function returns the value of member uint64_value - * @return Value of member uint64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint64_t uint64_value() const; - - /*! - * @brief This function returns a reference to member uint64_value - * @return Reference to member uint64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI uint64_t& uint64_value(); - /*! - * @brief This function sets a value in member float32_value - * @param _float32_value New value for member float32_value - */ - RTPS_DllAPI void float32_value( - float _float32_value); - - /*! - * @brief This function returns the value of member float32_value - * @return Value of member float32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI float float32_value() const; - - /*! - * @brief This function returns a reference to member float32_value - * @return Reference to member float32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI float& float32_value(); - /*! - * @brief This function sets a value in member float64_value - * @param _float64_value New value for member float64_value - */ - RTPS_DllAPI void float64_value( - double _float64_value); - - /*! - * @brief This function returns the value of member float64_value - * @return Value of member float64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI double float64_value() const; - - /*! - * @brief This function returns a reference to member float64_value - * @return Reference to member float64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI double& float64_value(); - - /*! - * @brief This function sets a value in member float128_value - * @param _float128_value New value for member float128_value - */ - RTPS_DllAPI void float128_value( - long double _float128_value); - - /*! - * @brief This function returns the value of member float128_value - * @return Value of member float128_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI long double float128_value() const; - - /*! - * @brief This function returns a reference to member float128_value - * @return Reference to member float128_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI long double& float128_value(); - /*! - * @brief This function sets a value in member char_value - * @param _char_value New value for member char_value - */ - RTPS_DllAPI void char_value( - char _char_value); - - /*! - * @brief This function returns the value of member char_value - * @return Value of member char_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI char char_value() const; - - /*! - * @brief This function returns a reference to member char_value - * @return Reference to member char_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI char& char_value(); - /*! - * @brief This function sets a value in member wchar_value - * @param _wchar_value New value for member wchar_value - */ - RTPS_DllAPI void wchar_value( - wchar_t _wchar_value); - - /*! - * @brief This function returns the value of member wchar_value - * @return Value of member wchar_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI wchar_t wchar_value() const; - - /*! - * @brief This function returns a reference to member wchar_value - * @return Reference to member wchar_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI wchar_t& wchar_value(); - /*! - * @brief This function sets a value in member enumerated_value - * @param _enumerated_value New value for member enumerated_value - */ - RTPS_DllAPI void enumerated_value( - int32_t _enumerated_value); - - /*! - * @brief This function returns the value of member enumerated_value - * @return Value of member enumerated_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int32_t enumerated_value() const; - - /*! - * @brief This function returns a reference to member enumerated_value - * @return Reference to member enumerated_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI int32_t& enumerated_value(); - /*! - * @brief This function copies the value in member string8_value - * @param _string8_value New value to be copied in member string8_value - */ - RTPS_DllAPI void string8_value( - const std::string& _string8_value); - - /*! - * @brief This function moves the value in member string8_value - * @param _string8_value New value to be moved in member string8_value - */ - RTPS_DllAPI void string8_value( - std::string&& _string8_value); - - /*! - * @brief This function returns a constant reference to member string8_value - * @return Constant reference to member string8_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const std::string& string8_value() const; - - /*! - * @brief This function returns a reference to member string8_value - * @return Reference to member string8_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI std::string& string8_value(); - /*! - * @brief This function copies the value in member string16_value - * @param _string16_value New value to be copied in member string16_value - */ - RTPS_DllAPI void string16_value( - const std::wstring& _string16_value); - - /*! - * @brief This function moves the value in member string16_value - * @param _string16_value New value to be moved in member string16_value - */ - RTPS_DllAPI void string16_value( - std::wstring&& _string16_value); - - /*! - * @brief This function returns a constant reference to member string16_value - * @return Constant reference to member string16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const std::wstring& string16_value() const; - - /*! - * @brief This function returns a reference to member string16_value - * @return Reference to member string16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI std::wstring& string16_value(); - - /*! - * @brief This function copies the value in member extended_value - * @param _extended_value New value to be copied in member extended_value - */ - RTPS_DllAPI void extended_value( - const ExtendedAnnotationParameterValue& _extended_value); - - /*! - * @brief This function moves the value in member extended_value - * @param _extended_value New value to be moved in member extended_value - */ - RTPS_DllAPI void extended_value( - ExtendedAnnotationParameterValue&& _extended_value); - - /*! - * @brief This function returns a constant reference to member extended_value - * @return Constant reference to member extended_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const ExtendedAnnotationParameterValue& extended_value() const; - - /*! - * @brief This function returns a reference to member extended_value - * @return Reference to member extended_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI ExtendedAnnotationParameterValue& extended_value(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AnnotationParameterValue& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - RTPS_DllAPI static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const AnnotationParameterValue& other) const; - - /** - * Aux method to return value as its string representation. - */ - RTPS_DllAPI std::string to_string() const - { - switch (m__d) - { - case TK_BOOLEAN: - return (m_boolean_value) ? "true" : "false"; - case TK_BYTE: - return std::to_string(m_byte_value); - case TK_INT16: - return std::to_string(m_int16_value); - case TK_UINT16: - return std::to_string(m_uint_16_value); - case TK_INT32: - return std::to_string(m_int32_value); - case TK_UINT32: - return std::to_string(m_uint32_value); - case TK_INT64: - return std::to_string(m_int64_value); - case TK_UINT64: - return std::to_string(m_uint64_value); - case TK_FLOAT32: - return std::to_string(m_float32_value); - case TK_FLOAT64: - return std::to_string(m_float64_value); - case TK_FLOAT128: - return std::to_string(m_float128_value); - case TK_CHAR8: - return std::to_string(m_char_value); - case TK_CHAR16: - return std::to_string(m_wchar_value); - case TK_ENUM: - return std::to_string(m_enumerated_value); - case TK_STRING16: - { - return wstring_to_bytes(m_string16_value); - } - case TK_STRING8: - case TK_NONE: // Cheat! - return m_string8_value; - default: - return ""; - } - } - - /** - * Aux method to set value from its string representation. - */ - RTPS_DllAPI void from_string( - const std::string& value) - { - switch (m__d) - { - case TK_BOOLEAN: - { - std::string val_ = value; - std::transform(val_.begin(), val_.end(), val_.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - boolean_value(val_.compare("0") != 0 || val_.compare(CONST_TRUE) == 0); - } - break; - case TK_BYTE: - { - byte_value(static_cast(std::stoul(value))); - } - break; - case TK_INT16: - { - int16_value(static_cast(std::stoi(value))); - } - break; - case TK_INT32: - { - int32_value(static_cast(std::stoi(value))); - } - break; - case TK_INT64: - { - int64_value(static_cast(std::stoll(value))); - } - break; - case TK_UINT16: - { - uint_16_value(static_cast(std::stoul(value))); - } - break; - case TK_UINT32: - { - uint32_value(static_cast(std::stoul(value))); - } - break; - case TK_UINT64: - { - uint64_value(static_cast(std::stoull(value))); - } - break; - case TK_FLOAT32: - { - float32_value(std::stof(value)); - } - break; - case TK_FLOAT64: - { - float64_value(std::stod(value)); - } - break; - case TK_FLOAT128: - { - float128_value(std::stold(value)); - } - break; - case TK_CHAR8: - { - char_value(value.c_str()[0]); - } - break; - case TK_CHAR16: - { - wchar_value(wstring_from_bytes(value).c_str()[0]); - } - break; - case TK_STRING8: - case TK_NONE: // Cheat! - { - string8_value(value); - } - break; - case TK_STRING16: - { - string16_value(wstring_from_bytes(value)); - } - break; - case TK_ENUM: - { - // TODO Translate from enum value name to integer value - enumerated_value(static_cast(std::stoul(value))); - } - break; - default: - break; - } - } - -private: - - char m__d; - - bool m_boolean_value; - uint8_t m_byte_value; - int16_t m_int16_value; - uint16_t m_uint_16_value; - int32_t m_int32_value; - uint32_t m_uint32_value; - int64_t m_int64_value; - uint64_t m_uint64_value; - float m_float32_value; - double m_float64_value; - long double m_float128_value; - char m_char_value; - wchar_t m_wchar_value; - int32_t m_enumerated_value; - std::string m_string8_value; - std::wstring m_string16_value; - ExtendedAnnotationParameterValue m_extended_value; -}; - -/*! - * @brief This class represents the structure AppliedAnnotationParameter defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class AppliedAnnotationParameter -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI AppliedAnnotationParameter(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~AppliedAnnotationParameter(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - RTPS_DllAPI AppliedAnnotationParameter( - const AppliedAnnotationParameter& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - RTPS_DllAPI AppliedAnnotationParameter( - AppliedAnnotationParameter&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - RTPS_DllAPI AppliedAnnotationParameter& operator =( - const AppliedAnnotationParameter& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - RTPS_DllAPI AppliedAnnotationParameter& operator =( - AppliedAnnotationParameter&& x); - - /*! - * @brief This function copies the value in member paramname_hash - * @param _paramname_hash New value to be copied in member paramname_hash - */ - inline void paramname_hash( - const NameHash& _paramname_hash) - { - m_paramname_hash = _paramname_hash; - } - - /*! - * @brief This function moves the value in member paramname_hash - * @param _paramname_hash New value to be moved in member paramname_hash - */ - inline void paramname_hash( - NameHash&& _paramname_hash) - { - m_paramname_hash = std::move(_paramname_hash); - } - - /*! - * @brief This function returns a constant reference to member paramname_hash - * @return Constant reference to member paramname_hash - */ - inline const NameHash& paramname_hash() const - { - return m_paramname_hash; - } - - /*! - * @brief This function returns a reference to member paramname_hash - * @return Reference to member paramname_hash - */ - inline NameHash& paramname_hash() - { - return m_paramname_hash; - } - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - inline void value( - const AnnotationParameterValue& _value) - { - m_value = _value; - } - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - inline void value( - AnnotationParameterValue&& _value) - { - m_value = std::move(_value); - } - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - inline const AnnotationParameterValue& value() const - { - return m_value; - } - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - inline AnnotationParameterValue& value() - { - return m_value; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AppliedAnnotationParameter& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - RTPS_DllAPI static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const AppliedAnnotationParameter& other) const; - -private: - - NameHash m_paramname_hash; - AnnotationParameterValue m_value; -}; - - -// The application of an annotation to some type or type member -/*struct AppliedAnnotationParameter { - NameHash paramname_hash; - AnnotationParameterValue value; - };*/ -/* - class AppliedAnnotationParameter - { - public: - AppliedAnnotationParameter(); - ~AppliedAnnotationParameter(); - AppliedAnnotationParameter(const AppliedAnnotationParameter &x); - AppliedAnnotationParameter(AppliedAnnotationParameter &&x); - AppliedAnnotationParameter& operator=(const AppliedAnnotationParameter &x); - AppliedAnnotationParameter& operator=(AppliedAnnotationParameter &&x); - - inline void paramname_hash(const NameHash &_paramname_hash) { m_paramname_hash = _paramname_hash; } - inline void paramname_hash(NameHash &&_paramname_hash) { m_paramname_hash = std::move(_paramname_hash); } - inline const NameHash& paramname_hash() const { return m_paramname_hash; } - inline NameHash& paramname_hash() { return m_paramname_hash; } - - inline void value(const AnnotationParameterValue &_value) { m_value = _value; } - inline void value(AnnotationParameterValue &&_value) { m_value = std::move(_value); } - inline const AnnotationParameterValue& value() const { return m_value; } - inline AnnotationParameterValue& value() { return m_value; } - - static size_t getCdrSerializedSize(const AppliedAnnotationParameter& data, size_t current_alignment = 0); - void serialize(eprosima::fastcdr::Cdr &cdr) const; - void deserialize(eprosima::fastcdr::Cdr &cdr); - static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - static bool isKeyDefined(); - void serializeKey(eprosima::fastcdr::Cdr &cdr) const; - - private: - NameHash m_paramname_hash; - AnnotationParameterValue m_value; - }; - */ -// Sorted by AppliedAnnotationParameter.paramname_hash -typedef std::vector AppliedAnnotationParameterSeq; - -/*struct AppliedAnnotation { - TypeIdentifier annotation_typeid; - AppliedAnnotationParameterSeq param_seq; // @Optional - };*/ -class AppliedAnnotation -{ -public: - - RTPS_DllAPI AppliedAnnotation(); - - RTPS_DllAPI ~AppliedAnnotation(); - - RTPS_DllAPI AppliedAnnotation( - const AppliedAnnotation& x); - - RTPS_DllAPI AppliedAnnotation( - AppliedAnnotation&& x); - RTPS_DllAPI AppliedAnnotation& operator =( - const AppliedAnnotation& x); - RTPS_DllAPI AppliedAnnotation& operator =( - AppliedAnnotation&& x); - - inline void annotation_typeid( - const TypeIdentifier& _annotation_typeid) - { - m_annotation_typeid = _annotation_typeid; - } - - inline void annotation_typeid( - TypeIdentifier&& _annotation_typeid) - { - m_annotation_typeid = std::move(_annotation_typeid); - } - - inline const TypeIdentifier& annotation_typeid() const - { - return m_annotation_typeid; - } - - inline TypeIdentifier& annotation_typeid() - { - return m_annotation_typeid; - } - - inline void param_seq( - const AppliedAnnotationParameterSeq& _param_seq) - { - m_param_seq = _param_seq; - } - - inline void param_seq( - AppliedAnnotationParameterSeq&& _param_seq) - { - m_param_seq = std::move(_param_seq); - } - - inline const AppliedAnnotationParameterSeq& param_seq() const - { - return m_param_seq; - } - - inline AppliedAnnotationParameterSeq& param_seq() - { - return m_param_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AppliedAnnotation& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - RTPS_DllAPI static bool isKeyDefined(); - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const AppliedAnnotation& other) const; - -private: - - TypeIdentifier m_annotation_typeid; - AppliedAnnotationParameterSeq m_param_seq; -}; - -// Sorted by AppliedAnnotation.annotation_typeid -typedef std::vector AppliedAnnotationSeq; - -// @verbatim(placement="", language="", text="") -/*struct AppliedVerbatimAnnotation { - std::string placement; // 32 - std::string language; // 32 - std::string text; - };*/ -class AppliedVerbatimAnnotation -{ -public: - - RTPS_DllAPI AppliedVerbatimAnnotation(); - - RTPS_DllAPI ~AppliedVerbatimAnnotation(); - - RTPS_DllAPI AppliedVerbatimAnnotation( - const AppliedVerbatimAnnotation& x); - - RTPS_DllAPI AppliedVerbatimAnnotation( - AppliedVerbatimAnnotation&& x); - - RTPS_DllAPI AppliedVerbatimAnnotation& operator =( - const AppliedVerbatimAnnotation& x); - - RTPS_DllAPI AppliedVerbatimAnnotation& operator =( - AppliedVerbatimAnnotation&& x); - - inline void placement( - const std::string& _placement) - { - m_placement = _placement; - } - - inline void placement( - std::string&& _placement) - { - m_placement = std::move(_placement); - } - - inline const std::string& placement() const - { - return m_placement; - } - - inline std::string& placement() - { - return m_placement; - } - - inline void language( - const std::string& _language) - { - m_language = _language; - } - - inline void language( - std::string&& _language) - { - m_language = std::move(_language); - } - - inline const std::string& language() const - { - return m_language; - } - - inline std::string& language() - { - return m_language; - } - - inline void text( - const std::string& _text) - { - m_text = _text; - } - - inline void text( - std::string&& _text) - { - m_text = std::move(_text); - } - - inline const std::string& text() const - { - return m_text; - } - - inline std::string& text() - { - return m_text; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AppliedVerbatimAnnotation& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - RTPS_DllAPI static bool isKeyDefined(); - - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const AppliedVerbatimAnnotation& other) const; - -private: - - std::string m_placement; - std::string m_language; - std::string m_text; -}; - -// --- Aggregate types: ----------------------------------------------- -/*struct AppliedBuiltinMemberAnnotations { - std::string unit; // @unit("") // @Optional - AnnotationParameterValue min; // @min , @range // @Optional - AnnotationParameterValue max; // @max , @range // @Optional - std::string hash_id; // @hash_id("") // @Optional - }; - */ -class AppliedBuiltinMemberAnnotations -{ -public: - - RTPS_DllAPI AppliedBuiltinMemberAnnotations(); - - RTPS_DllAPI ~AppliedBuiltinMemberAnnotations(); - - RTPS_DllAPI AppliedBuiltinMemberAnnotations( - const AppliedBuiltinMemberAnnotations& x); - - RTPS_DllAPI AppliedBuiltinMemberAnnotations( - AppliedBuiltinMemberAnnotations&& x); - - RTPS_DllAPI AppliedBuiltinMemberAnnotations& operator =( - const AppliedBuiltinMemberAnnotations& x); - - RTPS_DllAPI AppliedBuiltinMemberAnnotations& operator =( - AppliedBuiltinMemberAnnotations&& x); - - inline void unit( - const std::string& _unit) - { - m_unit = _unit; - } - - inline void unit( - std::string&& _unit) - { - m_unit = std::move(_unit); - } - - inline const std::string& unit() const - { - return m_unit; - } - - inline std::string& unit() - { - return m_unit; - } - - inline void min( - const AnnotationParameterValue& _min) - { - m_min = _min; - } - - inline void min( - AnnotationParameterValue&& _min) - { - m_min = std::move(_min); - } - - inline const AnnotationParameterValue& min() const - { - return m_min; - } - - inline AnnotationParameterValue& min() - { - return m_min; - } - - inline void max( - const AnnotationParameterValue& _max) - { - m_max = _max; - } - - inline void max( - AnnotationParameterValue&& _max) - { - m_max = std::move(_max); - } - - inline const AnnotationParameterValue& max() const - { - return m_max; - } - - inline AnnotationParameterValue& max() - { - return m_max; - } - - inline void hash_id( - const std::string& _hash_id) - { - m_hash_id = _hash_id; - } - - inline void hash_id( - std::string&& _hash_id) - { - m_hash_id = std::move(_hash_id); - } - - inline const std::string& hash_id() const - { - return m_hash_id; - } - - inline std::string& hash_id() - { - return m_hash_id; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AppliedBuiltinMemberAnnotations& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - RTPS_DllAPI static bool isKeyDefined(); - - RTPS_DllAPI void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - RTPS_DllAPI bool operator ==( - const AppliedBuiltinMemberAnnotations& other) const; - -private: - - std::string m_unit; - AnnotationParameterValue m_min; - AnnotationParameterValue m_max; - std::string m_hash_id; -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#if _MSC_VER - -#if defined(FASTDDS_RESTORE_MIN) -#pragma pop_macro("min") -#undef FASTDDS_RESTORE_MIN -#endif // defined(FASTDDS_RESTORE_MIN) - -#if defined(FASTDDS_RESTORE_MAX) -#pragma pop_macro("max") -#undef FASTDDS_RESTORE_MAX -#endif // defined(FASTDDS_RESTORE_MAX) - -#endif // if _MSC_VER - -#endif // _ANNOTATIONPARAMETERVALUE_H_ diff --git a/include/fastrtps/types/BuiltinAnnotationsTypeObject.h b/include/fastrtps/types/BuiltinAnnotationsTypeObject.h deleted file mode 100644 index 69364ca5181..00000000000 --- a/include/fastrtps/types/BuiltinAnnotationsTypeObject.h +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BuiltinAnnotationsTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ -#define _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ - - -#include -#include -#include - -using namespace eprosima::fastrtps::types; - -void register_builtin_annotations_types(TypeObjectFactory* factory); - -const TypeIdentifier* GetidIdentifier(bool complete = false); -const TypeObject* GetidObject(bool complete = false); -const TypeObject* GetMinimalidObject(); -const TypeObject* GetCompleteidObject(); - -const TypeIdentifier* GetautoidIdentifier(bool complete = false); -const TypeObject* GetautoidObject(bool complete = false); -const TypeObject* GetMinimalautoidObject(); -const TypeObject* GetCompleteautoidObject(); - -namespace autoid -{ - const TypeIdentifier* GetAutoidKindIdentifier(bool complete = false); - const TypeObject* GetAutoidKindObject(bool complete = false); - const TypeObject* GetMinimalAutoidKindObject(); - const TypeObject* GetCompleteAutoidKindObject(); -} - -const TypeIdentifier* GetoptionalIdentifier(bool complete = false); -const TypeObject* GetoptionalObject(bool complete = false); -const TypeObject* GetMinimaloptionalObject(); -const TypeObject* GetCompleteoptionalObject(); - -const TypeIdentifier* GetpositionIdentifier(bool complete = false); -const TypeObject* GetpositionObject(bool complete = false); -const TypeObject* GetMinimalpositionObject(); -const TypeObject* GetCompletepositionObject(); - -const TypeIdentifier* GetvalueIdentifier(bool complete = false); -const TypeObject* GetvalueObject(bool complete = false); -const TypeObject* GetMinimalvalueObject(); -const TypeObject* GetCompletevalueObject(); - -const TypeIdentifier* GetextensibilityIdentifier(bool complete = false); -const TypeObject* GetextensibilityObject(bool complete = false); -const TypeObject* GetMinimalextensibilityObject(); -const TypeObject* GetCompleteextensibilityObject(); - -namespace extensibility -{ - const TypeIdentifier* GetExtensibilityKindIdentifier(bool complete = false); - const TypeObject* GetExtensibilityKindObject(bool complete = false); - const TypeObject* GetMinimalExtensibilityKindObject(); - const TypeObject* GetCompleteExtensibilityKindObject(); -} - -const TypeIdentifier* GetfinalIdentifier(bool complete = false); -const TypeObject* GetfinalObject(bool complete = false); -const TypeObject* GetMinimalfinalObject(); -const TypeObject* GetCompletefinalObject(); - -const TypeIdentifier* GetappendableIdentifier(bool complete = false); -const TypeObject* GetappendableObject(bool complete = false); -const TypeObject* GetMinimalappendableObject(); -const TypeObject* GetCompleteappendableObject(); - -const TypeIdentifier* GetmutableIdentifier(bool complete = false); -const TypeObject* GetmutableObject(bool complete = false); -const TypeObject* GetMinimalmutableObject(); -const TypeObject* GetCompletemutableObject(); - -const TypeIdentifier* GetkeyIdentifier(bool complete = false); -const TypeObject* GetkeyObject(bool complete = false); -const TypeObject* GetMinimalkeyObject(); -const TypeObject* GetCompletekeyObject(); - -const TypeIdentifier* Getmust_understandIdentifier(bool complete = false); -const TypeObject* Getmust_understandObject(bool complete = false); -const TypeObject* GetMinimalmust_understandObject(); -const TypeObject* GetCompletemust_understandObject(); - -const TypeIdentifier* Getdefault_literalIdentifier(bool complete = false); -const TypeObject* Getdefault_literalObject(bool complete = false); -const TypeObject* GetMinimaldefault_literalObject(); -const TypeObject* GetCompletedefault_literalObject(); - -const TypeIdentifier* GetdefaultIdentifier(bool complete = false); -const TypeObject* GetdefaultObject(bool complete = false); -const TypeObject* GetMinimaldefaultObject(); -const TypeObject* GetCompletedefaultObject(); - -const TypeIdentifier* GetrangeIdentifier(bool complete = false); -const TypeObject* GetrangeObject(bool complete = false); -const TypeObject* GetMinimalrangeObject(); -const TypeObject* GetCompleterangeObject(); - -const TypeIdentifier* GetminIdentifier(bool complete = false); -const TypeObject* GetminObject(bool complete = false); -const TypeObject* GetMinimalminObject(); -const TypeObject* GetCompleteminObject(); - -const TypeIdentifier* GetmaxIdentifier(bool complete = false); -const TypeObject* GetmaxObject(bool complete = false); -const TypeObject* GetMinimalmaxObject(); -const TypeObject* GetCompletemaxObject(); - -const TypeIdentifier* GetunitIdentifier(bool complete = false); -const TypeObject* GetunitObject(bool complete = false); -const TypeObject* GetMinimalunitObject(); -const TypeObject* GetCompleteunitObject(); - -const TypeIdentifier* Getbit_boundIdentifier(bool complete = false); -const TypeObject* Getbit_boundObject(bool complete = false); -const TypeObject* GetMinimalbit_boundObject(); -const TypeObject* GetCompletebit_boundObject(); - -const TypeIdentifier* GetexternalIdentifier(bool complete = false); -const TypeObject* GetexternalObject(bool complete = false); -const TypeObject* GetMinimalexternalObject(); -const TypeObject* GetCompleteexternalObject(); - -const TypeIdentifier* GetnestedIdentifier(bool complete = false); -const TypeObject* GetnestedObject(bool complete = false); -const TypeObject* GetMinimalnestedObject(); -const TypeObject* GetCompletenestedObject(); - -const TypeIdentifier* GetverbatimIdentifier(bool complete = false); -const TypeObject* GetverbatimObject(bool complete = false); -const TypeObject* GetMinimalverbatimObject(); -const TypeObject* GetCompleteverbatimObject(); - -namespace verbatim -{ - const TypeIdentifier* GetPlacementKindIdentifier(bool complete = false); - const TypeObject* GetPlacementKindObject(bool complete = false); - const TypeObject* GetMinimalPlacementKindObject(); - const TypeObject* GetCompletePlacementKindObject(); -} - -const TypeIdentifier* GetserviceIdentifier(bool complete = false); -const TypeObject* GetserviceObject(bool complete = false); -const TypeObject* GetMinimalserviceObject(); -const TypeObject* GetCompleteserviceObject(); - -const TypeIdentifier* GetonewayIdentifier(bool complete = false); -const TypeObject* GetonewayObject(bool complete = false); -const TypeObject* GetMinimalonewayObject(); -const TypeObject* GetCompleteonewayObject(); - -const TypeIdentifier* GetamiIdentifier(bool complete = false); -const TypeObject* GetamiObject(bool complete = false); -const TypeObject* GetMinimalamiObject(); -const TypeObject* GetCompleteamiObject(); - -const TypeIdentifier* Getnon_serializedIdentifier(bool complete = false); -const TypeObject* Getnon_serializedObject(bool complete = false); -const TypeObject* GetMinimalnon_serializedObject(); -const TypeObject* GetCompletenon_serializedObject(); - -#endif // _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/include/fastrtps/types/DynamicData.h b/include/fastrtps/types/DynamicData.h deleted file mode 100644 index 6020b46105f..00000000000 --- a/include/fastrtps/types/DynamicData.h +++ /dev/null @@ -1,788 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_DATA_H -#define TYPES_DYNAMIC_DATA_H - -#include -#include -#include - -//#define DYNAMIC_TYPES_CHECKING - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace DDSSQLFilter { - -class DDSFilterExpression; - -} // namespace DDSSQLFilter -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; -class MemberDescriptor; - -class DynamicData -{ -protected: - - DynamicData(); - DynamicData( - const DynamicData* pData); - DynamicData( - DynamicType_ptr pType); - - ~DynamicData(); - - void add_value( - TypeKind kind, - MemberId id); - - void create_members( - DynamicType_ptr pType); - - void create_members( - const DynamicData* pData); - - void clean(); - - void clean_members(); - - void* clone_value( - MemberId id, - TypeKind kind) const; - - bool compare_values( - TypeKind kind, - void* left, - void* right) const; - - ReturnCode_t insert_array_data( - MemberId indexId); - - void serialize_empty_data( - const DynamicType_ptr pType, - eprosima::fastcdr::Cdr& cdr) const; - - void set_default_value( - MemberId id); - - void get_value( - std::string& sOutValue, - MemberId id = MEMBER_ID_INVALID) const; - - void set_value( - const std::string& sValue, - MemberId id = MEMBER_ID_INVALID); - - void set_type_name( - const std::string& name); - - MemberId get_union_id() const; - - ReturnCode_t set_union_id( - MemberId id); - - void update_union_discriminator(); - - void sort_member_ids( - MemberId startId); - - void set_union_discriminator( - DynamicData* pData); - - // Serializes and deserializes the Dynamic Data. - bool deserialize( - eprosima::fastcdr::Cdr& cdr); - - bool deserialize_discriminator( - eprosima::fastcdr::Cdr& cdr); - - static size_t getCdrSerializedSize( - const DynamicData* data, - size_t current_alignment = 0); - - static size_t getEmptyCdrSerializedSize( - const DynamicType* type, - size_t current_alignment = 0); - - static size_t getKeyMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment = 0); - - static size_t getMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment = 0); - - void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - void serialize_discriminator( - eprosima::fastcdr::Cdr& cdr) const; - - void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - DynamicType_ptr type_; - std::map descriptors_; - -#ifdef DYNAMIC_TYPES_CHECKING - int32_t int32_value_; - uint32_t uint32_value_; - int16_t int16_value_; - uint16_t uint16_value_; - int64_t int64_value_; - uint64_t uint64_value_; - float float32_value_; - double float64_value_; - long double float128_value_; - char char8_value_; - wchar_t char16_value_; - octet byte_value_; - bool bool_value_; - std::string string_value_; - std::wstring wstring_value_; - std::map complex_values_; -#else - std::map values_; -#endif // ifdef DYNAMIC_TYPES_CHECKING - std::vector loaned_values_; - bool key_element_; - DynamicData* default_array_value_; - uint64_t union_label_; - MemberId union_id_; - DynamicData* union_discriminator_; - uint64_t discriminator_value_; - - friend class DynamicDataFactory; - friend class DynamicPubSubType; - friend class DynamicDataHelper; - friend class eprosima::fastdds::dds::DDSSQLFilter::DDSFilterExpression; - -public: - - RTPS_DllAPI ReturnCode_t get_descriptor( - MemberDescriptor& value, - MemberId id); - - RTPS_DllAPI ReturnCode_t set_descriptor( - MemberId id, - const MemberDescriptor* value); - - RTPS_DllAPI ReturnCode_t clear_all_values(); - - RTPS_DllAPI ReturnCode_t clear_nonkey_values(); - - RTPS_DllAPI ReturnCode_t clear_value( - MemberId id); - - RTPS_DllAPI bool equals( - const DynamicData* other) const; - - RTPS_DllAPI TypeKind get_kind() const; - - RTPS_DllAPI uint32_t get_item_count() const; - - RTPS_DllAPI std::string get_name(); - - RTPS_DllAPI MemberId get_member_id_by_name( - const std::string& name) const; - - RTPS_DllAPI MemberId get_member_id_at_index( - uint32_t index) const; - - RTPS_DllAPI DynamicData* loan_value( - MemberId id); - - RTPS_DllAPI ReturnCode_t return_loaned_value( - const DynamicData* value); - - RTPS_DllAPI MemberId get_array_index( - const std::vector& position); - - RTPS_DllAPI ReturnCode_t insert_sequence_data( - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_int32_value( - int32_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_uint32_value( - uint32_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_int16_value( - int16_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_uint16_value( - uint16_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_int64_value( - int64_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_uint64_value( - uint64_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_float32_value( - float value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_float64_value( - double value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_float128_value( - long double value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_char8_value( - char value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_char16_value( - wchar_t value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_byte_value( - octet value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_bool_value( - bool value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_string_value( - const std::string& value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_wstring_value( - const std::wstring& value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_enum_value( - const std::string& value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_complex_value( - const DynamicData* value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_complex_value( - DynamicData* value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t insert_complex_value( - DynamicData_ptr value, - MemberId& outId); - - RTPS_DllAPI ReturnCode_t remove_sequence_data( - MemberId id); - - RTPS_DllAPI ReturnCode_t clear_data(); - - RTPS_DllAPI ReturnCode_t clear_array_data( - MemberId indexId); - - RTPS_DllAPI ReturnCode_t insert_map_data( - const DynamicData* key, - MemberId& outKeyId, - MemberId& outValueId); - - RTPS_DllAPI ReturnCode_t insert_map_data( - const DynamicData* key, - DynamicData* value, - MemberId& outKey, - MemberId& outValue); - - RTPS_DllAPI ReturnCode_t insert_map_data( - const DynamicData* key, - const DynamicData* value, - MemberId& outKey, - MemberId& outValue); - - RTPS_DllAPI ReturnCode_t insert_map_data( - const DynamicData* key, - DynamicData_ptr value, - MemberId& outKey, - MemberId& outValue); - - RTPS_DllAPI ReturnCode_t remove_map_data( - MemberId keyId); - - RTPS_DllAPI ReturnCode_t get_int32_value( - int32_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_int32_value( - int32_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_uint32_value( - uint32_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_uint32_value( - uint32_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_int16_value( - int16_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_int16_value( - int16_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_uint16_value( - uint16_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_uint16_value( - uint16_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_int64_value( - int64_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_int64_value( - int64_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_uint64_value( - uint64_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_uint64_value( - uint64_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_float32_value( - float& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_float32_value( - float value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_float64_value( - double& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_float64_value( - double value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_float128_value( - long double& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_float128_value( - long double value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_char8_value( - char& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_char8_value( - char value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_char16_value( - wchar_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_char16_value( - wchar_t value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_byte_value( - octet& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_byte_value( - octet value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_int8_value( - int8_t& value, - MemberId id) const - { - octet aux; - ReturnCode_t result = get_byte_value(aux, id); - value = static_cast(aux); - return result; - } - - RTPS_DllAPI ReturnCode_t set_int8_value( - int8_t value, - MemberId id = MEMBER_ID_INVALID) - { - return set_byte_value(static_cast(value), id); - } - - RTPS_DllAPI ReturnCode_t get_uint8_value( - uint8_t& value, - MemberId id) const - { - octet aux; - ReturnCode_t result = get_byte_value(aux, id); - value = static_cast(aux); - return result; - } - - RTPS_DllAPI ReturnCode_t set_uint8_value( - uint8_t value, - MemberId id = MEMBER_ID_INVALID) - { - return set_byte_value(static_cast(value), id); - } - - RTPS_DllAPI ReturnCode_t get_bool_value( - bool& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_bool_value( - bool value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t set_bool_value( - bool value, - const std::string& name) - { - MemberId id = get_member_id_by_name(name); - if (id != MEMBER_ID_INVALID) - { - return set_bool_value(value, id); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - - RTPS_DllAPI ReturnCode_t get_string_value( - std::string& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_string_value( - const std::string& value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_wstring_value( - std::wstring& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_wstring_value( - const std::wstring& value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_enum_value( - std::string& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_enum_value( - const std::string& value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_enum_value( - uint32_t& value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_enum_value( - const uint32_t& value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_bitmask_value( - uint64_t& value) const; - - RTPS_DllAPI uint64_t get_bitmask_value() const - { - uint64_t value; - if (get_bitmask_value(value) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI ReturnCode_t set_bitmask_value( - uint64_t value); - - RTPS_DllAPI ReturnCode_t get_complex_value( - DynamicData** value, - MemberId id) const; - - RTPS_DllAPI ReturnCode_t set_complex_value( - DynamicData* value, - MemberId id = MEMBER_ID_INVALID); - - RTPS_DllAPI ReturnCode_t get_union_label( - uint64_t& value) const; - - // Basic types returns (copy) - RTPS_DllAPI int32_t get_int32_value( - MemberId id) const - { - int32_t value; - if (get_int32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint32_t get_uint32_value( - MemberId id) const - { - uint32_t value; - if (get_uint32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI int16_t get_int16_value( - MemberId id) const - { - int16_t value; - if (get_int16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint16_t get_uint16_value( - MemberId id) const - { - uint16_t value; - if (get_uint16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI int64_t get_int64_value( - MemberId id) const - { - int64_t value; - if (get_int64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint64_t get_uint64_value( - MemberId id) const - { - uint64_t value; - if (get_uint64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI float get_float32_value( - MemberId id) const - { - float value; - if (get_float32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI double get_float64_value( - MemberId id) const - { - double value; - if (get_float64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI long double get_float128_value( - MemberId id) const - { - long double value; - if (get_float128_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI char get_char8_value( - MemberId id) const - { - char value; - if (get_char8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI wchar_t get_char16_value( - MemberId id) const - { - wchar_t value; - if (get_char16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI octet get_byte_value( - MemberId id) const - { - octet value; - if (get_byte_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI int8_t get_int8_value( - MemberId id) const - { - int8_t value; - if (get_int8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint8_t get_uint8_value( - MemberId id) const - { - uint8_t value; - if (get_uint8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI bool get_bool_value( - MemberId id) const - { - bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI bool get_bool_value( - const std::string& name) const - { - MemberId id = get_member_id_by_name(name); - bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI std::string get_string_value( - MemberId id) const - { - std::string value; - if (get_string_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI std::wstring get_wstring_value( - MemberId id) const - { - std::wstring value; - if (get_wstring_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI std::string get_enum_value( - MemberId id) const - { - std::string value; - if (get_enum_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint64_t get_union_label() const - { - uint64_t value; - if (get_union_label(value) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - RTPS_DllAPI uint64_t get_discriminator_value() const - { - return discriminator_value_; - } - - RTPS_DllAPI void get_discriminator_value( - uint64_t& outValue) const - { - outValue = discriminator_value_; - } - - RTPS_DllAPI void set_discriminator_value( - uint64_t value) - { - discriminator_value_ = value; - } - -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_H diff --git a/include/fastrtps/types/DynamicDataFactory.h b/include/fastrtps/types/DynamicDataFactory.h deleted file mode 100644 index db87510f51a..00000000000 --- a/include/fastrtps/types/DynamicDataFactory.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_DATA_FACTORY_H -#define TYPES_DYNAMIC_DATA_FACTORY_H - -#include -#include -#include -#include -#include -#include - -//#define DISABLE_DYNAMIC_MEMORY_CHECK - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataFactory -{ -protected: - DynamicDataFactory(); - - ReturnCode_t create_members( - DynamicData* pData, - DynamicType_ptr pType); - -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::vector dynamic_datas_; - mutable std::recursive_mutex mutex_; -#endif - -public: - ~DynamicDataFactory(); - - RTPS_DllAPI static DynamicDataFactory* get_instance(); - - RTPS_DllAPI static ReturnCode_t delete_instance(); - - RTPS_DllAPI DynamicData* create_data(DynamicTypeBuilder* pBuilder); - - RTPS_DllAPI DynamicData* create_data(DynamicType_ptr pType); - - RTPS_DllAPI DynamicData* create_copy(const DynamicData* pData); - - RTPS_DllAPI ReturnCode_t delete_data(DynamicData* pData); - - RTPS_DllAPI bool is_empty() const; -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_FACTORY_H diff --git a/include/fastrtps/types/DynamicDataHelper.hpp b/include/fastrtps/types/DynamicDataHelper.hpp deleted file mode 100644 index 9f1b17d28c0..00000000000 --- a/include/fastrtps/types/DynamicDataHelper.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ -#define _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataHelper -{ -public: - - RTPS_DllAPI static void print( - const DynamicData_ptr& data); - - RTPS_DllAPI static std::ostream& print( - std::ostream& output, - const DynamicData_ptr& data); - - RTPS_DllAPI static void print( - const DynamicData* data); - - RTPS_DllAPI static std::ostream& print( - std::ostream& output, - const DynamicData* data); - -protected: - - static void print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind); - - static void print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind, - std::ostream& output); - - static void print_collection( - DynamicData* data, - const std::string& tabs = ""); - - static void print_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs = ""); - - static void fill_array_positions( - const std::vector& bounds, - std::vector>& positions); - - static void get_index_position( - uint32_t index, - const std::vector& bounds, - std::vector& position); - - static void aux_index_position( - uint32_t index, - uint32_t inner_index, - const std::vector& bounds, - std::vector& position); - - static void print_basic_collection( - DynamicData* data); - - static void print_basic_collection( - DynamicData* data, - std::ostream& output); - - static void print_complex_collection( - DynamicData* data, - const std::string& tabs = ""); - - static void print_complex_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs = ""); - - static void print_complex_element( - DynamicData* data, - MemberId id, - const std::string& tabs = ""); - - static void print_complex_element( - DynamicData* data, - MemberId id, - std::ostream& output, - const std::string& tabs = ""); - - static void print_member( - DynamicData* data, - const DynamicTypeMember* type, - const std::string& tabs = ""); - - static void print_member( - DynamicData* data, - std::ostream& output, - const DynamicTypeMember* type, - const std::string& tabs = ""); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ diff --git a/include/fastrtps/types/DynamicDataPtr.h b/include/fastrtps/types/DynamicDataPtr.h deleted file mode 100644 index 342cd274f6d..00000000000 --- a/include/fastrtps/types/DynamicDataPtr.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_DATA_PTR_H -#define TYPES_DYNAMIC_DATA_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicData; - -class DynamicData_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator->; - using Base::operator*; - using Base::operator bool; - - RTPS_DllAPI DynamicData_ptr() - { - } - - RTPS_DllAPI explicit DynamicData_ptr( - DynamicData* pData); - - RTPS_DllAPI DynamicData_ptr( - const DynamicData_ptr& other) = default; - - RTPS_DllAPI DynamicData_ptr( - DynamicData_ptr&& other) = default; - - RTPS_DllAPI DynamicData_ptr& operator =( - const DynamicData_ptr&) = default; - - RTPS_DllAPI DynamicData_ptr& operator =( - DynamicData_ptr&&) = default; - - RTPS_DllAPI DynamicData_ptr& operator =( - DynamicData*); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_PTR_H diff --git a/include/fastrtps/types/DynamicPubSubType.h b/include/fastrtps/types/DynamicPubSubType.h deleted file mode 100644 index e7ac0a8a80c..00000000000 --- a/include/fastrtps/types/DynamicPubSubType.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_PUB_SUB_TYPE_H -#define TYPES_DYNAMIC_PUB_SUB_TYPE_H - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -protected: - - void UpdateDynamicTypeInfo(); - - DynamicType_ptr dynamic_type_; - MD5 m_md5; - unsigned char* m_keyBuffer; - - enum - { - FINAL, - APPENDABLE, - MUTABLE - } - extensibility_ {APPENDABLE}; - -public: - - RTPS_DllAPI DynamicPubSubType(); - - RTPS_DllAPI DynamicPubSubType( - DynamicType_ptr pDynamicType); - - RTPS_DllAPI virtual ~DynamicPubSubType(); - - RTPS_DllAPI void* createData() override; - - RTPS_DllAPI void deleteData ( - void* data) override; - - RTPS_DllAPI bool deserialize ( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - RTPS_DllAPI bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - RTPS_DllAPI std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - RTPS_DllAPI std::function getSerializedSizeProvider( - void* data, - fastdds::dds::DataRepresentationId_t data_representation) override; - - RTPS_DllAPI bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - RTPS_DllAPI bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - RTPS_DllAPI void CleanDynamicType(); - - RTPS_DllAPI DynamicType_ptr GetDynamicType() const; - - RTPS_DllAPI ReturnCode_t SetDynamicType( - DynamicData_ptr pData); - - RTPS_DllAPI ReturnCode_t SetDynamicType( - DynamicType_ptr pType); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_PUB_SUB_TYPE_H diff --git a/include/fastrtps/types/DynamicType.h b/include/fastrtps/types/DynamicType.h deleted file mode 100644 index ab2e81fa938..00000000000 --- a/include/fastrtps/types/DynamicType.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_H -#define TYPES_DYNAMIC_TYPE_H - -#include -#include - -namespace eprosima { - -namespace fastdds { -namespace dds { -class DomainParticipantImpl; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class TypeDescriptor; -class DynamicTypeMember; -class DynamicTypeBuilder; - -class DynamicType -{ -protected: - - friend class DynamicTypeBuilder; - friend class DynamicTypeBuilderFactory; - friend class MemberDescriptor; - friend class TypeDescriptor; - friend class DynamicData; - friend class DynamicDataFactory; - friend class AnnotationDescriptor; - friend class TypeObjectFactory; - friend class DynamicTypeMember; - friend class DynamicDataHelper; - friend class fastdds::dds::DomainParticipantImpl; - - DynamicType(); - - RTPS_DllAPI DynamicType( - const TypeDescriptor* descriptor); - - DynamicType( - const DynamicTypeBuilder* other); - - RTPS_DllAPI virtual ~DynamicType(); - - RTPS_DllAPI virtual void clear(); - - ReturnCode_t copy_from_builder( - const DynamicTypeBuilder* other); - - // Checks if there is a member with the given name. - bool exists_member_by_name( - const std::string& name) const; - - // This method is used by Dynamic Data to override the name of the types based on ALIAS. - void set_name( - const std::string& name); - - ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - ReturnCode_t apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - ReturnCode_t get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx); - - uint32_t get_annotation_count(); - - DynamicType_ptr get_base_type() const; - - DynamicType_ptr get_discriminator_type() const; - - DynamicType_ptr get_element_type() const; - - DynamicType_ptr get_key_element_type() const; - - ReturnCode_t get_member( - DynamicTypeMember& member, - MemberId id); - - ReturnCode_t get_member_by_name( - DynamicTypeMember& member, - const std::string& name); - - TypeDescriptor* descriptor_; - std::map member_by_id_; // Aggregated members - std::map member_by_name_; // Uses the pointers from "member_by_id_". - std::string name_; - TypeKind kind_; - bool is_key_defined_; - -public: - - RTPS_DllAPI bool equals( - const DynamicType* other) const; - - RTPS_DllAPI ReturnCode_t get_all_members( - std::map& members); - - RTPS_DllAPI ReturnCode_t get_all_members_by_name( - std::map& members); - - RTPS_DllAPI uint32_t get_bounds( - uint32_t index = 0) const; - - RTPS_DllAPI uint32_t get_bounds_size() const; - - RTPS_DllAPI ReturnCode_t get_descriptor( - TypeDescriptor* descriptor) const; - - RTPS_DllAPI const TypeDescriptor* get_descriptor() const; - - RTPS_DllAPI TypeDescriptor* get_descriptor(); - - RTPS_DllAPI bool key_annotation() const; - - RTPS_DllAPI inline TypeKind get_kind() const - { - return kind_; - } - - RTPS_DllAPI std::string get_name() const; - - RTPS_DllAPI MemberId get_members_count() const; - - RTPS_DllAPI uint32_t get_total_bounds() const; - - RTPS_DllAPI const TypeDescriptor* get_type_descriptor() const - { - return descriptor_; - } - - RTPS_DllAPI bool has_children() const; - - RTPS_DllAPI bool is_consistent() const; - - RTPS_DllAPI bool is_complex_kind() const; - - RTPS_DllAPI bool is_discriminator_type() const; - - RTPS_DllAPI size_t get_size() const; - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_H diff --git a/include/fastrtps/types/DynamicTypeBuilder.h b/include/fastrtps/types/DynamicTypeBuilder.h deleted file mode 100644 index 1d26ea66e19..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilder.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_H -#define TYPES_DYNAMIC_TYPE_BUILDER_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class TypeDescriptor; -class MemberDescriptor; -class DynamicType; -class DynamicTypeMember; - -class DynamicTypeBuilder -{ -protected: - DynamicTypeBuilder(); - - DynamicTypeBuilder(const DynamicTypeBuilder* builder); - - DynamicTypeBuilder(const TypeDescriptor* descriptor); - - virtual ~DynamicTypeBuilder(); - - friend class DynamicType; - friend class DynamicTypeBuilderFactory; - - TypeDescriptor* descriptor_; - std::map member_by_id_; // Aggregated members - std::map member_by_name_; // Uses the pointers from "member_by_id_". - std::string name_; - TypeKind kind_; - MemberId current_member_id_; - uint32_t max_index_; - - ReturnCode_t _apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - ReturnCode_t _apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - bool check_union_configuration(const MemberDescriptor* descriptor); - - // Checks if there is a member with the given name. - bool exists_member_by_name(const std::string& name) const; - - void refresh_member_ids(); - - void clear(); - - ReturnCode_t copy_from_builder(const DynamicTypeBuilder* other); - -public: - RTPS_DllAPI ReturnCode_t add_empty_member( - uint32_t index, - const std::string& name); - - RTPS_DllAPI ReturnCode_t add_member(const MemberDescriptor* descriptor); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_ = nullptr); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_, - const std::string& defaultValue); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_ = DynamicType_ptr(nullptr)); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue); - - RTPS_DllAPI ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - RTPS_DllAPI ReturnCode_t apply_annotation(AnnotationDescriptor& descriptor); - - RTPS_DllAPI ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - RTPS_DllAPI ReturnCode_t apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - RTPS_DllAPI ReturnCode_t apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - RTPS_DllAPI DynamicType_ptr build(); - - RTPS_DllAPI ReturnCode_t copy_from(const DynamicTypeBuilder* other); - - ReturnCode_t get_all_members(std::map& members); - - RTPS_DllAPI inline TypeKind get_kind() const - { - return kind_; - } - - RTPS_DllAPI std::string get_name() const; - - RTPS_DllAPI MemberId get_member_id_by_name(const std::string& name) const; - - const TypeDescriptor* get_type_descriptor() const - { - return descriptor_; - } - - bool is_consistent() const; - - bool is_discriminator_type() const; - - RTPS_DllAPI ReturnCode_t set_name(const std::string& name); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_H diff --git a/include/fastrtps/types/DynamicTypeBuilderFactory.h b/include/fastrtps/types/DynamicTypeBuilderFactory.h deleted file mode 100644 index 3fa52ea39b8..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderFactory.h +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H -#define TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H - -#include -#include -#include -#include - -//#define DISABLE_DYNAMIC_MEMORY_CHECK - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class DynamicTypeBuilder; -class TypeDescriptor; -class TypeIdentifier; -class MemberDescriptor; -class TypeObject; -class DynamicType; -class DynamicType_ptr; -class AnnotationParameterValue; - -class DynamicTypeBuilderFactory -{ -protected: - - DynamicTypeBuilderFactory(); - - inline void add_builder_to_list( - DynamicTypeBuilder* pBuilder); - - DynamicType_ptr build_type( - DynamicType_ptr other); - - void build_alias_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_string8_type_code( - const TypeDescriptor* descriptor) const; - - void build_string16_type_code( - const TypeDescriptor* descriptor) const; - - void build_sequence_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_array_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_map_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_enum_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_struct_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_union_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_bitset_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_bitmask_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_annotation_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void set_annotation_default_value( - AnnotationParameterValue& apv, - const MemberDescriptor* member) const; - - void apply_type_annotations( - AppliedAnnotationSeq& annotations, - const TypeDescriptor* descriptor) const; - -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::vector builders_list_; - mutable std::recursive_mutex mutex_; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - -public: - - RTPS_DllAPI static DynamicTypeBuilderFactory* get_instance(); - - RTPS_DllAPI static ReturnCode_t delete_instance(); - - ~DynamicTypeBuilderFactory(); - - RTPS_DllAPI DynamicType_ptr get_primitive_type( - TypeKind kind); - - RTPS_DllAPI ReturnCode_t delete_builder( - DynamicTypeBuilder* builder); - - RTPS_DllAPI ReturnCode_t delete_type( - DynamicType* type); - - RTPS_DllAPI DynamicTypeBuilder* create_custom_builder( - const TypeDescriptor* descriptor, - const std::string& name = ""); - - RTPS_DllAPI DynamicTypeBuilder* create_builder_copy( - const DynamicTypeBuilder* type); - - RTPS_DllAPI DynamicTypeBuilder* create_int32_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_uint32_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_int16_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_uint16_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_int64_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_uint64_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_float32_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_float64_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_float128_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_char8_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_char16_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_bool_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_byte_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_string_builder( - uint32_t bound = MAX_STRING_LENGTH); - - RTPS_DllAPI DynamicTypeBuilder* create_wstring_builder( - uint32_t bound = MAX_STRING_LENGTH); - - RTPS_DllAPI DynamicTypeBuilder* create_sequence_builder( - const DynamicTypeBuilder* element_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - RTPS_DllAPI DynamicTypeBuilder* create_sequence_builder( - const DynamicType_ptr type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - RTPS_DllAPI DynamicTypeBuilder* create_array_builder( - const DynamicTypeBuilder* element_type, - const std::vector& bounds); - - RTPS_DllAPI DynamicTypeBuilder* create_array_builder( - const DynamicType_ptr type, - const std::vector& bounds); - - RTPS_DllAPI DynamicTypeBuilder* create_map_builder( - DynamicTypeBuilder* key_element_type, - DynamicTypeBuilder* element_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - RTPS_DllAPI DynamicTypeBuilder* create_map_builder( - DynamicType_ptr key_type, - DynamicType_ptr value_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - RTPS_DllAPI DynamicTypeBuilder* create_bitmask_builder( - uint32_t bound); - - RTPS_DllAPI DynamicTypeBuilder* create_bitset_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_alias_builder( - DynamicTypeBuilder* base_type, - const std::string& sName); - - RTPS_DllAPI DynamicTypeBuilder* create_alias_builder( - DynamicType_ptr base_type, - const std::string& sName); - - RTPS_DllAPI DynamicTypeBuilder* create_enum_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_struct_builder(); - - RTPS_DllAPI DynamicTypeBuilder* create_child_struct_builder( - DynamicTypeBuilder* parent_type); - - RTPS_DllAPI DynamicTypeBuilder* create_union_builder( - DynamicTypeBuilder* discriminator_type); - - RTPS_DllAPI DynamicTypeBuilder* create_union_builder( - DynamicType_ptr discriminator_type); - - RTPS_DllAPI DynamicType_ptr create_annotation_primitive( - const std::string& name); - - RTPS_DllAPI DynamicType_ptr create_type( - const TypeDescriptor* descriptor, - const std::string& name = ""); - - RTPS_DllAPI DynamicType_ptr create_type( - const DynamicTypeBuilder* other); - - RTPS_DllAPI DynamicType_ptr create_alias_type( - DynamicTypeBuilder* base_type, - const std::string& sName); - - RTPS_DllAPI DynamicType_ptr create_alias_type( - DynamicType_ptr base_type, - const std::string& sName); - - RTPS_DllAPI DynamicType_ptr create_int32_type(); - - RTPS_DllAPI DynamicType_ptr create_uint32_type(); - - RTPS_DllAPI DynamicType_ptr create_int16_type(); - - RTPS_DllAPI DynamicType_ptr create_uint16_type(); - - RTPS_DllAPI DynamicType_ptr create_int64_type(); - - RTPS_DllAPI DynamicType_ptr create_uint64_type(); - - RTPS_DllAPI DynamicType_ptr create_float32_type(); - - RTPS_DllAPI DynamicType_ptr create_float64_type(); - - RTPS_DllAPI DynamicType_ptr create_float128_type(); - - RTPS_DllAPI DynamicType_ptr create_char8_type(); - - RTPS_DllAPI DynamicType_ptr create_char16_type(); - - RTPS_DllAPI DynamicType_ptr create_bool_type(); - - RTPS_DllAPI DynamicType_ptr create_byte_type(); - - RTPS_DllAPI DynamicType_ptr create_string_type( - uint32_t bound = MAX_STRING_LENGTH); - - RTPS_DllAPI DynamicType_ptr create_wstring_type( - uint32_t bound = MAX_STRING_LENGTH); - - RTPS_DllAPI DynamicType_ptr create_bitset_type( - uint32_t bound); - - RTPS_DllAPI void build_type_identifier( - const DynamicType_ptr type, - TypeIdentifier& identifier, - bool complete = true) const; - - RTPS_DllAPI void build_type_identifier( - const TypeDescriptor* descriptor, - TypeIdentifier& identifier, - bool complete = true) const; - - RTPS_DllAPI void build_type_object( - const DynamicType_ptr type, - TypeObject& object, - bool complete = true, - bool force = false) const; - - RTPS_DllAPI void build_type_object( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector* members = nullptr, - bool complete = true, - bool force = false) const; - - RTPS_DllAPI bool is_empty() const; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H diff --git a/include/fastrtps/types/DynamicTypeBuilderPtr.h b/include/fastrtps/types/DynamicTypeBuilderPtr.h deleted file mode 100644 index f3bb41e3fdb..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderPtr.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_PTR_H -#define TYPES_DYNAMIC_TYPE_BUILDER_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicTypeBuilder; - -class DynamicTypeBuilder_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator ->; - using Base::operator *; - using Base::operator bool; - - RTPS_DllAPI DynamicTypeBuilder_ptr() - { - } - - RTPS_DllAPI DynamicTypeBuilder_ptr( - DynamicTypeBuilder* pType); - - RTPS_DllAPI DynamicTypeBuilder_ptr( - DynamicTypeBuilder_ptr&& other) = default; - - RTPS_DllAPI DynamicTypeBuilder_ptr& operator =( - DynamicTypeBuilder_ptr&&) = default; - - RTPS_DllAPI bool operator !=( - std::nullptr_t) const - { - return bool(*this); - } - - RTPS_DllAPI bool operator ==( - std::nullptr_t) const - { - return !*this; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_PTR_H diff --git a/include/fastrtps/types/DynamicTypeMember.h b/include/fastrtps/types/DynamicTypeMember.h deleted file mode 100644 index 5cef28d9c32..00000000000 --- a/include/fastrtps/types/DynamicTypeMember.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_MEMBER_H -#define TYPES_DYNAMIC_TYPE_MEMBER_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class DynamicType; - -class DynamicTypeMember -{ -protected: - - DynamicType* parent_; - MemberDescriptor descriptor_; - MemberId id_; - - uint32_t get_index() const; - - void set_index( - uint32_t index); - - void set_parent( - DynamicType* pType); - - friend class DynamicTypeBuilder; - friend class DynamicType; - friend class DynamicData; - -public: - - RTPS_DllAPI DynamicTypeMember(); - - RTPS_DllAPI DynamicTypeMember( - const DynamicTypeMember* other); - - RTPS_DllAPI DynamicTypeMember( - const MemberDescriptor* descriptor, - MemberId id); - - ~DynamicTypeMember(); - - RTPS_DllAPI ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - RTPS_DllAPI ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - RTPS_DllAPI bool equals( - const DynamicTypeMember*) const; - - RTPS_DllAPI ReturnCode_t get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx); - - RTPS_DllAPI uint32_t get_annotation_count(); - - RTPS_DllAPI bool key_annotation() const; - - RTPS_DllAPI std::vector get_union_labels() const; - - RTPS_DllAPI ReturnCode_t get_descriptor( - MemberDescriptor* descriptor) const; - - RTPS_DllAPI MemberId get_id() const; - - RTPS_DllAPI std::string get_name() const; - - RTPS_DllAPI bool is_default_union_value() const; - - RTPS_DllAPI const MemberDescriptor* get_descriptor() const - { - return &descriptor_; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_MEMBER_H diff --git a/include/fastrtps/types/DynamicTypePtr.h b/include/fastrtps/types/DynamicTypePtr.h deleted file mode 100644 index b37119ccff8..00000000000 --- a/include/fastrtps/types/DynamicTypePtr.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_DYNAMIC_TYPE_PTR_H -#define TYPES_DYNAMIC_TYPE_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; - -class DynamicType_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator ->; - using Base::operator *; - using Base::operator bool; - - DynamicType_ptr() - { - } - - RTPS_DllAPI explicit DynamicType_ptr( - DynamicType* pType); - - RTPS_DllAPI DynamicType_ptr( - const DynamicType_ptr& other) = default; - - RTPS_DllAPI DynamicType_ptr( - DynamicType_ptr&& other) = default; - - RTPS_DllAPI DynamicType_ptr& operator =( - const DynamicType_ptr&) = default; - - RTPS_DllAPI DynamicType_ptr& operator =( - DynamicType_ptr&&) = default; - - RTPS_DllAPI DynamicType_ptr& operator =( - DynamicType*); - - RTPS_DllAPI bool operator !=( - std::nullptr_t) const - { - return bool(*this); - } - - RTPS_DllAPI bool operator ==( - std::nullptr_t) const - { - return !*this; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_PTR_H diff --git a/include/fastrtps/types/MemberDescriptor.h b/include/fastrtps/types/MemberDescriptor.h deleted file mode 100644 index 5a52948a4c7..00000000000 --- a/include/fastrtps/types/MemberDescriptor.h +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_MEMBER_DESCRIPTOR_H -#define TYPES_MEMBER_DESCRIPTOR_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; -class AnnotationDescriptor; - -class MemberDescriptor -{ -protected: - - std::string name_; // Name of the member - MemberId id_; // MemberId, it should be filled automatically when the member is added. - DynamicType_ptr type_; // Member's Type. - std::string default_value_; // Default value of the member in string. - uint32_t index_; // Definition order of the member inside it's parent. - std::vector labels_; // Case Labels for unions. - bool default_label_; // TRUE if it's the default option of a union. - - std::vector annotation_; // Annotations to apply - - friend class DynamicTypeBuilderFactory; - friend class DynamicData; - friend class DynamicTypeMember; - friend class TypeObjectFactory; - - bool is_default_value_consistent( - const std::string& sDefaultValue) const; - - bool is_type_name_consistent( - const std::string& sName) const; - - void copy_annotations_from_type( - const DynamicType_ptr& type); - -public: - - RTPS_DllAPI MemberDescriptor(); - - RTPS_DllAPI MemberDescriptor( - uint32_t index, - const std::string& name); - - RTPS_DllAPI MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type); - - RTPS_DllAPI MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue); - - RTPS_DllAPI MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - RTPS_DllAPI MemberDescriptor( - const MemberDescriptor* descriptor); - - RTPS_DllAPI ~MemberDescriptor(); - - bool check_union_labels( - const std::vector& labels) const; - - RTPS_DllAPI ReturnCode_t copy_from( - const MemberDescriptor* other); - - RTPS_DllAPI bool equals( - const MemberDescriptor* other) const; - - RTPS_DllAPI TypeKind get_kind() const; - - RTPS_DllAPI MemberId get_id() const; - - RTPS_DllAPI uint32_t get_index() const; - - RTPS_DllAPI std::string get_name() const; - - RTPS_DllAPI std::vector get_union_labels() const; - - RTPS_DllAPI std::string get_default_value() const - { - if (!default_value_.empty()) - { - return default_value_; - } - // Try annotation - return annotation_get_default(); - } - - RTPS_DllAPI bool is_default_union_value() const; - - RTPS_DllAPI bool is_consistent( - TypeKind parentKind) const; - - RTPS_DllAPI void add_union_case_index( - uint64_t value); - - RTPS_DllAPI void set_id( - MemberId id); - - RTPS_DllAPI void set_index( - uint32_t index); - - RTPS_DllAPI void set_name( - const std::string& name); - - RTPS_DllAPI void set_type( - DynamicType_ptr type); - - RTPS_DllAPI DynamicType_ptr get_type() const - { - return type_; - } - - RTPS_DllAPI void set_default_union_value( - bool bDefault); - - RTPS_DllAPI void set_default_value( - const std::string& value) - { - default_value_ = value; - } - - // Annotations - ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - AnnotationDescriptor* get_annotation( - const std::string& name) const; - - // Annotations application - RTPS_DllAPI bool annotation_is_optional() const; - - RTPS_DllAPI bool annotation_is_key() const; - - RTPS_DllAPI bool annotation_is_must_understand() const; - - RTPS_DllAPI bool annotation_is_non_serialized() const; - - RTPS_DllAPI bool annotation_is_value() const; - - RTPS_DllAPI bool annotation_is_default_literal() const; - - RTPS_DllAPI bool annotation_is_position() const; - - RTPS_DllAPI bool annotation_is_bit_bound() const; - - // Annotations getters - RTPS_DllAPI bool annotation_get_key() const; - - RTPS_DllAPI std::string annotation_get_value() const; - - RTPS_DllAPI std::string annotation_get_default() const; - - RTPS_DllAPI uint16_t annotation_get_position() const; - - RTPS_DllAPI uint16_t annotation_get_bit_bound() const; - - // Annotations setters - RTPS_DllAPI void annotation_set_optional( - bool optional); - - RTPS_DllAPI void annotation_set_key( - bool key); - - RTPS_DllAPI void annotation_set_must_understand( - bool must_understand); - - RTPS_DllAPI void annotation_set_non_serialized( - bool non_serialized); - - RTPS_DllAPI void annotation_set_value( - const std::string& value); - - RTPS_DllAPI void annotation_set_default( - const std::string& default_value); - - RTPS_DllAPI void annotation_set_default_literal(); - - RTPS_DllAPI void annotation_set_position( - uint16_t position); - - RTPS_DllAPI void annotation_set_bit_bound( - uint16_t bit_bound); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_MEMBER_DESCRIPTOR_H diff --git a/include/fastrtps/types/TypeDescriptor.h b/include/fastrtps/types/TypeDescriptor.h deleted file mode 100644 index c6f5654d896..00000000000 --- a/include/fastrtps/types/TypeDescriptor.h +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_TYPE_DESCRIPTOR_H -#define TYPES_TYPE_DESCRIPTOR_H - -#include -#include -#include - -class MemberDescriptor; -class DynamicType; - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeDescriptor -{ -protected: - - TypeKind kind_; // Type Kind. - std::string name_; // Type Name. - DynamicType_ptr base_type_; // SuperType of an structure or base type of an alias type. - DynamicType_ptr discriminator_type_; // Discrimination type for a union. - std::vector bound_; // Length for strings, arrays, sequences, maps and bitmasks. - DynamicType_ptr element_type_; // Value Type for arrays, sequences, maps, bitmasks. - DynamicType_ptr key_element_type_; // Key Type for maps. - std::vector annotation_; // Annotations to apply - - RTPS_DllAPI void clean(); - - static bool is_type_name_consistent( - const std::string& sName); - - friend class DynamicTypeBuilderFactory; - friend class TypeObjectFactory; - friend class DynamicType; - friend class MemberDescriptor; - friend class DynamicDataHelper; - -public: - - RTPS_DllAPI TypeDescriptor(); - - RTPS_DllAPI TypeDescriptor( - const TypeDescriptor* other); - - RTPS_DllAPI TypeDescriptor( - const std::string& name, - TypeKind kind); - - RTPS_DllAPI ~TypeDescriptor(); - - RTPS_DllAPI ReturnCode_t copy_from( - const TypeDescriptor* descriptor); - - RTPS_DllAPI bool equals( - const TypeDescriptor* descriptor) const; - - RTPS_DllAPI bool is_consistent() const; - - RTPS_DllAPI DynamicType_ptr get_base_type() const; - - RTPS_DllAPI uint32_t get_bounds( - uint32_t index = 0) const; - - RTPS_DllAPI uint32_t get_bounds_size() const; - - RTPS_DllAPI DynamicType_ptr get_discriminator_type() const; - - RTPS_DllAPI DynamicType_ptr get_element_type() const; - - RTPS_DllAPI DynamicType_ptr get_key_element_type() const; - - RTPS_DllAPI TypeKind get_kind() const; - - RTPS_DllAPI std::string get_name() const; - - RTPS_DllAPI uint32_t get_total_bounds() const; - - RTPS_DllAPI void set_kind( - TypeKind kind); - - RTPS_DllAPI void set_name( - std::string name); - - RTPS_DllAPI ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - RTPS_DllAPI ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - RTPS_DllAPI AnnotationDescriptor* get_annotation( - const std::string& name) const; - - // Annotations application - RTPS_DllAPI bool annotation_is_extensibility() const; - - RTPS_DllAPI bool annotation_is_mutable() const; - - RTPS_DllAPI bool annotation_is_final() const; - - RTPS_DllAPI bool annotation_is_appendable() const; - - RTPS_DllAPI bool annotation_is_nested() const; - - RTPS_DllAPI bool annotation_is_bit_bound() const; - - RTPS_DllAPI bool annotation_is_key() const; - - RTPS_DllAPI bool annotation_is_non_serialized() const; - - // Annotation getters - RTPS_DllAPI std::string annotation_get_extensibility() const; - - RTPS_DllAPI bool annotation_get_nested() const; - - RTPS_DllAPI uint16_t annotation_get_bit_bound() const; - - RTPS_DllAPI bool annotation_get_key() const; - - // Annotation setters - RTPS_DllAPI void annotation_set_extensibility( - const std::string& extensibility); - - RTPS_DllAPI void annotation_set_mutable(); - - RTPS_DllAPI void annotation_set_final(); - - RTPS_DllAPI void annotation_set_appendable(); - - RTPS_DllAPI void annotation_set_nested( - bool nested); - - RTPS_DllAPI void annotation_set_bit_bound( - uint16_t bit_bound); - - RTPS_DllAPI void annotation_set_key( - bool key); - - RTPS_DllAPI void annotation_set_non_serialized( - bool non_serialized); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_TYPE_DESCRIPTOR_H diff --git a/include/fastrtps/types/TypeIdentifier.h b/include/fastrtps/types/TypeIdentifier.h deleted file mode 100644 index b49cf48d396..00000000000 --- a/include/fastrtps/types/TypeIdentifier.h +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeIdentifier.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _TYPEIDENTIFIER_H_ -#define _TYPEIDENTIFIER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // namespace fastcdr - -namespace fastdds { -namespace dds { -class TypeConsistencyEnforcementQosPolicy; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - -typedef octet TypeIdentiferKind; -const octet TI_STRING8_SMALL = 0x70; -const octet TI_STRING8_LARGE = 0x71; -const octet TI_STRING16_SMALL = 0x72; -const octet TI_STRING16_LARGE = 0x73; -const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; -const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; -const octet TI_PLAIN_ARRAY_SMALL = 0x90; -const octet TI_PLAIN_ARRAY_LARGE = 0x91; -const octet TI_PLAIN_MAP_SMALL = 0xA0; -const octet TI_PLAIN_MAP_LARGE = 0xA1; -const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; - -// The TypeIdentifier uniquely identifies a type (a set of equivalent -// types according to an equivalence relationship: COMPLETE, MNIMAL). -// -// In some cases (primitive types, strings, plain types) the identifier -// is a explicit description of the type. -// In other cases the Identifier is a Hash of the type description -// -// In the case of primitive types and strings the implied equivalence -// relation is the identity. -// -// For Plain Types and Hash-defined TypeIdentifiers there are three -// possibilities: MINIMAL, COMPLETE, and COMMON: -// - MINIMAL indicates the TypeIdentifier identifies equivalent types -// according to the MINIMAL equivalence relation -// - COMPLETE indicates the TypeIdentifier identifies equivalent types -// according to the COMPLETE equivalence relation -// - COMMON indicates the TypeIdentifier identifies equivalent types -// according to both the MINIMAL and the COMMON equivalence relation. -// This means the TypeIdentifier is the same for both relationships -// -class TypeIdentifier -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI TypeIdentifier(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~TypeIdentifier(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - RTPS_DllAPI TypeIdentifier( - const TypeIdentifier& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - RTPS_DllAPI TypeIdentifier( - TypeIdentifier&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - RTPS_DllAPI TypeIdentifier& operator =( - const TypeIdentifier& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - RTPS_DllAPI TypeIdentifier& operator =( - TypeIdentifier&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - RTPS_DllAPI void _d( - octet __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - RTPS_DllAPI octet _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - RTPS_DllAPI octet& _d(); - - /*! - * @brief This function sets a value in member string_sdefn - * @param _string_sdefn New value for member string_sdefn - */ - RTPS_DllAPI void string_sdefn( - StringSTypeDefn _string_sdefn); - - /*! - * @brief This function returns the value of member string_sdefn - * @return Value of member string_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const StringSTypeDefn& string_sdefn() const; - - /*! - * @brief This function returns a reference to member string_sdefn - * @return Reference to member string_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI StringSTypeDefn& string_sdefn(); - /*! - * @brief This function sets a value in member string_ldefn - * @param _string_ldefn New value for member string_ldefn - */ - RTPS_DllAPI void string_ldefn( - StringLTypeDefn _string_ldefn); - - /*! - * @brief This function returns the value of member string_ldefn - * @return Value of member string_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const StringLTypeDefn& string_ldefn() const; - - /*! - * @brief This function returns a reference to member string_ldefn - * @return Reference to member string_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI StringLTypeDefn& string_ldefn(); - /*! - * @brief This function sets a value in member seq_sdefn - * @param _seq_sdefn New value for member seq_sdefn - */ - RTPS_DllAPI void seq_sdefn( - PlainSequenceSElemDefn _seq_sdefn); - - /*! - * @brief This function returns the value of member seq_sdefn - * @return Value of member seq_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainSequenceSElemDefn& seq_sdefn() const; - - /*! - * @brief This function returns a reference to member seq_sdefn - * @return Reference to member seq_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainSequenceSElemDefn& seq_sdefn(); - /*! - * @brief This function sets a value in member seq_ldefn - * @param _seq_ldefn New value for member seq_ldefn - */ - RTPS_DllAPI void seq_ldefn( - PlainSequenceLElemDefn _seq_ldefn); - - /*! - * @brief This function returns the value of member seq_ldefn - * @return Value of member seq_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainSequenceLElemDefn& seq_ldefn() const; - - /*! - * @brief This function returns a reference to member seq_ldefn - * @return Reference to member seq_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainSequenceLElemDefn& seq_ldefn(); - /*! - * @brief This function sets a value in member array_sdefn - * @param _array_sdefn New value for member array_sdefn - */ - RTPS_DllAPI void array_sdefn( - PlainArraySElemDefn _array_sdefn); - - /*! - * @brief This function returns the value of member array_sdefn - * @return Value of member array_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainArraySElemDefn& array_sdefn() const; - - /*! - * @brief This function returns a reference to member array_sdefn - * @return Reference to member array_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainArraySElemDefn& array_sdefn(); - /*! - * @brief This function sets a value in member array_ldefn - * @param _array_ldefn New value for member array_ldefn - */ - RTPS_DllAPI void array_ldefn( - PlainArrayLElemDefn _array_ldefn); - - /*! - * @brief This function returns the value of member array_ldefn - * @return Value of member array_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainArrayLElemDefn& array_ldefn() const; - - /*! - * @brief This function returns a reference to member array_ldefn - * @return Reference to member array_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainArrayLElemDefn& array_ldefn(); - /*! - * @brief This function sets a value in member map_sdefn - * @param _map_sdefn New value for member map_sdefn - */ - RTPS_DllAPI void map_sdefn( - PlainMapSTypeDefn _map_sdefn); - - /*! - * @brief This function returns the value of member map_sdefn - * @return Value of member map_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainMapSTypeDefn& map_sdefn() const; - - /*! - * @brief This function returns a reference to member map_sdefn - * @return Reference to member map_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainMapSTypeDefn& map_sdefn(); - /*! - * @brief This function sets a value in member map_ldefn - * @param _map_ldefn New value for member map_ldefn - */ - RTPS_DllAPI void map_ldefn( - PlainMapLTypeDefn _map_ldefn); - - /*! - * @brief This function returns the value of member map_ldefn - * @return Value of member map_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const PlainMapLTypeDefn& map_ldefn() const; - - /*! - * @brief This function returns a reference to member map_ldefn - * @return Reference to member map_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI PlainMapLTypeDefn& map_ldefn(); - /*! - * @brief This function sets a value in member sc_component_id - * @param _sc_component_id New value for member sc_component_id - */ - RTPS_DllAPI void sc_component_id( - StronglyConnectedComponentId _sc_component_id); - - /*! - * @brief This function returns the value of member sc_component_id - * @return Value of member sc_component_id - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI StronglyConnectedComponentId sc_component_id() const; - - /*! - * @brief This function returns a reference to member sc_component_id - * @return Reference to member sc_component_id - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI StronglyConnectedComponentId& sc_component_id(); - /*! - * @brief This function sets a value in member equivalence_hash - * @param _equivalence_hash New value for member equivalence_hash - */ - RTPS_DllAPI void equivalence_hash( - EquivalenceHash _equivalence_hash); - - /*! - * @brief This function returns the value of member equivalence_hash - * @return Value of member equivalence_hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const octet* equivalence_hash() const; - - /*! - * @brief This function returns a reference to member equivalence_hash - * @return Reference to member equivalence_hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI octet* equivalence_hash(); - /*! - * @brief This function sets a value in member extended_defn - * @param _extended_defn New value for member extended_defn - */ - RTPS_DllAPI void extended_defn( - ExtendedTypeDefn _extended_defn); - - /*! - * @brief This function returns the value of member extended_defn - * @return Value of member extended_defn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const ExtendedTypeDefn& extended_defn() const; - - /*! - * @brief This function returns a reference to member extended_defn - * @return Reference to member extended_defn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI ExtendedTypeDefn& extended_defn(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeIdentifier& data, - size_t current_alignment = 0); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - /** - * Equals - * */ - bool operator ==( - const TypeIdentifier& other) const; - - RTPS_DllAPI bool consistent( - const TypeIdentifier& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - /** - * @brief equivalence_hash_to_string - * @return string representation of the equivalence hash - */ - RTPS_DllAPI std::string equivalence_hash_to_string() const; - -private: - - octet m__d; - - StringSTypeDefn m_string_sdefn; - StringLTypeDefn m_string_ldefn; - PlainSequenceSElemDefn m_seq_sdefn; - PlainSequenceLElemDefn m_seq_ldefn; - PlainArraySElemDefn m_array_sdefn; - PlainArrayLElemDefn m_array_ldefn; - PlainMapSTypeDefn m_map_sdefn; - PlainMapLTypeDefn m_map_ldefn; - StronglyConnectedComponentId m_sc_component_id; - EquivalenceHash m_equivalence_hash; - ExtendedTypeDefn m_extended_defn; -}; - -typedef std::vector TypeIdentifierSeq; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEIDENTIFIER_H_ diff --git a/include/fastrtps/types/TypeIdentifierTypes.h b/include/fastrtps/types/TypeIdentifierTypes.h deleted file mode 100644 index 553c6eab8c8..00000000000 --- a/include/fastrtps/types/TypeIdentifierTypes.h +++ /dev/null @@ -1,1920 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeIdentifierTypes.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _TYPEIDENTIFIERTYPES_H_ -#define _TYPEIDENTIFIERTYPES_H_ - -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace eprosima { - -namespace fastdds { -namespace dds { -class TypeConsistencyEnforcementQosPolicy; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - - -// Forward declaration -class TypeIdentifier; -class StringLTypeDefn; - -/*! - * @brief This class represents the structure StringSTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StringSTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI StringSTypeDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~StringSTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - RTPS_DllAPI StringSTypeDefn( - const StringSTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - RTPS_DllAPI StringSTypeDefn( - StringSTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - RTPS_DllAPI StringSTypeDefn& operator =( - const StringSTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - RTPS_DllAPI StringSTypeDefn& operator =( - StringSTypeDefn&& x); - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline SBound& bound() - { - return m_bound; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const StringSTypeDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const StringSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - RTPS_DllAPI bool consistent( - const StringLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - SBound m_bound; -}; -/*! - * @brief This class represents the structure StringLTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StringLTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI StringLTypeDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~StringLTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - RTPS_DllAPI StringLTypeDefn( - const StringLTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - RTPS_DllAPI StringLTypeDefn( - StringLTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - RTPS_DllAPI StringLTypeDefn& operator =( - const StringLTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - RTPS_DllAPI StringLTypeDefn& operator =( - StringLTypeDefn&& x); - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline LBound& bound() - { - return m_bound; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const StringLTypeDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const StringLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - RTPS_DllAPI bool consistent( - const StringSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBound m_bound; -}; -/*! - * @brief This class represents the structure PlainCollectionHeader defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainCollectionHeader final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainCollectionHeader(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainCollectionHeader(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - RTPS_DllAPI PlainCollectionHeader( - const PlainCollectionHeader& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - RTPS_DllAPI PlainCollectionHeader( - PlainCollectionHeader&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - RTPS_DllAPI PlainCollectionHeader& operator =( - const PlainCollectionHeader& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - RTPS_DllAPI PlainCollectionHeader& operator =( - PlainCollectionHeader&& x); - - /*! - * @brief This function sets a value in member equiv_kind - * @param _equiv_kind New value for member equiv_kind - */ - RTPS_DllAPI inline void equiv_kind( - EquivalenceKind _equiv_kind) - { - m_equiv_kind = _equiv_kind; - } - - /*! - * @brief This function returns the value of member equiv_kind - * @return Value of member equiv_kind - */ - RTPS_DllAPI inline EquivalenceKind equiv_kind() const - { - return m_equiv_kind; - } - - /*! - * @brief This function returns a reference to member equiv_kind - * @return Reference to member equiv_kind - */ - RTPS_DllAPI inline EquivalenceKind& equiv_kind() - { - return m_equiv_kind; - } - - /*! - * @brief This function sets a value in member element_flags - * @param _element_flags New value for member element_flags - */ - RTPS_DllAPI inline void element_flags( - CollectionElementFlag _element_flags) - { - m_element_flags = _element_flags; - } - - /*! - * @brief This function returns the value of member element_flags - * @return Value of member element_flags - */ - RTPS_DllAPI inline CollectionElementFlag element_flags() const - { - return m_element_flags; - } - - /*! - * @brief This function returns a reference to member element_flags - * @return Reference to member element_flags - */ - RTPS_DllAPI inline CollectionElementFlag& element_flags() - { - return m_element_flags; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainCollectionHeader& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EquivalenceKind m_equiv_kind; - CollectionElementFlag m_element_flags; -}; -/*! - * @brief This class represents the structure PlainSequenceSElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainSequenceSElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainSequenceSElemDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainSequenceSElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceSElemDefn( - const PlainSequenceSElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceSElemDefn( - PlainSequenceSElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceSElemDefn& operator =( - const PlainSequenceSElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceSElemDefn& operator =( - PlainSequenceSElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline SBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainSequenceSElemDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainSequenceSElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBound m_bound; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainSequenceLElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainSequenceLElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainSequenceLElemDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainSequenceLElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceLElemDefn( - const PlainSequenceLElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceLElemDefn( - PlainSequenceLElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceLElemDefn& operator =( - const PlainSequenceLElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - RTPS_DllAPI PlainSequenceLElemDefn& operator =( - PlainSequenceLElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline LBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainSequenceLElemDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainSequenceLElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBound m_bound; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainArraySElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainArraySElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainArraySElemDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainArraySElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - RTPS_DllAPI PlainArraySElemDefn( - const PlainArraySElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - RTPS_DllAPI PlainArraySElemDefn( - PlainArraySElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - RTPS_DllAPI PlainArraySElemDefn& operator =( - const PlainArraySElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - RTPS_DllAPI PlainArraySElemDefn& operator =( - PlainArraySElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function copies the value in member array_bound_seq - * @param _array_bound_seq New value to be copied in member array_bound_seq - */ - RTPS_DllAPI inline void array_bound_seq( - const SBoundSeq& _array_bound_seq) - { - m_array_bound_seq = _array_bound_seq; - } - - /*! - * @brief This function moves the value in member array_bound_seq - * @param _array_bound_seq New value to be moved in member array_bound_seq - */ - RTPS_DllAPI inline void array_bound_seq( - SBoundSeq&& _array_bound_seq) - { - m_array_bound_seq = std::move(_array_bound_seq); - } - - /*! - * @brief This function returns a constant reference to member array_bound_seq - * @return Constant reference to member array_bound_seq - */ - RTPS_DllAPI inline const SBoundSeq& array_bound_seq() const - { - return m_array_bound_seq; - } - - /*! - * @brief This function returns a reference to member array_bound_seq - * @return Reference to member array_bound_seq - */ - RTPS_DllAPI inline SBoundSeq& array_bound_seq() - { - return m_array_bound_seq; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainArraySElemDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainArraySElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBoundSeq m_array_bound_seq; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainArrayLElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainArrayLElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainArrayLElemDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainArrayLElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - RTPS_DllAPI PlainArrayLElemDefn( - const PlainArrayLElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - RTPS_DllAPI PlainArrayLElemDefn( - PlainArrayLElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - RTPS_DllAPI PlainArrayLElemDefn& operator =( - const PlainArrayLElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - RTPS_DllAPI PlainArrayLElemDefn& operator =( - PlainArrayLElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function copies the value in member array_bound_seq - * @param _array_bound_seq New value to be copied in member array_bound_seq - */ - RTPS_DllAPI inline void array_bound_seq( - const LBoundSeq& _array_bound_seq) - { - m_array_bound_seq = _array_bound_seq; - } - - /*! - * @brief This function moves the value in member array_bound_seq - * @param _array_bound_seq New value to be moved in member array_bound_seq - */ - RTPS_DllAPI inline void array_bound_seq( - LBoundSeq&& _array_bound_seq) - { - m_array_bound_seq = std::move(_array_bound_seq); - } - - /*! - * @brief This function returns a constant reference to member array_bound_seq - * @return Constant reference to member array_bound_seq - */ - RTPS_DllAPI inline const LBoundSeq& array_bound_seq() const - { - return m_array_bound_seq; - } - - /*! - * @brief This function returns a reference to member array_bound_seq - * @return Reference to member array_bound_seq - */ - RTPS_DllAPI inline LBoundSeq& array_bound_seq() - { - return m_array_bound_seq; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainArrayLElemDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainArrayLElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBoundSeq m_array_bound_seq; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainMapSTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainMapSTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainMapSTypeDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainMapSTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapSTypeDefn( - const PlainMapSTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapSTypeDefn( - PlainMapSTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapSTypeDefn& operator =( - const PlainMapSTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapSTypeDefn& operator =( - PlainMapSTypeDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline SBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - /*! - * @brief This function sets a value in member key_flags - * @param _key_flags New value for member key_flags - */ - RTPS_DllAPI inline void key_flags( - CollectionElementFlag _key_flags) - { - m_key_flags = _key_flags; - } - - /*! - * @brief This function returns the value of member key_flags - * @return Value of member key_flags - */ - RTPS_DllAPI inline CollectionElementFlag key_flags() const - { - return m_key_flags; - } - - /*! - * @brief This function returns a reference to member key_flags - * @return Reference to member key_flags - */ - RTPS_DllAPI inline CollectionElementFlag& key_flags() - { - return m_key_flags; - } - - /*! - * @brief This function sets a value in member key_identifier - * @param _key_identifier New value for member key_identifier - */ - RTPS_DllAPI void key_identifier( - const TypeIdentifier* _key_identifier); - - /*! - * @brief This function returns the value of member key_identifier - * @return Value of member key_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* key_identifier() const - { - return m_key_identifier; - } - - /*! - * @brief This function returns a reference to member key_identifier - * @return Reference to member key_identifier - */ - RTPS_DllAPI inline TypeIdentifier* key_identifier() - { - return m_key_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainMapSTypeDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainMapSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBound m_bound; - TypeIdentifier* m_element_identifier; - CollectionElementFlag m_key_flags; - TypeIdentifier* m_key_identifier; -}; -/*! - * @brief This class represents the structure PlainMapLTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainMapLTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI PlainMapLTypeDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~PlainMapLTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapLTypeDefn( - const PlainMapLTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapLTypeDefn( - PlainMapLTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapLTypeDefn& operator =( - const PlainMapLTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - RTPS_DllAPI PlainMapLTypeDefn& operator =( - PlainMapLTypeDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - RTPS_DllAPI inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - RTPS_DllAPI inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - RTPS_DllAPI inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - RTPS_DllAPI inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - RTPS_DllAPI inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - RTPS_DllAPI inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - RTPS_DllAPI inline LBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - RTPS_DllAPI void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - RTPS_DllAPI inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - /*! - * @brief This function sets a value in member key_flags - * @param _key_flags New value for member key_flags - */ - RTPS_DllAPI inline void key_flags( - CollectionElementFlag _key_flags) - { - m_key_flags = _key_flags; - } - - /*! - * @brief This function returns the value of member key_flags - * @return Value of member key_flags - */ - RTPS_DllAPI inline CollectionElementFlag key_flags() const - { - return m_key_flags; - } - - /*! - * @brief This function returns a reference to member key_flags - * @return Reference to member key_flags - */ - RTPS_DllAPI inline CollectionElementFlag& key_flags() - { - return m_key_flags; - } - - /*! - * @brief This function sets a value in member key_identifier - * @param _key_identifier New value for member key_identifier - */ - RTPS_DllAPI void key_identifier( - const TypeIdentifier* _key_identifier); - - /*! - * @brief This function returns the value of member key_identifier - * @return Value of member key_identifier - */ - RTPS_DllAPI inline const TypeIdentifier* key_identifier() const - { - return m_key_identifier; - } - - /*! - * @brief This function returns a reference to member key_identifier - * @return Reference to member key_identifier - */ - RTPS_DllAPI inline TypeIdentifier* key_identifier() - { - return m_key_identifier; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const PlainMapLTypeDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const PlainMapLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBound m_bound; - TypeIdentifier* m_element_identifier; - CollectionElementFlag m_key_flags; - TypeIdentifier* m_key_identifier; -}; -/*! - * @brief This class represents the structure StronglyConnectedComponentId defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StronglyConnectedComponentId final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI StronglyConnectedComponentId(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~StronglyConnectedComponentId(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - RTPS_DllAPI StronglyConnectedComponentId( - const StronglyConnectedComponentId& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - RTPS_DllAPI StronglyConnectedComponentId( - StronglyConnectedComponentId&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - RTPS_DllAPI StronglyConnectedComponentId& operator =( - const StronglyConnectedComponentId& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - RTPS_DllAPI StronglyConnectedComponentId& operator =( - StronglyConnectedComponentId&& x); - - /*! - * @brief This function copies the value in member sc_component_id - * @param _sc_component_id New value to be copied in member sc_component_id - */ - RTPS_DllAPI inline void sc_component_id( - const TypeObjectHashId& _sc_component_id) - { - m_sc_component_id = _sc_component_id; - } - - /*! - * @brief This function moves the value in member sc_component_id - * @param _sc_component_id New value to be moved in member sc_component_id - */ - RTPS_DllAPI inline void sc_component_id( - TypeObjectHashId&& _sc_component_id) - { - m_sc_component_id = std::move(_sc_component_id); - } - - /*! - * @brief This function returns a constant reference to member sc_component_id - * @return Constant reference to member sc_component_id - */ - RTPS_DllAPI inline const TypeObjectHashId& sc_component_id() const - { - return m_sc_component_id; - } - - /*! - * @brief This function returns a reference to member sc_component_id - * @return Reference to member sc_component_id - */ - RTPS_DllAPI inline TypeObjectHashId& sc_component_id() - { - return m_sc_component_id; - } - - /*! - * @brief This function sets a value in member scc_length - * @param _scc_length New value for member scc_length - */ - RTPS_DllAPI inline void scc_length( - int32_t _scc_length) - { - m_scc_length = _scc_length; - } - - /*! - * @brief This function returns the value of member scc_length - * @return Value of member scc_length - */ - RTPS_DllAPI inline int32_t scc_length() const - { - return m_scc_length; - } - - /*! - * @brief This function returns a reference to member scc_length - * @return Reference to member scc_length - */ - RTPS_DllAPI inline int32_t& scc_length() - { - return m_scc_length; - } - - /*! - * @brief This function sets a value in member scc_index - * @param _scc_index New value for member scc_index - */ - RTPS_DllAPI inline void scc_index( - int32_t _scc_index) - { - m_scc_index = _scc_index; - } - - /*! - * @brief This function returns the value of member scc_index - * @return Value of member scc_index - */ - RTPS_DllAPI inline int32_t scc_index() const - { - return m_scc_index; - } - - /*! - * @brief This function returns a reference to member scc_index - * @return Reference to member scc_index - */ - RTPS_DllAPI inline int32_t& scc_index() - { - return m_scc_index; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const StronglyConnectedComponentId& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const StronglyConnectedComponentId& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeObjectHashId m_sc_component_id; - int32_t m_scc_length; - int32_t m_scc_index; -}; -/*! - * @brief This class represents the structure ExtendedTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class ExtendedTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI ExtendedTypeDefn(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI virtual ~ExtendedTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - RTPS_DllAPI ExtendedTypeDefn( - const ExtendedTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - RTPS_DllAPI ExtendedTypeDefn( - ExtendedTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - RTPS_DllAPI virtual ExtendedTypeDefn& operator =( - const ExtendedTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - RTPS_DllAPI virtual ExtendedTypeDefn& operator =( - ExtendedTypeDefn&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const ExtendedTypeDefn& data, - size_t current_alignment = 0); - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI virtual void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI virtual void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool consistent( - const ExtendedTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEIDENTIFIERTYPES_H_ diff --git a/include/fastrtps/types/TypeNamesGenerator.h b/include/fastrtps/types/TypeNamesGenerator.h deleted file mode 100644 index eeb3d195da9..00000000000 --- a/include/fastrtps/types/TypeNamesGenerator.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _TYPE_NAMES_GENERATOR_ -#define _TYPE_NAMES_GENERATOR_ - -#include - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeNamesGenerator -{ -public: - - RTPS_DllAPI static std::string get_string_type_name( - uint32_t bound, - bool wide, - bool generate_identifier = true); - - RTPS_DllAPI static std::string get_sequence_type_name( - const std::string& type_name, - uint32_t bound, - bool generate_identifier = true); - - RTPS_DllAPI static std::string get_array_type_name( - const std::string& type_name, - const std::vector& bound, - bool generate_identifier = true); - - RTPS_DllAPI static std::string get_array_type_name( - const std::string& type_name, - const std::vector& bound, - uint32_t& ret_size, - bool generate_identifier = true); - - RTPS_DllAPI static std::string get_map_type_name( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool generate_identifier = true); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif //_TYPE_NAMES_GENERATOR_ diff --git a/include/fastrtps/types/TypeObject.h b/include/fastrtps/types/TypeObject.h deleted file mode 100644 index a755ddac2dd..00000000000 --- a/include/fastrtps/types/TypeObject.h +++ /dev/null @@ -1,8075 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_TYPE_OBJECT_H -#define TYPES_TYPE_OBJECT_H - -#include -#include - -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -// The types in this file shall be serialized with XCDR encoding version 2 -namespace eprosima { -namespace fastrtps { - -namespace types { - -/*struct CommonStructMember final { - MemberId member_id; - StructMemberFlag member_flags; - TypeIdentifier member_type_id; - };*/ -class CommonStructMember -{ -public: - - RTPS_DllAPI CommonStructMember(); - RTPS_DllAPI ~CommonStructMember(); - RTPS_DllAPI CommonStructMember( - const CommonStructMember& x); - RTPS_DllAPI CommonStructMember( - CommonStructMember&& x); - RTPS_DllAPI CommonStructMember& operator =( - const CommonStructMember& x); - RTPS_DllAPI CommonStructMember& operator =( - CommonStructMember&& x); - - RTPS_DllAPI inline void member_id( - const MemberId& _member_id) - { - m_member_id = _member_id; - } - - RTPS_DllAPI inline void member_id( - MemberId&& _member_id) - { - m_member_id = std::move(_member_id); - } - - RTPS_DllAPI inline const MemberId& member_id() const - { - return m_member_id; - } - - RTPS_DllAPI inline MemberId& member_id() - { - return m_member_id; - } - - RTPS_DllAPI inline void member_flags( - const StructMemberFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - RTPS_DllAPI inline void member_flags( - StructMemberFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - RTPS_DllAPI inline const StructMemberFlag& member_flags() const - { - return m_member_flags; - } - - RTPS_DllAPI inline StructMemberFlag& member_flags() - { - return m_member_flags; - } - - RTPS_DllAPI inline void member_type_id( - const TypeIdentifier& _member_type_id) - { - m_member_type_id = _member_type_id; - } - - RTPS_DllAPI inline void member_type_id( - TypeIdentifier&& _member_type_id) - { - m_member_type_id = std::move(_member_type_id); - } - - RTPS_DllAPI inline const TypeIdentifier& member_type_id() const - { - return m_member_type_id; - } - - RTPS_DllAPI inline TypeIdentifier& member_type_id() - { - return m_member_type_id; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonStructMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonStructMember& other) const; - - RTPS_DllAPI bool consistent( - const CommonStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberId m_member_id; - StructMemberFlag m_member_flags; - TypeIdentifier m_member_type_id; -}; - -// COMPLETE Details for a member of an aggregate type -/*struct CompleteMemberDetail final{ - MemberName name; - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteMemberDetail -{ -public: - - RTPS_DllAPI CompleteMemberDetail(); - RTPS_DllAPI ~CompleteMemberDetail(); - RTPS_DllAPI CompleteMemberDetail( - const CompleteMemberDetail& x); - RTPS_DllAPI CompleteMemberDetail( - CompleteMemberDetail&& x); - RTPS_DllAPI CompleteMemberDetail& operator =( - const CompleteMemberDetail& x); - RTPS_DllAPI CompleteMemberDetail& operator =( - CompleteMemberDetail&& x); - - RTPS_DllAPI inline void name( - const MemberName& _name) - { - m_name = _name; - } - - RTPS_DllAPI inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - RTPS_DllAPI inline const MemberName& name() const - { - return m_name; - } - - RTPS_DllAPI inline MemberName& name() - { - return m_name; - } - - RTPS_DllAPI inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - RTPS_DllAPI inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - RTPS_DllAPI inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - RTPS_DllAPI inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - RTPS_DllAPI inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - RTPS_DllAPI inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - RTPS_DllAPI inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - RTPS_DllAPI inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteMemberDetail& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteMemberDetail& other) const; - - RTPS_DllAPI bool consistent( - const CompleteMemberDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberName m_name; - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -// MINIMAL Details for a member of an aggregate type -/*struct MinimalMemberDetail final{ - NameHash name_hash; - };*/ - -class MinimalMemberDetail final -{ -public: - - RTPS_DllAPI MinimalMemberDetail(); - RTPS_DllAPI ~MinimalMemberDetail(); - RTPS_DllAPI MinimalMemberDetail( - const MinimalMemberDetail& x); - RTPS_DllAPI MinimalMemberDetail( - MinimalMemberDetail&& x); - RTPS_DllAPI MinimalMemberDetail& operator =( - const MinimalMemberDetail& x); - RTPS_DllAPI MinimalMemberDetail& operator =( - MinimalMemberDetail&& x); - - RTPS_DllAPI inline void name_hash( - const NameHash& _name_hash) - { - m_name_hash = _name_hash; - } - - RTPS_DllAPI inline void name_hash( - NameHash&& _name_hash) - { - m_name_hash = std::move(_name_hash); - } - - RTPS_DllAPI inline const NameHash& name_hash() const - { - return m_name_hash; - } - - RTPS_DllAPI inline NameHash& name_hash() - { - return m_name_hash; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalMemberDetail& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalMemberDetail& other) const; - - RTPS_DllAPI bool consistent( - const MinimalMemberDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - NameHash m_name_hash; -}; - -// Member of an aggregate type -/*struct CompleteStructMember { - CommonStructMember common; - CompleteMemberDetail detail; - };*/ -class CompleteStructMember -{ -public: - - RTPS_DllAPI CompleteStructMember(); - RTPS_DllAPI ~CompleteStructMember(); - RTPS_DllAPI CompleteStructMember( - const CompleteStructMember& x); - RTPS_DllAPI CompleteStructMember( - CompleteStructMember&& x); - RTPS_DllAPI CompleteStructMember& operator =( - const CompleteStructMember& x); - RTPS_DllAPI CompleteStructMember& operator =( - CompleteStructMember&& x); - - RTPS_DllAPI inline void common( - const CommonStructMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonStructMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonStructMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonStructMember& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteStructMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteStructMember& other) const; - - RTPS_DllAPI bool consistent( - const CompleteStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonStructMember m_common; - CompleteMemberDetail m_detail; -}; - -// Ordered by the member_index -typedef std::vector CompleteStructMemberSeq; - -// Member of an aggregate type -/*struct MinimalStructMember { - CommonStructMember common; - MinimalMemberDetail detail; - };*/ -class MinimalStructMember -{ -public: - - RTPS_DllAPI MinimalStructMember(); - RTPS_DllAPI ~MinimalStructMember(); - RTPS_DllAPI MinimalStructMember( - const MinimalStructMember& x); - RTPS_DllAPI MinimalStructMember( - MinimalStructMember&& x); - RTPS_DllAPI MinimalStructMember& operator =( - const MinimalStructMember& x); - RTPS_DllAPI MinimalStructMember& operator =( - MinimalStructMember&& x); - - RTPS_DllAPI inline void common( - const CommonStructMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonStructMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonStructMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonStructMember& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalStructMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalStructMember& other) const; - - RTPS_DllAPI bool consistent( - const MinimalStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonStructMember m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by common.member_id -typedef std::vector MinimalStructMemberSeq; - -/*struct AppliedBuiltinTypeAnnotations { - AppliedVerbatimAnnotation verbatim; // verbatim(...) // optional - };*/ -class AppliedBuiltinTypeAnnotations -{ -public: - - RTPS_DllAPI AppliedBuiltinTypeAnnotations(); - RTPS_DllAPI ~AppliedBuiltinTypeAnnotations(); - RTPS_DllAPI AppliedBuiltinTypeAnnotations( - const AppliedBuiltinTypeAnnotations& x); - RTPS_DllAPI AppliedBuiltinTypeAnnotations( - AppliedBuiltinTypeAnnotations&& x); - RTPS_DllAPI AppliedBuiltinTypeAnnotations& operator =( - const AppliedBuiltinTypeAnnotations& x); - RTPS_DllAPI AppliedBuiltinTypeAnnotations& operator =( - AppliedBuiltinTypeAnnotations&& x); - - RTPS_DllAPI inline void verbatim( - const AppliedVerbatimAnnotation& _verbatim) - { - m_verbatim = _verbatim; - } - - RTPS_DllAPI inline void verbatim( - AppliedVerbatimAnnotation&& _verbatim) - { - m_verbatim = std::move(_verbatim); - } - - RTPS_DllAPI inline const AppliedVerbatimAnnotation& verbatim() const - { - return m_verbatim; - } - - RTPS_DllAPI inline AppliedVerbatimAnnotation& verbatim() - { - return m_verbatim; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const AppliedBuiltinTypeAnnotations& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const AppliedBuiltinTypeAnnotations& other) const; - - RTPS_DllAPI bool consistent( - const AppliedBuiltinTypeAnnotations& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedVerbatimAnnotation m_verbatim; -}; - -/*struct MinimalTypeDetail final{ - // Empty. Available for future extension - };*/ -class MinimalTypeDetail -{ -public: - - RTPS_DllAPI MinimalTypeDetail(); - RTPS_DllAPI ~MinimalTypeDetail(); - RTPS_DllAPI MinimalTypeDetail( - const MinimalTypeDetail& x); - RTPS_DllAPI MinimalTypeDetail( - MinimalTypeDetail&& x); - RTPS_DllAPI MinimalTypeDetail& operator =( - const MinimalTypeDetail& x); - RTPS_DllAPI MinimalTypeDetail& operator =( - MinimalTypeDetail&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalTypeDetail& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalTypeDetail&) const - { - return true; - } - - RTPS_DllAPI bool consistent( - const MinimalTypeDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteTypeDetail final{ - AppliedBuiltinTypeAnnotations ann_builtin; // optional - AppliedAnnotationSeq ann_custom; // optional - QualifiedTypeName type_name; - };*/ -class CompleteTypeDetail -{ -public: - - RTPS_DllAPI CompleteTypeDetail(); - RTPS_DllAPI ~CompleteTypeDetail(); - RTPS_DllAPI CompleteTypeDetail( - const CompleteTypeDetail& x); - RTPS_DllAPI CompleteTypeDetail( - CompleteTypeDetail&& x); - RTPS_DllAPI CompleteTypeDetail& operator =( - const CompleteTypeDetail& x); - RTPS_DllAPI CompleteTypeDetail& operator =( - CompleteTypeDetail&& x); - - RTPS_DllAPI inline void ann_builtin( - const AppliedBuiltinTypeAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - RTPS_DllAPI inline void ann_builtin( - AppliedBuiltinTypeAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - RTPS_DllAPI inline const AppliedBuiltinTypeAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - RTPS_DllAPI inline AppliedBuiltinTypeAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - RTPS_DllAPI inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - RTPS_DllAPI inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - RTPS_DllAPI inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - RTPS_DllAPI inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - RTPS_DllAPI inline void type_name( - const QualifiedTypeName& _type_name) - { - m_type_name = _type_name; - } - - RTPS_DllAPI inline void type_name( - QualifiedTypeName&& _type_name) - { - m_type_name = std::move(_type_name); - } - - RTPS_DllAPI inline const QualifiedTypeName& type_name() const - { - return m_type_name; - } - - RTPS_DllAPI inline QualifiedTypeName& type_name() - { - return m_type_name; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteTypeDetail& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteTypeDetail& other) const; - - RTPS_DllAPI bool consistent( - const CompleteTypeDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedBuiltinTypeAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; - QualifiedTypeName m_type_name; -}; -/*struct CompleteStructHeader { - TypeIdentifier base_type; - CompleteTypeDetail detail; - };*/ -class CompleteStructHeader -{ -public: - - RTPS_DllAPI CompleteStructHeader(); - RTPS_DllAPI ~CompleteStructHeader(); - RTPS_DllAPI CompleteStructHeader( - const CompleteStructHeader& x); - RTPS_DllAPI CompleteStructHeader( - CompleteStructHeader&& x); - RTPS_DllAPI CompleteStructHeader& operator =( - const CompleteStructHeader& x); - RTPS_DllAPI CompleteStructHeader& operator =( - CompleteStructHeader&& x); - - RTPS_DllAPI inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - RTPS_DllAPI inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - RTPS_DllAPI inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - RTPS_DllAPI inline TypeIdentifier& base_type() - { - return m_base_type; - } - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteStructHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteStructHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteStructHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - CompleteTypeDetail m_detail; -}; -/*struct MinimalStructHeader { - TypeIdentifier base_type; - MinimalTypeDetail detail; - };*/ -class MinimalStructHeader -{ -public: - - RTPS_DllAPI MinimalStructHeader(); - RTPS_DllAPI ~MinimalStructHeader(); - RTPS_DllAPI MinimalStructHeader( - const MinimalStructHeader& x); - RTPS_DllAPI MinimalStructHeader( - MinimalStructHeader&& x); - RTPS_DllAPI MinimalStructHeader& operator =( - const MinimalStructHeader& x); - RTPS_DllAPI MinimalStructHeader& operator =( - MinimalStructHeader&& x); - - RTPS_DllAPI inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - RTPS_DllAPI inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - RTPS_DllAPI inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - RTPS_DllAPI inline TypeIdentifier& base_type() - { - return m_base_type; - } - - RTPS_DllAPI inline void detail( - const MinimalTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalStructHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalStructHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalStructHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - MinimalTypeDetail m_detail; -}; - -/*struct CompleteStructType final{ - StructTypeFlag struct_flags; - CompleteStructHeader header; - CompleteStructMemberSeq member_seq; - };*/ -class CompleteStructType -{ -public: - - RTPS_DllAPI CompleteStructType(); - RTPS_DllAPI ~CompleteStructType(); - RTPS_DllAPI CompleteStructType( - const CompleteStructType& x); - RTPS_DllAPI CompleteStructType( - CompleteStructType&& x); - RTPS_DllAPI CompleteStructType& operator =( - const CompleteStructType& x); - RTPS_DllAPI CompleteStructType& operator =( - CompleteStructType&& x); - - RTPS_DllAPI inline void struct_flags( - const StructTypeFlag& _struct_flags) - { - m_struct_flags = _struct_flags; - } - - RTPS_DllAPI inline void struct_flags( - StructTypeFlag&& _struct_flags) - { - m_struct_flags = std::move(_struct_flags); - } - - RTPS_DllAPI inline const StructTypeFlag& struct_flags() const - { - return m_struct_flags; - } - - RTPS_DllAPI inline StructTypeFlag& struct_flags() - { - return m_struct_flags; - } - - RTPS_DllAPI inline void header( - const CompleteStructHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteStructHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteStructHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteStructHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void member_seq( - const CompleteStructMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - CompleteStructMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const CompleteStructMemberSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline CompleteStructMemberSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteStructType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteStructType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteStructType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - StructTypeFlag m_struct_flags; - CompleteStructHeader m_header; - CompleteStructMemberSeq m_member_seq; -}; - -/*struct MinimalStructType final{ - StructTypeFlag struct_flags; - MinimalStructHeader header; - MinimalStructMemberSeq member_seq; - };*/ -class MinimalStructType -{ -public: - - RTPS_DllAPI MinimalStructType(); - RTPS_DllAPI ~MinimalStructType(); - RTPS_DllAPI MinimalStructType( - const MinimalStructType& x); - RTPS_DllAPI MinimalStructType( - MinimalStructType&& x); - RTPS_DllAPI MinimalStructType& operator =( - const MinimalStructType& x); - RTPS_DllAPI MinimalStructType& operator =( - MinimalStructType&& x); - - RTPS_DllAPI inline void struct_flags( - const StructTypeFlag& _struct_flags) - { - m_struct_flags = _struct_flags; - } - - RTPS_DllAPI inline void struct_flags( - StructTypeFlag&& _struct_flags) - { - m_struct_flags = std::move(_struct_flags); - } - - RTPS_DllAPI inline const StructTypeFlag& struct_flags() const - { - return m_struct_flags; - } - - RTPS_DllAPI inline StructTypeFlag& struct_flags() - { - return m_struct_flags; - } - - RTPS_DllAPI inline void header( - const MinimalStructHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalStructHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalStructHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalStructHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void member_seq( - const MinimalStructMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - MinimalStructMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const MinimalStructMemberSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline MinimalStructMemberSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalStructType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalStructType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalStructType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - StructTypeFlag m_struct_flags; - MinimalStructHeader m_header; - MinimalStructMemberSeq m_member_seq; -}; - -// --- Union: --------------------------------------------------------- - -// Case labels that apply to a member of a union type -// Ordered by their values -typedef std::vector UnionCaseLabelSeq; - -/*struct CommonUnionMember final{ - MemberId member_id; - UnionMemberFlag member_flags; - TypeIdentifier type_id; - UnionCaseLabelSeq label_seq; - };*/ -class CommonUnionMember -{ -public: - - RTPS_DllAPI CommonUnionMember(); - RTPS_DllAPI ~CommonUnionMember(); - RTPS_DllAPI CommonUnionMember( - const CommonUnionMember& x); - RTPS_DllAPI CommonUnionMember( - CommonUnionMember&& x); - RTPS_DllAPI CommonUnionMember& operator =( - const CommonUnionMember& x); - RTPS_DllAPI CommonUnionMember& operator =( - CommonUnionMember&& x); - - RTPS_DllAPI inline void member_id( - const MemberId& _member_id) - { - m_member_id = _member_id; - } - - RTPS_DllAPI inline void member_id( - MemberId&& _member_id) - { - m_member_id = std::move(_member_id); - } - - RTPS_DllAPI inline const MemberId& member_id() const - { - return m_member_id; - } - - RTPS_DllAPI inline MemberId& member_id() - { - return m_member_id; - } - - RTPS_DllAPI inline void member_flags( - const UnionMemberFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - RTPS_DllAPI inline void member_flags( - UnionMemberFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - RTPS_DllAPI inline const UnionMemberFlag& member_flags() const - { - return m_member_flags; - } - - RTPS_DllAPI inline UnionMemberFlag& member_flags() - { - return m_member_flags; - } - - RTPS_DllAPI inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - RTPS_DllAPI inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - RTPS_DllAPI inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - RTPS_DllAPI inline TypeIdentifier& type_id() - { - return m_type_id; - } - - RTPS_DllAPI inline void label_seq( - const UnionCaseLabelSeq& _label_seq) - { - m_label_seq = _label_seq; - } - - RTPS_DllAPI inline void label_seq( - UnionCaseLabelSeq&& _label_seq) - { - m_label_seq = std::move(_label_seq); - } - - RTPS_DllAPI inline const UnionCaseLabelSeq& label_seq() const - { - return m_label_seq; - } - - RTPS_DllAPI inline UnionCaseLabelSeq& label_seq() - { - return m_label_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonUnionMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonUnionMember& other) const; - - RTPS_DllAPI bool consistent( - const CommonUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberId m_member_id; - UnionMemberFlag m_member_flags; - TypeIdentifier m_type_id; - UnionCaseLabelSeq m_label_seq; -}; - -// Member of a union type -/*struct CompleteUnionMember { - CommonUnionMember common; - CompleteMemberDetail detail; - };*/ -class CompleteUnionMember -{ -public: - - RTPS_DllAPI CompleteUnionMember(); - RTPS_DllAPI ~CompleteUnionMember(); - RTPS_DllAPI CompleteUnionMember( - const CompleteUnionMember& x); - RTPS_DllAPI CompleteUnionMember( - CompleteUnionMember&& x); - RTPS_DllAPI CompleteUnionMember& operator =( - const CompleteUnionMember& x); - RTPS_DllAPI CompleteUnionMember& operator =( - CompleteUnionMember&& x); - - RTPS_DllAPI inline void common( - const CommonUnionMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonUnionMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonUnionMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonUnionMember& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteUnionMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteUnionMember& other) const; - - RTPS_DllAPI bool consistent( - const CompleteUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonUnionMember m_common; - CompleteMemberDetail m_detail; -}; - -// Ordered by member_index -typedef std::vector CompleteUnionMemberSeq; - -// Member of a union type -/*struct MinimalUnionMember { - CommonUnionMember common; - MinimalMemberDetail detail; - };*/ -class MinimalUnionMember -{ -public: - - RTPS_DllAPI MinimalUnionMember(); - RTPS_DllAPI ~MinimalUnionMember(); - RTPS_DllAPI MinimalUnionMember( - const MinimalUnionMember& x); - RTPS_DllAPI MinimalUnionMember( - MinimalUnionMember&& x); - RTPS_DllAPI MinimalUnionMember& operator =( - const MinimalUnionMember& x); - RTPS_DllAPI MinimalUnionMember& operator =( - MinimalUnionMember&& x); - - RTPS_DllAPI inline void common( - const CommonUnionMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonUnionMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonUnionMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonUnionMember& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalUnionMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalUnionMember& other) const; - - RTPS_DllAPI bool consistent( - const MinimalUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonUnionMember m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by MinimalUnionMember.common.member_id -typedef std::vector MinimalUnionMemberSeq; - -/*struct CommonDiscriminatorMember final{ - UnionDiscriminatorFlag member_flags; - TypeIdentifier type_id; - };*/ -class CommonDiscriminatorMember -{ -public: - - RTPS_DllAPI CommonDiscriminatorMember(); - RTPS_DllAPI ~CommonDiscriminatorMember(); - RTPS_DllAPI CommonDiscriminatorMember( - const CommonDiscriminatorMember& x); - RTPS_DllAPI CommonDiscriminatorMember( - CommonDiscriminatorMember&& x); - RTPS_DllAPI CommonDiscriminatorMember& operator =( - const CommonDiscriminatorMember& x); - RTPS_DllAPI CommonDiscriminatorMember& operator =( - CommonDiscriminatorMember&& x); - - RTPS_DllAPI inline void member_flags( - const UnionDiscriminatorFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - RTPS_DllAPI inline void member_flags( - UnionDiscriminatorFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - RTPS_DllAPI inline const UnionDiscriminatorFlag& member_flags() const - { - return m_member_flags; - } - - RTPS_DllAPI inline UnionDiscriminatorFlag& member_flags() - { - return m_member_flags; - } - - RTPS_DllAPI inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - RTPS_DllAPI inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - RTPS_DllAPI inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - RTPS_DllAPI inline TypeIdentifier& type_id() - { - return m_type_id; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonDiscriminatorMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonDiscriminatorMember& other) const; - - RTPS_DllAPI bool consistent( - const CommonDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionDiscriminatorFlag m_member_flags; - TypeIdentifier m_type_id; -}; - -// Member of a union type -/*struct CompleteDiscriminatorMember { - CommonDiscriminatorMember common; - AppliedBuiltinTypeAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteDiscriminatorMember -{ -public: - - RTPS_DllAPI CompleteDiscriminatorMember(); - RTPS_DllAPI ~CompleteDiscriminatorMember(); - RTPS_DllAPI CompleteDiscriminatorMember( - const CompleteDiscriminatorMember& x); - RTPS_DllAPI CompleteDiscriminatorMember( - CompleteDiscriminatorMember&& x); - RTPS_DllAPI CompleteDiscriminatorMember& operator =( - const CompleteDiscriminatorMember& x); - RTPS_DllAPI CompleteDiscriminatorMember& operator =( - CompleteDiscriminatorMember&& x); - - RTPS_DllAPI inline void common( - const CommonDiscriminatorMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonDiscriminatorMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonDiscriminatorMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonDiscriminatorMember& common() - { - return m_common; - } - - RTPS_DllAPI inline void ann_builtin( - const AppliedBuiltinTypeAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - RTPS_DllAPI inline void ann_builtin( - AppliedBuiltinTypeAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - RTPS_DllAPI inline const AppliedBuiltinTypeAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - RTPS_DllAPI inline AppliedBuiltinTypeAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - RTPS_DllAPI inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - RTPS_DllAPI inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - RTPS_DllAPI inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - RTPS_DllAPI inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteDiscriminatorMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteDiscriminatorMember& other) const; - - RTPS_DllAPI bool consistent( - const CompleteDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonDiscriminatorMember m_common; - AppliedBuiltinTypeAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -// Member of a union type -/*struct MinimalDiscriminatorMember { - CommonDiscriminatorMember common; - };*/ -class MinimalDiscriminatorMember -{ -public: - - RTPS_DllAPI MinimalDiscriminatorMember(); - RTPS_DllAPI ~MinimalDiscriminatorMember(); - RTPS_DllAPI MinimalDiscriminatorMember( - const MinimalDiscriminatorMember& x); - RTPS_DllAPI MinimalDiscriminatorMember( - MinimalDiscriminatorMember&& x); - RTPS_DllAPI MinimalDiscriminatorMember& operator =( - const MinimalDiscriminatorMember& x); - RTPS_DllAPI MinimalDiscriminatorMember& operator =( - MinimalDiscriminatorMember&& x); - - RTPS_DllAPI inline void common( - const CommonDiscriminatorMember& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonDiscriminatorMember&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonDiscriminatorMember& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonDiscriminatorMember& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalDiscriminatorMember& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalDiscriminatorMember& other) const; - - RTPS_DllAPI bool consistent( - const MinimalDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonDiscriminatorMember m_common; -}; - -/*struct CompleteUnionHeader { - CompleteTypeDetail detail; - };*/ -class CompleteUnionHeader -{ -public: - - RTPS_DllAPI CompleteUnionHeader(); - RTPS_DllAPI ~CompleteUnionHeader(); - RTPS_DllAPI CompleteUnionHeader( - const CompleteUnionHeader& x); - RTPS_DllAPI CompleteUnionHeader( - CompleteUnionHeader&& x); - RTPS_DllAPI CompleteUnionHeader& operator =( - const CompleteUnionHeader& x); - RTPS_DllAPI CompleteUnionHeader& operator =( - CompleteUnionHeader&& x); - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteUnionHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteUnionHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteUnionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CompleteTypeDetail m_detail; -}; - -/*struct MinimalUnionHeader { - MinimalTypeDetail detail; - };*/ -class MinimalUnionHeader -{ -public: - - RTPS_DllAPI MinimalUnionHeader(); - RTPS_DllAPI ~MinimalUnionHeader(); - RTPS_DllAPI MinimalUnionHeader( - const MinimalUnionHeader& x); - RTPS_DllAPI MinimalUnionHeader( - MinimalUnionHeader&& x); - RTPS_DllAPI MinimalUnionHeader& operator =( - const MinimalUnionHeader& x); - RTPS_DllAPI MinimalUnionHeader& operator =( - MinimalUnionHeader&& x); - - RTPS_DllAPI inline void detail( - const MinimalTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalUnionHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalUnionHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalUnionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MinimalTypeDetail m_detail; -}; - -/*struct CompleteUnionType final{ - UnionTypeFlag union_flags; - CompleteUnionHeader header; - CompleteDiscriminatorMember discriminator; - CompleteUnionMemberSeq member_seq; - };*/ -class CompleteUnionType -{ -public: - - RTPS_DllAPI CompleteUnionType(); - RTPS_DllAPI ~CompleteUnionType(); - RTPS_DllAPI CompleteUnionType( - const CompleteUnionType& x); - RTPS_DllAPI CompleteUnionType( - CompleteUnionType&& x); - RTPS_DllAPI CompleteUnionType& operator =( - const CompleteUnionType& x); - RTPS_DllAPI CompleteUnionType& operator =( - CompleteUnionType&& x); - - RTPS_DllAPI inline void union_flags( - const UnionTypeFlag& _union_flags) - { - m_union_flags = _union_flags; - } - - RTPS_DllAPI inline void union_flags( - UnionTypeFlag&& _union_flags) - { - m_union_flags = std::move(_union_flags); - } - - RTPS_DllAPI inline const UnionTypeFlag& union_flags() const - { - return m_union_flags; - } - - RTPS_DllAPI inline UnionTypeFlag& union_flags() - { - return m_union_flags; - } - - RTPS_DllAPI inline void header( - const CompleteUnionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteUnionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteUnionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteUnionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void discriminator( - const CompleteDiscriminatorMember& _discriminator) - { - m_discriminator = _discriminator; - } - - RTPS_DllAPI inline void discriminator( - CompleteDiscriminatorMember&& _discriminator) - { - m_discriminator = std::move(_discriminator); - } - - RTPS_DllAPI inline const CompleteDiscriminatorMember& discriminator() const - { - return m_discriminator; - } - - RTPS_DllAPI inline CompleteDiscriminatorMember& discriminator() - { - return m_discriminator; - } - - RTPS_DllAPI inline void member_seq( - const CompleteUnionMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - CompleteUnionMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const CompleteUnionMemberSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline CompleteUnionMemberSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteUnionType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteUnionType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteUnionType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionTypeFlag m_union_flags; - CompleteUnionHeader m_header; - CompleteDiscriminatorMember m_discriminator; - CompleteUnionMemberSeq m_member_seq; -}; - -/*struct MinimalUnionType final{ - UnionTypeFlag union_flags; - MinimalUnionHeader header; - MinimalDiscriminatorMember discriminator; - MinimalUnionMemberSeq member_seq; - };*/ -class MinimalUnionType -{ -public: - - RTPS_DllAPI MinimalUnionType(); - RTPS_DllAPI ~MinimalUnionType(); - RTPS_DllAPI MinimalUnionType( - const MinimalUnionType& x); - RTPS_DllAPI MinimalUnionType( - MinimalUnionType&& x); - RTPS_DllAPI MinimalUnionType& operator =( - const MinimalUnionType& x); - RTPS_DllAPI MinimalUnionType& operator =( - MinimalUnionType&& x); - - RTPS_DllAPI inline void union_flags( - const UnionTypeFlag& _union_flags) - { - m_union_flags = _union_flags; - } - - RTPS_DllAPI inline void union_flags( - UnionTypeFlag&& _union_flags) - { - m_union_flags = std::move(_union_flags); - } - - RTPS_DllAPI inline const UnionTypeFlag& union_flags() const - { - return m_union_flags; - } - - RTPS_DllAPI inline UnionTypeFlag& union_flags() - { - return m_union_flags; - } - - RTPS_DllAPI inline void header( - const MinimalUnionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalUnionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalUnionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalUnionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void discriminator( - const MinimalDiscriminatorMember& _discriminator) - { - m_discriminator = _discriminator; - } - - RTPS_DllAPI inline void discriminator( - MinimalDiscriminatorMember&& _discriminator) - { - m_discriminator = std::move(_discriminator); - } - - RTPS_DllAPI inline const MinimalDiscriminatorMember& discriminator() const - { - return m_discriminator; - } - - RTPS_DllAPI inline MinimalDiscriminatorMember& discriminator() - { - return m_discriminator; - } - - RTPS_DllAPI inline void member_seq( - const MinimalUnionMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - MinimalUnionMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const MinimalUnionMemberSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline MinimalUnionMemberSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalUnionType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalUnionType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalUnionType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionTypeFlag m_union_flags; - MinimalUnionHeader m_header; - MinimalDiscriminatorMember m_discriminator; - MinimalUnionMemberSeq m_member_seq; -}; - -// --- Annotation: --------------------------------------------------- -/*struct CommonAnnotationParameter final{ - AnnotationParameterFlag member_flags; - TypeIdentifier member_type_id; - };*/ -class CommonAnnotationParameter -{ -public: - - RTPS_DllAPI CommonAnnotationParameter(); - RTPS_DllAPI ~CommonAnnotationParameter(); - RTPS_DllAPI CommonAnnotationParameter( - const CommonAnnotationParameter& x); - RTPS_DllAPI CommonAnnotationParameter( - CommonAnnotationParameter&& x); - RTPS_DllAPI CommonAnnotationParameter& operator =( - const CommonAnnotationParameter& x); - RTPS_DllAPI CommonAnnotationParameter& operator =( - CommonAnnotationParameter&& x); - - RTPS_DllAPI inline void member_flags( - const AnnotationParameterFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - RTPS_DllAPI inline void member_flags( - AnnotationParameterFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - RTPS_DllAPI inline const AnnotationParameterFlag& member_flags() const - { - return m_member_flags; - } - - RTPS_DllAPI inline AnnotationParameterFlag& member_flags() - { - return m_member_flags; - } - - RTPS_DllAPI inline void member_type_id( - const TypeIdentifier& _member_type_id) - { - m_member_type_id = _member_type_id; - } - - RTPS_DllAPI inline void member_type_id( - TypeIdentifier&& _member_type_id) - { - m_member_type_id = std::move(_member_type_id); - } - - RTPS_DllAPI inline const TypeIdentifier& member_type_id() const - { - return m_member_type_id; - } - - RTPS_DllAPI inline TypeIdentifier& member_type_id() - { - return m_member_type_id; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonAnnotationParameter& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonAnnotationParameter& other) const; - - RTPS_DllAPI bool consistent( - const CommonAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationParameterFlag m_member_flags; - TypeIdentifier m_member_type_id; -}; - -// Member of an annotation type - -/*struct CompleteAnnotationParameter { - CommonAnnotationParameter common; - MemberName name; - AnnotationParameterValue default_value; - };*/ -class CompleteAnnotationParameter -{ -public: - - RTPS_DllAPI CompleteAnnotationParameter(); - RTPS_DllAPI ~CompleteAnnotationParameter(); - RTPS_DllAPI CompleteAnnotationParameter( - const CompleteAnnotationParameter& x); - RTPS_DllAPI CompleteAnnotationParameter( - CompleteAnnotationParameter&& x); - RTPS_DllAPI CompleteAnnotationParameter& operator =( - const CompleteAnnotationParameter& x); - RTPS_DllAPI CompleteAnnotationParameter& operator =( - CompleteAnnotationParameter&& x); - - RTPS_DllAPI inline void common( - const CommonAnnotationParameter& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonAnnotationParameter&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonAnnotationParameter& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonAnnotationParameter& common() - { - return m_common; - } - - RTPS_DllAPI inline void name( - const MemberName& _name) - { - m_name = _name; - } - - RTPS_DllAPI inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - RTPS_DllAPI inline const MemberName& name() const - { - return m_name; - } - - RTPS_DllAPI inline MemberName& name() - { - return m_name; - } - - RTPS_DllAPI inline void default_value( - const AnnotationParameterValue& _default_value) - { - m_default_value = _default_value; - } - - RTPS_DllAPI inline void default_value( - AnnotationParameterValue&& _default_value) - { - m_default_value = std::move(_default_value); - } - - RTPS_DllAPI inline const AnnotationParameterValue& default_value() const - { - return m_default_value; - } - - RTPS_DllAPI inline AnnotationParameterValue& default_value() - { - return m_default_value; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAnnotationParameter& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAnnotationParameter& other) const; - - RTPS_DllAPI bool consistent( - const CompleteAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAnnotationParameter m_common; - MemberName m_name; - AnnotationParameterValue m_default_value; -}; -// Ordered by CompleteAnnotationParameter.name -typedef std::vector CompleteAnnotationParameterSeq; -/*struct MinimalAnnotationParameter { - CommonAnnotationParameter common; - NameHash name_hash; - AnnotationParameterValue default_value; - };*/ -class MinimalAnnotationParameter -{ -public: - - RTPS_DllAPI MinimalAnnotationParameter(); - RTPS_DllAPI ~MinimalAnnotationParameter(); - RTPS_DllAPI MinimalAnnotationParameter( - const MinimalAnnotationParameter& x); - RTPS_DllAPI MinimalAnnotationParameter( - MinimalAnnotationParameter&& x); - RTPS_DllAPI MinimalAnnotationParameter& operator =( - const MinimalAnnotationParameter& x); - RTPS_DllAPI MinimalAnnotationParameter& operator =( - MinimalAnnotationParameter&& x); - - RTPS_DllAPI inline void common( - const CommonAnnotationParameter& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonAnnotationParameter&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonAnnotationParameter& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonAnnotationParameter& common() - { - return m_common; - } - - RTPS_DllAPI inline void name( - const MemberName& _name) - { - m_name = _name; - } - - RTPS_DllAPI inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - RTPS_DllAPI inline const MemberName& name() const - { - return m_name; - } - - RTPS_DllAPI inline MemberName& name() - { - return m_name; - } - - RTPS_DllAPI inline void default_value( - const AnnotationParameterValue& _default_value) - { - m_default_value = _default_value; - } - - RTPS_DllAPI inline void default_value( - AnnotationParameterValue&& _default_value) - { - m_default_value = std::move(_default_value); - } - - RTPS_DllAPI inline const AnnotationParameterValue& default_value() const - { - return m_default_value; - } - - RTPS_DllAPI inline AnnotationParameterValue& default_value() - { - return m_default_value; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAnnotationParameter& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAnnotationParameter& other) const; - - RTPS_DllAPI bool consistent( - const MinimalAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAnnotationParameter m_common; - MemberName m_name; - AnnotationParameterValue m_default_value; -}; - -// Ordered by MinimalAnnotationParameter.name_hash -typedef std::vector MinimalAnnotationParameterSeq; -/*struct CompleteAnnotationHeader { - QualifiedTypeName annotation_name; - };*/ -class CompleteAnnotationHeader -{ -public: - - RTPS_DllAPI CompleteAnnotationHeader(); - RTPS_DllAPI ~CompleteAnnotationHeader(); - RTPS_DllAPI CompleteAnnotationHeader( - const CompleteAnnotationHeader& x); - RTPS_DllAPI CompleteAnnotationHeader( - CompleteAnnotationHeader&& x); - RTPS_DllAPI CompleteAnnotationHeader& operator =( - const CompleteAnnotationHeader& x); - RTPS_DllAPI CompleteAnnotationHeader& operator =( - CompleteAnnotationHeader&& x); - - RTPS_DllAPI inline void annotation_name( - const QualifiedTypeName& _annotation_name) - { - m_annotation_name = _annotation_name; - } - - RTPS_DllAPI inline void annotation_name( - QualifiedTypeName&& _annotation_name) - { - m_annotation_name = std::move(_annotation_name); - } - - RTPS_DllAPI inline const QualifiedTypeName& annotation_name() const - { - return m_annotation_name; - } - - RTPS_DllAPI inline QualifiedTypeName& annotation_name() - { - return m_annotation_name; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAnnotationHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAnnotationHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteAnnotationHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - QualifiedTypeName m_annotation_name; -}; - -/*struct MinimalAnnotationHeader { - // Empty. Available for future extension - };*/ -class MinimalAnnotationHeader -{ -public: - - RTPS_DllAPI MinimalAnnotationHeader(); - RTPS_DllAPI ~MinimalAnnotationHeader(); - RTPS_DllAPI MinimalAnnotationHeader( - const MinimalAnnotationHeader& x); - RTPS_DllAPI MinimalAnnotationHeader( - MinimalAnnotationHeader&& x); - RTPS_DllAPI MinimalAnnotationHeader& operator =( - const MinimalAnnotationHeader& x); - RTPS_DllAPI MinimalAnnotationHeader& operator =( - MinimalAnnotationHeader&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAnnotationHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAnnotationHeader&) const - { - return true; - } - - RTPS_DllAPI bool consistent( - const MinimalAnnotationHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteAnnotationType final{ - AnnotationTypeFlag annotation_flag; - CompleteAnnotationHeader header; - CompleteAnnotationParameterSeq member_seq; - };*/ -class CompleteAnnotationType final -{ -public: - - RTPS_DllAPI CompleteAnnotationType(); - RTPS_DllAPI ~CompleteAnnotationType(); - RTPS_DllAPI CompleteAnnotationType( - const CompleteAnnotationType& x); - RTPS_DllAPI CompleteAnnotationType( - CompleteAnnotationType&& x); - RTPS_DllAPI CompleteAnnotationType& operator =( - const CompleteAnnotationType& x); - RTPS_DllAPI CompleteAnnotationType& operator =( - CompleteAnnotationType&& x); - - RTPS_DllAPI inline void annotation_flag( - const AnnotationTypeFlag& _annotation_flag) - { - m_annotation_flag = _annotation_flag; - } - - RTPS_DllAPI inline void annotation_flag( - AnnotationTypeFlag&& _annotation_flag) - { - m_annotation_flag = std::move(_annotation_flag); - } - - RTPS_DllAPI inline const AnnotationTypeFlag& annotation_flag() const - { - return m_annotation_flag; - } - - RTPS_DllAPI inline AnnotationTypeFlag& annotation_flag() - { - return m_annotation_flag; - } - - RTPS_DllAPI inline void header( - const CompleteAnnotationHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteAnnotationHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteAnnotationHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteAnnotationHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void member_seq( - const CompleteAnnotationParameterSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - CompleteAnnotationParameterSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const CompleteAnnotationParameterSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline CompleteAnnotationParameterSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAnnotationType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAnnotationType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteAnnotationType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationTypeFlag m_annotation_flag; - CompleteAnnotationHeader m_header; - CompleteAnnotationParameterSeq m_member_seq; -}; -/*struct MinimalAnnotationType final{ - AnnotationTypeFlag annotation_flag; - MinimalAnnotationHeader header; - MinimalAnnotationParameterSeq member_seq; - };*/ -class MinimalAnnotationType final -{ -public: - - RTPS_DllAPI MinimalAnnotationType(); - RTPS_DllAPI ~MinimalAnnotationType(); - RTPS_DllAPI MinimalAnnotationType( - const MinimalAnnotationType& x); - RTPS_DllAPI MinimalAnnotationType( - MinimalAnnotationType&& x); - RTPS_DllAPI MinimalAnnotationType& operator =( - const MinimalAnnotationType& x); - RTPS_DllAPI MinimalAnnotationType& operator =( - MinimalAnnotationType&& x); - - RTPS_DllAPI inline void annotation_flag( - const AnnotationTypeFlag& _annotation_flag) - { - m_annotation_flag = _annotation_flag; - } - - RTPS_DllAPI inline void annotation_flag( - AnnotationTypeFlag&& _annotation_flag) - { - m_annotation_flag = std::move(_annotation_flag); - } - - RTPS_DllAPI inline const AnnotationTypeFlag& annotation_flag() const - { - return m_annotation_flag; - } - - RTPS_DllAPI inline AnnotationTypeFlag& annotation_flag() - { - return m_annotation_flag; - } - - RTPS_DllAPI inline void header( - const MinimalAnnotationHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalAnnotationHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalAnnotationHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalAnnotationHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void member_seq( - const MinimalAnnotationParameterSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - RTPS_DllAPI inline void member_seq( - MinimalAnnotationParameterSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - RTPS_DllAPI inline const MinimalAnnotationParameterSeq& member_seq() const - { - return m_member_seq; - } - - RTPS_DllAPI inline MinimalAnnotationParameterSeq& member_seq() - { - return m_member_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAnnotationType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAnnotationType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalAnnotationType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationTypeFlag m_annotation_flag; - MinimalAnnotationHeader m_header; - MinimalAnnotationParameterSeq m_member_seq; -}; - -// --- Alias: --------------------------------------------------------- -/*struct CommonAliasBody final{ - AliasMemberFlag related_flags; - TypeIdentifier related_type; - };*/ -class CommonAliasBody -{ -public: - - RTPS_DllAPI CommonAliasBody(); - RTPS_DllAPI ~CommonAliasBody(); - RTPS_DllAPI CommonAliasBody( - const CommonAliasBody& x); - RTPS_DllAPI CommonAliasBody( - CommonAliasBody&& x); - RTPS_DllAPI CommonAliasBody& operator =( - const CommonAliasBody& x); - RTPS_DllAPI CommonAliasBody& operator =( - CommonAliasBody&& x); - - RTPS_DllAPI inline void related_flags( - const AliasMemberFlag& _related_flags) - { - m_related_flags = _related_flags; - } - - RTPS_DllAPI inline void related_flags( - AliasMemberFlag&& _related_flags) - { - m_related_flags = std::move(_related_flags); - } - - RTPS_DllAPI inline const AliasMemberFlag& related_flags() const - { - return m_related_flags; - } - - RTPS_DllAPI inline AliasMemberFlag& related_flags() - { - return m_related_flags; - } - - RTPS_DllAPI inline void related_type( - const TypeIdentifier& _related_type) - { - m_related_type = _related_type; - } - - RTPS_DllAPI inline void related_type( - TypeIdentifier&& _related_type) - { - m_related_type = std::move(_related_type); - } - - RTPS_DllAPI inline const TypeIdentifier& related_type() const - { - return m_related_type; - } - - RTPS_DllAPI inline TypeIdentifier& related_type() - { - return m_related_type; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonAliasBody& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonAliasBody& other) const; - - // RTPS_DllAPI bool consistent(const CommonAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasMemberFlag m_related_flags; - TypeIdentifier m_related_type; -}; - -/*struct CompleteAliasBody { - CommonAliasBody common; - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteAliasBody -{ -public: - - RTPS_DllAPI CompleteAliasBody(); - RTPS_DllAPI ~CompleteAliasBody(); - RTPS_DllAPI CompleteAliasBody( - const CompleteAliasBody& x); - RTPS_DllAPI CompleteAliasBody( - CompleteAliasBody&& x); - RTPS_DllAPI CompleteAliasBody& operator =( - const CompleteAliasBody& x); - RTPS_DllAPI CompleteAliasBody& operator =( - CompleteAliasBody&& x); - - RTPS_DllAPI inline void common( - const CommonAliasBody& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonAliasBody&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonAliasBody& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonAliasBody& common() - { - return m_common; - } - - RTPS_DllAPI inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - RTPS_DllAPI inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - RTPS_DllAPI inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - RTPS_DllAPI inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - RTPS_DllAPI inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - RTPS_DllAPI inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - RTPS_DllAPI inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - RTPS_DllAPI inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAliasBody& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAliasBody& other) const; - - // RTPS_DllAPI bool consistent(const CompleteAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAliasBody m_common; - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -/*struct MinimalAliasBody { - CommonAliasBody common; - };*/ -class MinimalAliasBody -{ -public: - - RTPS_DllAPI MinimalAliasBody(); - RTPS_DllAPI ~MinimalAliasBody(); - RTPS_DllAPI MinimalAliasBody( - const MinimalAliasBody& x); - RTPS_DllAPI MinimalAliasBody( - MinimalAliasBody&& x); - RTPS_DllAPI MinimalAliasBody& operator =( - const MinimalAliasBody& x); - RTPS_DllAPI MinimalAliasBody& operator =( - MinimalAliasBody&& x); - - RTPS_DllAPI inline void common( - const CommonAliasBody& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonAliasBody&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonAliasBody& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonAliasBody& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAliasBody& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAliasBody& other) const; - - // RTPS_DllAPI bool consistent(const MinimalAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAliasBody m_common; -}; - -/*struct CompleteAliasHeader { - CompleteTypeDetail detail; - };*/ -class CompleteAliasHeader -{ -public: - - RTPS_DllAPI CompleteAliasHeader(); - RTPS_DllAPI ~CompleteAliasHeader(); - RTPS_DllAPI CompleteAliasHeader( - const CompleteAliasHeader& x); - RTPS_DllAPI CompleteAliasHeader( - CompleteAliasHeader&& x); - RTPS_DllAPI CompleteAliasHeader& operator =( - const CompleteAliasHeader& x); - RTPS_DllAPI CompleteAliasHeader& operator =( - CompleteAliasHeader&& x); - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAliasHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAliasHeader& other) const; - - // RTPS_DllAPI bool consistent(const CompleteAliasHeader &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CompleteTypeDetail m_detail; -}; - -/*struct MinimalAliasHeader { - // Empty. Available for future extension - };*/ -class MinimalAliasHeader -{ -public: - - RTPS_DllAPI MinimalAliasHeader(); - RTPS_DllAPI ~MinimalAliasHeader(); - RTPS_DllAPI MinimalAliasHeader( - const MinimalAliasHeader& x); - RTPS_DllAPI MinimalAliasHeader( - MinimalAliasHeader&& x); - RTPS_DllAPI MinimalAliasHeader& operator =( - const MinimalAliasHeader& x); - RTPS_DllAPI MinimalAliasHeader& operator =( - MinimalAliasHeader&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAliasHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAliasHeader&) const - { - return true; - } - - // RTPS_DllAPI bool consistent(const MinimalAliasHeader &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteAliasType final{ - AliasTypeFlag alias_flags; - CompleteAliasHeader header; - CompleteAliasBody body; - };*/ -class CompleteAliasType -{ -public: - - RTPS_DllAPI CompleteAliasType(); - RTPS_DllAPI ~CompleteAliasType(); - RTPS_DllAPI CompleteAliasType( - const CompleteAliasType& x); - RTPS_DllAPI CompleteAliasType( - CompleteAliasType&& x); - RTPS_DllAPI CompleteAliasType& operator =( - const CompleteAliasType& x); - RTPS_DllAPI CompleteAliasType& operator =( - CompleteAliasType&& x); - - RTPS_DllAPI inline void alias_flags( - const AliasTypeFlag& _alias_flags) - { - m_alias_flags = _alias_flags; - } - - RTPS_DllAPI inline void alias_flags( - AliasTypeFlag&& _alias_flags) - { - m_alias_flags = std::move(_alias_flags); - } - - RTPS_DllAPI inline const AliasTypeFlag& alias_flags() const - { - return m_alias_flags; - } - - RTPS_DllAPI inline AliasTypeFlag& alias_flags() - { - return m_alias_flags; - } - - RTPS_DllAPI inline void header( - const CompleteAliasHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteAliasHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteAliasHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteAliasHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void body( - const CompleteAliasBody& _body) - { - m_body = _body; - } - - RTPS_DllAPI inline void body( - CompleteAliasBody&& _body) - { - m_body = std::move(_body); - } - - RTPS_DllAPI inline const CompleteAliasBody& body() const - { - return m_body; - } - - RTPS_DllAPI inline CompleteAliasBody& body() - { - return m_body; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteAliasType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteAliasType& other) const; - - // RTPS_DllAPI bool consistent(const CompleteAliasType &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasTypeFlag m_alias_flags; - CompleteAliasHeader m_header; - CompleteAliasBody m_body; -}; -/*struct MinimalAliasType final{ - AliasTypeFlag alias_flags; - MinimalAliasHeader header; - MinimalAliasBody body; - };*/ -class MinimalAliasType -{ -public: - - RTPS_DllAPI MinimalAliasType(); - RTPS_DllAPI ~MinimalAliasType(); - RTPS_DllAPI MinimalAliasType( - const MinimalAliasType& x); - RTPS_DllAPI MinimalAliasType( - MinimalAliasType&& x); - RTPS_DllAPI MinimalAliasType& operator =( - const MinimalAliasType& x); - RTPS_DllAPI MinimalAliasType& operator =( - MinimalAliasType&& x); - - RTPS_DllAPI inline void alias_flags( - const AliasTypeFlag& _alias_flags) - { - m_alias_flags = _alias_flags; - } - - RTPS_DllAPI inline void alias_flags( - AliasTypeFlag&& _alias_flags) - { - m_alias_flags = std::move(_alias_flags); - } - - RTPS_DllAPI inline const AliasTypeFlag& alias_flags() const - { - return m_alias_flags; - } - - RTPS_DllAPI inline AliasTypeFlag& alias_flags() - { - return m_alias_flags; - } - - RTPS_DllAPI inline void header( - const MinimalAliasHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalAliasHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalAliasHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalAliasHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void body( - const MinimalAliasBody& _body) - { - m_body = _body; - } - - RTPS_DllAPI inline void body( - MinimalAliasBody&& _body) - { - m_body = std::move(_body); - } - - RTPS_DllAPI inline const MinimalAliasBody& body() const - { - return m_body; - } - - RTPS_DllAPI inline MinimalAliasBody& body() - { - return m_body; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalAliasType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalAliasType& other) const; - - // RTPS_DllAPI bool consistent(const MinimalAliasType &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasTypeFlag m_alias_flags; - MinimalAliasHeader m_header; - MinimalAliasBody m_body; -}; - -// --- Collections: --------------------------------------------------- -/*struct CompleteElementDetail final{ - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteElementDetail -{ -public: - - RTPS_DllAPI CompleteElementDetail(); - RTPS_DllAPI ~CompleteElementDetail(); - RTPS_DllAPI CompleteElementDetail( - const CompleteElementDetail& x); - RTPS_DllAPI CompleteElementDetail( - CompleteElementDetail&& x); - RTPS_DllAPI CompleteElementDetail& operator =( - const CompleteElementDetail& x); - RTPS_DllAPI CompleteElementDetail& operator =( - CompleteElementDetail&& x); - - RTPS_DllAPI inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - RTPS_DllAPI inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - RTPS_DllAPI inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - RTPS_DllAPI inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - RTPS_DllAPI inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - RTPS_DllAPI inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - RTPS_DllAPI inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - RTPS_DllAPI inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteElementDetail& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteElementDetail& other) const; - - RTPS_DllAPI bool consistent( - const CompleteElementDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; -/*struct CommonCollectionElement final{ - CollectionElementFlag element_flags; - TypeIdentifier type; - };*/ -class CommonCollectionElement final -{ -public: - - RTPS_DllAPI CommonCollectionElement(); - RTPS_DllAPI ~CommonCollectionElement(); - RTPS_DllAPI CommonCollectionElement( - const CommonCollectionElement& x); - RTPS_DllAPI CommonCollectionElement( - CommonCollectionElement&& x); - RTPS_DllAPI CommonCollectionElement& operator =( - const CommonCollectionElement& x); - RTPS_DllAPI CommonCollectionElement& operator =( - CommonCollectionElement&& x); - - RTPS_DllAPI inline void element_flags( - const CollectionElementFlag& _element_flags) - { - m_element_flags = _element_flags; - } - - RTPS_DllAPI inline void element_flags( - CollectionElementFlag&& _element_flags) - { - m_element_flags = std::move(_element_flags); - } - - RTPS_DllAPI inline const CollectionElementFlag& element_flags() const - { - return m_element_flags; - } - - RTPS_DllAPI inline CollectionElementFlag& element_flags() - { - return m_element_flags; - } - - RTPS_DllAPI inline void type( - const TypeIdentifier& _type) - { - m_type = _type; - } - - RTPS_DllAPI inline void type( - TypeIdentifier&& _type) - { - m_type = std::move(_type); - } - - RTPS_DllAPI inline const TypeIdentifier& type() const - { - return m_type; - } - - RTPS_DllAPI inline TypeIdentifier& type() - { - return m_type; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonCollectionElement& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonCollectionElement& other) const; - - RTPS_DllAPI bool consistent( - const CommonCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionElementFlag m_element_flags; - TypeIdentifier m_type; -}; - -/*struct CompleteCollectionElement { - CommonCollectionElement common; - CompleteElementDetail detail; - };*/ -class CompleteCollectionElement -{ -public: - - RTPS_DllAPI CompleteCollectionElement(); - RTPS_DllAPI ~CompleteCollectionElement(); - RTPS_DllAPI CompleteCollectionElement( - const CompleteCollectionElement& x); - RTPS_DllAPI CompleteCollectionElement( - CompleteCollectionElement&& x); - RTPS_DllAPI CompleteCollectionElement& operator =( - const CompleteCollectionElement& x); - RTPS_DllAPI CompleteCollectionElement& operator =( - CompleteCollectionElement&& x); - - RTPS_DllAPI inline void common( - const CommonCollectionElement& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonCollectionElement&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonCollectionElement& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonCollectionElement& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteElementDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteElementDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteElementDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteElementDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteCollectionElement& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteCollectionElement& other) const; - - RTPS_DllAPI bool consistent( - const CompleteCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionElement m_common; - CompleteElementDetail m_detail; -}; - -/*struct MinimalCollectionElement { - CommonCollectionElement common; - };*/ -class MinimalCollectionElement -{ -public: - - RTPS_DllAPI MinimalCollectionElement(); - RTPS_DllAPI ~MinimalCollectionElement(); - RTPS_DllAPI MinimalCollectionElement( - const MinimalCollectionElement& x); - RTPS_DllAPI MinimalCollectionElement( - MinimalCollectionElement&& x); - RTPS_DllAPI MinimalCollectionElement& operator =( - const MinimalCollectionElement& x); - RTPS_DllAPI MinimalCollectionElement& operator =( - MinimalCollectionElement&& x); - - RTPS_DllAPI inline void common( - const CommonCollectionElement& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonCollectionElement&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonCollectionElement& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonCollectionElement& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalCollectionElement& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalCollectionElement& other) const; - - RTPS_DllAPI bool consistent( - const MinimalCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionElement m_common; -}; - -/*struct CommonCollectionHeader final{ - LBound bound; - };*/ -class CommonCollectionHeader -{ -public: - - RTPS_DllAPI CommonCollectionHeader(); - RTPS_DllAPI ~CommonCollectionHeader(); - RTPS_DllAPI CommonCollectionHeader( - const CommonCollectionHeader& x); - RTPS_DllAPI CommonCollectionHeader( - CommonCollectionHeader&& x); - RTPS_DllAPI CommonCollectionHeader& operator =( - const CommonCollectionHeader& x); - RTPS_DllAPI CommonCollectionHeader& operator =( - CommonCollectionHeader&& x); - - RTPS_DllAPI inline void bound( - const LBound& _bound) - { - m_bound = _bound; - } - - RTPS_DllAPI inline void bound( - LBound&& _bound) - { - m_bound = std::move(_bound); - } - - RTPS_DllAPI inline const LBound& bound() const - { - return m_bound; - } - - RTPS_DllAPI inline LBound& bound() - { - return m_bound; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonCollectionHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonCollectionHeader& other) const; - - RTPS_DllAPI bool consistent( - const CommonCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBound m_bound; -}; - -/*struct CompleteCollectionHeader { - CommonCollectionHeader common; - CompleteTypeDetail detail; // Optional // not present for anonymous - };*/ -class CompleteCollectionHeader -{ -public: - - RTPS_DllAPI CompleteCollectionHeader(); - RTPS_DllAPI ~CompleteCollectionHeader(); - RTPS_DllAPI CompleteCollectionHeader( - const CompleteCollectionHeader& x); - RTPS_DllAPI CompleteCollectionHeader( - CompleteCollectionHeader&& x); - RTPS_DllAPI CompleteCollectionHeader& operator =( - const CompleteCollectionHeader& x); - RTPS_DllAPI CompleteCollectionHeader& operator =( - CompleteCollectionHeader&& x); - - RTPS_DllAPI inline void common( - const CommonCollectionHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonCollectionHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonCollectionHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonCollectionHeader& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteCollectionHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteCollectionHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalCollectionHeader { - CommonCollectionHeader common; - };*/ -class MinimalCollectionHeader -{ -public: - - RTPS_DllAPI MinimalCollectionHeader(); - RTPS_DllAPI ~MinimalCollectionHeader(); - RTPS_DllAPI MinimalCollectionHeader( - const MinimalCollectionHeader& x); - RTPS_DllAPI MinimalCollectionHeader( - MinimalCollectionHeader&& x); - RTPS_DllAPI MinimalCollectionHeader& operator =( - const MinimalCollectionHeader& x); - RTPS_DllAPI MinimalCollectionHeader& operator =( - MinimalCollectionHeader&& x); - - RTPS_DllAPI inline void common( - const CommonCollectionHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonCollectionHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonCollectionHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonCollectionHeader& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalCollectionHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalCollectionHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionHeader m_common; -}; - -// --- Sequence: ----------------------------------------------------- -/*struct CompleteSequenceType final{ - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement element; - };*/ -class CompleteSequenceType -{ -public: - - RTPS_DllAPI CompleteSequenceType(); - RTPS_DllAPI ~CompleteSequenceType(); - RTPS_DllAPI CompleteSequenceType( - const CompleteSequenceType& x); - RTPS_DllAPI CompleteSequenceType( - CompleteSequenceType&& x); - RTPS_DllAPI CompleteSequenceType& operator =( - const CompleteSequenceType& x); - RTPS_DllAPI CompleteSequenceType& operator =( - CompleteSequenceType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const CompleteCollectionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteCollectionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteCollectionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const CompleteCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline CompleteCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteSequenceType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteSequenceType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteSequenceType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteCollectionHeader m_header; - CompleteCollectionElement m_element; -}; - -/*struct MinimalSequenceType final{ - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement element; - };*/ -class MinimalSequenceType -{ -public: - - RTPS_DllAPI MinimalSequenceType(); - RTPS_DllAPI ~MinimalSequenceType(); - RTPS_DllAPI MinimalSequenceType( - const MinimalSequenceType& x); - RTPS_DllAPI MinimalSequenceType( - MinimalSequenceType&& x); - RTPS_DllAPI MinimalSequenceType& operator =( - const MinimalSequenceType& x); - RTPS_DllAPI MinimalSequenceType& operator =( - MinimalSequenceType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const MinimalCollectionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalCollectionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalCollectionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const MinimalCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline MinimalCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalSequenceType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalSequenceType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalSequenceType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalCollectionHeader m_header; - MinimalCollectionElement m_element; -}; - -// --- Array: ----------------------------------------------------- -/*struct CommonArrayHeader final{ - LBoundSeq bound_seq; - };*/ -class CommonArrayHeader -{ -public: - - RTPS_DllAPI CommonArrayHeader(); - RTPS_DllAPI ~CommonArrayHeader(); - RTPS_DllAPI CommonArrayHeader( - const CommonArrayHeader& x); - RTPS_DllAPI CommonArrayHeader( - CommonArrayHeader&& x); - RTPS_DllAPI CommonArrayHeader& operator =( - const CommonArrayHeader& x); - RTPS_DllAPI CommonArrayHeader& operator =( - CommonArrayHeader&& x); - - RTPS_DllAPI inline void bound_seq( - const LBoundSeq& _bound_seq) - { - m_bound_seq = _bound_seq; - } - - RTPS_DllAPI inline void bound_seq( - LBoundSeq&& _bound_seq) - { - m_bound_seq = std::move(_bound_seq); - } - - RTPS_DllAPI inline const LBoundSeq& bound_seq() const - { - return m_bound_seq; - } - - RTPS_DllAPI inline LBoundSeq& bound_seq() - { - return m_bound_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonArrayHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonArrayHeader& other) const; - - RTPS_DllAPI bool consistent( - const CommonArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBoundSeq m_bound_seq; -}; - -/*struct CompleteArrayHeader { - CommonArrayHeader common; - CompleteTypeDetail detail; - };*/ -class CompleteArrayHeader -{ -public: - - RTPS_DllAPI CompleteArrayHeader(); - RTPS_DllAPI ~CompleteArrayHeader(); - RTPS_DllAPI CompleteArrayHeader( - const CompleteArrayHeader& x); - RTPS_DllAPI CompleteArrayHeader( - CompleteArrayHeader&& x); - RTPS_DllAPI CompleteArrayHeader& operator =( - const CompleteArrayHeader& x); - RTPS_DllAPI CompleteArrayHeader& operator =( - CompleteArrayHeader&& x); - - RTPS_DllAPI inline void common( - const CommonArrayHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonArrayHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonArrayHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonArrayHeader& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteArrayHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteArrayHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonArrayHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalArrayHeader { - CommonArrayHeader common; - };*/ -class MinimalArrayHeader -{ -public: - - RTPS_DllAPI MinimalArrayHeader(); - RTPS_DllAPI ~MinimalArrayHeader(); - RTPS_DllAPI MinimalArrayHeader( - const MinimalArrayHeader& x); - RTPS_DllAPI MinimalArrayHeader( - MinimalArrayHeader&& x); - RTPS_DllAPI MinimalArrayHeader& operator =( - const MinimalArrayHeader& x); - RTPS_DllAPI MinimalArrayHeader& operator =( - MinimalArrayHeader&& x); - - RTPS_DllAPI inline void common( - const CommonArrayHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonArrayHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonArrayHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonArrayHeader& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalArrayHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalArrayHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonArrayHeader m_common; -}; - -/*struct CompleteArrayType { - CollectionTypeFlag collection_flag; - CompleteArrayHeader header; - CompleteCollectionElement element; - };*/ -class CompleteArrayType -{ -public: - - RTPS_DllAPI CompleteArrayType(); - RTPS_DllAPI ~CompleteArrayType(); - RTPS_DllAPI CompleteArrayType( - const CompleteArrayType& x); - RTPS_DllAPI CompleteArrayType( - CompleteArrayType&& x); - RTPS_DllAPI CompleteArrayType& operator =( - const CompleteArrayType& x); - RTPS_DllAPI CompleteArrayType& operator =( - CompleteArrayType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const CompleteArrayHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteArrayHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteArrayHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteArrayHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const CompleteCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline CompleteCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteArrayType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteArrayType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteArrayType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteArrayHeader m_header; - CompleteCollectionElement m_element; -}; - -/*struct MinimalArrayType final{ - CollectionTypeFlag collection_flag; - MinimalArrayHeader header; - MinimalCollectionElement element; - };*/ -class MinimalArrayType -{ -public: - - RTPS_DllAPI MinimalArrayType(); - RTPS_DllAPI ~MinimalArrayType(); - RTPS_DllAPI MinimalArrayType( - const MinimalArrayType& x); - RTPS_DllAPI MinimalArrayType( - MinimalArrayType&& x); - RTPS_DllAPI MinimalArrayType& operator =( - const MinimalArrayType& x); - RTPS_DllAPI MinimalArrayType& operator =( - MinimalArrayType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const MinimalArrayHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalArrayHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalArrayHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalArrayHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const MinimalCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline MinimalCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalArrayType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalArrayType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalArrayType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalArrayHeader m_header; - MinimalCollectionElement m_element; -}; - -// --- Map: ----------------------------------------------------- -/*struct CompleteMapType final{ - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement key; - CompleteCollectionElement element; - };*/ -class CompleteMapType final -{ -public: - - RTPS_DllAPI CompleteMapType(); - RTPS_DllAPI ~CompleteMapType(); - RTPS_DllAPI CompleteMapType( - const CompleteMapType& x); - RTPS_DllAPI CompleteMapType( - CompleteMapType&& x); - RTPS_DllAPI CompleteMapType& operator =( - const CompleteMapType& x); - RTPS_DllAPI CompleteMapType& operator =( - CompleteMapType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const CompleteCollectionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteCollectionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteCollectionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void key( - const CompleteCollectionElement& _key) - { - m_key = _key; - } - - RTPS_DllAPI inline void key( - CompleteCollectionElement&& _key) - { - m_key = std::move(_key); - } - - RTPS_DllAPI inline const CompleteCollectionElement& key() const - { - return m_key; - } - - RTPS_DllAPI inline CompleteCollectionElement& key() - { - return m_key; - } - - RTPS_DllAPI inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const CompleteCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline CompleteCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteMapType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteMapType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteMapType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteCollectionHeader m_header; - CompleteCollectionElement m_key; - CompleteCollectionElement m_element; -}; -/*struct MinimalMapType final{ - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement key; - MinimalCollectionElement element; - };*/ -class MinimalMapType final -{ -public: - - RTPS_DllAPI MinimalMapType(); - RTPS_DllAPI ~MinimalMapType(); - RTPS_DllAPI MinimalMapType( - const MinimalMapType& x); - RTPS_DllAPI MinimalMapType( - MinimalMapType&& x); - RTPS_DllAPI MinimalMapType& operator =( - const MinimalMapType& x); - RTPS_DllAPI MinimalMapType& operator =( - MinimalMapType&& x); - - RTPS_DllAPI inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - RTPS_DllAPI inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - RTPS_DllAPI inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - RTPS_DllAPI inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - RTPS_DllAPI inline void header( - const MinimalCollectionHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalCollectionHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalCollectionHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void key( - const MinimalCollectionElement& _key) - { - m_key = _key; - } - - RTPS_DllAPI inline void key( - MinimalCollectionElement&& _key) - { - m_key = std::move(_key); - } - - RTPS_DllAPI inline const MinimalCollectionElement& key() const - { - return m_key; - } - - RTPS_DllAPI inline MinimalCollectionElement& key() - { - return m_key; - } - - RTPS_DllAPI inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - RTPS_DllAPI inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - RTPS_DllAPI inline const MinimalCollectionElement& element() const - { - return m_element; - } - - RTPS_DllAPI inline MinimalCollectionElement& element() - { - return m_element; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalMapType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalMapType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalMapType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalCollectionHeader m_header; - MinimalCollectionElement m_key; - MinimalCollectionElement m_element; -}; - -// --- Enumeration: --------------------------------------------------- -typedef uint16_t BitBound; - -// Constant in an enumerated type - -/*struct CommonEnumeratedLiteral { - int32_t value; - EnumeratedLiteralFlag flags; - };*/ -class CommonEnumeratedLiteral -{ -public: - - RTPS_DllAPI CommonEnumeratedLiteral(); - RTPS_DllAPI ~CommonEnumeratedLiteral(); - RTPS_DllAPI CommonEnumeratedLiteral( - const CommonEnumeratedLiteral& x); - RTPS_DllAPI CommonEnumeratedLiteral( - CommonEnumeratedLiteral&& x); - RTPS_DllAPI CommonEnumeratedLiteral& operator =( - const CommonEnumeratedLiteral& x); - RTPS_DllAPI CommonEnumeratedLiteral& operator =( - CommonEnumeratedLiteral&& x); - - RTPS_DllAPI inline void value( - const int32_t& _value) - { - m_value = _value; - } - - RTPS_DllAPI inline void value( - int32_t&& _value) - { - m_value = std::move(_value); - } - - RTPS_DllAPI inline const int32_t& value() const - { - return m_value; - } - - RTPS_DllAPI inline int32_t& value() - { - return m_value; - } - - RTPS_DllAPI inline void flags( - const EnumeratedLiteralFlag& _flags) - { - m_flags = _flags; - } - - RTPS_DllAPI inline void flags( - EnumeratedLiteralFlag&& _flags) - { - m_flags = std::move(_flags); - } - - RTPS_DllAPI inline const EnumeratedLiteralFlag& flags() const - { - return m_flags; - } - - RTPS_DllAPI inline EnumeratedLiteralFlag& flags() - { - return m_flags; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonEnumeratedLiteral& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonEnumeratedLiteral& other) const; - - RTPS_DllAPI bool consistent( - const CommonEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - int32_t m_value; - EnumeratedLiteralFlag m_flags; -}; - -// Constant in an enumerated type - -/*struct CompleteEnumeratedLiteral { - CommonEnumeratedLiteral common; - CompleteMemberDetail detail; - };*/ -class CompleteEnumeratedLiteral -{ -public: - - RTPS_DllAPI CompleteEnumeratedLiteral(); - RTPS_DllAPI ~CompleteEnumeratedLiteral(); - RTPS_DllAPI CompleteEnumeratedLiteral( - const CompleteEnumeratedLiteral& x); - RTPS_DllAPI CompleteEnumeratedLiteral( - CompleteEnumeratedLiteral&& x); - RTPS_DllAPI CompleteEnumeratedLiteral& operator =( - const CompleteEnumeratedLiteral& x); - RTPS_DllAPI CompleteEnumeratedLiteral& operator =( - CompleteEnumeratedLiteral&& x); - - RTPS_DllAPI inline void common( - const CommonEnumeratedLiteral& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonEnumeratedLiteral&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonEnumeratedLiteral& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonEnumeratedLiteral& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteEnumeratedLiteral& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteEnumeratedLiteral& other) const; - - RTPS_DllAPI bool consistent( - const CompleteEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedLiteral m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by EnumeratedLiteral.common.value -typedef std::vector CompleteEnumeratedLiteralSeq; - -// Constant in an enumerated type - -/*struct MinimalEnumeratedLiteral { - CommonEnumeratedLiteral common; - MinimalMemberDetail detail; - };*/ -class MinimalEnumeratedLiteral -{ -public: - - RTPS_DllAPI MinimalEnumeratedLiteral(); - RTPS_DllAPI ~MinimalEnumeratedLiteral(); - RTPS_DllAPI MinimalEnumeratedLiteral( - const MinimalEnumeratedLiteral& x); - RTPS_DllAPI MinimalEnumeratedLiteral( - MinimalEnumeratedLiteral&& x); - RTPS_DllAPI MinimalEnumeratedLiteral& operator =( - const MinimalEnumeratedLiteral& x); - RTPS_DllAPI MinimalEnumeratedLiteral& operator =( - MinimalEnumeratedLiteral&& x); - - RTPS_DllAPI inline void common( - const CommonEnumeratedLiteral& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonEnumeratedLiteral&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonEnumeratedLiteral& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonEnumeratedLiteral& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalEnumeratedLiteral& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalEnumeratedLiteral& other) const; - - RTPS_DllAPI bool consistent( - const MinimalEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedLiteral m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by EnumeratedLiteral.common.value -typedef std::vector MinimalEnumeratedLiteralSeq; - -/*struct CommonEnumeratedHeader final{ - BitBound bit_bound; - };*/ -class CommonEnumeratedHeader final -{ -public: - - RTPS_DllAPI CommonEnumeratedHeader(); - RTPS_DllAPI ~CommonEnumeratedHeader(); - RTPS_DllAPI CommonEnumeratedHeader( - const CommonEnumeratedHeader& x); - RTPS_DllAPI CommonEnumeratedHeader( - CommonEnumeratedHeader&& x); - RTPS_DllAPI CommonEnumeratedHeader& operator =( - const CommonEnumeratedHeader& x); - RTPS_DllAPI CommonEnumeratedHeader& operator =( - CommonEnumeratedHeader&& x); - - RTPS_DllAPI inline void bit_bound( - const BitBound& _bit_bound) - { - m_bit_bound = _bit_bound; - } - - RTPS_DllAPI inline void bit_bound( - BitBound&& _bit_bound) - { - m_bit_bound = std::move(_bit_bound); - } - - RTPS_DllAPI inline const BitBound& bit_bound() const - { - return m_bit_bound; - } - - RTPS_DllAPI inline BitBound& bit_bound() - { - return m_bit_bound; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonEnumeratedHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonEnumeratedHeader& other) const; - - RTPS_DllAPI bool consistent( - const CommonEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitBound m_bit_bound; -}; - -/*struct CompleteEnumeratedHeader { - CommonEnumeratedHeader common; - CompleteTypeDetail detail; - };*/ -class CompleteEnumeratedHeader -{ -public: - - RTPS_DllAPI CompleteEnumeratedHeader(); - RTPS_DllAPI ~CompleteEnumeratedHeader(); - RTPS_DllAPI CompleteEnumeratedHeader( - const CompleteEnumeratedHeader& x); - RTPS_DllAPI CompleteEnumeratedHeader( - CompleteEnumeratedHeader&& x); - RTPS_DllAPI CompleteEnumeratedHeader& operator =( - const CompleteEnumeratedHeader& x); - RTPS_DllAPI CompleteEnumeratedHeader& operator =( - CompleteEnumeratedHeader&& x); - - RTPS_DllAPI inline void common( - const CommonEnumeratedHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonEnumeratedHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonEnumeratedHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonEnumeratedHeader& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteEnumeratedHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteEnumeratedHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalEnumeratedHeader { - CommonEnumeratedHeader common; - };*/ -class MinimalEnumeratedHeader -{ -public: - - RTPS_DllAPI MinimalEnumeratedHeader(); - RTPS_DllAPI ~MinimalEnumeratedHeader(); - RTPS_DllAPI MinimalEnumeratedHeader( - const MinimalEnumeratedHeader& x); - RTPS_DllAPI MinimalEnumeratedHeader( - MinimalEnumeratedHeader&& x); - RTPS_DllAPI MinimalEnumeratedHeader& operator =( - const MinimalEnumeratedHeader& x); - RTPS_DllAPI MinimalEnumeratedHeader& operator =( - MinimalEnumeratedHeader&& x); - - RTPS_DllAPI inline void common( - const CommonEnumeratedHeader& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonEnumeratedHeader&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonEnumeratedHeader& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonEnumeratedHeader& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalEnumeratedHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalEnumeratedHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedHeader m_common; -}; - -// Enumerated type -/*struct CompleteEnumeratedType final{ - EnumTypeFlag enum_flags; // unused - CompleteEnumeratedHeader header; - CompleteEnumeratedLiteralSeq literal_seq; - };*/ -class CompleteEnumeratedType -{ -public: - - RTPS_DllAPI CompleteEnumeratedType(); - RTPS_DllAPI ~CompleteEnumeratedType(); - RTPS_DllAPI CompleteEnumeratedType( - const CompleteEnumeratedType& x); - RTPS_DllAPI CompleteEnumeratedType( - CompleteEnumeratedType&& x); - RTPS_DllAPI CompleteEnumeratedType& operator =( - const CompleteEnumeratedType& x); - RTPS_DllAPI CompleteEnumeratedType& operator =( - CompleteEnumeratedType&& x); - - RTPS_DllAPI inline void enum_flags( - const EnumTypeFlag& _enum_flags) - { - m_enum_flags = _enum_flags; - } - - RTPS_DllAPI inline void enum_flags( - EnumTypeFlag&& _enum_flags) - { - m_enum_flags = std::move(_enum_flags); - } - - RTPS_DllAPI inline const EnumTypeFlag& enum_flags() const - { - return m_enum_flags; - } - - RTPS_DllAPI inline EnumTypeFlag& enum_flags() - { - return m_enum_flags; - } - - RTPS_DllAPI inline void header( - const CompleteEnumeratedHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteEnumeratedHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteEnumeratedHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteEnumeratedHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void literal_seq( - const CompleteEnumeratedLiteralSeq& _literal_seq) - { - m_literal_seq = _literal_seq; - } - - RTPS_DllAPI inline void literal_seq( - CompleteEnumeratedLiteralSeq&& _literal_seq) - { - m_literal_seq = std::move(_literal_seq); - } - - RTPS_DllAPI inline const CompleteEnumeratedLiteralSeq& literal_seq() const - { - return m_literal_seq; - } - - RTPS_DllAPI inline CompleteEnumeratedLiteralSeq& literal_seq() - { - return m_literal_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteEnumeratedType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteEnumeratedType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteEnumeratedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EnumTypeFlag m_enum_flags; - CompleteEnumeratedHeader m_header; - CompleteEnumeratedLiteralSeq m_literal_seq; -}; -// Enumerated type -/*struct MinimalEnumeratedType final{ - EnumTypeFlag enum_flags; // unused - MinimalEnumeratedHeader header; - MinimalEnumeratedLiteralSeq literal_seq; - };*/ -class MinimalEnumeratedType -{ -public: - - RTPS_DllAPI MinimalEnumeratedType(); - RTPS_DllAPI ~MinimalEnumeratedType(); - RTPS_DllAPI MinimalEnumeratedType( - const MinimalEnumeratedType& x); - RTPS_DllAPI MinimalEnumeratedType( - MinimalEnumeratedType&& x); - RTPS_DllAPI MinimalEnumeratedType& operator =( - const MinimalEnumeratedType& x); - RTPS_DllAPI MinimalEnumeratedType& operator =( - MinimalEnumeratedType&& x); - - RTPS_DllAPI inline void enum_flags( - const EnumTypeFlag& _enum_flags) - { - m_enum_flags = _enum_flags; - } - - RTPS_DllAPI inline void enum_flags( - EnumTypeFlag&& _enum_flags) - { - m_enum_flags = std::move(_enum_flags); - } - - RTPS_DllAPI inline const EnumTypeFlag& enum_flags() const - { - return m_enum_flags; - } - - RTPS_DllAPI inline EnumTypeFlag& enum_flags() - { - return m_enum_flags; - } - - RTPS_DllAPI inline void header( - const MinimalEnumeratedHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalEnumeratedHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalEnumeratedHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalEnumeratedHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void literal_seq( - const MinimalEnumeratedLiteralSeq& _literal_seq) - { - m_literal_seq = _literal_seq; - } - - RTPS_DllAPI inline void literal_seq( - MinimalEnumeratedLiteralSeq&& _literal_seq) - { - m_literal_seq = std::move(_literal_seq); - } - - RTPS_DllAPI inline const MinimalEnumeratedLiteralSeq& literal_seq() const - { - return m_literal_seq; - } - - RTPS_DllAPI inline MinimalEnumeratedLiteralSeq& literal_seq() - { - return m_literal_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalEnumeratedType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalEnumeratedType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalEnumeratedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EnumTypeFlag m_enum_flags; - MinimalEnumeratedHeader m_header; - MinimalEnumeratedLiteralSeq m_literal_seq; -}; - -// --- Bitmask: ------------------------------------------------------- -// Bit in a bit mask -/*struct CommonBitflag final{ - uint16_t position; - BitflagFlag flags; - };*/ -class CommonBitflag final -{ -public: - - RTPS_DllAPI CommonBitflag(); - RTPS_DllAPI ~CommonBitflag(); - RTPS_DllAPI CommonBitflag( - const CommonBitflag& x); - RTPS_DllAPI CommonBitflag( - CommonBitflag&& x); - RTPS_DllAPI CommonBitflag& operator =( - const CommonBitflag& x); - RTPS_DllAPI CommonBitflag& operator =( - CommonBitflag&& x); - - RTPS_DllAPI inline void position( - const uint16_t& _position) - { - m_position = _position; - } - - RTPS_DllAPI inline void position( - uint16_t&& _position) - { - m_position = std::move(_position); - } - - RTPS_DllAPI inline const uint16_t& position() const - { - return m_position; - } - - RTPS_DllAPI inline uint16_t& position() - { - return m_position; - } - - RTPS_DllAPI inline void flags( - const BitflagFlag& _flags) - { - m_flags = _flags; - } - - RTPS_DllAPI inline void flags( - BitflagFlag&& _flags) - { - m_flags = std::move(_flags); - } - - RTPS_DllAPI inline const BitflagFlag& flags() const - { - return m_flags; - } - - RTPS_DllAPI inline BitflagFlag& flags() - { - return m_flags; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonBitflag& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonBitflag& other) const; - - RTPS_DllAPI bool consistent( - const CommonBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint16_t m_position; - BitflagFlag m_flags; -}; - -/*struct CompleteBitflag { - CommonBitflag common; - CompleteMemberDetail detail; - };*/ -class CompleteBitflag -{ -public: - - RTPS_DllAPI CompleteBitflag(); - RTPS_DllAPI ~CompleteBitflag(); - RTPS_DllAPI CompleteBitflag( - const CompleteBitflag& x); - RTPS_DllAPI CompleteBitflag( - CompleteBitflag&& x); - RTPS_DllAPI CompleteBitflag& operator =( - const CompleteBitflag& x); - RTPS_DllAPI CompleteBitflag& operator =( - CompleteBitflag&& x); - - RTPS_DllAPI inline void common( - const CommonBitflag& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonBitflag&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonBitflag& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonBitflag& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteBitflag& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteBitflag& other) const; - - RTPS_DllAPI bool consistent( - const CompleteBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitflag m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by Bitflag.position -typedef std::vector CompleteBitflagSeq; -/*struct MinimalBitflag { - CommonBitflag common; - MinimalMemberDetail detail; - };*/ -class MinimalBitflag -{ -public: - - RTPS_DllAPI MinimalBitflag(); - RTPS_DllAPI ~MinimalBitflag(); - RTPS_DllAPI MinimalBitflag( - const MinimalBitflag& x); - RTPS_DllAPI MinimalBitflag( - MinimalBitflag&& x); - RTPS_DllAPI MinimalBitflag& operator =( - const MinimalBitflag& x); - RTPS_DllAPI MinimalBitflag& operator =( - MinimalBitflag&& x); - - RTPS_DllAPI inline void common( - const CommonBitflag& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonBitflag&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonBitflag& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonBitflag& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline MinimalMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalBitflag& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalBitflag& other) const; - - RTPS_DllAPI bool consistent( - const MinimalBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitflag m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by Bitflag.position -typedef std::vector MinimalBitflagSeq; - -/*struct CommonBitmaskHeader final{ - BitBound bit_bound; - };*/ -class CommonBitmaskHeader final -{ -public: - - RTPS_DllAPI CommonBitmaskHeader(); - RTPS_DllAPI ~CommonBitmaskHeader(); - RTPS_DllAPI CommonBitmaskHeader( - const CommonBitmaskHeader& x); - RTPS_DllAPI CommonBitmaskHeader( - CommonBitmaskHeader&& x); - RTPS_DllAPI CommonBitmaskHeader& operator =( - const CommonBitmaskHeader& x); - RTPS_DllAPI CommonBitmaskHeader& operator =( - CommonBitmaskHeader&& x); - - RTPS_DllAPI inline void bit_bound( - const BitBound& _bit_bound) - { - m_bit_bound = _bit_bound; - } - - RTPS_DllAPI inline void bit_bound( - BitBound&& _bit_bound) - { - m_bit_bound = std::move(_bit_bound); - } - - RTPS_DllAPI inline const BitBound& bit_bound() const - { - return m_bit_bound; - } - - RTPS_DllAPI inline BitBound& bit_bound() - { - return m_bit_bound; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonBitmaskHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonBitmaskHeader& other) const; - - RTPS_DllAPI bool consistent( - const CommonBitmaskHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitBound m_bit_bound; -}; -typedef CompleteEnumeratedHeader CompleteBitmaskHeader; - -typedef MinimalEnumeratedHeader MinimalBitmaskHeader; -/*struct CompleteBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - CompleteBitmaskHeader header; - CompleteBitflagSeq flag_seq; - };*/ -class CompleteBitmaskType -{ -public: - - RTPS_DllAPI CompleteBitmaskType(); - RTPS_DllAPI ~CompleteBitmaskType(); - RTPS_DllAPI CompleteBitmaskType( - const CompleteBitmaskType& x); - RTPS_DllAPI CompleteBitmaskType( - CompleteBitmaskType&& x); - RTPS_DllAPI CompleteBitmaskType& operator =( - const CompleteBitmaskType& x); - RTPS_DllAPI CompleteBitmaskType& operator =( - CompleteBitmaskType&& x); - - RTPS_DllAPI inline void bitmask_flags( - const BitmaskTypeFlag& _bitmask_flags) - { - m_bitmask_flags = _bitmask_flags; - } - - RTPS_DllAPI inline void bitmask_flags( - BitmaskTypeFlag&& _bitmask_flags) - { - m_bitmask_flags = std::move(_bitmask_flags); - } - - RTPS_DllAPI inline const BitmaskTypeFlag& bitmask_flags() const - { - return m_bitmask_flags; - } - - RTPS_DllAPI inline BitmaskTypeFlag& bitmask_flags() - { - return m_bitmask_flags; - } - - RTPS_DllAPI inline void header( - const CompleteBitmaskHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteBitmaskHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteBitmaskHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteBitmaskHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void flag_seq( - const CompleteBitflagSeq& _flag_seq) - { - m_flag_seq = _flag_seq; - } - - RTPS_DllAPI inline void flag_seq( - CompleteBitflagSeq&& _flag_seq) - { - m_flag_seq = std::move(_flag_seq); - } - - RTPS_DllAPI inline const CompleteBitflagSeq& flag_seq() const - { - return m_flag_seq; - } - - RTPS_DllAPI inline CompleteBitflagSeq& flag_seq() - { - return m_flag_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteBitmaskType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteBitmaskType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteBitmaskType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitmaskTypeFlag m_bitmask_flags; - CompleteBitmaskHeader m_header; - CompleteBitflagSeq m_flag_seq; -}; - -/*struct MinimalBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - MinimalBitmaskHeader header; - MinimalBitflagSeq flag_seq; - };*/ -class MinimalBitmaskType -{ -public: - - RTPS_DllAPI MinimalBitmaskType(); - RTPS_DllAPI ~MinimalBitmaskType(); - RTPS_DllAPI MinimalBitmaskType( - const MinimalBitmaskType& x); - RTPS_DllAPI MinimalBitmaskType( - MinimalBitmaskType&& x); - RTPS_DllAPI MinimalBitmaskType& operator =( - const MinimalBitmaskType& x); - RTPS_DllAPI MinimalBitmaskType& operator =( - MinimalBitmaskType&& x); - - RTPS_DllAPI inline void bitmask_flags( - const BitmaskTypeFlag& _bitmask_flags) - { - m_bitmask_flags = _bitmask_flags; - } - - RTPS_DllAPI inline void bitmask_flags( - BitmaskTypeFlag&& _bitmask_flags) - { - m_bitmask_flags = std::move(_bitmask_flags); - } - - RTPS_DllAPI inline const BitmaskTypeFlag& bitmask_flags() const - { - return m_bitmask_flags; - } - - RTPS_DllAPI inline BitmaskTypeFlag& bitmask_flags() - { - return m_bitmask_flags; - } - - RTPS_DllAPI inline void header( - const MinimalBitmaskHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalBitmaskHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalBitmaskHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalBitmaskHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void flag_seq( - const MinimalBitflagSeq& _flag_seq) - { - m_flag_seq = _flag_seq; - } - - RTPS_DllAPI inline void flag_seq( - MinimalBitflagSeq&& _flag_seq) - { - m_flag_seq = std::move(_flag_seq); - } - - RTPS_DllAPI inline const MinimalBitflagSeq& flag_seq() const - { - return m_flag_seq; - } - - RTPS_DllAPI inline MinimalBitflagSeq& flag_seq() - { - return m_flag_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalBitmaskType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalBitmaskType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalBitmaskType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitmaskTypeFlag m_bitmask_flags; - MinimalBitmaskHeader m_header; - MinimalBitflagSeq m_flag_seq; -}; - -// --- Bitset: --------------------------------------------------------- -/*struct CommonBitfield final{ - uint16_t position; - BitsetMemberFlag flags; - octet bitcount; - TypeKind holder_type; // Must be primitive integer type - };*/ -class CommonBitfield final -{ -public: - - RTPS_DllAPI CommonBitfield(); - RTPS_DllAPI ~CommonBitfield(); - RTPS_DllAPI CommonBitfield( - const CommonBitfield& x); - RTPS_DllAPI CommonBitfield( - CommonBitfield&& x); - RTPS_DllAPI CommonBitfield& operator =( - const CommonBitfield& x); - RTPS_DllAPI CommonBitfield& operator =( - CommonBitfield&& x); - - RTPS_DllAPI inline void position( - const uint16_t& _position) - { - m_position = _position; - } - - RTPS_DllAPI inline void position( - uint16_t&& _position) - { - m_position = std::move(_position); - } - - RTPS_DllAPI inline const uint16_t& position() const - { - return m_position; - } - - RTPS_DllAPI inline uint16_t& position() - { - return m_position; - } - - RTPS_DllAPI inline void flags( - const BitsetMemberFlag& _flags) - { - m_flags = _flags; - } - - RTPS_DllAPI inline void flags( - BitsetMemberFlag&& _flags) - { - m_flags = std::move(_flags); - } - - RTPS_DllAPI inline const BitsetMemberFlag& flags() const - { - return m_flags; - } - - RTPS_DllAPI inline BitsetMemberFlag& flags() - { - return m_flags; - } - - RTPS_DllAPI inline void bitcount( - const octet& _bitcount) - { - m_bitcount = _bitcount; - } - - RTPS_DllAPI inline void bitcount( - octet&& _bitcount) - { - m_bitcount = std::move(_bitcount); - } - - RTPS_DllAPI inline const octet& bitcount() const - { - return m_bitcount; - } - - RTPS_DllAPI inline octet& bitcount() - { - return m_bitcount; - } - - RTPS_DllAPI inline void holder_type( - const TypeKind& _holder_type) - { - m_holder_type = _holder_type; - } - - RTPS_DllAPI inline void holder_type( - TypeKind&& _holder_type) - { - m_holder_type = std::move(_holder_type); - } - - RTPS_DllAPI inline const TypeKind& holder_type() const - { - return m_holder_type; - } - - RTPS_DllAPI inline TypeKind& holder_type() - { - return m_holder_type; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CommonBitfield& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CommonBitfield& other) const; - - RTPS_DllAPI bool consistent( - const CommonBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint16_t m_position; - BitsetMemberFlag m_flags; - octet m_bitcount; - TypeKind m_holder_type; -}; - -/*struct CompleteBitfield { - CommonBitfield common; - CompleteMemberDetail detail; - };*/ -class CompleteBitfield -{ -public: - - RTPS_DllAPI CompleteBitfield(); - RTPS_DllAPI ~CompleteBitfield(); - RTPS_DllAPI CompleteBitfield( - const CompleteBitfield& x); - RTPS_DllAPI CompleteBitfield( - CompleteBitfield&& x); - RTPS_DllAPI CompleteBitfield& operator =( - const CompleteBitfield& x); - RTPS_DllAPI CompleteBitfield& operator =( - CompleteBitfield&& x); - - RTPS_DllAPI inline void common( - const CommonBitfield& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonBitfield&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonBitfield& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonBitfield& common() - { - return m_common; - } - - RTPS_DllAPI inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteMemberDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfield::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteBitfield& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfield::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfielddeserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteBitfield& other) const; - - RTPS_DllAPI bool consistent( - const CompleteBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitfield m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by Bitfield.position -typedef std::vector CompleteBitfieldSeq; -/*struct MinimalBitfield { - CommonBitfield common; - NameHash name_hash; - };*/ -class MinimalBitfield -{ -public: - - RTPS_DllAPI MinimalBitfield(); - RTPS_DllAPI ~MinimalBitfield(); - RTPS_DllAPI MinimalBitfield( - const MinimalBitfield& x); - RTPS_DllAPI MinimalBitfield( - MinimalBitfield&& x); - RTPS_DllAPI MinimalBitfield& operator =( - const MinimalBitfield& x); - RTPS_DllAPI MinimalBitfield& operator =( - MinimalBitfield&& x); - - RTPS_DllAPI inline void name_hash( - const NameHash& _name_hash) - { - m_name_hash = _name_hash; - } - - RTPS_DllAPI inline void name_hash( - NameHash&& _name_hash) - { - m_name_hash = std::move(_name_hash); - } - - RTPS_DllAPI inline const NameHash& name_hash() const - { - return m_name_hash; - } - - RTPS_DllAPI inline NameHash& name_hash() - { - return m_name_hash; - } - - RTPS_DllAPI inline void common( - const CommonBitfield& _common) - { - m_common = _common; - } - - RTPS_DllAPI inline void common( - CommonBitfield&& _common) - { - m_common = std::move(_common); - } - - RTPS_DllAPI inline const CommonBitfield& common() const - { - return m_common; - } - - RTPS_DllAPI inline CommonBitfield& common() - { - return m_common; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalBitfield& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalBitfield& other) const; - - RTPS_DllAPI bool consistent( - const MinimalBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitfield m_common; - NameHash m_name_hash; -}; -// Ordered by Bitfield.position -typedef std::vector MinimalBitfieldSeq; -/*struct CompleteBitsetHeader { - CompleteTypeDetail detail; - };*/ -class CompleteBitsetHeader -{ -public: - - RTPS_DllAPI CompleteBitsetHeader(); - RTPS_DllAPI ~CompleteBitsetHeader(); - RTPS_DllAPI CompleteBitsetHeader( - const CompleteBitsetHeader& x); - RTPS_DllAPI CompleteBitsetHeader( - CompleteBitsetHeader&& x); - RTPS_DllAPI CompleteBitsetHeader& operator =( - const CompleteBitsetHeader& x); - RTPS_DllAPI CompleteBitsetHeader& operator =( - CompleteBitsetHeader&& x); - - RTPS_DllAPI inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - RTPS_DllAPI inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - RTPS_DllAPI inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - RTPS_DllAPI inline TypeIdentifier& base_type() - { - return m_base_type; - } - - RTPS_DllAPI inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - RTPS_DllAPI inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - RTPS_DllAPI inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - RTPS_DllAPI inline CompleteTypeDetail& detail() - { - return m_detail; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteBitsetHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteBitsetHeader& other) const; - - RTPS_DllAPI bool consistent( - const CompleteBitsetHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalBitsetHeader { - // Empty. Available for future extension - };*/ -class MinimalBitsetHeader -{ -public: - - RTPS_DllAPI MinimalBitsetHeader(); - RTPS_DllAPI ~MinimalBitsetHeader(); - RTPS_DllAPI MinimalBitsetHeader( - const MinimalBitsetHeader& x); - RTPS_DllAPI MinimalBitsetHeader( - MinimalBitsetHeader&& x); - RTPS_DllAPI MinimalBitsetHeader& operator =( - const MinimalBitsetHeader& x); - RTPS_DllAPI MinimalBitsetHeader& operator =( - MinimalBitsetHeader&& x); - - RTPS_DllAPI inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - RTPS_DllAPI inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - RTPS_DllAPI inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - RTPS_DllAPI inline TypeIdentifier& base_type() - { - return m_base_type; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalBitsetHeader& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalBitsetHeader& other) const; - - RTPS_DllAPI bool consistent( - const MinimalBitsetHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; -}; -/*struct CompleteBitsetType { - BitsetTypeFlag bitset_flags; // unused - CompleteBitsetHeader header; - CompleteBitfieldSeq field_seq; - };*/ -class CompleteBitsetType -{ -public: - - RTPS_DllAPI CompleteBitsetType(); - RTPS_DllAPI ~CompleteBitsetType(); - RTPS_DllAPI CompleteBitsetType( - const CompleteBitsetType& x); - RTPS_DllAPI CompleteBitsetType( - CompleteBitsetType&& x); - RTPS_DllAPI CompleteBitsetType& operator =( - const CompleteBitsetType& x); - RTPS_DllAPI CompleteBitsetType& operator =( - CompleteBitsetType&& x); - - RTPS_DllAPI inline void bitset_flags( - const BitsetTypeFlag& _bitset_flags) - { - m_bitset_flags = _bitset_flags; - } - - RTPS_DllAPI inline void bitset_flags( - BitsetTypeFlag&& _bitset_flags) - { - m_bitset_flags = std::move(_bitset_flags); - } - - RTPS_DllAPI inline const BitsetTypeFlag& bitset_flags() const - { - return m_bitset_flags; - } - - RTPS_DllAPI inline BitsetTypeFlag& bitset_flags() - { - return m_bitset_flags; - } - - RTPS_DllAPI inline void header( - const CompleteBitsetHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - CompleteBitsetHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const CompleteBitsetHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline CompleteBitsetHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void field_seq( - const CompleteBitfieldSeq& _field_seq) - { - m_field_seq = _field_seq; - } - - RTPS_DllAPI inline void field_seq( - CompleteBitfieldSeq&& _field_seq) - { - m_field_seq = std::move(_field_seq); - } - - RTPS_DllAPI inline const CompleteBitfieldSeq& field_seq() const - { - return m_field_seq; - } - - RTPS_DllAPI inline CompleteBitfieldSeq& field_seq() - { - return m_field_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteBitsetType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteBitsetType& other) const; - - RTPS_DllAPI bool consistent( - const CompleteBitsetType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitsetTypeFlag m_bitset_flags; - CompleteBitsetHeader m_header; - CompleteBitfieldSeq m_field_seq; -}; - -/*struct MinimalBitsetType { - BitsetTypeFlag bitset_flags; // unused - MinimalBitsetHeader header; - MinimalBitfieldSeq field_seq; - };*/ -class MinimalBitsetType -{ -public: - - RTPS_DllAPI MinimalBitsetType(); - RTPS_DllAPI ~MinimalBitsetType(); - RTPS_DllAPI MinimalBitsetType( - const MinimalBitsetType& x); - RTPS_DllAPI MinimalBitsetType( - MinimalBitsetType&& x); - RTPS_DllAPI MinimalBitsetType& operator =( - const MinimalBitsetType& x); - RTPS_DllAPI MinimalBitsetType& operator =( - MinimalBitsetType&& x); - - RTPS_DllAPI inline void bitset_flags( - const BitsetTypeFlag& _bitset_flags) - { - m_bitset_flags = _bitset_flags; - } - - RTPS_DllAPI inline void bitset_flags( - BitsetTypeFlag&& _bitset_flags) - { - m_bitset_flags = std::move(_bitset_flags); - } - - RTPS_DllAPI inline const BitsetTypeFlag& bitset_flags() const - { - return m_bitset_flags; - } - - RTPS_DllAPI inline BitsetTypeFlag& bitset_flags() - { - return m_bitset_flags; - } - - RTPS_DllAPI inline void header( - const MinimalBitsetHeader& _header) - { - m_header = _header; - } - - RTPS_DllAPI inline void header( - MinimalBitsetHeader&& _header) - { - m_header = std::move(_header); - } - - RTPS_DllAPI inline const MinimalBitsetHeader& header() const - { - return m_header; - } - - RTPS_DllAPI inline MinimalBitsetHeader& header() - { - return m_header; - } - - RTPS_DllAPI inline void field_seq( - const MinimalBitfieldSeq& _field_seq) - { - m_field_seq = _field_seq; - } - - RTPS_DllAPI inline void field_seq( - MinimalBitfieldSeq&& _field_seq) - { - m_field_seq = std::move(_field_seq); - } - - RTPS_DllAPI inline const MinimalBitfieldSeq& field_seq() const - { - return m_field_seq; - } - - RTPS_DllAPI inline MinimalBitfieldSeq& field_seq() - { - return m_field_seq; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalBitsetType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalBitsetType& other) const; - - RTPS_DllAPI bool consistent( - const MinimalBitsetType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitsetTypeFlag m_bitset_flags; - MinimalBitsetHeader m_header; - MinimalBitfieldSeq m_field_seq; -}; - -// --- Type Object: -------------------------------------------------- -// The types associated with each case selection must have extensibility -// kind APPENDABLE or MUTABLE so that they can be extended in the future - -/*struct CompleteExtendedType { - // Empty. Available for future extension - };*/ -class CompleteExtendedType -{ -public: - - RTPS_DllAPI CompleteExtendedType(); - RTPS_DllAPI ~CompleteExtendedType(); - RTPS_DllAPI CompleteExtendedType( - const CompleteExtendedType& x); - RTPS_DllAPI CompleteExtendedType( - CompleteExtendedType&& x); - RTPS_DllAPI CompleteExtendedType& operator =( - const CompleteExtendedType& x); - RTPS_DllAPI CompleteExtendedType& operator =( - CompleteExtendedType&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteExtendedType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteExtendedType&) const - { - return true; - } - - RTPS_DllAPI bool consistent( - const CompleteExtendedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct MinimalExtendedType { - // Empty. Available for future extension - };*/ -class MinimalExtendedType -{ -public: - - RTPS_DllAPI MinimalExtendedType(); - RTPS_DllAPI ~MinimalExtendedType(); - RTPS_DllAPI MinimalExtendedType( - const MinimalExtendedType& x); - RTPS_DllAPI MinimalExtendedType( - MinimalExtendedType&& x); - RTPS_DllAPI MinimalExtendedType& operator =( - const MinimalExtendedType& x); - RTPS_DllAPI MinimalExtendedType& operator =( - MinimalExtendedType&& x); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalExtendedType& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalExtendedType&) const - { - return true; - } - - RTPS_DllAPI bool consistent( - const MinimalExtendedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -class CompleteTypeObject final -{ -public: - - RTPS_DllAPI CompleteTypeObject(); - RTPS_DllAPI ~CompleteTypeObject(); - RTPS_DllAPI CompleteTypeObject( - const CompleteTypeObject& x); - RTPS_DllAPI CompleteTypeObject( - CompleteTypeObject&& x); - RTPS_DllAPI CompleteTypeObject& operator =( - const CompleteTypeObject& x); - RTPS_DllAPI CompleteTypeObject& operator =( - CompleteTypeObject&& x); - RTPS_DllAPI void _d( - octet __d); - RTPS_DllAPI octet _d() const; - RTPS_DllAPI octet& _d(); - - RTPS_DllAPI void alias_type( - CompleteAliasType _alias_type); - RTPS_DllAPI const CompleteAliasType& alias_type() const; - RTPS_DllAPI CompleteAliasType& alias_type(); - - RTPS_DllAPI void annotation_type( - CompleteAnnotationType _annotation_type); - RTPS_DllAPI const CompleteAnnotationType& annotation_type() const; - RTPS_DllAPI CompleteAnnotationType& annotation_type(); - - RTPS_DllAPI void struct_type( - CompleteStructType _struct_type); - RTPS_DllAPI const CompleteStructType& struct_type() const; - RTPS_DllAPI CompleteStructType& struct_type(); - - RTPS_DllAPI void union_type( - CompleteUnionType _union_type); - RTPS_DllAPI const CompleteUnionType& union_type() const; - RTPS_DllAPI CompleteUnionType& union_type(); - - RTPS_DllAPI void bitset_type( - CompleteBitsetType _bitset_type); - RTPS_DllAPI const CompleteBitsetType& bitset_type() const; - RTPS_DllAPI CompleteBitsetType& bitset_type(); - - RTPS_DllAPI void sequence_type( - CompleteSequenceType _sequence_type); - RTPS_DllAPI const CompleteSequenceType& sequence_type() const; - RTPS_DllAPI CompleteSequenceType& sequence_type(); - - RTPS_DllAPI void array_type( - CompleteArrayType _array_type); - RTPS_DllAPI const CompleteArrayType& array_type() const; - RTPS_DllAPI CompleteArrayType& array_type(); - - RTPS_DllAPI void map_type( - CompleteMapType _map_type); - RTPS_DllAPI const CompleteMapType& map_type() const; - RTPS_DllAPI CompleteMapType& map_type(); - - RTPS_DllAPI void enumerated_type( - CompleteEnumeratedType _enumerated_type); - RTPS_DllAPI const CompleteEnumeratedType& enumerated_type() const; - RTPS_DllAPI CompleteEnumeratedType& enumerated_type(); - - RTPS_DllAPI void bitmask_type( - CompleteBitmaskType _bitmask_type); - RTPS_DllAPI const CompleteBitmaskType& bitmask_type() const; - RTPS_DllAPI CompleteBitmaskType& bitmask_type(); - - RTPS_DllAPI void extended_type( - CompleteExtendedType _extended_type); - RTPS_DllAPI const CompleteExtendedType& extended_type() const; - RTPS_DllAPI CompleteExtendedType& extended_type(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const CompleteTypeObject& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const CompleteTypeObject& other) const; - - RTPS_DllAPI bool consistent( - const CompleteTypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - octet m__d; - - CompleteAliasType m_alias_type; - CompleteAnnotationType m_annotation_type; - CompleteStructType m_struct_type; - CompleteUnionType m_union_type; - CompleteBitsetType m_bitset_type; - CompleteSequenceType m_sequence_type; - CompleteArrayType m_array_type; - CompleteMapType m_map_type; - CompleteEnumeratedType m_enumerated_type; - CompleteBitmaskType m_bitmask_type; - CompleteExtendedType m_extended_type; -}; - -class MinimalTypeObject final -{ -public: - - RTPS_DllAPI MinimalTypeObject(); - RTPS_DllAPI ~MinimalTypeObject(); - RTPS_DllAPI MinimalTypeObject( - const MinimalTypeObject& x); - RTPS_DllAPI MinimalTypeObject( - MinimalTypeObject&& x); - RTPS_DllAPI MinimalTypeObject& operator =( - const MinimalTypeObject& x); - RTPS_DllAPI MinimalTypeObject& operator =( - MinimalTypeObject&& x); - RTPS_DllAPI void _d( - octet __d); - RTPS_DllAPI octet _d() const; - RTPS_DllAPI octet& _d(); - - RTPS_DllAPI void alias_type( - MinimalAliasType _alias_type); - RTPS_DllAPI const MinimalAliasType& alias_type() const; - RTPS_DllAPI MinimalAliasType& alias_type(); - - RTPS_DllAPI void annotation_type( - MinimalAnnotationType _annotation_type); - RTPS_DllAPI const MinimalAnnotationType& annotation_type() const; - RTPS_DllAPI MinimalAnnotationType& annotation_type(); - - RTPS_DllAPI void struct_type( - MinimalStructType _struct_type); - RTPS_DllAPI const MinimalStructType& struct_type() const; - RTPS_DllAPI MinimalStructType& struct_type(); - - RTPS_DllAPI void union_type( - MinimalUnionType _union_type); - RTPS_DllAPI const MinimalUnionType& union_type() const; - RTPS_DllAPI MinimalUnionType& union_type(); - - RTPS_DllAPI void bitset_type( - MinimalBitsetType _bitset_type); - RTPS_DllAPI const MinimalBitsetType& bitset_type() const; - RTPS_DllAPI MinimalBitsetType& bitset_type(); - - RTPS_DllAPI void sequence_type( - MinimalSequenceType _sequence_type); - RTPS_DllAPI const MinimalSequenceType& sequence_type() const; - RTPS_DllAPI MinimalSequenceType& sequence_type(); - - RTPS_DllAPI void array_type( - MinimalArrayType _array_type); - RTPS_DllAPI const MinimalArrayType& array_type() const; - RTPS_DllAPI MinimalArrayType& array_type(); - - RTPS_DllAPI void map_type( - MinimalMapType _map_type); - RTPS_DllAPI const MinimalMapType& map_type() const; - RTPS_DllAPI MinimalMapType& map_type(); - - RTPS_DllAPI void enumerated_type( - MinimalEnumeratedType _enumerated_type); - RTPS_DllAPI const MinimalEnumeratedType& enumerated_type() const; - RTPS_DllAPI MinimalEnumeratedType& enumerated_type(); - - RTPS_DllAPI void bitmask_type( - MinimalBitmaskType _bitmask_type); - RTPS_DllAPI const MinimalBitmaskType& bitmask_type() const; - RTPS_DllAPI MinimalBitmaskType& bitmask_type(); - - RTPS_DllAPI void extended_type( - MinimalExtendedType _extended_type); - RTPS_DllAPI const MinimalExtendedType& extended_type() const; - RTPS_DllAPI MinimalExtendedType& extended_type(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const MinimalTypeObject& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const MinimalTypeObject& other) const; - - RTPS_DllAPI bool consistent( - const MinimalTypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - octet m__d; - - MinimalAliasType m_alias_type; - MinimalAnnotationType m_annotation_type; - MinimalStructType m_struct_type; - MinimalUnionType m_union_type; - MinimalBitsetType m_bitset_type; - MinimalSequenceType m_sequence_type; - MinimalArrayType m_array_type; - MinimalMapType m_map_type; - MinimalEnumeratedType m_enumerated_type; - MinimalBitmaskType m_bitmask_type; - MinimalExtendedType m_extended_type; -}; -class TypeObject -{ -public: - - /*! - * @brief Default constructor. - */ - RTPS_DllAPI TypeObject(); - - /*! - * @brief Default destructor. - */ - RTPS_DllAPI ~TypeObject(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeObject that will be copied. - */ - RTPS_DllAPI TypeObject( - const TypeObject& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeObject that will be copied. - */ - RTPS_DllAPI TypeObject( - TypeObject&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeObject that will be copied. - */ - RTPS_DllAPI TypeObject& operator =( - const TypeObject& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeObject that will be copied. - */ - RTPS_DllAPI TypeObject& operator =( - TypeObject&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - RTPS_DllAPI void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - RTPS_DllAPI uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - RTPS_DllAPI uint8_t& _d(); - - /*! - * @brief This function copies the value in member complete - * @param _complete New value to be copied in member complete - */ - RTPS_DllAPI void complete( - const CompleteTypeObject& _complete); - - /*! - * @brief This function moves the value in member complete - * @param _complete New value to be moved in member complete - */ - RTPS_DllAPI void complete( - CompleteTypeObject&& _complete); - - /*! - * @brief This function returns a constant reference to member complete - * @return Constant reference to member complete - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const CompleteTypeObject& complete() const; - - /*! - * @brief This function returns a reference to member complete - * @return Reference to member complete - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI CompleteTypeObject& complete(); - /*! - * @brief This function copies the value in member minimal - * @param _minimal New value to be copied in member minimal - */ - RTPS_DllAPI void minimal( - const MinimalTypeObject& _minimal); - - /*! - * @brief This function moves the value in member minimal - * @param _minimal New value to be moved in member minimal - */ - RTPS_DllAPI void minimal( - MinimalTypeObject&& _minimal); - - /*! - * @brief This function returns a constant reference to member minimal - * @return Constant reference to member minimal - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI const MinimalTypeObject& minimal() const; - - /*! - * @brief This function returns a reference to member minimal - * @return Reference to member minimal - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - RTPS_DllAPI MinimalTypeObject& minimal(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeObject& data, - size_t current_alignment = 0); - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - RTPS_DllAPI bool operator ==( - const TypeObject& other) const; - - /*! - * @brief This function check type consistency enforcement with the given TypeObject x. - * @param x TypeObject to check if can be assigned to the current instance. - * @param consistency fastdds::dds::TypeConsistencyEnforcementQoSPolicy to apply. - */ - RTPS_DllAPI bool consistent( - const TypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint8_t m__d; - - CompleteTypeObject m_complete; - MinimalTypeObject m_minimal; -}; - -typedef std::vector TypeObjectSeq; - -// Set of TypeObjects representing a strong component: Equivalence class -// for the Strong Connectivity relationship (mutual reachability between -// types). -// Ordered by fully qualified typename lexicographic order -typedef TypeObjectSeq StronglyConnectedComponent; - -/*struct TypeIdentifierTypeObjectPair final { - TypeIdentifier type_identifier; - TypeObject type_object; - };*/ -class TypeIdentifierTypeObjectPair final -{ -public: - - RTPS_DllAPI TypeIdentifierTypeObjectPair(); - RTPS_DllAPI ~TypeIdentifierTypeObjectPair(); - RTPS_DllAPI TypeIdentifierTypeObjectPair( - const TypeIdentifierTypeObjectPair& x); - RTPS_DllAPI TypeIdentifierTypeObjectPair( - TypeIdentifierTypeObjectPair&& x); - RTPS_DllAPI TypeIdentifierTypeObjectPair& operator =( - const TypeIdentifierTypeObjectPair& x); - RTPS_DllAPI TypeIdentifierTypeObjectPair& operator =( - TypeIdentifierTypeObjectPair&& x); - - RTPS_DllAPI inline void type_identifier( - const TypeIdentifier& _type_identifier) - { - m_type_identifier = _type_identifier; - } - - RTPS_DllAPI inline void type_identifier( - TypeIdentifier&& _type_identifier) - { - m_type_identifier = std::move(_type_identifier); - } - - RTPS_DllAPI inline const TypeIdentifier& type_identifier() const - { - return m_type_identifier; - } - - RTPS_DllAPI inline TypeIdentifier& type_identifier() - { - return m_type_identifier; - } - - RTPS_DllAPI inline void type_object( - const TypeObject& _type_object) - { - m_type_object = _type_object; - } - - RTPS_DllAPI inline void type_object( - TypeObject&& _type_object) - { - m_type_object = std::move(_type_object); - } - - RTPS_DllAPI inline const TypeObject& type_object() const - { - return m_type_object; - } - - RTPS_DllAPI inline TypeObject& type_object() - { - return m_type_object; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeIdentifierTypeObjectPair& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - -private: - - TypeIdentifier m_type_identifier; - TypeObject m_type_object; -}; -typedef std::vector TypeIdentifierTypeObjectPairSeq; - -/*struct TypeIdentifierPair final { - TypeIdentifier type_identifier1; - TypeIdentifier type_identifier2; - };*/ -class TypeIdentifierPair final -{ -public: - - RTPS_DllAPI TypeIdentifierPair(); - RTPS_DllAPI ~TypeIdentifierPair(); - RTPS_DllAPI TypeIdentifierPair( - const TypeIdentifierPair& x); - RTPS_DllAPI TypeIdentifierPair( - TypeIdentifierPair&& x); - RTPS_DllAPI TypeIdentifierPair& operator =( - const TypeIdentifierPair& x); - RTPS_DllAPI TypeIdentifierPair& operator =( - TypeIdentifierPair&& x); - - RTPS_DllAPI inline void type_identifier1( - const TypeIdentifier& _type_identifier1) - { - m_type_identifier1 = _type_identifier1; - } - - RTPS_DllAPI inline void type_identifier1( - TypeIdentifier&& _type_identifier1) - { - m_type_identifier1 = std::move(_type_identifier1); - } - - RTPS_DllAPI inline const TypeIdentifier& type_identifier1() const - { - return m_type_identifier1; - } - - RTPS_DllAPI inline TypeIdentifier& type_identifier1() - { - return m_type_identifier1; - } - - RTPS_DllAPI inline void type_identifier2( - const TypeIdentifier& _type_identifier2) - { - m_type_identifier2 = _type_identifier2; - } - - RTPS_DllAPI inline void type_identifier2( - TypeIdentifier&& _type_identifier2) - { - m_type_identifier2 = std::move(_type_identifier2); - } - - RTPS_DllAPI inline const TypeIdentifier& type_identifier2() const - { - return m_type_identifier2; - } - - RTPS_DllAPI inline TypeIdentifier& type_identifier2() - { - return m_type_identifier2; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeIdentifierPair& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - -private: - - TypeIdentifier m_type_identifier1; - TypeIdentifier m_type_identifier2; -}; - -typedef std::vector TypeIdentifierPairSeq; -/*struct TypeIdentifierWithSize { - TypeIdentifier type_id; - uint32_t typeobject_serialized_size; - };*/ -class TypeIdentifierWithSize -{ -public: - - RTPS_DllAPI TypeIdentifierWithSize(); - RTPS_DllAPI ~TypeIdentifierWithSize(); - RTPS_DllAPI TypeIdentifierWithSize( - const TypeIdentifierWithSize& x); - RTPS_DllAPI TypeIdentifierWithSize( - TypeIdentifierWithSize&& x); - RTPS_DllAPI TypeIdentifierWithSize& operator =( - const TypeIdentifierWithSize& x); - RTPS_DllAPI TypeIdentifierWithSize& operator =( - TypeIdentifierWithSize&& x); - - RTPS_DllAPI inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - RTPS_DllAPI inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - RTPS_DllAPI inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - RTPS_DllAPI inline TypeIdentifier& type_id() - { - return m_type_id; - } - - RTPS_DllAPI inline void typeobject_serialized_size( - const uint32_t& _typeobject_serialized_size) - { - m_typeobject_serialized_size = _typeobject_serialized_size; - } - - RTPS_DllAPI inline void typeobject_serialized_size( - uint32_t&& _typeobject_serialized_size) - { - m_typeobject_serialized_size = std::move(_typeobject_serialized_size); - } - - RTPS_DllAPI inline const uint32_t& typeobject_serialized_size() const - { - return m_typeobject_serialized_size; - } - - RTPS_DllAPI inline uint32_t& typeobject_serialized_size() - { - return m_typeobject_serialized_size; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeIdentifierWithSize& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - -private: - - TypeIdentifier m_type_id; - uint32_t m_typeobject_serialized_size; -}; - -typedef std::vector TypeIdentifierWithSizeSeq; - -/*struct TypeIdentifierWithDependencies { - TypeIdentifierWithSize typeid_with_size; - // The total additional types related to minimal_type - int32_t dependent_typeid_count; - TypeIdentifierWithSizeSeq dependent_typeids; - };*/ -class TypeIdentifierWithDependencies -{ -public: - - RTPS_DllAPI TypeIdentifierWithDependencies(); - RTPS_DllAPI ~TypeIdentifierWithDependencies(); - RTPS_DllAPI TypeIdentifierWithDependencies( - const TypeIdentifierWithDependencies& x); - RTPS_DllAPI TypeIdentifierWithDependencies( - TypeIdentifierWithDependencies&& x); - RTPS_DllAPI TypeIdentifierWithDependencies& operator =( - const TypeIdentifierWithDependencies& x); - RTPS_DllAPI TypeIdentifierWithDependencies& operator =( - TypeIdentifierWithDependencies&& x); - - RTPS_DllAPI inline void typeid_with_size( - const TypeIdentifierWithSize& _typeid_with_size) - { - m_typeid_with_size = _typeid_with_size; - } - - RTPS_DllAPI inline void typeid_with_size( - TypeIdentifierWithSize&& _typeid_with_size) - { - m_typeid_with_size = std::move(_typeid_with_size); - } - - RTPS_DllAPI inline const TypeIdentifierWithSize& typeid_with_size() const - { - return m_typeid_with_size; - } - - RTPS_DllAPI inline TypeIdentifierWithSize& typeid_with_size() - { - return m_typeid_with_size; - } - - RTPS_DllAPI inline void dependent_typeid_count( - const int32_t& _dependent_typeid_count) - { - m_dependent_typeid_count = _dependent_typeid_count; - } - - RTPS_DllAPI inline void dependent_typeid_count( - int32_t&& _dependent_typeid_count) - { - m_dependent_typeid_count = std::move(_dependent_typeid_count); - } - - RTPS_DllAPI inline const int32_t& dependent_typeid_count() const - { - return m_dependent_typeid_count; - } - - RTPS_DllAPI inline int32_t& dependent_typeid_count() - { - return m_dependent_typeid_count; - } - - RTPS_DllAPI inline void dependent_typeids( - const TypeIdentifierWithSizeSeq& _dependent_typeids) - { - m_dependent_typeids = _dependent_typeids; - } - - RTPS_DllAPI inline void dependent_typeids( - TypeIdentifierWithSizeSeq&& _dependent_typeids) - { - m_dependent_typeids = std::move(_dependent_typeids); - } - - RTPS_DllAPI inline const TypeIdentifierWithSizeSeq& dependent_typeids() const - { - return m_dependent_typeids; - } - - RTPS_DllAPI inline TypeIdentifierWithSizeSeq& dependent_typeids() - { - return m_dependent_typeids; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeIdentifierWithDependencies& data, - size_t current_alignment = 0); - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - -private: - - TypeIdentifierWithSize m_typeid_with_size; - int32_t m_dependent_typeid_count; - TypeIdentifierWithSizeSeq m_dependent_typeids; -}; - -typedef std::vector TypeIdentifierWithDependenciesSeq; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// This appears in the builtin DDS topics PublicationBuiltinTopicData -// and SubscriptionBuiltinTopicData - -/*struct TypeInformation { - TypeIdentifierWithDependencies minimal; // @id{0x1001} - TypeIdentifierWithDependencies complete; // @id{0x1002} - };*/ -class TypeInformation -{ -public: - - RTPS_DllAPI TypeInformation(); - RTPS_DllAPI ~TypeInformation(); - RTPS_DllAPI TypeInformation( - const TypeInformation& x); - RTPS_DllAPI TypeInformation( - TypeInformation&& x); - RTPS_DllAPI TypeInformation& operator =( - const TypeInformation& x); - RTPS_DllAPI TypeInformation& operator =( - TypeInformation&& x); - - RTPS_DllAPI inline void minimal( - const TypeIdentifierWithDependencies& _minimal) - { - m_minimal = _minimal; - } - - RTPS_DllAPI inline void minimal( - TypeIdentifierWithDependencies&& _minimal) - { - m_minimal = std::move(_minimal); - } - - RTPS_DllAPI inline const TypeIdentifierWithDependencies& minimal() const - { - return m_minimal; - } - - RTPS_DllAPI inline TypeIdentifierWithDependencies& minimal() - { - return m_minimal; - } - - RTPS_DllAPI inline void complete( - const TypeIdentifierWithDependencies& _complete) - { - m_complete = _complete; - } - - RTPS_DllAPI inline void complete( - TypeIdentifierWithDependencies&& _complete) - { - m_complete = std::move(_complete); - } - - RTPS_DllAPI inline const TypeIdentifierWithDependencies& complete() const - { - return m_complete; - } - - RTPS_DllAPI inline TypeIdentifierWithDependencies& complete() - { - return m_complete; - } - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - RTPS_DllAPI static size_t getCdrSerializedSize( - const TypeInformation& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - -private: - - TypeIdentifierWithDependencies m_minimal; - TypeIdentifierWithDependencies m_complete; -}; - -typedef std::vector TypeInformationSeq; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_TYPE_OBJECT_H diff --git a/include/fastrtps/types/TypeObjectFactory.h b/include/fastrtps/types/TypeObjectFactory.h deleted file mode 100644 index 33fd87ba9c4..00000000000 --- a/include/fastrtps/types/TypeObjectFactory.h +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPE_OBJECT_TYPE_FACTORY_H -#define TYPE_OBJECT_TYPE_FACTORY_H - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeObjectFactory -{ -private: - mutable std::recursive_mutex m_MutexIdentifiers; - mutable std::recursive_mutex m_MutexObjects; - mutable std::recursive_mutex m_MutexInformations; - -protected: - TypeObjectFactory(); - mutable std::map identifiers_; // Basic, builtin and EK_MINIMAL - std::map complete_identifiers_; // Only EK_COMPLETE - std::map objects_; // EK_MINIMAL - std::map complete_objects_; // EK_COMPLETE - mutable std::vector identifiers_created_; - mutable std::map informations_; - mutable std::vector informations_created_; - std::map aliases_; // Aliases - - DynamicType_ptr build_dynamic_type( - TypeDescriptor& descriptor, - const TypeObject* object, - const DynamicType_ptr annotation_member_type = DynamicType_ptr(nullptr)) const; - - const TypeIdentifier* try_get_complete( - const TypeIdentifier* identifier) const; - - const TypeIdentifier* get_stored_type_identifier( - const TypeIdentifier* identifier) const; - - std::string generate_name_and_store_type_identifier( - const TypeIdentifier* identifier) const; - - void nullify_all_entries( - const TypeIdentifier* identifier); - - void create_builtin_annotations(); - - void apply_type_annotations( - DynamicTypeBuilder_ptr& type_builder, - const AppliedAnnotationSeq& annotations) const; - - void apply_member_annotations( - DynamicTypeBuilder_ptr& parent_type_builder, - MemberId member_id, - const AppliedAnnotationSeq& annotations) const; - - std::string get_key_from_hash( - const DynamicType_ptr annotation_descriptor_type, - const NameHash& hash) const; - - /** - * @brief Fills the TypeInformation provided with the minimal TypeIdentifiers and its minimal dependencies. - * @param info - * @param ident - */ - void fill_minimal_information( - TypeInformation* info, - const TypeIdentifier* ident) const; - - /** - * @brief Fills the TypeInformation provided with the complete TypeIdentifiers and its complete dependencies - * if possible, or minimal ones in other case. - * @param info - * @param ident - */ - void fill_complete_information( - TypeInformation* info, - const TypeIdentifier* ident) const; - - /** - * @brief Auxiliar function to fill minimal dependencies. - * @param info - * @param identifier - */ - void fill_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - - /** - * @brief Auxiliar function to fill complete dependencies. - * @param info - * @param identifier - */ - void fill_complete_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - - /** - * @brief Auxiliar function to fill minimal information with complete dependencies. - * @param info - * @param identifier - */ - void fill_complete_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - -public: - RTPS_DllAPI static TypeObjectFactory* get_instance(); - - RTPS_DllAPI static ReturnCode_t delete_instance(); - - ~TypeObjectFactory(); - - /** - * @brief get_type_information Retrieves the TypeInformation of the named type. - * @param type_name - * @return - */ - RTPS_DllAPI const TypeInformation* get_type_information( - const std::string &type_name) const; - - /** - * @brief get_type_information Retrieves the TypeInformation of the given TypeIdentifier. - * @param identifier - * @return - */ - RTPS_DllAPI TypeInformation* get_type_information( - const TypeIdentifier* identifier) const; - - RTPS_DllAPI const TypeObject* get_type_object( - const std::string& type_name, - bool complete = false) const; - - RTPS_DllAPI const TypeObject* get_type_object( - const TypeIdentifier* identifier) const; - - RTPS_DllAPI TypeKind get_type_kind( - const std::string& type_name) const; - - RTPS_DllAPI std::string get_type_name( - const TypeKind kind) const; - - RTPS_DllAPI std::string get_type_name( - const TypeIdentifier* identifier) const; - - RTPS_DllAPI const TypeIdentifier* get_primitive_type_identifier( - TypeKind kind) const; - - RTPS_DllAPI const TypeIdentifier* get_type_identifier( - const std::string& type_name, - bool complete = false) const; - - RTPS_DllAPI const TypeIdentifier* get_type_identifier_trying_complete( - const std::string& type_name) const; - - RTPS_DllAPI const TypeIdentifier* get_string_identifier( - uint32_t bound, - bool wide = false); - - RTPS_DllAPI const TypeIdentifier* get_sequence_identifier( - const std::string& type_name, - uint32_t bound, - bool complete = false); - - RTPS_DllAPI const TypeIdentifier* get_array_identifier( - const std::string& type_name, - const std::vector &bound, - bool complete = false); - - RTPS_DllAPI const TypeIdentifier* get_map_identifier( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool complete = false); - - RTPS_DllAPI DynamicType_ptr build_dynamic_type( - const std::string& name, - const TypeIdentifier* identifier, - const TypeObject* object = nullptr) const; - - RTPS_DllAPI bool is_type_identifier_complete( - const TypeIdentifier* identifier) const; - - RTPS_DllAPI void add_type_identifier( - const std::string& type_name, - const TypeIdentifier* identifier); - - RTPS_DllAPI void add_type_object( - const std::string& type_name, - const TypeIdentifier* identifier, - const TypeObject* object); - - RTPS_DllAPI inline void add_alias( - const std::string& alias_name, - const std::string& target_type) - { - std::unique_lock scoped(m_MutexIdentifiers); - aliases_.emplace(std::pair(alias_name, target_type)); - } - - /** - * @brief Returns a TypeIdentifierWithSizeSeq object filled with the dependencies of the - * given identifiers. If continuation_point isn't empty, then it will skip the first - * (max_size * continuation_point) dependencies. - * @param identifiers - * @param in_continuation_point - * @param out_continuation_point - * @param max_size - * @return - */ - RTPS_DllAPI TypeIdentifierWithSizeSeq typelookup_get_type_dependencies( - const TypeIdentifierSeq& identifiers, - const OctetSeq& in_continuation_point, - OctetSeq& out_continuation_point, - size_t max_size) const; - - /** - * @brief Fills the given object with the complete version of the given identifier. - * If the given identifier was MINIMAL, then it will return the stored COMPLETE identifier pointer. - * Otherwise, it will return the given identifier address (to make comparision trivial). - * @param identifier - * @param object - * @return - */ - RTPS_DllAPI const TypeIdentifier* typelookup_get_type( - const TypeIdentifier& identifier, - TypeObject& object) const; - - /** - * @brief Checks if a TypeIdentifier is already known by the factory. - * @param identifier - * @return - */ - RTPS_DllAPI bool typelookup_check_type_identifier( - const TypeIdentifier& identifier) const; - - /** - * @brief Retrieves the CompleteTypeObject from the given TypeInformation. - * If it doesn't exist, it returns nullptr. - * A user that received a TypeInformation from TypeLookupService that calls this method and returns nullptr, - * must iterate through the TypeInformation dependencies calling recursively to getTypeDependencies method in - * its participant (which will call the correspondent method in the TypeLookupService), retrieving the - * TypeObject correspondent and registering the type into the Factory with a name using the add_type_object method, - * for each COMPLETE TypeIdentifier received in this way until all the hierarchy is registered, and then, - * the user may call again this method that should return the TypeObject. - * @param information - * @return - */ - RTPS_DllAPI const TypeObject* typelookup_get_type_object_from_information( - const TypeInformation& information) const; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPE_OBJECT_TYPE_FACTORY_H diff --git a/include/fastrtps/types/TypeObjectHashId.h b/include/fastrtps/types/TypeObjectHashId.h deleted file mode 100644 index 180acb70ae6..00000000000 --- a/include/fastrtps/types/TypeObjectHashId.h +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeObjectHashId.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen and modified manually. - */ - -#ifndef _TYPEOBJECTHASHID_H_ -#define _TYPEOBJECTHASHID_H_ - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -// The types in this file shall be serialized with XCDR encoding version 2 -namespace eprosima { -namespace fastrtps { - -namespace types { - -// First 14 bytes of MD5 of the serialized TypeObject using XCDR -// version 2 with Little Endian encoding -typedef octet EquivalenceHash[14]; - -/*! - * @brief This class represents the union TypeObjectHashId defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class TypeObjectHashId -{ -public: - - /*! - * @brief Default constructor. - */ - TypeObjectHashId(); - - /*! - * @brief Default destructor. - */ - ~TypeObjectHashId(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId( - const TypeObjectHashId& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId( - TypeObjectHashId&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId& operator =( - const TypeObjectHashId& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId& operator =( - TypeObjectHashId&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - uint8_t& _d(); - - /*! - * @brief This function copies the value in member hash - * @param _hash New value to be copied in member hash - */ - void hash( - const EquivalenceHash& _hash); - - /*! - * @brief This function moves the value in member hash - * @param _hash New value to be moved in member hash - */ - void hash( - EquivalenceHash&& _hash); - - /*! - * @brief This function returns a constant reference to member hash - * @return Constant reference to member hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - const EquivalenceHash& hash() const; - - /*! - * @brief This function returns a reference to member hash - * @return Reference to member hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - EquivalenceHash& hash(); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - void deserialize( - eprosima::fastcdr::Cdr& cdr); - - /*! - * @brief This function returns the maximum serialized size of the Key of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - -private: - - uint8_t m__d; - - EquivalenceHash m_hash; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEOBJECTHASHID_H_ diff --git a/include/fastrtps/types/TypesBase.h b/include/fastrtps/types/TypesBase.h deleted file mode 100644 index c5242e17ad6..00000000000 --- a/include/fastrtps/types/TypesBase.h +++ /dev/null @@ -1,647 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TYPES_BASE_H -#define TYPES_BASE_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastdds { -namespace dds { -using DomainId_t = uint32_t; -} // dds -} // namespace fastdds - -namespace fastcdr { -class Cdr; -} // namespace fastcdr -namespace fastrtps { -namespace types { - -//! A special value indicating an unlimited quantity -constexpr uint32_t BOUND_UNLIMITED = 0; - -using eprosima::fastrtps::rtps::octet; - -using OctetSeq = std::vector; - -OctetSeq& operator ++( - OctetSeq&); - -OctetSeq operator ++( - OctetSeq&, - int); - -size_t to_size_t( - const OctetSeq&); - -const std::string CONST_TRUE = "true"; -const std::string CONST_FALSE = "false"; - -const std::string ANNOTATION_KEY_ID = "key"; -const std::string ANNOTATION_EPKEY_ID = "Key"; -const std::string ANNOTATION_TOPIC_ID = "Topic"; -const std::string ANNOTATION_EXTENSIBILITY_ID = "extensibility"; -const std::string ANNOTATION_FINAL_ID = "final"; -const std::string ANNOTATION_APPENDABLE_ID = "appendable"; -const std::string ANNOTATION_MUTABLE_ID = "mutable"; -const std::string ANNOTATION_NESTED_ID = "nested"; -const std::string ANNOTATION_OPTIONAL_ID = "optional"; -const std::string ANNOTATION_MUST_UNDERSTAND_ID = "must_understand"; -const std::string ANNOTATION_NON_SERIALIZED_ID = "non_serialized"; -const std::string ANNOTATION_BIT_BOUND_ID = "bit_bound"; -const std::string ANNOTATION_DEFAULT_ID = "default"; -const std::string ANNOTATION_DEFAULT_LITERAL_ID = "default_literal"; -const std::string ANNOTATION_VALUE_ID = "value"; -const std::string ANNOTATION_POSITION_ID = "position"; - -const std::string EXTENSIBILITY_FINAL = "FINAL"; -const std::string EXTENSIBILITY_APPENDABLE = "APPENDABLE"; -const std::string EXTENSIBILITY_MUTABLE = "MUTABLE"; - -const std::string TKNAME_BOOLEAN = "bool"; -const std::string TKNAME_INT16 = "int16_t"; -const std::string TKNAME_UINT16 = "uint16_t"; -const std::string TKNAME_INT32 = "int32_t"; -const std::string TKNAME_UINT32 = "uint32_t"; -const std::string TKNAME_INT64 = "int64_t"; -const std::string TKNAME_UINT64 = "uint64_t"; -const std::string TKNAME_CHAR8 = "char"; -const std::string TKNAME_BYTE = "octet"; -const std::string TKNAME_INT8 = "int8_t"; -const std::string TKNAME_UINT8 = "uint8_t"; -const std::string TKNAME_CHAR16 = "wchar"; -const std::string TKNAME_CHAR16T = "wchar_t"; -const std::string TKNAME_FLOAT32 = "float"; -const std::string TKNAME_FLOAT64 = "double"; -const std::string TKNAME_FLOAT128 = "longdouble"; - -const std::string TKNAME_STRING8 = "string"; -const std::string TKNAME_STRING16 = "wstring"; -const std::string TKNAME_ALIAS = "alias"; -const std::string TKNAME_ENUM = "enum"; -const std::string TKNAME_BITMASK = "bitmask"; -const std::string TKNAME_ANNOTATION = "annotation"; -const std::string TKNAME_STRUCTURE = "structure"; -const std::string TKNAME_UNION = "union"; -const std::string TKNAME_BITSET = "bitset"; -const std::string TKNAME_SEQUENCE = "sequence"; -const std::string TKNAME_ARRAY = "array"; -const std::string TKNAME_MAP = "map"; - -// ---------- Equivalence Kinds ------------------ -typedef octet EquivalenceKind; -const octet EK_MINIMAL = 0xF1; // 0x1111 0001 -const octet EK_COMPLETE = 0xF2; // 0x1111 0010 -const octet EK_BOTH = 0xF3; // 0x1111 0011 - -// ---------- TypeKinds (begin) ------------------ -typedef octet TypeKind; // Primitive TKs - -const octet TK_NONE = 0x00; -const octet TK_BOOLEAN = 0x01; -const octet TK_BYTE = 0x02; -const octet TK_INT16 = 0x03; -const octet TK_INT32 = 0x04; -const octet TK_INT64 = 0x05; -const octet TK_UINT16 = 0x06; -const octet TK_UINT32 = 0x07; -const octet TK_UINT64 = 0x08; -const octet TK_FLOAT32 = 0x09; -const octet TK_FLOAT64 = 0x0A; -const octet TK_FLOAT128 = 0x0B; -const octet TK_CHAR8 = 0x10; -const octet TK_CHAR16 = 0x11; - -// String TKs -const octet TK_STRING8 = 0x20; -const octet TK_STRING16 = 0x21; - - -// Constructed/Named types -const octet TK_ALIAS = 0x30; - -// Enumerated TKs -const octet TK_ENUM = 0x40; -const octet TK_BITMASK = 0x41; - -// Structured TKs -const octet TK_ANNOTATION = 0x50; -const octet TK_STRUCTURE = 0x51; -const octet TK_UNION = 0x52; -const octet TK_BITSET = 0x53; - -// Collection TKs -const octet TK_SEQUENCE = 0x60; -const octet TK_ARRAY = 0x61; -const octet TK_MAP = 0x62; - -// ---------- TypeKinds (end) ------------------ - -// The name of some element (e.g. type, type member, module) -// Valid characters are alphanumeric plus the "_" cannot start with digit - -const int32_t MEMBER_NAME_MAX_LENGTH = 256; -typedef std::string MemberName; - -// Qualified type name includes the name of containing modules -// using "::" as separator. No leading "::". E.g. "MyModule::MyType" -const int32_t TYPE_NAME_MAX_LENGTH = 256; -typedef std::string QualifiedTypeName; - -// Every type has an ID. Those of the primitive types are pre-defined. -typedef octet PrimitiveTypeId; - -// First 4 bytes of MD5 of of a member name converted to bytes -// using UTF-8 encoding and without a 'nul' terminator. -// Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} -typedef std::array NameHash; - -// Mask used to remove the flags that do no affect assignability -// Selects T1, T2, O, M, K, D -const uint16_t MemberFlagMinimalMask = 0x003f; - -/*! - * @brief This class represents the enumeration ReturnCode_t. - */ - -class RTPS_DllAPI ReturnCode_t -{ - uint32_t value_; - -public: - - enum ReturnCodeValue - { - RETCODE_OK = 0, - RETCODE_ERROR = 1, - RETCODE_UNSUPPORTED = 2, - RETCODE_BAD_PARAMETER = 3, - RETCODE_PRECONDITION_NOT_MET = 4, - RETCODE_OUT_OF_RESOURCES = 5, - RETCODE_NOT_ENABLED = 6, - RETCODE_IMMUTABLE_POLICY = 7, - RETCODE_INCONSISTENT_POLICY = 8, - RETCODE_ALREADY_DELETED = 9, - RETCODE_TIMEOUT = 10, - RETCODE_NO_DATA = 11, - RETCODE_ILLEGAL_OPERATION = 12, - RETCODE_NOT_ALLOWED_BY_SECURITY = 13 - }; - - ReturnCode_t() - : value_(RETCODE_OK) - { - } - - ReturnCode_t( - uint32_t e) - { - value_ = e; - } - - bool operator ==( - const ReturnCode_t& c) const - { - return value_ == c.value_; - } - - bool operator !=( - const ReturnCode_t& c) const - { - return value_ != c.value_; - } - - explicit operator bool() = delete; - - uint32_t operator ()() const - { - return value_; - } - - bool operator !() const - { - return value_ != 0; - } - -}; - -RTPS_DllAPI inline bool operator ==( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -RTPS_DllAPI inline bool operator !=( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -RTPS_DllAPI inline bool operator ==( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -RTPS_DllAPI inline bool operator !=( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -// TODO Remove this alias when Fast-RTPS reaches version 2 -using ResponseCode = ReturnCode_t; - -typedef uint32_t MemberId; -constexpr uint32_t MEMBER_ID_INVALID {0X0FFFFFFF}; -#define INDEX_INVALID UINT32_MAX - -const int32_t MAX_BITMASK_LENGTH = 64; -const int32_t MAX_ELEMENTS_COUNT = 100; -const int32_t MAX_STRING_LENGTH = 255; - -// Long Bound of a collection type -typedef uint32_t LBound; -typedef std::vector LBoundSeq; -const LBound INVALID_LBOUND = 0; - -// Short Bound of a collection type -typedef octet SBound; -typedef std::vector SBoundSeq; -const SBound INVALID_SBOUND = 0; - -// Auxiliar function to compare sequences (std::vector) -template -bool compareSequence( - const std::vector& a, - const std::vector& b) -{ - if (a.size() == b.size()) - { - auto aIt = a.begin(); - auto bIt = b.begin(); - while (aIt != a.end() && bIt != b.end()) - { - if (*aIt == *bIt) - { - ++aIt; - ++bIt; - } - else - { - return false; - } - } - return true; - } - return false; -} - -// Flags that apply to struct/union/collection/enum/bitmask/bitset -// members/elements and DO affect type assignability -// Depending on the flag it may not apply to members of all types - -// When not all, the applicable member types are listed -class MemberFlag -{ -private: - - std::bitset<16> m_MemberFlag; - -public: - - MemberFlag() - { - } - - MemberFlag( - const MemberFlag& x) - : m_MemberFlag(x.m_MemberFlag) - { - } - - MemberFlag( - MemberFlag&& x) - : m_MemberFlag(std::move(x.m_MemberFlag)) - { - } - - MemberFlag& operator =( - const MemberFlag& x) - { - m_MemberFlag = x.m_MemberFlag; - return *this; - } - - MemberFlag& operator =( - MemberFlag&& x) - { - m_MemberFlag = std::move(x.m_MemberFlag); - return *this; - } - - // T1 | 00 = INVALID, 01 = DISCARD - bool TRY_CONSTRUCT1() const - { - return m_MemberFlag.test(0); - } - - void TRY_CONSTRUCT1( - bool b) - { - b ? m_MemberFlag.set(0) : m_MemberFlag.reset(0); - } - - // T2 | 10 = USE_DEFAULT, 11 = TRIM - bool TRY_CONSTRUCT2() const - { - return m_MemberFlag.test(1); - } - - void TRY_CONSTRUCT2( - bool b) - { - b ? m_MemberFlag.set(1) : m_MemberFlag.reset(1); - } - - // X StructMember, UnionMember, - // CollectionElement - bool IS_EXTERNAL() const - { - return m_MemberFlag.test(2); - } - - void IS_EXTERNAL( - bool b) - { - b ? m_MemberFlag.set(2) : m_MemberFlag.reset(2); - } - - // O StructMember - bool IS_OPTIONAL() const - { - return m_MemberFlag.test(3); - } - - void IS_OPTIONAL( - bool b) - { - b ? m_MemberFlag.set(3) : m_MemberFlag.reset(3); - } - - // M StructMember - bool IS_MUST_UNDERSTAND() const - { - return m_MemberFlag.test(4); - } - - void IS_MUST_UNDERSTAND( - bool b) - { - b ? m_MemberFlag.set(4) : m_MemberFlag.reset(4); - } - - // K StructMember, UnionDiscriminator - bool IS_KEY() const - { - return m_MemberFlag.test(5); - } - - void IS_KEY( - bool b) - { - b ? m_MemberFlag.set(5) : m_MemberFlag.reset(5); - } - - // D UnionMember, EnumerationLiteral - bool IS_DEFAULT() const - { - return m_MemberFlag.test(6); - } - - void IS_DEFAULT( - bool b) - { - b ? m_MemberFlag.set(6) : m_MemberFlag.reset(6); - } - - bool operator ==( - const MemberFlag& other) const - { - return m_MemberFlag == other.m_MemberFlag; - } - - std::bitset<16> bitset() const - { - std::string str_value; - - str_value = m_MemberFlag.to_string() + str_value; - - return std::bitset<16>(str_value); - } - - void bitset( - const std::bitset<16>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 16; - m_MemberFlag = std::bitset<16>(str_value.substr(str_value.length() - base_diff, last_post)); - } - -}; - -typedef MemberFlag CollectionElementFlag; // T1, T2, X -typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X -typedef MemberFlag UnionMemberFlag; // T1, T2, D, X -typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K -typedef MemberFlag EnumeratedLiteralFlag; // D -typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply -typedef MemberFlag AliasMemberFlag; // Unused. No flags apply -typedef MemberFlag BitflagFlag; // Unused. No flags apply -typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply - -// Flags that apply to type declarationa and DO affect assignability -// Depending on the flag it may not apply to all types -// When not all, the applicable types are listed -class TypeFlag -{ -private: - - std::bitset<16> m_TypeFlag; - -public: - - TypeFlag() - { - } - - TypeFlag( - const TypeFlag& x) - : m_TypeFlag(x.m_TypeFlag) - { - } - - TypeFlag( - TypeFlag&& x) - : m_TypeFlag(std::move(x.m_TypeFlag)) - { - } - - TypeFlag& operator =( - const TypeFlag& x) - { - m_TypeFlag = x.m_TypeFlag; - return *this; - } - - TypeFlag& operator =( - TypeFlag&& x) - { - m_TypeFlag = std::move(x.m_TypeFlag); - return *this; - } - - // F | - bool IS_FINAL() const - { - return m_TypeFlag.test(0); - } - - void IS_FINAL( - bool b) - { - b ? m_TypeFlag.set(0) : m_TypeFlag.reset(0); - } - - // A |- Struct, Union - bool IS_APPENDABLE() const - { - return m_TypeFlag.test(1); - } - - void IS_APPENDABLE( - bool b) - { - b ? m_TypeFlag.set(1) : m_TypeFlag.reset(1); - } - - // M | (exactly one flag) - bool IS_MUTABLE() const - { - return m_TypeFlag.test(2); - } - - void IS_MUTABLE( - bool b) - { - b ? m_TypeFlag.set(2) : m_TypeFlag.reset(2); - } - - // N Struct, Union - bool IS_NESTED() const - { - return m_TypeFlag.test(3); - } - - void IS_NESTED( - bool b) - { - b ? m_TypeFlag.set(3) : m_TypeFlag.reset(3); - } - - // H Struct - bool IS_AUTOID_HASH() const - { - return m_TypeFlag.test(4); - } - - void IS_AUTOID_HASH( - bool b) - { - b ? m_TypeFlag.set(4) : m_TypeFlag.reset(4); - } - - bool operator ==( - const TypeFlag& other) const - { - return m_TypeFlag == other.m_TypeFlag; - } - - std::bitset<16> bitset() const - { - std::string str_value; - - str_value = m_TypeFlag.to_string() + str_value; - - return std::bitset<16>(str_value); - } - - void bitset( - const std::bitset<16>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 16; - m_TypeFlag = std::bitset<16>(str_value.substr(str_value.length() - base_diff, last_post)); - } - -}; - -typedef TypeFlag StructTypeFlag; // All flags apply -typedef TypeFlag UnionTypeFlag; // All flags apply -typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply -typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply -typedef TypeFlag AliasTypeFlag; // Unused. No flags apply -typedef TypeFlag EnumTypeFlag; // Unused. No flags apply -typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply -typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply - -// Mask used to remove the flags that do no affect assignability -const uint16_t TypeFlagMinimalMask = 0x0007; // Selects M, A, F - -// --- Annotation usage: ---------------------------------------------- - -// ID of a type member -const uint32_t ANNOTATION_STR_VALUE_MAX_LEN = 128; -const uint32_t ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_BASE_H diff --git a/include/fastrtps/types/dds-builtin_types.idl b/include/fastrtps/types/dds-builtin_types.idl deleted file mode 100644 index bf373a2a7e0..00000000000 --- a/include/fastrtps/types/dds-builtin_types.idl +++ /dev/null @@ -1,137 +0,0 @@ -module DDS { - @extensibility(APPENDABLE) - struct _String { - string value; - }; - - interface StringDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is an unbounded string. - */ - }; - - interface StringDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is an unbounded string. - */ - }; - - interface StringTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is an unbounded - * string. - */ - }; - - @extensibility(APPENDABLE) - struct KeyedString { - @key string key; - string value; - }; - - typedef sequence KeyedStringSeq; - - interface KeyedStringDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is KeyedString. It also defines - * the operations below. - */ - InstanceHandle_t register_instance_w_key( in string key); - InstanceHandle_t register_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t unregister_instance_w_key( in string key); - ReturnCode_t unregister_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t write_string_w_key( in string key, in string str, in InstanceHandle_t handle); - ReturnCode_t write_string_w_key_w_timestamp( in string key, in string str, in InstanceHandle_t handle, in Time_t source_timestamp); - - ReturnCode_t dispose_w_key( in string key); - ReturnCode_t dispose_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t get_key_value_w_key( inout string key, in InstanceHandle_t handle); - - InstanceHandle_t lookup_instance_w_key( in string key); - }; - - interface KeyedStringDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is KeyedString. - */ - }; - - interface KeyedStringTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is KeyedString. - */ - }; - - - @extensibility(APPENDABLE) - struct Bytes { - ByteSeq value; - }; - typedef sequence BytesSeq; - - interface BytesDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is an unbounded sequence of - * bytes (octets). It also defines the operations below. - */ - ReturnCode_t write_w_bytes( in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle); - ReturnCode_t write_w_bytes_w_timestamp( in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle, in Time_t source_timestamp); - }; - - interface BytesDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is Bytes. - */ - }; - - interface BytesTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is Bytes. - */ - }; - - - @extensibility(APPENDABLE) - struct KeyedBytes { - @key string key; - ByteSeq value; - }; - typedef sequence KeyedBytesSeq; - - interface KeyedBytesDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is KeyedBytes. - * It also defines the operations below. - */ - InstanceHandle_t register_instance_w_key( in string key); - InstanceHandle_t register_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t unregister_instance_w_key( in string key); - ReturnCode_t unregister_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t write_bytes_w_key( in string key, in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle); - ReturnCode_t write_bytes_w_key_w_timestamp( in string key, in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle, in Time_t source_timestamp); - - ReturnCode_t dispose_w_key( in string key); - ReturnCode_t dispose_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t get_key_value_w_key( inout string key, in InstanceHandle_t handle); - - InstanceHandle_t lookup_instance_w_key( in string key); - }; - - interface KeyedBytesDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is KeyedBytes. - */ - }; - - interface KeyedBytesTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is KeyedBytes. - */ - }; -}; // end module DDS \ No newline at end of file diff --git a/include/fastrtps/types/dds-language_binding.idl b/include/fastrtps/types/dds-language_binding.idl deleted file mode 100644 index f8d7c1fbbb7..00000000000 --- a/include/fastrtps/types/dds-language_binding.idl +++ /dev/null @@ -1,267 +0,0 @@ -module DDS { - local interface DynamicType; - local interface DynamicTypeBuilder; - valuetype TypeDescriptor; - - typedef sequence IncludePathSeq; - - local interface DynamicTypeBuilderFactory { - /*static*/ DynamicTypeBuilderFactory get_instance(); - /*static*/ DDS::ReturnCode_t delete_instance(); - - DynamicType get_primitive_type(in TypeKind kind); - DynamicTypeBuilder create_type(in TypeDescriptor descriptor); - DynamicTypeBuilder create_type_copy(in DynamicType type); - DynamicTypeBuilder create_type_w_type_object(in TypeObject type_object); - DynamicTypeBuilder create_string_type(in unsigned long bound); - DynamicTypeBuilder create_wstring_type(in unsigned long bound); - DynamicTypeBuilder create_sequence_type(in DynamicType element_type, in unsigned long bound); - DynamicTypeBuilder create_array_type(in DynamicType element_type, in BoundSeq bound); - DynamicTypeBuilder create_map_type(in DynamicType key_element_type, in DynamicType element_type, in unsigned long bound); - DynamicTypeBuilder create_bitmask_type(in unsigned long bound); - DynamicTypeBuilder create_type_w_uri( in string document_url, in string type_name, in IncludePathSeq include_paths); - DynamicTypeBuilder create_type_w_document( in string document, in string type_name, in IncludePathSeq include_paths); - DDS::ReturnCode_t delete_type(in DynamicType type); - }; - - interface TypeSupport { - // ReturnCode_t register_type( - // in DomainParticipant domain, - // in string type_name); - // string get_type_name(); - - // DynamicType get_type(); - }; - - /* Implied IDL for type "Foo": - interface FooTypeSupport : DDS::TypeSupport { - DDS::ReturnCode_t register_type( in DDS::DomainParticipant participant, in string type_name); - string get_type_name(); - DynamicType get_type(); - Foo create_sample(in DynamicData src); - DynamicData create_dynamic_sample(in Foo src); - }; */ - - interface DynamicTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is DynamicData. - */ - - /*static*/ DynamicTypeSupport create_type_support( in DynamicType type); - /*static*/ DDS::ReturnCode_t delete_type_support( in DynamicTypeSupport type_support); - - DDS::ReturnCode_t register_type( in DDS::DomainParticipant participant, in ObjectName type_name); - ObjectName get_type_name(); - }; - - typedef map Parameters; - - valuetype AnnotationDescriptor { - public DynamicType type; - - DDS::ReturnCode_t get_value( inout ObjectName value, in ObjectName key); - DDS::ReturnCode_t get_all_value( inout Parameters value); - DDS::ReturnCode_t set_value( in ObjectName key, in ObjectName value); - DDS::ReturnCode_t copy_from(in AnnotationDescriptor other); - boolean equals(in AnnotationDescriptor other); - boolean is_consistent(); - }; - - valuetype TypeDescriptor { - public TypeKind kind; - public ObjectName name; - public DynamicType base_type; - public DynamicType discriminator_type; - public BoundSeq bound; - @optional public DynamicType element_type; - @optional public DynamicType key_element_type; - - DDS::ReturnCode_t copy_from(in TypeDescriptor other); - boolean equals(in TypeDescriptor other); - boolean is_consistent(); - }; - - valuetype MemberDescriptor { - public ObjectName name; - public MemberId id; - public DynamicType type; - public string default_value; - public unsigned long index; - public UnionCaseLabelSeq label; - public boolean default_label; - - DDS::ReturnCode_t copy_from(in MemberDescriptor descriptor); - boolean equals(in MemberDescriptor descriptor); - boolean is_consistent(); - }; - - local interface DynamicTypeMember { - DDS::ReturnCode_t get_descriptor( inout MemberDescriptor descriptor); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicTypeMember other); - - MemberId get_id(); - ObjectName get_name(); - }; - - typedef map DynamicTypeMembersByName; - typedef map DynamicTypeMembersById; - - local interface DynamicTypeBuilder { - DDS::ReturnCode_t get_descriptor( inout TypeDescriptor descriptor); - - ObjectName get_name(); - TypeKind get_kind(); - - DDS::ReturnCode_t get_member_by_name( inout DynamicTypeMember member, in ObjectName name); - DDS::ReturnCode_t get_all_members_by_name( inout DynamicTypeMembersByName member); - - DDS::ReturnCode_t get_member( inout DynamicTypeMember member, in MemberId id); - DDS::ReturnCode_t get_all_members( inout DynamicTypeMembersById member); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicType other); - DDS::ReturnCode_t add_member(in MemberDescriptor descriptor); - DDS::ReturnCode_t apply_annotation( in AnnotationDescriptor descriptor); - - DynamicType build(); - }; - - local interface DynamicType { - DDS::ReturnCode_t get_descriptor( inout TypeDescriptor descriptor); - - ObjectName get_name(); - TypeKind get_kind(); - - DDS::ReturnCode_t get_member_by_name( inout DynamicTypeMember member, in ObjectName name); - DDS::ReturnCode_t get_all_members_by_name( inout DynamicTypeMembersByName member); - - DDS::ReturnCode_t get_member( inout DynamicTypeMember member, in MemberId id); - DDS::ReturnCode_t get_all_members( inout DynamicTypeMembersById member); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicType other); - }; - - local interface DynamicData; - - local interface DynamicDataFactory { - /*static*/ DynamicDataFactory get_instance(); - /*static*/ DDS::ReturnCode_t delete_instance(); - - DynamicData create_data(); - DDS::ReturnCode_t delete_data(in DynamicData data); - }; - - typedef sequence Int32Seq; - typedef sequence UInt32Seq; - typedef sequence Int16Seq; - typedef sequence UInt16Seq; - typedef sequence Int64Seq; - typedef sequence UInt64Seq; - typedef sequence Float32Seq; - typedef sequence Float64Seq; - typedef sequence Float128Seq; - typedef sequence CharSeq; - typedef sequence WcharSeq; - typedef sequence BooleanSeq; - typedef sequence ByteSeq; - - // typedef sequence StringSeq; - typedef sequence WstringSeq; - - local interface DynamicData { - readonly attribute DynamicType type; - - DDS::ReturnCode_t get_descriptor( inout MemberDescriptor value, in MemberId id); - DDS::ReturnCode_t set_descriptor( in MemberId id, in MemberDescriptor value); - - boolean equals(in DynamicData other); - - MemberId get_member_id_by_name(in ObjectName name); - MemberId get_member_id_at_index(in unsigned long index); - - unsigned long get_item_count(); - - DDS::ReturnCode_t clear_all_values(); - DDS::ReturnCode_t clear_nonkey_values(); - DDS::ReturnCode_t clear_value(in MemberId id); - - DynamicData loan_value(in MemberId id); - DDS::ReturnCode_t return_loaned_value(in DynamicData value); - - DynamicData clone(); - - DDS::ReturnCode_t get_int32_value( inout long value, in MemberId id); - DDS::ReturnCode_t set_int32_value( in MemberId id, in long value); - DDS::ReturnCode_t get_uint32_value( inout unsigned long value, in MemberId id); - DDS::ReturnCode_t set_uint32_value( in MemberId id, in unsigned long value); - DDS::ReturnCode_t get_int16_value( inout short value, in MemberId id); - DDS::ReturnCode_t set_int16_value( in MemberId id, in short value); - DDS::ReturnCode_t get_uint16_value( inout unsigned short value, in MemberId id); - DDS::ReturnCode_t set_uint16_value( in MemberId id, in unsigned short value); - DDS::ReturnCode_t get_int64_value( inout long long value, in MemberId id); - DDS::ReturnCode_t set_int64_value( in MemberId id, in long long value); - DDS::ReturnCode_t get_uint64_value( inout unsigned long long value, in MemberId id); - DDS::ReturnCode_t set_uint64_value( in MemberId id, in unsigned long long value); - DDS::ReturnCode_t get_float32_value( inout float value, in MemberId id); - DDS::ReturnCode_t set_float32_value( in MemberId id, in float value); - DDS::ReturnCode_t get_float64_value( inout double value, in MemberId id); - DDS::ReturnCode_t set_float64_value( in MemberId id, in double value); - DDS::ReturnCode_t get_float128_value( inout long double value, in MemberId id); - DDS::ReturnCode_t set_float128_value( in MemberId id, in long double value); - DDS::ReturnCode_t get_char8_value( inout char value, in MemberId id); - DDS::ReturnCode_t set_char8_value( in MemberId id, in char value); - DDS::ReturnCode_t get_char16_value( inout wchar value, in MemberId id); - DDS::ReturnCode_t set_char16_value( in MemberId id, in wchar value); - DDS::ReturnCode_t get_byte_value( inout octet value, in MemberId id); - DDS::ReturnCode_t set_byte_value( in MemberId id, in octet value); - DDS::ReturnCode_t get_boolean_value( inout boolean value, in MemberId id); - DDS::ReturnCode_t set_boolean_value( in MemberId id, in boolean value); - DDS::ReturnCode_t get_string_value( inout string value, in MemberId id); - DDS::ReturnCode_t set_string_value( in MemberId id, in string value); - DDS::ReturnCode_t get_wstring_value( inout wstring value, in MemberId id); - DDS::ReturnCode_t set_wstring_value( in MemberId id, in wstring value); - - DDS::ReturnCode_t get_complex_value( inout DynamicData value, in MemberId id); - DDS::ReturnCode_t set_complex_value( in MemberId id, in DynamicData value); - - DDS::ReturnCode_t get_int32_values( inout Int32Seq value, in MemberId id); - DDS::ReturnCode_t set_int32_values( in MemberId id, in Int32Seq value); - DDS::ReturnCode_t get_uint32_values( inout UInt32Seq value, in MemberId id); - DDS::ReturnCode_t set_uint32_values( in MemberId id, in UInt32Seq value); - DDS::ReturnCode_t get_int16_values( inout Int16Seq value, in MemberId id); - DDS::ReturnCode_t set_int16_values( in MemberId id, in Int16Seq value); - DDS::ReturnCode_t get_uint16_values( inout UInt16Seq value, in MemberId id); - DDS::ReturnCode_t set_uint16_values( in MemberId id, in UInt16Seq value); - DDS::ReturnCode_t get_int64_values( inout Int64Seq value, in MemberId id); - DDS::ReturnCode_t set_int64_values( in MemberId id, in Int64Seq value); - DDS::ReturnCode_t get_uint64_values( inout UInt64Seq value, in MemberId id); - DDS::ReturnCode_t set_uint64_values( in MemberId id, in UInt64Seq value); - DDS::ReturnCode_t get_float32_values( inout Float32Seq value, in MemberId id); - DDS::ReturnCode_t set_float32_values( in MemberId id, in Float32Seq value); - DDS::ReturnCode_t get_float64_values( inout Float64Seq value, in MemberId id); - DDS::ReturnCode_t set_float64_values( in MemberId id, in Float64Seq value); - DDS::ReturnCode_t get_float128_values( inout Float128Seq value, in MemberId id); - DDS::ReturnCode_t set_float128_values( in MemberId id, in Float128Seq value); - DDS::ReturnCode_t get_char8_values( inout CharSeq value, in MemberId id); - DDS::ReturnCode_t set_char8_values( in MemberId id, in CharSeq value); - DDS::ReturnCode_t get_char16_values( inout WcharSeq value, in MemberId id); - DDS::ReturnCode_t set_char16_values( in MemberId id, in WcharSeq value); - DDS::ReturnCode_t get_byte_values( inout ByteSeq value, in MemberId id); - DDS::ReturnCode_t set_byte_values( in MemberId id, in ByteSeq value); - DDS::ReturnCode_t get_boolean_values( inout BooleanSeq value, in MemberId id); - DDS::ReturnCode_t set_boolean_values( in MemberId id, in BooleanSeq value); - DDS::ReturnCode_t get_string_values( inout StringSeq value, in MemberId id); - DDS::ReturnCode_t set_string_values( in MemberId id, in StringSeq value); - DDS::ReturnCode_t get_wstring_values( inout WstringSeq value, in MemberId id); - DDS::ReturnCode_t set_wstring_values( in MemberId id, in WstringSeq value); - }; // local interface DynamicData -}; // end module DDS diff --git a/include/fastrtps/types/dds-xtypes_discovery.idl b/include/fastrtps/types/dds-xtypes_discovery.idl deleted file mode 100644 index c9df7aba0e4..00000000000 --- a/include/fastrtps/types/dds-xtypes_discovery.idl +++ /dev/null @@ -1,298 +0,0 @@ -/* dds-xtypes_discovery.idl */ - -// The types in this file shall be serialized with XCDR encoding version 1 -module DDS { - @extensibility(APPENDABLE) @nested - struct BuiltinTopicKey_t { - octet value[16]; - }; - - @extensibility(FINAL) @nested - struct Duration_t { - long sec; unsigned long nanosec; - }; - - @extensibility(APPENDABLE) @nested - struct DeadlineQosPolicy { - Duration_t period; - }; - - enum DestinationOrderQosPolicyKind { - BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS, - BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS - }; - - @extensibility(APPENDABLE) @nested - struct DestinationOrderQosPolicy { - DestinationOrderQosPolicyKind kind; - }; - - enum DurabilityQosPolicyKind { - VOLATILE_DURABILITY_QOS, - TRANSIENT_LOCAL_DURABILITY_QOS, - TRANSIENT_DURABILITY_QOS, - PERSISTENT_DURABILITY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct DurabilityQosPolicy { - DurabilityQosPolicyKind kind; - }; - - enum HistoryQosPolicyKind { - KEEP_LAST_HISTORY_QOS, - KEEP_ALL_HISTORY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct HistoryQosPolicy { - HistoryQosPolicyKind kind; - long depth; - }; - - @extensibility(APPENDABLE) @nested - struct DurabilityServiceQosPolicy { - Duration_t service_cleanup_delay; - HistoryQosPolicyKind history_kind; - long history_depth; - long max_samples; - long max_instances; - long max_samples_per_instance; - }; - - @extensibility(APPENDABLE) @nested - struct GroupDataQosPolicy { - ByteSeq value; - }; - - @extensibility(APPENDABLE) @nested - struct LatencyBudgetQosPolicy { - Duration_t duration; - }; - - @extensibility(APPENDABLE) @nested - struct LifespanQosPolicy { - Duration_t duration; - }; - - enum LivelinessQosPolicyKind { - AUTOMATIC_LIVELINESS_QOS, - MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, - MANUAL_BY_TOPIC_LIVELINESS_QOS - }; - - @extensibility(APPENDABLE) @nested - struct LivelinessQosPolicy { - LivelinessQosPolicyKind kind; - Duration_t lease_duration; - }; - - enum OwnershipQosPolicyKind { - SHARED_OWNERSHIP_QOS, - EXCLUSIVE_OWNERSHIP_QOS - }; - - @extensibility(APPENDABLE) @nested - struct OwnershipQosPolicy { - OwnershipQosPolicyKind kind; - }; - - @extensibility(APPENDABLE) @nested - struct OwnershipStrengthQosPolicy { - long value; - }; - - @extensibility(APPENDABLE) @nested - struct PartitionQosPolicy { - StringSeq name; - }; - - enum PresentationQosPolicyAccessScopeKind { - INSTANCE_PRESENTATION_QOS, - TOPIC_PRESENTATION_QOS, - GROUP_PRESENTATION_QOS - }; - - @extensibility(APPENDABLE) @nested - struct PresentationQosPolicy { - PresentationQosPolicyAccessScopeKind access_scope; - boolean coherent_access; - boolean ordered_access; - }; - - enum ReliabilityQosPolicyKind { - BEST_EFFORT_RELIABILITY_QOS, - RELIABLE_RELIABILITY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct ReliabilityQosPolicy { - ReliabilityQosPolicyKind kind; - Duration_t max_blocking_time; - }; - - @extensibility(APPENDABLE) @nested - struct ResourceLimitsQosPolicy { - long max_samples; - long max_instances; - long max_samples_per_instance; - }; - - @extensibility(APPENDABLE) @nested - struct TimeBasedFilterQosPolicy { - Duration_t minimum_separation; - }; - - @extensibility(APPENDABLE) @nested - struct TopicDataQosPolicy { - ByteSeq value; - }; - - @extensibility(APPENDABLE) @nested - struct TransportPriorityQosPolicy { - long value; - }; - - @extensibility(APPENDABLE) @nested - struct UserDataQosPolicy { - ByteSeq value; - }; - - @extensibility(MUTABLE) - struct ParticipantBuiltinTopicData { - @id(0x0050) @key BuiltinTopicKey_t key; - @id(0x002C) UserDataQosPolicy user_data; - }; - - typedef short DataRepresentationId_t; - - const DataRepresentationId_t XCDR_DATA_REPRESENTATION = 0; - const DataRepresentationId_t XML_DATA_REPRESENTATION = 1; - const DataRepresentationId_t XCDR2_DATA_REPRESENTATION = 2; - - typedef sequence DataRepresentationIdSeq; - - const QosPolicyId_t DATA_REPRESENTATION_QOS_POLICY_ID = 23; - const string DATA_REPRESENTATION_QOS_POLICY_NAME = "DataRepresentation"; - - @extensibility(APPENDABLE) @nested - struct DataRepresentationQosPolicy { - DataRepresentationIdSeq value; - }; - - @bit_bound(16) enum TypeConsistencyKind { - DISALLOW_TYPE_COERCION, - ALLOW_TYPE_COERCION - }; - - const QosPolicyId_t TYPE_CONSISTENCY_ENFORCEMENT_QOS_POLICY_ID = 24; - const string TYPE_CONSISTENCY_ENFORCEMENT_QOS_POLICY_NAME = "TypeConsistencyEnforcement"; - - @extensibility(APPENDABLE) @nested - struct TypeConsistencyEnforcementQosPolicy { - TypeConsistencyKind kind; - boolean ignore_sequence_bounds; - boolean ignore_string_bounds; - boolean ignore_member_names; - boolean prevent_type_widening; - boolean force_type_validation; - }; - - @extensibility(MUTABLE) - struct TopicBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0005) ObjectName name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x001E) DurabilityServiceQosPolicy durability_service; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x0049) TransportPriorityQosPolicy transport_priority; - @id(0x002B) LifespanQosPolicy lifespan; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x0040) HistoryQosPolicy history; - @id(0x0041) ResourceLimitsQosPolicy resource_limits; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x0073) DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) struct TopicQos { - // ... - DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct PublicationBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0050) BuiltinTopicKey_t participant_key; - @id(0x0005) ObjectName topic_name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x001E) DurabilityServiceQosPolicy durability_service; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x002B) LifespanQosPolicy lifespan; - @id(0x002C) UserDataQosPolicy user_data; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x0006) OwnershipStrengthQosPolicy ownership_strength; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x0021) PresentationQosPolicy presentation; - @id(0x0029) PartitionQosPolicy partition; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x002D) GroupDataQosPolicy group_data; - @id(0x0073) DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct DataWriterQos { - // ... DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct SubscriptionBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0050) BuiltinTopicKey_t participant_key; - @id(0x0005) ObjectName topic_name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x002C) UserDataQosPolicy user_data; - @id(0x0004) TimeBasedFilterQosPolicy time_based_filter; - @id(0x0021) PresentationQosPolicy presentation; - @id(0x0029) PartitionQosPolicy partition; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x002D) GroupDataQosPolicy group_data; - @id(0x0073) DataRepresentationQosPolicy representation; - @id(0x0074) TypeConsistencyEnforcementQosPolicy type_consistency; - }; - - @extensibility(MUTABLE) - struct DataReaderQos { - // ... - DataRepresentationQosPolicy representation; - TypeConsistencyEnforcementQosPolicy type_consistency; - }; -}; // end module DDS - \ No newline at end of file diff --git a/include/fastrtps/types/dds-xtypes_typeobject.idl b/include/fastrtps/types/dds-xtypes_typeobject.idl deleted file mode 100644 index 465300a4c7b..00000000000 --- a/include/fastrtps/types/dds-xtypes_typeobject.idl +++ /dev/null @@ -1,1077 +0,0 @@ -/* dds-xtypes_typeobject.idl */ - -// The types in this file shall be serialized with XCDR encoding version 2 -module DDS { - module XTypes { - - // ---------- Equivalence Kinds ------------------ - typedef octet EquivalenceKind; - const octet EK_MINIMAL = 0xF1; // 0x1111 0001 - const octet EK_COMPLETE = 0xF2; // 0x1111 0010 - const octet EK_BOTH = 0xF3; // 0x1111 0011 - - // ---------- TypeKinds (begin) ------------------ - typedef octet TypeKind; // Primitive TKs - - const octet TK_NONE = 0x00; - const octet TK_BOOLEAN = 0x01; - const octet TK_BYTE = 0x02; - const octet TK_INT16 = 0x03; - const octet TK_INT32 = 0x04; - const octet TK_INT64 = 0x05; - const octet TK_UINT16 = 0x06; - const octet TK_UINT32 = 0x07; - const octet TK_UINT64 = 0x08; - const octet TK_FLOAT32 = 0x09; - const octet TK_FLOAT64 = 0x0A; - const octet TK_FLOAT128 = 0x0B; - const octet TK_CHAR8 = 0x10; - const octet TK_CHAR16 = 0x11; - - // String TKs - const octet TK_STRING8 = 0x20; - const octet TK_STRING16 = 0x21; - - - // Constructed/Named types - const octet TK_ALIAS = 0x30; - - // Enumerated TKs - const octet TK_ENUM = 0x40; - const octet TK_BITMASK = 0x41; - - // Structured TKs - const octet TK_ANNOTATION = 0x50; - const octet TK_STRUCTURE = 0x51; - const octet TK_UNION = 0x52; - const octet TK_BITSET = 0x53; - - // Collection TKs - const octet TK_SEQUENCE = 0x60; - const octet TK_ARRAY = 0x61; - const octet TK_MAP = 0x62; - - // ---------- TypeKinds (end) ------------------ - - // ---------- Extra TypeIdentifiers (begin) ----------- - typedef octet TypeIdentiferKind; - const octet TI_STRING8_SMALL = 0x70; - const octet TI_STRING8_LARGE = 0x71; - const octet TI_STRING16_SMALL = 0x72; - const octet TI_STRING16_LARGE = 0x73; - - const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; - const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; - const octet TI_PLAIN_ARRAY_SMALL = 0x90; - const octet TI_PLAIN_ARRAY_LARGE = 0x91; - const octet TI_PLAIN_MAP_SMALL = 0xA0; - const octet TI_PLAIN_MAP_LARGE = 0xA1; - - const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; - - // ---------- Extra TypeIdentifiers (end) ------------- - - // The name of some element (e.g. type, type member, module) - // Valid characters are alphanumeric plus the "_" cannot start with digit - - const long MEMBER_NAME_MAX_LENGTH = 256; typedef string MemberName; - - // Qualified type name includes the name of containing modules - // using "::" as separator. No leading "::". E.g. "MyModule::MyType" - const long TYPE_NAME_MAX_LENGTH = 256; - typedef string QualifiedTypeName; - - // Every type has an ID. Those of the primitive types are pre-defined. - typedef octet PrimitiveTypeId; - - // First 14 bytes of MD5 of the serialized TypeObject using XCDR - // version 2 with Little Endian encoding - typedef octet EquivalenceHash[14]; - - // First 4 bytes of MD5 of of a member name converted to bytes - // using UTF-8 encoding and without a 'nul' terminator. - // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} - - typedef octet NameHash[4]; - - // Long Bound of a collection type - typedef unsigned long LBound; - typedef sequence LBoundSeq; - const LBound INVALID_LBOUND = 0; - - // Short Bound of a collection type - typedef octet SBound; - typedef sequence SBoundSeq; - const SBound INVALID_SBOUND = 0; - - @extensibility(FINAL) @nested - union TypeObjectHashId switch (octet) { - case EK_COMPLETE: - case EK_MINIMAL: - EquivalenceHash hash; - }; - - // Flags that apply to struct/union/collection/enum/bitmask/bitset - // members/elements and DO affect type assignability - // Depending on the flag it may not apply to members of all types - - // When not all, the applicable member types are listed - @bit_bound(16) - bitmask MemberFlag { - @position(0) TRY_CONSTRUCT1, // T1 | 00 = INVALID, 01 = DISCARD - @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM - @position(2) IS_EXTERNAL, // X StructMember, UnionMember, - // CollectionElement - @position(3) IS_OPTIONAL, // O StructMember - @position(4) IS_MUST_UNDERSTAND, // M StructMember - @position(5) IS_KEY, // K StructMember, UnionDiscriminator - @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral - }; - - typedef MemberFlag CollectionElementFlag; // T1, T2, X - typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X - typedef MemberFlag UnionMemberFlag; // T1, T2, D, X - typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K - typedef MemberFlag EnumeratedLiteralFlag; // D - typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply - typedef MemberFlag AliasMemberFlag; // Unused. No flags apply - typedef MemberFlag BitflagFlag; // Unused. No flags apply - typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply - - // Mask used to remove the flags that do no affect assignability - // Selects T1, T2, O, M, K, D - const unsigned short MemberFlagMinimalMask = 0x003f; - - // Flags that apply to type declarationa and DO affect assignability - // Depending on the flag it may not apply to all types - // When not all, the applicable types are listed - @bit_bound(16) bitmask TypeFlag { - @position(0) IS_FINAL, // F | - @position(1) IS_APPENDABLE, // A |- Struct, Union - @position(2) IS_MUTABLE, // M | (exactly one flag) - @position(3) IS_NESTED, // N Struct, Union - @position(4) IS_AUTOID_HASH // H Struct - }; - - typedef TypeFlag StructTypeFlag; // All flags apply - typedef TypeFlag UnionTypeFlag; // All flags apply - typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply - typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply - typedef TypeFlag AliasTypeFlag; // Unused. No flags apply - typedef TypeFlag EnumTypeFlag; // Unused. No flags apply - typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply - typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply - - // Mask used to remove the flags that do no affect assignability - const unsigned short TypeFlagMinimalMask = 0x0007; // Selects M, A, F - - // Forward declaration - union TypeIdentifier; - - // 1 Byte - @extensibility(FINAL) @nested - struct StringSTypeDefn { - SBound bound; - }; - - // 4 Bytes - @extensibility(FINAL) @nested - struct StringLTypeDefn { - LBound bound; - }; - - @extensibility(FINAL) @nested - struct PlainCollectionHeader { - EquivalenceKind equiv_kind; - CollectionElementFlag element_flags; - }; - - @extensibility(FINAL) @nested - struct PlainSequenceSElemDefn { - PlainCollectionHeader header; - SBound bound; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainSequenceLElemDefn { - PlainCollectionHeader header; - LBound bound; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainArraySElemDefn { - PlainCollectionHeader header; - SBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainArrayLElemDefn { - PlainCollectionHeader header; - LBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainMapSTypeDefn { - PlainCollectionHeader header; - SBound bound; - @external TypeIdentifier element_identifier; - CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainMapLTypeDefn { - PlainCollectionHeader header; - LBound bound; - @external TypeIdentifier element_identifier; - CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; - }; - - // Used for Types that have cyclic depencencies with other types - @extensibility(APPENDABLE) @nested - struct StronglyConnectedComponentId { - TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent - long scc_length; // StronglyConnectedComponent.length - long scc_index ; // identify type in Strongly Connected Comp. - }; - - // Future extensibility - @extensibility(MUTABLE) @nested - struct ExtendedTypeDefn { - // Empty. Available for future extension - }; - - - // The TypeIdentifier uniquely identifies a type (a set of equivalent - // types according to an equivalence relationship: COMPLETE, MNIMAL). - // - // In some cases (primitive types, strings, plain types) the identifier - // is a explicit description of the type. - // In other cases the Identifier is a Hash of the type description - // - // In the case of primitive types and strings the implied equivalence - // relation is the identity. - // - // For Plain Types and Hash-defined TypeIdentifiers there are three - // possibilities: MINIMAL, COMPLETE, and COMMON: - // - MINIMAL indicates the TypeIdentifier identifies equivalent types - // according to the MINIMAL equivalence relation - // - COMPLETE indicates the TypeIdentifier identifies equivalent types - // according to the COMPLETE equivalence relation - // - COMMON indicates the TypeIdentifier identifies equivalent types - // according to both the MINIMAL and the COMMON equivalence relation. - // This means the TypeIdentifier is the same for both relationships - // - - @extensibility(FINAL) @nested - union TypeIdentifier switch (octet) { - // ============ Primitive types - use TypeKind ==================== - // All primitive types fall here. - // Commented-out because Unions cannot have cases with no member. - /* case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE_TYPE: - case TK_INT16_TYPE: - case TK_INT32_TYPE: - case TK_INT64_TYPE: - case TK_UINT16_TYPE: - case TK_UINT32_TYPE: - case TK_UINT64_TYPE: - case TK_FLOAT32_TYPE: - case TK_FLOAT64_TYPE: - case TK_FLOAT128_TYPE: - case TK_CHAR8_TYPE: - case TK_CHAR16_TYPE: - // No Value - */ - - // ============ Strings - use TypeIdentifierKind =================== - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - StringSTypeDefn string_sdefn; - - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - StringLTypeDefn string_ldefn; - - // ============ Plain collectios - use TypeIdentifierKind ========= - case TI_PLAIN_SEQUENCE_SMALL: - PlainSequenceSElemDefn seq_sdefn; - case TI_PLAIN_SEQUENCE_LARGE: - PlainSequenceLElemDefn seq_ldefn; - - case TI_PLAIN_ARRAY_SMALL: - PlainArraySElemDefn array_sdefn; - case TI_PLAIN_ARRAY_LARGE: - PlainArrayLElemDefn array_ldefn; - - case TI_PLAIN_MAP_SMALL: - PlainMapSTypeDefn map_sdefn; - case TI_PLAIN_MAP_LARGE: - PlainMapLTypeDefn map_ldefn; - - // ============ Types that are mutually dependent on each other === - case TI_STRONGLY_CONNECTED_COMPONENT: - StronglyConnectedComponentId sc_component_id; - - // ============ The remaining cases - use EquivalenceKind ========= - case EK_COMPLETE: - case EK_MINIMAL: - EquivalenceHash equivalence_hash; - - // =================== Future extensibility ============ - // Future extensions - default: ExtendedTypeDefn extended_defn; - }; - typedef sequence TypeIdentifierSeq; - - - // --- Annotation usage: ---------------------------------------------- - - // ID of a type member - typedef unsigned long MemberId; - const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128; - const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; - - @extensibility(MUTABLE) @nested - struct ExtendedAnnotationParameterValue { - // Empty. Available for future extension - }; - - /* Literal value of an annotation member: either the default value in its - * definition or the value applied in its usage. - */ - - @extensibility(FINAL) @nested - union AnnotationParameterValue switch (octet) { - case TK_BOOLEAN: - boolean boolean_value; - case TK_BYTE: - octet byte_value; - case TK_INT16: - short int16_value; - case TK_UINT16: - unsigned short uint_16_value; - case TK_INT32: - long int32_value; - case TK_UINT32: - unsigned long uint32_value; - case TK_INT64: - long long int64_value; - case TK_UINT64: - unsigned long long uint64_value; - case TK_FLOAT32: - float float32_value; - case TK_FLOAT64: - double float64_value; - case TK_FLOAT128: - long double float128_value; - case TK_CHAR8: - char char_value; - case TK_CHAR16: - wchar wchar_value; - case TK_ENUM: - long enumerated_value; - case TK_STRING8: - string string8_value; - case TK_STRING16: - wstring string16_value; - default: - ExtendedAnnotationParameterValue extended_value; - }; - - // The application of an annotation to some type or type member - @extensibility(APPENDABLE) @nested - struct AppliedAnnotationParameter { - NameHash paramname_hash; - AnnotationParameterValue value; - }; - - // Sorted by AppliedAnnotationParameter.paramname_hash - typedef - sequence AppliedAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct AppliedAnnotation { - TypeIdentifier annotation_typeid; - @optional AppliedAnnotationParameterSeq param_seq; - }; - - // Sorted by AppliedAnnotation.annotation_typeid - typedef sequence AppliedAnnotationSeq; - - // @verbatim(placement="", language="", text="") - @extensibility(FINAL) @nested - struct AppliedVerbatimAnnotation { - string<32> placement; - string<32> language; - string text; - }; - - // --- Aggregate types: ----------------------------------------------- - @extensibility(APPENDABLE) @nested - struct AppliedBuiltinMemberAnnotations { - @optional string unit; // @unit("") - @optional AnnotationParameterValue min; // @min , @range - @optional AnnotationParameterValue max; // @max , @range - @optional string hash_id; // @hash_id("") - }; - - @extensibility(FINAL) @nested - struct CommonStructMember { - MemberId member_id; - StructMemberFlag member_flags; - TypeIdentifier member_type_id; - }; - - // COMPLETE Details for a member of an aggregate type - @extensibility(FINAL) @nested - struct CompleteMemberDetail { - MemberName name; - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - // MINIMAL Details for a member of an aggregate type - @extensibility(FINAL) @nested struct MinimalMemberDetail { - NameHash name_hash; - }; - - // Member of an aggregate type - @extensibility(APPENDABLE) @nested - struct CompleteStructMember { - CommonStructMember common; - CompleteMemberDetail detail; - }; - - // Ordered by the member_index - typedef sequence CompleteStructMemberSeq; - - // Member of an aggregate type - @extensibility(APPENDABLE) @nested - struct MinimalStructMember { - CommonStructMember common; - MinimalMemberDetail detail; - }; - - // Ordered by common.member_id - typedef sequence MinimalStructMemberSeq; - - @extensibility(APPENDABLE) @nested - struct AppliedBuiltinTypeAnnotations { - @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...) - }; - - @extensibility(FINAL) @nested - struct MinimalTypeDetail { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteTypeDetail { - @optional AppliedBuiltinTypeAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - QualifiedTypeName type_name; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteStructHeader { - TypeIdentifier base_type; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalStructHeader { - TypeIdentifier base_type; - MinimalTypeDetail detail; - }; - - @extensibility(FINAL) @nested - struct CompleteStructType { - StructTypeFlag struct_flags; - CompleteStructHeader header; - CompleteStructMemberSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalStructType { - StructTypeFlag struct_flags; - MinimalStructHeader header; - MinimalStructMemberSeq member_seq; - }; - - // --- Union: --------------------------------------------------------- - - // Case labels that apply to a member of a union type - // Ordered by their values - typedef sequence UnionCaseLabelSeq; - - @extensibility(FINAL) @nested - struct CommonUnionMember { - MemberId member_id; - UnionMemberFlag member_flags; - TypeIdentifier type_id; - UnionCaseLabelSeq label_seq; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct CompleteUnionMember { - CommonUnionMember common; - CompleteMemberDetail detail; - }; - - // Ordered by member_index - typedef sequence CompleteUnionMemberSeq; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct MinimalUnionMember { - CommonUnionMember common; - MinimalMemberDetail detail; - }; - - // Ordered by MinimalUnionMember.common.member_id - typedef sequence MinimalUnionMemberSeq; - - @extensibility(FINAL) @nested - struct CommonDiscriminatorMember { - UnionDiscriminatorFlag member_flags; - TypeIdentifier type_id; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct CompleteDiscriminatorMember { - CommonDiscriminatorMember common; - @optional AppliedBuiltinTypeAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct MinimalDiscriminatorMember { - CommonDiscriminatorMember common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteUnionHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalUnionHeader { - MinimalTypeDetail detail; - }; - - @extensibility(FINAL) @nested - struct CompleteUnionType { - UnionTypeFlag union_flags; - CompleteUnionHeader header; - CompleteDiscriminatorMember discriminator; - CompleteUnionMemberSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalUnionType { - UnionTypeFlag union_flags; - MinimalUnionHeader header; - MinimalDiscriminatorMember discriminator; - MinimalUnionMemberSeq member_seq; - }; - - // --- Annotation: --------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonAnnotationParameter { - AnnotationParameterFlag member_flags; - TypeIdentifier member_type_id; - }; - - // Member of an annotation type - @extensibility(APPENDABLE) @nested - struct CompleteAnnotationParameter { - CommonAnnotationParameter common; - MemberName name; - AnnotationParameterValue default_value; - }; - - // Ordered by CompleteAnnotationParameter.name - typedef sequence CompleteAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalAnnotationParameter { - CommonAnnotationParameter common; - NameHash name_hash; - AnnotationParameterValue default_value; - }; - - // Ordered by MinimalAnnotationParameter.name_hash - typedef sequence MinimalAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct CompleteAnnotationHeader { - QualifiedTypeName annotation_name; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAnnotationHeader { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteAnnotationType { - AnnotationTypeFlag annotation_flag; - CompleteAnnotationHeader header; - CompleteAnnotationParameterSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalAnnotationType { - AnnotationTypeFlag annotation_flag; - MinimalAnnotationHeader header; - MinimalAnnotationParameterSeq member_seq; - }; - - // --- Alias: --------------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonAliasBody { - AliasMemberFlag related_flags; - TypeIdentifier related_type; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteAliasBody { - CommonAliasBody common; - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAliasBody { - CommonAliasBody common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteAliasHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAliasHeader { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteAliasType { - AliasTypeFlag alias_flags; - CompleteAliasHeader header; - CompleteAliasBody body; - }; - - @extensibility(FINAL) @nested - struct MinimalAliasType { - AliasTypeFlag alias_flags; - MinimalAliasHeader header; - MinimalAliasBody body; - }; - - // --- Collections: --------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteElementDetail { - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - @extensibility(FINAL) @nested - struct CommonCollectionElement { - CollectionElementFlag element_flags; - TypeIdentifier type; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteCollectionElement { - CommonCollectionElement common; - CompleteElementDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalCollectionElement { - CommonCollectionElement common; - }; - - @extensibility(FINAL) @nested - struct CommonCollectionHeader { - LBound bound; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteCollectionHeader { - CommonCollectionHeader common; - @optional CompleteTypeDetail detail; // not present for anonymous - }; - - @extensibility(APPENDABLE) @nested - struct MinimalCollectionHeader { - CommonCollectionHeader common; - }; - - // --- Sequence: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteSequenceType { - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement element; - }; - - - @extensibility(FINAL) @nested - struct MinimalSequenceType { - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement element; - }; - - // --- Array: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonArrayHeader { - LBoundSeq bound_seq; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteArrayHeader { - CommonArrayHeader common; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalArrayHeader { - CommonArrayHeader common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteArrayType { - CollectionTypeFlag collection_flag; - CompleteArrayHeader header; - CompleteCollectionElement element; - }; - - @extensibility(FINAL) @nested - struct MinimalArrayType { - CollectionTypeFlag collection_flag; - MinimalArrayHeader header; - MinimalCollectionElement element; - }; - - // --- Map: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteMapType { - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement key; - CompleteCollectionElement element; - }; - - @extensibility(FINAL) @nested - struct MinimalMapType { - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement key; - MinimalCollectionElement element; - }; - - // --- Enumeration: --------------------------------------------------- - typedef unsigned short BitBound; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct CommonEnumeratedLiteral { - long value; - EnumeratedLiteralFlag flags; - }; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct CompleteEnumeratedLiteral { - CommonEnumeratedLiteral common; - CompleteMemberDetail detail; - }; - - // Ordered by EnumeratedLiteral.common.value - typedef sequence CompleteEnumeratedLiteralSeq; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct MinimalEnumeratedLiteral { - CommonEnumeratedLiteral common; - MinimalMemberDetail detail; - }; - - // Ordered by EnumeratedLiteral.common.value - typedef sequence MinimalEnumeratedLiteralSeq; - - @extensibility(FINAL) @nested - struct CommonEnumeratedHeader { - BitBound bit_bound; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteEnumeratedHeader { - CommonEnumeratedHeader common; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalEnumeratedHeader { - CommonEnumeratedHeader common; - }; - - // Enumerated type - @extensibility(FINAL) @nested - struct CompleteEnumeratedType { - EnumTypeFlag enum_flags; // unused - CompleteEnumeratedHeader header; - CompleteEnumeratedLiteralSeq literal_seq; - }; - - // Enumerated type - @extensibility(FINAL) @nested - struct MinimalEnumeratedType { - EnumTypeFlag enum_flags; // unused - MinimalEnumeratedHeader header; - MinimalEnumeratedLiteralSeq literal_seq; - }; - - // --- Bitmask: ------------------------------------------------------- - // Bit in a bit mask - @extensibility(FINAL) @nested - struct CommonBitflag { - unsigned short position; - BitflagFlag flags; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitflag { - CommonBitflag common; - CompleteMemberDetail detail; - }; - - // Ordered by Bitflag.position - typedef sequence CompleteBitflagSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalBitflag { - CommonBitflag common; - MinimalMemberDetail detail; - }; - - // Ordered by Bitflag.position - typedef sequence MinimalBitflagSeq; - - @extensibility(FINAL) @nested - struct CommonBitmaskHeader { - BitBound bit_bound; - }; - - typedef CompleteEnumeratedHeader CompleteBitmaskHeader; - - typedef MinimalEnumeratedHeader MinimalBitmaskHeader; - - @extensibility(APPENDABLE) @nested - struct CompleteBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - CompleteBitmaskHeader header; - CompleteBitflagSeq flag_seq; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - MinimalBitmaskHeader header; - MinimalBitflagSeq flag_seq; - }; - - // --- Bitset: --------------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonBitfield { - unsigned short position; - BitsetMemberFlag flags; - octet bitcount; - TypeKind holder_type; // Must be primitive integer type - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitfield { - CommonBitfield common; - CompleteMemberDetail detail; - }; - - // Ordered by Bitfield.position - typedef sequence CompleteBitfieldSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalBitfield { - CommonBitfield common; - NameHash name_hash; - }; - - // Ordered by Bitfield.position - typedef sequence MinimalBitfieldSeq; - - @extensibility(APPENDABLE) @nested - struct CompleteBitsetHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitsetHeader { - // Empty. Available for future extension - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitsetType { - BitsetTypeFlag bitset_flags; // unused - CompleteBitsetHeader header; - CompleteBitfieldSeq field_seq; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitsetType { - BitsetTypeFlag bitset_flags; // unused - MinimalBitsetHeader header; - MinimalBitfieldSeq field_seq; - }; - - // --- Type Object: -------------------------------------------------- - // The types associated with each case selection must have extensibility - // kind APPENDABLE or MUTABLE so that they can be extended in the future - - @extensibility(MUTABLE) @nested - struct CompleteExtendedType { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - union CompleteTypeObject switch (octet) { - case TK_ALIAS: - CompleteAliasType alias_type; - case TK_ANNOTATION: - CompleteAnnotationType annotation_type; - case TK_STRUCTURE: - CompleteStructType struct_type; - case TK_UNION: - CompleteUnionType union_type; - case TK_BITSET: - CompleteBitsetType bitset_type; - case TK_SEQUENCE: - CompleteSequenceType sequence_type; - case TK_ARRAY: - CompleteArrayType array_type; - case TK_MAP: - CompleteMapType map_type; - case TK_ENUM: - CompleteEnumeratedType enumerated_type; - case TK_BITMASK: - CompleteBitmaskType bitmask_type; - - // =================== Future extensibility ============ - default: - CompleteExtendedType extended_type; - }; - - @extensibility(MUTABLE) @nested - struct MinimalExtendedType { - // Empty. Available for future extension - }; - - - @extensibility(FINAL) @nested - union MinimalTypeObject switch (octet) { - case TK_ALIAS: - MinimalAliasType alias_type; - case TK_ANNOTATION: - MinimalAnnotationType annotation_type; - case TK_STRUCTURE: - MinimalStructType struct_type; - case TK_UNION: - MinimalUnionType union_type; - case TK_BITSET: - MinimalBitsetType bitset_type; - case TK_SEQUENCE: - MinimalSequenceType sequence_type; - case TK_ARRAY: - MinimalArrayType array_type; - case TK_MAP: - MinimalMapType map_type; - case TK_ENUM: - MinimalEnumeratedType enumerated_type; - case TK_BITMASK: - MinimalBitmaskType bitmask_type; - - // =================== Future extensibility ============ - default: - MinimalExtendedType extended_type; - }; - - @extensibility(APPENDABLE) @nested - union TypeObject switch (octet) { // EquivalenceKind - case EK_COMPLETE: - CompleteTypeObject complete; - case EK_MINIMAL: - MinimalTypeObject minimal; - }; - typedef sequence TypeObjectSeq; - - // Set of TypeObjects representing a strong component: Equivalence class - // for the Strong Connectivity relationship (mutual reachability between - // types). - // Ordered by fully qualified typename lexicographic order - typedef TypeObjectSeq StronglyConnectedComponent; - - @extensibility(FINAL) @nested - struct TypeIdentifierTypeObjectPair { - TypeIdentifier type_identifier; - TypeObject type_object; - }; - typedef - sequence TypeIdentifierTypeObjectPairSeq; - - @extensibility(FINAL) @nested - struct TypeIdentifierPair { - TypeIdentifier type_identifier1; - TypeIdentifier type_identifier2; - }; - typedef sequence TypeIdentifierPairSeq; - - @extensibility(APPENDABLE) @nested - struct TypeIdentifierWithSize { - DDS::Xtypes::TypeIdentifier type_id; - unsigned long typeobject_serialized_size; - }; - typedef sequence TypeIdentfierWithSizeSeq; - - @extensibility(APPENDABLE) @nested - struct TypeIdentifierWithDependencies { - TypeIdentifierWithSize typeid_with_size; - // The total additional types related to minimal_type - long dependent_typeid_count; - sequence dependent_typeids; - }; - typedef sequence TypeIdentifierWithDependenciesSeq; - - // This appears in the builtin DDS topics PublicationBuiltinTopicData - // and SubscriptionBuiltinTopicData - - @extensibility(MUTABLE) @nested - struct TypeInformation { - @id(0x1001) TypeIdentifierWithDependencies minimal; - @id(0x1002) TypeIdentifierWithDependencies complete; - }; - typedef sequence TypeInformationSeq; - - }; // end of module XTypes -}; // end module DDS diff --git a/include/fastrtps/utils/DBQueue.h b/include/fastrtps/utils/DBQueue.h deleted file mode 100644 index f2d91b6cebc..00000000000 --- a/include/fastrtps/utils/DBQueue.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef DBQUEUE_H -#define DBQUEUE_H - -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * Double buffered, threadsafe queue for MPSC (multi-producer, single-consumer) comms. - */ -template -class DBQueue -{ - -public: - - DBQueue() - : mForegroundQueue(&mQueueAlpha) - , mBackgroundQueue(&mQueueBeta) - { - } - - //! Clears foreground queue and swaps queues. - void Swap() - { - std::unique_lock fgGuard(mForegroundMutex); - std::unique_lock bgGuard(mBackgroundMutex); - - // Clear the foreground queue. - std::queue().swap(*mForegroundQueue); - - auto* swap = mBackgroundQueue; - mBackgroundQueue = mForegroundQueue; - mForegroundQueue = swap; - } - - //! Pushes to the background queue. Copy constructor. - void Push( - const T& item) - { - std::unique_lock guard(mBackgroundMutex); - mBackgroundQueue->push(item); - } - - //! Pushes to the background queue. Move constructor. - void Push( - T&& item) - { - std::unique_lock guard(mBackgroundMutex); - mBackgroundQueue->push(std::move(item)); - } - - //! Returns a reference to the front element - //! in the foregrund queue. - T& Front() - { - std::unique_lock guard(mForegroundMutex); - return mForegroundQueue->front(); - } - - const T& Front() const - { - std::unique_lock guard(mForegroundMutex); - return mForegroundQueue->front(); - } - - //! Pops from the foreground queue. - void Pop() - { - std::unique_lock guard(mForegroundMutex); - mForegroundQueue->pop(); - } - - //! Return the front element in the foreground queue by moving it and erase it from the queue. - T FrontAndPop() - { - std::unique_lock guard(mForegroundMutex); - - // Get value by moving the internal queue reference to a new value - T value = std::move(mForegroundQueue->front()); - // At this point mForegroundQueue contains a non valid element, but mutex is taken and next instruction erase it - - // Pop value from queue - mForegroundQueue->pop(); - - // Return value (as it has been created in this scope, it will not be copied but moved or directly forwarded) - return value; - } - - //! Reports whether the foreground queue is empty. - bool Empty() const - { - std::unique_lock guard(mForegroundMutex); - return mForegroundQueue->empty(); - } - - //! Reports whether the both queues are empty. - bool BothEmpty() const - { - std::unique_lock guard(mForegroundMutex); - std::unique_lock bgGuard(mBackgroundMutex); - return mForegroundQueue->empty() && mBackgroundQueue->empty(); - } - - //! Reports the size of the foreground queue. - size_t Size() const - { - std::unique_lock guard(mForegroundMutex); - return mForegroundQueue->size(); - } - - //! Clears foreground and background. - void Clear() - { - std::unique_lock fgGuard(mForegroundMutex); - std::unique_lock bgGuard(mBackgroundMutex); - std::queue().swap(*mForegroundQueue); - std::queue().swap(*mBackgroundQueue); - } - -private: - - // Underlying queues - std::queue mQueueAlpha; - std::queue mQueueBeta; - - // Front and background queue references (double buffering) - std::queue* mForegroundQueue; - std::queue* mBackgroundQueue; - - mutable std::mutex mForegroundMutex; - mutable std::mutex mBackgroundMutex; -}; - - -} // namespace fastrtps -} // namespace eprosima - -#endif // ifndef DBQUEUE_H diff --git a/include/fastrtps/utils/Semaphore.h b/include/fastrtps/utils/Semaphore.h deleted file mode 100644 index a2d20af4378..00000000000 --- a/include/fastrtps/utils/Semaphore.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 Esteve Fernandez -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef FASTRTPS_SEMAPHORE_H_ -#define FASTRTPS_SEMAPHORE_H_ - -#include -#include - -namespace eprosima { -namespace fastrtps { - -class Semaphore { -public: - explicit Semaphore(size_t count = 0); - Semaphore(const Semaphore&) = delete; - Semaphore& operator=(const Semaphore&) = delete; - - void post(); - void wait(); - void disable(); - void enable(); - void post(int n); - -private: - size_t count_; - std::mutex mutex_; - std::condition_variable cv_; - bool disable_; -}; - -inline Semaphore::Semaphore(size_t count) : count_(count), disable_(false) {} - -inline void Semaphore::post() { - std::lock_guard lock(mutex_); - if (!disable_) - { - ++count_; - cv_.notify_one(); - } -} - -inline void Semaphore::post(int n) { - std::lock_guard lock(mutex_); - if (!disable_) - { - count_ += n; - for (int i = 0; i < n; ++i) - { - cv_.notify_one(); - } - } -} - -inline void Semaphore::disable() { - std::lock_guard lock(mutex_); - if (!disable_) - { - count_ = (size_t)-1L; - cv_.notify_all(); - disable_ = true; - } -} - -inline void Semaphore::enable() { - std::lock_guard lock(mutex_); - if (disable_) - { - count_ = 0; - disable_ = false; - } -} - -inline void Semaphore::wait() { - std::unique_lock lock(mutex_); - if (!disable_) - { - cv_.wait(lock, [&] { - if (disable_) return true; - return count_ > 0; - }); - --count_; - } -} - -} // fastrtps -} // eprosima - -#endif // FASTRTPS_SEMAPHORE_H_ diff --git a/include/fastrtps/utils/StringMatching.h b/include/fastrtps/utils/StringMatching.h deleted file mode 100644 index ca892aff459..00000000000 --- a/include/fastrtps/utils/StringMatching.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringMatching.h - * - */ - -#ifndef STRINGMATCHING_H_ -#define STRINGMATCHING_H_ - -#include - -#include -#include -#include - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -namespace eprosima { -namespace fastrtps { -namespace rtps { -/** - * Class StringMatching used to match different strings against each other as defined by the POSIX fnmatch API (1003.2-1992 - section B.6). - @ingroup UTILITIES_MODULE - */ -class RTPS_DllAPI StringMatching -{ -public: - - StringMatching(); - - virtual ~StringMatching(); - - /** Static method to match two strings. - * It checks if the input strings match. Any of the strings or both can be a pattern. - */ - static bool matchString( - const char* input1, - const char* input2); - - /** Static method to match a string to a pattern. - * It checks the string specified by the input argument to see if it matches the pattern specified by the pattern argument. - */ - static bool matchPattern( - const char* pattern, - const char* input); -}; - -} // namespace rtps -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif // ifndef STRINGMATCHING_H_ diff --git a/include/fastrtps/utils/System.h b/include/fastrtps/utils/System.h deleted file mode 100644 index 8a9e86b56ec..00000000000 --- a/include/fastrtps/utils/System.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file System.h - * - */ - -#ifndef _EPROSIMA_SYSTEM_UTILS_H -#define _EPROSIMA_SYSTEM_UTILS_H - -#include "../fastrtps_dll.h" - -namespace eprosima { -namespace fastrtps { - -/** - * Class System, to provide helper functions to access system information. - * @ingroup UTILITIES_MODULE - */ -class System -{ -public: - - //! Returns current process identifier. - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::System::GetPID", "") - RTPS_DllAPI static int GetPID(); -}; - -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* _EPROSIMA_SYSTEM_UTILS_H */ diff --git a/include/fastrtps/utils/TimeConversion.h b/include/fastrtps/utils/TimeConversion.h deleted file mode 100644 index e5950a41f49..00000000000 --- a/include/fastrtps/utils/TimeConversion.h +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TimeConversion.h - * - */ - -#ifndef TIMECONVERSION_H_ -#define TIMECONVERSION_H_ - -#include -#include - -namespace eprosima { -namespace fastrtps{ -namespace rtps { - - -namespace TimeConv{ - -/** -* Convert Time_t to seconds as a double -*/ -inline double Time_t2SecondsDouble(const rtps::Time_t& t) -{ - return (double)t.seconds() + (double)(t.fraction()/pow(2.0,32)); -} - -/** -* Convert Time_t to seconds as an int64 -*/ -inline int64_t Time_t2MicroSecondsInt64(const rtps::Time_t& t) -{ - return (int64_t)(t.fraction()/pow(2.0,32)*pow(10.0,6)) + t.seconds()*(int64_t)pow(10.0,6); -} - -/** -* Convert Duration_t to seconds as an int64 -*/ -inline int64_t Duration_t2MicroSecondsInt64(const Duration_t& t) -{ - return (int64_t)(t.nanosec/1000.0)+t.seconds*(int64_t)pow(10.0,6); -} - -/** -* Convert Time_t to microseconds as a double -*/ -inline double Time_t2MicroSecondsDouble(const rtps::Time_t& t) -{ - return ((double)t.fraction()/pow(2.0,32)*pow(10.0,6)) + (double)t.seconds()*pow(10.0,6); -} - -/** -* Convert Time_t to milliseconds as an int64 -*/ -inline int64_t Time_t2MilliSecondsInt64(const rtps::Time_t& t) -{ - return (int64_t)(t.fraction()/pow(2.0,32)*pow(10.0,3)) + t.seconds()*(int64_t)pow(10.0,3); -} - -/** -* Convert Time_t to milliseconds as a double -*/ -inline double Time_t2MilliSecondsDouble(const rtps::Time_t& t) -{ - return ((double)t.fraction()/pow(2.0,32)*pow(10.0,3)) + (double)t.seconds()*pow(10.0,3); -} - -/** -* Convert Duration_t to milliseconds as a double -*/ -inline double Duration_t2MilliSecondsDouble(const Duration_t& t) -{ - return ((double)t.nanosec/1000000.0)+(double)t.seconds*pow(10.0,3); -} - -/** -* Convert milliseconds to Time_t -*/ -inline rtps::Time_t MilliSeconds2Time_t(double millisec) -{ - rtps::Time_t t; - t.seconds((int32_t)(millisec/pow(10.0,3))); - t.fraction((uint32_t)((millisec-(double)t.seconds()*pow(10.0,3))/pow(10.0,3)*pow(2.0,32))); - return t; -} - -/** -* Convert microseconds to Time_t -*/ -inline rtps::Time_t MicroSeconds2Time_t(double microsec) -{ - rtps::Time_t t; - t.seconds((int32_t)(microsec/pow(10.0,6))); - t.fraction((uint32_t)((microsec-(double)t.seconds()*pow(10.0,6))/pow(10.0,6)*pow(2.0,32))); - return t; -} - -/** -* Convert seconds to Time_t -*/ -inline rtps::Time_t Seconds2Time_t(double seconds) -{ - rtps::Time_t t; - t.seconds((int32_t)seconds); - t.fraction((uint32_t)((seconds-(double)t.seconds())*pow(2.0,32))); - return t; -} - -/** -* Get the absolute difference between two Time_t in milliseconds as double -*/ -inline double Time_tAbsDiff2DoubleMillisec(const rtps::Time_t& t1, const rtps::Time_t& t2) -{ - double result = 0; - result +=(double)abs((t2.seconds()-t1.seconds())*1000); - result +=(double)std::abs((t2.fraction()-t1.fraction())/pow(2.0,32)*1000); - return result; -} - -//! Create a random Time_t that is millisec + [-randoff,randoff] -inline rtps::Time_t MilliSecondsWithRandOffset2Time_t(double millisec, double randoff) -{ - randoff = std::abs(randoff); - millisec = millisec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return MilliSeconds2Time_t(millisec); -} -//! Create a random Time_t that is microsec + [-randoff,randoff] -inline rtps::Time_t MicroSecondsWithRandOffset2Time_t(double microsec, double randoff) -{ - randoff = std::abs(randoff); - microsec = microsec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return MicroSeconds2Time_t(microsec); -} -//! Create a random Time_t that is sec + [-randoff,randoff] -inline rtps::Time_t SecondsWithRandOffset2Time_t(double sec, double randoff) -{ - randoff = std::abs(randoff); - sec = sec + (-randoff) + static_cast (rand()) /( static_cast (RAND_MAX/(2*randoff))); - return Seconds2Time_t(sec); -} - -} -} -} /* namespace rtps */ -} /* namespace eprosima */ - -#endif /* TIMECONVERSION_H_ */ diff --git a/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp b/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp deleted file mode 100644 index 24b963f8d57..00000000000 --- a/include/fastrtps/utils/collections/foonathan_memory_helpers.hpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file foonathan_memory_helpers.hpp - * - */ - -#ifndef FASTRTPS_UTILS_COLLECTIONS_FOONATHAN_MEMORY_HELPERS_HPP_ -#define FASTRTPS_UTILS_COLLECTIONS_FOONATHAN_MEMORY_HELPERS_HPP_ - -#include -#include - -#include "ResourceLimitedContainerConfig.hpp" -#include "fastrtps/config.h" - -namespace eprosima { -namespace fastrtps { - -/** - * A helper to calculate the block size of a memory pool given the size of the node and - * a resource limits configuration. - * - * @tparam MemoryPool memory_pool specialization - * - * @param node_size Size of the node for the memory pool - * @param limits Resource limits configuration of the container - * - * @return the block size to pass to the memory pool constructor - */ -template -std::size_t memory_pool_block_size( - std::size_t node_size, - const ResourceLimitedContainerConfig& limits) -{ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::memory_pool_block_size", "You should not use this method") - namespace fm = foonathan::memory; - - size_t num_elems = limits.increment > 0 ? limits.initial : limits.maximum; - if (num_elems < 1u) - { - num_elems = 1u; - } - - return num_elems - * ((node_size > MemoryPool::min_node_size ? node_size : MemoryPool::min_node_size) // Room for elements -#if FOONATHAN_MEMORY_DEBUG_DOUBLE_DEALLOC_CHECK - * (fm::detail::debug_fence_size ? 3 : 1)) // Room for debug info -#else - + (fm::detail::debug_fence_size ? 2 * fm::detail::max_alignment : 0)) // Room for debug info -#endif // if FOONATHAN_MEMORY_DEBUG_DOUBLE_DEALLOC_CHECK -#ifdef FOONATHAN_MEMORY_MEMORY_POOL_HAS_MIN_BLOCK_SIZE - + fm::detail::memory_block_stack::implementation_offset(); // Room for padding -#else - + fm::detail::memory_block_stack::implementation_offset; // Room for padding -#endif // FOONATHAN_MEMORY_MEMORY_POOL_HAS_MIN_BLOCK_SIZE -} - -} // namespace fastrtps -} // namespace eprosima - -#endif /* FASTRTPS_UTILS_COLLECTIONS_FOONATHAN_MEMORY_HELPERS_HPP_ */ diff --git a/include/fastrtps/utils/fixed_size_string.hpp b/include/fastrtps/utils/fixed_size_string.hpp deleted file mode 100644 index aa1c7c33147..00000000000 --- a/include/fastrtps/utils/fixed_size_string.hpp +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file fixed_size_string.hpp - * - */ - -#ifndef FASTRTPS_UTILS_FIXED_SIZE_STRING_HPP_ -#define FASTRTPS_UTILS_FIXED_SIZE_STRING_HPP_ - -#include -#include - -#ifdef _WIN32 -#define MEMCCPY _memccpy -#else -#define MEMCCPY memccpy -#endif // ifdef _WIN32 - -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -namespace eprosima { -namespace fastrtps { - -/** - * Template class for non-alloc strings. Will be truncated when assigned from a longer string. - * @tparam MAX_CHARS Maximum number of characters is specified as the template parameter. - * Space for an additional null terminator will be reserved. - * @ingroup UTILITIES_MODULE - */ -template -struct fixed_string -{ -public: - - static constexpr size_t max_size = MAX_CHARS; - - /// Default constructor. - fixed_string() noexcept - { - memset(string_data, 0, sizeof(string_data)); - string_len = 0; - } - - // We don't need to define copy/move constructors/assignment operators as the default ones would be enough - - // Construct / assign from a char array - fixed_string( - const char* c_array, - size_t n_chars) noexcept - { - assign(c_array, n_chars); - } - - fixed_string& assign( - const char* c_array, - size_t n_chars) noexcept - { - string_len = (nullptr == c_array) ? 0 : - (MAX_CHARS < n_chars) ? MAX_CHARS : n_chars; - if (0 < string_len) - { - memcpy(string_data, c_array, string_len); - } - return *this; - } - - // Construct / assign from a C string - fixed_string ( - const char* c_string) noexcept - : fixed_string() - { - set(c_string != nullptr ? c_string : ""); - } - - fixed_string& operator = ( - const char* c_string) noexcept - { - set(c_string != nullptr ? c_string : ""); - return *this; - } - - // Construct / assign from a std::string - fixed_string ( - const std::string& str) noexcept - : fixed_string() - { - set(str.c_str()); - } - - fixed_string& operator = ( - const std::string& str) noexcept - { - set(str.c_str()); return *this; - } - - // Assign from fixed_string of any size - template fixed_string& operator = ( - const fixed_string& rhs) noexcept - { - set(rhs.c_str()); return *this; - } - - // Converters to standard types - const char* c_str() const noexcept - { - return string_data; - } - - std::string to_string() const - { - return std::string(string_data); - } - - // Equality comparisons - bool operator == ( - const char* rhs) const noexcept - { - return strncmp(string_data, rhs, MAX_CHARS) == 0; - } - - bool operator == ( - const std::string& rhs) const noexcept - { - return strncmp(string_data, rhs.c_str(), MAX_CHARS) == 0; - } - - template bool operator == ( - const fixed_string& rhs) const noexcept - { - return strncmp(string_data, rhs.c_str(), MAX_CHARS) == 0; - } - - // Inequality comparisons - bool operator != ( - const char* rhs) const noexcept - { - return strncmp(string_data, rhs, MAX_CHARS) != 0; - } - - bool operator != ( - const std::string& rhs) const noexcept - { - return strncmp(string_data, rhs.c_str(), MAX_CHARS) != 0; - } - - template bool operator != ( - const fixed_string& rhs) const noexcept - { - return strncmp(string_data, rhs.c_str(), MAX_CHARS) != 0; - } - - template bool operator < ( - const fixed_string& rhs) const noexcept - { - return 0 > compare(rhs); - } - - template bool operator > ( - const fixed_string& rhs) const noexcept - { - return 0 < compare(rhs); - } - - bool operator < ( - const std::string& rhs) const noexcept - { - return 0 > compare(rhs); - } - - bool operator > ( - const std::string& rhs) const noexcept - { - return 0 < compare(rhs); - } - - operator const char* () const noexcept { - return c_str(); - } - - size_t size() const noexcept - { - return string_len; - } - - /*! - * Compare with a C string. - * - * @param str C string to be compared with. - * - * @return Integer value with the result of the comparison as described in `std::string::compare()`. - */ - int compare( - const char* str) const noexcept - { - return strncmp(string_data, str, MAX_CHARS); - } - - /*! - * Compare with a std::string. - * - * @param str std::string to be compared with. - * - * @return Integer value with the result of the comparison as described in `std::string::compare()`. - */ - int compare( - const std::string& str) const noexcept - { - return strncmp(string_data, str.c_str(), MAX_CHARS); - } - - /*! - * Compare with a fixed_string - * - * @param str fixed_string to be compared with. - * - * @return Integer value with the result of the comparison as described in `std::string::compare()`. - */ - template int compare( - const fixed_string& str) const noexcept - { - return strncmp(string_data, str.c_str(), MAX_CHARS); - } - -private: - - void set( - const char* c_string) noexcept - { - char* result = (char*) MEMCCPY(string_data, c_string, '\0', MAX_CHARS); - string_len = (result == nullptr) ? MAX_CHARS : (size_t)(result - string_data) - 1u; - } - - char string_data[MAX_CHARS + 1]; ///< Holds string data, including ending null character. - size_t string_len; ///< Holds current string length. -}; - -using string_255 = fixed_string<255>; - -} /* namespace fastrtps */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#endif /* FASTRTPS_UTILS_FIXED_SIZE_STRING_HPP_ */ diff --git a/include/fastrtps/utils/md5.h b/include/fastrtps/utils/md5.h deleted file mode 100644 index b718947f6e6..00000000000 --- a/include/fastrtps/utils/md5.h +++ /dev/null @@ -1,101 +0,0 @@ -/* MD5 - converted to C++ class by Frank Thilo (thilo@unix-ag.org) - for bzflag (http://www.bzflag.org) - - based on: - - md5.h and md5.c - reference implementation of RFC 1321 - - Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - -*/ - -#ifndef BZF_MD5_H -#define BZF_MD5_H - -#include -#include - -#include "../fastrtps_dll.h" - -/** -* Class MD5, for calculating MD5 hashes of strings or byte arrays -* it is not meant to be fast or secure -* -* usage: 1) feed it blocks of uchars with update() -* 2) finalize() -* 3) get hexdigest() string -* or -* MD5(std::string).hexdigest() -* -* assumes that char is 8 bit and int is 32 bit - * @ingroup UTILITIES_MODULE -*/ -class RTPS_DllAPI MD5 -{ -public: - typedef unsigned char uint1; // 8bit - typedef unsigned int size_type; // must be 32bit - - MD5(); - MD5(const std::string& text); - void update(const unsigned char *buf, size_type length); - void update(const char *buf, size_type length); - MD5& finalize(); - std::string hexdigest() const; - friend std::ostream& operator<<(std::ostream&, MD5& md5); - uint1 digest[16]; // the result - - void init(); -private: - - - typedef unsigned int uint4; // 32bit - enum {blocksize = 64}; // VC6 won't eat a const static int here - - void transform(const uint1 block[blocksize]); - static void decode(uint4 output[], const uint1 input[], size_type len); - static void encode(uint1 output[], const uint4 input[], size_type len); - - bool finalized; - uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk - uint4 count[2]; // 64bit counter for number of bits (lo, hi) - uint4 state[4]; // digest so far - - - // low level logic operations - static inline uint4 F(uint4 x, uint4 y, uint4 z); - static inline uint4 G(uint4 x, uint4 y, uint4 z); - static inline uint4 H(uint4 x, uint4 y, uint4 z); - static inline uint4 I(uint4 x, uint4 y, uint4 z); - static inline uint4 rotate_left(uint4 x, int n); - static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); - static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); -}; - -std::string md5(const std::string str); - -#endif - diff --git a/include/fastrtps/xmlparser/XMLEndpointParser.h b/include/fastrtps/xmlparser/XMLEndpointParser.h deleted file mode 100644 index 64743af59b6..00000000000 --- a/include/fastrtps/xmlparser/XMLEndpointParser.h +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file XMLEndpointParser.h - * - */ - -#ifndef XMLENDPOINTPARSER_H_ -#define XMLENDPOINTPARSER_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -namespace tinyxml2 { -class XMLElement; -class XMLDocument; -} // namespace tinyxml2 - - - -namespace eprosima { -namespace fastrtps { -namespace rtps { -class ReaderProxyData; -class WriterProxyData; -} // namespace rtps - -namespace xmlparser { - -/** - * Class StaticRTPSParticipantInfo, contains the information of writers and readers loaded from the XML file. - *@ingroup DISCOVERY_MODULE - */ -class StaticRTPSParticipantInfo -{ -public: - - StaticRTPSParticipantInfo() - { - } - - virtual ~StaticRTPSParticipantInfo() - { - } - - //!RTPS PArticipant name - std::string m_RTPSParticipantName; - //!Vector of ReaderProxyData pointer - std::vector m_readers; - //!Vector of ReaderProxyData pointer - std::vector m_writers; -}; - -/** - * Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints. - * @ingroup DISCOVERY_MODULE - */ -class XMLEndpointParser : XMLParser -{ -public: - - XMLEndpointParser(); - virtual ~XMLEndpointParser(); - /** - * Load the XML file - * @param filename Name or data of the file to load and parse. - * The string could contain a filename (file://) or the XML content directly (data://), filename assumed if neither - * @return True if correct. - */ - XMLP_ret loadXMLFile( - std::string& filename); - /** - * Load the XML node - * @param doc Node to parse. - * @return True if correct. - */ - XMLP_ret loadXMLNode( - tinyxml2::XMLDocument& doc); - - void loadXMLParticipantEndpoint( - tinyxml2::XMLElement* xml_endpoint, - StaticRTPSParticipantInfo* pdata); - - /** - * Load a Reader endpoint. - * @param xml_endpoint Reference of a tree child for a reader. - * @param pdata Pointer to the RTPSParticipantInfo where the reader must be added. - * @return True if correctly added. - */ - XMLP_ret loadXMLReaderEndpoint( - tinyxml2::XMLElement* xml_endpoint, - StaticRTPSParticipantInfo* pdata); - /** - * Load a Writer endpoint. - * @param xml_endpoint Reference of a tree child for a writer. - * @param pdata Pointer to the RTPSParticipantInfo where the reader must be added. - * @return True if correctly added. - */ - XMLP_ret loadXMLWriterEndpoint( - tinyxml2::XMLElement* xml_endpoint, - StaticRTPSParticipantInfo* pdata); - /** - * Look for a reader in the previously loaded endpoints. - * @param[in] partname RTPSParticipant name - * @param[in] id Id of the reader - * @param[out] rdataptr Pointer to pointer to return the information. - * @return True if found. - */ - XMLP_ret lookforReader( - const char* partname, - uint16_t id, - rtps::ReaderProxyData** rdataptr); - /** - * Look for a writer in the previously loaded endpoints. - * @param[in] partname RTPSParticipant name - * @param[in] id Id of the writer - * @param[out] wdataptr Pointer to pointer to return the information. - * @return True if found - */ - XMLP_ret lookforWriter( - const char* partname, - uint16_t id, - rtps::WriterProxyData** wdataptr); - -private: - - XMLP_ret get_disable_positive_acks_qos( - tinyxml2::XMLElement* elem, - DisablePositiveACKsQosPolicy& disable_positive_acks_qos); - - std::set m_endpointIds; - std::set m_entityIds; - - std::vector m_RTPSParticipants; -}; - - -} /* xmlparser */ -} /* namespace */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* XMLENDPOINTPARSER_H_ */ diff --git a/include/fastrtps/xmlparser/XMLParser.h b/include/fastrtps/xmlparser/XMLParser.h deleted file mode 100644 index 62ce937eee4..00000000000 --- a/include/fastrtps/xmlparser/XMLParser.h +++ /dev/null @@ -1,696 +0,0 @@ -// Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef XML_PARSER_H_ -#define XML_PARSER_H_ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace tinyxml2 { -class XMLElement; -class XMLDocument; -} // namespace tinyxml2 - -namespace eprosima { -namespace fastrtps { -namespace xmlparser { - -class BaseNode; -template class DataNode; - -typedef std::unique_ptr up_base_node_t; -typedef std::vector up_base_node_vector_t; -typedef std::map node_att_map_t; -typedef node_att_map_t::iterator node_att_map_it_t; -typedef node_att_map_t::const_iterator node_att_map_cit_t; - -typedef std::shared_ptr sp_transport_t; -typedef std::map sp_transport_map_t; -typedef types::DynamicTypeBuilder* p_dynamictypebuilder_t; -typedef std::map p_dynamictype_map_t; - -typedef std::unique_ptr up_participantfactory_t; -typedef DataNode node_participantfactory_t; -typedef node_participantfactory_t* p_node_participantfactory_t; -typedef std::unique_ptr up_node_participantfactory_t; - -typedef std::unique_ptr up_participant_t; -typedef DataNode node_participant_t; -typedef node_participant_t* p_node_participant_t; -typedef std::unique_ptr up_node_participant_t; - -typedef std::unique_ptr up_publisher_t; -typedef DataNode node_publisher_t; -typedef node_publisher_t* p_node_publisher_t; -typedef std::unique_ptr up_node_publisher_t; - -typedef std::unique_ptr up_subscriber_t; -typedef DataNode node_subscriber_t; -typedef node_subscriber_t* p_node_subscriber_t; -typedef std::unique_ptr up_node_subscriber_t; - -typedef std::unique_ptr up_topic_t; -typedef DataNode node_topic_t; -typedef node_topic_t* p_node_topic_t; -typedef std::unique_ptr up_node_topic_t; - -typedef std::unique_ptr up_requester_t; -typedef DataNode node_requester_t; -typedef node_requester_t* p_node_requester_t; -typedef std::unique_ptr up_node_requester_t; - -typedef std::unique_ptr up_replier_t; -typedef DataNode node_replier_t; -typedef node_replier_t* p_node_replier_t; -typedef std::unique_ptr up_node_replier_t; - -/** - * Class XMLParser, used to load XML data. - * @ingroup XMLPARSER_MODULE - */ -class XMLParser -{ - -public: - - /** - * Load the default XML file. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadDefaultXMLFile( - up_base_node_t& root); - - /** - * Load a XML file. - * @param filename Name for the file to be loaded. - * @param root Root node. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXML( - const std::string& filename, - up_base_node_t& root); - - /** - * Load a XML data from buffer. - * @param data XML data to load. - * @param length Length of the XML data. - * @param root Root node. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXML( - const char* data, - size_t length, - up_base_node_t& root); - - /** - * Load a XML node. - * @param xmlDoc Node to be loaded. - * @param root Root node. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXML( - tinyxml2::XMLDocument& xmlDoc, - up_base_node_t& root); - - /** - * Load a XML node. - * @param profiles Node to be loaded. - * @param root Root node. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLProfiles( - tinyxml2::XMLElement& profiles, - up_base_node_t& root); - - /** - * Load a XML node. - * @param types Node to be loaded. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLDynamicTypes( - tinyxml2::XMLElement& types); - -protected: - - RTPS_DllAPI static XMLP_ret parseXML( - tinyxml2::XMLDocument& xmlDoc, - up_base_node_t& root); - - RTPS_DllAPI static XMLP_ret parseXMLProfiles( - tinyxml2::XMLElement& profiles, - up_base_node_t& root); - - RTPS_DllAPI static XMLP_ret parseProfiles( - tinyxml2::XMLElement* p_root, - BaseNode& profilesNode); - - - /** - * Load a XML log node and parses it. It applies the configuration of the node directly. - * @param p_root Node to be loaded. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret parseLogConfig( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLLibrarySettings( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLTransportsProf( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLDomainParticipantFactoryProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLParticipantProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLPublisherProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLSubscriberProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLTopicData( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLRequesterProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLReplierProf( - tinyxml2::XMLElement* p_root, - BaseNode& rootNode); - - RTPS_DllAPI static XMLP_ret parseXMLTransportData( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret validateXMLTransportElements( - tinyxml2::XMLElement& p_root); - - RTPS_DllAPI static XMLP_ret parseXMLCommonTransportData( - tinyxml2::XMLElement* p_root, - sp_transport_t p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLPortBasedTransportData( - tinyxml2::XMLElement* p_root, - std::shared_ptr p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLSocketTransportData( - tinyxml2::XMLElement* p_root, - std::shared_ptr p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLInterfaces( - tinyxml2::XMLElement* p_root, - std::shared_ptr p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLAllowlist( - tinyxml2::XMLElement* p_root, - std::shared_ptr p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLBlocklist( - tinyxml2::XMLElement* p_root, - std::shared_ptr p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLCommonTCPTransportData( - tinyxml2::XMLElement* p_root, - sp_transport_t p_transport); - - RTPS_DllAPI static XMLP_ret parseXMLCommonSharedMemTransportData( - tinyxml2::XMLElement* p_root, - sp_transport_t p_transport); - - RTPS_DllAPI static XMLP_ret parse_tls_config( - tinyxml2::XMLElement* p_root, - sp_transport_t tcp_transport); - - RTPS_DllAPI static XMLP_ret parseXMLReceptionThreads( - tinyxml2::XMLElement& p_root, - fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap& reception_threads); - - /** - * Load a XML consumer node and parses it. Adds the parsed consumer to Log directly. - * @param consumer Node to be loaded. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret parseXMLConsumer( - tinyxml2::XMLElement& consumer); - - RTPS_DllAPI static XMLP_ret parseXMLDynamicTypes( - tinyxml2::XMLElement& types); - - RTPS_DllAPI static XMLP_ret parseDynamicTypes( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLTypes( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLStructDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLUnionDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLEnumDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLAliasDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLBitsetDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static XMLP_ret parseXMLBitmaskDynamicType( - tinyxml2::XMLElement* p_root); - - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLBitfieldDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - uint16_t& position); - - RTPS_DllAPI static XMLP_ret parseXMLBitvalueDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - uint16_t& position); - - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId); - - RTPS_DllAPI static p_dynamictypebuilder_t parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - const std::string& values); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* p_profile, - DataNode& factory_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* p_profile, - DataNode& participant_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* p_profile, - DataNode& publisher_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* p_profile, - DataNode& subscriber_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* node, - DataNode& topic_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* node, - DataNode& requester_node); - - RTPS_DllAPI static XMLP_ret fillDataNode( - tinyxml2::XMLElement* node, - DataNode& replier_node); - - template - RTPS_DllAPI static void addAllAttributes( - tinyxml2::XMLElement* p_profile, - DataNode& node); - - RTPS_DllAPI static XMLP_ret getXMLEnum( - tinyxml2::XMLElement* elem, - fastrtps::IntraprocessDeliveryType* e, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLPropertiesPolicy( - tinyxml2::XMLElement* elem, - rtps::PropertyPolicy& propertiesPolicy, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLHistoryMemoryPolicy( - tinyxml2::XMLElement* elem, - rtps::MemoryManagementPolicy_t& historyMemoryPolicy, - uint8_t ident); - - static XMLP_ret getXMLExternalLocatorList( - tinyxml2::XMLElement* elem, - fastdds::rtps::ExternalLocators& external_locators, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLocatorList( - tinyxml2::XMLElement* elem, - rtps::LocatorList_t& locatorList, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLocatorUDPv4( - tinyxml2::XMLElement* elem, - rtps::Locator_t& locator, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLocatorUDPv6( - tinyxml2::XMLElement* elem, - rtps::Locator_t& locator, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLocatorTCPv4( - tinyxml2::XMLElement* elem, - rtps::Locator_t& locator, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLocatorTCPv6( - tinyxml2::XMLElement* elem, - rtps::Locator_t& locator, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLWriterTimes( - tinyxml2::XMLElement* elem, - rtps::WriterTimes& times, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLReaderTimes( - tinyxml2::XMLElement* elem, - rtps::ReaderTimes& times, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDuration( - tinyxml2::XMLElement* elem, - Duration_t& duration, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLWriterQosPolicies( - tinyxml2::XMLElement* elem, - WriterQos& qos, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLReaderQosPolicies( - tinyxml2::XMLElement* elem, - ReaderQos& qos, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLPublishModeQos( - tinyxml2::XMLElement* elem, - PublishModeQosPolicy& publishMode, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLGroupDataQos( - tinyxml2::XMLElement* elem, - GroupDataQosPolicy& groupData, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLTopicDataQos( - tinyxml2::XMLElement* elem, - TopicDataQosPolicy& topicData, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLPartitionQos( - tinyxml2::XMLElement* elem, - PartitionQosPolicy& partition, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLPresentationQos( - tinyxml2::XMLElement* elem, - PresentationQosPolicy& presentation, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDestinationOrderQos( - tinyxml2::XMLElement* elem, - DestinationOrderQosPolicy& destinationOrder, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLOwnershipStrengthQos( - tinyxml2::XMLElement* elem, - OwnershipStrengthQosPolicy& ownershipStrength, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLOwnershipQos( - tinyxml2::XMLElement* elem, - OwnershipQosPolicy& ownership, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLTimeBasedFilterQos( - tinyxml2::XMLElement* elem, - TimeBasedFilterQosPolicy& timeBasedFilter, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLUserDataQos( - tinyxml2::XMLElement* elem, - UserDataQosPolicy& userData, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLifespanQos( - tinyxml2::XMLElement* elem, - LifespanQosPolicy& lifespan, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLReliabilityQos( - tinyxml2::XMLElement* elem, - ReliabilityQosPolicy& reliability, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLivelinessQos( - tinyxml2::XMLElement* elem, - LivelinessQosPolicy& liveliness, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLLatencyBudgetQos( - tinyxml2::XMLElement* elem, - LatencyBudgetQosPolicy& latencyBudget, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDeadlineQos( - tinyxml2::XMLElement* elem, - DeadlineQosPolicy& deadline, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDurabilityServiceQos( - tinyxml2::XMLElement* elem, - DurabilityServiceQosPolicy& durabilityService, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDurabilityQos( - tinyxml2::XMLElement* elem, - DurabilityQosPolicy& durability, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLTopicAttributes( - tinyxml2::XMLElement* elem, - TopicAttributes& topic, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLHistoryQosPolicy( - tinyxml2::XMLElement* elem, - HistoryQosPolicy& historyQos, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLResourceLimitsQos( - tinyxml2::XMLElement* elem, - ResourceLimitsQosPolicy& resourceLimitsQos, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLContainerAllocationConfig( - tinyxml2::XMLElement* elem, - ResourceLimitedContainerConfig& resourceLimitsQos, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLThroughputController( - tinyxml2::XMLElement* elem, - rtps::ThroughputControllerDescriptor& throughputController, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLPortParameters( - tinyxml2::XMLElement* elem, - rtps::PortParameters& port, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLParticipantAllocationAttributes( - tinyxml2::XMLElement* elem, - rtps::RTPSParticipantAllocationAttributes& allocation, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLRemoteLocatorsAllocationAttributes( - tinyxml2::XMLElement* elem, - rtps::RemoteLocatorsAllocationAttributes& allocation, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLSendBuffersAllocationAttributes( - tinyxml2::XMLElement* elem, - rtps::SendBuffersAllocationAttributes& allocation, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDiscoverySettings( - tinyxml2::XMLElement* elem, - rtps::DiscoverySettings& settings, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLTypeLookupSettings( - tinyxml2::XMLElement* elem, - rtps::TypeLookupSettings& settings, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLInitialAnnouncementsConfig( - tinyxml2::XMLElement* elem, - rtps::InitialAnnouncementConfig& config, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLBuiltinAttributes( - tinyxml2::XMLElement* elem, - rtps::BuiltinAttributes& builtin, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLOctetVector( - tinyxml2::XMLElement* elem, - std::vector& octet_vector, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLInt( - tinyxml2::XMLElement* elem, - int* i, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLUint( - tinyxml2::XMLElement* elem, - unsigned int* ui, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLUint( - tinyxml2::XMLElement* elem, - uint16_t* ui16, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLUint( - tinyxml2::XMLElement* elem, - uint64_t* ui64, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLBool( - tinyxml2::XMLElement* elem, - bool* b, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLEnum( - tinyxml2::XMLElement* elem, - rtps::DiscoveryProtocol_t* e, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLList( - tinyxml2::XMLElement* elem, - eprosima::fastdds::rtps::RemoteServerList_t& list, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLEnum( - tinyxml2::XMLElement* elem, - rtps::ParticipantFilteringFlags_t* e, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLRemoteServer( - tinyxml2::XMLElement* elem, - eprosima::fastdds::rtps::RemoteServerAttributes& server, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLString( - tinyxml2::XMLElement* elem, - std::string* s, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLTransports( - tinyxml2::XMLElement* elem, - std::vector>& transports, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDisablePositiveAcksQos( - tinyxml2::XMLElement* elem, - DisablePositiveACKsQosPolicy& disablePositiveAcks, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDataSharingQos( - tinyxml2::XMLElement* elem, - DataSharingQosPolicy& data_sharing, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLguidPrefix( - tinyxml2::XMLElement* elem, - rtps::GuidPrefix_t& prefix, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLDomainParticipantFactoryQos( - tinyxml2::XMLElement& elem, - fastdds::dds::DomainParticipantFactoryQos& qos); - - RTPS_DllAPI static XMLP_ret getXMLPublisherAttributes( - tinyxml2::XMLElement* elem, - PublisherAttributes& publisher, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLSubscriberAttributes( - tinyxml2::XMLElement* elem, - SubscriberAttributes& subscriber, - uint8_t ident); - - RTPS_DllAPI static XMLP_ret getXMLThreadSettings( - tinyxml2::XMLElement& elem, - fastdds::rtps::ThreadSettings& thread_setting); - - /* - Return XMLP_ret::XML_OK when OK, XMLP_ret::XML_NOK when port attribute is not present, and - XMLP_ret::XML_ERROR if error - */ - RTPS_DllAPI static XMLP_ret getXMLThreadSettingsWithPort( - tinyxml2::XMLElement& elem, - fastdds::rtps::ThreadSettings& thread_setting, - uint32_t& port); - - RTPS_DllAPI static XMLP_ret getXMLEntityFactoryQos( - tinyxml2::XMLElement& elem, - fastdds::dds::EntityFactoryQosPolicy& entity_factory); - - RTPS_DllAPI static XMLP_ret getXMLBuiltinTransports( - tinyxml2::XMLElement* elem, - eprosima::fastdds::rtps::BuiltinTransports* bt, - eprosima::fastdds::rtps::BuiltinTransportsOptions* bt_opts, - uint8_t ident); -}; - -} // namespace xmlparser -} // namespace fastrtps -} // namespace eprosima - -#endif // ifndef XML_PARSER_H_ diff --git a/include/fastrtps/xmlparser/XMLProfileManager.h b/include/fastrtps/xmlparser/XMLProfileManager.h deleted file mode 100644 index 90097180fc2..00000000000 --- a/include/fastrtps/xmlparser/XMLProfileManager.h +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef XML_PROFILE_MANAGER_H_ -#define XML_PROFILE_MANAGER_H_ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace xmlparser { - -using participant_factory_map_t = std::map; -using part_factory_map_iterator_t = participant_factory_map_t::iterator; -using participant_map_t = std::map; -using part_map_iterator_t = participant_map_t::iterator; -using publisher_map_t = std::map; -using publ_map_iterator_t = publisher_map_t::iterator; -using subscriber_map_t = std::map; -using subs_map_iterator_t = subscriber_map_t::iterator; -using topic_map_t = std::map; -using topic_map_iterator_t = topic_map_t::iterator; -using requester_map_t = std::map; -using requester_map_iterator_t = requester_map_t::iterator; -using replier_map_t = std::map; -using replier_map_iterator_t = replier_map_t::iterator; -using xmlfiles_map_t = std::map; -using xmlfile_map_iterator_t = xmlfiles_map_t::iterator; - -/** - * Class XMLProfileManager, used to make available profiles from XML file. - * @ingroup XMLPARSER_MODULE - */ -class XMLProfileManager -{ -public: - - /** - * Load the default profiles XML file. - */ - RTPS_DllAPI static void loadDefaultXMLFile(); - - /** - * Load a profiles XML file. - * @param filename Name for the file to be loaded. - * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, - * XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLFile( - const std::string& filename); - - /** - * Load a profiles XML string. - * @param data Buffer containing the data. - * @param length Length of data. - * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, - * XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLString( - const char* data, - size_t length); - - /** - * Load a profiles XML node. - * @param doc Node to be loaded. - * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, - * XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLNode( - tinyxml2::XMLDocument& doc); - - /** - * Load a profiles XML node. - * @param profiles Node to be loaded. - * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, - * XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLProfiles( - tinyxml2::XMLElement& profiles); - - /** - * Load a dynamic types XML node. - * @param types Node to be loaded. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret loadXMLDynamicTypes( - tinyxml2::XMLElement& types); - - /** - * Library settings setter. - * @param library_settings New value for library settings. - */ - RTPS_DllAPI static void library_settings( - const LibrarySettingsAttributes& library_settings); - - /** - * Library settings getter. - * @return const ref to current library settings. - */ - RTPS_DllAPI static const LibrarySettingsAttributes& library_settings(); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @param log_error Flag to log an error if the profile_name is not found. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. - */ - RTPS_DllAPI static XMLP_ret fillParticipantAttributes( - const std::string& profile_name, - ParticipantAttributes& atts, - bool log_error = true); - - //!Fills participant_attributes with the default values. - RTPS_DllAPI static void getDefaultParticipantAttributes( - ParticipantAttributes& participant_attributes); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param qos Structure to be filled. - * @param log_error Flag to log an error if the profile_name is not found. Defaults true. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret fillDomainParticipantFactoryQos( - const std::string& profile_name, - fastdds::dds::DomainParticipantFactoryQos& qos, - bool log_error = true); - - /** - * Fills input domain participant factory qos with the default values. - * @param qos Structure to be filled. - */ - RTPS_DllAPI static void getDefaultDomainParticipantFactoryQos( - fastdds::dds::DomainParticipantFactoryQos& qos); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @param log_error Flag to log an error if the profile_name is not found. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. - */ - RTPS_DllAPI static XMLP_ret fillPublisherAttributes( - const std::string& profile_name, - PublisherAttributes& atts, - bool log_error = true); - - //!Fills publisher_attributes with the default values. - RTPS_DllAPI static void getDefaultPublisherAttributes( - PublisherAttributes& publisher_attributes); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @param log_error Flag to log an error if the profile_name is not found. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. - */ - RTPS_DllAPI static XMLP_ret fillSubscriberAttributes( - const std::string& profile_name, - SubscriberAttributes& atts, - bool log_error = true); - - //!Fills subscriber_attributes with the default values. - RTPS_DllAPI static void getDefaultSubscriberAttributes( - SubscriberAttributes& subscriber_attributes); - - //!Add a new transport instance along with its id. - RTPS_DllAPI static bool insertTransportById( - const std::string& transport_id, - sp_transport_t transport); - - //!Retrieves a transport instance by its id. - RTPS_DllAPI static sp_transport_t getTransportById( - const std::string& transport_id); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret fillTopicAttributes( - const std::string& profile_name, - TopicAttributes& atts); - - //!Fills topic_attributes with the default values. - RTPS_DllAPI static void getDefaultTopicAttributes( - TopicAttributes& topic_attributes); - - //!Add a new dynamic type instance along with its name. - RTPS_DllAPI static bool insertDynamicTypeByName( - const std::string& type_name, - p_dynamictypebuilder_t type); - - //!Retrieves a transport instance by its name. - RTPS_DllAPI static p_dynamictypebuilder_t getDynamicTypeByName( - const std::string& type_name); - - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret fillRequesterAttributes( - const std::string& profile_name, - RequesterAttributes& atts); - - /** - * Search for the profile specified and fill the structure. - * @param profile_name Name for the profile to be used to fill the structure. - * @param atts Structure to be filled. - * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. - */ - RTPS_DllAPI static XMLP_ret fillReplierAttributes( - const std::string& profile_name, - ReplierAttributes& atts); - - /** - * Deletes the XMLProfileManager instance. - * FastDDS's Domain calls this method automatically on its destructor, but - * if using XMLProfileManager outside of FastDDS, it should be called manually. - */ - RTPS_DllAPI static void DeleteInstance(); - - /** - * Retrieves a DynamicPubSubType for the given dynamic type name. - * Any instance retrieve by calling this method must be deleted calling the - * XMLProfileManager::DeleteDynamicPubSubType method. - */ - RTPS_DllAPI static types::DynamicPubSubType* CreateDynamicPubSubType( - const std::string& type_name); - - /** - * Deletes the given DynamicPubSubType previously created by calling - * XMLProfileManager::CreateDynamicPubSubType method. - */ - RTPS_DllAPI static void DeleteDynamicPubSubType( - types::DynamicPubSubType* type); - -private: - - RTPS_DllAPI static XMLP_ret extractProfiles( - up_base_node_t properties, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractDomainParticipantFactoryProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractParticipantProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractPublisherProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractSubscriberProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractTopicProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractRequesterProfile( - up_base_node_t& profile, - const std::string& filename); - - RTPS_DllAPI static XMLP_ret extractReplierProfile( - up_base_node_t& profile, - const std::string& filename); - - static BaseNode* root; - - static LibrarySettingsAttributes library_settings_; - - static participant_factory_map_t participant_factory_profiles_; - - static participant_map_t participant_profiles_; - - static publisher_map_t publisher_profiles_; - - static subscriber_map_t subscriber_profiles_; - - static topic_map_t topic_profiles_; - - static requester_map_t requester_profiles_; - - static replier_map_t replier_profiles_; - - static xmlfiles_map_t xml_files_; - - static sp_transport_map_t transport_profiles_; - - static p_dynamictype_map_t dynamic_types_; -}; - -} /* xmlparser */ -} /* namespace */ -} /* namespace eprosima */ - -#endif // ifndef XML_PROFILE_MANAGER_H_ diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 deleted file mode 100644 index 28e48cbefb6..00000000000 --- a/m4/ax_check_openssl.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) -# -# DESCRIPTION -# -# Look for OpenSSL in a number of default spots, or in a user-selected -# spot (via --with-openssl). Sets -# -# OPENSSL_INCLUDES to the include directives required -# OPENSSL_LIBS to the -l directives required -# OPENSSL_LDFLAGS to the -L or -R flags required -# -# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately -# -# This macro sets OPENSSL_INCLUDES such that source files should use the -# openssl/ directory in include directives: -# -# #include -# -# LICENSE -# -# Copyright (c) 2009,2010 Zmanda Inc. -# Copyright (c) 2009,2010 Dustin J. Mitchell -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 10 - -AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) -AC_DEFUN([AX_CHECK_OPENSSL], [ - found=false - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl=DIR], - [root of the OpenSSL directory])], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([Invalid --with-openssl value]) - ;; - *) ssldirs="$withval" - ;; - esac - ], [ - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) - if test x"$PKG_CONFIG" != x""; then - OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - ] - ) - - - # note that we #include , so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - OPENSSL_INCLUDES= - for ssldir in $ssldirs; do - AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) - if test -f "$ssldir/include/openssl/ssl.h"; then - OPENSSL_INCLUDES="-I$ssldir/include" - OPENSSL_LDFLAGS="-L$ssldir/lib" - OPENSSL_LIBS="-lssl -lcrypto" - found=true - AC_MSG_RESULT([yes]) - break - else - AC_MSG_RESULT([no]) - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) - echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ - "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], - [ - AC_MSG_RESULT([yes]) - $1 - ], [ - AC_MSG_RESULT([no]) - $2 - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - AC_SUBST([OPENSSL_INCLUDES]) - AC_SUBST([OPENSSL_LIBS]) - AC_SUBST([OPENSSL_LDFLAGS]) -]) diff --git a/m4/ax_cxx_compile_stdcxx_0x.m4 b/m4/ax_cxx_compile_stdcxx_0x.m4 deleted file mode 100644 index 719f92c62cf..00000000000 --- a/m4/ax_cxx_compile_stdcxx_0x.m4 +++ /dev/null @@ -1,109 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_0X -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++0x -# standard. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [ - AC_CACHE_CHECK(if g++ supports C++0x features without additional flags, - ax_cv_cxx_compile_cxx0x_native, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c);],, - ax_cv_cxx_compile_cxx0x_native=yes, ax_cv_cxx_compile_cxx0x_native=no) - AC_LANG_RESTORE - ]) - - AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x, - ax_cv_cxx_compile_cxx0x_cxx, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -std=c++0x" - AC_TRY_COMPILE([ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c);],, - ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE - ]) - - AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x, - ax_cv_cxx_compile_cxx0x_gxx, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -std=gnu++0x" - AC_TRY_COMPILE([ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c);],, - ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no) - CXXFLAGS="$ac_save_CXXFLAGS" - AC_LANG_RESTORE - ]) - - if test "$ax_cv_cxx_compile_cxx0x_native" = yes || - test "$ax_cv_cxx_compile_cxx0x_cxx" = yes || - test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then - AC_DEFINE(HAVE_CXX0X, 1,[Define if g++ supports C++0x features. ]) - else - AC_DEFINE(HAVE_CXX0X, 0,[Define if g++ supports C++0x features. ]) - fi -]) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 deleted file mode 100644 index 395b13d2a6d..00000000000 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ /dev/null @@ -1,167 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXXFLAGS to enable support. -# -# The first argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The second argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline C++11 support is required and that the macro -# should error out if no mode with that support is found. If specified -# 'optional', then configuration proceeds regardless, after defining -# HAVE_CXX11 if and only if a supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - struct Base { - virtual void f() {} - }; - struct Child : public Base { - virtual void f() override {} - }; - - typedef check> right_angle_brackets; - - int a; - decltype(a) b; - - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c); - - auto d = a; - auto l = [](){}; - // Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable] - struct use_l { use_l() { l(); } }; - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this - namespace test_template_alias_sfinae { - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { - func(0); - } - } -]]) - -AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl - m4_if([$1], [], [], - [$1], [ext], [], - [$1], [noext], [], - [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl - m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], - [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], - [$2], [optional], [ax_cxx_compile_cxx11_required=false], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++11 features by default, - ax_cv_cxx_compile_cxx11, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [ax_cv_cxx_compile_cxx11=yes], - [ax_cv_cxx_compile_cxx11=no])]) - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes - fi - - m4_if([$1], [noext], [], [dnl - if test x$ac_success = xno; then - for switch in -std=gnu++11 -std=gnu++0x; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi]) - - m4_if([$1], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - for switch in -std=c++11 -std=c++0x +std=c++11; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, - $cachevar, - [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXXFLAGS="$ac_save_CXXFLAGS"]) - if eval test x\$$cachevar = xyes; then - CXXFLAGS="$CXXFLAGS $switch" - ac_success=yes - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx11_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) - fi - else - if test x$ac_success = xno; then - HAVE_CXX11=0 - AC_MSG_NOTICE([No compiler with C++11 support was found]) - else - HAVE_CXX11=1 - AC_DEFINE(HAVE_CXX11,1, - [define if the compiler supports basic C++11 syntax]) - fi - - AC_SUBST(HAVE_CXX11) - fi -]) diff --git a/package.xml b/package.xml index 138d7d371ec..c5d39b49c0c 100644 --- a/package.xml +++ b/package.xml @@ -1,10 +1,10 @@ - fastrtps - 2.14.1 + fastdds + 3.0.0 - *eprosima Fast DDS* (formerly Fast RTPS) is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. RTPS is also the wire interoperability protocol defined for the Data Distribution Service (DDS) standard. *eProsima Fast DDS* expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. + *eprosima Fast DDS* is a C++ implementation of the DDS (Data Distribution Service) standard of the OMG (Object Management Group). eProsima Fast DDS implements the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium. RTPS is also the wire interoperability protocol defined for the Data Distribution Service (DDS) standard. *eProsima Fast DDS* expose an API to access directly the RTPS protocol, giving the user full access to the protocol internals. Miguel Company Eduardo Ponz diff --git a/doc/images/fastdds_github_banner.png b/resources/images/fastdds_github_banner.png similarity index 100% rename from doc/images/fastdds_github_banner.png rename to resources/images/fastdds_github_banner.png diff --git a/utils/images/logo/eProsimaLogo.jpg b/resources/images/logo/eProsimaLogo.jpg similarity index 100% rename from utils/images/logo/eProsimaLogo.jpg rename to resources/images/logo/eProsimaLogo.jpg diff --git a/utils/images/logo/eProsimaLogo.png b/resources/images/logo/eProsimaLogo.png similarity index 100% rename from utils/images/logo/eProsimaLogo.png rename to resources/images/logo/eProsimaLogo.png diff --git a/resources/xsd/fastRTPS_profiles.xsd b/resources/xsd/fastRTPS_profiles.xsd deleted file mode 100644 index 17f28870206..00000000000 --- a/resources/xsd/fastRTPS_profiles.xsd +++ /dev/null @@ -1,2031 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/xsd/fastdds_profiles.xsd b/resources/xsd/fastdds_profiles.xsd new file mode 100644 index 00000000000..aa1845d84d4 --- /dev/null +++ b/resources/xsd/fastdds_profiles.xsd @@ -0,0 +1,2086 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index bac5fec9875..7a5e2ab085f 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -14,8 +14,10 @@ include(CheckCXXSourceCompiles) -# Set source files +add_subdirectory(fastdds/log) +add_subdirectory(fastdds/xtypes) +# Set source files if(WIN32) file(GLOB_RECURSE ALL_HEADERS @@ -31,48 +33,117 @@ endif(WIN32) file(GLOB DDSSQLFILTER_SOURCES fastdds/topic/DDSSQLFilter/*.cpp) + set(${PROJECT_NAME}_source_files ${ALL_HEADERS} ${DDSSQLFILTER_SOURCES} + fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp + fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + fastdds/core/condition/Condition.cpp + fastdds/core/condition/ConditionNotifier.cpp + fastdds/core/condition/GuardCondition.cpp + fastdds/core/condition/StatusCondition.cpp + fastdds/core/condition/StatusConditionImpl.cpp + fastdds/core/condition/WaitSet.cpp + fastdds/core/condition/WaitSetImpl.cpp + fastdds/core/Entity.cpp + fastdds/core/policy/ParameterList.cpp + fastdds/core/policy/QosPolicyUtils.cpp + fastdds/domain/DomainParticipant.cpp + fastdds/domain/DomainParticipantFactory.cpp + fastdds/domain/DomainParticipantImpl.cpp + fastdds/domain/qos/DomainParticipantFactoryQos.cpp + fastdds/domain/qos/DomainParticipantQos.cpp + fastdds/log/FileConsumer.cpp fastdds/log/Log.cpp fastdds/log/OStreamConsumer.cpp - fastdds/log/StdoutErrConsumer.cpp fastdds/log/StdoutConsumer.cpp - fastdds/log/FileConsumer.cpp - + fastdds/log/StdoutErrConsumer.cpp + fastdds/publisher/DataWriter.cpp + fastdds/publisher/DataWriterHistory.cpp + fastdds/publisher/DataWriterImpl.cpp + fastdds/publisher/Publisher.cpp + fastdds/publisher/PublisherImpl.cpp + fastdds/publisher/qos/DataWriterQos.cpp + fastdds/publisher/qos/PublisherQos.cpp + fastdds/publisher/qos/WriterQos.cpp + fastdds/subscriber/DataReader.cpp + fastdds/subscriber/DataReaderImpl.cpp + fastdds/subscriber/history/DataReaderHistory.cpp + fastdds/subscriber/qos/DataReaderQos.cpp + fastdds/subscriber/qos/ReaderQos.cpp + fastdds/subscriber/qos/SubscriberQos.cpp + fastdds/subscriber/ReadCondition.cpp + fastdds/subscriber/Subscriber.cpp + fastdds/subscriber/SubscriberImpl.cpp + fastdds/topic/ContentFilteredTopic.cpp + fastdds/topic/ContentFilteredTopicImpl.cpp + fastdds/topic/qos/TopicQos.cpp + fastdds/topic/Topic.cpp + fastdds/topic/TopicDataType.cpp + fastdds/topic/TopicImpl.cpp + fastdds/topic/TopicProxyFactory.cpp + fastdds/topic/TypeSupport.cpp + fastdds/utils/QosConverters.cpp + rtps/attributes/PropertyPolicy.cpp + rtps/attributes/RTPSParticipantAttributes.cpp + rtps/attributes/ThreadSettings.cpp + rtps/attributes/TopicAttributes.cpp + rtps/builtin/BuiltinProtocols.cpp + rtps/builtin/data/ParticipantProxyData.cpp + rtps/builtin/data/ReaderProxyData.cpp + rtps/builtin/data/WriterProxyData.cpp + rtps/builtin/discovery/database/backup/SharedBackupFunctions.cpp + rtps/builtin/discovery/database/DiscoveryDataBase.cpp + rtps/builtin/discovery/database/DiscoveryParticipantInfo.cpp + rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp + rtps/builtin/discovery/database/DiscoverySharedInfo.cpp + rtps/builtin/discovery/endpoint/EDP.cpp + rtps/builtin/discovery/endpoint/EDPClient.cpp + rtps/builtin/discovery/endpoint/EDPServer.cpp + rtps/builtin/discovery/endpoint/EDPServerListeners.cpp + rtps/builtin/discovery/endpoint/EDPSimple.cpp + rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp + rtps/builtin/discovery/endpoint/EDPStatic.cpp + rtps/builtin/discovery/participant/DirectMessageSender.cpp + rtps/builtin/discovery/participant/PDP.cpp + rtps/builtin/discovery/participant/PDPClient.cpp + rtps/builtin/discovery/participant/PDPListener.cpp + rtps/builtin/discovery/participant/PDPServer.cpp + rtps/builtin/discovery/participant/PDPServerListener.cpp + rtps/builtin/discovery/participant/PDPSimple.cpp + rtps/builtin/discovery/participant/ServerAttributes.cpp + rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp + rtps/builtin/discovery/participant/timedevent/DServerEvent.cpp + rtps/builtin/liveliness/WLP.cpp + rtps/builtin/liveliness/WLPListener.cpp rtps/common/GuidPrefix_t.cpp rtps/common/LocatorWithMask.cpp rtps/common/Time_t.cpp - rtps/resources/ResourceEvent.cpp - rtps/resources/TimedEvent.cpp - rtps/resources/TimedEventImpl.cpp - rtps/writer/LivelinessManager.cpp - rtps/writer/LocatorSelectorSender.cpp - rtps/writer/RTPSWriter.cpp - rtps/writer/StatefulWriter.cpp - rtps/writer/ReaderProxy.cpp - rtps/writer/StatelessWriter.cpp - rtps/writer/ReaderLocator.cpp + rtps/common/Token.cpp + rtps/DataSharing/DataSharingListener.cpp + rtps/DataSharing/DataSharingNotification.cpp + rtps/DataSharing/DataSharingPayloadPool.cpp + rtps/exceptions/Exception.cpp + rtps/flowcontrol/FlowControllerConsts.cpp + rtps/flowcontrol/FlowControllerFactory.cpp + rtps/flowcontrol/ThroughputControllerDescriptor.cpp rtps/history/CacheChangePool.cpp rtps/history/History.cpp - rtps/history/WriterHistory.cpp rtps/history/ReaderHistory.cpp rtps/history/TopicPayloadPool.cpp rtps/history/TopicPayloadPoolRegistry.cpp - rtps/DataSharing/DataSharingPayloadPool.cpp - rtps/DataSharing/DataSharingListener.cpp - rtps/DataSharing/DataSharingNotification.cpp - rtps/reader/WriterProxy.cpp - rtps/reader/StatefulReader.cpp - rtps/reader/StatelessReader.cpp - rtps/reader/RTPSReader.cpp + rtps/history/WriterHistory.cpp + rtps/messages/MessageReceiver.cpp + rtps/messages/RTPSGapBuilder.cpp rtps/messages/RTPSMessageCreator.cpp rtps/messages/RTPSMessageGroup.cpp - rtps/messages/RTPSGapBuilder.cpp rtps/messages/SendBuffersManager.cpp - rtps/messages/MessageReceiver.cpp rtps/messages/submessages/AckNackMsg.hpp rtps/messages/submessages/DataMsg.hpp rtps/messages/submessages/GapMsg.hpp @@ -82,53 +153,19 @@ set(${PROJECT_NAME}_source_files rtps/network/utils/external_locators.cpp rtps/network/utils/netmask_filter.cpp rtps/network/utils/network.cpp - rtps/attributes/RTPSParticipantAttributes.cpp rtps/participant/RTPSParticipant.cpp rtps/participant/RTPSParticipantImpl.cpp + rtps/persistence/PersistenceFactory.cpp + rtps/reader/RTPSReader.cpp + rtps/reader/StatefulPersistentReader.cpp + rtps/reader/StatefulReader.cpp + rtps/reader/StatelessPersistentReader.cpp + rtps/reader/StatelessReader.cpp + rtps/reader/WriterProxy.cpp + rtps/resources/ResourceEvent.cpp + rtps/resources/TimedEvent.cpp + rtps/resources/TimedEventImpl.cpp rtps/RTPSDomain.cpp - fastrtps_deprecated/Domain.cpp - fastrtps_deprecated/participant/Participant.cpp - fastrtps_deprecated/participant/ParticipantImpl.cpp - fastrtps_deprecated/publisher/Publisher.cpp - fastrtps_deprecated/publisher/PublisherImpl.cpp - fastrtps_deprecated/publisher/PublisherHistory.cpp - fastrtps_deprecated/subscriber/Subscriber.cpp - fastrtps_deprecated/subscriber/SubscriberImpl.cpp - fastrtps_deprecated/subscriber/SubscriberHistory.cpp - fastdds/publisher/DataWriter.cpp - fastdds/publisher/DataWriterImpl.cpp - fastdds/publisher/DataWriterHistory.cpp - fastdds/topic/ContentFilteredTopic.cpp - fastdds/topic/ContentFilteredTopicImpl.cpp - fastdds/topic/Topic.cpp - fastdds/topic/TopicImpl.cpp - fastdds/topic/TopicProxyFactory.cpp - fastdds/topic/TypeSupport.cpp - fastdds/topic/TopicDataType.cpp - fastdds/topic/qos/TopicQos.cpp - fastdds/publisher/qos/DataWriterQos.cpp - fastdds/subscriber/qos/DataReaderQos.cpp - fastdds/publisher/PublisherImpl.cpp - fastdds/publisher/qos/PublisherQos.cpp - fastdds/publisher/Publisher.cpp - fastdds/subscriber/SubscriberImpl.cpp - fastdds/subscriber/qos/SubscriberQos.cpp - fastdds/subscriber/Subscriber.cpp - fastdds/subscriber/DataReader.cpp - fastdds/subscriber/DataReaderImpl.cpp - fastdds/subscriber/ReadCondition.cpp - fastdds/subscriber/history/DataReaderHistory.cpp - fastdds/domain/DomainParticipantFactory.cpp - fastdds/domain/DomainParticipantImpl.cpp - fastdds/domain/DomainParticipant.cpp - fastdds/domain/qos/DomainParticipantQos.cpp - fastdds/domain/qos/DomainParticipantFactoryQos.cpp - fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - fastdds/builtin/common/RPCHeadersImpl.cpp - fastdds/builtin/typelookup/TypeLookupManager.cpp - fastdds/builtin/typelookup/TypeLookupRequestListener.cpp - fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - rtps/transport/TransportInterface.cpp rtps/transport/ChainingTransport.cpp rtps/transport/ChannelResource.cpp rtps/transport/network/NetmaskFilterKind.cpp @@ -146,121 +183,38 @@ set(${PROJECT_NAME}_source_files rtps/transport/TCPv4Transport.cpp rtps/transport/TCPv6Transport.cpp rtps/transport/test_UDPv4Transport.cpp + rtps/transport/TransportInterface.cpp rtps/transport/UDPChannelResource.cpp rtps/transport/UDPTransportInterface.cpp rtps/transport/UDPv4Transport.cpp rtps/transport/UDPv6Transport.cpp - - dynamic-types/AnnotationDescriptor.cpp - dynamic-types/AnnotationParameterValue.cpp - dynamic-types/DynamicData.cpp - dynamic-types/DynamicDataFactory.cpp - dynamic-types/DynamicType.cpp - dynamic-types/DynamicPubSubType.cpp - dynamic-types/DynamicTypePtr.cpp - dynamic-types/DynamicDataPtr.cpp - dynamic-types/DynamicTypeBuilder.cpp - dynamic-types/DynamicTypeBuilderPtr.cpp - dynamic-types/DynamicTypeBuilderFactory.cpp - dynamic-types/DynamicTypeMember.cpp - dynamic-types/MemberDescriptor.cpp - dynamic-types/TypeDescriptor.cpp - dynamic-types/TypeIdentifier.cpp - dynamic-types/TypeIdentifierTypes.cpp - dynamic-types/TypeObject.cpp - dynamic-types/TypeObjectHashId.cpp - dynamic-types/TypeObjectFactory.cpp - dynamic-types/TypeNamesGenerator.cpp - dynamic-types/TypesBase.cpp - dynamic-types/BuiltinAnnotationsTypeObject.cpp - dynamic-types/DynamicDataHelper.cpp - - fastrtps_deprecated/attributes/TopicAttributes.cpp - fastdds/core/Entity.cpp - fastdds/core/condition/Condition.cpp - fastdds/core/condition/ConditionNotifier.cpp - fastdds/core/condition/GuardCondition.cpp - fastdds/core/condition/StatusCondition.cpp - fastdds/core/condition/StatusConditionImpl.cpp - fastdds/core/condition/WaitSet.cpp - fastdds/core/condition/WaitSetImpl.cpp - fastdds/core/policy/ParameterList.cpp - fastdds/core/policy/QosPolicyUtils.cpp - fastdds/publisher/qos/WriterQos.cpp - fastdds/subscriber/qos/ReaderQos.cpp - fastdds/utils/QosConverters.cpp - rtps/builtin/BuiltinProtocols.cpp - rtps/builtin/discovery/participant/DirectMessageSender.cpp - rtps/builtin/discovery/participant/PDP.cpp - rtps/builtin/discovery/participant/ServerAttributes.cpp - rtps/builtin/discovery/participant/PDPSimple.cpp - rtps/builtin/discovery/participant/PDPListener.cpp - rtps/builtin/discovery/endpoint/EDP.cpp - rtps/builtin/discovery/endpoint/EDPSimple.cpp - rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp - rtps/builtin/discovery/endpoint/EDPStatic.cpp - rtps/builtin/liveliness/WLP.cpp - rtps/builtin/liveliness/WLPListener.cpp - rtps/builtin/data/ParticipantProxyData.cpp - rtps/builtin/data/WriterProxyData.cpp - rtps/builtin/data/ReaderProxyData.cpp - rtps/flowcontrol/ThroughputControllerDescriptor.cpp - rtps/flowcontrol/FlowControllerConsts.cpp - rtps/flowcontrol/FlowControllerFactory.cpp - rtps/exceptions/Exception.cpp - rtps/attributes/PropertyPolicy.cpp - rtps/attributes/ThreadSettings.cpp - rtps/common/Token.cpp - rtps/xmlparser/XMLParserCommon.cpp - rtps/xmlparser/XMLElementParser.cpp - rtps/xmlparser/XMLDynamicParser.cpp - rtps/xmlparser/XMLEndpointParser.cpp - rtps/xmlparser/XMLParser.cpp - rtps/xmlparser/XMLProfileManager.cpp + rtps/writer/LivelinessManager.cpp + rtps/writer/LocatorSelectorSender.cpp rtps/writer/PersistentWriter.cpp - rtps/writer/StatelessPersistentWriter.cpp + rtps/writer/ReaderLocator.cpp + rtps/writer/ReaderProxy.cpp + rtps/writer/RTPSWriter.cpp rtps/writer/StatefulPersistentWriter.cpp - rtps/reader/StatelessPersistentReader.cpp - rtps/reader/StatefulPersistentReader.cpp - rtps/persistence/PersistenceFactory.cpp - - rtps/builtin/discovery/database/backup/SharedBackupFunctions.cpp - rtps/builtin/discovery/endpoint/EDPClient.cpp - rtps/builtin/discovery/endpoint/EDPServer.cpp - rtps/builtin/discovery/endpoint/EDPServerListeners.cpp - rtps/builtin/discovery/database/DiscoveryDataBase.cpp - rtps/builtin/discovery/database/DiscoveryParticipantInfo.cpp - rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp - rtps/builtin/discovery/database/DiscoverySharedInfo.cpp - rtps/builtin/discovery/participant/PDPClient.cpp - rtps/builtin/discovery/participant/PDPServer.cpp - rtps/builtin/discovery/participant/PDPServerListener.cpp - rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp - rtps/builtin/discovery/participant/timedevent/DServerEvent.cpp - + rtps/writer/StatefulWriter.cpp + rtps/writer/StatelessPersistentWriter.cpp + rtps/writer/StatelessWriter.cpp + statistics/fastdds/domain/DomainParticipant.cpp + statistics/fastdds/publisher/qos/DataWriterQos.cpp + statistics/fastdds/subscriber/qos/DataReaderQos.cpp utils/IPFinder.cpp + utils/IPLocator.cpp utils/md5.cpp + utils/string_convert.cpp utils/StringMatching.cpp - utils/IPLocator.cpp - utils/System.cpp utils/SystemInfo.cpp utils/TimedConditionVariable.cpp - utils/string_convert.cpp utils/UnitsParser.cpp - - dds/core/types.cpp - dds/core/Exception.cpp - dds/domain/DomainParticipant.cpp - dds/pub/Publisher.cpp - dds/pub/AnyDataWriter.cpp - dds/pub/DataWriter.cpp - dds/sub/Subscriber.cpp - dds/sub/DataReader.cpp - dds/topic/Topic.cpp - - statistics/fastdds/domain/DomainParticipant.cpp - statistics/fastdds/publisher/qos/DataWriterQos.cpp - statistics/fastdds/subscriber/qos/DataReaderQos.cpp + xmlparser/XMLDynamicParser.cpp + xmlparser/XMLElementParser.cpp + xmlparser/XMLEndpointParser.cpp + xmlparser/XMLParser.cpp + xmlparser/XMLParserCommon.cpp + xmlparser/XMLProfileManager.cpp ) # Statistics support @@ -274,12 +228,10 @@ if (FASTDDS_STATISTICS) statistics/rtps/reader/StatisticsReaderImpl.cpp statistics/rtps/StatisticsBase.cpp statistics/rtps/writer/StatisticsWriterImpl.cpp - statistics/types/typesPubSubTypes.cxx - statistics/types/types.cxx - statistics/types/typesv1.cxx - statistics/types/monitorservice_types.cxx - statistics/types/monitorservice_typesv1.cxx statistics/types/monitorservice_typesPubSubTypes.cxx + statistics/types/monitorservice_typesTypeObjectSupport.cxx + statistics/types/typesPubSubTypes.cxx + statistics/types/typesTypeObjectSupport.cxx ) list(APPEND ${PROJECT_NAME}_source_files @@ -511,27 +463,35 @@ else() endif() # Link library to external libraries. -target_link_libraries(${PROJECT_NAME} ${PRIVACY} fastcdr foonathan_memory +target_link_libraries(${PROJECT_NAME} + ${PRIVACY} + fastcdr + foonathan_memory ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TINYXML2_LIBRARY} $<$:OpenSSL::SSL$OpenSSL::Crypto$<$:$crypt32.lib>> $<$:iphlpapi$Shlwapi> ${THIRDPARTY_BOOST_LINK_LIBS} - PRIVATE eProsima_atomic + + PRIVATE + eProsima_atomic + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation ) if(MSVC OR MSVC_IDE) # On installed binaries use manifest to specify dependencies if(INSTALLER_PLATFORM AND OPENSSL_FOUND) - # Get Fast-DDS version suitable manifest format - set(FASTDDS_CANONICAL_VERSION ${fastrtps_VERSION}) + # Get Fast DDS version suitable manifest format + set(FASTDDS_CANONICAL_VERSION ${fastdds_VERSION}) if( NOT FASTDDS_CANONICAL_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+$") - message(FATAL_ERROR "Fast-DDS version number ${fastrtps_VERSION} must include major, minor and patch.") + message(FATAL_ERROR "Fast DDS version number ${fastdds_VERSION} must include major, minor and patch.") endif() - if( NOT fastrtps_VERSION_TWEAK) + if( NOT fastdds_VERSION_TWEAK) set(FASTDDS_CANONICAL_VERSION "${FASTDDS_CANONICAL_VERSION}.0") endif() @@ -548,12 +508,12 @@ if(MSVC OR MSVC_IDE) # replace the values in the manifest template configure_file( - "${PROJECT_SOURCE_DIR}/cmake/packaging/windows/fastrtps.manifest.in" - "${PROJECT_BINARY_DIR}/fastrtps.manifest" + "${PROJECT_SOURCE_DIR}/cmake/packaging/windows/fastdds.manifest.in" + "${PROJECT_BINARY_DIR}/fastdds.manifest" @ONLY ) - file(TO_NATIVE_PATH "${PROJECT_BINARY_DIR}/fastrtps.manifest" MANIFEST_FILE_PATH) + file(TO_NATIVE_PATH "${PROJECT_BINARY_DIR}/fastdds.manifest" MANIFEST_FILE_PATH) target_link_options(${PROJECT_NAME} PRIVATE "/MANIFEST:EMBED" "/MANIFESTINPUT:${MANIFEST_FILE_PATH}") unset(WINDOWS_SOURCE_DIR) @@ -588,7 +548,7 @@ if(MSVC OR MSVC_IDE) set_target_properties(${PROJECT_NAME} PROPERTIES VS_WINRT_COMPONENT "true") endif() elseif(BUILD_SHARED_LIBS) - set(VERSION_SCRIPT_SUPPORT_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfastrtps.version) + set(VERSION_SCRIPT_SUPPORT_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfastdds.version) set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} ${VERSION_SCRIPT_SUPPORT_FLAGS}) CHECK_CXX_SOURCE_COMPILES("int main(int, char**){return 0;}" HAS_VERSION_SCRIPT_SUPPORT) @@ -615,7 +575,7 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME} PATTERN "*.ipp" ) -install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/fastdds +install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/fastrtps DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT headers FILES_MATCHING @@ -699,9 +659,9 @@ endif() include(CMakePackageConfigHelpers) if(BUILD_SHARED_LIBS) - set(FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION "if(MSVC OR MSVC_IDE)") + set(FASTDDS_PACKAGE_OPT_BIN_DIR_CONDITION "if(MSVC OR MSVC_IDE)") else() - set(FASTRTPS_PACKAGE_OPT_BIN_DIR_CONDITION "if(0)") + set(FASTDDS_PACKAGE_OPT_BIN_DIR_CONDITION "if(0)") endif() # include the option parser targets @@ -712,32 +672,32 @@ if(COMPILE_TOOLS) set(INCLUDE_FASTDDS_TARGETS "${INCLUDE_FASTDDS_TARGETS}\ninclude(\${CMAKE_CURRENT_LIST_DIR}/fast-discovery-server-targets.cmake)") endif() -# Add fastrtps dependencies in its CMake config file. +# Add fastdds dependencies in its CMake config file. if(LINK_SSL) if(INSTALLER_PLATFORM) # OpenSSL dependency is only propagated on static linking # We must use the deployed OpenSSL binaries to prevent compatibility issues - set(FASTRTPS_INSTALLER_DEPS_ANCILLARY "\ + set(FASTDDS_INSTALLER_DEPS_ANCILLARY "\ function(find_fastdds_deployed_openssl)\n\ if(OPENSSL_FOUND AND NOT(OPENSSL_VERSION STREQUAL \"${OPENSSL_VERSION}\") )\n\ - message(WARNING \"OpenSSL already loaded. Version \${OPENSSL_VERSION} differs from version ${OPENSSL_VERSION}, used in Fast-DDS binaries building, ABI issues may arise\")\n\ + message(WARNING \"OpenSSL already loaded. Version \${OPENSSL_VERSION} differs from version ${OPENSSL_VERSION}, used in Fast DDS binaries building, ABI issues may arise\")\n\ endif()\n\ set(OPENSSL_USE_STATIC_LIBS TRUE)\n\ set(OPENSSL_ROOT_DIR \"\${PACKAGE_PREFIX_DIR}/lib/${INSTALLER_PLATFORM}\")\n\ find_package(OpenSSL REQUIRED)\n\ endfunction()" ) - set(FASTRTPS_INSTALLER_OPT_DEPS "\ + set(FASTDDS_INSTALLER_OPT_DEPS "\ if (\${type} STREQUAL \"static\")\n\ find_fastdds_deployed_openssl()\n\ endif()") elseif(WIN32) # windows from sources only requires OpenSSL on static libraries - set(FASTRTPS_PACKAGE_WIN32_OPT_DEPS "find_package(OpenSSL REQUIRED)") + set(FASTDDS_PACKAGE_WIN32_OPT_DEPS "find_package(OpenSSL REQUIRED)") else() # linux from sources requires OpenSSL always - set(FASTRTPS_PACKAGE_UNIX_OPT_DEPS "find_package(OpenSSL REQUIRED)") + set(FASTDDS_PACKAGE_UNIX_OPT_DEPS "find_package(OpenSSL REQUIRED)") endif() endif() diff --git a/src/cpp/dds/core/Exception.cpp b/src/cpp/dds/core/Exception.cpp deleted file mode 100644 index c4f47427afe..00000000000 --- a/src/cpp/dds/core/Exception.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#define DEFINE_LOGIC_ERROR_EXCEPTION(ERROR) \ - ERROR::ERROR( \ - const std::string& msg) \ - : Exception() \ - , std::logic_error(msg){} \ - ERROR::ERROR( \ - const ERROR& src) \ - : Exception() \ - , std::logic_error(src.what()){} \ - ERROR::~ERROR() throw(){} \ - const char* ERROR::what() const throw() { return this->std::logic_error::what();} - -#define DEFINE_RUNTIME_ERROR_EXCEPTION(ERROR) \ - ERROR::ERROR( \ - const std::string& msg) \ - : Exception() \ - , std::runtime_error(msg){} \ - ERROR::ERROR( \ - const ERROR& src) \ - : Exception() \ - , std::runtime_error(src.what()){} \ - ERROR::~ERROR() throw(){} \ - const char* ERROR::what() const throw() { return this->std::runtime_error::what();} - -#define DEFINE_INVALID_ARGUMENT_EXCEPTION(ERROR) \ - ERROR::ERROR( \ - const std::string& msg) \ - : Exception() \ - , std::invalid_argument(msg){} \ - ERROR::ERROR( \ - const ERROR& src) \ - : Exception() \ - , std::invalid_argument(src.what()){} \ - ERROR::~ERROR() throw(){} \ - const char* ERROR::what() const throw() { return this->std::invalid_argument::what();} - -namespace dds { -namespace core { - -DEFINE_LOGIC_ERROR_EXCEPTION(Error) -DEFINE_LOGIC_ERROR_EXCEPTION(InvalidDataError) -DEFINE_LOGIC_ERROR_EXCEPTION(PreconditionNotMetError) -DEFINE_LOGIC_ERROR_EXCEPTION(UnsupportedError) -DEFINE_LOGIC_ERROR_EXCEPTION(NotEnabledError) -DEFINE_LOGIC_ERROR_EXCEPTION(InconsistentPolicyError) -DEFINE_LOGIC_ERROR_EXCEPTION(ImmutablePolicyError) -DEFINE_LOGIC_ERROR_EXCEPTION(AlreadyClosedError) -DEFINE_LOGIC_ERROR_EXCEPTION(IllegalOperationError) - -DEFINE_RUNTIME_ERROR_EXCEPTION(OutOfResourcesError) -DEFINE_RUNTIME_ERROR_EXCEPTION(TimeoutError) -DEFINE_RUNTIME_ERROR_EXCEPTION(InvalidDowncastError) -DEFINE_RUNTIME_ERROR_EXCEPTION(NullReferenceError) - -DEFINE_INVALID_ARGUMENT_EXCEPTION(InvalidArgumentError) - -} // namespace core -} // namespace dds diff --git a/src/cpp/dds/core/types.cpp b/src/cpp/dds/core/types.cpp deleted file mode 100644 index 24c99e4ae43..00000000000 --- a/src/cpp/dds/core/types.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file types.cpp - * - */ - -#include - -using namespace dds::core; - -OMG_DDS_API const null_type dds::core::null; diff --git a/src/cpp/dds/domain/DomainParticipant.cpp b/src/cpp/dds/domain/DomainParticipant.cpp deleted file mode 100644 index a6a040fb57f..00000000000 --- a/src/cpp/dds/domain/DomainParticipant.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file DomainParticipantImpl.cpp - */ - -#include -#include -#include - -#include -#include - -namespace dds { -namespace domain { - -DomainParticipant::DomainParticipant( - uint32_t did) - : dds::core::Reference( - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->create_participant( - did, - eprosima::fastdds::dds::PARTICIPANT_QOS_DEFAULT)) -{ -} - -DomainParticipant::DomainParticipant( - uint32_t id, - const dds::domain::qos::DomainParticipantQos& qos, - dds::domain::DomainParticipantListener* listener, - const dds::core::status::StatusMask& mask) - : dds::core::Reference( - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->create_participant( - id, - qos, - listener, - mask)) -{ -} - -DomainParticipant::~DomainParticipant() -{ -} - -//void DomainParticipant::listener( -// Listener* /*listener*/, -// const ::dds::core::status::StatusMask& /*event_mask*/) -//{ -// this->delegate()->set_listener(listener /*, event_mask*/); -//} - -//typename DomainParticipant::Listener* DomainParticipant::listener() const -//{ -// return dynamic_cast(this->delegate()->get_listener()); -//} - -const dds::domain::qos::DomainParticipantQos& DomainParticipant::qos() const -{ - return this->delegate()->get_qos(); -} - -void DomainParticipant::qos( - const dds::domain::qos::DomainParticipantQos& qos) -{ - ReturnCode_t code = this->delegate()->set_qos(qos); - if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) - { - throw dds::core::ImmutablePolicyError("Immutable Qos"); - } - else if ( code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); - } -} - -//uint32_t DomainParticipant::domain_id() const -//{ -// return this->delegate()->get_domain_id(); -//} - -//void DomainParticipant::assert_liveliness() -//{ -// this->delegate()->assert_liveliness(); -//} - -//bool DomainParticipant::contains_entity( -// const ::dds::core::InstanceHandle& /*handle*/) -//{ -// return this->delegate()->contains_entity(handle); -//} - -//dds::core::Time DomainParticipant::current_time() const -//{ -// eprosima::fastrtps::Time_t now; -// this->delegate()->get_current_time(now); -// return core::Time(now.seconds, now.nanosec); -//} - -dds::domain::qos::DomainParticipantQos DomainParticipant::default_participant_qos() -{ - qos::DomainParticipantQos qos; - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->get_default_participant_qos(qos); - return qos; -} - -void DomainParticipant::default_participant_qos( - const ::dds::domain::qos::DomainParticipantQos& qos) -{ - ReturnCode_t code = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_default_participant_qos( - qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); - } -} - -dds::pub::qos::PublisherQos DomainParticipant::default_publisher_qos() const -{ - return this->delegate()->get_default_publisher_qos(); -} - -DomainParticipant& DomainParticipant::default_publisher_qos( - const ::dds::pub::qos::PublisherQos& qos) -{ - ReturnCode_t code = this->delegate()->set_default_publisher_qos(qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on PublisherQos"); - } - return *this; -} - -dds::sub::qos::SubscriberQos DomainParticipant::default_subscriber_qos() const -{ - return this->delegate()->get_default_subscriber_qos(); -} - -DomainParticipant& DomainParticipant::default_subscriber_qos( - const ::dds::sub::qos::SubscriberQos& qos) -{ - ReturnCode_t result = delegate()->set_default_subscriber_qos(qos); - if (result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - if (result == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported Qos"); - } - return *this; -} - -dds::topic::qos::TopicQos DomainParticipant::default_topic_qos() const -{ - return this->delegate()->get_default_topic_qos(); -} - -DomainParticipant& DomainParticipant::default_topic_qos( - const dds::topic::qos::TopicQos& qos) -{ - ReturnCode_t ret_code = this->delegate()->set_default_topic_qos(qos); - if (ret_code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (ret_code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on TopicQos"); - } - return *this; -} - -DomainParticipant& DomainParticipant::operator <<( - const dds::domain::qos::DomainParticipantQos& qos) -{ - this->qos(qos); - return *this; -} - -const DomainParticipant& DomainParticipant::operator >>( - dds::domain::qos::DomainParticipantQos& qos) const -{ - qos = this->qos(); - return *this; -} - -} //namespace domain -} //namespace dds diff --git a/src/cpp/dds/pub/AnyDataWriter.cpp b/src/cpp/dds/pub/AnyDataWriter.cpp deleted file mode 100644 index 0d4e4c1e96c..00000000000 --- a/src/cpp/dds/pub/AnyDataWriter.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -//#ifndef EPROSIMA_DDS_PUB_DETAIL_TANYDATAWRITER_HPP_ -//#define EPROSIMA_DDS_PUB_DETAIL_TANYDATAWRITER_HPP_ - -/** - * @file - */ - - -// TODO This class currently isn't being compiled. When needed, most of its methods will require conversions. - -/* - * OMG PSM class declaration - */ -#include - -namespace dds { -namespace pub { - -template -TAnyDataWriter::~TAnyDataWriter() -{ - publisher_ = nullptr; -} - -//template -//const dds::pub::Publisher& -//TAnyDataWriter::publisher() const -//{ -// return *publisher_; -//} - -//template -//const dds::topic::TopicDescription& TAnyDataWriter::topic_description() const -//{ -// return this->delegate()->topic_description(); -//} - -template -qos::DataWriterQos TAnyDataWriter::qos() const -{ - return this->delegate()->get_qos(); -} - -template -void TAnyDataWriter::qos( - const qos::DataWriterQos& qos) -{ - ReturnCode_t code = this->delegate()->set_qos(qos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on DataWriterQos"); - } - else if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) - { - throw dds::core::ImmutablePolicyError("Immutable Qos"); - } -} - -template -TAnyDataWriter& TAnyDataWriter::operator <<( - const dds::pub::qos::DataWriterQos& qos) -{ - this->qos(qos); - return *this; -} - -template -const TAnyDataWriter& TAnyDataWriter::operator >>( - qos::DataWriterQos& qos) const -{ - qos = this->qos(); - return *this; -} - -//template -//void TAnyDataWriter::wait_for_acknowledgments( -// const dds::core::Duration& timeout) -//{ -// this->delegate()->wait_for_acknowledgments(timeout); -//} - -//template -//const dds::core::status::LivelinessLostStatus TAnyDataWriter::liveliness_lost_status() -//{ -// return this->delegate()->get_liveliness_lost_status(); -//} - -//template -//const dds::core::status::OfferedDeadlineMissedStatus TAnyDataWriter::offered_deadline_missed_status() -//{ -// return this->delegate()->get_offered_deadline_missed_status(); -//} - -//template -//const dds::core::status::OfferedIncompatibleQosStatus TAnyDataWriter::offered_incompatible_qos_status() -//{ -// return this->delegate()->get_offered_incompatible_qos_status(); -//} - -//template -//const dds::core::status::PublicationMatchedStatus TAnyDataWriter::publication_matched_status() -//{ -// return this->delegate()->get_publication_matched_status(); -//} - -//template -//void TAnyDataWriter::assert_liveliness() -//{ -// this->delegate()->assert_liveliness(); -//} - -} //namespace pub -} //namespace dds - - -//#endif //EPROSIMA_DDS_PUB_DETAIL_TANYDATAWRITER_HPP_ diff --git a/src/cpp/dds/pub/DataWriter.cpp b/src/cpp/dds/pub/DataWriter.cpp deleted file mode 100644 index b2dda593846..00000000000 --- a/src/cpp/dds/pub/DataWriter.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/*************************************************************************** -* -* dds/pub/DataWriter<> WRAPPER implementation. -* Declaration can be found in dds/pub/DataWriter.hpp -* -***************************************************************************/ - -#include -#include -//#include - -#include - -namespace dds { -namespace pub { - -//template -//DataWriter::DataWriter( -// const dds::pub::Publisher& pub, -// const dds::topic::Topic& topic) -// : dds::core::Reference( -// new detail::DataWriter(pub, -// topic, -// pub.is_nil() ? dds::pub::qos::DataWriterQos() : pub.default_datawriter_qos(), -// nullptr, -// dds::core::status::StatusMask::all())) -//{ -// publisher_ = &pub; -//} - -//template -//DataWriter::DataWriter( -// const dds::pub::Publisher& pub, -// const dds::topic::Topic& topic, -// const dds::pub::qos::DataWriterQos& qos, -// dds::pub::DataWriterListener* listener, -// const dds::core::status::StatusMask& mask) -// : dds::core::Reference( -// new detail::DataWriter( -// pub.delegate().get(), -// topic.delegate().get(), -// qos, -// listener, -// mask)) -//{ -// publisher_ = &pub; -//} - -template -DataWriter::~DataWriter() -{ -} - -//template -//void DataWriter::write( -// const T& sample) -//{ -// this->delegate()->write(const_cast(&sample)); -//} - -//template -//void DataWriter::write( -// const T& sample, -// const dds::core::Time& timestamp) -//{ -// this->delegate()->write(const_cast(&sample)); -// //To implement -// (void)timestamp; -//} - -//template -//void DataWriter::write( -// const T& sample, -// const ::dds::core::InstanceHandle& instance) -//{ -// this->delegate()->write(const_cast(&sample), instance); -//} - -//template -//void DataWriter::write( -// const T& sample, -// const ::dds::core::InstanceHandle& instance, -// const dds::core::Time& timestamp) -//{ -// this->delegate()->write_w_timestamp(const_cast(&sample), instance, timestamp); -//} - -//template -//void DataWriter::write( -// const dds::topic::TopicInstance& /*i*/) -//{ -// //To implement -// // this->delegate()->write(i); -//} - -//template -//void DataWriter::write( -// const dds::topic::TopicInstance& /*i*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // this->delegate()->write(i, timestamp); -//} - -//template -//template -//void DataWriter::write( -// const FWIterator& /*begin*/, -// const FWIterator& /*end*/) -//{ -// //To implement -// // FWIterator b = begin; -// // while(b != end) -// // { -// // this->delegate()->write(*b); -// // ++b; -// // } -//} - -//template -//template -//void DataWriter::write( -// const FWIterator& /*begin*/, -// const FWIterator& /*end*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // FWIterator b = begin; -// // while(b != end) -// // { -// // this->delegate()->write(*b, timestamp); -// // ++b; -// // } -//} - -//template -//template< -// typename SamplesFWIterator, -// typename HandlesFWIterator> -//void DataWriter::write( -// const SamplesFWIterator& /*data_begin*/, -// const SamplesFWIterator& /*data_end*/, -// const HandlesFWIterator& /*handle_begin*/, -// const HandlesFWIterator& /*handle_end*/) -//{ -// //To implement -// // SamplesFWIterator data = data_begin; -// // HandlesFWIterator handle = handle_begin; - -// // while(data != data_end && handle != handle_end) -// // { -// // this->delegate()->write(*data, *handle); -// // ++data; -// // ++handle; -// // } -//} - -//template -//template< -// typename SamplesFWIterator, -// typename HandlesFWIterator> -//void DataWriter::write( -// const SamplesFWIterator& /*data_begin*/, -// const SamplesFWIterator& /*data_end*/, -// const HandlesFWIterator& /*handle_begin*/, -// const HandlesFWIterator& /*handle_end*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // SamplesFWIterator data = data_begin; -// // HandlesFWIterator handle = handle_begin; - -// // while(data != data_end && handle != handle_end) -// // { -// // this->delegate()->write(*data, *handle, timestamp); -// // ++data; -// // ++handle; -// // } -//} - -//template -//DataWriter& DataWriter::operator <<( -// const ::dds::pub::qos::DataWriterQos& qos) -//{ -// ReturnCode_t code = this->delegate()->set_qos(qos); -// if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) -// { -// throw dds::core::InconsistentPolicyError("Inconsistent Qos"); -// } -// else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) -// { -// throw dds::core::UnsupportedError("Unsupported values on DataWriterQos"); -// } -// else if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) -// { -// throw dds::core::ImmutablePolicyError("Immutable Qos"); -// } -// return *this; -//} - -//template -//DataWriter& DataWriter::operator <<( -// const T& data) -//{ -// this->write(data); -// return *this; -//} - -//template -//DataWriter& DataWriter::operator <<( -// const std::pair& data) -//{ -// this->write(data.first, data.second); -// return *this; -//} - -//template -//DataWriter& DataWriter::operator <<( -// const std::pair& data) -//{ -// this->write(data.first, data.second); -// return *this; -//} - -//template -//DataWriter& DataWriter::operator <<( -// DataWriter& (*manipulator)(DataWriter&)) -//{ -// return manipulator(*this); -//} - -//template -//const dds::core::InstanceHandle DataWriter::register_instance( -// const T& /*key*/) -//{ -// /* Invalid time will be used as current time. */ -// //return this->delegate()->register_instance(key, dds::core::Time::invalid()); -// return dds::core::InstanceHandle::nil(); -//} - -//template -//const dds::core::InstanceHandle DataWriter::register_instance( -// const T& /*key*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // return this->delegate()->register_instance(key, timestamp); -// return dds::core::InstanceHandle::nil(); -//} - -//template -//DataWriter& DataWriter::unregister_instance( -// const ::dds::core::InstanceHandle& /*i*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // /* Invalid time will be used as current time. */ -// // this->delegate()->unregister_instance(i, dds::core::Time::invalid()); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::unregister_instance( -// const ::dds::core::InstanceHandle& /*i*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // this->delegate()->unregister_instance(i, timestamp); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::unregister_instance( -// const T& /*key*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // /* Invalid time will be used as current time. */ -// // this->delegate()->unregister_instance(key, dds::core::Time::invalid()); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::unregister_instance( -// const T& /*key*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // this->delegate()->unregister_instance(key, timestamp); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::dispose_instance( -// const ::dds::core::InstanceHandle& /*i*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // /* Invalid time will be used as current time. */ -// // this->delegate()->dispose_instance(i, dds::core::Time::invalid()); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::dispose_instance( -// const ::dds::core::InstanceHandle& /*i*/, -// const dds::core::Time& /*timestamp*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // this->delegate()->dispose_instance(i, timestamp); -// // return *this; -// return *this; -//} - -//template -//DataWriter& DataWriter::dispose_instance( -// const T& key) -//{ -// return this->delegate()->dispose(const_cast(&key)); -//} - -//template -//DataWriter& DataWriter::dispose_instance( -// const T& key, -// const dds::core::Time& timestamp) -//{ -// return this->delegate()->dispose_w_timestamp(const_cast(&key), dds::core::InstanceHandle(), timestamp); -//} - -//template -//dds::topic::TopicInstance& DataWriter::key_value( -// dds::topic::TopicInstance& /*i*/, -// const ::dds::core::InstanceHandle& /*h*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // return this->delegate()->key_value(i, h); -// return dds::topic::TopicInstance(); -//} - -//template -//T& DataWriter::key_value( -// T& /*sample*/, -// const ::dds::core::InstanceHandle& /*h*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // return this->delegate()->key_value(sample, h); -//} - -//template -//dds::core::InstanceHandle DataWriter::lookup_instance( -// const T& /*key*/) -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // return this->delegate()->lookup_instance(key); -// return dds::core::InstanceHandle::nil(); -//} - -//template -//const dds::topic::Topic& DataWriter::topic() const -//{ -// //To implement -// // ISOCPP_REPORT_STACK_DDS_BEGIN(*this); -// // return this->delegate()->topic(); -//} - -//template -//void DataWriter::listener( -// DataWriterListener* listener, -// const ::dds::core::status::StatusMask& mask) -//{ -// this->delegate()->set_listener(listener, mask); -//} - -//template -//DataWriterListener* DataWriter::listener() const -//{ -// return this->delegate()->get_listener(); -//} - -} //namespace dds -} //namespace pub diff --git a/src/cpp/dds/pub/Publisher.cpp b/src/cpp/dds/pub/Publisher.cpp deleted file mode 100644 index a6b2d2f8bc2..00000000000 --- a/src/cpp/dds/pub/Publisher.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include - -namespace dds { -namespace pub { - -Publisher::Publisher( - const dds::domain::DomainParticipant& dp) - : ::dds::core::Reference( - new detail::Publisher( - dp.delegate().get(), - dp.default_publisher_qos(), - nullptr, - dds::core::status::StatusMask::all())) - , participant_(&dp) -{ -} - -Publisher::Publisher( - const dds::domain::DomainParticipant& dp, - const qos::PublisherQos& qos, - PublisherListener* listener, - const dds::core::status::StatusMask& mask) - : ::dds::core::Reference( - new detail::Publisher( - dp.delegate().get(), qos, listener, mask)) - , participant_(&dp) -{ -} - -Publisher::~Publisher() -{ -} - -const qos::PublisherQos& Publisher::qos() const -{ - return this->delegate()->get_qos(); -} - -void Publisher::qos( - const qos::PublisherQos& pqos) -{ - ReturnCode_t code = this->delegate()->set_qos(pqos); - if (code == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) - { - throw dds::core::ImmutablePolicyError("Immutable Qos"); - } - else if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - else if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on DomainParticipantQos"); - } -} - -Publisher& Publisher::operator <<( - const qos::PublisherQos& qos) -{ - this->qos(qos); - return *this; -} - -Publisher& Publisher::operator >>( - qos::PublisherQos& qos) -{ - qos = this->qos(); - return *this; -} - -Publisher& Publisher::default_datawriter_qos( - const qos::DataWriterQos& dwqos) -{ - ReturnCode_t code = this->delegate()->set_default_datawriter_qos(dwqos); - if (code == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - if (code == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported values on DataWriterQos"); - } - return *this; -} - -qos::DataWriterQos Publisher::default_datawriter_qos() const -{ - return this->delegate()->get_default_datawriter_qos(); -} - -//void Publisher::listener( -// Listener* plistener, -// const dds::core::status::StatusMask& /*event_mask*/) -//{ -// delegate()->set_listener(plistener /*, event_mask*/); -//} - -//typename Publisher::Listener* Publisher::listener() const -//{ -// return dynamic_cast(delegate()->get_listener()); -//} - -//void Publisher::wait_for_acknowledgments( -// const dds::core::Duration& timeout) -//{ -// eprosima::fastrtps::Duration_t max_wait(static_cast(timeout.sec()), timeout.nanosec()); -// delegate()->wait_for_acknowledgments(max_wait); -//} - -const dds::domain::DomainParticipant& Publisher::participant() const -{ - return *participant_; -} - -} //namespace pub -} //namespace dds diff --git a/src/cpp/dds/sub/DataReader.cpp b/src/cpp/dds/sub/DataReader.cpp deleted file mode 100644 index dbe018881dd..00000000000 --- a/src/cpp/dds/sub/DataReader.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include -#include - -namespace dds { -namespace sub { - -DataReader::DataReader( - const Subscriber& sub, - const dds::topic::Topic& topic) - : ::dds::core::Reference( - new detail::DataReader( - sub.delegate().get(), - topic.delegate().get(), - sub.default_datareader_qos(), - nullptr, - dds::core::status::StatusMask::all())) - , subscriber_(nullptr) -{ -} - -DataReader::DataReader( - const Subscriber& sub, - const dds::topic::Topic& topic, - const qos::DataReaderQos& qos, - DataReaderListener* listener, - const dds::core::status::StatusMask& mask) - : ::dds::core::Reference( - new detail::DataReader( - sub.delegate().get(), topic.delegate().get(), qos, listener, mask)) - , subscriber_(nullptr) -{ -} - -DataReader::~DataReader() -{ -} - -//const qos::DataReaderQos& DataReader::qos() const -//{ -// return delegate()->get_qos(); -//} - -//void DataReader::qos( -// const qos::DataReaderQos& pqos) -//{ -// delegate()->set_qos(pqos); -//} - -//DataReader& DataReader::operator <<( -// const qos::DataReaderQos& qos) -//{ -// this->qos(qos); -// return *this; -//} - -//DataReader& DataReader::operator >>( -// qos::DataReaderQos& qos) -//{ -// qos = this->qos(); -// return *this; -//} - -//void DataReader::listener( -// Listener* plistener, -// const dds::core::status::StatusMask& /*event_mask*/) -//{ -// delegate()->set_listener(plistener /*, event_mask*/); -//} - -//typename DataReader::Listener* DataReader::listener() const -//{ -// return dynamic_cast(delegate()->get_listener()); -//} - -//const dds::sub::Subscriber& DataReader::subscriber() const -//{ -// eprosima::fastdds::dds::Subscriber s = delegate()->get_subscriber(); -// std::shared_ptr ptr(&s); -// subscriber_->delegate().swap(ptr); - -// return *subscriber; -//} - -} //namespace sub -} //namespace dds - diff --git a/src/cpp/dds/sub/Subscriber.cpp b/src/cpp/dds/sub/Subscriber.cpp deleted file mode 100644 index 69821b6d968..00000000000 --- a/src/cpp/dds/sub/Subscriber.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include - -namespace dds { -namespace sub { - -Subscriber::Subscriber( - const dds::domain::DomainParticipant& dp) - : ::dds::core::Reference( - new detail::Subscriber( - dp.delegate().get(), - dp.default_subscriber_qos(), - nullptr, - dds::core::status::StatusMask::all())) - , participant_(nullptr) -{ -} - -Subscriber::Subscriber( - const dds::domain::DomainParticipant& dp, - const qos::SubscriberQos& qos, - SubscriberListener* listener, - const dds::core::status::StatusMask& mask) - : ::dds::core::Reference( - new detail::Subscriber( - dp.delegate().get(), qos, listener, mask)) - , participant_(&dp) -{ -} - -Subscriber::~Subscriber() -{ -} - -const qos::SubscriberQos& Subscriber::qos() const -{ - return delegate()->get_qos(); -} - -void Subscriber::qos( - const qos::SubscriberQos& pqos) -{ - ReturnCode_t result = delegate()->set_qos(pqos); - if (result == ReturnCode_t::RETCODE_IMMUTABLE_POLICY) - { - throw dds::core::ImmutablePolicyError("Immutable Qos"); - } - else if (result == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported Qos"); - } - else if (result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } -} - -Subscriber& Subscriber::operator <<( - const qos::SubscriberQos& qos) -{ - this->qos(qos); - return *this; -} - -Subscriber& Subscriber::operator >>( - qos::SubscriberQos& qos) -{ - qos = this->qos(); - return *this; -} - -Subscriber& Subscriber::default_datareader_qos( - const qos::DataReaderQos& drqos) -{ - ReturnCode_t result = delegate()->set_default_datareader_qos(drqos); - if ( result == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) - { - throw dds::core::InconsistentPolicyError("Inconsistent Qos"); - } - if ( result == ReturnCode_t::RETCODE_UNSUPPORTED) - { - throw dds::core::UnsupportedError("Unsupported Qos"); - } - return *this; -} - -qos::DataReaderQos Subscriber::default_datareader_qos() const -{ - return delegate()->get_default_datareader_qos(); -} - -//void Subscriber::listener( -// Listener* plistener, -// const dds::core::status::StatusMask& /*event_mask*/) -//{ -// delegate()->set_listener(plistener /*, event_mask*/); -//} - -//typename Subscriber::Listener* Subscriber::listener() const -//{ -// return dynamic_cast(delegate()->get_listener()); -//} - -const dds::domain::DomainParticipant& Subscriber::participant() const -{ - return *participant_; -} - -} //namespace sub -} //namespace dds - diff --git a/src/cpp/dds/topic/Topic.cpp b/src/cpp/dds/topic/Topic.cpp deleted file mode 100644 index 33a2e00c060..00000000000 --- a/src/cpp/dds/topic/Topic.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2020, Proyectos y Sistemas de Mantenimiento SL (eProsima). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - * @file - */ - -/* - * OMG PSM class declaration - */ -#include -#include -#include - -namespace dds { -namespace topic { - -Topic::Topic( - const dds::domain::DomainParticipant& dp, - const std::string& topic_name, - const std::string& type_name) - : ::dds::core::Reference( - new detail::Topic( - dp.delegate().get(), - topic_name, - type_name, - dp.default_topic_qos(), - nullptr, - dds::core::status::StatusMask::all())) - , participant_(nullptr) -{ -} - -Topic::Topic( - const dds::domain::DomainParticipant& dp, - const std::string& topic_name, - const std::string& type_name, - const qos::TopicQos& qos, - TopicListener* listener, - const dds::core::status::StatusMask& mask) - : ::dds::core::Reference( - new detail::Topic( - dp.delegate().get(), topic_name, type_name, qos, listener, mask)) - , participant_(nullptr) -{ -} - -Topic::~Topic() -{ -} - - -} //namespace topic -} //namespace dds - diff --git a/src/cpp/dynamic-types/AnnotationDescriptor.cpp b/src/cpp/dynamic-types/AnnotationDescriptor.cpp deleted file mode 100644 index 26fb37eac08..00000000000 --- a/src/cpp/dynamic-types/AnnotationDescriptor.cpp +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -AnnotationDescriptor::AnnotationDescriptor() - : type_(nullptr) -{ -} - -AnnotationDescriptor::~AnnotationDescriptor() -{ - type_ = nullptr; -} - -AnnotationDescriptor::AnnotationDescriptor( - const AnnotationDescriptor* descriptor) -{ - copy_from(descriptor); -} - -AnnotationDescriptor::AnnotationDescriptor( - DynamicType_ptr pType) -{ - type_ = pType; -} - -ReturnCode_t AnnotationDescriptor::copy_from( - const AnnotationDescriptor* descriptor) -{ - if (descriptor != nullptr) - { - try - { - type_ = descriptor->type_; - value_ = descriptor->value_; - } - catch (std::exception& /*e*/) - { - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying AnnotationDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return ReturnCode_t::RETCODE_OK; -} - -bool AnnotationDescriptor::equals( - const AnnotationDescriptor* other) const -{ - if (other != nullptr && (type_ == other->type_ || (type_ != nullptr && type_->equals(other->type_.get())))) - { - if (value_.size() != other->value_.size()) - { - return false; - } - - for (auto it = value_.begin(); it != value_.end(); ++it) - { - auto it2 = other->value_.find(it->first); - if (it2 == other->value_.end() || it2->second != it->second) - { - return false; - } - } - } - return true; -} - -bool AnnotationDescriptor::key_annotation() const -{ - bool ret = false; - - // Annotations @key and @Key have names "key" and "Key" respectively. - if (type_ && (type_->get_name() == ANNOTATION_KEY_ID || type_->get_name() == ANNOTATION_EPKEY_ID)) - { - // When an annotation is a key annotation, there is only one entry in value_. - // Its map key is ANNOTATION_VALUE_ID and its value is either "true" of "false". - // We cannot call get_value() directly because it is not const-qualified - auto it = value_.find(ANNOTATION_VALUE_ID); - - if (it != value_.end()) - { - ret = it->second == CONST_TRUE; - } - } - - return ret; -} - -ReturnCode_t AnnotationDescriptor::get_value( - std::string& value) -{ - return get_value(value, ANNOTATION_VALUE_ID); -} - -ReturnCode_t AnnotationDescriptor::get_value( - std::string& value, - const std::string& key) -{ - auto it = value_.find(key); - if (it != value_.end()) - { - value = it->second; - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t AnnotationDescriptor::get_all_value( - std::map& value) const -{ - value = value_; - return ReturnCode_t::RETCODE_OK; -} - -bool AnnotationDescriptor::is_consistent() const -{ - if (type_ == nullptr || type_->get_kind() != TK_ANNOTATION) - { - return false; - } - - //TODO: Check consistency of value_ - return true; -} - -void AnnotationDescriptor::set_type( - DynamicType_ptr pType) -{ - type_ = pType; -} - -ReturnCode_t AnnotationDescriptor::set_value( - const std::string& key, - const std::string& value) -{ - value_[key] = value; - return ReturnCode_t::RETCODE_OK; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/AnnotationParameterValue.cpp b/src/cpp/dynamic-types/AnnotationParameterValue.cpp deleted file mode 100644 index 6cfbb6d8a60..00000000000 --- a/src/cpp/dynamic-types/AnnotationParameterValue.cpp +++ /dev/null @@ -1,1634 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AnnotationParameterValue.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#include - -#include -#include - -using namespace eprosima::fastcdr::exception; - -#include "AnnotationParameterValueCdrAux.ipp" - - -namespace eprosima { -namespace fastrtps { - -using namespace rtps; - -namespace types { - - - -ExtendedAnnotationParameterValue::ExtendedAnnotationParameterValue() -{ -} - -ExtendedAnnotationParameterValue::~ExtendedAnnotationParameterValue() -{ -} - -ExtendedAnnotationParameterValue::ExtendedAnnotationParameterValue( - const ExtendedAnnotationParameterValue&) -{ -} - -ExtendedAnnotationParameterValue::ExtendedAnnotationParameterValue( - ExtendedAnnotationParameterValue&&) -{ -} - -ExtendedAnnotationParameterValue& ExtendedAnnotationParameterValue::operator =( - const ExtendedAnnotationParameterValue&) -{ - - return *this; -} - -ExtendedAnnotationParameterValue& ExtendedAnnotationParameterValue::operator =( - ExtendedAnnotationParameterValue&&) -{ - - return *this; -} - -size_t ExtendedAnnotationParameterValue::getCdrSerializedSize( - const ExtendedAnnotationParameterValue& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void ExtendedAnnotationParameterValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void ExtendedAnnotationParameterValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t ExtendedAnnotationParameterValue::getKeyMaxCdrSerializedSize( - size_t current_alignment) -{ - size_t current_align = current_alignment; - - - return current_align; -} - -bool ExtendedAnnotationParameterValue::isKeyDefined() -{ - return false; -} - -void ExtendedAnnotationParameterValue::serializeKey( - eprosima::fastcdr::Cdr&) const -{ -} - -AnnotationParameterValue::AnnotationParameterValue() -{ - m__d = TK_NONE; - m_boolean_value = false; - m_byte_value = 0; - m_int16_value = 0; - m_uint_16_value = 0; - m_int32_value = 0; - m_uint32_value = 0; - m_int64_value = 0; - m_uint64_value = 0; - m_float32_value = 0.0; - m_float64_value = 0.0; - m_float128_value = 0.0; - m_char_value = 0; - m_wchar_value = 0; - m_enumerated_value = 0; - //m_extended_value = 0; -} - -AnnotationParameterValue::~AnnotationParameterValue() -{ -} - -AnnotationParameterValue::AnnotationParameterValue( - const AnnotationParameterValue& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TK_BOOLEAN: - m_boolean_value = x.m_boolean_value; - break; - case TK_BYTE: - m_byte_value = x.m_byte_value; - break; - case TK_INT16: - m_int16_value = x.m_int16_value; - break; - case TK_UINT16: - m_uint_16_value = x.m_uint_16_value; - break; - case TK_INT32: - m_int32_value = x.m_int32_value; - break; - case TK_UINT32: - m_uint32_value = x.m_uint32_value; - break; - case TK_INT64: - m_int64_value = x.m_int64_value; - break; - case TK_UINT64: - m_uint64_value = x.m_uint64_value; - break; - case TK_FLOAT32: - m_float32_value = x.m_float32_value; - break; - case TK_FLOAT64: - m_float64_value = x.m_float64_value; - break; - case TK_FLOAT128: - m_float128_value = x.m_float128_value; - break; - case TK_CHAR8: - m_char_value = x.m_char_value; - break; - case TK_CHAR16: - m_wchar_value = x.m_wchar_value; - break; - case TK_ENUM: - m_enumerated_value = x.m_enumerated_value; - break; - case TK_STRING8: - m_string8_value = x.m_string8_value; - break; - case TK_STRING16: - m_string16_value = x.m_string16_value; - break; - default: - m_extended_value = x.m_extended_value; - break; - } -} - -AnnotationParameterValue::AnnotationParameterValue( - AnnotationParameterValue&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TK_BOOLEAN: - m_boolean_value = x.m_boolean_value; - break; - case TK_BYTE: - m_byte_value = x.m_byte_value; - break; - case TK_INT16: - m_int16_value = x.m_int16_value; - break; - case TK_UINT16: - m_uint_16_value = x.m_uint_16_value; - break; - case TK_INT32: - m_int32_value = x.m_int32_value; - break; - case TK_UINT32: - m_uint32_value = x.m_uint32_value; - break; - case TK_INT64: - m_int64_value = x.m_int64_value; - break; - case TK_UINT64: - m_uint64_value = x.m_uint64_value; - break; - case TK_FLOAT32: - m_float32_value = x.m_float32_value; - break; - case TK_FLOAT64: - m_float64_value = x.m_float64_value; - break; - case TK_FLOAT128: - m_float128_value = x.m_float128_value; - break; - case TK_CHAR8: - m_char_value = x.m_char_value; - break; - case TK_CHAR16: - m_wchar_value = x.m_wchar_value; - break; - case TK_ENUM: - m_enumerated_value = x.m_enumerated_value; - break; - case TK_STRING8: - m_string8_value = std::move(x.m_string8_value); - break; - case TK_STRING16: - m_string16_value = std::move(x.m_string16_value); - break; - default: - m_extended_value = std::move(x.m_extended_value); - break; - } -} - -AnnotationParameterValue& AnnotationParameterValue::operator =( - const AnnotationParameterValue& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TK_BOOLEAN: - m_boolean_value = x.m_boolean_value; - break; - case TK_BYTE: - m_byte_value = x.m_byte_value; - break; - case TK_INT16: - m_int16_value = x.m_int16_value; - break; - case TK_UINT16: - m_uint_16_value = x.m_uint_16_value; - break; - case TK_INT32: - m_int32_value = x.m_int32_value; - break; - case TK_UINT32: - m_uint32_value = x.m_uint32_value; - break; - case TK_INT64: - m_int64_value = x.m_int64_value; - break; - case TK_UINT64: - m_uint64_value = x.m_uint64_value; - break; - case TK_FLOAT32: - m_float32_value = x.m_float32_value; - break; - case TK_FLOAT64: - m_float64_value = x.m_float64_value; - break; - case TK_FLOAT128: - m_float128_value = x.m_float128_value; - break; - case TK_CHAR8: - m_char_value = x.m_char_value; - break; - case TK_CHAR16: - m_wchar_value = x.m_wchar_value; - break; - case TK_ENUM: - m_enumerated_value = x.m_enumerated_value; - break; - case TK_STRING8: - m_string8_value = x.m_string8_value; - break; - case TK_STRING16: - m_string16_value = x.m_string16_value; - break; - default: - m_extended_value = x.m_extended_value; - break; - } - - return *this; -} - -AnnotationParameterValue& AnnotationParameterValue::operator =( - AnnotationParameterValue&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TK_BOOLEAN: - m_boolean_value = x.m_boolean_value; - break; - case TK_BYTE: - m_byte_value = x.m_byte_value; - break; - case TK_INT16: - m_int16_value = x.m_int16_value; - break; - case TK_UINT16: - m_uint_16_value = x.m_uint_16_value; - break; - case TK_INT32: - m_int32_value = x.m_int32_value; - break; - case TK_UINT32: - m_uint32_value = x.m_uint32_value; - break; - case TK_INT64: - m_int64_value = x.m_int64_value; - break; - case TK_UINT64: - m_uint64_value = x.m_uint64_value; - break; - case TK_FLOAT32: - m_float32_value = x.m_float32_value; - break; - case TK_FLOAT64: - m_float64_value = x.m_float64_value; - break; - case TK_FLOAT128: - m_float128_value = x.m_float128_value; - break; - case TK_CHAR8: - m_char_value = x.m_char_value; - break; - case TK_CHAR16: - m_wchar_value = x.m_wchar_value; - break; - case TK_ENUM: - m_enumerated_value = x.m_enumerated_value; - break; - case TK_STRING8: - m_string8_value = std::move(x.m_string8_value); - break; - case TK_STRING16: - m_string16_value = std::move(x.m_string16_value); - break; - default: - m_extended_value = std::move(x.m_extended_value); - break; - } - - return *this; -} - -void AnnotationParameterValue::_d( - char __d) // Special case to ease, sets the current active member. -{ - m__d = __d; -} - -char AnnotationParameterValue::_d() const -{ - return m__d; -} - -char& AnnotationParameterValue::_d() -{ - return m__d; -} - -void AnnotationParameterValue::boolean_value( - bool _boolean_value) -{ - m_boolean_value = _boolean_value; - m__d = TK_BOOLEAN; -} - -bool AnnotationParameterValue::boolean_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_BOOLEAN: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_boolean_value; -} - -bool& AnnotationParameterValue::boolean_value() -{ - bool b = false; - - switch (m__d) - { - case TK_BOOLEAN: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_boolean_value; -} - -void AnnotationParameterValue::byte_value( - uint8_t _byte_value) -{ - m_byte_value = _byte_value; - m__d = TK_BYTE; -} - -uint8_t AnnotationParameterValue::byte_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_BYTE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_byte_value; -} - -uint8_t& AnnotationParameterValue::byte_value() -{ - bool b = false; - - switch (m__d) - { - case TK_BYTE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_byte_value; -} - -void AnnotationParameterValue::int16_value( - int16_t _int16_value) -{ - m_int16_value = _int16_value; - m__d = TK_INT16; -} - -int16_t AnnotationParameterValue::int16_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_INT16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int16_value; -} - -int16_t& AnnotationParameterValue::int16_value() -{ - bool b = false; - - switch (m__d) - { - case TK_INT16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int16_value; -} - -void AnnotationParameterValue::uint_16_value( - uint16_t _uint_16_value) -{ - m_uint_16_value = _uint_16_value; - m__d = TK_UINT16; -} - -uint16_t AnnotationParameterValue::uint_16_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_UINT16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint_16_value; -} - -uint16_t& AnnotationParameterValue::uint_16_value() -{ - bool b = false; - - switch (m__d) - { - case TK_UINT16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint_16_value; -} - -void AnnotationParameterValue::int32_value( - int32_t _int32_value) -{ - m_int32_value = _int32_value; - m__d = TK_INT32; -} - -int32_t AnnotationParameterValue::int32_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_INT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int32_value; -} - -int32_t& AnnotationParameterValue::int32_value() -{ - bool b = false; - - switch (m__d) - { - case TK_INT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int32_value; -} - -void AnnotationParameterValue::uint32_value( - uint32_t _uint32_value) -{ - m_uint32_value = _uint32_value; - m__d = TK_UINT32; -} - -uint32_t AnnotationParameterValue::uint32_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_UINT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint32_value; -} - -uint32_t& AnnotationParameterValue::uint32_value() -{ - bool b = false; - - switch (m__d) - { - case TK_UINT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint32_value; -} - -void AnnotationParameterValue::int64_value( - int64_t _int64_value) -{ - m_int64_value = _int64_value; - m__d = TK_INT64; -} - -int64_t AnnotationParameterValue::int64_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_INT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int64_value; -} - -int64_t& AnnotationParameterValue::int64_value() -{ - bool b = false; - - switch (m__d) - { - case TK_INT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_int64_value; -} - -void AnnotationParameterValue::uint64_value( - uint64_t _uint64_value) -{ - m_uint64_value = _uint64_value; - m__d = TK_UINT64; -} - -uint64_t AnnotationParameterValue::uint64_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_UINT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint64_value; -} - -uint64_t& AnnotationParameterValue::uint64_value() -{ - bool b = false; - - switch (m__d) - { - case TK_UINT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_uint64_value; -} - -void AnnotationParameterValue::float32_value( - float _float32_value) -{ - m_float32_value = _float32_value; - m__d = TK_FLOAT32; -} - -float AnnotationParameterValue::float32_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float32_value; -} - -float& AnnotationParameterValue::float32_value() -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT32: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float32_value; -} - -void AnnotationParameterValue::float64_value( - double _float64_value) -{ - m_float64_value = _float64_value; - m__d = TK_FLOAT64; -} - -double AnnotationParameterValue::float64_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float64_value; -} - -double& AnnotationParameterValue::float64_value() -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT64: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float64_value; -} - -void AnnotationParameterValue::float128_value( - long double _float128_value) -{ - m_float128_value = _float128_value; - m__d = TK_FLOAT128; -} - -long double AnnotationParameterValue::float128_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT128: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float128_value; -} - -long double& AnnotationParameterValue::float128_value() -{ - bool b = false; - - switch (m__d) - { - case TK_FLOAT128: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_float128_value; -} - -void AnnotationParameterValue::char_value( - char _char_value) -{ - m_char_value = _char_value; - m__d = TK_CHAR8; -} - -char AnnotationParameterValue::char_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_CHAR8: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_char_value; -} - -char& AnnotationParameterValue::char_value() -{ - bool b = false; - - switch (m__d) - { - case TK_CHAR8: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_char_value; -} - -void AnnotationParameterValue::wchar_value( - wchar_t _wchar_value) -{ - m_wchar_value = _wchar_value; - m__d = TK_CHAR16; -} - -wchar_t AnnotationParameterValue::wchar_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_CHAR16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_wchar_value; -} - -wchar_t& AnnotationParameterValue::wchar_value() -{ - bool b = false; - - switch (m__d) - { - case TK_CHAR16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_wchar_value; -} - -void AnnotationParameterValue::enumerated_value( - int32_t _enumerated_value) -{ - m_enumerated_value = _enumerated_value; - m__d = TK_ENUM; -} - -int32_t AnnotationParameterValue::enumerated_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_enumerated_value; -} - -int32_t& AnnotationParameterValue::enumerated_value() -{ - bool b = false; - - switch (m__d) - { - case TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_enumerated_value; -} - -void AnnotationParameterValue::string8_value( - const std::string& _string8_value) -{ - m_string8_value = _string8_value; - m__d = TK_STRING8; -} - -void AnnotationParameterValue::string8_value( - std::string&& _string8_value) -{ - m_string8_value = std::move(_string8_value); - m__d = TK_STRING8; -} - -const std::string& AnnotationParameterValue::string8_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_STRING8: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_string8_value; -} - -std::string& AnnotationParameterValue::string8_value() -{ - bool b = false; - - switch (m__d) - { - case TK_STRING8: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_string8_value; -} - -void AnnotationParameterValue::string16_value( - const std::wstring& _string16_value) -{ - m_string16_value = _string16_value; - m__d = TK_STRING16; -} - -void AnnotationParameterValue::string16_value( - std::wstring&& _string16_value) -{ - m_string16_value = std::move(_string16_value); - m__d = TK_STRING16; -} - -const std::wstring& AnnotationParameterValue::string16_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_STRING16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_string16_value; -} - -std::wstring& AnnotationParameterValue::string16_value() -{ - bool b = false; - - switch (m__d) - { - case TK_STRING16: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_string16_value; -} - -void AnnotationParameterValue::extended_value( - const ExtendedAnnotationParameterValue& _extended_value) -{ - m_extended_value = _extended_value; - m__d = TK_NONE; -} - -void AnnotationParameterValue::extended_value( - ExtendedAnnotationParameterValue&& _extended_value) -{ - m_extended_value = std::move(_extended_value); - m__d = TK_NONE; -} - -const ExtendedAnnotationParameterValue& AnnotationParameterValue::extended_value() const -{ - bool b = false; - - switch (m__d) - { - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_UINT16: - case TK_INT32: - case TK_UINT32: - case TK_INT64: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_ENUM: - case TK_STRING16: - case TK_STRING8: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_extended_value; -} - -ExtendedAnnotationParameterValue& AnnotationParameterValue::extended_value() -{ - bool b = false; - - switch (m__d) - { - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_UINT16: - case TK_INT32: - case TK_UINT32: - case TK_INT64: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_ENUM: - case TK_STRING16: - case TK_STRING8: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_extended_value; -} - -size_t AnnotationParameterValue::getCdrSerializedSize( - const AnnotationParameterValue& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void AnnotationParameterValue::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AnnotationParameterValue::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AnnotationParameterValue::operator ==( - const AnnotationParameterValue& other) const -{ - if (m__d != other.m__d) - { - return false; - } - - switch (m__d) - { - case TK_BOOLEAN: - return m_boolean_value == other.m_boolean_value; - break; - case TK_BYTE: - return m_byte_value == other.m_byte_value; - break; - case TK_INT16: - return m_int16_value == other.m_int16_value; - break; - case TK_UINT16: - return m_uint_16_value == other.m_uint_16_value; - break; - case TK_INT32: - return m_int32_value == other.m_int32_value; - break; - case TK_UINT32: - return m_uint32_value == other.m_uint32_value; - break; - case TK_INT64: - return m_int64_value == other.m_int64_value; - break; - case TK_UINT64: - return m_uint64_value == other.m_uint64_value; - break; - case TK_FLOAT32: - return m_float32_value == other.m_float32_value; - break; - case TK_FLOAT64: - return m_float64_value == other.m_float64_value; - break; - case TK_FLOAT128: - return m_float128_value == other.m_float128_value; - break; - case TK_CHAR8: - return m_char_value == other.m_char_value; - break; - case TK_CHAR16: - return m_wchar_value == other.m_wchar_value; - break; - case TK_ENUM: - return m_enumerated_value == other.m_enumerated_value; - break; - case TK_STRING8: - return m_string8_value == other.m_string8_value; - break; - case TK_STRING16: - return m_string16_value == other.m_string16_value; - break; - default: - return m_extended_value == other.m_extended_value; - break; - } -} - -AppliedAnnotationParameter::AppliedAnnotationParameter() -{ - - -} - -AppliedAnnotationParameter::~AppliedAnnotationParameter() -{ -} - -AppliedAnnotationParameter::AppliedAnnotationParameter( - const AppliedAnnotationParameter& x) -{ - m_paramname_hash = x.m_paramname_hash; - m_value = x.m_value; -} - -AppliedAnnotationParameter::AppliedAnnotationParameter( - AppliedAnnotationParameter&& x) -{ - m_paramname_hash = std::move(x.m_paramname_hash); - m_value = std::move(x.m_value); -} - -AppliedAnnotationParameter& AppliedAnnotationParameter::operator =( - const AppliedAnnotationParameter& x) -{ - m_paramname_hash = x.m_paramname_hash; - m_value = x.m_value; - - return *this; -} - -AppliedAnnotationParameter& AppliedAnnotationParameter::operator =( - AppliedAnnotationParameter&& x) -{ - m_paramname_hash = std::move(x.m_paramname_hash); - m_value = std::move(x.m_value); - - return *this; -} - -bool AppliedAnnotationParameter::operator ==( - const AppliedAnnotationParameter& other) const -{ - return m_paramname_hash == other.m_paramname_hash && - m_value == other.m_value; -} - -void AppliedAnnotationParameter::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AppliedAnnotationParameter::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AppliedAnnotationParameter::isKeyDefined() -{ - return false; -} - -void AppliedAnnotationParameter::serializeKey( - eprosima::fastcdr::Cdr&) const -{ -} - -AppliedAnnotation::AppliedAnnotation() -{ -} - -AppliedAnnotation::~AppliedAnnotation() -{ -} - -AppliedAnnotation::AppliedAnnotation( - const AppliedAnnotation& x) -{ - m_annotation_typeid = x.m_annotation_typeid; - m_param_seq = x.m_param_seq; -} - -AppliedAnnotation::AppliedAnnotation( - AppliedAnnotation&& x) -{ - m_annotation_typeid = std::move(x.m_annotation_typeid); - m_param_seq = std::move(x.m_param_seq); -} - -AppliedAnnotation& AppliedAnnotation::operator =( - const AppliedAnnotation& x) -{ - m_annotation_typeid = x.m_annotation_typeid; - m_param_seq = x.m_param_seq; - - return *this; -} - -AppliedAnnotation& AppliedAnnotation::operator =( - AppliedAnnotation&& x) -{ - m_annotation_typeid = std::move(x.m_annotation_typeid); - m_param_seq = std::move(x.m_param_seq); - - return *this; -} - -bool AppliedAnnotation::operator ==( - const AppliedAnnotation& other) const -{ - if (m_annotation_typeid == other.m_annotation_typeid) - { - return compareSequence(m_param_seq, other.m_param_seq); - } - return false; -} - -void AppliedAnnotation::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AppliedAnnotation::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AppliedAnnotation::isKeyDefined() -{ - return false; -} - -void AppliedAnnotation::serializeKey( - eprosima::fastcdr::Cdr&) const -{ -} - -AppliedVerbatimAnnotation::AppliedVerbatimAnnotation() -{ -} - -AppliedVerbatimAnnotation::~AppliedVerbatimAnnotation() -{ -} - -AppliedVerbatimAnnotation::AppliedVerbatimAnnotation( - const AppliedVerbatimAnnotation& x) -{ - m_placement = x.m_placement; - m_language = x.m_language; - m_text = x.m_text; -} - -AppliedVerbatimAnnotation::AppliedVerbatimAnnotation( - AppliedVerbatimAnnotation&& x) -{ - m_placement = std::move(x.m_placement); - m_language = std::move(x.m_language); - m_text = std::move(x.m_text); -} - -AppliedVerbatimAnnotation& AppliedVerbatimAnnotation::operator =( - const AppliedVerbatimAnnotation& x) -{ - m_placement = x.m_placement; - m_language = x.m_language; - m_text = x.m_text; - - return *this; -} - -AppliedVerbatimAnnotation& AppliedVerbatimAnnotation::operator =( - AppliedVerbatimAnnotation&& x) -{ - m_placement = std::move(x.m_placement); - m_language = std::move(x.m_language); - m_text = std::move(x.m_text); - - return *this; -} - -bool AppliedVerbatimAnnotation::operator ==( - const AppliedVerbatimAnnotation& other) const -{ - return m_placement == other.m_placement && - m_language == other.m_language && - m_text == other.m_text; -} - -void AppliedVerbatimAnnotation::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AppliedVerbatimAnnotation::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AppliedVerbatimAnnotation::isKeyDefined() -{ - return false; -} - -void AppliedVerbatimAnnotation::serializeKey( - eprosima::fastcdr::Cdr&) const -{ -} - -AppliedBuiltinMemberAnnotations::AppliedBuiltinMemberAnnotations() -{ -} - -AppliedBuiltinMemberAnnotations::~AppliedBuiltinMemberAnnotations() -{ -} - -AppliedBuiltinMemberAnnotations::AppliedBuiltinMemberAnnotations( - const AppliedBuiltinMemberAnnotations& x) -{ - m_unit = x.m_unit; - m_min = x.m_min; - m_max = x.m_max; - m_hash_id = x.m_hash_id; -} - -AppliedBuiltinMemberAnnotations::AppliedBuiltinMemberAnnotations( - AppliedBuiltinMemberAnnotations&& x) -{ - m_unit = std::move(x.m_unit); - m_min = std::move(x.m_min); - m_max = std::move(x.m_max); - m_hash_id = std::move(x.m_hash_id); -} - -AppliedBuiltinMemberAnnotations& AppliedBuiltinMemberAnnotations::operator =( - const AppliedBuiltinMemberAnnotations& x) -{ - m_unit = x.m_unit; - m_min = x.m_min; - m_max = x.m_max; - m_hash_id = x.m_hash_id; - - return *this; -} - -AppliedBuiltinMemberAnnotations& AppliedBuiltinMemberAnnotations::operator =( - AppliedBuiltinMemberAnnotations&& x) -{ - m_unit = std::move(x.m_unit); - m_min = std::move(x.m_min); - m_max = std::move(x.m_max); - m_hash_id = std::move(x.m_hash_id); - - return *this; -} - -bool AppliedBuiltinMemberAnnotations::operator ==( - const AppliedBuiltinMemberAnnotations& other) const -{ - return m_unit == other.m_unit && - m_min == other.m_min && - m_max == other.m_max && - m_hash_id == other.m_hash_id; -} - -void AppliedBuiltinMemberAnnotations::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AppliedBuiltinMemberAnnotations::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AppliedBuiltinMemberAnnotations::isKeyDefined() -{ - return false; -} - -void AppliedBuiltinMemberAnnotations::serializeKey( - eprosima::fastcdr::Cdr&) const -{ -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp b/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp deleted file mode 100644 index 4daac3b61d4..00000000000 --- a/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DYNAMIC_TYPES_ANNOTATIONPARAMETERVALUE_IPP -#define DYNAMIC_TYPES_ANNOTATIONPARAMETERVALUE_IPP - -namespace eprosima { -namespace fastcdr { - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::ExtendedAnnotationParameterValue&, - size_t&) -{ - return 0; -} - -template<> -void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::ExtendedAnnotationParameterValue&) -{ -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::ExtendedAnnotationParameterValue&) -{ -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AnnotationParameterValue& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_BOOLEAN: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - case eprosima::fastrtps::types::TK_BYTE: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - case eprosima::fastrtps::types::TK_INT16: - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - break; - case eprosima::fastrtps::types::TK_UINT16: - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - break; - case eprosima::fastrtps::types::TK_INT32: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - case eprosima::fastrtps::types::TK_UINT32: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - case eprosima::fastrtps::types::TK_INT64: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - case eprosima::fastrtps::types::TK_UINT64: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - case eprosima::fastrtps::types::TK_FLOAT32: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - case eprosima::fastrtps::types::TK_FLOAT64: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - case eprosima::fastrtps::types::TK_FLOAT128: - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - break; - case eprosima::fastrtps::types::TK_CHAR8: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - case eprosima::fastrtps::types::TK_CHAR16: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - case eprosima::fastrtps::types::TK_ENUM: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - case eprosima::fastrtps::types::TK_STRING8: - current_alignment += 4 + - eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string8_value().size() + 1; - break; - case eprosima::fastrtps::types::TK_STRING16: - current_alignment += 4 + - eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string16_value().size() + 1; - break; - default: - calculate_serialized_size(calculator, data.extended_value(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_BOOLEAN: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.boolean_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_BYTE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.byte_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_INT16: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.int16_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_UINT16: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.uint_16_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_INT32: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.int32_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_UINT32: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.uint32_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_INT64: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.int64_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_UINT64: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.uint64_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_FLOAT32: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.float32_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_FLOAT64: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 10), data.float64_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_FLOAT128: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.float128_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_CHAR8: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 12), data.char_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_CHAR16: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 13), data.wchar_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_ENUM: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 14), data.enumerated_value(), current_alignment); - - break; - case eprosima::fastrtps::types::TK_STRING8: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 15), data.string8_value(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRING16: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 16), data.string16_value(), current_alignment); - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 17), data.extended_value(), current_alignment); - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AnnotationParameterValue& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_BOOLEAN: - scdr << data.boolean_value(); - break; - case eprosima::fastrtps::types::TK_BYTE: - scdr << data.byte_value(); - break; - case eprosima::fastrtps::types::TK_INT16: - scdr << data.int16_value(); - break; - case eprosima::fastrtps::types::TK_UINT16: - scdr << data.uint_16_value(); - break; - case eprosima::fastrtps::types::TK_INT32: - scdr << data.int32_value(); - break; - case eprosima::fastrtps::types::TK_UINT32: - scdr << data.uint32_value(); - break; - case eprosima::fastrtps::types::TK_INT64: - scdr << data.int64_value(); - break; - case eprosima::fastrtps::types::TK_UINT64: - scdr << data.uint64_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT32: - scdr << data.float32_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT64: - scdr << data.float64_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT128: - scdr << data.float128_value(); - break; - case eprosima::fastrtps::types::TK_CHAR8: - scdr << data.char_value(); - break; - case eprosima::fastrtps::types::TK_CHAR16: - scdr << data.wchar_value(); - break; - case eprosima::fastrtps::types::TK_ENUM: - scdr << data.enumerated_value(); - break; - case eprosima::fastrtps::types::TK_STRING8: - scdr << data.string8_value(); - break; - case eprosima::fastrtps::types::TK_STRING16: - scdr << data.string16_value(); - break; - default: - scdr << data.extended_value(); - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AnnotationParameterValue& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_BOOLEAN: - dcdr >> data.boolean_value(); - break; - case eprosima::fastrtps::types::TK_BYTE: - dcdr >> data.byte_value(); - break; - case eprosima::fastrtps::types::TK_INT16: - dcdr >> data.int16_value(); - break; - case eprosima::fastrtps::types::TK_UINT16: - dcdr >> data.uint_16_value(); - break; - case eprosima::fastrtps::types::TK_INT32: - dcdr >> data.int32_value(); - break; - case eprosima::fastrtps::types::TK_UINT32: - dcdr >> data.uint32_value(); - break; - case eprosima::fastrtps::types::TK_INT64: - dcdr >> data.int64_value(); - break; - case eprosima::fastrtps::types::TK_UINT64: - dcdr >> data.uint64_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT32: - dcdr >> data.float32_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT64: - dcdr >> data.float64_value(); - break; - case eprosima::fastrtps::types::TK_FLOAT128: - dcdr >> data.float128_value(); - break; - case eprosima::fastrtps::types::TK_CHAR8: - dcdr >> data.char_value(); - break; - case eprosima::fastrtps::types::TK_CHAR16: - dcdr >> data.wchar_value(); - break; - case eprosima::fastrtps::types::TK_ENUM: - dcdr >> data.enumerated_value(); - break; - case eprosima::fastrtps::types::TK_STRING8: - dcdr >> data.string8_value(); - break; - case eprosima::fastrtps::types::TK_STRING16: - dcdr >> data.string16_value(); - break; - default: - dcdr >> data.extended_value(); - break; - } -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedAnnotationParameter& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - calculate_serialized_size(calculator, data.value(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.paramname_hash(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.value(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedAnnotationParameter& data) -{ - scdr << data.paramname_hash(); - scdr << data.value(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedAnnotationParameter& data) -{ - dcdr >> data.paramname_hash(); - dcdr >> data.value(); -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedAnnotation& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.annotation_typeid(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.param_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.param_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_typeid(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.param_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedAnnotation& data) -{ - scdr << data.annotation_typeid(); - scdr << data.param_seq(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedAnnotation& data) -{ - dcdr >> data.annotation_typeid(); - dcdr >> data.param_seq(); -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedVerbatimAnnotation& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.placement().size() + 1; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.language().size() + 1; - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.text().size() + 1; - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.placement(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.language(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.text(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedVerbatimAnnotation& data) -{ - scdr << data.placement(); - scdr << data.language(); - scdr << data.text(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedVerbatimAnnotation& data) -{ - dcdr >> data.placement(); - dcdr >> data.language(); - dcdr >> data.text(); -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.unit().size() + 1; - calculate_serialized_size(calculator, data.min(), current_alignment); - calculate_serialized_size(calculator, data.max(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.hash_id().size() + 1; - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.unit(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.min(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.max(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.hash_id(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations& data) -{ - scdr << data.unit(); - scdr << data.min(); - scdr << data.max(); - scdr << data.hash_id(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations& data) -{ - dcdr >> data.unit(); - dcdr >> data.min(); - dcdr >> data.max(); - dcdr >> data.hash_id(); -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // DYNAMIC_TYPES_ANNOTATIONPARAMETERVALUE_IPP diff --git a/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp b/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp deleted file mode 100644 index 729dda56952..00000000000 --- a/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp +++ /dev/null @@ -1,4605 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BuiltinAnnotationsTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // ifdef _WIN32 - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void register_builtin_annotations_types( - TypeObjectFactory* factory) -{ - factory->add_type_object("id", GetidIdentifier(true), GetidObject(true)); - factory->add_type_object("id", GetidIdentifier(false), GetidObject(false)); - - factory->add_type_object("autoid", GetautoidIdentifier(true), GetautoidObject(true)); - factory->add_type_object("autoid", GetautoidIdentifier(false), GetautoidObject(false)); - { - using namespace autoid; - - factory->add_type_object("AutoidKind", GetAutoidKindIdentifier(true), GetAutoidKindObject(true)); - factory->add_type_object("AutoidKind", GetAutoidKindIdentifier(false), GetAutoidKindObject(false)); - - - } - factory->add_type_object("optional", GetoptionalIdentifier(true), GetoptionalObject(true)); - factory->add_type_object("optional", GetoptionalIdentifier(false), GetoptionalObject(false)); - - factory->add_type_object("position", GetpositionIdentifier(true), GetpositionObject(true)); - factory->add_type_object("position", GetpositionIdentifier(false), GetpositionObject(false)); - - factory->add_type_object("value", GetvalueIdentifier(true), GetvalueObject(true)); - factory->add_type_object("value", GetvalueIdentifier(false), GetvalueObject(false)); - - factory->add_type_object("extensibility", GetextensibilityIdentifier(true), GetextensibilityObject(true)); - factory->add_type_object("extensibility", GetextensibilityIdentifier(false), GetextensibilityObject(false)); - { - using namespace extensibility; - - factory->add_type_object("ExtensibilityKind", GetExtensibilityKindIdentifier(true), - GetExtensibilityKindObject(true)); - factory->add_type_object("ExtensibilityKind", GetExtensibilityKindIdentifier(false), - GetExtensibilityKindObject(false)); - - - } - factory->add_type_object("final", GetfinalIdentifier(true), GetfinalObject(true)); - factory->add_type_object("final", GetfinalIdentifier(false), GetfinalObject(false)); - - factory->add_type_object("appendable", GetappendableIdentifier(true), GetappendableObject(true)); - factory->add_type_object("appendable", GetappendableIdentifier(false), GetappendableObject(false)); - - factory->add_type_object("mutable", GetmutableIdentifier(true), GetmutableObject(true)); - factory->add_type_object("mutable", GetmutableIdentifier(false), GetmutableObject(false)); - - factory->add_type_object("key", GetkeyIdentifier(true), GetkeyObject(true)); - factory->add_type_object("key", GetkeyIdentifier(false), GetkeyObject(false)); - - factory->add_type_object("Key", GetkeyIdentifier(true), GetkeyObject(true)); - factory->add_type_object("Key", GetkeyIdentifier(false), GetkeyObject(false)); - - factory->add_type_object("must_understand", Getmust_understandIdentifier(true), Getmust_understandObject(true)); - factory->add_type_object("must_understand", Getmust_understandIdentifier(false), Getmust_understandObject(false)); - - factory->add_type_object("default_literal", Getdefault_literalIdentifier(true), Getdefault_literalObject(true)); - factory->add_type_object("default_literal", Getdefault_literalIdentifier(false), Getdefault_literalObject(false)); - - factory->add_type_object("default", GetdefaultIdentifier(true), GetdefaultObject(true)); - factory->add_type_object("default", GetdefaultIdentifier(false), GetdefaultObject(false)); - - factory->add_type_object("range", GetrangeIdentifier(true), GetrangeObject(true)); - factory->add_type_object("range", GetrangeIdentifier(false), GetrangeObject(false)); - - factory->add_type_object("min", GetminIdentifier(true), GetminObject(true)); - factory->add_type_object("min", GetminIdentifier(false), GetminObject(false)); - - factory->add_type_object("max", GetmaxIdentifier(true), GetmaxObject(true)); - factory->add_type_object("max", GetmaxIdentifier(false), GetmaxObject(false)); - - factory->add_type_object("unit", GetunitIdentifier(true), GetunitObject(true)); - factory->add_type_object("unit", GetunitIdentifier(false), GetunitObject(false)); - - factory->add_type_object("bit_bound", Getbit_boundIdentifier(true), Getbit_boundObject(true)); - factory->add_type_object("bit_bound", Getbit_boundIdentifier(false), Getbit_boundObject(false)); - - factory->add_type_object("external", GetexternalIdentifier(true), GetexternalObject(true)); - factory->add_type_object("external", GetexternalIdentifier(false), GetexternalObject(false)); - - factory->add_type_object("nested", GetnestedIdentifier(true), GetnestedObject(true)); - factory->add_type_object("nested", GetnestedIdentifier(false), GetnestedObject(false)); - - factory->add_type_object("verbatim", GetverbatimIdentifier(true), GetverbatimObject(true)); - factory->add_type_object("verbatim", GetverbatimIdentifier(false), GetverbatimObject(false)); - { - using namespace verbatim; - - factory->add_type_object("PlacementKind", GetPlacementKindIdentifier(true), GetPlacementKindObject(true)); - factory->add_type_object("PlacementKind", GetPlacementKindIdentifier(false), GetPlacementKindObject(false)); - - - } - factory->add_type_object("service", GetserviceIdentifier(true), GetserviceObject(true)); - factory->add_type_object("service", GetserviceIdentifier(false), GetserviceObject(false)); - - factory->add_type_object("oneway", GetonewayIdentifier(true), GetonewayObject(true)); - factory->add_type_object("oneway", GetonewayIdentifier(false), GetonewayObject(false)); - - factory->add_type_object("ami", GetamiIdentifier(true), GetamiObject(true)); - factory->add_type_object("ami", GetamiIdentifier(false), GetamiObject(false)); - - factory->add_type_object("non_serialized", Getnon_serializedIdentifier(true), Getnon_serializedObject(true)); - factory->add_type_object("non_serialized", Getnon_serializedIdentifier(false), Getnon_serializedObject(false)); - -} - -const TypeIdentifier* GetidIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("id", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetidObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("id", complete); -} - -const TypeObject* GetidObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("id", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteidObject(); - } - // else - return GetMinimalidObject(); -} - -const TypeObject* GetMinimalidObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("id", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("id", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("id", false); -} - -const TypeObject* GetCompleteidObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("id", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("id"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("id", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("id", true); -} - -const TypeIdentifier* GetautoidIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("autoid", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetautoidObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("autoid", complete); -} - -const TypeObject* GetautoidObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("autoid", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteautoidObject(); - } - // else - return GetMinimalautoidObject(); -} - -const TypeObject* GetMinimalautoidObject() -{ - using namespace autoid; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("autoid", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*GetAutoidKindIdentifier(false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("1"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("autoid", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("autoid", false); -} - -const TypeObject* GetCompleteautoidObject() -{ - using namespace autoid; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("autoid", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("autoid"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*GetAutoidKindIdentifier(true)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("1"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("autoid", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("autoid", true); -} - -namespace autoid { -const TypeIdentifier* GetAutoidKindIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("AutoidKind", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetAutoidKindObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("AutoidKind", complete); -} - -const TypeObject* GetAutoidKindObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AutoidKind", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteAutoidKindObject(); - } - // else - return GetMinimalAutoidKindObject(); -} - -const TypeObject* GetMinimalAutoidKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AutoidKind", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_SEQUENTIAL; - mel_SEQUENTIAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().IS_KEY(false); // Doesn't apply - mel_SEQUENTIAL.common().flags().IS_DEFAULT(false); - mel_SEQUENTIAL.common().value(value++); - MD5 SEQUENTIAL_hash("SEQUENTIAL"); - for (int i = 0; i < 4; ++i) - { - mel_SEQUENTIAL.detail().name_hash()[i] = SEQUENTIAL_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_SEQUENTIAL); - - MinimalEnumeratedLiteral mel_HASH; - mel_HASH.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_HASH.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_HASH.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_HASH.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_HASH.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_HASH.common().flags().IS_KEY(false); // Doesn't apply - mel_HASH.common().flags().IS_DEFAULT(false); - mel_HASH.common().value(value++); - MD5 HASH_hash("HASH"); - for (int i = 0; i < 4; ++i) - { - mel_HASH.detail().name_hash()[i] = HASH_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_HASH); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AutoidKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AutoidKind", false); -} - -const TypeObject* GetCompleteAutoidKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AutoidKind", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - //type_object->complete().enumerated_type().header().detail().ann_builtin()... - //type_object->complete().enumerated_type().header().detail().ann_custom()... - type_object->complete().enumerated_type().header().detail().type_name("AutoidKind"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_SEQUENTIAL; - cel_SEQUENTIAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().IS_KEY(false); // Doesn't apply - cel_SEQUENTIAL.common().flags().IS_DEFAULT(false); - cel_SEQUENTIAL.common().value(value++); - cel_SEQUENTIAL.detail().name("SEQUENTIAL"); - //cel_SEQUENTIAL.detail().ann_builtin()... - //cel_SEQUENTIAL.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_SEQUENTIAL); - - CompleteEnumeratedLiteral cel_HASH; - cel_HASH.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_HASH.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_HASH.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_HASH.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_HASH.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_HASH.common().flags().IS_KEY(false); // Doesn't apply - cel_HASH.common().flags().IS_DEFAULT(false); - cel_HASH.common().value(value++); - cel_HASH.detail().name("HASH"); - //cel_HASH.detail().ann_builtin()... - //cel_HASH.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_HASH); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AutoidKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AutoidKind", true); -} - -} // autoid namespace -const TypeIdentifier* GetoptionalIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("optional", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetoptionalObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("optional", complete); -} - -const TypeObject* GetoptionalObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("optional", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteoptionalObject(); - } - // else - return GetMinimaloptionalObject(); -} - -const TypeObject* GetMinimaloptionalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("optional", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("optional", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("optional", false); -} - -const TypeObject* GetCompleteoptionalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("optional", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("optional"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("optional", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("optional", true); -} - -const TypeIdentifier* GetpositionIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("position", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetpositionObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("position", complete); -} - -const TypeObject* GetpositionObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("position", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletepositionObject(); - } - // else - return GetMinimalpositionObject(); -} - -const TypeObject* GetMinimalpositionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("position", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("position", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("position", false); -} - -const TypeObject* GetCompletepositionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("position", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("position"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("position", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("position", true); -} - -const TypeIdentifier* GetvalueIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("value", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetvalueObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("value", complete); -} - -const TypeObject* GetvalueObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("value", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletevalueObject(); - } - // else - return GetMinimalvalueObject(); -} - -const TypeObject* GetMinimalvalueObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("value", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("value", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("value", false); -} - -const TypeObject* GetCompletevalueObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("value", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("value"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("value", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("value", true); -} - -const TypeIdentifier* GetextensibilityIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("extensibility", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetextensibilityObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("extensibility", complete); -} - -const TypeObject* GetextensibilityObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("extensibility", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteextensibilityObject(); - } - // else - return GetMinimalextensibilityObject(); -} - -const TypeObject* GetMinimalextensibilityObject() -{ - using namespace extensibility; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("extensibility", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*GetExtensibilityKindIdentifier(false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("extensibility", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("extensibility", false); -} - -const TypeObject* GetCompleteextensibilityObject() -{ - using namespace extensibility; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("extensibility", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("extensibility"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*GetExtensibilityKindIdentifier(true)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("extensibility", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("extensibility", true); -} - -namespace extensibility { -const TypeIdentifier* GetExtensibilityKindIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ExtensibilityKind", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetExtensibilityKindObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ExtensibilityKind", complete); -} - -const TypeObject* GetExtensibilityKindObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ExtensibilityKind", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteExtensibilityKindObject(); - } - // else - return GetMinimalExtensibilityKindObject(); -} - -const TypeObject* GetMinimalExtensibilityKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ExtensibilityKind", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_FINAL; - mel_FINAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_FINAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_FINAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_FINAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_FINAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_FINAL.common().flags().IS_KEY(false); // Doesn't apply - mel_FINAL.common().flags().IS_DEFAULT(false); - mel_FINAL.common().value(value++); - MD5 FINAL_hash("FINAL"); - for (int i = 0; i < 4; ++i) - { - mel_FINAL.detail().name_hash()[i] = FINAL_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_FINAL); - - MinimalEnumeratedLiteral mel_APPENDABLE; - mel_APPENDABLE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_APPENDABLE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_APPENDABLE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_APPENDABLE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_APPENDABLE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_APPENDABLE.common().flags().IS_KEY(false); // Doesn't apply - mel_APPENDABLE.common().flags().IS_DEFAULT(false); - mel_APPENDABLE.common().value(value++); - MD5 APPENDABLE_hash("APPENDABLE"); - for (int i = 0; i < 4; ++i) - { - mel_APPENDABLE.detail().name_hash()[i] = APPENDABLE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_APPENDABLE); - - MinimalEnumeratedLiteral mel_MUTABLE; - mel_MUTABLE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_MUTABLE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_MUTABLE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_MUTABLE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_MUTABLE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_MUTABLE.common().flags().IS_KEY(false); // Doesn't apply - mel_MUTABLE.common().flags().IS_DEFAULT(false); - mel_MUTABLE.common().value(value++); - MD5 MUTABLE_hash("MUTABLE"); - for (int i = 0; i < 4; ++i) - { - mel_MUTABLE.detail().name_hash()[i] = MUTABLE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_MUTABLE); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ExtensibilityKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ExtensibilityKind", false); -} - -const TypeObject* GetCompleteExtensibilityKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ExtensibilityKind", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - //type_object->complete().enumerated_type().header().detail().ann_builtin()... - //type_object->complete().enumerated_type().header().detail().ann_custom()... - type_object->complete().enumerated_type().header().detail().type_name("ExtensibilityKind"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_FINAL; - cel_FINAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_FINAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_FINAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_FINAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_FINAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_FINAL.common().flags().IS_KEY(false); // Doesn't apply - cel_FINAL.common().flags().IS_DEFAULT(false); - cel_FINAL.common().value(value++); - cel_FINAL.detail().name("FINAL"); - //cel_FINAL.detail().ann_builtin()... - //cel_FINAL.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_FINAL); - - CompleteEnumeratedLiteral cel_APPENDABLE; - cel_APPENDABLE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_APPENDABLE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_APPENDABLE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_APPENDABLE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_APPENDABLE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_APPENDABLE.common().flags().IS_KEY(false); // Doesn't apply - cel_APPENDABLE.common().flags().IS_DEFAULT(false); - cel_APPENDABLE.common().value(value++); - cel_APPENDABLE.detail().name("APPENDABLE"); - //cel_APPENDABLE.detail().ann_builtin()... - //cel_APPENDABLE.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_APPENDABLE); - - CompleteEnumeratedLiteral cel_MUTABLE; - cel_MUTABLE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_MUTABLE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_MUTABLE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_MUTABLE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_MUTABLE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_MUTABLE.common().flags().IS_KEY(false); // Doesn't apply - cel_MUTABLE.common().flags().IS_DEFAULT(false); - cel_MUTABLE.common().value(value++); - cel_MUTABLE.detail().name("MUTABLE"); - //cel_MUTABLE.detail().ann_builtin()... - //cel_MUTABLE.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_MUTABLE); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ExtensibilityKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ExtensibilityKind", true); -} - -} // extensibility namespace -const TypeIdentifier* GetfinalIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("final", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetfinalObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("final", complete); -} - -const TypeObject* GetfinalObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("final", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletefinalObject(); - } - // else - return GetMinimalfinalObject(); -} - -const TypeObject* GetMinimalfinalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("final", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("final", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("final", false); -} - -const TypeObject* GetCompletefinalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("final", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("final"); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("final", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("final", true); -} - -const TypeIdentifier* GetappendableIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("appendable", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetappendableObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("appendable", complete); -} - -const TypeObject* GetappendableObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("appendable", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteappendableObject(); - } - // else - return GetMinimalappendableObject(); -} - -const TypeObject* GetMinimalappendableObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("appendable", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("appendable", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("appendable", false); -} - -const TypeObject* GetCompleteappendableObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("appendable", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("appendable"); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("appendable", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("appendable", true); -} - -const TypeIdentifier* GetmutableIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("mutable", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetmutableObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("mutable", complete); -} - -const TypeObject* GetmutableObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("mutable", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletemutableObject(); - } - // else - return GetMinimalmutableObject(); -} - -const TypeObject* GetMinimalmutableObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("mutable", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("mutable", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("mutable", false); -} - -const TypeObject* GetCompletemutableObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("mutable", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("mutable"); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("mutable", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("mutable", true); -} - -const TypeIdentifier* GetkeyIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("key", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetkeyObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("key", complete); -} - -const TypeObject* GetkeyObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("key", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletekeyObject(); - } - // else - return GetMinimalkeyObject(); -} - -const TypeObject* GetMinimalkeyObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("key", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("key", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("key", false); -} - -const TypeObject* GetCompletekeyObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("key", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("key"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("key", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("key", true); -} - -const TypeIdentifier* Getmust_understandIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("must_understand", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - Getmust_understandObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("must_understand", complete); -} - -const TypeObject* Getmust_understandObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("must_understand", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletemust_understandObject(); - } - // else - return GetMinimalmust_understandObject(); -} - -const TypeObject* GetMinimalmust_understandObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("must_understand", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("must_understand", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("must_understand", false); -} - -const TypeObject* GetCompletemust_understandObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("must_understand", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("must_understand"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("must_understand", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("must_understand", true); -} - -const TypeIdentifier* Getdefault_literalIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("default_literal", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - Getdefault_literalObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("default_literal", complete); -} - -const TypeObject* Getdefault_literalObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default_literal", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletedefault_literalObject(); - } - // else - return GetMinimaldefault_literalObject(); -} - -const TypeObject* GetMinimaldefault_literalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default_literal", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("default_literal", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("default_literal", false); -} - -const TypeObject* GetCompletedefault_literalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default_literal", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("default_literal"); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("default_literal", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("default_literal", true); -} - -const TypeIdentifier* GetdefaultIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("default", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetdefaultObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("default", complete); -} - -const TypeObject* GetdefaultObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletedefaultObject(); - } - // else - return GetMinimaldefaultObject(); -} - -const TypeObject* GetMinimaldefaultObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("default", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("default", false); -} - -const TypeObject* GetCompletedefaultObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("default", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("default"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("default", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("default", true); -} - -const TypeIdentifier* GetrangeIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("range", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetrangeObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("range", complete); -} - -const TypeObject* GetrangeObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("range", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleterangeObject(); - } - // else - return GetMinimalrangeObject(); -} - -const TypeObject* GetMinimalrangeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("range", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_min; - mam_min.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_min.name("min"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_min); - - MinimalAnnotationParameter mam_max; - mam_max.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_max.name("max"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_max); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("range", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("range", false); -} - -const TypeObject* GetCompleterangeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("range", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("range"); - - CompleteAnnotationParameter cam_min; - cam_min.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_min.name("min"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_min); - - CompleteAnnotationParameter cam_max; - cam_max.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_max.name("max"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_max); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("range", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("range", true); -} - -const TypeIdentifier* GetminIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("min", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetminObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("min", complete); -} - -const TypeObject* GetminObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("min", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteminObject(); - } - // else - return GetMinimalminObject(); -} - -const TypeObject* GetMinimalminObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("min", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("min", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("min", false); -} - -const TypeObject* GetCompleteminObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("min", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("min"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("min", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("min", true); -} - -const TypeIdentifier* GetmaxIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("max", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetmaxObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("max", complete); -} - -const TypeObject* GetmaxObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("max", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletemaxObject(); - } - // else - return GetMinimalmaxObject(); -} - -const TypeObject* GetMinimalmaxObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("max", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("max", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("max", false); -} - -const TypeObject* GetCompletemaxObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("max", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("max"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("max", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("max", true); -} - -const TypeIdentifier* GetunitIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("unit", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetunitObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("unit", complete); -} - -const TypeObject* GetunitObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("unit", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteunitObject(); - } - // else - return GetMinimalunitObject(); -} - -const TypeObject* GetMinimalunitObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("unit", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("unit", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("unit", false); -} - -const TypeObject* GetCompleteunitObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("unit", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("unit"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("unit", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("unit", true); -} - -const TypeIdentifier* Getbit_boundIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("bit_bound", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - Getbit_boundObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("bit_bound", complete); -} - -const TypeObject* Getbit_boundObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("bit_bound", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletebit_boundObject(); - } - // else - return GetMinimalbit_boundObject(); -} - -const TypeObject* GetMinimalbit_boundObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("bit_bound", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - mam_value.name("value"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("bit_bound", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("bit_bound", false); -} - -const TypeObject* GetCompletebit_boundObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("bit_bound", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("bit_bound"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - cam_value.name("value"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("bit_bound", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("bit_bound", true); -} - -const TypeIdentifier* GetexternalIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("external", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetexternalObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("external", complete); -} - -const TypeObject* GetexternalObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("external", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteexternalObject(); - } - // else - return GetMinimalexternalObject(); -} - -const TypeObject* GetMinimalexternalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("external", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("external", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("external", false); -} - -const TypeObject* GetCompleteexternalObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("external", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("external"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("external", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("external", true); -} - -const TypeIdentifier* GetnestedIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("nested", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetnestedObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("nested", complete); -} - -const TypeObject* GetnestedObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("nested", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletenestedObject(); - } - // else - return GetMinimalnestedObject(); -} - -const TypeObject* GetMinimalnestedObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("nested", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("nested", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("nested", false); -} - -const TypeObject* GetCompletenestedObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("nested", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("nested"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("nested", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("nested", true); -} - -const TypeIdentifier* GetverbatimIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("verbatim", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetverbatimObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("verbatim", complete); -} - -const TypeObject* GetverbatimObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("verbatim", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteverbatimObject(); - } - // else - return GetMinimalverbatimObject(); -} - -const TypeObject* GetMinimalverbatimObject() -{ - using namespace verbatim; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("verbatim", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_language; - mam_language.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_language.name("language"); - - AnnotationParameterValue def_value_language; - def_value_language._d(mam_language.common().member_type_id()._d()); - def_value_language.from_string("*"); - mam_language.default_value(def_value_language); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_language); - - MinimalAnnotationParameter mam_placement; - mam_placement.common().member_type_id(*GetPlacementKindIdentifier(false)); - mam_placement.name("placement"); - - AnnotationParameterValue def_value_placement; - def_value_placement._d(mam_placement.common().member_type_id()._d()); - def_value_placement.from_string("1"); - mam_placement.default_value(def_value_placement); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_placement); - - MinimalAnnotationParameter mam_text; - mam_text.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_text.name("text"); - - type_object->minimal().annotation_type().member_seq().emplace_back(mam_text); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("verbatim", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("verbatim", false); -} - -const TypeObject* GetCompleteverbatimObject() -{ - using namespace verbatim; - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("verbatim", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("verbatim"); - - CompleteAnnotationParameter cam_language; - cam_language.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_language.name("language"); - - AnnotationParameterValue def_value_language; - def_value_language._d(cam_language.common().member_type_id()._d()); - def_value_language.from_string("*"); - cam_language.default_value(def_value_language); - type_object->complete().annotation_type().member_seq().emplace_back(cam_language); - - CompleteAnnotationParameter cam_placement; - cam_placement.common().member_type_id(*GetPlacementKindIdentifier(true)); - cam_placement.name("placement"); - - AnnotationParameterValue def_value_placement; - def_value_placement._d(cam_placement.common().member_type_id()._d()); - def_value_placement.from_string("1"); - cam_placement.default_value(def_value_placement); - type_object->complete().annotation_type().member_seq().emplace_back(cam_placement); - - CompleteAnnotationParameter cam_text; - cam_text.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_text.name("text"); - - type_object->complete().annotation_type().member_seq().emplace_back(cam_text); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("verbatim", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("verbatim", true); -} - -namespace verbatim { -const TypeIdentifier* GetPlacementKindIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("PlacementKind", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetPlacementKindObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("PlacementKind", complete); -} - -const TypeObject* GetPlacementKindObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("PlacementKind", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletePlacementKindObject(); - } - // else - return GetMinimalPlacementKindObject(); -} - -const TypeObject* GetMinimalPlacementKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("PlacementKind", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_BEGIN_FILE; - mel_BEGIN_FILE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().IS_KEY(false); // Doesn't apply - mel_BEGIN_FILE.common().flags().IS_DEFAULT(false); - mel_BEGIN_FILE.common().value(value++); - MD5 BEGIN_FILE_hash("BEGIN_FILE"); - for (int i = 0; i < 4; ++i) - { - mel_BEGIN_FILE.detail().name_hash()[i] = BEGIN_FILE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_BEGIN_FILE); - - MinimalEnumeratedLiteral mel_BEFORE_DECLARATION; - mel_BEFORE_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - mel_BEFORE_DECLARATION.common().flags().IS_DEFAULT(false); - mel_BEFORE_DECLARATION.common().value(value++); - MD5 BEFORE_DECLARATION_hash("BEFORE_DECLARATION"); - for (int i = 0; i < 4; ++i) - { - mel_BEFORE_DECLARATION.detail().name_hash()[i] = BEFORE_DECLARATION_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_BEFORE_DECLARATION); - - MinimalEnumeratedLiteral mel_BEGIN_DECLARATION; - mel_BEGIN_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - mel_BEGIN_DECLARATION.common().flags().IS_DEFAULT(false); - mel_BEGIN_DECLARATION.common().value(value++); - MD5 BEGIN_DECLARATION_hash("BEGIN_DECLARATION"); - for (int i = 0; i < 4; ++i) - { - mel_BEGIN_DECLARATION.detail().name_hash()[i] = BEGIN_DECLARATION_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_BEGIN_DECLARATION); - - MinimalEnumeratedLiteral mel_END_DECLARATION; - mel_END_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_END_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_END_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_END_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_END_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_END_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - mel_END_DECLARATION.common().flags().IS_DEFAULT(false); - mel_END_DECLARATION.common().value(value++); - MD5 END_DECLARATION_hash("END_DECLARATION"); - for (int i = 0; i < 4; ++i) - { - mel_END_DECLARATION.detail().name_hash()[i] = END_DECLARATION_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_END_DECLARATION); - - MinimalEnumeratedLiteral mel_AFTER_DECLARATION; - mel_AFTER_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - mel_AFTER_DECLARATION.common().flags().IS_DEFAULT(false); - mel_AFTER_DECLARATION.common().value(value++); - MD5 AFTER_DECLARATION_hash("AFTER_DECLARATION"); - for (int i = 0; i < 4; ++i) - { - mel_AFTER_DECLARATION.detail().name_hash()[i] = AFTER_DECLARATION_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_AFTER_DECLARATION); - - MinimalEnumeratedLiteral mel_END_FILE; - mel_END_FILE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_END_FILE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_END_FILE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_END_FILE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_END_FILE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_END_FILE.common().flags().IS_KEY(false); // Doesn't apply - mel_END_FILE.common().flags().IS_DEFAULT(false); - mel_END_FILE.common().value(value++); - MD5 END_FILE_hash("END_FILE"); - for (int i = 0; i < 4; ++i) - { - mel_END_FILE.detail().name_hash()[i] = END_FILE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_END_FILE); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("PlacementKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("PlacementKind", false); -} - -const TypeObject* GetCompletePlacementKindObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("PlacementKind", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - //type_object->complete().enumerated_type().header().detail().ann_builtin()... - //type_object->complete().enumerated_type().header().detail().ann_custom()... - type_object->complete().enumerated_type().header().detail().type_name("PlacementKind"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_BEGIN_FILE; - cel_BEGIN_FILE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().IS_KEY(false); // Doesn't apply - cel_BEGIN_FILE.common().flags().IS_DEFAULT(false); - cel_BEGIN_FILE.common().value(value++); - cel_BEGIN_FILE.detail().name("BEGIN_FILE"); - //cel_BEGIN_FILE.detail().ann_builtin()... - //cel_BEGIN_FILE.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_BEGIN_FILE); - - CompleteEnumeratedLiteral cel_BEFORE_DECLARATION; - cel_BEFORE_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - cel_BEFORE_DECLARATION.common().flags().IS_DEFAULT(false); - cel_BEFORE_DECLARATION.common().value(value++); - cel_BEFORE_DECLARATION.detail().name("BEFORE_DECLARATION"); - //cel_BEFORE_DECLARATION.detail().ann_builtin()... - //cel_BEFORE_DECLARATION.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_BEFORE_DECLARATION); - - CompleteEnumeratedLiteral cel_BEGIN_DECLARATION; - cel_BEGIN_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - cel_BEGIN_DECLARATION.common().flags().IS_DEFAULT(false); - cel_BEGIN_DECLARATION.common().value(value++); - cel_BEGIN_DECLARATION.detail().name("BEGIN_DECLARATION"); - //cel_BEGIN_DECLARATION.detail().ann_builtin()... - //cel_BEGIN_DECLARATION.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_BEGIN_DECLARATION); - - CompleteEnumeratedLiteral cel_END_DECLARATION; - cel_END_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_END_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_END_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_END_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_END_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_END_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - cel_END_DECLARATION.common().flags().IS_DEFAULT(false); - cel_END_DECLARATION.common().value(value++); - cel_END_DECLARATION.detail().name("END_DECLARATION"); - //cel_END_DECLARATION.detail().ann_builtin()... - //cel_END_DECLARATION.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_END_DECLARATION); - - CompleteEnumeratedLiteral cel_AFTER_DECLARATION; - cel_AFTER_DECLARATION.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().IS_KEY(false); // Doesn't apply - cel_AFTER_DECLARATION.common().flags().IS_DEFAULT(false); - cel_AFTER_DECLARATION.common().value(value++); - cel_AFTER_DECLARATION.detail().name("AFTER_DECLARATION"); - //cel_AFTER_DECLARATION.detail().ann_builtin()... - //cel_AFTER_DECLARATION.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_AFTER_DECLARATION); - - CompleteEnumeratedLiteral cel_END_FILE; - cel_END_FILE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_END_FILE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_END_FILE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_END_FILE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_END_FILE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_END_FILE.common().flags().IS_KEY(false); // Doesn't apply - cel_END_FILE.common().flags().IS_DEFAULT(false); - cel_END_FILE.common().value(value++); - cel_END_FILE.detail().name("END_FILE"); - //cel_END_FILE.detail().ann_builtin()... - //cel_END_FILE.detail().ann_custom()... - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_END_FILE); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("PlacementKind", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("PlacementKind", true); -} - -} // verbatim namespace -const TypeIdentifier* GetserviceIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("service", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetserviceObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("service", complete); -} - -const TypeObject* GetserviceObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("service", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteserviceObject(); - } - // else - return GetMinimalserviceObject(); -} - -const TypeObject* GetMinimalserviceObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("service", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_platform; - mam_platform.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - mam_platform.name("platform"); - - AnnotationParameterValue def_value_platform; - def_value_platform._d(mam_platform.common().member_type_id()._d()); - def_value_platform.from_string("*"); - mam_platform.default_value(def_value_platform); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_platform); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("service", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("service", false); -} - -const TypeObject* GetCompleteserviceObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("service", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("service"); - - CompleteAnnotationParameter cam_platform; - cam_platform.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cam_platform.name("platform"); - - AnnotationParameterValue def_value_platform; - def_value_platform._d(cam_platform.common().member_type_id()._d()); - def_value_platform.from_string("*"); - cam_platform.default_value(def_value_platform); - type_object->complete().annotation_type().member_seq().emplace_back(cam_platform); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("service", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("service", true); -} - -const TypeIdentifier* GetonewayIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("oneway", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetonewayObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("oneway", complete); -} - -const TypeObject* GetonewayObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("oneway", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteonewayObject(); - } - // else - return GetMinimalonewayObject(); -} - -const TypeObject* GetMinimalonewayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("oneway", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("oneway", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("oneway", false); -} - -const TypeObject* GetCompleteonewayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("oneway", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("oneway"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("oneway", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("oneway", true); -} - -const TypeIdentifier* GetamiIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ami", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetamiObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ami", complete); -} - -const TypeObject* GetamiObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ami", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteamiObject(); - } - // else - return GetMinimalamiObject(); -} - -const TypeObject* GetMinimalamiObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ami", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ami", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ami", false); -} - -const TypeObject* GetCompleteamiObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ami", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("ami"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ami", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ami", true); -} - -const TypeIdentifier* Getnon_serializedIdentifier( - bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("non_serialized", - complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - Getnon_serializedObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("non_serialized", complete); -} - -const TypeObject* Getnon_serializedObject( - bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("non_serialized", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompletenon_serializedObject(); - } - // else - return GetMinimalnon_serializedObject(); -} - -const TypeObject* GetMinimalnon_serializedObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("non_serialized", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ANNOTATION); - - MinimalAnnotationParameter mam_value; - mam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - mam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(mam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - mam_value.default_value(def_value_value); - type_object->minimal().annotation_type().member_seq().emplace_back(mam_value); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("non_serialized", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("non_serialized", false); -} - -const TypeObject* GetCompletenon_serializedObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("non_serialized", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject* type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ANNOTATION); - - // No flags apply - //type_object->complete().annotation_type().annotation_flags().IS_FINAL(false); - //type_object->complete().annotation_type().annotation_flags().IS_APPENDABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_MUTABLE(false); - //type_object->complete().annotation_type().annotation_flags().IS_NESTED(false); - //type_object->complete().annotation_type().annotation_flags().IS_AUTOID_HASH(false); - - //type_object->complete().annotation_type().header().detail().ann_builtin()... - //type_object->complete().annotation_type().header().detail().ann_custom()... - type_object->complete().annotation_type().header().annotation_name("non_serialized"); - - CompleteAnnotationParameter cam_value; - cam_value.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - cam_value.name("value"); - - AnnotationParameterValue def_value_value; - def_value_value._d(cam_value.common().member_type_id()._d()); - def_value_value.from_string("true"); - cam_value.default_value(def_value_value); - type_object->complete().annotation_type().member_seq().emplace_back(cam_value); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().annotation_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("non_serialized", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("non_serialized", true); -} diff --git a/src/cpp/dynamic-types/DynamicData.cpp b/src/cpp/dynamic-types/DynamicData.cpp deleted file mode 100644 index 34e229ab923..00000000000 --- a/src/cpp/dynamic-types/DynamicData.cpp +++ /dev/null @@ -1,6936 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -template -bool map_compare( - Map const& left, - Map const& right) -{ - auto pred = [](decltype(*left.begin()) a, decltype(a) b) - { - return a.first == b.first && a.second == b.second; - }; - - return left.size() == right.size() && std::equal(left.begin(), left.end(), right.begin(), pred); -} - -template <> -bool map_compare( - const std::map& left, - const std::map& right) -{ - auto pred = [](decltype(*left.begin()) a, decltype(a) b) - { - return a.first == b.first && a.second->equals(b.second); - }; - - return left.size() == right.size() && std::equal(left.begin(), left.end(), right.begin(), pred); -} - -DynamicData::DynamicData() - : type_(nullptr) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(0) - , uint32_value_(0) - , int16_value_(0) - , uint16_value_(0) - , int64_value_(0) - , uint64_value_(0) - , float32_value_(0.0f) - , float64_value_(0.0) - , float128_value_(0.0) - , char8_value_(0) - , char16_value_(0) - , byte_value_(0) - , bool_value_(false) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(false) - , default_array_value_(nullptr) - , union_label_(UINT64_MAX) - , union_id_(MEMBER_ID_INVALID) - , union_discriminator_(nullptr) -{ -} - -DynamicData::DynamicData( - DynamicType_ptr pType) - : type_(pType) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(0) - , uint32_value_(0) - , int16_value_(0) - , uint16_value_(0) - , int64_value_(0) - , uint64_value_(0) - , float32_value_(0.0f) - , float64_value_(0.0) - , float128_value_(0.0) - , char8_value_(0) - , char16_value_(0) - , byte_value_(0) - , bool_value_(false) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(false) - , default_array_value_(nullptr) - , union_label_(UINT64_MAX) - , union_id_(MEMBER_ID_INVALID) - , union_discriminator_(nullptr) -{ - create_members(type_); -} - -DynamicData::DynamicData( - const DynamicData* pData) - : type_(pData->type_) -#ifdef DYNAMIC_TYPES_CHECKING - , int32_value_(pData->int32_value_) - , uint32_value_(pData->uint32_value_) - , int16_value_(pData->int16_value_) - , uint16_value_(pData->uint16_value_) - , int64_value_(pData->int64_value_) - , uint64_value_(pData->uint64_value_) - , float32_value_(pData->float32_value_) - , float64_value_(pData->float64_value_) - , float128_value_(pData->float128_value_) - , char8_value_(pData->char8_value_) - , char16_value_(pData->char16_value_) - , byte_value_(pData->byte_value_) - , bool_value_(pData->bool_value_) - , string_value_(pData->string_value_) - , wstring_value_(pData->wstring_value_) -#endif // ifdef DYNAMIC_TYPES_CHECKING - , key_element_(pData->key_element_) - , default_array_value_(pData->default_array_value_) - , union_label_(pData->union_label_) - , union_id_(pData->union_id_) - , union_discriminator_(pData->union_discriminator_) -{ - create_members(pData); -} - -DynamicData::~DynamicData() -{ - clean(); -} - -void DynamicData::create_members( - const DynamicData* pData) -{ - for (auto it = pData->descriptors_.begin(); it != pData->descriptors_.end(); ++it) - { - descriptors_.insert(std::make_pair(it->first, new MemberDescriptor(it->second))); - } - -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = pData->complex_values_.begin(); it != pData->complex_values_.end(); ++it) - { - complex_values_.insert(std::make_pair(it->first, DynamicDataFactory::get_instance()->create_copy(it->second))); - } -#else - if (type_->is_complex_kind()) - { - for (auto it = pData->values_.begin(); it != pData->values_.end(); ++it) - { - values_.insert(std::make_pair(it->first, - DynamicDataFactory::get_instance()->create_copy((DynamicData*)it->second))); - } - } - else if (pData->descriptors_.size() > 0) - { - for (auto it = pData->descriptors_.begin(); it != pData->descriptors_.end(); ++it) - { - values_.insert(std::make_pair(it->first, pData->clone_value(it->first, it->second->get_kind()))); - } - } - else - { - values_.insert(std::make_pair(MEMBER_ID_INVALID, pData->clone_value(MEMBER_ID_INVALID, pData->get_kind()))); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -void DynamicData::create_members( - DynamicType_ptr pType) -{ - std::map members; - if (pType->get_all_members(members) == ReturnCode_t::RETCODE_OK) - { - if (pType->is_complex_kind()) - { - // Bitmasks and enums register their members but only manages one value. - if (pType->get_kind() == TK_BITMASK || pType->get_kind() == TK_ENUM) - { - add_value(pType->get_kind(), MEMBER_ID_INVALID); - } - - for (auto it = members.begin(); it != members.end(); ++it) - { - MemberDescriptor* newDescriptor = new MemberDescriptor(); - if (it->second->get_descriptor(newDescriptor) == ReturnCode_t::RETCODE_OK) - { - descriptors_.insert(std::make_pair(it->first, newDescriptor)); - if (pType->get_kind() != TK_BITMASK && pType->get_kind() != TK_ENUM) - { - DynamicData* data = DynamicDataFactory::get_instance()->create_data(newDescriptor->type_); - if (newDescriptor->type_->get_kind() != TK_BITSET && - newDescriptor->type_->get_kind() != TK_STRUCTURE && - newDescriptor->type_->get_kind() != TK_UNION && - newDescriptor->type_->get_kind() != TK_SEQUENCE && - newDescriptor->type_->get_kind() != TK_ARRAY && - newDescriptor->type_->get_kind() != TK_MAP) - { - std::string def_value = newDescriptor->annotation_get_default(); - if (!def_value.empty()) - { - data->set_value(def_value); - } - } -#ifdef DYNAMIC_TYPES_CHECKING - complex_values_.insert(std::make_pair(it->first, data)); -#else - values_.insert(std::make_pair(it->first, data)); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - else - { - delete newDescriptor; - } - } - - // Set the default value for unions. - if (pType->get_kind() == TK_UNION) - { - bool defaultValue = false; - // Search the default value. - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->is_default_union_value()) - { - set_union_id(it->first); - defaultValue = true; - break; - } - } - - // If there isn't a default value... set the first element of the union - if (!defaultValue && descriptors_.size() > 0) - { - set_union_id(descriptors_.begin()->first); - } - } - } - else - { - add_value(pType->get_kind(), MEMBER_ID_INVALID); - } - } -} - -ReturnCode_t DynamicData::get_descriptor( - MemberDescriptor& value, - MemberId id) -{ - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - value.copy_from(it->second); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting MemberDescriptor. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::set_descriptor( - MemberId id, - const MemberDescriptor* value) -{ - if (descriptors_.find(id) == descriptors_.end()) - { - descriptors_.insert(std::make_pair(id, new MemberDescriptor(value))); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error setting MemberDescriptor. MemberId found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicData::equals( - const DynamicData* other) const -{ - if (other != nullptr) - { - if (other == this) - { - return true; - } - else if (get_item_count() == other->get_item_count() && type_->equals(other->type_.get()) && - descriptors_.size() == other->descriptors_.size()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto otherDescIt = other->descriptors_.find(it->first); - if (otherDescIt == other->descriptors_.end() || !it->second->equals(otherDescIt->second)) - { - return false; - } - } - - // Optimization for unions, only check the selected element. - if (get_kind() == TK_UNION) - { - if (union_id_ != other->union_id_) - { - return false; - } - else if (union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(union_id_); - auto otherIt = other->complex_values_.find(union_id_); -#else - auto it = values_.find(union_id_); - auto otherIt = other->values_.find(union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - if (!((DynamicData*)it->second)->equals((DynamicData*)otherIt->second)) - { - return false; - } - } - } - else - { -#ifdef DYNAMIC_TYPES_CHECKING - bool bFail = false; - bFail = int32_value_ != other->int32_value_; - bFail = bFail || uint32_value_ != other->uint32_value_; - bFail = bFail || int16_value_ != other->int16_value_; - bFail = bFail || uint16_value_ != other->uint16_value_; - bFail = bFail || int64_value_ != other->int64_value_; - bFail = bFail || uint64_value_ != other->uint64_value_; - bFail = bFail || float32_value_ != other->float32_value_; - bFail = bFail || float64_value_ != other->float64_value_; - bFail = bFail || float128_value_ != other->float128_value_; - bFail = bFail || char8_value_ != other->char8_value_; - bFail = bFail || char16_value_ != other->char16_value_; - bFail = bFail || byte_value_ != other->byte_value_; - bFail = bFail || bool_value_ != other->bool_value_; - bFail = bFail || string_value_ != other->string_value_; - bFail = bFail || wstring_value_ != other->wstring_value_; - bFail = bFail || !map_compare(complex_values_, other->complex_values_); - /*if (int32_value_ != other->int32_value_ || uint32_value_ != other->uint32_value_ || - int16_value_ != other->int16_value_ || uint16_value_ != other->uint16_value_ || - int64_value_ != other->int64_value_ || uint64_value_ != other->uint64_value_ || - float32_value_ != other->float32_value_ || float64_value_ != other->float64_value_ || - float128_value_ != other->float128_value_ || char8_value_ != other->char8_value_ || - char16_value_ != other->char16_value_ || byte_value_ != other->byte_value_ || - bool_value_ != other->bool_value_ || string_value_ != other->string_value_ || - wstring_value_ != other->wstring_value_ || - !map_compare(complex_values_, other->complex_values_)) - */ - if (bFail) - { - return false; - } -#else - if (get_kind() == TK_ENUM) - { - if (!compare_values(TK_UINT32, values_.begin()->second, other->values_.begin()->second)) - { - return false; - } - } - else if (get_kind() == TK_BITMASK) - { - TypeKind bitmask_kind = TK_BYTE; - size_t type_size = type_->get_size(); - switch (type_size) - { - case 1: bitmask_kind = TK_BYTE; break; - case 2: bitmask_kind = TK_UINT16; break; - case 4: bitmask_kind = TK_UINT32; break; - case 8: bitmask_kind = TK_UINT64; break; - } - if (!compare_values(bitmask_kind, values_.begin()->second, other->values_.begin()->second)) - { - return false; - } - } - else if (type_->is_complex_kind()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto currentIt = values_.find(it->first); - auto otherIt = other->values_.find(it->first); - if (!((DynamicData*)currentIt->second)->equals(((DynamicData*)otherIt->second))) - { - return false; - } - } - } - else if (descriptors_.size() > 0) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - auto currentIt = values_.find(it->first); - auto otherIt = other->values_.find(it->first); - if (!compare_values(it->second->get_kind(), currentIt->second, otherIt->second)) - { - return false; - } - } - } - else - { - if (!compare_values(get_kind(), values_.begin()->second, other->values_.begin()->second)) - { - return false; - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - return true; - } - } - return false; -} - -MemberId DynamicData::get_member_id_by_name( - const std::string& name) const -{ - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == name) - { - return it->first; - } - } - return MEMBER_ID_INVALID; -} - -MemberId DynamicData::get_member_id_at_index( - uint32_t index) const -{ - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_index() == index) - { - return it->first; - } - } - return MEMBER_ID_INVALID; -} - -TypeKind DynamicData::get_kind() const -{ - return type_->get_kind(); -} - -uint32_t DynamicData::get_item_count() const -{ - if (get_kind() == TK_MAP) - { -#ifdef DYNAMIC_TYPES_CHECKING - return static_cast(complex_values_.size() / 2); -#else - return static_cast(values_.size() / 2); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else if (get_kind() == TK_ARRAY) - { - return type_->get_total_bounds(); - } - else - { -#ifdef DYNAMIC_TYPES_CHECKING - return static_cast(complex_values_.size()); -#else - return static_cast(values_.size()); -#endif // ifdef DYNAMIC_TYPES_CHECKING - } -} - -std::string DynamicData::get_name() -{ - return type_->get_name(); -} - -void DynamicData::add_value( - TypeKind kind, - MemberId id) -{ - switch (kind) - { - default: - break; - case TK_INT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_UINT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_INT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int16_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_UINT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint16_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_INT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new int64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_UINT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_FLOAT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new float())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_FLOAT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new double())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_FLOAT128: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new long double())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_CHAR8: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new char())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_CHAR16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new wchar_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_BOOLEAN: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new bool())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_BYTE: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new octet())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_STRING8: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new std::string())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_STRING16: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new std::wstring())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_ENUM: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint32_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - break; - case TK_BITMASK: - { -#ifndef DYNAMIC_TYPES_CHECKING - values_.insert(std::make_pair(id, new uint64_t())); -#endif // ifndef DYNAMIC_TYPES_CHECKING - } - } - set_default_value(id); -} - -void DynamicData::clean() -{ - if (default_array_value_ != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(default_array_value_); - default_array_value_ = nullptr; - } - - if (union_discriminator_ != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(union_discriminator_); - union_discriminator_ = nullptr; - } - - clean_members(); - - type_ = nullptr; - - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - delete it->second; - } - descriptors_.clear(); -} - -ReturnCode_t DynamicData::clear_all_values() -{ - if (type_->is_complex_kind()) - { - if (get_kind() == TK_SEQUENCE || get_kind() == TK_MAP || get_kind() == TK_ARRAY) - { - return clear_data(); - } - else - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_all_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_all_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - } - else - { - set_default_value(MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_OK; -} - -void DynamicData::clean_members() -{ -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.clear(); -#else - if (type_->has_children()) - { - for (auto it = values_.begin(); it != values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - } - else - { - switch (get_kind()) - { - default: - break; - case TK_INT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int16_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint16_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((int64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT32: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((float*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT64: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((double*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT128: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((long double*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR8: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((char*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((wchar_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BOOLEAN: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((bool*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BYTE: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((octet*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING8: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((std::string*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING16: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((std::wstring*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ENUM: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint32_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BITMASK: - { -#ifndef DYNAMIC_TYPES_CHECKING - auto it = values_.begin(); - delete ((uint64_t*)it->second); -#endif // ifndef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UNION: - case TK_STRUCTURE: - case TK_ARRAY: - case TK_SEQUENCE: - case TK_MAP: - case TK_ALIAS: - case TK_BITSET: - { - break; - } - } - } - values_.clear(); -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::clear_nonkey_values() -{ - if (type_->is_complex_kind()) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_nonkey_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_nonkey_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - } - else - { - if (!key_element_) - { - set_default_value(MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_OK; -} - -ReturnCode_t DynamicData::clear_value( - MemberId id) -{ - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - if (type_->is_complex_kind()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(it->first); - if (itValue != complex_values_.end()) - { - itValue->second->clear_all_values(); - } -#else - auto itValue = values_.find(it->first); - if (itValue != values_.end()) - { - ((DynamicData*)itValue->second)->clear_all_values(); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - set_default_value(id); - } - } - else - { - set_default_value(id); - } - return ReturnCode_t::RETCODE_OK; -} - -void* DynamicData::clone_value( - MemberId id, - TypeKind kind) const -{ - switch (kind) - { - default: - break; - case TK_INT32: - { - int32_t* newInt32 = new int32_t(); - get_int32_value(*newInt32, id); - return newInt32; - } - break; - case TK_UINT32: - { - uint32_t* newUInt32 = new uint32_t(); - get_uint32_value(*newUInt32, id); - return newUInt32; - } - break; - case TK_INT16: - { - int16_t* newInt16 = new int16_t(); - get_int16_value(*newInt16, id); - return newInt16; - } - break; - case TK_UINT16: - { - uint16_t* newUInt16 = new uint16_t(); - get_uint16_value(*newUInt16, id); - return newUInt16; - } - break; - case TK_INT64: - { - int64_t* newInt64 = new int64_t(); - get_int64_value(*newInt64, id); - return newInt64; - } - break; - case TK_UINT64: - { - uint64_t* newUInt64 = new uint64_t(); - get_uint64_value(*newUInt64, id); - return newUInt64; - } - break; - case TK_FLOAT32: - { - float* newFloat32 = new float(); - get_float32_value(*newFloat32, id); - return newFloat32; - } - break; - case TK_FLOAT64: - { - double* newFloat64 = new double(); - get_float64_value(*newFloat64, id); - return newFloat64; - } - break; - case TK_FLOAT128: - { - long double* newFloat128 = new long double(); - get_float128_value(*newFloat128, id); - return newFloat128; - } - break; - case TK_CHAR8: - { - char* newChar8 = new char(); - get_char8_value(*newChar8, id); - return newChar8; - } - break; - case TK_CHAR16: - { - wchar_t* newChar16 = new wchar_t(); - get_char16_value(*newChar16, id); - return newChar16; - } - break; - case TK_BOOLEAN: - { - bool* newBool = new bool(); - get_bool_value(*newBool, id); - return newBool; - } - break; - case TK_BYTE: - { - octet* newByte = new octet(); - get_byte_value(*newByte, id); - return newByte; - } - break; - case TK_STRING8: - { - std::string* newString = new std::string(); - get_string_value(*newString, id); - return newString; - } - break; - case TK_STRING16: - { - std::wstring* newString = new std::wstring(); - get_wstring_value(*newString, id); - return newString; - } - break; - case TK_ENUM: - { - uint32_t* newUInt32 = new uint32_t(); - get_enum_value(*newUInt32, id); - return newUInt32; - } - break; - case TK_BITMASK: - { - uint64_t* newBitset = new uint64_t(); - get_uint64_value(*newBitset, id); - return newBitset; - } - } - return nullptr; -} - -bool DynamicData::compare_values( - TypeKind kind, - void* left, - void* right) const -{ - switch (kind) - { - default: - break; - case TK_INT32: { - return *((int32_t*)left) == *((int32_t*)right); - } - case TK_UINT32: { - return *((uint32_t*)left) == *((uint32_t*)right); - } - case TK_INT16: { - return *((int16_t*)left) == *((int16_t*)right); - } - case TK_UINT16: { - return *((uint16_t*)left) == *((uint16_t*)right); - } - case TK_INT64: { - return *((int64_t*)left) == *((int64_t*)right); - } - case TK_UINT64: { - return *((uint64_t*)left) == *((uint64_t*)right); - } - case TK_FLOAT32: { - return *((float*)left) == *((float*)right); - } - case TK_FLOAT64: { - return *((double*)left) == *((double*)right); - } - case TK_FLOAT128: { - return *((long double*)left) == *((long double*)right); - } - case TK_CHAR8: { - return *((char*)left) == *((char*)right); - } - case TK_CHAR16: { - return *((wchar_t*)left) == *((wchar_t*)right); - } - case TK_BOOLEAN: { - return *((bool*)left) == *((bool*)right); - } - case TK_BYTE: { - return *((octet*)left) == *((octet*)right); - } - case TK_STRING8: { - return *((std::string*)left) == *((std::string*)right); - } - case TK_STRING16: { - return *((std::wstring*)left) == *((std::wstring*)right); - } - case TK_ENUM: { - return *((uint32_t*)left) == *((uint32_t*)right); - } - } - return false; -} - -void DynamicData::get_value( - std::string& sOutValue, - MemberId id /*= MEMBER_ID_INVALID*/) const -{ - switch (type_->kind_) - { - default: - break; - case TK_INT32: - { - int32_t value(0); - get_int32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_UINT32: - { - uint32_t value(0); - get_uint32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_INT16: - { - int16_t value(0); - get_int16_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_UINT16: - { - uint16_t value(0); - get_uint16_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_INT64: - { - int64_t value(0); - get_int64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_UINT64: - { - uint64_t value(0); - get_uint64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_FLOAT32: - { - float value(0.0f); - get_float32_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_FLOAT64: - { - double value(0.0f); - get_float64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_FLOAT128: - { - long double value(0.0f); - get_float128_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_CHAR8: - { - char value = 0; - get_char8_value(value, id); - sOutValue = value; - } - break; - case TK_CHAR16: - { - wchar_t value(0); - get_char16_value(value, id); - std::wstring temp = L""; - temp += value; - sOutValue = wstring_to_bytes(temp); - } - break; - case TK_BOOLEAN: - { - bool value(false); - get_bool_value(value, id); - sOutValue = std::to_string(value ? 1 : 0); - } - break; - case TK_BYTE: - { - uint8_t value(0); - get_byte_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_STRING8: - { - sOutValue = get_string_value(id); - } - break; - case TK_STRING16: - { - std::wstring value; - get_wstring_value(value, id); - sOutValue = wstring_to_bytes(value); - } - break; - case TK_ENUM: - { - uint32_t value; - get_enum_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_BITMASK: - { - uint64_t value(0); - get_uint64_value(value, id); - sOutValue = std::to_string(value); - } - break; - case TK_ARRAY: - case TK_SEQUENCE: - case TK_BITSET: - case TK_MAP: - { - // THESE TYPES DON'T MANAGE VALUES - } - break; - } -} - -void DynamicData::set_value( - const std::string& sValue, - MemberId id /*= MEMBER_ID_INVALID*/) -{ - switch (type_->kind_) - { - default: - break; - case TK_INT32: - { - int32_t value(0); - try - { - value = stoi(sValue); - } - catch (...) - { - } - set_int32_value(value, id); - } - break; - case TK_UINT32: - { - uint32_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint32_value(value, id); - } - break; - case TK_INT16: - { - int16_t value(0); - try - { - value = static_cast(stoi(sValue)); - } - catch (...) - { - } - set_int16_value(value, id); - } - break; - case TK_UINT16: - { - uint16_t value(0); - try - { - value = static_cast(stoul(sValue)); - } - catch (...) - { - } - set_uint16_value(value, id); - } - break; - case TK_INT64: - { - int64_t value(0); - try - { - value = stoll(sValue); - } - catch (...) - { - } - set_int64_value(value, id); - } - break; - case TK_UINT64: - { - uint64_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case TK_FLOAT32: - { - float value(0.0f); - try - { - value = stof(sValue); - } - catch (...) - { - } - set_float32_value(value, id); - } - break; - case TK_FLOAT64: - { - double value(0.0f); - try - { - value = stod(sValue); - } - catch (...) - { - } - set_float64_value(value, id); - } - break; - case TK_FLOAT128: - { - long double value(0.0f); - try - { - value = stold(sValue); - } - catch (...) - { - } - set_float128_value(value, id); - } - break; - case TK_CHAR8: - { - if (sValue.length() >= 1) - { - set_char8_value(sValue[0], id); - } - } - break; - case TK_CHAR16: - { - wchar_t value(0); - try - { - std::wstring temp = std::wstring(sValue.begin(), sValue.end()); - value = temp[0]; - } - catch (...) - { - } - - set_char16_value(value, id); - } - break; - case TK_BOOLEAN: - { - int value(0); - try - { - value = stoi(sValue); - } - catch (...) - { - } - set_bool_value(value == 1 ? true : false, id); - } - break; - case TK_BYTE: - { - if (sValue.length() >= 1) - { - uint8_t value(0); - try - { - value = static_cast(stoul(sValue)); - } - catch (...) - { - } - set_byte_value(value, id); - } - } - break; - case TK_STRING8: - { - set_string_value(sValue, id); - } - break; - case TK_STRING16: - { - set_wstring_value(std::wstring(sValue.begin(), sValue.end()), id); - } - break; - case TK_ENUM: - { - uint32_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_enum_value(value, id); - } - break; - case TK_BITMASK: - { - uint64_t value(0); - try - { - value = stoul(sValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case TK_ARRAY: - case TK_SEQUENCE: - case TK_BITSET: - case TK_MAP: - { - // THESE TYPES DON'T MANAGE VALUES - } - break; - } -} - -void DynamicData::set_default_value( - MemberId id) -{ - std::string defaultValue = ""; - auto it = descriptors_.find(id); - if (it != descriptors_.end()) - { - defaultValue = it->second->get_default_value(); - } - - switch (type_->kind_) - { - default: - break; - case TK_INT32: - { - int32_t value(0); - try - { - value = stoi(defaultValue); - } - catch (...) - { - } - set_int32_value(value, id); - } - break; - case TK_UINT32: - { - uint32_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint32_value(value, id); - } - break; - case TK_INT16: - { - int16_t value(0); - try - { - value = static_cast(stoi(defaultValue)); - } - catch (...) - { - } - set_int16_value(value, id); - } - break; - case TK_UINT16: - { - uint16_t value(0); - try - { - value = static_cast(stoul(defaultValue)); - } - catch (...) - { - } - set_uint16_value(value, id); - } - break; - case TK_INT64: - { - int64_t value(0); - try - { - value = stoll(defaultValue); - } - catch (...) - { - } - set_int64_value(value, id); - } - break; - case TK_UINT64: - { - uint64_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case TK_FLOAT32: - { - float value(0.0f); - try - { - value = stof(defaultValue); - } - catch (...) - { - } - set_float32_value(value, id); - } - break; - case TK_FLOAT64: - { - double value(0.0f); - try - { - value = stod(defaultValue); - } - catch (...) - { - } - set_float64_value(value, id); - } - break; - case TK_FLOAT128: - { - long double value(0.0f); - try - { - value = stold(defaultValue); - } - catch (...) - { - } - set_float128_value(value, id); - } - break; - case TK_CHAR8: - { - if (defaultValue.length() >= 1) - { - set_char8_value(defaultValue[0], id); - } - } - break; - case TK_CHAR16: - { - wchar_t value(0); - try - { - std::wstring temp = std::wstring(defaultValue.begin(), defaultValue.end()); - value = temp[0]; - } - catch (...) - { - } - - set_char16_value(value, id); - } - break; - case TK_BOOLEAN: - { - int value(0); - try - { - value = stoi(defaultValue); - } - catch (...) - { - } - set_bool_value(value == 1 ? true : false, id); - } - break; - case TK_BYTE: - { - if (defaultValue.length() >= 1) - { - uint8_t value(0); - try - { - value = static_cast(stoul(defaultValue)); - } - catch (...) - { - } - set_byte_value(value, id); - } - } - break; - case TK_STRING8: - { - set_string_value(defaultValue, id); - } - break; - case TK_STRING16: - { - set_wstring_value(std::wstring(defaultValue.begin(), defaultValue.end()), id); - } - break; - case TK_ENUM: - { - uint32_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_enum_value(value, id); - } - break; - case TK_BITMASK: - { - uint64_t value(0); - try - { - value = stoul(defaultValue); - } - catch (...) - { - } - set_uint64_value(value, id); - } - break; - case TK_ARRAY: - case TK_SEQUENCE: - case TK_BITSET: - case TK_MAP: - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itValue = complex_values_.find(id); - if (itValue != complex_values_.end()) - { - if (!itValue->second->key_element_) - { - itValue->second->set_default_value(MEMBER_ID_INVALID); - } - } -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (!((DynamicData*)itValue->second)->key_element_) - { - ((DynamicData*)itValue->second)->set_default_value(MEMBER_ID_INVALID); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } -} - -DynamicData* DynamicData::loan_value( - MemberId id) -{ - if (id != MEMBER_ID_INVALID) - { - if (std::find(loaned_values_.begin(), loaned_values_.end(), id) == loaned_values_.end()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() == TK_MAP && it->second->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Key values can't be loaned."); - return nullptr; - } - else - { - if (get_kind() == TK_UNION && union_id_ != id) - { - set_union_id(id); - } - loaned_values_.push_back(id); - return it->second; - } - } - else if (get_kind() == TK_ARRAY) - { - if (insert_array_data(id) == ReturnCode_t::RETCODE_OK) - { - loaned_values_.push_back(id); - return complex_values_.at(id); - } - } -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_MAP && ((DynamicData*)it->second)->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Key values can't be loaned."); - return nullptr; - } - else - { - if (get_kind() == TK_UNION && union_id_ != id) - { - set_union_id(id); - } - loaned_values_.push_back(id); - return (DynamicData*)it->second; - } - } - else if (get_kind() == TK_ARRAY) - { - if (insert_array_data(id) == ReturnCode_t::RETCODE_OK) - { - loaned_values_.push_back(id); - return (DynamicData*)values_.at(id); - } - } - -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. MemberId not found."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. The value has been loaned previously."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning Value. Invalid MemberId."); - } - return nullptr; -} - -ReturnCode_t DynamicData::return_loaned_value( - const DynamicData* value) -{ - for (auto loanIt = loaned_values_.begin(); loanIt != loaned_values_.end(); ++loanIt) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(*loanIt); - if (it != complex_values_.end() && it->second == value) - { - loaned_values_.erase(loanIt); - return ReturnCode_t::RETCODE_OK; - } -#else - auto it = values_.find(*loanIt); - if (it != values_.end() && it->second == value) - { - loaned_values_.erase(loanIt); - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error returning loaned Value. The value hasn't been loaned."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; -} - -ReturnCode_t DynamicData::get_int32_value( - int32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) - { - value = int32_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_int32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) - { - value = *((int32_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int32_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int32_value( - int32_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) - { - int32_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_get_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int32_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT32 && id == MEMBER_ID_INVALID) - { - *((int32_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int32_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint32_value( - uint32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) - { - value = uint32_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) - { - value = *((uint32_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint32_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint32_value( - uint32_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) - { - uint32_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint32_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_UINT32 && id == MEMBER_ID_INVALID) - { - *((uint32_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint32_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint32_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_int16_value( - int16_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) - { - value = int16_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_int16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) - { - value = *((int16_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int16_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int16_value( - int16_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) - { - int16_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int16_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT16 && id == MEMBER_ID_INVALID) - { - *((int16_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int16_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint16_value( - uint16_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) - { - value = uint16_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) - { - value = *((uint16_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint16_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint16_value( - uint16_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) - { - uint16_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint16_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_UINT16 && id == MEMBER_ID_INVALID) - { - *((uint16_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint16_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint16_value(value, id); - } - return insertResult; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_int64_value( - int64_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) - { - value = int64_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_int64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) - { - value = *((int64_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_int64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_int64_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_int64_value( - int64_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) - { - int64_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - int64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_int64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int64_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_INT64 && id == MEMBER_ID_INVALID) - { - *((int64_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - int64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_int64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_int64_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_uint64_value( - uint64_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) - { - value = uint64_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) - { - value = *((uint64_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_uint64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_uint64_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_uint64_value( - uint64_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) - { - uint64_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - uint64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint64_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if ((get_kind() == TK_UINT64 || get_kind() == TK_BITMASK) && id == MEMBER_ID_INVALID) - { - *((uint64_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - uint64_t mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_uint64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_uint64_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float32_value( - float& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - value = float32_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_float32_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - value = *((float*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float32_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float32_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float32_value( - float value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - float32_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float32_value(value, id); - } - return insertResult; - } - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT32 && id == MEMBER_ID_INVALID) - { - *((float*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float32_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float32_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float64_value( - double& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - value = float64_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_float64_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - value = *((double*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float64_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float64_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float64_value( - double value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - float64_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float64_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT64 && id == MEMBER_ID_INVALID) - { - *((double*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float64_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float64_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_float128_value( - long double& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - value = float128_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_float128_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - value = *((long double*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_float128_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_float128_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_float128_value( - long double value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - float128_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_float128_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float128_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_FLOAT128 && id == MEMBER_ID_INVALID) - { - *((long double*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_float128_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_float128_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_char8_value( - char& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) - { - value = char8_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_char8_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) - { - value = *((char*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_char8_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_char8_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_char8_value( - char value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) - { - char8_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_char8_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_char8_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_CHAR8 && id == MEMBER_ID_INVALID) - { - *((char*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_char8_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_char8_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_char16_value( - wchar_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) - { - value = char16_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_char16_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) - { - value = *((wchar_t*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_char16_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_char16_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_char16_value( - wchar_t value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) - { - char16_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_char16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_char16_value(value, id); - } - return insertResult; - } - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_CHAR16 && id == MEMBER_ID_INVALID) - { - *((wchar_t*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_char16_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_char16_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_byte_value( - octet& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) - { - value = byte_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_byte_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) - { - value = *((octet*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_byte_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_byte_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_byte_value( - octet value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) - { - byte_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicData* data = it->second; - if (get_kind() == TK_BITSET && data->type_->get_descriptor()->annotation_is_bit_bound()) - { - uint16_t bit_bound = data->type_->get_descriptor()->annotation_get_bit_bound(); - octet mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = it->second->set_byte_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_byte_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_BYTE && id == MEMBER_ID_INVALID) - { - *((octet*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto itDescriptor = descriptors_.find(id); - if (get_kind() == TK_BITSET) - { - if (itDescriptor == descriptors_.end()) - { - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - uint16_t bit_bound = ((MemberDescriptor*)itDescriptor->second)->annotation_get_bit_bound(); - octet mask = 0x00; - for (uint16_t i = 0; i < bit_bound; ++i) - { - mask = mask << 1; - mask += 1; - } - value &= mask; - } - ReturnCode_t result = ((DynamicData*)it->second)->set_byte_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_byte_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_bool_value( - bool& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - value = bool_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (get_kind() == TK_BITMASK && id < type_->get_bounds()) - { - value = (uint64_value_ & ((uint64_t)1 << id)) != 0; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_bool_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.end(); - if (get_kind() == TK_BITMASK) - { - it = values_.find(MEMBER_ID_INVALID); - } - else - { - it = values_.find(id); - } - if (it != values_.end()) - { - if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - value = *((bool*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (get_kind() == TK_BITMASK && id < type_->get_bounds()) - { - auto m_id = descriptors_.find(id); - MemberDescriptor* member = m_id->second; - uint16_t position = member->annotation_get_position(); - value = (*((uint64_t*)it->second) & ((uint64_t)1 << position)) != 0; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_bool_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_bool_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_bool_value( - bool value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - bool_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else if (get_kind() == TK_BITMASK) - { - if (id == MEMBER_ID_INVALID) - { - if (value) - { - uint64_value_ = ~((uint64_t)0); - } - else - { - uint64_value_ = 0; - } - } - else if (type_->get_bounds() == BOUND_UNLIMITED || id < type_->get_bounds()) - { - if (value) - { - uint64_value_ |= ((uint64_t)1 << id); - } - else - { - uint64_value_ &= ~((uint64_t)1 << id); - } - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_bool_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_bool_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.end(); - if (get_kind() == TK_BITMASK) - { - it = values_.find(MEMBER_ID_INVALID); - } - else - { - it = values_.find(id); - } - - if (it != values_.end()) - { - if (get_kind() == TK_BOOLEAN && id == MEMBER_ID_INVALID) - { - *((bool*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else if (get_kind() == TK_BITMASK) - { - if (id == MEMBER_ID_INVALID) - { - if (value) - { - *((uint64_t*)it->second) = ~((uint64_t)0); - } - else - { - *((uint64_t*)it->second) = 0; - } - return ReturnCode_t::RETCODE_OK; - } - else if (type_->get_bounds() == BOUND_UNLIMITED || id < type_->get_bounds()) - { - auto m_id = descriptors_.find(id); - MemberDescriptor* member = m_id->second; - uint16_t position = member->annotation_get_position(); - if (value) - { - *((uint64_t*)it->second) |= ((uint64_t)1 << position); - } - else - { - *((uint64_t*)it->second) &= ~((uint64_t)1 << position); - } - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting bool value. The given index is greater than the limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_bool_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_bool_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_string_value( - std::string& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) - { - value = string_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_string_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) - { - value = *((std::string*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_string_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_string_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_string_value( - const std::string& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - string_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting string value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_string_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_string_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_STRING8 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - *((std::string*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting string value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_string_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_string_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -void DynamicData::set_type_name( - const std::string& name) -{ - if (type_ != nullptr) - { - type_->set_name(name); - } -} - -void DynamicData::update_union_discriminator() -{ - if (get_kind() == TK_UNION) - { - uint64_t sUnionValue; - union_discriminator_->get_discriminator_value(sUnionValue); - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - std::vector unionLabels = it->second->get_union_labels(); - for (uint64_t label : unionLabels) - { - if (sUnionValue == label) - { - union_id_ = it->first; - union_label_ = label; - break; - } - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error updating union id. The kind: " << get_kind() << " doesn't support it."); - } -} - -void DynamicData::set_union_discriminator( - DynamicData* pData) -{ - union_discriminator_ = pData; - if (union_discriminator_ != nullptr) - { - union_discriminator_->set_discriminator_value(union_label_); - } -} - -MemberId DynamicData::get_union_id() const -{ - return union_id_; -} - -ReturnCode_t DynamicData::set_union_id( - MemberId id) -{ - if (get_kind() == TK_UNION) - { - auto it = descriptors_.find(id); - if (id == MEMBER_ID_INVALID || it != descriptors_.end()) - { - union_id_ = id; - if (it != descriptors_.end()) - { - std::vector unionLabels = it->second->get_union_labels(); - if (unionLabels.size() > 0) - { - union_label_ = unionLabels[0]; - if (union_discriminator_ != nullptr) - { - union_discriminator_->set_discriminator_value(union_label_); - } - } - } - return ReturnCode_t::RETCODE_OK; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting union id. The kind: " << get_kind() << " doesn't support it."); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_wstring_value( - std::wstring& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) - { - value = wstring_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) - { - value = *((std::wstring*)it->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)it->second)->get_wstring_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_wstring_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_wstring_value( - const std::wstring& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - wstring_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting wstring value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_wstring_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_STRING16 && id == MEMBER_ID_INVALID) - { - if (value.length() <= type_->get_bounds()) - { - *((std::wstring*)it->second) = value; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error setting wstring value. The given string is greater than the length limit."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)it->second)->set_wstring_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_wstring_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_enum_value( - uint32_t& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - value = uint32_value_; - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_enum_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - value = *((uint32_t*)itValue->second); - return ReturnCode_t::RETCODE_OK; - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)itValue->second)->get_enum_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_enum_value( - const uint32_t& value, - MemberId id /*= MEMBER_ID_INVALID*/) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - if (descriptors_.find(value) != descriptors_.end()) - { - uint32_value_ = value; - return ReturnCode_t::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - if (descriptors_.find(value) != descriptors_.end()) - { - *((uint32_t*)itValue->second) = value; - return ReturnCode_t::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::get_enum_value( - std::string& value, - MemberId id) const -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - auto it = descriptors_.find(uint32_value_); - if (it != descriptors_.end()) - { - value = it->second->get_name(); - return ReturnCode_t::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return it->second->get_enum_value(value, MEMBER_ID_INVALID); - } - } - else if (get_kind() == TK_ARRAY) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - auto it = descriptors_.find(*((uint32_t*)itValue->second)); - if (it != descriptors_.end()) - { - value = it->second->get_name(); - return ReturnCode_t::RETCODE_OK; - } - } - else if (id != MEMBER_ID_INVALID) - { - if (get_kind() != TK_UNION || id == union_id_) - { - return ((DynamicData*)itValue->second)->get_enum_value(value, MEMBER_ID_INVALID); - } - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - return default_array_value_->get_enum_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_enum_value( - const std::string& value, - MemberId id) -{ -#ifdef DYNAMIC_TYPES_CHECKING - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == value) - { - uint32_value_ = it->first; - return ReturnCode_t::RETCODE_OK; - } - } - } - else if (id != MEMBER_ID_INVALID) - { - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - ReturnCode_t result = it->second->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - else if (get_kind() == TK_ARRAY) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto itValue = values_.find(id); - if (itValue != values_.end()) - { - if (get_kind() == TK_ENUM && id == MEMBER_ID_INVALID) - { - for (auto it = descriptors_.begin(); it != descriptors_.end(); ++it) - { - if (it->second->get_name() == value) - { - *((uint32_t*)itValue->second) = it->first; - return ReturnCode_t::RETCODE_OK; - } - } - } - else if (id != MEMBER_ID_INVALID) - { - ReturnCode_t result = ((DynamicData*)itValue->second)->set_enum_value(value, MEMBER_ID_INVALID); - if (result == ReturnCode_t::RETCODE_OK && get_kind() == TK_UNION) - { - set_union_id(id); - } - return result; - } - } - else if (get_kind() == TK_ARRAY && id != MEMBER_ID_INVALID) - { - ReturnCode_t insertResult = insert_array_data(id); - if (insertResult == ReturnCode_t::RETCODE_OK) - { - return set_enum_value(value, id); - } - return insertResult; - } - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -ReturnCode_t DynamicData::set_bitmask_value( - uint64_t value) -{ - if (type_->kind_ == TK_BITMASK) - { - return set_uint64_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_bitmask_value( - uint64_t& value) const -{ - if (type_->kind_ == TK_BITMASK) - { - return get_uint64_value(value, MEMBER_ID_INVALID); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -void DynamicData::sort_member_ids( - MemberId startId) -{ - MemberId index = startId; - MemberId curID = startId + 1; - uint32_t distance = 1; -#ifdef DYNAMIC_TYPES_CHECKING - while (index <= complex_values_.size()) - { - auto it = complex_values_.find(curID); - if (it != complex_values_.end()) - { - complex_values_[curID - distance] = it->second; - complex_values_.erase(it); - } - else - { - ++distance; - } - ++index; - ++curID; - } -#else - static_cast(index); - while (curID <= values_.size()) - { - auto it = values_.find(curID); - if (it != values_.end()) - { - values_[curID - distance] = it->second; - values_.erase(it); - } - else - { - ++distance; - } - ++index; - ++curID; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING -} - -MemberId DynamicData::get_array_index( - const std::vector& position) -{ - if (get_kind() == TK_ARRAY) - { - MemberId outPosition(0); - uint32_t offset(1); - if (position.size() == type_->get_bounds_size()) - { - for (int32_t i = static_cast(position.size() - 1); i >= 0; --i) - { - outPosition += position[i] * offset; - offset *= type_->get_bounds(static_cast(i)); - } - return outPosition; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting array index. Invalid dimension count."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting array index. The kind " << get_kind() << "doesn't support it."); - } - return MEMBER_ID_INVALID; -} - -ReturnCode_t DynamicData::insert_array_data( - MemberId indexId) -{ - if (get_kind() == TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - if (indexId < type_->get_total_bounds()) - { - auto it = complex_values_.find(indexId); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - } - DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - complex_values_.insert(std::make_pair(indexId, value)); - return ReturnCode_t::RETCODE_OK; - } -#else - if (indexId < type_->get_total_bounds()) - { - auto it = values_.find(indexId); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - } - DynamicData* value = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - values_.insert(std::make_pair(indexId, value)); - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. Index out of bounds"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error inserting data. The kind " << get_kind() << " doesn't support this method"); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::clear_array_data( - MemberId indexId) -{ - if (get_kind() == TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - if (indexId < type_->get_total_bounds()) - { - auto it = complex_values_.find(indexId); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - } - return ReturnCode_t::RETCODE_OK; - } -#else - if (indexId < type_->get_total_bounds()) - { - auto it = values_.find(indexId); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - } - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. Index out of bounds"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The kind " << get_kind() << " doesn't support this method"); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::insert_int32_value( - int32_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_int32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint32_value( - uint32_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_uint32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_int16_value( - int16_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_int16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint16_value( - uint16_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_uint16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_int64_value( - int64_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_INT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_int64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_uint64_value( - uint64_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_UINT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_uint64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float32_value( - float value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT32) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_float32_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float64_value( - double value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT64) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_float64_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_float128_value( - long double value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_FLOAT128) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_float128_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_char8_value( - char value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_CHAR8) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_char8_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_char16_value( - wchar_t value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_CHAR16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_char16_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_byte_value( - octet value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_BYTE) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_byte_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_bool_value( - bool value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_BOOLEAN) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_bool_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_string_value( - const std::string& value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_STRING8) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_string_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_wstring_value( - const std::wstring& value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_STRING16) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_wstring_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_enum_value( - const std::string& value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->get_kind() == TK_ENUM) - { - ReturnCode_t result = insert_sequence_data(outId); - if (result == ReturnCode_t::RETCODE_OK) - { - result = set_enum_value(value, outId); - } - return result; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - const DynamicData* value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return ReturnCode_t::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value))); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - DynamicData_ptr value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return ReturnCode_t::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, DynamicDataFactory::get_instance()->create_copy(value.get()))); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_complex_value( - DynamicData* value, - MemberId& outId) -{ - if (get_kind() == TK_SEQUENCE && type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, value)); - return ReturnCode_t::RETCODE_OK; -#else - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, value)); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The current kinds don't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_sequence_data( - MemberId& outId) -{ - outId = MEMBER_ID_INVALID; - if (get_kind() == TK_SEQUENCE) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outId, new_element)); - return ReturnCode_t::RETCODE_OK; -#else - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outId = static_cast(values_.size()); - values_.insert(std::make_pair(outId, new_element)); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting data. The container is full."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error inserting data. The kind " << get_kind() << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::remove_sequence_data( - MemberId id) -{ - if (get_kind() == TK_SEQUENCE || get_kind() == TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - complex_values_.erase(it); - sort_member_ids(id); - return ReturnCode_t::RETCODE_OK; - } -#else - auto it = values_.find(id); - if (it != values_.end()) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - values_.erase(it); - sort_member_ids(id); - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. Member not found"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing data. The current Kind " << get_kind() - << " doesn't support this method"); - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - MemberId& outKeyId, - MemberId& outValueId) -{ - if (get_kind() == TK_MAP && type_->get_key_element_type()->equals(key->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKeyId = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKeyId, keyCopy)); - - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outValueId = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outValueId, new_element)); - return ReturnCode_t::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (((DynamicData*)it->second)->key_element_ && ((DynamicData*)it->second)->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKeyId = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKeyId, keyCopy)); - - DynamicData* new_element = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - outValueId = static_cast(values_.size()); - values_.insert(std::make_pair(outValueId, new_element)); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - DynamicData* value, - MemberId& outKey, - MemberId& outValue) -{ - if (get_kind() == TK_MAP && type_->get_key_element_type()->equals(key->type_.get()) && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(complex_values_.size()); - complex_values_.insert(std::make_pair(outValue, value)); - return ReturnCode_t::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (it->second == key) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(values_.size()); - values_.insert(std::make_pair(outValue, value)); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - const DynamicData* value, - MemberId& outKey, - MemberId& outValue) -{ - if (get_kind() == TK_MAP && type_->get_key_element_type()->equals(key->type_.get()) && - type_->get_element_type()->equals(value->type_.get())) - { - if (type_->get_bounds() == BOUND_UNLIMITED || get_item_count() < type_->get_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - if (it->second->key_element_ && it->second->equals(key)) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(complex_values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - complex_values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(complex_values_.size()); - DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); - complex_values_.insert(std::make_pair(outValue, valueCopy)); - return ReturnCode_t::RETCODE_OK; -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - if (it->second == key) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The key already exists."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - outKey = static_cast(values_.size()); - DynamicData* keyCopy = DynamicDataFactory::get_instance()->create_copy(key); - keyCopy->key_element_ = true; - values_.insert(std::make_pair(outKey, keyCopy)); - - outValue = static_cast(values_.size()); - DynamicData* valueCopy = DynamicDataFactory::get_instance()->create_copy(value); - values_.insert(std::make_pair(outValue, valueCopy)); - return ReturnCode_t::RETCODE_OK; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The map is full"); - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error inserting to map. The current Kind " << get_kind() - << " doesn't support this method"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::insert_map_data( - const DynamicData* key, - DynamicData_ptr value, - MemberId& outKey, - MemberId& outValue) -{ - return insert_map_data(key, reinterpret_cast(value.get()), outKey, outValue); -} - -ReturnCode_t DynamicData::remove_map_data( - MemberId keyId) -{ - if (get_kind() == TK_MAP) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto itKey = complex_values_.find(keyId); - auto itValue = complex_values_.find(keyId + 1); - if (itKey != complex_values_.end() && itValue != complex_values_.end() && itKey->second->key_element_) - { - DynamicDataFactory::get_instance()->delete_data(itKey->second); - DynamicDataFactory::get_instance()->delete_data(itValue->second); - complex_values_.erase(itKey); - complex_values_.erase(itValue); - sort_member_ids(keyId); - return ReturnCode_t::RETCODE_OK; - } -#else - auto itKey = values_.find(keyId); - auto itValue = values_.find(keyId + 1); - if (itKey != values_.end() && itValue != values_.end() && ((DynamicData*)itKey->second)->key_element_) - { - DynamicDataFactory::get_instance()->delete_data(((DynamicData*)itKey->second)); - DynamicDataFactory::get_instance()->delete_data(((DynamicData*)itValue->second)); - values_.erase(itKey); - values_.erase(itValue); - sort_member_ids(keyId); - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. Invalid input KeyId"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error removing from map. The current Kind " << get_kind() - << " doesn't support this method"); - return ReturnCode_t::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicData::clear_data() -{ - if (get_kind() == TK_SEQUENCE || get_kind() == TK_MAP || get_kind() == TK_ARRAY) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.clear(); -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - values_.clear(); -#endif // ifdef DYNAMIC_TYPES_CHECKING - return ReturnCode_t::RETCODE_OK; - } - - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error clearing data. The current Kind " << get_kind() - << " doesn't support this method"); - - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicData::get_complex_value( - DynamicData** value, - MemberId id) const -{ - // Check that the type is complex and in case of dynamic containers, check that the index is valid - if (id != MEMBER_ID_INVALID && (get_kind() == TK_STRUCTURE || get_kind() == TK_UNION || - get_kind() == TK_SEQUENCE || get_kind() == TK_ARRAY || get_kind() == TK_MAP || get_kind() == TK_BITSET)) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - *value = DynamicDataFactory::get_instance()->create_copy(it->second); - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#else - auto it = values_.find(id); - if (it != values_.end()) - { - *value = DynamicDataFactory::get_instance()->create_copy((DynamicData*)it->second); - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::set_complex_value( - DynamicData* value, - MemberId id) -{ - // Check that the type is complex and in case of dynamic containers, check that the index is valid - if (id != MEMBER_ID_INVALID && (get_kind() == TK_STRUCTURE || get_kind() == TK_UNION || - get_kind() == TK_SEQUENCE || get_kind() == TK_ARRAY || get_kind() == TK_MAP || get_kind() == TK_BITSET)) - { - // With containers, check that the index is valid - if ((get_kind() == TK_SEQUENCE || get_kind() == TK_ARRAY || get_kind() == TK_MAP) && - id < type_->get_total_bounds()) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(id); - if (it != complex_values_.end()) - { - if (get_kind() == TK_MAP && it->second->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - else - { - if (it->second != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(it->second); - } - complex_values_.erase(it); - - complex_values_.insert(std::make_pair(id, value)); - if (get_kind() == TK_UNION && union_id_ != id) - { - set_union_id(id); - } - } - } - else if (get_kind() == TK_ARRAY) - { - complex_values_.insert(std::make_pair(id, value)); - return ReturnCode_t::RETCODE_OK; - } - -#else - auto it = values_.find(id); - if (it != values_.end()) - { - if (get_kind() == TK_MAP && ((DynamicData*)it->second)->key_element_) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. They given id is a Key value."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - else - { - if (it->second != nullptr) - { - DynamicDataFactory::get_instance()->delete_data((DynamicData*)it->second); - } - values_.erase(it); - values_.insert(std::make_pair(id, value)); - if (get_kind() == TK_UNION && union_id_ != id) - { - set_union_id(id); - } - } - } - else if (get_kind() == TK_ARRAY) - { - values_.insert(std::make_pair(id, value)); - return ReturnCode_t::RETCODE_OK; - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex Value. id out of bounds."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error settings complex value. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicData::get_union_label( - uint64_t& value) const -{ - if (get_kind() == TK_UNION) - { - if (union_id_ != MEMBER_ID_INVALID) - { - value = union_label_; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. There isn't any label selected"); - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting union label. The kind " << get_kind() << "doesn't support it"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicData::deserialize( - eprosima::fastcdr::Cdr& cdr) -{ - if (type_ != nullptr && type_->get_descriptor()->annotation_is_non_serialized()) - { - return true; - } - - switch (get_kind()) - { - default: - break; - case TK_INT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int32_value_; - -#else - auto it = values_.begin(); - cdr >> *((int32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint32_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int16_value_; - -#else - auto it = values_.begin(); - cdr >> *((int16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint16_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> int64_value_; - -#else - auto it = values_.begin(); - cdr >> *((int64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint64_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float32_value_; -#else - auto it = values_.begin(); - cdr >> *((float*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float64_value_; - -#else - auto it = values_.begin(); - cdr >> *((double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT128: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> float128_value_; - -#else - auto it = values_.begin(); - cdr >> *((long double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> char8_value_; - -#else - auto it = values_.begin(); - cdr >> *((char*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> char16_value_; - -#else - auto it = values_.begin(); - cdr >> *((wchar_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BOOLEAN: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> bool_value_; - -#else - auto it = values_.begin(); - cdr >> *((bool*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BYTE: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> byte_value_; - -#else - auto it = values_.begin(); - cdr >> *((octet*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> string_value_; - -#else - auto it = values_.begin(); - cdr >> *((std::string*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> wstring_value_; - -#else - auto it = values_.begin(); - cdr >> *((std::wstring*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ENUM: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr >> uint32_value_; - -#else - auto it = values_.begin(); - cdr >> *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BITMASK: - { - size_t type_size = type_->get_size(); -#ifdef DYNAMIC_TYPES_CHECKING - switch (type_size) - { - case 1: - { - uint8_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 2: - { - uint16_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 3: - { - uint32_t temp; - cdr >> temp; - uint64_value_ = temp; - break; - } - case 4: cdr >> uint64_value_; break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } -#else - auto it = values_.begin(); - switch (type_size) - { - case 1: cdr >> *((uint8_t*)it->second); break; - case 2: cdr >> *((uint16_t*)it->second); break; - case 3: cdr >> *((uint32_t*)it->second); break; - case 4: cdr >> *((uint64_t*)it->second); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UNION: - { - union_discriminator_->deserialize_discriminator(cdr); - update_union_discriminator(); - set_union_id(union_id_); - if (union_id_ != MEMBER_ID_INVALID) - { - -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(union_id_); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } -#else - auto it = values_.find(union_id_); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - //uint32_t size(static_cast(complex_values_.size())), memberId(MEMBER_ID_INVALID); - for (uint32_t i = 0; i < complex_values_.size(); ++i) - { - //cdr >> memberId; - MemberDescriptor* member_desc = descriptors_[i]; - if (member_desc != nullptr) - { - if (!member_desc->annotation_is_non_serialized()) - { - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } - else - { - DynamicData* pData = DynamicDataFactory::get_instance()->create_data( - type_->get_element_type()); - pData->deserialize(cdr); - complex_values_.insert(std::make_pair(i, pData)); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#else - //uint32_t size(static_cast(values_.size())), memberId(MEMBER_ID_INVALID); - for (uint32_t i = 0; i < values_.size(); ++i) - { - //cdr >> memberId; - MemberDescriptor* member_desc = descriptors_[i]; - if (member_desc != nullptr) - { - if (!member_desc->annotation_is_non_serialized()) - { - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } - else - { - DynamicData* pData = DynamicDataFactory::get_instance()->create_data( - type_->get_element_type()); - pData->deserialize(cdr); - values_.insert(std::make_pair(i, pData)); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - case TK_ARRAY: - { - uint32_t size(type_->get_total_bounds()); - if (size > 0) - { - DynamicData* inputData(nullptr); - for (uint32_t i = 0; i < size; ++i) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - } - else - { - if (inputData == nullptr) - { - inputData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - - inputData->deserialize(cdr); - if (!inputData->equals(default_array_value_)) - { - complex_values_.insert(std::make_pair(i, inputData)); - inputData = nullptr; - } - } -#else - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - } - else - { - if (inputData == nullptr) - { - inputData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - - inputData->deserialize(cdr); - if (!inputData->equals(default_array_value_)) - { - values_.insert(std::make_pair(i, inputData)); - inputData = nullptr; - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - if (inputData != nullptr) - { - DynamicDataFactory::get_instance()->delete_data(inputData); - } - } - break; - } - case TK_SEQUENCE: - case TK_MAP: - { - uint32_t size(0); - bool bKeyElement(false); - cdr >> size; - - if (get_kind() == TK_MAP) - { - size *= 2; // We serialize the number of pairs. - } - for (uint32_t i = 0; i < size; ++i) - { - //cdr >> memberId; - if (get_kind() == TK_MAP) - { - bKeyElement = !bKeyElement; - } - -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(i); - if (it != complex_values_.end()) - { - it->second->deserialize(cdr); - it->second->key_element_ = bKeyElement; - } - else - { - DynamicData* pData = nullptr; - if (bKeyElement) - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_key_element_type()); - } - else - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - pData->deserialize(cdr); - pData->key_element_ = bKeyElement; - complex_values_.insert(std::make_pair(i, pData)); - } -#else - auto it = values_.find(i); - if (it != values_.end()) - { - ((DynamicData*)it->second)->deserialize(cdr); - ((DynamicData*)it->second)->key_element_ = bKeyElement; - } - else - { - DynamicData* pData = nullptr; - if (bKeyElement) - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_key_element_type()); - } - else - { - pData = DynamicDataFactory::get_instance()->create_data(type_->get_element_type()); - } - pData->deserialize(cdr); - pData->key_element_ = bKeyElement; - values_.insert(std::make_pair(i, pData)); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - break; - } - - case TK_ALIAS: - break; - } - return true; -} - -bool DynamicData::deserialize_discriminator( - eprosima::fastcdr::Cdr& cdr) -{ - switch (get_kind()) - { - case TK_INT32: - { - int32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_UINT32: - { - uint32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_INT16: - { - int16_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_UINT16: - { - uint16_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_INT64: - { - int64_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_UINT64: - { - uint64_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_CHAR8: - { - char aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_CHAR16: - { - wchar_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_BOOLEAN: - { - bool aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_BYTE: - { - octet aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_ENUM: - { - uint32_t aux; - cdr >> aux; - discriminator_value_ = static_cast(aux); - break; - } - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_STRING8: - case TK_STRING16: - case TK_BITMASK: - case TK_UNION: - case TK_STRUCTURE: - case TK_BITSET: - case TK_ARRAY: - case TK_SEQUENCE: - case TK_MAP: - case TK_ALIAS: - default: - break; - } - return true; -} - -size_t DynamicData::getCdrSerializedSize( - const DynamicData* data, - size_t current_alignment /*= 0*/) -{ - if (data->type_ != nullptr && data->type_->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (data->get_kind()) - { - default: - break; - case TK_INT32: - case TK_UINT32: - case TK_FLOAT32: - case TK_ENUM: - case TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case TK_INT16: - case TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case TK_INT64: - case TK_UINT64: - case TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case TK_BITMASK: - { - size_t type_size = data->type_->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case TK_CHAR8: - case TK_BOOLEAN: - case TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - // string content (length + characters + 1) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data->string_value_.length() + 1; -#else - auto it = data->values_.begin(); - // string content (length + characters + 1) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - ((std::string*)it->second)->length() + 1; -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - // string content (length + (characters * 4) ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - ((data->wstring_value_.length()) * 4); -#else - auto it = data->values_.begin(); - // string content (length + (characters * 4) ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - (((std::wstring*)it->second)->length() * 4); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UNION: - { - // Union discriminator - current_alignment += getCdrSerializedSize(data->union_discriminator_, current_alignment); - - if (data->union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = data->complex_values_.at(data->union_id_); -#else - auto it = (DynamicData*)data->values_.at(data->union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - current_alignment += getCdrSerializedSize(it, current_alignment); - } - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - //for (auto it = data->complex_values_.begin(); it != data->complex_values_.end(); ++it) - //{ - // current_alignment += getCdrSerializedSize(it->second, current_alignment); - //} - for (uint32_t i = 0; i < data->complex_values_.size(); ++i) - { - //cdr >> memberId; - auto d_it = data->descriptors_.find(i); - if (d_it != data->descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = data->complex_values_.find(i); - if (it != data->complex_values_.end()) - { - current_alignment += getCdrSerializedSize(it->second, current_alignment); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } - -#else - //for (auto it = data->values_.begin(); it != data->values_.end(); ++it) - //{ - // current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - //} - for (uint32_t i = 0; i < data->values_.size(); ++i) - { - //cdr >> memberId; - auto d_it = data->descriptors_.find(i); - if (d_it != data->descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = data->values_.find(i); - if (it != data->values_.end()) - { - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << i); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ARRAY: - { - uint32_t arraySize = data->type_->get_total_bounds(); - size_t emptyElementSize = - getEmptyCdrSerializedSize(data->type_->get_element_type().get(), current_alignment); - for (uint32_t idx = 0; idx < arraySize; ++idx) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = data->complex_values_.find(idx); - if (it != data->complex_values_.end()) -#else - auto it = data->values_.find(idx); - if (it != data->values_.end()) -#endif // ifdef DYNAMIC_TYPES_CHECKING - { - // Element Size - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } - else - { - current_alignment += emptyElementSize; - } - } - break; - } - case TK_SEQUENCE: - case TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = data->complex_values_.begin(); it != data->complex_values_.end(); ++it) - { - // Element Size - current_alignment += getCdrSerializedSize(it->second, current_alignment); - } -#else - for (auto it = data->values_.begin(); it != data->values_.end(); ++it) - { - // Element Size - current_alignment += getCdrSerializedSize((DynamicData*)it->second, current_alignment); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ALIAS: - break; - } - - return current_alignment - initial_alignment; -} - -size_t DynamicData::getKeyMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment /*= 0*/) -{ - size_t initial_alignment = current_alignment; - - // Structures check the the size of the key for their children - if (type->get_kind() == TK_STRUCTURE || type->get_kind() == TK_BITSET) - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (it->second->key_annotation()) - { - current_alignment += getKeyMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - } - } - } - else if (type->is_key_defined_) - { - return getMaxCdrSerializedSize(type, current_alignment); - } - return current_alignment - initial_alignment; -} - -size_t DynamicData::getMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment /*= 0*/) -{ - if (type->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (type->get_kind()) - { - default: - break; - case TK_INT32: - case TK_UINT32: - case TK_FLOAT32: - case TK_ENUM: - case TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case TK_INT16: - case TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case TK_INT64: - case TK_UINT64: - case TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case TK_BITMASK: - { - size_t type_size = type->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case TK_CHAR8: - case TK_BOOLEAN: - case TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case TK_STRING8: - { - // string length + string content + 1 - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + type->get_bounds() + 1; - break; - } - case TK_STRING16: - { - // string length + ( string content * 4 ) - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (type->get_bounds() * 4); - - break; - } - case TK_UNION: - { - // union id - current_alignment += getMaxCdrSerializedSize(type->get_discriminator_type(), current_alignment); - - // Check the size of all members and take the size of the biggest one. - size_t temp_size(0); - size_t max_element_size(0); - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - temp_size = getMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - if (temp_size > max_element_size) - { - max_element_size = temp_size; - } - } - current_alignment += max_element_size; - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (!it->second->descriptor_.annotation_is_non_serialized()) - { - current_alignment += getMaxCdrSerializedSize(it->second->descriptor_.type_, current_alignment); - } - } - break; - } - case TK_ARRAY: - { - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - case TK_SEQUENCE: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - case TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Key Elements size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_key_element_type())); - - // Value Elements size with the maximum size - current_alignment += type->get_total_bounds() * - (getMaxCdrSerializedSize(type->descriptor_->get_element_type())); - break; - } - - case TK_ALIAS: - { - current_alignment += getMaxCdrSerializedSize(type->get_base_type()); - break; - } - } - - return current_alignment - initial_alignment; -} - -void DynamicData::serialize( - eprosima::fastcdr::Cdr& cdr) const -{ - if (type_ != nullptr && type_->get_descriptor()->annotation_is_non_serialized()) - { - return; - } - - switch (get_kind()) - { - default: - break; - case TK_INT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int32_value_; -#else - auto it = values_.begin(); - cdr << *((int32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint32_value_; -#else - auto it = values_.begin(); - cdr << *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int16_value_; -#else - auto it = values_.begin(); - cdr << *((int16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint16_value_; -#else - auto it = values_.begin(); - cdr << *((uint16_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_INT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << int64_value_; -#else - auto it = values_.begin(); - cdr << *((int64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UINT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint64_value_; -#else - auto it = values_.begin(); - cdr << *((uint64_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT32: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float32_value_; -#else - auto it = values_.begin(); - cdr << *((float*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT64: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float64_value_; -#else - auto it = values_.begin(); - cdr << *((double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_FLOAT128: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << float128_value_; -#else - auto it = values_.begin(); - cdr << *((long double*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << char8_value_; -#else - auto it = values_.begin(); - cdr << *((char*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_CHAR16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << char16_value_; -#else - auto it = values_.begin(); - cdr << *((wchar_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BOOLEAN: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << bool_value_; -#else - auto it = values_.begin(); - cdr << *((bool*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BYTE: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << byte_value_; -#else - auto it = values_.begin(); - cdr << *((octet*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING8: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << string_value_; -#else - auto it = values_.begin(); - cdr << *((std::string*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRING16: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << wstring_value_; -#else - auto it = values_.begin(); - cdr << *((std::wstring*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ENUM: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << uint32_value_; -#else - auto it = values_.begin(); - cdr << *((uint32_t*)it->second); -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_BITMASK: - { - size_t type_size = type_->get_size(); -#ifdef DYNAMIC_TYPES_CHECKING - switch (type_size) - { - case 1: cdr << (uint8_t)uint64_value_; break; - case 2: cdr << (uint16_t)uint64_value_; break; - case 3: cdr << (uint32_t)uint64_value_; break; - case 4: cdr << uint64_value_; break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot serialize bitmask of size " << type_size); - } -#else - auto it = values_.begin(); - switch (type_size) - { - case 1: cdr << *((uint8_t*)it->second); break; - case 2: cdr << *((uint16_t*)it->second); break; - case 3: cdr << *((uint32_t*)it->second); break; - case 4: cdr << *((uint64_t*)it->second); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot serialize bitmask of size " << type_size); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_UNION: - { - union_discriminator_->serialize_discriminator(cdr); - //cdr << union_id_; - if (union_id_ != MEMBER_ID_INVALID) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.at(union_id_); -#else - auto it = (DynamicData*) values_.at(union_id_); -#endif // ifdef DYNAMIC_TYPES_CHECKING - it->serialize(cdr); - } - break; - } - case TK_SEQUENCE: // Sequence is like structure, but with size - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << static_cast(complex_values_.size()); - for (uint32_t idx = 0; idx < static_cast(complex_values_.size()); ++idx) - { - auto it = complex_values_.at(idx); - it->serialize(cdr); - } -#else - cdr << static_cast(values_.size()); - for (uint32_t idx = 0; idx < static_cast(values_.size()); ++idx) - { - auto it = values_.at(idx); - ((DynamicData*)it)->serialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { -#ifdef DYNAMIC_TYPES_CHECKING - for (uint32_t idx = 0; idx < static_cast(complex_values_.size()); ++idx) - { - auto d_it = descriptors_.find(idx); - if (d_it != descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = complex_values_.at(idx); - it->serialize(cdr); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << idx); - } - } -#else - for (uint32_t idx = 0; idx < static_cast(values_.size()); ++idx) - { - auto d_it = descriptors_.find(idx); - if (d_it != descriptors_.end()) - { - const MemberDescriptor* member_desc = d_it->second; - if (!member_desc->annotation_is_non_serialized()) - { - auto it = values_.at(idx); - ((DynamicData*)it)->serialize(cdr); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Missing MemberDescriptor " << idx); - } - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ARRAY: - { - uint32_t arraySize = type_->get_total_bounds(); - for (uint32_t idx = 0; idx < arraySize; ++idx) - { -#ifdef DYNAMIC_TYPES_CHECKING - auto it = complex_values_.find(idx); - if (it != complex_values_.end()) -#else - auto it = values_.find(idx); - if (it != values_.end()) -#endif // ifdef DYNAMIC_TYPES_CHECKING - { - ((DynamicData*)it->second)->serialize(cdr); - } - else - { - serialize_empty_data(type_->get_element_type(), cdr); - } - } - break; - } - case TK_MAP: - { -#ifdef DYNAMIC_TYPES_CHECKING - cdr << static_cast(complex_values_.size() / 2); // Number of pairs - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - it->second->serialize(cdr); - } -#else - cdr << static_cast(values_.size() / 2); - for (auto it = values_.begin(); it != values_.end(); ++it) - { - ((DynamicData*)it->second)->serialize(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - break; - } - case TK_ALIAS: - break; - } -} - -void DynamicData::serialize_discriminator( - eprosima::fastcdr::Cdr& cdr) const -{ - switch (get_kind()) - { - case TK_INT32: - { - int32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_UINT32: - { - uint32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_INT16: - { - int16_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_UINT16: - { - uint16_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_INT64: - { - int64_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_UINT64: - { - uint64_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_CHAR8: - { - char aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_CHAR16: - { - wchar_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_BOOLEAN: - { - bool aux = !!(discriminator_value_); - cdr << aux; - break; - } - case TK_BYTE: - { - octet aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_ENUM: - { - uint32_t aux = static_cast(discriminator_value_); - cdr << aux; - break; - } - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_STRING8: - case TK_STRING16: - case TK_BITMASK: - case TK_UNION: - case TK_SEQUENCE: - case TK_STRUCTURE: - case TK_BITSET: - case TK_ARRAY: - case TK_MAP: - case TK_ALIAS: - default: - break; - } -} - -void DynamicData::serializeKey( - eprosima::fastcdr::Cdr& cdr) const -{ - // Structures check the the size of the key for their children - if (type_->get_kind() == TK_STRUCTURE || type_->get_kind() == TK_BITSET) - { -#ifdef DYNAMIC_TYPES_CHECKING - for (auto it = complex_values_.begin(); it != complex_values_.end(); ++it) - { - it->second->serializeKey(cdr); - } -#else - for (auto it = values_.begin(); it != values_.end(); ++it) - { - ((DynamicData*)it->second)->serializeKey(cdr); - } -#endif // ifdef DYNAMIC_TYPES_CHECKING - } - else if (type_->is_key_defined_) - { - serialize(cdr); - } -} - -size_t DynamicData::getEmptyCdrSerializedSize( - const DynamicType* type, - size_t current_alignment /*= 0*/) -{ - if (type->get_descriptor()->annotation_is_non_serialized()) - { - return 0; - } - - size_t initial_alignment = current_alignment; - - switch (type->get_kind()) - { - default: - break; - case TK_INT32: - case TK_UINT32: - case TK_FLOAT32: - case TK_ENUM: - case TK_CHAR16: // WCHARS NEED 32 Bits on Linux & MacOS - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case TK_INT16: - case TK_UINT16: - { - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - break; - } - case TK_INT64: - case TK_UINT64: - case TK_FLOAT64: - { - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - break; - } - case TK_BITMASK: - { - size_t type_size = type->get_size(); - current_alignment += type_size + eprosima::fastcdr::Cdr::alignment(current_alignment, type_size); - break; - } - case TK_FLOAT128: - { - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - break; - } - case TK_CHAR8: - case TK_BOOLEAN: - case TK_BYTE: - { - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - break; - } - case TK_STRING8: - { - // string length + 1 - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 1; - break; - } - case TK_STRING16: - { - // string length - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - case TK_UNION: - { - // union discriminator - current_alignment += getEmptyCdrSerializedSize(type->get_discriminator_type().get(), current_alignment); - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { - for (auto it = type->member_by_id_.begin(); it != type->member_by_id_.end(); ++it) - { - if (!it->second->descriptor_.annotation_is_non_serialized()) - { - current_alignment += getEmptyCdrSerializedSize( - it->second->descriptor_.type_.get(), current_alignment); - } - } - break; - } - case TK_ARRAY: - { - // Elements count - //current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - // Element size with the maximum size - current_alignment += type->get_total_bounds() * - (getEmptyCdrSerializedSize(type->descriptor_->get_element_type().get())); - break; - } - case TK_SEQUENCE: - case TK_MAP: - { - // Elements count - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - break; - } - - case TK_ALIAS: - current_alignment += getEmptyCdrSerializedSize(type->get_base_type().get()); - break; - } - - return current_alignment - initial_alignment; -} - -void DynamicData::serialize_empty_data( - const DynamicType_ptr pType, - eprosima::fastcdr::Cdr& cdr) const -{ - if (pType->get_descriptor()->annotation_is_non_serialized()) - { - return; - } - - switch (pType->get_kind()) - { - default: - break; - case TK_ALIAS: - { - serialize_empty_data(pType->get_base_type(), cdr); - break; - } - case TK_INT32: - { - cdr << static_cast(0); - break; - } - case TK_UINT32: - { - cdr << static_cast(0); - break; - } - case TK_INT16: - { - cdr << static_cast(0); - break; - } - case TK_UINT16: - { - cdr << static_cast(0); - break; - } - case TK_INT64: - { - cdr << static_cast(0); - break; - } - case TK_UINT64: - { - cdr << static_cast(0); - break; - } - case TK_FLOAT32: - { - cdr << static_cast(0.0f); - break; - } - case TK_FLOAT64: - { - cdr << static_cast(0.0); - break; - } - case TK_FLOAT128: - { - cdr << static_cast(0.0); - break; - } - case TK_CHAR8: - { - cdr << static_cast(0); - break; - } - case TK_CHAR16: - { - cdr << static_cast(0); - break; - } - case TK_BOOLEAN: - { - cdr << static_cast(0); - break; - } - case TK_BYTE: - { - cdr << static_cast(0); - break; - } - case TK_STRING8: - { - cdr << std::string(); - break; - } - case TK_STRING16: - { - cdr << std::wstring(); - break; - } - case TK_ENUM: - { - cdr << static_cast(0); - break; - } - case TK_BITMASK: - { - size_t type_size = pType->get_size(); - switch (type_size) - { - case 1: cdr << static_cast(0); break; - case 2: cdr << static_cast(0); break; - case 3: cdr << static_cast(0); break; - case 4: cdr << static_cast(0); break; - default: EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot deserialize bitmask of size " << type_size); - } - break; - } - case TK_UNION: - { - cdr << static_cast(MEMBER_ID_INVALID); - break; - } - case TK_SEQUENCE: // Sequence is like structure, but with size - { - cdr << static_cast(0); - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { - for (uint32_t idx = 0; idx < pType->member_by_id_.size(); ++idx) - { - auto it = pType->member_by_id_.at(idx); - if (!it->descriptor_.annotation_is_non_serialized()) - { - serialize_empty_data(it->descriptor_.type_, cdr); - } - } - break; - } - case TK_ARRAY: - { - uint32_t arraySize = pType->get_total_bounds(); - //cdr << arraySize; - for (uint32_t i = 0; i < arraySize; ++i) - { - serialize_empty_data(pType->get_element_type(), cdr); - } - break; - } - case TK_MAP: - { - cdr << static_cast(0); - break; - } - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicDataFactory.cpp b/src/cpp/dynamic-types/DynamicDataFactory.cpp deleted file mode 100644 index a33fbd56738..00000000000 --- a/src/cpp/dynamic-types/DynamicDataFactory.cpp +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataFactoryReleaser -{ -public: - - ~DynamicDataFactoryReleaser() - { - DynamicDataFactory::delete_instance(); - } - -}; - -static DynamicDataFactoryReleaser s_releaser; -static DynamicDataFactory* s_instance = nullptr; - -DynamicDataFactory* DynamicDataFactory::get_instance() -{ - if (s_instance == nullptr) - { - s_instance = new DynamicDataFactory(); - } - return s_instance; -} - -ReturnCode_t DynamicDataFactory::delete_instance() -{ - if (s_instance != nullptr) - { - delete s_instance; - s_instance = nullptr; - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_ERROR; -} - -DynamicDataFactory::DynamicDataFactory() -{ -} - -DynamicDataFactory::~DynamicDataFactory() -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - while (dynamic_datas_.size() > 0) - { - delete_data(dynamic_datas_[dynamic_datas_.size() - 1]); - } - dynamic_datas_.clear(); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -DynamicData* DynamicDataFactory::create_copy( - const DynamicData* pData) -{ - DynamicData* newData = new DynamicData(pData); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - - return newData; -} - -DynamicData* DynamicDataFactory::create_data( - DynamicTypeBuilder* pBuilder) -{ - if (pBuilder != nullptr && pBuilder->is_consistent()) - { - DynamicType_ptr pType = DynamicTypeBuilderFactory::get_instance()->create_type(pBuilder); - return create_data(pType); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating DynamicData. Invalid dynamic type builder"); - return nullptr; - } -} - -DynamicData* DynamicDataFactory::create_data( - DynamicType_ptr pType) -{ - if (pType != nullptr && pType->is_consistent()) - { - try - { - DynamicData* newData = nullptr; - // ALIAS types create a DynamicData based on the base type and renames it with the name of the ALIAS. - if (pType->get_base_type() != nullptr) - { - if (pType->get_kind() == TK_ALIAS) - { - newData = create_data(pType->get_base_type()); - newData->set_type_name(pType->get_name()); - } - else if (pType->get_kind() == TK_STRUCTURE || pType->get_kind() == TK_BITSET) - { - newData = new DynamicData(pType); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - create_members(newData, pType->get_base_type()); - } - } - else - { - newData = new DynamicData(pType); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(newData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - - // Arrays must have created every members for serialization. - if (pType->get_kind() == TK_ARRAY) - { - DynamicData* defaultArrayData = new DynamicData(pType->get_element_type()); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(defaultArrayData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - newData->default_array_value_ = defaultArrayData; - } - // Unions need a discriminator data - else if (pType->get_kind() == TK_UNION) - { - DynamicData* discriminatorData = new DynamicData(pType->get_discriminator_type()); -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - { - std::unique_lock scoped(mutex_); - dynamic_datas_.push_back(discriminatorData); - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - newData->set_union_discriminator(discriminatorData); - } - } - return newData; - } - catch (std::exception& e) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Exception creating DynamicData: " << e.what()); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating DynamicData. Invalid dynamic type"); - return nullptr; - } -} - -ReturnCode_t DynamicDataFactory::create_members( - DynamicData* pData, - DynamicType_ptr pType) -{ - if (pType != nullptr && pData != nullptr) - { - pData->create_members(pType); - if ((pType->get_kind() == TK_STRUCTURE || pType->get_kind() == TK_BITSET) && pType->get_base_type() != nullptr) - { - create_members(pData, pType->get_base_type()); - } - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -ReturnCode_t DynamicDataFactory::delete_data( - DynamicData* pData) -{ - if (pData != nullptr) - { -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - auto it = std::find(dynamic_datas_.begin(), dynamic_datas_.end(), pData); - if (it != dynamic_datas_.end()) - { - dynamic_datas_.erase(it); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error deleting DynamicData. It isn't registered in the factory"); - return ReturnCode_t::RETCODE_ALREADY_DELETED; - } -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - delete pData; - } - return ReturnCode_t::RETCODE_OK; -} - -bool DynamicDataFactory::is_empty() const -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - return dynamic_datas_.empty(); -#else - return true; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicDataHelper.cpp b/src/cpp/dynamic-types/DynamicDataHelper.cpp deleted file mode 100644 index b7123b8c2f1..00000000000 --- a/src/cpp/dynamic-types/DynamicDataHelper.cpp +++ /dev/null @@ -1,891 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -using namespace eprosima::fastrtps::types; - -void DynamicDataHelper::print( - const DynamicData_ptr& data) -{ - print(data.get()); -} - -std::ostream& DynamicDataHelper::print( - std::ostream& output, - const DynamicData_ptr& data) -{ - return print(output, data.get()); -} - -void DynamicDataHelper::print( - const DynamicData* data) -{ - if (nullptr != data) - { - switch (data->type_->get_kind()) - { - case TK_STRUCTURE: - { - std::map members; - data->type_->get_all_members(members); - for (auto it : members) - { - print_member(const_cast(data), it.second); - } - break; - } - default: - { - std::cout << "Only structs are supported by DynamicDataHelper::print method." << std::endl; - } - } - } - else - { - std::cout << "" << std::endl; - } -} - -std::ostream& DynamicDataHelper::print( - std::ostream& output, - const DynamicData* data) -{ - if (nullptr != data) - { - switch (data->type_->get_kind()) - { - case TK_STRUCTURE: - { - std::map members; - data->type_->get_all_members(members); - for (auto it : members) - { - print_member(const_cast(data), output, it.second); - } - break; - } - default: - { - output << "Only structs are supported by DynamicDataHelper::print method.\n"; - } - } - } - else - { - output << "\n"; - } - return output; -} - -void DynamicDataHelper::print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind) -{ - switch (kind) - { - case TK_NONE: - { - std::cout << ""; - break; - } - case TK_BOOLEAN: - { - std::cout << (data->get_bool_value(id) ? "true" : "false"); - break; - } - case TK_BYTE: - { - std::cout << static_cast(data->get_byte_value(id)); - break; - } - case TK_INT16: - { - std::cout << data->get_int16_value(id); - break; - } - case TK_INT32: - { - std::cout << data->get_int32_value(id); - break; - } - case TK_INT64: - { - std::cout << data->get_int64_value(id); - break; - } - case TK_UINT16: - { - std::cout << data->get_uint16_value(id); - break; - } - case TK_UINT32: - { - std::cout << data->get_uint32_value(id); - break; - } - case TK_UINT64: - { - std::cout << data->get_uint64_value(id); - break; - } - case TK_FLOAT32: - { - std::cout << data->get_float32_value(id); - break; - } - case TK_FLOAT64: - { - std::cout << data->get_float64_value(id); - break; - } - case TK_FLOAT128: - { - std::cout << data->get_float128_value(id); - break; - } - case TK_CHAR8: - { - std::cout << data->get_char8_value(id); - break; - } - case TK_CHAR16: - { - std::cout << data->get_char16_value(id); - break; - } - case TK_STRING8: - { - std::cout << data->get_string_value(id); - break; - } - case TK_STRING16: - { - std::wcout << data->get_wstring_value(id); - break; - } - case TK_BITMASK: - { - size_t size = data->type_->get_size(); - switch (size) - { - case 1: std::cout << data->get_uint8_value(id); break; - case 2: std::cout << data->get_uint16_value(id); break; - case 3: std::cout << data->get_uint32_value(id); break; - case 4: std::cout << data->get_uint64_value(id); break; - } - break; - } - case TK_ENUM: - { - std::cout << data->get_uint32_value(id); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind, - std::ostream& output) -{ - switch (kind) - { - case TK_NONE: - { - output << ""; - break; - } - case TK_BOOLEAN: - { - output << (data->get_bool_value(id) ? "true" : "false"); - break; - } - case TK_BYTE: - { - output << std::to_string(static_cast(data->get_byte_value(id))); - break; - } - case TK_INT16: - { - output << std::to_string(data->get_int16_value(id)); - break; - } - case TK_INT32: - { - output << std::to_string(data->get_int32_value(id)); - break; - } - case TK_INT64: - { - output << std::to_string(data->get_int64_value(id)); - break; - } - case TK_UINT16: - { - output << std::to_string(data->get_uint16_value(id)); - break; - } - case TK_UINT32: - { - output << std::to_string(data->get_uint32_value(id)); - break; - } - case TK_UINT64: - { - output << std::to_string(data->get_uint64_value(id)); - break; - } - case TK_FLOAT32: - { - output << std::to_string(data->get_float32_value(id)); - break; - } - case TK_FLOAT64: - { - output << std::to_string(data->get_float64_value(id)); - break; - } - case TK_FLOAT128: - { - output << std::to_string(data->get_float128_value(id)); - break; - } - case TK_CHAR8: - { - output << std::to_string(data->get_char8_value(id)); - break; - } - case TK_CHAR16: - { - output << std::to_string(data->get_char16_value(id)); - break; - } - case TK_STRING8: - { - output << data->get_string_value(id); - break; - } - case TK_STRING16: - { - std::wcout << data->get_wstring_value(id); - break; - } - case TK_BITMASK: - { - size_t size = data->type_->get_size(); - switch (size) - { - case 1: output << std::to_string(data->get_uint8_value(id)); break; - case 2: output << std::to_string(data->get_uint16_value(id)); break; - case 3: output << std::to_string(data->get_uint32_value(id)); break; - case 4: output << std::to_string(data->get_uint64_value(id)); break; - } - break; - } - case TK_ENUM: - { - output << std::to_string(data->get_uint32_value(id)); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_collection( - DynamicData* data, - const std::string& tabs) -{ - switch (data->type_->get_element_type()->get_kind()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - case TK_ENUM: - case TK_BITMASK: - { - print_basic_collection(data); - break; - } - case TK_STRUCTURE: - case TK_BITSET: - case TK_UNION: - case TK_SEQUENCE: - case TK_ARRAY: - case TK_MAP: - { - print_complex_collection(data, tabs); - break; - } - default: - break; - - } -} - -void DynamicDataHelper::print_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs) -{ - switch (data->type_->get_element_type()->get_kind()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - case TK_ENUM: - case TK_BITMASK: - { - print_basic_collection(data, output); - break; - } - case TK_STRUCTURE: - case TK_BITSET: - case TK_UNION: - case TK_SEQUENCE: - case TK_ARRAY: - case TK_MAP: - { - print_complex_collection(data, output, tabs); - break; - } - default: - break; - - } -} - -void DynamicDataHelper::fill_array_positions( - const std::vector& bounds, - std::vector>& positions) -{ - uint32_t total_size = 1; - for (size_t i = 0; i < bounds.size(); ++i) - { - total_size *= bounds[i]; - } - - for (uint32_t idx = 0; idx < total_size; ++idx) - { - positions.push_back({}); - get_index_position(idx, bounds, positions[idx]); - } -} - -void DynamicDataHelper::get_index_position( - uint32_t index, - const std::vector& bounds, - std::vector& position) -{ - position.resize(bounds.size()); - if (bounds.size() > 0) - { - aux_index_position(index, static_cast(bounds.size() - 1), bounds, position); - } -} - -void DynamicDataHelper::aux_index_position( - uint32_t index, - uint32_t inner_index, - const std::vector& bounds, - std::vector& position) -{ - uint32_t remainder = index % bounds[inner_index]; - position[inner_index] = remainder; - if (inner_index > 0) - { - aux_index_position(index / bounds[inner_index], inner_index - 1, bounds, position); - } -} - -void DynamicDataHelper::print_basic_collection( - DynamicData* data) -{ - if (data->type_->get_kind() == TK_SEQUENCE) - { - auto count = data->get_item_count(); - std::cout << "["; - for (uint32_t i = 0; i < count; ++i) - { - print_basic_element(data, i, data->type_->get_element_type()->get_kind()); - std::cout << (i == count - 1 ? "]" : ", "); - } - if (count == 0) - { - std::cout << "]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - std::cout << "["; - for (size_t i = 0; i < positions.size(); ++i) - { - print_basic_element(data, data->get_array_index(positions[i]), data->type_->get_element_type()->get_kind()); - std::cout << (i == positions.size() - 1 ? "]" : ", "); - } - } - std::cout << std::endl; -} - -void DynamicDataHelper::print_basic_collection( - DynamicData* data, - std::ostream& output) -{ - if (data->type_->get_kind() == TK_SEQUENCE) - { - auto count = data->get_item_count(); - output << "["; - for (uint32_t i = 0; i < count; ++i) - { - print_basic_element(data, i, data->type_->get_element_type()->get_kind(), output); - output << (i == count - 1 ? "]" : ", "); - } - if (count == 0) - { - output << "]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - output << "["; - for (size_t i = 0; i < positions.size(); ++i) - { - print_basic_element(data, data->get_array_index(positions[i]), - data->type_->get_element_type()->get_kind(), output); - output << (i == positions.size() - 1 ? "]" : ", "); - } - } - output << "\n"; -} - -void DynamicDataHelper::print_complex_collection( - DynamicData* data, - const std::string& tabs) -{ - std::cout << std::endl; - if (data->type_->get_kind() == TK_SEQUENCE) - { - auto count = data->get_item_count(); - - for (uint32_t i = 0; i < count; ++i) - { - std::cout << tabs << "[" << i << "] = "; - print_complex_element(data, i, tabs); - std::cout << std::endl; - } - - if (count == 0) - { - std::cout << "[]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - for (size_t i = 0; i < positions.size(); ++i) - { - std::cout << tabs << "[" << i << "] = "; - print_complex_element(data, data->get_array_index(positions[i]), tabs); - std::cout << std::endl; - } - } -} - -void DynamicDataHelper::print_complex_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs) -{ - output << "\n"; - if (data->type_->get_kind() == TK_SEQUENCE) - { - auto count = data->get_item_count(); - - for (uint32_t i = 0; i < count; ++i) - { - output << tabs; - output << "["; - output << std::to_string(i); - output << "] = "; - print_complex_element(data, i, output, tabs); - output << "\n"; - } - - if (count == 0) - { - output << "[]"; - } - } - else - { - const std::vector& bounds = data->type_->descriptor_->bound_; - - std::vector> positions; - fill_array_positions(bounds, positions); - - for (size_t i = 0; i < positions.size(); ++i) - { - output << tabs; - output << "["; - output << std::to_string(i); - output << "] = "; - print_complex_element(data, data->get_array_index(positions[i]), output, tabs); - output << "\n"; - } - } -} - -void DynamicDataHelper::print_complex_element( - DynamicData* data, - MemberId id, - const std::string& tabs) -{ - DynamicData* st_data = data->loan_value(id); - const TypeDescriptor* desc = st_data->type_->get_type_descriptor(); - switch (desc->get_kind()) - { - case TK_STRUCTURE: - case TK_BITSET: - { - std::cout << "" << std::endl; - std::map members; - st_data->type_->get_all_members(members); - for (auto it : members) - { - print_member(st_data, it.second, tabs + "\t"); - } - break; - } - case TK_UNION: - { - std::cout << "" << std::endl; - DynamicTypeMember member; - st_data->type_->get_member(member, st_data->union_id_); - print_member(st_data, &member, tabs + "\t"); - break; - } - case TK_SEQUENCE: - case TK_ARRAY: - { - print_collection(st_data, tabs + "\t"); - break; - } - case TK_MAP: - { - std::cout << "" << std::endl; - std::map members; - st_data->type_->get_all_members(members); - size_t size = st_data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId member_id = st_data->get_member_id_at_index(static_cast(index)); - std::cout << "Key: "; - print_member(st_data, members[member_id], tabs + "\t"); - member_id = data->get_member_id_at_index(static_cast(index + 1)); - std::cout << "Value: "; - print_member(st_data, members[member_id], tabs + "\t"); - } - break; - } - default: - break; - } - data->return_loaned_value(st_data); -} - -void DynamicDataHelper::print_complex_element( - DynamicData* data, - MemberId id, - std::ostream& output, - const std::string& tabs) -{ - DynamicData* st_data = data->loan_value(id); - const TypeDescriptor* desc = st_data->type_->get_type_descriptor(); - switch (desc->get_kind()) - { - case TK_STRUCTURE: - case TK_BITSET: - { - output << "\n"; - std::map members; - st_data->type_->get_all_members(members); - for (auto it : members) - { - print_member(st_data, output, it.second, tabs + "\t"); - } - break; - } - case TK_UNION: - { - output << "\n"; - DynamicTypeMember member; - st_data->type_->get_member(member, st_data->union_id_); - print_member(st_data, output, &member, tabs + "\t"); - break; - } - case TK_SEQUENCE: - case TK_ARRAY: - { - print_collection(st_data, output, tabs + "\t"); - break; - } - case TK_MAP: - { - output << "\n"; - std::map members; - st_data->type_->get_all_members(members); - size_t size = st_data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId member_id = st_data->get_member_id_at_index(static_cast(index)); - output << "Key: "; - print_member(st_data, output, members[member_id], tabs + "\t"); - member_id = data->get_member_id_at_index(static_cast(index + 1)); - output << "Value: "; - print_member(st_data, output, members[member_id], tabs + "\t"); - } - break; - } - default: - break; - } - data->return_loaned_value(st_data); -} - -void DynamicDataHelper::print_member( - DynamicData* data, - const DynamicTypeMember* type, - const std::string& tabs) -{ - std::cout << tabs << type->get_name() << ": "; - const MemberDescriptor* desc = type->get_descriptor(); - switch (desc->get_kind()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - case TK_ENUM: - case TK_BITMASK: - { - print_basic_element(data, type->get_id(), desc->get_kind()); - std::cout << std::endl; - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { - DynamicData* st_data = data->loan_value(type->get_id()); - std::cout << "" << std::endl; - std::map members; - desc->get_type()->get_all_members(members); - for (auto it : members) - { - print_member(st_data, it.second, tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - case TK_UNION: - { - std::cout << "" << std::endl; - DynamicData* st_data = data->loan_value(type->get_id()); - DynamicTypeMember member; - desc->get_type()->get_member(member, data->union_id_); - print_member(st_data, &member, tabs + "\t"); - break; - } - case TK_SEQUENCE: - case TK_ARRAY: - { - DynamicData* st_data = data->loan_value(type->get_id()); - print_collection(st_data, tabs + "\t"); - data->return_loaned_value(st_data); - break; - } - case TK_MAP: - { - std::cout << "" << std::endl; - DynamicData* st_data = data->loan_value(type->get_id()); - std::map members; - desc->get_type()->get_all_members(members); - size_t size = data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId id = data->get_member_id_at_index(static_cast(index)); - std::cout << "Key: "; - print_member(st_data, members[id], tabs + "\t"); - id = data->get_member_id_at_index(static_cast(index + 1)); - std::cout << "Value: "; - print_member(st_data, members[id], tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - default: - break; - } -} - -void DynamicDataHelper::print_member( - DynamicData* data, - std::ostream& output, - const DynamicTypeMember* type, - const std::string& tabs) -{ - output << tabs; - output << type->get_name(); - output << ": "; - const MemberDescriptor* desc = type->get_descriptor(); - switch (desc->get_kind()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - case TK_ENUM: - case TK_BITMASK: - { - print_basic_element(data, type->get_id(), desc->get_kind(), output); - output << "\n"; - break; - } - case TK_STRUCTURE: - case TK_BITSET: - { - DynamicData* st_data = data->loan_value(type->get_id()); - output << "\n"; - std::map members; - desc->get_type()->get_all_members(members); - for (auto it : members) - { - print_member(st_data, output, it.second, tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - case TK_UNION: - { - output << "\n"; - DynamicData* st_data = data->loan_value(type->get_id()); - DynamicTypeMember member; - desc->get_type()->get_member(member, data->union_id_); - print_member(st_data, output, &member, tabs + "\t"); - break; - } - case TK_SEQUENCE: - case TK_ARRAY: - { - DynamicData* st_data = data->loan_value(type->get_id()); - print_collection(st_data, output, tabs + "\t"); - data->return_loaned_value(st_data); - break; - } - case TK_MAP: - { - output << "\n"; - DynamicData* st_data = data->loan_value(type->get_id()); - std::map members; - desc->get_type()->get_all_members(members); - size_t size = data->get_item_count(); - for (size_t i = 0; i < size; ++i) - { - size_t index = i * 2; - MemberId id = data->get_member_id_at_index(static_cast(index)); - output << "Key: "; - print_member(st_data, output, members[id], tabs + "\t"); - id = data->get_member_id_at_index(static_cast(index + 1)); - output << "Value: "; - print_member(st_data, output, members[id], tabs + "\t"); - } - data->return_loaned_value(st_data); - break; - } - default: - break; - } -} diff --git a/src/cpp/dynamic-types/DynamicDataPtr.cpp b/src/cpp/dynamic-types/DynamicDataPtr.cpp deleted file mode 100644 index 436f4076f3d..00000000000 --- a/src/cpp/dynamic-types/DynamicDataPtr.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicData_ptr::DynamicData_ptr( - DynamicData* pData) - : Base(pData, [](DynamicData* pData) -{ - DynamicDataFactory::get_instance()->delete_data(pData); -}) -{ -} - -DynamicData_ptr& DynamicData_ptr::operator =( - DynamicData* ptr) -{ - return operator =(DynamicData_ptr(ptr)); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicPubSubType.cpp b/src/cpp/dynamic-types/DynamicPubSubType.cpp deleted file mode 100644 index 8e6910e8412..00000000000 --- a/src/cpp/dynamic-types/DynamicPubSubType.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicPubSubType::DynamicPubSubType() - : dynamic_type_(nullptr) - , m_keyBuffer(nullptr) -{ -} - -DynamicPubSubType::DynamicPubSubType( - DynamicType_ptr pType) - : dynamic_type_(pType) - , m_keyBuffer(nullptr) -{ - UpdateDynamicTypeInfo(); -} - -DynamicPubSubType::~DynamicPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -void DynamicPubSubType::CleanDynamicType() -{ - dynamic_type_ = nullptr; -} - -DynamicType_ptr DynamicPubSubType::GetDynamicType() const -{ - return dynamic_type_; -} - -ReturnCode_t DynamicPubSubType::SetDynamicType( - DynamicData_ptr pData) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = pData->type_; - UpdateDynamicTypeInfo(); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicPubSubType::SetDynamicType( - DynamicType_ptr pType) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = pType; - UpdateDynamicTypeInfo(); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -void* DynamicPubSubType::createData() -{ - return DynamicDataFactory::get_instance()->create_data(dynamic_type_); -} - -void DynamicPubSubType::deleteData( - void* data) -{ - DynamicDataFactory::get_instance()->delete_data((DynamicData*)data); -} - -bool DynamicPubSubType::deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) -{ - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - try - { - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - //Deserialize the object: - ((DynamicData*)data)->deserialize(deser); - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - return true; -} - -bool DynamicPubSubType::getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* handle, - bool force_md5) -{ - if (dynamic_type_ == nullptr || !m_isGetKeyDefined) - { - return false; - } - DynamicData* pDynamicData = (DynamicData*)data; - size_t keyBufferSize = static_cast(DynamicData::getKeyMaxCdrSerializedSize(dynamic_type_)); - - if (m_keyBuffer == nullptr) - { - m_keyBuffer = (unsigned char*)malloc(keyBufferSize > 16 ? keyBufferSize : 16); - memset(m_keyBuffer, 0, keyBufferSize > 16 ? keyBufferSize : 16); - } - - eprosima::fastcdr::FastBuffer fastbuffer((char*)m_keyBuffer, keyBufferSize); - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, - eprosima::fastdds::rtps::DEFAULT_XCDR_VERSION); // Object that serializes the data. - pDynamicData->serializeKey(ser); - if (force_md5 || keyBufferSize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, (unsigned int)ser.getSerializedDataLength()); -#else - m_md5.update(m_keyBuffer, (unsigned int)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; -} - -std::function DynamicPubSubType::getSerializedSizeProvider( - void* data, - fastdds::dds::DataRepresentationId_t data_representation) -{ - static_cast(data_representation); - return [data]() -> uint32_t - { - return (uint32_t)DynamicData::getCdrSerializedSize((DynamicData*)data) + 4 /*encapsulation*/; - }; -} - -bool DynamicPubSubType::serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) -{ - if (dynamic_type_ == nullptr) - { - dynamic_type_ = static_cast(data)->type_; - UpdateDynamicTypeInfo(); - } - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == - fastdds::dds::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 - if (data_representation == fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION) - { - if (MUTABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); - } - else - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - } - } - else - { - if (MUTABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); - } - else if (APPENDABLE == extensibility_) - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - } - else - { - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - } - } -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - ((DynamicData*)data)->serialize(ser); // Serialize the object: - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -void DynamicPubSubType::UpdateDynamicTypeInfo() -{ - if (dynamic_type_ != nullptr) - { - m_isGetKeyDefined = dynamic_type_->key_annotation(); - - std::map membersMap; - dynamic_type_->get_all_members(membersMap); - for (auto it = membersMap.begin(); it != membersMap.end(); ++it) - { - m_isGetKeyDefined |= it->second->key_annotation(); - } - - m_typeSize = static_cast(DynamicData::getMaxCdrSerializedSize(dynamic_type_) + 4); - setName(dynamic_type_->get_name().c_str()); - - // Retrieve extensibility. - if (dynamic_type_->get_descriptor()->annotation_is_final()) - { - extensibility_ = FINAL; - } - else if (dynamic_type_->get_descriptor()->annotation_is_mutable()) - { - extensibility_ = MUTABLE; - } - else - { - extensibility_ = APPENDABLE; - } - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicType.cpp b/src/cpp/dynamic-types/DynamicType.cpp deleted file mode 100644 index dfdf6797dcd..00000000000 --- a/src/cpp/dynamic-types/DynamicType.cpp +++ /dev/null @@ -1,524 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicType::DynamicType() - : descriptor_(nullptr) - , name_("") - , kind_(TK_NONE) - , is_key_defined_(false) -{ -} - -DynamicType::DynamicType( - const TypeDescriptor* descriptor) - : is_key_defined_(false) -{ - descriptor_ = new TypeDescriptor(descriptor); - try - { - name_ = descriptor->get_name(); - kind_ = descriptor->get_kind(); - } - catch (...) - { - name_ = ""; - kind_ = TK_NONE; - } - - // Alias types use the same members than it's base class. - if (kind_ == TK_ALIAS) - { - for (auto it = descriptor_->get_base_type()->member_by_id_.begin(); - it != descriptor_->get_base_type()->member_by_id_.end(); ++it) - { - member_by_name_.insert(std::make_pair(it->second->get_name(), it->second)); - } - } -} - -DynamicType::DynamicType( - const DynamicTypeBuilder* other) - : descriptor_(nullptr) - , name_("") - , kind_(TK_NONE) - , is_key_defined_(false) -{ - copy_from_builder(other); -} - -DynamicType::~DynamicType() -{ - clear(); -} - -ReturnCode_t DynamicType::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - descriptor_->annotation_.push_back(pNewDescriptor); - is_key_defined_ = key_annotation(); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicType::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = descriptor_->get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - descriptor_->annotation_.push_back(pNewDescriptor); - is_key_defined_ = key_annotation(); - } - return ReturnCode_t::RETCODE_OK; -} - -ReturnCode_t DynamicType::apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(descriptor); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicType::apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(annotation_name, key, value); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -void DynamicType::clear() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); -} - -ReturnCode_t DynamicType::copy_from_builder( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - name_ = other->name_; - kind_ = other->kind_; - descriptor_ = new TypeDescriptor(other->descriptor_); - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - DynamicTypeMember* newMember = new DynamicTypeMember(it->second); - newMember->set_parent(this); - is_key_defined_ |= newMember->key_annotation(); - member_by_id_.insert(std::make_pair(newMember->get_id(), newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -bool DynamicType::exists_member_by_name( - const std::string& name) const -{ - if (descriptor_->get_base_type() != nullptr) - { - if (descriptor_->get_base_type()->exists_member_by_name(name)) - { - return true; - } - } - return member_by_name_.find(name) != member_by_name_.end(); -} - -ReturnCode_t DynamicType::get_descriptor( - TypeDescriptor* descriptor) const -{ - if (descriptor != nullptr) - { - descriptor->copy_from(descriptor_); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting TypeDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -const TypeDescriptor* DynamicType::get_descriptor() const -{ - return descriptor_; -} - -TypeDescriptor* DynamicType::get_descriptor() -{ - return descriptor_; -} - -bool DynamicType::key_annotation() const -{ - return descriptor_->annotation_get_key(); -} - -bool DynamicType::equals( - const DynamicType* other) const -{ - if (other != nullptr && descriptor_->annotation_.size() == other->descriptor_->annotation_.size() && - member_by_id_.size() == other->member_by_id_.size() && - member_by_name_.size() == other->member_by_name_.size()) - { - // Check the annotation list - for (auto it = descriptor_->annotation_.begin(), - it2 = other->descriptor_->annotation_.begin(); - it != descriptor_->annotation_.end(); ++it, ++it2) - { - if (!(*it)->equals(*it)) - { - return false; - } - } - - // Check the members by Id - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - auto it2 = other->member_by_id_.find(it->first); - if (it2 == other->member_by_id_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - auto it2 = member_by_id_.find(it->first); - if (it2 == member_by_id_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - // Check the members by Name - for (auto it = member_by_name_.begin(); it != member_by_name_.end(); ++it) - { - auto it2 = other->member_by_name_.find(it->first); - if (it2 == other->member_by_name_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - for (auto it = other->member_by_name_.begin(); it != other->member_by_name_.end(); ++it) - { - auto it2 = member_by_name_.find(it->first); - if (it2 == member_by_name_.end() || !it2->second->equals(it->second)) - { - return false; - } - } - - return true; - } - return false; -} - -MemberId DynamicType::get_members_count() const -{ - return static_cast(member_by_id_.size()); -} - -std::string DynamicType::get_name() const -{ - return name_; -} - -ReturnCode_t DynamicType::get_member_by_name( - DynamicTypeMember& member, - const std::string& name) -{ - auto it = member_by_name_.find(name); - if (it != member_by_name_.end()) - { - member = it->second; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member by name, member not found."); - return ReturnCode_t::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicType::get_all_members_by_name( - std::map& members) -{ - members = member_by_name_; - return ReturnCode_t::RETCODE_OK; -} - -ReturnCode_t DynamicType::get_member( - DynamicTypeMember& member, - MemberId id) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - member = it->second; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting member, member not found."); - return ReturnCode_t::RETCODE_ERROR; - } -} - -ReturnCode_t DynamicType::get_all_members( - std::map& members) -{ - members = member_by_id_; - return ReturnCode_t::RETCODE_OK; -} - -uint32_t DynamicType::get_annotation_count() -{ - return static_cast(descriptor_->annotation_.size()); -} - -ReturnCode_t DynamicType::get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx) -{ - if (idx < descriptor_->annotation_.size()) - { - descriptor = *descriptor_->annotation_[idx]; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error getting annotation, annotation not found."); - return ReturnCode_t::RETCODE_ERROR; - } -} - -DynamicType_ptr DynamicType::get_base_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_base_type(); - } - return DynamicType_ptr(nullptr); -} - -uint32_t DynamicType::get_bounds( - uint32_t index /*= 0*/) const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_bounds(index); - } - return BOUND_UNLIMITED; -} - -uint32_t DynamicType::get_bounds_size() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_bounds_size(); - } - return 0; -} - -DynamicType_ptr DynamicType::get_discriminator_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_discriminator_type(); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicType::get_element_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_element_type(); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicType::get_key_element_type() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_key_element_type(); - } - return DynamicType_ptr(nullptr); -} - -uint32_t DynamicType::get_total_bounds() const -{ - if (descriptor_ != nullptr) - { - return descriptor_->get_total_bounds(); - } - return BOUND_UNLIMITED; -} - -bool DynamicType::has_children() const -{ - return kind_ == TK_ANNOTATION || kind_ == TK_ARRAY || kind_ == TK_MAP || kind_ == TK_SEQUENCE - || kind_ == TK_STRUCTURE || kind_ == TK_UNION || kind_ == TK_BITSET; -} - -bool DynamicType::is_complex_kind() const -{ - return kind_ == TK_ANNOTATION || kind_ == TK_ARRAY || kind_ == TK_BITMASK || kind_ == TK_ENUM - || kind_ == TK_MAP || kind_ == TK_SEQUENCE || kind_ == TK_STRUCTURE || kind_ == TK_UNION || - kind_ == TK_BITSET; -} - -bool DynamicType::is_consistent() const -{ - return descriptor_->is_consistent(); -} - -bool DynamicType::is_discriminator_type() const -{ - if (kind_ == TK_ALIAS && descriptor_ != nullptr && descriptor_->get_base_type() != nullptr) - { - return descriptor_->get_base_type()->is_discriminator_type(); - } - return kind_ == TK_BOOLEAN || kind_ == TK_BYTE || kind_ == TK_INT16 || kind_ == TK_INT32 || - kind_ == TK_INT64 || kind_ == TK_UINT16 || kind_ == TK_UINT32 || kind_ == TK_UINT64 || - kind_ == TK_FLOAT32 || kind_ == TK_FLOAT64 || kind_ == TK_FLOAT128 || kind_ == TK_CHAR8 || - kind_ == TK_CHAR16 || kind_ == TK_STRING8 || kind_ == TK_STRING16 || kind_ == TK_ENUM || kind_ == TK_BITMASK; -} - -void DynamicType::set_name( - const std::string& name) -{ - if (descriptor_ != nullptr) - { - descriptor_->set_name(name); - } - name_ = name; -} - -size_t DynamicType::get_size() const -{ - switch (kind_) - { - case TK_BOOLEAN: case TK_BYTE: case TK_CHAR8: return 1; - case TK_INT16: case TK_UINT16: case TK_CHAR16: return 2; - case TK_INT32: case TK_UINT32: case TK_FLOAT32: return 4; - case TK_INT64: case TK_UINT64: case TK_FLOAT64: return 8; - case TK_FLOAT128: return 16; - case TK_BITMASK: case TK_ENUM: - { - size_t bits = descriptor_->get_bounds(0); - - if (bits % 8 == 0) - { - return bits / 8; - } - else - { - return (bits / 8) + 1; - } - } - } - EPROSIMA_LOG_ERROR(DYN_TYPES, "Called get_size() within a non primitive type! This is a program's logic error."); - return 0; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp b/src/cpp/dynamic-types/DynamicTypeBuilder.cpp deleted file mode 100644 index e4c06c29100..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeBuilder.cpp +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicTypeBuilder::DynamicTypeBuilder() - : descriptor_(nullptr) - , current_member_id_(0) - , max_index_(0) -{ -} - -DynamicTypeBuilder::DynamicTypeBuilder( - const DynamicTypeBuilder* builder) - : current_member_id_(0) - , max_index_(0) -{ - copy_from_builder(builder); -} - -DynamicTypeBuilder::DynamicTypeBuilder( - const TypeDescriptor* descriptor) - : current_member_id_(0) - , max_index_(0) -{ - descriptor_ = new TypeDescriptor(descriptor); - try - { - name_ = descriptor->get_name(); - kind_ = descriptor->get_kind(); - } - catch (...) - { - name_ = ""; - kind_ = TK_NONE; - } - - // Alias types use the same members than it's base class. - if (kind_ == TK_ALIAS) - { - for (auto it = descriptor_->get_base_type()->member_by_id_.begin(); - it != descriptor_->get_base_type()->member_by_id_.end(); ++it) - { - member_by_name_.insert(std::make_pair(it->second->get_name(), it->second)); - } - } - - refresh_member_ids(); -} - -DynamicTypeBuilder::~DynamicTypeBuilder() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); -} - -ReturnCode_t DynamicTypeBuilder::add_empty_member( - uint32_t index, - const std::string& name) -{ - MemberDescriptor descriptor(index, name); - if (descriptor_->get_kind() == TK_BITMASK) - { - if (index >= descriptor_->get_bounds(0)) - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, out of bounds."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - descriptor.annotation_set_position(static_cast(descriptor.get_index())); - } - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - const MemberDescriptor* descriptor) -{ - if (descriptor_ != nullptr && descriptor != nullptr && descriptor->is_consistent(descriptor_->get_kind())) - { - if (descriptor_->get_kind() == TK_ANNOTATION || descriptor_->get_kind() == TK_BITMASK - || descriptor_->get_kind() == TK_ENUM || descriptor_->get_kind() == TK_STRUCTURE - || descriptor_->get_kind() == TK_UNION || descriptor_->get_kind() == TK_BITSET) - { - if (!exists_member_by_name(descriptor->get_name()) || - (kind_ == TK_BITSET && descriptor->get_name().empty())) // Bitsets allow multiple empty members. - { - if (check_union_configuration(descriptor)) - { - DynamicTypeMember* newMember = new DynamicTypeMember(descriptor, current_member_id_); - - // If the index of the new member is bigger than the current maximum, put it at the end. - if (newMember->get_index() > max_index_) - { - newMember->set_index(max_index_++); - } - else - { - // Move every member bigger than the current index to the right. - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - if (it->second->get_index() >= newMember->get_index()) - { - it->second->set_index(it->second->get_index() + 1); - } - } - } - - if (!descriptor->get_name().empty()) // Don't store empty bitset members. - { - member_by_id_.insert(std::make_pair(current_member_id_, newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - else - { - delete newMember; - } - ++current_member_id_; - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, invalid union parameters."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, there is other member with the same name."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, the current type " << descriptor_->get_kind() - << " doesn't support members."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; - } - } - else - { - if (descriptor == nullptr) - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, Invalid input descriptor."); - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "Error adding member, The input descriptor isn't consistent."); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -RTPS_DllAPI MemberId DynamicTypeBuilder::get_member_id_by_name( - const std::string& name) const -{ - auto it = member_by_name_.find(name); - if (it != member_by_name_.end()) - { - return it->second->get_id(); - } - return MEMBER_ID_INVALID; -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type) -{ - if (type != nullptr) - { - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type)); - return add_member(&descriptor); - } - else - { - MemberDescriptor descriptor(id, name, DynamicType_ptr(nullptr)); - return add_member(&descriptor); - } -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type, - const std::string& defaultValue) -{ - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type), defaultValue); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) -{ - MemberDescriptor descriptor(id, name, DynamicTypeBuilderFactory::get_instance()->create_type(type), - defaultValue, unionLabels, isDefaultLabel); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type) -{ - MemberDescriptor descriptor(id, name, type); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue) -{ - MemberDescriptor descriptor(id, name, type, defaultValue); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) -{ - MemberDescriptor descriptor(id, name, type_, defaultValue, unionLabels, isDefaultLabel); - return add_member(&descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation( - AnnotationDescriptor& descriptor) -{ - return descriptor_->apply_annotation(descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - return descriptor_->apply_annotation(annotation_name, key, value); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - return _apply_annotation_to_member(id, descriptor); -} - -ReturnCode_t DynamicTypeBuilder::apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - return _apply_annotation_to_member(id, annotation_name, key, value); -} - -DynamicType_ptr DynamicTypeBuilder::build() -{ - if (descriptor_->is_consistent()) - { - return DynamicTypeBuilderFactory::get_instance()->create_type(this); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type. The current descriptor isn't consistent."); - return DynamicType_ptr(nullptr); - } -} - -bool DynamicTypeBuilder::check_union_configuration( - const MemberDescriptor* descriptor) -{ - if (descriptor_->get_kind() == TK_UNION) - { - if (!descriptor->is_default_union_value() && descriptor->get_union_labels().size() == 0) - { - return false; - } - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - // Check that there isn't any member as default label and that there isn't any member with the same case. - if ((descriptor->is_default_union_value() && it->second->is_default_union_value()) || - !descriptor->check_union_labels(it->second->get_union_labels())) - { - return false; - } - } - } - return true; -} - -ReturnCode_t DynamicTypeBuilder::copy_from( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - ReturnCode_t res = copy_from_builder(other); - if (res == ReturnCode_t::RETCODE_OK) - { - current_member_id_ = other->current_member_id_; - } - return res; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicTypeBuilder. Invalid input parameter."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicTypeBuilder::copy_from_builder( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - clear(); - - name_ = other->name_; - kind_ = other->kind_; - descriptor_ = new TypeDescriptor(other->descriptor_); - - for (auto it = other->member_by_id_.begin(); it != other->member_by_id_.end(); ++it) - { - DynamicTypeMember* newMember = new DynamicTypeMember(it->second); - member_by_id_.insert(std::make_pair(newMember->get_id(), newMember)); - member_by_name_.insert(std::make_pair(newMember->get_name(), newMember)); - } - - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying DynamicType, invalid input type"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -void DynamicTypeBuilder::clear() -{ - name_ = ""; - kind_ = 0; - if (descriptor_ != nullptr) - { - delete descriptor_; - descriptor_ = nullptr; - } - - for (auto it = member_by_id_.begin(); it != member_by_id_.end(); ++it) - { - delete it->second; - } - member_by_id_.clear(); - member_by_name_.clear(); - current_member_id_ = 0; -} - -bool DynamicTypeBuilder::exists_member_by_name( - const std::string& name) const -{ - if (descriptor_->get_base_type() != nullptr) - { - if (descriptor_->get_base_type()->exists_member_by_name(name)) - { - return true; - } - } - return member_by_name_.find(name) != member_by_name_.end(); -} - -ReturnCode_t DynamicTypeBuilder::get_all_members( - std::map& members) -{ - members = member_by_id_; - return ReturnCode_t::RETCODE_OK; -} - -std::string DynamicTypeBuilder::get_name() const -{ - return name_; -} - -bool DynamicTypeBuilder::is_consistent() const -{ - return descriptor_->is_consistent(); -} - -bool DynamicTypeBuilder::is_discriminator_type() const -{ - if (kind_ == TK_ALIAS && descriptor_ != nullptr && descriptor_->get_base_type() != nullptr) - { - return descriptor_->get_base_type()->is_discriminator_type(); - } - return kind_ == TK_BOOLEAN || kind_ == TK_BYTE || kind_ == TK_INT16 || kind_ == TK_INT32 || - kind_ == TK_INT64 || kind_ == TK_UINT16 || kind_ == TK_UINT32 || kind_ == TK_UINT64 || - kind_ == TK_FLOAT32 || kind_ == TK_FLOAT64 || kind_ == TK_FLOAT128 || kind_ == TK_CHAR8 || - kind_ == TK_CHAR16 || kind_ == TK_STRING8 || kind_ == TK_STRING16 || kind_ == TK_ENUM || kind_ == TK_BITMASK; -} - -void DynamicTypeBuilder::refresh_member_ids() -{ - if ((descriptor_->get_kind() == TK_STRUCTURE || descriptor_->get_kind() == TK_BITSET) && - descriptor_->get_base_type() != nullptr) - { - current_member_id_ = descriptor_->get_base_type()->get_members_count(); - } -} - -ReturnCode_t DynamicTypeBuilder::set_name( - const std::string& name) -{ - if (descriptor_ != nullptr) - { - descriptor_->set_name(name); - } - name_ = name; - return ReturnCode_t::RETCODE_OK; -} - -ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(descriptor); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t DynamicTypeBuilder::_apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - auto it = member_by_id_.find(id); - if (it != member_by_id_.end()) - { - it->second->apply_annotation(annotation_name, key, value); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation to member. MemberId not found."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp deleted file mode 100644 index 5f02c0a0e8c..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp +++ /dev/null @@ -1,2858 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -static std::string get_type_name( - TypeKind kind) -{ - switch (kind) - { - // Primitive types, already defined (never will be asked, but ok) - case TK_BOOLEAN: return TKNAME_BOOLEAN; - case TK_INT16: return TKNAME_INT16; - case TK_INT32: return TKNAME_INT32; - case TK_UINT16: return TKNAME_UINT16; - case TK_UINT32: return TKNAME_UINT32; - case TK_FLOAT32: return TKNAME_FLOAT32; - case TK_FLOAT64: return TKNAME_FLOAT64; - case TK_CHAR8: return TKNAME_CHAR8; - case TK_BYTE: return TKNAME_BYTE; - case TK_INT64: return TKNAME_INT64; - case TK_UINT64: return TKNAME_UINT64; - case TK_FLOAT128: return TKNAME_FLOAT128; - case TK_CHAR16: return TKNAME_CHAR16; - /* - case TK_STRING8: return TKNAME_STRING8; - case TK_STRING16: return TKNAME_STRING16; - case TK_ALIAS: return TKNAME_ALIAS; - case TK_ENUM: return TKNAME_ENUM; - */ - case TK_BITMASK: return TKNAME_BITMASK; - /* - case TK_ANNOTATION: return TKNAME_ANNOTATION; - case TK_STRUCTURE: return TKNAME_STRUCTURE; - case TK_UNION: return TKNAME_UNION; - */ - case TK_BITSET: return TKNAME_BITSET; - /* - case TK_SEQUENCE: return TKNAME_SEQUENCE; - case TK_ARRAY: return TKNAME_ARRAY; - case TK_MAP: return TKNAME_MAP; - */ - default: - break; - } - return "UNDEF"; -} - -//static uint32_t s_typeNameCounter = 0; -static std::string GenerateTypeName( - const std::string& kind) -{ - std::string tempKind = kind; - std::replace(tempKind.begin(), tempKind.end(), ' ', '_'); - return tempKind;// + "_" + std::to_string(++s_typeNameCounter); -} - -class DynamicTypeBuilderFactoryReleaser -{ -public: - - ~DynamicTypeBuilderFactoryReleaser() - { - DynamicTypeBuilderFactory::delete_instance(); - } - -}; - -static DynamicTypeBuilderFactoryReleaser s_releaser; -static DynamicTypeBuilderFactory* g_instance = nullptr; -DynamicTypeBuilderFactory* DynamicTypeBuilderFactory::get_instance() -{ - if (g_instance == nullptr) - { - g_instance = new DynamicTypeBuilderFactory(); - } - return g_instance; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_instance() -{ - if (g_instance != nullptr) - { - delete g_instance; - g_instance = nullptr; - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_ERROR; -} - -DynamicTypeBuilderFactory::DynamicTypeBuilderFactory() -{ -} - -DynamicTypeBuilderFactory::~DynamicTypeBuilderFactory() -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - for (auto it = builders_list_.begin(); it != builders_list_.end(); ++it) - { - delete *it; - } - builders_list_.clear(); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -void DynamicTypeBuilderFactory::add_builder_to_list( - DynamicTypeBuilder* pBuilder) -{ - (void)pBuilder; -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - builders_list_.push_back(pBuilder); -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -DynamicType_ptr DynamicTypeBuilderFactory::build_type( - DynamicType_ptr other) -{ - return other; -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_type( - const TypeDescriptor* descriptor, - const std::string& name) -{ - if (descriptor != nullptr) - { - DynamicType_ptr pNewType(new DynamicType(descriptor)); - if (name.length() > 0) - { - pNewType->set_name(name); - } - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type, invalid input descriptor"); - return DynamicType_ptr(nullptr); - } -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_type( - const DynamicTypeBuilder* other) -{ - if (other != nullptr) - { - DynamicType_ptr pNewType(new DynamicType(other)); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building type, invalid input parameter"); - return DynamicType_ptr(nullptr); - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_alias_builder( - DynamicTypeBuilder* base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - DynamicType_ptr pType = create_type(base_type); - if (pType != nullptr) - { - return create_alias_builder(pType, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, Error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_alias_builder( - DynamicType_ptr base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_ALIAS; - pDescriptor.base_type_ = base_type; - if (sName.length() > 0) - { - pDescriptor.name_ = sName; - } - else - { - //pDescriptor.name_ = GenerateTypeName(get_type_name(TK_ALIAS)); - pDescriptor.name_ = base_type->get_name(); - } - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_array_builder( - const DynamicTypeBuilder* element_type, - const std::vector& bounds) -{ - if (element_type != nullptr) - { - DynamicType_ptr pType = create_type(element_type); - if (pType != nullptr) - { - return create_array_builder(pType, bounds); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, element_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_array_builder( - const DynamicType_ptr type, - const std::vector& bounds) -{ - if (type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_ARRAY; - pDescriptor.name_ = TypeNamesGenerator::get_array_type_name(type->get_name(), bounds, false); - pDescriptor.element_type_ = type; - pDescriptor.bound_ = bounds; - - for (uint32_t i = 0; i < pDescriptor.bound_.size(); ++i) - { - if (pDescriptor.bound_[i] == 0) - { - pDescriptor.bound_[i] = MAX_ELEMENTS_COUNT; - } - } - - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating array, element_type must be valid"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bitmask_builder( - uint32_t bound) -{ - if (bound <= MAX_BITMASK_LENGTH) - { - TypeDescriptor pBoolDescriptor; - pBoolDescriptor.kind_ = TK_BOOLEAN; - pBoolDescriptor.name_ = GenerateTypeName(get_type_name(TK_BOOLEAN)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_BITMASK; - // TODO review on implementation for IDL - pDescriptor.name_ = GenerateTypeName(get_type_name(TK_BITMASK)); - pDescriptor.element_type_ = create_type(&pBoolDescriptor); - pDescriptor.bound_.push_back(bound); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating bitmask, length exceeds the maximum value '" << MAX_BITMASK_LENGTH << "'"); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bitset_builder() -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_BITSET; - // TODO Review on implementation for IDL - pDescriptor.name_ = GenerateTypeName(get_type_name(TK_BITSET)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_bool_builder() -{ - TypeDescriptor pBoolDescriptor; - pBoolDescriptor.kind_ = TK_BOOLEAN; - pBoolDescriptor.name_ = GenerateTypeName(get_type_name(TK_BOOLEAN)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pBoolDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_byte_builder() -{ - TypeDescriptor pByteDescriptor; - pByteDescriptor.kind_ = TK_BYTE; - pByteDescriptor.name_ = GenerateTypeName(get_type_name(TK_BYTE)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pByteDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_char8_builder() -{ - TypeDescriptor pChar8Descriptor; - pChar8Descriptor.kind_ = TK_CHAR8; - pChar8Descriptor.name_ = GenerateTypeName(get_type_name(TK_CHAR8)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pChar8Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_char16_builder() -{ - TypeDescriptor pChar16Descriptor; - pChar16Descriptor.kind_ = TK_CHAR16; - pChar16Descriptor.name_ = GenerateTypeName(get_type_name(TK_CHAR16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pChar16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_annotation_primitive( - const std::string& name) -{ - TypeDescriptor pEnumDescriptor; - pEnumDescriptor.kind_ = TK_ANNOTATION; - //pEnumDescriptor.name_ = GenerateTypeName(get_type_name(TK_ANNOTATION)); - pEnumDescriptor.name_ = name; - - return DynamicType_ptr(new DynamicType(&pEnumDescriptor)); -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_enum_builder() -{ - TypeDescriptor pEnumDescriptor; - pEnumDescriptor.kind_ = TK_ENUM; - //pEnumDescriptor.name_ = GenerateTypeName(get_type_name(TK_ENUM)); - // Enum currently is an alias for uint32_t - pEnumDescriptor.name_ = GenerateTypeName(get_type_name(TK_UINT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pEnumDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float32_builder() -{ - TypeDescriptor pFloat32Descriptor; - pFloat32Descriptor.kind_ = TK_FLOAT32; - pFloat32Descriptor.name_ = GenerateTypeName(get_type_name(TK_FLOAT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float64_builder() -{ - TypeDescriptor pFloat64Descriptor; - pFloat64Descriptor.kind_ = TK_FLOAT64; - pFloat64Descriptor.name_ = GenerateTypeName(get_type_name(TK_FLOAT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_float128_builder() -{ - TypeDescriptor pFloat128Descriptor; - pFloat128Descriptor.kind_ = TK_FLOAT128; - pFloat128Descriptor.name_ = GenerateTypeName(get_type_name(TK_FLOAT128)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pFloat128Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int16_builder() -{ - TypeDescriptor pInt16Descriptor; - pInt16Descriptor.kind_ = TK_INT16; - pInt16Descriptor.name_ = GenerateTypeName(get_type_name(TK_INT16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int32_builder() -{ - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.kind_ = TK_INT32; - pInt32Descriptor.name_ = GenerateTypeName(get_type_name(TK_INT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_int64_builder() -{ - TypeDescriptor pInt64Descriptor; - pInt64Descriptor.kind_ = TK_INT64; - pInt64Descriptor.name_ = GenerateTypeName(get_type_name(TK_INT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pInt64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_map_builder( - DynamicTypeBuilder* key_element_type, - DynamicTypeBuilder* element_type, - uint32_t bound) -{ - if (key_element_type != nullptr && element_type != nullptr) - { - DynamicType_ptr pKeyType = create_type(key_element_type); - DynamicType_ptr pValueType = create_type(element_type); - if (pKeyType != nullptr && pValueType != nullptr) - { - return create_map_builder(pKeyType, pValueType, bound); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, Error creating dynamic types."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, element_type and key_element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_map_builder( - DynamicType_ptr key_type, - DynamicType_ptr value_type, - uint32_t bound) -{ - if (key_type != nullptr && value_type != nullptr) - { - if (bound == BOUND_UNLIMITED) - { - bound = MAX_ELEMENTS_COUNT; - } - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_MAP; - //pDescriptor.name_ = GenerateTypeName(get_type_name(TK_MAP)); - pDescriptor.bound_.push_back(bound); - pDescriptor.key_element_type_ = key_type; - pDescriptor.element_type_ = value_type; - - pDescriptor.name_ = TypeNamesGenerator::get_map_type_name(key_type->get_name(), value_type->get_name(), - bound, false); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating map, element_type and key_element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_sequence_builder( - const DynamicTypeBuilder* element_type, - uint32_t bound) -{ - if (element_type != nullptr) - { - DynamicType_ptr pType = create_type(element_type); - if (pType != nullptr) - { - return create_sequence_builder(pType, bound); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, error creating dynamic type."); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_sequence_builder( - const DynamicType_ptr type, - uint32_t bound) -{ - if (type != nullptr) - { - if (bound == BOUND_UNLIMITED) - { - bound = MAX_ELEMENTS_COUNT; - } - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_SEQUENCE; - pDescriptor.name_ = TypeNamesGenerator::get_sequence_type_name(type->get_name(), bound, false); - pDescriptor.bound_.push_back(bound); - pDescriptor.element_type_ = type; - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating sequence, element_type must be valid."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_string_builder( - uint32_t bound) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pCharDescriptor; - pCharDescriptor.kind_ = TK_CHAR8; - pCharDescriptor.name_ = GenerateTypeName(get_type_name(TK_CHAR8)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_STRING8; - //pDescriptor.name_ = GenerateTypeName(get_type_name(TK_STRING8)); - pDescriptor.element_type_ = create_type(&pCharDescriptor); - pDescriptor.bound_.push_back(bound); - - pDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, false, true); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_child_struct_builder( - DynamicTypeBuilder* parent_type) -{ - if (parent_type != nullptr && (parent_type->get_kind() == TK_STRUCTURE || parent_type->get_kind() == TK_BITSET)) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = parent_type->get_kind(); - pDescriptor.name_ = GenerateTypeName(get_type_name(parent_type->get_kind())); - pDescriptor.base_type_ = create_type(parent_type); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating child struct, invalid input type."); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_struct_builder() -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_STRUCTURE; - pDescriptor.name_ = GenerateTypeName(get_type_name(TK_STRUCTURE)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_custom_builder( - const TypeDescriptor* descriptor, - const std::string& name /*= ""*/) -{ - if (descriptor != nullptr) - { - TypeKind kind = descriptor->get_kind(); - if (kind == TK_BOOLEAN || kind == TK_BYTE || kind == TK_INT16 || kind == TK_INT32 || - kind == TK_INT64 || kind == TK_UINT16 || kind == TK_UINT32 || kind == TK_UINT64 || - kind == TK_FLOAT32 || kind == TK_FLOAT64 || kind == TK_FLOAT128 || kind == TK_CHAR8 || - kind == TK_CHAR16 || kind == TK_STRING8 || kind == TK_STRING16 || kind == TK_ALIAS || - kind == TK_ENUM || kind == TK_BITMASK || kind == TK_STRUCTURE || kind == TK_UNION || - kind == TK_BITSET || kind == TK_SEQUENCE || kind == TK_ARRAY || kind == TK_MAP || - kind == TK_ANNOTATION) - { - DynamicTypeBuilder* pNewType = new DynamicTypeBuilder(descriptor); - if (pNewType != nullptr && name.length() > 0) - { - pNewType->set_name(name); - } - add_builder_to_list(pNewType); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating type, unsupported type kind: " << static_cast(kind)); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating type, invalid input descriptor."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_builder_copy( - const DynamicTypeBuilder* type) -{ - if (type != nullptr) - { - DynamicTypeBuilder* pNewType = new DynamicTypeBuilder(type); - add_builder_to_list(pNewType); - return pNewType; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating type, invalid input type."); - } - return nullptr; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint16_builder() -{ - TypeDescriptor pUInt16Descriptor; - pUInt16Descriptor.kind_ = TK_UINT16; - pUInt16Descriptor.name_ = GenerateTypeName(get_type_name(TK_UINT16)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt16Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint32_builder() -{ - TypeDescriptor pUInt32Descriptor; - pUInt32Descriptor.kind_ = TK_UINT32; - pUInt32Descriptor.name_ = GenerateTypeName(get_type_name(TK_UINT32)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt32Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_uint64_builder() -{ - TypeDescriptor pUInt64Descriptor; - pUInt64Descriptor.kind_ = TK_UINT64; - pUInt64Descriptor.name_ = GenerateTypeName(get_type_name(TK_UINT64)); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUInt64Descriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_union_builder( - DynamicTypeBuilder* discriminator_type) -{ - if (discriminator_type != nullptr && discriminator_type->is_discriminator_type()) - { - DynamicType_ptr pType = create_type(discriminator_type); - if (pType != nullptr) - { - return create_union_builder(pType); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, Error creating discriminator type"); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, invalid discriminator type"); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_union_builder( - DynamicType_ptr discriminator_type) -{ - if (discriminator_type != nullptr && discriminator_type->is_discriminator_type()) - { - TypeDescriptor pUnionDescriptor; - pUnionDescriptor.kind_ = TK_UNION; - pUnionDescriptor.name_ = GenerateTypeName(get_type_name(TK_UNION)); - pUnionDescriptor.discriminator_type_ = discriminator_type; - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pUnionDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error building Union, invalid discriminator type"); - return nullptr; - } -} - -DynamicTypeBuilder* DynamicTypeBuilderFactory::create_wstring_builder( - uint32_t bound) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pCharDescriptor; - pCharDescriptor.kind_ = TK_CHAR16; - pCharDescriptor.name_ = GenerateTypeName(get_type_name(TK_CHAR16)); - - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_STRING16; - //pDescriptor.name_ = GenerateTypeName(get_type_name(TK_STRING16)); - pDescriptor.element_type_ = create_type(&pCharDescriptor); - pDescriptor.bound_.push_back(bound); - - pDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, true, true); - - DynamicTypeBuilder* pNewTypeBuilder = new DynamicTypeBuilder(&pDescriptor); - add_builder_to_list(pNewTypeBuilder); - return pNewTypeBuilder; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_builder( - DynamicTypeBuilder* builder) -{ - if (builder != nullptr) - { -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::unique_lock scoped(mutex_); - auto it = std::find(builders_list_.begin(), builders_list_.end(), builder); - if (it != builders_list_.end()) - { - builders_list_.erase(it); - delete builder; - } - else - { - EPROSIMA_LOG_WARNING(DYN_TYPES, "The given type has been deleted previously."); - return ReturnCode_t::RETCODE_ALREADY_DELETED; - } -#else - delete builder; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - } - return ReturnCode_t::RETCODE_OK; -} - -ReturnCode_t DynamicTypeBuilderFactory::delete_type( - DynamicType* type) -{ - if (type != nullptr) - { - delete type; - } - return ReturnCode_t::RETCODE_OK; -} - -DynamicType_ptr DynamicTypeBuilderFactory::get_primitive_type( - TypeKind kind) -{ - TypeDescriptor pDescriptor; - pDescriptor.kind_ = kind; - pDescriptor.name_ = GenerateTypeName(get_type_name(kind)); - return create_type(&pDescriptor); -} - -bool DynamicTypeBuilderFactory::is_empty() const -{ -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - return builders_list_.empty(); -#else - return true; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK -} - -void DynamicTypeBuilderFactory::build_type_identifier( - const DynamicType_ptr type, - TypeIdentifier& identifier, - bool complete) const -{ - const TypeDescriptor* descriptor = type->get_type_descriptor(); - build_type_identifier(descriptor, identifier, complete); -} - -void DynamicTypeBuilderFactory::build_type_identifier( - const TypeDescriptor* descriptor, - TypeIdentifier& identifier, - bool complete) const -{ - const TypeIdentifier* id2 = (complete) - ? TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(descriptor->get_name()) - : TypeObjectFactory::get_instance()->get_type_identifier(descriptor->get_name()); - if (id2 != nullptr) - { - identifier = *id2; - } - else - { - switch (descriptor->kind_) - { - // Basic types - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - { - identifier._d(descriptor->kind_); - } - break; - // String TKs - case TK_STRING8: - { - if (descriptor->bound_[0] < 256) - { - identifier._d(TI_STRING8_SMALL); - identifier.string_sdefn().bound(static_cast(descriptor->bound_[0])); - } - else - { - identifier._d(TI_STRING8_LARGE); - identifier.string_ldefn().bound(descriptor->bound_[0]); - } - } - break; - case TK_STRING16: - { - if (descriptor->bound_[0] < 256) - { - identifier._d(TI_STRING16_SMALL); - identifier.string_sdefn().bound(static_cast(descriptor->bound_[0])); - } - else - { - identifier._d(TI_STRING16_LARGE); - identifier.string_ldefn().bound(descriptor->bound_[0]); - } - } - break; - // Collection TKs - case TK_SEQUENCE: - { - if (descriptor->bound_[0] < 256) - { - identifier._d(TI_PLAIN_SEQUENCE_SMALL); - identifier.seq_sdefn().bound(static_cast(descriptor->bound_[0])); - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.seq_sdefn().element_identifier(&elem_id); - } - else - { - identifier._d(TI_PLAIN_SEQUENCE_LARGE); - identifier.seq_ldefn().bound(descriptor->bound_[0]); - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.seq_ldefn().element_identifier(&elem_id); - } - } - break; - case TK_ARRAY: - { - uint32_t size = 0; - for (uint32_t s : descriptor->bound_) - { - size += s; - } - - if (size < 256) - { - identifier._d(TI_PLAIN_ARRAY_SMALL); - for (uint32_t b : descriptor->bound_) - { - identifier.array_sdefn().array_bound_seq().emplace_back(static_cast(b)); - } - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.array_sdefn().element_identifier(&elem_id); - } - else - { - identifier._d(TI_PLAIN_ARRAY_LARGE); - identifier.array_ldefn().array_bound_seq(descriptor->bound_); - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.array_ldefn().element_identifier(&elem_id); - } - } - break; - case TK_MAP: - { - if (descriptor->bound_[0] < 256) - { - identifier._d(TI_PLAIN_MAP_SMALL); - identifier.map_sdefn().bound(static_cast(descriptor->bound_[0])); - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.map_sdefn().element_identifier(&elem_id); - TypeIdentifier key_id; - build_type_identifier(descriptor->get_key_element_type()->descriptor_, key_id, complete); - identifier.map_sdefn().key_identifier(&key_id); - } - else - { - identifier._d(TI_PLAIN_MAP_LARGE); - identifier.map_ldefn().bound(static_cast(descriptor->bound_[0])); - TypeIdentifier elem_id; - build_type_identifier(descriptor->get_element_type()->descriptor_, elem_id, complete); - identifier.map_ldefn().element_identifier(&elem_id); - TypeIdentifier key_id; - build_type_identifier(descriptor->get_key_element_type()->descriptor_, key_id, complete); - identifier.map_ldefn().key_identifier(&key_id); - } - } - break; - // Constructed/Named types - case TK_ALIAS: - // Enumerated TKs - case TK_ENUM: - case TK_BITMASK: - // Structured TKs - case TK_ANNOTATION: - case TK_STRUCTURE: - case TK_UNION: - case TK_BITSET: - { - // Need to be registered as TypeObject first - // and return them as EK_MINIMAL or EK_COMPLETE - EPROSIMA_LOG_INFO(DYN_TYPE_FACTORY, "Complex types must be built from CompleteTypeObjects."); - } - break; - } - - TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), &identifier); - } -} - -void DynamicTypeBuilderFactory::build_type_object( - const DynamicType_ptr type, - TypeObject& object, - bool complete, - bool force) const -{ - const TypeDescriptor* descriptor = type->get_type_descriptor(); - - std::map membersMap; - type->get_all_members(membersMap); - std::vector members; - for (auto it : membersMap) - { - members.push_back(it.second->get_descriptor()); - } - - build_type_object(descriptor, object, &members, complete, force); -} - -void DynamicTypeBuilderFactory::build_type_object( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector* members, - bool complete, - bool force) const -{ - const TypeObject* obj2 = (force) - ? nullptr - : TypeObjectFactory::get_instance()->get_type_object(descriptor->get_name(), complete); - - if (obj2 != nullptr) - { - object = *obj2; - } - else - { - switch (descriptor->kind_) - { - // Basic types - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - { - break; - } - // String TKs - case TK_STRING8: - { - build_string8_type_code(descriptor); - break; - } - case TK_STRING16: - { - build_string16_type_code(descriptor); - break; - } - // Collection TKs - case TK_SEQUENCE: - { - build_sequence_type_code(descriptor, object, complete); - break; - } - case TK_ARRAY: - { - build_array_type_code(descriptor, object, complete); - break; - } - case TK_MAP: - { - build_map_type_code(descriptor, object, complete); - break; - } - - // Constructed/Named types - case TK_ALIAS: - { - build_alias_type_code(descriptor, object, complete); - } - break; - // Enumerated TKs - case TK_ENUM: - { - build_enum_type_code(descriptor, object, *members, complete); - } - break; - case TK_BITMASK: - { - build_bitmask_type_code(descriptor, object, *members, complete); - } - break; - // Structured TKs - case TK_ANNOTATION: - { - build_annotation_type_code(descriptor, object, *members, complete); - } - break; - case TK_STRUCTURE: - { - build_struct_type_code(descriptor, object, *members, complete); - } - break; - case TK_UNION: - { - build_union_type_code(descriptor, object, *members, complete); - } - break; - case TK_BITSET: - { - build_bitset_type_code(descriptor, object, *members, complete); - } - break; - } - } -} - -void DynamicTypeBuilderFactory::build_string8_type_code( - const TypeDescriptor* descriptor) const -{ - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_string_identifier( - descriptor->get_bounds(), - false); - - TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), identifier); -} - -void DynamicTypeBuilderFactory::build_string16_type_code( - const TypeDescriptor* descriptor) const -{ - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_string_identifier( - descriptor->get_bounds(), - true); - - TypeObjectFactory::get_instance()->add_type_identifier(descriptor->get_name(), identifier); -} - -void DynamicTypeBuilderFactory::build_sequence_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_SEQUENCE); - object.complete().sequence_type().collection_flag().IS_FINAL(false); - object.complete().sequence_type().collection_flag().IS_APPENDABLE(false); - object.complete().sequence_type().collection_flag().IS_MUTABLE(false); - object.complete().sequence_type().collection_flag().IS_NESTED(false); - object.complete().sequence_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().sequence_type().header().detail().ann_custom(), descriptor); - - object.complete().sequence_type().header().detail().type_name(descriptor->get_name()); - object.complete().sequence_type().header().common().bound(descriptor->get_bounds()); - object.complete().sequence_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.complete().sequence_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.complete().sequence_type().element().common().element_flags().IS_EXTERNAL(false); - object.complete().sequence_type().element().common().element_flags().IS_OPTIONAL(false); - object.complete().sequence_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.complete().sequence_type().element().common().element_flags().IS_KEY(false); - object.complete().sequence_type().element().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj, complete); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - object.complete().sequence_type().element().common().type(ident); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_sequence_identifier( - descriptor->get_element_type()->get_name(), - descriptor->get_bounds(), - true); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_SEQUENCE); - object.minimal().sequence_type().collection_flag().IS_FINAL(false); - object.minimal().sequence_type().collection_flag().IS_APPENDABLE(false); - object.minimal().sequence_type().collection_flag().IS_MUTABLE(false); - object.minimal().sequence_type().collection_flag().IS_NESTED(false); - object.minimal().sequence_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - object.minimal().sequence_type().header().common().bound(descriptor->get_bounds()); - object.minimal().sequence_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.minimal().sequence_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.minimal().sequence_type().element().common().element_flags().IS_EXTERNAL(false); - object.minimal().sequence_type().element().common().element_flags().IS_OPTIONAL(false); - object.minimal().sequence_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.minimal().sequence_type().element().common().element_flags().IS_KEY(false); - object.minimal().sequence_type().element().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - object.minimal().sequence_type().element().common().type(ident); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_sequence_identifier( - descriptor->get_element_type()->get_name(), - descriptor->get_bounds(), - false); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_array_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_ARRAY); - object.complete().array_type().collection_flag().IS_FINAL(false); - object.complete().array_type().collection_flag().IS_APPENDABLE(false); - object.complete().array_type().collection_flag().IS_MUTABLE(false); - object.complete().array_type().collection_flag().IS_NESTED(false); - object.complete().array_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().array_type().header().detail().ann_custom(), descriptor); - - object.complete().array_type().header().detail().type_name(descriptor->get_name()); - for (uint32_t i = 0; i < descriptor->get_bounds_size(); ++i) - { - object.complete().array_type().header().common().bound_seq().push_back(descriptor->get_bounds(i)); - } - object.complete().array_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.complete().array_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.complete().array_type().element().common().element_flags().IS_EXTERNAL(false); - object.complete().array_type().element().common().element_flags().IS_OPTIONAL(false); - object.complete().array_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.complete().array_type().element().common().element_flags().IS_KEY(false); - object.complete().array_type().element().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj, complete); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - object.complete().array_type().element().common().type(ident); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_array_identifier( - descriptor->get_element_type()->get_name(), - object.complete().array_type().header().common().bound_seq(), - true); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_ARRAY); - object.minimal().array_type().collection_flag().IS_FINAL(false); - object.minimal().array_type().collection_flag().IS_APPENDABLE(false); - object.minimal().array_type().collection_flag().IS_MUTABLE(false); - object.minimal().array_type().collection_flag().IS_NESTED(false); - object.minimal().array_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - for (uint32_t i = 0; i < descriptor->get_bounds_size(); ++i) - { - object.minimal().array_type().header().common().bound_seq().push_back(descriptor->get_bounds(i)); - } - object.minimal().array_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.minimal().array_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.minimal().array_type().element().common().element_flags().IS_EXTERNAL(false); - object.minimal().array_type().element().common().element_flags().IS_OPTIONAL(false); - object.minimal().array_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.minimal().array_type().element().common().element_flags().IS_KEY(false); - object.minimal().array_type().element().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - object.minimal().array_type().element().common().type(ident); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_array_identifier( - descriptor->get_element_type()->get_name(), - object.minimal().array_type().header().common().bound_seq(), - false); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_map_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_MAP); - object.complete().map_type().collection_flag().IS_FINAL(false); - object.complete().map_type().collection_flag().IS_APPENDABLE(false); - object.complete().map_type().collection_flag().IS_MUTABLE(false); - object.complete().map_type().collection_flag().IS_NESTED(false); - object.complete().map_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().map_type().header().detail().ann_custom(), descriptor); - - object.complete().map_type().header().detail().type_name(descriptor->get_name()); - object.complete().map_type().header().common().bound(descriptor->get_bounds()); - object.complete().map_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.complete().map_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.complete().map_type().element().common().element_flags().IS_EXTERNAL(false); - object.complete().map_type().element().common().element_flags().IS_OPTIONAL(false); - object.complete().map_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.complete().map_type().element().common().element_flags().IS_KEY(false); - object.complete().map_type().element().common().element_flags().IS_DEFAULT(false); - object.complete().map_type().key().common().element_flags().TRY_CONSTRUCT1(false); - object.complete().map_type().key().common().element_flags().TRY_CONSTRUCT2(false); - object.complete().map_type().key().common().element_flags().IS_EXTERNAL(false); - object.complete().map_type().key().common().element_flags().IS_OPTIONAL(false); - object.complete().map_type().key().common().element_flags().IS_MUST_UNDERSTAND(false); - object.complete().map_type().key().common().element_flags().IS_KEY(false); - object.complete().map_type().key().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj, complete); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - build_type_object(descriptor->get_key_element_type(), obj, complete); - TypeIdentifier ident_key = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_key_element_type()->get_name()); - - object.complete().map_type().element().common().type(ident); - object.complete().map_type().key().common().type(ident_key); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_map_identifier( - descriptor->get_key_element_type()->get_name(), - descriptor->get_element_type()->get_name(), - descriptor->get_bounds(), - true); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_MAP); - object.minimal().map_type().collection_flag().IS_FINAL(false); - object.minimal().map_type().collection_flag().IS_APPENDABLE(false); - object.minimal().map_type().collection_flag().IS_MUTABLE(false); - object.minimal().map_type().collection_flag().IS_NESTED(false); - object.minimal().map_type().collection_flag().IS_AUTOID_HASH(false); - - // Apply annotations - object.minimal().map_type().header().common().bound(descriptor->get_bounds()); - object.minimal().map_type().element().common().element_flags().TRY_CONSTRUCT1(false); - object.minimal().map_type().element().common().element_flags().TRY_CONSTRUCT2(false); - object.minimal().map_type().element().common().element_flags().IS_EXTERNAL(false); - object.minimal().map_type().element().common().element_flags().IS_OPTIONAL(false); - object.minimal().map_type().element().common().element_flags().IS_MUST_UNDERSTAND(false); - object.minimal().map_type().element().common().element_flags().IS_KEY(false); - object.minimal().map_type().element().common().element_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_element_type(), obj); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_element_type()->get_name()); - - build_type_object(descriptor->get_key_element_type(), obj, complete); - TypeIdentifier ident_key = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_key_element_type()->get_name()); - - object.minimal().map_type().element().common().type(ident); - object.minimal().map_type().key().common().type(ident_key); - - const TypeIdentifier* identifier = - TypeObjectFactory::get_instance()->get_map_identifier( - descriptor->get_key_element_type()->get_name(), - descriptor->get_element_type()->get_name(), - descriptor->get_bounds(), - false); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_alias_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_ALIAS); - object.complete().alias_type().alias_flags().IS_FINAL(false); - object.complete().alias_type().alias_flags().IS_APPENDABLE(false); - object.complete().alias_type().alias_flags().IS_MUTABLE(false); - object.complete().alias_type().alias_flags().IS_NESTED(false); - object.complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().alias_type().header().detail().ann_custom(), descriptor); - - object.complete().alias_type().header().detail().type_name(descriptor->get_name()); - object.complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - object.complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - object.complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - object.complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - object.complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - object.complete().alias_type().body().common().related_flags().IS_KEY(false); - object.complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_base_type(), obj, complete); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_base_type()->get_name()); - - object.complete().alias_type().body().common().related_type(ident); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Add our alias - TypeObjectFactory::get_instance()->add_alias(descriptor->get_name(), descriptor->get_base_type()->get_name()); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_ALIAS); - object.minimal().alias_type().alias_flags().IS_FINAL(false); - object.minimal().alias_type().alias_flags().IS_APPENDABLE(false); - object.minimal().alias_type().alias_flags().IS_MUTABLE(false); - object.minimal().alias_type().alias_flags().IS_NESTED(false); - object.minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - object.minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - object.minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - object.minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - object.minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - object.minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - object.minimal().alias_type().body().common().related_flags().IS_KEY(false); - object.minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //TypeIdentifier ident; - //build_type_identifier(descriptor->get_base_type()->descriptor_, ident); - TypeObject obj; - build_type_object(descriptor->get_base_type()->descriptor_, obj); - TypeIdentifier ident = *TypeObjectFactory::get_instance()->get_type_identifier( - descriptor->get_base_type()->get_name()); - - object.minimal().alias_type().body().common().related_type(ident); - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Add our alias - TypeObjectFactory::get_instance()->add_alias(descriptor->get_name(), descriptor->get_base_type()->get_name()); - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_enum_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_ENUM); - object.complete().enumerated_type().header().common().bit_bound(descriptor->annotation_get_bit_bound()); - object.complete().enumerated_type().header().detail().type_name(descriptor->get_name()); - - // Apply annotations - apply_type_annotations(object.complete().enumerated_type().header().detail().ann_custom(), descriptor); - - for (const MemberDescriptor* member : members) - { - CompleteEnumeratedLiteral mel; - mel.common().flags().IS_DEFAULT(member->annotation_is_default_literal()); - mel.common().value(member->get_index()); - mel.detail().name(member->get_name()); - - // Apply member annotations - TypeDescriptor member_type_descriptor; - member->type_->get_descriptor(&member_type_descriptor); - apply_type_annotations(mel.detail().ann_custom(), &member_type_descriptor); - - object.complete().enumerated_type().literal_seq().emplace_back(mel); - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_ENUM); - object.minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - for (const MemberDescriptor* member : members) - { - MinimalEnumeratedLiteral mel; - mel.common().flags().IS_DEFAULT(member->annotation_is_default_literal()); - mel.common().value(member->get_index()); - MD5 hash(member->get_name()); - for (int i = 0; i < 4; ++i) - { - mel.detail().name_hash()[i] = hash.digest[i]; - } - object.minimal().enumerated_type().literal_seq().emplace_back(mel); - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().enumerated_type(), - current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_struct_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_STRUCTURE); - - object.complete().struct_type().struct_flags().IS_FINAL(descriptor->annotation_is_final()); - object.complete().struct_type().struct_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); - object.complete().struct_type().struct_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); - object.complete().struct_type().struct_flags().IS_NESTED(descriptor->annotation_get_nested()); - object.complete().struct_type().struct_flags().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().struct_type().header().detail().ann_custom(), descriptor); - - for (const MemberDescriptor* member : members) - { - CompleteStructMember msm; - msm.common().member_id(member->get_index()); - msm.common().member_flags().TRY_CONSTRUCT1(false); - msm.common().member_flags().TRY_CONSTRUCT2(false); - msm.common().member_flags().IS_EXTERNAL(false); - msm.common().member_flags().IS_OPTIONAL(member->annotation_is_optional()); - msm.common().member_flags().IS_MUST_UNDERSTAND(member->annotation_is_must_understand()); - msm.common().member_flags().IS_KEY(member->annotation_is_key()); - msm.common().member_flags().IS_DEFAULT(false); - - // Apply member annotations - TypeDescriptor member_type_descriptor; - member->type_->get_descriptor(&member_type_descriptor); - apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - - std::map membersMap; - member->type_->get_all_members(membersMap); - std::vector innerMembers; - for (auto it : membersMap) - { - innerMembers.push_back(it.second->get_descriptor()); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj, &innerMembers); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() << " of struct " - << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - msm.common().member_type_id(memIdent); - } - - msm.detail().name(member->get_name()); - object.complete().struct_type().member_seq().emplace_back(msm); - } - - object.complete().struct_type().header().detail().type_name(descriptor->get_name()); - //object.complete().struct_type().header().detail().ann_builtin()... - //object.complete().struct_type().header().detail().ann_custom()... - - if (descriptor->get_base_type().get() != nullptr) - { - TypeIdentifier parent; - build_type_identifier(descriptor->get_base_type(), parent); - object.complete().struct_type().header().base_type(parent); - } - //object.complete().struct_type().header().base_type().equivalence_hash()[0..13]; - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().struct_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (CompleteStructMember& st : object.complete().struct_type().member_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_STRUCTURE); - - object.minimal().struct_type().struct_flags().IS_FINAL(descriptor->annotation_is_final()); - object.minimal().struct_type().struct_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); - object.minimal().struct_type().struct_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); - object.minimal().struct_type().struct_flags().IS_NESTED(descriptor->annotation_get_nested()); - object.minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); - - for (const MemberDescriptor* member : members) - { - MinimalStructMember msm; - msm.common().member_id(member->get_index()); - msm.common().member_flags().TRY_CONSTRUCT1(false); - msm.common().member_flags().TRY_CONSTRUCT2(false); - msm.common().member_flags().IS_EXTERNAL(false); - msm.common().member_flags().IS_OPTIONAL(member->annotation_is_optional()); - msm.common().member_flags().IS_MUST_UNDERSTAND(member->annotation_is_must_understand()); - msm.common().member_flags().IS_KEY(member->annotation_is_key()); - msm.common().member_flags().IS_DEFAULT(false); - //TypeIdentifier memIdent; - //build_type_identifier(member->type_->descriptor_, memIdent); - - std::map membersMap; - member->type_->get_all_members(membersMap); - std::vector innerMembers; - for (auto it : membersMap) - { - innerMembers.push_back(it.second->get_descriptor()); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj, &innerMembers, false); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() - << " of struct " << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - msm.common().member_type_id(memIdent); - } - - MD5 hash(member->get_name()); - for (int i = 0; i < 4; ++i) - { - msm.detail().name_hash()[i] = hash.digest[i]; - } - object.minimal().struct_type().member_seq().emplace_back(msm); - } - - if (descriptor->get_base_type().get() != nullptr) - { - TypeIdentifier parent; - build_type_identifier(descriptor->get_base_type(), parent, false); - object.minimal().struct_type().header().base_type(parent); - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().struct_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (MinimalStructMember& st : object.minimal().struct_type().member_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_union_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_UNION); - - object.complete().union_type().union_flags().IS_FINAL(descriptor->annotation_is_final()); - object.complete().union_type().union_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); - object.complete().union_type().union_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); - object.complete().union_type().union_flags().IS_NESTED(descriptor->annotation_get_nested()); - object.complete().union_type().union_flags().IS_AUTOID_HASH(false); - - object.complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); - object.complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); - object.complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); - object.complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); - object.complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); - object.complete().union_type().discriminator().common().member_flags().IS_KEY( - descriptor->discriminator_type_->descriptor_->annotation_get_key()); - object.complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); - - // Apply annotations - apply_type_annotations(object.complete().struct_type().header().detail().ann_custom(), descriptor); - - TypeObject discObj; - build_type_object(descriptor->discriminator_type_->descriptor_, discObj); - TypeIdentifier discIdent = - *TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name()); - object.complete().union_type().discriminator().common().type_id(discIdent); - - for (const MemberDescriptor* member : members) - { - CompleteUnionMember mum; - mum.common().member_id(member->get_index()); - mum.common().member_flags().TRY_CONSTRUCT1(false); - mum.common().member_flags().TRY_CONSTRUCT2(false); - mum.common().member_flags().IS_EXTERNAL(false); - mum.common().member_flags().IS_OPTIONAL(false); - mum.common().member_flags().IS_MUST_UNDERSTAND(false); - mum.common().member_flags().IS_KEY(false); - mum.common().member_flags().IS_DEFAULT(member->is_default_union_value()); - - // Apply member annotations - TypeDescriptor member_type_descriptor; - member->type_->get_descriptor(&member_type_descriptor); - apply_type_annotations(mum.detail().ann_custom(), &member_type_descriptor); - - std::map membersMap; - member->type_->get_all_members(membersMap); - std::vector innerMembers; - for (auto it : membersMap) - { - innerMembers.push_back(it.second->get_descriptor()); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj, &innerMembers); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() - << " of union " << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - mum.common().type_id(memIdent); - } - - for (uint64_t lab : member->get_union_labels()) - { - mum.common().label_seq().emplace_back(static_cast(lab)); - } - mum.detail().name(member->get_name()); - object.complete().union_type().member_seq().emplace_back(mum); - } - - object.complete().union_type().header().detail().type_name(descriptor->get_name()); - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_MINIMAL); - object.minimal()._d(TK_UNION); - - object.minimal().union_type().union_flags().IS_FINAL(descriptor->annotation_is_final()); - object.minimal().union_type().union_flags().IS_APPENDABLE(descriptor->annotation_is_appendable()); - object.minimal().union_type().union_flags().IS_MUTABLE(descriptor->annotation_is_mutable()); - object.minimal().union_type().union_flags().IS_NESTED(descriptor->annotation_get_nested()); - object.minimal().union_type().union_flags().IS_AUTOID_HASH(false); - - object.minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); - object.minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); - object.minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); - object.minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); - object.minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); - object.minimal().union_type().discriminator().common().member_flags().IS_KEY( - descriptor->discriminator_type_->descriptor_->annotation_get_key()); - object.minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); - - TypeObject discObj; - build_type_object(descriptor->discriminator_type_->descriptor_, discObj); - TypeIdentifier discIdent = - *TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name()); - object.minimal().union_type().discriminator().common().type_id(discIdent); - //*TypeObjectFactory::get_instance()->get_type_identifier(descriptor->discriminator_type_->get_name())); - - for (const MemberDescriptor* member : members) - { - MinimalUnionMember mum; - mum.common().member_id(member->get_index()); - mum.common().member_flags().TRY_CONSTRUCT1(false); - mum.common().member_flags().TRY_CONSTRUCT2(false); - mum.common().member_flags().IS_EXTERNAL(false); - mum.common().member_flags().IS_OPTIONAL(false); - mum.common().member_flags().IS_MUST_UNDERSTAND(false); - mum.common().member_flags().IS_KEY(false); - mum.common().member_flags().IS_DEFAULT(member->is_default_union_value()); - - //TypeIdentifier memIdent; - //build_type_identifier(member->type_->descriptor_, memIdent); - - std::map membersMap; - member->type_->get_all_members(membersMap); - std::vector innerMembers; - for (auto it : membersMap) - { - innerMembers.push_back(it.second->get_descriptor()); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj, &innerMembers); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() - << " of union " << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - mum.common().type_id(memIdent); - } - - for (uint64_t lab : member->get_union_labels()) - { - mum.common().label_seq().emplace_back(static_cast(lab)); - } - MD5 hash(member->get_name()); - for (int i = 0; i < 4; ++i) - { - mum.detail().name_hash()[i] = hash.digest[i]; - } - object.minimal().union_type().member_seq().emplace_back(mum); - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_bitset_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_BITSET); - - object.complete().bitset_type().bitset_flags().IS_FINAL(false); - object.complete().bitset_type().bitset_flags().IS_APPENDABLE(false); - object.complete().bitset_type().bitset_flags().IS_MUTABLE(false); - object.complete().bitset_type().bitset_flags().IS_NESTED(false); - object.complete().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().bitset_type().header().detail().ann_custom(), descriptor); - - for (const MemberDescriptor* member : members) - { - CompleteBitfield msm; - msm.common().position(member->annotation_get_position()); // Position stored as annotation - // Bitcount stored as bit_bound annotation - msm.common().bitcount(static_cast(member->annotation_get_bit_bound())); - msm.common().holder_type(member->type_->get_kind()); - msm.detail().name(member->get_name()); - - // Apply member annotations - TypeDescriptor member_type_descriptor; - member->type_->get_descriptor(&member_type_descriptor); - apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - - object.complete().bitset_type().field_seq().emplace_back(msm); - } - - object.complete().bitset_type().header().detail().type_name(descriptor->get_name()); - //object.complete().bitset_type().header().detail().ann_builtin()... - //object.complete().bitset_type().header().detail().ann_custom()... - - if (descriptor->get_base_type().get() != nullptr) - { - TypeIdentifier parent; - build_type_identifier(descriptor->get_base_type(), parent); - object.complete().bitset_type().header().base_type(parent); - } - //object.complete().bitset_type().header().base_type().equivalence_hash()[0..13]; - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().bitset_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (CompleteBitfield& st : object.complete().bitset_type().field_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_COMPLETE); - object.minimal()._d(TK_BITSET); - - object.minimal().bitset_type().bitset_flags().IS_FINAL(false); - object.minimal().bitset_type().bitset_flags().IS_APPENDABLE(false); - object.minimal().bitset_type().bitset_flags().IS_MUTABLE(false); - object.minimal().bitset_type().bitset_flags().IS_NESTED(false); - object.minimal().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - - for (const MemberDescriptor* member : members) - { - MinimalBitfield msm; - msm.common().position(member->annotation_get_position()); // Position stored as annotation - // Bitcount stored as bit_bound annotation - msm.common().bitcount(static_cast(member->annotation_get_bit_bound())); - msm.common().holder_type(member->type_->get_kind()); - MD5 parent_bitfield_hash(member->get_name()); - for (int i = 0; i < 4; ++i) - { - msm.name_hash()[i] = parent_bitfield_hash.digest[i]; - } - object.minimal().bitset_type().field_seq().emplace_back(msm); - } - - //object.minimal().bitset_type().header().detail().ann_builtin()... - //object.minimal().bitset_type().header().detail().ann_custom()... - - if (descriptor->get_base_type().get() != nullptr) - { - TypeIdentifier parent; - build_type_identifier(descriptor->get_base_type(), parent); - object.minimal().bitset_type().header().base_type(parent); - } - //object.minimal().bitset_type().header().base_type().equivalence_hash()[0..13]; - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().bitset_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (MinimalBitfield& st : object.minimal().bitset_type().field_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_bitmask_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_BITMASK); - - object.complete().bitmask_type().bitmask_flags().IS_FINAL(false); - object.complete().bitmask_type().bitmask_flags().IS_APPENDABLE(false); - object.complete().bitmask_type().bitmask_flags().IS_MUTABLE(false); - object.complete().bitmask_type().bitmask_flags().IS_NESTED(false); - object.complete().bitmask_type().bitmask_flags().IS_AUTOID_HASH(false); - - // Apply annotations - apply_type_annotations(object.complete().bitmask_type().header().detail().ann_custom(), descriptor); - - for (const MemberDescriptor* member : members) - { - CompleteBitflag msm; - msm.common().position(member->annotation_get_position()); // Position stored as annotation - msm.detail().name(member->get_name()); - - // Apply member annotations - TypeDescriptor member_type_descriptor; - member->type_->get_descriptor(&member_type_descriptor); - apply_type_annotations(msm.detail().ann_custom(), &member_type_descriptor); - - object.complete().bitmask_type().flag_seq().emplace_back(msm); - } - - object.complete().bitmask_type().header().detail().type_name(descriptor->get_name()); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().bitmask_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (CompleteBitflag& st : object.complete().bitmask_type().flag_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_COMPLETE); - object.minimal()._d(TK_BITMASK); - - object.minimal().bitmask_type().bitmask_flags().IS_FINAL(false); - object.minimal().bitmask_type().bitmask_flags().IS_APPENDABLE(false); - object.minimal().bitmask_type().bitmask_flags().IS_MUTABLE(false); - object.minimal().bitmask_type().bitmask_flags().IS_NESTED(false); - object.minimal().bitmask_type().bitmask_flags().IS_AUTOID_HASH(false); - - for (const MemberDescriptor* member : members) - { - MinimalBitflag msm; - msm.common().position(member->annotation_get_position()); // Position stored as annotation - MD5 parent_bitfield_hash(member->get_name()); - for (int i = 0; i < 4; ++i) - { - msm.detail().name_hash()[i] = parent_bitfield_hash.digest[i]; - } - object.minimal().bitmask_type().flag_seq().emplace_back(msm); - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().bitmask_type(), current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (MinimalBitflag& st : object.minimal().bitmask_type().flag_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::build_annotation_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete) const -{ - if (complete) - { - object._d(EK_COMPLETE); - object.complete()._d(TK_ANNOTATION); - - for (const MemberDescriptor* member : members) - { - CompleteAnnotationParameter msm; - msm.name(member->get_name()); - - if (!member->get_default_value().empty()) - { - AnnotationParameterValue apv; - set_annotation_default_value(apv, member); - msm.default_value(apv); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() - << " of annotation " << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - msm.common().member_type_id(memIdent); - } - - object.complete().annotation_type().member_seq().emplace_back(msm); - } - - object.complete().annotation_type().header().annotation_name(descriptor->get_name()); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.complete().annotation_type(), - current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (CompleteAnnotationParameter& st : object.complete().annotation_type().member_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } - else - { - object._d(EK_COMPLETE); - object.minimal()._d(TK_ANNOTATION); - - for (const MemberDescriptor* member : members) - { - MinimalAnnotationParameter msm; - msm.name(member->get_name()); - - if (!member->get_default_value().empty()) - { - AnnotationParameterValue apv; - set_annotation_default_value(apv, member); - msm.default_value(apv); - } - - TypeObject memObj; - build_type_object(member->type_->descriptor_, memObj); - const TypeIdentifier* typeId = - TypeObjectFactory::get_instance()->get_type_identifier(member->type_->get_name()); - if (typeId == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Member " << member->get_name() - << " of annotation " << descriptor->get_name() << " failed."); - } - else - { - TypeIdentifier memIdent = *typeId; - msm.common().member_type_id(memIdent); - } - - object.minimal().annotation_type().member_seq().emplace_back(msm); - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(object.minimal().annotation_type(), - current_alignment) + 4)); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - - for (MinimalAnnotationParameter& st : object.minimal().annotation_type().member_seq()) - { - ser << st; - } -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for (int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object(descriptor->get_name(), &identifier, &object); - } -} - -void DynamicTypeBuilderFactory::set_annotation_default_value( - AnnotationParameterValue& apv, - const MemberDescriptor* member) const -{ - switch (member->get_kind()) - { - case TK_BOOLEAN: - { - std::string value = member->get_default_value(); - std::transform(value.begin(), value.end(), value.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - apv.boolean_value(value.compare("0") != 0 || value.compare(CONST_TRUE) == 0); - } - break; - case TK_BYTE: - { - apv.byte_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case TK_INT16: - { - apv.int16_value(static_cast(std::stoi(member->get_default_value()))); - } - break; - case TK_INT32: - { - apv.int32_value(static_cast(std::stoi(member->get_default_value()))); - } - break; - case TK_INT64: - { - apv.int64_value(static_cast(std::stoll(member->get_default_value()))); - } - break; - case TK_UINT16: - { - apv.uint_16_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case TK_UINT32: - { - apv.uint32_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - case TK_UINT64: - { - apv.uint64_value(static_cast(std::stoull(member->get_default_value()))); - } - break; - case TK_FLOAT32: - { - apv.float32_value(std::stof(member->get_default_value())); - } - break; - case TK_FLOAT64: - { - apv.float64_value(std::stod(member->get_default_value())); - } - break; - case TK_FLOAT128: - { - apv.float128_value(std::stold(member->get_default_value())); - } - break; - case TK_CHAR8: - { - apv.char_value(member->get_default_value().c_str()[0]); - } - break; - case TK_CHAR16: - { - apv.wchar_value(wstring_from_bytes(member->get_default_value()).c_str()[0]); - } - break; - case TK_STRING8: - { - apv.string8_value(member->get_default_value()); - } - break; - case TK_STRING16: - { - apv.string16_value(wstring_from_bytes(member->get_default_value())); - } - break; - case TK_ENUM: - { - // TODO Translate from enum value name to integer value - apv.enumerated_value(static_cast(std::stoul(member->get_default_value()))); - } - break; - default: - break; - } -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_alias_type( - DynamicTypeBuilder* base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - DynamicType_ptr pType = create_type(base_type); - if (pType != nullptr) - { - return create_alias_type(pType, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, Error creating dynamic type"); - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_alias_type( - DynamicType_ptr base_type, - const std::string& sName) -{ - if (base_type != nullptr) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_ALIAS; - pDescriptor.base_type_ = base_type; - if (sName.length() > 0) - { - pDescriptor.name_ = sName; - } - else - { - pDescriptor.name_ = base_type->get_name(); - } - - return create_type(&pDescriptor, sName); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error creating alias type, base_type must be valid"); - } - return DynamicType_ptr(nullptr); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int32_type() -{ - TypeDescriptor pInt32Descriptor(GenerateTypeName(get_type_name(TK_INT32)), TK_INT32); - return DynamicType_ptr(new DynamicType(&pInt32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint32_type() -{ - TypeDescriptor pUint32Descriptor(GenerateTypeName(get_type_name(TK_UINT32)), TK_UINT32); - return DynamicType_ptr(new DynamicType(&pUint32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int16_type() -{ - TypeDescriptor pInt16Descriptor(GenerateTypeName(get_type_name(TK_INT16)), TK_INT16); - return DynamicType_ptr(new DynamicType(&pInt16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint16_type() -{ - TypeDescriptor pUint16Descriptor(GenerateTypeName(get_type_name(TK_UINT16)), TK_UINT16); - return DynamicType_ptr(new DynamicType(&pUint16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_int64_type() -{ - TypeDescriptor pInt64Descriptor(GenerateTypeName(get_type_name(TK_INT64)), TK_INT64); - return DynamicType_ptr(new DynamicType(&pInt64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_uint64_type() -{ - TypeDescriptor pUint64Descriptor(GenerateTypeName(get_type_name(TK_UINT64)), TK_UINT64); - return DynamicType_ptr(new DynamicType(&pUint64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float32_type() -{ - TypeDescriptor pFloat32Descriptor(GenerateTypeName(get_type_name(TK_FLOAT32)), TK_FLOAT32); - return DynamicType_ptr(new DynamicType(&pFloat32Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float64_type() -{ - TypeDescriptor pFloat64Descriptor(GenerateTypeName(get_type_name(TK_FLOAT64)), TK_FLOAT64); - return DynamicType_ptr(new DynamicType(&pFloat64Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_float128_type() -{ - TypeDescriptor pFloat128Descriptor(GenerateTypeName(get_type_name(TK_FLOAT128)), TK_FLOAT128); - return DynamicType_ptr(new DynamicType(&pFloat128Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_char8_type() -{ - TypeDescriptor pChar8Descriptor(GenerateTypeName(get_type_name(TK_CHAR8)), TK_CHAR8); - return DynamicType_ptr(new DynamicType(&pChar8Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_char16_type() -{ - TypeDescriptor pChar16Descriptor(GenerateTypeName(get_type_name(TK_CHAR16)), TK_CHAR16); - return DynamicType_ptr(new DynamicType(&pChar16Descriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_bool_type() -{ - TypeDescriptor pBoolDescriptor(GenerateTypeName(get_type_name(TK_BOOLEAN)), TK_BOOLEAN); - return DynamicType_ptr(new DynamicType(&pBoolDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_byte_type() -{ - TypeDescriptor pByteDescriptor(GenerateTypeName(get_type_name(TK_BYTE)), TK_BYTE); - return DynamicType_ptr(new DynamicType(&pByteDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_string_type( - uint32_t bound /*= MAX_STRING_LENGTH*/) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - TypeDescriptor pStringDescriptor("", TK_STRING8); - pStringDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, false, true); - pStringDescriptor.element_type_ = create_char8_type(); - pStringDescriptor.bound_.push_back(bound); - - return DynamicType_ptr(new DynamicType(&pStringDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_wstring_type( - uint32_t bound /*= MAX_STRING_LENGTH*/) -{ - if (bound == BOUND_UNLIMITED) - { - bound = MAX_STRING_LENGTH; - } - - TypeDescriptor pStringDescriptor("", TK_STRING16); - pStringDescriptor.name_ = TypeNamesGenerator::get_string_type_name(bound, true, true); - pStringDescriptor.element_type_ = create_char16_type(); - pStringDescriptor.bound_.push_back(bound); - - return DynamicType_ptr(new DynamicType(&pStringDescriptor)); -} - -DynamicType_ptr DynamicTypeBuilderFactory::create_bitset_type( - uint32_t bound) -{ - if (bound <= MAX_BITMASK_LENGTH) - { - TypeDescriptor pDescriptor; - pDescriptor.kind_ = TK_BITSET; - pDescriptor.name_ = GenerateTypeName(get_type_name(TK_BITSET)); - pDescriptor.bound_.push_back(bound); - return create_type(&pDescriptor, pDescriptor.name_); - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, - "Error creating bitmask, length exceeds the maximum value '" << MAX_BITMASK_LENGTH << "'"); - } - return DynamicType_ptr(nullptr); -} - -void DynamicTypeBuilderFactory::apply_type_annotations( - AppliedAnnotationSeq& annotations, - const TypeDescriptor* descriptor) const -{ - for (const AnnotationDescriptor* annotation : descriptor->annotation_) - { - AppliedAnnotation ann; - ann.annotation_typeid( - *TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(annotation->type_->get_name())); - std::map values; - annotation->get_all_value(values); - for (auto it : values) - { - AppliedAnnotationParameter ann_param; - MD5 message_hash(it.first); - for (int i = 0; i < 4; ++i) - { - ann_param.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue param_value; - param_value._d(annotation->type_->get_kind()); - param_value.from_string(it.second); - ann_param.value(param_value); - ann.param_seq().push_back(ann_param); - } - annotations.push_back(ann); - } -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp b/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp deleted file mode 100644 index d0e7477ac19..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicTypeBuilder_ptr::DynamicTypeBuilder_ptr(DynamicTypeBuilder* pType) - : Base(pType, [](DynamicTypeBuilder* pType) -{ - DynamicTypeBuilderFactory::get_instance()->delete_builder(pType); -}) -{ -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypeMember.cpp b/src/cpp/dynamic-types/DynamicTypeMember.cpp deleted file mode 100644 index f2f05085b43..00000000000 --- a/src/cpp/dynamic-types/DynamicTypeMember.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicTypeMember::DynamicTypeMember() - : parent_(nullptr) - , id_(MEMBER_ID_INVALID) -{ -} - -DynamicTypeMember::DynamicTypeMember( - const MemberDescriptor* descriptor, - MemberId id) - : parent_(nullptr) - , id_(id) -{ - descriptor_.copy_from(descriptor); - descriptor_.set_id(id); -} - -DynamicTypeMember::DynamicTypeMember( - const DynamicTypeMember* other) - : parent_(other->parent_) - , id_(other->id_) -{ - descriptor_.copy_from(&other->descriptor_); -} - -DynamicTypeMember::~DynamicTypeMember() -{ - parent_ = nullptr; -} - -ReturnCode_t DynamicTypeMember::apply_annotation( - AnnotationDescriptor& descriptor) -{ - // Update the annotations on the member Dynamic Type. - return descriptor_.apply_annotation(descriptor); -} - -ReturnCode_t DynamicTypeMember::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - // Update the annotations on the member Dynamic Type. - return descriptor_.apply_annotation(annotation_name, key, value); -} - -bool DynamicTypeMember::equals( - const DynamicTypeMember* other) const -{ - if (other != nullptr && descriptor_.annotation_.size() == other->descriptor_.annotation_.size()) - { - for (auto it = descriptor_.annotation_.begin(), - it2 = other->descriptor_.annotation_.begin(); - it != descriptor_.annotation_.end(); ++it, ++it2) - { - if (!(*it)->equals(*it2)) - { - return false; - } - } - return true; - } - else - { - return false; - } -} - -ReturnCode_t DynamicTypeMember::get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx) -{ - if (idx < descriptor_.annotation_.size()) - { - descriptor.copy_from(descriptor_.annotation_[idx]); - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; -} - -uint32_t DynamicTypeMember::get_annotation_count() -{ - return static_cast(descriptor_.annotation_.size()); -} - -bool DynamicTypeMember::key_annotation() const -{ - return descriptor_.annotation_is_key(); -} - -std::vector DynamicTypeMember::get_union_labels() const -{ - return descriptor_.get_union_labels(); -} - -ReturnCode_t DynamicTypeMember::get_descriptor( - MemberDescriptor* descriptor) const -{ - if (descriptor != nullptr) - { - descriptor->copy_from(&descriptor_); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting MemberDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -uint32_t DynamicTypeMember::get_index() const -{ - return descriptor_.get_index(); -} - -std::string DynamicTypeMember::get_name() const -{ - return descriptor_.get_name(); -} - -MemberId DynamicTypeMember::get_id() const -{ - return descriptor_.get_id(); -} - -bool DynamicTypeMember::is_default_union_value() const -{ - return descriptor_.is_default_union_value(); -} - -void DynamicTypeMember::set_index( - uint32_t index) -{ - descriptor_.set_index(index); -} - -void DynamicTypeMember::set_parent( - DynamicType* pType) -{ - parent_ = pType; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/DynamicTypePtr.cpp b/src/cpp/dynamic-types/DynamicTypePtr.cpp deleted file mode 100644 index c5caa57c194..00000000000 --- a/src/cpp/dynamic-types/DynamicTypePtr.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -DynamicType_ptr::DynamicType_ptr( - DynamicType* pType) - : Base(pType, [](DynamicType* pType) -{ - DynamicTypeBuilderFactory::get_instance()->delete_type(pType); -}) -{ -} - -DynamicType_ptr& DynamicType_ptr::operator =( - DynamicType* ptr) -{ - return operator =(DynamicType_ptr(ptr)); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/MemberDescriptor.cpp b/src/cpp/dynamic-types/MemberDescriptor.cpp deleted file mode 100644 index f3fdb79c0a0..00000000000 --- a/src/cpp/dynamic-types/MemberDescriptor.cpp +++ /dev/null @@ -1,806 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -MemberDescriptor::MemberDescriptor() - : name_("") - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ - copy_annotations_from_type(type_); -} - -MemberDescriptor::MemberDescriptor( - uint32_t index, - const std::string& name) - : name_(name) - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(index) - , default_label_(false) -{ - copy_annotations_from_type(type_); -} - -MemberDescriptor::MemberDescriptor( - const MemberDescriptor* descriptor) - : name_("") - , id_(MEMBER_ID_INVALID) - , type_(nullptr) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ - copy_from(descriptor); - copy_annotations_from_type(type_); -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type) - : name_(name) - , id_(id) - , type_(type) - , default_value_("") - , index_(INDEX_INVALID) - , default_label_(false) -{ - copy_annotations_from_type(type_); -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue) - : name_(name) - , id_(id) - , type_(type) - , default_value_(defaultValue) - , index_(INDEX_INVALID) - , default_label_(false) -{ - copy_annotations_from_type(type_); -} - -MemberDescriptor::MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel) - : name_(name) - , id_(id) - , type_(type) - , default_value_(defaultValue) - , index_(INDEX_INVALID) - , default_label_(isDefaultLabel) -{ - labels_ = unionLabels; - copy_annotations_from_type(type_); -} - -MemberDescriptor::~MemberDescriptor() -{ - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - type_ = nullptr; -} - -void MemberDescriptor::add_union_case_index( - uint64_t value) -{ - labels_.push_back(value); -} - -bool MemberDescriptor::check_union_labels( - const std::vector& labels) const -{ - for (auto it = labels.begin(); it != labels.end(); ++it) - { - if (std::find(labels_.begin(), labels_.end(), *it) != labels_.end()) - { - return false; - } - } - return true; -} - -ReturnCode_t MemberDescriptor::copy_from( - const MemberDescriptor* other) -{ - if (other != nullptr) - { - try - { - // Clear annotations - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - - // Copy them - for (auto it = other->annotation_.begin(); it != other->annotation_.end(); ++it) - { - AnnotationDescriptor* newDescriptor = new AnnotationDescriptor(*it); - annotation_.push_back(newDescriptor); - } - - type_ = other->type_; - name_ = other->name_; - id_ = other->id_; - default_value_ = other->default_value_; - index_ = other->index_; - default_label_ = other->default_label_; - labels_ = other->labels_; - return ReturnCode_t::RETCODE_OK; - } - catch (std::exception& /*e*/) - { - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying MemberDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -bool MemberDescriptor::equals( - const MemberDescriptor* other) const -{ - if (other != nullptr && name_ == other->name_ && id_ == other->id_ && - ((type_ == nullptr && other->type_ == nullptr) || type_->equals(other->type_.get())) && - default_value_ == other->default_value_ && index_ == other->index_ && - default_label_ == other->default_label_ && - labels_.size() == other->labels_.size()) - { - for (auto it = labels_.begin(), it2 = other->labels_.begin(); it != labels_.end(); ++it, ++it2) - { - if (*it != *it2) - { - return false; - } - } - return true; - } - return false; -} - -MemberId MemberDescriptor::get_id() const -{ - return id_; -} - -uint32_t MemberDescriptor::get_index() const -{ - return index_; -} - -TypeKind MemberDescriptor::get_kind() const -{ - if (type_ != nullptr) - { - return type_->get_kind(); - } - return 0; -} - -std::string MemberDescriptor::get_name() const -{ - return name_; -} - -std::vector MemberDescriptor::get_union_labels() const -{ - return labels_; -} - -bool MemberDescriptor::is_consistent( - TypeKind parentKind) const -{ - // The type field is mandatory in every type except bitmasks and enums. - if ((parentKind != TK_BITMASK && parentKind != TK_ENUM) && type_ == nullptr) - { - return false; - } - - // Only aggregated types must use the ID value. - if (id_ != MEMBER_ID_INVALID && parentKind != TK_UNION && parentKind != TK_STRUCTURE && - parentKind != TK_BITSET && parentKind != TK_ANNOTATION) - { - return false; - } - - if (!is_default_value_consistent(default_value_)) - { - return false; - } - - if (type_ != nullptr && !is_type_name_consistent(type_->name_)) // Enums and bitmask don't have type - { - return false; - } - - // Only Unions need the field "label" - if (labels_.size() != 0 && parentKind != TK_UNION) - { - return false; - } - // If the field isn't the default value for the union, it must have a label value. - else if (parentKind == TK_UNION && default_label_ == false && labels_.size() == 0) - { - return false; - } - - return true; -} - -bool MemberDescriptor::is_default_union_value() const -{ - return default_label_; -} - -bool MemberDescriptor::is_default_value_consistent( - const std::string& sDefaultValue) const -{ - if (sDefaultValue.length() > 0) - { - try - { - switch (get_kind()) - { - default: - return true; - case TK_INT32: - { - int32_t value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case TK_UINT32: - { - uint32_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case TK_INT16: - { - int16_t value(0); - value = static_cast(stoi(sDefaultValue)); - (void)value; - } - break; - case TK_UINT16: - { - uint16_t value(0); - value = static_cast(stoul(sDefaultValue)); - (void)value; - } - break; - case TK_INT64: - { - int64_t value(0); - value = stoll(sDefaultValue); - (void)value; - } - break; - case TK_UINT64: - { - uint64_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case TK_FLOAT32: - { - float value(0.0f); - value = stof(sDefaultValue); - (void)value; - } - break; - case TK_FLOAT64: - { - double value(0.0f); - value = stod(sDefaultValue); - (void)value; - } - break; - case TK_FLOAT128: - { - long double value(0.0f); - value = stold(sDefaultValue); - (void)value; - } - break; - case TK_CHAR8: { - return sDefaultValue.length() >= 1; - } - case TK_CHAR16: - { - std::wstring temp = std::wstring(sDefaultValue.begin(), sDefaultValue.end()); - (void)temp; - } - break; - case TK_BOOLEAN: - { - if (sDefaultValue == CONST_TRUE || sDefaultValue == CONST_FALSE) - { - return true; - } - int value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case TK_BYTE: { - return sDefaultValue.length() >= 1; - } - break; - case TK_STRING16: { - return true; - } - case TK_STRING8: { - return true; - } - case TK_ENUM: - { - uint32_t value(0); - value = stoul(sDefaultValue); - (void)value; - } - break; - case TK_BITMASK: - { - int value(0); - value = stoi(sDefaultValue); - (void)value; - } - break; - case TK_ARRAY: { - return true; - } - case TK_SEQUENCE: { - return true; - } - case TK_MAP: { - return true; - } - } - } - catch (...) - { - return false; - } - } - return true; -} - -bool MemberDescriptor::is_type_name_consistent( - const std::string& sName) const -{ - return TypeDescriptor::is_type_name_consistent(sName); -} - -void MemberDescriptor::copy_annotations_from_type( - const DynamicType_ptr& type) -{ - if (type) - { - // Copy annotations from type - uint32_t num_annotations = type->get_annotation_count(); - for (uint32_t i = 0; i < num_annotations; ++i) - { - AnnotationDescriptor ann; - type->get_annotation(ann, i); - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&ann); - annotation_.push_back(pNewDescriptor); - } - } - -} - -void MemberDescriptor::set_id( - MemberId id) -{ - id_ = id; -} - -void MemberDescriptor::set_index( - uint32_t index) -{ - index_ = index; -} - -void MemberDescriptor::set_name( - const std::string& name) -{ - name_ = name; -} - -void MemberDescriptor::set_type( - DynamicType_ptr type) -{ - type_ = type; -} - -void MemberDescriptor::set_default_union_value( - bool bDefault) -{ - default_label_ = bDefault; -} - -// Annotations application -bool MemberDescriptor::annotation_is_optional() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_OPTIONAL_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_key() const -{ - return annotation_get_key(); -} - -bool MemberDescriptor::annotation_get_key() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = get_annotation(ANNOTATION_EPKEY_ID); - } - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_must_understand() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_non_serialized() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool MemberDescriptor::annotation_is_value() const -{ - return get_annotation(ANNOTATION_VALUE_ID) != nullptr; -} - -bool MemberDescriptor::annotation_is_default_literal() const -{ - return get_annotation(ANNOTATION_DEFAULT_LITERAL_ID) != nullptr; -} - -bool MemberDescriptor::annotation_is_position() const -{ - return get_annotation(ANNOTATION_OPTIONAL_ID) != nullptr; -} - -// Annotations getters -std::string MemberDescriptor::annotation_get_value() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_VALUE_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value; - } - } - return ""; -} - -std::string MemberDescriptor::annotation_get_default() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value; - } - } - return ""; -} - -uint16_t MemberDescriptor::annotation_get_position() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_POSITION_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return static_cast(-1); -} - -// Annotations setters -void MemberDescriptor::annotation_set_optional( - bool optional) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_OPTIONAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_OPTIONAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_OPTIONAL_ID); - } - ann->set_value("value", optional ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_key( - bool key) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_KEY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_KEY_ID); - } - ann->set_value("value", key ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_must_understand( - bool must_understand) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_MUST_UNDERSTAND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_MUST_UNDERSTAND_ID); - } - ann->set_value("value", must_understand ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_non_serialized( - bool non_serialized) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NON_SERIALIZED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - } - ann->set_value("value", non_serialized ? "true" : "false"); -} - -void MemberDescriptor::annotation_set_value( - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_VALUE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_VALUE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_VALUE_ID); - } - ann->set_value("value", value); -} - -void MemberDescriptor::annotation_set_default_literal() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_LITERAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_DEFAULT_LITERAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_DEFAULT_LITERAL_ID); - } - ann->set_value("value", "true"); -} - -void MemberDescriptor::annotation_set_position( - uint16_t position) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_POSITION_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_POSITION_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_POSITION_ID); - } - ann->set_value("value", std::to_string(position)); -} - -void MemberDescriptor::annotation_set_default( - const std::string& default_value) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_DEFAULT_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_DEFAULT_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_DEFAULT_ID); - } - ann->set_value("value", default_value); -} - -bool MemberDescriptor::annotation_is_bit_bound() const -{ - return get_annotation(ANNOTATION_BIT_BOUND_ID) != nullptr; -} - -uint16_t MemberDescriptor::annotation_get_bit_bound() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return 32; // Default value -} - -void MemberDescriptor::annotation_set_bit_bound( - uint16_t bit_bound) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_BIT_BOUND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - } - ann->set_value("value", std::to_string(bit_bound)); -} - -ReturnCode_t MemberDescriptor::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - annotation_.push_back(pNewDescriptor); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t MemberDescriptor::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - annotation_.push_back(pNewDescriptor); - } - return ReturnCode_t::RETCODE_OK; -} - -AnnotationDescriptor* MemberDescriptor::get_annotation( - const std::string& name) const -{ - auto it = annotation_.begin(); - - for (; it != annotation_.end(); ++it) - { - AnnotationDescriptor* ann = *it; - if (ann->type()->get_name().compare(name) == 0) - { - return ann; - } - } - return nullptr; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeDescriptor.cpp b/src/cpp/dynamic-types/TypeDescriptor.cpp deleted file mode 100644 index 21b7264522c..00000000000 --- a/src/cpp/dynamic-types/TypeDescriptor.cpp +++ /dev/null @@ -1,665 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -enum FSM_INPUTS -{ - LETTER = 1, - NUMBER, - UNDERSCORE, - COLON, - OTHER -}; - -enum FSM_STATES -{ - INVALID = 0, - SINGLECOLON, - DOUBLECOLON, - VALID -}; - -static const int stateTable[4][6] = -{ - /* Input: letter, number, underscore, colon, other */ - {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, - {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, - {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, - {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID} -}; - -TypeDescriptor::TypeDescriptor() - : kind_(0) - , name_("") - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ -} - -TypeDescriptor::TypeDescriptor( - const std::string& name, - TypeKind kind) - : kind_(kind) - , name_(name) - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ -} - -TypeDescriptor::TypeDescriptor( - const TypeDescriptor* other) - : kind_(0) - , name_("") - , base_type_(nullptr) - , discriminator_type_(nullptr) - , element_type_(nullptr) - , key_element_type_(nullptr) -{ - copy_from(other); -} - -TypeDescriptor::~TypeDescriptor() -{ - clean(); -} - -void TypeDescriptor::clean() -{ - for (auto it = annotation_.begin(); it != annotation_.end(); ++it) - { - delete *it; - } - annotation_.clear(); - - base_type_ = nullptr; - discriminator_type_ = nullptr; - element_type_ = nullptr; - key_element_type_ = nullptr; -} - -ReturnCode_t TypeDescriptor::copy_from( - const TypeDescriptor* descriptor) -{ - if (descriptor != nullptr) - { - try - { - clean(); - - for (auto it = descriptor->annotation_.begin(); it != descriptor->annotation_.end(); ++it) - { - AnnotationDescriptor* newDescriptor = new AnnotationDescriptor(*it); - annotation_.push_back(newDescriptor); - } - - kind_ = descriptor->kind_; - name_ = descriptor->name_; - base_type_ = descriptor->base_type_; - discriminator_type_ = descriptor->discriminator_type_; - bound_ = descriptor->bound_; - element_type_ = descriptor->element_type_; - key_element_type_ = descriptor->key_element_type_; - return ReturnCode_t::RETCODE_OK; - } - catch (std::exception& /*e*/) - { - return ReturnCode_t::RETCODE_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error copying TypeDescriptor, invalid input descriptor"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -bool TypeDescriptor::equals( - const TypeDescriptor* descriptor) const -{ - return descriptor != nullptr && name_ == descriptor->name_ && kind_ == descriptor->kind_ && - base_type_ == descriptor->base_type_ && discriminator_type_ == descriptor->discriminator_type_ && - bound_ == descriptor->bound_ && element_type_ == descriptor->element_type_ && - key_element_type_ == descriptor->key_element_type_; -} - -DynamicType_ptr TypeDescriptor::get_base_type() const -{ - return base_type_; -} - -uint32_t TypeDescriptor::get_bounds( - uint32_t index /*=0*/) const -{ - if (index < bound_.size()) - { - return bound_[index]; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting bounds value. Index out of range."); - return BOUND_UNLIMITED; - } -} - -uint32_t TypeDescriptor::get_bounds_size() const -{ - return static_cast(bound_.size()); -} - -DynamicType_ptr TypeDescriptor::get_discriminator_type() const -{ - return discriminator_type_; -} - -DynamicType_ptr TypeDescriptor::get_element_type() const -{ - return element_type_; -} - -DynamicType_ptr TypeDescriptor::get_key_element_type() const -{ - return key_element_type_; -} - -TypeKind TypeDescriptor::get_kind() const -{ - return kind_; -} - -std::string TypeDescriptor::get_name() const -{ - return name_; -} - -uint32_t TypeDescriptor::get_total_bounds() const -{ - if (bound_.size() >= 1) - { - uint32_t bounds = 1; - for (uint32_t i = 0; i < bound_.size(); ++i) - { - bounds *= bound_[i]; - } - return bounds; - } - return BOUND_UNLIMITED; -} - -bool TypeDescriptor::is_consistent() const -{ - // Alias Types need the base type to indicate what type has been aliased. - if (kind_ == TK_ALIAS && base_type_ == nullptr) - { - return false; - } - - // Alias must have base type, and structures and bitsets optionally can have it. - if (base_type_ != nullptr && kind_ != TK_ALIAS && kind_ != TK_STRUCTURE && kind_ != TK_BITSET) - { - return false; - } - - // Arrays need one or more bound fields with the lenghts of each dimension. - if (kind_ == TK_ARRAY && bound_.size() == 0) - { - return false; - } - - // These types need one bound with the length of the field. - if (bound_.size() != 1 && (kind_ == TK_SEQUENCE || kind_ == TK_MAP || kind_ == TK_BITMASK || - kind_ == TK_STRING8 || kind_ == TK_STRING16)) - { - return false; - } - - // Only union types need the discriminator of the union - if ((discriminator_type_ == nullptr) == (kind_ == TK_UNION)) - { - return false; - } - - // ElementType is used by these types to set the "value" type of the element, otherwise it should be null. - if ((element_type_ == nullptr) == (kind_ == TK_ARRAY || kind_ == TK_SEQUENCE || kind_ == TK_STRING8 || - kind_ == TK_STRING16 || kind_ == TK_MAP || kind_ == TK_BITMASK)) - { - return false; - } - - // For Bitmask types is mandatory that this element is boolean. - if (kind_ == TK_BITMASK && (element_type_->get_kind() != TK_BOOLEAN)) - { - return false; - } - - // Only map types need the keyElementType to store the "Key" type of the pair. - if ((key_element_type_ == nullptr) == (kind_ == TK_MAP)) - { - return false; - } - - if (!is_type_name_consistent(name_)) - { - return false; - } - - return true; -} - -bool TypeDescriptor::is_type_name_consistent( - const std::string& sName) -{ - // Implement an FSM string parser to deal with both a plain type name - // and a fully qualified name. According to the DDS xtypes standard, - // type's fully qualified name is a concatenation of module names with - // the name of a type inside of those modules. - int currState = INVALID; - for (uint32_t i = 0; i < sName.length(); ++i) - { - int col = 0; - if (std::isalpha(sName[i])) - { - col = LETTER; - } - else if (std::isdigit(sName[i])) - { - col = NUMBER; - } - else if (sName[i] == '_') - { - col = UNDERSCORE; - } - else if (sName[i] == ':') - { - col = COLON; - } - else - { - col = OTHER; - } - currState = stateTable[currState][col]; - if (currState == INVALID) - { - return false; - } - } - return true; -} - -void TypeDescriptor::set_kind( - TypeKind kind) -{ - kind_ = kind; -} - -void TypeDescriptor::set_name( - std::string name) -{ - name_ = name; -} - -ReturnCode_t TypeDescriptor::apply_annotation( - AnnotationDescriptor& descriptor) -{ - if (descriptor.is_consistent()) - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->copy_from(&descriptor); - annotation_.push_back(pNewDescriptor); - return ReturnCode_t::RETCODE_OK; - } - else - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Error applying annotation. The input descriptor isn't consistent."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } -} - -ReturnCode_t TypeDescriptor::apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value) -{ - AnnotationDescriptor* ann = get_annotation(annotation_name); - if (ann != nullptr) - { - ann->set_value(key, value); - } - else - { - AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor(); - pNewDescriptor->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(annotation_name)); - pNewDescriptor->set_value(key, value); - annotation_.push_back(pNewDescriptor); - } - return ReturnCode_t::RETCODE_OK; -} - -AnnotationDescriptor* TypeDescriptor::get_annotation( - const std::string& name) const -{ - auto it = annotation_.begin(); - - for (; it != annotation_.end(); ++it) - { - AnnotationDescriptor* ann = *it; - //if (ann->type()->get_name().compare(name) == 0) - if (ann != nullptr - && ann->type() != nullptr - && ann->type()->kind_ > 0 - && !ann->type()->get_name().empty() - && ann->type()->get_name().compare(name) == 0) - { - return ann; - } - } - return nullptr; -} - -// Annotations application -bool TypeDescriptor::annotation_is_extensibility() const -{ - return get_annotation(ANNOTATION_EXTENSIBILITY_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_mutable() const -{ - if (get_annotation(ANNOTATION_MUTABLE_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_MUTABLE) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_final() const -{ - if (get_annotation(ANNOTATION_FINAL_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_FINAL) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_appendable() const -{ - if (get_annotation(ANNOTATION_APPENDABLE_ID) != nullptr) - { - return true; - } - else - { - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value.compare(EXTENSIBILITY_APPENDABLE) == 0; - } - } - } - return false; -} - -bool TypeDescriptor::annotation_is_nested() const -{ - return get_annotation(ANNOTATION_NESTED_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_bit_bound() const -{ - return get_annotation(ANNOTATION_BIT_BOUND_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_key() const -{ - return get_annotation(ANNOTATION_KEY_ID) != nullptr || get_annotation(ANNOTATION_EPKEY_ID) != nullptr; -} - -bool TypeDescriptor::annotation_is_non_serialized() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -// Annotation getters -std::string TypeDescriptor::annotation_get_extensibility() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value; - } - } - return ""; -} - -bool TypeDescriptor::annotation_get_nested() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NESTED_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -bool TypeDescriptor::annotation_get_key() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = get_annotation(ANNOTATION_EPKEY_ID); - } - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return value == CONST_TRUE; - } - } - return false; -} - -uint16_t TypeDescriptor::annotation_get_bit_bound() const -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann != nullptr) - { - std::string value; - if (ann->get_value(value) == ReturnCode_t::RETCODE_OK) - { - return static_cast(std::stoi(value)); - } - } - return 32; // Default value -} - -// Annotation setters -void TypeDescriptor::annotation_set_extensibility( - const std::string& extensibility) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_EXTENSIBILITY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_EXTENSIBILITY_ID); - } - ann->set_value("value", extensibility); -} - -void TypeDescriptor::annotation_set_mutable() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_MUTABLE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_MUTABLE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_MUTABLE_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_final() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_FINAL_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_FINAL_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_FINAL_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_appendable() -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_APPENDABLE_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_APPENDABLE_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_APPENDABLE_ID); - } - ann->set_value("value", CONST_TRUE); -} - -void TypeDescriptor::annotation_set_nested( - bool nested) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NESTED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NESTED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NESTED_ID); - } - ann->set_value("value", nested ? CONST_TRUE : CONST_FALSE); -} - -void TypeDescriptor::annotation_set_key( - bool key) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_KEY_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_KEY_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_KEY_ID); - } - ann->set_value("value", key ? CONST_TRUE : CONST_FALSE); -} - -void TypeDescriptor::annotation_set_bit_bound( - uint16_t bit_bound) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type(DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_BIT_BOUND_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_BIT_BOUND_ID); - } - ann->set_value("value", std::to_string(bit_bound)); -} - -void TypeDescriptor::annotation_set_non_serialized( - bool non_serialized) -{ - AnnotationDescriptor* ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - if (ann == nullptr) - { - ann = new AnnotationDescriptor(); - ann->set_type( - DynamicTypeBuilderFactory::get_instance()->create_annotation_primitive(ANNOTATION_NON_SERIALIZED_ID)); - apply_annotation(*ann); - delete ann; - ann = get_annotation(ANNOTATION_NON_SERIALIZED_ID); - } - ann->set_value("value", non_serialized ? CONST_TRUE : CONST_FALSE); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeIdentifier.cpp b/src/cpp/dynamic-types/TypeIdentifier.cpp deleted file mode 100644 index ce24a3fce37..00000000000 --- a/src/cpp/dynamic-types/TypeIdentifier.cpp +++ /dev/null @@ -1,1337 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeIdentifier.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#include - -#include -#include -#include -#include - -using namespace eprosima::fastcdr::exception; - -#include "TypeIdentifierCdrAux.ipp" - -namespace eprosima { -namespace fastrtps { - -using namespace rtps; - -namespace types { - -TypeIdentifier::TypeIdentifier() -{ - m__d = 0x00; // Default - memset(&m_equivalence_hash, 0, 14); -} - -TypeIdentifier::~TypeIdentifier() -{ -} - -TypeIdentifier::TypeIdentifier( - const TypeIdentifier& x) -{ - m__d = x.m__d; - memset(&m_equivalence_hash, 0, 14); - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - m_string_sdefn = x.m_string_sdefn; - break; - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - m_string_ldefn = x.m_string_ldefn; - break; - case TI_PLAIN_SEQUENCE_SMALL: - m_seq_sdefn = x.m_seq_sdefn; - break; - case TI_PLAIN_SEQUENCE_LARGE: - m_seq_ldefn = x.m_seq_ldefn; - break; - case TI_PLAIN_ARRAY_SMALL: - m_array_sdefn = x.m_array_sdefn; - break; - case TI_PLAIN_ARRAY_LARGE: - m_array_ldefn = x.m_array_ldefn; - break; - case TI_PLAIN_MAP_SMALL: - m_map_sdefn = x.m_map_sdefn; - break; - case TI_PLAIN_MAP_LARGE: - m_map_ldefn = x.m_map_ldefn; - break; - case TI_STRONGLY_CONNECTED_COMPONENT: - m_sc_component_id = x.m_sc_component_id; - break; - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(&m_equivalence_hash, &x.m_equivalence_hash, 14); - break; - default: - m_extended_defn = x.m_extended_defn; - break; - } -} - -TypeIdentifier::TypeIdentifier( - TypeIdentifier&& x) -{ - m__d = x.m__d; - memset(&m_equivalence_hash, 0, 14); - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - m_string_sdefn = x.m_string_sdefn; - break; - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - m_string_ldefn = x.m_string_ldefn; - break; - case TI_PLAIN_SEQUENCE_SMALL: - m_seq_sdefn = x.m_seq_sdefn; - break; - case TI_PLAIN_SEQUENCE_LARGE: - m_seq_ldefn = x.m_seq_ldefn; - break; - case TI_PLAIN_ARRAY_SMALL: - m_array_sdefn = x.m_array_sdefn; - break; - case TI_PLAIN_ARRAY_LARGE: - m_array_ldefn = x.m_array_ldefn; - break; - case TI_PLAIN_MAP_SMALL: - m_map_sdefn = x.m_map_sdefn; - break; - case TI_PLAIN_MAP_LARGE: - m_map_ldefn = x.m_map_ldefn; - break; - case TI_STRONGLY_CONNECTED_COMPONENT: - m_sc_component_id = x.m_sc_component_id; - break; - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(&m_equivalence_hash, &x.m_equivalence_hash, 14); - break; - default: - m_extended_defn = x.m_extended_defn; - break; - } -} - -TypeIdentifier& TypeIdentifier::operator =( - const TypeIdentifier& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - m_string_sdefn = x.m_string_sdefn; - break; - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - m_string_ldefn = x.m_string_ldefn; - break; - case TI_PLAIN_SEQUENCE_SMALL: - m_seq_sdefn = x.m_seq_sdefn; - break; - case TI_PLAIN_SEQUENCE_LARGE: - m_seq_ldefn = x.m_seq_ldefn; - break; - case TI_PLAIN_ARRAY_SMALL: - m_array_sdefn = x.m_array_sdefn; - break; - case TI_PLAIN_ARRAY_LARGE: - m_array_ldefn = x.m_array_ldefn; - break; - case TI_PLAIN_MAP_SMALL: - m_map_sdefn = x.m_map_sdefn; - break; - case TI_PLAIN_MAP_LARGE: - m_map_ldefn = x.m_map_ldefn; - break; - case TI_STRONGLY_CONNECTED_COMPONENT: - m_sc_component_id = x.m_sc_component_id; - break; - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(&m_equivalence_hash, &x.m_equivalence_hash, 14); - break; - default: - m_extended_defn = x.m_extended_defn; - break; - } - - return *this; -} - -TypeIdentifier& TypeIdentifier::operator =( - TypeIdentifier&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - m_string_sdefn = x.m_string_sdefn; - break; - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - m_string_ldefn = x.m_string_ldefn; - break; - case TI_PLAIN_SEQUENCE_SMALL: - m_seq_sdefn = x.m_seq_sdefn; - break; - case TI_PLAIN_SEQUENCE_LARGE: - m_seq_ldefn = x.m_seq_ldefn; - break; - case TI_PLAIN_ARRAY_SMALL: - m_array_sdefn = x.m_array_sdefn; - break; - case TI_PLAIN_ARRAY_LARGE: - m_array_ldefn = x.m_array_ldefn; - break; - case TI_PLAIN_MAP_SMALL: - m_map_sdefn = x.m_map_sdefn; - break; - case TI_PLAIN_MAP_LARGE: - m_map_ldefn = x.m_map_ldefn; - break; - case TI_STRONGLY_CONNECTED_COMPONENT: - m_sc_component_id = x.m_sc_component_id; - break; - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(&m_equivalence_hash, &x.m_equivalence_hash, 14); - break; - default: - m_extended_defn = x.m_extended_defn; - break; - } - - return *this; -} - -void TypeIdentifier::_d( - octet __d) // Special case to ease... sets the current active member -{ - bool b = false; - m__d = __d; - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - switch (__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - b = true; - break; - default: - break; - } - break; - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - switch (__d) - { - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_SEQUENCE_SMALL: - switch (__d) - { - case TI_PLAIN_SEQUENCE_SMALL: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_SEQUENCE_LARGE: - switch (__d) - { - case TI_PLAIN_SEQUENCE_LARGE: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_ARRAY_SMALL: - switch (__d) - { - case TI_PLAIN_ARRAY_SMALL: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_ARRAY_LARGE: - switch (__d) - { - case TI_PLAIN_ARRAY_LARGE: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_MAP_SMALL: - switch (__d) - { - case TI_PLAIN_MAP_SMALL: - b = true; - break; - default: - break; - } - break; - case TI_PLAIN_MAP_LARGE: - switch (__d) - { - case TI_PLAIN_MAP_LARGE: - b = true; - break; - default: - break; - } - break; - case TI_STRONGLY_CONNECTED_COMPONENT: - switch (__d) - { - case TI_STRONGLY_CONNECTED_COMPONENT: - b = true; - break; - default: - break; - } - break; - case EK_COMPLETE: - case EK_MINIMAL: - switch (__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - break; - default: - switch (__d) - { - case TI_PLAIN_ARRAY_SMALL: - case TI_PLAIN_SEQUENCE_LARGE: - case TI_PLAIN_SEQUENCE_SMALL: - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - case TI_PLAIN_ARRAY_LARGE: - case TI_PLAIN_MAP_SMALL: - case TI_PLAIN_MAP_LARGE: - case TI_STRONGLY_CONNECTED_COMPONENT: - case EK_COMPLETE: - case EK_MINIMAL: - break; - default: - b = true; - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -octet TypeIdentifier::_d() const -{ - return m__d; -} - -octet& TypeIdentifier::_d() -{ - return m__d; -} - -void TypeIdentifier::string_sdefn( - StringSTypeDefn _string_sdefn) -{ - m_string_sdefn = _string_sdefn; - m__d = TI_STRING8_SMALL; -} - -const StringSTypeDefn& TypeIdentifier::string_sdefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_string_sdefn; -} - -StringSTypeDefn& TypeIdentifier::string_sdefn() -{ - bool b = false; - - switch (m__d) - { - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_string_sdefn; -} - -void TypeIdentifier::string_ldefn( - StringLTypeDefn _string_ldefn) -{ - m_string_ldefn = _string_ldefn; - m__d = TI_STRING8_LARGE; -} - -const StringLTypeDefn& TypeIdentifier::string_ldefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_string_ldefn; -} - -StringLTypeDefn& TypeIdentifier::string_ldefn() -{ - bool b = false; - - switch (m__d) - { - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_string_ldefn; -} - -void TypeIdentifier::seq_sdefn( - PlainSequenceSElemDefn _seq_sdefn) -{ - m_seq_sdefn = _seq_sdefn; - m__d = TI_PLAIN_SEQUENCE_SMALL; -} - -const PlainSequenceSElemDefn& TypeIdentifier::seq_sdefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_SEQUENCE_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_seq_sdefn; -} - -PlainSequenceSElemDefn& TypeIdentifier::seq_sdefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_SEQUENCE_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_seq_sdefn; -} - -void TypeIdentifier::seq_ldefn( - PlainSequenceLElemDefn _seq_ldefn) -{ - m_seq_ldefn = _seq_ldefn; - m__d = TI_PLAIN_SEQUENCE_LARGE; -} - -const PlainSequenceLElemDefn& TypeIdentifier::seq_ldefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_SEQUENCE_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_seq_ldefn; -} - -PlainSequenceLElemDefn& TypeIdentifier::seq_ldefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_SEQUENCE_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_seq_ldefn; -} - -void TypeIdentifier::array_sdefn( - PlainArraySElemDefn _array_sdefn) -{ - m_array_sdefn = _array_sdefn; - m__d = TI_PLAIN_ARRAY_SMALL; -} - -const PlainArraySElemDefn& TypeIdentifier::array_sdefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_array_sdefn; -} - -PlainArraySElemDefn& TypeIdentifier::array_sdefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_array_sdefn; -} - -void TypeIdentifier::array_ldefn( - PlainArrayLElemDefn _array_ldefn) -{ - m_array_ldefn = _array_ldefn; - m__d = TI_PLAIN_ARRAY_LARGE; -} - -const PlainArrayLElemDefn& TypeIdentifier::array_ldefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_array_ldefn; -} - -PlainArrayLElemDefn& TypeIdentifier::array_ldefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_array_ldefn; -} - -void TypeIdentifier::map_sdefn( - PlainMapSTypeDefn _map_sdefn) -{ - m_map_sdefn = _map_sdefn; - m__d = TI_PLAIN_MAP_SMALL; -} - -const PlainMapSTypeDefn& TypeIdentifier::map_sdefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_MAP_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_map_sdefn; -} - -PlainMapSTypeDefn& TypeIdentifier::map_sdefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_MAP_SMALL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_map_sdefn; -} - -void TypeIdentifier::map_ldefn( - PlainMapLTypeDefn _map_ldefn) -{ - m_map_ldefn = _map_ldefn; - m__d = TI_PLAIN_MAP_LARGE; -} - -const PlainMapLTypeDefn& TypeIdentifier::map_ldefn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_MAP_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_map_ldefn; -} - -PlainMapLTypeDefn& TypeIdentifier::map_ldefn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_MAP_LARGE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_map_ldefn; -} - -void TypeIdentifier::sc_component_id( - StronglyConnectedComponentId _sc_component_id) -{ - m_sc_component_id = _sc_component_id; - m__d = TI_STRONGLY_CONNECTED_COMPONENT; -} - -StronglyConnectedComponentId TypeIdentifier::sc_component_id() const -{ - bool b = false; - - switch (m__d) - { - case TI_STRONGLY_CONNECTED_COMPONENT: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_sc_component_id; -} - -StronglyConnectedComponentId& TypeIdentifier::sc_component_id() -{ - bool b = false; - - switch (m__d) - { - case TI_STRONGLY_CONNECTED_COMPONENT: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_sc_component_id; -} - -void TypeIdentifier::equivalence_hash( - EquivalenceHash _equivalence_hash) -{ - memcpy(m_equivalence_hash, _equivalence_hash, 14); - m__d = EK_COMPLETE; -} - -const octet* TypeIdentifier::equivalence_hash() const -{ - bool b = false; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return (octet*)&m_equivalence_hash; -} - -octet* TypeIdentifier::equivalence_hash() -{ - bool b = false; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return (octet*)&m_equivalence_hash; -} - -std::string TypeIdentifier::equivalence_hash_to_string() const -{ - std::stringstream ss; - if (m__d >= EK_MINIMAL) - { - ss << std::hex << m_equivalence_hash[0]; - for (uint8_t i = 1; i < 14; ++i) - { - ss << std::hex << ":" << (uint32_t)m_equivalence_hash[i]; - } - } - return ss.str(); -} - -void TypeIdentifier::extended_defn( - ExtendedTypeDefn _extended_defn) -{ - m_extended_defn = _extended_defn; - m__d = 0x00; // Default -} - -const ExtendedTypeDefn& TypeIdentifier::extended_defn() const -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_SMALL: - case TI_PLAIN_SEQUENCE_LARGE: - case TI_PLAIN_SEQUENCE_SMALL: - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - case TI_PLAIN_ARRAY_LARGE: - case TI_PLAIN_MAP_SMALL: - case TI_PLAIN_MAP_LARGE: - case TI_STRONGLY_CONNECTED_COMPONENT: - case EK_COMPLETE: - case EK_MINIMAL: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_extended_defn; -} - -ExtendedTypeDefn& TypeIdentifier::extended_defn() -{ - bool b = false; - - switch (m__d) - { - case TI_PLAIN_ARRAY_SMALL: - case TI_PLAIN_SEQUENCE_LARGE: - case TI_PLAIN_SEQUENCE_SMALL: - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - case TI_PLAIN_ARRAY_LARGE: - case TI_PLAIN_MAP_SMALL: - case TI_PLAIN_MAP_LARGE: - case TI_STRONGLY_CONNECTED_COMPONENT: - case EK_COMPLETE: - case EK_MINIMAL: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_extended_defn; -} - -// size_t TypeIdentifier::getMaxCdrSerializedSize(size_t current_alignment) -// { -// size_t initial_alignment = current_alignment; -// size_t reset_alignment = 0; -// size_t union_max_size_serialized = 0; - -// current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - -// reset_alignment = current_alignment; - -// reset_alignment += StringSTypeDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += StringLTypeDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainSequenceSElemDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainSequenceLElemDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainArraySElemDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainArrayLElemDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainMapSTypeDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += PlainMapLTypeDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += StronglyConnectedComponentId::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += 14 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 14); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - -// reset_alignment = current_alignment; - -// reset_alignment += ExtendedTypeDefn::getMaxCdrSerializedSize(reset_alignment); - - -// if(union_max_size_serialized < reset_alignment) -// union_max_size_serialized = reset_alignment; - - - -// return union_max_size_serialized - initial_alignment; -// } - -size_t TypeIdentifier::getCdrSerializedSize( - const TypeIdentifier& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeIdentifier::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeIdentifier::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool TypeIdentifier::operator ==( - const TypeIdentifier& other) const -{ - if (this == &other) - { - return true; // Same memory! - - } - if (this->_d() != other._d()) - { - return false; - } - - switch (this->_d()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - return true; - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - return this->string_sdefn().bound() == other.string_sdefn().bound(); - - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - return this->string_ldefn().bound() == other.string_ldefn().bound(); - - case TI_PLAIN_SEQUENCE_SMALL: - return this->seq_sdefn().bound() == other.seq_sdefn().bound() - && *this->seq_sdefn().element_identifier() == *other.seq_sdefn().element_identifier(); - - case TI_PLAIN_SEQUENCE_LARGE: - return this->seq_ldefn().bound() == other.seq_ldefn().bound() - && *this->seq_ldefn().element_identifier() == *other.seq_ldefn().element_identifier(); - - case TI_PLAIN_ARRAY_SMALL: - { - if (this->array_sdefn().array_bound_seq().size() != other.array_sdefn().array_bound_seq().size()) - { - return false; - } - for (uint32_t idx = 0; idx < this->array_sdefn().array_bound_seq().size(); ++idx) - { - if (this->array_sdefn().array_bound_seq()[idx] != other.array_sdefn().array_bound_seq()[idx]) - { - return false; - } - } - return *this->array_sdefn().element_identifier() == *other.array_sdefn().element_identifier(); - } - - case TI_PLAIN_ARRAY_LARGE: - { - if (this->array_ldefn().array_bound_seq().size() != other.array_ldefn().array_bound_seq().size()) - { - return false; - } - for (uint32_t idx = 0; idx < this->array_ldefn().array_bound_seq().size(); ++idx) - { - if (this->array_ldefn().array_bound_seq()[idx] != other.array_ldefn().array_bound_seq()[idx]) - { - return false; - } - } - return *this->array_ldefn().element_identifier() == *other.array_ldefn().element_identifier(); - } - - case TI_PLAIN_MAP_SMALL: - return this->map_sdefn().bound() == other.map_sdefn().bound() - && *this->map_sdefn().key_identifier() == *other.map_sdefn().key_identifier() - && *this->map_sdefn().element_identifier() == *other.map_sdefn().element_identifier(); - - case TI_PLAIN_MAP_LARGE: - return this->map_ldefn().bound() == other.map_ldefn().bound() - && *this->map_ldefn().key_identifier() == *other.map_ldefn().key_identifier() - && *this->map_ldefn().element_identifier() == *other.map_ldefn().element_identifier(); - - case EK_MINIMAL: - case EK_COMPLETE: - { - //return memcmp(this->equivalence_hash(), other.equivalence_hash(), 14) == 0; - for (int i = 0; i < 14; ++i) - { - if (this->equivalence_hash()[i] != other.equivalence_hash()[i]) - { - return false; - } - } - return true; - } - default: - break; - } - return false; -} - -bool TypeIdentifier::consistent( - const TypeIdentifier& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (this == &x) - { - return true; // Same memory! - - } - switch (this->_d()) - { - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - if (this->_d() != x._d()) - { - return false; - } - return true; - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - if (_d() == TI_STRING8_SMALL && x._d() == TI_STRING8_SMALL) - { - return this->string_sdefn().consistent(x.string_sdefn(), consistency); - } - else if (_d() == TI_STRING8_SMALL && x._d() == TI_STRING8_LARGE) - { - return this->string_sdefn().consistent(x.string_ldefn(), consistency); - } - else if (_d() == TI_STRING16_SMALL && x._d() == TI_STRING16_SMALL) - { - return this->string_sdefn().consistent(x.string_sdefn(), consistency); - } - else if (_d() == TI_STRING16_SMALL && x._d() == TI_STRING16_LARGE) - { - return this->string_sdefn().consistent(x.string_ldefn(), consistency); - } - else if (_d() == TI_STRING8_LARGE && x._d() == TI_STRING8_SMALL) - { - return this->string_ldefn().consistent(x.string_sdefn(), consistency); - } - else if (_d() == TI_STRING8_LARGE && x._d() == TI_STRING8_LARGE) - { - return this->string_ldefn().consistent(x.string_ldefn(), consistency); - } - else if (_d() == TI_STRING16_LARGE && x._d() == TI_STRING16_SMALL) - { - return this->string_ldefn().consistent(x.string_sdefn(), consistency); - } - else if (_d() == TI_STRING16_LARGE && x._d() == TI_STRING16_LARGE) - { - return this->string_ldefn().consistent(x.string_ldefn(), consistency); - } - else - { - return false; - } - - case TI_PLAIN_SEQUENCE_SMALL: - return this->seq_sdefn().consistent(x.seq_sdefn(), consistency); - - case TI_PLAIN_SEQUENCE_LARGE: - return this->seq_ldefn().consistent(x.seq_ldefn(), consistency); - - case TI_PLAIN_ARRAY_SMALL: - return this->array_sdefn().consistent(x.array_sdefn(), consistency); - - case TI_PLAIN_ARRAY_LARGE: - return this->array_ldefn().consistent(x.array_ldefn(), consistency); - - case TI_PLAIN_MAP_SMALL: - return this->map_sdefn().consistent(x.map_sdefn(), consistency); - - case TI_PLAIN_MAP_LARGE: - return this->map_ldefn().consistent(x.map_ldefn(), consistency); - - case EK_MINIMAL: - case EK_COMPLETE: - { - if (this->_d() != x._d()) - { - return false; - } - - const TypeObject* localObj = TypeObjectFactory::get_instance()->get_type_object(this); - const TypeObject* remoteObj = TypeObjectFactory::get_instance()->get_type_object(&x); - if (localObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Local TypeIdentifier doesn't have a related TypeObject"); - return false; - } - if (remoteObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Remote TypeIdentifier doesn't have a related TypeObject"); - return false; - } - return localObj->consistent(*remoteObj, consistency); - } - default: - break; - } - return false; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp b/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp deleted file mode 100644 index a8e10941610..00000000000 --- a/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DYNAMIC_TYPES_TYPEIDENTIFIERCDRAUX_IPP -#define DYNAMIC_TYPES_TYPEIDENTIFIERCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifier& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::TI_STRING8_SMALL: - case eprosima::fastrtps::types::TI_STRING16_SMALL: - calculate_serialized_size(calculator, data.string_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_STRING8_LARGE: - case eprosima::fastrtps::types::TI_STRING16_LARGE: - calculate_serialized_size(calculator, data.string_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_SMALL: - calculate_serialized_size(calculator, data.seq_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_LARGE: - calculate_serialized_size(calculator, data.seq_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_SMALL: - calculate_serialized_size(calculator, data.array_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_LARGE: - calculate_serialized_size(calculator, data.array_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_SMALL: - calculate_serialized_size(calculator, data.map_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_LARGE: - calculate_serialized_size(calculator, data.map_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_STRONGLY_CONNECTED_COMPONENT: - calculate_serialized_size(calculator, data.sc_component_id(), current_alignment); - - break; - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - current_alignment += 14 + eprosima::fastcdr::Cdr::alignment(current_alignment, 14); - - break; - default: - calculate_serialized_size(calculator, data.extended_defn(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - calculated_size += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::TI_STRING8_SMALL: - case eprosima::fastrtps::types::TI_STRING16_SMALL: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.string_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_STRING8_LARGE: - case eprosima::fastrtps::types::TI_STRING16_LARGE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.string_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_SMALL: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.seq_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_LARGE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.seq_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_SMALL: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.array_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_LARGE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.array_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_SMALL: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.map_sdefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_LARGE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.map_ldefn(), current_alignment); - - break; - case eprosima::fastrtps::types::TI_STRONGLY_CONNECTED_COMPONENT: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.sc_component_id(), current_alignment); - - break; - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - calculated_size += 14 + eprosima::fastcdr::Cdr::alignment(current_alignment, 14); - - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.extended_defn(), current_alignment); - break; - } - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifier& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_NONE: - break; - case eprosima::fastrtps::types::TI_STRING8_SMALL: - case eprosima::fastrtps::types::TI_STRING16_SMALL: - scdr << data.string_sdefn(); - break; - case eprosima::fastrtps::types::TI_STRING8_LARGE: - case eprosima::fastrtps::types::TI_STRING16_LARGE: - scdr << data.string_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_SMALL: - scdr << data.seq_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_LARGE: - scdr << data.seq_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_SMALL: - scdr << data.array_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_LARGE: - scdr << data.array_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_SMALL: - scdr << data.map_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_LARGE: - scdr << data.map_ldefn(); - break; - case eprosima::fastrtps::types::TI_STRONGLY_CONNECTED_COMPONENT: - scdr << data.sc_component_id(); - break; - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - scdr << data.equivalence_hash()[i]; - } - break; - default: - scdr << data.extended_defn(); - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifier& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_NONE: - break; - case eprosima::fastrtps::types::TI_STRING8_SMALL: - case eprosima::fastrtps::types::TI_STRING16_SMALL: - dcdr >> data.string_sdefn(); - break; - case eprosima::fastrtps::types::TI_STRING8_LARGE: - case eprosima::fastrtps::types::TI_STRING16_LARGE: - dcdr >> data.string_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_SMALL: - dcdr >> data.seq_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_LARGE: - dcdr >> data.seq_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_SMALL: - dcdr >> data.array_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_ARRAY_LARGE: - dcdr >> data.array_ldefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_SMALL: - dcdr >> data.map_sdefn(); - break; - case eprosima::fastrtps::types::TI_PLAIN_MAP_LARGE: - dcdr >> data.map_ldefn(); - break; - case eprosima::fastrtps::types::TI_STRONGLY_CONNECTED_COMPONENT: - dcdr >> data.sc_component_id(); - break; - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - dcdr >> data.equivalence_hash()[i]; - } - break; - default: - dcdr >> data.extended_defn(); - break; - } -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // DYNAMIC_TYPES_TYPEIDENTIFIERCDRAUX_IPP diff --git a/src/cpp/dynamic-types/TypeIdentifierTypes.cpp b/src/cpp/dynamic-types/TypeIdentifierTypes.cpp deleted file mode 100644 index 7ba824e1449..00000000000 --- a/src/cpp/dynamic-types/TypeIdentifierTypes.cpp +++ /dev/null @@ -1,1484 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeIdentifierTypes.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#include -#include - -#include -#include -#include -#include - -using namespace eprosima::fastcdr::exception; - -#include "TypeIdentifierTypesCdrAux.ipp" - -namespace eprosima { -namespace fastrtps { -namespace types { - - - -StringSTypeDefn::StringSTypeDefn() -{ - m_bound = 0; -} - -StringSTypeDefn::~StringSTypeDefn() -{ -} - -StringSTypeDefn::StringSTypeDefn( - const StringSTypeDefn& x) -{ - m_bound = x.m_bound; -} - -StringSTypeDefn::StringSTypeDefn( - StringSTypeDefn&& x) -{ - m_bound = x.m_bound; -} - -StringSTypeDefn& StringSTypeDefn::operator =( - const StringSTypeDefn& x) -{ - m_bound = x.m_bound; - - return *this; -} - -StringSTypeDefn& StringSTypeDefn::operator =( - StringSTypeDefn&& x) -{ - m_bound = x.m_bound; - - return *this; -} - -size_t StringSTypeDefn::getCdrSerializedSize( - const StringSTypeDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void StringSTypeDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void StringSTypeDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool StringSTypeDefn::consistent( - const StringSTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_string_bounds) - || m_bound >= x.m_bound; -} - -bool StringSTypeDefn::consistent( - const StringLTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_string_bounds) - || m_bound >= x.bound(); -} - -StringLTypeDefn::StringLTypeDefn() -{ - m_bound = 0; -} - -StringLTypeDefn::~StringLTypeDefn() -{ -} - -StringLTypeDefn::StringLTypeDefn( - const StringLTypeDefn& x) -{ - m_bound = x.m_bound; -} - -StringLTypeDefn::StringLTypeDefn( - StringLTypeDefn&& x) -{ - m_bound = x.m_bound; -} - -StringLTypeDefn& StringLTypeDefn::operator =( - const StringLTypeDefn& x) -{ - m_bound = x.m_bound; - - return *this; -} - -StringLTypeDefn& StringLTypeDefn::operator =( - StringLTypeDefn&& x) -{ - m_bound = x.m_bound; - - return *this; -} - -size_t StringLTypeDefn::getCdrSerializedSize( - const StringLTypeDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void StringLTypeDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void StringLTypeDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool StringLTypeDefn::consistent( - const StringLTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_string_bounds) - || m_bound >= x.m_bound; -} - -bool StringLTypeDefn::consistent( - const StringSTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_string_bounds) - || m_bound >= x.bound(); -} - -PlainCollectionHeader::PlainCollectionHeader() -{ - m_equiv_kind = 0; -} - -PlainCollectionHeader::~PlainCollectionHeader() -{ -} - -PlainCollectionHeader::PlainCollectionHeader( - const PlainCollectionHeader& x) -{ - m_equiv_kind = x.m_equiv_kind; - m_element_flags = x.m_element_flags; -} - -PlainCollectionHeader::PlainCollectionHeader( - PlainCollectionHeader&& x) -{ - m_equiv_kind = x.m_equiv_kind; - m_element_flags = x.m_element_flags; -} - -PlainCollectionHeader& PlainCollectionHeader::operator =( - const PlainCollectionHeader& x) -{ - m_equiv_kind = x.m_equiv_kind; - m_element_flags = x.m_element_flags; - - return *this; -} - -PlainCollectionHeader& PlainCollectionHeader::operator =( - PlainCollectionHeader&& x) -{ - m_equiv_kind = x.m_equiv_kind; - m_element_flags = x.m_element_flags; - - return *this; -} - -size_t PlainCollectionHeader::getCdrSerializedSize( - const PlainCollectionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainCollectionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainCollectionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainCollectionHeader::consistent( - const PlainCollectionHeader& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return m_equiv_kind == x.m_equiv_kind; -} - -PlainSequenceSElemDefn::PlainSequenceSElemDefn() -{ - - m_bound = 0; - m_element_identifier = nullptr; -} - -PlainSequenceSElemDefn::~PlainSequenceSElemDefn() -{ - delete m_element_identifier; -} - -void PlainSequenceSElemDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -PlainSequenceSElemDefn::PlainSequenceSElemDefn( - const PlainSequenceSElemDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainSequenceSElemDefn::PlainSequenceSElemDefn( - PlainSequenceSElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainSequenceSElemDefn& PlainSequenceSElemDefn::operator =( - const PlainSequenceSElemDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -PlainSequenceSElemDefn& PlainSequenceSElemDefn::operator =( - PlainSequenceSElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -size_t PlainSequenceSElemDefn::getCdrSerializedSize( - const PlainSequenceSElemDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainSequenceSElemDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainSequenceSElemDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainSequenceSElemDefn::consistent( - const PlainSequenceSElemDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if ((consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_sequence_bounds) - || m_bound >= x.m_bound) - { - if (m_element_identifier == x.m_element_identifier - || (m_element_identifier != nullptr && x.m_element_identifier != nullptr)) - { - return m_element_identifier->consistent(*x.m_element_identifier, consistency); - } - } - } - return false; -} - -PlainSequenceLElemDefn::PlainSequenceLElemDefn() -{ - m_bound = 0; - m_element_identifier = nullptr; -} - -PlainSequenceLElemDefn::~PlainSequenceLElemDefn() -{ - delete m_element_identifier; -} - -void PlainSequenceLElemDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -PlainSequenceLElemDefn::PlainSequenceLElemDefn( - const PlainSequenceLElemDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainSequenceLElemDefn::PlainSequenceLElemDefn( - PlainSequenceLElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainSequenceLElemDefn& PlainSequenceLElemDefn::operator =( - const PlainSequenceLElemDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -PlainSequenceLElemDefn& PlainSequenceLElemDefn::operator =( - PlainSequenceLElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -size_t PlainSequenceLElemDefn::getCdrSerializedSize( - const PlainSequenceLElemDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainSequenceLElemDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainSequenceLElemDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainSequenceLElemDefn::consistent( - const PlainSequenceLElemDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if ((consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_sequence_bounds) - || m_bound >= x.m_bound) - { - if (m_element_identifier == x.m_element_identifier - || (m_element_identifier != nullptr && x.m_element_identifier != nullptr)) - { - return m_element_identifier->consistent(*x.m_element_identifier, consistency); - } - } - } - return false; -} - -PlainArraySElemDefn::PlainArraySElemDefn() -{ - - - m_element_identifier = nullptr; -} - -PlainArraySElemDefn::~PlainArraySElemDefn() -{ - delete m_element_identifier; -} - -void PlainArraySElemDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -PlainArraySElemDefn::PlainArraySElemDefn( - const PlainArraySElemDefn& x) -{ - m_header = x.m_header; - m_array_bound_seq = x.m_array_bound_seq; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainArraySElemDefn::PlainArraySElemDefn( - PlainArraySElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_array_bound_seq = std::move(x.m_array_bound_seq); - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -PlainArraySElemDefn& PlainArraySElemDefn::operator =( - const PlainArraySElemDefn& x) -{ - m_header = x.m_header; - m_array_bound_seq = x.m_array_bound_seq; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -PlainArraySElemDefn& PlainArraySElemDefn::operator =( - PlainArraySElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_array_bound_seq = std::move(x.m_array_bound_seq); - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -size_t PlainArraySElemDefn::getCdrSerializedSize( - const PlainArraySElemDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainArraySElemDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainArraySElemDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainArraySElemDefn::consistent( - const PlainArraySElemDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (m_array_bound_seq.size() == x.m_array_bound_seq.size()) - { - auto local_it = m_array_bound_seq.begin(); - auto remote_it = x.m_array_bound_seq.begin(); - - while (local_it != m_array_bound_seq.end()) - { - if (*local_it != *remote_it) - { - return false; - } - ++local_it; - ++remote_it; - } - - if (m_element_identifier == x.m_element_identifier - || (m_element_identifier != nullptr && x.m_element_identifier != nullptr)) - { - return m_element_identifier->consistent(*x.m_element_identifier, consistency); - } - } - } - return false; -} - -PlainArrayLElemDefn::PlainArrayLElemDefn() -{ - - - m_element_identifier = nullptr; -} - -PlainArrayLElemDefn::~PlainArrayLElemDefn() -{ - delete m_element_identifier; -} - -void PlainArrayLElemDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -PlainArrayLElemDefn::PlainArrayLElemDefn( - const PlainArrayLElemDefn& x) -{ - m_header = x.m_header; - m_array_bound_seq = x.m_array_bound_seq; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainArrayLElemDefn::PlainArrayLElemDefn( - PlainArrayLElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_array_bound_seq = std::move(x.m_array_bound_seq); - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } -} - -PlainArrayLElemDefn& PlainArrayLElemDefn::operator =( - const PlainArrayLElemDefn& x) -{ - m_header = x.m_header; - m_array_bound_seq = x.m_array_bound_seq; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -PlainArrayLElemDefn& PlainArrayLElemDefn::operator =( - PlainArrayLElemDefn&& x) -{ - m_header = std::move(x.m_header); - m_array_bound_seq = std::move(x.m_array_bound_seq); - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - - return *this; -} - -size_t PlainArrayLElemDefn::getCdrSerializedSize( - const PlainArrayLElemDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainArrayLElemDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainArrayLElemDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainArrayLElemDefn::consistent( - const PlainArrayLElemDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (m_array_bound_seq.size() == x.m_array_bound_seq.size()) - { - auto local_it = m_array_bound_seq.begin(); - auto remote_it = x.m_array_bound_seq.begin(); - - while (local_it != m_array_bound_seq.end()) - { - if (*local_it != *remote_it) - { - return false; - } - ++local_it; - ++remote_it; - } - - if (m_element_identifier == x.m_element_identifier - || (m_element_identifier != nullptr && x.m_element_identifier != nullptr)) - { - return m_element_identifier->consistent(*x.m_element_identifier, consistency); - } - } - } - return false; -} - -PlainMapSTypeDefn::PlainMapSTypeDefn() -{ - - m_bound = 0; - m_element_identifier = nullptr; - m_key_identifier = nullptr; -} - -PlainMapSTypeDefn::~PlainMapSTypeDefn() -{ - delete m_element_identifier; - delete m_key_identifier; -} - -void PlainMapSTypeDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -void PlainMapSTypeDefn::key_identifier( - const TypeIdentifier* _key_identifier) -{ - if (_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } -} - -PlainMapSTypeDefn::PlainMapSTypeDefn( - const PlainMapSTypeDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - m_key_identifier = new TypeIdentifier(); - *m_key_identifier = *x.m_key_identifier; - } - else - { - m_key_identifier = nullptr; - } -} - -PlainMapSTypeDefn::PlainMapSTypeDefn( - PlainMapSTypeDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - m_key_identifier = new TypeIdentifier(); - *m_key_identifier = *x.m_key_identifier; - } - else - { - m_key_identifier = nullptr; - } -} - -PlainMapSTypeDefn& PlainMapSTypeDefn::operator =( - const PlainMapSTypeDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *x.m_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } - - return *this; -} - -PlainMapSTypeDefn& PlainMapSTypeDefn::operator =( - PlainMapSTypeDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *x.m_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } - - return *this; -} - -size_t PlainMapSTypeDefn::getCdrSerializedSize( - const PlainMapSTypeDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainMapSTypeDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainMapSTypeDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainMapSTypeDefn::consistent( - const PlainMapSTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if ((consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_sequence_bounds) - || m_bound == x.m_bound) - { - if (m_element_identifier != x.m_element_identifier) - { - if (m_element_identifier != nullptr && x.m_element_identifier != nullptr) - { - if (!m_element_identifier->consistent(*x.m_element_identifier, consistency)) - { - return false; // Elements inconsistent - } - } - else - { - return false; // One element doesn't exists - } - } - // Elements are consistent - - if (m_key_identifier != x.m_key_identifier) - { - if (m_key_identifier != nullptr && x.m_key_identifier != nullptr) - { - if (!m_key_identifier->consistent(*x.m_key_identifier, consistency)) - { - return false; // Keys inconsistent - } - } - else - { - return false; // One key doesn't exists - } - } - // Both are consistent - return true; - } - } - return false; -} - -PlainMapLTypeDefn::PlainMapLTypeDefn() -{ - - m_element_identifier = nullptr; - m_key_identifier = nullptr; -} - -PlainMapLTypeDefn::~PlainMapLTypeDefn() -{ - delete m_element_identifier; - delete m_key_identifier; -} - -void PlainMapLTypeDefn::element_identifier( - const TypeIdentifier* _element_identifier) -{ - if (_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } -} - -void PlainMapLTypeDefn::key_identifier( - const TypeIdentifier* _key_identifier) -{ - if (_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } -} - -PlainMapLTypeDefn::PlainMapLTypeDefn( - const PlainMapLTypeDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - m_key_identifier = new TypeIdentifier(); - *m_key_identifier = *x.m_key_identifier; - } - else - { - m_key_identifier = nullptr; - } -} - -PlainMapLTypeDefn::PlainMapLTypeDefn( - PlainMapLTypeDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - m_element_identifier = new TypeIdentifier(); - *m_element_identifier = *x.m_element_identifier; - } - else - { - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - m_key_identifier = new TypeIdentifier(); - *m_key_identifier = *x.m_key_identifier; - } - else - { - m_key_identifier = nullptr; - } -} - -PlainMapLTypeDefn& PlainMapLTypeDefn::operator =( - const PlainMapLTypeDefn& x) -{ - m_header = x.m_header; - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *x.m_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } - - return *this; -} - -PlainMapLTypeDefn& PlainMapLTypeDefn::operator =( - PlainMapLTypeDefn&& x) -{ - m_header = std::move(x.m_header); - m_bound = x.m_bound; - if (x.m_element_identifier != nullptr) - { - if (m_element_identifier == nullptr) - { - m_element_identifier = new TypeIdentifier(); - } - *m_element_identifier = *x.m_element_identifier; - } - else - { - delete m_element_identifier; - m_element_identifier = nullptr; - } - m_key_flags = x.m_key_flags; - if (x.m_key_identifier != nullptr) - { - if (m_key_identifier == nullptr) - { - m_key_identifier = new TypeIdentifier(); - } - *m_key_identifier = *x.m_key_identifier; - } - else - { - delete m_key_identifier; - m_key_identifier = nullptr; - } - - return *this; -} - -size_t PlainMapLTypeDefn::getCdrSerializedSize( - const PlainMapLTypeDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void PlainMapLTypeDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void PlainMapLTypeDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool PlainMapLTypeDefn::consistent( - const PlainMapLTypeDefn& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if ((consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_sequence_bounds) - || m_bound == x.m_bound) - { - if (m_element_identifier != x.m_element_identifier) - { - if (m_element_identifier != nullptr && x.m_element_identifier != nullptr) - { - if (!m_element_identifier->consistent(*x.m_element_identifier, consistency)) - { - return false; // Elements inconsistent - } - } - else - { - return false; // One element doesn't exists - } - } - // Elements are consistent - - if (m_key_identifier != x.m_key_identifier) - { - if (m_key_identifier != nullptr && x.m_key_identifier != nullptr) - { - if (!m_key_identifier->consistent(*x.m_key_identifier, consistency)) - { - return false; // Keys inconsistent - } - } - else - { - return false; // One key doesn't exists - } - } - // Both are consistent - return true; - } - } - return false; -} - -StronglyConnectedComponentId::StronglyConnectedComponentId() -{ - - m_scc_length = 0; - m_scc_index = 0; -} - -StronglyConnectedComponentId::~StronglyConnectedComponentId() -{ -} - -StronglyConnectedComponentId::StronglyConnectedComponentId( - const StronglyConnectedComponentId& x) -{ - m_sc_component_id = x.m_sc_component_id; - m_scc_length = x.m_scc_length; - m_scc_index = x.m_scc_index; -} - -StronglyConnectedComponentId::StronglyConnectedComponentId( - StronglyConnectedComponentId&& x) -{ - m_sc_component_id = std::move(x.m_sc_component_id); - m_scc_length = x.m_scc_length; - m_scc_index = x.m_scc_index; -} - -StronglyConnectedComponentId& StronglyConnectedComponentId::operator =( - const StronglyConnectedComponentId& x) -{ - m_sc_component_id = x.m_sc_component_id; - m_scc_length = x.m_scc_length; - m_scc_index = x.m_scc_index; - - return *this; -} - -StronglyConnectedComponentId& StronglyConnectedComponentId::operator =( - StronglyConnectedComponentId&& x) -{ - m_sc_component_id = std::move(x.m_sc_component_id); - m_scc_length = x.m_scc_length; - m_scc_index = x.m_scc_index; - - return *this; -} - -size_t StronglyConnectedComponentId::getCdrSerializedSize( - const StronglyConnectedComponentId& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void StronglyConnectedComponentId::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void StronglyConnectedComponentId::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool StronglyConnectedComponentId::consistent( - const StronglyConnectedComponentId& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO It is neccessary apply some TypeConsistencyEnforcementQosPolicy? - return std::memcmp(m_sc_component_id.hash(), x.m_sc_component_id.hash(), 14) == 0 - && m_scc_index == x.m_scc_index - && m_scc_length == x.m_scc_length; -} - -ExtendedTypeDefn::ExtendedTypeDefn() -{ -} - -ExtendedTypeDefn::~ExtendedTypeDefn() -{ -} - -ExtendedTypeDefn::ExtendedTypeDefn( - const ExtendedTypeDefn&) -{ -} - -ExtendedTypeDefn::ExtendedTypeDefn( - ExtendedTypeDefn&&) -{ -} - -ExtendedTypeDefn& ExtendedTypeDefn::operator =( - const ExtendedTypeDefn&) -{ - return *this; -} - -ExtendedTypeDefn& ExtendedTypeDefn::operator =( - ExtendedTypeDefn&&) -{ - return *this; -} - -size_t ExtendedTypeDefn::getCdrSerializedSize( - const ExtendedTypeDefn& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void ExtendedTypeDefn::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void ExtendedTypeDefn::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool ExtendedTypeDefn::consistent( - const ExtendedTypeDefn&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return true; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp b/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp deleted file mode 100644 index f51bc2e76b4..00000000000 --- a/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp +++ /dev/null @@ -1,908 +0,0 @@ -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DYNAMIC_TYPES_TYPEIDENTIFIERTYPESCDRAUX_IPP -#define DYNAMIC_TYPES_TYPEIDENTIFIERTYPESCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::StringSTypeDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - return current_alignment - initial_alignment; -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::StringLTypeDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainCollectionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.equiv_kind(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.element_flags(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainSequenceSElemDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.element_identifier() != nullptr) - { - size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.bound(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainSequenceLElemDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.element_identifier() != nullptr) - { - size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.bound(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainArraySElemDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += (data.array_bound_seq().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.element_identifier() != nullptr) - { - size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - - return current_alignment - initial_alignment; -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.array_bound_seq(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainArrayLElemDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - current_alignment += (data.array_bound_seq().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.element_identifier() != nullptr) - { - size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.array_bound_seq(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainMapSTypeDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - size_t size = 0; - if (data.element_identifier() != nullptr) - { - size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.key_identifier() != nullptr) - { - size = calculate_serialized_size(calculator, *data.key_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.bound(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.key_flags(), current_alignment); - if (data.key_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), *data.key_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::PlainMapLTypeDefn& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - size_t size = 0; - if (data.element_identifier() != nullptr) - { - size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - if (data.key_identifier() != nullptr) - { - size = calculate_serialized_size(calculator, *data.key_identifier(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - size = calculate_serialized_size(calculator, emptyId, current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.bound(), current_alignment); - if (data.element_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), *data.element_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), emptyId, current_alignment); - } - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.key_flags(), current_alignment); - if (data.key_identifier() != nullptr) - { - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), *data.key_identifier(), current_alignment); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), emptyId, current_alignment); - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::StronglyConnectedComponentId& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - size_t initial_alignment = current_alignment; - - //current_alignment += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - size_t size = calculate_serialized_size(calculator, data.sc_component_id(), current_alignment); - current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - return current_alignment - initial_alignment; -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.sc_component_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.scc_length(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.scc_index(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::ExtendedTypeDefn&, - size_t&) -{ - return 0; -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::StringSTypeDefn& data) -{ - scdr << data.bound(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::StringSTypeDefn& data) -{ - dcdr >> data.bound(); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::StringLTypeDefn& data) -{ - scdr << data.bound(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::StringLTypeDefn& data) -{ - dcdr >> data.bound(); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainCollectionHeader& data) -{ - scdr << data.equiv_kind(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.element_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.element_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainCollectionHeader& data) -{ - dcdr >> data.equiv_kind(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.element_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.element_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainSequenceSElemDefn& data) -{ - scdr << data.header(); - scdr << data.bound(); - if (data.element_identifier() == nullptr) - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } - else - { - scdr << *data.element_identifier(); - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainSequenceSElemDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.bound(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainSequenceLElemDefn& data) -{ - scdr << data.header(); - scdr << data.bound(); - if (data.element_identifier() != nullptr) - { - scdr << *data.element_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainSequenceLElemDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.bound(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainArraySElemDefn& data) -{ - scdr << data.header(); - scdr << data.array_bound_seq(); - - if (data.element_identifier() != nullptr) - { - scdr << *data.element_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainArraySElemDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.array_bound_seq(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainArrayLElemDefn& data) -{ - scdr << data.header(); - scdr << data.array_bound_seq(); - if (data.element_identifier() != nullptr) - { - scdr << *data.element_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainArrayLElemDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.array_bound_seq(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainMapSTypeDefn& data) -{ - scdr << data.header(); - scdr << data.bound(); - if (data.element_identifier() != nullptr) - { - scdr << *data.element_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.key_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.key_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (data.key_identifier() != nullptr) - { - scdr << *data.key_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainMapSTypeDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.bound(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.key_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.key_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - - eprosima::fastrtps::types::TypeIdentifier key_type_id; - dcdr >> key_type_id; - data.key_identifier(&key_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::PlainMapLTypeDefn& data) -{ - scdr << data.header(); - scdr << data.bound(); - if (data.element_identifier() != nullptr) - { - scdr << *data.element_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.key_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.key_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (data.key_identifier() != nullptr) - { - scdr << *data.key_identifier(); - } - else - { - eprosima::fastrtps::types::TypeIdentifier emptyId; - scdr << emptyId; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::PlainMapLTypeDefn& data) -{ - dcdr >> data.header(); - dcdr >> data.bound(); - - eprosima::fastrtps::types::TypeIdentifier elem_type_id; - dcdr >> elem_type_id; - data.element_identifier(&elem_type_id); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.key_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.key_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - - eprosima::fastrtps::types::TypeIdentifier key_type_id; - dcdr >> key_type_id; - data.key_identifier(&key_type_id); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::StronglyConnectedComponentId& data) -{ - scdr << data.sc_component_id(); - scdr << data.scc_length(); - scdr << data.scc_index(); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::StronglyConnectedComponentId& data) -{ - dcdr >> data.sc_component_id(); - dcdr >> data.scc_length(); - dcdr >> data.scc_index(); -} - -template<> -void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::ExtendedTypeDefn&) -{ -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::ExtendedTypeDefn&) -{ -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // DYNAMIC_TYPES_TYPEIDENTIFIERTYPESCDRAUX_IPP diff --git a/src/cpp/dynamic-types/TypeNamesGenerator.cpp b/src/cpp/dynamic-types/TypeNamesGenerator.cpp deleted file mode 100644 index 430f6ebb13e..00000000000 --- a/src/cpp/dynamic-types/TypeNamesGenerator.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - - -std::string TypeNamesGenerator::get_string_type_name( - uint32_t bound, - bool wide, - bool generate_identifier) -{ - std::stringstream type; - type << ((wide) ? "wstring" : "string"); - type << ((bound < 256) ? "s_" : "l_") << bound; - if (generate_identifier) - { - TypeObjectFactory::get_instance()->get_string_identifier(bound, wide); - } - return type.str(); -} - -std::string TypeNamesGenerator::get_sequence_type_name( - const std::string& type_name, - uint32_t bound, - bool generate_identifier) -{ - std::stringstream auxType; - auxType << ((bound < 256) ? "sequences_" : "sequencel_"); - auxType << type_name << "_" << bound; - if (generate_identifier) - { - TypeObjectFactory::get_instance()->get_sequence_identifier(type_name, bound, true); - TypeObjectFactory::get_instance()->get_sequence_identifier(type_name, bound, false); - } - return auxType.str(); -} - -std::string TypeNamesGenerator::get_array_type_name( - const std::string& type_name, - const std::vector& bound, - bool generate_identifier) -{ - uint32_t unused; - return get_array_type_name(type_name, bound, unused, generate_identifier); -} - -std::string TypeNamesGenerator::get_array_type_name( - const std::string& type_name, - const std::vector& bound, - uint32_t& ret_size, - bool generate_identifier) -{ - std::stringstream auxType; - std::stringstream auxType2; - auxType2 << type_name; - uint32_t size = 0; - for (uint32_t b : bound) - { - auxType2 << "_" << b; - size += b; - } - if (size < 256) - { - auxType << "arrays_"; - } - else - { - auxType << "arrayl_"; - } - auxType << auxType2.str(); - ret_size = size; - if (generate_identifier) - { - TypeObjectFactory::get_instance()->get_array_identifier(type_name, bound, true); - TypeObjectFactory::get_instance()->get_array_identifier(type_name, bound, false); - } - return auxType.str(); -} - -std::string TypeNamesGenerator::get_map_type_name( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool generate_identifier) -{ - std::stringstream auxType; - auxType << ((bound < 256) ? "maps_" : "mapl_"); - auxType << key_type_name << "_" << value_type_name << "_" << bound; - if (generate_identifier) - { - TypeObjectFactory::get_instance()->get_map_identifier(key_type_name, value_type_name, bound, true); - TypeObjectFactory::get_instance()->get_map_identifier(key_type_name, value_type_name, bound, false); - } - return auxType.str(); -} - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeObject.cpp b/src/cpp/dynamic-types/TypeObject.cpp deleted file mode 100644 index 282bdb29425..00000000000 --- a/src/cpp/dynamic-types/TypeObject.cpp +++ /dev/null @@ -1,8935 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include - -#include "TypeObjectCdrAux.ipp" - -// The types in this file shall be serialized with XCDR encoding version 2 -namespace eprosima { -namespace fastrtps { - -using namespace rtps; -using namespace eprosima::fastcdr::exception; - -namespace types { - -CommonStructMember::CommonStructMember() -{ -} - -CommonStructMember::~CommonStructMember() -{ -} - -CommonStructMember::CommonStructMember( - const CommonStructMember& x) -{ - m_member_id = x.m_member_id; - m_member_flags = x.m_member_flags; - m_member_type_id = x.m_member_type_id; -} - -CommonStructMember::CommonStructMember( - CommonStructMember&& x) -{ - m_member_id = std::move(x.m_member_id); - m_member_flags = std::move(x.m_member_flags); - m_member_type_id = std::move(x.m_member_type_id); -} - -CommonStructMember& CommonStructMember::operator =( - const CommonStructMember& x) -{ - m_member_id = x.m_member_id; - m_member_flags = x.m_member_flags; - m_member_type_id = x.m_member_type_id; - - return *this; -} - -CommonStructMember& CommonStructMember::operator =( - CommonStructMember&& x) -{ - m_member_id = std::move(x.m_member_id); - m_member_flags = std::move(x.m_member_flags); - m_member_type_id = std::move(x.m_member_type_id); - - return *this; -} - -size_t CommonStructMember::getCdrSerializedSize( - const CommonStructMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonStructMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonStructMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonStructMember::operator ==( - const CommonStructMember& other) const -{ - return m_member_id == other.m_member_id && - m_member_flags == other.m_member_flags && - m_member_type_id == other.m_member_type_id; -} - -bool CommonStructMember::consistent( - const CommonStructMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_member_id == x.m_member_id - && m_member_type_id.consistent(x.m_member_type_id, consistency); -} - -CompleteMemberDetail::CompleteMemberDetail() -{ -} - -CompleteMemberDetail::~CompleteMemberDetail() -{ -} - -CompleteMemberDetail::CompleteMemberDetail( - const CompleteMemberDetail& x) -{ - m_name = x.m_name; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; -} - -CompleteMemberDetail::CompleteMemberDetail( - CompleteMemberDetail&& x) -{ - m_name = std::move(x.m_name); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); -} - -CompleteMemberDetail& CompleteMemberDetail::operator =( - const CompleteMemberDetail& x) -{ - m_name = x.m_name; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - - return *this; -} - -CompleteMemberDetail& CompleteMemberDetail::operator =( - CompleteMemberDetail&& x) -{ - m_name = std::move(x.m_name); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - - return *this; -} - -size_t CompleteMemberDetail::getCdrSerializedSize( - const CompleteMemberDetail& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteMemberDetail::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteMemberDetail::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteMemberDetail::operator ==( - const CompleteMemberDetail& other) const -{ - if (m_name == other.m_name && - m_ann_builtin == other.m_ann_builtin) - { - return compareSequence(m_ann_custom, other.m_ann_custom); - } - return false; -} - -bool CompleteMemberDetail::consistent( - const CompleteMemberDetail& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_member_names) - || m_name == x.m_name; - -} - -MinimalMemberDetail::MinimalMemberDetail() -{ -} - -MinimalMemberDetail::~MinimalMemberDetail() -{ -} - -MinimalMemberDetail::MinimalMemberDetail( - const MinimalMemberDetail& x) -{ - m_name_hash = x.m_name_hash; -} - -MinimalMemberDetail::MinimalMemberDetail( - MinimalMemberDetail&& x) -{ - m_name_hash = std::move(x.m_name_hash); -} - -MinimalMemberDetail& MinimalMemberDetail::operator =( - const MinimalMemberDetail& x) -{ - m_name_hash = x.m_name_hash; - - return *this; -} - -MinimalMemberDetail& MinimalMemberDetail::operator =( - MinimalMemberDetail&& x) -{ - m_name_hash = std::move(x.m_name_hash); - - return *this; -} - -size_t MinimalMemberDetail::getCdrSerializedSize( - const MinimalMemberDetail& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalMemberDetail::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalMemberDetail::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalMemberDetail::operator ==( - const MinimalMemberDetail& other) const -{ - return m_name_hash == other.m_name_hash; -} - -bool MinimalMemberDetail::consistent( - const MinimalMemberDetail& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_member_names) - || m_name_hash == x.m_name_hash; - -} - -CompleteStructMember::CompleteStructMember() -{ -} - -CompleteStructMember::~CompleteStructMember() -{ -} - -CompleteStructMember::CompleteStructMember( - const CompleteStructMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteStructMember::CompleteStructMember( - CompleteStructMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteStructMember& CompleteStructMember::operator =( - const CompleteStructMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteStructMember& CompleteStructMember::operator =( - CompleteStructMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteStructMember::getCdrSerializedSize( - const CompleteStructMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteStructMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteStructMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteStructMember::operator ==( - const CompleteStructMember& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteStructMember::consistent( - const CompleteStructMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalStructMember::MinimalStructMember() -{ -} - -MinimalStructMember::~MinimalStructMember() -{ -} - -MinimalStructMember::MinimalStructMember( - const MinimalStructMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -MinimalStructMember::MinimalStructMember( - MinimalStructMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -MinimalStructMember& MinimalStructMember::operator =( - const MinimalStructMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -MinimalStructMember& MinimalStructMember::operator =( - MinimalStructMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalStructMember::getCdrSerializedSize( - const MinimalStructMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalStructMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalStructMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalStructMember::operator ==( - const MinimalStructMember& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool MinimalStructMember::consistent( - const MinimalStructMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -AppliedBuiltinTypeAnnotations::AppliedBuiltinTypeAnnotations() -{ -} - -AppliedBuiltinTypeAnnotations::~AppliedBuiltinTypeAnnotations() -{ -} - -AppliedBuiltinTypeAnnotations::AppliedBuiltinTypeAnnotations( - const AppliedBuiltinTypeAnnotations& x) -{ - m_verbatim = x.m_verbatim; -} - -AppliedBuiltinTypeAnnotations::AppliedBuiltinTypeAnnotations( - AppliedBuiltinTypeAnnotations&& x) -{ - m_verbatim = std::move(x.m_verbatim); -} - -AppliedBuiltinTypeAnnotations& AppliedBuiltinTypeAnnotations::operator =( - const AppliedBuiltinTypeAnnotations& x) -{ - m_verbatim = x.m_verbatim; - - return *this; -} - -AppliedBuiltinTypeAnnotations& AppliedBuiltinTypeAnnotations::operator =( - AppliedBuiltinTypeAnnotations&& x) -{ - m_verbatim = std::move(x.m_verbatim); - - return *this; -} - -size_t AppliedBuiltinTypeAnnotations::getCdrSerializedSize( - const AppliedBuiltinTypeAnnotations& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void AppliedBuiltinTypeAnnotations::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void AppliedBuiltinTypeAnnotations::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool AppliedBuiltinTypeAnnotations::operator ==( - const AppliedBuiltinTypeAnnotations& other) const -{ - return m_verbatim == other.m_verbatim; -} - -bool AppliedBuiltinTypeAnnotations::consistent( - const AppliedBuiltinTypeAnnotations&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO Annotations - return true; - -} - -MinimalTypeDetail::MinimalTypeDetail() -{ -} - -MinimalTypeDetail::~MinimalTypeDetail() -{ -} - -MinimalTypeDetail::MinimalTypeDetail( - const MinimalTypeDetail&) -{ -} - -MinimalTypeDetail::MinimalTypeDetail( - MinimalTypeDetail&&) -{ -} - -MinimalTypeDetail& MinimalTypeDetail::operator =( - const MinimalTypeDetail&) -{ - return *this; -} - -MinimalTypeDetail& MinimalTypeDetail::operator =( - MinimalTypeDetail&&) -{ - return *this; -} - -size_t MinimalTypeDetail::getCdrSerializedSize( - const MinimalTypeDetail& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalTypeDetail::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalTypeDetail::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalTypeDetail::consistent( - const MinimalTypeDetail&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return true; -} - -CompleteTypeDetail::CompleteTypeDetail() -{ -} - -CompleteTypeDetail::~CompleteTypeDetail() -{ -} - -CompleteTypeDetail::CompleteTypeDetail( - const CompleteTypeDetail& x) -{ - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - m_type_name = x.m_type_name; -} - -CompleteTypeDetail::CompleteTypeDetail( - CompleteTypeDetail&& x) -{ - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - m_type_name = std::move(x.m_type_name); -} - -CompleteTypeDetail& CompleteTypeDetail::operator =( - const CompleteTypeDetail& x) -{ - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - m_type_name = x.m_type_name; - - return *this; -} - -CompleteTypeDetail& CompleteTypeDetail::operator =( - CompleteTypeDetail&& x) -{ - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - m_type_name = std::move(x.m_type_name); - - return *this; -} - -size_t CompleteTypeDetail::getCdrSerializedSize( - const CompleteTypeDetail& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteTypeDetail::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteTypeDetail::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteTypeDetail::operator ==( - const CompleteTypeDetail& other) const -{ - if (m_ann_builtin == other.m_ann_builtin) - { - return compareSequence(m_ann_custom, other.m_ann_custom); - } - return false; -} - -bool CompleteTypeDetail::consistent( - const CompleteTypeDetail&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // Don't check Type details - return true; - - // TODO annotations? - // Isn't a member name, but makes sense to apply here? - //return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_member_names) - // || m_type_name == x.m_type_name; -} - -CompleteStructHeader::CompleteStructHeader() -{ -} - -CompleteStructHeader::~CompleteStructHeader() -{ -} - -CompleteStructHeader::CompleteStructHeader( - const CompleteStructHeader& x) -{ - m_base_type = x.m_base_type; - m_detail = x.m_detail; -} - -CompleteStructHeader::CompleteStructHeader( - CompleteStructHeader&& x) -{ - m_base_type = std::move(x.m_base_type); - m_detail = std::move(x.m_detail); -} - -CompleteStructHeader& CompleteStructHeader::operator =( - const CompleteStructHeader& x) -{ - m_base_type = x.m_base_type; - m_detail = x.m_detail; - - return *this; -} - -CompleteStructHeader& CompleteStructHeader::operator =( - CompleteStructHeader&& x) -{ - m_base_type = std::move(x.m_base_type); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteStructHeader::getCdrSerializedSize( - const CompleteStructHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteStructHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteStructHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteStructHeader::operator ==( - const CompleteStructHeader& other) const -{ - return m_base_type == other.m_base_type && - m_detail == other.m_detail; -} - -bool CompleteStructHeader::consistent( - const CompleteStructHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_base_type.consistent(x.m_base_type, consistency); - -} - -MinimalStructHeader::MinimalStructHeader() -{ -} - -MinimalStructHeader::~MinimalStructHeader() -{ -} - -MinimalStructHeader::MinimalStructHeader( - const MinimalStructHeader& x) -{ - m_base_type = x.m_base_type; - m_detail = x.m_detail; -} - -MinimalStructHeader::MinimalStructHeader( - MinimalStructHeader&& x) -{ - m_base_type = std::move(x.m_base_type); - m_detail = std::move(x.m_detail); -} - -MinimalStructHeader& MinimalStructHeader::operator =( - const MinimalStructHeader& x) -{ - m_base_type = x.m_base_type; - m_detail = x.m_detail; - - return *this; -} - -MinimalStructHeader& MinimalStructHeader::operator =( - MinimalStructHeader&& x) -{ - m_base_type = std::move(x.m_base_type); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalStructHeader::getCdrSerializedSize( - const MinimalStructHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalStructHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalStructHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalStructHeader::operator ==( - const MinimalStructHeader& other) const -{ - return m_base_type == other.m_base_type && - m_detail == other.m_detail; -} - -bool MinimalStructHeader::consistent( - const MinimalStructHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_base_type.consistent(x.m_base_type, consistency); - -} - -CompleteStructType::CompleteStructType() -{ -} - -CompleteStructType::~CompleteStructType() -{ -} - -CompleteStructType::CompleteStructType( - const CompleteStructType& x) -{ - m_struct_flags = x.m_struct_flags; - m_header = x.m_header; - m_member_seq = x.m_member_seq; -} - -CompleteStructType::CompleteStructType( - CompleteStructType&& x) -{ - m_struct_flags = std::move(x.m_struct_flags); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); -} - -CompleteStructType& CompleteStructType::operator =( - const CompleteStructType& x) -{ - m_struct_flags = x.m_struct_flags; - m_header = x.m_header; - m_member_seq = x.m_member_seq; - - return *this; -} - -CompleteStructType& CompleteStructType::operator =( - CompleteStructType&& x) -{ - m_struct_flags = std::move(x.m_struct_flags); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t CompleteStructType::getCdrSerializedSize( - const CompleteStructType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteStructType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteStructType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteStructType::operator ==( - const CompleteStructType& other) const -{ - if (m_struct_flags == other.m_struct_flags && - m_header == other.m_header) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool CompleteStructType::consistent( - const CompleteStructType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_member_seq.size() != x.m_member_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all members consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - else // TODO Any Qos prevent this? I didn't see it - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (remote_it != x.m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All members consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -MinimalStructType::MinimalStructType() -{ -} - -MinimalStructType::~MinimalStructType() -{ -} - -MinimalStructType::MinimalStructType( - const MinimalStructType& x) -{ - m_struct_flags = x.m_struct_flags; - m_header = x.m_header; - m_member_seq = x.m_member_seq; -} - -MinimalStructType::MinimalStructType( - MinimalStructType&& x) -{ - m_struct_flags = std::move(x.m_struct_flags); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); -} - -MinimalStructType& MinimalStructType::operator =( - const MinimalStructType& x) -{ - m_struct_flags = x.m_struct_flags; - m_header = x.m_header; - m_member_seq = x.m_member_seq; - - return *this; -} - -MinimalStructType& MinimalStructType::operator =( - MinimalStructType&& x) -{ - m_struct_flags = std::move(x.m_struct_flags); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t MinimalStructType::getCdrSerializedSize( - const MinimalStructType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalStructType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalStructType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalStructType::operator ==( - const MinimalStructType& other) const -{ - if (m_struct_flags == other.m_struct_flags && - m_header == other.m_header) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool MinimalStructType::consistent( - const MinimalStructType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_member_seq.size() != x.m_member_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all members consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - else // TODO Any Qos prevent this? I didn't see it - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (remote_it != x.m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All members consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -CommonUnionMember::CommonUnionMember() -{ -} - -CommonUnionMember::~CommonUnionMember() -{ -} - -CommonUnionMember::CommonUnionMember( - const CommonUnionMember& x) -{ - m_member_id = x.m_member_id; - m_member_flags = x.m_member_flags; - m_type_id = x.m_type_id; - m_label_seq = x.m_label_seq; -} - -CommonUnionMember::CommonUnionMember( - CommonUnionMember&& x) -{ - m_member_id = std::move(x.m_member_id); - m_member_flags = std::move(x.m_member_flags); - m_type_id = std::move(x.m_type_id); - m_label_seq = std::move(x.m_label_seq); -} - -CommonUnionMember& CommonUnionMember::operator =( - const CommonUnionMember& x) -{ - m_member_id = x.m_member_id; - m_member_flags = x.m_member_flags; - m_type_id = x.m_type_id; - m_label_seq = x.m_label_seq; - - return *this; -} - -CommonUnionMember& CommonUnionMember::operator =( - CommonUnionMember&& x) -{ - m_member_id = std::move(x.m_member_id); - m_member_flags = std::move(x.m_member_flags); - m_type_id = std::move(x.m_type_id); - m_label_seq = std::move(x.m_label_seq); - - return *this; -} - -size_t CommonUnionMember::getCdrSerializedSize( - const CommonUnionMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonUnionMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonUnionMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonUnionMember::operator ==( - const CommonUnionMember& other) const -{ - if (m_member_id == other.m_member_id && - m_member_flags == other.m_member_flags && - m_type_id == other.m_type_id) - { - return compareSequence(m_label_seq, other.m_label_seq); - } - return false; -} - -bool CommonUnionMember::consistent( - const CommonUnionMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_member_id == x.m_member_id) - { - if (m_type_id.consistent(x.m_type_id, consistency)) - { - if (m_label_seq.size() == x.m_label_seq.size()) - { - auto local_it = m_label_seq.begin(); - auto remote_it = x.m_label_seq.begin(); - while (local_it != m_label_seq.end()) - { - if (*local_it != *remote_it) - { - return false; // Label inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Same size, all labels consistent - } - return false; // different sizes - } - } - return false; // MemberId or type inconsistent - -} - -CompleteUnionMember::CompleteUnionMember() -{ -} - -CompleteUnionMember::~CompleteUnionMember() -{ -} - -CompleteUnionMember::CompleteUnionMember( - const CompleteUnionMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteUnionMember::CompleteUnionMember( - CompleteUnionMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteUnionMember& CompleteUnionMember::operator =( - const CompleteUnionMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteUnionMember& CompleteUnionMember::operator =( - CompleteUnionMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteUnionMember::getCdrSerializedSize( - const CompleteUnionMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteUnionMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteUnionMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteUnionMember::operator ==( - const CompleteUnionMember& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteUnionMember::consistent( - const CompleteUnionMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalUnionMember::MinimalUnionMember() -{ -} - -MinimalUnionMember::~MinimalUnionMember() -{ -} - -MinimalUnionMember::MinimalUnionMember( - const MinimalUnionMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -MinimalUnionMember::MinimalUnionMember( - MinimalUnionMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -MinimalUnionMember& MinimalUnionMember::operator =( - const MinimalUnionMember& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -MinimalUnionMember& MinimalUnionMember::operator =( - MinimalUnionMember&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalUnionMember::getCdrSerializedSize( - const MinimalUnionMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalUnionMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalUnionMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalUnionMember::operator ==( - const MinimalUnionMember& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool MinimalUnionMember::consistent( - const MinimalUnionMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -CommonDiscriminatorMember::CommonDiscriminatorMember() -{ -} - -CommonDiscriminatorMember::~CommonDiscriminatorMember() -{ -} - -CommonDiscriminatorMember::CommonDiscriminatorMember( - const CommonDiscriminatorMember& x) -{ - m_member_flags = x.m_member_flags; - m_type_id = x.m_type_id; -} - -CommonDiscriminatorMember::CommonDiscriminatorMember( - CommonDiscriminatorMember&& x) -{ - m_member_flags = std::move(x.m_member_flags); - m_type_id = std::move(x.m_type_id); -} - -CommonDiscriminatorMember& CommonDiscriminatorMember::operator =( - const CommonDiscriminatorMember& x) -{ - m_member_flags = x.m_member_flags; - m_type_id = x.m_type_id; - - return *this; -} - -CommonDiscriminatorMember& CommonDiscriminatorMember::operator =( - CommonDiscriminatorMember&& x) -{ - m_member_flags = std::move(x.m_member_flags); - m_type_id = std::move(x.m_type_id); - - return *this; -} - -size_t CommonDiscriminatorMember::getCdrSerializedSize( - const CommonDiscriminatorMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonDiscriminatorMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonDiscriminatorMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonDiscriminatorMember::operator ==( - const CommonDiscriminatorMember& other) const -{ - return m_member_flags == other.m_member_flags && - m_type_id == other.m_type_id; -} - -bool CommonDiscriminatorMember::consistent( - const CommonDiscriminatorMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_type_id.consistent(x.m_type_id, consistency); - -} - -CompleteDiscriminatorMember::CompleteDiscriminatorMember() -{ -} - -CompleteDiscriminatorMember::~CompleteDiscriminatorMember() -{ -} - -CompleteDiscriminatorMember::CompleteDiscriminatorMember( - const CompleteDiscriminatorMember& x) -{ - m_common = x.m_common; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; -} - -CompleteDiscriminatorMember::CompleteDiscriminatorMember( - CompleteDiscriminatorMember&& x) -{ - m_common = std::move(x.m_common); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); -} - -CompleteDiscriminatorMember& CompleteDiscriminatorMember::operator =( - const CompleteDiscriminatorMember& x) -{ - m_common = x.m_common; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - - return *this; -} - -CompleteDiscriminatorMember& CompleteDiscriminatorMember::operator =( - CompleteDiscriminatorMember&& x) -{ - m_common = std::move(x.m_common); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - - return *this; -} - -size_t CompleteDiscriminatorMember::getCdrSerializedSize( - const CompleteDiscriminatorMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteDiscriminatorMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteDiscriminatorMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteDiscriminatorMember::operator ==( - const CompleteDiscriminatorMember& other) const -{ - if (m_common == other.m_common && - m_ann_builtin == other.m_ann_builtin) - { - return compareSequence(m_ann_custom, other.m_ann_custom); - } - return false; -} - -bool CompleteDiscriminatorMember::consistent( - const CompleteDiscriminatorMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - // TODO Annotations? - return m_common.consistent(x.m_common, consistency); - -} - -MinimalDiscriminatorMember::MinimalDiscriminatorMember() -{ -} - -MinimalDiscriminatorMember::~MinimalDiscriminatorMember() -{ -} - -MinimalDiscriminatorMember::MinimalDiscriminatorMember( - const MinimalDiscriminatorMember& x) -{ - m_common = x.m_common; -} - -MinimalDiscriminatorMember::MinimalDiscriminatorMember( - MinimalDiscriminatorMember&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalDiscriminatorMember& MinimalDiscriminatorMember::operator =( - const MinimalDiscriminatorMember& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalDiscriminatorMember& MinimalDiscriminatorMember::operator =( - MinimalDiscriminatorMember&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalDiscriminatorMember::getCdrSerializedSize( - const MinimalDiscriminatorMember& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalDiscriminatorMember::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalDiscriminatorMember::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalDiscriminatorMember::operator ==( - const MinimalDiscriminatorMember& other) const -{ - return m_common == other.m_common; -} - -bool MinimalDiscriminatorMember::consistent( - const MinimalDiscriminatorMember& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_common.consistent(x.m_common, consistency); - -} - -CompleteUnionHeader::CompleteUnionHeader() -{ -} - -CompleteUnionHeader::~CompleteUnionHeader() -{ -} - -CompleteUnionHeader::CompleteUnionHeader( - const CompleteUnionHeader& x) -{ - m_detail = x.m_detail; -} - -CompleteUnionHeader::CompleteUnionHeader( - CompleteUnionHeader&& x) -{ - m_detail = std::move(x.m_detail); -} - -CompleteUnionHeader& CompleteUnionHeader::operator =( - const CompleteUnionHeader& x) -{ - m_detail = x.m_detail; - - return *this; -} - -CompleteUnionHeader& CompleteUnionHeader::operator =( - CompleteUnionHeader&& x) -{ - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteUnionHeader::getCdrSerializedSize( - const CompleteUnionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteUnionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteUnionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteUnionHeader::operator ==( - const CompleteUnionHeader& other) const -{ - return m_detail == other.m_detail; -} - -bool CompleteUnionHeader::consistent( - const CompleteUnionHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency); - -} - -MinimalUnionHeader::MinimalUnionHeader() -{ -} - -MinimalUnionHeader::~MinimalUnionHeader() -{ -} - -MinimalUnionHeader::MinimalUnionHeader( - const MinimalUnionHeader& x) -{ - m_detail = x.m_detail; -} - -MinimalUnionHeader::MinimalUnionHeader( - MinimalUnionHeader&& x) -{ - m_detail = std::move(x.m_detail); -} - -MinimalUnionHeader& MinimalUnionHeader::operator =( - const MinimalUnionHeader& x) -{ - m_detail = x.m_detail; - - return *this; -} - -MinimalUnionHeader& MinimalUnionHeader::operator =( - MinimalUnionHeader&& x) -{ - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalUnionHeader::getCdrSerializedSize( - const MinimalUnionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalUnionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalUnionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalUnionHeader::operator ==( - const MinimalUnionHeader& other) const -{ - return m_detail == other.m_detail; -} - -bool MinimalUnionHeader::consistent( - const MinimalUnionHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency); - -} - -CompleteUnionType::CompleteUnionType() -{ -} - -CompleteUnionType::~CompleteUnionType() -{ -} - -CompleteUnionType::CompleteUnionType( - const CompleteUnionType& x) -{ - m_union_flags = x.m_union_flags; - m_header = x.m_header; - m_discriminator = x.m_discriminator; - m_member_seq = x.m_member_seq; -} - -CompleteUnionType::CompleteUnionType( - CompleteUnionType&& x) -{ - m_union_flags = std::move(x.m_union_flags); - m_header = std::move(x.m_header); - m_discriminator = std::move(x.m_discriminator); - m_member_seq = std::move(x.m_member_seq); -} - -CompleteUnionType& CompleteUnionType::operator =( - const CompleteUnionType& x) -{ - m_union_flags = x.m_union_flags; - m_header = x.m_header; - m_discriminator = x.m_discriminator; - m_member_seq = x.m_member_seq; - - return *this; -} - -CompleteUnionType& CompleteUnionType::operator =( - CompleteUnionType&& x) -{ - m_union_flags = std::move(x.m_union_flags); - m_header = std::move(x.m_header); - m_discriminator = std::move(x.m_discriminator); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t CompleteUnionType::getCdrSerializedSize( - const CompleteUnionType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteUnionType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteUnionType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteUnionType::operator ==( - const CompleteUnionType& other) const -{ - if (m_union_flags == other.m_union_flags && - m_header == other.m_header && - m_discriminator == other.m_discriminator) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool CompleteUnionType::consistent( - const CompleteUnionType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency) - && m_discriminator.consistent(x.m_discriminator, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_member_seq.size() != x.m_member_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all members consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (remote_it != x.m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All members consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -MinimalUnionType::MinimalUnionType() -{ -} - -MinimalUnionType::~MinimalUnionType() -{ -} - -MinimalUnionType::MinimalUnionType( - const MinimalUnionType& x) -{ - m_union_flags = x.m_union_flags; - m_header = x.m_header; - m_discriminator = x.m_discriminator; - m_member_seq = x.m_member_seq; -} - -MinimalUnionType::MinimalUnionType( - MinimalUnionType&& x) -{ - m_union_flags = std::move(x.m_union_flags); - m_header = std::move(x.m_header); - m_discriminator = std::move(x.m_discriminator); - m_member_seq = std::move(x.m_member_seq); -} - -MinimalUnionType& MinimalUnionType::operator =( - const MinimalUnionType& x) -{ - m_union_flags = x.m_union_flags; - m_header = x.m_header; - m_discriminator = x.m_discriminator; - m_member_seq = x.m_member_seq; - - return *this; -} - -MinimalUnionType& MinimalUnionType::operator =( - MinimalUnionType&& x) -{ - m_union_flags = std::move(x.m_union_flags); - m_header = std::move(x.m_header); - m_discriminator = std::move(x.m_discriminator); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t MinimalUnionType::getCdrSerializedSize( - const MinimalUnionType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalUnionType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalUnionType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalUnionType::operator ==( - const MinimalUnionType& other) const -{ - if (m_union_flags == other.m_union_flags && - m_header == other.m_header && - m_discriminator == other.m_discriminator) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool MinimalUnionType::consistent( - const MinimalUnionType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency) - && m_discriminator.consistent(x.m_discriminator, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_member_seq.size() != x.m_member_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all members consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_member_seq.size() <= x.m_member_seq.size()) - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (local_it != m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_member_seq.begin(); - auto remote_it = x.m_member_seq.begin(); - while (remote_it != x.m_member_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Member inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All members consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -CommonAnnotationParameter::CommonAnnotationParameter() -{ -} - -CommonAnnotationParameter::~CommonAnnotationParameter() -{ -} - -CommonAnnotationParameter::CommonAnnotationParameter( - const CommonAnnotationParameter& x) -{ - m_member_flags = x.m_member_flags; - m_member_type_id = x.m_member_type_id; -} - -CommonAnnotationParameter::CommonAnnotationParameter( - CommonAnnotationParameter&& x) -{ - m_member_flags = std::move(x.m_member_flags); - m_member_type_id = std::move(x.m_member_type_id); -} - -CommonAnnotationParameter& CommonAnnotationParameter::operator =( - const CommonAnnotationParameter& x) -{ - m_member_flags = x.m_member_flags; - m_member_type_id = x.m_member_type_id; - - return *this; -} - -CommonAnnotationParameter& CommonAnnotationParameter::operator =( - CommonAnnotationParameter&& x) -{ - m_member_flags = std::move(x.m_member_flags); - m_member_type_id = std::move(x.m_member_type_id); - - return *this; -} - -size_t CommonAnnotationParameter::getCdrSerializedSize( - const CommonAnnotationParameter& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonAnnotationParameter::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonAnnotationParameter::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonAnnotationParameter::operator ==( - const CommonAnnotationParameter& other) const -{ - return m_member_flags == other.m_member_flags && - m_member_type_id == other.m_member_type_id; -} - -bool CommonAnnotationParameter::consistent( - const CommonAnnotationParameter&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -CompleteAnnotationParameter::CompleteAnnotationParameter() -{ -} - -CompleteAnnotationParameter::~CompleteAnnotationParameter() -{ -} - -CompleteAnnotationParameter::CompleteAnnotationParameter( - const CompleteAnnotationParameter& x) -{ - m_common = x.m_common; - m_name = x.m_name; - m_default_value = x.m_default_value; -} - -CompleteAnnotationParameter::CompleteAnnotationParameter( - CompleteAnnotationParameter&& x) -{ - m_common = std::move(x.m_common); - m_name = std::move(x.m_name); - m_default_value = std::move(x.m_default_value); -} - -CompleteAnnotationParameter& CompleteAnnotationParameter::operator =( - const CompleteAnnotationParameter& x) -{ - m_common = x.m_common; - m_name = x.m_name; - m_default_value = x.m_default_value; - - return *this; -} - -CompleteAnnotationParameter& CompleteAnnotationParameter::operator =( - CompleteAnnotationParameter&& x) -{ - m_common = std::move(x.m_common); - m_name = std::move(x.m_name); - m_default_value = std::move(x.m_default_value); - - return *this; -} - -size_t CompleteAnnotationParameter::getCdrSerializedSize( - const CompleteAnnotationParameter& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAnnotationParameter::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAnnotationParameter::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAnnotationParameter::operator ==( - const CompleteAnnotationParameter& other) const -{ - return m_common == other.m_common && - m_name == other.m_name && - m_default_value == other.m_default_value; -} - -bool CompleteAnnotationParameter::consistent( - const CompleteAnnotationParameter&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -MinimalAnnotationParameter::MinimalAnnotationParameter() -{ -} - -MinimalAnnotationParameter::~MinimalAnnotationParameter() -{ -} - -MinimalAnnotationParameter::MinimalAnnotationParameter( - const MinimalAnnotationParameter& x) -{ - m_common = x.m_common; - m_name = x.m_name; - m_default_value = x.m_default_value; -} - -MinimalAnnotationParameter::MinimalAnnotationParameter( - MinimalAnnotationParameter&& x) -{ - m_common = std::move(x.m_common); - m_name = std::move(x.m_name); - m_default_value = std::move(x.m_default_value); -} - -MinimalAnnotationParameter& MinimalAnnotationParameter::operator =( - const MinimalAnnotationParameter& x) -{ - m_common = x.m_common; - m_name = x.m_name; - m_default_value = x.m_default_value; - - return *this; -} - -MinimalAnnotationParameter& MinimalAnnotationParameter::operator =( - MinimalAnnotationParameter&& x) -{ - m_common = std::move(x.m_common); - m_name = std::move(x.m_name); - m_default_value = std::move(x.m_default_value); - - return *this; -} - -size_t MinimalAnnotationParameter::getCdrSerializedSize( - const MinimalAnnotationParameter& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAnnotationParameter::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAnnotationParameter::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalAnnotationParameter::operator ==( - const MinimalAnnotationParameter& other) const -{ - return m_common == other.m_common && - m_name == other.m_name && - m_default_value == other.m_default_value; -} - -bool MinimalAnnotationParameter::consistent( - const MinimalAnnotationParameter&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -CompleteAnnotationHeader::CompleteAnnotationHeader() -{ -} - -CompleteAnnotationHeader::~CompleteAnnotationHeader() -{ -} - -CompleteAnnotationHeader::CompleteAnnotationHeader( - const CompleteAnnotationHeader& x) -{ - m_annotation_name = x.m_annotation_name; -} - -CompleteAnnotationHeader::CompleteAnnotationHeader( - CompleteAnnotationHeader&& x) -{ - m_annotation_name = std::move(x.m_annotation_name); -} - -CompleteAnnotationHeader& CompleteAnnotationHeader::operator =( - const CompleteAnnotationHeader& x) -{ - m_annotation_name = x.m_annotation_name; - - return *this; -} - -CompleteAnnotationHeader& CompleteAnnotationHeader::operator =( - CompleteAnnotationHeader&& x) -{ - m_annotation_name = std::move(x.m_annotation_name); - - return *this; -} - -size_t CompleteAnnotationHeader::getCdrSerializedSize( - const CompleteAnnotationHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAnnotationHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAnnotationHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAnnotationHeader::operator ==( - const CompleteAnnotationHeader& other) const -{ - return m_annotation_name == other.m_annotation_name; -} - -bool CompleteAnnotationHeader::consistent( - const CompleteAnnotationHeader&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -MinimalAnnotationHeader::MinimalAnnotationHeader() -{ -} - -MinimalAnnotationHeader::~MinimalAnnotationHeader() -{ -} - -MinimalAnnotationHeader::MinimalAnnotationHeader( - const MinimalAnnotationHeader&) -{ -} - -MinimalAnnotationHeader::MinimalAnnotationHeader( - MinimalAnnotationHeader&&) -{ -} - -MinimalAnnotationHeader& MinimalAnnotationHeader::operator =( - const MinimalAnnotationHeader&) -{ - return *this; -} - -MinimalAnnotationHeader& MinimalAnnotationHeader::operator =( - MinimalAnnotationHeader&&) -{ - return *this; -} - -size_t MinimalAnnotationHeader::getCdrSerializedSize( - const MinimalAnnotationHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAnnotationHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAnnotationHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalAnnotationHeader::consistent( - const MinimalAnnotationHeader&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; -} - -CompleteAnnotationType::CompleteAnnotationType() -{ -} - -CompleteAnnotationType::~CompleteAnnotationType() -{ -} - -CompleteAnnotationType::CompleteAnnotationType( - const CompleteAnnotationType& x) -{ - m_annotation_flag = x.m_annotation_flag; - m_header = x.m_header; - m_member_seq = x.m_member_seq; -} - -CompleteAnnotationType::CompleteAnnotationType( - CompleteAnnotationType&& x) -{ - m_annotation_flag = std::move(x.m_annotation_flag); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); -} - -CompleteAnnotationType& CompleteAnnotationType::operator =( - const CompleteAnnotationType& x) -{ - m_annotation_flag = x.m_annotation_flag; - m_header = x.m_header; - m_member_seq = x.m_member_seq; - - return *this; -} - -CompleteAnnotationType& CompleteAnnotationType::operator =( - CompleteAnnotationType&& x) -{ - m_annotation_flag = std::move(x.m_annotation_flag); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t CompleteAnnotationType::getCdrSerializedSize( - const CompleteAnnotationType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAnnotationType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAnnotationType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAnnotationType::operator ==( - const CompleteAnnotationType& other) const -{ - if (m_annotation_flag == other.m_annotation_flag && - m_header == other.m_header) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool CompleteAnnotationType::consistent( - const CompleteAnnotationType&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -MinimalAnnotationType::MinimalAnnotationType() -{ -} - -MinimalAnnotationType::~MinimalAnnotationType() -{ -} - -MinimalAnnotationType::MinimalAnnotationType( - const MinimalAnnotationType& x) -{ - m_annotation_flag = x.m_annotation_flag; - m_header = x.m_header; - m_member_seq = x.m_member_seq; -} - -MinimalAnnotationType::MinimalAnnotationType( - MinimalAnnotationType&& x) -{ - m_annotation_flag = std::move(x.m_annotation_flag); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); -} - -MinimalAnnotationType& MinimalAnnotationType::operator =( - const MinimalAnnotationType& x) -{ - m_annotation_flag = x.m_annotation_flag; - m_header = x.m_header; - m_member_seq = x.m_member_seq; - - return *this; -} - -MinimalAnnotationType& MinimalAnnotationType::operator =( - MinimalAnnotationType&& x) -{ - m_annotation_flag = std::move(x.m_annotation_flag); - m_header = std::move(x.m_header); - m_member_seq = std::move(x.m_member_seq); - - return *this; -} - -size_t MinimalAnnotationType::getCdrSerializedSize( - const MinimalAnnotationType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAnnotationType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAnnotationType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalAnnotationType::operator ==( - const MinimalAnnotationType& other) const -{ - if (m_annotation_flag == other.m_annotation_flag && - m_header == other.m_header) - { - return compareSequence(m_member_seq, other.m_member_seq); - } - return false; -} - -bool MinimalAnnotationType::consistent( - const MinimalAnnotationType&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO This is an annotation, implement if finally is needed - return true; - -} - -CommonAliasBody::CommonAliasBody() -{ -} - -CommonAliasBody::~CommonAliasBody() -{ -} - -CommonAliasBody::CommonAliasBody( - const CommonAliasBody& x) -{ - m_related_flags = x.m_related_flags; - m_related_type = x.m_related_type; -} - -CommonAliasBody::CommonAliasBody( - CommonAliasBody&& x) -{ - m_related_flags = std::move(x.m_related_flags); - m_related_type = std::move(x.m_related_type); -} - -CommonAliasBody& CommonAliasBody::operator =( - const CommonAliasBody& x) -{ - m_related_flags = x.m_related_flags; - m_related_type = x.m_related_type; - - return *this; -} - -CommonAliasBody& CommonAliasBody::operator =( - CommonAliasBody&& x) -{ - m_related_flags = std::move(x.m_related_flags); - m_related_type = std::move(x.m_related_type); - - return *this; -} - -size_t CommonAliasBody::getCdrSerializedSize( - const CommonAliasBody& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonAliasBody::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonAliasBody::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonAliasBody::operator ==( - const CommonAliasBody& other) const -{ - return m_related_flags == other.m_related_flags && - m_related_type == other.m_related_type; -} - -//bool CommonAliasBody::consistent(const CommonAliasBody &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// return m_related_type.consistent(x.m_related_type, consistency); -//} - -CompleteAliasBody::CompleteAliasBody() -{ -} - -CompleteAliasBody::~CompleteAliasBody() -{ -} - -CompleteAliasBody::CompleteAliasBody( - const CompleteAliasBody& x) -{ - m_common = x.m_common; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; -} - -CompleteAliasBody::CompleteAliasBody( - CompleteAliasBody&& x) -{ - m_common = std::move(x.m_common); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); -} - -CompleteAliasBody& CompleteAliasBody::operator =( - const CompleteAliasBody& x) -{ - m_common = x.m_common; - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - - return *this; -} - -CompleteAliasBody& CompleteAliasBody::operator =( - CompleteAliasBody&& x) -{ - m_common = std::move(x.m_common); - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - - return *this; -} - -size_t CompleteAliasBody::getCdrSerializedSize( - const CompleteAliasBody& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAliasBody::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAliasBody::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAliasBody::operator ==( - const CompleteAliasBody& other) const -{ - if (m_common == other.m_common && - m_ann_builtin == other.m_ann_builtin) - { - return compareSequence(m_ann_custom, other.m_ann_custom); - } - return false; -} - -//bool CompleteAliasBody::consistent(const CompleteAliasBody &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// // TODO Annotations? -// return m_common.consistent(x.m_common, consistency); -//} - -MinimalAliasBody::MinimalAliasBody() -{ -} - -MinimalAliasBody::~MinimalAliasBody() -{ -} - -MinimalAliasBody::MinimalAliasBody( - const MinimalAliasBody& x) -{ - m_common = x.m_common; -} - -MinimalAliasBody::MinimalAliasBody( - MinimalAliasBody&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalAliasBody& MinimalAliasBody::operator =( - const MinimalAliasBody& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalAliasBody& MinimalAliasBody::operator =( - MinimalAliasBody&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalAliasBody::getCdrSerializedSize( - const MinimalAliasBody& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAliasBody::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAliasBody::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalAliasBody::operator ==( - const MinimalAliasBody& other) const -{ - return m_common == other.m_common; -} - -//bool MinimalAliasBody::consistent(const MinimalAliasBody &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// return m_common.consistent(x.m_common, consistency); -//} - -CompleteAliasHeader::CompleteAliasHeader() -{ -} - -CompleteAliasHeader::~CompleteAliasHeader() -{ -} - -CompleteAliasHeader::CompleteAliasHeader( - const CompleteAliasHeader& x) -{ - m_detail = x.m_detail; -} - -CompleteAliasHeader::CompleteAliasHeader( - CompleteAliasHeader&& x) -{ - m_detail = std::move(x.m_detail); -} - -CompleteAliasHeader& CompleteAliasHeader::operator =( - const CompleteAliasHeader& x) -{ - m_detail = x.m_detail; - - return *this; -} - -CompleteAliasHeader& CompleteAliasHeader::operator =( - CompleteAliasHeader&& x) -{ - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteAliasHeader::getCdrSerializedSize( - const CompleteAliasHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAliasHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAliasHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAliasHeader::operator ==( - const CompleteAliasHeader& other) const -{ - return m_detail == other.m_detail; -} - -//bool CompleteAliasHeader::consistent(const CompleteAliasHeader &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// return m_detail.consistent(x.m_detail, consistency); -//} - -MinimalAliasHeader::MinimalAliasHeader() -{ -} - -MinimalAliasHeader::~MinimalAliasHeader() -{ -} - -MinimalAliasHeader::MinimalAliasHeader( - const MinimalAliasHeader&) -{ -} - -MinimalAliasHeader::MinimalAliasHeader( - MinimalAliasHeader&&) -{ -} - -MinimalAliasHeader& MinimalAliasHeader::operator =( - const MinimalAliasHeader&) -{ - return *this; -} - -MinimalAliasHeader& MinimalAliasHeader::operator =( - MinimalAliasHeader&&) -{ - return *this; -} - -size_t MinimalAliasHeader::getCdrSerializedSize( - const MinimalAliasHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAliasHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAliasHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -CompleteAliasType::CompleteAliasType() -{ -} - -CompleteAliasType::~CompleteAliasType() -{ -} - -CompleteAliasType::CompleteAliasType( - const CompleteAliasType& x) -{ - m_alias_flags = x.m_alias_flags; - m_header = x.m_header; - m_body = x.m_body; -} - -CompleteAliasType::CompleteAliasType( - CompleteAliasType&& x) -{ - m_alias_flags = std::move(x.m_alias_flags); - m_header = std::move(x.m_header); - m_body = std::move(x.m_body); -} - -CompleteAliasType& CompleteAliasType::operator =( - const CompleteAliasType& x) -{ - m_alias_flags = x.m_alias_flags; - m_header = x.m_header; - m_body = x.m_body; - - return *this; -} - -CompleteAliasType& CompleteAliasType::operator =( - CompleteAliasType&& x) -{ - m_alias_flags = std::move(x.m_alias_flags); - m_header = std::move(x.m_header); - m_body = std::move(x.m_body); - - return *this; -} - -size_t CompleteAliasType::getCdrSerializedSize( - const CompleteAliasType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteAliasType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteAliasType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteAliasType::operator ==( - const CompleteAliasType& other) const -{ - return m_alias_flags == other.m_alias_flags && - m_header == other.m_header && - m_body == other.m_body; -} - -//bool CompleteAliasType::consistent(const CompleteAliasType &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// return m_header.consistent(x.m_header, consistency) -// && m_body.consistent(x.m_body, consistency); -//} - -MinimalAliasType::MinimalAliasType() -{ -} - -MinimalAliasType::~MinimalAliasType() -{ -} - -MinimalAliasType::MinimalAliasType( - const MinimalAliasType& x) -{ - m_alias_flags = x.m_alias_flags; - m_header = x.m_header; - m_body = x.m_body; -} - -MinimalAliasType::MinimalAliasType( - MinimalAliasType&& x) -{ - m_alias_flags = std::move(x.m_alias_flags); - m_header = std::move(x.m_header); - m_body = std::move(x.m_body); -} - -MinimalAliasType& MinimalAliasType::operator =( - const MinimalAliasType& x) -{ - m_alias_flags = x.m_alias_flags; - m_header = x.m_header; - m_body = x.m_body; - - return *this; -} - -MinimalAliasType& MinimalAliasType::operator =( - MinimalAliasType&& x) -{ - m_alias_flags = std::move(x.m_alias_flags); - m_header = std::move(x.m_header); - m_body = std::move(x.m_body); - - return *this; -} - -size_t MinimalAliasType::getCdrSerializedSize( - const MinimalAliasType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalAliasType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalAliasType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalAliasType::operator ==( - const MinimalAliasType& other) const -{ - return m_alias_flags == other.m_alias_flags && - m_header == other.m_header && - m_body == other.m_body; -} - -//bool MinimalAliasType::consistent(const MinimalAliasType &x, -// const TypeConsistencyEnforcementQosPolicy& consistency) const -//{ -// return m_header.consistent(x.m_header, consistency) -// && m_body.consistent(x.m_body, consistency); -//} - -CompleteElementDetail::CompleteElementDetail() -{ -} - -CompleteElementDetail::~CompleteElementDetail() -{ -} - -CompleteElementDetail::CompleteElementDetail( - const CompleteElementDetail& x) -{ - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; -} - -CompleteElementDetail::CompleteElementDetail( - CompleteElementDetail&& x) -{ - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); -} - -CompleteElementDetail& CompleteElementDetail::operator =( - const CompleteElementDetail& x) -{ - m_ann_builtin = x.m_ann_builtin; - m_ann_custom = x.m_ann_custom; - - return *this; -} - -CompleteElementDetail& CompleteElementDetail::operator =( - CompleteElementDetail&& x) -{ - m_ann_builtin = std::move(x.m_ann_builtin); - m_ann_custom = std::move(x.m_ann_custom); - - return *this; -} - -size_t CompleteElementDetail::getCdrSerializedSize( - const CompleteElementDetail& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteElementDetail::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteElementDetail::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteElementDetail::operator ==( - const CompleteElementDetail& other) const -{ - if (m_ann_builtin == other.m_ann_builtin) - { - return compareSequence(m_ann_custom, other.m_ann_custom); - } - return false; -} - -bool CompleteElementDetail::consistent( - const CompleteElementDetail&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO Annotation consistency? - return true; - -} - -CommonCollectionElement::CommonCollectionElement() -{ -} - -CommonCollectionElement::~CommonCollectionElement() -{ -} - -CommonCollectionElement::CommonCollectionElement( - const CommonCollectionElement& x) -{ - m_element_flags = x.m_element_flags; - m_type = x.m_type; -} - -CommonCollectionElement::CommonCollectionElement( - CommonCollectionElement&& x) -{ - m_element_flags = std::move(x.m_element_flags); - m_type = std::move(x.m_type); -} - -CommonCollectionElement& CommonCollectionElement::operator =( - const CommonCollectionElement& x) -{ - m_element_flags = x.m_element_flags; - m_type = x.m_type; - - return *this; -} - -CommonCollectionElement& CommonCollectionElement::operator =( - CommonCollectionElement&& x) -{ - m_element_flags = std::move(x.m_element_flags); - m_type = std::move(x.m_type); - - return *this; -} - -size_t CommonCollectionElement::getCdrSerializedSize( - const CommonCollectionElement& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonCollectionElement::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonCollectionElement::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonCollectionElement::operator ==( - const CommonCollectionElement& other) const -{ - return m_element_flags == other.m_element_flags && - m_type == other.m_type; -} - -bool CommonCollectionElement::consistent( - const CommonCollectionElement& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_type.consistent(x.m_type, consistency); - -} - -CompleteCollectionElement::CompleteCollectionElement() -{ -} - -CompleteCollectionElement::~CompleteCollectionElement() -{ -} - -CompleteCollectionElement::CompleteCollectionElement( - const CompleteCollectionElement& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteCollectionElement::CompleteCollectionElement( - CompleteCollectionElement&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteCollectionElement& CompleteCollectionElement::operator =( - const CompleteCollectionElement& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteCollectionElement& CompleteCollectionElement::operator =( - CompleteCollectionElement&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteCollectionElement::getCdrSerializedSize( - const CompleteCollectionElement& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteCollectionElement::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteCollectionElement::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteCollectionElement::operator ==( - const CompleteCollectionElement& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteCollectionElement::consistent( - const CompleteCollectionElement& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalCollectionElement::MinimalCollectionElement() -{ -} - -MinimalCollectionElement::~MinimalCollectionElement() -{ -} - -MinimalCollectionElement::MinimalCollectionElement( - const MinimalCollectionElement& x) -{ - m_common = x.m_common; -} - -MinimalCollectionElement::MinimalCollectionElement( - MinimalCollectionElement&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalCollectionElement& MinimalCollectionElement::operator =( - const MinimalCollectionElement& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalCollectionElement& MinimalCollectionElement::operator =( - MinimalCollectionElement&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalCollectionElement::getCdrSerializedSize( - const MinimalCollectionElement& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalCollectionElement::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalCollectionElement::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalCollectionElement::operator ==( - const MinimalCollectionElement& other) const -{ - return m_common == other.m_common; -} - -bool MinimalCollectionElement::consistent( - const MinimalCollectionElement& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_common.consistent(x.m_common, consistency); - -} - -CommonCollectionHeader::CommonCollectionHeader() -{ -} - -CommonCollectionHeader::~CommonCollectionHeader() -{ -} - -CommonCollectionHeader::CommonCollectionHeader( - const CommonCollectionHeader& x) -{ - m_bound = x.m_bound; -} - -CommonCollectionHeader::CommonCollectionHeader( - CommonCollectionHeader&& x) -{ - m_bound = std::move(x.m_bound); -} - -CommonCollectionHeader& CommonCollectionHeader::operator =( - const CommonCollectionHeader& x) -{ - m_bound = x.m_bound; - - return *this; -} - -CommonCollectionHeader& CommonCollectionHeader::operator =( - CommonCollectionHeader&& x) -{ - m_bound = std::move(x.m_bound); - - return *this; -} - -size_t CommonCollectionHeader::getCdrSerializedSize( - const CommonCollectionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonCollectionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonCollectionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonCollectionHeader::operator ==( - const CommonCollectionHeader& other) const -{ - return m_bound == other.m_bound; -} - -bool CommonCollectionHeader::consistent( - const CommonCollectionHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return (consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_sequence_bounds) - || m_bound >= x.m_bound; - -} - -CompleteCollectionHeader::CompleteCollectionHeader() -{ -} - -CompleteCollectionHeader::~CompleteCollectionHeader() -{ -} - -CompleteCollectionHeader::CompleteCollectionHeader( - const CompleteCollectionHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteCollectionHeader::CompleteCollectionHeader( - CompleteCollectionHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteCollectionHeader& CompleteCollectionHeader::operator =( - const CompleteCollectionHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteCollectionHeader& CompleteCollectionHeader::operator =( - CompleteCollectionHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteCollectionHeader::getCdrSerializedSize( - const CompleteCollectionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteCollectionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteCollectionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteCollectionHeader::operator ==( - const CompleteCollectionHeader& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteCollectionHeader::consistent( - const CompleteCollectionHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalCollectionHeader::MinimalCollectionHeader() -{ -} - -MinimalCollectionHeader::~MinimalCollectionHeader() -{ -} - -MinimalCollectionHeader::MinimalCollectionHeader( - const MinimalCollectionHeader& x) -{ - m_common = x.m_common; -} - -MinimalCollectionHeader::MinimalCollectionHeader( - MinimalCollectionHeader&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalCollectionHeader& MinimalCollectionHeader::operator =( - const MinimalCollectionHeader& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalCollectionHeader& MinimalCollectionHeader::operator =( - MinimalCollectionHeader&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalCollectionHeader::getCdrSerializedSize( - const MinimalCollectionHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalCollectionHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalCollectionHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalCollectionHeader::operator ==( - const MinimalCollectionHeader& other) const -{ - return m_common == other.m_common; -} - -bool MinimalCollectionHeader::consistent( - const MinimalCollectionHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_common.consistent(x.m_common, consistency); - -} - -CompleteSequenceType::CompleteSequenceType() -{ -} - -CompleteSequenceType::~CompleteSequenceType() -{ -} - -CompleteSequenceType::CompleteSequenceType( - const CompleteSequenceType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; -} - -CompleteSequenceType::CompleteSequenceType( - CompleteSequenceType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); -} - -CompleteSequenceType& CompleteSequenceType::operator =( - const CompleteSequenceType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; - - return *this; -} - -CompleteSequenceType& CompleteSequenceType::operator =( - CompleteSequenceType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); - - return *this; -} - -size_t CompleteSequenceType::getCdrSerializedSize( - const CompleteSequenceType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteSequenceType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteSequenceType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteSequenceType::operator ==( - const CompleteSequenceType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_element == other.m_element; -} - -bool CompleteSequenceType::consistent( - const CompleteSequenceType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -MinimalSequenceType::MinimalSequenceType() -{ -} - -MinimalSequenceType::~MinimalSequenceType() -{ -} - -MinimalSequenceType::MinimalSequenceType( - const MinimalSequenceType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; -} - -MinimalSequenceType::MinimalSequenceType( - MinimalSequenceType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); -} - -MinimalSequenceType& MinimalSequenceType::operator =( - const MinimalSequenceType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; - - return *this; -} - -MinimalSequenceType& MinimalSequenceType::operator =( - MinimalSequenceType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); - - return *this; -} - -size_t MinimalSequenceType::getCdrSerializedSize( - const MinimalSequenceType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalSequenceType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalSequenceType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalSequenceType::operator ==( - const MinimalSequenceType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_element == other.m_element; -} - -bool MinimalSequenceType::consistent( - const MinimalSequenceType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -CommonArrayHeader::CommonArrayHeader() -{ -} - -CommonArrayHeader::~CommonArrayHeader() -{ -} - -CommonArrayHeader::CommonArrayHeader( - const CommonArrayHeader& x) -{ - m_bound_seq = x.m_bound_seq; -} - -CommonArrayHeader::CommonArrayHeader( - CommonArrayHeader&& x) -{ - m_bound_seq = std::move(x.m_bound_seq); -} - -CommonArrayHeader& CommonArrayHeader::operator =( - const CommonArrayHeader& x) -{ - m_bound_seq = x.m_bound_seq; - - return *this; -} - -CommonArrayHeader& CommonArrayHeader::operator =( - CommonArrayHeader&& x) -{ - m_bound_seq = std::move(x.m_bound_seq); - - return *this; -} - -size_t CommonArrayHeader::getCdrSerializedSize( - const CommonArrayHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonArrayHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonArrayHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonArrayHeader::operator ==( - const CommonArrayHeader& other) const -{ - return compareSequence(m_bound_seq, other.m_bound_seq); -} - -bool CommonArrayHeader::consistent( - const CommonArrayHeader& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO Does prevent_type_widening apply here? - if (m_bound_seq.size() == x.m_bound_seq.size()) // TODO In Arrays, == or <=? - { - auto local_it = m_bound_seq.begin(); - auto remote_it = x.m_bound_seq.begin(); - while (local_it != m_bound_seq.end()) - { - if (*local_it != *remote_it) - { - return false; // Bound inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Same size, all bounds consistent - } - return false; // different sizes - - -} - -CompleteArrayHeader::CompleteArrayHeader() -{ -} - -CompleteArrayHeader::~CompleteArrayHeader() -{ -} - -CompleteArrayHeader::CompleteArrayHeader( - const CompleteArrayHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteArrayHeader::CompleteArrayHeader( - CompleteArrayHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteArrayHeader& CompleteArrayHeader::operator =( - const CompleteArrayHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteArrayHeader& CompleteArrayHeader::operator =( - CompleteArrayHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteArrayHeader::getCdrSerializedSize( - const CompleteArrayHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteArrayHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteArrayHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteArrayHeader::operator ==( - const CompleteArrayHeader& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteArrayHeader::consistent( - const CompleteArrayHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalArrayHeader::MinimalArrayHeader() -{ -} - -MinimalArrayHeader::~MinimalArrayHeader() -{ -} - -MinimalArrayHeader::MinimalArrayHeader( - const MinimalArrayHeader& x) -{ - m_common = x.m_common; -} - -MinimalArrayHeader::MinimalArrayHeader( - MinimalArrayHeader&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalArrayHeader& MinimalArrayHeader::operator =( - const MinimalArrayHeader& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalArrayHeader& MinimalArrayHeader::operator =( - MinimalArrayHeader&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalArrayHeader::getCdrSerializedSize( - const MinimalArrayHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalArrayHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalArrayHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalArrayHeader::operator ==( - const MinimalArrayHeader& other) const -{ - return m_common == other.m_common; -} - -bool MinimalArrayHeader::consistent( - const MinimalArrayHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_common.consistent(x.m_common, consistency); - -} - -CompleteArrayType::CompleteArrayType() -{ -} - -CompleteArrayType::~CompleteArrayType() -{ -} - -CompleteArrayType::CompleteArrayType( - const CompleteArrayType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; -} - -CompleteArrayType::CompleteArrayType( - CompleteArrayType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); -} - -CompleteArrayType& CompleteArrayType::operator =( - const CompleteArrayType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; - - return *this; -} - -CompleteArrayType& CompleteArrayType::operator =( - CompleteArrayType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); - - return *this; -} - -size_t CompleteArrayType::getCdrSerializedSize( - const CompleteArrayType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteArrayType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteArrayType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteArrayType::operator ==( - const CompleteArrayType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_element == other.m_element; -} - -bool CompleteArrayType::consistent( - const CompleteArrayType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -MinimalArrayType::MinimalArrayType() -{ -} - -MinimalArrayType::~MinimalArrayType() -{ -} - -MinimalArrayType::MinimalArrayType( - const MinimalArrayType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; -} - -MinimalArrayType::MinimalArrayType( - MinimalArrayType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); -} - -MinimalArrayType& MinimalArrayType::operator =( - const MinimalArrayType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_element = x.m_element; - - return *this; -} - -MinimalArrayType& MinimalArrayType::operator =( - MinimalArrayType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_element = std::move(x.m_element); - - return *this; -} - -size_t MinimalArrayType::getCdrSerializedSize( - const MinimalArrayType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalArrayType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalArrayType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalArrayType::operator ==( - const MinimalArrayType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_element == other.m_element; -} - -bool MinimalArrayType::consistent( - const MinimalArrayType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -CompleteMapType::CompleteMapType() -{ -} - -CompleteMapType::~CompleteMapType() -{ -} - -CompleteMapType::CompleteMapType( - const CompleteMapType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_key = x.m_key; - m_element = x.m_element; -} - -CompleteMapType::CompleteMapType( - CompleteMapType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_key = std::move(x.m_key); - m_element = std::move(x.m_element); -} - -CompleteMapType& CompleteMapType::operator =( - const CompleteMapType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_key = x.m_key; - m_element = x.m_element; - - return *this; -} - -CompleteMapType& CompleteMapType::operator =( - CompleteMapType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_key = std::move(x.m_key); - m_element = std::move(x.m_element); - - return *this; -} - -size_t CompleteMapType::getCdrSerializedSize( - const CompleteMapType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteMapType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteMapType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteMapType::operator ==( - const CompleteMapType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_key == other.m_key && - m_element == other.m_element; -} - -bool CompleteMapType::consistent( - const CompleteMapType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_key.consistent(x.m_key, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -MinimalMapType::MinimalMapType() -{ -} - -MinimalMapType::~MinimalMapType() -{ -} - -MinimalMapType::MinimalMapType( - const MinimalMapType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_key = x.m_key; - m_element = x.m_element; -} - -MinimalMapType::MinimalMapType( - MinimalMapType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_key = std::move(x.m_key); - m_element = std::move(x.m_element); -} - -MinimalMapType& MinimalMapType::operator =( - const MinimalMapType& x) -{ - m_collection_flag = x.m_collection_flag; - m_header = x.m_header; - m_key = x.m_key; - m_element = x.m_element; - - return *this; -} - -MinimalMapType& MinimalMapType::operator =( - MinimalMapType&& x) -{ - m_collection_flag = std::move(x.m_collection_flag); - m_header = std::move(x.m_header); - m_key = std::move(x.m_key); - m_element = std::move(x.m_element); - - return *this; -} - -size_t MinimalMapType::getCdrSerializedSize( - const MinimalMapType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalMapType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalMapType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalMapType::operator ==( - const MinimalMapType& other) const -{ - return m_collection_flag == other.m_collection_flag && - m_header == other.m_header && - m_key == other.m_key && - m_element == other.m_element; -} - -bool MinimalMapType::consistent( - const MinimalMapType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_header.consistent(x.m_header, consistency) - && m_key.consistent(x.m_key, consistency) - && m_element.consistent(x.m_element, consistency); - -} - -CommonEnumeratedLiteral::CommonEnumeratedLiteral() -{ -} - -CommonEnumeratedLiteral::~CommonEnumeratedLiteral() -{ -} - -CommonEnumeratedLiteral::CommonEnumeratedLiteral( - const CommonEnumeratedLiteral& x) -{ - m_value = x.m_value; - m_flags = x.m_flags; -} - -CommonEnumeratedLiteral::CommonEnumeratedLiteral( - CommonEnumeratedLiteral&& x) -{ - m_value = std::move(x.m_value); - m_flags = std::move(x.m_flags); -} - -CommonEnumeratedLiteral& CommonEnumeratedLiteral::operator =( - const CommonEnumeratedLiteral& x) -{ - m_value = x.m_value; - m_flags = x.m_flags; - - return *this; -} - -CommonEnumeratedLiteral& CommonEnumeratedLiteral::operator =( - CommonEnumeratedLiteral&& x) -{ - m_value = std::move(x.m_value); - m_flags = std::move(x.m_flags); - - return *this; -} - -size_t CommonEnumeratedLiteral::getCdrSerializedSize( - const CommonEnumeratedLiteral& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonEnumeratedLiteral::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonEnumeratedLiteral::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonEnumeratedLiteral::operator ==( - const CommonEnumeratedLiteral& other) const -{ - return m_value == other.m_value && - m_flags == other.m_flags; -} - -bool CommonEnumeratedLiteral::consistent( - const CommonEnumeratedLiteral& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return m_value == x.m_value; - -} - -CompleteEnumeratedLiteral::CompleteEnumeratedLiteral() -{ -} - -CompleteEnumeratedLiteral::~CompleteEnumeratedLiteral() -{ -} - -CompleteEnumeratedLiteral::CompleteEnumeratedLiteral( - const CompleteEnumeratedLiteral& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteEnumeratedLiteral::CompleteEnumeratedLiteral( - CompleteEnumeratedLiteral&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteEnumeratedLiteral& CompleteEnumeratedLiteral::operator =( - const CompleteEnumeratedLiteral& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteEnumeratedLiteral& CompleteEnumeratedLiteral::operator =( - CompleteEnumeratedLiteral&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteEnumeratedLiteral::getCdrSerializedSize( - const CompleteEnumeratedLiteral& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteEnumeratedLiteral::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteEnumeratedLiteral::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteEnumeratedLiteral::operator ==( - const CompleteEnumeratedLiteral& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteEnumeratedLiteral::consistent( - const CompleteEnumeratedLiteral& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalEnumeratedLiteral::MinimalEnumeratedLiteral() -{ -} - -MinimalEnumeratedLiteral::~MinimalEnumeratedLiteral() -{ -} - -MinimalEnumeratedLiteral::MinimalEnumeratedLiteral( - const MinimalEnumeratedLiteral& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -MinimalEnumeratedLiteral::MinimalEnumeratedLiteral( - MinimalEnumeratedLiteral&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -MinimalEnumeratedLiteral& MinimalEnumeratedLiteral::operator =( - const MinimalEnumeratedLiteral& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -MinimalEnumeratedLiteral& MinimalEnumeratedLiteral::operator =( - MinimalEnumeratedLiteral&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalEnumeratedLiteral::getCdrSerializedSize( - const MinimalEnumeratedLiteral& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalEnumeratedLiteral::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalEnumeratedLiteral::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalEnumeratedLiteral::operator ==( - const MinimalEnumeratedLiteral& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool MinimalEnumeratedLiteral::consistent( - const MinimalEnumeratedLiteral& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -CommonEnumeratedHeader::CommonEnumeratedHeader() -{ -} - -CommonEnumeratedHeader::~CommonEnumeratedHeader() -{ -} - -CommonEnumeratedHeader::CommonEnumeratedHeader( - const CommonEnumeratedHeader& x) -{ - m_bit_bound = x.m_bit_bound; -} - -CommonEnumeratedHeader::CommonEnumeratedHeader( - CommonEnumeratedHeader&& x) -{ - m_bit_bound = std::move(x.m_bit_bound); -} - -CommonEnumeratedHeader& CommonEnumeratedHeader::operator =( - const CommonEnumeratedHeader& x) -{ - m_bit_bound = x.m_bit_bound; - - return *this; -} - -CommonEnumeratedHeader& CommonEnumeratedHeader::operator =( - CommonEnumeratedHeader&& x) -{ - m_bit_bound = std::move(x.m_bit_bound); - - return *this; -} - -size_t CommonEnumeratedHeader::getCdrSerializedSize( - const CommonEnumeratedHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonEnumeratedHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonEnumeratedHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonEnumeratedHeader::operator ==( - const CommonEnumeratedHeader& other) const -{ - return m_bit_bound == other.m_bit_bound; -} - -bool CommonEnumeratedHeader::consistent( - const CommonEnumeratedHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - // TODO type widening applies here? - return (consistency.m_kind == ALLOW_TYPE_COERCION && !consistency.m_prevent_type_widening) - || m_bit_bound == x.m_bit_bound; - -} - -CompleteEnumeratedHeader::CompleteEnumeratedHeader() -{ -} - -CompleteEnumeratedHeader::~CompleteEnumeratedHeader() -{ -} - -CompleteEnumeratedHeader::CompleteEnumeratedHeader( - const CompleteEnumeratedHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteEnumeratedHeader::CompleteEnumeratedHeader( - CompleteEnumeratedHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteEnumeratedHeader& CompleteEnumeratedHeader::operator =( - const CompleteEnumeratedHeader& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteEnumeratedHeader& CompleteEnumeratedHeader::operator =( - CompleteEnumeratedHeader&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteEnumeratedHeader::getCdrSerializedSize( - const CompleteEnumeratedHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteEnumeratedHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteEnumeratedHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteEnumeratedHeader::operator ==( - const CompleteEnumeratedHeader& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteEnumeratedHeader::consistent( - const CompleteEnumeratedHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalEnumeratedHeader::MinimalEnumeratedHeader() -{ -} - -MinimalEnumeratedHeader::~MinimalEnumeratedHeader() -{ -} - -MinimalEnumeratedHeader::MinimalEnumeratedHeader( - const MinimalEnumeratedHeader& x) -{ - m_common = x.m_common; -} - -MinimalEnumeratedHeader::MinimalEnumeratedHeader( - MinimalEnumeratedHeader&& x) -{ - m_common = std::move(x.m_common); -} - -MinimalEnumeratedHeader& MinimalEnumeratedHeader::operator =( - const MinimalEnumeratedHeader& x) -{ - m_common = x.m_common; - - return *this; -} - -MinimalEnumeratedHeader& MinimalEnumeratedHeader::operator =( - MinimalEnumeratedHeader&& x) -{ - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalEnumeratedHeader::getCdrSerializedSize( - const MinimalEnumeratedHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalEnumeratedHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalEnumeratedHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalEnumeratedHeader::operator ==( - const MinimalEnumeratedHeader& other) const -{ - return m_common == other.m_common; -} - -bool MinimalEnumeratedHeader::consistent( - const MinimalEnumeratedHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_common.consistent(x.m_common, consistency); - -} - -CompleteEnumeratedType::CompleteEnumeratedType() -{ -} - -CompleteEnumeratedType::~CompleteEnumeratedType() -{ -} - -CompleteEnumeratedType::CompleteEnumeratedType( - const CompleteEnumeratedType& x) -{ - m_enum_flags = x.m_enum_flags; - m_header = x.m_header; - m_literal_seq = x.m_literal_seq; -} - -CompleteEnumeratedType::CompleteEnumeratedType( - CompleteEnumeratedType&& x) -{ - m_enum_flags = std::move(x.m_enum_flags); - m_header = std::move(x.m_header); - m_literal_seq = std::move(x.m_literal_seq); -} - -CompleteEnumeratedType& CompleteEnumeratedType::operator =( - const CompleteEnumeratedType& x) -{ - m_enum_flags = x.m_enum_flags; - m_header = x.m_header; - m_literal_seq = x.m_literal_seq; - - return *this; -} - -CompleteEnumeratedType& CompleteEnumeratedType::operator =( - CompleteEnumeratedType&& x) -{ - m_enum_flags = std::move(x.m_enum_flags); - m_header = std::move(x.m_header); - m_literal_seq = std::move(x.m_literal_seq); - - return *this; -} - -size_t CompleteEnumeratedType::getCdrSerializedSize( - const CompleteEnumeratedType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteEnumeratedType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteEnumeratedType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteEnumeratedType::operator ==( - const CompleteEnumeratedType& other) const -{ - if (m_enum_flags == other.m_enum_flags && - m_header == other.m_header) - { - return compareSequence(m_literal_seq, other.m_literal_seq); - } - return false; -} - -bool CompleteEnumeratedType::consistent( - const CompleteEnumeratedType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_literal_seq.size() != x.m_literal_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_literal_seq.size() <= x.m_literal_seq.size()) - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (local_it != m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all literals consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_literal_seq.size() <= x.m_literal_seq.size()) - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (local_it != m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (remote_it != x.m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All literals consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -MinimalEnumeratedType::MinimalEnumeratedType() -{ -} - -MinimalEnumeratedType::~MinimalEnumeratedType() -{ -} - -MinimalEnumeratedType::MinimalEnumeratedType( - const MinimalEnumeratedType& x) -{ - m_enum_flags = x.m_enum_flags; - m_header = x.m_header; - m_literal_seq = x.m_literal_seq; -} - -MinimalEnumeratedType::MinimalEnumeratedType( - MinimalEnumeratedType&& x) -{ - m_enum_flags = std::move(x.m_enum_flags); - m_header = std::move(x.m_header); - m_literal_seq = std::move(x.m_literal_seq); -} - -MinimalEnumeratedType& MinimalEnumeratedType::operator =( - const MinimalEnumeratedType& x) -{ - m_enum_flags = x.m_enum_flags; - m_header = x.m_header; - m_literal_seq = x.m_literal_seq; - - return *this; -} - -MinimalEnumeratedType& MinimalEnumeratedType::operator =( - MinimalEnumeratedType&& x) -{ - m_enum_flags = std::move(x.m_enum_flags); - m_header = std::move(x.m_header); - m_literal_seq = std::move(x.m_literal_seq); - - return *this; -} - -size_t MinimalEnumeratedType::getCdrSerializedSize( - const MinimalEnumeratedType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalEnumeratedType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalEnumeratedType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalEnumeratedType::operator ==( - const MinimalEnumeratedType& other) const -{ - if (m_enum_flags == other.m_enum_flags && - m_header == other.m_header) - { - return compareSequence(m_literal_seq, other.m_literal_seq); - } - return false; -} - -bool MinimalEnumeratedType::consistent( - const MinimalEnumeratedType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_literal_seq.size() != x.m_literal_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_literal_seq.size() <= x.m_literal_seq.size()) - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (local_it != m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all literals consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_literal_seq.size() <= x.m_literal_seq.size()) - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (local_it != m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_literal_seq.begin(); - auto remote_it = x.m_literal_seq.begin(); - while (remote_it != x.m_literal_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Literal inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All literals consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -CommonBitflag::CommonBitflag() -{ -} - -CommonBitflag::~CommonBitflag() -{ -} - -CommonBitflag::CommonBitflag( - const CommonBitflag& x) -{ - m_position = x.m_position; - m_flags = x.m_flags; -} - -CommonBitflag::CommonBitflag( - CommonBitflag&& x) -{ - m_position = std::move(x.m_position); - m_flags = std::move(x.m_flags); -} - -CommonBitflag& CommonBitflag::operator =( - const CommonBitflag& x) -{ - m_position = x.m_position; - m_flags = x.m_flags; - - return *this; -} - -CommonBitflag& CommonBitflag::operator =( - CommonBitflag&& x) -{ - m_position = std::move(x.m_position); - m_flags = std::move(x.m_flags); - - return *this; -} - -size_t CommonBitflag::getCdrSerializedSize( - const CommonBitflag& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonBitflag::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonBitflag::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonBitflag::operator ==( - const CommonBitflag& other) const -{ - return m_position == other.m_position && - m_flags == other.m_flags; -} - -bool CommonBitflag::consistent( - const CommonBitflag& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return m_position == x.m_position; - -} - -CompleteBitflag::CompleteBitflag() -{ -} - -CompleteBitflag::~CompleteBitflag() -{ -} - -CompleteBitflag::CompleteBitflag( - const CompleteBitflag& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteBitflag::CompleteBitflag( - CompleteBitflag&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteBitflag& CompleteBitflag::operator =( - const CompleteBitflag& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteBitflag& CompleteBitflag::operator =( - CompleteBitflag&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteBitflag::getCdrSerializedSize( - const CompleteBitflag& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteBitflag::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteBitflag::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteBitflag::operator ==( - const CompleteBitflag& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteBitflag::consistent( - const CompleteBitflag& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalBitflag::MinimalBitflag() -{ -} - -MinimalBitflag::~MinimalBitflag() -{ -} - -MinimalBitflag::MinimalBitflag( - const MinimalBitflag& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -MinimalBitflag::MinimalBitflag( - MinimalBitflag&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -MinimalBitflag& MinimalBitflag::operator =( - const MinimalBitflag& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -MinimalBitflag& MinimalBitflag::operator =( - MinimalBitflag&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t MinimalBitflag::getCdrSerializedSize( - const MinimalBitflag& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalBitflag::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalBitflag::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalBitflag::operator ==( - const MinimalBitflag& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool MinimalBitflag::consistent( - const MinimalBitflag& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -CommonBitmaskHeader::CommonBitmaskHeader() -{ -} - -CommonBitmaskHeader::~CommonBitmaskHeader() -{ -} - -CommonBitmaskHeader::CommonBitmaskHeader( - const CommonBitmaskHeader& x) -{ - m_bit_bound = x.m_bit_bound; -} - -CommonBitmaskHeader::CommonBitmaskHeader( - CommonBitmaskHeader&& x) -{ - m_bit_bound = std::move(x.m_bit_bound); -} - -CommonBitmaskHeader& CommonBitmaskHeader::operator =( - const CommonBitmaskHeader& x) -{ - m_bit_bound = x.m_bit_bound; - - return *this; -} - -CommonBitmaskHeader& CommonBitmaskHeader::operator =( - CommonBitmaskHeader&& x) -{ - m_bit_bound = std::move(x.m_bit_bound); - - return *this; -} - -size_t CommonBitmaskHeader::getCdrSerializedSize( - const CommonBitmaskHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonBitmaskHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonBitmaskHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonBitmaskHeader::operator ==( - const CommonBitmaskHeader& other) const -{ - return m_bit_bound == other.m_bit_bound; -} - -bool CommonBitmaskHeader::consistent( - const CommonBitmaskHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - // TODO type widening applies here? - return (consistency.m_kind == ALLOW_TYPE_COERCION && !consistency.m_prevent_type_widening) - || m_bit_bound == x.m_bit_bound; - -} - -CompleteBitmaskType::CompleteBitmaskType() -{ -} - -CompleteBitmaskType::~CompleteBitmaskType() -{ -} - -CompleteBitmaskType::CompleteBitmaskType( - const CompleteBitmaskType& x) -{ - m_bitmask_flags = x.m_bitmask_flags; - m_header = x.m_header; - m_flag_seq = x.m_flag_seq; -} - -CompleteBitmaskType::CompleteBitmaskType( - CompleteBitmaskType&& x) -{ - m_bitmask_flags = std::move(x.m_bitmask_flags); - m_header = std::move(x.m_header); - m_flag_seq = std::move(x.m_flag_seq); -} - -CompleteBitmaskType& CompleteBitmaskType::operator =( - const CompleteBitmaskType& x) -{ - m_bitmask_flags = x.m_bitmask_flags; - m_header = x.m_header; - m_flag_seq = x.m_flag_seq; - - return *this; -} - -CompleteBitmaskType& CompleteBitmaskType::operator =( - CompleteBitmaskType&& x) -{ - m_bitmask_flags = std::move(x.m_bitmask_flags); - m_header = std::move(x.m_header); - m_flag_seq = std::move(x.m_flag_seq); - - return *this; -} - -size_t CompleteBitmaskType::getCdrSerializedSize( - const CompleteBitmaskType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteBitmaskType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteBitmaskType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteBitmaskType::operator ==( - const CompleteBitmaskType& other) const -{ - if (m_bitmask_flags == other.m_bitmask_flags && - m_header == other.m_header) - { - return compareSequence(m_flag_seq, other.m_flag_seq); - } - return false; -} - -bool CompleteBitmaskType::consistent( - const CompleteBitmaskType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_flag_seq.size() != x.m_flag_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_flag_seq.size() <= x.m_flag_seq.size()) - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (local_it != m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all flags consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_flag_seq.size() <= x.m_flag_seq.size()) - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (local_it != m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (remote_it != x.m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All flags consistent (size doesn't matter) - } - } - return false; // Header non consistent - -} - -MinimalBitmaskType::MinimalBitmaskType() -{ -} - -MinimalBitmaskType::~MinimalBitmaskType() -{ -} - -MinimalBitmaskType::MinimalBitmaskType( - const MinimalBitmaskType& x) -{ - m_bitmask_flags = x.m_bitmask_flags; - m_header = x.m_header; - m_flag_seq = x.m_flag_seq; -} - -MinimalBitmaskType::MinimalBitmaskType( - MinimalBitmaskType&& x) -{ - m_bitmask_flags = std::move(x.m_bitmask_flags); - m_header = std::move(x.m_header); - m_flag_seq = std::move(x.m_flag_seq); -} - -MinimalBitmaskType& MinimalBitmaskType::operator =( - const MinimalBitmaskType& x) -{ - m_bitmask_flags = x.m_bitmask_flags; - m_header = x.m_header; - m_flag_seq = x.m_flag_seq; - - return *this; -} - -MinimalBitmaskType& MinimalBitmaskType::operator =( - MinimalBitmaskType&& x) -{ - m_bitmask_flags = std::move(x.m_bitmask_flags); - m_header = std::move(x.m_header); - m_flag_seq = std::move(x.m_flag_seq); - - return *this; -} - -size_t MinimalBitmaskType::getCdrSerializedSize( - const MinimalBitmaskType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalBitmaskType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalBitmaskType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalBitmaskType::operator ==( - const MinimalBitmaskType& other) const -{ - if (m_bitmask_flags == other.m_bitmask_flags && - m_header == other.m_header) - { - return compareSequence(m_flag_seq, other.m_flag_seq); - } - return false; -} - -bool MinimalBitmaskType::consistent( - const MinimalBitmaskType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_flag_seq.size() != x.m_flag_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_flag_seq.size() <= x.m_flag_seq.size()) - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (local_it != m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all flags consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_flag_seq.size() <= x.m_flag_seq.size()) - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (local_it != m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_flag_seq.begin(); - auto remote_it = x.m_flag_seq.begin(); - while (remote_it != x.m_flag_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Flag inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All flags consistent (size doesn't matter) - } - } - return false; // Header non consistent - -} - -CommonBitfield::CommonBitfield() -{ -} - -CommonBitfield::~CommonBitfield() -{ -} - -CommonBitfield::CommonBitfield( - const CommonBitfield& x) -{ - m_position = x.m_position; - m_flags = x.m_flags; - m_bitcount = x.m_bitcount; - m_holder_type = x.m_holder_type; -} - -CommonBitfield::CommonBitfield( - CommonBitfield&& x) -{ - m_position = std::move(x.m_position); - m_flags = std::move(x.m_flags); - m_bitcount = std::move(x.m_bitcount); - m_holder_type = std::move(x.m_holder_type); -} - -CommonBitfield& CommonBitfield::operator =( - const CommonBitfield& x) -{ - m_position = x.m_position; - m_flags = x.m_flags; - m_bitcount = x.m_bitcount; - m_holder_type = x.m_holder_type; - - return *this; -} - -CommonBitfield& CommonBitfield::operator =( - CommonBitfield&& x) -{ - m_position = std::move(x.m_position); - m_flags = std::move(x.m_flags); - m_bitcount = std::move(x.m_bitcount); - m_holder_type = std::move(x.m_holder_type); - - return *this; -} - -size_t CommonBitfield::getCdrSerializedSize( - const CommonBitfield& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CommonBitfield::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CommonBitfield::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CommonBitfield::operator ==( - const CommonBitfield& other) const -{ - return m_position == other.m_position && - m_flags == other.m_flags && - m_bitcount == other.m_bitcount && - m_holder_type == other.m_holder_type; -} - -bool CommonBitfield::consistent( - const CommonBitfield& x, - const TypeConsistencyEnforcementQosPolicy&) const -{ - // TODO Not sure about bitcount... - return (m_position == x.m_position - && m_bitcount == x.m_bitcount - && m_holder_type == x.m_holder_type); - -} - -CompleteBitfield::CompleteBitfield() -{ -} - -CompleteBitfield::~CompleteBitfield() -{ -} - -CompleteBitfield::CompleteBitfield( - const CompleteBitfield& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; -} - -CompleteBitfield::CompleteBitfield( - CompleteBitfield&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); -} - -CompleteBitfield& CompleteBitfield::operator =( - const CompleteBitfield& x) -{ - m_common = x.m_common; - m_detail = x.m_detail; - - return *this; -} - -CompleteBitfield& CompleteBitfield::operator =( - CompleteBitfield&& x) -{ - m_common = std::move(x.m_common); - m_detail = std::move(x.m_detail); - - return *this; -} - -size_t CompleteBitfield::getCdrSerializedSize( - const CompleteBitfield& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteBitfield::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteBitfield::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteBitfield::operator ==( - const CompleteBitfield& other) const -{ - return m_common == other.m_common && - m_detail == other.m_detail; -} - -bool CompleteBitfield::consistent( - const CompleteBitfield& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency) - && m_common.consistent(x.m_common, consistency); - -} - -MinimalBitfield::MinimalBitfield() -{ -} - -MinimalBitfield::~MinimalBitfield() -{ -} - -MinimalBitfield::MinimalBitfield( - const MinimalBitfield& x) -{ - m_name_hash = x.m_name_hash; - m_common = x.m_common; -} - -MinimalBitfield::MinimalBitfield( - MinimalBitfield&& x) -{ - m_name_hash = std::move(x.m_name_hash); - m_common = std::move(x.m_common); -} - -MinimalBitfield& MinimalBitfield::operator =( - const MinimalBitfield& x) -{ - m_name_hash = x.m_name_hash; - m_common = x.m_common; - - return *this; -} - -MinimalBitfield& MinimalBitfield::operator =( - MinimalBitfield&& x) -{ - m_name_hash = std::move(x.m_name_hash); - m_common = std::move(x.m_common); - - return *this; -} - -size_t MinimalBitfield::getCdrSerializedSize( - const MinimalBitfield& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalBitfield::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalBitfield::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalBitfield::operator ==( - const MinimalBitfield& other) const -{ - return m_common == other.m_common && - m_name_hash == other.m_name_hash; -} - -bool MinimalBitfield::consistent( - const MinimalBitfield& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if ((consistency.m_kind == ALLOW_TYPE_COERCION && consistency.m_ignore_member_names) - || m_name_hash == x.m_name_hash) - { - return m_common.consistent(x.m_common, consistency); - } - return false; - -} - -CompleteBitsetHeader::CompleteBitsetHeader() -{ -} - -CompleteBitsetHeader::~CompleteBitsetHeader() -{ -} - -CompleteBitsetHeader::CompleteBitsetHeader( - const CompleteBitsetHeader& x) -{ - m_detail = x.m_detail; - m_base_type = x.m_base_type; -} - -CompleteBitsetHeader::CompleteBitsetHeader( - CompleteBitsetHeader&& x) -{ - m_detail = std::move(x.m_detail); - m_base_type = std::move(x.m_base_type); -} - -CompleteBitsetHeader& CompleteBitsetHeader::operator =( - const CompleteBitsetHeader& x) -{ - m_detail = x.m_detail; - m_base_type = x.m_base_type; - - return *this; -} - -CompleteBitsetHeader& CompleteBitsetHeader::operator =( - CompleteBitsetHeader&& x) -{ - m_detail = std::move(x.m_detail); - m_base_type = std::move(x.m_base_type); - - return *this; -} - -size_t CompleteBitsetHeader::getCdrSerializedSize( - const CompleteBitsetHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteBitsetHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteBitsetHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteBitsetHeader::operator ==( - const CompleteBitsetHeader& other) const -{ - return m_base_type == other.m_base_type && - m_detail == other.m_detail; -} - -bool CompleteBitsetHeader::consistent( - const CompleteBitsetHeader& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - return m_detail.consistent(x.m_detail, consistency); - -} - -MinimalBitsetHeader::MinimalBitsetHeader() -{ -} - -MinimalBitsetHeader::~MinimalBitsetHeader() -{ -} - -MinimalBitsetHeader::MinimalBitsetHeader( - const MinimalBitsetHeader& x) -{ - m_base_type = x.m_base_type; -} - -MinimalBitsetHeader::MinimalBitsetHeader( - MinimalBitsetHeader&& x) -{ - m_base_type = std::move(x.m_base_type); -} - -MinimalBitsetHeader& MinimalBitsetHeader::operator =( - const MinimalBitsetHeader& x) -{ - m_base_type = x.m_base_type; - return *this; -} - -MinimalBitsetHeader& MinimalBitsetHeader::operator =( - MinimalBitsetHeader&& x) -{ - m_base_type = std::move(x.m_base_type); - return *this; -} - -size_t MinimalBitsetHeader::getCdrSerializedSize( - const MinimalBitsetHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalBitsetHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalBitsetHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalBitsetHeader::operator ==( - const MinimalBitsetHeader& other) const -{ - return m_base_type == other.m_base_type; -} - -bool MinimalBitsetHeader::consistent( - const MinimalBitsetHeader&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return true; -} - -CompleteBitsetType::CompleteBitsetType() -{ -} - -CompleteBitsetType::~CompleteBitsetType() -{ -} - -CompleteBitsetType::CompleteBitsetType( - const CompleteBitsetType& x) -{ - m_bitset_flags = x.m_bitset_flags; - m_header = x.m_header; - m_field_seq = x.m_field_seq; -} - -CompleteBitsetType::CompleteBitsetType( - CompleteBitsetType&& x) -{ - m_bitset_flags = std::move(x.m_bitset_flags); - m_header = std::move(x.m_header); - m_field_seq = std::move(x.m_field_seq); -} - -CompleteBitsetType& CompleteBitsetType::operator =( - const CompleteBitsetType& x) -{ - m_bitset_flags = x.m_bitset_flags; - m_header = x.m_header; - m_field_seq = x.m_field_seq; - - return *this; -} - -CompleteBitsetType& CompleteBitsetType::operator =( - CompleteBitsetType&& x) -{ - m_bitset_flags = std::move(x.m_bitset_flags); - m_header = std::move(x.m_header); - m_field_seq = std::move(x.m_field_seq); - - return *this; -} - -size_t CompleteBitsetType::getCdrSerializedSize( - const CompleteBitsetType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteBitsetType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteBitsetType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteBitsetType::operator ==( - const CompleteBitsetType& other) const -{ - if (m_bitset_flags == other.m_bitset_flags && - m_header == other.m_header) - { - return compareSequence(m_field_seq, other.m_field_seq); - } - return false; -} - -bool CompleteBitsetType::consistent( - const CompleteBitsetType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_field_seq.size() != x.m_field_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_field_seq.size() <= x.m_field_seq.size()) - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (local_it != m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all fields consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_field_seq.size() <= x.m_field_seq.size()) - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (local_it != m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (remote_it != x.m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All fields consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -MinimalBitsetType::MinimalBitsetType() -{ -} - -MinimalBitsetType::~MinimalBitsetType() -{ -} - -MinimalBitsetType::MinimalBitsetType( - const MinimalBitsetType& x) -{ - m_bitset_flags = x.m_bitset_flags; - m_header = x.m_header; - m_field_seq = x.m_field_seq; -} - -MinimalBitsetType::MinimalBitsetType( - MinimalBitsetType&& x) -{ - m_bitset_flags = std::move(x.m_bitset_flags); - m_header = std::move(x.m_header); - m_field_seq = std::move(x.m_field_seq); -} - -MinimalBitsetType& MinimalBitsetType::operator =( - const MinimalBitsetType& x) -{ - m_bitset_flags = x.m_bitset_flags; - m_header = x.m_header; - m_field_seq = x.m_field_seq; - - return *this; -} - -MinimalBitsetType& MinimalBitsetType::operator =( - MinimalBitsetType&& x) -{ - m_bitset_flags = std::move(x.m_bitset_flags); - m_header = std::move(x.m_header); - m_field_seq = std::move(x.m_field_seq); - - return *this; -} - -size_t MinimalBitsetType::getCdrSerializedSize( - const MinimalBitsetType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalBitsetType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalBitsetType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalBitsetType::operator ==( - const MinimalBitsetType& other) const -{ - if (m_bitset_flags == other.m_bitset_flags && - m_header == other.m_header) - { - return compareSequence(m_field_seq, other.m_field_seq); - } - return false; -} - -bool MinimalBitsetType::consistent( - const MinimalBitsetType& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m_header.consistent(x.m_header, consistency)) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION || consistency.m_prevent_type_widening) - { - if (consistency.m_kind == DISALLOW_TYPE_COERCION - && m_field_seq.size() != x.m_field_seq.size()) - { - return false; // different sizes (coercion disallowed or type widening prevented) - } - - if (m_field_seq.size() <= x.m_field_seq.size()) - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (local_it != m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - return true; // Compatible size, all fields consistent - } - return false; // different sizes (coercion disallowed or type widening prevented) - } - else - { - if (m_field_seq.size() <= x.m_field_seq.size()) - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (local_it != m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - } - else - { - auto local_it = m_field_seq.begin(); - auto remote_it = x.m_field_seq.begin(); - while (remote_it != x.m_field_seq.end()) - { - if (!local_it->consistent(*remote_it, consistency)) - { - return false; // Field inconsistent - } - ++local_it; - ++remote_it; - } - } - return true; // All fields consistent (size doesn't matter) - } - } - return false; // header non consistent - -} - -CompleteExtendedType::CompleteExtendedType() -{ -} - -CompleteExtendedType::~CompleteExtendedType() -{ -} - -CompleteExtendedType::CompleteExtendedType( - const CompleteExtendedType&) -{ -} - -CompleteExtendedType::CompleteExtendedType( - CompleteExtendedType&&) -{ -} - -CompleteExtendedType& CompleteExtendedType::operator =( - const CompleteExtendedType&) -{ - return *this; -} - -CompleteExtendedType& CompleteExtendedType::operator =( - CompleteExtendedType&&) -{ - return *this; -} - -size_t CompleteExtendedType::getCdrSerializedSize( - const CompleteExtendedType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteExtendedType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteExtendedType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteExtendedType::consistent( - const CompleteExtendedType&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return true; -} - -MinimalExtendedType::MinimalExtendedType() -{ -} - -MinimalExtendedType::~MinimalExtendedType() -{ -} - -MinimalExtendedType::MinimalExtendedType( - const MinimalExtendedType&) -{ -} - -MinimalExtendedType::MinimalExtendedType( - MinimalExtendedType&&) -{ -} - -MinimalExtendedType& MinimalExtendedType::operator =( - const MinimalExtendedType&) -{ - return *this; -} - -MinimalExtendedType& MinimalExtendedType::operator =( - MinimalExtendedType&&) -{ - return *this; -} - -size_t MinimalExtendedType::getCdrSerializedSize( - const MinimalExtendedType& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalExtendedType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalExtendedType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalExtendedType::consistent( - const MinimalExtendedType&, - const TypeConsistencyEnforcementQosPolicy&) const -{ - return true; -} - -TypeIdentifierTypeObjectPair::TypeIdentifierTypeObjectPair() -{ -} - -TypeIdentifierTypeObjectPair::~TypeIdentifierTypeObjectPair() -{ -} - -TypeIdentifierTypeObjectPair::TypeIdentifierTypeObjectPair( - const TypeIdentifierTypeObjectPair& x) -{ - m_type_identifier = x.m_type_identifier; - m_type_object = x.m_type_object; -} - -TypeIdentifierTypeObjectPair::TypeIdentifierTypeObjectPair( - TypeIdentifierTypeObjectPair&& x) -{ - m_type_identifier = std::move(x.m_type_identifier); - m_type_object = std::move(x.m_type_object); -} - -TypeIdentifierTypeObjectPair& TypeIdentifierTypeObjectPair::operator =( - const TypeIdentifierTypeObjectPair& x) -{ - m_type_identifier = x.m_type_identifier; - m_type_object = x.m_type_object; - - return *this; -} - -TypeIdentifierTypeObjectPair& TypeIdentifierTypeObjectPair::operator =( - TypeIdentifierTypeObjectPair&& x) -{ - m_type_identifier = std::move(x.m_type_identifier); - m_type_object = std::move(x.m_type_object); - - return *this; -} - -size_t TypeIdentifierTypeObjectPair::getCdrSerializedSize( - const TypeIdentifierTypeObjectPair& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeIdentifierTypeObjectPair::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeIdentifierTypeObjectPair::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeIdentifierPair::TypeIdentifierPair() -{ -} - -TypeIdentifierPair::~TypeIdentifierPair() -{ -} - -TypeIdentifierPair::TypeIdentifierPair( - const TypeIdentifierPair& x) -{ - m_type_identifier1 = x.m_type_identifier1; - m_type_identifier2 = x.m_type_identifier2; -} - -TypeIdentifierPair::TypeIdentifierPair( - TypeIdentifierPair&& x) -{ - m_type_identifier1 = std::move(x.m_type_identifier1); - m_type_identifier2 = std::move(x.m_type_identifier2); -} - -TypeIdentifierPair& TypeIdentifierPair::operator =( - const TypeIdentifierPair& x) -{ - m_type_identifier1 = x.m_type_identifier1; - m_type_identifier2 = x.m_type_identifier2; - - return *this; -} - -TypeIdentifierPair& TypeIdentifierPair::operator =( - TypeIdentifierPair&& x) -{ - m_type_identifier1 = std::move(x.m_type_identifier1); - m_type_identifier2 = std::move(x.m_type_identifier2); - - return *this; -} - -size_t TypeIdentifierPair::getCdrSerializedSize( - const TypeIdentifierPair& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeIdentifierPair::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeIdentifierPair::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeIdentifierWithSize::TypeIdentifierWithSize() -{ - m_typeobject_serialized_size = 0; -} - -TypeIdentifierWithSize::~TypeIdentifierWithSize() -{ -} - -TypeIdentifierWithSize::TypeIdentifierWithSize( - const TypeIdentifierWithSize& x) -{ - m_type_id = x.m_type_id; - m_typeobject_serialized_size = x.m_typeobject_serialized_size; -} - -TypeIdentifierWithSize::TypeIdentifierWithSize( - TypeIdentifierWithSize&& x) -{ - m_type_id = std::move(x.m_type_id); - m_typeobject_serialized_size = std::move(x.m_typeobject_serialized_size); -} - -TypeIdentifierWithSize& TypeIdentifierWithSize::operator =( - const TypeIdentifierWithSize& x) -{ - m_type_id = x.m_type_id; - m_typeobject_serialized_size = x.m_typeobject_serialized_size; - - return *this; -} - -TypeIdentifierWithSize& TypeIdentifierWithSize::operator =( - TypeIdentifierWithSize&& x) -{ - m_type_id = std::move(x.m_type_id); - m_typeobject_serialized_size = std::move(x.m_typeobject_serialized_size); - - return *this; -} - -size_t TypeIdentifierWithSize::getCdrSerializedSize( - const TypeIdentifierWithSize& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeIdentifierWithSize::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeIdentifierWithSize::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeIdentifierWithDependencies::TypeIdentifierWithDependencies() -{ - m_dependent_typeid_count = -1; -} - -TypeIdentifierWithDependencies::~TypeIdentifierWithDependencies() -{ -} - -TypeIdentifierWithDependencies::TypeIdentifierWithDependencies( - const TypeIdentifierWithDependencies& x) -{ - m_typeid_with_size = x.m_typeid_with_size; - m_dependent_typeid_count = x.m_dependent_typeid_count; - m_dependent_typeids = x.m_dependent_typeids; -} - -TypeIdentifierWithDependencies::TypeIdentifierWithDependencies( - TypeIdentifierWithDependencies&& x) -{ - m_typeid_with_size = std::move(x.m_typeid_with_size); - m_dependent_typeid_count = std::move(x.m_dependent_typeid_count); - m_dependent_typeids = std::move(x.m_dependent_typeids); -} - -TypeIdentifierWithDependencies& TypeIdentifierWithDependencies::operator =( - const TypeIdentifierWithDependencies& x) -{ - m_typeid_with_size = x.m_typeid_with_size; - m_dependent_typeid_count = x.m_dependent_typeid_count; - m_dependent_typeids = x.m_dependent_typeids; - - return *this; -} - -TypeIdentifierWithDependencies& TypeIdentifierWithDependencies::operator =( - TypeIdentifierWithDependencies&& x) -{ - m_typeid_with_size = std::move(x.m_typeid_with_size); - m_dependent_typeid_count = std::move(x.m_dependent_typeid_count); - m_dependent_typeids = std::move(x.m_dependent_typeids); - - return *this; -} - -size_t TypeIdentifierWithDependencies::getCdrSerializedSize( - const TypeIdentifierWithDependencies& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeIdentifierWithDependencies::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeIdentifierWithDependencies::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////// - -CompleteTypeObject::CompleteTypeObject() -{ - m__d = 0x00; -} - -CompleteTypeObject::~CompleteTypeObject() -{ -} - -CompleteTypeObject::CompleteTypeObject( - const CompleteTypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } -} - -CompleteTypeObject::CompleteTypeObject( - CompleteTypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } -} - -CompleteTypeObject& CompleteTypeObject::operator =( - const CompleteTypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } - return *this; -} - -CompleteTypeObject& CompleteTypeObject::operator =( - CompleteTypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } - return *this; -} - -void CompleteTypeObject::_d( - octet __d) // Special case to ease... sets the current active member -{ - m__d = __d; - if (m__d != __d) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } -} - -octet CompleteTypeObject::_d() const -{ - return m__d; -} - -octet& CompleteTypeObject::_d() -{ - return m__d; -} - -void CompleteTypeObject::alias_type( - CompleteAliasType _alias_type) -{ - m_alias_type = _alias_type; - m__d = TK_ALIAS; -} - -const CompleteAliasType& CompleteTypeObject::alias_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - return m_alias_type; -} - -CompleteAliasType& CompleteTypeObject::alias_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_alias_type; -} - -void CompleteTypeObject::annotation_type( - CompleteAnnotationType _annotation_type) -{ - m_annotation_type = _annotation_type; - m__d = TK_ANNOTATION; -} - -const CompleteAnnotationType& CompleteTypeObject::annotation_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ANNOTATION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_annotation_type; -} - -CompleteAnnotationType& CompleteTypeObject::annotation_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ANNOTATION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_annotation_type; -} - -void CompleteTypeObject::struct_type( - CompleteStructType _struct_type) -{ - m_struct_type = _struct_type; - m__d = TK_STRUCTURE; -} - -const CompleteStructType& CompleteTypeObject::struct_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_STRUCTURE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_struct_type; -} - -CompleteStructType& CompleteTypeObject::struct_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_STRUCTURE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_struct_type; -} - -void CompleteTypeObject::union_type( - CompleteUnionType _union_type) -{ - m_union_type = _union_type; - m__d = TK_UNION; -} - -const CompleteUnionType& CompleteTypeObject::union_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_UNION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_union_type; -} - -CompleteUnionType& CompleteTypeObject::union_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_UNION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_union_type; -} - -void CompleteTypeObject::bitset_type( - CompleteBitsetType _bitset_type) -{ - m_bitset_type = _bitset_type; - m__d = TK_BITSET; -} - -const CompleteBitsetType& CompleteTypeObject::bitset_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITSET: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitset_type; -} - -CompleteBitsetType& CompleteTypeObject::bitset_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITSET: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitset_type; -} - -void CompleteTypeObject::sequence_type( - CompleteSequenceType _sequence_type) -{ - m_sequence_type = _sequence_type; - m__d = TK_SEQUENCE; -} - -const CompleteSequenceType& CompleteTypeObject::sequence_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_SEQUENCE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_sequence_type; -} - -CompleteSequenceType& CompleteTypeObject::sequence_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_SEQUENCE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_sequence_type; -} - -void CompleteTypeObject::array_type( - CompleteArrayType _array_type) -{ - m_array_type = _array_type; - m__d = TK_ARRAY; -} - -const CompleteArrayType& CompleteTypeObject::array_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ARRAY: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_array_type; -} - -CompleteArrayType& CompleteTypeObject::array_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ARRAY: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_array_type; -} - -void CompleteTypeObject::map_type( - CompleteMapType _map_type) -{ - m_map_type = _map_type; - m__d = TK_MAP; -} - -const CompleteMapType& CompleteTypeObject::map_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_MAP: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_map_type; -} - -CompleteMapType& CompleteTypeObject::map_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_MAP: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_map_type; -} - -void CompleteTypeObject::enumerated_type( - CompleteEnumeratedType _enumerated_type) -{ - m_enumerated_type = _enumerated_type; - m__d = TK_ENUM; -} - -const CompleteEnumeratedType& CompleteTypeObject::enumerated_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_enumerated_type; -} - -CompleteEnumeratedType& CompleteTypeObject::enumerated_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_enumerated_type; -} - -void CompleteTypeObject::bitmask_type( - CompleteBitmaskType _bitmask_type) -{ - m_bitmask_type = _bitmask_type; - m__d = TK_BITMASK; -} - -const CompleteBitmaskType& CompleteTypeObject::bitmask_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITMASK: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitmask_type; -} - -CompleteBitmaskType& CompleteTypeObject::bitmask_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITMASK: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitmask_type; -} - -void CompleteTypeObject::extended_type( - CompleteExtendedType _extended_type) -{ - m_extended_type = _extended_type; - m__d = 0x00; // Default -} - -const CompleteExtendedType& CompleteTypeObject::extended_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - case eprosima::fastrtps::types::TK_ANNOTATION: - case eprosima::fastrtps::types::TK_STRUCTURE: - case eprosima::fastrtps::types::TK_UNION: - case eprosima::fastrtps::types::TK_BITSET: - case eprosima::fastrtps::types::TK_SEQUENCE: - case eprosima::fastrtps::types::TK_ARRAY: - case eprosima::fastrtps::types::TK_MAP: - case eprosima::fastrtps::types::TK_ENUM: - case eprosima::fastrtps::types::TK_BITMASK: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_extended_type; -} - -CompleteExtendedType& CompleteTypeObject::extended_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - case eprosima::fastrtps::types::TK_ANNOTATION: - case eprosima::fastrtps::types::TK_STRUCTURE: - case eprosima::fastrtps::types::TK_UNION: - case eprosima::fastrtps::types::TK_BITSET: - case eprosima::fastrtps::types::TK_SEQUENCE: - case eprosima::fastrtps::types::TK_ARRAY: - case eprosima::fastrtps::types::TK_MAP: - case eprosima::fastrtps::types::TK_ENUM: - case eprosima::fastrtps::types::TK_BITMASK: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_extended_type; -} - -size_t CompleteTypeObject::getCdrSerializedSize( - const CompleteTypeObject& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void CompleteTypeObject::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void CompleteTypeObject::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool CompleteTypeObject::operator ==( - const CompleteTypeObject& other) const -{ - if (m__d == other.m__d) - { - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - return m_alias_type == other.m_alias_type; - case eprosima::fastrtps::types::TK_ANNOTATION: - return m_annotation_type == other.m_annotation_type; - case eprosima::fastrtps::types::TK_STRUCTURE: - return m_struct_type == other.m_struct_type; - case eprosima::fastrtps::types::TK_UNION: - return m_union_type == other.m_union_type; - case eprosima::fastrtps::types::TK_BITSET: - return m_bitset_type == other.m_bitset_type; - case eprosima::fastrtps::types::TK_SEQUENCE: - return m_sequence_type == other.m_sequence_type; - case eprosima::fastrtps::types::TK_ARRAY: - return m_array_type == other.m_array_type; - case eprosima::fastrtps::types::TK_MAP: - return m_map_type == other.m_map_type; - case eprosima::fastrtps::types::TK_ENUM: - return m_enumerated_type == other.m_enumerated_type; - case eprosima::fastrtps::types::TK_BITMASK: - return m_bitmask_type == other.m_bitmask_type; - default: - return m_extended_type == other.m_extended_type; - } - } - return false; -} - -bool CompleteTypeObject::consistent( - const CompleteTypeObject& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - // Resolve aliases - if (m__d == TK_ALIAS) - { - const TypeIdentifier& aliasedId = m_alias_type.body().common().related_type(); - const TypeObject* aliasedObj = TypeObjectFactory::get_instance()->get_type_object(&aliasedId); - if (aliasedObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Local type is aliased to an unkown TypeObject"); - return false; - } - return aliasedObj->complete().consistent(x, consistency); - } - - if (x.m__d == TK_ALIAS) - { - const TypeIdentifier& aliasedId = x.m_alias_type.body().common().related_type(); - const TypeObject* aliasedObj = TypeObjectFactory::get_instance()->get_type_object(&aliasedId); - if (aliasedObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Remote type is aliased to an unkown TypeObject"); - return false; - } - return this->consistent(aliasedObj->complete(), consistency); - } - - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - //case eprosima::fastrtps::types::TK_ALIAS: - // return m_alias_type.consistent(x.m_alias_type, consistency); - case eprosima::fastrtps::types::TK_ANNOTATION: - return m_annotation_type.consistent(x.m_annotation_type, consistency); - case eprosima::fastrtps::types::TK_STRUCTURE: - return m_struct_type.consistent(x.m_struct_type, consistency); - case eprosima::fastrtps::types::TK_UNION: - return m_union_type.consistent(x.m_union_type, consistency); - case eprosima::fastrtps::types::TK_BITSET: - return m_bitset_type.consistent(x.m_bitset_type, consistency); - case eprosima::fastrtps::types::TK_SEQUENCE: - return m_sequence_type.consistent(x.m_sequence_type, consistency); - case eprosima::fastrtps::types::TK_ARRAY: - return m_array_type.consistent(x.m_array_type, consistency); - case eprosima::fastrtps::types::TK_MAP: - return m_map_type.consistent(x.m_map_type, consistency); - case eprosima::fastrtps::types::TK_ENUM: - return m_enumerated_type.consistent(x.m_enumerated_type, consistency); - case eprosima::fastrtps::types::TK_BITMASK: - return m_bitmask_type.consistent(x.m_bitmask_type, consistency); - default: - return m_extended_type.consistent(x.m_extended_type, consistency); - } - -} - -/****************************************************************************************************************/ - -MinimalTypeObject::MinimalTypeObject() -{ - m__d = 0x00; -} - -MinimalTypeObject::~MinimalTypeObject() -{ -} - -MinimalTypeObject::MinimalTypeObject( - const MinimalTypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } -} - -MinimalTypeObject::MinimalTypeObject( - MinimalTypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } -} - -MinimalTypeObject& MinimalTypeObject::operator =( - const MinimalTypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } - return *this; -} - -MinimalTypeObject& MinimalTypeObject::operator =( - MinimalTypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - m_alias_type = x.m_alias_type; - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - m_annotation_type = x.m_annotation_type; - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - m_struct_type = x.m_struct_type; - break; - case eprosima::fastrtps::types::TK_UNION: - m_union_type = x.m_union_type; - break; - case eprosima::fastrtps::types::TK_BITSET: - m_bitset_type = x.m_bitset_type; - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - m_sequence_type = x.m_sequence_type; - break; - case eprosima::fastrtps::types::TK_ARRAY: - m_array_type = x.m_array_type; - break; - case eprosima::fastrtps::types::TK_MAP: - m_map_type = x.m_map_type; - break; - case eprosima::fastrtps::types::TK_ENUM: - m_enumerated_type = x.m_enumerated_type; - break; - case eprosima::fastrtps::types::TK_BITMASK: - m_bitmask_type = x.m_bitmask_type; - break; - default: - m_extended_type = x.m_extended_type; - break; - } - return *this; -} - -void MinimalTypeObject::_d( - octet __d) // Special case to ease... sets the current active member -{ - m__d = __d; - if (m__d != __d) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } -} - -octet MinimalTypeObject::_d() const -{ - return m__d; -} - -octet& MinimalTypeObject::_d() -{ - return m__d; -} - -void MinimalTypeObject::alias_type( - MinimalAliasType _alias_type) -{ - m_alias_type = _alias_type; - m__d = TK_ALIAS; -} - -const MinimalAliasType& MinimalTypeObject::alias_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_alias_type; -} - -MinimalAliasType& MinimalTypeObject::alias_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_alias_type; -} - -void MinimalTypeObject::annotation_type( - MinimalAnnotationType _annotation_type) -{ - m_annotation_type = _annotation_type; - m__d = TK_ANNOTATION; -} - -const MinimalAnnotationType& MinimalTypeObject::annotation_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ANNOTATION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_annotation_type; -} - -MinimalAnnotationType& MinimalTypeObject::annotation_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ANNOTATION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_annotation_type; -} - -void MinimalTypeObject::struct_type( - MinimalStructType _struct_type) -{ - m_struct_type = _struct_type; - m__d = TK_STRUCTURE; -} - -const MinimalStructType& MinimalTypeObject::struct_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_STRUCTURE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_struct_type; -} - -MinimalStructType& MinimalTypeObject::struct_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_STRUCTURE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_struct_type; -} - -void MinimalTypeObject::union_type( - MinimalUnionType _union_type) -{ - m_union_type = _union_type; - m__d = TK_UNION; -} - -const MinimalUnionType& MinimalTypeObject::union_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_UNION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_union_type; -} - -MinimalUnionType& MinimalTypeObject::union_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_UNION: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_union_type; -} - -void MinimalTypeObject::bitset_type( - MinimalBitsetType _bitset_type) -{ - m_bitset_type = _bitset_type; - m__d = TK_BITSET; -} - -const MinimalBitsetType& MinimalTypeObject::bitset_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITSET: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitset_type; -} - -MinimalBitsetType& MinimalTypeObject::bitset_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITSET: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitset_type; -} - -void MinimalTypeObject::sequence_type( - MinimalSequenceType _sequence_type) -{ - m_sequence_type = _sequence_type; - m__d = TK_SEQUENCE; -} - -const MinimalSequenceType& MinimalTypeObject::sequence_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_SEQUENCE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_sequence_type; -} - -MinimalSequenceType& MinimalTypeObject::sequence_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_SEQUENCE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_sequence_type; -} - -void MinimalTypeObject::array_type( - MinimalArrayType _array_type) -{ - m_array_type = _array_type; - m__d = TK_ARRAY; -} - -const MinimalArrayType& MinimalTypeObject::array_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ARRAY: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_array_type; -} - -MinimalArrayType& MinimalTypeObject::array_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ARRAY: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_array_type; -} - -void MinimalTypeObject::map_type( - MinimalMapType _map_type) -{ - m_map_type = _map_type; - m__d = TK_MAP; -} - -const MinimalMapType& MinimalTypeObject::map_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_MAP: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_map_type; -} - -MinimalMapType& MinimalTypeObject::map_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_MAP: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_map_type; -} - -void MinimalTypeObject::enumerated_type( - MinimalEnumeratedType _enumerated_type) -{ - m_enumerated_type = _enumerated_type; - m__d = TK_ENUM; -} - -const MinimalEnumeratedType& MinimalTypeObject::enumerated_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_enumerated_type; -} - -MinimalEnumeratedType& MinimalTypeObject::enumerated_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ENUM: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_enumerated_type; -} - -void MinimalTypeObject::bitmask_type( - MinimalBitmaskType _bitmask_type) -{ - m_bitmask_type = _bitmask_type; - m__d = TK_BITMASK; -} - -const MinimalBitmaskType& MinimalTypeObject::bitmask_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITMASK: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitmask_type; -} - -MinimalBitmaskType& MinimalTypeObject::bitmask_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_BITMASK: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_bitmask_type; -} - -void MinimalTypeObject::extended_type( - MinimalExtendedType _extended_type) -{ - m_extended_type = _extended_type; - m__d = 0x00; // Default -} - -const MinimalExtendedType& MinimalTypeObject::extended_type() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - case eprosima::fastrtps::types::TK_ANNOTATION: - case eprosima::fastrtps::types::TK_STRUCTURE: - case eprosima::fastrtps::types::TK_UNION: - case eprosima::fastrtps::types::TK_BITSET: - case eprosima::fastrtps::types::TK_SEQUENCE: - case eprosima::fastrtps::types::TK_ARRAY: - case eprosima::fastrtps::types::TK_MAP: - case eprosima::fastrtps::types::TK_ENUM: - case eprosima::fastrtps::types::TK_BITMASK: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_extended_type; -} - -MinimalExtendedType& MinimalTypeObject::extended_type() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - case eprosima::fastrtps::types::TK_ANNOTATION: - case eprosima::fastrtps::types::TK_STRUCTURE: - case eprosima::fastrtps::types::TK_UNION: - case eprosima::fastrtps::types::TK_BITSET: - case eprosima::fastrtps::types::TK_SEQUENCE: - case eprosima::fastrtps::types::TK_ARRAY: - case eprosima::fastrtps::types::TK_MAP: - case eprosima::fastrtps::types::TK_ENUM: - case eprosima::fastrtps::types::TK_BITMASK: - break; - default: - b = true; - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_extended_type; -} - -size_t MinimalTypeObject::getCdrSerializedSize( - const MinimalTypeObject& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void MinimalTypeObject::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void MinimalTypeObject::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool MinimalTypeObject::operator ==( - const MinimalTypeObject& other) const -{ - if (m__d == other.m__d) - { - switch (m__d) - { - case eprosima::fastrtps::types::TK_ALIAS: - return m_alias_type == other.m_alias_type; - case eprosima::fastrtps::types::TK_ANNOTATION: - return m_annotation_type == other.m_annotation_type; - case eprosima::fastrtps::types::TK_STRUCTURE: - return m_struct_type == other.m_struct_type; - case eprosima::fastrtps::types::TK_UNION: - return m_union_type == other.m_union_type; - case eprosima::fastrtps::types::TK_BITSET: - return m_bitset_type == other.m_bitset_type; - case eprosima::fastrtps::types::TK_SEQUENCE: - return m_sequence_type == other.m_sequence_type; - case eprosima::fastrtps::types::TK_ARRAY: - return m_array_type == other.m_array_type; - case eprosima::fastrtps::types::TK_MAP: - return m_map_type == other.m_map_type; - case eprosima::fastrtps::types::TK_ENUM: - return m_enumerated_type == other.m_enumerated_type; - case eprosima::fastrtps::types::TK_BITMASK: - return m_bitmask_type == other.m_bitmask_type; - default: - return m_extended_type == other.m_extended_type; - } - } - return false; -} - -bool MinimalTypeObject::consistent( - const MinimalTypeObject& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - // Resolve aliases - if (m__d == TK_ALIAS) - { - const TypeIdentifier& aliasedId = m_alias_type.body().common().related_type(); - const TypeObject* aliasedObj = TypeObjectFactory::get_instance()->get_type_object(&aliasedId); - if (aliasedObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Local type is aliased to an unkown TypeObject"); - return false; - } - return aliasedObj->minimal().consistent(x, consistency); - } - - if (x.m__d == TK_ALIAS) - { - const TypeIdentifier& aliasedId = x.m_alias_type.body().common().related_type(); - const TypeObject* aliasedObj = TypeObjectFactory::get_instance()->get_type_object(&aliasedId); - if (aliasedObj == nullptr) - { - EPROSIMA_LOG_WARNING(XTYPES, "Remote type is aliased to an unkown TypeObject"); - return false; - } - return this->consistent(aliasedObj->minimal(), consistency); - } - - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - //case eprosima::fastrtps::types::TK_ALIAS: - // return m_alias_type.consistent(x.m_alias_type, consistency); - case eprosima::fastrtps::types::TK_ANNOTATION: - return m_annotation_type.consistent(x.m_annotation_type, consistency); - case eprosima::fastrtps::types::TK_STRUCTURE: - return m_struct_type.consistent(x.m_struct_type, consistency); - case eprosima::fastrtps::types::TK_UNION: - return m_union_type.consistent(x.m_union_type, consistency); - case eprosima::fastrtps::types::TK_BITSET: - return m_bitset_type.consistent(x.m_bitset_type, consistency); - case eprosima::fastrtps::types::TK_SEQUENCE: - return m_sequence_type.consistent(x.m_sequence_type, consistency); - case eprosima::fastrtps::types::TK_ARRAY: - return m_array_type.consistent(x.m_array_type, consistency); - case eprosima::fastrtps::types::TK_MAP: - return m_map_type.consistent(x.m_map_type, consistency); - case eprosima::fastrtps::types::TK_ENUM: - return m_enumerated_type.consistent(x.m_enumerated_type, consistency); - case eprosima::fastrtps::types::TK_BITMASK: - return m_bitmask_type.consistent(x.m_bitmask_type, consistency); - default: - return m_extended_type.consistent(x.m_extended_type, consistency); - } - -} - -TypeObject::TypeObject() -{ - m__d = 0x00; // Default -} - -TypeObject::~TypeObject() -{ -} - -TypeObject::TypeObject( - const TypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - m_complete = x.m_complete; - break; - case eprosima::fastrtps::types::EK_MINIMAL: - m_minimal = x.m_minimal; - break; - default: - break; - } -} - -TypeObject::TypeObject( - TypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - m_complete = std::move(x.m_complete); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - m_minimal = std::move(x.m_minimal); - break; - default: - break; - } -} - -TypeObject& TypeObject::operator =( - const TypeObject& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - m_complete = x.m_complete; - break; - case eprosima::fastrtps::types::EK_MINIMAL: - m_minimal = x.m_minimal; - break; - default: - break; - } - - return *this; -} - -TypeObject& TypeObject::operator =( - TypeObject&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - m_complete = std::move(x.m_complete); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - m_minimal = std::move(x.m_minimal); - break; - default: - break; - } - - return *this; -} - -void TypeObject::_d( - uint8_t __d) // Special case to ease... sets the current active member -{ - bool b = false; - m__d = __d; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - switch (__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - b = true; - break; - default: - break; - } - break; - case eprosima::fastrtps::types::EK_MINIMAL: - switch (__d) - { - case eprosima::fastrtps::types::EK_MINIMAL: - b = true; - break; - default: - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t TypeObject::_d() const -{ - return m__d; -} - -uint8_t& TypeObject::_d() -{ - return m__d; -} - -void TypeObject::complete( - const CompleteTypeObject& _complete) -{ - m_complete = _complete; - m__d = EK_COMPLETE; -} - -void TypeObject::complete( - CompleteTypeObject&& _complete) -{ - m_complete = std::move(_complete); - m__d = EK_COMPLETE; -} - -const CompleteTypeObject& TypeObject::complete() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_complete; -} - -CompleteTypeObject& TypeObject::complete() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_complete; -} - -void TypeObject::minimal( - const MinimalTypeObject& _minimal) -{ - m_minimal = _minimal; - m__d = EK_MINIMAL; -} - -void TypeObject::minimal( - MinimalTypeObject&& _minimal) -{ - m_minimal = std::move(_minimal); - m__d = EK_MINIMAL; -} - -bool TypeObject::consistent( - const TypeObject& x, - const TypeConsistencyEnforcementQosPolicy& consistency) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - return m_complete.consistent(x.m_complete, consistency); - case eprosima::fastrtps::types::EK_MINIMAL: - return m_minimal.consistent(x.m_minimal, consistency); - default: - return false; - } - - - // if (consistency.m_kind == DISALLOW_TYPE_COERCION) - // { - // - // } - // else - // { - // - // } -} - -const MinimalTypeObject& TypeObject::minimal() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_minimal; -} - -MinimalTypeObject& TypeObject::minimal() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastrtps::types::EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member hasn't been selected"); - } - - - return m_minimal; -} - -size_t TypeObject::getCdrSerializedSize( - const TypeObject& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeObject::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeObject::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -bool TypeObject::operator ==( - const TypeObject& other) const -{ - if (m__d == other.m__d) - { - switch (m__d) - { - case eprosima::fastrtps::types::EK_COMPLETE: - return m_complete == other.m_complete; - case eprosima::fastrtps::types::EK_MINIMAL: - return m_minimal == other.m_minimal; - default: - break; - } - } - return false; -} - -TypeInformation::TypeInformation() -{ -} - -TypeInformation::~TypeInformation() -{ -} - -TypeInformation::TypeInformation( - const TypeInformation& x) -{ - m_minimal = x.m_minimal; - m_complete = x.m_complete; -} - -TypeInformation::TypeInformation( - TypeInformation&& x) -{ - m_minimal = std::move(x.m_minimal); - m_complete = std::move(x.m_complete); -} - -TypeInformation& TypeInformation::operator =( - const TypeInformation& x) -{ - m_minimal = x.m_minimal; - m_complete = x.m_complete; - - return *this; -} - -TypeInformation& TypeInformation::operator =( - TypeInformation&& x) -{ - m_minimal = std::move(x.m_minimal); - m_complete = std::move(x.m_complete); - - return *this; -} - -size_t TypeInformation::getCdrSerializedSize( - const TypeInformation& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeInformation::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeInformation::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -OctetSeq& operator ++( - OctetSeq& s) -{ - if (s.empty()) - { - // If empty, adds a new octet with value 1. - s.push_back(1); - } - else - { - // If not empty, iterate... - for (size_t i = 0; i < s.size(); ++i) - { - octet& o = s[i]; - if (o < 255) - { - // ...until find an octet lesser than 255, then increment it. - ++o; - break; - } - else - { - // ...while value 255 found, - if (i < s.size() - 1) - { - // if not the last octet, reset to 0. - o = 0; - } - - if (i == s.size() - 1) - { - // once last octet reached being all previos octets 255, - if (s.size() < 32) - { - // if not maximum sequence size reached, add a new octet with value 1. - s.push_back(1); - break; - } - else - { - // if no more space available, set every octet to 0 (the only way to detect this situation). - for (octet& oc : s) - { - oc = 0; - } - break; - } - } - } - } - } - return s; -} - -OctetSeq operator ++( - OctetSeq& s, - int) -{ - OctetSeq r = s; - ++s; - return r; -} - -size_t to_size_t( - const OctetSeq& s) -{ - if (s.size() > 4) - { - // If doesn't fit in a size_t, return size_t::max - size_t aux = 0; - for (size_t i = 3; i < s.size(); ++i) - { - aux += s[i]; - } - if (aux > 0) - { - return std::numeric_limits::max(); - } - } - - size_t result = 0; - - // result = s[0] + (s[1] * 255) + (s[2] * 255Β²) + (s[3] * 255Β³); - for (size_t i = 0; i < s.size() && i < 4; ++i) - { - result += (static_cast(std::pow(255, i)) * s[i]); - } - - return result; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp b/src/cpp/dynamic-types/TypeObjectCdrAux.ipp deleted file mode 100644 index 7d765faa064..00000000000 --- a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp +++ /dev/null @@ -1,5012 +0,0 @@ -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DYNAMIC_TYPES_TYPEOBJECTCDRAUX_IPP -#define DYNAMIC_TYPES_TYPEOBJECTCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonStructMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.member_type_id(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_type_id(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonStructMember& data) -{ - scdr << data.member_id(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.member_type_id(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonStructMember& data) -{ - dcdr >> data.member_id(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.member_type_id(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteMemberDetail& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteMemberDetail& data) -{ - scdr << data.name(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteMemberDetail& data) -{ - dcdr >> data.name(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalMemberDetail& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.name_hash(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalMemberDetail& data) -{ - scdr << data.name_hash(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalMemberDetail& data) -{ - dcdr >> data.name_hash(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.verbatim(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.verbatim(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) -{ - scdr << data.verbatim(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data) -{ - dcdr >> data.verbatim(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalTypeDetail&, - size_t&) -{ - return 0; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalTypeDetail&) -{ -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalTypeDetail&) -{ -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteTypeDetail& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type_name().size() + 1; - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_custom(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.type_name(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteTypeDetail& data) -{ - scdr << data.ann_builtin(); - scdr << data.ann_custom(); - scdr << data.type_name(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteTypeDetail& data) -{ - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); - dcdr >> data.type_name(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteStructType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.struct_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.struct_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteStructType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.struct_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteStructType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.struct_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.struct_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalStructType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.struct_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.struct_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalStructType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.struct_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalStructType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.struct_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.struct_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonUnionMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.type_id(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.label_seq().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.type_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.label_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonUnionMember& data) -{ - scdr << data.member_id(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type_id(); - scdr << data.label_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonUnionMember& data) -{ - dcdr >> data.member_id(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type_id(); - dcdr >> data.label_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionMember& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionMember& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonDiscriminatorMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.type_id(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type_id(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonDiscriminatorMember& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type_id(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonDiscriminatorMember& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type_id(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteDiscriminatorMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteDiscriminatorMember& data) -{ - scdr << data.common(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteDiscriminatorMember& data) -{ - dcdr >> data.common(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalDiscriminatorMember& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalDiscriminatorMember& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalDiscriminatorMember& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionHeader& data) -{ - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionHeader& data) -{ - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionHeader& data) -{ - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionHeader& data) -{ - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteUnionType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.union_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.discriminator(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.union_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.discriminator(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteUnionType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.union_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.discriminator(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteUnionType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.union_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.union_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.discriminator(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalUnionType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.union_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.discriminator(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.union_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.discriminator(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalUnionType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.union_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.discriminator(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalUnionType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.union_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.union_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.discriminator(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonAnnotationParameter& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.member_flags(), current_alignment); - calculate_serialized_size(calculator, data.member_type_id(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.member_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.member_type_id(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonAnnotationParameter& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.member_type_id(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonAnnotationParameter& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.member_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.member_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.member_type_id(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationParameter& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.default_value(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.default_value(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationParameter& data) -{ - scdr << data.common(); - scdr << data.name(); - scdr << data.default_value(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationParameter& data) -{ - dcdr >> data.common(); - dcdr >> data.name(); - dcdr >> data.default_value(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAnnotationParameter& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; - calculate_serialized_size(calculator, data.default_value(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.default_value(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAnnotationParameter& data) -{ - scdr << data.common(); - scdr << data.name(); - scdr << data.default_value(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAnnotationParameter& data) -{ - dcdr >> data.common(); - dcdr >> data.name(); - dcdr >> data.default_value(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 4 + - eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.annotation_name().size() + 1; - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_name(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationHeader& data) -{ - scdr << data.annotation_name(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationHeader& data) -{ - dcdr >> data.annotation_name(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalAnnotationHeader&, - size_t&) -{ - return 0; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalAnnotationHeader&) -{ -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalAnnotationHeader&) -{ -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAnnotationType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at( - a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAnnotationType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.annotation_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAnnotationType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.annotation_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.annotation_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAnnotationType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.member_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.member_seq().at(a), - current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.annotation_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.member_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAnnotationType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.annotation_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.member_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAnnotationType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.annotation_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.annotation_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.member_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonAliasBody& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.related_flags(), current_alignment); - calculate_serialized_size(calculator, data.related_type(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.related_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.related_type(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonAliasBody& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.related_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.related_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.related_type(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonAliasBody& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.related_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.related_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.related_type(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasBody& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.ann_custom(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasBody& data) -{ - scdr << data.common(); - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasBody& data) -{ - dcdr >> data.common(); - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAliasBody& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAliasBody& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAliasBody& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasHeader& data) -{ - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasHeader& data) -{ - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalAliasHeader&, - size_t&) -{ - return 0; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalAliasHeader&) -{ -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalAliasHeader&) -{ -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteAliasType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.alias_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.body(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.alias_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.body(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteAliasType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.alias_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.body(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteAliasType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.alias_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.alias_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.body(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalAliasType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.alias_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.body(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.alias_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.body(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalAliasType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.alias_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.body(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalAliasType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.alias_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.alias_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.body(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteElementDetail& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.ann_custom().size(); ++a) - { - calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.ann_builtin(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.ann_custom(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteElementDetail& data) -{ - scdr << data.ann_builtin(); - scdr << data.ann_custom(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteElementDetail& data) -{ - dcdr >> data.ann_builtin(); - dcdr >> data.ann_custom(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonCollectionElement& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.element_flags(), current_alignment); - calculate_serialized_size(calculator, data.type(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.element_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonCollectionElement& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.element_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.element_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.type(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonCollectionElement& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.element_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.element_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.type(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteCollectionElement& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteCollectionElement& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteCollectionElement& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalCollectionElement& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalCollectionElement& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalCollectionElement& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonCollectionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; - - return current_alignment - initial_alignment; -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonCollectionHeader& data) -{ - scdr << data.bound(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonCollectionHeader& data) -{ - dcdr >> data.bound(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteCollectionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteCollectionHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteCollectionHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalCollectionHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalCollectionHeader& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalCollectionHeader& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalSequenceType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; - // SEQUENCE - /* - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.param_seq().size(); ++a) - { - current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); - } - */ - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteSequenceType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteSequenceType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteSequenceType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; - // SEQUENCE - /* - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for(size_t a = 0; a < data.param_seq().size(); ++a) - { - current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); - } - */ - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalSequenceType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalSequenceType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonArrayHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.bound_seq().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bound_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonArrayHeader& data) -{ - scdr << data.bound_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonArrayHeader& data) -{ - dcdr >> data.bound_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteArrayHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteArrayHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteArrayHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalArrayHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalArrayHeader& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalArrayHeader& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteArrayType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteArrayType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteArrayType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalArrayType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalArrayType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalArrayType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteMapType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.key(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.key(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteMapType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.key(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteMapType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.key(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalMapType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.collection_flag(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - calculate_serialized_size(calculator, data.key(), current_alignment); - calculate_serialized_size(calculator, data.element(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.collection_flag(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.key(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.element(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalMapType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.key(); - scdr << data.element(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalMapType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.collection_flag().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.collection_flag(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.key(); - dcdr >> data.element(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonEnumeratedLiteral& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - calculate_serialized_size(calculator, data.flags(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.value(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonEnumeratedLiteral& data) -{ - scdr << data.value(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonEnumeratedLiteral& data) -{ - dcdr >> data.value(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedLiteral& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedLiteral& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonEnumeratedHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bit_bound(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonEnumeratedHeader& data) -{ - scdr << data.bit_bound(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonEnumeratedHeader& data) -{ - dcdr >> data.bit_bound(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedHeader& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedHeader& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedHeader& data) -{ - scdr << data.common(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedHeader& data) -{ - dcdr >> data.common(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteEnumeratedType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.enum_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.literal_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.literal_seq().at(a), - current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.enum_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.literal_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteEnumeratedType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.enum_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.literal_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteEnumeratedType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.enum_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.enum_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.literal_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalEnumeratedType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.enum_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.literal_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.literal_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.enum_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.literal_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalEnumeratedType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.enum_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.literal_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalEnumeratedType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.enum_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.enum_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.literal_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitflag& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - calculate_serialized_size(calculator, data.flags(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.position(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitflag& data) -{ - scdr << data.position(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitflag& data) -{ - dcdr >> data.position(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitflag& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitflag& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitflag& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitflag& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitflag& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitflag& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitmaskHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - static_cast(data); - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bit_bound(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitmaskHeader& data) -{ - scdr << data.bit_bound(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitmaskHeader& data) -{ - dcdr >> data.bit_bound(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitmaskType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.flag_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitmask_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.flag_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitmaskType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.bitmask_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.flag_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitmaskType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitmask_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.bitmask_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.flag_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitmaskType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.flag_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitmask_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.flag_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitmaskType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.bitmask_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.flag_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitmaskType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitmask_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.bitmask_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.flag_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CommonBitfield& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - calculate_serialized_size(calculator, data.flags(), current_alignment); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.position(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.bitcount(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.holder_type(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CommonBitfield& data) -{ - scdr << data.position(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.bitcount(); - scdr << data.holder_type(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CommonBitfield& data) -{ - dcdr >> data.position(); -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.bitcount(); - dcdr >> data.holder_type(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitfield& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.detail(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitfield& data) -{ - scdr << data.common(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitfield& data) -{ - dcdr >> data.common(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitfield& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.common(), current_alignment); - current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.common(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.name_hash(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitfield& data) -{ - scdr << data.common(); - scdr << data.name_hash(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitfield& data) -{ - dcdr >> data.common(); - dcdr >> data.name_hash(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitsetHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.base_type(), current_alignment); - calculate_serialized_size(calculator, data.detail(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.detail(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitsetHeader& data) -{ - scdr << data.base_type(); - scdr << data.detail(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitsetHeader& data) -{ - dcdr >> data.base_type(); - dcdr >> data.detail(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitsetHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.base_type(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.base_type(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitsetHeader& data) -{ - scdr << data.base_type(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitsetHeader& data) -{ - dcdr >> data.base_type(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteBitsetType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.field_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitset_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.field_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.field_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitset_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.field_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalBitsetType& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); - calculate_serialized_size(calculator, data.header(), current_alignment); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.field_seq().size(); ++a) - { - calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.bitset_flags(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.header(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.field_seq(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); - scdr << bits; -#else - scdr << data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - scdr << data.header(); - scdr << data.field_seq(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalBitsetType& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - dcdr >> bits; - data.bitset_flags().bitset(std::bitset<16>(bits)); -#else - dcdr >> data.bitset_flags(); -#endif // FASTCDR_VERSION_MAJOR == 1 - dcdr >> data.header(); - dcdr >> data.field_seq(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::CompleteExtendedType&, - size_t&) -{ - return 0; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::CompleteExtendedType&) -{ -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::CompleteExtendedType&) -{ -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MinimalExtendedType&, - size_t&) -{ - return 0; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr&, - const eprosima::fastrtps::types::MinimalExtendedType&) -{ -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr&, - eprosima::fastrtps::types::MinimalExtendedType&) -{ -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteTypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculate_serialized_size(calculator, data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculate_serialized_size(calculator, data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculate_serialized_size(calculator, data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculate_serialized_size(calculator, data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculate_serialized_size(calculator, data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculate_serialized_size(calculator, data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculate_serialized_size(calculator, data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculate_serialized_size(calculator, data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); - break; - default: - calculate_serialized_size(calculator, data.extended_type(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 10), data.bitmask_type(), current_alignment); - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.extended_type(), current_alignment); - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::CompleteTypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - scdr << data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - scdr << data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - scdr << data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - scdr << data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - scdr << data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - scdr << data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - scdr << data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - scdr << data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - scdr << data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - scdr << data.bitmask_type(); - break; - default: - scdr << data.extended_type(); - break; - } -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::CompleteTypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - dcdr >> data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - dcdr >> data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - dcdr >> data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - dcdr >> data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - dcdr >> data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - dcdr >> data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - dcdr >> data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - dcdr >> data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - dcdr >> data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - dcdr >> data.bitmask_type(); - break; - default: - dcdr >> data.extended_type(); - break; - } -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::MinimalTypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculate_serialized_size(calculator, data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculate_serialized_size(calculator, data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculate_serialized_size(calculator, data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculate_serialized_size(calculator, data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculate_serialized_size(calculator, data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculate_serialized_size(calculator, data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculate_serialized_size(calculator, data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculate_serialized_size(calculator, data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); - break; - default: - calculate_serialized_size(calculator, data.extended_type(), current_alignment); - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.alias_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.annotation_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 3), data.struct_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_UNION: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 4), data.union_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITSET: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 5), data.bitset_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 6), data.sequence_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ARRAY: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 7), data.array_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_MAP: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 8), data.map_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_ENUM: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 9), data.enumerated_type(), current_alignment); - break; - case eprosima::fastrtps::types::TK_BITMASK: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 10), data.bitmask_type(), current_alignment); - break; - default: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 11), data.extended_type(), current_alignment); - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::MinimalTypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - scdr << data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - scdr << data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - scdr << data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - scdr << data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - scdr << data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - scdr << data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - scdr << data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - scdr << data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - scdr << data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - scdr << data.bitmask_type(); - break; - default: - scdr << data.extended_type(); - break; - } -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::MinimalTypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::TK_ALIAS: - dcdr >> data.alias_type(); - break; - case eprosima::fastrtps::types::TK_ANNOTATION: - dcdr >> data.annotation_type(); - break; - case eprosima::fastrtps::types::TK_STRUCTURE: - dcdr >> data.struct_type(); - break; - case eprosima::fastrtps::types::TK_UNION: - dcdr >> data.union_type(); - break; - case eprosima::fastrtps::types::TK_BITSET: - dcdr >> data.bitset_type(); - break; - case eprosima::fastrtps::types::TK_SEQUENCE: - dcdr >> data.sequence_type(); - break; - case eprosima::fastrtps::types::TK_ARRAY: - dcdr >> data.array_type(); - break; - case eprosima::fastrtps::types::TK_MAP: - dcdr >> data.map_type(); - break; - case eprosima::fastrtps::types::TK_ENUM: - dcdr >> data.enumerated_type(); - break; - case eprosima::fastrtps::types::TK_BITMASK: - dcdr >> data.bitmask_type(); - break; - default: - dcdr >> data.extended_type(); - break; - } -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeObject& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - calculate_serialized_size(calculator, data.complete(), current_alignment); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - calculate_serialized_size(calculator, data.minimal(), current_alignment); - break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete(), current_alignment); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.minimal(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeObject& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - scdr << data.complete(); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - scdr << data.minimal(); - break; - default: - break; - } -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeObject& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - dcdr >> data.complete(); - break; - case eprosima::fastrtps::types::EK_MINIMAL: - dcdr >> data.minimal(); - break; - default: - break; - } -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.type_identifier(), current_alignment); - calculate_serialized_size(calculator, data.type_object(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_object(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - scdr << data.type_identifier(); - scdr << data.type_object(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - dcdr >> data.type_identifier(); - dcdr >> data.type_object(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierPair& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.type_identifier1(), current_alignment); - calculate_serialized_size(calculator, data.type_identifier2(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier1(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type_identifier2(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - scdr << data.type_identifier1(); - scdr << data.type_identifier2(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - dcdr >> data.type_identifier1(); - dcdr >> data.type_identifier2(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.type_id(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.typeobject_serialized_size(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - scdr << data.type_id(); - scdr << data.typeobject_serialized_size(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - dcdr >> data.type_id(); - dcdr >> data.typeobject_serialized_size(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.typeid_with_size(), current_alignment); - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - for (size_t a = 0; a < data.dependent_typeids().size(); ++a) - { - calculate_serialized_size(calculator, data.dependent_typeids().at( - a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.typeid_with_size(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.dependent_typeid_count(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.dependent_typeids(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - scdr << data.typeid_with_size(); - scdr << data.dependent_typeid_count(); - scdr << data.dependent_typeids(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - dcdr >> data.typeid_with_size(); - dcdr >> data.dependent_typeid_count(); - dcdr >> data.dependent_typeids(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeInformation& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - calculate_serialized_size(calculator, data.minimal(), current_alignment); - calculate_serialized_size(calculator, data.complete(), current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.minimal(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeInformation& data) -{ - scdr << data.minimal(); - scdr << data.complete(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeInformation& data) -{ - dcdr >> data.minimal(); - dcdr >> data.complete(); -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // DYNAMIC_TYPES_TYPEOBJECTCDRAUX_IPP diff --git a/src/cpp/dynamic-types/TypeObjectFactory.cpp b/src/cpp/dynamic-types/TypeObjectFactory.cpp deleted file mode 100644 index 9f24d1dc235..00000000000 --- a/src/cpp/dynamic-types/TypeObjectFactory.cpp +++ /dev/null @@ -1,2322 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeObjectFactoryReleaser -{ -public: - - ~TypeObjectFactoryReleaser() - { - TypeObjectFactory::delete_instance(); - } - -}; - -static TypeObjectFactoryReleaser s_releaser; -static TypeObjectFactory* g_instance = nullptr; -TypeObjectFactory* TypeObjectFactory::get_instance() -{ - if (g_instance == nullptr) - { - g_instance = new TypeObjectFactory(); - g_instance->create_builtin_annotations(); - } - return g_instance; -} - -ReturnCode_t TypeObjectFactory::delete_instance() -{ - if (g_instance != nullptr) - { - delete g_instance; - g_instance = nullptr; - return ReturnCode_t::RETCODE_OK; - } - return ReturnCode_t::RETCODE_ERROR; -} - -TypeObjectFactory::TypeObjectFactory() -{ - std::unique_lock scoped(m_MutexIdentifiers); - // Generate basic TypeIdentifiers - TypeIdentifier* auxIdent; - // TK_BOOLEAN: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_BOOLEAN); - identifiers_.insert(std::pair(TKNAME_BOOLEAN, auxIdent)); - // TK_BYTE: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_BYTE); - identifiers_.insert(std::pair(TKNAME_BYTE, auxIdent)); - // TK_BYTE: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_BYTE); - identifiers_.insert(std::pair(TKNAME_UINT8, auxIdent)); - // TK_BYTE: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_BYTE); - identifiers_.insert(std::pair(TKNAME_INT8, auxIdent)); - // TK_INT16: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_INT16); - identifiers_.insert(std::pair(TKNAME_INT16, auxIdent)); - // TK_INT32: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_INT32); - identifiers_.insert(std::pair(TKNAME_INT32, auxIdent)); - // TK_INT64: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_INT64); - identifiers_.insert(std::pair(TKNAME_INT64, auxIdent)); - // TK_UINT16: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_UINT16); - identifiers_.insert(std::pair(TKNAME_UINT16, auxIdent)); - // TK_UINT32: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_UINT32); - identifiers_.insert(std::pair(TKNAME_UINT32, auxIdent)); - // TK_UINT64: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_UINT64); - identifiers_.insert(std::pair(TKNAME_UINT64, auxIdent)); - // TK_FLOAT32: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_FLOAT32); - identifiers_.insert(std::pair(TKNAME_FLOAT32, auxIdent)); - // TK_FLOAT64: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_FLOAT64); - identifiers_.insert(std::pair(TKNAME_FLOAT64, auxIdent)); - // TK_FLOAT128: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_FLOAT128); - identifiers_.insert(std::pair(TKNAME_FLOAT128, auxIdent)); - // TK_CHAR8: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_CHAR8); - identifiers_.insert(std::pair(TKNAME_CHAR8, auxIdent)); - // TK_CHAR16: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_CHAR16); - identifiers_.insert(std::pair(TKNAME_CHAR16, auxIdent)); - // TK_CHAR16: - auxIdent = new TypeIdentifier(); - identifiers_created_.push_back(auxIdent); - auxIdent->_d(TK_CHAR16); - identifiers_.insert(std::pair(TKNAME_CHAR16T, auxIdent)); -} - -TypeObjectFactory::~TypeObjectFactory() -{ - { - std::unique_lock scoped(m_MutexInformations); - for (TypeInformation* inf : informations_created_) - { - delete inf; - } - informations_.clear(); - informations_created_.clear(); - } - { - std::unique_lock scoped(m_MutexIdentifiers); - identifiers_.clear(); - complete_identifiers_.clear(); - - for (TypeIdentifier* id : identifiers_created_) - { - delete id; - } - identifiers_created_.clear(); - } - { - std::unique_lock scoped(m_MutexObjects); - auto obj_it = objects_.begin(); - while (obj_it != objects_.end()) - { - delete (obj_it->second); - ++obj_it; - } - objects_.clear(); - - auto objc_it = complete_objects_.begin(); - while (objc_it != complete_objects_.end()) - { - delete (objc_it->second); - ++objc_it; - } - complete_objects_.clear(); - } -} - -void TypeObjectFactory::create_builtin_annotations() -{ - register_builtin_annotations_types(g_instance); -} - -void TypeObjectFactory::nullify_all_entries( - const TypeIdentifier* identifier) -{ - for (auto it = identifiers_.begin(); it != identifiers_.end(); ++it) - { - if (it->second == identifier) - { - it->second = nullptr; - } - } - - for (auto it = complete_identifiers_.begin(); it != complete_identifiers_.end(); ++it) - { - if (it->second == identifier) - { - it->second = nullptr; - } - } - - auto it = std::find(identifiers_created_.begin(), identifiers_created_.end(), identifier); - if (it != identifiers_created_.end()) - { - identifiers_created_.erase(it); - } -} - -const TypeInformation* TypeObjectFactory::get_type_information( - const std::string& type_name) const -{ - const TypeIdentifier* comp_identifier = get_type_identifier(type_name, true); - const TypeIdentifier* min_identifier = get_type_identifier(type_name, false); - if (comp_identifier == nullptr && min_identifier == nullptr) - { - return nullptr; - } - - TypeInformation* information = nullptr; - if (min_identifier != nullptr) - { - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(min_identifier); - if (innerInfo != informations_.end()) - { - information = innerInfo->second; - fill_minimal_information(information, min_identifier); - } - else - { - information = new TypeInformation(); - fill_minimal_information(information, min_identifier); - informations_[min_identifier] = information; - informations_created_.push_back(information); - } - } - - if (comp_identifier != nullptr) - { - if (information == nullptr) - { - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(comp_identifier); - if (innerInfo != informations_.end()) - { - information = innerInfo->second; - } - else - { - information = new TypeInformation(); - fill_complete_information(information, comp_identifier); - informations_[comp_identifier] = information; - informations_created_.push_back(information); - } - } - else - { - fill_complete_information(information, comp_identifier); - } - } - - return information; -} - -void TypeObjectFactory::fill_minimal_information( - TypeInformation* info, - const TypeIdentifier* user_ident) const -{ - const TypeIdentifier* ident = get_stored_type_identifier(user_ident); - { - std::lock_guard lock(m_MutexInformations); - auto it = informations_.find(ident); - if (it != informations_.end()) - { - if (info == it->second) - { - return; - } - info->minimal(it->second->minimal()); - return; - } - } - - info->minimal().typeid_with_size().type_id(*ident); - const TypeObject* obj = get_type_object(ident); - - if (obj == nullptr) - { - info->minimal().dependent_typeid_count(0); - info->minimal().typeid_with_size().typeobject_serialized_size(0); - // TODO Size in this case should be zero or the size of the identifier? - // info->minimal().typeid_with_size().typeobject_serialized_size(TypeIdentifier::getCdrSerializedSize(*ident)); - } - else - { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - info->minimal().typeid_with_size().typeobject_serialized_size( - static_cast(calculator.calculate_serialized_size(*obj, current_alignment))); - } - - switch (ident->_d()) - { - /* - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - info->minimal().dependent_typeid_count(0); - break; - */ - case TK_SEQUENCE: - { - info->minimal().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->minimal().sequence_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(innerInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - break; - } - case TK_ARRAY: - { - info->minimal().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->minimal().array_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(innerInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - break; - } - case TK_MAP: - { - info->minimal().dependent_typeid_count(2); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->minimal().map_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(innerInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - const TypeIdentifier* keyId = get_stored_type_identifier( - &obj->minimal().map_type().key().common().type()); - auto keyInfo = informations_.find(keyId); - if (keyInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(keyInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - break; - } - case EK_MINIMAL: - switch (obj->minimal()._d()) - { - case TK_ALIAS: - { - info->minimal().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->minimal().alias_type().body().common().related_type()); - std::lock_guard lock(m_MutexInformations); - auto keyInfo = informations_.find(innerId); - if (keyInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(keyInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - break; - } - case TK_STRUCTURE: - { - const MinimalStructMemberSeq& members = obj->minimal().struct_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().member_type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->minimal().dependent_typeids().push_back( - memberType->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - } - info->minimal().dependent_typeid_count(static_cast(members.size())); - break; - } - case TK_ENUM: - // Already fully defined by obj - break; - case TK_BITMASK: - // TODO To implement - break; - case TK_BITSET: - // TODO To implement - break; - case TK_UNION: - { - const MinimalUnionMemberSeq& members = obj->minimal().union_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->minimal().dependent_typeids().push_back( - memberType->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, innerId); - } - } - const TypeIdentifier* descId = get_stored_type_identifier( - &obj->minimal().union_type().discriminator().common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto descInfo = informations_.find(descId); - if (descInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(descInfo->second->minimal().typeid_with_size()); - } - else - { - fill_minimal_dependant_types(info, descId); - } - info->minimal().dependent_typeid_count(static_cast(members.size() + 1)); - break; - } - case TK_ANNOTATION: - // TODO To implement - break; - } - break; - case EK_COMPLETE: - // Cannot happen - break; - } - std::lock_guard lock(m_MutexInformations); - TypeInformation* new_info = new TypeInformation(); - *new_info = *info; - informations_[ident] = new_info; - informations_created_.push_back(new_info); -} - -TypeInformation* TypeObjectFactory::get_type_information( - const TypeIdentifier* identifier) const -{ - const TypeIdentifier* ident = get_stored_type_identifier(identifier); - { - std::lock_guard lock(m_MutexInformations); - auto it = informations_.find(ident); - if (it != informations_.end()) - { - return it->second; - } - } - - return nullptr; -} - -void TypeObjectFactory::fill_complete_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const -{ - TypeInformation* information = new TypeInformation(); - fill_complete_information(information, identifier); - informations_[identifier] = information; - informations_created_.push_back(information); - info->complete().dependent_typeids().push_back(information->complete().typeid_with_size()); -} - -void TypeObjectFactory::fill_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const -{ - TypeInformation* information = new TypeInformation(); - fill_minimal_information(information, identifier); - informations_[identifier] = information; - informations_created_.push_back(information); - info->minimal().dependent_typeids().push_back(information->minimal().typeid_with_size()); -} - -void TypeObjectFactory::fill_complete_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const -{ - TypeInformation* information = new TypeInformation(); - fill_complete_information(information, identifier); - informations_[identifier] = information; - informations_created_.push_back(information); - info->minimal().dependent_typeids().push_back(information->complete().typeid_with_size()); -} - -void TypeObjectFactory::fill_complete_information( - TypeInformation* info, - const TypeIdentifier* user_ident) const -{ - const TypeIdentifier* ident = get_stored_type_identifier(user_ident); - { - std::lock_guard lock(m_MutexInformations); - auto it = informations_.find(ident); - if (it != informations_.end()) - { - if (info == it->second) - { - return; - } - info->complete(it->second->complete()); - return; - } - } - - info->complete().typeid_with_size().type_id(*ident); - const TypeObject* obj = get_type_object(ident); - - if (obj == nullptr) - { - info->complete().dependent_typeid_count(0); - info->complete().typeid_with_size().typeobject_serialized_size(0); - // TODO Size in this case should be zero or the size of the identifier? - // info->complete().typeid_with_size().typeobject_serialized_size(TypeIdentifier::getCdrSerializedSize(*ident)); - } - else - { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - info->complete().typeid_with_size().typeobject_serialized_size( - static_cast(calculator.calculate_serialized_size(*obj, current_alignment))); - } - - switch (ident->_d()) - { - /* - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - case TK_STRING8: - case TK_STRING16: - info->complete().dependent_typeid_count(0); - break; - */ - case TK_SEQUENCE: - { - info->complete().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->complete().sequence_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(innerInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - break; - } - case TK_ARRAY: - { - info->complete().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->complete().array_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(innerInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - break; - } - case TK_MAP: - { - info->complete().dependent_typeid_count(2); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->complete().map_type().element().common().type()); - std::lock_guard lock(m_MutexInformations); - auto innerInfo = informations_.find(innerId); - if (innerInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(innerInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - const TypeIdentifier* keyId = get_stored_type_identifier( - &obj->complete().map_type().key().common().type()); - { - auto keyInfo = informations_.find(keyId); - if (keyInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(keyInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - } - break; - } - case EK_MINIMAL: - switch (obj->minimal()._d()) - { - case TK_ALIAS: - { - info->minimal().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->minimal().alias_type().body().common().related_type()); - std::lock_guard lock(m_MutexInformations); - auto keyInfo = informations_.find(innerId); - if (keyInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(keyInfo->second->minimal().typeid_with_size()); - } - else - { - fill_complete_minimal_dependant_types(info, innerId); - } - break; - } - case TK_STRUCTURE: - { - const MinimalStructMemberSeq& members = obj->minimal().struct_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().member_type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->minimal().dependent_typeids().push_back( - memberType->second->minimal().typeid_with_size()); - } - else - { - fill_complete_minimal_dependant_types(info, innerId); - } - } - info->minimal().dependent_typeid_count(static_cast(members.size())); - break; - } - case TK_ENUM: - // Already fully defined by obj - break; - case TK_BITMASK: - // TODO To implement (already fully defined?) - break; - case TK_BITSET: - // TODO To implement (already fully defined? Fields are primitives.) - break; - case TK_UNION: - { - const MinimalUnionMemberSeq& members = obj->minimal().union_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->minimal().dependent_typeids().push_back( - memberType->second->minimal().typeid_with_size()); - } - else - { - fill_complete_minimal_dependant_types(info, innerId); - } - } - const TypeIdentifier* descId = get_stored_type_identifier( - &obj->minimal().union_type().discriminator().common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto descInfo = informations_.find(descId); - if (descInfo != informations_.end()) - { - info->minimal().dependent_typeids().push_back(descInfo->second->minimal().typeid_with_size()); - } - else - { - fill_complete_minimal_dependant_types(info, descId); - } - info->minimal().dependent_typeid_count(static_cast(members.size() + 1)); - break; - } - case TK_ANNOTATION: - // TODO To implement (already fully defined? Fields are primitives.) - break; - } - break; - case EK_COMPLETE: - switch (obj->complete()._d()) - { - case TK_ALIAS: - { - info->complete().dependent_typeid_count(1); - const TypeIdentifier* innerId = get_stored_type_identifier( - &obj->complete().alias_type().body().common().related_type()); - std::lock_guard lock(m_MutexInformations); - auto keyInfo = informations_.find(innerId); - if (keyInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(keyInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - break; - } - case TK_STRUCTURE: - { - const CompleteStructMemberSeq& members = obj->complete().struct_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().member_type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->complete().dependent_typeids().push_back( - memberType->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - } - info->complete().dependent_typeid_count(static_cast(members.size())); - break; - } - case TK_ENUM: - // Already fully defined by obj - break; - case TK_BITMASK: - // TODO To implement - break; - case TK_BITSET: - // TODO To implement (already fully defined? Fields are primitives.) - break; - case TK_UNION: - { - const CompleteUnionMemberSeq& members = obj->complete().union_type().member_seq(); - for (auto member = members.begin(); member != members.end(); ++member) - { - const TypeIdentifier* innerId = get_stored_type_identifier( - &member->common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto memberType = informations_.find(innerId); - if (memberType != informations_.end()) - { - info->complete().dependent_typeids().push_back( - memberType->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, innerId); - } - } - const TypeIdentifier* descId = get_stored_type_identifier( - &obj->complete().union_type().discriminator().common().type_id()); - std::lock_guard lock(m_MutexInformations); - auto descInfo = informations_.find(descId); - if (descInfo != informations_.end()) - { - info->complete().dependent_typeids().push_back(descInfo->second->complete().typeid_with_size()); - } - else - { - fill_complete_dependant_types(info, descId); - } - info->complete().dependent_typeid_count(static_cast(members.size() + 1)); - break; - } - case TK_ANNOTATION: - // TODO To implement (already fully defined? Fields are primitives.) - break; - } - break; - } - std::lock_guard lock(m_MutexInformations); - TypeInformation* new_info = new TypeInformation(); - *new_info = *info; - informations_[ident] = new_info; - informations_created_.push_back(new_info); -} - -const TypeObject* TypeObjectFactory::get_type_object( - const std::string& type_name, - bool complete) const -{ - const TypeIdentifier* identifier = get_type_identifier(type_name, complete); - if (identifier == nullptr) - { - return nullptr; - } - - return get_type_object(identifier); -} - -const TypeObject* TypeObjectFactory::get_type_object( - const TypeIdentifier* identifier) const -{ - std::unique_lock scoped(m_MutexObjects); - if (identifier == nullptr) - { - return nullptr; - } - if (identifier->_d() == EK_COMPLETE) - { - if (complete_objects_.find(identifier) != complete_objects_.end()) - { - return complete_objects_.at(identifier); - } - } - else - { - if (objects_.find(identifier) != objects_.end()) - { - return objects_.at(identifier); - } - } - - // Maybe they are using an external TypeIdentifier? - const TypeIdentifier* internalId = get_stored_type_identifier(identifier); - if (internalId != nullptr) - { - if (internalId == identifier) - { - return nullptr; // Type without object - } - return get_type_object(internalId); - } - - return nullptr; -} - -TypeKind TypeObjectFactory::get_type_kind( - const std::string& type_name) const -{ - if (type_name == TKNAME_BOOLEAN) - { - return TK_BOOLEAN; - } - else if (type_name == TKNAME_INT16) - { - return TK_INT16; - } - else if (type_name == TKNAME_INT32) - { - return TK_INT32; - } - else if (type_name == TKNAME_UINT16) - { - return TK_UINT16; - } - else if (type_name == TKNAME_UINT32) - { - return TK_UINT32; - } - else if (type_name == TKNAME_FLOAT32) - { - return TK_FLOAT32; - } - else if (type_name == TKNAME_FLOAT64) - { - return TK_FLOAT64; - } - else if (type_name == TKNAME_CHAR8) - { - return TK_CHAR8; - } - else if (type_name == TKNAME_BYTE || type_name == TKNAME_INT8 || type_name == TKNAME_UINT8) - { - return TK_BYTE; - } - else if (type_name.find("strings_") == 0) - { - return TI_STRING8_SMALL; - } - else if (type_name.find("stringl_") == 0) - { - return TI_STRING8_LARGE; - } - else if (type_name.find("sets_") == 0) - { - return TI_PLAIN_SEQUENCE_SMALL; - } - else if (type_name.find("setl_") == 0) - { - return TI_PLAIN_SEQUENCE_LARGE; - } - else if (type_name.find("arrays_") == 0) - { - return TI_PLAIN_ARRAY_SMALL; - } - else if (type_name.find("arrayl_") == 0) - { - return TI_PLAIN_ARRAY_LARGE; - } - else if (type_name == TKNAME_INT64) - { - return TK_INT64; - } - else if (type_name == TKNAME_UINT64) - { - return TK_UINT64; - } - else if (type_name == TKNAME_FLOAT128) - { - return TK_FLOAT128; - } - else if (type_name == TKNAME_CHAR16 || type_name == TKNAME_CHAR16T) - { - return TK_CHAR16; - } - else if (type_name.find("wstrings_") == 0) - { - return TI_STRING16_SMALL; - } - else if (type_name.find("wstringl_") == 0) - { - return TI_STRING16_LARGE; - } - else if (type_name.find("sequences_") == 0) - { - return TI_PLAIN_SEQUENCE_SMALL; - } - else if (type_name.find("sequencel_") == 0) - { - return TI_PLAIN_SEQUENCE_LARGE; - } - else if (type_name.find("maps_") == 0) - { - return TI_PLAIN_MAP_SMALL; - } - else if (type_name.find("mapl_") == 0) - { - return TI_PLAIN_MAP_LARGE; - } - else if (get_type_identifier(type_name) != nullptr) - { - return EK_MINIMAL; - } - else - { - return TK_NONE; - } -} - -std::string TypeObjectFactory::get_type_name( - const TypeKind kind) const -{ - switch (kind) - { - // Primitive types, already defined (never will be asked, but ok) - case TK_BOOLEAN: return TKNAME_BOOLEAN; - case TK_INT16: return TKNAME_INT16; - case TK_INT32: return TKNAME_INT32; - case TK_UINT16: return TKNAME_UINT16; - case TK_UINT32: return TKNAME_UINT32; - case TK_FLOAT32: return TKNAME_FLOAT32; - case TK_FLOAT64: return TKNAME_FLOAT64; - case TK_CHAR8: return TKNAME_CHAR8; - case TK_BYTE: return TKNAME_BYTE; - case TK_INT64: return TKNAME_INT64; - case TK_UINT64: return TKNAME_UINT64; - case TK_FLOAT128: return TKNAME_FLOAT128; - case TK_CHAR16: return TKNAME_CHAR16; - default: - break; - } - return ""; -} - -const TypeIdentifier* TypeObjectFactory::get_primitive_type_identifier( - TypeKind kind) const -{ - std::string typeName = get_type_name(kind); - if (typeName.empty()) - { - return nullptr; - } - return get_type_identifier(typeName); -} - -/* - const TypeIdentifier* TypeObjectFactory::TryCreateTypeIdentifier(const std::string& type_name) - { - std::unique_lock scoped(m_MutexIdentifiers); - // TODO Makes sense here? I don't think so. - } - */ - -const TypeIdentifier* TypeObjectFactory::get_type_identifier( - const std::string& type_name, - bool complete) const -{ - std::unique_lock scoped(m_MutexIdentifiers); - - if (complete) - { - if (complete_identifiers_.find(type_name) != complete_identifiers_.end()) - { - return complete_identifiers_.at(type_name); - } - /*else // Try it with minimal - { - return get_type_identifier(type_name, false); - }*/ - } - else - { - if (identifiers_.find(type_name) != identifiers_.end()) - { - return identifiers_.at(type_name); - } - } - - // Try with aliases - if (aliases_.find(type_name) != aliases_.end()) - { - return get_type_identifier(aliases_.at(type_name), complete); - } - - return nullptr; -} - -const TypeIdentifier* TypeObjectFactory::get_type_identifier_trying_complete( - const std::string& type_name) const -{ - std::unique_lock scoped(m_MutexIdentifiers); - - if (complete_identifiers_.find(type_name) != complete_identifiers_.end()) - { - return complete_identifiers_.at(type_name); - } - else // Try it with minimal - { - return get_type_identifier(type_name, false); - } -} - -const TypeIdentifier* TypeObjectFactory::get_stored_type_identifier( - const TypeIdentifier* identifier) const -{ - std::unique_lock scoped(m_MutexIdentifiers); - if (identifier == nullptr) - { - return nullptr; - } - if (identifier->_d() == EK_COMPLETE) - { - for (auto& it : complete_identifiers_) - { - if (*(it.second) == *identifier) - { - return it.second; - } - } - } - else - { - for (auto& it : identifiers_) - { - if (*(it.second) == *identifier) - { - return it.second; - } - } - } - // If isn't minimal, return directly - if (identifier->_d() < EK_MINIMAL) - { - return identifier; - } - return nullptr; -} - -std::string TypeObjectFactory::get_type_name( - const TypeIdentifier* identifier) const -{ - std::unique_lock scoped(m_MutexIdentifiers); - if (identifier == nullptr) - { - return ""; - } - if (identifier->_d() == EK_COMPLETE) - { - for (auto& it : complete_identifiers_) - { - if (*(it.second) == *identifier) - { - return it.first; - } - } - } - else - { - for (auto& it : identifiers_) - { - if (*(it.second) == *identifier) - { - return it.first; - } - } - } - - // Maybe they are using an external TypeIdentifier? - const TypeIdentifier* internalId = get_stored_type_identifier(identifier); - if (internalId == identifier) - { - // If the execution reached this point, a lesser than minimal no stored identifier was provided. - // Calculate the name and store it. - return generate_name_and_store_type_identifier(identifier); - } - else if (internalId != nullptr) - { - return get_type_name(internalId); - } - - return "UNDEF"; -} - -std::string TypeObjectFactory::generate_name_and_store_type_identifier( - const TypeIdentifier* identifier) const -{ - if (identifier->_d() < EK_MINIMAL) - { - switch (identifier->_d()) - { - case TI_PLAIN_ARRAY_SMALL: - { - std::vector bounds; - for (SBound sb : identifier->array_sdefn().array_bound_seq()) - { - bounds.push_back(sb); - } - return TypeNamesGenerator::get_array_type_name( - get_type_name(identifier->array_sdefn().element_identifier()), - bounds, - true); - } - case TI_PLAIN_ARRAY_LARGE: - { - return TypeNamesGenerator::get_array_type_name( - get_type_name(identifier->array_ldefn().element_identifier()), - identifier->array_ldefn().array_bound_seq(), - true); - } - case TI_PLAIN_SEQUENCE_SMALL: - { - return TypeNamesGenerator::get_sequence_type_name( - get_type_name(identifier->seq_sdefn().element_identifier()), - identifier->seq_sdefn().bound(), - true); - } - case TI_PLAIN_SEQUENCE_LARGE: - { - return TypeNamesGenerator::get_sequence_type_name( - get_type_name(identifier->seq_ldefn().element_identifier()), - identifier->seq_ldefn().bound(), - true); - } - case TI_STRING8_SMALL: - { - return TypeNamesGenerator::get_string_type_name( - identifier->string_sdefn().bound(), - false, - true); - } - case TI_STRING8_LARGE: - { - return TypeNamesGenerator::get_string_type_name( - identifier->string_ldefn().bound(), - false, - true); - } - case TI_STRING16_SMALL: - { - return TypeNamesGenerator::get_string_type_name( - identifier->string_sdefn().bound(), - true, - true); - } - case TI_STRING16_LARGE: - { - return TypeNamesGenerator::get_string_type_name( - identifier->string_ldefn().bound(), - true, - true); - } - case TI_PLAIN_MAP_SMALL: - { - return TypeNamesGenerator::get_map_type_name( - get_type_name(identifier->map_sdefn().key_identifier()), - get_type_name(identifier->map_sdefn().element_identifier()), - identifier->map_sdefn().bound(), - true); - } - case TI_PLAIN_MAP_LARGE: - { - return TypeNamesGenerator::get_map_type_name( - get_type_name(identifier->map_ldefn().key_identifier()), - get_type_name(identifier->map_ldefn().element_identifier()), - identifier->map_ldefn().bound(), - true); - } - case TI_STRONGLY_CONNECTED_COMPONENT: // TODO: Not yet supported. - default: - return "UNDEF"; - } - } - return "UNDEF"; -} - -const TypeIdentifier* TypeObjectFactory::try_get_complete( - const TypeIdentifier* identifier) const -{ - if (identifier->_d() == EK_COMPLETE) - { - return identifier; - } - - std::unique_lock scoped(m_MutexIdentifiers); - std::string name = get_type_name(identifier); - return get_type_identifier_trying_complete(name); -} - -bool TypeObjectFactory::is_type_identifier_complete( - const TypeIdentifier* identifier) const -{ - switch (identifier->_d()) - { - case TI_STRING8_SMALL: - case TI_STRING8_LARGE: - case TI_STRING16_SMALL: - case TI_STRING16_LARGE: - return false; - case TI_PLAIN_SEQUENCE_SMALL: - return is_type_identifier_complete(identifier->seq_sdefn().element_identifier()); - case TI_PLAIN_SEQUENCE_LARGE: - return is_type_identifier_complete(identifier->seq_ldefn().element_identifier()); - case TI_PLAIN_ARRAY_SMALL: - return is_type_identifier_complete(identifier->array_sdefn().element_identifier()); - case TI_PLAIN_ARRAY_LARGE: - return is_type_identifier_complete(identifier->array_ldefn().element_identifier()); - case TI_PLAIN_MAP_SMALL: - return is_type_identifier_complete(identifier->map_sdefn().element_identifier()) - && is_type_identifier_complete(identifier->map_sdefn().key_identifier()); - case TI_PLAIN_MAP_LARGE: - return is_type_identifier_complete(identifier->map_ldefn().element_identifier()) - && is_type_identifier_complete(identifier->map_ldefn().key_identifier()); - case TI_STRONGLY_CONNECTED_COMPONENT: - return false; - case EK_COMPLETE: - return true; - case EK_MINIMAL: - return false; - default: - return false; - } -} - -void TypeObjectFactory::add_type_identifier( - const std::string& type_name, - const TypeIdentifier* identifier) -{ - const TypeIdentifier* alreadyExists = get_stored_type_identifier(identifier); - if (alreadyExists != nullptr && alreadyExists != identifier) - { - // Don't copy - if (is_type_identifier_complete(alreadyExists)) - { - complete_identifiers_[type_name] = alreadyExists; - } - else - { - identifiers_[type_name] = alreadyExists; - } - return; - } - - std::unique_lock scoped(m_MutexIdentifiers); - //identifiers_.insert(std::pair(type_name, identifier)); - if (is_type_identifier_complete(identifier)) - { - if (complete_identifiers_.find(type_name) == complete_identifiers_.end()) - { - TypeIdentifier* id = new TypeIdentifier(); - identifiers_created_.push_back(id); - *id = *identifier; - complete_identifiers_[type_name] = id; - } - } - else - { - if (identifiers_.find(type_name) == identifiers_.end()) - { - TypeIdentifier* id = new TypeIdentifier(); - identifiers_created_.push_back(id); - *id = *identifier; - identifiers_[type_name] = id; - } - } -} - -void TypeObjectFactory::add_type_object( - const std::string& type_name, - const TypeIdentifier* identifier, - const TypeObject* object) -{ - add_type_identifier(type_name, identifier); - - std::unique_lock scopedObj(m_MutexObjects); - - if (object != nullptr) - { - if (identifier->_d() >= EK_MINIMAL) - { - if (object->_d() == EK_MINIMAL) - { - const TypeIdentifier* typeId = identifiers_[type_name]; - if (objects_.find(typeId) == objects_.end()) - { - TypeObject* obj = new TypeObject(); - *obj = *object; - objects_[typeId] = obj; - } - } - else if (object->_d() == EK_COMPLETE) - { - const TypeIdentifier* typeId = complete_identifiers_[type_name]; - if (complete_objects_.find(typeId) == complete_objects_.end()) - { - TypeObject* obj = new TypeObject(); - *obj = *object; - complete_objects_[typeId] = obj; - } - } - } - else - { - const TypeIdentifier* typeId = identifiers_[type_name]; - if (object->_d() == EK_MINIMAL) - { - if (objects_.find(typeId) == objects_.end()) - { - TypeObject* obj = new TypeObject(); - *obj = *object; - objects_[typeId] = obj; - } - } - else if (object->_d() == EK_COMPLETE) - { - if (complete_objects_.find(typeId) == complete_objects_.end()) - { - TypeObject* obj = new TypeObject(); - *obj = *object; - complete_objects_[typeId] = obj; - } - } - } - } -} - -const TypeIdentifier* TypeObjectFactory::get_string_identifier( - uint32_t bound, - bool wide) -{ - std::string type = TypeNamesGenerator::get_string_type_name(bound, wide, false); - - const TypeIdentifier* c_auxIdent = get_type_identifier(type); - - if (c_auxIdent != nullptr) - { - return c_auxIdent; - } - else - { - TypeIdentifier auxIdent; - if (bound < 256) - { - auxIdent._d(wide ? TI_STRING16_SMALL : TI_STRING8_SMALL); - auxIdent.string_sdefn().bound(static_cast(bound)); - } - else - { - auxIdent._d(wide ? TI_STRING16_LARGE : TI_STRING8_LARGE); - auxIdent.string_ldefn().bound(bound); - } - //identifiers_.insert(std::pair(type, auxIdent)); - //identifiers_[type] = auxIdent; - add_type_identifier(type, &auxIdent); - return get_type_identifier(type); - } - return nullptr; -} - -const TypeIdentifier* TypeObjectFactory::get_sequence_identifier( - const std::string& type_name, - uint32_t bound, - bool complete) -{ - std::string auxType = TypeNamesGenerator::get_sequence_type_name(type_name, bound, false); - - const TypeIdentifier* c_auxIdent = get_type_identifier(auxType, complete); - - if (c_auxIdent != nullptr) - { - return c_auxIdent; - } - else - { - const TypeIdentifier* innerIdent = (complete) - ? get_type_identifier_trying_complete(type_name) - : get_type_identifier(type_name); - - TypeIdentifier auxIdent; - if (bound < 256) - { - auxIdent._d(TI_PLAIN_SEQUENCE_SMALL); - auxIdent.seq_sdefn().bound(static_cast(bound)); - auxIdent.seq_sdefn().element_identifier(innerIdent); - auxIdent.seq_sdefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.seq_sdefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.seq_sdefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.seq_sdefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.seq_sdefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.seq_sdefn().header().element_flags().IS_KEY(false); - auxIdent.seq_sdefn().header().element_flags().IS_DEFAULT(false); - auxIdent.seq_sdefn().header().equiv_kind(get_type_kind(type_name)); - } - else - { - auxIdent._d(TI_PLAIN_SEQUENCE_LARGE); - auxIdent.seq_ldefn().bound(bound); - auxIdent.seq_ldefn().element_identifier(innerIdent); - auxIdent.seq_ldefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.seq_ldefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.seq_ldefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.seq_ldefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.seq_ldefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.seq_ldefn().header().element_flags().IS_KEY(false); - auxIdent.seq_ldefn().header().element_flags().IS_DEFAULT(false); - auxIdent.seq_ldefn().header().equiv_kind(get_type_kind(type_name)); - } - //identifiers_.insert(std::pair(auxType, auxIdent)); - //identifiers_[auxType] = auxIdent; - add_type_identifier(auxType, &auxIdent); - if (complete) - { - return get_type_identifier_trying_complete(auxType); - } - else - { - return get_type_identifier(auxType); - } - } -} - -const TypeIdentifier* TypeObjectFactory::get_array_identifier( - const std::string& type_name, - const std::vector& bound, - bool complete) -{ - uint32_t size; - std::string auxType = TypeNamesGenerator::get_array_type_name(type_name, bound, size, false); - - const TypeIdentifier* c_auxIdent = get_type_identifier(auxType, complete); - - if (c_auxIdent != nullptr) - { - return c_auxIdent; - } - else - { - const TypeIdentifier* innerIdent = (complete) - ? get_type_identifier_trying_complete(type_name) - : get_type_identifier(type_name); - - TypeIdentifier auxIdent; - if (size < 256) - { - auxIdent._d(TI_PLAIN_ARRAY_SMALL); - for (uint32_t b : bound) - { - auxIdent.array_sdefn().array_bound_seq().push_back(static_cast(b)); - } - auxIdent.array_sdefn().element_identifier(innerIdent); - auxIdent.array_sdefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.array_sdefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.array_sdefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.array_sdefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.array_sdefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.array_sdefn().header().element_flags().IS_KEY(false); - auxIdent.array_sdefn().header().element_flags().IS_DEFAULT(false); - auxIdent.array_sdefn().header().equiv_kind(get_type_kind(type_name)); - } - else - { - auxIdent._d(TI_PLAIN_ARRAY_LARGE); - for (uint32_t b : bound) - { - auxIdent.array_ldefn().array_bound_seq().push_back(b); - } - auxIdent.array_ldefn().element_identifier(innerIdent); - auxIdent.array_ldefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.array_ldefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.array_ldefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.array_ldefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.array_ldefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.array_ldefn().header().element_flags().IS_KEY(false); - auxIdent.array_ldefn().header().element_flags().IS_DEFAULT(false); - auxIdent.array_ldefn().header().equiv_kind(get_type_kind(type_name)); - } - //identifiers_.insert(std::pair(auxType, auxIdent)); - //identifiers_[auxType] = auxIdent; - add_type_identifier(auxType, &auxIdent); - if (complete) - { - return get_type_identifier_trying_complete(auxType); - } - else - { - return get_type_identifier(auxType); - } - } -} - -const TypeIdentifier* TypeObjectFactory::get_map_identifier( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool complete) -{ - std::string auxType = TypeNamesGenerator::get_map_type_name(key_type_name, value_type_name, bound, false); - - const TypeIdentifier* c_auxIdent = get_type_identifier(auxType, complete); - - if (c_auxIdent != nullptr) - { - return c_auxIdent; - } - else - { - const TypeIdentifier* keyIdent = (complete) - ? get_type_identifier_trying_complete(key_type_name) - : get_type_identifier(key_type_name); - const TypeIdentifier* valIdent = (complete) - ? get_type_identifier_trying_complete(value_type_name) - : get_type_identifier(value_type_name); - - TypeIdentifier auxIdent; - if (bound < 256) - { - auxIdent._d(TI_PLAIN_MAP_SMALL); - auxIdent.map_sdefn().bound(static_cast(bound)); - auxIdent.map_sdefn().element_identifier(valIdent); - auxIdent.map_sdefn().key_identifier(keyIdent); - auxIdent.map_sdefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.map_sdefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.map_sdefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.map_sdefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.map_sdefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.map_sdefn().header().element_flags().IS_KEY(false); - auxIdent.map_sdefn().header().element_flags().IS_DEFAULT(false); - auxIdent.map_sdefn().key_flags().TRY_CONSTRUCT1(false); - auxIdent.map_sdefn().key_flags().TRY_CONSTRUCT2(false); - auxIdent.map_sdefn().key_flags().IS_EXTERNAL(false); - auxIdent.map_sdefn().key_flags().IS_OPTIONAL(false); - auxIdent.map_sdefn().key_flags().IS_MUST_UNDERSTAND(false); - auxIdent.map_sdefn().key_flags().IS_KEY(false); - auxIdent.map_sdefn().key_flags().IS_DEFAULT(false); - auxIdent.map_sdefn().header().equiv_kind(get_type_kind(value_type_name)); - } - else - { - auxIdent._d(TI_PLAIN_MAP_LARGE); - auxIdent.map_ldefn().bound(bound); - auxIdent.map_ldefn().element_identifier(valIdent); - auxIdent.map_ldefn().key_identifier(keyIdent); - auxIdent.map_ldefn().header().element_flags().TRY_CONSTRUCT1(false); - auxIdent.map_ldefn().header().element_flags().TRY_CONSTRUCT2(false); - auxIdent.map_ldefn().header().element_flags().IS_EXTERNAL(false); - auxIdent.map_ldefn().header().element_flags().IS_OPTIONAL(false); - auxIdent.map_ldefn().header().element_flags().IS_MUST_UNDERSTAND(false); - auxIdent.map_ldefn().header().element_flags().IS_KEY(false); - auxIdent.map_ldefn().header().element_flags().IS_DEFAULT(false); - auxIdent.map_ldefn().key_flags().TRY_CONSTRUCT1(false); - auxIdent.map_ldefn().key_flags().TRY_CONSTRUCT2(false); - auxIdent.map_ldefn().key_flags().IS_EXTERNAL(false); - auxIdent.map_ldefn().key_flags().IS_OPTIONAL(false); - auxIdent.map_ldefn().key_flags().IS_MUST_UNDERSTAND(false); - auxIdent.map_ldefn().key_flags().IS_KEY(false); - auxIdent.map_ldefn().key_flags().IS_DEFAULT(false); - auxIdent.map_ldefn().header().equiv_kind(get_type_kind(value_type_name)); - } - //identifiers_.insert(std::pair(auxType, auxIdent)); - //identifiers_[auxType] = auxIdent; - add_type_identifier(auxType, &auxIdent); - if (complete) - { - return get_type_identifier_trying_complete(auxType); - } - else - { - return get_type_identifier(auxType); - } - } -} - -static TypeKind GetTypeKindFromIdentifier( - const TypeIdentifier* identifier) -{ - if (identifier == nullptr) - { - return TK_NONE; - } - switch (identifier->_d()) - { - case TI_STRING8_SMALL: - case TI_STRING8_LARGE: - return TK_STRING8; - case TI_STRING16_SMALL: - case TI_STRING16_LARGE: - return TK_STRING16; - case TI_PLAIN_SEQUENCE_SMALL: - case TI_PLAIN_SEQUENCE_LARGE: - return TK_SEQUENCE; - case TI_PLAIN_ARRAY_SMALL: - case TI_PLAIN_ARRAY_LARGE: - return TK_ARRAY; - case TI_PLAIN_MAP_SMALL: - case TI_PLAIN_MAP_LARGE: - return TK_MAP; - case TI_STRONGLY_CONNECTED_COMPONENT: - return TK_NONE; - case EK_COMPLETE: - case EK_MINIMAL: - default: - return identifier->_d(); - } -} - -DynamicType_ptr TypeObjectFactory::build_dynamic_type( - const std::string& name, - const TypeIdentifier* identifier, - const TypeObject* object) const -{ - TypeKind kind = GetTypeKindFromIdentifier(identifier); - TypeDescriptor descriptor(name, kind); - switch (kind) - { - // Basic types goes as default! - /* - case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE: - case TK_INT16: - case TK_INT32: - case TK_INT64: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: - case TK_FLOAT32: - case TK_FLOAT64: - case TK_FLOAT128: - case TK_CHAR8: - case TK_CHAR16: - break; - */ - case TK_STRING8: - { - if (identifier->_d() == TI_STRING8_SMALL) - { - descriptor.bound_.emplace_back(static_cast(identifier->string_sdefn().bound())); - } - else - { - descriptor.bound_.emplace_back(identifier->string_ldefn().bound()); - } - descriptor.element_type_ = DynamicTypeBuilderFactory::get_instance()->create_char8_type(); - break; - } - case TK_STRING16: - { - if (identifier->_d() == TI_STRING16_SMALL) - { - descriptor.bound_.emplace_back(static_cast(identifier->string_sdefn().bound())); - } - else - { - descriptor.bound_.emplace_back(identifier->string_ldefn().bound()); - } - descriptor.element_type_ = DynamicTypeBuilderFactory::get_instance()->create_char16_type(); - break; - } - case TK_SEQUENCE: - { - if (identifier->_d() == TI_PLAIN_SEQUENCE_SMALL) - { - const TypeIdentifier* aux = try_get_complete(identifier->seq_sdefn().element_identifier()); - descriptor.bound_.emplace_back(static_cast(identifier->seq_sdefn().bound())); - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - else - { - const TypeIdentifier* aux = try_get_complete(identifier->seq_ldefn().element_identifier()); - descriptor.bound_.emplace_back(identifier->seq_ldefn().bound()); - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - break; - } - case TK_ARRAY: - { - if (identifier->_d() == TI_PLAIN_ARRAY_SMALL) - { - const TypeIdentifier* aux = try_get_complete(identifier->array_sdefn().element_identifier()); - for (octet b : identifier->array_sdefn().array_bound_seq()) - { - descriptor.bound_.emplace_back(static_cast(b)); - } - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - else - { - const TypeIdentifier* aux = identifier->array_ldefn().element_identifier(); - descriptor.bound_ = identifier->array_ldefn().array_bound_seq(); - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - break; - } - case TK_MAP: - { - if (identifier->_d() == TI_PLAIN_MAP_SMALL) - { - const TypeIdentifier* aux = try_get_complete(identifier->map_sdefn().element_identifier()); - const TypeIdentifier* aux2 = try_get_complete(identifier->map_sdefn().key_identifier()); - descriptor.bound_.emplace_back(static_cast(identifier->map_sdefn().bound())); - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - descriptor.key_element_type_ = build_dynamic_type(get_type_name(aux), aux2, get_type_object(aux2)); - } - else - { - const TypeIdentifier* aux = try_get_complete(identifier->map_ldefn().element_identifier()); - const TypeIdentifier* aux2 = try_get_complete(identifier->map_ldefn().key_identifier()); - descriptor.bound_.emplace_back(identifier->map_ldefn().bound()); - descriptor.element_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - descriptor.key_element_type_ = build_dynamic_type(get_type_name(aux), aux2, get_type_object(aux2)); - } - break; - } - case EK_MINIMAL: - case EK_COMPLETE: - // A MinimalTypeObject cannot instantiate a valid TypeDescriptor, but maybe the object isn't minimal - if (object != nullptr && object->_d() == EK_COMPLETE) - { - return build_dynamic_type(descriptor, object); - } - break; - case TK_NONE: - return DynamicType_ptr(nullptr); // Maybe in discovery, return nullptr quietly. - default: - break; - } - - DynamicTypeBuilder_ptr outputType = DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - //outputType->set_name(name); - if (outputType != nullptr) - { - return outputType->build(); - } - return DynamicType_ptr(nullptr); -} - -// TODO annotations -DynamicType_ptr TypeObjectFactory::build_dynamic_type( - TypeDescriptor& descriptor, - const TypeObject* object, - const DynamicType_ptr annotation_member_type) const -{ - if (object == nullptr || object->_d() != EK_COMPLETE) - { - return DynamicType_ptr(nullptr); - } - - // Change descriptor's kind - descriptor.set_kind(object->complete()._d()); - - switch (object->complete()._d()) - { - // From here, we need TypeObject - case TK_ALIAS: - { - const TypeIdentifier* aux = - get_stored_type_identifier(&object->complete().alias_type().body().common().related_type()); - descriptor.base_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - descriptor.set_name(object->complete().alias_type().header().detail().type_name()); - DynamicTypeBuilder_ptr alias_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(alias_type, object->complete().alias_type().header().detail().ann_custom()); - - return alias_type->build(); - } - case TK_STRUCTURE: - { - const TypeIdentifier* aux = &object->complete().struct_type().header().base_type(); - if (aux->_d() == EK_COMPLETE) - { - descriptor.base_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - - DynamicTypeBuilder_ptr struct_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(struct_type, object->complete().struct_type().header().detail().ann_custom()); - - //uint32_t order = 0; - const CompleteStructMemberSeq& structVector = object->complete().struct_type().member_seq(); - for (auto member = structVector.begin(); member != structVector.end(); ++member) - { - //const TypeIdentifier* auxMem = &member.common().member_type_id(); - const TypeIdentifier* auxMem = get_stored_type_identifier(&member->common().member_type_id()); - if (auxMem == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Struct) auxMem is nullptr, but original member has " - << (int)member->common().member_type_id()._d()); - } - MemberDescriptor memDesc; - memDesc.id_ = member->common().member_id(); - memDesc.set_type(build_dynamic_type(get_type_name(auxMem), auxMem, get_type_object(auxMem))); - //memDesc.set_index(order++); - memDesc.set_name(member->detail().name()); - struct_type->add_member(&memDesc); - apply_member_annotations(struct_type, member->common().member_id(), member->detail().ann_custom()); - } - return struct_type->build(); - } - case TK_ENUM: - { - // bit_bound annotation effect! - descriptor.annotation_set_bit_bound(object->complete().enumerated_type().header().common().bit_bound()); - - DynamicTypeBuilder_ptr enum_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(enum_type, object->complete().enumerated_type().header().detail().ann_custom()); - /* - { - const AppliedAnnotationSeq& annotations = - object->complete().enumerated_type().header().detail().ann_custom(); - for (const AppliedAnnotation& annotation : annotations) - { - const TypeIdentifier* anno_id = get_stored_type_identifier(&annotation.annotation_typeid()); - if (anno_id == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Annotation) anno_id is nullptr, but original member has " - << (int)annotation.annotation_typeid()._d()); - } - AnnotationDescriptor anno_desc; - anno_desc.set_type(build_dynamic_type(get_type_name(anno_id), anno_id, get_type_object(anno_id))); - const AppliedAnnotationParameterSeq& anno_params = annotation.param_seq(); - for (const AppliedAnnotationParameter a_param : anno_params) - { - std::string param_key = get_key_from_hash(anno_desc.type(), a_param.paramname_hash()); - anno_desc.set_value(param_key, a_param.value().to_string()); - } - enum_type->apply_annotation(anno_desc); - } - } - */ - - const CompleteEnumeratedLiteralSeq& enumVector = object->complete().enumerated_type().literal_seq(); - for (auto member = enumVector.begin(); member != enumVector.end(); ++member) - { - enum_type->add_empty_member(member->common().value(), member->detail().name()); - apply_member_annotations(enum_type, member->common().value(), member->detail().ann_custom()); - if (member->common().flags().IS_DEFAULT()) - { - AnnotationDescriptor def_flag; - def_flag.set_value(ANNOTATION_DEFAULT_LITERAL_ID, CONST_TRUE); - enum_type->apply_annotation_to_member(member->common().value(), def_flag); - } - } - return enum_type->build(); - } - case TK_BITMASK: - { - descriptor.annotation_set_bit_bound(object->complete().bitmask_type().header().common().bit_bound()); - descriptor.bound_.emplace_back(static_cast( - object->complete().bitmask_type().header().common().bit_bound())); - descriptor.element_type_ = DynamicTypeBuilderFactory::get_instance()->create_bool_type(); - - DynamicTypeBuilder_ptr bitmask_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(bitmask_type, object->complete().bitmask_type().header().detail().ann_custom()); - - const CompleteBitflagSeq& seq = object->complete().bitmask_type().flag_seq(); - for (auto member = seq.begin(); member != seq.end(); ++member) - { - bitmask_type->add_empty_member(member->common().position(), member->detail().name()); - MemberId m_id = bitmask_type->get_member_id_by_name(member->detail().name()); - // member->common().position() should be already an annotation - apply_member_annotations(bitmask_type, m_id, member->detail().ann_custom()); - } - return bitmask_type->build(); - } - case TK_BITSET: - { - const TypeIdentifier* aux = &object->complete().bitset_type().header().base_type(); - if (aux->_d() == EK_COMPLETE) - { - descriptor.base_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - } - - DynamicTypeBuilder_ptr bitsetType = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(bitsetType, object->complete().bitset_type().header().detail().ann_custom()); - - //uint32_t order = 0; - const CompleteBitfieldSeq& fields = object->complete().bitset_type().field_seq(); - for (auto member = fields.begin(); member != fields.end(); ++member) - { - //const TypeIdentifier* auxMem = &member.common().member_type_id(); - const TypeIdentifier* auxMem = get_primitive_type_identifier(member->common().holder_type()); - if (auxMem == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Bitset) auxMem is nullptr, but original member has " - << (int)member->common().holder_type()); - } - MemberDescriptor memDesc; - //memDesc.id_ = order++; - memDesc.set_type(build_dynamic_type(get_type_name(auxMem), auxMem, get_type_object(auxMem))); - memDesc.set_name(member->detail().name()); - // bounds are meant for string, arrays, sequences, maps, but not for bitset! - // Lack in the standard? - bitsetType->add_member(&memDesc); - MemberId m_id = bitsetType->get_member_id_by_name(memDesc.get_name()); - // member->common().position() and member->common().bitcount() should be annotations - apply_member_annotations(bitsetType, m_id, member->detail().ann_custom()); - } - return bitsetType->build(); - - //EPROSIMA_LOG_ERROR(XTYPES, "Bitset isn't supported by DynamicType"); - //return nullptr; - } - case TK_UNION: - { - const TypeIdentifier* aux = - get_stored_type_identifier(&object->complete().union_type().discriminator().common().type_id()); - descriptor.discriminator_type_ = build_dynamic_type(get_type_name(aux), aux, get_type_object(aux)); - - DynamicTypeBuilder_ptr union_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - // Apply type's annotations - apply_type_annotations(union_type, object->complete().union_type().header().detail().ann_custom()); - - //uint32_t order = 0; - const CompleteUnionMemberSeq& unionVector = object->complete().union_type().member_seq(); - for (auto member = unionVector.begin(); member != unionVector.end(); ++member) - { - const TypeIdentifier* auxMem = get_stored_type_identifier(&member->common().type_id()); - if (auxMem == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Union) auxMem is nullptr, but original member has " - << (int)member->common().type_id()._d()); - } - MemberDescriptor memDesc; - memDesc.set_type(build_dynamic_type(get_type_name(auxMem), auxMem, get_type_object(auxMem))); - //memDesc.set_index(order++); - memDesc.id_ = member->common().member_id(); - memDesc.set_name(member->detail().name()); - memDesc.set_default_union_value(member->common().member_flags().IS_DEFAULT()); - if (descriptor.discriminator_type_->get_kind() == TK_ENUM) - { - DynamicTypeMember enumMember; - descriptor.discriminator_type_->get_member(enumMember, memDesc.id_); - memDesc.default_value_ = enumMember.get_descriptor()->name_; - for (uint32_t lab : member->common().label_seq()) - { - memDesc.add_union_case_index(lab); - } - } - else - { - memDesc.default_value_ = std::to_string(memDesc.id_); - for (uint32_t lab : member->common().label_seq()) - { - memDesc.add_union_case_index(lab); - } - } - union_type->add_member(&memDesc); - apply_member_annotations(union_type, member->common().member_id(), member->detail().ann_custom()); - } - - return union_type->build(); - } - case TK_ANNOTATION: - { - DynamicTypeBuilder_ptr annotation_type = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&descriptor); - - for (const CompleteAnnotationParameter& member : object->complete().annotation_type().member_seq()) - { - const TypeIdentifier* aux_mem = get_stored_type_identifier(&member.common().member_type_id()); - if (aux_mem == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Annotation) aux_mem is nullptr, but original member has " - << (int)member.common().member_type_id()._d()); - } - - MemberDescriptor mem_desc; - mem_desc.set_name(member.name()); - if (annotation_member_type != nullptr) - { - mem_desc.set_type(annotation_member_type); - } - else - { - mem_desc.set_type(build_dynamic_type(get_type_name(aux_mem), aux_mem, get_type_object(aux_mem))); - } - mem_desc.set_default_value(member.default_value().to_string()); - annotation_type->add_member(&mem_desc); - } - // Annotation inner definitions? - - return annotation_type->build(); - } - default: - break; - } - return DynamicType_ptr(nullptr); -} - -void TypeObjectFactory::apply_type_annotations( - DynamicTypeBuilder_ptr& type_builder, - const AppliedAnnotationSeq& annotations) const -{ - for (const AppliedAnnotation& annotation : annotations) - { - const TypeIdentifier* anno_id = get_stored_type_identifier(&annotation.annotation_typeid()); - if (anno_id == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Annotation) anno_id is nullptr, but original member has " - << (int)annotation.annotation_typeid()._d()); - } - AnnotationDescriptor anno_desc; - anno_desc.set_type(build_dynamic_type(get_type_name(anno_id), anno_id, get_type_object(anno_id))); - const AppliedAnnotationParameterSeq& anno_params = annotation.param_seq(); - for (const AppliedAnnotationParameter& a_param : anno_params) - { - std::string param_key = get_key_from_hash(anno_desc.type(), a_param.paramname_hash()); - anno_desc.set_value(param_key, a_param.value().to_string()); - } - type_builder->apply_annotation(anno_desc); - } -} - -void TypeObjectFactory::apply_member_annotations( - DynamicTypeBuilder_ptr& parent_type_builder, - MemberId member_id, - const AppliedAnnotationSeq& annotations) const -{ - for (const AppliedAnnotation& annotation : annotations) - { - const TypeIdentifier* anno_id = get_stored_type_identifier(&annotation.annotation_typeid()); - if (anno_id == nullptr) - { - EPROSIMA_LOG_WARNING(DYNAMIC_TYPES, "(Annotation) anno_id is nullptr, but original member has " - << (int)annotation.annotation_typeid()._d()); - } - AnnotationDescriptor anno_desc; - anno_desc.set_type(build_dynamic_type(get_type_name(anno_id), anno_id, get_type_object(anno_id))); - const AppliedAnnotationParameterSeq& anno_params = annotation.param_seq(); - for (const AppliedAnnotationParameter& a_param : anno_params) - { - std::string param_key = get_key_from_hash(anno_desc.type(), a_param.paramname_hash()); - anno_desc.set_value(param_key, a_param.value().to_string()); - } - parent_type_builder->apply_annotation_to_member(member_id, anno_desc); - } -} - -std::string TypeObjectFactory::get_key_from_hash( - const DynamicType_ptr annotation_descriptor_type, - const NameHash& hash) const -{ - std::map members; - annotation_descriptor_type->get_all_members(members); - for (auto it : members) - { - std::string name = it.second->get_name(); - NameHash memberHash; - MD5 message_hash(name); - for (int i = 0; i < 4; ++i) - { - memberHash[i] = message_hash.digest[i]; - } - if (memberHash == hash) - { - return name; - } - } - return ""; -} - -TypeIdentifierWithSizeSeq TypeObjectFactory::typelookup_get_type_dependencies( - const TypeIdentifierSeq& identifiers, - const OctetSeq& in_continuation_point, - OctetSeq& out_continuation_point, - size_t max_size) const -{ - TypeIdentifierWithSizeSeq result; - size_t continuation_point = to_size_t(in_continuation_point); - size_t start_index = max_size * continuation_point; - size_t skip = 0; - - // TODO Manage the overflow with additional "start_indexes" to cover - // the complete 256 bits possibilities of OctetSeq. - if (start_index < continuation_point) - { - // Overflow - for (octet& o : out_continuation_point) - { - o = 0; - } - return result; - } - - // For each given identifier - for (const TypeIdentifier& identifier : identifiers) - { - const TypeIdentifier* local_id = get_stored_type_identifier(&identifier); - - // Check it is known - if (local_id != nullptr) - { - // Create or retrieve its TypeInformation - if (get_type_information(local_id) == nullptr) - { - TypeInformation aux; - if (local_id->_d() > EK_MINIMAL) - { - fill_complete_information(&aux, local_id); - } - else - { - fill_minimal_information(&aux, local_id); - } - } - const TypeInformation* local_info = get_type_information(local_id); - if (local_info != nullptr) - { - // With the TypeInformation, retrieve directly their dependencies - const TypeIdentifierWithSizeSeq& full_results = - (local_id->_d() > EK_MINIMAL) - ? local_info->complete().dependent_typeids() - : local_info->minimal().dependent_typeids(); - - // Check the start_index - if (skip + full_results.size() < start_index) - { - skip += full_results.size(); - continue; - } - else - { - size_t local_start = start_index - skip; - size_t added = 0; - // Add the next identifiers. - for (size_t i = local_start; i < local_start + max_size && i < full_results.size(); ++i) - { - result.push_back(full_results[i]); - ++added; - } - skip = 0; - start_index = 0; - if (added == max_size) - { - // If max_size reached, increment out_continuation_point - ++out_continuation_point; - break; - } - } - } - } - } - - return result; -} - -const TypeIdentifier* TypeObjectFactory::typelookup_get_type( - const TypeIdentifier& identifier, - TypeObject& object) const -{ - const TypeIdentifier* local_id = get_stored_type_identifier(&identifier); - - if (local_id != nullptr) - { - const TypeObject* local_obj = get_type_object(local_id); - if (local_obj != nullptr) - { - object = *local_obj; - } - } - - return local_id; -} - -bool TypeObjectFactory::typelookup_check_type_identifier( - const TypeIdentifier& identifier) const -{ - return get_stored_type_identifier(&identifier) != nullptr; -} - -const TypeObject* TypeObjectFactory::typelookup_get_type_object_from_information( - const TypeInformation& information) const -{ - if (information.complete().typeid_with_size().type_id()._d() != 0) - { - const TypeIdentifier* local_id = - get_stored_type_identifier(&information.complete().typeid_with_size().type_id()); - - if (local_id != nullptr) - { - return get_type_object(local_id); - } - } - return nullptr; -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeObjectHashId.cpp b/src/cpp/dynamic-types/TypeObjectHashId.cpp deleted file mode 100644 index 1d415c3e6db..00000000000 --- a/src/cpp/dynamic-types/TypeObjectHashId.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypeObjectHashId.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool gen and modified manually. - */ - -#include -#include - -#include "TypeObjectHashIdCdrAux.ipp" - -using namespace eprosima::fastcdr::exception; - -#include - -namespace eprosima { -namespace fastrtps { - -using namespace rtps; - -namespace types { - -TypeObjectHashId::TypeObjectHashId() -{ - m__d = EK_COMPLETE; -} - -TypeObjectHashId::~TypeObjectHashId() -{ -} - -TypeObjectHashId::TypeObjectHashId( - const TypeObjectHashId& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(m_hash, x.m_hash, 14); - break; - default: - break; - } -} - -TypeObjectHashId::TypeObjectHashId( - TypeObjectHashId&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(m_hash, x.m_hash, 14); - break; - default: - break; - } -} - -TypeObjectHashId& TypeObjectHashId::operator =( - const TypeObjectHashId& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(m_hash, x.m_hash, 14); - break; - default: - break; - } - - return *this; -} - -TypeObjectHashId& TypeObjectHashId::operator =( - TypeObjectHashId&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - memcpy(m_hash, x.m_hash, 14); - break; - default: - break; - } - - return *this; -} - -void TypeObjectHashId::_d( - uint8_t __d) // Special case to ease... sets the current active member -{ - bool b = false; - m__d = __d; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - switch (__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t TypeObjectHashId::_d() const -{ - return m__d; -} - -uint8_t& TypeObjectHashId::_d() -{ - return m__d; -} - -void TypeObjectHashId::hash( - const EquivalenceHash& _hash) -{ - memcpy(m_hash, _hash, 14); - m__d = EK_COMPLETE; -} - -void TypeObjectHashId::hash( - EquivalenceHash&& _hash) -{ - memcpy(m_hash, _hash, 14); - m__d = EK_COMPLETE; -} - -const EquivalenceHash& TypeObjectHashId::hash() const -{ - bool b = false; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_hash; -} - -EquivalenceHash& TypeObjectHashId::hash() -{ - bool b = false; - - switch (m__d) - { - case EK_COMPLETE: - case EK_MINIMAL: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - - return m_hash; -} - -void TypeObjectHashId::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeObjectHashId::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -} // namespace types -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp b/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp deleted file mode 100644 index 1207c7dc943..00000000000 --- a/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp +++ /dev/null @@ -1,115 +0,0 @@ - -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP -#define DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeObjectHashId& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - current_alignment += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - calculated_size += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeObjectHashId& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - scdr << data.hash()[i]; - } - break; - default: - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeObjectHashId& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - dcdr >> data.hash()[i]; - } - break; - default: - break; - } -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP diff --git a/src/cpp/dynamic-types/TypesBase.cpp b/src/cpp/dynamic-types/TypesBase.cpp deleted file mode 100644 index c88f3f1afdc..00000000000 --- a/src/cpp/dynamic-types/TypesBase.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesBase.cpp - */ - -#include -#include - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::MemberFlag&, - size_t& current_alignment) -{ - size_t calculated_size {2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2)}; - current_alignment += calculated_size; - return calculated_size; -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& cdr, - const eprosima::fastrtps::types::MemberFlag& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset().to_ulong()); - cdr << bits; -#else - cdr << data.bitset(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& cdr, - eprosima::fastrtps::types::MemberFlag& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - cdr >> bits; - data.bitset(std::bitset<16>(bits)); -#else - std::bitset<16> bitset; - cdr >> bitset; - data.bitset(bitset); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator&, - const eprosima::fastrtps::types::TypeFlag&, - size_t& current_alignment) -{ - size_t calculated_size {2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2)}; - current_alignment += calculated_size; - return calculated_size; -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& cdr, - const eprosima::fastrtps::types::TypeFlag& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits = static_cast(data.bitset().to_ulong()); - cdr << bits; -#else - cdr << data.bitset(); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& cdr, - eprosima::fastrtps::types::TypeFlag& data) -{ -#if FASTCDR_VERSION_MAJOR == 1 - uint16_t bits; - cdr >> bits; - data.bitset(std::bitset<16>(bits)); -#else - std::bitset<16> bitset; - cdr >> bitset; - data.bitset(bitset); -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -} // namespace fastcdr -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp b/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp deleted file mode 100644 index 5cdca291d7d..00000000000 --- a/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file RPCHeadersImpl.cpp - * - */ - -#include -#include -#include - -#include "RPCHeadersImplCdrAux.ipp" - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace rpc { - -size_t ReplyHeader::getCdrSerializedSize( - const ReplyHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void ReplyHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void ReplyHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t RequestHeader::getCdrSerializedSize( - const RequestHeader& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void RequestHeader::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void RequestHeader::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -} // namespace rpc -} // namespace dds -} // namespace fastdds -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp b/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp deleted file mode 100644 index b6729395808..00000000000 --- a/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef FASTDDS_BUILTIN_COMMON_RPCHEADERSIMPLCDRAUX_IPP -#define FASTDDS_BUILTIN_COMMON_RPCHEADERSIMPLCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::rpc::ReplyHeader&, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); // RemoteException - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t - calculated_size += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t - calculated_size += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); // RemoteException - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::rpc::ReplyHeader& data) -{ - for (uint32_t i = 0; i < fastrtps::rtps::GuidPrefix_t::size; ++i) - { - scdr << data.relatedRequestId.writer_guid().guidPrefix.value[i]; - } - for (uint32_t i = 0; i < fastrtps::rtps::EntityId_t::size; ++i) - { - scdr << data.relatedRequestId.writer_guid().entityId.value[i]; - } - - scdr << data.relatedRequestId.sequence_number().high; - scdr << data.relatedRequestId.sequence_number().low; - - scdr << static_cast(data.remoteEx); -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::rpc::ReplyHeader& data) -{ - for (uint32_t i = 0; i < fastrtps::rtps::GuidPrefix_t::size; ++i) - { - dcdr >> data.relatedRequestId.writer_guid().guidPrefix.value[i]; - } - for (uint32_t i = 0; i < fastrtps::rtps::EntityId_t::size; ++i) - { - dcdr >> data.relatedRequestId.writer_guid().entityId.value[i]; - } - dcdr >> data.relatedRequestId.sequence_number().high; - dcdr >> data.relatedRequestId.sequence_number().low; - -#if FASTCDR_VERSION_MAJOR == 1 - uint32_t aux; - dcdr >> aux; - data.remoteEx = static_cast(aux); -#else - dcdr >> data.remoteEx; -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::rpc::RequestHeader& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - static_cast(calculator); - size_t initial_alignment = current_alignment; - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.instanceName.size() + 1; - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t - calculated_size += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t - calculated_size += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.instanceName.size() + 1; - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::rpc::RequestHeader& data) -{ - for (uint32_t i = 0; i < fastrtps::rtps::GuidPrefix_t::size; ++i) - { - scdr << data.requestId.writer_guid().guidPrefix.value[i]; - } - for (uint32_t i = 0; i < fastrtps::rtps::EntityId_t::size; ++i) - { - scdr << data.requestId.writer_guid().entityId.value[i]; - } - scdr << data.requestId.sequence_number().high; - scdr << data.requestId.sequence_number().low; - -#if FASTCDR_VERSION_MAJOR == 1 - scdr << data.instanceName.to_string(); -#else - scdr << data.instanceName; -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::rpc::RequestHeader& data) -{ - for (uint32_t i = 0; i < fastrtps::rtps::GuidPrefix_t::size; ++i) - { - dcdr >> data.requestId.writer_guid().guidPrefix.value[i]; - } - for (uint32_t i = 0; i < fastrtps::rtps::EntityId_t::size; ++i) - { - dcdr >> data.requestId.writer_guid().entityId.value[i]; - } - dcdr >> data.requestId.sequence_number().high; - dcdr >> data.requestId.sequence_number().low; - -#if FASTCDR_VERSION_MAJOR == 1 - std::string aux; - dcdr >> aux; - data.instanceName = aux; -#else - dcdr >> data.instanceName; -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // FASTDDS_BUILTIN_COMMON_RPCHEADERSIMPLCDRAUX_IPP diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp new file mode 100644 index 00000000000..2b924742abd --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp @@ -0,0 +1,845 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupManager.cpp + * + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace eprosima { + +using namespace fastrtps::rtps; +using eprosima::fastdds::dds::Log; + +namespace fastdds { +namespace dds { +namespace builtin { + + +inline SequenceNumber_t sequence_number_rtps_2_dds( + const fastrtps::rtps::SequenceNumber_t& seq_number) +{ + return *reinterpret_cast(&seq_number); +} + +inline GUID_t guid_rtps_2_dds( + const fastrtps::rtps::GUID_t& rtps_guid) +{ + return *reinterpret_cast(&rtps_guid); +} + +inline fastrtps::rtps::GUID_t guid_dds_2_rtps( + const GUID_t& guid) +{ + return *reinterpret_cast(&guid); +} + +TypeLookupManager::TypeLookupManager() +{ +} + +TypeLookupManager::~TypeLookupManager() +{ + if (nullptr != builtin_reply_reader_) + { + participant_->deleteUserEndpoint(builtin_reply_reader_->getGuid()); + } + if (nullptr != builtin_reply_writer_) + { + participant_->deleteUserEndpoint(builtin_reply_writer_->getGuid()); + } + if (nullptr != builtin_request_reader_) + { + participant_->deleteUserEndpoint(builtin_request_reader_->getGuid()); + } + if (nullptr != builtin_request_writer_) + { + participant_->deleteUserEndpoint(builtin_request_writer_->getGuid()); + } + delete builtin_request_writer_history_; + delete builtin_reply_writer_history_; + delete builtin_request_reader_history_; + delete builtin_reply_reader_history_; + + delete reply_listener_; + delete request_listener_; + + delete temp_reader_proxy_data_; + delete temp_writer_proxy_data_; +} + +bool TypeLookupManager::init( + fastrtps::rtps::BuiltinProtocols* protocols) +{ + participant_ = protocols->mp_participantImpl; + builtin_protocols_ = protocols; + + local_instance_name_ = get_instance_name(participant_->getGuid()); + + temp_reader_proxy_data_ = new fastrtps::rtps::ReaderProxyData( + protocols->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_unicast_locators, + protocols->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_multicast_locators); + temp_writer_proxy_data_ = new fastrtps::rtps::WriterProxyData( + protocols->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_unicast_locators, + protocols->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_multicast_locators); + + + // Check if ReaderProxyData and WriterProxyData objects were created successfully + if (temp_reader_proxy_data_ && temp_writer_proxy_data_) + { + return create_endpoints(); + } + else + { + // Clean up on failure and return false + delete temp_reader_proxy_data_; + delete temp_writer_proxy_data_; + return false; + } +} + +bool TypeLookupManager::assign_remote_endpoints( + const ParticipantProxyData& pdata) +{ + const NetworkFactory& network = participant_->network_factory(); + uint32_t endp = pdata.m_availableBuiltinEndpoints; + uint32_t auxendp = endp; + + std::lock_guard data_guard(temp_data_lock_); + + temp_writer_proxy_data_->guid().guidPrefix = pdata.m_guid.guidPrefix; + temp_writer_proxy_data_->persistence_guid().guidPrefix = pdata.m_guid.guidPrefix; + temp_writer_proxy_data_->set_remote_locators(pdata.metatraffic_locators, network, true); + temp_writer_proxy_data_->topicKind(NO_KEY); + temp_writer_proxy_data_->m_qos.m_durability.kind = fastrtps::VOLATILE_DURABILITY_QOS; + temp_writer_proxy_data_->m_qos.m_reliability.kind = fastrtps::RELIABLE_RELIABILITY_QOS; + + temp_reader_proxy_data_->clear(); + temp_reader_proxy_data_->m_expectsInlineQos = false; + temp_reader_proxy_data_->guid().guidPrefix = pdata.m_guid.guidPrefix; + temp_reader_proxy_data_->set_remote_locators(pdata.metatraffic_locators, network, true); + temp_reader_proxy_data_->topicKind(NO_KEY); + temp_reader_proxy_data_->m_qos.m_durability.kind = fastrtps::VOLATILE_DURABILITY_QOS; + temp_reader_proxy_data_->m_qos.m_reliability.kind = fastrtps::RELIABLE_RELIABILITY_QOS; + + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "for RTPSParticipant: " << pdata.m_guid); + + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; + + if (auxendp != 0 && builtin_request_reader_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote writer to the local Builtin Request Reader"); + temp_writer_proxy_data_->guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; + temp_writer_proxy_data_->persistence_guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; + builtin_request_reader_->matched_writer_add(*temp_writer_proxy_data_); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; + + if (auxendp != 0 && builtin_reply_reader_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote writer to the local Builtin Reply Reader"); + temp_writer_proxy_data_->guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; + temp_writer_proxy_data_->persistence_guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; + builtin_reply_reader_->matched_writer_add(*temp_writer_proxy_data_); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; + + if (auxendp != 0 && builtin_request_writer_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote reader to the local Builtin Request Writer"); + temp_reader_proxy_data_->guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_reader; + builtin_request_writer_->matched_reader_add(*temp_reader_proxy_data_); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; + + if (auxendp != 0 && builtin_reply_writer_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote reader to the local Builtin Reply Writer"); + temp_reader_proxy_data_->guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_reader; + builtin_reply_writer_->matched_reader_add(*temp_reader_proxy_data_); + } + + return true; +} + +void TypeLookupManager::remove_remote_endpoints( + fastrtps::rtps::ParticipantProxyData* pdata) +{ + fastrtps::rtps::GUID_t tmp_guid; + tmp_guid.guidPrefix = pdata->m_guid.guidPrefix; + + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "for RTPSParticipant: " << pdata->m_guid); + uint32_t endp = pdata->m_availableBuiltinEndpoints; + uint32_t partdet = endp; + uint32_t auxendp = endp; + partdet &= DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR; //Habria que quitar esta linea que comprueba si tiene PDP. + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; + + if ((auxendp != 0 || partdet != 0) && builtin_request_reader_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote writer from the local Builtin Request Reader"); + tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; + builtin_request_reader_->matched_writer_remove(tmp_guid); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; + + if ((auxendp != 0 || partdet != 0) && builtin_reply_reader_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote writer from the local Builtin Reply Reader"); + tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; + builtin_reply_reader_->matched_writer_remove(tmp_guid); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; + + if ((auxendp != 0 || partdet != 0) && builtin_request_writer_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote reader from the local Builtin Request Writer"); + tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_reader; + builtin_request_writer_->matched_reader_remove(tmp_guid); + } + + auxendp = endp; + auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; + + if ((auxendp != 0 || partdet != 0) && builtin_reply_writer_ != nullptr) + { + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote reader from the local Builtin Reply Writer"); + tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_reader; + builtin_reply_writer_->matched_reader_remove(tmp_guid); + } +} + +SampleIdentity TypeLookupManager::get_type_dependencies( + const xtypes::TypeIdentifierSeq& id_seq, + const fastrtps::rtps::GUID_t& type_server, + const std::vector& continuation_point) const +{ + TypeLookup_getTypeDependencies_In in; + in.type_ids(id_seq); + if (!continuation_point.empty()) + { + in.continuation_point(continuation_point); + } + + // Create a generic TypeLookup_Request + TypeLookup_RequestPubSubType type; + TypeLookup_Request* request = create_request(type_server, type); + + // Add the specific data to the request + request->data().getTypeDependencies(in); + + SampleIdentity id = INVALID_SAMPLE_IDENTITY; + if (send(*request)) + { + id = request->header().requestId(); + } + // Delete request data after sending + type.deleteData(request); + return id; +} + +SampleIdentity TypeLookupManager::get_types( + const xtypes::TypeIdentifierSeq& id_seq, + const fastrtps::rtps::GUID_t& type_server) const +{ + TypeLookup_getTypes_In in; + in.type_ids(id_seq); + + // Create a generic TypeLookup_Request + TypeLookup_RequestPubSubType type; + TypeLookup_Request* request = create_request(type_server, type); + + // Add the specific data to the request + request->data().getTypes(in); + + SampleIdentity id = INVALID_SAMPLE_IDENTITY; + if (send(*request)) + { + id = request->header().requestId(); + } + // Delete request data after sending + type.deleteData(request); + return id; +} + +ReturnCode_t TypeLookupManager::async_get_type( + eprosima::ProxyPool::smart_ptr& temp_writer_data, + const AsyncGetTypeWriterCallback& callback) +{ + return check_type_identifier_received( + temp_writer_data, callback, async_get_type_writer_callbacks_); +} + +ReturnCode_t TypeLookupManager::async_get_type( + eprosima::ProxyPool::smart_ptr& temp_reader_data, + const AsyncGetTypeReaderCallback& callback) +{ + return check_type_identifier_received( + temp_reader_data, callback, async_get_type_reader_callbacks_); +} + +template +ReturnCode_t TypeLookupManager::check_type_identifier_received( + typename eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const AsyncCallback& callback, + std::unordered_map::smart_ptr, + AsyncCallback>>>& async_get_type_callbacks) +{ + xtypes::TypeIdentfierWithSize type_identifier_with_size = + temp_proxy_data->type_information().type_information.complete().typeid_with_size(); + fastrtps::rtps::GUID_t type_server = temp_proxy_data->guid(); + + // Check if the type is known + if (fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + is_type_identifier_known(type_identifier_with_size)) + { + // The type is already known, invoke the callback + callback(temp_proxy_data); + return RETCODE_OK; + } + + { + // Check if TypeIdentfierWithSize already exists in the map + std::lock_guard lock(async_get_types_mutex_); + auto it = async_get_type_callbacks.find(type_identifier_with_size); + if (it != async_get_type_callbacks.end()) + { + // TypeIdentfierWithSize exists, add the callback + it->second.push_back(std::make_pair(std::move(temp_proxy_data), callback)); + // Return without sending new request + return RETCODE_NO_DATA; + } + } + + // TypeIdentfierWithSize doesn't exist, create a new entry + SampleIdentity get_type_dependencies_request = get_type_dependencies( + {type_identifier_with_size.type_id()}, type_server); + if (INVALID_SAMPLE_IDENTITY != get_type_dependencies_request) + { + // Store the sent requests and callback + add_async_get_type_request(get_type_dependencies_request, type_identifier_with_size); + std::vector::smart_ptr, AsyncCallback>> types; + types.push_back(std::make_pair(std::move(temp_proxy_data), callback)); + async_get_type_callbacks.emplace(type_identifier_with_size, std::move(types)); + + return RETCODE_NO_DATA; + } + else + { + // Failed to send request, return error + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Failed to send get_type_dependencies request"); + return RETCODE_ERROR; + } +} + +void TypeLookupManager::notify_callbacks( + xtypes::TypeIdentfierWithSize type_identifier_with_size) +{ + bool removed = false; + // Check that type is pending to be resolved + auto writer_callbacks_it = async_get_type_writer_callbacks_.find(type_identifier_with_size); + if (writer_callbacks_it != async_get_type_writer_callbacks_.end()) + { + for (auto& proxy_callback_pair : writer_callbacks_it->second) + { + proxy_callback_pair.second(proxy_callback_pair.first); + } + removed = true; + } + + auto reader_callbacks_it = async_get_type_reader_callbacks_.find(type_identifier_with_size); + if (reader_callbacks_it != async_get_type_reader_callbacks_.end()) + { + for (auto& proxy_callback_pair : reader_callbacks_it->second) + { + proxy_callback_pair.second(proxy_callback_pair.first); + } + removed = true; + } + + if (removed) + { + // Erase the solved TypeIdentfierWithSize + remove_async_get_type_callback(type_identifier_with_size); + } +} + +bool TypeLookupManager::add_async_get_type_request( + const SampleIdentity& request, + const xtypes::TypeIdentfierWithSize& type_identifier_with_size) +{ + std::lock_guard lock(async_get_types_mutex_); + try + { + async_get_type_requests_.emplace(request, type_identifier_with_size); + return true; + } + catch (const std::exception& e) + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, + "Error in TypeLookupManager::add_async_get_type_request: " << e.what()); + return false; + } + +} + +bool TypeLookupManager::remove_async_get_type_callback( + const xtypes::TypeIdentfierWithSize& type_identifier_with_size) +{ + std::lock_guard lock(async_get_types_mutex_); + try + { + bool removed = false; + + // Check if the key is in the writer map + auto writer_it = async_get_type_writer_callbacks_.find(type_identifier_with_size); + if (writer_it != async_get_type_writer_callbacks_.end()) + { + async_get_type_writer_callbacks_.erase(writer_it); + removed = true; + } + // Check if the key is in the reader map + auto reader_it = async_get_type_reader_callbacks_.find(type_identifier_with_size); + if (reader_it != async_get_type_reader_callbacks_.end()) + { + async_get_type_reader_callbacks_.erase(reader_it); + removed = true; + } + + if (!removed) + { + // If not found in either map, log an error + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, + "Error in TypeLookupManager::remove_async_get_type_callback: Key not found"); + } + return removed; + } + catch (const std::exception& e) + { + // Log any exception that might occur during erasure + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, + "Error in TypeLookupManager::remove_async_get_type_callback: " << e.what()); + return false; + } + +} + +bool TypeLookupManager::remove_async_get_type_request( + SampleIdentity request) +{ + std::unique_lock lock(async_get_types_mutex_); + try + { + async_get_type_requests_.erase(request); + return true; + } + catch (const std::exception& e) + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, + "Error in TypeLookupManager::remove_async_get_type_request: " << e.what()); + return false; + } +} + +bool TypeLookupManager::create_endpoints() +{ + bool ret = true; + + const RTPSParticipantAttributes& pattr = participant_->getRTPSParticipantAttributes(); + + // Built-in history attributes. + HistoryAttributes hatt; + hatt.initialReservedCaches = 20; + hatt.maximumReservedCaches = 1000; + hatt.payloadMaxSize = TYPELOOKUP_DATA_MAX_SIZE; + + WriterAttributes watt; + watt.endpoint.unicastLocatorList = builtin_protocols_->m_metatrafficUnicastLocatorList; + watt.endpoint.multicastLocatorList = builtin_protocols_->m_metatrafficMulticastLocatorList; + watt.endpoint.external_unicast_locators = builtin_protocols_->m_att.metatraffic_external_unicast_locators; + watt.endpoint.ignore_non_matching_locators = pattr.ignore_non_matching_locators; + watt.endpoint.remoteLocatorList = builtin_protocols_->m_initialPeersList; + watt.matched_readers_allocation = pattr.allocation.participants; + watt.endpoint.topicKind = fastrtps::rtps::NO_KEY; + watt.endpoint.reliabilityKind = fastrtps::rtps::RELIABLE; + watt.endpoint.durabilityKind = fastrtps::rtps::VOLATILE; + watt.mode = fastrtps::rtps::ASYNCHRONOUS_WRITER; + + ReaderAttributes ratt; + ratt.endpoint.unicastLocatorList = builtin_protocols_->m_metatrafficUnicastLocatorList; + ratt.endpoint.multicastLocatorList = builtin_protocols_->m_metatrafficMulticastLocatorList; + ratt.endpoint.external_unicast_locators = builtin_protocols_->m_att.metatraffic_external_unicast_locators; + ratt.endpoint.ignore_non_matching_locators = pattr.ignore_non_matching_locators; + ratt.endpoint.remoteLocatorList = builtin_protocols_->m_initialPeersList; + ratt.matched_writers_allocation = pattr.allocation.participants; + ratt.expectsInlineQos = true; + ratt.endpoint.topicKind = fastrtps::rtps::NO_KEY; + ratt.endpoint.reliabilityKind = fastrtps::rtps::RELIABLE; + ratt.endpoint.durabilityKind = fastrtps::rtps::VOLATILE; + + // Built-in request writer + request_listener_ = new TypeLookupRequestListener(this); + builtin_request_writer_history_ = new WriterHistory(hatt); + + RTPSWriter* req_writer; + if (participant_->createWriter( + &req_writer, + watt, + builtin_request_writer_history_, + request_listener_, + fastrtps::rtps::c_EntityId_TypeLookup_request_writer, + true)) + { + builtin_request_writer_ = dynamic_cast(req_writer); + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup request writer created."); + } + else + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request writer creation failed."); + ret = false; + } + + // Built-in request reader + builtin_request_reader_history_ = new ReaderHistory(hatt); + + RTPSReader* req_reader; + if (participant_->createReader( + &req_reader, + ratt, + builtin_request_reader_history_, + request_listener_, + fastrtps::rtps::c_EntityId_TypeLookup_request_reader, + true)) + { + builtin_request_reader_ = dynamic_cast(req_reader); + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup request reader created."); + } + else + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request reader creation failed."); + ret = false; + } + + // Built-in reply writer + reply_listener_ = new TypeLookupReplyListener(this); + builtin_reply_writer_history_ = new WriterHistory(hatt); + + RTPSWriter* rep_writer; + if (participant_->createWriter( + &rep_writer, + watt, + builtin_reply_writer_history_, + reply_listener_, + fastrtps::rtps::c_EntityId_TypeLookup_reply_writer, + true)) + { + builtin_reply_writer_ = dynamic_cast(rep_writer); + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply writer created."); + } + else + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply writer creation failed."); + ret = false; + } + + // Built-in reply reader + builtin_reply_reader_history_ = new ReaderHistory(hatt); + + RTPSReader* rep_reader; + if (participant_->createReader( + &rep_reader, + ratt, + builtin_reply_reader_history_, + reply_listener_, + fastrtps::rtps::c_EntityId_TypeLookup_reply_reader, + true)) + { + builtin_reply_reader_ = dynamic_cast(rep_reader); + EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply reader created."); + } + else + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply reader creation failed."); + ret = false; + } + + // Clean up if something failed. + if (!ret) + { + if (nullptr != builtin_request_writer_history_) + { + delete builtin_request_writer_history_; + builtin_request_writer_history_ = nullptr; + } + + if (nullptr != builtin_reply_writer_history_) + { + delete builtin_reply_writer_history_; + builtin_reply_writer_history_ = nullptr; + } + + if (nullptr != builtin_request_reader_history_) + { + delete builtin_request_reader_history_; + builtin_request_reader_history_ = nullptr; + } + + if (nullptr != builtin_reply_reader_history_) + { + delete builtin_reply_reader_history_; + builtin_reply_reader_history_ = nullptr; + } + + if (nullptr != request_listener_) + { + delete request_listener_; + request_listener_ = nullptr; + } + if (nullptr != reply_listener_) + { + delete reply_listener_; + reply_listener_ = nullptr; + } + } + + return ret; +} + +TypeLookup_Request* TypeLookupManager::create_request( + const fastrtps::rtps::GUID_t& type_server, + TypeLookup_RequestPubSubType& pupsubtype) const +{ + TypeLookup_Request* request = static_cast(pupsubtype.createData()); + request->header().instanceName() = get_instance_name(type_server); + request->header().requestId().writer_guid(guid_rtps_2_dds(builtin_request_writer_->getGuid())); + request->header().requestId().sequence_number(sequence_number_rtps_2_dds(request_seq_number_)); + request_seq_number_++; + return request; +} + +bool TypeLookupManager::send( + TypeLookup_Request& request) const +{ + if (!send_impl(request, &request_type_, builtin_request_writer_, builtin_request_writer_history_)) + { + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE, "Error sending request."); + return false; + } + return true; +} + +bool TypeLookupManager::send( + TypeLookup_Reply& reply) const +{ + if (!send_impl(reply, &reply_type_, builtin_reply_writer_, builtin_reply_writer_history_)) + { + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE, "Error sending reply."); + return false; + } + return true; +} + +template +bool TypeLookupManager::send_impl( + Type& msg, + PubSubType* pubsubtype, + fastrtps::rtps::StatefulWriter* writer, + fastrtps::rtps::WriterHistory* writer_history) const +{ + // Create a new CacheChange_t using the provided StatefulWriter + CacheChange_t* change = writer->new_change( + [&msg]() + { + // Calculate the serialized size of the message using a CdrSizeCalculator + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size(msg, current_alignment) + 4); + }, + ALIVE); + + // Check if the creation of CacheChange_t was successful + if (!change) + { + return false; + } + + // Prepare the payload for sending the message + SerializedPayload_t payload; + payload.max_size = change->serializedPayload.max_size; + payload.data = change->serializedPayload.data; + + // Serialize the message using the provided PubSubType + bool result = pubsubtype->serialize(&msg, &payload, DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); + // If serialization was successful, update the change and add it to the WriterHistory + if (result) + { + change->serializedPayload.length += payload.length; + change->serializedPayload.pos += payload.pos; + result = writer_history->add_change(change); + } + // Release the payload data + payload.data = nullptr; + + // If adding the change to WriterHistory failed, remove the change + if (!result) + { + writer_history->remove_change(change); + } + + return result; +} + +bool TypeLookupManager::prepare_receive_payload( + fastrtps::rtps::CacheChange_t& change, + SerializedPayload_t& payload) const +{ + CDRMessage_t msg(change.serializedPayload); + msg.pos += 1; + + payload.max_size = change.serializedPayload.max_size; + payload.length = change.serializedPayload.length; + payload.data = change.serializedPayload.data; + return true; +} + +bool TypeLookupManager::receive( + fastrtps::rtps::CacheChange_t& change, + TypeLookup_Request& request) const +{ + if (!receive_impl(change, request, &request_type_)) + { + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE, "Error receiving request."); + return false; + } + + //Compare only the "dds.builtin.TOS." + guid.guidPrefix + if ((request.header().instanceName().to_string()).substr(0, 40) != local_instance_name_.substr(0, 40)) + { + // Ignore request + return false; + } + return true; +} + +bool TypeLookupManager::receive( + fastrtps::rtps::CacheChange_t& change, + TypeLookup_Reply& reply) const +{ + if (!receive_impl(change, reply, &reply_type_)) + { + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE, "Error receiving reply."); + return false; + } + + if (guid_dds_2_rtps(reply.header().relatedRequestId().writer_guid()) != builtin_request_writer_->getGuid()) + { + // Ignore reply + return false; + } + return true; +} + +template +bool TypeLookupManager::receive_impl( + fastrtps::rtps::CacheChange_t& change, + Type& msg, + PubSubType* pubsubtype) const +{ + SerializedPayload_t payload; + if (!prepare_receive_payload(change, payload)) + { + return false; + } + + bool result = pubsubtype->deserialize(&payload, &msg); + payload.data = nullptr; + + return result; +} + +std::string TypeLookupManager::get_instance_name( + const fastrtps::rtps::GUID_t guid) const +{ + std::stringstream ss; + ss << std::hex; + for (const auto& elem : guid.guidPrefix.value) + { + ss << std::setw(2) << std::setfill('0') << static_cast(elem); + } + for (const auto& elem : guid.entityId.value) + { + ss << std::setw(2) << std::setfill('0') << static_cast(elem); + } + + std::string str = ss.str(); + std::transform(str.begin(), str.end(), str.begin(), + [](unsigned char c) + { + return static_cast(std::tolower(c)); + }); + return "dds.builtin.TOS." + str; +} + +void TypeLookupManager::remove_builtin_request_writer_history_change( + fastrtps::rtps::CacheChange_t* change) +{ + builtin_request_writer_history_->remove_change(change); +} + +void TypeLookupManager::remove_builtin_reply_writer_history_change( + fastrtps::rtps::CacheChange_t* change) +{ + builtin_reply_writer_history_->remove_change(change); +} + +} // namespace builtin + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp new file mode 100644 index 00000000000..a9b90c92bb3 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp @@ -0,0 +1,445 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupManager.hpp + * + */ + +#ifndef _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_MANAGER_HPP_ +#define _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_MANAGER_HPP_ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace std { + +template<> +struct hash +{ + std::size_t operator ()( + const eprosima::fastdds::dds::xtypes::TypeInformation& k) const + { + return (static_cast(k.complete().typeid_with_size().type_id().equivalence_hash()[0]) << 16) | + (static_cast(k.complete().typeid_with_size().type_id().equivalence_hash()[1]) << 8) | + (static_cast(k.complete().typeid_with_size().type_id().equivalence_hash()[2])); + } + +}; + +template <> +struct hash +{ + std::size_t operator ()( + const eprosima::fastdds::dds::SampleIdentity& k) const + { + std::size_t hash_value = 0; + + // Hash m_writer_guid + for (const auto& byte : k.writer_guid().guidPrefix()) + { + hash_value ^= std::hash{}(byte); + } + + hash_value ^= std::hash{}(k.writer_guid().entityId().entityKind()); + + // Hash m_entityKey of m_writer_guid's EntityId_t + for (const auto& byte : k.writer_guid().entityId().entityKey()) + { + hash_value ^= std::hash{}(byte); + } + + // Hash m_sequence_number + hash_value ^= std::hash{}(k.sequence_number().high()); + hash_value ^= std::hash{}(k.sequence_number().low()); + + return hash_value; + } + +}; + +} // std + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class BuiltinProtocols; +class ReaderHistory; +class RTPSParticipantImpl; +class StatefulReader; +class StatefulWriter; +class ParticipantProxyData; +class WriterHistory; + +} // namespace rtps +} // namespace fastrtps + +namespace fastdds { +namespace dds { +namespace builtin { + +const SampleIdentity INVALID_SAMPLE_IDENTITY; + +using AsyncGetTypeWriterCallback = std::function< + void (eprosima::ProxyPool::smart_ptr&)>; +using AsyncGetTypeReaderCallback = std::function< + void (eprosima::ProxyPool::smart_ptr&)>; + +/** + * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.3 specification. + * @ingroup XTYPES + */ +class TypeLookupManager +{ + friend class TypeLookupRequestListener; + friend class TypeLookupRequestWListener; + friend class TypeLookupReplyListener; + friend class TypeLookupReplyWListener; + +public: + + /** + * Constructor + */ + TypeLookupManager(); + + virtual ~TypeLookupManager(); + + /** + * Stores pointers to the RTPSParticipantImpl and BuiltinProtocols and creates temp + * ReaderProxyData and WriterProxyData objects for the TypeLookupManager. + * @param prot Pointer to the BuiltinProtocols object. + * @return true if members and endpoints are created, false otherwise. + */ + bool init( + fastrtps::rtps::BuiltinProtocols* protocols); + /** + * Assign the remote endpoints for a newly discovered RTPSParticipant. + * @param pdata Pointer to the RTPSParticipantProxyData object. + * @return True if correct. + */ + bool assign_remote_endpoints( + const fastrtps::rtps::ParticipantProxyData& pdata); + + /** + * Remove remote endpoints from the typelookup service. + * @param pdata Pointer to the ParticipantProxyData to remove. + */ + void remove_remote_endpoints( + fastrtps::rtps::ParticipantProxyData* pdata); + + /** + * Create and send a request using the builtin TypeLookup Service to retrieve all the type dependencies + * associated with a sequence of TypeIdentifiers. + * @param id_seq[in] Sequence of TypeIdentifiers for which dependencies are needed. + * @param type_server[in] GUID corresponding to the remote participant which TypeInformation is being resolved. + * @param continuation_point[in] Continuation point for a previous partially answered request. + * @return The SampleIdentity of the sent request. + */ + SampleIdentity get_type_dependencies( + const xtypes::TypeIdentifierSeq& id_seq, + const fastrtps::rtps::GUID_t& type_server, + const std::vector& continuation_point = std::vector()) const; + + /** + * Create and send a request using the built-in TypeLookup Service to retrieve TypeObjects associated with a + * sequence of TypeIdentifiers. + * @param id_seq[in] Sequence of TypeIdentifiers for which TypeObjects are to be retrieved. + * @param type_server[in] GUID corresponding to the remote participant whose TypeInformation is being resolved. + * @return The SampleIdentity of the sent request. + */ + SampleIdentity get_types( + const xtypes::TypeIdentifierSeq& id_seq, + const fastrtps::rtps::GUID_t& type_server) const; + + /** + * Use builtin TypeLookup service to solve the type and dependencies of a given TypeInformation. + * It receives a callback that will be used to notify when the negotiation is complete. + * @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request. + * @param callback Callback called when the negotiation is complete. + * @return ReturnCode_t RETCODE_OK if the type is already known. + * RETCODE_NO_DATA if type is not known, and a negotiation has been started. + * RETCODE_ERROR if any request was not sent correctly. + */ + ReturnCode_t async_get_type( + eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const AsyncGetTypeWriterCallback& callback); + ReturnCode_t async_get_type( + eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const AsyncGetTypeReaderCallback& callback); + +protected: + + /** + * Checks if the given TypeIdentfierWithSize is known by the TypeObjectRegistry. + * Uses get_type_dependencies() and get_types() to get those that are not known. + * Adds a callback to the async_get_type_callbacks_ entry of the TypeIdentfierWithSize, or creates a new one if + * TypeIdentfierWithSize was not in the map before + * @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request. + * @param callback[in] Callback to add. + * @param async_get_type_callbacks[in] The collection ProxyData and their callbacks to use. + * @return ReturnCode_t RETCODE_OK if type is known. + * RETCODE_NO_DATA if the type is being discovered. + * RETCODE_ERROR if the request was not sent or the callback was not added correctly. + */ + template + ReturnCode_t check_type_identifier_received( + typename eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const AsyncCallback& callback, + std::unordered_map::smart_ptr, + AsyncCallback>>>& async_get_type_callbacks); + + /** + * Notifies callbacks for a given TypeIdentfierWithSize. + * @param type_identifier_with_size[in] TypeIdentfierWithSize of the callbacks to notify. + */ + void notify_callbacks( + xtypes::TypeIdentfierWithSize type_identifier_with_size); + + /** + * Adds a callback to the async_get_type_callbacks_ entry of the TypeIdentfierWithSize, or creates a new one if + * TypeIdentfierWithSize was not in the map before. + * @param request[in] SampleIdentity of the request. + * @param type_identifier_with_size[in] TypeIdentfierWithSize that originated the request. + * @return true if added. false otherwise. + */ + bool add_async_get_type_request( + const SampleIdentity& request, + const xtypes::TypeIdentfierWithSize& type_identifier_with_size ); + + /** + * Removes a TypeIdentfierWithSize from the async_get_type_callbacks_. + * @param type_identifier_with_size[in] TypeIdentfierWithSize to be removed. + * @return true if removed, false otherwise. + */ + bool remove_async_get_type_callback( + const xtypes::TypeIdentfierWithSize& type_identifier_with_size); + + /** + * Removes a SampleIdentity from the async_get_type_callbacks_. + * @param request[in] SampleIdentity to be removed. + * @return true if removed, false otherwise. + */ + bool remove_async_get_type_request( + SampleIdentity request); + + /** + * Creates a TypeLookup_Request for the given type_server. + * @param type_server[in] GUID corresponding to the remote participant. + * @param pupsubtype[out] PubSubType in charge of TypeLookup_Request . + * @return the TypeLookup_Request created. + */ + TypeLookup_Request* create_request( + const fastrtps::rtps::GUID_t& type_server, + TypeLookup_RequestPubSubType& pupsubtype) const; + + /** + * Uses the send_impl with the appropriate parameters. + * @param request[in] TypeLookup_Request to be sent. + * @return true if request was sent, false otherwise. + */ + bool send( + TypeLookup_Request& request) const; + /** + * Uses the send_impl with the appropriate parameters. + * @param reply[in] TypeLookup_Reply to be sent. + * @return true if reply was sent, false otherwise. + */ + bool send( + TypeLookup_Reply& reply) const; + + /** + * Implementation for the send methods. + * Creates CacheChange, serializes the message and adds change to writer history. + * @param msg[in] Message to be sent. + * @param pubsubtype[in] PubSubType of the msg. + * @param writer[in]Pointer to the RTPSWriter. + * @param writer_history[in] Pointer to the Writer History. + * @return true if message was sent, false otherwise. + */ + template + bool send_impl( + Type& msg, + PubSubType* pubsubtype, + fastrtps::rtps::StatefulWriter* writer, + fastrtps::rtps::WriterHistory* writer_history) const; + + /** + * Prepares the received payload of a CacheChange before deserializing. + * @param change[in] CacheChange_t received. + * @param payload[out] SerializedPayload_t prepared. + * @return true if received payload is prepared, false otherwise. + */ + bool prepare_receive_payload( + fastrtps::rtps::CacheChange_t& change, + fastrtps::rtps::SerializedPayload_t& payload) const; + + /** + * Uses the receive_impl with the appropriate parameters and checks if it is directed to the local DomainParticipant. + * @param change[in] CacheChange_t of the request. + * @param request[out] TypeLookup_Request after deserialization. + * @return true if the request is deserialized and directed to the local participant, false otherwise. + */ + bool receive( + fastrtps::rtps::CacheChange_t& change, + TypeLookup_Request& request) const; + + /** + * Uses the receive_impl with the appropriate parameters and checks if the reply's recipient is the local participant. + * @param change[in] CacheChange_t of the reply. + * @param reply[out] TypeLookup_Reply after deserialization. + * @return true if the request is deserialized and the reply's recipient is us, false otherwise. + */ + bool receive( + fastrtps::rtps::CacheChange_t& change, + TypeLookup_Reply& reply) const; + + /** + * Implementation for the receive methods. + * Derializes the message received. + * @param change[in] CacheChange_t of the message. + * @param msg[in] Message to be sent. + * @param pubsubtype[in] PubSubType of the msg. + * @return true if message is correct, false otherwise. + */ + template + bool receive_impl( + fastrtps::rtps::CacheChange_t& change, + Type& msg, + PubSubType* pubsubtype) const; + + /** + * Get the RTPS participant + * @return RTPS participant + */ + inline fastrtps::rtps::RTPSParticipantImpl* get_RTPS_participant() + { + return participant_; + } + + /** + * Create instance name as defined in section 7.6.3.3.4 XTypes 1.3 specification. + * @param guid[in] GUID to be included in the instance name. + * @return The instance name. + */ + std::string get_instance_name( + const fastrtps::rtps::GUID_t guid) const; + + /** + * Create the builtin endpoints used in the TypeLookupManager. + * @return true if correct. + */ + bool create_endpoints(); + + /** + * Removes a change from the builtin_request_writer_history_. + * @param change[in] CacheChange_t to be removed. + */ + void remove_builtin_request_writer_history_change( + fastrtps::rtps::CacheChange_t* change); + + /** + * Removes a change from the builtin_reply_writer_history_. + * @param change[in] CacheChange_t to be removed. + */ + void remove_builtin_reply_writer_history_change( + fastrtps::rtps::CacheChange_t* change); + + //! Pointer to the local RTPSParticipant. + fastrtps::rtps::RTPSParticipantImpl* participant_ = nullptr; + + //! Own instance name. + std::string local_instance_name_; + + //! Pointer to the BuiltinProtocols class. + fastrtps::rtps::BuiltinProtocols* builtin_protocols_ = nullptr; + + //! Pointer to the RTPSWriter for the TypeLookup_Request. + fastrtps::rtps::StatefulWriter* builtin_request_writer_ = nullptr; + + //! Pointer to the RTPSReader for the TypeLookup_Request. + fastrtps::rtps::StatefulReader* builtin_request_reader_ = nullptr; + + //! Pointer to the RTPSWriter for the TypeLookup_Reply. + fastrtps::rtps::StatefulWriter* builtin_reply_writer_ = nullptr; + + //! Pointer to the RTPSReader for the TypeLookup_Reply. + fastrtps::rtps::StatefulReader* builtin_reply_reader_ = nullptr; + + //! Pointer to the Writer History of TypeLookup_Request. + fastrtps::rtps::WriterHistory* builtin_request_writer_history_ = nullptr; + + //! Pointer to the Writer History of TypeLookup_Reply. + fastrtps::rtps::WriterHistory* builtin_reply_writer_history_ = nullptr; + + //! Pointer to the Reader History of TypeLookup_Request. + fastrtps::rtps::ReaderHistory* builtin_request_reader_history_ = nullptr; + + //! Pointer to the Reader History of TypeLookup_Reply. + fastrtps::rtps::ReaderHistory* builtin_reply_reader_history_ = nullptr; + + //! Request Listener object. + TypeLookupRequestListener* request_listener_ = nullptr; + + //! Reply Listener object. + TypeLookupReplyListener* reply_listener_ = nullptr; + + //! Mutex to protect access to temp_reader_proxy_data_ and temp_writer_proxy_data_. + std::mutex temp_data_lock_; + + //! Pointer to the temp ReaderProxyData used for assigments. + fastrtps::rtps::ReaderProxyData* temp_reader_proxy_data_ = nullptr; + + //! Pointer to the temp WriterProxyData used for assigments. + fastrtps::rtps::WriterProxyData* temp_writer_proxy_data_ = nullptr; + + mutable fastrtps::rtps::SequenceNumber_t request_seq_number_; + mutable TypeLookup_RequestPubSubType request_type_; + mutable TypeLookup_ReplyPubSubType reply_type_; + + //! Mutex to protect access to async_get_type_callbacks_ and async_get_type_requests_. + std::mutex async_get_types_mutex_; + + //! Collection of all the WriterProxyData and their callbacks related to a TypeIdentfierWithSize, hashed by its TypeIdentfierWithSize. + std::unordered_map < xtypes::TypeIdentfierWithSize, + std::vector::smart_ptr, + AsyncGetTypeWriterCallback>>> async_get_type_writer_callbacks_; + + //! Collection of all the ReaderProxyData and their callbacks related to a TypeIdentfierWithSize, hashed by its TypeIdentfierWithSize. + std::unordered_map < xtypes::TypeIdentfierWithSize, + std::vector::smart_ptr, + AsyncGetTypeReaderCallback>>> async_get_type_reader_callbacks_; + + //! Collection of all SampleIdentity and the TypeIdentfierWithSize it originated from, hashed by its SampleIdentity. + std::unordered_map async_get_type_requests_; +}; + +} /* namespace builtin */ +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ +#endif /* _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_MANAGER_HPP_ */ diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp new file mode 100644 index 00000000000..8823824099e --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp @@ -0,0 +1,327 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupReplyListener.cpp + * + */ + +#include + +#include + +#include +#include +#include + +using eprosima::fastrtps::rtps::RTPSReader; +using eprosima::fastrtps::rtps::CacheChange_t; +using eprosima::fastdds::dds::Log; +using eprosima::fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace builtin { + +TypeLookupReplyListener::TypeLookupReplyListener( + TypeLookupManager* manager) + : typelookup_manager_(manager) +{ + start_reply_processor_thread(); +} + +TypeLookupReplyListener::~TypeLookupReplyListener() +{ + stop_reply_processor_thread(); +} + +void TypeLookupReplyListener::start_reply_processor_thread() +{ + std::unique_lock guard(replies_processor_cv_mutex_); + // Check if is not already in progress and the thread is not joinable + if (!processing_ && !replies_processor_thread.joinable()) + { + processing_ = true; + // Lambda function to be executed by the thread + auto thread_func = [this]() + { + process_reply(); + }; + // Create and start the processing thread + replies_processor_thread = eprosima::create_thread(thread_func, + typelookup_manager_->participant_->getAttributes().typelookup_service_thread, + "dds.tls.replies.%u"); + } +} + +void TypeLookupReplyListener::stop_reply_processor_thread() +{ + { + // Set processing_ to false to signal the processing thread to stop + std::unique_lock guard(replies_processor_cv_mutex_); + processing_ = false; + } + + if (replies_processor_thread.joinable()) + { + // Notify the processing thread to wake up and check the exit condition + replies_processor_cv_.notify_all(); + // Check if the calling thread is not the processing thread and join it + if (!replies_processor_thread.is_calling_thread()) + { + replies_processor_thread.join(); + } + } +} + +void TypeLookupReplyListener::process_reply() +{ + std::unique_lock guard(replies_processor_cv_mutex_); + + while (processing_) + { + // Wait until either processing is done or there are replies in the queue + replies_processor_cv_.wait(guard, + [&]() + { + return !processing_ || !replies_queue_.empty(); + }); + + if (!replies_queue_.empty()) + { + TypeLookup_Reply& reply = replies_queue_.front().reply; + { + // Process the TypeLookup_Reply based on its type + switch (reply.return_value()._d()) + { + case TypeLookup_getTypes_HashId: + { + check_get_types_reply(reply.header().relatedRequestId(), + reply.return_value().getType().result(), reply.header().relatedRequestId()); + break; + } + case TypeLookup_getDependencies_HashId: + { + check_get_type_dependencies_reply( + reply.header().relatedRequestId(), replies_queue_.front().type_server, + reply.return_value().getTypeDependencies().result()); + break; + } + default: + // If the type of request is not known, log an error + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REPLY_LISTENER, + "Received unknown reply operation type in type lookup service."); + break; + } + } + // Remove the requests from the queue + replies_queue_.pop(); + } + } +} + +void TypeLookupReplyListener::check_get_types_reply( + const SampleIdentity& request_id, + const TypeLookup_getTypes_Out& reply, + SampleIdentity related_request) +{ + // Check if the received reply SampleIdentity corresponds to an outstanding request + auto requests_it = typelookup_manager_->async_get_type_requests_.find(request_id); + if (requests_it != typelookup_manager_->async_get_type_requests_.end()) + { + ReturnCode_t register_result = RETCODE_OK; + for (xtypes::TypeIdentifierTypeObjectPair pair : reply.types()) + { + if (RETCODE_OK != fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + register_type_object(pair.type_identifier(), pair.type_object())) + { + // If any of the types is not registered, log error + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REPLY_LISTENER, + "Error registering remote type"); + register_result = RETCODE_ERROR; + } + } + + if (RETCODE_OK == register_result) + { + // Check if the get_type_dependencies related to this reply required a continuation_point + std::unique_lock guard(replies_with_continuation_mutex_); + auto it = std::find(replies_with_continuation_.begin(), replies_with_continuation_.end(), related_request); + if (it != replies_with_continuation_.end()) + { + // If it did, remove it from the list and continue + replies_with_continuation_.erase(it); + } + else + { + // If it did not, check that the type that originated the request is consistent + // before notifying the callbacks associated with the request + try + { + xtypes::TypeObject type_object; + fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer().get_type_object( + requests_it->second.type_id(), type_object); + xtypes::TypeObjectUtils::type_object_consistency(type_object); + + typelookup_manager_->notify_callbacks(requests_it->second); + } + catch (const std::exception& exception) + { + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE_REPLY_LISTENER, + "Error registering remote type: " << exception.what()); + } + } + } + + // Remove the processed SampleIdentity from the outstanding requests + typelookup_manager_->remove_async_get_type_request(request_id); + } +} + +void TypeLookupReplyListener::check_get_type_dependencies_reply( + const SampleIdentity& request_id, + const fastrtps::rtps::GUID_t type_server, + const TypeLookup_getTypeDependencies_Out& reply) +{ + // Check if the received reply SampleIdentity corresponds to an outstanding request + auto requests_it = typelookup_manager_->async_get_type_requests_.find(request_id); + if (requests_it == typelookup_manager_->async_get_type_requests_.end()) + { + // The reply is not associated with any outstanding request, ignore it + return; + } + + // Add the dependent types to the list for the get_type request + xtypes::TypeIdentifierSeq needed_types; + std::unordered_set unique_types; + + for (xtypes::TypeIdentfierWithSize type : reply.dependent_typeids()) + { + // Check if the type is known + if (!fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + is_type_identifier_known(type)) + { + // Insert the type into the unordered_set and check if the insertion was successful + if (unique_types.insert(type.type_id()).second) + { + // If the insertion was successful, it means the type was not already in the set + needed_types.push_back(type.type_id()); + } + // If the insertion was not successful, the type is a duplicate and can be ignored + } + } + + // If there is no continuation point, add the parent type + if (reply.continuation_point().empty()) + { + needed_types.push_back(requests_it->second.type_id()); + } + // Make a new request with the continuation point + else + { + SampleIdentity next_request_id = typelookup_manager_-> + get_type_dependencies({requests_it->second.type_id()}, type_server, + reply.continuation_point()); + if (INVALID_SAMPLE_IDENTITY != next_request_id) + { + // Store the sent requests and associated TypeIdentfierWithSize + typelookup_manager_->add_async_get_type_request(next_request_id, requests_it->second); + } + else + { + // Failed to send request + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE_REPLY_LISTENER, "Failed to send get_type_dependencies request"); + } + } + + // Send the type request + SampleIdentity get_types_request = typelookup_manager_->get_types(needed_types, type_server); + + if (INVALID_SAMPLE_IDENTITY != get_types_request) + { + // Store the type request + typelookup_manager_->add_async_get_type_request(get_types_request, requests_it->second); + + // If this get_types request has a continuation_point, store it in the list + if (!reply.continuation_point().empty()) + { + std::unique_lock guard(replies_with_continuation_mutex_); + replies_with_continuation_.push_back(get_types_request); + } + } + else + { + // Failed to send request + EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE_REPLY_LISTENER, "Failed to send get_types request"); + } + + // Remove the processed SampleIdentity from the outstanding requests + typelookup_manager_->remove_async_get_type_request(request_id); +} + +void TypeLookupReplyListener::onNewCacheChangeAdded( + RTPSReader* reader, + const CacheChange_t* const change_in) +{ + CacheChange_t* change = const_cast(change_in); + + // Check if the data is received from the expected TypeLookup Reply writer + if (change->writerGUID.entityId != c_EntityId_TypeLookup_reply_writer) + { + // Log a warning and remove the change from the history + EPROSIMA_LOG_WARNING(TL_REPLY_READER, "Received data from a bad endpoint."); + reader->getHistory()->remove_change(change); + return; + } + + // Process the received TypeLookup Reply and handle different types of replies + TypeLookup_Reply reply; + if (typelookup_manager_->receive(*change, reply)) + { + // Check if the reply has any exceptions + if (reply.header().remoteEx() != rpc::RemoteExceptionCode_t::REMOTE_EX_OK) + { + // TODO: Implement specific handling for each exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REPLY_LISTENER, + "Received reply with exception code: " << static_cast(reply.header().remoteEx())); + // If the reply was not ok, ignore it + return; + } + + // Add reply to the processing queue + replies_queue_.push(ReplyWithServerGUID{reply, change->writerGUID}); + { + // Notify processor + std::unique_lock guard(replies_processor_cv_mutex_); + replies_processor_cv_.notify_all(); + } + } + + // Remove the processed cache change from the history + reader->getHistory()->remove_change(change); +} + +void TypeLookupReplyListener::onWriterChangeReceivedByAll( + fastrtps::rtps::RTPSWriter*, + fastrtps::rtps::CacheChange_t* change) +{ + typelookup_manager_->remove_builtin_reply_writer_history_change(change); +} + +} // namespace builtin + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.hpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.hpp new file mode 100644 index 00000000000..aa2df3fbaf1 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.hpp @@ -0,0 +1,156 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupReplyListener.hpp + * + */ + +#ifndef _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REPLY_LISTENER_HPP_ +#define _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REPLY_LISTENER_HPP_ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class RTPSReader; +struct CacheChange_t; + +} // namespace rtps +} // namespace fastrtp + +namespace fastdds { +namespace dds { +namespace builtin { + +class TypeLookupManager; + +struct ReplyWithServerGUID +{ + TypeLookup_Reply reply; + fastrtps::rtps::GUID_t type_server; +}; + +/** + * Class TypeLookupReplyListener that receives the typelookup request messages of remote endpoints. + * @ingroup TYPES_MODULE + */ +class TypeLookupReplyListener : public fastrtps::rtps::ReaderListener, public fastrtps::rtps::WriterListener +{ +public: + + /** + * @brief Constructor + * @param manager Pointer to the TypeLookupManager. + */ + TypeLookupReplyListener( + TypeLookupManager* manager); + + /** + * @brief Destructor + */ + virtual ~TypeLookupReplyListener() override; + +protected: + + /** + * @brief Starts the thread that process the received replies. + */ + void start_reply_processor_thread(); + + /** + * @brief Stops the thread that process the received replies. + */ + void stop_reply_processor_thread(); + + /** + * @brief Process the replies in the queue. + */ + void process_reply(); + + /** + * @brief Registers TypeIdentifier and TypeObject in TypeObjectRegistry. + * This method also notifies all type related callbacks and removes the current SampleIdentity from the pending request list. + * @param request_id[in] The SampleIdentity of the request. + * @param reply[in] The reply data. + * @param related_request[in] The request that this reply answers. + */ + void check_get_types_reply( + const SampleIdentity& request_id, + const TypeLookup_getTypes_Out& reply, + SampleIdentity related_request); + + /** + * @brief Checks if all dependencies are solved. + * If they are not, sends next request and adds it to the list. + * If they are, sends get_types request and adds it to the list. + * Also removes the current SampleIdentity from the list. + * @param request_id[in] The SampleIdentity of the request. + * @param type_server[in] GUID corresponding to the remote participant which TypeInformation is being solved. + * @param reply[in] The reply data. + */ + void check_get_type_dependencies_reply( + const SampleIdentity& request_id, + const fastrtps::rtps::GUID_t type_server, + const TypeLookup_getTypeDependencies_Out& reply); + + /** + * @brief Method called when this class is notified of a new cache change. + * @param reader The reader receiving the cache change. + * @param change The cache change. + */ + void onNewCacheChangeAdded( + fastrtps::rtps::RTPSReader* reader, + const fastrtps::rtps::CacheChange_t* const change) override; + + void onWriterChangeReceivedByAll( + fastrtps::rtps::RTPSWriter*, + fastrtps::rtps::CacheChange_t* change) override; + + //! A pointer to the typelookup manager. + TypeLookupManager* typelookup_manager_; + + //! Mutex to protect access to replies_with_continuation_. + std::mutex replies_with_continuation_mutex_; + + //! Collection of the replies that needed continuation points. + std::vector replies_with_continuation_; + + eprosima::thread replies_processor_thread; + std::queue replies_queue_; + std::mutex replies_processor_cv_mutex_; + std::condition_variable replies_processor_cv_; + bool processing_ = false; + rtps::ThreadSettings replies_processor_thread_settings_; +}; + +} /* namespace builtin */ +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ +#endif /* _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REPLY_LISTENER_HPP_*/ diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp new file mode 100644 index 00000000000..608ac76f5f9 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp @@ -0,0 +1,461 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupRequestListener.cpp + * + */ + +#include + +#include + +#include +#include +#include + +using eprosima::fastrtps::rtps::RTPSReader; +using eprosima::fastrtps::rtps::CacheChange_t; +using eprosima::fastdds::dds::Log; + +using eprosima::fastrtps::rtps::c_EntityId_TypeLookup_request_writer; + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace builtin { + +//! Constant that specifies the maximum number of dependent types to be included per reply. +//! This number is calculated considering the MTU. +const int32_t MAX_DEPENDENCIES_PER_REPLY = 75; + +/** + * @brief Calculates the opaque value of continuation point. + * @param continuation_point[in] The continuation point. + * @return The value of the continuation_point. + */ +inline size_t calculate_continuation_point( + const std::vector& continuation_point) +{ + size_t result = 0; + for (size_t i = 0; i < continuation_point.size(); ++i) + { + result = (result << 8) | continuation_point[i]; + } + return result; +} + +/** + * @brief Creates a continuation point with the given value. + * @param value[in] The desired value. + * @return The continuation_point. + */ +inline std::vector create_continuation_point( + size_t value) +{ + std::vector continuation_point(32, 0); + + for (size_t value_i = 0; value_i < value; value_i++) + { + for (size_t i = continuation_point.size() - 1; i != SIZE_MAX; --i) + { + if (continuation_point[i] < 255) + { + ++continuation_point[i]; + // Break after successful increment + break; + } + else + { + continuation_point[i] = 0; + } + } + } + return continuation_point; +} + +TypeLookupRequestListener::TypeLookupRequestListener( + TypeLookupManager* manager) + : typelookup_manager_(manager) +{ + start_request_processor_thread(); +} + +TypeLookupRequestListener::~TypeLookupRequestListener() +{ + stop_request_processor_thread(); +} + +void TypeLookupRequestListener::start_request_processor_thread() +{ + std::unique_lock guard(request_processor_cv_mutex_); + // Check if is not already in progress and the thread is not joinable + if (!processing_ && !request_processor_thread.joinable()) + { + processing_ = true; + // Lambda function to be executed by the thread + auto thread_func = [this]() + { + process_requests(); + }; + // Create and start the processing thread + request_processor_thread = eprosima::create_thread(thread_func, + typelookup_manager_->participant_->getAttributes().typelookup_service_thread, + "dds.tls.requests.%u"); + } +} + +void TypeLookupRequestListener::stop_request_processor_thread() +{ + { + // Set processing_ to false to signal the processing thread to stop + std::unique_lock guard(request_processor_cv_mutex_); + processing_ = false; + } + + if (request_processor_thread.joinable()) + { + // Notify the processing thread to wake up and check the exit condition + request_processor_cv_.notify_all(); + // Check if the calling thread is not the processing thread and join it + if (!request_processor_thread.is_calling_thread()) + { + request_processor_thread.join(); + } + } +} + +void TypeLookupRequestListener::process_requests() +{ + std::unique_lock guard(request_processor_cv_mutex_); + + while (processing_) + { + // Wait until either processing is done or there are requests in the queue + request_processor_cv_.wait(guard, + [&]() + { + return !processing_ || !requests_queue_.empty(); + }); + + if (!requests_queue_.empty()) + { + TypeLookup_Request& request = requests_queue_.front(); + { + // Process the TypeLookup_Request based on its type + switch (request.data()._d()) + { + case TypeLookup_getTypes_HashId: + { + check_get_types_request(request.header().requestId(), request.data().getTypes()); + break; + } + case TypeLookup_getDependencies_HashId: + { + check_get_type_dependencies_request(request.header().requestId(), + request.data().getTypeDependencies()); + break; + } + default: + // If the type of request is not known, log an error and answer with an exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Received unknown request in type lookup service."); + answer_request(request.header().requestId(), + rpc::RemoteExceptionCode_t::REMOTE_EX_UNKNOWN_OPERATION); + break; + } + } + // Remove the requests from the queue + requests_queue_.pop(); + } + } +} + +void TypeLookupRequestListener::check_get_types_request( + SampleIdentity request_id, + const TypeLookup_getTypes_In& request) +{ + // Always Sends EK_COMPLETE + // TODO: Add a property to the participant to configure this behavior. Allowing it to respond with EK_MINIMAL when possible. + TypeLookup_getTypes_Out out; + ReturnCode_t type_result = RETCODE_ERROR; + xtypes::TypeObject obj; + xtypes::TypeIdentifier complete_id; + xtypes::TypeIdentifier minimal_id; + // Iterate through requested type_ids + for (const xtypes::TypeIdentifier& type_id : request.type_ids()) + { + // If TypeIdentifier is EK_MINIMAL add complete_to_minimal to answer + if (type_id._d() == xtypes::EK_MINIMAL) + { + minimal_id = type_id; + // Get complete TypeIdentifier from registry + complete_id = fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + get_complementary_type_identifier(minimal_id); + + xtypes::TypeIdentifierPair id_pair; + id_pair.type_identifier1(complete_id); + id_pair.type_identifier2(minimal_id); + // Add the id pair to the result + out.complete_to_minimal().push_back(std::move(id_pair)); + } + else + { + complete_id = type_id; + } + + type_result = fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + get_type_object(complete_id, obj); + if (RETCODE_OK != type_result) + { + // If any object is unknown, abort and answer with exception + break; + } + + xtypes::TypeIdentifierTypeObjectPair id_obj_pair; + id_obj_pair.type_identifier(complete_id); + id_obj_pair.type_object(obj); + // Add the id/obj pair to the result + out.types().push_back(std::move(id_obj_pair)); + } + + // Handle the result based on the type_result + if (RETCODE_OK == type_result) + { + // Prepare and send the reply for successful operation + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_OK, out); + } + else if (RETCODE_NO_DATA == type_result) + { + // Log error for type not found and reply with appropriate exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Requested TypeIdentifier is not found in the registry."); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_UNKNOWN_EXCEPTION); + } + else if (RETCODE_PRECONDITION_NOT_MET == type_result) + { + // Log error for invalid argument and reply with appropriate exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Requested TypeIdentifier is not a direct hash."); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_INVALID_ARGUMENT); + } +} + +void TypeLookupRequestListener::check_get_type_dependencies_request( + SampleIdentity request_id, + const TypeLookup_getTypeDependencies_In& request) +{ + std::unordered_set type_dependencies; + ReturnCode_t type_dependencies_result = RETCODE_ERROR; + if (!request.type_ids().empty()) + { + // Check if the received request has been done before and needed a continuation point + std::lock_guard lock(requests_with_continuation_mutex_); + if (!request.continuation_point().empty()) + { + auto requests_it = requests_with_continuation_.find(request.type_ids()); + if (requests_it != requests_with_continuation_.end()) + { + // Get the dependencies without checking the registry + type_dependencies = requests_it->second; + type_dependencies_result = RETCODE_OK; + } + else + { + // If the the received request is not found, log error and answer with exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Error processing ongoing type dependencies request."); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_UNKNOWN_EXCEPTION); + } + } + else + { + // Get the dependencies from the registry + type_dependencies_result = + fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). + get_type_dependencies(request.type_ids(), type_dependencies); + + // If there are too many dependent types, store the type dependencies for future requests + if (type_dependencies_result == RETCODE_OK && type_dependencies.size() > MAX_DEPENDENCIES_PER_REPLY) + { + requests_with_continuation_.emplace(request.type_ids(), type_dependencies); + } + } + } + + // Handle the result based on the type_dependencies_result + if (RETCODE_OK == type_dependencies_result) + { + // Prepare and send the reply for successful operation + TypeLookup_getTypeDependencies_Out out = prepare_get_type_dependencies_response( + request.type_ids(), type_dependencies, request.continuation_point()); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_OK, out); + } + else if (RETCODE_NO_DATA == type_dependencies_result) + { + // Log error for type not found and reply with appropriate exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Requested TypeIdentifier is not found in the registry."); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_UNKNOWN_EXCEPTION); + } + else if (RETCODE_BAD_PARAMETER == type_dependencies_result) + { + // Log error for invalid argument and reply with appropriate exception + EPROSIMA_LOG_WARNING(TYPELOOKUP_SERVICE_REQUEST_LISTENER, + "Requested TypeIdentifier is not a direct hash."); + answer_request(request_id, rpc::RemoteExceptionCode_t::REMOTE_EX_INVALID_ARGUMENT); + } +} + +TypeLookup_getTypeDependencies_Out TypeLookupRequestListener::prepare_get_type_dependencies_response( + const xtypes::TypeIdentifierSeq& id_seq, + const std::unordered_set& type_dependencies, + const std::vector& continuation_point) +{ + TypeLookup_getTypeDependencies_Out out; + + // Check if all dependencies can be sent in a single response + if (type_dependencies.size() < MAX_DEPENDENCIES_PER_REPLY) + { + for (const auto& type_identifier : type_dependencies) + { + out.dependent_typeids().emplace_back(type_identifier); + } + } + else + { + size_t start_index = 0; + // Check if a continuation point is provided, and calculate starting point if there is + if (!continuation_point.empty()) + { + start_index = calculate_continuation_point(continuation_point) * MAX_DEPENDENCIES_PER_REPLY; + } + + // Copy the dependencies within the specified range directly to out + auto start_it = std::next(type_dependencies.begin(), start_index); + auto end_it = std::next(start_it, std::min(MAX_DEPENDENCIES_PER_REPLY, + type_dependencies.size() - start_index)); + for (auto it = start_it; it != end_it; ++it) + { + out.dependent_typeids().emplace_back(*it); + } + + if ((start_index + MAX_DEPENDENCIES_PER_REPLY) > type_dependencies.size()) + { + // If all dependent types have been sent, remove from map + std::lock_guard lock(requests_with_continuation_mutex_); + auto requests_it = requests_with_continuation_.find(id_seq); + if (requests_it != requests_with_continuation_.end()) + { + requests_with_continuation_.erase(requests_it); + } + } + else + { + // Set the continuation point for the next request + out.continuation_point(create_continuation_point(calculate_continuation_point(continuation_point) + 1)); + } + } + + return out; +} + +void TypeLookupRequestListener::answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code, + TypeLookup_getTypeDependencies_Out& out) +{ + TypeLookup_Reply* reply = static_cast(typelookup_manager_->reply_type_.createData()); + TypeLookup_getTypeDependencies_Result result; + result.result(out); + reply->return_value().getTypeDependencies(result); + reply->header().relatedRequestId(request_id); + reply->header().remoteEx(exception_code); + + typelookup_manager_->send(*reply); + typelookup_manager_->reply_type_.deleteData(reply); +} + +void TypeLookupRequestListener::answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code, + TypeLookup_getTypes_Out& out) +{ + TypeLookup_Reply* reply = static_cast(typelookup_manager_->reply_type_.createData()); + TypeLookup_getTypes_Result result; + result.result(out); + reply->return_value().getType(result); + reply->header().relatedRequestId(request_id); + reply->header().remoteEx(exception_code); + + typelookup_manager_->send(*reply); + typelookup_manager_->reply_type_.deleteData(reply); +} + +void TypeLookupRequestListener::answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code) +{ + TypeLookup_Reply* reply = static_cast(typelookup_manager_->reply_type_.createData()); + reply->header().relatedRequestId(request_id); + reply->header().remoteEx(exception_code); + + typelookup_manager_->send(*reply); + typelookup_manager_->reply_type_.deleteData(reply); +} + +void TypeLookupRequestListener::onNewCacheChangeAdded( + RTPSReader* reader, + const CacheChange_t* const changeIN) +{ + CacheChange_t* change = const_cast(changeIN); + + // Check if the data is received from the expected TypeLookup Request writer + if (change->writerGUID.entityId != c_EntityId_TypeLookup_request_writer) + { + // Log a warning and remove the change from the history + EPROSIMA_LOG_WARNING(TL_REQUEST_READER, "Received data from a bad endpoint."); + reader->getHistory()->remove_change(change); + return; + } + + // Process the received TypeLookup Request and handle different types of requests + TypeLookup_Request request; + if (typelookup_manager_->receive(*change, request)) + { + // Add request to the processing queue + requests_queue_.push(request); + { + // Notify processor + std::unique_lock guard(request_processor_cv_mutex_); + request_processor_cv_.notify_all(); + } + } + + // Remove the processed cache change from the history + reader->getHistory()->remove_change(change); +} + +void TypeLookupRequestListener::onWriterChangeReceivedByAll( + fastrtps::rtps::RTPSWriter*, + fastrtps::rtps::CacheChange_t* change) +{ + typelookup_manager_->remove_builtin_request_writer_history_change(change); +} + +} // namespace builtin + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.hpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.hpp new file mode 100644 index 00000000000..4ee685e60e9 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.hpp @@ -0,0 +1,195 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TypeLookupRequestListener.hpp + * + */ + +#ifndef _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REQUEST_LISTENER_HPP_ +#define _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REQUEST_LISTENER_HPP_ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace std { + +template <> +struct hash +{ + std::size_t operator ()( + const eprosima::fastdds::dds::xtypes::TypeIdentifierSeq& k) const + { + std::size_t hash_value = 0; + for (const auto& id : k) + { + hash_value ^= (static_cast(id.equivalence_hash()[0]) << 16) | + (static_cast(id.equivalence_hash()[1]) << 8) | + (static_cast(id.equivalence_hash()[2])); + } + return hash_value; + } + +}; + +} // std + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class RTPSReader; +struct CacheChange_t; + +} // namespace rtps +} // namespace fastrtp + +namespace fastdds { +namespace dds { +namespace builtin { + +class TypeLookupManager; + +/** + * Class TypeLookupRequestListener that receives the typelookup request messages of remote endpoints. + * @ingroup TYPES_MODULE + */ +class TypeLookupRequestListener : public fastrtps::rtps::ReaderListener, public fastrtps::rtps::WriterListener +{ +public: + + /** + * @brief Constructor. + * @param manager Pointer to the TypeLookupManager. + */ + TypeLookupRequestListener( + TypeLookupManager* manager); + + /** + * @brief Destructor. + */ + virtual ~TypeLookupRequestListener() override; + +protected: + + /** + * @brief Starts the thread that process the received requests. + */ + void start_request_processor_thread(); + + /** + * @brief Stops the thread that process the received requests. + */ + void stop_request_processor_thread(); + + /** + * @brief Process the requests in the queue. + */ + void process_requests(); + + /** + * @brief Gets TypeObject from TypeObjectRegistry, creates and sends reply. + * @param request_id[in] The SampleIdentity of the request. + * @param request[in] The request data. + */ + void check_get_types_request( + SampleIdentity request_id, + const TypeLookup_getTypes_In& request); + + /** + * @brief Gets type dependencies from TypeObjectRegistry, creates and sends reply. + * @param request_id[in] The SampleIdentity of the request. + * @param request[in] The request data. + */ + void check_get_type_dependencies_request( + SampleIdentity request_id, + const TypeLookup_getTypeDependencies_In& request); + + /** + * @brief Creates a TypeLookup_getTypeDependencies_Out using continuation points to manage size. + * @param id_seq[in] Sequence of TypeIdentifiers for which dependencies are needed. + * @param type_dependencies[in] The full list of dependencies of the type. + * @param continuation_point[in] The continuation point of the previous request. + * @return The reply containing the dependent types. + */ + TypeLookup_getTypeDependencies_Out prepare_get_type_dependencies_response( + const xtypes::TypeIdentifierSeq& id_seq, + const std::unordered_set& type_dependencies, + const std::vector& continuation_point); + + /** + * @brief Creates and sends the TypeLookup_Reply. + * @param request_id[in] The SampleIdentity of the request. + * @param exception_code[in] The RemoteExceptionCode_t used in the header. + * @param out[in] Reply to the query included in the received request. + */ + void answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code, + TypeLookup_getTypeDependencies_Out& out); + void answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code, + TypeLookup_getTypes_Out& out); + void answer_request( + SampleIdentity request_id, + rpc::RemoteExceptionCode_t exception_code); + + /** + * @brief Method call when this class is notified of a new cache change. + * @param reader The reader receiving the cache change. + * @param change The cache change. + */ + void onNewCacheChangeAdded( + fastrtps::rtps::RTPSReader* reader, + const fastrtps::rtps::CacheChange_t* const change) override; + + void onWriterChangeReceivedByAll( + fastrtps::rtps::RTPSWriter*, + fastrtps::rtps::CacheChange_t* change) override; + + //! A pointer to the typelookup manager. + TypeLookupManager* typelookup_manager_; + + //! Mutex to protect access to requests_with_continuation_. + std::mutex requests_with_continuation_mutex_; + + //! Collection of the requests that needed continuation points. + std::unordered_map > requests_with_continuation_; + + eprosima::thread request_processor_thread; + std::queue requests_queue_; + std::mutex request_processor_cv_mutex_; + std::condition_variable request_processor_cv_; + bool processing_ = false; + rtps::ThreadSettings request_processor_thread_settings_; +}; + +} /* namespace builtin */ +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ +#endif /* _FASTDDS_BUILTIN_TYPE_LOOKUP_SERVICE_TYPE_LOOKUP_REQUEST_LISTENER_HPP_*/ diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.hpp b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.hpp new file mode 100644 index 00000000000..8d0ed3172fb --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.hpp @@ -0,0 +1,2394 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeLookupTypes.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_HPP_ + +#include +#include +#include +#include + +#include + +#include "rpc_types.hpp" +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPELOOKUPTYPES_SOURCE) +#define TYPELOOKUPTYPES_DllAPI __declspec( dllexport ) +#else +#define TYPELOOKUPTYPES_DllAPI __declspec( dllimport ) +#endif // TYPELOOKUPTYPES_SOURCE +#else +#define TYPELOOKUPTYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPELOOKUPTYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace builtin { + +const uint32_t TypeLookup_getTypes_HashId = 0x018252d3; +const uint32_t TypeLookup_getDependencies_HashId = 0x05aafb31; +/*! + * @brief This class represents the structure TypeLookup_getTypes_In defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypes_In +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypes_In() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypes_In() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypes_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_In( + const TypeLookup_getTypes_In& x) + { + m_type_ids = x.m_type_ids; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypes_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_In( + TypeLookup_getTypes_In&& x) noexcept + { + m_type_ids = std::move(x.m_type_ids); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypes_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_In& operator =( + const TypeLookup_getTypes_In& x) + { + + m_type_ids = x.m_type_ids; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypes_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_In& operator =( + TypeLookup_getTypes_In&& x) noexcept + { + + m_type_ids = std::move(x.m_type_ids); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_In object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypes_In& x) const + { + return (m_type_ids == x.m_type_ids); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_In object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypes_In& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_ids + * @param _type_ids New value to be copied in member type_ids + */ + eProsima_user_DllExport void type_ids( + const std::vector& _type_ids) + { + m_type_ids = _type_ids; + } + + /*! + * @brief This function moves the value in member type_ids + * @param _type_ids New value to be moved in member type_ids + */ + eProsima_user_DllExport void type_ids( + std::vector&& _type_ids) + { + m_type_ids = std::move(_type_ids); + } + + /*! + * @brief This function returns a constant reference to member type_ids + * @return Constant reference to member type_ids + */ + eProsima_user_DllExport const std::vector& type_ids() const + { + return m_type_ids; + } + + /*! + * @brief This function returns a reference to member type_ids + * @return Reference to member type_ids + */ + eProsima_user_DllExport std::vector& type_ids() + { + return m_type_ids; + } + + + +private: + + std::vector m_type_ids; + +}; +/*! + * @brief This class represents the structure TypeLookup_getTypes_Out defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypes_Out +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypes_Out() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypes_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out( + const TypeLookup_getTypes_Out& x) + { + m_types = x.m_types; + + m_complete_to_minimal = x.m_complete_to_minimal; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypes_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out( + TypeLookup_getTypes_Out&& x) noexcept + { + m_types = std::move(x.m_types); + m_complete_to_minimal = std::move(x.m_complete_to_minimal); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypes_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out& operator =( + const TypeLookup_getTypes_Out& x) + { + + m_types = x.m_types; + + m_complete_to_minimal = x.m_complete_to_minimal; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypes_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out& operator =( + TypeLookup_getTypes_Out&& x) noexcept + { + + m_types = std::move(x.m_types); + m_complete_to_minimal = std::move(x.m_complete_to_minimal); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_Out object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypes_Out& x) const + { + return (m_types == x.m_types && + m_complete_to_minimal == x.m_complete_to_minimal); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_Out object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypes_Out& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member types + * @param _types New value to be copied in member types + */ + eProsima_user_DllExport void types( + const std::vector& _types) + { + m_types = _types; + } + + /*! + * @brief This function moves the value in member types + * @param _types New value to be moved in member types + */ + eProsima_user_DllExport void types( + std::vector&& _types) + { + m_types = std::move(_types); + } + + /*! + * @brief This function returns a constant reference to member types + * @return Constant reference to member types + */ + eProsima_user_DllExport const std::vector& types() const + { + return m_types; + } + + /*! + * @brief This function returns a reference to member types + * @return Reference to member types + */ + eProsima_user_DllExport std::vector& types() + { + return m_types; + } + + + /*! + * @brief This function copies the value in member complete_to_minimal + * @param _complete_to_minimal New value to be copied in member complete_to_minimal + */ + eProsima_user_DllExport void complete_to_minimal( + const std::vector& _complete_to_minimal) + { + m_complete_to_minimal = _complete_to_minimal; + } + + /*! + * @brief This function moves the value in member complete_to_minimal + * @param _complete_to_minimal New value to be moved in member complete_to_minimal + */ + eProsima_user_DllExport void complete_to_minimal( + std::vector&& _complete_to_minimal) + { + m_complete_to_minimal = std::move(_complete_to_minimal); + } + + /*! + * @brief This function returns a constant reference to member complete_to_minimal + * @return Constant reference to member complete_to_minimal + */ + eProsima_user_DllExport const std::vector& complete_to_minimal() const + { + return m_complete_to_minimal; + } + + /*! + * @brief This function returns a reference to member complete_to_minimal + * @return Reference to member complete_to_minimal + */ + eProsima_user_DllExport std::vector& complete_to_minimal() + { + return m_complete_to_minimal; + } + + + +private: + + std::vector m_types; + std::vector m_complete_to_minimal; + +}; +/*! + * @brief This class represents the union TypeLookup_getTypes_Result defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypes_Result +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypes_Result() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypes_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result( + const TypeLookup_getTypes_Result& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = x.m_result; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypes_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result( + TypeLookup_getTypes_Result&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = std::move(x.m_result); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypes_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result& operator =( + const TypeLookup_getTypes_Result& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = x.m_result; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypes_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result& operator =( + TypeLookup_getTypes_Result&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = std::move(x.m_result); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_Result object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypes_Result& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_result == x.m_result); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypes_Result object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypes_Result& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case eprosima::fastdds::dds::RETCODE_OK: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member result + * @param _result New value to be copied in member result + */ + eProsima_user_DllExport void result( + const TypeLookup_getTypes_Out& _result) + { + result_() = _result; + m__d = eprosima::fastdds::dds::RETCODE_OK; + } + + /*! + * @brief This function moves the value in member result + * @param _result New value to be moved in member result + */ + eProsima_user_DllExport void result( + TypeLookup_getTypes_Out&& _result) + { + result_() = _result; + m__d = eprosima::fastdds::dds::RETCODE_OK; + } + + /*! + * @brief This function returns a constant reference to member result + * @return Constant reference to member result + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypes_Out& result() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_result; + } + + /*! + * @brief This function returns a reference to member result + * @return Reference to member result + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypes_Out& result() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_result; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + TypeLookup_getTypes_Out& result_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_result.~TypeLookup_getTypes_Out();}; + new(&m_result) TypeLookup_getTypes_Out(); + ; + } + + return m_result; + } + + + int32_t m__d {1}; + + union + { + TypeLookup_getTypes_Out m_result; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure TypeLookup_getTypeDependencies_In defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypeDependencies_In +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypeDependencies_In() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In( + const TypeLookup_getTypeDependencies_In& x) + { + m_type_ids = x.m_type_ids; + + m_continuation_point = x.m_continuation_point; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In( + TypeLookup_getTypeDependencies_In&& x) noexcept + { + m_type_ids = std::move(x.m_type_ids); + m_continuation_point = std::move(x.m_continuation_point); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In& operator =( + const TypeLookup_getTypeDependencies_In& x) + { + + m_type_ids = x.m_type_ids; + + m_continuation_point = x.m_continuation_point; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_In that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In& operator =( + TypeLookup_getTypeDependencies_In&& x) noexcept + { + + m_type_ids = std::move(x.m_type_ids); + m_continuation_point = std::move(x.m_continuation_point); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_In object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypeDependencies_In& x) const + { + return (m_type_ids == x.m_type_ids && + m_continuation_point == x.m_continuation_point); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_In object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypeDependencies_In& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_ids + * @param _type_ids New value to be copied in member type_ids + */ + eProsima_user_DllExport void type_ids( + const std::vector& _type_ids) + { + m_type_ids = _type_ids; + } + + /*! + * @brief This function moves the value in member type_ids + * @param _type_ids New value to be moved in member type_ids + */ + eProsima_user_DllExport void type_ids( + std::vector&& _type_ids) + { + m_type_ids = std::move(_type_ids); + } + + /*! + * @brief This function returns a constant reference to member type_ids + * @return Constant reference to member type_ids + */ + eProsima_user_DllExport const std::vector& type_ids() const + { + return m_type_ids; + } + + /*! + * @brief This function returns a reference to member type_ids + * @return Reference to member type_ids + */ + eProsima_user_DllExport std::vector& type_ids() + { + return m_type_ids; + } + + + /*! + * @brief This function copies the value in member continuation_point + * @param _continuation_point New value to be copied in member continuation_point + */ + eProsima_user_DllExport void continuation_point( + const std::vector& _continuation_point) + { + m_continuation_point = _continuation_point; + } + + /*! + * @brief This function moves the value in member continuation_point + * @param _continuation_point New value to be moved in member continuation_point + */ + eProsima_user_DllExport void continuation_point( + std::vector&& _continuation_point) + { + m_continuation_point = std::move(_continuation_point); + } + + /*! + * @brief This function returns a constant reference to member continuation_point + * @return Constant reference to member continuation_point + */ + eProsima_user_DllExport const std::vector& continuation_point() const + { + return m_continuation_point; + } + + /*! + * @brief This function returns a reference to member continuation_point + * @return Reference to member continuation_point + */ + eProsima_user_DllExport std::vector& continuation_point() + { + return m_continuation_point; + } + + + +private: + + std::vector m_type_ids; + std::vector m_continuation_point; + +}; +/*! + * @brief This class represents the structure TypeLookup_getTypeDependencies_Out defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypeDependencies_Out +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypeDependencies_Out() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out( + const TypeLookup_getTypeDependencies_Out& x) + { + m_dependent_typeids = x.m_dependent_typeids; + + m_continuation_point = x.m_continuation_point; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out( + TypeLookup_getTypeDependencies_Out&& x) noexcept + { + m_dependent_typeids = std::move(x.m_dependent_typeids); + m_continuation_point = std::move(x.m_continuation_point); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out& operator =( + const TypeLookup_getTypeDependencies_Out& x) + { + + m_dependent_typeids = x.m_dependent_typeids; + + m_continuation_point = x.m_continuation_point; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_Out that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out& operator =( + TypeLookup_getTypeDependencies_Out&& x) noexcept + { + + m_dependent_typeids = std::move(x.m_dependent_typeids); + m_continuation_point = std::move(x.m_continuation_point); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_Out object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypeDependencies_Out& x) const + { + return (m_dependent_typeids == x.m_dependent_typeids && + m_continuation_point == x.m_continuation_point); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_Out object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypeDependencies_Out& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member dependent_typeids + * @param _dependent_typeids New value to be copied in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + const std::vector& _dependent_typeids) + { + m_dependent_typeids = _dependent_typeids; + } + + /*! + * @brief This function moves the value in member dependent_typeids + * @param _dependent_typeids New value to be moved in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + std::vector&& _dependent_typeids) + { + m_dependent_typeids = std::move(_dependent_typeids); + } + + /*! + * @brief This function returns a constant reference to member dependent_typeids + * @return Constant reference to member dependent_typeids + */ + eProsima_user_DllExport const std::vector& dependent_typeids() const + { + return m_dependent_typeids; + } + + /*! + * @brief This function returns a reference to member dependent_typeids + * @return Reference to member dependent_typeids + */ + eProsima_user_DllExport std::vector& dependent_typeids() + { + return m_dependent_typeids; + } + + + /*! + * @brief This function copies the value in member continuation_point + * @param _continuation_point New value to be copied in member continuation_point + */ + eProsima_user_DllExport void continuation_point( + const std::vector& _continuation_point) + { + m_continuation_point = _continuation_point; + } + + /*! + * @brief This function moves the value in member continuation_point + * @param _continuation_point New value to be moved in member continuation_point + */ + eProsima_user_DllExport void continuation_point( + std::vector&& _continuation_point) + { + m_continuation_point = std::move(_continuation_point); + } + + /*! + * @brief This function returns a constant reference to member continuation_point + * @return Constant reference to member continuation_point + */ + eProsima_user_DllExport const std::vector& continuation_point() const + { + return m_continuation_point; + } + + /*! + * @brief This function returns a reference to member continuation_point + * @return Reference to member continuation_point + */ + eProsima_user_DllExport std::vector& continuation_point() + { + return m_continuation_point; + } + + + +private: + + std::vector m_dependent_typeids; + std::vector m_continuation_point; + +}; +/*! + * @brief This class represents the union TypeLookup_getTypeDependencies_Result defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_getTypeDependencies_Result +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_getTypeDependencies_Result() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result( + const TypeLookup_getTypeDependencies_Result& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = x.m_result; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_getTypeDependencies_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result( + TypeLookup_getTypeDependencies_Result&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = std::move(x.m_result); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result& operator =( + const TypeLookup_getTypeDependencies_Result& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = x.m_result; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_getTypeDependencies_Result that will be copied. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result& operator =( + TypeLookup_getTypeDependencies_Result&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + result_() = std::move(x.m_result); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_Result object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_getTypeDependencies_Result& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_result == x.m_result); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_getTypeDependencies_Result object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_getTypeDependencies_Result& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case eprosima::fastdds::dds::RETCODE_OK: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member result + * @param _result New value to be copied in member result + */ + eProsima_user_DllExport void result( + const TypeLookup_getTypeDependencies_Out& _result) + { + result_() = _result; + m__d = eprosima::fastdds::dds::RETCODE_OK; + } + + /*! + * @brief This function moves the value in member result + * @param _result New value to be moved in member result + */ + eProsima_user_DllExport void result( + TypeLookup_getTypeDependencies_Out&& _result) + { + result_() = _result; + m__d = eprosima::fastdds::dds::RETCODE_OK; + } + + /*! + * @brief This function returns a constant reference to member result + * @return Constant reference to member result + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypeDependencies_Out& result() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_result; + } + + /*! + * @brief This function returns a reference to member result + * @return Reference to member result + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Out& result() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_result; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + TypeLookup_getTypeDependencies_Out& result_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_result.~TypeLookup_getTypeDependencies_Out();}; + new(&m_result) TypeLookup_getTypeDependencies_Out(); + ; + } + + return m_result; + } + + + int32_t m__d {1}; + + union + { + TypeLookup_getTypeDependencies_Out m_result; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the union TypeLookup_Call defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_Call +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_Call() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_Call() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_Call that will be copied. + */ + eProsima_user_DllExport TypeLookup_Call( + const TypeLookup_Call& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getTypes_() = x.m_getTypes; + break; + + case 0x00000002: + getTypeDependencies_() = x.m_getTypeDependencies; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_Call that will be copied. + */ + eProsima_user_DllExport TypeLookup_Call( + TypeLookup_Call&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getTypes_() = std::move(x.m_getTypes); + break; + + case 0x00000002: + getTypeDependencies_() = std::move(x.m_getTypeDependencies); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_Call that will be copied. + */ + eProsima_user_DllExport TypeLookup_Call& operator =( + const TypeLookup_Call& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getTypes_() = x.m_getTypes; + break; + + case 0x00000002: + getTypeDependencies_() = x.m_getTypeDependencies; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_Call that will be copied. + */ + eProsima_user_DllExport TypeLookup_Call& operator =( + TypeLookup_Call&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getTypes_() = std::move(x.m_getTypes); + break; + + case 0x00000002: + getTypeDependencies_() = std::move(x.m_getTypeDependencies); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Call object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_Call& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_getTypes == x.m_getTypes); + break; + + case 0x00000002: + ret_value = (m_getTypeDependencies == x.m_getTypeDependencies); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Call object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_Call& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TypeLookup_getTypes_HashId: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TypeLookup_getDependencies_HashId: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member getTypes + * @param _getTypes New value to be copied in member getTypes + */ + eProsima_user_DllExport void getTypes( + const TypeLookup_getTypes_In& _getTypes) + { + getTypes_() = _getTypes; + m__d = TypeLookup_getTypes_HashId; + } + + /*! + * @brief This function moves the value in member getTypes + * @param _getTypes New value to be moved in member getTypes + */ + eProsima_user_DllExport void getTypes( + TypeLookup_getTypes_In&& _getTypes) + { + getTypes_() = _getTypes; + m__d = TypeLookup_getTypes_HashId; + } + + /*! + * @brief This function returns a constant reference to member getTypes + * @return Constant reference to member getTypes + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypes_In& getTypes() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypes; + } + + /*! + * @brief This function returns a reference to member getTypes + * @return Reference to member getTypes + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypes_In& getTypes() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypes; + } + + + /*! + * @brief This function copies the value in member getTypeDependencies + * @param _getTypeDependencies New value to be copied in member getTypeDependencies + */ + eProsima_user_DllExport void getTypeDependencies( + const TypeLookup_getTypeDependencies_In& _getTypeDependencies) + { + getTypeDependencies_() = _getTypeDependencies; + m__d = TypeLookup_getDependencies_HashId; + } + + /*! + * @brief This function moves the value in member getTypeDependencies + * @param _getTypeDependencies New value to be moved in member getTypeDependencies + */ + eProsima_user_DllExport void getTypeDependencies( + TypeLookup_getTypeDependencies_In&& _getTypeDependencies) + { + getTypeDependencies_() = _getTypeDependencies; + m__d = TypeLookup_getDependencies_HashId; + } + + /*! + * @brief This function returns a constant reference to member getTypeDependencies + * @return Constant reference to member getTypeDependencies + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypeDependencies_In& getTypeDependencies() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypeDependencies; + } + + /*! + * @brief This function returns a reference to member getTypeDependencies + * @return Reference to member getTypeDependencies + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_In& getTypeDependencies() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypeDependencies; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + TypeLookup_getTypes_In& getTypes_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_getTypes.~TypeLookup_getTypes_In();}; + new(&m_getTypes) TypeLookup_getTypes_In(); + ; + } + + return m_getTypes; + } + + TypeLookup_getTypeDependencies_In& getTypeDependencies_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_getTypeDependencies.~TypeLookup_getTypeDependencies_In();}; + new(&m_getTypeDependencies) TypeLookup_getTypeDependencies_In(); + ; + } + + return m_getTypeDependencies; + } + + + int32_t m__d {0}; + + union + { + TypeLookup_getTypes_In m_getTypes; + TypeLookup_getTypeDependencies_In m_getTypeDependencies; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure TypeLookup_Request defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_Request +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_Request() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_Request() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_Request that will be copied. + */ + eProsima_user_DllExport TypeLookup_Request( + const TypeLookup_Request& x) + { + m_header = x.m_header; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_Request that will be copied. + */ + eProsima_user_DllExport TypeLookup_Request( + TypeLookup_Request&& x) noexcept + { + m_header = std::move(x.m_header); + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_Request that will be copied. + */ + eProsima_user_DllExport TypeLookup_Request& operator =( + const TypeLookup_Request& x) + { + + m_header = x.m_header; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_Request that will be copied. + */ + eProsima_user_DllExport TypeLookup_Request& operator =( + TypeLookup_Request&& x) noexcept + { + + m_header = std::move(x.m_header); + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Request object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_Request& x) const + { + return (m_header == x.m_header && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Request object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_Request& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const eprosima::fastdds::dds::rpc::RequestHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + eprosima::fastdds::dds::rpc::RequestHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const eprosima::fastdds::dds::rpc::RequestHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport eprosima::fastdds::dds::rpc::RequestHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const TypeLookup_Call& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + TypeLookup_Call&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const TypeLookup_Call& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport TypeLookup_Call& data() + { + return m_data; + } + + + +private: + + eprosima::fastdds::dds::rpc::RequestHeader m_header; + TypeLookup_Call m_data; + +}; +/*! + * @brief This class represents the union TypeLookup_Return defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_Return +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_Return() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_Return() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_Return that will be copied. + */ + eProsima_user_DllExport TypeLookup_Return( + const TypeLookup_Return& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getType_() = x.m_getType; + break; + + case 0x00000002: + getTypeDependencies_() = x.m_getTypeDependencies; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_Return that will be copied. + */ + eProsima_user_DllExport TypeLookup_Return( + TypeLookup_Return&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getType_() = std::move(x.m_getType); + break; + + case 0x00000002: + getTypeDependencies_() = std::move(x.m_getTypeDependencies); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_Return that will be copied. + */ + eProsima_user_DllExport TypeLookup_Return& operator =( + const TypeLookup_Return& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getType_() = x.m_getType; + break; + + case 0x00000002: + getTypeDependencies_() = x.m_getTypeDependencies; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_Return that will be copied. + */ + eProsima_user_DllExport TypeLookup_Return& operator =( + TypeLookup_Return&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + getType_() = std::move(x.m_getType); + break; + + case 0x00000002: + getTypeDependencies_() = std::move(x.m_getTypeDependencies); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Return object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_Return& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_getType == x.m_getType); + break; + + case 0x00000002: + ret_value = (m_getTypeDependencies == x.m_getTypeDependencies); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Return object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_Return& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TypeLookup_getTypes_HashId: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TypeLookup_getDependencies_HashId: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member getType + * @param _getType New value to be copied in member getType + */ + eProsima_user_DllExport void getType( + const TypeLookup_getTypes_Result& _getType) + { + getType_() = _getType; + m__d = TypeLookup_getTypes_HashId; + } + + /*! + * @brief This function moves the value in member getType + * @param _getType New value to be moved in member getType + */ + eProsima_user_DllExport void getType( + TypeLookup_getTypes_Result&& _getType) + { + getType_() = _getType; + m__d = TypeLookup_getTypes_HashId; + } + + /*! + * @brief This function returns a constant reference to member getType + * @return Constant reference to member getType + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypes_Result& getType() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getType; + } + + /*! + * @brief This function returns a reference to member getType + * @return Reference to member getType + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypes_Result& getType() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getType; + } + + + /*! + * @brief This function copies the value in member getTypeDependencies + * @param _getTypeDependencies New value to be copied in member getTypeDependencies + */ + eProsima_user_DllExport void getTypeDependencies( + const TypeLookup_getTypeDependencies_Result& _getTypeDependencies) + { + getTypeDependencies_() = _getTypeDependencies; + m__d = TypeLookup_getDependencies_HashId; + } + + /*! + * @brief This function moves the value in member getTypeDependencies + * @param _getTypeDependencies New value to be moved in member getTypeDependencies + */ + eProsima_user_DllExport void getTypeDependencies( + TypeLookup_getTypeDependencies_Result&& _getTypeDependencies) + { + getTypeDependencies_() = _getTypeDependencies; + m__d = TypeLookup_getDependencies_HashId; + } + + /*! + * @brief This function returns a constant reference to member getTypeDependencies + * @return Constant reference to member getTypeDependencies + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const TypeLookup_getTypeDependencies_Result& getTypeDependencies() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypeDependencies; + } + + /*! + * @brief This function returns a reference to member getTypeDependencies + * @return Reference to member getTypeDependencies + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport TypeLookup_getTypeDependencies_Result& getTypeDependencies() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_getTypeDependencies; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + TypeLookup_getTypes_Result& getType_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_getType.~TypeLookup_getTypes_Result();}; + new(&m_getType) TypeLookup_getTypes_Result(); + ; + } + + return m_getType; + } + + TypeLookup_getTypeDependencies_Result& getTypeDependencies_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_getTypeDependencies.~TypeLookup_getTypeDependencies_Result();}; + new(&m_getTypeDependencies) TypeLookup_getTypeDependencies_Result(); + ; + } + + return m_getTypeDependencies; + } + + + int32_t m__d {0}; + + union + { + TypeLookup_getTypes_Result m_getType; + TypeLookup_getTypeDependencies_Result m_getTypeDependencies; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure TypeLookup_Reply defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ +class TypeLookup_Reply +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeLookup_Reply() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeLookup_Reply() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeLookup_Reply that will be copied. + */ + eProsima_user_DllExport TypeLookup_Reply( + const TypeLookup_Reply& x) + { + m_header = x.m_header; + + m_return_value = x.m_return_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeLookup_Reply that will be copied. + */ + eProsima_user_DllExport TypeLookup_Reply( + TypeLookup_Reply&& x) noexcept + { + m_header = std::move(x.m_header); + m_return_value = std::move(x.m_return_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeLookup_Reply that will be copied. + */ + eProsima_user_DllExport TypeLookup_Reply& operator =( + const TypeLookup_Reply& x) + { + + m_header = x.m_header; + + m_return_value = x.m_return_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeLookup_Reply that will be copied. + */ + eProsima_user_DllExport TypeLookup_Reply& operator =( + TypeLookup_Reply&& x) noexcept + { + + m_header = std::move(x.m_header); + m_return_value = std::move(x.m_return_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Reply object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeLookup_Reply& x) const + { + return (m_header == x.m_header && + m_return_value == x.m_return_value); + } + + /*! + * @brief Comparison operator. + * @param x TypeLookup_Reply object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeLookup_Reply& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const eprosima::fastdds::dds::rpc::ReplyHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + eprosima::fastdds::dds::rpc::ReplyHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const eprosima::fastdds::dds::rpc::ReplyHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport eprosima::fastdds::dds::rpc::ReplyHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member return_value + * @param _return_value New value to be copied in member return_value + */ + eProsima_user_DllExport void return_value( + const TypeLookup_Return& _return_value) + { + m_return_value = _return_value; + } + + /*! + * @brief This function moves the value in member return_value + * @param _return_value New value to be moved in member return_value + */ + eProsima_user_DllExport void return_value( + TypeLookup_Return&& _return_value) + { + m_return_value = std::move(_return_value); + } + + /*! + * @brief This function returns a constant reference to member return_value + * @return Constant reference to member return_value + */ + eProsima_user_DllExport const TypeLookup_Return& return_value() const + { + return m_return_value; + } + + /*! + * @brief This function returns a reference to member return_value + * @return Reference to member return_value + */ + eProsima_user_DllExport TypeLookup_Return& return_value() + { + return m_return_value; + } + + + +private: + + eprosima::fastdds::dds::rpc::ReplyHeader m_header; + TypeLookup_Return m_return_value; + +}; + +} // namespace builtin + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_HPP_ + + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.idl b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.idl new file mode 100644 index 00000000000..7d548746ddb --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.idl @@ -0,0 +1,82 @@ +/* TypeLookupTypes.idl */ + +#include "../../../../../../include/fastdds/dds/core/detail/DDSReturnCode.idl" +#include "../../../../../../include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl" +#include "rpc_types.idl" + +module dds { +module builtin { + + // computed from @hashid("getTypes") + const unsigned long TypeLookup_getTypes_HashId = 0x018252d3; + + // computed from @hashid("getDependencies"); + const unsigned long TypeLookup_getDependencies_HashId = 0x05aafb31; + + // Query the TypeObjects associated with one or more TypeIdentifiers + @extensibility(MUTABLE) + struct TypeLookup_getTypes_In { + @hashid sequence type_ids; + }; + + @extensibility(MUTABLE) + struct TypeLookup_getTypes_Out { + @hashid sequence types; + @hashid sequence complete_to_minimal; + }; + + union TypeLookup_getTypes_Result switch(long) { + //TODO case DDS::RETCODE_OK: + case eprosima::fastdds::dds::RETCODE_OK: + TypeLookup_getTypes_Out result; + }; + + // Query TypeIdentifiers that the specified types depend on + @extensibility(MUTABLE) + struct TypeLookup_getTypeDependencies_In { + @hashid sequence type_ids; + @hashid sequence continuation_point; + }; + + @extensibility(MUTABLE) + struct TypeLookup_getTypeDependencies_Out { + @hashid sequence dependent_typeids; + @hashid sequence continuation_point; + }; + + union TypeLookup_getTypeDependencies_Result switch(long){ + //TODO case DDS::RETCODE_OK: + case eprosima::fastdds::dds::RETCODE_OK: + TypeLookup_getTypeDependencies_Out result; + }; + + // Service Request + union TypeLookup_Call switch(long) { + case TypeLookup_getTypes_HashId: + TypeLookup_getTypes_In getTypes; + case TypeLookup_getDependencies_HashId: + TypeLookup_getTypeDependencies_In getTypeDependencies; + }; + + // @RPCRequestType // Annotation not defined + struct TypeLookup_Request { + rpc::RequestHeader header; + TypeLookup_Call data; + }; + + // Service Reply + union TypeLookup_Return switch(long) { + case TypeLookup_getTypes_HashId: + TypeLookup_getTypes_Result getType; + case TypeLookup_getDependencies_HashId: + TypeLookup_getTypeDependencies_Result getTypeDependencies; + }; + + // @RPCReplyType // Annotation not defined + struct TypeLookup_Reply { + rpc::ReplyHeader header; + TypeLookup_Return return_value; //This name was changed from "return" to "return_value" to avoid problems in c++ + }; + +}; // builtin +}; // dds diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.hpp b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.hpp new file mode 100644 index 00000000000..569f3b42958 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.hpp @@ -0,0 +1,207 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeLookupTypesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_HPP_ + +#include "TypeLookupTypes.hpp" + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_Reply_max_cdr_typesize {140UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_Reply_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypes_In_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypes_In_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_max_cdr_typesize {72UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_max_cdr_typesize {72UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_max_key_cdr_typesize {0UL}; + + + + + + + + + + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypes_Out_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_getTypes_Out_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_Request_max_cdr_typesize {388UL}; +constexpr uint32_t eprosima_fastdds_dds_builtin_TypeLookup_Request_max_key_cdr_typesize {0UL}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Request& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_HPP_ + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.ipp b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.ipp new file mode 100644 index 00000000000..dfe0d74b994 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesCdrAux.ipp @@ -0,0 +1,1088 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeLookupTypesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_IPP_ + +#include "TypeLookupTypesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0c536065), + data.type_ids(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + scdr + << eprosima::fastcdr::MemberId(0x0c536065) << data.type_ids() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0x0c536065: + dcdr >> data.type_ids(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x02804ad1), + data.types(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0b8e6577), + data.complete_to_minimal(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + scdr + << eprosima::fastcdr::MemberId(0x02804ad1) << data.types() + << eprosima::fastcdr::MemberId(0x0b8e6577) << data.complete_to_minimal() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0x02804ad1: + dcdr >> data.types(); + break; + + case 0x0b8e6577: + dcdr >> data.complete_to_minimal(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.result(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + scdr << eprosima::fastcdr::MemberId(1) << data.result(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + int32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case eprosima::fastdds::dds::RETCODE_OK: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out result_value; + data.result(std::move(result_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + dcdr >> data.result(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0c536065), + data.type_ids(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0508e3d2), + data.continuation_point(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + scdr + << eprosima::fastcdr::MemberId(0x0c536065) << data.type_ids() + << eprosima::fastcdr::MemberId(0x0508e3d2) << data.continuation_point() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0x0c536065: + dcdr >> data.type_ids(); + break; + + case 0x0508e3d2: + dcdr >> data.continuation_point(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0ba4dfc9), + data.dependent_typeids(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x0508e3d2), + data.continuation_point(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + scdr + << eprosima::fastcdr::MemberId(0x0ba4dfc9) << data.dependent_typeids() + << eprosima::fastcdr::MemberId(0x0508e3d2) << data.continuation_point() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0x0ba4dfc9: + dcdr >> data.dependent_typeids(); + break; + + case 0x0508e3d2: + dcdr >> data.continuation_point(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.result(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + scdr << eprosima::fastcdr::MemberId(1) << data.result(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + int32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case eprosima::fastdds::dds::RETCODE_OK: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out result_value; + data.result(std::move(result_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case eprosima::fastdds::dds::RETCODE_OK: + dcdr >> data.result(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_Call& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.getTypes(), current_alignment); + break; + + case TypeLookup_getDependencies_HashId: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.getTypeDependencies(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Call& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + scdr << eprosima::fastcdr::MemberId(1) << data.getTypes(); + break; + + case TypeLookup_getDependencies_HashId: + scdr << eprosima::fastcdr::MemberId(2) << data.getTypeDependencies(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_Call& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + int32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TypeLookup_getTypes_HashId: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In getTypes_value; + data.getTypes(std::move(getTypes_value)); + data._d(discriminator); + break; + } + + case TypeLookup_getDependencies_HashId: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In getTypeDependencies_value; + data.getTypeDependencies(std::move(getTypeDependencies_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + dcdr >> data.getTypes(); + break; + + case TypeLookup_getDependencies_HashId: + dcdr >> data.getTypeDependencies(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_Request& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.data(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Request& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.data() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_Request& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.data(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Request& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_Return& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.getType(), current_alignment); + break; + + case TypeLookup_getDependencies_HashId: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.getTypeDependencies(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Return& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + scdr << eprosima::fastcdr::MemberId(1) << data.getType(); + break; + + case TypeLookup_getDependencies_HashId: + scdr << eprosima::fastcdr::MemberId(2) << data.getTypeDependencies(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_Return& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + int32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TypeLookup_getTypes_HashId: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result getType_value; + data.getType(std::move(getType_value)); + data._d(discriminator); + break; + } + + case TypeLookup_getDependencies_HashId: + { + eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result getTypeDependencies_value; + data.getTypeDependencies(std::move(getTypeDependencies_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case TypeLookup_getTypes_HashId: + dcdr >> data.getType(); + break; + + case TypeLookup_getDependencies_HashId: + dcdr >> data.getTypeDependencies(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.return_value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.return_value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::builtin::TypeLookup_Reply& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.return_value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data) +{ + using namespace eprosima::fastdds::dds::builtin; + + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPESCDRAUX_IPP_ + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx new file mode 100644 index 00000000000..437543a48f1 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx @@ -0,0 +1,1219 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeLookupTypesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + +#include "TypeLookupTypesPubSubTypes.h" + +#include +#include + +#include "TypeLookupTypesCdrAux.hpp" +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace builtin { + TypeLookup_getTypes_InPubSubType::TypeLookup_getTypes_InPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_getTypes_In::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_getTypes_In_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_fastdds_dds_builtin_TypeLookup_getTypes_In_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_getTypes_In_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_getTypes_InPubSubType::~TypeLookup_getTypes_InPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_getTypes_InPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_getTypes_In* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeLookup_getTypes_InPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_getTypes_In* 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 TypeLookup_getTypes_InPubSubType::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* TypeLookup_getTypes_InPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_getTypes_In()); + } + + void TypeLookup_getTypes_InPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_getTypes_InPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_getTypes_In* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_getTypes_In_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_fastdds_dds_builtin_TypeLookup_getTypes_In_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; + } + + void TypeLookup_getTypes_InPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + TypeLookup_getTypes_OutPubSubType::TypeLookup_getTypes_OutPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_getTypes_Out::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_getTypes_Out_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_fastdds_dds_builtin_TypeLookup_getTypes_Out_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_getTypes_Out_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_getTypes_OutPubSubType::~TypeLookup_getTypes_OutPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_getTypes_OutPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_getTypes_Out* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeLookup_getTypes_OutPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_getTypes_Out* 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 TypeLookup_getTypes_OutPubSubType::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* TypeLookup_getTypes_OutPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_getTypes_Out()); + } + + void TypeLookup_getTypes_OutPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_getTypes_OutPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_getTypes_Out* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_getTypes_Out_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_fastdds_dds_builtin_TypeLookup_getTypes_Out_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; + } + + void TypeLookup_getTypes_OutPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + + TypeLookup_getTypeDependencies_InPubSubType::TypeLookup_getTypeDependencies_InPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_getTypeDependencies_In::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_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_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_getTypeDependencies_InPubSubType::~TypeLookup_getTypeDependencies_InPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_getTypeDependencies_InPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_getTypeDependencies_In* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeLookup_getTypeDependencies_InPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_getTypeDependencies_In* 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 TypeLookup_getTypeDependencies_InPubSubType::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* TypeLookup_getTypeDependencies_InPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_getTypeDependencies_In()); + } + + void TypeLookup_getTypeDependencies_InPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_getTypeDependencies_InPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_getTypeDependencies_In* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_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_fastdds_dds_builtin_TypeLookup_getTypeDependencies_In_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; + } + + void TypeLookup_getTypeDependencies_InPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + TypeLookup_getTypeDependencies_OutPubSubType::TypeLookup_getTypeDependencies_OutPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_getTypeDependencies_Out::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_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_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_getTypeDependencies_OutPubSubType::~TypeLookup_getTypeDependencies_OutPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_getTypeDependencies_OutPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_getTypeDependencies_Out* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeLookup_getTypeDependencies_OutPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_getTypeDependencies_Out* 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 TypeLookup_getTypeDependencies_OutPubSubType::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* TypeLookup_getTypeDependencies_OutPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_getTypeDependencies_Out()); + } + + void TypeLookup_getTypeDependencies_OutPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_getTypeDependencies_OutPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_getTypeDependencies_Out* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_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_fastdds_dds_builtin_TypeLookup_getTypeDependencies_Out_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; + } + + void TypeLookup_getTypeDependencies_OutPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + + + TypeLookup_RequestPubSubType::TypeLookup_RequestPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_Request"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_Request::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_Request_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_fastdds_dds_builtin_TypeLookup_Request_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_Request_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_RequestPubSubType::~TypeLookup_RequestPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_RequestPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_Request* 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; + } + 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 TypeLookup_RequestPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_Request* 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 TypeLookup_RequestPubSubType::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* TypeLookup_RequestPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_Request()); + } + + void TypeLookup_RequestPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_RequestPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_Request* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_Request_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_fastdds_dds_builtin_TypeLookup_Request_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; + } + + void TypeLookup_RequestPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + + TypeLookup_ReplyPubSubType::TypeLookup_ReplyPubSubType() + { + setName("eprosima::fastdds::dds::builtin::TypeLookup_Reply"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeLookup_Reply::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_builtin_TypeLookup_Reply_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_fastdds_dds_builtin_TypeLookup_Reply_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_builtin_TypeLookup_Reply_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + TypeLookup_ReplyPubSubType::~TypeLookup_ReplyPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool TypeLookup_ReplyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + TypeLookup_Reply* 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; + } + 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 TypeLookup_ReplyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + TypeLookup_Reply* 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 TypeLookup_ReplyPubSubType::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* TypeLookup_ReplyPubSubType::createData() + { + return reinterpret_cast(new TypeLookup_Reply()); + } + + void TypeLookup_ReplyPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool TypeLookup_ReplyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + TypeLookup_Reply* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_builtin_TypeLookup_Reply_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_fastdds_dds_builtin_TypeLookup_Reply_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; + } + + void TypeLookup_ReplyPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + +} // namespace builtin + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +// Include auxiliary functions like for serializing/deserializing. +#include "TypeLookupTypesCdrAux.ipp" diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.h b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.h new file mode 100644 index 00000000000..cc9d5070918 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.h @@ -0,0 +1,612 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeLookupTypesPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "TypeLookupTypes.hpp" + +#include "rpc_typesPubSubTypes.h" +#include +#include + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated TypeLookupTypes is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace builtin +{ + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_getTypes_In defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_getTypes_InPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_getTypes_In type; + + eProsima_user_DllExport TypeLookup_getTypes_InPubSubType(); + + eProsima_user_DllExport ~TypeLookup_getTypes_InPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_getTypes_Out defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_getTypes_OutPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_getTypes_Out type; + + eProsima_user_DllExport TypeLookup_getTypes_OutPubSubType(); + + eProsima_user_DllExport ~TypeLookup_getTypes_OutPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_getTypeDependencies_In defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_getTypeDependencies_InPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_getTypeDependencies_In type; + + eProsima_user_DllExport TypeLookup_getTypeDependencies_InPubSubType(); + + eProsima_user_DllExport ~TypeLookup_getTypeDependencies_InPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_getTypeDependencies_Out defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_getTypeDependencies_OutPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_getTypeDependencies_Out type; + + eProsima_user_DllExport TypeLookup_getTypeDependencies_OutPubSubType(); + + eProsima_user_DllExport ~TypeLookup_getTypeDependencies_OutPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_Request defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_RequestPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_Request type; + + eProsima_user_DllExport TypeLookup_RequestPubSubType(); + + eProsima_user_DllExport ~TypeLookup_RequestPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + + /*! + * @brief This class represents the TopicDataType of the type TypeLookup_Reply defined by the user in the IDL file. + * @ingroup TypeLookupTypes + */ + class TypeLookup_ReplyPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef TypeLookup_Reply type; + + eProsima_user_DllExport TypeLookup_ReplyPubSubType(); + + eProsima_user_DllExport ~TypeLookup_ReplyPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; +} // namespace builtin + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_BUILTIN_TYPELOOKUPTYPES_PUBSUBTYPES_H_ + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.hpp b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.hpp new file mode 100644 index 00000000000..ba955772f77 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.hpp @@ -0,0 +1,1139 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file rpc_types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_HPP_ + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(RPC_TYPES_SOURCE) +#define RPC_TYPES_DllAPI __declspec( dllexport ) +#else +#define RPC_TYPES_DllAPI __declspec( dllimport ) +#endif // RPC_TYPES_SOURCE +#else +#define RPC_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define RPC_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef std::array GuidPrefix_t; + +/*! + * @brief This class represents the structure EntityId_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class EntityId_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + const EntityId_t& x) + { + m_entityKey = x.m_entityKey; + + m_entityKind = x.m_entityKind; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t( + EntityId_t&& x) noexcept + { + m_entityKey = std::move(x.m_entityKey); + m_entityKind = x.m_entityKind; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + const EntityId_t& x) + { + + m_entityKey = x.m_entityKey; + + m_entityKind = x.m_entityKind; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityId_t that will be copied. + */ + eProsima_user_DllExport EntityId_t& operator =( + EntityId_t&& x) noexcept + { + + m_entityKey = std::move(x.m_entityKey); + m_entityKind = x.m_entityKind; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_t& x) const + { + return (m_entityKey == x.m_entityKey && + m_entityKind == x.m_entityKind); + } + + /*! + * @brief Comparison operator. + * @param x EntityId_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member entityKey + * @param _entityKey New value to be copied in member entityKey + */ + eProsima_user_DllExport void entityKey( + const std::array& _entityKey) + { + m_entityKey = _entityKey; + } + + /*! + * @brief This function moves the value in member entityKey + * @param _entityKey New value to be moved in member entityKey + */ + eProsima_user_DllExport void entityKey( + std::array&& _entityKey) + { + m_entityKey = std::move(_entityKey); + } + + /*! + * @brief This function returns a constant reference to member entityKey + * @return Constant reference to member entityKey + */ + eProsima_user_DllExport const std::array& entityKey() const + { + return m_entityKey; + } + + /*! + * @brief This function returns a reference to member entityKey + * @return Reference to member entityKey + */ + eProsima_user_DllExport std::array& entityKey() + { + return m_entityKey; + } + + + /*! + * @brief This function sets a value in member entityKind + * @param _entityKind New value for member entityKind + */ + eProsima_user_DllExport void entityKind( + uint8_t _entityKind) + { + m_entityKind = _entityKind; + } + + /*! + * @brief This function returns the value of member entityKind + * @return Value of member entityKind + */ + eProsima_user_DllExport uint8_t entityKind() const + { + return m_entityKind; + } + + /*! + * @brief This function returns a reference to member entityKind + * @return Reference to member entityKind + */ + eProsima_user_DllExport uint8_t& entityKind() + { + return m_entityKind; + } + + + +private: + + std::array m_entityKey{0}; + uint8_t m_entityKind{0}; + +}; +/*! + * @brief This class represents the structure GUID_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class GUID_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + const GUID_t& x) + { + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t( + GUID_t&& x) noexcept + { + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + const GUID_t& x) + { + + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GUID_t that will be copied. + */ + eProsima_user_DllExport GUID_t& operator =( + GUID_t&& x) noexcept + { + + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GUID_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_t& x) const + { + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); + } + + /*! + * @brief Comparison operator. + * @param x GUID_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const GuidPrefix_t& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + GuidPrefix_t&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const GuidPrefix_t& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport GuidPrefix_t& guidPrefix() + { + return m_guidPrefix; + } + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const EntityId_t& _entityId) + { + m_entityId = _entityId; + } + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + EntityId_t&& _entityId) + { + m_entityId = std::move(_entityId); + } + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const EntityId_t& entityId() const + { + return m_entityId; + } + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport EntityId_t& entityId() + { + return m_entityId; + } + + + +private: + + GuidPrefix_t m_guidPrefix{0}; + EntityId_t m_entityId; + +}; +/*! + * @brief This class represents the structure SequenceNumber_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class SequenceNumber_t +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_t() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_t() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + const SequenceNumber_t& x) + { + m_high = x.m_high; + + m_low = x.m_low; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t( + SequenceNumber_t&& x) noexcept + { + m_high = x.m_high; + m_low = x.m_low; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + const SequenceNumber_t& x) + { + + m_high = x.m_high; + + m_low = x.m_low; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceNumber_t that will be copied. + */ + eProsima_user_DllExport SequenceNumber_t& operator =( + SequenceNumber_t&& x) noexcept + { + + m_high = x.m_high; + m_low = x.m_low; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_t& x) const + { + return (m_high == x.m_high && + m_low == x.m_low); + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_t object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_t& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high) + { + m_high = _high; + } + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const + { + return m_high; + } + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high() + { + return m_high; + } + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low) + { + m_low = _low; + } + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const + { + return m_low; + } + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low() + { + return m_low; + } + + + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; +/*! + * @brief This class represents the structure SampleIdentity defined by the user in the IDL file. + * @ingroup rpc_types + */ +class SampleIdentity +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SampleIdentity that will be copied. + */ + eProsima_user_DllExport SampleIdentity( + const SampleIdentity& x) + { + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SampleIdentity that will be copied. + */ + eProsima_user_DllExport SampleIdentity( + SampleIdentity&& x) noexcept + { + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SampleIdentity that will be copied. + */ + eProsima_user_DllExport SampleIdentity& operator =( + const SampleIdentity& x) + { + + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SampleIdentity that will be copied. + */ + eProsima_user_DllExport SampleIdentity& operator =( + SampleIdentity&& x) noexcept + { + + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity& x) const + { + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const GUID_t& _writer_guid) + { + m_writer_guid = _writer_guid; + } + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + GUID_t&& _writer_guid) + { + m_writer_guid = std::move(_writer_guid); + } + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const GUID_t& writer_guid() const + { + return m_writer_guid; + } + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport GUID_t& writer_guid() + { + return m_writer_guid; + } + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const SequenceNumber_t& _sequence_number) + { + m_sequence_number = _sequence_number; + } + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + SequenceNumber_t&& _sequence_number) + { + m_sequence_number = std::move(_sequence_number); + } + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const SequenceNumber_t& sequence_number() const + { + return m_sequence_number; + } + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport SequenceNumber_t& sequence_number() + { + return m_sequence_number; + } + + + +private: + + GUID_t m_writer_guid; + SequenceNumber_t m_sequence_number; + +}; +namespace rpc { + +typedef uint8_t UnknownOperation; + +typedef uint8_t UnknownException; + +typedef uint8_t UnusedMember; + +/*! + * @brief This class represents the enumeration RemoteExceptionCode_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +enum class RemoteExceptionCode_t : uint32_t +{ + REMOTE_EX_OK, + REMOTE_EX_UNSUPPORTED, + REMOTE_EX_INVALID_ARGUMENT, + REMOTE_EX_OUT_OF_RESOURCES, + REMOTE_EX_UNKNOWN_OPERATION, + REMOTE_EX_UNKNOWN_EXCEPTION +}; +typedef eprosima::fastcdr::fixed_string<255> InstanceName; + +/*! + * @brief This class represents the structure RequestHeader defined by the user in the IDL file. + * @ingroup rpc_types + */ +class RequestHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RequestHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RequestHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object RequestHeader that will be copied. + */ + eProsima_user_DllExport RequestHeader( + const RequestHeader& x) + { + m_requestId = x.m_requestId; + + m_instanceName = x.m_instanceName; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object RequestHeader that will be copied. + */ + eProsima_user_DllExport RequestHeader( + RequestHeader&& x) noexcept + { + m_requestId = std::move(x.m_requestId); + m_instanceName = std::move(x.m_instanceName); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object RequestHeader that will be copied. + */ + eProsima_user_DllExport RequestHeader& operator =( + const RequestHeader& x) + { + + m_requestId = x.m_requestId; + + m_instanceName = x.m_instanceName; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object RequestHeader that will be copied. + */ + eProsima_user_DllExport RequestHeader& operator =( + RequestHeader&& x) noexcept + { + + m_requestId = std::move(x.m_requestId); + m_instanceName = std::move(x.m_instanceName); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x RequestHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RequestHeader& x) const + { + return (m_requestId == x.m_requestId && + m_instanceName == x.m_instanceName); + } + + /*! + * @brief Comparison operator. + * @param x RequestHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RequestHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member requestId + * @param _requestId New value to be copied in member requestId + */ + eProsima_user_DllExport void requestId( + const eprosima::fastdds::dds::SampleIdentity& _requestId) + { + m_requestId = _requestId; + } + + /*! + * @brief This function moves the value in member requestId + * @param _requestId New value to be moved in member requestId + */ + eProsima_user_DllExport void requestId( + eprosima::fastdds::dds::SampleIdentity&& _requestId) + { + m_requestId = std::move(_requestId); + } + + /*! + * @brief This function returns a constant reference to member requestId + * @return Constant reference to member requestId + */ + eProsima_user_DllExport const eprosima::fastdds::dds::SampleIdentity& requestId() const + { + return m_requestId; + } + + /*! + * @brief This function returns a reference to member requestId + * @return Reference to member requestId + */ + eProsima_user_DllExport eprosima::fastdds::dds::SampleIdentity& requestId() + { + return m_requestId; + } + + + /*! + * @brief This function copies the value in member instanceName + * @param _instanceName New value to be copied in member instanceName + */ + eProsima_user_DllExport void instanceName( + const InstanceName& _instanceName) + { + m_instanceName = _instanceName; + } + + /*! + * @brief This function moves the value in member instanceName + * @param _instanceName New value to be moved in member instanceName + */ + eProsima_user_DllExport void instanceName( + InstanceName&& _instanceName) + { + m_instanceName = std::move(_instanceName); + } + + /*! + * @brief This function returns a constant reference to member instanceName + * @return Constant reference to member instanceName + */ + eProsima_user_DllExport const InstanceName& instanceName() const + { + return m_instanceName; + } + + /*! + * @brief This function returns a reference to member instanceName + * @return Reference to member instanceName + */ + eProsima_user_DllExport InstanceName& instanceName() + { + return m_instanceName; + } + + + +private: + + eprosima::fastdds::dds::SampleIdentity m_requestId; + InstanceName m_instanceName; + +}; +/*! + * @brief This class represents the structure ReplyHeader defined by the user in the IDL file. + * @ingroup rpc_types + */ +class ReplyHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ReplyHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ReplyHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ReplyHeader that will be copied. + */ + eProsima_user_DllExport ReplyHeader( + const ReplyHeader& x) + { + m_relatedRequestId = x.m_relatedRequestId; + + m_remoteEx = x.m_remoteEx; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ReplyHeader that will be copied. + */ + eProsima_user_DllExport ReplyHeader( + ReplyHeader&& x) noexcept + { + m_relatedRequestId = std::move(x.m_relatedRequestId); + m_remoteEx = x.m_remoteEx; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ReplyHeader that will be copied. + */ + eProsima_user_DllExport ReplyHeader& operator =( + const ReplyHeader& x) + { + + m_relatedRequestId = x.m_relatedRequestId; + + m_remoteEx = x.m_remoteEx; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ReplyHeader that will be copied. + */ + eProsima_user_DllExport ReplyHeader& operator =( + ReplyHeader&& x) noexcept + { + + m_relatedRequestId = std::move(x.m_relatedRequestId); + m_remoteEx = x.m_remoteEx; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ReplyHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ReplyHeader& x) const + { + return (m_relatedRequestId == x.m_relatedRequestId && + m_remoteEx == x.m_remoteEx); + } + + /*! + * @brief Comparison operator. + * @param x ReplyHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ReplyHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member relatedRequestId + * @param _relatedRequestId New value to be copied in member relatedRequestId + */ + eProsima_user_DllExport void relatedRequestId( + const eprosima::fastdds::dds::SampleIdentity& _relatedRequestId) + { + m_relatedRequestId = _relatedRequestId; + } + + /*! + * @brief This function moves the value in member relatedRequestId + * @param _relatedRequestId New value to be moved in member relatedRequestId + */ + eProsima_user_DllExport void relatedRequestId( + eprosima::fastdds::dds::SampleIdentity&& _relatedRequestId) + { + m_relatedRequestId = std::move(_relatedRequestId); + } + + /*! + * @brief This function returns a constant reference to member relatedRequestId + * @return Constant reference to member relatedRequestId + */ + eProsima_user_DllExport const eprosima::fastdds::dds::SampleIdentity& relatedRequestId() const + { + return m_relatedRequestId; + } + + /*! + * @brief This function returns a reference to member relatedRequestId + * @return Reference to member relatedRequestId + */ + eProsima_user_DllExport eprosima::fastdds::dds::SampleIdentity& relatedRequestId() + { + return m_relatedRequestId; + } + + + /*! + * @brief This function sets a value in member remoteEx + * @param _remoteEx New value for member remoteEx + */ + eProsima_user_DllExport void remoteEx( + RemoteExceptionCode_t _remoteEx) + { + m_remoteEx = _remoteEx; + } + + /*! + * @brief This function returns the value of member remoteEx + * @return Value of member remoteEx + */ + eProsima_user_DllExport RemoteExceptionCode_t remoteEx() const + { + return m_remoteEx; + } + + /*! + * @brief This function returns a reference to member remoteEx + * @return Reference to member remoteEx + */ + eProsima_user_DllExport RemoteExceptionCode_t& remoteEx() + { + return m_remoteEx; + } + + + +private: + + eprosima::fastdds::dds::SampleIdentity m_relatedRequestId; + RemoteExceptionCode_t m_remoteEx{RemoteExceptionCode_t::REMOTE_EX_OK}; + +}; + +} // namespace rpc + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_HPP_ + + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.idl b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.idl new file mode 100644 index 00000000000..19a15632890 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.idl @@ -0,0 +1,80 @@ +//This directive is not supported yet. +//#ifdef BASIC + +module dds { + +//This directive is not supported yet. +//#ifdef REDEFINE_DDS_TYPES + + // The following DDS related types are + // borrowed from the RTPS v1.2 specification + typedef octet GuidPrefix_t[12]; + + @nested + struct EntityId_t + { + octet entityKey[3]; + octet entityKind; + }; + + @nested + struct GUID_t + { + GuidPrefix_t guidPrefix; + EntityId_t entityId; + }; + + @nested + struct SequenceNumber_t + { + long high; + unsigned long low; + }; + +//#endif // REDEFINE_DDS_TYPES + +@nested +struct SampleIdentity +{ + GUID_t writer_guid; + SequenceNumber_t sequence_number; +}; + +module rpc { + +typedef octet UnknownOperation; +typedef octet UnknownException; +typedef octet UnusedMember; + +enum RemoteExceptionCode_t +{ + REMOTE_EX_OK, + REMOTE_EX_UNSUPPORTED, + REMOTE_EX_INVALID_ARGUMENT, + REMOTE_EX_OUT_OF_RESOURCES, + REMOTE_EX_UNKNOWN_OPERATION, + REMOTE_EX_UNKNOWN_EXCEPTION +}; + +typedef string<255> InstanceName; + +@nested +struct RequestHeader +{ + dds::SampleIdentity requestId; + InstanceName instanceName; +}; + +@nested +struct ReplyHeader +{ + dds::SampleIdentity relatedRequestId; + dds::rpc::RemoteExceptionCode_t remoteEx; +}; + +}; // module rpc + +}; // module dds + +//#endif // BASIC + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.hpp b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.hpp new file mode 100644 index 00000000000..4cb04c42841 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.hpp @@ -0,0 +1,86 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file rpc_typesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_HPP_ + +#include "rpc_types.hpp" + +constexpr uint32_t eprosima_fastdds_dds_rpc_RequestHeader_max_cdr_typesize {304UL}; +constexpr uint32_t eprosima_fastdds_dds_rpc_RequestHeader_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_EntityId_t_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_dds_EntityId_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_GUID_t_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_dds_GUID_t_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_rpc_ReplyHeader_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_rpc_ReplyHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_SequenceNumber_t_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_dds_SequenceNumber_t_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_SampleIdentity_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_SampleIdentity_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::EntityId_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::GUID_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SequenceNumber_t& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SampleIdentity& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::RequestHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::ReplyHeader& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_HPP_ + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.ipp b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.ipp new file mode 100644 index 00000000000..2f49369f96c --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesCdrAux.ipp @@ -0,0 +1,594 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file rpc_typesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_IPP_ + +#include "rpc_typesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::EntityId_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.entityKey(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.entityKind(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::EntityId_t& data) +{ + using namespace eprosima::fastdds::dds; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.entityKey() + << eprosima::fastcdr::MemberId(1) << data.entityKind() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::EntityId_t& data) +{ + using namespace eprosima::fastdds::dds; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.entityKey(); + break; + + case 1: + dcdr >> data.entityKind(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::EntityId_t& data) +{ + using namespace eprosima::fastdds::dds; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::GUID_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.guidPrefix(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.entityId(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::GUID_t& data) +{ + using namespace eprosima::fastdds::dds; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.guidPrefix() + << eprosima::fastcdr::MemberId(1) << data.entityId() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::GUID_t& data) +{ + using namespace eprosima::fastdds::dds; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.guidPrefix(); + break; + + case 1: + dcdr >> data.entityId(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::GUID_t& data) +{ + using namespace eprosima::fastdds::dds; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::SequenceNumber_t& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.high(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.low(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::dds; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.high() + << eprosima::fastcdr::MemberId(1) << data.low() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::dds; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.high(); + break; + + case 1: + dcdr >> data.low(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SequenceNumber_t& data) +{ + using namespace eprosima::fastdds::dds; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::SampleIdentity& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.writer_guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.sequence_number(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SampleIdentity& data) +{ + using namespace eprosima::fastdds::dds; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.writer_guid() + << eprosima::fastcdr::MemberId(1) << data.sequence_number() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::SampleIdentity& data) +{ + using namespace eprosima::fastdds::dds; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.writer_guid(); + break; + + case 1: + dcdr >> data.sequence_number(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::SampleIdentity& data) +{ + using namespace eprosima::fastdds::dds; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::rpc::RequestHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::rpc; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.requestId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.instanceName(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::RequestHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.requestId() + << eprosima::fastcdr::MemberId(1) << data.instanceName() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::rpc::RequestHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.requestId(); + break; + + case 1: + dcdr >> data.instanceName(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::RequestHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::rpc::ReplyHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::rpc; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.relatedRequestId(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.remoteEx(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::ReplyHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.relatedRequestId() + << eprosima::fastcdr::MemberId(1) << data.remoteEx() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::rpc::ReplyHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.relatedRequestId(); + break; + + case 1: + dcdr >> data.remoteEx(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::rpc::ReplyHeader& data) +{ + using namespace eprosima::fastdds::dds::rpc; + + static_cast(scdr); + static_cast(data); +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPESCDRAUX_IPP_ + diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx new file mode 100644 index 00000000000..c6f3ada8b49 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx @@ -0,0 +1,1215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file rpc_typesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + +#include "rpc_typesPubSubTypes.h" + +#include +#include + +#include "rpc_typesCdrAux.hpp" +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +EntityId_tPubSubType::EntityId_tPubSubType() +{ + setName("eprosima::fastdds::dds::EntityId_t"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityId_t::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_EntityId_t_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_fastdds_dds_EntityId_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_EntityId_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +EntityId_tPubSubType::~EntityId_tPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool EntityId_tPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + EntityId_t* 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; + } + 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 EntityId_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + EntityId_t* 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 EntityId_tPubSubType::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* EntityId_tPubSubType::createData() +{ + return reinterpret_cast(new EntityId_t()); +} + +void EntityId_tPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool EntityId_tPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + EntityId_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_EntityId_t_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_fastdds_dds_EntityId_t_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; +} + +void EntityId_tPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +GUID_tPubSubType::GUID_tPubSubType() +{ + setName("eprosima::fastdds::dds::GUID_t"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(GUID_t::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_GUID_t_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_fastdds_dds_GUID_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_GUID_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +GUID_tPubSubType::~GUID_tPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool GUID_tPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + GUID_t* 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; + } + 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 GUID_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + GUID_t* 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 GUID_tPubSubType::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* GUID_tPubSubType::createData() +{ + return reinterpret_cast(new GUID_t()); +} + +void GUID_tPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool GUID_tPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + GUID_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_GUID_t_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_fastdds_dds_GUID_t_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; +} + +void GUID_tPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +SequenceNumber_tPubSubType::SequenceNumber_tPubSubType() +{ + setName("eprosima::fastdds::dds::SequenceNumber_t"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceNumber_t::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_SequenceNumber_t_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_fastdds_dds_SequenceNumber_t_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_SequenceNumber_t_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +SequenceNumber_tPubSubType::~SequenceNumber_tPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool SequenceNumber_tPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SequenceNumber_t* 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; + } + 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 SequenceNumber_tPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SequenceNumber_t* 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 SequenceNumber_tPubSubType::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* SequenceNumber_tPubSubType::createData() +{ + return reinterpret_cast(new SequenceNumber_t()); +} + +void SequenceNumber_tPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SequenceNumber_tPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + SequenceNumber_t* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_SequenceNumber_t_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_fastdds_dds_SequenceNumber_t_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; +} + +void SequenceNumber_tPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +SampleIdentityPubSubType::SampleIdentityPubSubType() +{ + setName("eprosima::fastdds::dds::SampleIdentity"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SampleIdentity::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_SampleIdentity_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_fastdds_dds_SampleIdentity_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_SampleIdentity_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +SampleIdentityPubSubType::~SampleIdentityPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool SampleIdentityPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + SampleIdentity* 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; + } + 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 SampleIdentityPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + SampleIdentity* 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 SampleIdentityPubSubType::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* SampleIdentityPubSubType::createData() +{ + return reinterpret_cast(new SampleIdentity()); +} + +void SampleIdentityPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool SampleIdentityPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + SampleIdentity* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_SampleIdentity_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_fastdds_dds_SampleIdentity_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; +} + +void SampleIdentityPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +namespace rpc { + RequestHeaderPubSubType::RequestHeaderPubSubType() + { + setName("eprosima::fastdds::dds::rpc::RequestHeader"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(RequestHeader::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_rpc_RequestHeader_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_fastdds_dds_rpc_RequestHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_rpc_RequestHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + RequestHeaderPubSubType::~RequestHeaderPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool RequestHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + RequestHeader* 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; + } + 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 RequestHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + RequestHeader* 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 RequestHeaderPubSubType::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* RequestHeaderPubSubType::createData() + { + return reinterpret_cast(new RequestHeader()); + } + + void RequestHeaderPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool RequestHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + RequestHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_rpc_RequestHeader_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_fastdds_dds_rpc_RequestHeader_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; + } + + void RequestHeaderPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + + ReplyHeaderPubSubType::ReplyHeaderPubSubType() + { + setName("eprosima::fastdds::dds::rpc::ReplyHeader"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(ReplyHeader::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_dds_rpc_ReplyHeader_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_fastdds_dds_rpc_ReplyHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_rpc_ReplyHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ReplyHeaderPubSubType::~ReplyHeaderPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ReplyHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + ReplyHeader* 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; + } + 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 ReplyHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + ReplyHeader* 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 ReplyHeaderPubSubType::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* ReplyHeaderPubSubType::createData() + { + return reinterpret_cast(new ReplyHeader()); + } + + void ReplyHeaderPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ReplyHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + ReplyHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_rpc_ReplyHeader_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_fastdds_dds_rpc_ReplyHeader_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; + } + + void ReplyHeaderPubSubType::register_type_object_representation() const + { + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); + } + +} // namespace rpc + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +// Include auxiliary functions like for serializing/deserializing. +#include "rpc_typesCdrAux.ipp" diff --git a/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.h b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.h new file mode 100644 index 00000000000..a3812e63d81 --- /dev/null +++ b/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.h @@ -0,0 +1,611 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file rpc_typesPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "rpc_types.hpp" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated rpc_types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef std::array GuidPrefix_t; + +/*! + * @brief This class represents the TopicDataType of the type EntityId_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class EntityId_tPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef EntityId_t type; + + eProsima_user_DllExport EntityId_tPubSubType(); + + eProsima_user_DllExport ~EntityId_tPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type GUID_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class GUID_tPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef GUID_t type; + + eProsima_user_DllExport GUID_tPubSubType(); + + eProsima_user_DllExport ~GUID_tPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type SequenceNumber_t defined by the user in the IDL file. + * @ingroup rpc_types + */ +class SequenceNumber_tPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SequenceNumber_t type; + + eProsima_user_DllExport SequenceNumber_tPubSubType(); + + eProsima_user_DllExport ~SequenceNumber_tPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type SampleIdentity defined by the user in the IDL file. + * @ingroup rpc_types + */ +class SampleIdentityPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef SampleIdentity type; + + eProsima_user_DllExport SampleIdentityPubSubType(); + + eProsima_user_DllExport ~SampleIdentityPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +namespace rpc +{ + typedef uint8_t UnknownOperation; + typedef uint8_t UnknownException; + typedef uint8_t UnusedMember; + + typedef eprosima::fastcdr::fixed_string<255> InstanceName; + + /*! + * @brief This class represents the TopicDataType of the type RequestHeader defined by the user in the IDL file. + * @ingroup rpc_types + */ + class RequestHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef RequestHeader type; + + eProsima_user_DllExport RequestHeaderPubSubType(); + + eProsima_user_DllExport ~RequestHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type ReplyHeader defined by the user in the IDL file. + * @ingroup rpc_types + */ + class ReplyHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ReplyHeader type; + + eProsima_user_DllExport ReplyHeaderPubSubType(); + + eProsima_user_DllExport ~ReplyHeaderPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; +} // namespace rpc + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_RPC_RPC_TYPES_PUBSUBTYPES_H_ + diff --git a/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp deleted file mode 100644 index 40ffd150fb2..00000000000 --- a/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp +++ /dev/null @@ -1,762 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupManager.cpp - * - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// TODO Uncomment if security is implemented. -//#include -//#include - -#include - -#include - -#include - -namespace eprosima { - -using namespace fastrtps::rtps; -using eprosima::fastdds::dds::Log; - -namespace fastdds { -namespace dds { -namespace builtin { - -const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -TypeLookupManager::TypeLookupManager( - BuiltinProtocols* prot) - : participant_(nullptr) - , builtin_protocols_(prot) - , builtin_request_writer_(nullptr) - , builtin_request_reader_(nullptr) - , builtin_reply_writer_(nullptr) - , builtin_reply_reader_(nullptr) - , builtin_request_writer_history_(nullptr) - , builtin_reply_writer_history_(nullptr) - , builtin_request_reader_history_(nullptr) - , builtin_reply_reader_history_(nullptr) - , request_listener_(nullptr) - , reply_listener_(nullptr) - , temp_reader_proxy_data_( - prot->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_unicast_locators, - prot->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_multicast_locators) - , temp_writer_proxy_data_( - prot->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_unicast_locators, - prot->mp_participantImpl->getRTPSParticipantAttributes().allocation.locators.max_multicast_locators) - /* TODO Uncomment if security is implemented - #if HAVE_SECURITY - , builtin_request_writer_secure_(nullptr) - , builtin_reply_writer_secure_(nullptr) - , builtin_request_reader_secure_(nullptr) - , builtin_reply_reader_secure_(nullptr) - , builtin_request_writer_secure_history_(nullptr) - , builtin_reply_writer_secure_history_(nullptr) - , builtin_request_reader_secure_history_(nullptr) - , builtin_reply_reader_secure_history_(nullptr) - #endif - */ -{ -} - -TypeLookupManager::~TypeLookupManager() -{ - /* TODO Uncomment if security is implemented - #if HAVE_SECURITY - participant_->deleteUserEndpoint(builtin_request_writer_secure_); - participant_->deleteUserEndpoint(builtin_reply_writer_secure_); - participant_->deleteUserEndpoint(builtin_request_reader_secure_); - participant_->deleteUserEndpoint(builtin_reply_reader_secure_); - delete builtin_request_writer_secure_history_; - delete builtin_reply_writer_secure_history_; - delete builtin_request_reader_secure_history_; - delete builtin_reply_reader_secure_history_; - #endif - */ - if (nullptr != builtin_reply_reader_) - { - participant_->deleteUserEndpoint(builtin_reply_reader_->getGuid()); - } - if (nullptr != builtin_reply_writer_) - { - participant_->deleteUserEndpoint(builtin_reply_writer_->getGuid()); - } - if (nullptr != builtin_request_reader_) - { - participant_->deleteUserEndpoint(builtin_request_reader_->getGuid()); - } - if (nullptr != builtin_request_writer_) - { - participant_->deleteUserEndpoint(builtin_request_writer_->getGuid()); - } - delete builtin_request_writer_history_; - delete builtin_reply_writer_history_; - delete builtin_request_reader_history_; - delete builtin_reply_reader_history_; - - delete reply_listener_; - delete request_listener_; -} - -bool TypeLookupManager::init_typelookup_service( - RTPSParticipantImpl* participant) -{ - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Initializing TypeLookup Service"); - participant_ = participant; - bool retVal = create_endpoints(); - /* - #if HAVE_SECURITY - if (retVal) - { - retVal = create_secure_endpoints(); - } - #endif - */ - return retVal; -} - -bool TypeLookupManager::assign_remote_endpoints( - const ParticipantProxyData& pdata) -{ - const NetworkFactory& network = participant_->network_factory(); - uint32_t endp = pdata.m_availableBuiltinEndpoints; - uint32_t auxendp = endp; - - std::lock_guard data_guard(temp_data_lock_); - - temp_writer_proxy_data_.guid().guidPrefix = pdata.m_guid.guidPrefix; - temp_writer_proxy_data_.persistence_guid().guidPrefix = pdata.m_guid.guidPrefix; - temp_writer_proxy_data_.set_remote_locators(pdata.metatraffic_locators, network, true); - temp_writer_proxy_data_.topicKind(NO_KEY); - temp_writer_proxy_data_.m_qos.m_durability.kind = fastrtps::VOLATILE_DURABILITY_QOS; - temp_writer_proxy_data_.m_qos.m_reliability.kind = fastrtps::RELIABLE_RELIABILITY_QOS; - - temp_reader_proxy_data_.clear(); - temp_reader_proxy_data_.m_expectsInlineQos = false; - temp_reader_proxy_data_.guid().guidPrefix = pdata.m_guid.guidPrefix; - temp_reader_proxy_data_.set_remote_locators(pdata.metatraffic_locators, network, true); - temp_reader_proxy_data_.topicKind(NO_KEY); - temp_reader_proxy_data_.m_qos.m_durability.kind = fastrtps::VOLATILE_DURABILITY_QOS; - temp_reader_proxy_data_.m_qos.m_reliability.kind = fastrtps::RELIABLE_RELIABILITY_QOS; - - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "for RTPSParticipant: " << pdata.m_guid); - - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; - - if (auxendp != 0 && builtin_request_reader_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote writer to the local Builtin Request Reader"); - temp_writer_proxy_data_.guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; - temp_writer_proxy_data_.persistence_guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; - builtin_request_reader_->matched_writer_add(temp_writer_proxy_data_); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; - - if (auxendp != 0 && builtin_reply_reader_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote writer to the local Builtin Reply Reader"); - temp_writer_proxy_data_.guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; - temp_writer_proxy_data_.persistence_guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; - builtin_reply_reader_->matched_writer_add(temp_writer_proxy_data_); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; - - if (auxendp != 0 && builtin_request_writer_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote reader to the local Builtin Request Writer"); - temp_reader_proxy_data_.guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_reader; - builtin_request_writer_->matched_reader_add(temp_reader_proxy_data_); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; - - if (auxendp != 0 && builtin_reply_writer_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Adding remote reader to the local Builtin Reply Writer"); - temp_reader_proxy_data_.guid().entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_reader; - builtin_reply_writer_->matched_reader_add(temp_reader_proxy_data_); - } - - return true; -} - -void TypeLookupManager::remove_remote_endpoints( - fastrtps::rtps::ParticipantProxyData* pdata) -{ - GUID_t tmp_guid; - tmp_guid.guidPrefix = pdata->m_guid.guidPrefix; - - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "for RTPSParticipant: " << pdata->m_guid); - uint32_t endp = pdata->m_availableBuiltinEndpoints; - uint32_t partdet = endp; - uint32_t auxendp = endp; - partdet &= DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR; //Habria que quitar esta linea que comprueba si tiene PDP. - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; - - if ((auxendp != 0 || partdet != 0) && builtin_request_reader_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote writer from the local Builtin Request Reader"); - tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_writer; - builtin_request_reader_->matched_writer_remove(tmp_guid); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; - - if ((auxendp != 0 || partdet != 0) && builtin_reply_reader_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote writer from the local Builtin Reply Reader"); - tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; - builtin_reply_reader_->matched_writer_remove(tmp_guid); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; - - if ((auxendp != 0 || partdet != 0) && builtin_request_writer_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote reader from the local Builtin Request Writer"); - tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_request_reader; - builtin_request_writer_->matched_reader_remove(tmp_guid); - } - - auxendp = endp; - auxendp &= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; - - if ((auxendp != 0 || partdet != 0) && builtin_reply_writer_ != nullptr) - { - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Removing remote reader from the local Builtin Reply Writer"); - tmp_guid.entityId = fastrtps::rtps::c_EntityId_TypeLookup_reply_reader; - builtin_reply_writer_->matched_reader_remove(tmp_guid); - } -} - -StatefulWriter* TypeLookupManager::get_builtin_request_writer() -{ - return builtin_request_writer_; -} - -StatefulWriter* TypeLookupManager::get_builtin_reply_writer() -{ - return builtin_reply_writer_; -} - -WriterHistory* TypeLookupManager::get_builtin_request_writer_history() -{ - return builtin_request_writer_history_; -} - -WriterHistory* TypeLookupManager::get_builtin_reply_writer_history() -{ - return builtin_reply_writer_history_; -} - -StatefulReader* TypeLookupManager::get_builtin_request_reader() -{ - return builtin_request_reader_; -} - -StatefulReader* TypeLookupManager::get_builtin_reply_reader() -{ - return builtin_reply_reader_; -} - -ReaderHistory* TypeLookupManager::get_builtin_request_reader_history() -{ - return builtin_request_reader_history_; -} - -ReaderHistory* TypeLookupManager::get_builtin_reply_reader_history() -{ - return builtin_reply_reader_history_; -} - -/* TODO Implement if security is needed. - #if HAVE_SECURITY - bool TypeLookupManager::pairing_remote_reader_with_local_writer_after_security( - const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data) - { - - } - - bool TypeLookupManager::pairing_remote_writer_with_local_reader_after_security( - const GUID_t& local_reader, - const WriterProxyData& remote_writer_data) - { - - } - #endif - */ -bool TypeLookupManager::create_endpoints() -{ - bool ret = true; - - const RTPSParticipantAttributes& pattr = participant_->getRTPSParticipantAttributes(); - - // Built-in history attributes. - HistoryAttributes hatt; - hatt.initialReservedCaches = 20; - hatt.maximumReservedCaches = 1000; - hatt.payloadMaxSize = TYPELOOKUP_DATA_MAX_SIZE; - - WriterAttributes watt; - watt.endpoint.unicastLocatorList = builtin_protocols_->m_metatrafficUnicastLocatorList; - watt.endpoint.multicastLocatorList = builtin_protocols_->m_metatrafficMulticastLocatorList; - watt.endpoint.external_unicast_locators = builtin_protocols_->m_att.metatraffic_external_unicast_locators; - watt.endpoint.ignore_non_matching_locators = pattr.ignore_non_matching_locators; - watt.endpoint.remoteLocatorList = builtin_protocols_->m_initialPeersList; - watt.matched_readers_allocation = pattr.allocation.participants; - watt.endpoint.topicKind = fastrtps::rtps::NO_KEY; - watt.endpoint.reliabilityKind = fastrtps::rtps::RELIABLE; - watt.endpoint.durabilityKind = fastrtps::rtps::VOLATILE; - - // Built-in request writer - if (builtin_protocols_->m_att.typelookup_config.use_client) - { - request_listener_ = new TypeLookupRequestListener(this); - builtin_request_writer_history_ = new WriterHistory(hatt); - - RTPSWriter* req_writer; - if (participant_->createWriter( - &req_writer, - watt, - builtin_request_writer_history_, - request_listener_, - fastrtps::rtps::c_EntityId_TypeLookup_request_writer, - true)) - { - builtin_request_writer_ = dynamic_cast(req_writer); - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup request writer created."); - } - else - { - EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request writer creation failed."); - ret = false; - } - } - - // Built-in reply writer - if (ret && builtin_protocols_->m_att.typelookup_config.use_server) - { - reply_listener_ = new TypeLookupReplyListener(this); - builtin_reply_writer_history_ = new WriterHistory(hatt); - - RTPSWriter* rep_writer; - if (participant_->createWriter( - &rep_writer, - watt, - builtin_reply_writer_history_, - reply_listener_, - fastrtps::rtps::c_EntityId_TypeLookup_reply_writer, - true)) - { - builtin_reply_writer_ = dynamic_cast(rep_writer); - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply writer created."); - } - else - { - EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply writer creation failed."); - ret = false; - } - } - - ReaderAttributes ratt; - ratt.endpoint.unicastLocatorList = builtin_protocols_->m_metatrafficUnicastLocatorList; - ratt.endpoint.multicastLocatorList = builtin_protocols_->m_metatrafficMulticastLocatorList; - ratt.endpoint.external_unicast_locators = builtin_protocols_->m_att.metatraffic_external_unicast_locators; - ratt.endpoint.ignore_non_matching_locators = pattr.ignore_non_matching_locators; - ratt.endpoint.remoteLocatorList = builtin_protocols_->m_initialPeersList; - ratt.matched_writers_allocation = pattr.allocation.participants; - ratt.expectsInlineQos = true; - ratt.endpoint.topicKind = fastrtps::rtps::NO_KEY; - ratt.endpoint.reliabilityKind = fastrtps::rtps::RELIABLE; - ratt.endpoint.durabilityKind = fastrtps::rtps::VOLATILE; - - // Built-in request reader - if (ret && builtin_protocols_->m_att.typelookup_config.use_server) - { - if (nullptr == request_listener_) - { - request_listener_ = new TypeLookupRequestListener(this); - } - builtin_request_reader_history_ = new ReaderHistory(hatt); - - RTPSReader* req_reader; - if (participant_->createReader( - &req_reader, - ratt, - builtin_request_reader_history_, - request_listener_, - fastrtps::rtps::c_EntityId_TypeLookup_request_reader, - true)) - { - builtin_request_reader_ = dynamic_cast(req_reader); - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup request reader created."); - } - else - { - EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup request reader creation failed."); - ret = false; - } - } - - // Built-in reply reader - if (ret && builtin_protocols_->m_att.typelookup_config.use_client) - { - if (nullptr == reply_listener_) - { - reply_listener_ = new TypeLookupReplyListener(this); - } - builtin_reply_reader_history_ = new ReaderHistory(hatt); - - RTPSReader* rep_reader; - if (participant_->createReader( - &rep_reader, - ratt, - builtin_reply_reader_history_, - reply_listener_, - fastrtps::rtps::c_EntityId_TypeLookup_reply_reader, - true)) - { - builtin_reply_reader_ = dynamic_cast(rep_reader); - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE, "Builtin Typelookup reply reader created."); - } - else - { - EPROSIMA_LOG_ERROR(TYPELOOKUP_SERVICE, "Typelookup reply reader creation failed."); - ret = false; - } - } - - // Clean up if something failed. - if (!ret) - { - if (nullptr != builtin_request_writer_history_) - { - delete builtin_request_writer_history_; - builtin_request_writer_history_ = nullptr; - } - - if (nullptr != builtin_reply_writer_history_) - { - delete builtin_reply_writer_history_; - builtin_reply_writer_history_ = nullptr; - } - - if (nullptr != builtin_request_reader_history_) - { - delete builtin_request_reader_history_; - builtin_request_reader_history_ = nullptr; - } - - if (nullptr != builtin_reply_reader_history_) - { - delete builtin_reply_reader_history_; - builtin_reply_reader_history_ = nullptr; - } - - if (nullptr != request_listener_) - { - delete request_listener_; - request_listener_ = nullptr; - } - if (nullptr != reply_listener_) - { - delete reply_listener_; - reply_listener_ = nullptr; - } - } - - return ret; -} - -/* TODO Implement if security is needed. - #if HAVE_SECURITY - bool TypeLookupManager::create_secure_endpoints() - { - } - #endif - */ - -SampleIdentity TypeLookupManager::get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& id_seq) const -{ - SampleIdentity id = INVALID_SAMPLE_IDENTITY; - if (builtin_protocols_->m_att.typelookup_config.use_client) - { - TypeLookup_getTypeDependencies_In in; - in.type_ids = id_seq; - TypeLookup_RequestTypeSupport type; - TypeLookup_Request* request = static_cast(type.create_data()); - request->data.getTypeDependencies(in); - - if (send_request(*request)) - { - id = request->header.requestId; - } - type.delete_data(request); - } - return id; -} - -SampleIdentity TypeLookupManager::get_types( - const fastrtps::types::TypeIdentifierSeq& id_seq) const -{ - SampleIdentity id = INVALID_SAMPLE_IDENTITY; - if (builtin_protocols_->m_att.typelookup_config.use_client) - { - TypeLookup_getTypes_In in; - in.type_ids = id_seq; - TypeLookup_RequestTypeSupport type; - TypeLookup_Request* request = static_cast(type.create_data()); - request->data.getTypes(in); - - if (send_request(*request)) - { - id = request->header.requestId; - } - type.delete_data(request); - } - return id; -} - -std::string TypeLookupManager::get_instanceName() const -{ - std::stringstream ss; - ss << participant_->getGuid(); - std::string str = ss.str(); - std::transform(str.begin(), str.end(), str.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - str.erase(std::remove(str.begin(), str.end(), '.'), str.end()); - return "dds.builtin.TOS." + str; -} - -bool TypeLookupManager::send_request( - TypeLookup_Request& req) const -{ - req.header.instanceName = get_instanceName(); - req.header.requestId.writer_guid(builtin_request_writer_->getGuid()); - req.header.requestId.sequence_number(request_seq_number_); - ++request_seq_number_; - - CacheChange_t* change = builtin_request_writer_->new_change( - [&req]() - { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size(req, current_alignment) + 4); - }, - ALIVE); - - if (change != nullptr) - { - CDRMessage_t msg(change->serializedPayload); - - bool valid = CDRMessage::addOctet(&msg, 0); - change->serializedPayload.encapsulation = static_cast(PL_DEFAULT_ENCAPSULATION); - msg.msg_endian = DEFAULT_ENDIAN; - valid &= CDRMessage::addOctet(&msg, PL_DEFAULT_ENCAPSULATION); - valid &= CDRMessage::addUInt16(&msg, 0); - - change->serializedPayload.pos = msg.pos; - change->serializedPayload.length = msg.length; - - SerializedPayload_t payload; - payload.max_size = change->serializedPayload.max_size - 4; - payload.data = change->serializedPayload.data + 4; - - bool serialize_ret = request_type_.serialize(&req, &payload, DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - if (!serialize_ret) - { - payload.data = nullptr; - } - else if (valid) - { - change->serializedPayload.length += payload.length; - change->serializedPayload.pos += payload.pos; - payload.data = nullptr; - return builtin_request_writer_history_->add_change(change); - } - } - builtin_request_writer_history_->remove_change(change); - return false; - -} - -bool TypeLookupManager::send_reply( - TypeLookup_Reply& rep) const -{ - rep.header.instanceName = get_instanceName(); - - CacheChange_t* change = builtin_reply_writer_->new_change( - [&rep]() - { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size(rep, current_alignment) + 4); - }, - ALIVE); - - if (change != nullptr) - { - CDRMessage_t msg(change->serializedPayload); - - bool valid = CDRMessage::addOctet(&msg, 0); - change->serializedPayload.encapsulation = static_cast(PL_DEFAULT_ENCAPSULATION); - msg.msg_endian = DEFAULT_ENDIAN; - valid &= CDRMessage::addOctet(&msg, PL_DEFAULT_ENCAPSULATION); - valid &= CDRMessage::addUInt16(&msg, 0); - - change->serializedPayload.pos = msg.pos; - change->serializedPayload.length = msg.length; - - SerializedPayload_t payload; - payload.max_size = change->serializedPayload.max_size - 4; - payload.data = change->serializedPayload.data + 4; - - bool serialize_ret = reply_type_.serialize(&rep, &payload, DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - if (!serialize_ret) - { - payload.data = nullptr; - } - else if (valid) - { - change->serializedPayload.length += payload.length; - change->serializedPayload.pos += payload.pos; - payload.data = nullptr; - return builtin_reply_writer_history_->add_change(change); - } - } - builtin_request_writer_history_->remove_change(change); - return false; -} - -bool TypeLookupManager::recv_request( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Request& req) const -{ - CDRMessage_t msg(change.serializedPayload); - msg.pos += 1; - octet encapsulation = 0; - CDRMessage::readOctet(&msg, &encapsulation); - if (encapsulation == PL_CDR_BE) - { - msg.msg_endian = BIGEND; - } - else if (encapsulation == PL_CDR_LE) - { - msg.msg_endian = LITTLEEND; - } - else - { - return false; - } - change.serializedPayload.encapsulation = static_cast(encapsulation); - msg.pos += 2; // Skip encapsulation options. - - SerializedPayload_t payload; - payload.max_size = change.serializedPayload.max_size - 4; - payload.length = change.serializedPayload.length - 4; - payload.data = change.serializedPayload.data + 4; - bool result = request_type_.deserialize(&payload, &req); - payload.data = nullptr; - return result; -} - -bool TypeLookupManager::recv_reply( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Reply& rep) const -{ - CDRMessage_t msg(change.serializedPayload); - msg.pos += 1; - octet encapsulation = 0; - CDRMessage::readOctet(&msg, &encapsulation); - if (encapsulation == PL_CDR_BE) - { - msg.msg_endian = BIGEND; - } - else if (encapsulation == PL_CDR_LE) - { - msg.msg_endian = LITTLEEND; - } - else - { - return false; - } - change.serializedPayload.encapsulation = static_cast(encapsulation); - msg.pos += 2; // Skip encapsulation options. - - SerializedPayload_t payload; - payload.max_size = change.serializedPayload.max_size - 4; - payload.length = change.serializedPayload.length - 4; - payload.data = change.serializedPayload.data + 4; - bool result = reply_type_.deserialize(&payload, &rep); - payload.data = nullptr; - return result; -} - -const fastrtps::rtps::GUID_t& TypeLookupManager::get_builtin_request_writer_guid() const -{ - if (nullptr != builtin_request_writer_) - { - return builtin_request_writer_->getGuid(); - } - return c_Guid_Unknown; -} - -void TypeLookupManager::request_cache_change_acked( - fastrtps::rtps::CacheChange_t* change) -{ - builtin_request_writer_history_->remove_change(change); -} - -void TypeLookupManager::reply_cache_change_acked( - fastrtps::rtps::CacheChange_t* change) -{ - builtin_reply_writer_history_->remove_change(change); -} - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp b/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp deleted file mode 100644 index 3efe307b383..00000000000 --- a/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupReplyListener.cpp - * - */ - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include - -using eprosima::fastrtps::rtps::RTPSReader; -using eprosima::fastrtps::rtps::CacheChange_t; -using eprosima::fastdds::dds::Log; - -using eprosima::fastrtps::rtps::c_EntityId_TypeLookup_reply_writer; - -using namespace eprosima::fastrtps::types; - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace builtin { - -TypeLookupReplyListener::TypeLookupReplyListener( - TypeLookupManager* manager) - : tlm_(manager) - , factory_(TypeObjectFactory::get_instance()) -{ -} - -TypeLookupReplyListener::~TypeLookupReplyListener() -{ -} - -void TypeLookupReplyListener::onNewCacheChangeAdded( - RTPSReader* reader, - const CacheChange_t* const changeIN) -{ - CacheChange_t* change = const_cast(changeIN); - - if (change->writerGUID.entityId != c_EntityId_TypeLookup_reply_writer) - { - EPROSIMA_LOG_WARNING(TL_REPLY_READER, "Received data from a bad endpoint."); - reader->getHistory()->remove_change(change); - } - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE_REPLY_LISTENER, "Received new cache change"); - - TypeLookup_Reply reply; - if (tlm_->recv_reply(*change, reply)) - { - if (reply.header.requestId.writer_guid() != tlm_->get_builtin_request_writer_guid()) - { - // This message isn't for us. - return; - } - - switch (reply.return_value._d()) - { - case TypeLookup_getTypes_Hash: - { - const TypeLookup_getTypes_Out types = reply.return_value.getType().result(); - for (auto pair : types.types) - { - if (pair.type_object()._d() == EK_COMPLETE) // Just in case - { - // If build_dynamic_type failed, just sent the nullptr already contained on it. - tlm_->participant_->getListener()->on_type_discovery( - tlm_->participant_->getUserRTPSParticipant(), - reply.header.requestId, - "", // No topic_name available - &pair.type_identifier(), - &pair.type_object(), - DynamicType_ptr(nullptr)); - } - } - // TODO Call a callback once the job is done - break; - } - case TypeLookup_getDependencies_Hash: - { - //const TypeLookup_getTypeDependencies_Out dependencies = - // reply.return_value.getTypeDependencies().result(); - - tlm_->get_RTPS_participant()->getListener()->on_type_dependencies_reply( - tlm_->builtin_protocols_->mp_participantImpl->getUserRTPSParticipant(), - reply.header.requestId, - reply.return_value.getTypeDependencies().result().dependent_typeids); - break; - } - default: - break; - } - } - reader->getHistory()->remove_change(change); -} - -void TypeLookupReplyListener::onWriterChangeReceivedByAll( - fastrtps::rtps::RTPSWriter*, - fastrtps::rtps::CacheChange_t* change) -{ - tlm_->reply_cache_change_acked(change); -} - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp b/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp deleted file mode 100644 index f2ccfe37cc8..00000000000 --- a/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupRequestListener.cpp - * - */ - -#include -#include -#include - -#include - -#include -#include -#include - -#include - -using eprosima::fastrtps::rtps::RTPSReader; -using eprosima::fastrtps::rtps::CacheChange_t; -using eprosima::fastrtps::types::TypeIdentifier; -using eprosima::fastrtps::types::TypeObject; -using eprosima::fastrtps::types::TypeIdentifierTypeObjectPair; -using eprosima::fastrtps::types::TypeIdentifierPair; -using eprosima::fastrtps::types::TypeObjectFactory; -using eprosima::fastrtps::types::TypeIdentifierWithSize; -using eprosima::fastrtps::types::TypeIdentifierWithSizeSeq; -using eprosima::fastdds::dds::Log; - -using eprosima::fastrtps::rtps::c_EntityId_TypeLookup_request_writer; - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace builtin { - -TypeLookupRequestListener::TypeLookupRequestListener( - TypeLookupManager* manager) - : tlm_(manager) - , factory_(TypeObjectFactory::get_instance()) -{ -} - -TypeLookupRequestListener::~TypeLookupRequestListener() -{ -} - -void TypeLookupRequestListener::onNewCacheChangeAdded( - RTPSReader* reader, - const CacheChange_t* const changeIN) -{ - CacheChange_t* change = const_cast(changeIN); - - if (change->writerGUID.entityId != c_EntityId_TypeLookup_request_writer) - { - EPROSIMA_LOG_WARNING(TL_REQUEST_READER, "Received data from a bad endpoint."); - reader->getHistory()->remove_change(change); - } - - EPROSIMA_LOG_INFO(TYPELOOKUP_SERVICE_REQUEST_LISTENER, "Received new cache change"); - TypeLookup_Request request; - if (tlm_->recv_request(*change, request)) - { - // TODO checks? - if (request.header.requestId.writer_guid() == tlm_->get_builtin_request_writer_guid()) - { - // Message from our selves. - return; - } - // request.header.instanceName - - switch (request.data._d()) - { - case TypeLookup_getTypes_Hash: - { - const TypeLookup_getTypes_In in = request.data.getTypes(); - TypeLookup_getTypes_Out out; - - for (const TypeIdentifier& type_id : in.type_ids) - { - TypeObject obj; - const TypeIdentifier* obj_ident = factory_->typelookup_get_type(type_id, obj); - - if (obj_ident != nullptr && obj._d() != 0) - { - TypeIdentifierTypeObjectPair pair; - pair.type_identifier(type_id); - pair.type_object(obj); - out.types.push_back(std::move(pair)); - } - - if (obj_ident != nullptr && !(type_id == *obj_ident)) - { - TypeIdentifierPair pair; - pair.type_identifier1(*obj_ident); - pair.type_identifier2(type_id); - out.complete_to_minimal.push_back(std::move(pair)); - } - } - - TypeLookup_Reply* reply = static_cast(tlm_->reply_type_.create_data()); - TypeLookup_getTypes_Result result; - result.result(out); - reply->return_value.getType(result); - reply->header.requestId = request.header.requestId; - - tlm_->send_reply(*reply); - tlm_->reply_type_.delete_data(reply); - - break; - } - case TypeLookup_getDependencies_Hash: - { - const TypeLookup_getTypeDependencies_In in = request.data.getTypeDependencies(); - TypeLookup_getTypeDependencies_Out out; - //for (size_t index = 0; index < in.type_ids.size(); ++index) - { - out.dependent_typeids = factory_->typelookup_get_type_dependencies( - in.type_ids, in.continuation_point, out.continuation_point, 255); // TODO: Make configurable? - } - - TypeLookup_Reply* reply = static_cast(tlm_->reply_type_.create_data()); - TypeLookup_getTypeDependencies_Result result; - result.result(out); - reply->return_value.getTypeDependencies(result); - reply->header.requestId = request.header.requestId; - - tlm_->send_reply(*reply); - tlm_->reply_type_.delete_data(reply); - - break; - } - default: - break; - } - } - reader->getHistory()->remove_change(change); -} - -void TypeLookupRequestListener::onWriterChangeReceivedByAll( - fastrtps::rtps::RTPSWriter*, - fastrtps::rtps::CacheChange_t* change) -{ - tlm_->request_cache_change_acked(change); -} - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp deleted file mode 100644 index 7876c5f1a4c..00000000000 --- a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp +++ /dev/null @@ -1,1227 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TypeLookupTypes.hpp - * - */ - -#include -#include -#include - -using namespace eprosima; -using namespace eprosima::fastcdr; -using namespace eprosima::fastcdr::exception; - -using eprosima::fastrtps::types::TypeIdentifier; -using eprosima::fastrtps::types::TypeIdentifierWithSize; -using eprosima::fastrtps::types::TypeIdentifierPair; -using eprosima::fastrtps::types::TypeIdentifierTypeObjectPair; - -#include "TypeLookupTypesCdrAux.ipp" - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace builtin { - -TypeLookup_getTypes_Result::TypeLookup_getTypes_Result() -{ - m__d = 0; -} - -TypeLookup_getTypes_Result::~TypeLookup_getTypes_Result() -{ -} - -TypeLookup_getTypes_Result::TypeLookup_getTypes_Result( - const TypeLookup_getTypes_Result& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_result = x.m_result; - break; - default: - break; - } -} - -TypeLookup_getTypes_Result::TypeLookup_getTypes_Result( - TypeLookup_getTypes_Result&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_result = std::move(x.m_result); - break; - default: - break; - } -} - -TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator =( - const TypeLookup_getTypes_Result& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_result = x.m_result; - break; - default: - break; - } - - return *this; -} - -TypeLookup_getTypes_Result& TypeLookup_getTypes_Result::operator =( - TypeLookup_getTypes_Result&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_result = std::move(x.m_result); - break; - default: - break; - } - - return *this; -} - -void TypeLookup_getTypes_Result::_d( - int32_t __d) -{ - m__d = __d; -} - -int32_t TypeLookup_getTypes_Result::_d() const -{ - return m__d; -} - -int32_t& TypeLookup_getTypes_Result::_d() -{ - return m__d; -} - -void TypeLookup_getTypes_Result::result( - const TypeLookup_getTypes_Out& _result) -{ - m_result = _result; - m__d = 0; -} - -void TypeLookup_getTypes_Result::result( - TypeLookup_getTypes_Out&& _result) -{ - m_result = std::move(_result); - m__d = 0; -} - -const TypeLookup_getTypes_Out& TypeLookup_getTypes_Result::result() const -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_result; -} - -TypeLookup_getTypes_Out& TypeLookup_getTypes_Result::result() -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_result; -} - -size_t TypeLookup_getTypes_Result::getCdrSerializedSize( - const TypeLookup_getTypes_Result& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypes_Result::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypes_Result::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_getTypes_In::getCdrSerializedSize( - const TypeLookup_getTypes_In& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypes_In::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypes_In::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_getTypes_Out::getCdrSerializedSize( - const TypeLookup_getTypes_Out& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypes_Out::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypes_Out::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_getTypeDependencies_In::getCdrSerializedSize( - const TypeLookup_getTypeDependencies_In& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypeDependencies_In::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypeDependencies_In::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_getTypeDependencies_Out::getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Out& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypeDependencies_Out::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypeDependencies_Out::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result() -{ - m__d = 0 /* TODO DDS_RETCODE_OK */; -} - -TypeLookup_getTypeDependencies_Result::~TypeLookup_getTypeDependencies_Result() -{ -} - -TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result( - const TypeLookup_getTypeDependencies_Result& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = x.m_result; - break; - default: - break; - } -} - -TypeLookup_getTypeDependencies_Result::TypeLookup_getTypeDependencies_Result( - TypeLookup_getTypeDependencies_Result&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = std::move(x.m_result); - break; - default: - break; - } -} - -TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator =( - const TypeLookup_getTypeDependencies_Result& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = x.m_result; - break; - default: - break; - } - - return *this; -} - -TypeLookup_getTypeDependencies_Result& TypeLookup_getTypeDependencies_Result::operator =( - TypeLookup_getTypeDependencies_Result&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - m_result = std::move(x.m_result); - break; - default: - break; - } - - return *this; -} - -void TypeLookup_getTypeDependencies_Result::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - switch (__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - b = true; - break; - default: - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t TypeLookup_getTypeDependencies_Result::_d() const -{ - return m__d; -} - -int32_t& TypeLookup_getTypeDependencies_Result::_d() -{ - return m__d; -} - -void TypeLookup_getTypeDependencies_Result::result( - const TypeLookup_getTypeDependencies_Out& _result) -{ - m_result = _result; - m__d = 0 /* TODO DDS_RETCODE_OK */; -} - -void TypeLookup_getTypeDependencies_Result::result( - TypeLookup_getTypeDependencies_Out&& _result) -{ - m_result = std::move(_result); - m__d = 0 /* TODO DDS_RETCODE_OK */; -} - -const TypeLookup_getTypeDependencies_Out& TypeLookup_getTypeDependencies_Result::result() const -{ - bool b = false; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_result; -} - -TypeLookup_getTypeDependencies_Out& TypeLookup_getTypeDependencies_Result::result() -{ - bool b = false; - - switch (m__d) - { - case 0 /* TODO DDS_RETCODE_OK */: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_result; -} - -size_t TypeLookup_getTypeDependencies_Result::getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Result& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_getTypeDependencies_Result::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_getTypeDependencies_Result::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeLookup_Call::TypeLookup_Call() -{ - m__d = TypeLookup_getTypes_Hash; - // m_getTypes com.eprosima.fastrtps.idl.parser.typecode.StructTypeCode@543788f3 - - // m_getTypeDependencies com.eprosima.fastrtps.idl.parser.typecode.StructTypeCode@6d3af739 - -} - -TypeLookup_Call::~TypeLookup_Call() -{ -} - -TypeLookup_Call::TypeLookup_Call( - const TypeLookup_Call& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getTypes = x.m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; - } -} - -TypeLookup_Call::TypeLookup_Call( - TypeLookup_Call&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getTypes = std::move(x.m_getTypes); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; - } -} - -TypeLookup_Call& TypeLookup_Call::operator =( - const TypeLookup_Call& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getTypes = x.m_getTypes; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; - } - - return *this; -} - -TypeLookup_Call& TypeLookup_Call::operator =( - TypeLookup_Call&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getTypes = std::move(x.m_getTypes); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; - } - - return *this; -} - -void TypeLookup_Call::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - switch (__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - break; - case TypeLookup_getDependencies_Hash: - switch (__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t TypeLookup_Call::_d() const -{ - return m__d; -} - -int32_t& TypeLookup_Call::_d() -{ - return m__d; -} - -void TypeLookup_Call::getTypes( - const TypeLookup_getTypes_In& _getTypes) -{ - m_getTypes = _getTypes; - m__d = TypeLookup_getTypes_Hash; -} - -void TypeLookup_Call::getTypes( - TypeLookup_getTypes_In&& _getTypes) -{ - m_getTypes = std::move(_getTypes); - m__d = TypeLookup_getTypes_Hash; -} - -const TypeLookup_getTypes_In& TypeLookup_Call::getTypes() const -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypes; -} - -TypeLookup_getTypes_In& TypeLookup_Call::getTypes() -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypes; -} - -void TypeLookup_Call::getTypeDependencies( - const TypeLookup_getTypeDependencies_In& _getTypeDependencies) -{ - m_getTypeDependencies = _getTypeDependencies; - m__d = TypeLookup_getDependencies_Hash; -} - -void TypeLookup_Call::getTypeDependencies( - TypeLookup_getTypeDependencies_In&& _getTypeDependencies) -{ - m_getTypeDependencies = std::move(_getTypeDependencies); - m__d = TypeLookup_getDependencies_Hash; -} - -const TypeLookup_getTypeDependencies_In& TypeLookup_Call::getTypeDependencies() const -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypeDependencies; -} - -TypeLookup_getTypeDependencies_In& TypeLookup_Call::getTypeDependencies() -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypeDependencies; -} - -size_t TypeLookup_Call::getCdrSerializedSize( - const TypeLookup_Call& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_Call::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_Call::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_Request::getCdrSerializedSize( - const TypeLookup_Request& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_Request::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_Request::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -TypeLookup_Return::TypeLookup_Return() -{ - m__d = TypeLookup_getTypes_Hash; - // m_getType com.eprosima.idl.parser.typecode.UnionTypeCode@69930714 - - // m_getTypeDependencies com.eprosima.idl.parser.typecode.UnionTypeCode@7a52f2a2 - -} - -TypeLookup_Return::~TypeLookup_Return() -{ -} - -TypeLookup_Return::TypeLookup_Return( - const TypeLookup_Return& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getType = x.m_getType; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; - } -} - -TypeLookup_Return::TypeLookup_Return( - TypeLookup_Return&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getType = std::move(x.m_getType); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; - } -} - -TypeLookup_Return& TypeLookup_Return::operator =( - const TypeLookup_Return& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getType = x.m_getType; - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = x.m_getTypeDependencies; - break; - default: - break; - } - - return *this; -} - -TypeLookup_Return& TypeLookup_Return::operator =( - TypeLookup_Return&& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - m_getType = std::move(x.m_getType); - break; - case TypeLookup_getDependencies_Hash: - m_getTypeDependencies = std::move(x.m_getTypeDependencies); - break; - default: - break; - } - - return *this; -} - -void TypeLookup_Return::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - switch (__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - break; - case TypeLookup_getDependencies_Hash: - switch (__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t TypeLookup_Return::_d() const -{ - return m__d; -} - -int32_t& TypeLookup_Return::_d() -{ - return m__d; -} - -void TypeLookup_Return::getType( - const TypeLookup_getTypes_Result& _getType) -{ - m_getType = _getType; - m__d = TypeLookup_getTypes_Hash; -} - -void TypeLookup_Return::getType( - TypeLookup_getTypes_Result&& _getType) -{ - m_getType = std::move(_getType); - m__d = TypeLookup_getTypes_Hash; -} - -const TypeLookup_getTypes_Result& TypeLookup_Return::getType() const -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getType; -} - -TypeLookup_getTypes_Result& TypeLookup_Return::getType() -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getTypes_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getType; -} - -void TypeLookup_Return::getTypeDependencies( - const TypeLookup_getTypeDependencies_Result& _getTypeDependencies) -{ - m_getTypeDependencies = _getTypeDependencies; - m__d = TypeLookup_getDependencies_Hash; -} - -void TypeLookup_Return::getTypeDependencies( - TypeLookup_getTypeDependencies_Result&& _getTypeDependencies) -{ - m_getTypeDependencies = std::move(_getTypeDependencies); - m__d = TypeLookup_getDependencies_Hash; -} - -const TypeLookup_getTypeDependencies_Result& TypeLookup_Return::getTypeDependencies() const -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypeDependencies; -} - -TypeLookup_getTypeDependencies_Result& TypeLookup_Return::getTypeDependencies() -{ - bool b = false; - - switch (m__d) - { - case TypeLookup_getDependencies_Hash: - b = true; - break; - default: - break; - } - if (!b) - { - throw BadParamException("This member is not been selected"); - } - - return m_getTypeDependencies; -} - -size_t TypeLookup_Return::getCdrSerializedSize( - const TypeLookup_Return& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_Return::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_Return::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -size_t TypeLookup_Reply::getCdrSerializedSize( - const TypeLookup_Reply& data, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - return eprosima::fastcdr::calculate_serialized_size(calculator, data, current_alignment) - initial_alignment; -} - -void TypeLookup_Reply::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - eprosima::fastcdr::serialize(scdr, *this); -} - -void TypeLookup_Reply::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - eprosima::fastcdr::deserialize(dcdr, *this); -} - -// TypeSupports -bool TypeLookup_RequestTypeSupport::serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) -{ - TypeLookup_Request* type = static_cast(data); - //eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == - fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion:: - XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv1); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object - ser << *type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length -#else - payload->length = static_cast(ser.get_serialized_data_length()); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - // - return true; -} - -bool TypeLookup_RequestTypeSupport::deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) -{ - TypeLookup_Request* p_type = static_cast(data); //Convert DATA to pointer of your type - //eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); - 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 - ); - - try - { - // 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; -} - -void* TypeLookup_RequestTypeSupport::create_data() -{ - return new TypeLookup_Request(); -} - -void TypeLookup_RequestTypeSupport::delete_data( - void* data) -{ - delete static_cast(data); -} - -/* - TypeLookup_ReplyPubSubType::TypeLookup_ReplyPubSubType() - { - - } - - TypeLookup_ReplyPubSubType::~TypeLookup_ReplyPubSubType() - { - - } - - bool TypeLookup_ReplyPubSubType::serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) - { - - } - - bool TypeLookup_ReplyPubSubType::deserialize( - fastrtps::rtps::SerializedPayload_t *payload, - void *data) - { - - } - - TypeLookup_ReplyTypeSupport::TypeLookup_ReplyTypeSupport() - : TypeSupport(new TypeLookup_Reply()) - { - } - */ -bool TypeLookup_ReplyTypeSupport::serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) -{ - TypeLookup_Reply* type = static_cast(data); - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == - fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion:: - XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv1); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object - ser << *type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length -#else - payload->length = static_cast(ser.get_serialized_data_length()); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - - return true; -} - -bool TypeLookup_ReplyTypeSupport::deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) -{ - TypeLookup_Reply* p_type = static_cast(data); //Convert DATA to pointer of your type - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. - 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 - ); - - try - { - // 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; -} - -void* TypeLookup_ReplyTypeSupport::create_data() -{ - return new TypeLookup_Reply(); -} - -void TypeLookup_ReplyTypeSupport::delete_data( - void* data) -{ - delete static_cast(data); -} - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima diff --git a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp deleted file mode 100644 index b5d7ef0c66b..00000000000 --- a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp +++ /dev/null @@ -1,733 +0,0 @@ -// Copyright 2023 y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef FASTDDS_BUILTIN_TYPELOOKUP_COMMON_TYPELOOKUPTYPESCDRAUX_IPP -#define FASTDDS_BUILTIN_TYPELOOKUP_COMMON_TYPELOOKUPTYPESCDRAUX_IPP - -namespace eprosima { -namespace fastcdr { - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for (size_t a = 0; a < data.type_ids.size(); ++a) - { - current_alignment += calculate_serialized_size(calculator, data.type_ids.at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_ids, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) -{ - - scdr << data.type_ids; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) -{ - - dcdr >> data.type_ids; -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for (size_t a = 0; a < data.types.size(); ++a) - { - current_alignment += calculate_serialized_size(calculator, data.types.at(a), current_alignment); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for (size_t a = 0; a < data.complete_to_minimal.size(); ++a) - { - current_alignment += - calculate_serialized_size(calculator, data.complete_to_minimal.at(a), current_alignment); - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.types, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete_to_minimal, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) -{ - - scdr << data.types; - scdr << data.complete_to_minimal; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) -{ - - dcdr >> data.types; - dcdr >> data.complete_to_minimal; -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - switch (data._d()) - { - case 0: - current_alignment += calculate_serialized_size(calculator, data.result(), current_alignment); - break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.result(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case 0: - scdr << data.result(); - break; - default: - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case 0: - dcdr >> data.result(); - break; - default: - break; - } -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for (size_t a = 0; a < data.type_ids.size(); ++a) - { - current_alignment += calculate_serialized_size(calculator, data.type_ids.at(a), current_alignment); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (data.continuation_point.size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_ids, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.continuation_point, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data) -{ - - scdr << data.type_ids; - scdr << data.continuation_point; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data) -{ - - dcdr >> data.type_ids; - dcdr >> data.continuation_point; -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for (size_t a = 0; a < data.dependent_typeids.size(); ++a) - { - current_alignment += calculate_serialized_size(calculator, data.dependent_typeids.at( - a), current_alignment); - } - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (data.continuation_point.size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.dependent_typeids, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.continuation_point, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data) -{ - - scdr << data.dependent_typeids; - scdr << data.continuation_point; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data) -{ - - dcdr >> data.dependent_typeids; - dcdr >> data.continuation_point; -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - switch (data._d()) - { - case 0 /* TODO DDS_RETCODE_OK */: - current_alignment += calculate_serialized_size(calculator, data.result(), current_alignment); - break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case 0 /* TODO DDS_RETCODE_OK */: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.result(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case 0 /* TODO DDS_RETCODE_OK */: - scdr << data.result(); - break; - default: - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case 0 /* TODO DDS_RETCODE_OK */: - dcdr >> data.result(); - break; - default: - break; - } -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_Call& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - current_alignment += calculate_serialized_size(calculator, data.getTypes(), current_alignment); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - current_alignment += calculate_serialized_size(calculator, data.getTypeDependencies(), current_alignment); - break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.getTypes(), current_alignment); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.getTypeDependencies(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_Call& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - scdr << data.getTypes(); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - scdr << data.getTypeDependencies(); - break; - default: - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_Call& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - dcdr >> data.getTypes(); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - dcdr >> data.getTypeDependencies(); - break; - default: - break; - } -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_Request& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header, current_alignment); - current_alignment += calculate_serialized_size(calculator, data.data, current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.data, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_Request& data) -{ - - scdr << data.header; - scdr << data.data; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_Request& data) -{ - - dcdr >> data.header; - dcdr >> data.data; -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_Return& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - current_alignment += calculate_serialized_size(calculator, data.getType(), current_alignment); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - current_alignment += calculate_serialized_size(calculator, data.getTypeDependencies(), current_alignment); - break; - default: - break; - } - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.getType(), current_alignment); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.getTypeDependencies(), current_alignment); - break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_Return& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - scdr << data.getType(); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - scdr << data.getTypeDependencies(); - break; - default: - break; - } -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_Return& data) -{ - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: - dcdr >> data.getType(); - break; - case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: - dcdr >> data.getTypeDependencies(); - break; - default: - break; - } -} - -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data, - size_t& current_alignment) -{ -#if FASTCDR_VERSION_MAJOR == 1 - - size_t initial_alignment = current_alignment; - - current_alignment += calculate_serialized_size(calculator, data.header, current_alignment); - current_alignment += calculate_serialized_size(calculator, data.return_value, current_alignment); - - return current_alignment - initial_alignment; - -#else - - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.header, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.return_value, current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; - -#endif // FASTCDR_VERSION_MAJOR == 1 -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data) -{ - - scdr << data.header; - scdr << data.return_value; -} - -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_Reply& data) -{ - - dcdr >> data.header; - dcdr >> data.return_value; -} - -} // namespace fastcdr -} // namespace eprosima - -#endif // FASTDDS_BUILTIN_TYPELOOKUP_COMMON_TYPELOOKUPTYPESCDRAUX_IPP diff --git a/src/cpp/fastdds/core/condition/GuardCondition.cpp b/src/cpp/fastdds/core/condition/GuardCondition.cpp index 43eaa8a7313..5f5fd242c87 100644 --- a/src/cpp/fastdds/core/condition/GuardCondition.cpp +++ b/src/cpp/fastdds/core/condition/GuardCondition.cpp @@ -47,7 +47,7 @@ ReturnCode_t GuardCondition::set_trigger_value( notifier_->notify(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } // namespace dds diff --git a/src/cpp/fastdds/core/condition/StatusCondition.cpp b/src/cpp/fastdds/core/condition/StatusCondition.cpp index f7615b90aaf..98b835727fb 100644 --- a/src/cpp/fastdds/core/condition/StatusCondition.cpp +++ b/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -18,7 +18,8 @@ */ #include -#include + +#include #include @@ -26,8 +27,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using eprosima::fastrtps::types::ReturnCode_t; - StatusCondition::StatusCondition( Entity* parent) : Condition() diff --git a/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp b/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp index 61f0e6cde2f..623df4f19f3 100644 --- a/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp +++ b/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp @@ -61,7 +61,7 @@ ReturnCode_t StatusConditionImpl::set_enabled_statuses( { notifier_->notify(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const StatusMask& StatusConditionImpl::get_enabled_statuses() const diff --git a/src/cpp/fastdds/core/condition/StatusConditionImpl.hpp b/src/cpp/fastdds/core/condition/StatusConditionImpl.hpp index a08c52efaf8..ef7215e9d6c 100644 --- a/src/cpp/fastdds/core/condition/StatusConditionImpl.hpp +++ b/src/cpp/fastdds/core/condition/StatusConditionImpl.hpp @@ -21,13 +21,11 @@ #include +#include #include -#include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { diff --git a/src/cpp/fastdds/core/condition/WaitSet.cpp b/src/cpp/fastdds/core/condition/WaitSet.cpp index 16b339f3a17..16b755eaeef 100644 --- a/src/cpp/fastdds/core/condition/WaitSet.cpp +++ b/src/cpp/fastdds/core/condition/WaitSet.cpp @@ -18,7 +18,6 @@ */ #include -#include #include @@ -26,8 +25,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using eprosima::fastrtps::types::ReturnCode_t; - WaitSet::WaitSet() : impl_(new detail::WaitSetImpl()) { diff --git a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp index d74115a1d58..5c4e43600a7 100644 --- a/src/cpp/fastdds/core/condition/WaitSetImpl.cpp +++ b/src/cpp/fastdds/core/condition/WaitSetImpl.cpp @@ -21,14 +21,12 @@ #include #include +#include #include #include -#include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -81,7 +79,7 @@ ReturnCode_t WaitSetImpl::attach_condition( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t WaitSetImpl::detach_condition( @@ -99,11 +97,11 @@ ReturnCode_t WaitSetImpl::detach_condition( { // Inform the notifier we are not interested anymore. condition.get_notifier()->detach_from(this); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } // Condition not found - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t WaitSetImpl::wait( @@ -114,7 +112,7 @@ ReturnCode_t WaitSetImpl::wait( if (is_waiting_) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } auto fill_active_conditions = [&]() @@ -146,7 +144,7 @@ ReturnCode_t WaitSetImpl::wait( } is_waiting_ = false; - return condition_value ? ReturnCode_t::RETCODE_OK : ReturnCode_t::RETCODE_TIMEOUT; + return condition_value ? RETCODE_OK : RETCODE_TIMEOUT; } ReturnCode_t WaitSetImpl::get_conditions( @@ -159,7 +157,7 @@ ReturnCode_t WaitSetImpl::get_conditions( { attached_conditions.push_back(const_cast(c)); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void WaitSetImpl::wake_up() diff --git a/src/cpp/fastdds/core/condition/WaitSetImpl.hpp b/src/cpp/fastdds/core/condition/WaitSetImpl.hpp index d3e5fc187b0..93374d17aac 100644 --- a/src/cpp/fastdds/core/condition/WaitSetImpl.hpp +++ b/src/cpp/fastdds/core/condition/WaitSetImpl.hpp @@ -23,12 +23,10 @@ #include #include +#include #include -#include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { diff --git a/src/cpp/fastdds/core/policy/ParameterList.cpp b/src/cpp/fastdds/core/policy/ParameterList.cpp index e59da3520b2..8090868f2d6 100644 --- a/src/cpp/fastdds/core/policy/ParameterList.cpp +++ b/src/cpp/fastdds/core/policy/ParameterList.cpp @@ -93,7 +93,7 @@ bool ParameterList::updateCacheChangeFromInlineQos( * Changing this here implies a behaviour change in the * RTPS layer, so it is postponed until the next major release. */ - FASTDDS_TODO_BEFORE(3, 0, "Fill related sample identity instead"); + // FASTDDS_TODO_BEFORE(3, 0, "Fill related sample identity instead"); change.write_params.sample_identity(p.sample_id); } break; diff --git a/src/cpp/fastdds/core/policy/ParameterSerializer.hpp b/src/cpp/fastdds/core/policy/ParameterSerializer.hpp index a63c1af43af..eb3664479ba 100644 --- a/src/cpp/fastdds/core/policy/ParameterSerializer.hpp +++ b/src/cpp/fastdds/core/policy/ParameterSerializer.hpp @@ -22,10 +22,10 @@ #include "ParameterList.hpp" +#include + #include #include -#include - namespace eprosima { namespace fastdds { namespace dds { @@ -199,7 +199,7 @@ class ParameterSerializer } static inline uint32_t cdr_serialized_size( - const fastrtps::string_255& str) + const fastcdr::string_255& str) { // Size including NUL char at the end uint32_t str_siz = static_cast(str.size()) + 1; @@ -323,7 +323,7 @@ inline bool ParameterSerializer::read_content_from_cdr_messag } parameter.length = parameter_length; - fastrtps::string_255 aux; + fastcdr::string_255 aux; bool valid = fastrtps::rtps::CDRMessage::readString(cdr_message, &aux); parameter.setName(aux.c_str()); return valid; @@ -831,7 +831,7 @@ class ParameterSerializer // sequence length ret_val += 4; // Add all parameters - for (const fastrtps::string_255& param : parameter.expression_parameters) + for (const fastcdr::string_255& param : parameter.expression_parameters) { ret_val += cdr_serialized_size(param); } @@ -870,7 +870,7 @@ class ParameterSerializer uint32_t num_params = static_cast(parameter.expression_parameters.size()); valid &= fastrtps::rtps::CDRMessage::addUInt32(cdr_message, num_params); // Add all parameters - for (const fastrtps::string_255& param : parameter.expression_parameters) + for (const fastcdr::string_255& param : parameter.expression_parameters) { valid &= fastrtps::rtps::CDRMessage::add_string(cdr_message, param); } @@ -928,7 +928,7 @@ class ParameterSerializer { for (uint32_t i = 0; valid && i < num_parameters; ++i) { - fastrtps::string_255* p = parameter.expression_parameters.push_back({}); + fastcdr::string_255* p = parameter.expression_parameters.push_back({}); assert(nullptr != p); valid = read_string(cdr_message, *p); } @@ -950,7 +950,7 @@ class ParameterSerializer private: static inline uint32_t cdr_serialized_size( - const fastrtps::string_255& str) + const fastcdr::string_255& str) { // Size including NUL char at the end uint32_t str_siz = static_cast(str.size()) + 1; @@ -972,7 +972,7 @@ class ParameterSerializer static inline bool read_string( fastrtps::rtps::CDRMessage_t* cdr_message, - fastrtps::string_255& str) + fastcdr::string_255& str) { uint32_t str_size = 0; bool valid; diff --git a/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp b/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp index dd48cbb4d75..08bd98f598a 100644 --- a/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp +++ b/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp @@ -1042,21 +1042,21 @@ inline bool QosPoliciesSerializer::read_content_from_cdr_message( } template<> -inline uint32_t QosPoliciesSerializer::cdr_serialized_size( - const xtypes::TypeInformation& qos_policy) +inline uint32_t QosPoliciesSerializer::cdr_serialized_size( + const xtypes::TypeInformationParameter& qos_policy) { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); size_t current_alignment {0}; size_t size = calculator.calculate_serialized_size(qos_policy.type_information, current_alignment) + 4; return 2 + 2 + static_cast(size); } template<> -inline bool QosPoliciesSerializer::add_to_cdr_message( - const xtypes::TypeInformation& qos_policy, +inline bool QosPoliciesSerializer::add_to_cdr_message( + const xtypes::TypeInformationParameter& qos_policy, fastrtps::rtps::CDRMessage_t* cdr_message) { - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); size_t current_alignment {0}; size_t size = calculator.calculate_serialized_size(qos_policy.type_information, @@ -1065,10 +1065,10 @@ inline bool QosPoliciesSerializer::add_to_cdr_message( eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. + eprosima::fastcdr::CdrVersion::XCDRv2); // Object that serializes the data. payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.serialize_encapsulation(); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); ser << qos_policy.type_information; #if FASTCDR_VERSION_MAJOR == 1 @@ -1092,8 +1092,8 @@ inline bool QosPoliciesSerializer::add_to_cdr_message( } template<> -inline bool QosPoliciesSerializer::read_content_from_cdr_message( - xtypes::TypeInformation& qos_policy, +inline bool QosPoliciesSerializer::read_content_from_cdr_message( + xtypes::TypeInformationParameter& qos_policy, fastrtps::rtps::CDRMessage_t* cdr_message, const uint16_t parameter_length) { @@ -1102,18 +1102,10 @@ inline bool QosPoliciesSerializer::read_content_from_cd fastrtps::rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer. - 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 - ); - + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastcdr::CdrVersion::XCDRv2); try { - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - deser >> qos_policy.type_information; qos_policy.assigned(true); } diff --git a/src/cpp/fastdds/domain/DomainParticipant.cpp b/src/cpp/fastdds/domain/DomainParticipant.cpp index 693380368af..41e0f3001a3 100644 --- a/src/cpp/fastdds/domain/DomainParticipant.cpp +++ b/src/cpp/fastdds/domain/DomainParticipant.cpp @@ -91,7 +91,7 @@ ReturnCode_t DomainParticipant::set_listener( const std::chrono::seconds timeout) { ReturnCode_t ret_val = impl_->set_listener(listener, timeout); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -103,12 +103,12 @@ ReturnCode_t DomainParticipant::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = !!ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -227,7 +227,7 @@ ReturnCode_t DomainParticipant::delete_multitopic( const MultiTopic* a_multitopic) { static_cast (a_multitopic); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::register_content_filter_factory( @@ -278,21 +278,21 @@ ReturnCode_t DomainParticipant::ignore_topic( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::ignore_publication( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::ignore_subscription( const InstanceHandle_t& handle) { static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } DomainId_t DomainParticipant::get_domain_id() const @@ -325,7 +325,7 @@ ReturnCode_t DomainParticipant::get_default_publisher_qos( PublisherQos& qos) const { qos = impl_->get_default_publisher_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_publisher_qos_from_profile( @@ -350,7 +350,7 @@ ReturnCode_t DomainParticipant::get_default_subscriber_qos( SubscriberQos& qos) const { qos = impl_->get_default_subscriber_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_subscriber_qos_from_profile( @@ -375,7 +375,7 @@ ReturnCode_t DomainParticipant::get_default_topic_qos( TopicQos& qos) const { qos = impl_->get_default_topic_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipant::get_topic_qos_from_profile( @@ -385,11 +385,25 @@ ReturnCode_t DomainParticipant::get_topic_qos_from_profile( return impl_->get_topic_qos_from_profile(profile_name, qos); } +ReturnCode_t DomainParticipant::get_replier_qos_from_profile( + const std::string& profile_name, + ReplierQos& qos) const +{ + return impl_->get_replier_qos_from_profile(profile_name, qos); +} + +ReturnCode_t DomainParticipant::get_requester_qos_from_profile( + const std::string& profile_name, + RequesterQos& qos) const +{ + return impl_->get_requester_qos_from_profile(profile_name, qos); +} + ReturnCode_t DomainParticipant::get_discovered_participants( std::vector& participant_handles) const { static_cast (participant_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_participant_data( @@ -398,14 +412,14 @@ ReturnCode_t DomainParticipant::get_discovered_participant_data( { static_cast (participant_data); static_cast (participant_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_topics( std::vector& topic_handles) const { static_cast (topic_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } ReturnCode_t DomainParticipant::get_discovered_topic_data( @@ -414,7 +428,7 @@ ReturnCode_t DomainParticipant::get_discovered_topic_data( { static_cast (topic_data); static_cast (topic_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } bool DomainParticipant::contains_entity( @@ -483,26 +497,6 @@ fastrtps::rtps::ResourceEvent& DomainParticipant::get_resource_event() const return impl_->get_resource_event(); } -fastrtps::rtps::SampleIdentity DomainParticipant::get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const -{ - return impl_->get_type_dependencies(in); -} - -fastrtps::rtps::SampleIdentity DomainParticipant::get_types( - const fastrtps::types::TypeIdentifierSeq& in) const -{ - return impl_->get_types(in); -} - -ReturnCode_t DomainParticipant::register_remote_type( - const fastrtps::types::TypeInformation& type_information, - const std::string& type_name, - std::function& callback) -{ - return impl_->register_remote_type(type_information, type_name, callback); -} - bool DomainParticipant::has_active_entities() { return impl_->has_active_entities(); diff --git a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp index bb9457b8bd4..ef3850c4bad 100644 --- a/src/cpp/fastdds/domain/DomainParticipantFactory.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantFactory.cpp @@ -17,32 +17,31 @@ * */ +#include + #include #include -#include #include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include #include #include #include #include #include +#include +#include using namespace eprosima::fastrtps::xmlparser; -using eprosima::fastrtps::ParticipantAttributes; using eprosima::fastdds::dds::Log; using eprosima::fastrtps::rtps::RTPSDomain; @@ -54,6 +53,7 @@ namespace dds { DomainParticipantFactory::DomainParticipantFactory() : default_xml_profiles_loaded(false) + , default_domain_id_(0) , default_participant_qos_(PARTICIPANT_QOS_DEFAULT) , topic_pool_(fastrtps::rtps::TopicPayloadPoolRegistry::instance()) , rtps_domain_(fastrtps::rtps::RTPSDomainImpl::get_instance()) @@ -77,9 +77,8 @@ DomainParticipantFactory::~DomainParticipantFactory() } // Deletes DynamicTypes and TypeObject factories - fastrtps::types::DynamicTypeBuilderFactory::delete_instance(); - fastrtps::types::DynamicDataFactory::delete_instance(); - fastrtps::types::TypeObjectFactory::delete_instance(); + fastdds::dds::DynamicDataFactory::delete_instance(); + fastdds::dds::DynamicTypeBuilderFactory::delete_instance(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); eprosima::fastdds::dds::Log::KillThread(); @@ -119,7 +118,7 @@ ReturnCode_t DomainParticipantFactory::delete_participant( #endif // ifdef FASTDDS_STATISTICS if (part->has_active_entities()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } VectorIt vit = participants_.find(part->get_domain_id()); @@ -146,16 +145,16 @@ ReturnCode_t DomainParticipantFactory::delete_participant( { participants_.erase(vit); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DomainParticipant* DomainParticipantFactory::create_participant( DomainId_t did, const DomainParticipantQos& qos, - DomainParticipantListener* listen, + DomainParticipantListener* listener, const StatusMask& mask) { load_profiles(); @@ -164,10 +163,10 @@ DomainParticipant* DomainParticipantFactory::create_participant( DomainParticipant* dom_part = new DomainParticipant(mask); #ifndef FASTDDS_STATISTICS - DomainParticipantImpl* dom_part_impl = new DomainParticipantImpl(dom_part, did, pqos, listen); + DomainParticipantImpl* dom_part_impl = new DomainParticipantImpl(dom_part, did, pqos, listener); #else eprosima::fastdds::statistics::dds::DomainParticipantImpl* dom_part_impl = - new eprosima::fastdds::statistics::dds::DomainParticipantImpl(dom_part, did, pqos, listen); + new eprosima::fastdds::statistics::dds::DomainParticipantImpl(dom_part, did, pqos, listener); #endif // FASTDDS_STATISTICS if (fastrtps::rtps::GUID_t::unknown() != dom_part_impl->guid()) @@ -190,7 +189,7 @@ DomainParticipant* DomainParticipantFactory::create_participant( if (factory_qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != dom_part->enable()) + if (RETCODE_OK != dom_part->enable()) { delete_participant(dom_part); return nullptr; @@ -206,10 +205,23 @@ DomainParticipant* DomainParticipantFactory::create_participant( return dom_part; } +DomainParticipant* DomainParticipantFactory::create_participant_with_default_profile() +{ + return create_participant_with_default_profile(nullptr, StatusMask::none()); +} + +DomainParticipant* DomainParticipantFactory::create_participant_with_default_profile( + DomainParticipantListener* listener, + const StatusMask& mask) +{ + load_profiles(); + return create_participant(default_domain_id_, default_participant_qos_, listener, mask); +} + DomainParticipant* DomainParticipantFactory::create_participant_with_profile( DomainId_t did, const std::string& profile_name, - DomainParticipantListener* listen, + DomainParticipantListener* listener, const StatusMask& mask) { load_profiles(); @@ -220,7 +232,7 @@ DomainParticipant* DomainParticipantFactory::create_participant_with_profile( { DomainParticipantQos qos = default_participant_qos_; utils::set_qos_from_attributes(qos, attr.rtps); - return create_participant(did, qos, listen, mask); + return create_participant(did, qos, listener, mask); } return nullptr; @@ -228,7 +240,7 @@ DomainParticipant* DomainParticipantFactory::create_participant_with_profile( DomainParticipant* DomainParticipantFactory::create_participant_with_profile( const std::string& profile_name, - DomainParticipantListener* listen, + DomainParticipantListener* listener, const StatusMask& mask) { load_profiles(); @@ -239,7 +251,7 @@ DomainParticipant* DomainParticipantFactory::create_participant_with_profile( { DomainParticipantQos qos = default_participant_qos_; utils::set_qos_from_attributes(qos, attr.rtps); - return create_participant(attr.domainId, qos, listen, mask); + return create_participant(attr.domainId, qos, listener, mask); } return nullptr; @@ -282,7 +294,7 @@ ReturnCode_t DomainParticipantFactory::get_default_participant_qos( DomainParticipantQos& qos) const { qos = default_participant_qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& DomainParticipantFactory::get_default_participant_qos() const @@ -296,16 +308,16 @@ ReturnCode_t DomainParticipantFactory::set_default_participant_qos( if (&qos == &PARTICIPANT_QOS_DEFAULT) { reset_default_participant_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = DomainParticipantImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } DomainParticipantImpl::set_qos(default_participant_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::get_participant_qos_from_profile( @@ -317,10 +329,10 @@ ReturnCode_t DomainParticipantFactory::get_participant_qos_from_profile( { qos = default_participant_qos_; utils::set_qos_from_attributes(qos, attr.rtps); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantFactory::load_profiles() @@ -349,11 +361,15 @@ ReturnCode_t DomainParticipantFactory::load_profiles() { reset_default_participant_qos(); } + // Take the default domain id from the default participant profile + eprosima::fastdds::ParticipantAttributes attr; + XMLProfileManager::getDefaultParticipantAttributes(attr); + default_domain_id_ = attr.domainId; RTPSDomain::set_filewatch_thread_config(factory_qos_.file_watch_threads(), factory_qos_.file_watch_threads()); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::load_XML_profiles_file( @@ -362,9 +378,9 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_file( if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLFile(xml_profile_file)) { EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML file '" << xml_profile_file << "'"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::load_XML_profiles_string( @@ -374,9 +390,9 @@ ReturnCode_t DomainParticipantFactory::load_XML_profiles_string( if (XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLString(data, length)) { EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML string"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::check_xml_static_discovery( @@ -386,32 +402,37 @@ ReturnCode_t DomainParticipantFactory::check_xml_static_discovery( if (XMLP_ret::XML_OK != parser.loadXMLFile(xml_file)) { EPROSIMA_LOG_ERROR(DOMAIN, "Error parsing xml file"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::get_qos( DomainParticipantFactoryQos& qos) const { qos = factory_qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantFactory::set_qos( const DomainParticipantFactoryQos& qos) { ReturnCode_t ret_val = check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } if (!can_qos_be_updated(factory_qos_, qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(factory_qos_, qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; +} + +xtypes::ITypeObjectRegistry& DomainParticipantFactory::type_object_registry() +{ + return rtps_domain_->type_object_registry(); } void DomainParticipantFactory::reset_default_participant_qos() @@ -420,7 +441,7 @@ void DomainParticipantFactory::reset_default_participant_qos() DomainParticipantImpl::set_qos(default_participant_qos_, PARTICIPANT_QOS_DEFAULT, true); if (true == default_xml_profiles_loaded) { - eprosima::fastrtps::ParticipantAttributes attr; + ParticipantAttributes attr; XMLProfileManager::getDefaultParticipantAttributes(attr); utils::set_qos_from_attributes(default_participant_qos_, attr.rtps); } @@ -443,7 +464,7 @@ ReturnCode_t DomainParticipantFactory::check_qos( { (void) qos; //There is no restriction by the moment with the contained Qos - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DomainParticipantFactory::can_qos_be_updated( @@ -481,6 +502,38 @@ void DomainParticipantFactory::participant_has_been_deleted( } } +ReturnCode_t DomainParticipantFactory::get_library_settings( + LibrarySettings& library_settings) const +{ + rtps_domain_->get_library_settings(library_settings); + return RETCODE_OK; +} + +ReturnCode_t DomainParticipantFactory::set_library_settings( + const LibrarySettings& library_settings) +{ + if (rtps_domain_->set_library_settings(library_settings)) + { + return RETCODE_OK; + } + return RETCODE_PRECONDITION_NOT_MET; +} + +ReturnCode_t DomainParticipantFactory::get_dynamic_type_builder_from_xml_by_name( + const std::string& type_name, + DynamicType::_ref_type& type) +{ + if (type_name.empty()) + { + return RETCODE_BAD_PARAMETER; + } + if (XMLP_ret::XML_OK != XMLProfileManager::getDynamicTypeByName(type, type_name)) + { + return RETCODE_NO_DATA; + } + return RETCODE_OK; +} + } /* namespace dds */ } /* namespace fastdds */ } /* namespace eprosima */ diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 56e4023b637..ac99c2d19d4 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -17,18 +17,16 @@ * */ -#include "fastdds/rtps/common/Guid.h" -#include "fastdds/rtps/common/GuidPrefix_t.hpp" +#include + #include -#include #include #include -#include - #include -#include +#include +#include #include #include #include @@ -39,33 +37,35 @@ #include #include #include -#include +#include +#include #include #include -#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include #include #include #include #include +#include #include #include +#include +#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -73,25 +73,24 @@ namespace dds { using fastrtps::xmlparser::XMLProfileManager; using fastrtps::xmlparser::XMLP_ret; -using fastrtps::ParticipantAttributes; using fastrtps::TopicAttributes; -using fastrtps::SubscriberAttributes; -using fastrtps::PublisherAttributes; +using fastrtps::rtps::ParticipantDiscoveryInfo; using fastrtps::rtps::RTPSDomain; using fastrtps::rtps::RTPSDomainImpl; using fastrtps::rtps::RTPSParticipant; -using fastrtps::rtps::ParticipantDiscoveryInfo; +using fastrtps::TopicAttributes; +using fastrtps::xmlparser::XMLP_ret; +using fastrtps::xmlparser::XMLProfileManager; #if HAVE_SECURITY using fastrtps::rtps::ParticipantAuthenticationInfo; #endif // if HAVE_SECURITY +using eprosima::fastdds::dds::Log; +using fastrtps::rtps::EndpointKind_t; using fastrtps::rtps::ReaderDiscoveryInfo; using fastrtps::rtps::ReaderProxyData; +using fastrtps::rtps::ResourceEvent; using fastrtps::rtps::WriterDiscoveryInfo; using fastrtps::rtps::WriterProxyData; -using fastrtps::rtps::GUID_t; -using fastrtps::rtps::EndpointKind_t; -using fastrtps::rtps::ResourceEvent; -using eprosima::fastdds::dds::Log; DomainParticipantImpl::DomainParticipantImpl( DomainParticipant* dp, @@ -145,7 +144,7 @@ DomainParticipantImpl::DomainParticipantImpl( if (nullptr != property_value && property_value->empty()) { std::string username = "unknown"; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_username(username)) + if (RETCODE_OK == SystemInfo::get_username(username)) { property_value->assign(username); } @@ -258,7 +257,7 @@ ReturnCode_t DomainParticipantImpl::enable() // Should not have been previously enabled assert(get_rtps_participant() == nullptr); // Should not have failed assigning the GUID - assert (guid_ != GUID_t::unknown()); + assert (guid_ != fastrtps::rtps::GUID_t::unknown()); fastrtps::rtps::RTPSParticipantAttributes rtps_attr; utils::set_attributes_from_qos(rtps_attr, qos_); @@ -279,7 +278,7 @@ ReturnCode_t DomainParticipantImpl::enable() if (part == nullptr) { EPROSIMA_LOG_ERROR(DOMAIN_PARTICIPANT, "Problem creating RTPSParticipant"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -333,7 +332,7 @@ ReturnCode_t DomainParticipantImpl::enable() part->enable(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::set_qos( @@ -355,7 +354,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( if (&qos != &PARTICIPANT_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos(qos_to_set); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -363,7 +362,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } qos_should_be_updated = set_qos(qos_, qos_to_set, !enabled); @@ -387,7 +386,7 @@ ReturnCode_t DomainParticipantImpl::set_qos( rtps_participant->update_attributes(patt); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::get_qos( @@ -395,7 +394,7 @@ ReturnCode_t DomainParticipantImpl::get_qos( { std::lock_guard _(mtx_gs_); qos = qos_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& DomainParticipantImpl::get_qos() const @@ -409,7 +408,7 @@ ReturnCode_t DomainParticipantImpl::delete_publisher( { if (get_participant() != pub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_pubs_); auto pit = publishers_.find(const_cast(pub)); @@ -420,16 +419,16 @@ ReturnCode_t DomainParticipantImpl::delete_publisher( && "The publisher instance handle does not match the publisher implementation instance handle"); if (pub->has_datawriters()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } pit->second->set_listener(nullptr); publishers_by_handle_.erase(publishers_by_handle_.find(pit->second->get_instance_handle())); delete pit->second; publishers_.erase(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::delete_subscriber( @@ -437,7 +436,7 @@ ReturnCode_t DomainParticipantImpl::delete_subscriber( { if (get_participant() != sub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_subs_); auto sit = subscribers_.find(const_cast(sub)); @@ -448,16 +447,16 @@ ReturnCode_t DomainParticipantImpl::delete_subscriber( && "The subscriber instance handle does not match the subscriber implementation instance handle"); if (sub->has_datareaders()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } sit->second->set_listener(nullptr); subscribers_by_handle_.erase(subscribers_by_handle_.find(sit->second->get_instance_handle())); delete sit->second; subscribers_.erase(sit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Topic* DomainParticipantImpl::find_topic( @@ -512,7 +511,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( { if (topic == nullptr) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); @@ -530,7 +529,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( TopicProxy* proxy = dynamic_cast(topic->get_impl()); assert(nullptr != proxy); auto ret_code = it->second->delete_topic(proxy); - if (ReturnCode_t::RETCODE_OK == ret_code) + if (RETCODE_OK == ret_code) { topics_by_handle_.erase(handle); @@ -544,7 +543,7 @@ ReturnCode_t DomainParticipantImpl::delete_topic( return ret_code; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ContentFilteredTopic* DomainParticipantImpl::create_contentfilteredtopic( @@ -613,7 +612,7 @@ ContentFilteredTopic* DomainParticipantImpl::create_contentfilteredtopic( // Tell filter factory to compile the expression IContentFilter* filter_instance = nullptr; - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != filter_factory->create_content_filter(filter_class_name, related_topic->get_type_name().c_str(), type.get(), filter_expression.c_str(), filter_parameters, filter_instance)) { @@ -641,7 +640,7 @@ ReturnCode_t DomainParticipantImpl::delete_contentfilteredtopic( { if (topic == nullptr) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); @@ -651,13 +650,13 @@ ReturnCode_t DomainParticipantImpl::delete_contentfilteredtopic( { if (it->second->get_impl()->is_referenced()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } filtered_topics_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t DomainParticipantImpl::register_content_filter_factory( @@ -666,18 +665,18 @@ ReturnCode_t DomainParticipantImpl::register_content_filter_factory( { if (nullptr == filter_factory || nullptr == filter_class_name || strlen(filter_class_name) > 255) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); auto it = filter_factories_.find(filter_class_name); if ((it != filter_factories_.end()) || (0 == strcmp(filter_class_name, FASTDDS_SQLFILTER_NAME))) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } filter_factories_[filter_class_name] = filter_factory; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } IContentFilterFactory* DomainParticipantImpl::lookup_content_filter_factory( @@ -702,21 +701,21 @@ ReturnCode_t DomainParticipantImpl::unregister_content_filter_factory( { if (nullptr == filter_class_name) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } std::lock_guard lock(mtx_topics_); auto it = filter_factories_.find(filter_class_name); if ((it == filter_factories_.end()) || (it->first == FASTDDS_SQLFILTER_NAME)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } for (auto& topic : filtered_topics_) { if (topic.second->impl_->filter_property.filter_class_name == filter_class_name) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -733,7 +732,7 @@ ReturnCode_t DomainParticipantImpl::unregister_content_filter_factory( filter_factories_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } IContentFilterFactory* DomainParticipantImpl::find_content_filter_factory( @@ -758,7 +757,7 @@ const InstanceHandle_t& DomainParticipantImpl::get_instance_handle() const return static_cast(guid_); } -const GUID_t& DomainParticipantImpl::guid() const +const fastrtps::rtps::GUID_t& DomainParticipantImpl::guid() const { return guid_; } @@ -777,9 +776,9 @@ Publisher* DomainParticipantImpl::create_publisher( PublisherListener* listener, const StatusMask& mask) { - if (!PublisherImpl::check_qos(qos)) + if (RETCODE_OK != PublisherImpl::check_qos(qos)) { - // The PublisherImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The PublisherImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // EPROSIMA_LOG_ERROR(PARTICIPANT, "PublisherQos inconsistent or not supported"); // return nullptr; @@ -806,7 +805,7 @@ Publisher* DomainParticipantImpl::create_publisher( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_publisher_enable = pub->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_publisher_enable); + assert(RETCODE_OK == ret_publisher_enable); (void)ret_publisher_enable; } @@ -853,9 +852,9 @@ PublisherImpl* DomainParticipantImpl::create_publisher_impl( ReturnCode_t DomainParticipantImpl::ignore_participant( const InstanceHandle_t& handle) { - return (nullptr == rtps_participant_) ? ReturnCode_t::RETCODE_NOT_ENABLED : - rtps_participant_->ignore_participant(iHandle2GUID(handle).guidPrefix) ? ReturnCode_t::RETCODE_OK : - ReturnCode_t::RETCODE_BAD_PARAMETER; + return (nullptr == rtps_participant_) ? RETCODE_NOT_ENABLED : + rtps_participant_->ignore_participant(iHandle2GUID(handle).guidPrefix) ? RETCODE_OK : + RETCODE_BAD_PARAMETER; } /* TODO @@ -900,7 +899,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() can_be_deleted = subscriber.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -913,18 +912,18 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() can_be_deleted = publisher.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } - ReturnCode_t ret_code = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret_code = RETCODE_OK; for (auto& subscriber : subscribers_) { ret_code = subscriber.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -940,9 +939,9 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() for (auto& publisher : publishers_) { ret_code = publisher.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -967,7 +966,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() it_topics = topics_.erase(it_topics); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::assert_liveliness() @@ -975,21 +974,21 @@ ReturnCode_t DomainParticipantImpl::assert_liveliness() fastrtps::rtps::RTPSParticipant* rtps_participant = get_rtps_participant(); if (rtps_participant == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (rtps_participant->wlp() != nullptr) { if (rtps_participant->wlp()->assert_liveliness_manual_by_participant()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } else { EPROSIMA_LOG_ERROR(PARTICIPANT, "Invalid WLP, cannot assert liveliness of participant"); } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::set_default_publisher_qos( @@ -998,18 +997,18 @@ ReturnCode_t DomainParticipantImpl::set_default_publisher_qos( if (&qos == &PUBLISHER_QOS_DEFAULT) { reset_default_publisher_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = PublisherImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { - // The PublisherImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The PublisherImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // return ret_val; } PublisherImpl::set_qos(default_pub_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_publisher_qos() @@ -1026,7 +1025,7 @@ const PublisherQos& DomainParticipantImpl::get_default_publisher_qos() const return default_pub_qos_; } -const ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( const std::string& profile_name, PublisherQos& qos) const { @@ -1035,10 +1034,10 @@ const ReturnCode_t DomainParticipantImpl::get_publisher_qos_from_profile( { qos = default_pub_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantImpl::set_default_subscriber_qos( @@ -1047,17 +1046,17 @@ ReturnCode_t DomainParticipantImpl::set_default_subscriber_qos( if (&qos == &SUBSCRIBER_QOS_DEFAULT) { reset_default_subscriber_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_result = SubscriberImpl::check_qos(qos); - if (!check_result) + if (RETCODE_OK != check_result) { - // The SubscriberImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The SubscriberImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // return check_result; } SubscriberImpl::set_qos(default_sub_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_subscriber_qos() @@ -1074,7 +1073,7 @@ const SubscriberQos& DomainParticipantImpl::get_default_subscriber_qos() const return default_sub_qos_; } -const ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( const std::string& profile_name, SubscriberQos& qos) const { @@ -1083,10 +1082,10 @@ const ReturnCode_t DomainParticipantImpl::get_subscriber_qos_from_profile( { qos = default_sub_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t DomainParticipantImpl::set_default_topic_qos( @@ -1095,17 +1094,17 @@ ReturnCode_t DomainParticipantImpl::set_default_topic_qos( if (&qos == &TOPIC_QOS_DEFAULT) { reset_default_topic_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = TopicImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } TopicImpl::set_qos(default_topic_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::reset_default_topic_qos() @@ -1122,7 +1121,7 @@ const TopicQos& DomainParticipantImpl::get_default_topic_qos() const return default_topic_qos_; } -const ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( +ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( const std::string& profile_name, TopicQos& qos) const { @@ -1131,10 +1130,38 @@ const ReturnCode_t DomainParticipantImpl::get_topic_qos_from_profile( { qos = default_topic_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +ReturnCode_t DomainParticipantImpl::get_replier_qos_from_profile( + const std::string& profile_name, + ReplierQos& qos) const +{ + ReplierAttributes attr; + if (XMLP_ret::XML_OK == XMLProfileManager::fillReplierAttributes(profile_name, attr)) + { + utils::set_qos_from_attributes(qos, attr); + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +ReturnCode_t DomainParticipantImpl::get_requester_qos_from_profile( + const std::string& profile_name, + RequesterQos& qos) const +{ + RequesterAttributes attr; + if (XMLP_ret::XML_OK == XMLProfileManager::fillRequesterAttributes(profile_name, attr)) + { + utils::set_qos_from_attributes(qos, attr); + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } /* TODO @@ -1230,7 +1257,7 @@ ReturnCode_t DomainParticipantImpl::get_current_time( current_time.seconds = static_cast(seconds.count()); current_time.nanosec = static_cast(nanos.count()); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } std::vector DomainParticipantImpl::get_participant_names() const @@ -1247,9 +1274,9 @@ Subscriber* DomainParticipantImpl::create_subscriber( SubscriberListener* listener, const StatusMask& mask) { - if (!SubscriberImpl::check_qos(qos)) + if (RETCODE_OK != SubscriberImpl::check_qos(qos)) { - // The SubscriberImpl::check_qos() function is not yet implemented and always returns ReturnCode_t::RETCODE_OK. + // The SubscriberImpl::check_qos() function is not yet implemented and always returns RETCODE_OK. // It will be implemented in future releases of Fast DDS. // EPROSIMA_LOG_ERROR(PARTICIPANT, "SubscriberQos inconsistent or not supported"); // return nullptr; @@ -1278,7 +1305,7 @@ Subscriber* DomainParticipantImpl::create_subscriber( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_subscriber_enable = sub->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_subscriber_enable); + assert(RETCODE_OK == ret_subscriber_enable); (void)ret_subscriber_enable; } @@ -1324,7 +1351,7 @@ Topic* DomainParticipantImpl::create_topic( return nullptr; } - if (!TopicImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != TopicImpl::check_qos_including_resource_limits(qos, type_support)) { EPROSIMA_LOG_ERROR(PARTICIPANT, "TopicQos inconsistent or not supported"); return nullptr; @@ -1358,7 +1385,7 @@ Topic* DomainParticipantImpl::create_topic( if (enabled && qos_.entity_factory().autoenable_created_entities) { ReturnCode_t ret_topic_enable = topic->enable(); - assert(ReturnCode_t::RETCODE_OK == ret_topic_enable); + assert(RETCODE_OK == ret_topic_enable); (void)ret_topic_enable; } @@ -1428,7 +1455,7 @@ ReturnCode_t DomainParticipantImpl::register_type( if (type_name.size() <= 0) { EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have a name"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); @@ -1437,68 +1464,20 @@ ReturnCode_t DomainParticipantImpl::register_type( { if (t == type) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } EPROSIMA_LOG_ERROR(PARTICIPANT, "Another type with the same name '" << type_name << "' is already registered."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } EPROSIMA_LOG_INFO(PARTICIPANT, "Type " << type_name << " registered."); std::lock_guard lock(mtx_types_); types_.insert(std::make_pair(type_name, type)); - if (type->auto_fill_type_object() || type->auto_fill_type_information()) - { - register_dynamic_type_to_factories(type); - } + type.get()->register_type_object_representation(); - return ReturnCode_t::RETCODE_OK; -} - -bool DomainParticipantImpl::register_dynamic_type_to_factories( - const TypeSupport& type) const -{ - using namespace eprosima::fastrtps::types; - DynamicPubSubType* dpst = dynamic_cast(type.get()); - if (dpst != nullptr) // Registering a dynamic type. - { - TypeObjectFactory* objectFactory = TypeObjectFactory::get_instance(); - DynamicTypeBuilderFactory* dynFactory = DynamicTypeBuilderFactory::get_instance(); - const TypeIdentifier* id = objectFactory->get_type_identifier_trying_complete(dpst->getName()); - if (id == nullptr) - { - std::map membersMap; - dpst->GetDynamicType()->get_all_members(membersMap); - std::vector members; - for (auto it : membersMap) - { - members.push_back(it.second->get_descriptor()); - } - TypeObject typeObj; - dynFactory->build_type_object(dpst->GetDynamicType()->get_type_descriptor(), typeObj, &members); - // Minimal too - dynFactory->build_type_object(dpst->GetDynamicType()->get_type_descriptor(), typeObj, &members, false); - const TypeIdentifier* type_id2 = objectFactory->get_type_identifier(dpst->getName()); - const TypeObject* type_obj = objectFactory->get_type_object(dpst->getName()); - if (type_id2 == nullptr) - { - EPROSIMA_LOG_ERROR(DOMAIN_PARTICIPANT, "Cannot register dynamic type " << dpst->getName()); - } - else - { - objectFactory->add_type_object(dpst->getName(), type_id2, type_obj); - - // Complete, just to make sure it is generated - const TypeIdentifier* type_id_complete = objectFactory->get_type_identifier(dpst->getName(), true); - const TypeObject* type_obj_complete = objectFactory->get_type_object(dpst->getName(), true); - objectFactory->add_type_object(dpst->getName(), type_id_complete, type_obj_complete); // Add complete - return true; - } - } - } - - return false; // Isn't a registered dynamic type. + return RETCODE_OK; } ReturnCode_t DomainParticipantImpl::unregister_type( @@ -1507,14 +1486,14 @@ ReturnCode_t DomainParticipantImpl::unregister_type( if (type_name.size() <= 0) { EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have a name"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (t.empty()) { - return ReturnCode_t::RETCODE_OK; // Not registered, so unregistering complete. + return RETCODE_OK; // Not registered, so unregistering complete. } { @@ -1525,7 +1504,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( { if (sit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; // Is in use + return RETCODE_PRECONDITION_NOT_MET; // Is in use } } } @@ -1538,7 +1517,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( { if (pit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; // Is in use + return RETCODE_PRECONDITION_NOT_MET; // Is in use } } } @@ -1546,7 +1525,7 @@ ReturnCode_t DomainParticipantImpl::unregister_type( std::lock_guard lock(mtx_types_); types_.erase(type_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DomainParticipantImpl::MyRTPSParticipantListener::onParticipantDiscovery( @@ -1560,10 +1539,6 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onParticipantDiscovery( { participant_->listener_->on_participant_discovery(participant_->participant_, std::move(info), should_be_ignored); - if (!should_be_ignored) - { - participant_->listener_->on_participant_discovery(participant_->participant_, std::move(info)); - } } } @@ -1588,7 +1563,9 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onReaderDiscovery( Sentry sentinel(this); if (sentinel) { - participant_->listener_->on_subscriber_discovery(participant_->participant_, std::move(info)); + bool should_be_ignored = false; + participant_->listener_->on_data_reader_discovery(participant_->participant_, std::move(info), + should_be_ignored); } } @@ -1599,68 +1576,14 @@ void DomainParticipantImpl::MyRTPSParticipantListener::onWriterDiscovery( Sentry sentinel(this); if (sentinel) { - participant_->listener_->on_publisher_discovery(participant_->participant_, std::move(info)); - } -} - -void DomainParticipantImpl::MyRTPSParticipantListener::on_type_discovery( - RTPSParticipant*, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::string_255& topic, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type) -{ - Sentry sentinel(this); - if (sentinel) - { - participant_->listener_->on_type_discovery( - participant_->participant_, - request_sample_id, - topic, - identifier, - object, - dyn_type); - - participant_->check_get_type_request(request_sample_id, identifier, object, dyn_type); - } -} - -void DomainParticipantImpl::MyRTPSParticipantListener::on_type_dependencies_reply( - RTPSParticipant*, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies) -{ - Sentry sentinel(this); - if (sentinel) - { - participant_->listener_->on_type_dependencies_reply( - participant_->participant_, request_sample_id, dependencies); - - participant_->check_get_dependencies_request(request_sample_id, dependencies); - } -} - -void DomainParticipantImpl::MyRTPSParticipantListener::on_type_information_received( - RTPSParticipant*, - const fastrtps::string_255& topic_name, - const fastrtps::string_255& type_name, - const fastrtps::types::TypeInformation& type_information) -{ - Sentry sentinel(this); - if (sentinel) - { - if (type_information.complete().typeid_with_size().type_id()._d() > 0 - || type_information.minimal().typeid_with_size().type_id()._d() > 0) - { - participant_->listener_->on_type_information_received( - participant_->participant_, topic_name, type_name, type_information); - } + bool should_be_ignored = false; + participant_->listener_->on_data_writer_discovery(participant_->participant_, std::move(info), + should_be_ignored); } } bool DomainParticipantImpl::new_remote_endpoint_discovered( - const GUID_t& partguid, + const fastrtps::rtps::GUID_t& partguid, uint16_t endpointId, EndpointKind_t kind) { @@ -1685,443 +1608,13 @@ ResourceEvent& DomainParticipantImpl::get_resource_event() const return get_rtps_participant()->get_resource_event(); } -fastrtps::rtps::SampleIdentity DomainParticipantImpl::get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const -{ - const fastrtps::rtps::RTPSParticipant* rtps_participant = get_rtps_participant(); - return nullptr != rtps_participant ? - rtps_participant->typelookup_manager()->get_type_dependencies(in) : - builtin::INVALID_SAMPLE_IDENTITY; -} - -fastrtps::rtps::SampleIdentity DomainParticipantImpl::get_types( - const fastrtps::types::TypeIdentifierSeq& in) const -{ - const fastrtps::rtps::RTPSParticipant* rtps_participant = get_rtps_participant(); - return nullptr != rtps_participant ? - rtps_participant->typelookup_manager()->get_types(in) : - builtin::INVALID_SAMPLE_IDENTITY; -} - -ReturnCode_t DomainParticipantImpl::register_remote_type( - const fastrtps::types::TypeInformation& type_information, - const std::string& type_name, - std::function& callback) -{ - using namespace fastrtps::types; - - if (get_rtps_participant() == nullptr) - { - return ReturnCode_t::RETCODE_NOT_ENABLED; - } - - TypeObjectFactory* factory = TypeObjectFactory::get_instance(); - // Check if plain - if (type_information.complete().typeid_with_size().type_id()._d() < EK_MINIMAL) - { - DynamicType_ptr dyn = factory->build_dynamic_type( - type_name, - &type_information.minimal().typeid_with_size().type_id()); - - if (nullptr != dyn) - { - //callback(type_name, dyn); // For plain types, don't call the callback - return register_dynamic_type(dyn); - } - // If cannot create the dynamic type, probably is because it depend on unknown types. - // We must continue. - } - - // Check if already available - TypeObject obj; - factory->typelookup_get_type( - type_information.complete().typeid_with_size().type_id(), - obj); - - if (obj._d() != 0) - { - DynamicType_ptr dyn = factory->build_dynamic_type( - type_name, - &type_information.complete().typeid_with_size().type_id(), - &obj); - - if (nullptr != dyn) - { - //callback(type_name, dyn); // If the type is already registered, don't call the callback. - return register_dynamic_type(dyn); - } - } - else if (get_rtps_participant()->typelookup_manager() != nullptr) - { - TypeIdentifierSeq dependencies; - TypeIdentifierSeq retrieve_objects; - - fill_pending_dependencies(type_information.complete().dependent_typeids(), dependencies, retrieve_objects); - - fastrtps::rtps::SampleIdentity request_dependencies; - fastrtps::rtps::SampleIdentity request_objects; - - // Lock now, we don't want to process the reply before we add the requests' ID to the maps. - std::lock_guard lock(mtx_request_cb_); - - // If any pending dependency exists, retrieve it. - if (!dependencies.empty()) - { - request_dependencies = get_type_dependencies(dependencies); - } - - // If any pending TypeObject exists, retrieve it - if (!retrieve_objects.empty()) - { - request_objects = get_types(retrieve_objects); - } - - // If no more dependencies but failed to create, probably we only need the TypeObject - dependencies.clear(); // Reuse the same vector. - dependencies.push_back(type_information.complete().typeid_with_size().type_id()); - fastrtps::rtps::SampleIdentity requestId = get_types(dependencies); - - // Add everything to maps - register_callbacks_.emplace(std::make_pair(requestId, std::make_pair(type_name, callback))); - std::vector vector; - vector.push_back(requestId); // Add itself - - if (builtin::INVALID_SAMPLE_IDENTITY != request_dependencies) - { - vector.push_back(request_dependencies); - child_requests_.emplace(std::make_pair(request_dependencies, requestId)); - } - - if (builtin::INVALID_SAMPLE_IDENTITY != request_objects) - { - vector.push_back(request_objects); - child_requests_.emplace(std::make_pair(request_objects, requestId)); - } - - // Move the filled vector to the map - parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - - return ReturnCode_t::RETCODE_NO_DATA; - } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; -} - -bool DomainParticipantImpl::check_get_type_request( - const fastrtps::rtps::SampleIdentity& requestId, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type) -{ - // Maybe we have a pending request? - if (builtin::INVALID_SAMPLE_IDENTITY != requestId) - { - // First level request? - std::lock_guard lock(mtx_request_cb_); - - auto cb_it = register_callbacks_.find(requestId); - - if (cb_it != register_callbacks_.end()) - { - const std::string& name = cb_it->second.first; - const auto& callback = cb_it->second.second; - - if (nullptr != dyn_type) - { - dyn_type->set_name(name); - if (register_dynamic_type(dyn_type) == ReturnCode_t::RETCODE_OK) - { - callback(name, dyn_type); - remove_parent_request(requestId); - return true; - } - } - - // Exists the request, but the provided dyn_type isn't valid. - // Register the received TypeObject into factory and recreate the DynamicType. - fastrtps::types::TypeObjectFactory::get_instance()->add_type_object(name, identifier, object); - - auto pending = parent_requests_.find(requestId); - if (pending != parent_requests_.end() && pending->second.size() < 2) // Exists and everything is solved. - { - fastrtps::types::DynamicType_ptr dynamic = - fastrtps::types::TypeObjectFactory::get_instance()->build_dynamic_type(name, identifier, - object); - - if (nullptr != dynamic) - { - if (register_dynamic_type(dynamic) == ReturnCode_t::RETCODE_OK) - { - callback(name, dynamic); - remove_parent_request(requestId); - return true; - } - } - } - // Failed, cannot register the type yet, probably child request still pending. - return false; - } - - // Child request? - auto child_it = child_requests_.find(requestId); - - if (child_it != child_requests_.end()) - { - // Register received TypeObject into factory, remove the iterator from the map and check our parent. - fastrtps::types::TypeObjectFactory::get_instance()->add_type_object( - get_inner_type_name(requestId), identifier, object); - remove_child_request(requestId); - } - } - return false; -} - -void DomainParticipantImpl::fill_pending_dependencies( - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies, - fastrtps::types::TypeIdentifierSeq& pending_identifiers, - fastrtps::types::TypeIdentifierSeq& pending_objects) const -{ - using namespace fastrtps::types; - for (const TypeIdentifierWithSize& tiws : dependencies) - { - // Check that we don't know that dependency - if (!TypeObjectFactory::get_instance()->typelookup_check_type_identifier(tiws.type_id())) - { - pending_identifiers.push_back(tiws.type_id()); - } - // Check if we need to retrieve the TypeObject - if (tiws.type_id()._d() >= EK_MINIMAL) - { - TypeObject obj; - TypeObjectFactory::get_instance()->typelookup_get_type(tiws.type_id(), obj); - if (obj._d() == 0) - { - // Failed, so we must retrieve it. - pending_objects.push_back(tiws.type_id()); - } - } - } -} - -bool DomainParticipantImpl::check_get_dependencies_request( - const fastrtps::rtps::SampleIdentity& requestId, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies) -{ - using namespace fastrtps::types; - - // Maybe we have a pending request? - if (builtin::INVALID_SAMPLE_IDENTITY != requestId) - { - TypeIdentifierSeq next_dependencies; - TypeIdentifierSeq retrieve_objects; - - // First level request? - std::lock_guard lock(mtx_request_cb_); - - auto cb_it = register_callbacks_.find(requestId); - - if (cb_it != register_callbacks_.end()) - { - fill_pending_dependencies(dependencies, next_dependencies, retrieve_objects); - - // If any pending dependency exists, retrieve it - if (!next_dependencies.empty()) - { - fastrtps::rtps::SampleIdentity child_request = get_type_dependencies(next_dependencies); - std::vector vector; - vector.push_back(child_request); - parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - child_requests_.emplace(std::make_pair(child_request, requestId)); - } - - // Add received dependencies to the factory - for (const TypeIdentifierWithSize& tiws : dependencies) - { - if (tiws.type_id()._d() >= EK_MINIMAL) - { - // This dependency needs a TypeObject - retrieve_objects.push_back(tiws.type_id()); - } - else - { - TypeObjectFactory::get_instance()->add_type_identifier( - get_inner_type_name(requestId), &tiws.type_id()); - } - } - - // If any pending TypeObject exists, retrieve it - if (!retrieve_objects.empty()) - { - fastrtps::rtps::SampleIdentity child_request = get_types(retrieve_objects); - std::vector vector; - vector.push_back(child_request); - parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - child_requests_.emplace(std::make_pair(child_request, requestId)); - } - - if (next_dependencies.empty() && retrieve_objects.empty()) - { - // Finished? - on_child_requests_finished(requestId); - return true; - } - - return false; - } - - // Child request? - auto child_it = child_requests_.find(requestId); - - if (child_it != child_requests_.end()) - { - fill_pending_dependencies(dependencies, next_dependencies, retrieve_objects); - - // If any pending dependency exists, retrieve it - if (!next_dependencies.empty()) - { - fastrtps::rtps::SampleIdentity child_request = get_type_dependencies(next_dependencies); - std::vector vector; - vector.push_back(child_request); - parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - child_requests_.emplace(std::make_pair(child_request, requestId)); - } - - // Add received dependencies to the factory - for (const TypeIdentifierWithSize& tiws : dependencies) - { - if (tiws.type_id()._d() >= EK_MINIMAL) - { - // This dependency needs a TypeObject - retrieve_objects.push_back(tiws.type_id()); - } - else - { - TypeObjectFactory::get_instance()->add_type_identifier( - get_inner_type_name(requestId), &tiws.type_id()); - } - } - - // If any pending TypeObject exists, retrieve it - if (!retrieve_objects.empty()) - { - fastrtps::rtps::SampleIdentity child_request = get_types(retrieve_objects); - std::vector vector; - vector.push_back(child_request); - parent_requests_.emplace(std::make_pair(requestId, std::move(vector))); - child_requests_.emplace(std::make_pair(child_request, requestId)); - } - - if (next_dependencies.empty() && retrieve_objects.empty()) - { - remove_child_request(requestId); - return true; - } - - return false; - } - } - return false; -} - ReturnCode_t DomainParticipantImpl::register_dynamic_type( - fastrtps::types::DynamicType_ptr dyn_type) + DynamicType::_ref_type dyn_type) { - TypeSupport type(new fastrtps::types::DynamicPubSubType(dyn_type)); + TypeSupport type(new DynamicPubSubType(dyn_type)); return get_participant()->register_type(type); } -void DomainParticipantImpl::remove_parent_request( - const fastrtps::rtps::SampleIdentity& request) -{ - // If a parent request if going to be deleted, delete all its children too. - auto cb_it = register_callbacks_.find(request); - auto parent_it = parent_requests_.find(request); - - if (parent_requests_.end() != parent_it) - { - for (const fastrtps::rtps::SampleIdentity& child_id : parent_it->second) - { - auto child_it = child_requests_.find(child_id); - if (child_requests_.end() != child_it) - { - child_requests_.erase(child_it); - } - } - parent_requests_.erase(parent_it); - } - - if (register_callbacks_.end() != cb_it) - { - register_callbacks_.erase(cb_it); - } -} - -void DomainParticipantImpl::remove_child_request( - const fastrtps::rtps::SampleIdentity& request) -{ - auto child_it = child_requests_.find(request); - if (child_requests_.end() != child_it) - { - fastrtps::rtps::SampleIdentity parent_request = child_it->second; - child_requests_.erase(child_it); - - auto parent_it = parent_requests_.find(parent_request); - if (parent_requests_.end() != parent_it) - { - std::vector& pending = parent_it->second; - pending.erase(std::find(pending.begin(), pending.end(), request)); - if (pending.empty()) - { - parent_requests_.erase(parent_it); - } - } - - on_child_requests_finished(parent_request); - } -} - -void DomainParticipantImpl::on_child_requests_finished( - const fastrtps::rtps::SampleIdentity& parent) -{ - auto pending_requests_it = parent_requests_.find(parent); - // Do I have no more pending childs? - if (parent_requests_.end() == pending_requests_it || pending_requests_it->second.empty()) - { - // Am I a children? - auto child_it = child_requests_.find(parent); - if (child_requests_.end() != child_it) - { - remove_child_request(parent); - } - else - { - // Or a top-level request? - auto cb_it = register_callbacks_.find(parent); - if (pending_requests_it->second.size() < 2) - { - parent_requests_.erase(pending_requests_it); - } - cb_it->second.second(cb_it->second.first, fastrtps::types::DynamicType_ptr(nullptr)); // Everything should be already registered - register_callbacks_.erase(cb_it); - } - } -} - -std::string DomainParticipantImpl::get_inner_type_name( - const fastrtps::rtps::SampleIdentity& id) const -{ - std::stringstream ss; - ss << "type_" << id.writer_guid() << "_" << id.sequence_number(); - std::string str = ss.str(); - std::transform(str.begin(), str.end(), str.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - str.erase(std::remove(str.begin(), str.end(), '.'), str.end()); - std::replace(str.begin(), str.end(), '|', '_'); - return str; -} - bool DomainParticipantImpl::has_active_entities() { if (!publishers_.empty()) @@ -2188,15 +1681,15 @@ bool DomainParticipantImpl::set_qos( return qos_should_be_updated; } -fastrtps::types::ReturnCode_t DomainParticipantImpl::check_qos( +ReturnCode_t DomainParticipantImpl::check_qos( const DomainParticipantQos& qos) { if (qos.allocation().data_limits.max_user_data == 0 || qos.allocation().data_limits.max_user_data > qos.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } bool DomainParticipantImpl::can_qos_be_updated( @@ -2236,10 +1729,6 @@ bool DomainParticipantImpl::can_qos_be_updated( from.wire_protocol().ignore_non_matching_locators) || !(to.wire_protocol().builtin.use_WriterLivelinessProtocol == from.wire_protocol().builtin.use_WriterLivelinessProtocol) || - !(to.wire_protocol().builtin.typelookup_config.use_client == - from.wire_protocol().builtin.typelookup_config.use_client) || - !(to.wire_protocol().builtin.typelookup_config.use_server == - from.wire_protocol().builtin.typelookup_config.use_server) || !(to.wire_protocol().builtin.network_configuration == from.wire_protocol().builtin.network_configuration) || !(to.wire_protocol().builtin.metatrafficUnicastLocatorList == @@ -2340,6 +1829,12 @@ bool DomainParticipantImpl::can_qos_be_updated( EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "Participant discovery_server_thread cannot be changed after the participant is enabled"); } + if (!(to.typelookup_service_thread() == from.typelookup_service_thread())) + { + updatable = false; + EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, + "Participant typelookup_service_thread cannot be changed after the participant is enabled"); + } #if HAVE_SECURITY if (!(to.security_log_thread() == from.security_log_thread())) { diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp index f2746ed522c..b086b9d0d26 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.hpp @@ -22,29 +22,28 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include #include +#include -#include -#include -#include - +#include +#include +#include +#include +#include #include #include -#include -#include #include #include +#include #include - #include -#include -#include +#include +#include +#include #include "fastdds/topic/DDSSQLFilter/DDSFilterFactory.hpp" #include -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastrtps { @@ -77,7 +76,7 @@ class ReaderFilterCollection; /** * This is the implementation class of the DomainParticipant. - * @ingroup FASTRTPS_MODULE + * @ingroup FASTDDS_MODULE */ class DomainParticipantImpl { @@ -125,12 +124,12 @@ class DomainParticipantImpl return !(rtps_listener_.callback_counter_ > 0); })) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } rtps_listener_.callback_counter_ = (listener == nullptr) ? -1 : 0; listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipantListener* get_listener() const @@ -376,7 +375,7 @@ class DomainParticipantImpl const PublisherQos& get_default_publisher_qos() const; - const ReturnCode_t get_publisher_qos_from_profile( + ReturnCode_t get_publisher_qos_from_profile( const std::string& profile_name, PublisherQos& qos) const; @@ -387,7 +386,7 @@ class DomainParticipantImpl const SubscriberQos& get_default_subscriber_qos() const; - const ReturnCode_t get_subscriber_qos_from_profile( + ReturnCode_t get_subscriber_qos_from_profile( const std::string& profile_name, SubscriberQos& qos) const; @@ -398,10 +397,18 @@ class DomainParticipantImpl const TopicQos& get_default_topic_qos() const; - const ReturnCode_t get_topic_qos_from_profile( + ReturnCode_t get_topic_qos_from_profile( const std::string& profile_name, TopicQos& qos) const; + ReturnCode_t get_replier_qos_from_profile( + const std::string& profile_name, + ReplierQos& qos) const; + + ReturnCode_t get_requester_qos_from_profile( + const std::string& profile_name, + RequesterQos& qos) const; + /* TODO bool get_discovered_participants( std::vector& participant_handles) const; @@ -468,7 +475,7 @@ class DomainParticipantImpl /** * This method can be used when using a StaticEndpointDiscovery mechanism different that the one - * included in FastRTPS, for example when communicating with other implementations. + * included in Fast DDS, for example when communicating with other implementations. * It indicates the Participant that an Endpoint from the XML has been discovered and * should be activated. * @param partguid Participant GUID_t. @@ -483,34 +490,6 @@ class DomainParticipantImpl fastrtps::rtps::ResourceEvent& get_resource_event() const; - fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const; - - fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const; - - /** - * Helps the user to solve all dependencies calling internally to the typelookup service and - * registers the resulting dynamic type. - * The registration may be perform asynchronously, case in which the user will be notified - * through the given callback, which receives the type_name as unique argument. - * - * @param type_information - * @param type_name - * @param callback - * @return RETCODE_OK If the given type_information is enough to build the type without using - * the typelookup service (callback will not be called). - * @return RETCODE_OK if the given type is already available (callback will not be called). - * @return RETCODE_NO_DATA if type is not available yet (the callback will be called if - * negotiation is success, and ignored in other case). - * @return RETCODE_NOT_ENABLED if the DomainParticipant is not enabled. - * @return RETCODE_PRECONDITION_NOT_MET if the DomainParticipant type lookup service is disabled. - */ - ReturnCode_t register_remote_type( - const fastrtps::types::TypeInformation& type_information, - const std::string& type_name, - std::function& callback); - //! Remove all listeners in the hierarchy to allow a quiet destruction virtual void disable(); @@ -594,21 +573,6 @@ class DomainParticipantImpl TopicQos default_topic_qos_; - // Mutex for requests and callbacks maps. - std::mutex mtx_request_cb_; - - // register_remote_type parent request, type_name, callback relationship. - std::map>> register_callbacks_; - - // Relationship between child and parent request - std::map child_requests_; - - // All parent's child requests - std::map> parent_requests_; - std::atomic id_counter_; class MyRTPSParticipantListener : public fastrtps::rtps::RTPSParticipantListener @@ -698,25 +662,6 @@ class DomainParticipantImpl fastrtps::rtps::RTPSParticipant* participant, fastrtps::rtps::WriterDiscoveryInfo&& info) override; - void on_type_discovery( - fastrtps::rtps::RTPSParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::string_255& topic, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type) override; - - void on_type_dependencies_reply( - fastrtps::rtps::RTPSParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies) override; - - void on_type_information_received( - fastrtps::rtps::RTPSParticipant* participant, - const fastrtps::string_255& topic_name, - const fastrtps::string_255& type_name, - const fastrtps::types::TypeInformation& type_information) override; - DomainParticipantImpl* participant_; int callback_counter_ = 0; @@ -727,20 +672,7 @@ class DomainParticipantImpl InstanceHandle_t& handle); ReturnCode_t register_dynamic_type( - fastrtps::types::DynamicType_ptr dyn_type); - - bool register_dynamic_type_to_factories( - const TypeSupport& type) const; - - bool check_get_type_request( - const fastrtps::rtps::SampleIdentity& requestId, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type); - - bool check_get_dependencies_request( - const fastrtps::rtps::SampleIdentity& requestId, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies); + DynamicType::_ref_type dyn_type); virtual PublisherImpl* create_publisher_impl( const PublisherQos& qos, @@ -750,26 +682,6 @@ class DomainParticipantImpl const SubscriberQos& qos, SubscriberListener* listener); - // Always call it with the mutex already taken - void remove_parent_request( - const fastrtps::rtps::SampleIdentity& request); - - // Always call it with the mutex already taken - void remove_child_request( - const fastrtps::rtps::SampleIdentity& request); - - // Always call it with the mutex already taken - void on_child_requests_finished( - const fastrtps::rtps::SampleIdentity& parent); - - void fill_pending_dependencies( - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies, - fastrtps::types::TypeIdentifierSeq& pending_identifiers, - fastrtps::types::TypeIdentifierSeq& pending_objects) const; - - std::string get_inner_type_name( - const fastrtps::rtps::SampleIdentity& id) const; - IContentFilterFactory* find_content_filter_factory( const char* filter_class_name); diff --git a/src/cpp/fastdds/log/CMakeLists.txt b/src/cpp/fastdds/log/CMakeLists.txt new file mode 100644 index 00000000000..049b5c622ba --- /dev/null +++ b/src/cpp/fastdds/log/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#{{{ Interface library for grouping the Log source code + +add_library(fastdds-log INTERFACE) + +add_library(fastdds::log ALIAS fastdds-log) + +target_compile_features(fastdds-log INTERFACE cxx_std_11) + +target_sources(fastdds-log INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/Colors.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/FileConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/Log.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/OStreamConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/StdoutConsumer.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/log/StdoutErrConsumer.hpp + + FileConsumer.cpp + Log.cpp + LogResources.hpp + OStreamConsumer.cpp + StdoutConsumer.cpp + StdoutErrConsumer.cpp + ) + +#}}} diff --git a/src/cpp/fastdds/log/Log.cpp b/src/cpp/fastdds/log/Log.cpp index 9063fd4efb9..d114aa6d0fd 100644 --- a/src/cpp/fastdds/log/Log.cpp +++ b/src/cpp/fastdds/log/Log.cpp @@ -18,13 +18,13 @@ #include #include -#include - +#include #include #include #include #include -#include + +#include #include #include #include @@ -115,6 +115,13 @@ struct LogResources category_filter_.reset(new std::regex(filter)); } + //! Returns a copy of the current category filter or an empty object otherwise + std::regex GetCategoryFilter() + { + std::unique_lock configGuard(config_mutex_); + return category_filter_ ? *category_filter_ : std::regex{}; + } + //! Sets a filter that will pattern-match against filenames_, dropping any unmatched categories. void SetFilenameFilter( const std::regex& filter) @@ -123,6 +130,13 @@ struct LogResources filename_filter_.reset(new std::regex(filter)); } + //! Returns a copy of the current filename filter or an empty object otherwise + std::regex GetFilenameFilter() + { + std::unique_lock configGuard(config_mutex_); + return filename_filter_ ? *filename_filter_: std::regex{}; + } + //! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories. void SetErrorStringFilter( const std::regex& filter) @@ -139,6 +153,13 @@ struct LogResources thread_settings_ = config; } + //! Returns a copy of the current filename filter or an empty object otherwise + std::regex GetErrorStringFilter() + { + std::unique_lock configGuard(config_mutex_); + return error_string_filter_ ? *error_string_filter_: std::regex{}; + } + //! Returns the logging_ engine to configuration defaults. void Reset() { @@ -341,7 +362,7 @@ struct LogResources return true; } - fastrtps::DBQueue logs_; + DBQueue logs_; std::vector> consumers_; eprosima::thread logging_thread_; @@ -453,6 +474,21 @@ void Log::SetThreadConfig( detail::get_log_resources()->SetThreadConfig(config); } +std::regex Log::GetCategoryFilter() +{ + return detail::get_log_resources()->GetCategoryFilter(); +} + +std::regex Log::GetFilenameFilter() +{ + return detail::get_log_resources()->GetFilenameFilter(); +} + +std::regex Log::GetErrorStringFilter() +{ + return detail::get_log_resources()->GetErrorStringFilter(); +} + void LogConsumer::print_timestamp( std::ostream& stream, const Log::Entry& entry, diff --git a/src/cpp/fastdds/publisher/DataWriter.cpp b/src/cpp/fastdds/publisher/DataWriter.cpp index 92e10412200..2b4e1c64e69 100644 --- a/src/cpp/fastdds/publisher/DataWriter.cpp +++ b/src/cpp/fastdds/publisher/DataWriter.cpp @@ -52,16 +52,16 @@ ReturnCode_t DataWriter::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_publisher()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -106,17 +106,6 @@ ReturnCode_t DataWriter::write_w_timestamp( return impl_->write_w_timestamp(data, handle, timestamp); } -ReturnCode_t DataWriter::write_w_timestamp( - void* data, - const InstanceHandle_t& handle, - const fastrtps::rtps::Time_t& timestamp) -{ - static_cast (data); - static_cast (handle); - static_cast (timestamp); - return ReturnCode_t::RETCODE_UNSUPPORTED; -} - InstanceHandle_t DataWriter::register_instance( void* instance) { @@ -130,16 +119,6 @@ InstanceHandle_t DataWriter::register_instance_w_timestamp( return impl_->register_instance_w_timestamp(instance, timestamp); } -InstanceHandle_t DataWriter::register_instance_w_timestamp( - void* instance, - const fastrtps::rtps::Time_t& timestamp) -{ - static_cast (instance); - static_cast (timestamp); - EPROSIMA_LOG_WARNING(DATA_WRITER, "register_instance_w_timestamp method not yet implemented"); - return HANDLE_NIL; -} - ReturnCode_t DataWriter::unregister_instance( void* instance, const InstanceHandle_t& handle) @@ -155,17 +134,6 @@ ReturnCode_t DataWriter::unregister_instance_w_timestamp( return impl_->unregister_instance_w_timestamp(instance, handle, timestamp); } -ReturnCode_t DataWriter::unregister_instance_w_timestamp( - void* instance, - const InstanceHandle_t& handle, - const fastrtps::rtps::Time_t& timestamp) -{ - static_cast (instance); - static_cast (handle); - static_cast (timestamp); - return ReturnCode_t::RETCODE_UNSUPPORTED; -} - ReturnCode_t DataWriter::get_key_value( void* key_holder, const InstanceHandle_t& handle) @@ -226,7 +194,7 @@ ReturnCode_t DataWriter::get_qos( DataWriterQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriter::set_listener( @@ -240,7 +208,7 @@ ReturnCode_t DataWriter::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -304,7 +272,7 @@ ReturnCode_t DataWriter::get_matched_subscription_data( { static_cast (subscription_data); static_cast (subscription_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_subscription_data(subscription_data, subscription_handle); */ @@ -314,17 +282,7 @@ ReturnCode_t DataWriter::get_matched_subscriptions( std::vector& subscription_handles) const { static_cast (subscription_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; - /* - return impl_->get_matched_subscription_data(subscription_handles); - */ -} - -ReturnCode_t DataWriter::get_matched_subscriptions( - std::vector& subscription_handles) const -{ - static_cast (subscription_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_subscription_data(subscription_handles); */ diff --git a/src/cpp/fastdds/publisher/DataWriterHistory.hpp b/src/cpp/fastdds/publisher/DataWriterHistory.hpp index 281d460417d..8aacc0481a5 100644 --- a/src/cpp/fastdds/publisher/DataWriterHistory.hpp +++ b/src/cpp/fastdds/publisher/DataWriterHistory.hpp @@ -22,12 +22,12 @@ #include #include +#include +#include #include #include #include #include -#include -#include #include diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.cpp b/src/cpp/fastdds/publisher/DataWriterImpl.cpp index 726f899561b..03696bb7e5b 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.cpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.cpp @@ -21,9 +21,11 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -33,25 +35,24 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include -#include -#include +#include #include #include #include #include #include +#include #ifdef FASTDDS_STATISTICS #include -#include +#include #endif //FASTDDS_STATISTICS using namespace eprosima::fastrtps; @@ -172,7 +173,8 @@ DataWriterImpl::DataWriterImpl( endpoint_attributes.setEntityID(qos_.endpoint().entity_id); endpoint_attributes.setUserDefinedID(qos_.endpoint().user_defined_id); fastrtps::rtps::RTPSParticipantImpl::preprocess_endpoint_attributes( - EntityId_t::unknown(), publisher_->get_participant_impl()->id_counter(), endpoint_attributes, guid_.entityId); + fastrtps::rtps::EntityId_t::unknown(), + publisher_->get_participant_impl()->id_counter(), endpoint_attributes, guid_.entityId); guid_.guidPrefix = publisher_->get_participant_impl()->guid().guidPrefix; if (payload_pool != nullptr) @@ -297,7 +299,7 @@ ReturnCode_t DataWriterImpl::enable() } ReturnCode_t ret_code = check_datasharing_compatible(w_att, is_data_sharing_compatible_); - if (ret_code != ReturnCode_t::RETCODE_OK) + if (ret_code != RETCODE_OK) { return ret_code; } @@ -335,14 +337,14 @@ ReturnCode_t DataWriterImpl::enable() if (!change_pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating change pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } auto pool = get_payload_pool(); if (!pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating payload pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } RTPSWriter* writer = RTPSDomainImpl::create_rtps_writer( @@ -368,7 +370,7 @@ ReturnCode_t DataWriterImpl::enable() if (!pool) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating payload pool for associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer = RTPSDomainImpl::create_rtps_writer( @@ -384,7 +386,7 @@ ReturnCode_t DataWriterImpl::enable() { release_payload_pool(); EPROSIMA_LOG_ERROR(DATA_WRITER, "Problem creating associated Writer"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer_ = writer; @@ -438,7 +440,7 @@ ReturnCode_t DataWriterImpl::enable() } publisher_->rtps_participant()->registerWriter(writer_, get_topic_attributes(qos_, *topic_, type_), wqos); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataWriterImpl::disable() @@ -454,10 +456,10 @@ ReturnCode_t DataWriterImpl::check_delete_preconditions() { if (loans_ && !loans_->is_empty()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataWriterImpl::~DataWriterImpl() @@ -481,25 +483,25 @@ ReturnCode_t DataWriterImpl::loan_sample( { // Block lowlevel writer auto max_blocking_time = steady_clock::now() + - microseconds(::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); + microseconds(rtps::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); // Type should be plain and have space for the representation header if (!type_->is_plain(data_representation_) || SerializedPayload_t::representation_header_size > type_->m_typeSize) { - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } // Writer should be enabled if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } #if HAVE_STRICT_REALTIME std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else static_cast(max_blocking_time); @@ -514,7 +516,7 @@ ReturnCode_t DataWriterImpl::loan_sample( return size; }, payload)) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Leave payload state as if serialization has already been performed @@ -531,7 +533,7 @@ ReturnCode_t DataWriterImpl::loan_sample( { sample = nullptr; return_payload_to_pool(payload); - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } switch (initialization) @@ -558,12 +560,12 @@ ReturnCode_t DataWriterImpl::loan_sample( check_and_remove_loan(sample, payload); return_payload_to_pool(payload); sample = nullptr; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } break; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::discard_loan( @@ -572,13 +574,13 @@ ReturnCode_t DataWriterImpl::discard_loan( // Type should be plain and have space for the representation header if (!type_->is_plain(data_representation_) || SerializedPayload_t::representation_header_size > type_->m_typeSize) { - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } // Writer should be enabled if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } std::lock_guard lock(writer_->getMutex()); @@ -587,14 +589,14 @@ ReturnCode_t DataWriterImpl::discard_loan( PayloadInfo_t payload; if ((nullptr == sample) || !check_and_remove_loan(sample, payload)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } // Return payload to pool return_payload_to_pool(payload); sample = nullptr; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::write( @@ -606,7 +608,7 @@ bool DataWriterImpl::write( } EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data"); - return ReturnCode_t::RETCODE_OK == create_new_change(ALIVE, data); + return RETCODE_OK == create_new_change(ALIVE, data); } bool DataWriterImpl::write( @@ -619,7 +621,7 @@ bool DataWriterImpl::write( } EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with WriteParams"); - return ReturnCode_t::RETCODE_OK == create_new_change_with_params(ALIVE, data, params); + return RETCODE_OK == create_new_change_with_params(ALIVE, data, params); } ReturnCode_t DataWriterImpl::check_write_preconditions( @@ -629,7 +631,7 @@ ReturnCode_t DataWriterImpl::check_write_preconditions( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (type_.get()->m_isGetKeyDefined) @@ -645,10 +647,10 @@ ReturnCode_t DataWriterImpl::check_write_preconditions( //does not correspond with the instance referred by the data if (handle.isDefined() && handle != instance_handle) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::write( @@ -657,7 +659,7 @@ ReturnCode_t DataWriterImpl::write( { InstanceHandle_t instance_handle; ReturnCode_t ret = check_write_preconditions(data, handle, instance_handle); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with Handle"); WriteParams wparams; @@ -673,18 +675,18 @@ ReturnCode_t DataWriterImpl::write_w_timestamp( const fastrtps::Time_t& timestamp) { InstanceHandle_t instance_handle; - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = RETCODE_OK; if (timestamp.is_infinite() || timestamp.seconds < 0) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = check_write_preconditions(data, handle, instance_handle); } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { EPROSIMA_LOG_INFO(DATA_WRITER, "Writing new data with Handle and timestamp"); WriteParams wparams; @@ -702,19 +704,19 @@ ReturnCode_t DataWriterImpl::check_instance_preconditions( { if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (nullptr == data) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } instance_handle = handle; @@ -734,11 +736,11 @@ ReturnCode_t DataWriterImpl::check_instance_preconditions( if (handle.isDefined() && instance_handle != handle) { EPROSIMA_LOG_ERROR(DATA_WRITER, "handle differs from data's key."); - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } #endif // if !defined(NDEBUG) - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } InstanceHandle_t DataWriterImpl::register_instance( @@ -746,7 +748,7 @@ InstanceHandle_t DataWriterImpl::register_instance( { /// Preconditions InstanceHandle_t instance_handle; - if (ReturnCode_t::RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle)) + if (RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle)) { return HANDLE_NIL; } @@ -762,7 +764,7 @@ InstanceHandle_t DataWriterImpl::register_instance_w_timestamp( /// Preconditions InstanceHandle_t instance_handle; if (timestamp.is_infinite() || timestamp.seconds < 0 || - (ReturnCode_t::RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle))) + (RETCODE_OK != check_instance_preconditions(key, HANDLE_NIL, instance_handle))) { return HANDLE_NIL; } @@ -783,7 +785,7 @@ InstanceHandle_t DataWriterImpl::do_register_instance( // Block lowlevel writer auto max_blocking_time = std::chrono::steady_clock::now() + - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); + std::chrono::microseconds(rtps::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); #if HAVE_STRICT_REALTIME std::unique_lock lock(writer_->getMutex(), std::defer_lock); @@ -808,7 +810,7 @@ InstanceHandle_t DataWriterImpl::do_register_instance( // Serialization of the sample failed. Remove the instance to keep original state. // Note that we will only end-up here if the instance has just been created, so it will be empty // and removing its changes will remove the instance completely. - history_.remove_instance_changes(instance_handle, SequenceNumber_t()); + history_.remove_instance_changes(instance_handle, fastrtps::rtps::SequenceNumber_t()); } } return instance_handle; @@ -826,13 +828,13 @@ ReturnCode_t DataWriterImpl::unregister_instance( // Preconditions InstanceHandle_t ih; ReturnCode_t returned_value = check_instance_preconditions(instance, handle, ih); - if (ReturnCode_t::RETCODE_OK == returned_value && !history_.is_key_registered(ih)) + if (RETCODE_OK == returned_value && !history_.is_key_registered(ih)) { - returned_value = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + returned_value = RETCODE_PRECONDITION_NOT_MET; } // Operation - if (ReturnCode_t::RETCODE_OK == returned_value) + if (RETCODE_OK == returned_value) { WriteParams wparams; ChangeKind_t change_kind = unregister_change_kind(dispose, qos_); @@ -850,22 +852,22 @@ ReturnCode_t DataWriterImpl::unregister_instance_w_timestamp( { // Preconditions InstanceHandle_t instance_handle; - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = RETCODE_OK; if (timestamp.is_infinite() || timestamp.seconds < 0) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = check_instance_preconditions(instance, handle, instance_handle); } - if (ReturnCode_t::RETCODE_OK == ret && !history_.is_key_registered(instance_handle)) + if (RETCODE_OK == ret && !history_.is_key_registered(instance_handle)) { - ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + ret = RETCODE_PRECONDITION_NOT_MET; } // Operation - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { WriteParams wparams; wparams.source_timestamp(timestamp); @@ -884,28 +886,28 @@ ReturnCode_t DataWriterImpl::get_key_value( if (key_holder == nullptr || !handle.isDefined()) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Key holder pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } // Block lowlevel writer #if HAVE_STRICT_REALTIME auto max_blocking_time = std::chrono::steady_clock::now() + - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); + std::chrono::microseconds(rtps::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::lock_guard lock(writer_->getMutex()); @@ -914,11 +916,11 @@ ReturnCode_t DataWriterImpl::get_key_value( SerializedPayload_t* payload = history_.get_key_value(handle); if (nullptr == payload) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } type_->deserialize(payload, key_holder); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::create_new_change( @@ -937,7 +939,7 @@ ReturnCode_t DataWriterImpl::check_new_change_preconditions( if (data == nullptr) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data pointer not valid"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (change_kind == NOT_ALIVE_UNREGISTERED @@ -947,11 +949,11 @@ ReturnCode_t DataWriterImpl::check_new_change_preconditions( if (!type_->m_isGetKeyDefined) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Topic is NO_KEY, operation not permitted"); - return ReturnCode_t::RETCODE_ILLEGAL_OPERATION; + return RETCODE_ILLEGAL_OPERATION; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::perform_create_new_change( @@ -962,13 +964,13 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( { // Block lowlevel writer auto max_blocking_time = steady_clock::now() + - microseconds(::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); + microseconds(rtps::TimeConv::Time_t2MicroSecondsInt64(qos_.reliability().max_blocking_time)); #if HAVE_STRICT_REALTIME std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::unique_lock lock(writer_->getMutex()); @@ -980,14 +982,14 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( { if (!get_free_payload_from_pool(type_->getSerializedSizeProvider(data), payload)) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } if ((ALIVE == change_kind) && !type_->serialize(data, &payload.payload, data_representation_)) { EPROSIMA_LOG_WARNING(DATA_WRITER, "Data serialization returned false"); return_payload_to_pool(payload); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -1020,7 +1022,7 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( add_loan(data, payload); } writer_->release_change(ch); - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } if (qos_.deadline().period != c_TimeInfinite) @@ -1052,10 +1054,10 @@ ReturnCode_t DataWriterImpl::perform_create_new_change( lifespan_timer_->restart_timer(); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } ReturnCode_t DataWriterImpl::create_new_change_with_params( @@ -1064,7 +1066,7 @@ ReturnCode_t DataWriterImpl::create_new_change_with_params( WriteParams& wparams) { ReturnCode_t ret_code = check_new_change_preconditions(changeKind, data); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -1089,7 +1091,7 @@ ReturnCode_t DataWriterImpl::create_new_change_with_params( const InstanceHandle_t& handle) { ReturnCode_t ret_code = check_new_change_preconditions(changeKind, data); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -1105,7 +1107,7 @@ bool DataWriterImpl::remove_min_seq_change() ReturnCode_t DataWriterImpl::clear_history( size_t* removed) { - return (history_.removeAllChange(removed) ? ReturnCode_t::RETCODE_OK : ReturnCode_t::RETCODE_ERROR); + return (history_.removeAllChange(removed) ? RETCODE_OK : RETCODE_ERROR); } ReturnCode_t DataWriterImpl::get_sending_locators( @@ -1113,14 +1115,14 @@ ReturnCode_t DataWriterImpl::get_sending_locators( { if (nullptr == writer_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } writer_->getRTPSParticipant()->get_sending_locators(locators); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } -const GUID_t& DataWriterImpl::guid() const +const fastrtps::rtps::GUID_t& DataWriterImpl::guid() const { return guid_; } @@ -1151,7 +1153,7 @@ ReturnCode_t DataWriterImpl::set_qos( if (&qos != &DATAWRITER_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos_including_resource_limits(qos_to_set, type_); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -1160,20 +1162,20 @@ ReturnCode_t DataWriterImpl::set_qos( publisher_->get_participant()->get_qos().allocation().data_limits.max_user_data < qos_to_set.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); if (enabled) { - if (qos_.reliability().kind == eprosima::fastrtps::RELIABLE_RELIABILITY_QOS && + if (qos_.reliability().kind == ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS && qos_.reliable_writer_qos() == qos_to_set.reliable_writer_qos()) { // Update times and positive_acks attributes on RTPS Layer @@ -1214,7 +1216,7 @@ ReturnCode_t DataWriterImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterQos& DataWriterImpl::get_qos() const @@ -1227,7 +1229,7 @@ ReturnCode_t DataWriterImpl::set_listener( { std::lock_guard scoped_lock(listener_mutex_); listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterListener* DataWriterImpl::get_listener() const @@ -1256,7 +1258,7 @@ void DataWriterImpl::InnerDataWriterListener::onWriterMatched( if (listener != nullptr) { PublicationMatchedStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_writer_->get_publication_matched_status(callback_status)) + if (RETCODE_OK == data_writer_->get_publication_matched_status(callback_status)) { listener->on_publication_matched(data_writer_->user_datawriter_, callback_status); } @@ -1274,14 +1276,14 @@ void DataWriterImpl::InnerDataWriterListener::on_offered_incompatible_qos( if (listener != nullptr) { OfferedIncompatibleQosStatus callback_status; - if (data_writer_->get_offered_incompatible_qos_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_writer_->get_offered_incompatible_qos_status(callback_status) == RETCODE_OK) { listener->on_offered_incompatible_qos(data_writer_->user_datawriter_, callback_status); } } #ifdef FASTDDS_STATISTICS - notify_status_observer(statistics::INCOMPATIBLE_QOS); + notify_status_observer(statistics::StatusKind::INCOMPATIBLE_QOS); #endif //FASTDDS_STATISTICS data_writer_->user_datawriter_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1305,7 +1307,7 @@ void DataWriterImpl::InnerDataWriterListener::onWriterChangeReceivedByAll( void DataWriterImpl::InnerDataWriterListener::on_liveliness_lost( fastrtps::rtps::RTPSWriter* /*writer*/, - const fastrtps::LivelinessLostStatus& status) + const LivelinessLostStatus& status) { data_writer_->update_liveliness_lost_status(status); StatusMask notify_status = StatusMask::liveliness_lost(); @@ -1313,14 +1315,14 @@ void DataWriterImpl::InnerDataWriterListener::on_liveliness_lost( if (listener != nullptr) { LivelinessLostStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_writer_->get_liveliness_lost_status(callback_status)) + if (RETCODE_OK == data_writer_->get_liveliness_lost_status(callback_status)) { listener->on_liveliness_lost(data_writer_->user_datawriter_, callback_status); } } #ifdef FASTDDS_STATISTICS - notify_status_observer(statistics::LIVELINESS_LOST); + notify_status_observer(statistics::StatusKind::LIVELINESS_LOST); #endif //FASTDDS_STATISTICS data_writer_->user_datawriter_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1372,14 +1374,14 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (writer_->wait_for_all_acked(max_wait)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } ReturnCode_t DataWriterImpl::wait_for_acknowledgments( @@ -1390,20 +1392,20 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( // Preconditions InstanceHandle_t ih; ReturnCode_t returned_value = check_instance_preconditions(instance, handle, ih); - if (ReturnCode_t::RETCODE_OK != returned_value) + if (RETCODE_OK != returned_value) { return returned_value; } // Block low-level writer auto max_blocking_time = steady_clock::now() + - microseconds(::TimeConv::Time_t2MicroSecondsInt64(max_wait)); + microseconds(rtps::TimeConv::Time_t2MicroSecondsInt64(max_wait)); # if HAVE_STRICT_REALTIME std::unique_lock lock(writer_->getMutex(), std::defer_lock); if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::unique_lock lock(writer_->getMutex()); @@ -1411,15 +1413,15 @@ ReturnCode_t DataWriterImpl::wait_for_acknowledgments( if (!history_.is_key_registered(ih)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } if (history_.wait_for_acknowledgement_last_change(ih, lock, max_blocking_time)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } void DataWriterImpl::update_publication_matched_status( @@ -1441,7 +1443,7 @@ ReturnCode_t DataWriterImpl::get_publication_matched_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1453,7 +1455,7 @@ ReturnCode_t DataWriterImpl::get_publication_matched_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::publication_matched(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::deadline_timer_reschedule() @@ -1492,7 +1494,7 @@ bool DataWriterImpl::deadline_missed() } #ifdef FASTDDS_STATISTICS - writer_listener_.notify_status_observer(statistics::DEADLINE_MISSED); + writer_listener_.notify_status_observer(statistics::StatusKind::DEADLINE_MISSED); #endif //FASTDDS_STATISTICS user_datawriter_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1512,7 +1514,7 @@ ReturnCode_t DataWriterImpl::get_offered_deadline_missed_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1523,7 +1525,7 @@ ReturnCode_t DataWriterImpl::get_offered_deadline_missed_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::offered_deadline_missed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( @@ -1531,7 +1533,7 @@ ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1542,7 +1544,7 @@ ReturnCode_t DataWriterImpl::get_offered_incompatible_qos_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::offered_incompatible_qos(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::lifespan_expired() @@ -1592,7 +1594,7 @@ ReturnCode_t DataWriterImpl::get_liveliness_lost_status( { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1603,14 +1605,14 @@ ReturnCode_t DataWriterImpl::get_liveliness_lost_status( } user_datawriter_->get_statuscondition().get_impl()->set_status(StatusMask::liveliness_lost(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::assert_liveliness() { if (writer_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (!publisher_->rtps_participant()->wlp()->assert_liveliness( @@ -1619,7 +1621,7 @@ ReturnCode_t DataWriterImpl::assert_liveliness() writer_->get_liveliness_lease_duration())) { EPROSIMA_LOG_ERROR(DATAWRITER, "Could not assert liveliness of writer " << writer_->getGuid()); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } if (qos_.liveliness().kind == MANUAL_BY_TOPIC_LIVELINESS_QOS) @@ -1634,7 +1636,7 @@ ReturnCode_t DataWriterImpl::assert_liveliness() stateful_writer->send_periodic_heartbeat(true, true); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } fastrtps::TopicAttributes DataWriterImpl::get_topic_attributes( @@ -1649,7 +1651,6 @@ fastrtps::TopicAttributes DataWriterImpl::get_topic_attributes( topic_att.topicDataType = topic.get_type_name(); topic_att.topicKind = type->m_isGetKeyDefined ? WITH_KEY : NO_KEY; topic_att.auto_fill_type_information = type->auto_fill_type_information(); - topic_att.auto_fill_type_object = type->auto_fill_type_object(); if (type->type_identifier()) { topic_att.type_id = *type->type_identifier(); @@ -1682,7 +1683,7 @@ OfferedIncompatibleQosStatus& DataWriterImpl::update_offered_incompatible_qos( } LivelinessLostStatus& DataWriterImpl::update_liveliness_lost_status( - const fastrtps::LivelinessLostStatus& liveliness_lost_status) + const LivelinessLostStatus& liveliness_lost_status) { liveliness_lost_status_.total_count = liveliness_lost_status.total_count; liveliness_lost_status_.total_count_change += liveliness_lost_status.total_count_change; @@ -1831,7 +1832,7 @@ ReturnCode_t DataWriterImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -1845,17 +1846,17 @@ ReturnCode_t DataWriterImpl::check_qos( if (qos.durability().kind == PERSISTENT_DURABILITY_QOS) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.destination_order().kind == BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (nullptr != PropertyPolicyHelper::find_property(qos.properties(), "fastdds.unique_network_flows")) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "Unique network flows not supported on writers"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } bool is_pull_mode = qos_has_pull_mode_request(qos); if (is_pull_mode) @@ -1863,12 +1864,12 @@ ReturnCode_t DataWriterImpl::check_qos( if (BEST_EFFORT_RELIABILITY_QOS == qos.reliability().kind) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "BEST_EFFORT incompatible with pull mode"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (c_TimeInfinite == qos.reliable_writer_qos().times.heartbeatPeriod) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "Infinite heartbeat period incompatible with pull mode"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (qos.liveliness().kind == AUTOMATIC_LIVELINESS_QOS || @@ -1878,7 +1879,7 @@ ReturnCode_t DataWriterImpl::check_qos( qos.liveliness().lease_duration <= qos.liveliness().announcement_period) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "WRITERQOS: LeaseDuration <= announcement period."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } if (qos.data_sharing().kind() == DataSharingKind::ON && @@ -1886,12 +1887,12 @@ ReturnCode_t DataWriterImpl::check_qos( qos.endpoint().history_memory_policy != PREALLOCATED_WITH_REALLOC_MEMORY_MODE)) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "DATA_SHARING cannot be used with memory policies other than PREALLOCATED."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth <= 0) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth > 0 && qos.resource_limits().max_samples_per_instance > 0 && @@ -1903,7 +1904,7 @@ ReturnCode_t DataWriterImpl::check_qos( "'. Consistency rule: depth <= max_samples_per_instance." << " Effectively using max_samples_per_instance as depth."); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataWriterImpl::check_allocation_consistency( @@ -1915,16 +1916,16 @@ ReturnCode_t DataWriterImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataWriterImpl::can_qos_be_updated( @@ -2127,19 +2128,19 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( switch (qos_.data_sharing().kind()) { case DataSharingKind::OFF: - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::ON: if (is_custom_payload_pool_) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Custom payload pool detected. Cannot force Data sharing usage."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with security protection."); - return ReturnCode_t::RETCODE_NOT_ALLOWED_BY_SECURITY; + return RETCODE_NOT_ALLOWED_BY_SECURITY; } #endif // HAVE_SECURITY @@ -2147,29 +2148,29 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with " << (type_.is_bounded() ? "memory policies other than PREALLOCATED" : "unbounded data types")); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (has_key) { EPROSIMA_LOG_ERROR(DATA_WRITER, "Data sharing cannot be used with keyed data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::AUTO: if (is_custom_payload_pool_) { EPROSIMA_LOG_INFO(DATA_WRITER, "Custom payload pool detected. Data Sharing disabled."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled due to security configuration."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // HAVE_SECURITY @@ -2177,21 +2178,21 @@ ReturnCode_t DataWriterImpl::check_datasharing_compatible( { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled because " << (type_.is_bounded() ? "memory policy is not PREALLOCATED" : "data type is not bounded")); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (has_key) { EPROSIMA_LOG_INFO(DATA_WRITER, "Data sharing disabled because data type is keyed"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; default: EPROSIMA_LOG_ERROR(DATA_WRITER, "Unknown data sharing kind."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/fastdds/publisher/DataWriterImpl.hpp index 98b6119b5df..7e604fe5e49 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.hpp @@ -16,41 +16,34 @@ * @file DataWriterImpl.hpp */ -#ifndef _FASTRTPS_DATAWRITERIMPL_HPP_ -#define _FASTRTPS_DATAWRITERIMPL_HPP_ +#ifndef _FASTDDS_DATAWRITERIMPL_HPP_ +#define _FASTDDS_DATAWRITERIMPL_HPP_ #include +#include #include +#include #include #include #include #include #include #include - #include -#include #include +#include #include #include #include #include #include -#include -#include - -#include - #include #include - #include -#include #include - -using eprosima::fastrtps::types::ReturnCode_t; +#include namespace eprosima { namespace fastrtps { @@ -127,9 +120,9 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * Enable this object. * The required lower layer entities will be created. * - * @pre This method has not previously returned ReturnCode_t::RETCODE_OK + * @pre This method has not previously returned RETCODE_OK * - * @return ReturnCode_t::RETCODE_OK if all the lower layer entities have been correctly created. + * @return RETCODE_OK if all the lower layer entities have been correctly created. * @return Other standard return codes on error. */ virtual ReturnCode_t enable(); @@ -137,8 +130,8 @@ class DataWriterImpl : protected rtps::IReaderDataFilter /** * Check if the preconditions to delete this object are met. * - * @return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET if the preconditions to delete this object are not met. - * @return ReturnCode_t::RETCODE_OK if it is safe to delete this object. + * @return RETCODE_PRECONDITION_NOT_MET if the preconditions to delete this object are not met. + * @return RETCODE_OK if it is safe to delete this object. */ ReturnCode_t check_delete_preconditions(); @@ -148,9 +141,9 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * @param [out] sample Pointer to the sample on the internal pool. * @param [in] initialization How to initialize the loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the type does not support loans. - * @return ReturnCode_t::RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. - * @return ReturnCode_t::RETCODE_OK if a pointer to a sample is successfully obtained. + * @return RETCODE_ILLEGAL_OPERATION when the type does not support loans. + * @return RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. + * @return RETCODE_OK if a pointer to a sample is successfully obtained. */ ReturnCode_t loan_sample( void*& sample, @@ -161,9 +154,9 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * * @param [in,out] sample Pointer to the previously loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the type does not support loans. - * @return ReturnCode_t::RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. - * @return ReturnCode_t::RETCODE_OK if the loan is successfully discarded. + * @return RETCODE_ILLEGAL_OPERATION when the type does not support loans. + * @return RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. + * @return RETCODE_OK if the loan is successfully discarded. */ ReturnCode_t discard_loan( void*& sample); @@ -259,7 +252,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * If `dispose` is `true`, a CacheChange_t with kind set to NOT_ALIVE_DISPOSED is sent. * * @return Returns the operation's result. - * If the operation finishes successfully, ReturnCode_t::RETCODE_OK is returned. + * If the operation finishes successfully, RETCODE_OK is returned. */ ReturnCode_t unregister_instance( void* instance, @@ -280,7 +273,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * If `dispose` is `true`, a CacheChange_t with kind set to NOT_ALIVE_DISPOSED is sent. * * @return Returns the operation's result. - * If the operation finishes successfully, ReturnCode_t::RETCODE_OK is returned. + * If the operation finishes successfully, RETCODE_OK is returned. */ ReturnCode_t unregister_instance_w_timestamp( void* instance, @@ -317,7 +310,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter PublicationMatchedStatus& status); ReturnCode_t get_offered_deadline_missed_status( - fastrtps::OfferedDeadlineMissedStatus& status); + OfferedDeadlineMissedStatus& status); ReturnCode_t get_offered_incompatible_qos_status( OfferedIncompatibleQosStatus& status); @@ -365,7 +358,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter /** * Removes all changes from the History. * @param[out] removed Number of removed elements - * @return ReturnCode_t::RETCODE_OK if correct, ReturnCode_t::RETCODE_ERROR if not. + * @return RETCODE_OK if correct, RETCODE_ERROR if not. */ ReturnCode_t clear_history( size_t* removed); @@ -445,7 +438,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter void on_liveliness_lost( fastrtps::rtps::RTPSWriter* writer, - const fastrtps::LivelinessLostStatus& status) override; + const LivelinessLostStatus& status) override; void on_reader_discovery( fastrtps::rtps::RTPSWriter* writer, @@ -649,7 +642,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter * @return Current liveliness lost status. */ LivelinessLostStatus& update_liveliness_lost_status( - const fastrtps::LivelinessLostStatus& liveliness_lost_status); + const LivelinessLostStatus& liveliness_lost_status); /** * Returns the most appropriate listener to handle the callback for the given status, @@ -745,4 +738,4 @@ class DataWriterImpl : protected rtps::IReaderDataFilter } /* namespace fastdds */ } /* namespace eprosima */ -#endif //_FASTRTPS_DATAWRITERIMPL_HPP_ +#endif //_FASTDDS_DATAWRITERIMPL_HPP_ diff --git a/src/cpp/fastdds/publisher/Publisher.cpp b/src/cpp/fastdds/publisher/Publisher.cpp index 8c7453c14e8..babfd8eb8ef 100644 --- a/src/cpp/fastdds/publisher/Publisher.cpp +++ b/src/cpp/fastdds/publisher/Publisher.cpp @@ -52,17 +52,17 @@ ReturnCode_t Publisher::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_participant()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -75,7 +75,7 @@ ReturnCode_t Publisher::get_qos( PublisherQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Publisher::set_qos( @@ -100,7 +100,7 @@ ReturnCode_t Publisher::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -142,7 +142,7 @@ DataWriter* Publisher::lookup_datawriter( ReturnCode_t Publisher::suspend_publications() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->suspend_publications(); */ @@ -150,7 +150,7 @@ ReturnCode_t Publisher::suspend_publications() ReturnCode_t Publisher::resume_publications() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->resume_publications(); */ @@ -158,7 +158,7 @@ ReturnCode_t Publisher::resume_publications() ReturnCode_t Publisher::begin_coherent_changes() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->begin_coherent_changes(); */ @@ -166,7 +166,7 @@ ReturnCode_t Publisher::begin_coherent_changes() ReturnCode_t Publisher::end_coherent_changes() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->end_coherent_changes(); */ @@ -203,7 +203,7 @@ ReturnCode_t Publisher::get_default_datawriter_qos( DataWriterQos& qos) const { qos = impl_->get_default_datawriter_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Publisher::copy_from_topic_qos( diff --git a/src/cpp/fastdds/publisher/PublisherImpl.cpp b/src/cpp/fastdds/publisher/PublisherImpl.cpp index 9524d69050c..e2f2c896c7a 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.cpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.cpp @@ -18,33 +18,28 @@ */ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include #include -#include #include - -#include +#include +#include #include +#include +#include #include - -#include - -#include - -#include - #ifdef FASTDDS_STATISTICS -#include +#include #endif //FASTDDS_STATISTICS +#include +#include namespace eprosima { namespace fastdds { @@ -54,7 +49,6 @@ using fastrtps::xmlparser::XMLProfileManager; using fastrtps::xmlparser::XMLP_ret; using fastrtps::rtps::InstanceHandle_t; using fastrtps::Duration_t; -using fastrtps::PublisherAttributes; PublisherImpl::PublisherImpl( DomainParticipantImpl* p, @@ -87,7 +81,7 @@ ReturnCode_t PublisherImpl::enable() } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::disable() @@ -139,7 +133,7 @@ ReturnCode_t PublisherImpl::set_qos( if (&qos != &PUBLISHER_QOS_DEFAULT) { ReturnCode_t ret_val = check_qos(qos_to_set); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } @@ -147,7 +141,7 @@ ReturnCode_t PublisherImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -163,7 +157,7 @@ ReturnCode_t PublisherImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherListener* PublisherImpl::get_listener() const @@ -175,7 +169,7 @@ ReturnCode_t PublisherImpl::set_listener( PublisherListener* listener) { listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::PublisherWriterListener::on_publication_matched( @@ -200,7 +194,7 @@ void PublisherImpl::PublisherWriterListener::on_liveliness_lost( void PublisherImpl::PublisherWriterListener::on_offered_deadline_missed( DataWriter* writer, - const fastrtps::OfferedDeadlineMissedStatus& status) + const OfferedDeadlineMissedStatus& status) { if (publisher_->listener_ != nullptr) { @@ -237,7 +231,7 @@ DataWriter* PublisherImpl::create_datawriter( return nullptr; } - if (!DataWriterImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != DataWriterImpl::check_qos_including_resource_limits(qos, type_support)) { return nullptr; } @@ -281,7 +275,7 @@ DataWriter* PublisherImpl::create_datawriter( if (user_publisher_->is_enabled() && qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != writer->enable()) + if (RETCODE_OK != writer->enable()) { delete_datawriter(writer); return nullptr; @@ -315,7 +309,7 @@ ReturnCode_t PublisherImpl::delete_datawriter( { if (user_publisher_ != writer->get_publisher()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::unique_lock lock(mtx_writers_); auto vit = writers_.find(writer->get_topic()->get_name()); @@ -327,7 +321,7 @@ ReturnCode_t PublisherImpl::delete_datawriter( //First extract the writer from the maps to free the mutex DataWriterImpl* writer_impl = *dw_it; ReturnCode_t ret_code = writer_impl->check_delete_preconditions(); - if (!ret_code) + if (RETCODE_OK != ret_code) { return ret_code; } @@ -342,10 +336,10 @@ ReturnCode_t PublisherImpl::delete_datawriter( //Now we can delete it writer_impl->get_topic()->get_impl()->dereference(); delete (writer_impl); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DataWriter* PublisherImpl::lookup_datawriter( @@ -440,16 +434,16 @@ ReturnCode_t PublisherImpl::set_default_datawriter_qos( if (&qos == &DATAWRITER_QOS_DEFAULT) { reset_default_datawriter_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = DataWriterImpl::check_qos(qos); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } DataWriterImpl::set_qos(default_datawriter_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void PublisherImpl::reset_default_datawriter_qos() @@ -466,7 +460,7 @@ const DataWriterQos& PublisherImpl::get_default_datawriter_qos() const return default_datawriter_qos_; } -const ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( +ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( const std::string& profile_name, DataWriterQos& qos) const { @@ -475,10 +469,10 @@ const ReturnCode_t PublisherImpl::get_datawriter_qos_from_profile( { qos = default_datawriter_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t PublisherImpl::copy_from_topic_qos( @@ -498,7 +492,7 @@ ReturnCode_t PublisherImpl::copy_from_topic_qos( writer_qos.lifespan(topic_qos.lifespan()); writer_qos.ownership(topic_qos.ownership()); writer_qos.representation(topic_qos.representation()); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t PublisherImpl::wait_for_acknowledgments( @@ -512,20 +506,20 @@ ReturnCode_t PublisherImpl::wait_for_acknowledgments( for (DataWriterImpl* dw : vit.second) { participant_->get_current_time(begin); - if (!dw->wait_for_acknowledgments(current)) + if (RETCODE_OK != dw->wait_for_acknowledgments(current)) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } // Check ellapsed time and decrement participant_->get_current_time(end); current = current - (end - begin); if (current < fastrtps::c_TimeZero) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipant* PublisherImpl::get_participant() const @@ -541,7 +535,7 @@ const Publisher* PublisherImpl::get_publisher() const ReturnCode_t PublisherImpl::delete_contained_entities() { // Let's be optimistic - ReturnCode_t result = ReturnCode_t::RETCODE_OK; + ReturnCode_t result = RETCODE_OK; bool can_be_deleted = true; @@ -550,10 +544,10 @@ ReturnCode_t PublisherImpl::delete_contained_entities() { for (DataWriterImpl* dw: writer.second) { - can_be_deleted = dw->check_delete_preconditions() == ReturnCode_t::RETCODE_OK; + can_be_deleted = dw->check_delete_preconditions() == RETCODE_OK; if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -566,9 +560,9 @@ ReturnCode_t PublisherImpl::delete_contained_entities() auto it = writer_iterator->second.begin(); DataWriterImpl* writer_impl = *it; ReturnCode_t ret_code = writer_impl->check_delete_preconditions(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } writer_impl->set_listener(nullptr); it = writer_iterator->second.erase(it); @@ -592,7 +586,7 @@ bool PublisherImpl::can_be_deleted() { for (DataWriterImpl* dw : topic_writers.second) { - can_be_deleted = can_be_deleted && (dw->check_delete_preconditions() == ReturnCode_t::RETCODE_OK); + can_be_deleted = can_be_deleted && (dw->check_delete_preconditions() == RETCODE_OK); if (!can_be_deleted) { return can_be_deleted; @@ -655,7 +649,7 @@ ReturnCode_t PublisherImpl::check_qos( const PublisherQos& qos) { (void) qos; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool PublisherImpl::can_qos_be_updated( @@ -693,7 +687,7 @@ bool PublisherImpl::get_monitoring_status( { switch (status._d()) { - case statistics::INCOMPATIBLE_QOS: + case statistics::StatusKind::INCOMPATIBLE_QOS: { OfferedIncompatibleQosStatus incompatible_qos_status; writer->get_offered_incompatible_qos_status(incompatible_qos_status); @@ -710,13 +704,13 @@ bool PublisherImpl::get_monitoring_status( break; } //! TODO - /*case statistics::INCONSISTENT_TOPIC: + /*case statistics::StatusKind::INCONSISTENT_TOPIC: { writer->get_inconsistent_topic_status(); ret = true; break; }*/ - case statistics::LIVELINESS_LOST: + case statistics::StatusKind::LIVELINESS_LOST: { LivelinessLostStatus liveliness_lost_status; writer->get_liveliness_lost_status(liveliness_lost_status); @@ -724,7 +718,7 @@ bool PublisherImpl::get_monitoring_status( ret = true; break; } - case statistics::DEADLINE_MISSED: + case statistics::StatusKind::DEADLINE_MISSED: { DeadlineMissedStatus deadline_missed_status; writer->get_offered_deadline_missed_status(deadline_missed_status); diff --git a/src/cpp/fastdds/publisher/PublisherImpl.hpp b/src/cpp/fastdds/publisher/PublisherImpl.hpp index 8ad109b63ea..06e1b401e1d 100644 --- a/src/cpp/fastdds/publisher/PublisherImpl.hpp +++ b/src/cpp/fastdds/publisher/PublisherImpl.hpp @@ -22,26 +22,23 @@ #define _FASTDDS_PUBLISHERIMPL_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include +#include + +#include +#include +#include +#include #include -#include #include -#include +#include #include -#include -#include -#include - -#include -#include #ifdef FASTDDS_STATISTICS #include #endif // ifdef FASTDDS_STATISTICS -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastrtps { namespace rtps { @@ -67,7 +64,7 @@ class TypeSupport; /** * Class PublisherImpl, contains the actual implementation of the behaviour of the Publisher. - * @ingroup FASTRTPS_MODULE + * @ingroup FASTDDS_MODULE */ class PublisherImpl { @@ -170,7 +167,7 @@ class PublisherImpl const DataWriterQos& get_default_datawriter_qos() const; - const ReturnCode_t get_datawriter_qos_from_profile( + ReturnCode_t get_datawriter_qos_from_profile( const std::string& profile_name, DataWriterQos& qos) const; @@ -244,7 +241,7 @@ class PublisherImpl void on_offered_deadline_missed( DataWriter* writer, - const fastrtps::OfferedDeadlineMissedStatus& status) override; + const OfferedDeadlineMissedStatus& status) override; void on_liveliness_lost( DataWriter* writer, diff --git a/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChange.hpp b/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChange.hpp index 31dc4edad18..4207e652876 100644 --- a/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChange.hpp +++ b/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChange.hpp @@ -21,8 +21,8 @@ #include -#include -#include +#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChangePool.hpp b/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChangePool.hpp index c0d4b07f752..4da89ef4991 100644 --- a/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChangePool.hpp +++ b/src/cpp/fastdds/publisher/filtering/DataWriterFilteredChangePool.hpp @@ -19,7 +19,7 @@ #ifndef _FASTDDS_PUBLISHER_FILTERING_DATAWRITERCHANGEPOOL_HPP_ #define _FASTDDS_PUBLISHER_FILTERING_DATAWRITERCHANGEPOOL_HPP_ -#include +#include #include #include diff --git a/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp b/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp index a1c6684f42b..2ec981b9705 100644 --- a/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp +++ b/src/cpp/fastdds/publisher/filtering/ReaderFilterCollection.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -309,7 +309,7 @@ class ReaderFilterCollection filter_parameters, new_filter); - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { return false; } diff --git a/src/cpp/fastdds/publisher/filtering/ReaderFilterInformation.hpp b/src/cpp/fastdds/publisher/filtering/ReaderFilterInformation.hpp index d4ac5e2b0cb..ac83384fe46 100644 --- a/src/cpp/fastdds/publisher/filtering/ReaderFilterInformation.hpp +++ b/src/cpp/fastdds/publisher/filtering/ReaderFilterInformation.hpp @@ -22,18 +22,18 @@ #include #include +#include + #include #include -#include - namespace eprosima { namespace fastdds { namespace dds { struct ReaderFilterInformation { - fastrtps::string_255 filter_class_name; + fastcdr::string_255 filter_class_name; IContentFilterFactory* filter_factory = nullptr; IContentFilter* filter = nullptr; std::array filter_signature{ { 0 } }; diff --git a/src/cpp/fastdds/publisher/qos/PublisherQos.cpp b/src/cpp/fastdds/publisher/qos/PublisherQos.cpp index 43de23357ce..efee7c46332 100644 --- a/src/cpp/fastdds/publisher/qos/PublisherQos.cpp +++ b/src/cpp/fastdds/publisher/qos/PublisherQos.cpp @@ -24,7 +24,7 @@ namespace eprosima { namespace fastdds { namespace dds { -RTPS_DllAPI const PublisherQos PUBLISHER_QOS_DEFAULT; +FASTDDS_EXPORTED_API const PublisherQos PUBLISHER_QOS_DEFAULT; } /* namespace dds */ diff --git a/src/cpp/fastdds/publisher/qos/WriterQos.cpp b/src/cpp/fastdds/publisher/qos/WriterQos.cpp index 7ebbaea962e..3bf221cc905 100644 --- a/src/cpp/fastdds/publisher/qos/WriterQos.cpp +++ b/src/cpp/fastdds/publisher/qos/WriterQos.cpp @@ -27,7 +27,7 @@ namespace eprosima { namespace fastdds { namespace dds { -//RTPS_DllAPI const WriterQos DATAWRITER_QOS_DEFAULT; +//FASTDDS_EXPORTED_API const WriterQos DATAWRITER_QOS_DEFAULT; WriterQos::WriterQos() { diff --git a/src/cpp/fastdds/subscriber/DataReader.cpp b/src/cpp/fastdds/subscriber/DataReader.cpp index fecd31a07e1..93defebd8a0 100644 --- a/src/cpp/fastdds/subscriber/DataReader.cpp +++ b/src/cpp/fastdds/subscriber/DataReader.cpp @@ -59,16 +59,16 @@ ReturnCode_t DataReader::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_subscriber()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -97,7 +97,7 @@ ReturnCode_t DataReader::read_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return read( @@ -144,7 +144,7 @@ ReturnCode_t DataReader::read_next_instance_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return read_next_instance( @@ -176,7 +176,7 @@ ReturnCode_t DataReader::take_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return take( @@ -223,7 +223,7 @@ ReturnCode_t DataReader::take_next_instance_w_condition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } return take_next_instance( @@ -249,7 +249,7 @@ ReturnCode_t DataReader::get_key_value( { static_cast (key_holder); static_cast (handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } InstanceHandle_t DataReader::lookup_instance( @@ -319,7 +319,7 @@ ReturnCode_t DataReader::get_qos( DataReaderQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReader::get_requested_deadline_missed_status( @@ -345,7 +345,7 @@ ReturnCode_t DataReader::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -397,7 +397,7 @@ ReturnCode_t DataReader::get_matched_publication_data( { static_cast (publication_data); static_cast (publication_handle); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_publication_data(publication_data, publication_handle); */ @@ -407,7 +407,7 @@ ReturnCode_t DataReader::get_matched_publications( std::vector& publication_handles) const { static_cast (publication_handles); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_matched_publication_data(publication_handles); */ @@ -460,7 +460,7 @@ ReturnCode_t DataReader::wait_for_historical_data( const Duration_t& max_wait) const { static_cast (max_wait); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->wait_for_historical_data(a_condition); */ diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp index 194a3b0e860..b9233a7f039 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp @@ -23,6 +23,7 @@ # include #endif // if defined(__has_include) && __has_include() +#include #include #include #include @@ -40,20 +41,19 @@ #include #include #include +#include #include #include #include #include #include -#include -#include -#include #include #include +#include #ifdef FASTDDS_STATISTICS #include -#include +#include #endif //FASTDDS_STATISTICS using eprosima::fastrtps::RecursiveTimedMutex; @@ -62,8 +62,6 @@ using eprosima::fastrtps::c_TimeInfinite; using namespace eprosima::fastrtps::rtps; using namespace std::chrono; -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -118,7 +116,8 @@ DataReaderImpl::DataReaderImpl( endpoint_attributes.setEntityID(qos_.endpoint().entity_id); endpoint_attributes.setUserDefinedID(qos_.endpoint().user_defined_id); RTPSParticipantImpl::preprocess_endpoint_attributes( - EntityId_t::unknown(), subscriber_->get_participant_impl()->id_counter(), endpoint_attributes, guid_.entityId); + fastrtps::rtps::EntityId_t::unknown(), + subscriber_->get_participant_impl()->id_counter(), endpoint_attributes, guid_.entityId); guid_.guidPrefix = subscriber_->get_participant_impl()->guid().guidPrefix; if (payload_pool != nullptr) @@ -215,7 +214,7 @@ ReturnCode_t DataReaderImpl::enable() bool is_datasharing_compatible = false; ReturnCode_t ret_code = check_datasharing_compatible(att, is_datasharing_compatible); - if (ret_code != ReturnCode_t::RETCODE_OK) + if (ret_code != RETCODE_OK) { return ret_code; } @@ -247,7 +246,7 @@ ReturnCode_t DataReaderImpl::enable() { release_payload_pool(); EPROSIMA_LOG_ERROR(DATA_READER, "Problem creating associated Reader"); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } auto content_topic = dynamic_cast(topic_->get_impl()); @@ -303,10 +302,10 @@ ReturnCode_t DataReaderImpl::enable() reader_->setListener(nullptr); stop(); - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataReaderImpl::disable() @@ -402,7 +401,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples // Properties should be the same on both collections if (!collections_have_same_properties(data_values, sample_infos)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } // Check if a loan is required @@ -411,7 +410,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples // Loan not required, input collections should not be already loaned if (false == data_values.has_ownership()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } int32_t collection_max = data_values.maximum(); @@ -426,7 +425,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples { if (max_samples > collection_max) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -437,7 +436,7 @@ ReturnCode_t DataReaderImpl::check_collection_preconditions_and_calc_max_samples max_samples = qos_.reader_resource_limits().max_samples_per_read; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::prepare_loan( @@ -448,7 +447,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( if (0 < data_values.maximum()) { // A loan was not requested - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (max_samples > 0) @@ -457,7 +456,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( size_t num_infos = sample_info_pool_.num_allocated(); if (num_infos == qos_.reader_resource_limits().sample_infos_allocation.maximum) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Limit max_samples to available sample_infos @@ -480,7 +479,7 @@ ReturnCode_t DataReaderImpl::prepare_loan( } if (num_samples == max_resource_samples) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } // Limit max_samples to available samples @@ -494,12 +493,12 @@ ReturnCode_t DataReaderImpl::prepare_loan( // Check if there are enough loans ReturnCode_t code = loan_manager_.get_loan(data_values, sample_infos); - if (!code) + if (RETCODE_OK != code) { return code; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::read_or_take( @@ -516,11 +515,11 @@ ReturnCode_t DataReaderImpl::read_or_take( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } ReturnCode_t code = check_collection_preconditions_and_calc_max_samples(data_values, sample_infos, max_samples); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -532,7 +531,7 @@ ReturnCode_t DataReaderImpl::read_or_take( if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else std::lock_guard _(reader_->getMutex()); @@ -545,16 +544,16 @@ ReturnCode_t DataReaderImpl::read_or_take( { if (exact_instance && !history_.is_instance_present(handle)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } else { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } } code = prepare_loan(data_values, sample_infos, max_samples); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -665,26 +664,26 @@ ReturnCode_t DataReaderImpl::return_loan( if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } // Properties should be the same on both collections if (!collections_have_same_properties(data_values, sample_infos)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } - // They should have a loan + // If there is ownership that means there are no loans, case in which we just return OK if (data_values.has_ownership() == true) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_OK; } std::lock_guard lock(reader_->getMutex()); // Check if they were loaned by this reader ReturnCode_t code = loan_manager_.return_loan(data_values, sample_infos); - if (!code) + if (RETCODE_OK != code) { return code; } @@ -705,7 +704,7 @@ ReturnCode_t DataReaderImpl::return_loan( data_values.unloan(); sample_infos.unloan(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::read_or_take_next_sample( @@ -715,12 +714,12 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (history_.getHistorySize() == 0) { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } #if HAVE_STRICT_REALTIME @@ -730,7 +729,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( if (!lock.try_lock_until(max_blocking_time)) { - return ReturnCode_t::RETCODE_TIMEOUT; + return RETCODE_TIMEOUT; } #else @@ -742,7 +741,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( auto it = history_.lookup_available_instance(HANDLE_NIL, false); if (!it.first) { - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } StackAllocatedSequence data_values; @@ -757,7 +756,7 @@ ReturnCode_t DataReaderImpl::read_or_take_next_sample( } ReturnCode_t code = cmd.return_value(); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { *info = sample_infos[0]; } @@ -786,14 +785,14 @@ ReturnCode_t DataReaderImpl::get_first_untaken_info( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } if (history_.get_first_untaken_info(*info)) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_NO_DATA; + return RETCODE_NO_DATA; } uint64_t DataReaderImpl::get_unread_count( @@ -807,7 +806,7 @@ uint64_t DataReaderImpl::get_unread_count( return ret_val; } -const GUID_t& DataReaderImpl::guid() const +const fastrtps::rtps::GUID_t& DataReaderImpl::guid() const { return guid_; } @@ -852,11 +851,11 @@ ReturnCode_t DataReaderImpl::set_qos( subscriber_->get_participant()->get_qos().allocation().data_limits.max_user_data < qos_to_set.user_data().getValue().size()) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } ReturnCode_t check_result = check_qos_including_resource_limits(qos_to_set, type_); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } @@ -864,7 +863,7 @@ ReturnCode_t DataReaderImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -898,7 +897,7 @@ ReturnCode_t DataReaderImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataReaderQos& DataReaderImpl::get_qos() const @@ -908,9 +907,9 @@ const DataReaderQos& DataReaderImpl::get_qos() const void DataReaderImpl::InnerDataReaderListener::on_data_available( RTPSReader* /*reader*/, - const GUID_t& writer_guid, - const SequenceNumber_t& first_sequence, - const SequenceNumber_t& last_sequence, + const fastrtps::rtps::GUID_t& writer_guid, + const fastrtps::rtps::SequenceNumber_t& first_sequence, + const fastrtps::rtps::SequenceNumber_t& last_sequence, bool& should_notify_individual_changes) { should_notify_individual_changes = false; @@ -951,7 +950,7 @@ void DataReaderImpl::InnerDataReaderListener::onReaderMatched( if (listener != nullptr) { SubscriptionMatchedStatus callback_status; - if (ReturnCode_t::RETCODE_OK == data_reader_->get_subscription_matched_status(callback_status)) + if (RETCODE_OK == data_reader_->get_subscription_matched_status(callback_status)) { listener->on_subscription_matched(data_reader_->user_datareader_, callback_status); } @@ -969,14 +968,14 @@ void DataReaderImpl::InnerDataReaderListener::on_liveliness_changed( if (listener != nullptr) { LivelinessChangedStatus callback_status; - if (data_reader_->get_liveliness_changed_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_liveliness_changed_status(callback_status) == RETCODE_OK) { listener->on_liveliness_changed(data_reader_->user_datareader_, callback_status); } } #ifdef FASTDDS_STATISTICS - notify_status_observer(statistics::LIVELINESS_CHANGED); + notify_status_observer(statistics::StatusKind::LIVELINESS_CHANGED); #endif //FASTDDS_STATISTICS data_reader_->user_datareader_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -992,14 +991,14 @@ void DataReaderImpl::InnerDataReaderListener::on_requested_incompatible_qos( if (listener != nullptr) { RequestedIncompatibleQosStatus callback_status; - if (data_reader_->get_requested_incompatible_qos_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_requested_incompatible_qos_status(callback_status) == RETCODE_OK) { listener->on_requested_incompatible_qos(data_reader_->user_datareader_, callback_status); } } #ifdef FASTDDS_STATISTICS - notify_status_observer(statistics::INCOMPATIBLE_QOS); + notify_status_observer(statistics::StatusKind::INCOMPATIBLE_QOS); #endif //FASTDDS_STATISTICS data_reader_->user_datareader_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1015,14 +1014,14 @@ void DataReaderImpl::InnerDataReaderListener::on_sample_lost( if (listener != nullptr) { SampleLostStatus callback_status; - if (data_reader_->get_sample_lost_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_sample_lost_status(callback_status) == RETCODE_OK) { listener->on_sample_lost(data_reader_->user_datareader_, callback_status); } } #ifdef FASTDDS_STATISTICS - notify_status_observer(statistics::SAMPLE_LOST); + notify_status_observer(statistics::StatusKind::SAMPLE_LOST); #endif //FASTDDS_STATISTICS data_reader_->user_datareader_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1039,7 +1038,7 @@ void DataReaderImpl::InnerDataReaderListener::on_sample_rejected( if (listener != nullptr) { SampleRejectedStatus callback_status; - if (data_reader_->get_sample_rejected_status(callback_status) == ReturnCode_t::RETCODE_OK) + if (data_reader_->get_sample_rejected_status(callback_status) == RETCODE_OK) { listener->on_sample_rejected(data_reader_->user_datareader_, callback_status); } @@ -1065,9 +1064,9 @@ void DataReaderImpl::InnerDataReaderListener::notify_status_observer( #endif //FASTDDS_STATISTICS bool DataReaderImpl::on_data_available( - const GUID_t& writer_guid, - const SequenceNumber_t& first_sequence, - const SequenceNumber_t& last_sequence) + const fastrtps::rtps::GUID_t& writer_guid, + const fastrtps::rtps::SequenceNumber_t& first_sequence, + const fastrtps::rtps::SequenceNumber_t& last_sequence) { bool ret_val = false; @@ -1183,7 +1182,7 @@ ReturnCode_t DataReaderImpl::get_subscription_matched_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1195,7 +1194,7 @@ ReturnCode_t DataReaderImpl::get_subscription_matched_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::subscription_matched(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::deadline_timer_reschedule() @@ -1234,7 +1233,7 @@ bool DataReaderImpl::deadline_missed() } #ifdef FASTDDS_STATISTICS - reader_listener_.notify_status_observer(statistics::DEADLINE_MISSED); + reader_listener_.notify_status_observer(statistics::StatusKind::DEADLINE_MISSED); #endif //FASTDDS_STATISTICS user_datareader_->get_statuscondition().get_impl()->set_status(notify_status, true); @@ -1254,7 +1253,7 @@ ReturnCode_t DataReaderImpl::get_requested_deadline_missed_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1265,7 +1264,7 @@ ReturnCode_t DataReaderImpl::get_requested_deadline_missed_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::requested_deadline_missed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::lifespan_expired() @@ -1317,7 +1316,7 @@ ReturnCode_t DataReaderImpl::set_listener( { std::lock_guard _(listener_mutex_); listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataReaderListener* DataReaderImpl::get_listener() const @@ -1343,7 +1342,7 @@ ReturnCode_t DataReaderImpl::get_liveliness_changed_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1355,7 +1354,7 @@ ReturnCode_t DataReaderImpl::get_liveliness_changed_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::liveliness_changed(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( @@ -1363,7 +1362,7 @@ ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1374,7 +1373,7 @@ ReturnCode_t DataReaderImpl::get_requested_incompatible_qos_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::requested_incompatible_qos(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_sample_lost_status( @@ -1382,7 +1381,7 @@ ReturnCode_t DataReaderImpl::get_sample_lost_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1393,7 +1392,7 @@ ReturnCode_t DataReaderImpl::get_sample_lost_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::sample_lost(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::get_sample_rejected_status( @@ -1401,7 +1400,7 @@ ReturnCode_t DataReaderImpl::get_sample_rejected_status( { if (reader_ == nullptr) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } { @@ -1412,7 +1411,7 @@ ReturnCode_t DataReaderImpl::get_sample_rejected_status( } user_datareader_->get_statuscondition().get_impl()->set_status(StatusMask::sample_rejected(), false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const Subscriber* DataReaderImpl::get_subscriber() const @@ -1488,7 +1487,7 @@ ReturnCode_t DataReaderImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -1502,27 +1501,27 @@ ReturnCode_t DataReaderImpl::check_qos( if (qos.durability().kind == PERSISTENT_DURABILITY_QOS) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.destination_order().kind == BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (qos.reader_resource_limits().max_samples_per_read <= 0) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples_per_read should be strictly possitive"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos_has_unique_network_request(qos) && qos_has_specific_locators(qos)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "unique_network_request cannot be set along specific locators"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth <= 0) { EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth > 0 && qos.resource_limits().max_samples_per_instance > 0 && @@ -1534,7 +1533,7 @@ ReturnCode_t DataReaderImpl::check_qos( "'. Consistency rule: depth <= max_samples_per_instance." << " Effectively using max_samples_per_instance as depth."); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::check_allocation_consistency( @@ -1546,16 +1545,16 @@ ReturnCode_t DataReaderImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool DataReaderImpl::can_qos_be_updated( @@ -1780,7 +1779,6 @@ fastrtps::TopicAttributes DataReaderImpl::topic_attributes() const { topic_att.type_information = *type_->type_information(); } - topic_att.auto_fill_type_object = type_->auto_fill_type_object(); topic_att.auto_fill_type_information = type_->auto_fill_type_information(); return topic_att; @@ -1875,58 +1873,58 @@ ReturnCode_t DataReaderImpl::check_datasharing_compatible( switch (qos_.data_sharing().kind()) { case DataSharingKind::OFF: - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::ON: #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_ERROR(DATA_READER, "Data sharing cannot be used with security protection."); - return ReturnCode_t::RETCODE_NOT_ALLOWED_BY_SECURITY; + return RETCODE_NOT_ALLOWED_BY_SECURITY; } #endif // if HAVE_SECURITY if (!type_.is_bounded()) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing cannot be used with unbounded data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (has_key) { EPROSIMA_LOG_ERROR(DATA_READER, "Data sharing cannot be used with keyed data types"); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; case DataSharingKind::AUTO: #if HAVE_SECURITY if (has_security_enabled) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled due to security configuration."); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } #endif // if HAVE_SECURITY if (!type_.is_bounded()) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled because data type is not bounded"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (has_key) { EPROSIMA_LOG_INFO(DATA_READER, "Data sharing disabled because data type is keyed"); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } is_datasharing_compatible = true; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; break; default: EPROSIMA_LOG_ERROR(DATA_WRITER, "Unknown data sharing kind."); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } @@ -1942,12 +1940,12 @@ ReturnCode_t DataReaderImpl::get_listening_locators( { if (nullptr == reader_) { - return ReturnCode_t::RETCODE_NOT_ENABLED; + return RETCODE_NOT_ENABLED; } locators.assign(reader_->getAttributes().unicastLocatorList); locators.push_back(reader_->getAttributes().multicastLocatorList); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t DataReaderImpl::delete_contained_entities() @@ -1967,7 +1965,7 @@ ReturnCode_t DataReaderImpl::delete_contained_entities() // release the colection read_conditions_.clear(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void DataReaderImpl::filter_has_been_updated() @@ -2091,7 +2089,7 @@ ReadCondition* DataReaderImpl::create_readcondition( auto ret_code = impl->attach_condition(cond); // attach cannot fail in this scenario - assert(!!ret_code); + assert(RETCODE_OK == ret_code); (void)ret_code; return cond; @@ -2102,14 +2100,14 @@ ReturnCode_t DataReaderImpl::delete_readcondition( { if ( nullptr == a_condition ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } detail::ReadConditionImpl* impl = a_condition->get_impl(); if ( nullptr == impl ) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard _(get_conditions_mutex()); @@ -2120,7 +2118,7 @@ ReturnCode_t DataReaderImpl::delete_readcondition( if ( it == read_conditions_.end()) { // The ReadCondition is unknown to this DataReader - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } # ifdef __cpp_lib_enable_shared_from_this @@ -2133,7 +2131,7 @@ ReturnCode_t DataReaderImpl::delete_readcondition( // Detach from the implementation object auto ret_code = impl->detach_condition(a_condition); - if (!!ret_code) + if (RETCODE_OK == ret_code) { // delete the condition delete a_condition; diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp index 857a336a2cf..f3a006160ba 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.hpp @@ -17,14 +17,16 @@ * */ -#ifndef _FASTRTPS_DATAREADERIMPL_HPP_ -#define _FASTRTPS_DATAREADERIMPL_HPP_ +#ifndef _FASTDDS_DATAREADERIMPL_HPP_ +#define _FASTDDS_DATAREADERIMPL_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include +#include #include #include +#include #include #include #include @@ -32,20 +34,18 @@ #include #include #include +#include #include #include #include #include + #include #include #include #include #include #include -#include -#include -#include - #include namespace eprosima { @@ -238,7 +238,7 @@ class DataReaderImpl SubscriptionMatchedStatus& status); ReturnCode_t get_requested_deadline_missed_status( - fastrtps::RequestedDeadlineMissedStatus& status); + RequestedDeadlineMissedStatus& status); ReturnCode_t set_qos( const DataReaderQos& qos); @@ -257,7 +257,7 @@ class DataReaderImpl */ ReturnCode_t get_liveliness_changed_status( - fastrtps::LivelinessChangedStatus& status); + LivelinessChangedStatus& status); ReturnCode_t get_requested_incompatible_qos_status( RequestedIncompatibleQosStatus& status); @@ -280,7 +280,7 @@ class DataReaderImpl * @return RETCODE_OK */ ReturnCode_t get_sample_rejected_status( - fastrtps::SampleRejectedStatus& status); + SampleRejectedStatus& status); const Subscriber* get_subscriber() const; @@ -428,7 +428,7 @@ class DataReaderImpl void on_liveliness_changed( fastrtps::rtps::RTPSReader* reader, - const fastrtps::LivelinessChangedStatus& status) override; + const LivelinessChangedStatus& status) override; void on_requested_incompatible_qos( fastrtps::rtps::RTPSReader* reader, @@ -472,7 +472,7 @@ class DataReaderImpl LivelinessChangedStatus liveliness_changed_status_; //! Requested deadline missed status - fastrtps::RequestedDeadlineMissedStatus deadline_missed_status_; + RequestedDeadlineMissedStatus deadline_missed_status_; //! Requested incompatible QoS status RequestedIncompatibleQosStatus requested_incompatible_qos_status_; @@ -613,7 +613,7 @@ class DataReaderImpl PolicyMask incompatible_policies); LivelinessChangedStatus& update_liveliness_status( - const fastrtps::LivelinessChangedStatus& status); + const LivelinessChangedStatus& status); const SampleLostStatus& update_sample_lost_status( int32_t sample_lost_since_last_update); @@ -660,4 +660,4 @@ class DataReaderImpl } /* namespace eprosima */ #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTRTPS_DATAREADERIMPL_HPP_*/ +#endif /* _FASTDDS_DATAREADERIMPL_HPP_*/ diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp index b563e94bbf0..f47fbc98456 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/DataReaderLoanManager.hpp @@ -24,12 +24,12 @@ #include #include +#include #include #include -#include -#include -#include +#include +#include namespace eprosima { namespace fastdds { @@ -39,7 +39,6 @@ namespace detail { struct DataReaderLoanManager { using SampleInfoSeq = LoanableTypedCollection; - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; explicit DataReaderLoanManager( const DataReaderQos& qos) @@ -84,7 +83,7 @@ struct DataReaderLoanManager result = used_loans_.push_back(tmp); if (nullptr == result) { - return ReturnCode_t::RETCODE_OUT_OF_RESOURCES; + return RETCODE_OUT_OF_RESOURCES; } result->data_values = new LoanableCollection::element_type[max_samples_]; @@ -100,7 +99,7 @@ struct DataReaderLoanManager data_values.loan(result->data_values, max_samples_, 0); sample_infos.loan(result->sample_infos, max_samples_, 0); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t return_loan( @@ -113,13 +112,13 @@ struct DataReaderLoanManager if (!used_loans_.remove(tmp)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } OutstandingLoanItem* result = free_loans_.push_back(tmp); static_cast(result); assert(result != nullptr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } private: diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp index 8b0e49e953b..d13487c7754 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp @@ -22,13 +22,12 @@ #include #include +#include #include #include #include #include -#include - #include #include #include @@ -50,7 +49,6 @@ namespace detail { struct ReadTakeCommand { - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; using history_type = eprosima::fastdds::dds::detail::DataReaderHistory; using CacheChange_t = eprosima::fastrtps::rtps::CacheChange_t; using RTPSReader = eprosima::fastrtps::rtps::RTPSReader; @@ -90,7 +88,7 @@ struct ReadTakeCommand ~ReadTakeCommand() { - if (!data_values_.has_ownership() && ReturnCode_t::RETCODE_NO_DATA == return_value_) + if (!data_values_.has_ownership() && RETCODE_NO_DATA == return_value_) { loan_manager_.return_loan(data_values_, sample_infos_); data_values_.unloan(); @@ -244,7 +242,7 @@ struct ReadTakeCommand * More importantly, the related sample identity should be taken from the related sample identity * in write_params. */ - FASTDDS_TODO_BEFORE(3, 0, "Fill both sample_identity and related_sample_identity with write_params"); + // FASTDDS_TODO_BEFORE(3, 0, "Fill both sample_identity and related_sample_identity with write_params"); info.sample_identity.writer_guid(item->writerGUID); info.sample_identity.sequence_number(item->sequenceNumber); info.related_sample_identity = item->write_params.sample_identity(); @@ -282,7 +280,7 @@ struct ReadTakeCommand bool loop_for_data_; bool finished_ = false; - ReturnCode_t return_value_ = ReturnCode_t::RETCODE_NO_DATA; + ReturnCode_t return_value_ = RETCODE_NO_DATA; LoanableCollection::size_type current_slot_ = 0; @@ -353,7 +351,7 @@ struct ReadTakeCommand } // Mark that some data is available - return_value_ = ReturnCode_t::RETCODE_OK; + return_value_ = RETCODE_OK; ++current_slot_; --remaining_samples_; ret_val = true; diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp index dc5242f9c36..bbef87f718e 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleInfoPool.hpp @@ -27,9 +27,8 @@ #include #include -#include -#include -#include +#include +#include namespace eprosima { namespace fastdds { @@ -38,8 +37,6 @@ namespace detail { struct SampleInfoPool { - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - explicit SampleInfoPool( const DataReaderQos& qos) : free_items_(qos.reader_resource_limits().sample_infos_allocation) diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp index ea6af5ce65c..8d6b179e5ac 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl/SampleLoanManager.hpp @@ -29,9 +29,8 @@ #include #include -#include -#include -#include +#include +#include #include @@ -45,7 +44,6 @@ struct SampleLoanManager using CacheChange_t = eprosima::fastrtps::rtps::CacheChange_t; using IPayloadPool = eprosima::fastrtps::rtps::IPayloadPool; using PoolConfig = eprosima::fastrtps::rtps::PoolConfig; - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; using SampleIdentity = eprosima::fastrtps::rtps::SampleIdentity; using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; diff --git a/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp b/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp index 4a7d99ba7e4..78dde62f233 100644 --- a/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp +++ b/src/cpp/fastdds/subscriber/ReadConditionImpl.hpp @@ -21,11 +21,13 @@ #include #include -#include +#include #include #include #include #include + +#include #include #include @@ -38,8 +40,6 @@ namespace fastdds { namespace dds { namespace detail { -using fastrtps::types::ReturnCode_t; - class ReadConditionImpl : public std::enable_shared_from_this { DataReaderImpl& data_reader_; @@ -149,7 +149,7 @@ class ReadConditionImpl : public std::enable_shared_from_this else if ( *it == pRC ) { // already there - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } else { @@ -163,7 +163,7 @@ class ReadConditionImpl : public std::enable_shared_from_this // associate pRC->impl_ = shared_from_this(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } /** @@ -191,7 +191,7 @@ class ReadConditionImpl : public std::enable_shared_from_this { conditions_.erase_after(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } else { @@ -199,7 +199,7 @@ class ReadConditionImpl : public std::enable_shared_from_this } } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } void set_trigger_value( diff --git a/src/cpp/fastdds/subscriber/Subscriber.cpp b/src/cpp/fastdds/subscriber/Subscriber.cpp index 3eb4faf775d..ff2a03df165 100644 --- a/src/cpp/fastdds/subscriber/Subscriber.cpp +++ b/src/cpp/fastdds/subscriber/Subscriber.cpp @@ -46,17 +46,17 @@ ReturnCode_t Subscriber::enable() { if (enable_) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } if (false == impl_->get_participant()->is_enabled()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } enable_ = true; ReturnCode_t ret_code = impl_->enable(); - enable_ = ReturnCode_t::RETCODE_OK == ret_code; + enable_ = RETCODE_OK == ret_code; return ret_code; } @@ -69,7 +69,7 @@ ReturnCode_t Subscriber::get_qos( SubscriberQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Subscriber::set_qos( @@ -94,7 +94,7 @@ ReturnCode_t Subscriber::set_listener( const StatusMask& mask) { ReturnCode_t ret_val = impl_->set_listener(listener); - if (ret_val == ReturnCode_t::RETCODE_OK) + if (ret_val == RETCODE_OK) { status_mask_ = mask; } @@ -150,7 +150,7 @@ ReturnCode_t Subscriber::get_datareaders( static_cast (sample_states); static_cast (view_states); static_cast (instance_states); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->get_datareaders(readers); */ @@ -163,7 +163,7 @@ bool Subscriber::has_datareaders() const ReturnCode_t Subscriber::begin_access() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->begin_access(); */ @@ -171,7 +171,7 @@ ReturnCode_t Subscriber::begin_access() ReturnCode_t Subscriber::end_access() { - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; /* return impl_->end_access(); */ @@ -207,7 +207,7 @@ ReturnCode_t Subscriber::get_default_datareader_qos( DataReaderQos& qos) const { qos = impl_->get_default_datareader_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Subscriber::get_datareader_qos_from_profile( diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp index b1003634ca6..149b0f9e7af 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.cpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.cpp @@ -16,6 +16,10 @@ * @file SubscriberImpl.cpp * */ + +#include + +#include #include #include #include @@ -23,20 +27,19 @@ #include #include #include +#include #include #include -#include -#include - -#include #include -#include #include #include + #include #ifdef FASTDDS_STATISTICS -#include +#include #endif //FASTDDS_STATISTICS +#include +#include namespace eprosima { namespace fastdds { @@ -47,7 +50,6 @@ using fastrtps::xmlparser::XMLP_ret; using fastrtps::rtps::InstanceHandle_t; using fastrtps::rtps::Property; using fastrtps::Duration_t; -using fastrtps::SubscriberAttributes; SubscriberImpl::SubscriberImpl( DomainParticipantImpl* p, @@ -80,7 +82,7 @@ ReturnCode_t SubscriberImpl::enable() } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void SubscriberImpl::disable() @@ -131,7 +133,7 @@ ReturnCode_t SubscriberImpl::set_qos( if (&qos != &SUBSCRIBER_QOS_DEFAULT) { ReturnCode_t check_result = check_qos(qos_to_set); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } @@ -139,7 +141,7 @@ ReturnCode_t SubscriberImpl::set_qos( if (enabled && !can_qos_be_updated(qos_, qos_to_set)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos_to_set, !enabled); @@ -155,7 +157,7 @@ ReturnCode_t SubscriberImpl::set_qos( } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const SubscriberListener* SubscriberImpl::get_listener() const @@ -167,7 +169,7 @@ ReturnCode_t SubscriberImpl::set_listener( SubscriberListener* listener) { listener_ = listener; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataReaderImpl* SubscriberImpl::create_datareader_impl( @@ -199,7 +201,7 @@ DataReader* SubscriberImpl::create_datareader( return nullptr; } - if (!DataReaderImpl::check_qos_including_resource_limits(qos, type_support)) + if (RETCODE_OK != DataReaderImpl::check_qos_including_resource_limits(qos, type_support)) { return nullptr; } @@ -235,7 +237,7 @@ DataReader* SubscriberImpl::create_datareader( if (user_subscriber_->is_enabled() && qos_.entity_factory().autoenable_created_entities) { - if (ReturnCode_t::RETCODE_OK != reader->enable()) + if (RETCODE_OK != reader->enable()) { delete_datareader(reader); return nullptr; @@ -269,7 +271,7 @@ ReturnCode_t SubscriberImpl::delete_datareader( { if (user_subscriber_ != reader->get_subscriber()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::unique_lock lock(mtx_readers_); auto it = readers_.find(reader->impl_->get_topicdescription()->get_name()); @@ -282,7 +284,7 @@ ReturnCode_t SubscriberImpl::delete_datareader( DataReaderImpl* reader_impl = *dr_it; if (!reader_impl->can_be_deleted(false)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } it->second.erase(dr_it); @@ -295,10 +297,10 @@ ReturnCode_t SubscriberImpl::delete_datareader( //Now we can delete it reader_impl->get_topicdescription()->get_impl()->dereference(); delete (reader_impl); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } DataReader* SubscriberImpl::lookup_datareader( @@ -324,7 +326,7 @@ ReturnCode_t SubscriberImpl::get_datareaders( readers.push_back(dr->user_datareader_); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool SubscriberImpl::has_datareaders() const @@ -361,7 +363,7 @@ ReturnCode_t SubscriberImpl::notify_datareaders() const dr->listener_->on_data_available(dr->user_datareader_); } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t SubscriberImpl::set_default_datareader_qos( @@ -370,17 +372,17 @@ ReturnCode_t SubscriberImpl::set_default_datareader_qos( if (&qos == &DATAREADER_QOS_DEFAULT) { reset_default_datareader_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_result = DataReaderImpl::check_qos(qos); - if (!check_result) + if (RETCODE_OK != check_result) { return check_result; } DataReaderImpl::set_qos(default_datareader_qos_, qos, true); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void SubscriberImpl::reset_default_datareader_qos() @@ -420,7 +422,7 @@ bool SubscriberImpl::contains_entity( return false; } -const ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( +ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( const std::string& profile_name, DataReaderQos& qos) const { @@ -429,10 +431,10 @@ const ReturnCode_t SubscriberImpl::get_datareader_qos_from_profile( { qos = default_datareader_qos_; utils::set_qos_from_attributes(qos, attr); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ReturnCode_t SubscriberImpl::copy_from_topic_qos( @@ -451,7 +453,7 @@ ReturnCode_t SubscriberImpl::copy_from_topic_qos( reader_qos.resource_limits(topic_qos.resource_limits()); reader_qos.ownership(topic_qos.ownership()); reader_qos.type_consistency().representation = topic_qos.representation(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipant* SubscriberImpl::get_participant() const @@ -481,7 +483,7 @@ void SubscriberImpl::SubscriberReaderListener::on_subscription_matched( void SubscriberImpl::SubscriberReaderListener::on_requested_deadline_missed( DataReader* reader, - const fastrtps::RequestedDeadlineMissedStatus& status) + const RequestedDeadlineMissedStatus& status) { if (subscriber_->listener_ != nullptr) { @@ -491,7 +493,7 @@ void SubscriberImpl::SubscriberReaderListener::on_requested_deadline_missed( void SubscriberImpl::SubscriberReaderListener::on_liveliness_changed( DataReader* reader, - const fastrtps::LivelinessChangedStatus& status) + const LivelinessChangedStatus& status) { (void)status; @@ -518,7 +520,7 @@ void SubscriberImpl::SubscriberReaderListener::on_liveliness_changed( void SubscriberImpl::SubscriberReaderListener::on_sample_rejected( DataReader* /*reader*/, - const fastrtps::SampleRejectedStatus& /*status*/) + const SampleRejectedStatus& /*status*/) { /* TODO if (subscriber_->listener_ != nullptr) @@ -603,7 +605,7 @@ ReturnCode_t SubscriberImpl::check_qos( const SubscriberQos& qos) { (void) qos; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool SubscriberImpl::can_qos_be_updated( @@ -629,7 +631,7 @@ SubscriberListener* SubscriberImpl::get_listener_for( ReturnCode_t SubscriberImpl::delete_contained_entities() { // Let's be optimistic - ReturnCode_t result = ReturnCode_t::RETCODE_OK; + ReturnCode_t result = RETCODE_OK; std::lock_guard lock(mtx_readers_); for (auto reader: readers_) @@ -638,7 +640,7 @@ ReturnCode_t SubscriberImpl::delete_contained_entities() { if (!dr->can_be_deleted()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -653,7 +655,7 @@ ReturnCode_t SubscriberImpl::delete_contained_entities() bool ret_code = reader_impl->can_be_deleted(); if (!ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } reader_impl->set_listener(nullptr); it = reader_iterator->second.erase(it); @@ -694,7 +696,7 @@ bool SubscriberImpl::get_monitoring_status( { bool ret = false; std::vector readers; - if (get_datareaders(readers) == ReturnCode_t::RETCODE_OK) + if (get_datareaders(readers) == RETCODE_OK) { for (auto& reader : readers) { @@ -702,7 +704,7 @@ bool SubscriberImpl::get_monitoring_status( { switch (status._d()) { - case statistics::INCOMPATIBLE_QOS: + case statistics::StatusKind::INCOMPATIBLE_QOS: { RequestedIncompatibleQosStatus incompatible_qos_status; reader->get_requested_incompatible_qos_status(incompatible_qos_status); @@ -719,13 +721,13 @@ bool SubscriberImpl::get_monitoring_status( break; } //! TODO - /*case statistics::INCONSISTENT_TOPIC: + /*case statistics::StatusKind::INCONSISTENT_TOPIC: { reader->get_inconsistent_topic_status(); ret = true; break; }*/ - case statistics::LIVELINESS_CHANGED: + case statistics::StatusKind::LIVELINESS_CHANGED: { LivelinessChangedStatus liveliness_changed_status; reader->get_liveliness_changed_status(liveliness_changed_status); @@ -738,7 +740,7 @@ bool SubscriberImpl::get_monitoring_status( ret = true; break; } - case statistics::DEADLINE_MISSED: + case statistics::StatusKind::DEADLINE_MISSED: { DeadlineMissedStatus deadline_missed_status; reader->get_requested_deadline_missed_status(deadline_missed_status); @@ -750,7 +752,7 @@ bool SubscriberImpl::get_monitoring_status( ret = true; break; } - case statistics::SAMPLE_LOST: + case statistics::StatusKind::SAMPLE_LOST: { SampleLostStatus sample_lost_status; reader->get_sample_lost_status(sample_lost_status); diff --git a/src/cpp/fastdds/subscriber/SubscriberImpl.hpp b/src/cpp/fastdds/subscriber/SubscriberImpl.hpp index 3a61940611e..c624ac5bc26 100644 --- a/src/cpp/fastdds/subscriber/SubscriberImpl.hpp +++ b/src/cpp/fastdds/subscriber/SubscriberImpl.hpp @@ -24,19 +24,15 @@ #include #include +#include #include #include #include #include #include -#include -#include #include - -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastrtps { namespace rtps { @@ -62,7 +58,7 @@ class TypeSupport; /** * Class SubscriberImpl, contains the actual implementation of the behaviour of the Subscriber. - * @ingroup FASTRTPS_MODULE + * @ingroup FASTDDS_MODULE */ class SubscriberImpl { @@ -149,7 +145,7 @@ class SubscriberImpl DataReaderQos& get_default_datareader_qos(); - const ReturnCode_t get_datareader_qos_from_profile( + ReturnCode_t get_datareader_qos_from_profile( const std::string& profile_name, DataReaderQos& qos) const; @@ -272,15 +268,15 @@ class SubscriberImpl void on_requested_deadline_missed( DataReader* reader, - const fastrtps::RequestedDeadlineMissedStatus& status) override; + const RequestedDeadlineMissedStatus& status) override; void on_liveliness_changed( DataReader* reader, - const fastrtps::LivelinessChangedStatus& status) override; + const LivelinessChangedStatus& status) override; void on_sample_rejected( DataReader* reader, - const fastrtps::SampleRejectedStatus& status) override; + const SampleRejectedStatus& status) override; void on_requested_incompatible_qos( DataReader* reader, diff --git a/src/cpp/fastdds/subscriber/history/DataReaderHistory.hpp b/src/cpp/fastdds/subscriber/history/DataReaderHistory.hpp index 4feb7842685..71358ed80d9 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderHistory.hpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderHistory.hpp @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include @@ -42,8 +44,7 @@ #include -#include -#include +#include #include "DataReaderHistoryCounters.hpp" #include "DataReaderInstance.hpp" @@ -381,9 +382,9 @@ class DataReaderHistory : public eprosima::fastrtps::rtps::ReaderHistory //!ResourceLimitsQosPolicy values. ResourceLimitsQosPolicy resource_limited_qos_; //!Topic name - fastrtps::string_255 topic_name_; + fastcdr::string_255 topic_name_; //!Type name - fastrtps::string_255 type_name_; + fastcdr::string_255 type_name_; //!Whether the type has keys bool has_keys_; //!TopicDataType diff --git a/src/cpp/fastdds/subscriber/history/DataReaderInstance.hpp b/src/cpp/fastdds/subscriber/history/DataReaderInstance.hpp index 690af13f283..9979a21bf2c 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderInstance.hpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderInstance.hpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include "DataReaderCacheChange.hpp" #include "DataReaderHistoryCounters.hpp" diff --git a/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp b/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp index 67b5dc2e8c3..732d649a16e 100644 --- a/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp +++ b/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp @@ -24,7 +24,7 @@ namespace eprosima { namespace fastdds { namespace dds { -RTPS_DllAPI const SubscriberQos SUBSCRIBER_QOS_DEFAULT; +FASTDDS_EXPORTED_API const SubscriberQos SUBSCRIBER_QOS_DEFAULT; } /* namespace dds */ } /* namespace fastdds */ diff --git a/src/cpp/fastdds/topic/ContentFilteredTopic.cpp b/src/cpp/fastdds/topic/ContentFilteredTopic.cpp index 8320ce0ccef..16f12db6071 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopic.cpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopic.cpp @@ -72,7 +72,7 @@ ReturnCode_t ContentFilteredTopic::get_expression_parameters( { expression_parameters.emplace_back(param.c_str()); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ContentFilteredTopic::set_expression_parameters( diff --git a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp index d8658019b84..3914bee1a7b 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -28,9 +29,7 @@ #include #include #include - -#include -#include +#include namespace eprosima { namespace fastdds { @@ -70,7 +69,7 @@ ReturnCode_t ContentFilteredTopicImpl::set_expression_parameters( EPROSIMA_LOG_ERROR(CONTENT_FILTERED_TOPIC, "Number of expression parameters exceeds maximum allocation limit: " << new_expression_parameters.size() << " > " << pqos.allocation().content_filter.expression_parameters.maximum); - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } LoanableSequence::size_type n_params; @@ -88,7 +87,7 @@ ReturnCode_t ContentFilteredTopicImpl::set_expression_parameters( related_topic->get_type_name().c_str(), type.get(), new_expression, filter_parameters, filter_instance); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { filter_property.expression_parameters.assign(new_expression_parameters.begin(), new_expression_parameters.end()); diff --git a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp index f76a469312a..897854e7cae 100644 --- a/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp +++ b/src/cpp/fastdds/topic/ContentFilteredTopicImpl.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp index a2f083468d0..2157410b245 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp @@ -15,7 +15,6 @@ /** * @file DDSFilterExpression.cpp */ - #include "DDSFilterExpression.hpp" #include @@ -23,17 +22,15 @@ #include #include -#include -#include -#include -#include - #include #include #include -#include "DDSFilterCondition.hpp" +#include +#include +#include +#include "DDSFilterConditionState.hpp" #include "DDSFilterField.hpp" #include "DDSFilterParameter.hpp" @@ -50,7 +47,7 @@ bool DDSFilterExpression::evaluate( static_cast(sample_info); static_cast(reader_guid); - using namespace eprosima::fastrtps::types; + using namespace eprosima::fastdds::dds::xtypes; using namespace eprosima::fastcdr; dyn_data_->clear_all_values(); @@ -64,7 +61,7 @@ bool DDSFilterExpression::evaluate( #endif // FASTCDR_VERSION_MAJOR == 1 ); deser.read_encapsulation(); - dyn_data_->deserialize(deser); + traits::narrow(dyn_data_)->deserialize(deser); } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -76,7 +73,7 @@ bool DDSFilterExpression::evaluate( it != fields.end() && DDSFilterConditionState::UNDECIDED == root->get_state(); ++it) { - if (!it->second->set_value(*dyn_data_)) + if (!it->second->set_value(dyn_data_)) { return false; } @@ -87,21 +84,21 @@ bool DDSFilterExpression::evaluate( void DDSFilterExpression::clear() { - dyn_data_.reset(); - dyn_type_.reset(); + DynamicDataFactory::get_instance()->delete_data(dyn_data_); + DynamicTypeBuilderFactory::get_instance()->delete_type(dyn_type_); parameters.clear(); fields.clear(); root.reset(); } void DDSFilterExpression::set_type( - const eprosima::fastrtps::types::DynamicType_ptr& type) + DynamicType::_ref_type type) { dyn_type_ = type; - dyn_data_.reset(eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(type)); + dyn_data_ = traits::narrow(DynamicDataFactory::get_instance()->create_data(type)); } -} // namespace DDSSQLFilter -} // namespace dds -} // namespace fastdds -} // namespace eprosima +} // namespace DDSSQLFilter +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp index 00bd1eebed6..0a89a18b569 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.hpp @@ -25,14 +25,15 @@ #include #include -#include -#include -#include +#include +#include #include "DDSFilterCondition.hpp" #include "DDSFilterField.hpp" #include "DDSFilterParameter.hpp" +#include "../../xtypes/dynamic_types/DynamicDataImpl.hpp" + namespace eprosima { namespace fastdds { namespace dds { @@ -62,7 +63,7 @@ class DDSFilterExpression final : public IContentFilter * @param [in] type The DynamicType to assign. */ void set_type( - const eprosima::fastrtps::types::DynamicType_ptr& type); + DynamicType::_ref_type type); /// The root condition of the expression tree. std::unique_ptr root; @@ -73,23 +74,10 @@ class DDSFilterExpression final : public IContentFilter private: - class DynDataDeleter - { - - public: - - void operator ()( - eprosima::fastrtps::types::DynamicData* ptr) - { - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->delete_data(ptr); - } - - }; - /// The Dynamic type used to deserialize the payloads - eprosima::fastrtps::types::DynamicType_ptr dyn_type_; + DynamicType::_ref_type dyn_type_; /// The Dynamic data used to deserialize the payloads - std::unique_ptr dyn_data_; + traits::ref_type dyn_data_; }; } // namespace DDSSQLFilter diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp index 6552d303d84..a709ec8daef 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.cpp @@ -15,25 +15,21 @@ /** * @file DDSFilterExpressionParser.cpp */ - #include "DDSFilterExpressionParser.hpp" #include +#include #include - -#include -#include -#include +#include #include "pegtl.hpp" #include "pegtl/contrib/parse_tree.hpp" +#include "DDSFilterField.hpp" #include "DDSFilterGrammar.hpp" #include "DDSFilterParseNode.hpp" - #include "DDSFilterValue.hpp" -#include "DDSFilterField.hpp" namespace eprosima { namespace fastdds { @@ -42,7 +38,7 @@ namespace DDSSQLFilter { namespace parser { using namespace tao::TAO_PEGTL_NAMESPACE; -using namespace eprosima::fastrtps::types; +using namespace eprosima::fastdds::dds::xtypes; #include "DDSFilterExpressionParserImpl/rearrange.hpp" #include "DDSFilterExpressionParserImpl/literal_values.hpp" @@ -97,12 +93,12 @@ using selector = parse_tree::selector < std::unique_ptr parse_filter_expression( const char* expression, - const TypeObject* type_object) + const std::shared_ptr& type_object) { memory_input<> in(expression, ""); try { - CurrentIdentifierState identifier_state { type_object, nullptr, {} }; + CurrentIdentifierState identifier_state { type_object, {}, {} }; return parse_tree::parse< FilterExpressionGrammar, ParseNode, selector >(in, identifier_state); } catch (const parse_error& e) diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.hpp index 0d79a014a14..cbb744e213b 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParser.hpp @@ -21,7 +21,7 @@ #include -#include +#include #include "DDSFilterParseNode.hpp" @@ -42,7 +42,7 @@ namespace parser { */ std::unique_ptr parse_filter_expression( const char* expression, - const eprosima::fastrtps::types::TypeObject* type_object); + const std::shared_ptr& type_object); /** * Performs parsing of a string containing a literal value. diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp index 98412f3191c..dd7b3ea1d08 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpressionParserImpl/identifiers.hpp @@ -21,8 +21,8 @@ struct CurrentIdentifierState { - const TypeObject* type_object; - const TypeIdentifier* current_type; + const std::shared_ptr type_object; + std::shared_ptr current_type; std::vector access_path; }; @@ -49,45 +49,47 @@ struct identifier_processor } static bool type_should_be_indexed( - const TypeIdentifier& ti, - const TypeIdentifier*& out_type, + const xtypes::TypeIdentifier& ti, + std::shared_ptr& out_type, size_t& max_size) { max_size = 0; switch (ti._d()) { - case TI_PLAIN_ARRAY_SMALL: - out_type = ti.array_sdefn().element_identifier(); + case xtypes::TI_PLAIN_ARRAY_SMALL: + out_type = std::make_shared(*ti.array_sdefn().element_identifier()); max_size = process_bounds(ti.array_sdefn().array_bound_seq()); return true; - case TI_PLAIN_ARRAY_LARGE: - out_type = ti.array_ldefn().element_identifier(); + case xtypes::TI_PLAIN_ARRAY_LARGE: + out_type = std::make_shared(*ti.array_ldefn().element_identifier()); max_size = process_bounds(ti.array_ldefn().array_bound_seq()); return true; - case TI_PLAIN_SEQUENCE_SMALL: - out_type = ti.seq_sdefn().element_identifier(); + case xtypes::TI_PLAIN_SEQUENCE_SMALL: + out_type = std::make_shared(*ti.seq_sdefn().element_identifier()); max_size = process_bound(ti.seq_sdefn().bound()); return true; - case TI_PLAIN_SEQUENCE_LARGE: - out_type = ti.seq_ldefn().element_identifier(); + case xtypes::TI_PLAIN_SEQUENCE_LARGE: + out_type = std::make_shared(*ti.seq_ldefn().element_identifier()); max_size = process_bound(ti.seq_ldefn().bound()); return true; + + default: + out_type = std::make_shared(ti); } - out_type = &ti; return false; } static void add_member_access( std::unique_ptr< ParseNode >& n, CurrentIdentifierState& identifier_state, - const CompleteTypeObject& complete) + const xtypes::CompleteTypeObject& complete) { - if (TK_STRUCTURE != complete._d()) + if (xtypes::TK_STRUCTURE != complete._d()) { throw parse_error("trying to access field on a non-struct type", n->begin()); } @@ -95,7 +97,7 @@ struct identifier_processor const ParseNode& name_node = n->left(); std::string name = name_node.content(); size_t member_index; - const CompleteStructMemberSeq& members = complete.struct_type().member_seq(); + const xtypes::CompleteStructMemberSeq& members = complete.struct_type().member_seq(); for (member_index = 0; member_index < members.size(); ++member_index) { if (members[member_index].detail().name() == name) @@ -109,7 +111,7 @@ struct identifier_processor throw parse_error("field not found", name_node.begin()); } - const TypeIdentifier& ti = members[member_index].common().member_type_id(); + const xtypes::TypeIdentifier& ti = members[member_index].common().member_type_id(); bool has_index = n->children.size() > 1; size_t max_size = 0; size_t array_index = std::numeric_limits::max(); @@ -138,58 +140,65 @@ struct identifier_processor } static DDSFilterValue::ValueKind get_value_kind( - const TypeIdentifier& ti, + const xtypes::TypeIdentifier& ti, const position& pos) { switch (ti._d()) { - case TK_BOOLEAN: + case xtypes::TK_BOOLEAN: return DDSFilterValue::ValueKind::BOOLEAN; - case TK_CHAR8: + case xtypes::TK_CHAR8: return DDSFilterValue::ValueKind::CHAR; - case TK_STRING8: - case TI_STRING8_SMALL: - case TI_STRING8_LARGE: + case xtypes::TK_STRING8: + case xtypes::TI_STRING8_SMALL: + case xtypes::TI_STRING8_LARGE: return DDSFilterValue::ValueKind::STRING; - case TK_INT16: - case TK_INT32: - case TK_INT64: + case xtypes::TK_INT8: + case xtypes::TK_INT16: + case xtypes::TK_INT32: + case xtypes::TK_INT64: return DDSFilterValue::ValueKind::SIGNED_INTEGER; - case TK_BYTE: - case TK_UINT16: - case TK_UINT32: - case TK_UINT64: + case xtypes::TK_BYTE: + case xtypes::TK_UINT8: + case xtypes::TK_UINT16: + case xtypes::TK_UINT32: + case xtypes::TK_UINT64: return DDSFilterValue::ValueKind::UNSIGNED_INTEGER; - case TK_FLOAT32: + case xtypes::TK_FLOAT32: return DDSFilterValue::ValueKind::FLOAT_FIELD; - case TK_FLOAT64: + case xtypes::TK_FLOAT64: return DDSFilterValue::ValueKind::DOUBLE_FIELD; - case TK_FLOAT128: + case xtypes::TK_FLOAT128: return DDSFilterValue::ValueKind::LONG_DOUBLE_FIELD; - case EK_COMPLETE: - const TypeObject* type_object = TypeObjectFactory::get_instance()->get_type_object(&ti); - if (TK_ENUM == type_object->complete()._d()) - { - return DDSFilterValue::ValueKind::ENUM; - } - if (TK_ALIAS == type_object->complete()._d()) + case xtypes::EK_COMPLETE: + { + std::shared_ptr type_object = std::make_shared(); + if (RETCODE_OK == DomainParticipantFactory::get_instance()->type_object_registry().get_type_object( + ti, *type_object) && xtypes::EK_COMPLETE == type_object->_d()) { - const TypeIdentifier& aliasedId = - type_object->complete().alias_type().body().common().related_type(); - return get_value_kind(aliasedId, pos); + if (xtypes::TK_ENUM == type_object->complete()._d()) + { + return DDSFilterValue::ValueKind::ENUM; + } + if (xtypes::TK_ALIAS == type_object->complete()._d()) + { + const xtypes::TypeIdentifier& aliasedId = + type_object->complete().alias_type().body().common().related_type(); + return get_value_kind(aliasedId, pos); + } } - break; + } + break; } - throw parse_error("type is not primitive", pos); } @@ -208,23 +217,25 @@ struct identifier_processor // Reset parser state state.access_path.clear(); - state.current_type = nullptr; + state.current_type.reset(); } else { - if (nullptr == state.current_type) + if (!state.current_type) { add_member_access(n, state, state.type_object->complete()); } else { - if (EK_COMPLETE != state.current_type->_d()) + if (xtypes::EK_COMPLETE != state.current_type->_d()) { throw parse_error("trying to access field on a non-complete type", n->begin()); } - const TypeObject* type_object = TypeObjectFactory::get_instance()->get_type_object(state.current_type); - if (nullptr == type_object) + std::shared_ptr type_object = std::make_shared(); + ReturnCode_t ret = DomainParticipantFactory::get_instance()->type_object_registry().get_type_object( + *state.current_type, *type_object); + if (RETCODE_BAD_PARAMETER == ret) { throw parse_error("could not find type object definition", n->begin()); } diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp index 836ab5c73b7..71bb6ab491c 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterFactory.cpp @@ -22,12 +22,15 @@ #include #include +#include #include #include #include - -#include -#include +#include +#include +#include +#include +#include #include "DDSFilterGrammar.hpp" #include "DDSFilterExpressionParser.hpp" @@ -49,31 +52,35 @@ namespace fastdds { namespace dds { namespace DDSSQLFilter { -static IContentFilterFactory::ReturnCode_t transform_enum( +static ReturnCode_t transform_enum( std::shared_ptr& value, - const eprosima::fastrtps::types::TypeIdentifier* type, - const eprosima::fastrtps::string_255& string_value) + const std::shared_ptr& type, + const eprosima::fastcdr::string_255& string_value) { const char* str_value = string_value.c_str(); - auto type_obj = eprosima::fastrtps::types::TypeObjectFactory::get_instance()->get_type_object(type); - for (const auto& enum_value : type_obj->complete().enumerated_type().literal_seq()) + std::shared_ptr type_obj = std::make_shared(); + if (RETCODE_OK == DomainParticipantFactory::get_instance()->type_object_registry().get_type_object(*type, *type_obj) + && type_obj->_d() == xtypes::EK_COMPLETE && type_obj->complete()._d() == xtypes::TK_ENUM) { - if (enum_value.detail().name() == str_value) + for (const auto& enum_value : type_obj->complete().enumerated_type().literal_seq()) { - value->kind = DDSFilterValue::ValueKind::SIGNED_INTEGER; - value->signed_integer_value = enum_value.common().value(); - return IContentFilterFactory::ReturnCode_t::RETCODE_OK; + if (enum_value.detail().name() == str_value) + { + value->kind = DDSFilterValue::ValueKind::SIGNED_INTEGER; + value->signed_integer_value = enum_value.common().value(); + return RETCODE_OK; + } } } - return IContentFilterFactory::ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } -static IContentFilterFactory::ReturnCode_t transform_enums( +static ReturnCode_t transform_enums( std::shared_ptr& left_value, - const eprosima::fastrtps::types::TypeIdentifier* left_type, + const std::shared_ptr& left_type, std::shared_ptr& right_value, - const eprosima::fastrtps::types::TypeIdentifier* right_type) + const std::shared_ptr& right_type) { if ((DDSFilterValue::ValueKind::ENUM == left_value->kind) && (DDSFilterValue::ValueKind::STRING == right_value->kind)) @@ -87,7 +94,7 @@ static IContentFilterFactory::ReturnCode_t transform_enums( return transform_enum(left_value, right_type, left_value->string_value); } - return IContentFilterFactory::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static bool check_value_compatibility( @@ -195,20 +202,20 @@ static DDSFilterPredicate::OperationKind get_predicate_op( struct ExpressionParsingState { - const eprosima::fastrtps::types::TypeObject* type_object; + const std::shared_ptr type_object; const IContentFilterFactory::ParameterSeq& filter_parameters; DDSFilterExpression* filter; }; template<> -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::unique_ptr& condition, const parser::ParseNode& node); template<> -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::shared_ptr& value, const parser::ParseNode& node) @@ -237,7 +244,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree= state.filter_parameters.length()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (state.filter->parameters[node.parameter_index]) @@ -249,17 +256,17 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(); if (!param_value->set_value(state.filter_parameters[node.parameter_index])) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } value = state.filter->parameters[node.parameter_index] = param_value; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } template<> -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::unique_ptr& condition, const parser::ParseNode& node) @@ -267,10 +274,10 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree left; std::shared_ptr right; ReturnCode_t ret = convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { bool ignore_enum = false; if (node.is() || node.is()) @@ -279,7 +286,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree() && (DDSFilterValue::ValueKind::STRING == left->kind)) || (node.right().is() && (DDSFilterValue::ValueKind::STRING == right->kind)))) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ignore_enum = true; @@ -287,18 +294,18 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_treekind) && (DDSFilterValue::ValueKind::ENUM == right->kind)) { - if (node.left().type_id != node.right().type_id) + if (*node.left().type_id != *node.right().type_id) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } } else if (!check_value_compatibility(left->kind, right->kind, ignore_enum)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ret = transform_enums(left, node.left().type_id, right, node.right().type_id); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { condition.reset(new DDSFilterPredicate(get_predicate_op(node), left, right)); } @@ -309,7 +316,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::unique_ptr& condition, const parser::ParseNode& node) @@ -325,7 +332,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( std::shared_ptr field; ReturnCode_t ret = convert_tree(state, field, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { const parser::ParseNode& and_node = node.right(); assert(and_node.is()); @@ -334,28 +341,28 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( std::shared_ptr op2; ret = convert_tree(state, op1, and_node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, op2, and_node.right()); } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { if (!check_value_compatibility(field->kind, op1->kind, false) || !check_value_compatibility(field->kind, op2->kind, false) || !check_value_compatibility(op1->kind, op2->kind, false)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } ret = transform_enums(field, node.left().type_id, op1, and_node.left().type_id); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = transform_enums(field, node.left().type_id, op2, and_node.right().type_id); } } - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { DDSFilterPredicate::OperationKind binary_op = node.is() ? DDSFilterPredicate::OperationKind::LESS_EQUAL : @@ -375,12 +382,12 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( } template<> -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::unique_ptr& condition, const parser::ParseNode& node) { - ReturnCode_t ret = ReturnCode_t::RETCODE_UNSUPPORTED; + ReturnCode_t ret = RETCODE_UNSUPPORTED; DDSFilterCompoundCondition::OperationKind op = DDSFilterCompoundCondition::OperationKind::NOT; std::unique_ptr left; std::unique_ptr right; @@ -394,7 +401,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); } @@ -403,7 +410,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree(state, left, node.left()); - if (ReturnCode_t::RETCODE_OK == ret) + if (RETCODE_OK == ret) { ret = convert_tree(state, right, node.right()); } @@ -413,7 +420,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree -IContentFilterFactory::ReturnCode_t DDSFilterFactory::convert_tree( +ReturnCode_t DDSFilterFactory::convert_tree( ExpressionParsingState& state, std::unique_ptr& condition, const parser::ParseNode& node) @@ -449,7 +456,7 @@ DDSFilterFactory::~DDSFilterFactory() pool.clear(); } -IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( +ReturnCode_t DDSFilterFactory::create_content_filter( const char* filter_class_name, const char* type_name, const TopicDataType* data_type, @@ -457,34 +464,32 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( const IContentFilterFactory::ParameterSeq& filter_parameters, IContentFilter*& filter_instance) { - using eprosima::fastrtps::types::TypeObjectFactory; - static_cast(data_type); - ReturnCode_t ret = ReturnCode_t::RETCODE_UNSUPPORTED; + ReturnCode_t ret = RETCODE_UNSUPPORTED; if (nullptr == filter_expression) { if (nullptr == filter_instance) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } else { - ret = ReturnCode_t::RETCODE_OK; + ret = RETCODE_OK; if (&empty_expression_ != filter_instance) { auto expr = static_cast(filter_instance); auto n_params = static_cast(expr->parameters.size()); if (filter_parameters.length() < n_params) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } else { std::vector old_values(n_params); LoanableCollection::size_type n = n_params; - while ((n > 0) && (ReturnCode_t::RETCODE_OK == ret)) + while ((n > 0) && (RETCODE_OK == ret)) { --n; if (expr->parameters[n]) @@ -492,12 +497,12 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( old_values[n].copy_from(*(expr->parameters[n]), true); if (!expr->parameters[n]->set_value(filter_parameters[n])) { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } } } - if (ReturnCode_t::RETCODE_OK != ret) + if (RETCODE_OK != ret) { while (n < n_params) { @@ -513,46 +518,58 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( { delete_content_filter(filter_class_name, filter_instance); filter_instance = &empty_expression_; - ret = ReturnCode_t::RETCODE_OK; + ret = RETCODE_OK; } else { - auto type_object = TypeObjectFactory::get_instance()->get_type_object(type_name, true); - if (!type_object) + std::shared_ptr type_objects = std::make_shared(); + ret = DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects( + type_name, *type_objects); + if (RETCODE_OK != ret) { EPROSIMA_LOG_ERROR(DDSSQLFILTER, "No TypeObject found for type " << type_name); - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; } else { - auto node = parser::parse_filter_expression(filter_expression, type_object); + auto node = + parser::parse_filter_expression(filter_expression, + std::make_shared(type_objects->complete_type_object)); if (node) { - auto type_id = TypeObjectFactory::get_instance()->get_type_identifier(type_name, true); - auto dyn_type = TypeObjectFactory::get_instance()->build_dynamic_type(type_name, type_id, type_object); - DDSFilterExpression* expr = get_expression(); - expr->set_type(dyn_type); - size_t n_params = filter_parameters.length(); - expr->parameters.reserve(n_params); - while (expr->parameters.size() < n_params) - { - expr->parameters.emplace_back(); - } - ExpressionParsingState state{ type_object, filter_parameters, expr }; - ret = convert_tree(state, expr->root, *(node->children[0])); - if (ReturnCode_t::RETCODE_OK == ret) + DynamicType::_ref_type dyn_type = DynamicTypeBuilderFactory::get_instance()->create_type_w_type_object( + type_objects->complete_type_object)->build(); + if (dyn_type) { - delete_content_filter(filter_class_name, filter_instance); - filter_instance = expr; + DDSFilterExpression* expr = get_expression(); + expr->set_type(dyn_type); + size_t n_params = filter_parameters.length(); + expr->parameters.reserve(n_params); + while (expr->parameters.size() < n_params) + { + expr->parameters.emplace_back(); + } + ExpressionParsingState state{ std::make_shared( + type_objects->complete_type_object), + filter_parameters, expr }; + ret = convert_tree(state, expr->root, *(node->children[0])); + if (RETCODE_OK == ret) + { + delete_content_filter(filter_class_name, filter_instance); + filter_instance = expr; + } + else + { + delete_content_filter(filter_class_name, expr); + } } else { - delete_content_filter(filter_class_name, expr); + ret = RETCODE_BAD_PARAMETER; } } else { - ret = ReturnCode_t::RETCODE_BAD_PARAMETER; + ret = RETCODE_BAD_PARAMETER; } } } @@ -560,7 +577,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::create_content_filter( return ret; } -IContentFilterFactory::ReturnCode_t DDSFilterFactory::delete_content_filter( +ReturnCode_t DDSFilterFactory::delete_content_filter( const char* filter_class_name, IContentFilter* filter_instance) { @@ -568,7 +585,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::delete_content_filter( if (nullptr == filter_instance) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (&empty_expression_ != filter_instance) @@ -577,7 +594,7 @@ IContentFilterFactory::ReturnCode_t DDSFilterFactory::delete_content_filter( expr->clear(); expression_pool_.put(expr); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } // namespace DDSSQLFilter diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp index b83651d0ab1..60033533bdf 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.cpp @@ -22,10 +22,10 @@ #include #include +#include +#include +#include #include -#include -#include -#include #include "DDSFilterPredicate.hpp" #include "DDSFilterValue.hpp" @@ -36,54 +36,52 @@ namespace dds { namespace DDSSQLFilter { bool DDSFilterField::set_value( - eprosima::fastrtps::types::DynamicData& data, + DynamicData::_ref_type data, size_t n) { - using namespace eprosima::fastrtps::types; - uint32_t index = static_cast(access_path_[n].member_index); - auto member_id = data.get_member_id_at_index(index); + auto member_id = data->get_member_id_at_index(index); bool last_step = access_path_.size() - 1 == n; bool ret = false; if (access_path_[n].array_index < MEMBER_ID_INVALID) { - DynamicData* array_data = data.loan_value(member_id); - if (nullptr != array_data) + DynamicData::_ref_type array_data = data->loan_value(member_id); + if (array_data) { member_id = static_cast(access_path_[n].array_index); if (array_data->get_item_count() > member_id) { if (last_step) { - ret = set_value(array_data, member_id); + ret = set_value_using_member_id(array_data, member_id); } else { - DynamicData* struct_data = array_data->loan_value(member_id); - if (nullptr != struct_data) + DynamicData::_ref_type struct_data = array_data->loan_value(member_id); + if (struct_data) { - ret = set_value(*struct_data, n + 1); + ret = set_value(struct_data, n + 1); array_data->return_loaned_value(struct_data); } } } - data.return_loaned_value(array_data); + data->return_loaned_value(array_data); } } else { if (last_step) { - ret = set_value(&data, member_id); + ret = set_value_using_member_id(data, member_id); } else { - DynamicData* struct_data = data.loan_value(member_id); - if (nullptr != struct_data) + DynamicData::_ref_type struct_data = data->loan_value(member_id); + if (struct_data) { - ret = set_value(*struct_data, n + 1); - data.return_loaned_value(struct_data); + ret = set_value(struct_data, n + 1); + data->return_loaned_value(struct_data); } } } @@ -103,93 +101,132 @@ bool DDSFilterField::set_value( return ret; } -bool DDSFilterField::set_value( - const eprosima::fastrtps::types::DynamicData* data, - eprosima::fastrtps::types::MemberId member_id) +bool DDSFilterField::set_value_using_member_id( + DynamicData::_ref_type data, + MemberId member_id) { - using namespace eprosima::fastrtps::types; - - bool ret = true; - try + bool ret = false; + switch (type_id_->_d()) { - switch (type_id_->_d()) - { - case TK_BOOLEAN: - boolean_value = data->get_bool_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_BOOLEAN: + ret = RETCODE_OK == data->get_boolean_value(boolean_value, member_id); + break; - case TK_CHAR8: - char_value = data->get_char8_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_CHAR8: + ret = RETCODE_OK == data->get_char8_value(char_value, member_id); + break; - case TK_STRING8: - case TI_STRING8_SMALL: - case TI_STRING8_LARGE: - string_value = data->get_string_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_STRING8: + case eprosima::fastdds::dds::xtypes::TI_STRING8_SMALL: + case eprosima::fastdds::dds::xtypes::TI_STRING8_LARGE: + { + std::string tmp; + ret = RETCODE_OK == data->get_string_value(tmp, member_id); + string_value = tmp.c_str(); + } + break; - case TK_INT16: - signed_integer_value = data->get_int16_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_INT8: + { + int8_t value8 {0}; + ret = RETCODE_OK == data->get_int8_value(value8, member_id); + signed_integer_value = value8; + } + break; - case TK_INT32: - signed_integer_value = data->get_int32_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_INT16: + { + int16_t value16 {0}; + ret = RETCODE_OK == data->get_int16_value(value16, member_id); + signed_integer_value = value16; + } + break; - case TK_INT64: - signed_integer_value = data->get_int64_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_INT32: + { + int32_t value32 {0}; + ret = RETCODE_OK == data->get_int32_value(value32, member_id); + signed_integer_value = value32; + } + break; - case TK_BYTE: - unsigned_integer_value = data->get_uint8_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_INT64: + ret = RETCODE_OK == data->get_int64_value(signed_integer_value, member_id); + break; - case TK_UINT16: - unsigned_integer_value = data->get_uint16_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_BYTE: + { + fastrtps::rtps::octet byte {0}; + ret = RETCODE_OK == data->get_byte_value(byte, member_id); + unsigned_integer_value = byte; + } + break; - case TK_UINT32: - unsigned_integer_value = data->get_uint32_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_UINT8: + { + uint8_t valueu8 {0}; + ret = RETCODE_OK == data->get_uint8_value(valueu8, member_id); + unsigned_integer_value = valueu8; + } + break; - case TK_UINT64: - unsigned_integer_value = data->get_uint64_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_UINT16: + { + uint16_t valueu16 {0}; + ret = RETCODE_OK == data->get_uint16_value(valueu16, member_id); + unsigned_integer_value = valueu16; + } + break; - case TK_FLOAT32: - float_value = data->get_float32_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_UINT32: + { + uint32_t valueu32 {0}; + ret = RETCODE_OK == data->get_uint32_value(valueu32, member_id); + unsigned_integer_value = valueu32; + } + break; - case TK_FLOAT64: - float_value = data->get_float64_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_UINT64: + ret = RETCODE_OK == data->get_uint64_value(unsigned_integer_value, member_id); + break; - case TK_FLOAT128: - float_value = data->get_float128_value(member_id); - break; + case eprosima::fastdds::dds::xtypes::TK_FLOAT32: + { + float valuef32 {0}; + ret = RETCODE_OK == data->get_float32_value(valuef32, member_id); + float_value = valuef32; + } + break; - case EK_COMPLETE: - { - uint32_t enum_value; - ret = !!data->get_enum_value(enum_value, member_id); - signed_integer_value = enum_value; - break; - } + case eprosima::fastdds::dds::xtypes::TK_FLOAT64: + { + double valuef64 {0}; + ret = RETCODE_OK == data->get_float64_value(valuef64, member_id); + float_value = valuef64; + } + break; - default: - ret = false; - break; + case eprosima::fastdds::dds::xtypes::TK_FLOAT128: + ret = RETCODE_OK == data->get_float128_value(float_value, member_id); + break; + + case eprosima::fastdds::dds::xtypes::EK_COMPLETE: + { + int32_t valueenum {0}; + ret = RETCODE_OK == data->get_int32_value(valueenum, member_id); + signed_integer_value = valueenum; + break; } - } - catch (...) - { - ret = false; + + default: + break; } return ret; } } // namespace DDSSQLFilter + } // namespace dds } // namespace fastdds } // namespace eprosima diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp index 58d2c134ab7..668ba47d9c8 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterField.hpp @@ -23,10 +23,10 @@ #include #include +#include +#include +#include #include -#include -#include -#include #include "DDSFilterPredicate.hpp" #include "DDSFilterValue.hpp" @@ -64,7 +64,7 @@ class DDSFilterField final : public DDSFilterValue * @param[in] data_kind Kind of data the field represents. */ DDSFilterField( - const eprosima::fastrtps::types::TypeIdentifier* type_id, + const std::shared_ptr& type_id, const std::vector& access_path, ValueKind data_kind) : DDSFilterValue(data_kind) @@ -104,7 +104,7 @@ class DDSFilterField final : public DDSFilterValue * @post Method @c has_value returns true. */ inline bool set_value( - eprosima::fastrtps::types::DynamicData& data_value) + DynamicData::_ref_type data_value) { return set_value(data_value, 0); } @@ -120,7 +120,7 @@ class DDSFilterField final : public DDSFilterValue * @post Method @c has_value returns true. */ bool set_value( - eprosima::fastrtps::types::DynamicData& data, + DynamicData::_ref_type data, size_t n); protected: @@ -134,13 +134,13 @@ class DDSFilterField final : public DDSFilterValue private: - bool set_value( - const eprosima::fastrtps::types::DynamicData* data, - eprosima::fastrtps::types::MemberId member_id); + bool set_value_using_member_id( + DynamicData::_ref_type data, + MemberId member_id); bool has_value_ = false; std::vector access_path_; - const eprosima::fastrtps::types::TypeIdentifier* type_id_ = nullptr; + const std::shared_ptr type_id_; std::unordered_set parents_; }; diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterParseNode.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterParseNode.hpp index 777974354ec..da2344120fe 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterParseNode.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterParseNode.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include "pegtl/contrib/parse_tree.hpp" @@ -45,7 +45,7 @@ struct ParseNode : parse_tree::basic_node< ParseNode > // When the node is a fieldname, it will hold the access path to the field, the data kind, and the type id std::vector field_access_path; DDSFilterValue::ValueKind field_kind = DDSFilterValue::ValueKind::STRING; - const eprosima::fastrtps::types::TypeIdentifier* type_id = nullptr; + std::shared_ptr type_id; // When the node is a parameter, it will hold the parameter index int32_t parameter_index = 0; diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.cpp index 9bb404ebc7c..5377b15f988 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.cpp @@ -34,7 +34,7 @@ int compare_values( T rvalue) { return lvalue < rvalue ? -1 : - lvalue > rvalue ? 1 : 0; + lvalue > rvalue ? 1 : 0; } /** @@ -140,7 +140,7 @@ static long double to_float( */ static void to_string_value( const DDSFilterValue& in, - eprosima::fastrtps::string_255& out) + eprosima::fastcdr::string_255& out) { assert(DDSFilterValue::ValueKind::CHAR == in.kind); out.assign(&in.char_value, 1); @@ -268,7 +268,7 @@ int DDSFilterValue::compare( case ValueKind::STRING: { - eprosima::fastrtps::string_255 rvalue; + eprosima::fastcdr::string_255 rvalue; to_string_value(rhs, rvalue); return std::strcmp(lhs.string_value.c_str(), rvalue.c_str()); } @@ -332,7 +332,7 @@ bool DDSFilterValue::is_like( { assert(other.regular_expr_); - eprosima::fastrtps::string_255 char_string_value; + eprosima::fastcdr::string_255 char_string_value; switch (kind) { diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.hpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.hpp index da75c7372ec..7add3f48659 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.hpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterValue.hpp @@ -19,11 +19,11 @@ #ifndef _FASTDDS_TOPIC_DDSSQLFILTER_DDSFILTERVALUE_HPP_ #define _FASTDDS_TOPIC_DDSSQLFILTER_DDSFILTERVALUE_HPP_ +#include + #include #include -#include - namespace eprosima { namespace fastdds { namespace dds { @@ -70,7 +70,7 @@ class DDSFilterValue int64_t signed_integer_value; ///< Value when kind == SIGNED_INTEGER / ENUM uint64_t unsigned_integer_value; ///< Value when kind == UNSIGNED_INTEGER long double float_value; ///< Value when kind == FLOAT - eprosima::fastrtps::string_255 string_value; ///< Value when kind == STRING + eprosima::fastcdr::string_255 string_value; ///< Value when kind == STRING }; /** diff --git a/src/cpp/fastdds/topic/Topic.cpp b/src/cpp/fastdds/topic/Topic.cpp index ed8975170b5..58f88aa9fbf 100644 --- a/src/cpp/fastdds/topic/Topic.cpp +++ b/src/cpp/fastdds/topic/Topic.cpp @@ -64,7 +64,7 @@ ReturnCode_t Topic::get_qos( TopicQos& qos) const { qos = impl_->get_qos(); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t Topic::set_qos( @@ -83,7 +83,7 @@ ReturnCode_t Topic::set_listener( const StatusMask& mask) { impl_->set_listener(listener, mask); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipant* Topic::get_participant() const @@ -96,7 +96,7 @@ ReturnCode_t Topic::get_inconsistent_topic_status( { // TODO: return impl_->get_inconsistent_topic_status(status); (void)status; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } TopicDescriptionImpl* Topic::get_impl() const diff --git a/src/cpp/fastdds/topic/TopicDataType.cpp b/src/cpp/fastdds/topic/TopicDataType.cpp index ea98abdd27a..e2266c119ef 100644 --- a/src/cpp/fastdds/topic/TopicDataType.cpp +++ b/src/cpp/fastdds/topic/TopicDataType.cpp @@ -20,12 +20,12 @@ #include #include -#include -#include #include -#include -#include +#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -34,7 +34,6 @@ namespace dds { TopicDataType::TopicDataType() : m_typeSize(0) , m_isGetKeyDefined(false) - , auto_fill_type_object_(true) , auto_fill_type_information_(true) { } diff --git a/src/cpp/fastdds/topic/TopicImpl.cpp b/src/cpp/fastdds/topic/TopicImpl.cpp index 4ab7b3e493d..a7b5dc72274 100644 --- a/src/cpp/fastdds/topic/TopicImpl.cpp +++ b/src/cpp/fastdds/topic/TopicImpl.cpp @@ -55,7 +55,7 @@ ReturnCode_t TopicImpl::check_qos_including_resource_limits( const TypeSupport& type) { ReturnCode_t check_qos_return = check_qos(qos); - if (ReturnCode_t::RETCODE_OK == check_qos_return && + if (RETCODE_OK == check_qos_return && type->m_isGetKeyDefined) { check_qos_return = check_allocation_consistency(qos); @@ -69,12 +69,12 @@ ReturnCode_t TopicImpl::check_qos( if (PERSISTENT_DURABILITY_QOS == qos.durability().kind) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "PERSISTENT Durability not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS == qos.destination_order().kind) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "BY SOURCE TIMESTAMP DestinationOrder not supported"); - return ReturnCode_t::RETCODE_UNSUPPORTED; + return RETCODE_UNSUPPORTED; } if (AUTOMATIC_LIVELINESS_QOS == qos.liveliness().kind || MANUAL_BY_PARTICIPANT_LIVELINESS_QOS == qos.liveliness().kind) @@ -83,10 +83,10 @@ ReturnCode_t TopicImpl::check_qos( qos.liveliness().lease_duration <= qos.liveliness().announcement_period) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "lease_duration <= announcement period."); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t TopicImpl::check_allocation_consistency( @@ -98,16 +98,16 @@ ReturnCode_t TopicImpl::check_allocation_consistency( { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be greater than max_instances * max_samples_per_instance"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) && (qos.resource_limits().max_samples > 0)) { EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "max_samples should be infinite when max_instances or max_samples_per_instance are infinite"); - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return RETCODE_INCONSISTENT_POLICY; } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void TopicImpl::set_qos( @@ -144,26 +144,26 @@ ReturnCode_t TopicImpl::set_qos( const TopicQos& default_qos = participant_->get_default_topic_qos(); if (!can_qos_be_updated(qos_, default_qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, default_qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t ret_val = check_qos_including_resource_limits(qos, type_support_); - if (!ret_val) + if (RETCODE_OK != ret_val) { return ret_val; } if (!can_qos_be_updated(qos_, qos)) { - return ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + return RETCODE_IMMUTABLE_POLICY; } set_qos(qos_, qos, false); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const TopicListener* TopicImpl::get_listener() const diff --git a/src/cpp/fastdds/topic/TopicImpl.hpp b/src/cpp/fastdds/topic/TopicImpl.hpp index f02dcfe20cd..b07c79fae64 100644 --- a/src/cpp/fastdds/topic/TopicImpl.hpp +++ b/src/cpp/fastdds/topic/TopicImpl.hpp @@ -21,13 +21,11 @@ #define _FASTDDS_TOPICIMPL_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#include #include #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastdds { diff --git a/src/cpp/fastdds/topic/TopicProxy.hpp b/src/cpp/fastdds/topic/TopicProxy.hpp index 1c455402fe9..5e108be3fca 100644 --- a/src/cpp/fastdds/topic/TopicProxy.hpp +++ b/src/cpp/fastdds/topic/TopicProxy.hpp @@ -23,18 +23,15 @@ #include #include +#include #include #include #include #include -#include - #include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { diff --git a/src/cpp/fastdds/topic/TopicProxyFactory.cpp b/src/cpp/fastdds/topic/TopicProxyFactory.cpp index dd5e1af58f5..e4e89d6d036 100644 --- a/src/cpp/fastdds/topic/TopicProxyFactory.cpp +++ b/src/cpp/fastdds/topic/TopicProxyFactory.cpp @@ -43,10 +43,10 @@ ReturnCode_t TopicProxyFactory::delete_topic( if (it != proxies_.end() && !proxy->is_referenced()) { proxies_.erase(it); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } TopicProxy* TopicProxyFactory::get_topic() diff --git a/src/cpp/fastdds/topic/TopicProxyFactory.hpp b/src/cpp/fastdds/topic/TopicProxyFactory.hpp index d5b13e64604..d70ca038d4c 100644 --- a/src/cpp/fastdds/topic/TopicProxyFactory.hpp +++ b/src/cpp/fastdds/topic/TopicProxyFactory.hpp @@ -25,16 +25,14 @@ #include #include +#include #include #include #include -#include #include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { diff --git a/src/cpp/fastdds/utils/QosConverters.cpp b/src/cpp/fastdds/utils/QosConverters.cpp index bed5ea6f448..a72537c23b8 100644 --- a/src/cpp/fastdds/utils/QosConverters.cpp +++ b/src/cpp/fastdds/utils/QosConverters.cpp @@ -161,6 +161,7 @@ void set_qos_from_attributes( qos.builtin_controllers_sender_thread() = attr.builtin_controllers_sender_thread; qos.timed_events_thread() = attr.timed_events_thread; qos.discovery_server_thread() = attr.discovery_server_thread; + qos.typelookup_service_thread() = attr.typelookup_service_thread; #if HAVE_SECURITY qos.security_log_thread() = attr.security_log_thread; #endif // if HAVE_SECURITY @@ -209,6 +210,7 @@ void set_attributes_from_qos( attr.builtin_controllers_sender_thread = qos.builtin_controllers_sender_thread(); attr.timed_events_thread = qos.timed_events_thread(); attr.discovery_server_thread = qos.discovery_server_thread(); + attr.typelookup_service_thread = qos.typelookup_service_thread(); #if HAVE_SECURITY attr.security_log_thread = qos.security_log_thread(); #endif // if HAVE_SECURITY @@ -240,6 +242,32 @@ void set_qos_from_attributes( qos.presentation() = attr.qos.m_presentation; } +void set_qos_from_attributes( + ReplierQos& qos, + const ReplierAttributes& attr) +{ + qos.service_name = attr.service_name; + qos.request_type = attr.request_type; + qos.reply_type = attr.reply_type; + qos.request_topic_name = attr.request_topic_name; + qos.reply_topic_name = attr.reply_topic_name; + set_qos_from_attributes(qos.writer_qos, attr.publisher); + set_qos_from_attributes(qos.reader_qos, attr.subscriber); +} + +void set_qos_from_attributes( + RequesterQos& qos, + const RequesterAttributes& attr) +{ + qos.service_name = attr.service_name; + qos.request_type = attr.request_type; + qos.reply_type = attr.reply_type; + qos.request_topic_name = attr.request_topic_name; + qos.reply_topic_name = attr.reply_topic_name; + set_qos_from_attributes(qos.writer_qos, attr.publisher); + set_qos_from_attributes(qos.reader_qos, attr.subscriber); +} + } /* namespace utils */ } /* namespace dds */ } /* namespace fastdds */ diff --git a/src/cpp/fastdds/utils/QosConverters.hpp b/src/cpp/fastdds/utils/QosConverters.hpp index 7b89defa50a..4e554775c60 100644 --- a/src/cpp/fastdds/utils/QosConverters.hpp +++ b/src/cpp/fastdds/utils/QosConverters.hpp @@ -21,20 +21,24 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include +#include +#include +#include #include #include #include -#include -#include -#include +#include + +#include +#include +#include +#include namespace eprosima { namespace fastdds { namespace dds { namespace utils { -using fastrtps::PublisherAttributes; -using fastrtps::SubscriberAttributes; using fastrtps::TopicAttributes; /** @@ -115,9 +119,30 @@ void set_qos_from_attributes( PublisherQos& qos, const PublisherAttributes& attr); +/** + * Obtains the ReplierQos from the ReplierAttributes provided. + * + * @param[out] qos Pointer to the QoS to write on + * @param[in] attr Pointer to the attributes from which to obtain data + */ +void set_qos_from_attributes( + ReplierQos& qos, + const ReplierAttributes& attr); + +/** + * Obtains the RequesterQos from the RequesterAttributes provided. + * + * @param[out] qos Pointer to the QoS to write on + * @param[in] attr Pointer to the attributes from which to obtain data + */ +void set_qos_from_attributes( + RequesterQos& qos, + const RequesterAttributes& attr); + } /* namespace utils */ } /* namespace dds */ } /* namespace fastdds */ } /* namespace eprosima */ + #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #endif /* _FASTDDS_UTILS_QOS_CONVERTERS_HPP_ */ diff --git a/src/cpp/fastdds/xtypes/CMakeLists.txt b/src/cpp/fastdds/xtypes/CMakeLists.txt new file mode 100644 index 00000000000..79f2199205e --- /dev/null +++ b/src/cpp/fastdds/xtypes/CMakeLists.txt @@ -0,0 +1,114 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#{{{ Interface library for grouping the Dynamic Language Binding source code. + +#{{{ API + +add_library(fastdds-xtypes-dynamic-types-api INTERFACE) + +add_library(fastdds::xtypes::dynamic-types::api ALIAS fastdds-xtypes-dynamic-types-api) + +target_compile_features(fastdds-xtypes-dynamic-types-api INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-dynamic-types-api INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/Types.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp + + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp + + dynamic_types/DynamicDataFactory.cpp + dynamic_types/DynamicTypeBuilderFactory.cpp + ) + +#}}} + +#{{{ Implementation + +add_library(fastdds-xtypes-dynamic-types-impl INTERFACE) + +add_library(fastdds::xtypes::dynamic-types::impl ALIAS fastdds-xtypes-dynamic-types-impl) + +target_compile_features(fastdds-xtypes-dynamic-types-impl INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-dynamic-types-impl INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp + dynamic_types/AnnotationDescriptorImpl.cpp + dynamic_types/AnnotationDescriptorImpl.hpp + dynamic_types/DynamicDataImpl.cpp + dynamic_types/DynamicDataImpl.hpp + dynamic_types/DynamicDataFactoryImpl.cpp + dynamic_types/DynamicDataFactoryImpl.hpp + dynamic_types/DynamicPubSubType.cpp + dynamic_types/DynamicTypeImpl.cpp + dynamic_types/DynamicTypeImpl.hpp + dynamic_types/DynamicTypeBuilderImpl.cpp + dynamic_types/DynamicTypeBuilderImpl.hpp + dynamic_types/DynamicTypeBuilderFactoryImpl.cpp + dynamic_types/DynamicTypeBuilderFactoryImpl.hpp + dynamic_types/DynamicTypeMemberImpl.cpp + dynamic_types/DynamicTypeMemberImpl.hpp + dynamic_types/MemberDescriptorImpl.cpp + dynamic_types/MemberDescriptorImpl.hpp + dynamic_types/TypeDescriptorImpl.cpp + dynamic_types/TypeDescriptorImpl.hpp + dynamic_types/VerbatimTextDescriptorImpl.cpp + dynamic_types/VerbatimTextDescriptorImpl.hpp + ) + +target_link_libraries(fastdds-xtypes-dynamic-types-impl INTERFACE fastdds-xtypes-dynamic-types-api) + +#}}} + +#}}} + +#{{{ Interface library for grouping the TypeObject Representation source code. + +add_library(fastdds-xtypes-type-representation INTERFACE) + +add_library(fastdds::xtypes::type-representation ALIAS fastdds-xtypes-type-representation) + +target_compile_features(fastdds-xtypes-type-representation INTERFACE cxx_std_11) + +target_sources(fastdds-xtypes-type-representation INTERFACE + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/exception/Exception.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp + + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp + ${PROJECT_SOURCE_DIR}/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h + + exception/Exception.cpp + type_representation/dds_xtypes_typeobjectCdrAux.ipp + type_representation/dds_xtypes_typeobjectPubSubTypes.cxx + type_representation/TypeIdentifierWithSizeHashSpecialization.h + type_representation/TypeObjectRegistry.cpp + type_representation/TypeObjectRegistry.hpp + type_representation/TypeObjectUtils.cpp + ) + +#}}} diff --git a/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp new file mode 100644 index 00000000000..1dbc0f849a2 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.cpp @@ -0,0 +1,141 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "AnnotationDescriptorImpl.hpp" + +#include +#include + +#include "DynamicTypeImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t AnnotationDescriptorImpl::get_value( + ObjectName& value, + const ObjectName& key) noexcept +{ + auto it = value_.find(key); + + if (it != value_.end()) + { + value = it->second; + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +ReturnCode_t AnnotationDescriptorImpl::get_all_value( + Parameters& value) noexcept +{ + value = value_; + return RETCODE_OK; +} + +ReturnCode_t AnnotationDescriptorImpl::set_value( + const ObjectName& key, + const ObjectName& value) noexcept +{ + value_[key] = value; + return RETCODE_OK; +} + +ReturnCode_t AnnotationDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t AnnotationDescriptorImpl::copy_from( + const AnnotationDescriptorImpl& descriptor) noexcept +{ + type_ = descriptor.type_; + value_.clear(); + value_ = descriptor.value_; + return RETCODE_OK; +} + +bool AnnotationDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool AnnotationDescriptorImpl::equals( + AnnotationDescriptorImpl& descriptor) noexcept +{ + return (type_ && type_->equals(descriptor.type_)) && + value_ == descriptor.value_; +} + +bool AnnotationDescriptorImpl::is_consistent() noexcept +{ + if (!type_ || type_->get_kind() != TK_ANNOTATION) + { + return false; + } + + auto type_impl {traits::narrow(type_)}; + + for (const auto& param : value_) + { + //{{{ Check the annotation parameter name is valid because it exits in the annotation type descriptor. + const ObjectName* ann_param_value {nullptr}; + traits::ref_type ann_param_type; + for (auto member{type_impl->get_all_members_by_index().cbegin()}; + !ann_param_value && member != type_impl->get_all_members_by_index().cend(); + ++member) + { + if (0 == member->get()->get_name().compare(param.first)) + { + ann_param_value = ¶m.second; + ann_param_type = traits::narrow(member->get()->get_descriptor().type()); + } + } + + if (!ann_param_value) + { + return false; + } + //}}} + + //{{{ Check the parameter value is convertible to its type. + if (!TypeValueConverter::is_string_consistent(ann_param_type->get_kind(), + ann_param_type->get_all_members_by_index(), ann_param_value->to_string())) + { + return false; + } + //}}} + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp new file mode 100644 index 00000000000..c51bb805a81 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp @@ -0,0 +1,90 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_ANNOTATIONDESCRIPTORIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_ANNOTATIONDESCRIPTORIMPL_HPP + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class AnnotationDescriptorImpl : public virtual AnnotationDescriptor +{ + //! Reference to the annotation type. + traits::ref_type type_; + + //! Collection of keys and values. + Parameters value_; + +public: + + AnnotationDescriptorImpl() noexcept = default; + + AnnotationDescriptorImpl( + const AnnotationDescriptorImpl&) noexcept = default; + + AnnotationDescriptorImpl( + AnnotationDescriptorImpl&&) noexcept = default; + + virtual ~AnnotationDescriptorImpl() noexcept = default; + + traits::ref_type type() const noexcept override + { + return type_; + } + + traits::ref_type& type() noexcept override + { + return type_; + } + + void type( + traits::ref_type type) noexcept override + { + type_ = type; + } + + ReturnCode_t get_value( + ObjectName& value, + const ObjectName& key) noexcept override; + + ReturnCode_t get_all_value( + Parameters& value) noexcept override; + + ReturnCode_t set_value( + const ObjectName& key, + const ObjectName& value) noexcept override; + + ReturnCode_t copy_from( + traits::ref_type descriptor) noexcept override; + + ReturnCode_t copy_from( + const AnnotationDescriptorImpl& descriptor) noexcept; + + bool equals( + traits::ref_type descriptor) noexcept override; + + bool equals( + AnnotationDescriptorImpl& descriptor) noexcept; + + bool is_consistent() noexcept override; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_ANNOTATIONDESCRIPTORIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp new file mode 100644 index 00000000000..bc76d3e8545 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactory.cpp @@ -0,0 +1,36 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "DynamicDataFactoryImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicDataFactory::get_instance() +{ + return DynamicDataFactoryImpl::get_instance(); +} + +ReturnCode_t DynamicDataFactory::delete_instance() +{ + // Delegate into the implementation class + return DynamicDataFactoryImpl::delete_instance(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp new file mode 100644 index 00000000000..579b951b898 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.cpp @@ -0,0 +1,60 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicDataFactoryImpl.hpp" + +#include "DynamicDataImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicDataFactoryImpl::instance_; + +traits::ref_type DynamicDataFactoryImpl::get_instance() noexcept +{ + if (!instance_) + { + instance_ = std::make_shared(); + } + + return instance_; +} + +ReturnCode_t DynamicDataFactoryImpl::delete_instance() noexcept +{ + if (!instance_) + { + return RETCODE_BAD_PARAMETER; + } + instance_.reset(); + return RETCODE_OK; +} + +traits::ref_type DynamicDataFactoryImpl::create_data( + traits::ref_type type) noexcept +{ + return std::make_shared(type); +} + +ReturnCode_t DynamicDataFactoryImpl::delete_data( + traits::ref_type& data) noexcept +{ + data.reset(); + return RETCODE_OK; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp new file mode 100644 index 00000000000..4ecb2ef865a --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataFactoryImpl.hpp @@ -0,0 +1,49 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAFACTORYIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAFACTORYIMPL_HPP + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicDataFactoryImpl : public traits::base_type +{ +public: + + static traits::ref_type get_instance() noexcept; + + static ReturnCode_t delete_instance() noexcept; + + traits::ref_type create_data( + traits::ref_type type) noexcept override; + + ReturnCode_t delete_data( + traits::ref_type& data) noexcept override; + + virtual ~DynamicDataFactoryImpl() = default; + +private: + + static traits::ref_type instance_; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAFACTORYIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp new file mode 100644 index 00000000000..7ceb9651d0c --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.cpp @@ -0,0 +1,7083 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicDataImpl.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "common.hpp" +#include "DynamicTypeMemberImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { + +namespace fastcdr { + +//{{{ Specialization templates used by Fast CDR to work with DynamicData. + +template<> +FASTDDS_EXPORTED_API size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const fastdds::dds::traits::ref_type& data, + size_t& current_alignment) +{ + return data->calculate_serialized_size(calculator, current_alignment); +} + +template<> +FASTDDS_EXPORTED_API void serialize( + eprosima::fastcdr::Cdr& scdr, + const fastdds::dds::traits::ref_type& data) +{ + return data->serialize(scdr); +} + +template<> +FASTDDS_EXPORTED_API void deserialize( + eprosima::fastcdr::Cdr& cdr, + fastdds::dds::traits::ref_type& data) +{ + data->deserialize(cdr); +} + +//}}} + +} // namespace fastcdr + +namespace fastdds { +namespace dds { + + +bool is_complex_kind( + TypeKind kind) +{ + switch (kind) + { + case TK_ANNOTATION: + case TK_ARRAY: + case TK_BITMASK: + case TK_BITSET: + case TK_MAP: + case TK_SEQUENCE: + case TK_STRUCTURE: + case TK_UNION: + return true; + default: + return false; + } +} + +void fill_vector_with_dynamic_data( + std::shared_ptr::ref_type>>& vector, + const traits::ref_type& sequence_type) +{ + for (size_t pos = 0; pos < vector->size(); ++pos) + { + if (!vector->at(pos)) + { + vector->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(sequence_type)); + } + } +} + +template +ReturnCode_t clear_sequence_typed_element( + std::shared_ptr& sequence, + TypeKind type_kind, + MemberId id) +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + if (sequence->size() > id) + { + auto it = sequence->erase(sequence->begin() + id); + if (TK_ARRAY == type_kind) + { + sequence->emplace(it); + } + ret_value = RETCODE_OK; + } + return ret_value; +} + +template<> +ReturnCode_t clear_sequence_typed_element( + std::shared_ptr>& sequence, + TypeKind type_kind, + MemberId id) +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + if (sequence->size() > id) + { + auto it = sequence->erase(sequence->begin() + id); + if (TK_ARRAY == type_kind) + { + sequence->insert(it, false); + } + ret_value = RETCODE_OK; + } + return ret_value; +} + +//{{{ Public functions + +DynamicDataImpl::DynamicDataImpl( + traits::ref_type type) noexcept + : type_(traits::narrow(type)) + , enclosing_type_(get_enclosing_type(type_)) +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + for (auto& member : enclosing_type_->get_all_members_by_index()) + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + member->get_descriptor().type()); + traits::ref_type data_impl = traits::narrow(data); + + set_default_value(member, data_impl); + + value_.emplace(member->get_id(), data); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + uint32_t sequence_size {calculate_array_max_elements(type_kind)}; + auto sequence_type = get_enclosing_type( + traits::narrow(enclosing_type_->get_descriptor().element_type())); + + add_sequence_value(sequence_type, sequence_size); + } + else if (TK_BITMASK == type_kind) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + value_.emplace(MEMBER_ID_INVALID, + std::make_shared>(enclosing_type_->get_descriptor().bound().at(0), false)); + } + else if (TK_MAP != type_kind) // Primitives + { + add_value(type_kind, MEMBER_ID_INVALID); + } +} + +ReturnCode_t DynamicDataImpl::clear_all_values() noexcept +{ + return clear_all_values(false); +} + +ReturnCode_t DynamicDataImpl::clear_nonkey_values() noexcept +{ + return clear_all_values(true); +} + +ReturnCode_t DynamicDataImpl::clear_value( + MemberId id) noexcept +{ + ReturnCode_t ret_val = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || TK_SEQUENCE == type_kind) + { + ret_val = clear_sequence_element(type_kind, id); + } + else if (TK_MAP == type_kind) + { + auto key_it = std::find_if(key_to_id_.begin(), key_to_id_.end(), [id]( + const decltype(key_to_id_)::value_type& value) + { + return value.second == id; + }); + + if (key_to_id_.end() != key_it) + { + auto value_it = value_.find(id); + assert(value_it != value_.end()); + + key_to_id_.erase(key_it); + value_.erase(value_it); + ret_val = RETCODE_OK; + } + else + { + assert(value_.end() == value_.find(id)); + } + } + else if (TK_BITMASK == type_kind) + { + assert(1 == value_.size()); + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence->size() == enclosing_type_->get_descriptor().bound().at(0)); + + if (sequence->size() > id) + { + sequence->at(id) = false; + ret_val = RETCODE_OK; + } + } + else if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || 0 == id || selected_union_member_ == id) + { + const auto& members = enclosing_type_->get_all_members(); + auto it_value = value_.find(id); + + if (it_value != value_.end()) + { + const auto it = members.find(it_value->first); + assert(members.end() != it); + auto member = traits::narrow(it->second); + auto data = std::static_pointer_cast(it_value->second); + + data->clear_all_values(); + set_default_value(member, data); + ret_val = RETCODE_OK; + } + } + } + else + { + if (MEMBER_ID_INVALID == id) + { + set_value(""); + ret_val = RETCODE_OK; + } + } + + return ret_val; +} + +traits::ref_type DynamicDataImpl::clone() noexcept +{ + traits::ref_type ret_value = std::make_shared(); + ret_value->type_ = type_; + ret_value->enclosing_type_ = enclosing_type_; + + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + ret_value->selected_union_member_ = selected_union_member_; + for (const auto& value : value_) + { + ret_value->value_.emplace(value.first, std::static_pointer_cast(value.second)->clone()); + + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + ret_value->value_.emplace(value_.cbegin()->first, clone_sequence(element_kind, value_.cbegin()->second)); + } + else if (TK_MAP == type_kind) + { + ret_value->key_to_id_ = key_to_id_; + ret_value->next_map_member_id_ = next_map_member_id_; + + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + for (const auto& value : value_) + { + if (is_complex_kind(element_kind)) + { + ret_value->value_.emplace(value.first, + std::static_pointer_cast(value.second)->clone()); + } + else + { + ret_value->value_.emplace(value.first, clone_primitive(element_kind, value.second)); + } + } + } + else if (TK_BITMASK == type_kind) + { + ret_value->value_.emplace(value_.cbegin()->first, + std::make_shared>(*std::static_pointer_cast>( + value_.cbegin()->second))); + } + else // Primitives + { + ret_value->value_.emplace(value_.cbegin()->first, clone_primitive(type_kind, value_.cbegin()->second)); + } + + return ret_value; +} + +bool DynamicDataImpl::equals( + traits::ref_type other) noexcept +{ + auto other_data = traits::narrow(other); + + if (type_ && other_data->type_ && type_->equals(other_data->type_)) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind) + { + return value_.size() == other_data->value_.size() && + std::equal( + value_.begin(), + value_.end(), + other_data->value_.begin(), + [](const decltype(value_)::value_type& l, const decltype(value_)::value_type& r) + { + return l.first == r.first && std::static_pointer_cast(l.second)->equals( + std::static_pointer_cast(r.second)); + }); + } + else if (TK_UNION == type_kind) + { + return std::static_pointer_cast(value_.at(0))->equals( + std::static_pointer_cast(other_data->value_.at(0))) && + (MEMBER_ID_INVALID == selected_union_member_ || + std::static_pointer_cast(value_.at(selected_union_member_))->equals( + std::static_pointer_cast(other_data->value_.at(selected_union_member_)))); + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + return compare_sequence_values(element_kind, value_.begin()->second, + other_data->value_.begin()->second); + } + else if (TK_MAP == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + assert(key_to_id_.size() == value_.size() && other_data->key_to_id_.size() == other_data->value_.size()); + + return key_to_id_.size() == other_data->key_to_id_.size() && + std::equal( + key_to_id_.begin(), + key_to_id_.end(), + other_data->key_to_id_.begin(), + [&](const decltype(key_to_id_)::value_type& l, const decltype(key_to_id_)::value_type& r) + { + return 0 == l.first.compare(r.first) && + 1 == value_.count(l.second) && + 1 == other_data->value_.count(r.second) && + (is_complex_kind(element_kind) ? + std::static_pointer_cast(value_.at(l.second))->equals( + std::static_pointer_cast(other_data->value_.at(r.second))) : + compare_values(element_kind, value_.at(l.second), other_data->value_.at(r.second))); + }); + } + else if (TK_BITMASK == type_kind) + { + return *(std::static_pointer_cast>(value_.begin()->second)) == + *(std::static_pointer_cast>(other_data->value_.begin()->second)); + } + else // primitives + { + // primitives + return compare_values(type_kind, value_.begin()->second, other_data->value_.begin()->second); + } + } + + return false; +} + +ReturnCode_t DynamicDataImpl::get_descriptor( + traits::ref_type& value, + MemberId id) noexcept +{ + traits::ref_type member; + + if (RETCODE_OK == type_->get_member(member, id)) + { + return member->get_descriptor(value); + } + + return RETCODE_BAD_PARAMETER; +} + +uint32_t DynamicDataImpl::get_item_count() noexcept +{ + uint32_t ret_value {0}; + + TypeKind type_kind = enclosing_type_->get_kind(); + if (TK_ARRAY == type_kind || TK_SEQUENCE == type_kind) + { + ret_value = get_sequence_length(); + } + else if (TK_STRING8 == type_kind) + { + assert(1 == value_.size()); + ret_value = static_cast( + std::static_pointer_cast>(value_.begin()->second)->length()); + } + else if (TK_STRING16 == type_kind) + { + assert(1 == value_.size()); + ret_value = static_cast( + std::static_pointer_cast>(value_.begin()->second)->length()); + } + else if (TK_UNION == type_kind) + { + ret_value = 1 + (MEMBER_ID_INVALID == selected_union_member_ ? 0 : 1); + } + else if (TK_BITMASK == type_kind) + { + auto bits = std::static_pointer_cast>(value_.begin()->second); + ret_value = static_cast(std::count_if(bits->begin(), bits->end(), [](bool bit) + { + return bit; + })); + } + else + { + ret_value = static_cast(value_.size()); + } + + return ret_value; +} + +MemberId DynamicDataImpl::get_member_id_at_index( + uint32_t index) noexcept +{ + MemberId ret_value {MEMBER_ID_INVALID}; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITMASK == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + traits::ref_type member; + if (RETCODE_OK == enclosing_type_->get_member_by_index(member, index)) + { + ret_value = member->get_id(); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind || + TK_STRING8 == type_kind || + TK_STRING16 == type_kind) + { + assert(1 == value_.size()); + if (index < get_item_count()) + { + ret_value = index; + } + } + else if (TK_MAP == type_kind) + { + if (index < key_to_id_.size()) + { + ret_value = std::next(key_to_id_.begin(), index)->second; + } + } + + return ret_value; +} + +MemberId DynamicDataImpl::get_member_id_by_name( + const ObjectName& name) noexcept +{ + MemberId ret_value {MEMBER_ID_INVALID}; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITMASK == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + traits::ref_type member; + if (RETCODE_OK == enclosing_type_->get_member_by_name(member, name)) + { + ret_value = member->get_id(); + } + } + else if (TK_MAP == type_kind) + { + assert(enclosing_type_->get_descriptor().key_element_type()); + auto key_type = traits::narrow( + enclosing_type_->get_descriptor().key_element_type())->resolve_alias_enclosed_type(); + if (TypeValueConverter::is_string_consistent(key_type->get_kind(), key_type->get_all_members_by_index(), + name.to_string())) + { + auto it = key_to_id_.find(name.to_string()); + + if (key_to_id_.end() == it) + { + if (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > key_to_id_.size()) + { + ret_value = next_map_member_id_++; + key_to_id_[name.to_string()] = ret_value; + + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (!is_complex_kind(element_kind)) + { + add_value(element_kind, ret_value); + } + else + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + type_->get_descriptor().element_type()); + value_.emplace(ret_value, data); + } + } + } + else + { + ret_value = it->second; + } + } + } + + return ret_value; +} + +//{{{ Getters + +//{{{ Primitive getters + +ReturnCode_t DynamicDataImpl::get_int32_value( + int32_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint32_value( + uint32_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int8_value( + int8_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint8_value( + uint8_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int16_value( + int16_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint16_value( + uint16_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int64_value( + int64_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint64_value( + uint64_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float32_value( + float& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float64_value( + double& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float128_value( + long double& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char8_value( + char& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char16_value( + wchar_t& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_boolean_value( + bool& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_string_value( + std::string& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +ReturnCode_t DynamicDataImpl::get_wstring_value( + std::wstring& value, + MemberId id) noexcept +{ + return get_value(value, id); +} + +//}}} + +ReturnCode_t DynamicDataImpl::get_complex_value( + traits::ref_type& value, + MemberId id) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (MEMBER_ID_INVALID != id) + { + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || selected_union_member_ == id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value = std::static_pointer_cast(it->second)->clone(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. MemberId not found."); + } + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + value = std::static_pointer_cast(sequence->at(id))->clone(); + return RETCODE_OK; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning a collection of primitives"); + } + } + else if (TK_MAP == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value = std::static_pointer_cast(it->second)->clone(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. MemberId not found."); + } + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting complex value. Invalid MemberId."); + } + + return RETCODE_BAD_PARAMETER; +} + +//{{{ Array getters + +ReturnCode_t DynamicDataImpl::get_int32_values( + Int32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint32_values( + UInt32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int8_values( + Int8Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint8_values( + UInt8Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int16_values( + Int16Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint16_values( + UInt16Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_int64_values( + Int64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_uint64_values( + UInt64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float32_values( + Float32Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float64_values( + Float64Seq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_float128_values( + Float128Seq& value, + MemberId id) noexcept +{ + return get_sequence_values< TK_FLOAT128>(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char8_values( + CharSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_char16_values( + WcharSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_byte_values( + ByteSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_boolean_values( + BooleanSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_string_values( + StringSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +ReturnCode_t DynamicDataImpl::get_wstring_values( + WstringSeq& value, + MemberId id) noexcept +{ + return get_sequence_values(value, id); +} + +//}}} + +//}}} + +traits::ref_type DynamicDataImpl::loan_value( + MemberId id) noexcept +{ + if (MEMBER_ID_INVALID != id) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (std::find(loaned_values_.begin(), loaned_values_.end(), id) == loaned_values_.end()) + { + if (TK_ANNOTATION == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto sp = std::static_pointer_cast(it->second); + + if (TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + + loaned_values_.push_back(id); + return sp; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. MemberId not found."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + loaned_values_.push_back(id); + return sequence->at(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning a collection of primitives"); + } + } + else if (TK_MAP == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (is_complex_kind(element_type->get_kind())) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto sp = std::static_pointer_cast(it->second); + loaned_values_.push_back(id); + return sp; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. MemberId not found."); + } + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. The value has been loaned previously."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error loaning value. Invalid MemberId."); + } + + return {}; +} + +ReturnCode_t DynamicDataImpl::return_loaned_value( + traits::ref_type value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + for (auto loan_it {loaned_values_.begin()}; loan_it != loaned_values_.end(); ++loan_it) + { + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + auto it = value_.find(*loan_it); + if (it != value_.end() && std::static_pointer_cast(it->second) == value) + { + loaned_values_.erase(loan_it); + return RETCODE_OK; + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert((TK_ARRAY == type_kind && sequence->size() > *loan_it) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > *loan_it))); + if (sequence->size() >= *loan_it + 1) + { + if (sequence->at(*loan_it) == value) + { + loaned_values_.erase(loan_it); + return RETCODE_OK; + } + } + } + } + + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error returning loaned Value. The value hasn't been loaned."); + return RETCODE_PRECONDITION_NOT_MET; +} + +//{{{ Setters + +//{{{ Primitive setters + +ReturnCode_t DynamicDataImpl::set_int32_value( + MemberId id, + int32_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint32_value( + MemberId id, + uint32_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int8_value( + MemberId id, + int8_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint8_value( + MemberId id, + uint8_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int16_value( + MemberId id, + int16_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint16_value( + MemberId id, + uint16_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int64_value( + MemberId id, + int64_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint64_value( + MemberId id, + uint64_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float32_value( + MemberId id, + float value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float64_value( + MemberId id, + double value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float128_value( + MemberId id, + long double value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char8_value( + MemberId id, + char value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char16_value( + MemberId id, + wchar_t value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_byte_value( + MemberId id, + eprosima::fastrtps::rtps::octet value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_boolean_value( + MemberId id, + bool value) noexcept +{ + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_string_value( + MemberId id, + const std::string& value) noexcept +{ + if (TK_STRING8 == enclosing_type_->get_kind()) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto bound = enclosing_type_->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && value.length() > bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting string value. The given string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_value(id, value); +} + +ReturnCode_t DynamicDataImpl::set_wstring_value( + MemberId id, + const std::wstring& value) noexcept +{ + if (TK_STRING16 == enclosing_type_->get_kind()) + { + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto bound = enclosing_type_->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && value.length() > bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting string value. The given string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_value(id, value); +} + +//}}} + +ReturnCode_t DynamicDataImpl::set_complex_value( + MemberId id, + traits::ref_type value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (value && id != MEMBER_ID_INVALID) + { + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (TK_UNION != type_kind || 0 != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto data = std::static_pointer_cast(it->second); + + if (data->type_->equals(value->type())) + { + value_.erase(it); + value_.emplace(id, value->clone()); + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. MemberId not found."); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind) // Set new discriminator. + { + set_discriminator_value(id); + } + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (enclosing_type_->get_descriptor().element_type()->equals(value->type()) && + is_complex_kind(element_kind)) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + sequence->resize(id + 1); + } + + auto pos = sequence->begin() + id; + pos = sequence->erase(pos); + sequence->emplace(pos, value->clone()); + ret_value = RETCODE_OK; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + else if (TK_MAP == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (enclosing_type_->get_descriptor().element_type()->equals(value->type()) && + is_complex_kind(element_kind)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + value_.erase(it); + value_.emplace(id, value->clone()); + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting due to the fact that types are different."); + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting complex value. Invalid MemberId."); + } + + return ret_value; +} + +//{{{ Array setters + +ReturnCode_t DynamicDataImpl::set_int32_values( + MemberId id, + const Int32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint32_values( + MemberId id, + const UInt32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int8_values( + MemberId id, + const Int8Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint8_values( + MemberId id, + const UInt8Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int16_values( + MemberId id, + const Int16Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint16_values( + MemberId id, + const UInt16Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_int64_values( + MemberId id, + const Int64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_uint64_values( + MemberId id, + const UInt64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float32_values( + MemberId id, + const Float32Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float64_values( + MemberId id, + const Float64Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_float128_values( + MemberId id, + const Float128Seq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char8_values( + MemberId id, + const CharSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_char16_values( + MemberId id, + const WcharSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_byte_values( + MemberId id, + const ByteSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_boolean_values( + MemberId id, + const BooleanSeq& value) noexcept +{ + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_string_values( + MemberId id, + const StringSeq& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_STRING8 == element_type->get_kind()) + { + assert(1 == element_type->get_descriptor().bound().size()); + auto bound = element_type->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && + value.end() != std::find_if(value.begin(), value.end(), [bound](const std::string& str) + { + return str.length() > bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value. The string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value when element_type is not STRING8."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_sequence_values(id, value); +} + +ReturnCode_t DynamicDataImpl::set_wstring_values( + MemberId id, + const WstringSeq& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_STRING16 == element_type->get_kind()) + { + assert(1 == element_type->get_descriptor().bound().size()); + auto bound = element_type->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) != bound && + value.end() != std::find_if(value.begin(), value.end(), [bound](const std::wstring& str) + { + return str.length() > bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value. The string is greater than the length limit."); + return RETCODE_BAD_PARAMETER; + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error setting an array with a string value when element_type is not STRING16."); + return RETCODE_BAD_PARAMETER; + } + } + + return set_sequence_values(id, value); +} + +//}}} + +//}}} + +traits::ref_type DynamicDataImpl::type() noexcept +{ + return type_; +} + +traits::ref_type DynamicDataImpl::_this() +{ + return shared_from_this(); +} + +//{{{ Encoding/decoding functions + +size_t DynamicDataImpl::calculate_key_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept +{ + size_t calculated_size {0}; + + TypeKind type_kind = enclosing_type_->get_kind(); + + switch (type_kind) + { + default: + calculated_size = calculate_serialized_size(calculator, current_alignment); + break; + case TK_STRUCTURE: + { + bool there_is_keyed_member {false}; + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + if (member_impl->get_descriptor().is_key()) + { + there_is_keyed_member = true; + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + calculated_size += calculator.calculate_member_serialized_size( + member.first, member_data, current_alignment); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error calculating structure member size because it is not found on DynamicData"); + } + } + } + + if (!there_is_keyed_member) + { + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + auto member_type {traits::narrow(member_impl->get_descriptor().type())}; + + //TODO(richiware) For the future support of optionals. Optional member cannot be a keyed member. + if (TK_MAP != member_type->resolve_alias_enclosed_type()->get_kind()) + { + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + calculated_size += calculator.calculate_member_serialized_size( + member.first, member_data, current_alignment); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error calculating structure member size because it is not found on DynamicData"); + } + } + } + } + + break; + } + case TK_UNION: + { + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + calculated_size += calculator.calculate_member_serialized_size( + 0, discriminator_data, current_alignment); + break; + } + } + + return calculated_size; +} + +size_t DynamicDataImpl::calculate_max_serialized_size( + traits::ref_type type, + size_t current_alignment) +{ + size_t initial_alignment {current_alignment}; + + auto type_impl = get_enclosing_type(traits::narrow(type)); + + switch (type_impl->get_kind()) + { + case TK_FLOAT128: + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + break; + case TK_FLOAT64: + case TK_INT64: + case TK_UINT64: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + break; + case TK_FLOAT32: + case TK_INT32: + case TK_UINT32: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + break; + case TK_INT16: + case TK_UINT16: + case TK_CHAR16: + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + break; + case TK_CHAR8: + case TK_BYTE: + case TK_BOOLEAN: + case TK_INT8: + case TK_UINT8: + current_alignment += 1; + break; + case TK_STRING8: + { + size_t max_size = type_impl->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) == max_size) + { + max_size = 255; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + max_size + 1; + break; + } + case TK_STRING16: + { + size_t max_size = type_impl->get_descriptor().bound().at(0); + if (static_cast(LENGTH_UNLIMITED) == max_size) + { + max_size = 255; + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (max_size * 2); + break; + } + case TK_UNION: + { + size_t reset_alignment {0}; + size_t union_max_size_serialized {0}; + if (ExtensibilityKind::FINAL != type_impl->get_descriptor().extensibility_kind()) + { + // For APPENDABLE and MUTABLE, the maximum is the XCDR2 header (DHEADER(0) : Int32). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().discriminator_type(), current_alignment); + + for (auto& member : type_impl->get_all_members_by_index()) + { + + auto member_impl = traits::narrow(member); + reset_alignment = current_alignment; + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind() || + member->get_descriptor().is_optional()) + { + // If member is from a MUTABLE type (or it is optional member) the maximum is XCDR1 LongMemberHeader. + // << ALIGN(4) + // << { FLAG_I + FLAG_M + PID_EXTENDED : UInt16 } + // << { slength=8 : UInt16 } + // << { M.id : <<: UInt32 } + // << { M.value.ssize : UInt32 } + reset_alignment += 2 + 2 + 4 + 4 + eprosima::fastcdr::Cdr::alignment(reset_alignment, 4); + } + + reset_alignment += calculate_max_serialized_size( + member_impl->get_descriptor().type(), reset_alignment); + + if (union_max_size_serialized < reset_alignment) + { + union_max_size_serialized = reset_alignment; + } + } + + current_alignment = union_max_size_serialized; + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind()) + { + // For MUTABLE, extra alignment for the PID_SENTINAL. + current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + break; + } + case TK_BITSET: + { + assert(0 < type_impl->get_all_members_by_index().size()); + auto sum {type_impl->get_all_members_by_index().rbegin()->get()->get_id() + + *type_impl->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + current_alignment += 1; + } + else if (17 > sum) + { + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + else if (33 > sum) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + else + { + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + break; + } + case TK_STRUCTURE: + { + if (ExtensibilityKind::FINAL != type_impl->get_descriptor().extensibility_kind()) + { + // For APPENDABLE and MUTABLE, the maximum is the XCDR2 header (DHEADER(0) : Int32). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + for (auto& member : type_impl->get_all_members_by_index()) + { + auto member_impl = traits::narrow(member); + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind() || + member->get_descriptor().is_optional()) + { + // If member is from a MUTABLE type (or it is optional member) the maximum is XCDR1 LongMemberHeader. + // << ALIGN(4) + // << { FLAG_I + FLAG_M + PID_EXTENDED : UInt16 } + // << { slength=8 : UInt16 } + // << { M.id : <<: UInt32 } + // << { M.value.ssize : UInt32 } + current_alignment += 2 + 2 + 4 + 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + current_alignment += calculate_max_serialized_size( + member_impl->get_descriptor().type(), current_alignment); + } + + if (ExtensibilityKind::MUTABLE == type_impl->get_descriptor().extensibility_kind()) + { + // For MUTABLE, extra alignment for the PID_SENTINAL. + current_alignment += eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + break; + } + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type())); + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + auto dimension {std::accumulate(type_impl->get_descriptor().bound().begin(), + type_impl->get_descriptor().bound().end(), 1, std::multiplies())}; + + assert(0 < dimension); + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < dimension) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (dimension - 1); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type())); + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Sequence length. + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + auto bound {type_impl->get_descriptor().bound().at(0)}; + + if (static_cast(LENGTH_UNLIMITED) != bound) + { + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < bound) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (bound - 1); + } + } + + + break; + } + case TK_MAP: + { + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type_impl->get_descriptor().element_type()))}; + + if (is_complex_kind(element_kind) || + TK_STRING8 == element_kind || + TK_STRING16 == element_kind) + { + // DHEADER if XCDRv2 + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Map length + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + auto bound {type_impl->get_descriptor().bound().at(0)}; + + if (static_cast(LENGTH_UNLIMITED) != bound) + { + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().key_element_type(), current_alignment); + current_alignment += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + + if (1 < bound) + { + auto element_size_after_first = calculate_max_serialized_size( + type_impl->get_descriptor().key_element_type(), current_alignment); + element_size_after_first += calculate_max_serialized_size( + type_impl->get_descriptor().element_type(), current_alignment); + current_alignment += element_size_after_first * (bound - 1); + } + } + + break; + } + case TK_BITMASK: + { + assert(1 == type_impl->get_descriptor().bound().size()); + auto bound = type_impl->get_descriptor().bound().at(0); + + if (9 > bound) + { + current_alignment += 1; + } + else if (17 > bound) + { + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + else if (33 > bound) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + else + { + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + } + break; + default: + break; + } + + return current_alignment - initial_alignment; +} + +size_t DynamicDataImpl::calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept +{ + return calculate_serialized_size(calculator, enclosing_type_, current_alignment); +} + +bool DynamicDataImpl::deserialize( + eprosima::fastcdr::Cdr& cdr) +{ + return deserialize(cdr, enclosing_type_); +} + +void DynamicDataImpl::serialize( + eprosima::fastcdr::Cdr& cdr) const +{ + serialize(cdr, enclosing_type_); +} + +void DynamicDataImpl::serialize_key( + eprosima::fastcdr::Cdr& cdr) const noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + + switch (type_kind) + { + default: + serialize(cdr); + break; + case TK_STRUCTURE: + { + bool there_is_keyed_member {false}; + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + if (member_impl->get_descriptor().is_key()) + { + there_is_keyed_member = true; + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + member_data->serialize_key(cdr); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + } + + if (!there_is_keyed_member) + { + for (auto& member : enclosing_type_->get_all_members()) + { + auto member_impl {traits::narrow(member.second)}; + auto member_type {traits::narrow(member_impl->get_descriptor().type())}; + + if (TK_MAP != member_type->resolve_alias_enclosed_type()->get_kind()) + { + auto it = value_.find(member.first); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + member_data->serialize_key(cdr); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + } + } + + break; + } + case TK_UNION: + { + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + discriminator_data->serialize_key(cdr); + break; + } + } +} + +//}}} + +//}}} + +//{{{ Auxiliary functions + +template +void DynamicDataImpl::apply_bitset_mask( + MemberId member_id, + TypeForKind& value) const noexcept +{ + // Get member index. + assert(enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(member_id)); + const auto member_impl {traits::narrow( + enclosing_type_->get_all_members().at(member_id))}; + const auto member_index {member_impl->get_descriptor().index()}; + const auto bound {enclosing_type_->get_descriptor().bound().at(member_index)}; + uint64_t mask {0XFFFFFFFFFFFFFFFFllu << bound}; + value &= static_cast>(~mask); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +template<> +void DynamicDataImpl::apply_bitset_mask( + MemberId, + TypeForKind&) const noexcept +{ + assert(false); +} + +void DynamicDataImpl::add_sequence_value( + const traits::ref_type& sequence_type, + uint32_t sequence_size) noexcept +{ + if (is_complex_kind(sequence_type->get_kind())) + { + value_.emplace(MEMBER_ID_INVALID, + std::make_shared::ref_type>>(sequence_size)); + auto vector = std::static_pointer_cast ::ref_type >> ( + value_.begin()->second); + fill_vector_with_dynamic_data(vector, sequence_type); + } + else + { + switch (sequence_type->get_kind()) + { + case TK_INT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_INT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT32: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT64: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_FLOAT128: + { + value_.emplace(MEMBER_ID_INVALID, + std::make_shared>(sequence_size)); + } + break; + case TK_CHAR8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_CHAR16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_BOOLEAN: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_BYTE: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_UINT8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_STRING8: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + case TK_STRING16: + { + value_.emplace(MEMBER_ID_INVALID, std::make_shared>(sequence_size)); + } + break; + default: + break; + } + } +} + +std::map>::iterator DynamicDataImpl::add_value( + TypeKind kind, + MemberId id) noexcept +{ + std::map>::iterator ret_value {value_.end()}; + + switch (kind) + { + case TK_INT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_INT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT32: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT64: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_FLOAT128: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_CHAR8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_CHAR16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_BOOLEAN: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_BYTE: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_UINT8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_STRING8: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + case TK_STRING16: + { + ret_value = value_.emplace(id, std::make_shared>()).first; + } + break; + default: + break; + } + + return ret_value; +} + +uint32_t DynamicDataImpl::calculate_array_max_elements( + TypeKind type_kind) noexcept +{ + uint32_t ret_value {0}; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + + if (TK_ARRAY == type_kind) + { + auto bounds_it {enclosing_type_->get_descriptor().bound().cbegin()}; + assert(bounds_it != enclosing_type_->get_descriptor().bound().cend()); + ret_value = *bounds_it; + + while (++bounds_it != enclosing_type_->get_descriptor().bound().cend()) + { + ret_value *= *bounds_it; + } + } + + return ret_value; +} + +ReturnCode_t DynamicDataImpl::clear_all_sequence( + TypeKind type_kind) noexcept +{ + ReturnCode_t ret_value = RETCODE_OK; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + uint32_t sequence_size {calculate_array_max_elements(type_kind)}; + + switch (element_type->get_kind()) + { + case TK_INT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_INT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT32: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT64: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_FLOAT128: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_CHAR8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_CHAR16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_BOOLEAN: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_BYTE: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_UINT8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_STRING8: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + case TK_STRING16: + std::static_pointer_cast>(value_.begin()->second)->clear(); + std::static_pointer_cast>(value_.begin()->second)->resize(sequence_size); + break; + default: + auto vector = std::static_pointer_cast ::ref_type >> ( + value_.begin()->second); + vector->clear(); + vector->resize(sequence_size); + fill_vector_with_dynamic_data(vector, element_type); + break; + } + + return ret_value; +} + +ReturnCode_t DynamicDataImpl::clear_all_values( + bool only_non_keyed) noexcept +{ + ReturnCode_t ret_val = RETCODE_OK; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + ret_val = clear_all_sequence(type_kind); + } + else if (TK_MAP == type_kind) + { + next_map_member_id_ = 0; + key_to_id_.clear(); + value_.clear(); + } + else if (TK_BITMASK == type_kind) + { + assert(1 == value_.size()); + assert(1 == enclosing_type_->get_descriptor().bound().size()); + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence->size() == enclosing_type_->get_descriptor().bound().at(0)); + sequence->assign(sequence->size(), false); + } + else if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + const auto& members = enclosing_type_->get_all_members(); + for (auto& value_element : value_) + { + const auto it = members.find(value_element.first); + assert(members.end() != it); + auto member = traits::narrow(it->second); + if (!only_non_keyed || !member->get_descriptor().is_key()) + { + auto data = std::static_pointer_cast(value_element.second); + + data->clear_all_values(); + set_default_value(member, data); + } + } + } + else + { + set_value(""); + } + + return ret_val; +} + +ReturnCode_t DynamicDataImpl::clear_sequence_element( + TypeKind type_kind, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + assert(TK_ARRAY == type_kind || TK_SEQUENCE == type_kind); + + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + switch (element_type->get_kind()) + { + case TK_INT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_INT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT32: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT64: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_FLOAT128: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_CHAR8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_CHAR16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_BOOLEAN: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_BYTE: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_UINT8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_STRING8: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + case TK_STRING16: + { + auto seq = std::static_pointer_cast>(value_.begin()->second); + ret_value = clear_sequence_typed_element(seq, type_kind, id); + break; + } + default: + auto seq = std::static_pointer_cast::ref_type>>( + value_.begin()->second); + if (seq->size() > id) + { + auto it = seq->erase(seq->begin() + id); + if (TK_ARRAY == type_kind) + { + it = seq->emplace(it); + *it = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + ret_value = RETCODE_OK; + } + break; + } + + return ret_value; +} + +std::shared_ptr DynamicDataImpl::clone_primitive( + TypeKind type_kind, + const std::shared_ptr& primitive) const noexcept +{ + switch (type_kind) + { + case TK_INT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_INT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT32: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT64: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_FLOAT128: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_CHAR8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_CHAR16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_BOOLEAN: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_BYTE: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_UINT8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_STRING8: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + case TK_STRING16: { + return std::make_shared>(*std::static_pointer_cast>( + primitive)); + } + default: { + assert(false); + break; + } + } + return {}; +} + +std::shared_ptr DynamicDataImpl::clone_sequence( + TypeKind element_kind, + const std::shared_ptr& sequence) const noexcept +{ + switch (element_kind) + { + case TK_INT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_INT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT32: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT64: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_FLOAT128: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_CHAR8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_CHAR16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_BOOLEAN: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_BYTE: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_UINT8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_STRING8: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + case TK_STRING16: { + return std::make_shared>(*std::static_pointer_cast>( + sequence)); + } + default: { + auto ret_value = std::make_shared::ref_type>>(); + const auto& sequence_complex = + *std::static_pointer_cast::ref_type>>(sequence); + + for (const auto& element : sequence_complex) + { + ret_value->push_back(element->clone()); + } + + return ret_value; + } + break; + } +} + +bool DynamicDataImpl::compare_sequence_values( + TypeKind kind, + std::shared_ptr l, + std::shared_ptr r) const noexcept +{ + void* left = l.get(); + void* right = r.get(); + + switch (kind) + { + case TK_INT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT128: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BOOLEAN: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BYTE: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + default: { + auto* dl = (std::vector::ref_type>*)left; + auto* dr = (std::vector::ref_type>*)right; + return dl->size() == dr->size() && std::equal(dl->begin(), dl->end(), dr->begin(), + [](traits::ref_type& x, traits::ref_type& y) + { + return x->equals(y); + }); + } + break; + } + return false; +} + +bool DynamicDataImpl::compare_values( + TypeKind kind, + std::shared_ptr l, + std::shared_ptr r) const noexcept +{ + void* left = l.get(); + void* right = r.get(); + + switch (kind) + { + case TK_INT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_INT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT32: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT64: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_FLOAT128: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_CHAR16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BOOLEAN: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_BYTE: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_UINT8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING8: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + case TK_STRING16: { + return *(reinterpret_cast*>(left)) == + *(reinterpret_cast*>(right)); + } + default: + break; + } + return false; +} + +template +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence); + + if (MEMBER_ID_INVALID != id) + { + // Check MemberId was defined as a BITMASK member and retrieve the value. + if (enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(id)) + { + if (sequence->size() > id && (TK_BOOLEAN == TK || TypePromotion::value)) + { + value = static_cast>(sequence->at(id)); + ret_value = RETCODE_OK; + } + } + } + else + { + auto bound {enclosing_type_->get_descriptor().bound().at(0)}; + bool valid_promotion {false}; + + if (9 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (17 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (33 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (TypePromotion::value) + { + valid_promotion = true; + } + + if (valid_promotion) + { + uint64_t value_set {0}; + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (sequence->at(pos)) + { + value_set |= 0x1ull << pos; + } + } + + value = static_cast>(value_set); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind&, + MemberId) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_bitmask_bit( + TypeForKind&, + MemberId) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +traits::ref_type DynamicDataImpl::get_enclosing_type( + traits::ref_type type) noexcept +{ + traits::ref_type ret_value = type->resolve_alias_enclosed_type(); + + if (TK_ENUM == ret_value->get_kind()) // If enum, get enclosing type. + { + assert(0 < ret_value->get_all_members_by_index().size()); + ret_value = traits::narrow(ret_value->get_all_members_by_index().at( + 0)->get_descriptor().type()); + } + + return ret_value; +} + +TypeKind DynamicDataImpl::get_enclosing_typekind( + traits::ref_type type) noexcept +{ + return get_enclosing_type(type)->get_kind(); +} + +template +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK == element_kind) + { + value = *std::static_pointer_cast>(value_iterator->second); + ret_value = RETCODE_OK; + } + else + { + switch (element_kind) + { + case TK_INT8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_INT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_UINT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT32: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT64: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT128: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR8: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR16: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_BYTE: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_BOOLEAN: + if (TypePromotion::value) + { + assert(MEMBER_ID_INVALID == member_id); + value = + static_cast>(*std::static_pointer_cast>( + value_iterator->second)); + ret_value = RETCODE_OK; + } + break; + case TK_STRING8: + if (MEMBER_ID_INVALID != member_id && (TK == TK_CHAR8 || TypePromotion::value)) + { + auto str = std::static_pointer_cast>(value_iterator->second); + if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + + } + break; + case TK_STRING16: + if (MEMBER_ID_INVALID != member_id && (TK == TK_CHAR16 || TypePromotion::value)) + { + auto str = std::static_pointer_cast>(value_iterator->second); + if (member_id < str->length()) + { + value = static_cast>(str->at(member_id)); + ret_value = RETCODE_OK; + } + + } + break; + default: + break; + } + } + + return ret_value; +} + +/*! + * Specialization for TK_STRING8. + * @param[in] member_id Indicates the position of the character to be returned. MEMBER_ID_INVALID can be used to + * return all the string instead of a single character. + */ +template<> +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK_STRING8 == element_kind) + { + auto str = std::static_pointer_cast>(value_iterator->second); + + if (MEMBER_ID_INVALID == member_id) + { + value = *str; + ret_value = RETCODE_OK; + } + else if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +/*! + * Specialization for TK_STRING16. + * @param[in] member_id Indicates the position of the character to be returned. MEMBER_ID_INVALID can be used to + * return all the string instead of a single character. + */ +template<> +ReturnCode_t DynamicDataImpl::get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + + if (TK_STRING16 == element_kind) + { + auto str = std::static_pointer_cast>(value_iterator->second); + + if (MEMBER_ID_INVALID == member_id) + { + value = *str; + ret_value = RETCODE_OK; + } + else if (member_id < str->length()) + { + value = str->at(member_id); + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +uint32_t DynamicDataImpl::get_sequence_length() +{ + assert(TK_ARRAY == enclosing_type_->get_kind() || TK_SEQUENCE == enclosing_type_->get_kind()); + assert(enclosing_type_->get_descriptor().element_type()); + assert(1 == value_.size()); + + size_t ret_value {0}; + TypeKind type_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + switch (type_kind) + { + case TK_INT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_INT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_UINT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT32: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT64: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_FLOAT128: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_CHAR8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_CHAR16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_BOOLEAN: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_BYTE: + { + ret_value = + std::static_pointer_cast>(value_.begin()->second)-> + size(); + } + break; + case TK_UINT8: + { + ret_value = + std::static_pointer_cast>(value_.begin()->second)-> + size(); + } + break; + case TK_STRING8: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + case TK_STRING16: + { + ret_value = std::static_pointer_cast>(value_.begin()->second)->size(); + } + break; + default: + ret_value = + std::static_pointer_cast::ref_type>>(value_.begin()->second) + ->size(); + } + + return static_cast(ret_value); +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values( + SequenceTypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id && (TK_UNION != type_kind || 0 == id || selected_union_member_ == id)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + ret_value = std::static_pointer_cast(it->second)->get_sequence_values( + value, 0); + + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot find MemberId " << id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + + if (TK_ARRAY == element_kind || + TK_SEQUENCE == element_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + + if (sequence->size() > id) + { + ret_value = sequence->at(id)->get_sequence_values(value, 0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == element_kind) + { + ret_value = get_sequence_values_bitmask(id, it, value, 0); + } + else + { + ret_value = get_sequence_values_primitive(id, element_kind, it, value, 0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Unsupported type kind"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + auto sequence = + std::static_pointer_cast::ref_type>>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + for (auto it = initial_pos; it != final_pos; ++it) + { + TypeForKind element_value {0}; + (*it)->get_bitmask_bit(element_value, MEMBER_ID_INVALID); + value.push_back(element_value); + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId, + std::map>::const_iterator, + SequenceTypeForKind&, + size_t) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_bitmask( + MemberId, + std::map>::const_iterator, + SequenceTypeForKind&, + size_t) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + ReturnCode_t ret_value {RETCODE_BAD_PARAMETER}; + + switch (element_kind) + { + case TK_INT8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_INT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_UINT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT32: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT64: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_FLOAT128: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_CHAR8: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_CHAR16: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_BYTE: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + case TK_BOOLEAN: + ret_value = get_sequence_values_promoting(id, value_iterator, value, number_of_elements); + break; + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + if (TK_STRING8 == element_kind) + { + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + value.insert(value.begin(), initial_pos, final_pos); + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + if (TK_STRING16 == element_kind) + { + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + value.insert(value.begin(), initial_pos, final_pos); + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept +{ + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (0 == number_of_elements && 0 == sequence->size()) + { + value.clear(); + return RETCODE_OK; + } + if (sequence->size() > id && (TK == ToTK || TypePromotion::value)) + { + auto initial_pos = sequence->begin() + id; + auto final_pos = sequence->end(); + if (0 != number_of_elements && + static_cast::difference_type>(number_of_elements) < + std::distance(initial_pos, final_pos)) + { + final_pos = std::next(initial_pos, number_of_elements); + } + value.clear(); + for (auto it = initial_pos; it != final_pos; ++it) + { + value.push_back(static_cast>(*it)); + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::get_value( + TypeForKind& value, + MemberId id) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id && (TK_UNION != type_kind || 0 == id || selected_union_member_ == id)) + { + auto it = value_.find(id); + if (it != value_.end()) + { + ret_value = std::static_pointer_cast(it->second)->get_value( + value, + MEMBER_ID_INVALID); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (MEMBER_ID_INVALID != id) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + SequenceTypeForKind tmp; + + if (TK_BITMASK == element_kind) + { + ret_value = get_sequence_values_bitmask(id, it, tmp, 1); + } + else + { + ret_value = get_sequence_values_primitive(id, element_kind, it, tmp, 1); + } + + if (RETCODE_OK == ret_value) + { + assert(1 == tmp.size()); + value = tmp.at(0); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_MAP == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + + if (TK_BITMASK == element_kind) + { + ret_value = std::static_pointer_cast(it->second)->get_bitmask_bit(value, + MEMBER_ID_INVALID); + } + else + { + ret_value = get_primitive_value(element_kind, it, value, MEMBER_ID_INVALID); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error getting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == type_kind) + { + ret_value = get_bitmask_bit(value, id); + } + else // Primitives + { + if (MEMBER_ID_INVALID == id || TK_STRING8 == type_kind || TK_STRING16 == type_kind) + { + assert(1 == value_.size() && MEMBER_ID_INVALID == value_.begin()->first); + ret_value = get_primitive_value(type_kind, value_.begin(), value, id); + } + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId id, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + auto sequence = std::static_pointer_cast>(value_.begin()->second); + assert(sequence); + + if (MEMBER_ID_INVALID != id) + { + // Check MemberId was defined as a BITMASK member. + if (enclosing_type_->get_all_members().end() != enclosing_type_->get_all_members().find(id)) + { + if (sequence->size() > id && (TK_BOOLEAN == TK || TypePromotion::value)) + { + sequence->at(id) = static_cast>(value); + ret_value = RETCODE_OK; + } + } + } + else + { + auto bound {enclosing_type_->get_descriptor().bound().at(0)}; + bool valid_promotion {false}; + + if (9 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (17 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (33 > bound && TypePromotion::value) + { + valid_promotion = true; + } + else if (TypePromotion::value) + { + valid_promotion = true; + } + + if (valid_promotion) + { + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + uint64_t check_value = static_cast(value); + if (check_value & (0x1ull << pos)) + { + sequence->at(pos) = true; + } + else + { + sequence->at(pos) = false; + } + } + ret_value = RETCODE_OK; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId, + const TypeForKind&) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::set_bitmask_bit( + MemberId, + const TypeForKind&) noexcept +{ + return RETCODE_BAD_PARAMETER; +} + +void DynamicDataImpl::set_default_value( + const traits::ref_type member, + traits::ref_type data) noexcept +{ + traits::ref_type member_type = traits::narrow( + member->get_descriptor().type()); + TypeKind member_kind = get_enclosing_typekind(member_type); + + // In case of TK_UNION and member's index 0, set discrimiantor. + if (TK_UNION == enclosing_type_->get_kind() && 0 == member->get_descriptor().index()) + { + // Set default discriminator value. + set_discriminator_value(enclosing_type_->default_value(), member_type, data); + selected_union_member_ = enclosing_type_->default_union_member(); + } + // Other case, set member with default value. + else if (TK_BITSET != member_kind && + TK_STRUCTURE != member_kind && + TK_UNION != member_kind && + TK_SEQUENCE != member_kind && + TK_ARRAY != member_kind && + TK_MAP != member_kind) + { + if (0 < member->get_descriptor().default_value().length()) + { + data->set_value(member->get_descriptor().default_value()); + } + } +} + +void DynamicDataImpl::set_discriminator_value( + MemberId id) noexcept +{ + assert(TK_UNION == enclosing_type_->get_kind()); + + traits::ref_type member; + enclosing_type_->get_member(member, id); + assert(member); + auto m_impl = traits::narrow(member); + int32_t label {0}; + + if (m_impl->get_descriptor().is_default_label()) + { + label = enclosing_type_->default_value(); + } + else + { + assert(0 < m_impl->get_descriptor().label().size()); + label = m_impl->get_descriptor().label().at(0); + } + + assert(value_.find(0) != value_.end()); + traits::ref_type data_impl = std::static_pointer_cast(value_.at(0)); + + // Set new discriminator value. + set_discriminator_value(label, + traits::narrow(enclosing_type_->get_descriptor().discriminator_type()), + data_impl); + + selected_union_member_ = id; +} + +void DynamicDataImpl::set_discriminator_value( + int32_t new_discriminator_value, + const traits::ref_type& discriminator_type, + traits::ref_type& data) noexcept +{ + assert(TK_UNION == enclosing_type_->get_kind()); + TypeKind discriminator_kind = get_enclosing_typekind(discriminator_type); + + switch (discriminator_kind) + { + case TK_INT32: + data->set_int32_value(MEMBER_ID_INVALID, new_discriminator_value); + break; + case TK_UINT32: + data->set_uint32_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT8: + data->set_int8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT16: + data->set_int16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT16: + data->set_uint16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_INT64: + data->set_int64_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT64: + data->set_uint64_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_CHAR8: + data->set_char8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_CHAR16: + data->set_char16_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_BOOLEAN: + data->set_boolean_value(MEMBER_ID_INVALID, 0 == new_discriminator_value ? false : true); + break; + case TK_BYTE: + data->set_byte_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + case TK_UINT8: + data->set_uint8_value(MEMBER_ID_INVALID, static_cast(new_discriminator_value)); + break; + default: + break; + } +} + +template +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK == element_kind) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + switch (element_kind) + { + case TK_INT8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_INT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_UINT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT32: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT64: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_FLOAT128: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR8: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_CHAR16: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_BYTE: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + case TK_BOOLEAN: + if (TypePromotion::value) + { + *std::static_pointer_cast>(value_iterator->second) = + static_cast>(value); + ret_value = RETCODE_OK; + } + break; + default: + break; + } + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK_STRING8 == element_kind && ( + static_cast(LENGTH_UNLIMITED) == element_type->get_descriptor().bound().at(0) || + value.size() <= element_type->get_descriptor().bound().at(0))) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Element kind is not TK_STRING8 or the string length exceeds the string bound"); + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind element_kind = element_type->get_kind(); + + if (TK_STRING16 == element_kind && ( + static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + value.size() <= enclosing_type_->get_descriptor().bound().at(0))) + { + *std::static_pointer_cast>(value_iterator->second) = value; + ret_value = RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Element kind is not TK_STRING16 or the string length exceeds the string bound"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values( + MemberId id, + const SequenceTypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_MAP == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + if (TK_UNION == type_kind && 0 == id) // Check setting discriminator is correct. + { + if (!check_new_discriminator_value(value)) + { + return RETCODE_BAD_PARAMETER; + } + } + + auto it = value_.find(id); + if (it != value_.end()) + { + + ret_value = std::static_pointer_cast(it->second)->set_sequence_values( + 0, + value); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot find MemberId " << id); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + TypeKind element_kind = element_type->get_kind(); + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + if (TK_ARRAY == element_kind || + TK_SEQUENCE == element_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto sequence = + std::static_pointer_cast::ref_type>>(it->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() > id) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == + enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) > id))) + { + if (sequence->size() < id + 1) + { + auto last_pos = sequence->size(); + sequence->resize(id + 1); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + ret_value = sequence->at(id)->set_sequence_values(0, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == element_kind) + { + ret_value = set_sequence_values_bitmask(MEMBER_ID_INVALID == id ? 0 : id, it, value); + } + else // Try primitives + { + ret_value = set_sequence_values_primitive(MEMBER_ID_INVALID == id ? 0 : id, element_kind, it, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Unsupported type kind"); + } + + return ret_value; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + auto sequence = + std::static_pointer_cast::ref_type>>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + auto last_pos = sequence->size(); + sequence->resize(id + value.size()); + + for (auto pos = last_pos; pos < sequence->size(); ++pos) + { + sequence->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + (*pos)->set_bitmask_bit(MEMBER_ID_INVALID, value.at(count)); + ++pos; + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + ReturnCode_t ret_value {RETCODE_BAD_PARAMETER}; + + switch (element_kind) + { + case TK_INT8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_INT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_UINT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT32: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT64: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_FLOAT128: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_CHAR8: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_CHAR16: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_BYTE: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + case TK_BOOLEAN: + ret_value = set_sequence_values_promoting(id, value_iterator, value); + break; + } + + return ret_value; +} + +template<> +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + if (TK_STRING8 == element_kind) + { + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = value.at(count); + ++pos; + } + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template<> +ReturnCode_t DynamicDataImpl::set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + if (TK_STRING16 == element_kind) + { + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + if ((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = value.at(count); + ++pos; + } + return RETCODE_OK; + } + } + + return RETCODE_BAD_PARAMETER; +} + +template +ReturnCode_t DynamicDataImpl::set_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept +{ + TypeKind type_kind = enclosing_type_->get_kind(); + auto sequence = std::static_pointer_cast>(value_iterator->second); + assert(sequence); + + if (((TK_ARRAY == type_kind && sequence->size() >= id + value.size()) || + (TK_SEQUENCE == type_kind && + (static_cast(LENGTH_UNLIMITED) == enclosing_type_->get_descriptor().bound().at(0) || + enclosing_type_->get_descriptor().bound().at(0) >= id + value.size()))) && + (TK == ToTK || TypePromotion::value)) + { + if (sequence->size() < id + value.size()) + { + sequence->resize(id + value.size()); + } + auto pos = sequence->begin() + id; + for (size_t count {0}; count < value.size(); ++count) + { + *pos = static_cast>(value.at(count)); + ++pos; + } + return RETCODE_OK; + } + + return RETCODE_BAD_PARAMETER; +} + +void DynamicDataImpl::set_value( + const ObjectName& sValue) noexcept +{ + auto enclosed_type = type_->resolve_alias_enclosed_type(); + TypeKind type_kind = enclosed_type->get_kind(); + + switch (type_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT32: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT8: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int8_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT16: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT16: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_INT64: + { + TypeForKind value {0}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_int64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT64: + { + TypeForKind value(0); + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_uint64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT32: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float32_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT64: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float64_value(MEMBER_ID_INVALID, value); + break; + } + case TK_FLOAT128: + { + TypeForKind value {0.0f}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_float128_value(MEMBER_ID_INVALID, value); + break; + } + case TK_CHAR8: + { + TypeForKind value {0}; + if (1 == sValue.size()) + { + value = sValue[0]; + } + + set_char8_value(MEMBER_ID_INVALID, value); + break; + } + case TK_CHAR16: + { + TypeForKind value {0}; + try + { + if (1 == sValue.size()) + { + std::string str = sValue.to_string(); + std::wstring temp = std::wstring(str.begin(), str.end()); + value = temp[0]; + } + } + catch (...) + { + } + + set_char16_value(MEMBER_ID_INVALID, value); + break; + } + case TK_BOOLEAN: + { + TypeForKind value {false}; + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + set_boolean_value(MEMBER_ID_INVALID, value); + break; + } + case TK_BYTE: + { + TypeForKind value {0}; + if (sValue.size() >= 1) + { + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + } + set_byte_value(MEMBER_ID_INVALID, value); + break; + } + case TK_UINT8: + { + TypeForKind value {0}; + if (sValue.size() >= 1) + { + try + { + value = TypeValueConverter::sto(sValue.to_string()); + } + catch (...) + { + } + } + set_byte_value(MEMBER_ID_INVALID, value); + break; + } + case TK_STRING8: + { + set_string_value(MEMBER_ID_INVALID, sValue.to_string()); + break; + } + case TK_STRING16: + { + std::string str = sValue.to_string(); + set_wstring_value(MEMBER_ID_INVALID, std::wstring(str.begin(), str.end())); + break; + } + case TK_ENUM: + { + auto& members = enclosed_type->get_all_members_by_index(); + assert(0 < members.size()); + TypeForKind value = TypeValueConverter::sto(members.at(0)->get_descriptor().default_value()); + for (auto member_it {members.begin()}; member_it != members.end(); ++member_it) + { + if (0 == sValue.to_string().compare((*member_it)->get_name().to_string())) + { + value = TypeValueConverter::sto((*member_it)->get_descriptor().default_value()); + break; + } + } + + switch (enclosing_type_->get_kind()) + { + case TK_INT8: + set_int8_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT8: + set_uint8_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_INT16: + set_int16_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT16: + set_uint16_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_INT32: + set_int32_value(MEMBER_ID_INVALID, static_cast(value)); + break; + case TK_UINT32: + set_uint32_value(MEMBER_ID_INVALID, static_cast(value)); + break; + } + break; + } + default: + break; + } +} + +template +ReturnCode_t DynamicDataImpl::set_value( + MemberId id, + const TypeForKind& value) noexcept +{ + ReturnCode_t ret_value = RETCODE_BAD_PARAMETER; + TypeKind type_kind = enclosing_type_->get_kind(); + + if (TK_ANNOTATION == type_kind || + TK_BITSET == type_kind || + TK_STRUCTURE == type_kind || + TK_UNION == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + if (TK_UNION == type_kind && 0 == id) // Check setting discriminator is correct. + { + if (!check_new_discriminator_value(value)) + { + return RETCODE_BAD_PARAMETER; + } + } + + auto it = value_.find(id); + if (it != value_.end()) + { + TypeForKind new_value {value}; + + // In case of BITSET, apply mask. + if (TK_BITSET == type_kind) + { + apply_bitset_mask(id, new_value); + } + + ret_value = std::static_pointer_cast(it->second)->set_value( + MEMBER_ID_INVALID, new_value); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. MemberId not found."); + } + + if (RETCODE_OK == ret_value && TK_UNION == type_kind && 0 != id) // Set new discriminator. + { + set_discriminator_value(id); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_ARRAY == type_kind || + TK_SEQUENCE == type_kind) + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (MEMBER_ID_INVALID != id) + { + auto it = value_.cbegin(); + assert(value_.cend() != it && MEMBER_ID_INVALID == it->first); + + if (TK_BITMASK == element_kind) + { + ret_value = set_sequence_values_bitmask(id, it, {value}); + } + else + { + ret_value = set_sequence_values_primitive(id, element_kind, it, {value}); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_MAP == type_kind) + { + if (MEMBER_ID_INVALID != id) + { + auto it = value_.find(id); + if (it != value_.end()) + { + auto element_type = + get_enclosing_type(traits::narrow( + enclosing_type_->get_descriptor().element_type())); + if (TK_BITMASK == element_type->get_kind()) + { + ret_value = std::static_pointer_cast(it->second)->set_bitmask_bit( + MEMBER_ID_INVALID, value); + } + else + { + ret_value = set_primitive_value(element_type, it, value); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. MemberId not found."); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error setting value. Invalid MemberId."); + } + } + else if (TK_BITMASK == type_kind) + { + ret_value = set_bitmask_bit(id, value); + } + else // Primitives + { + if (MEMBER_ID_INVALID == id) + { + assert(1 == value_.size() && MEMBER_ID_INVALID == value_.begin()->first); + ret_value = set_primitive_value(enclosing_type_, value_.begin(), value); + } + } + + return ret_value; +} + +//}}} + +//{{{ Encoding/decoding functions + +size_t DynamicDataImpl::calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const traits::ref_type type, + size_t& current_alignment) const noexcept +{ + size_t calculated_size {0}; + auto it = value_.begin(); + + TypeKind type_kind = type->get_kind(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT16: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BYTE: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING8: + calculated_size = calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + it->second), + current_alignment); + break; + //}}} + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_INT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BYTE: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_UINT8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING8: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_array_serialized_size(*std::static_pointer_cast>( + it->second), current_alignment); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + it->second)}; + calculated_size += + calculator.calculate_array_serialized_size(vector_t->data(), + vector_t->size(), current_alignment); + } + break; + default: + calculated_size = + calculator.calculate_array_serialized_size( + *std::static_pointer_cast::ref_type>>( + it->second), current_alignment); + break; + + } + + break; + } + case TK_BITMASK: + { + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + if (9 > bound) + { + uint8_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else if (17 > bound) + { + uint16_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else if (33 > bound) + { + uint32_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + else + { + uint64_t value {0}; + calculated_size = calculator.calculate_serialized_size(value, current_alignment); + } + break; + } + case TK_BITSET: + { + assert(0 < type->get_all_members_by_index().size()); + auto sum {type->get_all_members_by_index().rbegin()->get()->get_id() + + *type->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + std::bitset<8> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else if (17 > sum) + { + std::bitset<16> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else if (33 > sum) + { + std::bitset<32> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + else + { + std::bitset<64> bitset; + calculated_size = calculator.calculate_serialized_size(bitset, current_alignment); + } + break; + } + case TK_MAP: + { + TypeKind key_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + size_t initial_alignment {current_alignment}; + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version()) + { + // DHEADER + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + // Serializing map's length. XTypes v1.3 section 7.4.3.5.3 rule 15 doesn't specify this but it is probably a + // typo (other collection types behave this way). + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + calculated_size = current_alignment - initial_alignment; + for (auto key_it = key_to_id_.begin(); key_it != key_to_id_.end(); ++key_it) + { + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_INT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_FLOAT128: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_CHAR8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_CHAR16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_BOOLEAN: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_BYTE: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_UINT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + } + break; + case TK_STRING8: + { + calculated_size += calculator.calculate_serialized_size(key_it->first, current_alignment); + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + assert(value_.end() != value_.find(key_it->second)); + switch (element_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_INT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT32: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT64: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_FLOAT128: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_CHAR8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_CHAR16: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_BOOLEAN: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_BYTE: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_UINT8: + { + TypeForKind value {0}; + calculated_size += calculator.calculate_serialized_size(value, current_alignment); + break; + } + case TK_STRING8: + calculated_size += + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.find( + key_it->second)->second), current_alignment); + break; + case TK_STRING16: + calculated_size += + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.find( + key_it->second)->second), current_alignment); + break; + default: + calculated_size += + calculator.calculate_serialized_size(std::static_pointer_cast( + value_.find(key_it->second)->second), current_alignment); + break; + + } + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_INT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT32: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT64: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_FLOAT128: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_CHAR8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_CHAR16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BOOLEAN: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BYTE: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_UINT8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_STRING8: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_STRING16: + calculated_size = + calculator.calculate_serialized_size(*std::static_pointer_cast>( + value_.begin()->second), current_alignment); + break; + case TK_BITMASK: + { + uint32_t seq_length {0}; + auto vector_t {std::static_pointer_cast::ref_type>>( + value_.begin()->second)}; + calculated_size = calculator.calculate_serialized_size(seq_length, current_alignment); + calculated_size += + calculator.calculate_array_serialized_size(vector_t->data(), + vector_t->size(), current_alignment); + } + break; + default: + calculated_size = + calculator.calculate_serialized_size( + *std::static_pointer_cast::ref_type>>( + value_.begin()->second), current_alignment); + break; + + } + + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + calculator.get_cdr_version())}; + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + calculated_size = calculator.begin_calculate_type_serialized_size(encoding, current_alignment); + + for (auto& member : type->get_all_members_by_index()) + { + it = value_.find(member->get_id()); + + if (it != value_.end()) + { + auto member_data = std::static_pointer_cast(it->second); + calculated_size += calculator.calculate_member_serialized_size( + member->get_id(), member_data, current_alignment); + } + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + calculator.get_cdr_version())}; + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + calculated_size = calculator.begin_calculate_type_serialized_size(encoding, current_alignment); + + // Union discriminator + auto discriminator_data = std::static_pointer_cast(value_.at(0)); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + discriminator_data, current_alignment); + + if (MEMBER_ID_INVALID != selected_union_member_) + { + auto member_data = std::static_pointer_cast(value_.at(selected_union_member_)); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + member_data, current_alignment); + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + break; + } + default: + break; + } + + return calculated_size; +} + +bool DynamicDataImpl::deserialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) +{ + bool res = true; + + TypeKind type_kind = type->get_kind(); + auto begin_it = value_.begin(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT32: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT64: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT128: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BOOLEAN: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BYTE: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING8: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING16: + { + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + } + //}}} + case TK_ARRAY: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT32: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT64: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT128: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BOOLEAN: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BYTE: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING8: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING16: + cdr.deserialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + begin_it->second)}; + cdr.deserialize_array(vector_t->data(), vector_t->size()); + break; + } + default: + cdr.deserialize_array(*std::static_pointer_cast::ref_type>>( + begin_it->second)); + break; + } + break; + } + case TK_BITMASK: + { + uint64_t value {0}; + auto sequence = std::static_pointer_cast>(begin_it->second); + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + if (9 > bound) + { + uint8_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else if (17 > bound) + { + uint16_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else if (33 > bound) + { + uint32_t value_get {0}; + cdr >> value_get; + value = value_get; + } + else + { + cdr >> value; + } + + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (value & (0x1ull << pos)) + { + sequence->at(pos) = true; + } + else + { + sequence->at(pos) = false; + } + } + break; + } + case TK_BITSET: + { + std::bitset<64> bitset; + assert(0 < type->get_all_members_by_index().size()); + auto sum {type->get_all_members_by_index().rbegin()->get()->get_id() + + *type->get_descriptor().bound().rbegin()}; + + if (9 > sum) + { + std::bitset<8> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else if (17 > sum) + { + std::bitset<16> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else if (33 > sum) + { + std::bitset<32> new_bitset; + cdr >> new_bitset; + bitset = {new_bitset.to_ullong()}; + } + else + { + cdr >> bitset; + } + + size_t index = 0; + for (auto& member : type->get_all_members_by_index()) + { + MemberId member_id {member->get_id()}; + auto it = value_.find(member_id); + + if (it != value_.end()) + { + int64_t value {0}; + auto base {member_id}; + auto size {type->get_descriptor().bound().at(index)}; + auto member_data {std::static_pointer_cast(it->second)}; + + for (uint32_t i = 0; i < size; ++i) + { + if (bitset.test(i + base)) + { + value |= 0x1ull << i; + } + } + + TypeKind element_kind { + get_enclosing_typekind(traits::narrow( + member->get_descriptor().type()))}; + ReturnCode_t ret_value {RETCODE_ERROR}; + + switch (element_kind) + { + case TK_BOOLEAN: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_BYTE: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT8: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT8: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT16: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT16: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT32: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT32: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_INT64: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + case TK_UINT64: + ret_value = member_data->set_value(MEMBER_ID_INVALID, + static_cast>(value)); + break; + default: + break; + } + + if (RETCODE_OK != ret_value) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error retrieving bitset bitfield value"); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error deserializing bitset bitfield because it is not found on DynamicData"); + } + + ++index; + } + break; + } + case TK_MAP: + { + TypeKind key_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind { get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + uint32_t dheader {0}; + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + cdr >> dheader; + } + + clear_all_values(); + + auto offset {cdr.get_current_position()}; + uint32_t length {0}; + cdr >> length; + + for (uint32_t count {0}; + (is_primitive || eprosima::fastcdr::CdrVersion::XCDRv2 != cdr.get_cdr_version() || + static_cast(cdr.get_current_position() - offset) < dheader) && count < length; ++count) + { + if (static_cast(LENGTH_UNLIMITED) == type->get_descriptor().bound().at(0) || + type->get_descriptor().bound().at(0) > key_to_id_.size()) + { + std::string key; + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_INT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT32: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT64: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_FLOAT128: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_CHAR8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_CHAR16: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_BOOLEAN: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_BYTE: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_UINT8: + { + TypeForKind value {0}; + cdr >> value; + key = std::to_string(value); + } + break; + case TK_STRING8: + { + cdr >> key; + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + MemberId id = next_map_member_id_++; + key_to_id_[key] = id; + std::map>::iterator insert_it {value_.end()}; + + if (!is_complex_kind(element_kind)) + { + insert_it = add_value(element_kind, id); + } + else + { + traits::ref_type data = DynamicDataFactory::get_instance()->create_data( + type->get_descriptor().element_type()); + insert_it = value_.emplace(id, data).first; + } + + switch (element_kind) + { + case TK_INT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_INT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT32: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT64: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_FLOAT128: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_CHAR8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_CHAR16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_BOOLEAN: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_BYTE: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_UINT8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_STRING8: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + case TK_STRING16: + cdr >> *std::static_pointer_cast>(insert_it->second); + break; + default: + traits::ref_type member_data = + std::static_pointer_cast( + insert_it->second); + cdr >> member_data; + break; + + } + + } + } + + if (!is_primitive && eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() && + static_cast(cdr.get_current_position() - offset) != dheader) + { + throw fastcdr::exception::BadParamException( + "Member size differs from the size specified by DHEADER"); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind = + get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type())); + switch (element_kind) + { + case TK_INT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT32: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT64: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT128: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_BOOLEAN: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_BYTE: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING8: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING16: + cdr >> *std::static_pointer_cast>(begin_it->second); + break; + default: + { + auto vector_t = std::static_pointer_cast ::ref_type >> ( + begin_it->second); + uint32_t sequence_length {0}; + + if (TK_BITMASK != element_kind && + fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + uint32_t dheader {0}; + cdr.deserialize(dheader); + + auto offset {cdr.get_current_position()}; + + cdr.deserialize(sequence_length); + + if (0 == sequence_length) + { + vector_t->clear(); + } + else + { + auto element_type = + get_enclosing_type(traits::narrow( + type->get_descriptor().element_type())); + + vector_t->resize(sequence_length); + + for (size_t pos = 0; pos < vector_t->size(); ++pos) + { + if (!vector_t->at(pos)) + { + vector_t->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + + uint32_t count {0}; + while (static_cast(cdr.get_current_position() - offset) < dheader && + count < sequence_length) + { + cdr.deserialize(vector_t->data()[count]); + ++count; + } + + if (static_cast(cdr.get_current_position() - offset) != dheader) + { + throw fastcdr::exception::BadParamException( + "Member size differs from the size specified by DHEADER"); + } + } + } + else + { + fastcdr::Cdr::state state_before_error(cdr); + + cdr.deserialize(sequence_length); + + if (sequence_length == 0) + { + vector_t->clear(); + } + else + { + auto element_type = + get_enclosing_type(traits::narrow( + type->get_descriptor().element_type())); + try + { + vector_t->resize(sequence_length); + for (size_t pos = 0; pos < vector_t->size(); ++pos) + { + if (!vector_t->at(pos)) + { + vector_t->at(pos) = traits::narrow( + DynamicDataFactory::get_instance()->create_data(element_type)); + } + } + cdr.deserialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(state_before_error); + ex.raise(); + } + } + } + } + break; + } + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + cdr.deserialize_type(encoding, + [&](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + + traits::ref_type member; + + if (ExtensibilityKind::MUTABLE == type->get_descriptor().extensibility_kind()) + { + ret_value = (RETCODE_OK == type->get_member(member, mid.id)); + } + else + { + ret_value = (RETCODE_OK == type->get_member_by_index(member, mid.id)); + } + + if (ret_value) + { + auto member_impl = traits::narrow(member); + traits::ref_type member_data; + auto it = value_.find(member_impl->get_id()); + + if (it != value_.end()) + { + member_data = std::static_pointer_cast(it->second); + } + else + { + member_data = + traits::narrow(DynamicDataFactory::get_instance() + ->create_data( + member_impl->get_descriptor().type())); + value_.emplace(it->first, member_data); + } + + dcdr >> member_data; + } + + return ret_value; + }); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + cdr.deserialize_type(encoding, + [&](eprosima::fastcdr::Cdr& dcdr, + const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + + switch (mid.id) + { + case 0: + { + traits::ref_type member_data = + std::static_pointer_cast(value_.at( + 0)); + dcdr >> member_data; + + // Select member pointed by discriminator. + int64_t discriminator {0}; + uint64_t udiscriminator {0}; + selected_union_member_ = MEMBER_ID_INVALID; + ReturnCode_t dyn_ret_value = get_int64_value(discriminator, 0); + if (RETCODE_OK != dyn_ret_value) + { + dyn_ret_value = get_uint64_value(udiscriminator, 0); + discriminator = static_cast(udiscriminator); + } + + if (RETCODE_OK == dyn_ret_value) + { + for (auto member : type->get_all_members_by_index()) + { + auto m_impl {traits::narrow( + member)}; + + for (auto label : m_impl->get_descriptor().label()) + { + if (static_cast(discriminator) == label) + { + selected_union_member_ = m_impl->get_id(); + break; + } + } + } + + if (MEMBER_ID_INVALID == selected_union_member_) + { + selected_union_member_ = type->default_union_member(); + } + } + else + { + throw fastcdr::exception::BadParamException("Wrong discriminator"); + } + } + break; + default: + { + if (1 == value_.count(selected_union_member_)) + { + // Check MemberId in mutable case. + auto member_data {std::static_pointer_cast(value_.at( + selected_union_member_))}; + dcdr >> member_data; + // In case it is not MUTABLE, we have to inform fastcdr to stop returning `false`. + if (ExtensibilityKind::MUTABLE != type->get_descriptor().extensibility_kind()) + { + ret_value = false; + } + } + else + { + throw fastcdr::exception::BadParamException( + "Cannot deserialize union member due to wrong discriminator value"); + } + } + break; + } + + return ret_value; + }); + + break; + } + default: + break; + } + + return res; +} + +void DynamicDataImpl::serialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) const +{ + TypeKind type_kind = type->get_kind(); + auto begin_it = value_.begin(); + + switch (type_kind) + { + //{{{ Primitive types + case TK_INT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_INT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT32: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT64: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_FLOAT128: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_CHAR16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BOOLEAN: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_BYTE: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_UINT8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING8: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + case TK_STRING16: + { + cdr << *std::static_pointer_cast>(begin_it->second); + break; + } + //}}} + case TK_ARRAY: + { + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + switch (element_kind) + { + case TK_INT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_INT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT32: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT64: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_FLOAT128: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_CHAR16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BOOLEAN: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BYTE: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_UINT8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING8: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_STRING16: + cdr.serialize_array(*std::static_pointer_cast>(begin_it->second)); + break; + case TK_BITMASK: + { + auto vector_t {std::static_pointer_cast::ref_type>>( + begin_it->second)}; + cdr.serialize_array(vector_t->data(), vector_t->size()); + break; + } + default: + cdr.serialize_array(*std::static_pointer_cast::ref_type>>( + begin_it->second)); + break; + } + + break; + } + case TK_BITMASK: + { + uint64_t value {0}; + auto sequence = std::static_pointer_cast>(begin_it->second); + assert(1 == type->get_descriptor().bound().size()); + auto bound = type->get_descriptor().bound().at(0); + + for (size_t pos {0}; pos < sequence->size(); ++pos) + { + if (sequence->at(pos)) + { + value |= 0x1ull << pos; + } + } + + if (9 > bound) + { + cdr << static_cast(value); + } + else if (17 > bound) + { + cdr << static_cast(value); + } + else if (33 > bound) + { + cdr << static_cast(value); + } + else + { + cdr << value; + } + break; + } + case TK_BITSET: + { + size_t index = 0; + size_t sum {0}; + std::bitset<64> bitset; + for (auto& member : type->get_all_members_by_index()) + { + MemberId member_id {member->get_id()}; + auto it = value_.find(member_id); + + if (it != value_.end()) + { + int64_t value {0}; + auto member_data {std::static_pointer_cast(it->second)}; + + if (RETCODE_OK == member_data->get_value(value, MEMBER_ID_INVALID)) + { + auto base {member_id}; + auto size {type->get_descriptor().bound().at(index)}; + for (auto i = base; i < base + size; ++i) + { + bitset.set(i, !!(value & 0x01)); + value = value >> 1; + } + assert(sum <= base); + sum = base + size; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error retrieving bitset bitfield value"); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing bitset bitfield because it is not found on DynamicData"); + } + + ++index; + } + + if (9 > sum) + { + std::bitset<8> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else if (17 > sum) + { + std::bitset<16> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else if (33 > sum) + { + std::bitset<32> new_bitset(bitset.to_ullong()); + cdr << new_bitset; + } + else + { + cdr << bitset; + } + break; + } + case TK_MAP: + { + TypeKind key_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().key_element_type()))}; + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + bool is_primitive {TK_BITMASK == element_kind || (!is_complex_kind(element_kind) && + TK_STRING8 != element_kind && + TK_STRING16 != element_kind)}; + eprosima::fastcdr::Cdr::state dheader_state{!is_primitive ? cdr.allocate_xcdrv2_dheader() : + eprosima::fastcdr::Cdr::state{cdr}}; + + assert(key_to_id_.size() == value_.size()); + cdr << static_cast(key_to_id_.size()); + + for (auto it = key_to_id_.begin(); it != key_to_id_.end(); ++it) + { + switch (key_kind) + { + case TK_INT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_INT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT32: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT64: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_FLOAT128: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_CHAR8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_CHAR16: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_BOOLEAN: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_BYTE: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_UINT8: + { + TypeForKind value = TypeValueConverter::sto(it->first); + cdr << value; + } + break; + case TK_STRING8: + { + cdr << it->first; + } + break; + case TK_STRING16: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Map's key type cannot be WString. Not supported"); + assert(false); + break; + default: + assert(false); + break; + + } + assert(value_.end() != value_.find(it->second)); + switch (element_kind) + { + case TK_INT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_INT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT32: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT64: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_FLOAT128: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_CHAR8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_CHAR16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_BOOLEAN: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_BYTE: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_UINT8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_STRING8: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + case TK_STRING16: + cdr << *std::static_pointer_cast>(value_.find(it->second)->second); + break; + default: + cdr << std::static_pointer_cast(value_.find(it->second)->second); + break; + + } + } + + if (!is_primitive) + { + cdr.set_xcdrv2_dheader(dheader_state); + } + + break; + } + case TK_SEQUENCE: + { + TypeKind element_kind {get_enclosing_typekind(traits::narrow( + type->get_descriptor().element_type()))}; + switch (element_kind) + { + case TK_INT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_INT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT32: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT64: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_FLOAT128: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_CHAR16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_BOOLEAN: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_BYTE: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_UINT8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING8: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + case TK_STRING16: + cdr << *std::static_pointer_cast>(begin_it->second); + break; + default: + { + auto vector_t = std::static_pointer_cast ::ref_type >> ( + begin_it->second); + + if (TK_BITMASK != element_kind && + fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version()) + { + fastcdr::Cdr::state dheader_state {cdr.allocate_xcdrv2_dheader()}; + + cdr.serialize(static_cast(vector_t->size())); + + try + { + cdr.serialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(dheader_state); + ex.raise(); + } + + cdr.set_xcdrv2_dheader(dheader_state); + } + else + { + fastcdr::Cdr::state state_before_error(cdr); + cdr.serialize(static_cast(vector_t->size())); + + try + { + cdr.serialize_array(vector_t->data(), vector_t->size()); + } + catch (fastcdr::exception::Exception& ex) + { + cdr.set_state(state_before_error); + ex.raise(); + } + + } + } + break; + } + + break; + } + case TK_STRUCTURE: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + eprosima::fastcdr::Cdr::state current_state(cdr); + cdr.begin_serialize_type(current_state, encoding); + + for (auto& member : type->get_all_members_by_index()) + { + auto it = value_.find(member->get_id()); + + if (it != value_.end()) + { + auto member_data {std::static_pointer_cast(it->second)}; + + cdr << eprosima::fastcdr::MemberId{member->get_id()} << member_data; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error serializing structure member because it is not found on DynamicData"); + } + } + + cdr.end_serialize_type(current_state); + break; + } + case TK_UNION: + { + eprosima::fastcdr::EncodingAlgorithmFlag encoding {get_fastcdr_encoding_flag( + type->get_descriptor().extensibility_kind(), + cdr.get_cdr_version())}; + eprosima::fastcdr::Cdr::state current_state(cdr); + cdr.begin_serialize_type(current_state, encoding); + + // The union_id_ must be serialized as a discriminator_type_ + auto discriminator_data {std::static_pointer_cast(value_.at(0))}; + cdr << eprosima::fastcdr::MemberId{0} << discriminator_data; + + if (MEMBER_ID_INVALID != selected_union_member_) + { + auto member_data = std::static_pointer_cast(value_.at(selected_union_member_)); + cdr << eprosima::fastcdr::MemberId{selected_union_member_} << member_data; + } + + cdr.end_serialize_type(current_state); + break; + } + default: + break; + } +} + +//}}} + +} // namespace dds + +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp new file mode 100644 index 00000000000..09edfd74f02 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicDataImpl.hpp @@ -0,0 +1,768 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAIMPL_HPP + +#include +#include + +#include +#include + +#include "DynamicTypeImpl.hpp" +#include "TypeForKind.hpp" + +namespace eprosima { + +namespace fastcdr { +class Cdr; +class CdrSizeCalculator; +} // namespace fastcdr + +namespace fastdds { +namespace dds { + +class DynamicDataImpl : public traits::base_type +{ + //{{{ Implementation members of DynamicData + + //! The associated type. + traits::ref_type type_; + + //! Enclosed type in case of `type_` is TK_ALIAS or TK_ENUM. In other case, the same value as `type_`. + traits::ref_type enclosing_type_; + + //! Contains the values of the current sample. + std::map> value_; + + //! Used in TK_MAP to maintain correlation between keys and MemberIds. + std::map key_to_id_; + + //! Used in TK_MAP to know which is the next MemberId to be used. + MemberId next_map_member_id_ {0}; + + //! Stores the loaned values by the user. + std::vector loaned_values_; + + //! Points to the current selected member in the union. + MemberId selected_union_member_ {MEMBER_ID_INVALID}; + + //}}} + +public: + + //{{{ Public functions + + DynamicDataImpl() noexcept = default; + + DynamicDataImpl( + traits::ref_type type) noexcept; + + ReturnCode_t clear_all_values() noexcept override; + + ReturnCode_t clear_nonkey_values() noexcept override; + + ReturnCode_t clear_value( + MemberId id) noexcept override; + + traits::ref_type clone() noexcept override; + + bool equals( + traits::ref_type other) noexcept override; + + ReturnCode_t get_descriptor( + traits::ref_type& value, + MemberId id) noexcept override; + + uint32_t get_item_count() noexcept override; + + MemberId get_member_id_at_index( + uint32_t index) noexcept override; + + MemberId get_member_id_by_name( + const ObjectName& name) noexcept override; + + //{{{ Getters + + //{{{ Primitive getters + + ReturnCode_t get_int32_value( + int32_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint32_value( + uint32_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int8_value( + int8_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint8_value( + uint8_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int16_value( + int16_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint16_value( + uint16_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_int64_value( + int64_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint64_value( + uint64_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_float32_value( + float& value, + MemberId id) noexcept override; + + ReturnCode_t get_float64_value( + double& value, + MemberId id) noexcept override; + + ReturnCode_t get_float128_value( + long double& value, + MemberId id) noexcept override; + + ReturnCode_t get_char8_value( + char& value, + MemberId id) noexcept override; + + ReturnCode_t get_char16_value( + wchar_t& value, + MemberId id) noexcept override; + + ReturnCode_t get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) noexcept override; + + ReturnCode_t get_boolean_value( + bool& value, + MemberId id) noexcept override; + + ReturnCode_t get_string_value( + std::string& value, + MemberId id) noexcept override; + + ReturnCode_t get_wstring_value( + std::wstring& value, + MemberId id) noexcept override; + + //}}} + + ReturnCode_t get_complex_value( + traits::ref_type& value, + MemberId id) noexcept override; + + //{{{ Array getters + + ReturnCode_t get_int32_values( + Int32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint32_values( + UInt32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int8_values( + Int8Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint8_values( + UInt8Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int16_values( + Int16Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint16_values( + UInt16Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_int64_values( + Int64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_uint64_values( + UInt64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float32_values( + Float32Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float64_values( + Float64Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_float128_values( + Float128Seq& value, + MemberId id) noexcept override; + + ReturnCode_t get_char8_values( + CharSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_char16_values( + WcharSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_byte_values( + ByteSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_boolean_values( + BooleanSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_string_values( + StringSeq& value, + MemberId id) noexcept override; + + ReturnCode_t get_wstring_values( + WstringSeq& value, + MemberId id) noexcept override; + + //}}} + + //}}} + + traits::ref_type loan_value( + MemberId id) noexcept override; + + ReturnCode_t return_loaned_value( + traits::ref_type value) noexcept override; + + //{{{ Setters + + //{{{ Primitive getters + + ReturnCode_t set_int32_value( + MemberId id, + int32_t value) noexcept override; + + ReturnCode_t set_uint32_value( + MemberId id, + uint32_t value) noexcept override; + + ReturnCode_t set_int8_value( + MemberId id, + int8_t value) noexcept override; + + ReturnCode_t set_uint8_value( + MemberId id, + uint8_t value) noexcept override; + + ReturnCode_t set_int16_value( + MemberId id, + int16_t value) noexcept override; + + ReturnCode_t set_uint16_value( + MemberId id, + uint16_t value) noexcept override; + + ReturnCode_t set_int64_value( + MemberId id, + int64_t value) noexcept override; + + ReturnCode_t set_uint64_value( + MemberId id, + uint64_t value) noexcept override; + + ReturnCode_t set_float32_value( + MemberId id, + float value) noexcept override; + + ReturnCode_t set_float64_value( + MemberId id, + double value) noexcept override; + + ReturnCode_t set_float128_value( + MemberId id, + long double value) noexcept override; + + ReturnCode_t set_char8_value( + MemberId id, + char value) noexcept override; + + ReturnCode_t set_char16_value( + MemberId id, + wchar_t value) noexcept override; + + ReturnCode_t set_byte_value( + MemberId id, + eprosima::fastrtps::rtps::octet value) noexcept override; + + ReturnCode_t set_boolean_value( + MemberId id, + bool value) noexcept override; + + ReturnCode_t set_string_value( + MemberId id, + const std::string& value) noexcept override; + + ReturnCode_t set_wstring_value( + MemberId id, + const std::wstring& value) noexcept override; + + //}}} + + ReturnCode_t set_complex_value( + MemberId id, + traits::ref_type value) noexcept override; + + //{{{ Array getters + + ReturnCode_t set_int32_values( + MemberId id, + const Int32Seq& value) noexcept override; + + ReturnCode_t set_uint32_values( + MemberId id, + const UInt32Seq& value) noexcept override; + + ReturnCode_t set_int8_values( + MemberId id, + const Int8Seq& value) noexcept override; + + ReturnCode_t set_uint8_values( + MemberId id, + const UInt8Seq& value) noexcept override; + + ReturnCode_t set_int16_values( + MemberId id, + const Int16Seq& value) noexcept override; + + ReturnCode_t set_uint16_values( + MemberId id, + const UInt16Seq& value) noexcept override; + + ReturnCode_t set_int64_values( + MemberId id, + const Int64Seq& value) noexcept override; + + ReturnCode_t set_uint64_values( + MemberId id, + const UInt64Seq& value) noexcept override; + + ReturnCode_t set_float32_values( + MemberId id, + const Float32Seq& value) noexcept override; + + ReturnCode_t set_float64_values( + MemberId id, + const Float64Seq& value) noexcept override; + + ReturnCode_t set_float128_values( + MemberId id, + const Float128Seq& value) noexcept override; + + ReturnCode_t set_char8_values( + MemberId id, + const CharSeq& value) noexcept override; + + ReturnCode_t set_char16_values( + MemberId id, + const WcharSeq& value) noexcept override; + + ReturnCode_t set_byte_values( + MemberId id, + const ByteSeq& value) noexcept override; + + ReturnCode_t set_boolean_values( + MemberId id, + const BooleanSeq& value) noexcept override; + + ReturnCode_t set_string_values( + MemberId id, + const StringSeq& value) noexcept override; + + ReturnCode_t set_wstring_values( + MemberId id, + const WstringSeq& value) noexcept override; + + //}}} + + //}}} + + + traits::ref_type type() noexcept override; + + //{{{ Encoding/decoding functions + + size_t calculate_key_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept; + + static size_t calculate_max_serialized_size( + traits::ref_type type, + size_t current_alignment = 0); + + size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + size_t& current_alignment) const noexcept; + + bool deserialize( + eprosima::fastcdr::Cdr& cdr); + + void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + void serialize_key( + eprosima::fastcdr::Cdr& cdr) const noexcept; + + //}}} + + //}}} + +protected: + + traits::ref_type _this(); + +private: + + //{{{ Auxiliary functions + + /*! + * Auxiliary function to apply the bitset mask when setting a value. + */ + template + void apply_bitset_mask( + MemberId member_id, + TypeForKind& value) const noexcept; + + void add_sequence_value( + const traits::ref_type& sequence_type, + uint32_t sequence_size) noexcept; + + std::map>::iterator add_value( + TypeKind kind, + MemberId id) noexcept; + + /*! + * Auxiliary function for getting the initial number of elements for TK_ARRAY. + */ + uint32_t calculate_array_max_elements( + TypeKind type_kind) noexcept; + + /*! + * Auxiliary function for checking the new discriminator value set by the user is correct. + */ + template::value, bool>::type = true> + bool check_new_discriminator_value( + const T& value) + { + bool ret_value = false; + + if (MEMBER_ID_INVALID != selected_union_member_) // There is a member selected by current discriminator. + { + traits::ref_type selected_member; + enclosing_type_->get_member(selected_member, selected_union_member_); + auto sm_impl = traits::narrow(selected_member); + + for (auto label : sm_impl->get_descriptor().label()) + { + if (static_cast(value) == label) + { + ret_value = true; + break; + } + } + } + + if (MEMBER_ID_INVALID == selected_union_member_ || + (MEMBER_ID_INVALID == enclosing_type_->default_union_member() && !ret_value)) // It is selected the implicit default member. + { + ret_value = true; + + if (enclosing_type_->default_value() != static_cast(value)) + { + for (auto member : enclosing_type_->get_all_members_by_index()) + { + auto m_impl = traits::narrow(member); + + for (auto label : m_impl->get_descriptor().label()) + { + if (static_cast(value) == label) + { + ret_value = false; + break; + } + } + } + } + + if (ret_value) + { + selected_union_member_ = MEMBER_ID_INVALID; + } + } + + return ret_value; + } + + template::value, bool>::type = true> + bool check_new_discriminator_value( + const T&) + { + return false; + } + + /*! + * Auxiliary function to clear completely a sequence. + * Only valid for TK_ARRAY or TK_SEQUENCE. + */ + ReturnCode_t clear_all_sequence( + TypeKind type_kind) noexcept; + + ReturnCode_t clear_all_values( + bool only_non_keyed) noexcept; + + /*! + * Auxiliary function to clear a sequence element. + * Only valid for TK_ARRAY and TK_SEQUENCE. + */ + ReturnCode_t clear_sequence_element( + TypeKind type_kind, + MemberId id) noexcept; + + /*! + * Auxiliary function to clone a primitive. + */ + std::shared_ptr clone_primitive( + TypeKind type_kind, + const std::shared_ptr& primitive) const noexcept; + + /*! + * Auxiliary function to clone a array/sequence. + */ + std::shared_ptr clone_sequence( + TypeKind element_kind, + const std::shared_ptr& sequence) const noexcept; + + /*! + * Auxiliary function to compare two sequence values. + */ + bool compare_sequence_values( + TypeKind kind, + std::shared_ptr left, + std::shared_ptr right) const noexcept; + + /*! + * Auxiliary function to compare two primitive values. + */ + bool compare_values( + TypeKind kind, + std::shared_ptr left, + std::shared_ptr right) const noexcept; + + template + ReturnCode_t get_bitmask_bit( + TypeForKind& value, + MemberId id) noexcept; + + /*! + * @brief Given a type, returns the enclosing type if exists. + */ + static traits::ref_type get_enclosing_type( + traits::ref_type type) noexcept; + + /*! + * @brief Given a type, returns the enclosing type kind if exists. + */ + static TypeKind get_enclosing_typekind( + traits::ref_type type) noexcept; + + template + ReturnCode_t get_primitive_value( + TypeKind element_kind, + std::map>::iterator value_iterator, + TypeForKind& value, + MemberId member_id) noexcept; + + /*! + * @brief Auxiliary template to retrieve the length of a internal sequence. + * Only valid for TK_ARRAY and TK_SEQUENCE. + */ + uint32_t get_sequence_length(); + + /*! + * Auxiliary template with the common code for getting the values of a sequence. + */ + template + ReturnCode_t get_sequence_values( + SequenceTypeForKind& value, + MemberId id) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a bitmask sequence from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a primitive sequence from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + /*! + * Auxiliary template with the common code for getting the values of a primitive sequence supporting promotion + * from a TK_ARRAY or TK_SEQUENCE. + * @param[in] number_of_elements Number of elements. 0 value means all elements. + */ + template + ReturnCode_t get_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + SequenceTypeForKind& value, + size_t number_of_elements) noexcept; + + template + ReturnCode_t get_value( + TypeForKind& value, + MemberId id) noexcept; + + /*! + * Auxiliary function for setting a bitmask bit. + */ + template + ReturnCode_t set_bitmask_bit( + MemberId id, + const TypeForKind& value) noexcept; + + void set_default_value( + const traits::ref_type member, + traits::ref_type data) noexcept; + + /*! + * Auxiliary function for setting the discriminator value to a label of the member specified by the MemberId. + */ + void set_discriminator_value( + MemberId id) noexcept; + + /*! + * Auxiliary function to set the discriminator value on already given discriminator DynamicData. + */ + void set_discriminator_value( + int32_t new_discriminator_value, + const traits::ref_type& discriminator_type, + traits::ref_type& data) noexcept; + + /*! + * Auxiliary function to set a primitive value taking into account if there is promotion of the type. + */ + template + ReturnCode_t set_primitive_value( + const traits::ref_type& element_type, + std::map>::iterator value_iterator, + const TypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a sequence. + */ + template + ReturnCode_t set_sequence_values( + MemberId id, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a bitmask sequence into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_bitmask( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a primitive sequence into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_primitive( + MemberId id, + TypeKind element_kind, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the values of a primitive sequence supporting promotion + * into a TK_ARRAY or TK_SEQUENCE. + */ + template + ReturnCode_t set_sequence_values_promoting( + MemberId id, + std::map>::const_iterator value_iterator, + const SequenceTypeForKind& value) noexcept; + + + /*! + * Auxiliary function to set the default value,specified by MemberDescriptor::default_value, to primitive types. + */ + void set_value( + const ObjectName& value) noexcept; + + /*! + * Auxiliary template with the common code for setting the value of a primitive type + */ + template + ReturnCode_t set_value( + MemberId id, + const TypeForKind& value) noexcept; + + //}}} + + //{{{ Encoding/decoding functions + + size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const traits::ref_type type, + size_t& current_alignment) const noexcept; + + bool deserialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type); + + void serialize( + eprosima::fastcdr::Cdr& cdr, + const traits::ref_type type) const; + + //}}} + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICDATAIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp new file mode 100644 index 00000000000..74ce6f2a65a --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicPubSubType.cpp @@ -0,0 +1,267 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "common.hpp" +#include "DynamicDataImpl.hpp" +#include "DynamicTypeImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +//{{{ Public functions + +DynamicPubSubType::DynamicPubSubType( + traits::ref_type type) + : dynamic_type_(type) +{ + update_dynamic_type(); +} + +DynamicPubSubType::~DynamicPubSubType() +{ + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } +} + +void* DynamicPubSubType::createData() +{ + if (!dynamic_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "DynamicPubSubType cannot create data. Unspecified type."); + return nullptr; + } + else + { + traits::ref_type* ret_val = new traits::ref_type(); + *ret_val = + traits::narrow(DynamicDataFactory::get_instance()->create_data( + dynamic_type_)); + return ret_val; + } +} + +void DynamicPubSubType::deleteData( + void* data) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + DynamicDataFactory::get_instance()->delete_data(*data_ptr); + delete data_ptr; +} + +bool DynamicPubSubType::deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); // Object that deserializes the data. + + try + { + // Deserialize encapsulation. + deser.read_encapsulation(); + payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + deser >> *data_ptr; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + return true; +} + +traits::ref_type DynamicPubSubType::get_dynamic_type() const noexcept +{ + return dynamic_type_; +} + +bool DynamicPubSubType::getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* handle, + bool force_md5) +{ + if (!dynamic_type_ || !m_isGetKeyDefined) + { + return false; + } + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + size_t keyBufferSize = + static_cast((*data_ptr)->calculate_key_serialized_size(calculator, current_alignment)); + + if (nullptr == key_buffer_) + { + key_buffer_ = reinterpret_cast(malloc(keyBufferSize > 16 ? keyBufferSize : 16)); + memset(key_buffer_, 0, keyBufferSize > 16 ? keyBufferSize : 16); + } + + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), keyBufferSize); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv2); // Object that serializes the data. + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + (*data_ptr)->serialize_key(ser); + if (force_md5 || keyBufferSize > 16) + { + md5_.init(); + md5_.update(key_buffer_, (unsigned int)ser.get_serialized_data_length()); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle->value[i] = key_buffer_[i]; + } + } + return true; +} + +std::function DynamicPubSubType::getSerializedSizeProvider( + void* data) +{ + return getSerializedSizeProvider(data, DEFAULT_DATA_REPRESENTATION); +} + +std::function DynamicPubSubType::getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(data); + + return [data_ptr, data_representation]() -> uint32_t + { + 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( + *data_ptr, current_alignment)) + 4u /*encapsulation*/; + + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + }; +} + +bool DynamicPubSubType::serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + fastdds::dds::DataRepresentationId_t data_representation) +{ + traits::ref_type* data_ptr = static_cast::ref_type*>(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 == + fastdds::dds::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; + + auto type_impl = traits::narrow(dynamic_type_); + ser.set_encoding_flag(get_fastcdr_encoding_flag(type_impl->get_descriptor().extensibility_kind(), + fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION == data_representation? + eprosima::fastcdr::CdrVersion:: XCDRv1 : + eprosima::fastcdr::CdrVersion::XCDRv2)); + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + + ser << *data_ptr; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } + + payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + return true; +} + +ReturnCode_t DynamicPubSubType::set_dynamic_type( + traits::ref_type type) +{ + if (!dynamic_type_) + { + dynamic_type_ = type; + update_dynamic_type(); + return RETCODE_OK; + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error Setting the dynamic type. There is already a registered type"); + } + + return RETCODE_BAD_PARAMETER; +} + +//}}} + +void DynamicPubSubType::update_dynamic_type() +{ + m_isGetKeyDefined = false; + + if (nullptr == dynamic_type_) + { + return; + } + + m_typeSize = static_cast(DynamicDataImpl::calculate_max_serialized_size(dynamic_type_) + 4); + setName(dynamic_type_->get_name()); + + if (TK_STRUCTURE == dynamic_type_->get_kind()) + { + auto type_impl = traits::narrow(dynamic_type_); + for (auto& member : type_impl->get_all_members_by_index()) + { + auto member_impl = traits::narrow(member); + if (member_impl->get_descriptor().is_key()) + { + m_isGetKeyDefined = true; + break; + } + } + } +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp new file mode 100644 index 00000000000..a4ec26be2d0 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactory.cpp @@ -0,0 +1,36 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "DynamicTypeBuilderFactoryImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicTypeBuilderFactory::get_instance() +{ + return DynamicTypeBuilderFactoryImpl::get_instance(); +} + +ReturnCode_t DynamicTypeBuilderFactory::delete_instance() +{ + // Delegate into the implementation class + return DynamicTypeBuilderFactoryImpl::delete_instance(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp new file mode 100644 index 00000000000..94e7af98ee9 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.cpp @@ -0,0 +1,1574 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicTypeBuilderFactoryImpl.hpp" + +#include +#include +#include + +#include + +#include "DynamicTypeBuilderImpl.hpp" +#include +#include +#include +#include +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +traits::ref_type DynamicTypeBuilderFactoryImpl::instance_; + +//{{{ Functions to create types + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type( + traits::ref_type descriptor) noexcept +{ + auto descriptor_impl = traits::narrow(descriptor); + + if (descriptor_impl->is_consistent()) + { + return std::make_shared(*descriptor_impl); + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_copy( + traits::ref_type type) noexcept +{ + auto ret_val = std::make_shared(TypeDescriptorImpl{TK_NONE, ""}); + ret_val->copy_from(traits::narrow(type)); + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept +{ + traits::ref_type nil; + static_cast(document); + static_cast(type_name); + static_cast(include_paths); + return nil; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_type_object( + const xtypes::TypeObject& type_object) noexcept +{ + traits::ref_type ret_val; + + try + { + xtypes::TypeObjectUtils::type_object_consistency(type_object); + switch (type_object._d()) + { + case xtypes::EK_COMPLETE: + switch (type_object.complete()._d()) + { + case xtypes::TK_ALIAS: + ret_val = create_alias_type_w_complete_type_object(type_object.complete().alias_type()); + break; + case xtypes::TK_ANNOTATION: + ret_val = + create_annotation_type_w_complete_type_object(type_object.complete().annotation_type()); + break; + case xtypes::TK_STRUCTURE: + ret_val = create_structure_type_w_complete_type_object(type_object.complete().struct_type()); + break; + case xtypes::TK_UNION: + ret_val = create_union_type_w_complete_type_object(type_object.complete().union_type()); + break; + case xtypes::TK_BITSET: + ret_val = create_bitset_type_w_complete_type_object(type_object.complete().bitset_type()); + break; + case xtypes::TK_SEQUENCE: + ret_val = create_sequence_type_w_complete_type_object(type_object.complete().sequence_type()); + break; + case xtypes::TK_ARRAY: + ret_val = create_array_type_w_complete_type_object(type_object.complete().array_type()); + break; + case xtypes::TK_MAP: + ret_val = create_map_type_w_complete_type_object(type_object.complete().map_type()); + break; + case xtypes::TK_ENUM: + ret_val = create_enum_type_w_complete_type_object(type_object.complete().enumerated_type()); + break; + case xtypes::TK_BITMASK: + ret_val = create_bitmask_type_w_complete_type_object(type_object.complete().bitmask_type()); + break; + default: + break; + } + break; + case xtypes::EK_MINIMAL: + switch (type_object.minimal()._d()) + { + case xtypes::TK_ALIAS: + ret_val = create_alias_type_w_minimal_type_object(type_object.minimal().alias_type()); + break; + case xtypes::TK_ANNOTATION: + ret_val = create_annotation_type_w_minimal_type_object(type_object.minimal().annotation_type()); + break; + case xtypes::TK_STRUCTURE: + ret_val = create_structure_type_w_minimal_type_object(type_object.minimal().struct_type()); + break; + case xtypes::TK_UNION: + ret_val = create_union_type_w_minimal_type_object(type_object.minimal().union_type()); + break; + case xtypes::TK_BITSET: + ret_val = create_bitset_type_w_minimal_type_object(type_object.minimal().bitset_type()); + break; + case xtypes::TK_SEQUENCE: + ret_val = create_sequence_type_w_minimal_type_object(type_object.minimal().sequence_type()); + break; + case xtypes::TK_ARRAY: + ret_val = create_array_type_w_minimal_type_object(type_object.minimal().array_type()); + break; + case xtypes::TK_MAP: + ret_val = create_map_type_w_minimal_type_object(type_object.minimal().map_type()); + break; + case xtypes::TK_ENUM: + ret_val = create_enum_type_w_minimal_type_object(type_object.minimal().enumerated_type()); + break; + case xtypes::TK_BITMASK: + ret_val = create_bitmask_type_w_minimal_type_object(type_object.minimal().bitmask_type()); + break; + default: + break; + } + break; + default: + break; + } + } + catch (const xtypes::InvalidArgumentError& e) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent TypeObject: " << e.what()); + ret_val.reset(); + } + + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept +{ + traits::ref_type nil; + static_cast(document_url); + static_cast(type_name); + static_cast(include_paths); + return nil; +} + +//}}} + +//{{{ Functions to create specific types + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_array_type( + traits::ref_type element_type, + const BoundSeq& bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_ARRAY, ""})}; + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound() = bound; + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitmask_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_BITMASK, ""})}; + ret_val->get_descriptor().element_type(bool_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_map_type( + traits::ref_type key_element_type, + traits::ref_type element_type, + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_MAP, ""})}; + ret_val->get_descriptor().key_element_type(key_element_type); + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_sequence_type( + traits::ref_type element_type, + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_SEQUENCE, ""})}; + ret_val->get_descriptor().element_type(element_type); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_string_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_STRING8, ""})}; + ret_val->get_descriptor().element_type(char8_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_wstring_type( + uint32_t bound) noexcept +{ + traits::ref_type ret_val {std::make_shared( + TypeDescriptorImpl{TK_STRING16, ""})}; + ret_val->get_descriptor().element_type(char16_type_); + ret_val->get_descriptor().bound().push_back(bound); + + if (ret_val->get_descriptor().is_consistent()) + { + return ret_val; + } + + return {}; +} + +//}}} + +ReturnCode_t DynamicTypeBuilderFactoryImpl::delete_instance() noexcept +{ + if (!instance_) + { + return RETCODE_BAD_PARAMETER; + } + instance_.reset(); + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderFactoryImpl::delete_type( + traits::ref_type type) noexcept +{ + type.reset(); + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::get_instance() noexcept +{ + if (!instance_) + { + instance_ = std::make_shared(); + } + + return instance_; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::get_primitive_type( + TypeKind kind) noexcept +{ + traits::ref_type ret_val; + + switch (kind) + { + case TK_BOOLEAN: + ret_val = bool_type_; + break; + case TK_BYTE: + ret_val = byte_type_; + break; + case TK_INT16: + ret_val = int16_type_; + break; + case TK_INT32: + ret_val = int32_type_; + break; + case TK_INT64: + ret_val = int64_type_; + break; + case TK_UINT16: + ret_val = uint16_type_; + break; + case TK_UINT32: + ret_val = uint32_type_; + break; + case TK_UINT64: + ret_val = uint64_type_; + break; + case TK_FLOAT32: + ret_val = float32_type_; + break; + case TK_FLOAT64: + ret_val = float64_type_; + break; + case TK_FLOAT128: + ret_val = float128_type_; + break; + case TK_INT8: + ret_val = int8_type_; + break; + case TK_UINT8: + ret_val = uint8_type_; + break; + case TK_CHAR8: + ret_val = char8_type_; + break; + case TK_CHAR16: + ret_val = char16_type_; + break; + default: + break; + } + + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::_this() +{ + return shared_from_this(); +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_alias_type_w_complete_type_object( + const xtypes::CompleteAliasType& alias_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ALIAS); + type_descriptor.name(alias_type.header().detail().type_name()); + // Aliased type + traits::ref_type base_type = base_type_from_type_identifier(alias_type.body().common().related_type()); + if (base_type) + { + type_descriptor.base_type(base_type); + + ret_val = std::make_shared(type_descriptor); + + apply_builtin_type_annotations(ret_val, alias_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, alias_type.header().detail().ann_custom())) + { + apply_custom_annotations(ret_val, alias_type.body().ann_custom()); + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_alias_type_w_minimal_type_object( + const xtypes::MinimalAliasType& alias_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ALIAS); + // Aliased type + traits::ref_type base_type = base_type_from_type_identifier(alias_type.body().common().related_type()); + if (base_type) + { + type_descriptor.base_type(base_type); + + ret_val = std::make_shared(type_descriptor); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_annotation_type_w_complete_type_object( + const xtypes::CompleteAnnotationType& annotation_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ANNOTATION); + type_descriptor.name(annotation_type.header().annotation_name()); + + ret_val = std::make_shared(type_descriptor); + + for (const xtypes::CompleteAnnotationParameter& parameter : annotation_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + traits::ref_type type = base_type_from_type_identifier(parameter.common().member_type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent annotation parameter TypeIdentifier " + parameter.name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->name(parameter.name()); + member_descriptor->default_value(get_annotation_parameter_value(parameter.default_value())); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding annotation parameter " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_annotation_type_w_minimal_type_object( + const xtypes::MinimalAnnotationType& annotation_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ANNOTATION); + + ret_val = std::make_shared(type_descriptor); + + for (const xtypes::MinimalAnnotationParameter& parameter : annotation_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(parameter.name_hash())); + traits::ref_type type = base_type_from_type_identifier(parameter.common().member_type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent annotation parameter TypeIdentifier " + + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->default_value(get_annotation_parameter_value(parameter.default_value())); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding annotation parameter " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_structure_type_w_complete_type_object( + const xtypes::CompleteStructType& struct_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_STRUCTURE); + type_descriptor.name(struct_type.header().detail().type_name()); + type_descriptor.is_nested(struct_type.struct_flags() & xtypes::IS_NESTED); + type_descriptor.extensibility_kind(struct_type.struct_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL : + (struct_type.struct_flags() & + xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE)); + + ret_val = std::make_shared(type_descriptor); + + if (xtypes::TK_NONE != struct_type.header().base_type()._d()) + { + traits::ref_type base_type = base_type_from_type_identifier(struct_type.header().base_type()); + if (base_type) + { + ret_val->get_descriptor().base_type(base_type); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier"); + ret_val.reset(); + } + } + + if (ret_val) + { + apply_builtin_type_annotations(ret_val, struct_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, struct_type.header().detail().ann_custom())) + { + for (const xtypes::CompleteStructMember& member : struct_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(member.detail().name()); + traits::ref_type type = base_type_from_type_identifier(member.common().member_type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent struct member TypeIdentifier " + + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->id(member.common().member_id()); + apply_try_construct_flag(member_descriptor, member.common().member_flags()); + member_descriptor->is_key(member.common().member_flags() & xtypes::IS_KEY); + member_descriptor->is_optional(member.common().member_flags() & xtypes::IS_OPTIONAL); + member_descriptor->is_must_understand(member.common().member_flags() & xtypes::IS_MUST_UNDERSTAND); + member_descriptor->is_shared(member.common().member_flags() & xtypes::IS_EXTERNAL); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error adding struct member " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + if (!apply_custom_annotations(ret_val, member.detail().ann_custom(), member_descriptor->id())) + { + break; + } + } + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_structure_type_w_minimal_type_object( + const xtypes::MinimalStructType& struct_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_STRUCTURE); + type_descriptor.is_nested(struct_type.struct_flags() & xtypes::IS_NESTED); + type_descriptor.extensibility_kind(struct_type.struct_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL : + (struct_type.struct_flags() & + xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE)); + bool inheritance_correct {true}; + if (xtypes::TK_NONE != struct_type.header().base_type()._d()) + { + traits::ref_type base_type = base_type_from_type_identifier(struct_type.header().base_type()); + if (base_type) + { + type_descriptor.base_type(base_type); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent base TypeIdentifier"); + inheritance_correct = false; + } + } + if (inheritance_correct) + { + ret_val = std::make_shared(type_descriptor); + } + + if (ret_val) + { + for (const xtypes::MinimalStructMember& member : struct_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(member.detail().name_hash())); + traits::ref_type type = base_type_from_type_identifier(member.common().member_type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent struct member TypeIdentifier " + + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->id(member.common().member_id()); + apply_try_construct_flag(member_descriptor, member.common().member_flags()); + member_descriptor->is_key(member.common().member_flags() & xtypes::IS_KEY); + member_descriptor->is_optional(member.common().member_flags() & xtypes::IS_OPTIONAL); + member_descriptor->is_must_understand(member.common().member_flags() & xtypes::IS_MUST_UNDERSTAND); + member_descriptor->is_shared(member.common().member_flags() & xtypes::IS_EXTERNAL); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding struct member " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_union_type_w_complete_type_object( + const xtypes::CompleteUnionType& union_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_UNION); + type_descriptor.name(union_type.header().detail().type_name()); + type_descriptor.is_nested(union_type.union_flags() & xtypes::IS_NESTED); + type_descriptor.extensibility_kind(union_type.union_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL : + (union_type.union_flags() & + xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE)); + + traits::ref_type discriminator_type = base_type_from_type_identifier( + union_type.discriminator().common().type_id()); + if (discriminator_type) + { + type_descriptor.discriminator_type(discriminator_type); + ret_val = std::make_shared(type_descriptor); + apply_builtin_type_annotations(ret_val, union_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, union_type.header().detail().ann_custom())) + { + apply_builtin_type_annotations(ret_val, union_type.discriminator().ann_builtin()); + if (apply_custom_annotations(ret_val, union_type.discriminator().ann_custom(), 0)) + { + for (const xtypes::CompleteUnionMember& member : union_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(member.detail().name()); + traits::ref_type type = base_type_from_type_identifier(member.common().type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent union member TypeIdentifier " + + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->id(member.common().member_id()); + apply_try_construct_flag(member_descriptor, member.common().member_flags()); + member_descriptor->is_default_label(member.common().member_flags() & xtypes::IS_DEFAULT); + member_descriptor->is_shared(member.common().member_flags() & xtypes::IS_EXTERNAL); + member_descriptor->label(member.common().label_seq()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error adding union member " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + if (!apply_custom_annotations(ret_val, member.detail().ann_custom(), member_descriptor->id())) + { + break; + } + } + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent discriminator TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_union_type_w_minimal_type_object( + const xtypes::MinimalUnionType& union_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_UNION); + type_descriptor.is_nested(union_type.union_flags() & xtypes::IS_NESTED); + type_descriptor.extensibility_kind(union_type.union_flags() & xtypes::IS_FINAL ? ExtensibilityKind::FINAL : + (union_type.union_flags() & + xtypes::IS_MUTABLE ? ExtensibilityKind::MUTABLE : ExtensibilityKind::APPENDABLE)); + + traits::ref_type discriminator_type = base_type_from_type_identifier( + union_type.discriminator().common().type_id()); + if (discriminator_type) + { + type_descriptor.discriminator_type(discriminator_type); + ret_val = std::make_shared(type_descriptor); + for (const xtypes::MinimalUnionMember& member : union_type.member_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(member.detail().name_hash())); + traits::ref_type type = base_type_from_type_identifier(member.common().type_id()); + if (!type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Inconsistent union member TypeIdentifier " + + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + member_descriptor->type(type); + member_descriptor->id(member.common().member_id()); + apply_try_construct_flag(member_descriptor, member.common().member_flags()); + member_descriptor->is_default_label(member.common().member_flags() & xtypes::IS_DEFAULT); + member_descriptor->is_shared(member.common().member_flags() & xtypes::IS_EXTERNAL); + member_descriptor->label(member.common().label_seq()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding union member " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent discriminator TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitset_type_w_complete_type_object( + const xtypes::CompleteBitsetType& bitset_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_BITSET); + type_descriptor.name(bitset_type.header().detail().type_name()); + + ret_val = std::make_shared(type_descriptor); + apply_builtin_type_annotations(ret_val, bitset_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, bitset_type.header().detail().ann_custom())) + { + for (const xtypes::CompleteBitfield& bitfield : bitset_type.field_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(bitfield.detail().name()); + member_descriptor->type(get_primitive_type(bitfield.common().holder_type())); + member_descriptor->id(bitfield.common().position()); + ret_val->get_descriptor().bound().push_back(bitfield.common().bitcount()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding bitfield " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + if (!apply_custom_annotations(ret_val, bitfield.detail().ann_custom(), member_descriptor->id())) + { + break; + } + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitset_type_w_minimal_type_object( + const xtypes::MinimalBitsetType& bitset_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_BITSET); + ret_val = std::make_shared(type_descriptor); + for (const xtypes::MinimalBitfield& bitfield : bitset_type.field_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(bitfield.name_hash())); + member_descriptor->type(get_primitive_type(bitfield.common().holder_type())); + member_descriptor->id(bitfield.common().position()); + ret_val->get_descriptor().bound().push_back(bitfield.common().bitcount()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding bitfield " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_sequence_type_w_complete_type_object( + const xtypes::CompleteSequenceType& sequence_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_SEQUENCE); + type_descriptor.bound().push_back(sequence_type.header().common().bound() != xtypes::INVALID_LBOUND ? + sequence_type.header().common().bound() : LENGTH_UNLIMITED); + + ret_val = std::make_shared(type_descriptor); + + if (sequence_type.header().detail().has_value()) + { + ret_val->get_descriptor().name(sequence_type.header().detail().value().type_name()); + apply_builtin_type_annotations(ret_val, sequence_type.header().detail().value().ann_builtin()); + apply_custom_annotations(ret_val, sequence_type.header().detail().value().ann_custom()); + } + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = + base_type_from_type_identifier(sequence_type.element().common().type()); + if (ret_val && element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else if (!element_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_sequence_type_w_minimal_type_object( + const xtypes::MinimalSequenceType& sequence_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_SEQUENCE); + type_descriptor.bound().push_back(sequence_type.header().common().bound() != xtypes::INVALID_LBOUND ? + sequence_type.header().common().bound() : LENGTH_UNLIMITED); + + ret_val = std::make_shared(type_descriptor); + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = + base_type_from_type_identifier(sequence_type.element().common().type()); + if (element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_array_type_w_complete_type_object( + const xtypes::CompleteArrayType& array_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ARRAY); + type_descriptor.bound(array_type.header().common().bound_seq()); + + ret_val = std::make_shared(type_descriptor); + ret_val->get_descriptor().name(array_type.header().detail().type_name()); + apply_builtin_type_annotations(ret_val, array_type.header().detail().ann_builtin()); + apply_custom_annotations(ret_val, array_type.header().detail().ann_custom()); + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = base_type_from_type_identifier(array_type.element().common().type()); + if (ret_val && element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else if (!element_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_array_type_w_minimal_type_object( + const xtypes::MinimalArrayType& array_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ARRAY); + type_descriptor.bound(array_type.header().common().bound_seq()); + + ret_val = std::make_shared(type_descriptor); + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = base_type_from_type_identifier(array_type.element().common().type()); + if (element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else if (!element_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_map_type_w_complete_type_object( + const xtypes::CompleteMapType& map_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_MAP); + type_descriptor.bound().push_back(map_type.header().common().bound() != xtypes::INVALID_LBOUND ? + map_type.header().common().bound() : LENGTH_UNLIMITED); + + ret_val = std::make_shared(type_descriptor); + + if (map_type.header().detail().has_value()) + { + ret_val->get_descriptor().name(map_type.header().detail().value().type_name()); + apply_builtin_type_annotations(ret_val, map_type.header().detail().value().ann_builtin()); + apply_custom_annotations(ret_val, map_type.header().detail().value().ann_custom()); + } + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = base_type_from_type_identifier(map_type.element().common().type()); + if (ret_val && element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else if (!element_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + traits::ref_type key_type = base_type_from_type_identifier(map_type.key().common().type()); + if (ret_val && key_type) + { + ret_val->get_descriptor().key_element_type(key_type); + } + else if (!key_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent key TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_map_type_w_minimal_type_object( + const xtypes::MinimalMapType& map_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_MAP); + type_descriptor.bound().push_back(map_type.header().common().bound() != xtypes::INVALID_LBOUND ? + map_type.header().common().bound() : LENGTH_UNLIMITED); + + ret_val = std::make_shared(type_descriptor); + + // TODO(jlbueno): collection element annotations are not supported yet. + traits::ref_type element_type = base_type_from_type_identifier(map_type.element().common().type()); + if (ret_val && element_type) + { + ret_val->get_descriptor().element_type(element_type); + } + else if (!element_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent element TypeIdentifier"); + ret_val.reset(); + } + traits::ref_type key_type = base_type_from_type_identifier(map_type.key().common().type()); + if (ret_val && key_type) + { + ret_val->get_descriptor().key_element_type(key_type); + } + else if (!key_type) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent key TypeIdentifier"); + ret_val.reset(); + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_enum_type_w_complete_type_object( + const xtypes::CompleteEnumeratedType& enum_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ENUM); + type_descriptor.name(enum_type.header().detail().type_name()); + traits::ref_type literal_type; + if (enum_type.header().common().bit_bound() <= 8) + { + literal_type = get_primitive_type(TK_INT8); + } + else if (enum_type.header().common().bit_bound() <= 16) + { + literal_type = get_primitive_type(TK_INT16); + } + else + { + literal_type = get_primitive_type(TK_INT32); + } + + ret_val = std::make_shared(type_descriptor); + apply_builtin_type_annotations(ret_val, enum_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, enum_type.header().detail().ann_custom())) + { + for (const xtypes::CompleteEnumeratedLiteral& literal : enum_type.literal_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(literal.detail().name()); + member_descriptor->type(literal_type); + member_descriptor->default_value(std::to_string(literal.common().value())); + member_descriptor->is_default_label(literal.common().flags() & xtypes::IS_DEFAULT); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Error adding enumeration literal " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + // Literal annotations not supported. + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_enum_type_w_minimal_type_object( + const xtypes::MinimalEnumeratedType& enum_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_ENUM); + traits::ref_type literal_type; + if (enum_type.header().common().bit_bound() <= 8) + { + literal_type = get_primitive_type(TK_INT8); + } + else if (enum_type.header().common().bit_bound() <= 16) + { + literal_type = get_primitive_type(TK_INT16); + } + else + { + literal_type = get_primitive_type(TK_INT32); + } + + ret_val = std::make_shared(type_descriptor); + for (const xtypes::MinimalEnumeratedLiteral& literal : enum_type.literal_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(literal.detail().name_hash())); + member_descriptor->type(literal_type); + member_descriptor->default_value(std::to_string(literal.common().value())); + member_descriptor->is_default_label(literal.common().flags() & xtypes::IS_DEFAULT); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding enumeration literal " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitmask_type_w_complete_type_object( + const xtypes::CompleteBitmaskType& bitmask_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_BITMASK); + type_descriptor.name(bitmask_type.header().detail().type_name()); + type_descriptor.bound().push_back(bitmask_type.header().common().bit_bound()); + type_descriptor.element_type(get_primitive_type(TK_BOOLEAN)); + + ret_val = std::make_shared(type_descriptor); + apply_builtin_type_annotations(ret_val, bitmask_type.header().detail().ann_builtin()); + if (apply_custom_annotations(ret_val, bitmask_type.header().detail().ann_custom())) + { + for (const xtypes::CompleteBitflag& bitflag : bitmask_type.flag_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(bitflag.detail().name()); + member_descriptor->type(get_primitive_type(TK_BOOLEAN)); + member_descriptor->id(bitflag.common().position()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding bitflag " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + // Bitflag annotations not supported. + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::create_bitmask_type_w_minimal_type_object( + const xtypes::MinimalBitmaskType& bitmask_type) +{ + traits::ref_type ret_val; + + TypeDescriptorImpl type_descriptor; + type_descriptor.kind(TK_BITMASK); + type_descriptor.bound().push_back(bitmask_type.header().common().bit_bound()); + type_descriptor.element_type(get_primitive_type(TK_BOOLEAN)); + + ret_val = std::make_shared(type_descriptor); + for (const xtypes::MinimalBitflag& bitflag : bitmask_type.flag_seq()) + { + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name(get_string_from_name_hash(bitflag.detail().name_hash())); + member_descriptor->type(get_primitive_type(TK_BOOLEAN)); + member_descriptor->id(bitflag.common().position()); + if (RETCODE_OK != ret_val->add_member(member_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Error adding bitflag " + member_descriptor->name().to_string()); + ret_val.reset(); + break; + } + } + + if (ret_val && !ret_val->get_descriptor().is_consistent()) + { + ret_val.reset(); + } + return ret_val; +} + +traits::ref_type DynamicTypeBuilderFactoryImpl::base_type_from_type_identifier( + const xtypes::TypeIdentifier& type_identifier) +{ + traits::ref_type ret_val; + switch (type_identifier._d()) + { + case xtypes::TK_BOOLEAN: + ret_val = get_primitive_type(TK_BOOLEAN); + break; + case xtypes::TK_BYTE: + ret_val = get_primitive_type(TK_BYTE); + break; + case xtypes::TK_INT8: + ret_val = get_primitive_type(TK_INT8); + break; + case xtypes::TK_INT16: + ret_val = get_primitive_type(TK_INT16); + break; + case xtypes::TK_INT32: + ret_val = get_primitive_type(TK_INT32); + break; + case xtypes::TK_INT64: + ret_val = get_primitive_type(TK_INT64); + break; + case xtypes::TK_UINT8: + ret_val = get_primitive_type(TK_UINT8); + break; + case xtypes::TK_UINT16: + ret_val = get_primitive_type(TK_UINT16); + break; + case xtypes::TK_UINT32: + ret_val = get_primitive_type(TK_UINT32); + break; + case xtypes::TK_UINT64: + ret_val = get_primitive_type(TK_UINT64); + break; + case xtypes::TK_FLOAT32: + ret_val = get_primitive_type(TK_FLOAT32); + break; + case xtypes::TK_FLOAT64: + ret_val = get_primitive_type(TK_FLOAT64); + break; + case xtypes::TK_FLOAT128: + ret_val = get_primitive_type(TK_FLOAT128); + break; + case xtypes::TK_CHAR8: + ret_val = get_primitive_type(TK_CHAR8); + break; + case xtypes::TK_CHAR16: + ret_val = get_primitive_type(TK_CHAR16); + break; + case xtypes::TI_STRING8_SMALL: + ret_val = create_string_type(type_identifier.string_sdefn().bound() != xtypes::INVALID_LBOUND ? + type_identifier.string_sdefn().bound() : LENGTH_UNLIMITED)->build(); + break; + case xtypes::TI_STRING16_SMALL: + ret_val = create_wstring_type(type_identifier.string_sdefn().bound() != xtypes::INVALID_LBOUND ? + type_identifier.string_sdefn().bound() : LENGTH_UNLIMITED)->build(); + break; + case xtypes::TI_STRING8_LARGE: + ret_val = create_string_type(type_identifier.string_ldefn().bound())->build(); + break; + case xtypes::TI_STRING16_LARGE: + ret_val = create_wstring_type(type_identifier.string_ldefn().bound())->build(); + break; + // TODO(jlbueno): Collection annotations are not supported yet. + case xtypes::TI_PLAIN_SEQUENCE_SMALL: + { + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.seq_sdefn().element_identifier()); + ret_val = create_sequence_type(element_type, type_identifier.seq_sdefn().bound() != xtypes::INVALID_LBOUND ? + type_identifier.seq_sdefn().bound() : static_cast(LENGTH_UNLIMITED))->build(); + break; + } + case xtypes::TI_PLAIN_SEQUENCE_LARGE: + { + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.seq_ldefn().element_identifier()); + ret_val = create_sequence_type(element_type, type_identifier.seq_ldefn().bound())->build(); + break; + } + case xtypes::TI_PLAIN_ARRAY_SMALL: + { + BoundSeq array_bound_seq; + for (xtypes::SBound bound : type_identifier.array_sdefn().array_bound_seq()) + { + array_bound_seq.push_back(bound); + } + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.array_sdefn().element_identifier()); + ret_val = create_array_type(element_type, array_bound_seq)->build(); + break; + } + case xtypes::TI_PLAIN_ARRAY_LARGE: + { + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.array_ldefn().element_identifier()); + ret_val = create_array_type(element_type, type_identifier.array_ldefn().array_bound_seq())->build(); + break; + } + case xtypes::TI_PLAIN_MAP_SMALL: + { + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.map_sdefn().element_identifier()); + traits::ref_type key_type = base_type_from_type_identifier( + *type_identifier.map_sdefn().key_identifier()); + ret_val = create_map_type(key_type, element_type, + type_identifier.map_sdefn().bound() != xtypes::INVALID_LBOUND ? + type_identifier.map_sdefn().bound() : static_cast(LENGTH_UNLIMITED))->build(); + break; + } + case xtypes::TI_PLAIN_MAP_LARGE: + { + traits::ref_type element_type = base_type_from_type_identifier( + *type_identifier.map_ldefn().element_identifier()); + traits::ref_type key_type = base_type_from_type_identifier( + *type_identifier.map_ldefn().key_identifier()); + ret_val = create_map_type(key_type, element_type, type_identifier.map_ldefn().bound())->build(); + break; + } + case xtypes::EK_COMPLETE: + case xtypes::EK_MINIMAL: + { + // Find related type object + xtypes::TypeObject base_type_object; + if (RETCODE_OK != + fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer().get_type_object( + type_identifier, base_type_object)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Given TypeIdentifier unknown to TypeObjectRegistry"); + } + else + { + ret_val = create_type_w_type_object(base_type_object)->build(); + } + break; + } + case xtypes::TK_NONE: + case xtypes::TI_STRONGLY_CONNECTED_COMPONENT: + break; + } + return ret_val; +} + +bool DynamicTypeBuilderFactoryImpl::apply_custom_annotations( + traits::ref_type& ret_val, + const fastcdr::optional& ann_custom, + const MemberId& member_id) +{ + if (ann_custom.has_value()) + { + for (const xtypes::AppliedAnnotation& annotation : ann_custom.value()) + { + // Find annotation type object + xtypes::TypeObject annotation_type_object; + if (RETCODE_OK != + fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer().get_type_object( + annotation.annotation_typeid(), annotation_type_object)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Given annotation type identifier unknown to TypeObjectRegistry"); + ret_val.reset(); + break; + } + traits::ref_type annotation_descriptor {traits::make_shared()}; + annotation_descriptor->type(create_type_w_type_object(annotation_type_object)->build()); + if (annotation.param_seq().has_value()) + { + for (const xtypes::AppliedAnnotationParameter& parameter : annotation.param_seq().value()) + { + annotation_descriptor->set_value(get_string_from_name_hash(parameter.paramname_hash()), + get_annotation_parameter_value(parameter.value())); + } + } + if (member_id != MEMBER_ID_INVALID && + ret_val && RETCODE_OK != ret_val->apply_annotation_to_member(member_id, annotation_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent member applied annotation"); + ret_val.reset(); + break; + } + if (member_id == MEMBER_ID_INVALID && + ret_val && RETCODE_OK != ret_val->apply_annotation(annotation_descriptor)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistent type applied annotation"); + ret_val.reset(); + break; + } + } + } + if (ret_val) + { + return true; + } + return false; +} + +void DynamicTypeBuilderFactoryImpl::apply_builtin_type_annotations( + traits::ref_type& ret_val, + const fastcdr::optional& ann_builtin) +{ + if (ann_builtin.has_value()) + { + if (ann_builtin.value().verbatim().has_value()) + { + if (ann_builtin.value().verbatim().value().language().to_string() == "C++" || + ann_builtin.value().verbatim().value().language().to_string() == "c++" || + ann_builtin.value().verbatim().value().language().to_string() == "*") + { + VerbatimTextDescriptorImpl verbatim; + verbatim.placement(ann_builtin.value().verbatim().value().placement().to_string()); + verbatim.text(ann_builtin.value().verbatim().value().text()); + ret_val->get_verbatim().emplace_back(); + ret_val->get_verbatim().back().copy_from(verbatim); + } + } + } +} + +void DynamicTypeBuilderFactoryImpl::apply_try_construct_flag( + MemberDescriptor::_ref_type& ret_val, + const xtypes::MemberFlag& flags) +{ + if (flags & xtypes::TRY_CONSTRUCT1 && flags & xtypes::TRY_CONSTRUCT2) + { + ret_val->try_construct_kind(TryConstructKind::TRIM); + } + else if (flags & xtypes::TRY_CONSTRUCT2) + { + ret_val->try_construct_kind(TryConstructKind::USE_DEFAULT); + } + else + { + ret_val->try_construct_kind(TryConstructKind::DISCARD); + } +} + +std::string DynamicTypeBuilderFactoryImpl::get_annotation_parameter_value( + const xtypes::AnnotationParameterValue& value) +{ + std::string ret_val; + switch (value._d()) + { + case xtypes::TK_BOOLEAN: + ret_val = std::to_string(value.boolean_value()); + break; + case xtypes::TK_BYTE: + ret_val = std::to_string(value.byte_value()); + break; + case xtypes::TK_INT8: + ret_val = std::to_string(value.int8_value()); + break; + case xtypes::TK_UINT8: + ret_val = std::to_string(value.uint8_value()); + break; + case xtypes::TK_INT16: + ret_val = std::to_string(value.int16_value()); + break; + case xtypes::TK_UINT16: + ret_val = std::to_string(value.uint_16_value()); + break; + case xtypes::TK_INT32: + ret_val = std::to_string(value.int32_value()); + break; + case xtypes::TK_UINT32: + ret_val = std::to_string(value.uint32_value()); + break; + case xtypes::TK_INT64: + ret_val = std::to_string(value.int64_value()); + break; + case xtypes::TK_UINT64: + ret_val = std::to_string(value.uint64_value()); + break; + case xtypes::TK_FLOAT32: + ret_val = std::to_string(value.float32_value()); + break; + case xtypes::TK_FLOAT64: + ret_val = std::to_string(value.float64_value()); + break; + case xtypes::TK_FLOAT128: + ret_val = std::to_string(value.float128_value()); + break; + case xtypes::TK_CHAR8: + ret_val = std::to_string(value.char_value()); + break; + case xtypes::TK_CHAR16: + ret_val = std::to_string(value.wchar_value()); + break; + case xtypes::TK_ENUM: + ret_val = std::to_string(value.enumerated_value()); + break; + case xtypes::TK_STRING8: + ret_val = value.string8_value().to_string(); + break; + case xtypes::TK_STRING16: + // There is no official support in the STL to convert from wstring to string. + EPROSIMA_LOG_ERROR(DYN_TYPES, + "No support to create DynamicTypeBuilder with a TypeObject using custom annotations with wstring parameter"); + break; + default: + break; + } + return ret_val; +} + +std::string DynamicTypeBuilderFactoryImpl::get_string_from_name_hash( + const xtypes::NameHash& name) +{ + std::stringstream ss; + ss << std::hex; + ss << name[0]; + for (size_t i {1}; i < name.size(); ++i) + { + ss << "." << name[i]; + } + return ss.str(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp new file mode 100644 index 00000000000..958697680c1 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderFactoryImpl.hpp @@ -0,0 +1,206 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERFACTORYIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERFACTORYIMPL_HPP + +#include + +#include + +#include +#include +#include +#include +#include + +#include "DynamicTypeBuilderImpl.hpp" +#include "DynamicTypeImpl.hpp" +#include "TypeDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +/** + * This class is conceived as a singleton in charged of creating the @ref DynamicTypeBuilderImpl objects. + * For simplicity direct primitive types instantiation is also possible. + */ +class DynamicTypeBuilderFactoryImpl : public traits::base_type +{ +public: + + //{{{ Functions to create types + + traits::ref_type create_type( + traits::ref_type descriptor) noexcept override; + + traits::ref_type create_type_copy( + traits::ref_type type) noexcept override; + + traits::ref_type create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept override; + + traits::ref_type create_type_w_type_object( + const xtypes::TypeObject& type_object) noexcept override; + + traits::ref_type create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) noexcept override; + + //}}} + + //{{{ Functions to create specific types + + traits::ref_type create_array_type( + traits::ref_type element_type, + const BoundSeq& bound) noexcept override; + + traits::ref_type create_bitmask_type( + uint32_t bound) noexcept override; + + traits::ref_type create_map_type( + traits::ref_type key_element_type, + traits::ref_type element_type, + uint32_t bound) noexcept override; + + traits::ref_type create_sequence_type( + traits::ref_type element_type, + uint32_t bound) noexcept override; + + traits::ref_type create_string_type( + uint32_t bound) noexcept override; + + traits::ref_type create_wstring_type( + uint32_t bound) noexcept override; + + //}}} + + static ReturnCode_t delete_instance() noexcept; + + ReturnCode_t delete_type( + traits::ref_type type) noexcept override; + + static traits::ref_type get_instance() noexcept; + + traits::ref_type get_primitive_type( + TypeKind kind) noexcept override; + +protected: + + traits::ref_type _this(); + +private: + + //------------------------------------------------------------------- + // Auxiliary methods for creating DynamicTypeBuilders with TypeObject + traits::ref_type create_alias_type_w_complete_type_object( + const xtypes::CompleteAliasType& alias_type); + traits::ref_type create_alias_type_w_minimal_type_object( + const xtypes::MinimalAliasType& alias_type); + traits::ref_type create_annotation_type_w_complete_type_object( + const xtypes::CompleteAnnotationType& annotation_type); + traits::ref_type create_annotation_type_w_minimal_type_object( + const xtypes::MinimalAnnotationType& annotation_type); + traits::ref_type create_structure_type_w_complete_type_object( + const xtypes::CompleteStructType& struct_type); + traits::ref_type create_structure_type_w_minimal_type_object( + const xtypes::MinimalStructType& struct_type); + traits::ref_type create_union_type_w_complete_type_object( + const xtypes::CompleteUnionType& union_type); + traits::ref_type create_union_type_w_minimal_type_object( + const xtypes::MinimalUnionType& union_type); + traits::ref_type create_bitset_type_w_complete_type_object( + const xtypes::CompleteBitsetType& bitset_type); + traits::ref_type create_bitset_type_w_minimal_type_object( + const xtypes::MinimalBitsetType& bitset_type); + traits::ref_type create_sequence_type_w_complete_type_object( + const xtypes::CompleteSequenceType& sequence_type); + traits::ref_type create_sequence_type_w_minimal_type_object( + const xtypes::MinimalSequenceType& sequence_type); + traits::ref_type create_array_type_w_complete_type_object( + const xtypes::CompleteArrayType& array_type); + traits::ref_type create_array_type_w_minimal_type_object( + const xtypes::MinimalArrayType& array_type); + traits::ref_type create_map_type_w_complete_type_object( + const xtypes::CompleteMapType& map_type); + traits::ref_type create_map_type_w_minimal_type_object( + const xtypes::MinimalMapType& map_type); + traits::ref_type create_enum_type_w_complete_type_object( + const xtypes::CompleteEnumeratedType& enum_type); + traits::ref_type create_enum_type_w_minimal_type_object( + const xtypes::MinimalEnumeratedType& enum_type); + traits::ref_type create_bitmask_type_w_complete_type_object( + const xtypes::CompleteBitmaskType& bitmask_type); + traits::ref_type create_bitmask_type_w_minimal_type_object( + const xtypes::MinimalBitmaskType& bitmask_type); + + traits::ref_type base_type_from_type_identifier( + const xtypes::TypeIdentifier& type_identifier); + + bool apply_custom_annotations( + traits::ref_type& ret_val, + const fastcdr::optional& ann_custom, + const MemberId& member_id = MEMBER_ID_INVALID); + void apply_builtin_type_annotations( + traits::ref_type& ret_val, + const fastcdr::optional& ann_builtin); + void apply_try_construct_flag( + MemberDescriptor::_ref_type& ret_val, + const xtypes::MemberFlag& flags); + + std::string get_annotation_parameter_value( + const xtypes::AnnotationParameterValue& value); + std::string get_string_from_name_hash( + const xtypes::NameHash& name); + //------------------------------------------------------------------- + + static traits::ref_type instance_; + + //{{{ Cached primitive types. + + traits::ref_type bool_type_ {std::make_shared(TypeDescriptorImpl{TK_BOOLEAN, + ""})}; + traits::ref_type byte_type_ {std::make_shared(TypeDescriptorImpl{TK_BYTE, ""})}; + traits::ref_type int16_type_ {std::make_shared(TypeDescriptorImpl{TK_INT16, ""})}; + traits::ref_type int32_type_ {std::make_shared(TypeDescriptorImpl{TK_INT32, ""})}; + traits::ref_type int64_type_ {std::make_shared(TypeDescriptorImpl{TK_INT64, ""})}; + traits::ref_type uint16_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT16, + ""})}; + traits::ref_type uint32_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT32, + ""})}; + traits::ref_type uint64_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT64, + ""})}; + traits::ref_type float32_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT32, + ""})}; + traits::ref_type float64_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT64, + ""})}; + traits::ref_type float128_type_ {std::make_shared(TypeDescriptorImpl{TK_FLOAT128, + ""})}; + traits::ref_type int8_type_ {std::make_shared(TypeDescriptorImpl{TK_INT8, ""})}; + traits::ref_type uint8_type_ {std::make_shared(TypeDescriptorImpl{TK_UINT8, ""})}; + traits::ref_type char8_type_ {std::make_shared(TypeDescriptorImpl{TK_CHAR8, ""})}; + traits::ref_type char16_type_ {std::make_shared(TypeDescriptorImpl{TK_CHAR16, + ""})}; + //}}} +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERFACTORYIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp new file mode 100644 index 00000000000..d78ad6d5fdf --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp @@ -0,0 +1,692 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicTypeBuilderImpl.hpp" + +#include +#include +#include + +#include +#include +#include + +#include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeImpl.hpp" +#include "DynamicTypeMemberImpl.hpp" +#include "MemberDescriptorImpl.hpp" +#include "TypeDescriptorImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeBuilderImpl::DynamicTypeBuilderImpl( + const TypeDescriptorImpl& type_descriptor) noexcept +{ + type_descriptor_.copy_from(type_descriptor); + + if ((TK_STRUCTURE == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind()) && + type_descriptor_.base_type()) + { + // Get the members of the base type. + auto base_type = + traits::narrow(type_descriptor_.base_type())->resolve_alias_enclosed_type(); + member_ = base_type->member_; + member_by_name_ = base_type->member_by_name_; + members_ = base_type->members_; + + // In case TK_BITSET, get the base type bounds. + type_descriptor_.bound().insert(type_descriptor_.bound().begin(), + base_type->get_descriptor().bound().begin(), + base_type->get_descriptor().bound().end()); + + // Get last member_id from the base type. + if (0 < members_.size()) + { + traits::ref_type member_impl {traits::narrow( + members_.back())}; + assert(MEMBER_ID_INVALID != member_impl->get_descriptor().id()); + next_id_ = member_impl->get_descriptor().id() + 1; + } + + next_index_ = static_cast(members_.size()); + } + else if (TK_UNION == type_descriptor_.kind()) + { + MemberDescriptorImpl discriminator_descriptor; + discriminator_descriptor.id(0); + discriminator_descriptor.index(0); + discriminator_descriptor.name("discriminator"); + discriminator_descriptor.type(type_descriptor.discriminator_type()); + + traits::ref_type dyn_member = std::make_shared( + discriminator_descriptor); + members_.push_back(dyn_member); + member_by_name_.emplace(std::make_pair(discriminator_descriptor.name(), dyn_member)); + member_.emplace(std::make_pair(discriminator_descriptor.id(), dyn_member)); + next_index_ = 1; + next_id_ = 1; + } +} + +ReturnCode_t DynamicTypeBuilderImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(type_descriptor_); + return RETCODE_OK; +} + +ObjectName DynamicTypeBuilderImpl::get_name() noexcept +{ + return type_descriptor_.name(); +} + +TypeKind DynamicTypeBuilderImpl::get_kind() noexcept +{ + return type_descriptor_.kind(); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept +{ + auto it = member_by_name_.find(name); + + if (member_by_name_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept +{ + member = member_by_name_; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member( + traits::ref_type& member, + MemberId id) noexcept +{ + auto it = member_.find(id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::get_all_members( + DynamicTypeMembersById& member) noexcept +{ + member = member_; + return RETCODE_OK; +} + +uint32_t DynamicTypeBuilderImpl::get_member_count() noexcept +{ + return static_cast(members_.size()); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept +{ + if (index >= members_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + member = members_.at(index); + return RETCODE_OK; +} + +uint32_t DynamicTypeBuilderImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeBuilderImpl::get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeBuilderImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= type_descriptor_.equals(impl->type_descriptor_); + if (ret_value) + { + ret_value &= annotation_.size() == impl->annotation_.size(); + if (ret_value) + { + for (size_t count {0}; ret_value && count < annotation_.size(); ++count) + { + ret_value &= annotation_.at(count).equals(impl->annotation_.at(count)); + } + } + + ret_value &= verbatim_.size() == impl->verbatim_.size(); + if (ret_value) + { + for (size_t count {0}; ret_value && count < verbatim_.size(); ++count) + { + ret_value &= verbatim_.at(count).equals(impl->verbatim_.at(count)); + } + } + + ret_value &= member_.size() == impl->member_.size(); + assert(TK_ANNOTATION == type_descriptor_.kind() || + TK_BITMASK == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind() || + TK_STRUCTURE == type_descriptor_.kind() || + TK_UNION == type_descriptor_.kind() || + 0 == member_.size()); + assert(TK_ANNOTATION == impl->type_descriptor_.kind() || + TK_BITMASK == impl->type_descriptor_.kind() || + TK_BITSET == impl->type_descriptor_.kind() || + TK_STRUCTURE == impl->type_descriptor_.kind() || + TK_UNION == impl->type_descriptor_.kind() || + 0 == impl->member_.size()); + + assert(member_by_name_.size() == members_.size()); + assert(impl->member_by_name_.size() == impl->members_.size()); + ret_value &= member_by_name_.size() == impl->member_by_name_.size(); + if (ret_value) + { + auto it = member_by_name_.begin(); + auto impl_it = impl->member_by_name_.begin(); + + while (ret_value && member_by_name_.end() != it) + { + ret_value &= it->second->equals(impl_it->second); + ++it; + ++impl_it; + } + } + } + + return ret_value; +} + +ReturnCode_t DynamicTypeBuilderImpl::add_member( + traits::ref_type descriptor) noexcept +{ + auto type_descriptor_kind = type_descriptor_.kind(); + + //{{{ Auxiliary structure to revert index/id increasing. + struct RollbackIncreasing + { + RollbackIncreasing( + uint32_t& value_reference) + : value_reference_{value_reference} + { + } + + ~RollbackIncreasing() + { + if (activate) + { + --value_reference_; + } + } + + bool activate {false}; + uint32_t& value_reference_; + } + //}}} + id_reverter{next_id_}, + index_reverter{next_index_}; + + if (TK_ANNOTATION != type_descriptor_kind && + TK_BITMASK != type_descriptor_kind && + TK_BITSET != type_descriptor_kind && + TK_ENUM != type_descriptor_kind && + TK_STRUCTURE != type_descriptor_kind && + TK_UNION != type_descriptor_kind) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Type of kind " << type_descriptor_kind << " does not support adding members"); + return RETCODE_PRECONDITION_NOT_MET; + } + + if (!descriptor) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor reference is nil"); + return RETCODE_BAD_PARAMETER; + } + + auto descriptor_impl = traits::narrow(descriptor); + + + //{{{ Check on BITMASK doesn't exceed bound. + assert(TK_BITMASK != type_descriptor_kind || 1 == type_descriptor_.bound().size()); + if (TK_BITMASK == type_descriptor_kind && members_.size() >= type_descriptor_.bound().at(0)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Adding new member in this BITMASK exceeds the bound."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + //{{{ Check on BITSET new member doesn't exceed the bound vector's size. + if (TK_BITSET == type_descriptor_kind && members_.size() == type_descriptor_.bound().size()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Adding new member in this BITSET exceeds the size of bounds."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + const auto& member_name = descriptor_impl->name(); + + //{{{ Check there is already a member with same name. + auto it_by_name = member_by_name_.find(member_name); + if (member_by_name_.end() != it_by_name) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "There is already a member with name " << member_name); + return RETCODE_BAD_PARAMETER; + } + //}}} + + auto member_id = descriptor_impl->id(); + + //{{{ If member_id is MEMBER_ID_INVALID and type is aggregated, find a new one. + if (TK_ANNOTATION == type_descriptor_kind || + TK_BITMASK == type_descriptor_kind || + TK_STRUCTURE == type_descriptor_kind || + TK_UNION == type_descriptor_kind) + { + if (MEMBER_ID_INVALID == member_id) + { + member_id = next_id_++; + id_reverter.activate = true; + + } + + // Check there is already a member with same id. + auto it_by_id = member_.find(member_id); + if (member_.end() != it_by_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "There is already a member with MemberId " << member_id); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Else if it is mandatory to a BITSET's member to have MemberId. + else if (TK_BITSET == type_descriptor_kind) + { + if (MEMBER_ID_INVALID == member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "MemberId for BITSET must be different than MEMBER_ID_INVALID"); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Else, TK_ENUM has to come with MEMBER_ID_INVALID. + else if (MEMBER_ID_INVALID != member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "MemberId must be MEMBER_ID_INVALID"); + return RETCODE_BAD_PARAMETER; + } + //}}} + + traits::ref_type dyn_member = std::make_shared(*descriptor_impl); + dyn_member->get_descriptor().id(member_id); + //{{{ Set index + dyn_member->get_descriptor().index(next_index_++); + index_reverter.activate = true; + //}}} + + //{{{ Check bound in case of BITMASK + if (TK_BITMASK == type_descriptor_kind && member_id >= type_descriptor_.bound().at(0)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "The BITMASK member id exceeds the bound."); + return RETCODE_BAD_PARAMETER; + } + //}}} + + //{{{ Specific checks for UNION + if (TK_UNION == type_descriptor_kind) + { + for (auto member : members_) + { + const auto member_impl {traits::narrow(member)}; + + // Check default label and label cases uniqueness. + if (descriptor_impl->is_default_label() && member_impl->member_descriptor_.is_default_label()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << + " already defined as default_label"); + return RETCODE_BAD_PARAMETER; + } + for (const int32_t new_label : descriptor_impl->label()) + { + for (const int32_t label : member_impl->member_descriptor_.label()) + { + if (new_label == label) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << " already contains the label " << + label); + return RETCODE_BAD_PARAMETER; + } + } + + // Recalculate the default discriminator value (for default case or default implicit member). + if (new_label >= default_value_) + { + default_value_ = new_label + 1; + } + } + } + + // In case of default case, store the related MemberId. + if (descriptor_impl->is_default_label()) + { + default_union_member_ = member_id; + } + } + //}}} + //{{{ Specific checks for BITSET + else if (TK_BITSET == type_descriptor_kind) + { + const MemberId new_member_id {dyn_member->get_descriptor().id()}; + const auto new_member_bound {type_descriptor_.bound().at(dyn_member->get_descriptor().index())}; + + for (auto member : member_) + { + const MemberId mid {member.first}; + const auto member_impl {traits::narrow(member.second)}; + const auto member_index {member_impl->get_descriptor().index()}; + + if (mid == new_member_id) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because it is equal to MemberId(" << + mid << ")"); + return RETCODE_BAD_PARAMETER; + } + else if (mid < new_member_id) + { + const auto bound {type_descriptor_.bound().at(member_index)}; + + if (new_member_id < mid + bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because is less than MemberId(" << + mid << ") + Bound(" << bound << ")"); + return RETCODE_BAD_PARAMETER; + } + } + else + { + if (mid < new_member_id + new_member_bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because there is a member with id " + << "less than MemberId(" << new_member_id << ") + Bound(" << new_member_bound << ")"); + return RETCODE_BAD_PARAMETER; + } + } + } + + //TODO(richiware) Not valid when bitset refactored to support more than 64bits. + if (64 < new_member_id + new_member_bound) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Inconsistency in the new MemberId because exceeds the maximum " + << "64 bits length is exceeded"); + return RETCODE_BAD_PARAMETER; + } + } + //}}} + //{{{ Specific checks for ENUM + if (TK_ENUM == type_descriptor_kind) + { + if (0 < members_.size()) + { + const auto member_impl = traits::narrow(members_.at(0)); + + if (member_impl->get_descriptor().type()->get_kind() != descriptor->type()->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor type kind differs from the current member types."); + return RETCODE_BAD_PARAMETER; + } + } + + if (!descriptor->default_value().empty()) + { + for (auto member : members_) + { + const auto member_impl {traits::narrow(member)}; + + // Check that there isn't already any member with the same default value. + if (0 == descriptor->default_value().compare(member_impl->get_descriptor().default_value())) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Member " << member_impl->member_descriptor_.name().c_str() << + " has already the value"); + return RETCODE_BAD_PARAMETER; + } + } + TypeForKind value = TypeValueConverter::sto(descriptor->default_value()); + + if (value >= default_value_) + { + default_value_ = value + 1; + } + } + else + { + dyn_member->get_descriptor().default_value(std::to_string(default_value_++)); + } + } + //}}} + + // Set before calling is_consistent(). + dyn_member->get_descriptor().parent_kind(type_descriptor_kind); + + if (!dyn_member->get_descriptor().is_consistent()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor is not consistent"); + return RETCODE_BAD_PARAMETER; + } + + assert(dyn_member->get_descriptor().index() <= members_.size()); + if (dyn_member->get_descriptor().index() < members_.size()) + { + auto it = members_.begin() + dyn_member->get_descriptor().index(); + it = members_.insert(it, dyn_member); + for (++it; it != members_.end(); ++it) + { + auto next_member = traits::narrow(*it); + next_member->get_descriptor().index(next_member->get_descriptor().index() + 1); + } + ++next_index_; + } + else + { + members_.push_back(dyn_member); + } + assert(next_index_ == traits::narrow( + *members_.rbegin())->get_descriptor().index() + 1); + + member_by_name_.emplace(std::make_pair(member_name, dyn_member)); + if (TK_ANNOTATION == type_descriptor_kind || + TK_BITMASK == type_descriptor_kind || + TK_BITSET == type_descriptor_kind || + TK_STRUCTURE == type_descriptor_kind || + TK_UNION == type_descriptor_kind) + { + member_.emplace(std::make_pair(member_id, dyn_member)); + } + + id_reverter.activate = false; + index_reverter.activate = false; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::apply_annotation( + traits::ref_type descriptor) noexcept +{ + if (!descriptor || !descriptor->is_consistent()) + { + return RETCODE_BAD_PARAMETER; + } + + auto descriptor_impl = traits::narrow(descriptor); + + if (annotation_.end() != std::find_if(annotation_.begin(), annotation_.end(), + [&descriptor_impl](AnnotationDescriptorImpl& x) + { + return x.equals(descriptor_impl); + })) + { + return RETCODE_BAD_PARAMETER; + } + + annotation_.emplace_back(); + annotation_.back().copy_from(*descriptor_impl); + + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeBuilderImpl::apply_annotation_to_member( + MemberId member_id, + traits::ref_type descriptor) noexcept +{ + auto type_descriptor_kind = type_descriptor_.kind(); + + if (!descriptor || !descriptor->is_consistent() || + (TK_STRUCTURE != type_descriptor_kind && TK_UNION != type_descriptor_kind)) + { + return RETCODE_BAD_PARAMETER; + } + + auto it = member_.find(member_id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + auto member_impl = traits::narrow(it->second); + auto descriptor_impl = traits::narrow(descriptor); + + if (member_impl->annotation_.end() != std::find_if(member_impl->annotation_.begin(), member_impl->annotation_.end(), + [&descriptor_impl](AnnotationDescriptorImpl& x) + { + return x.equals(descriptor_impl); + })) + { + return RETCODE_BAD_PARAMETER; + } + + member_impl->annotation_.emplace_back(); + member_impl->annotation_.back().copy_from(descriptor_impl); + + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderImpl::build() noexcept +{ + traits::ref_type ret_val; + + if (type_descriptor_.is_consistent()) + { + bool preconditions {true}; + + // In case of BITSET, verify the TypeDescriptor's bounds size is same as number of members. + preconditions &= TK_BITSET != type_descriptor_.kind() || type_descriptor_.bound().size() == members_.size(); + if (!preconditions) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Expected more members in BITSET according to the size of bounds."); + } + + // In case of ENUM and BITSET, it must have at least one member + preconditions &= (TK_ENUM != type_descriptor_.kind() && TK_BITSET != type_descriptor_.kind()) + || 0 < members_.size(); + if (!preconditions) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Expected at least one member."); + } + + if (preconditions) + { + ret_val = std::make_shared(type_descriptor_); + for (auto& annotation : annotation_) + { + ret_val->annotation_.emplace_back(); + ret_val->annotation_.back().copy_from(annotation); + } + ret_val->member_ = member_; + ret_val->member_by_name_ = member_by_name_; + ret_val->members_ = members_; + ret_val->default_value_ = default_value_; + ret_val->default_union_member_ = default_union_member_; + } + } + + return ret_val; +} + +ReturnCode_t DynamicTypeBuilderImpl::copy_from( + traits::ref_type type) +{ + type_descriptor_.copy_from(type->type_descriptor_); + for (auto& annotation : type->annotation_) + { + annotation_.emplace_back(); + annotation_.back().copy_from(annotation); + } + member_ = type->member_; + member_by_name_ = type->member_by_name_; + members_ = type->members_; + for (auto& verbatim : type->verbatim_) + { + verbatim_.emplace_back(); + verbatim_.back().copy_from(verbatim); + } + return RETCODE_OK; +} + +traits::ref_type DynamicTypeBuilderImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp new file mode 100644 index 00000000000..0698c7c6a7c --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.hpp @@ -0,0 +1,157 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERIMPL_HPP + +#include + +#include + +#include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeImpl.hpp" +#include "TypeDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeBuilderImpl : public traits::base_type +{ +public: + + DynamicTypeBuilderImpl( + const TypeDescriptorImpl&) noexcept; + + ReturnCode_t get_descriptor( + traits::ref_type& descriptor) noexcept override; + + ObjectName get_name() noexcept override; + + TypeKind get_kind() noexcept override; + + ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept override; + + ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept override; + + ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) noexcept override; + + ReturnCode_t get_all_members( + DynamicTypeMembersById& member) noexcept override; + + uint32_t get_member_count() noexcept override; + + ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept override; + + uint32_t get_annotation_count() noexcept override; + + ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept override; + + bool equals( + traits::ref_type other) noexcept override; + + ReturnCode_t add_member( + traits::ref_type descriptor) noexcept override; + + + ReturnCode_t apply_annotation( + traits::ref_type descriptor) noexcept override; + + ReturnCode_t apply_annotation_to_member( + MemberId member_id, + traits::ref_type descriptor) noexcept override; + + traits::ref_type build() noexcept override; + + /*! + * Initialize the instance copying the information from a @ref DynamicType. + * + * @param[in] @ref DynamicType reference used to initialize the instance. + * @return Currently always return RETCODE_OK. + */ + ReturnCode_t copy_from( + traits::ref_type type); + + const TypeDescriptorImpl& get_descriptor() const noexcept + { + return type_descriptor_; + } + + TypeDescriptorImpl& get_descriptor() noexcept + { + return type_descriptor_; + } + + const std::vector& get_verbatim() const noexcept + { + return verbatim_; + } + + std::vector& get_verbatim() noexcept + { + return verbatim_; + } + +protected: + + traits::ref_type _this(); + +private: + + //! Contains the annotations applied by the user. + std::vector annotation_; + + //! Contains the default value of discriminator (TK_UNION) or next literal (TK_ENUM). + //! This is calculated while the type is being built. + int32_t default_value_ {0}; + + //! Points to the default union member. + MemberId default_union_member_ {MEMBER_ID_INVALID}; + + //! Collection of all members sorted by MemberId. + DynamicTypeMembersById member_; + + //! Collection of all members sorted by name. + DynamicTypeMembersByName member_by_name_; + + //! Collection of all members sorted by index. + std::vector::ref_type> members_; + + //! Next MemberId to be used. + MemberId next_id_ {0}; + + //! Next index to be used. + uint32_t next_index_ {0}; + + //! Copy of the TypeDescriptor provided by the user. + TypeDescriptorImpl type_descriptor_; + + std::vector verbatim_; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEBUILDERIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp new file mode 100644 index 00000000000..d901ca98d1f --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.cpp @@ -0,0 +1,240 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicTypeImpl.hpp" + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeImpl::DynamicTypeImpl( + const TypeDescriptorImpl& descriptor) noexcept +{ + type_descriptor_.copy_from(descriptor); +} + +ReturnCode_t DynamicTypeImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(type_descriptor_); + return RETCODE_OK; +} + +ObjectName DynamicTypeImpl::get_name() noexcept +{ + return type_descriptor_.name(); +} + +TypeKind DynamicTypeImpl::get_kind() noexcept +{ + return type_descriptor_.kind(); +} + +ReturnCode_t DynamicTypeImpl::get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept +{ + auto it = member_by_name_.find(name); + + if (member_by_name_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept +{ + member = member_by_name_; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_member( + traits::ref_type& member, + MemberId id) noexcept +{ + auto it = member_.find(id); + + if (member_.end() == it) + { + return RETCODE_BAD_PARAMETER; + } + + member = it->second; + return RETCODE_OK; +} + +ReturnCode_t DynamicTypeImpl::get_all_members( + DynamicTypeMembersById& member) noexcept +{ + member = member_; + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_member_count() noexcept +{ + return static_cast(members_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept +{ + if (index >= members_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + member = members_.at(index); + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +uint32_t DynamicTypeImpl::get_verbatim_text_count() noexcept +{ + return static_cast(verbatim_.size()); +} + +ReturnCode_t DynamicTypeImpl::get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) noexcept +{ + if (!descriptor || idx >= verbatim_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(verbatim_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= type_descriptor_.equals(impl->type_descriptor_); + if (ret_value) + { + ret_value &= annotation_.size() == impl->annotation_.size(); + if (ret_value) + { + for (auto& annotation : annotation_) + { + ret_value &= impl->annotation_.end() != std::find_if(impl->annotation_.begin(), impl->annotation_.end(), + [&annotation](AnnotationDescriptorImpl& a) + { + return annotation.equals(a); + }); + } + } + + ret_value &= member_.size() == impl->member_.size(); + assert(TK_ANNOTATION == type_descriptor_.kind() || + TK_BITMASK == type_descriptor_.kind() || + TK_BITSET == type_descriptor_.kind() || + TK_STRUCTURE == type_descriptor_.kind() || + TK_UNION == type_descriptor_.kind() || + 0 == member_.size()); + assert(TK_ANNOTATION == impl->type_descriptor_.kind() || + TK_BITMASK == impl->type_descriptor_.kind() || + TK_BITSET == impl->type_descriptor_.kind() || + TK_STRUCTURE == impl->type_descriptor_.kind() || + TK_UNION == impl->type_descriptor_.kind() || + 0 == impl->member_.size()); + + assert(member_by_name_.size() == members_.size()); + ret_value &= member_by_name_.size() == impl->member_by_name_.size(); + if (ret_value) + { + auto it = member_by_name_.begin(); + auto impl_it = impl->member_by_name_.begin(); + + while (ret_value && member_by_name_.end() != it) + { + ret_value &= it->second->equals(impl_it->second); + ++it; + ++impl_it; + } + } + + ret_value &= verbatim_.size() == impl->verbatim_.size(); + if (ret_value) + { + for (auto& verbatim : verbatim_) + { + ret_value &= impl->verbatim_.end() != std::find_if(impl->verbatim_.begin(), impl->verbatim_.end(), + [&verbatim](VerbatimTextDescriptorImpl& v) + { + return verbatim.equals(v); + }); + } + } + } + + return ret_value; +} + +traits::ref_type DynamicTypeImpl::resolve_alias_enclosed_type() noexcept +{ + traits::ref_type ret_value = traits::narrow(_this()); + + if (TK_ALIAS == ret_value->get_kind()) + { + do { + ret_value = traits::narrow(ret_value->get_descriptor().base_type()); + } while (TK_ALIAS == ret_value->get_kind()); + } + + return ret_value; +} + +traits::ref_type DynamicTypeImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp new file mode 100644 index 00000000000..cce3f300351 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp @@ -0,0 +1,147 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_IMPL_HPP_ +#define _FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_IMPL_HPP_ + +#include + +#include +#include +#include + +#include "AnnotationDescriptorImpl.hpp" +#include "DynamicTypeMemberImpl.hpp" +#include "TypeDescriptorImpl.hpp" +#include "VerbatimTextDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeImpl : public virtual traits::base_type +{ + friend class DynamicTypeBuilderImpl; + +public: + + DynamicTypeImpl( + const TypeDescriptorImpl& descriptor) noexcept; + + ReturnCode_t get_descriptor( + traits::ref_type& descriptor) noexcept override; + + ObjectName get_name() noexcept override; + + TypeKind get_kind() noexcept override; + + ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) noexcept override; + + ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) noexcept override; + + ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) noexcept override; + + ReturnCode_t get_all_members( + DynamicTypeMembersById& member) noexcept override; + + uint32_t get_member_count() noexcept override; + + ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) noexcept override; + + uint32_t get_annotation_count() noexcept override; + + ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept override; + + uint32_t get_verbatim_text_count() noexcept override; + + ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) noexcept override; + + bool equals( + traits::ref_type other) noexcept override; + + const DynamicTypeMembersById& get_all_members() const + { + return member_; + } + + const std::vector::ref_type>& get_all_members_by_index() const + { + return members_; + } + + const TypeDescriptorImpl& get_descriptor() const noexcept + { + return type_descriptor_; + } + + int32_t default_value() const noexcept + { + return default_value_; + } + + MemberId default_union_member() const noexcept + { + return default_union_member_; + } + + traits::ref_type resolve_alias_enclosed_type() noexcept; + +protected: + + traits::ref_type _this(); + +private: + + //! Contains the annotations applied by the user. + std::vector annotation_; + + //! Contains the default value of discriminator (TK_UNION) or next literal (TK_ENUM). + //! This is calculated while the type is being built. + int32_t default_value_ {0}; + + //! Points to the default union member. + MemberId default_union_member_ {MEMBER_ID_INVALID}; + + //! Collection of all members sorted by MemberId. + DynamicTypeMembersById member_; + + //! Collection of all members sorted by name. + DynamicTypeMembersByName member_by_name_; + + //! Collection of all members sorted by index. + std::vector::ref_type> members_; + + //! Copy of the TypeDescriptor provided by the user. + TypeDescriptorImpl type_descriptor_; + + //! Contains the verbatim builtin annotation applied by the user. + std::vector verbatim_; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_IMPL_HPP_ diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp new file mode 100644 index 00000000000..b4de9e1ea02 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.cpp @@ -0,0 +1,136 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "DynamicTypeMemberImpl.hpp" + +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +DynamicTypeMemberImpl::DynamicTypeMemberImpl( + const MemberDescriptorImpl& descriptor) noexcept +{ + member_descriptor_.copy_from(descriptor); +} + +ReturnCode_t DynamicTypeMemberImpl::get_descriptor( + traits::ref_type& descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(member_descriptor_); + return RETCODE_OK; +} + +uint32_t DynamicTypeMemberImpl::get_annotation_count() noexcept +{ + return static_cast(annotation_.size()); +} + +ReturnCode_t DynamicTypeMemberImpl::get_annotation( + traits::ref_type& descriptor, + const uint32_t idx) noexcept +{ + if (!descriptor || idx >= annotation_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(annotation_.at(idx)); + return RETCODE_OK; +} + +uint32_t DynamicTypeMemberImpl::get_verbatim_text_count() noexcept +{ + return static_cast(verbatim_.size()); +} + +ReturnCode_t DynamicTypeMemberImpl::get_verbatim_text( + traits::ref_type& descriptor, + const uint32_t idx) noexcept +{ + if (!descriptor || idx >= verbatim_.size()) + { + return RETCODE_BAD_PARAMETER; + } + + traits::narrow(descriptor)->copy_from(verbatim_.at(idx)); + return RETCODE_OK; +} + +bool DynamicTypeMemberImpl::equals( + traits::ref_type other) noexcept +{ + bool ret_value = true; + auto impl = traits::narrow(other); + + ret_value &= (annotation_.size() == impl->annotation_.size()); + if (ret_value) + { + for (size_t count {0}; ret_value && count < annotation_.size(); ++count) + { + auto& annotation = annotation_.at(count); + ret_value &= impl->annotation_.end() != std::find_if(impl->annotation_.begin(), impl->annotation_.end(), + [&annotation](AnnotationDescriptorImpl& a) + { + return annotation.equals(a); + }); + } + } + + ret_value &= member_descriptor_.equals(impl->member_descriptor_); + + ret_value &= (verbatim_.size() == impl->verbatim_.size()); + if (ret_value) + { + for (size_t count {0}; ret_value && count < verbatim_.size(); ++count) + { + auto& verbatim = verbatim_.at(count); + ret_value &= impl->verbatim_.end() != std::find_if(impl->verbatim_.begin(), impl->verbatim_.end(), + [&verbatim](VerbatimTextDescriptorImpl& v) + { + return verbatim.equals(v); + }); + } + } + + return ret_value; +} + +MemberId DynamicTypeMemberImpl::get_id() noexcept +{ + return member_descriptor_.id(); +} + +ObjectName DynamicTypeMemberImpl::get_name() noexcept +{ + return member_descriptor_.name(); +} + +traits::ref_type DynamicTypeMemberImpl::_this() +{ + return shared_from_this(); +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp new file mode 100644 index 00000000000..3fb4bcb17cd --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeMemberImpl.hpp @@ -0,0 +1,90 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEMEMBERIMPL_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEMEMBERIMPL_HPP + +#include + +#include +#include +#include + +#include "AnnotationDescriptorImpl.hpp" +#include "MemberDescriptorImpl.hpp" +#include "VerbatimTextDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeMemberImpl : public virtual traits::base_type +{ + friend class DynamicTypeBuilderImpl; + +public: + + DynamicTypeMemberImpl( + const MemberDescriptorImpl&) noexcept; + + ReturnCode_t get_descriptor( + traits::ref_type& md) noexcept override; + + uint32_t get_annotation_count() noexcept override; + + ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) noexcept override; + + uint32_t get_verbatim_text_count() noexcept override; + + ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) noexcept override; + + bool equals( + traits::ref_type other) noexcept override; + + MemberId get_id() noexcept override; + + ObjectName get_name() noexcept override; + + MemberDescriptorImpl& get_descriptor() noexcept + { + return member_descriptor_; + } + + const MemberDescriptorImpl& get_descriptor() const noexcept + { + return member_descriptor_; + } + +protected: + + traits::ref_type _this(); + +private: + + std::vector annotation_; + + MemberDescriptorImpl member_descriptor_; + + std::vector verbatim_; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_DYNAMICTYPEMEMBERIMPL_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp new file mode 100644 index 00000000000..fd6decafe00 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.cpp @@ -0,0 +1,228 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "MemberDescriptorImpl.hpp" + +#include +#include + +#include "DynamicTypeImpl.hpp" +#include "TypeValueConverter.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t MemberDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t MemberDescriptorImpl::copy_from( + const MemberDescriptorImpl& descriptor) noexcept +{ + name_ = descriptor.name_; + id_ = descriptor.id_; + type_ = descriptor.type_; + default_value_ = descriptor.default_value_; + index_ = descriptor.index_; + label_ = descriptor.label_; + try_construct_kind_ = descriptor.try_construct_kind_; + is_key_ = descriptor.is_key_; + is_optional_ = descriptor.is_optional_; + is_must_understand_ = descriptor.is_must_understand_; + is_shared_ = descriptor.is_shared_; + is_default_label_ = descriptor.is_default_label_; + + return RETCODE_OK; +} + +bool MemberDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool MemberDescriptorImpl::equals( + MemberDescriptorImpl& descriptor) noexcept +{ + return name_ == descriptor.name_ && + id_ == descriptor.id_ && + (type_ && type_->equals(descriptor.type_)) && + default_value_ == descriptor.default_value_ && + index_ == descriptor.index_ && + label_ == descriptor.label_ && + try_construct_kind_ == descriptor.try_construct_kind_ && + is_key_ == descriptor.is_key_ && + is_optional_ == descriptor.is_optional_ && + is_must_understand_ == descriptor.is_must_understand_ && + is_shared_ == descriptor.is_shared_ && + is_default_label_ == descriptor.is_default_label_; +} + +bool MemberDescriptorImpl::is_consistent() noexcept +{ + if (TK_NONE == parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "To check consistency the descriptor should be added as member"); + return false; + } + + // type_ cannot be nil. + if (!type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor has no type and it is mandatory"); + return false; + } + + auto type = traits::narrow(type_); + + // Only aggregated types must use the ID value. + if ((MEMBER_ID_INVALID == id_ && (TK_ANNOTATION == parent_kind_ || + TK_BITMASK == parent_kind_ || + TK_BITSET == parent_kind_ || + TK_UNION == parent_kind_ || + TK_STRUCTURE == parent_kind_)) || + (MEMBER_ID_INVALID != id_ && TK_ANNOTATION != parent_kind_ && + TK_BITMASK != parent_kind_ && + TK_BITSET != parent_kind_ && + TK_UNION != parent_kind_ && + TK_STRUCTURE != parent_kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor has a wrong MemberId " << id_); + return false; + } + + // A union member cannot have the MemberId 0 because this value is for the discriminator + if (TK_UNION == parent_kind_ && 0 == id_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Parent type is an UNION and the MemberId 0 is reserved to the discriminator"); + return false; + } + + // Check default_label. + if (is_default_label_ && TK_UNION != parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is not a UNION and it has set is_default_label"); + return false; + } + + // Check labels + if ((TK_UNION != parent_kind_ && 0 < label_.size()) || + (TK_UNION == parent_kind_ && !is_default_label_ && 0 == label_.size())) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor is not consistent with its labels"); + return false; + } + + // Check uniqueness of labels. + if (TK_UNION == parent_kind_) + { + UnionCaseLabelSeq label_copy {label_}; + std::sort(label_copy.begin(), label_copy.end()); + auto last = std::unique(label_copy.begin(), label_copy.end()); + if (label_copy.end() != last) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor contains duplicated labels"); + return false; + } + } + + if (!default_value_.empty() && + !TypeValueConverter::is_string_consistent(type->get_kind(), type->get_all_members_by_index(), + default_value_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Default value is not consistent"); + return false; + } + + // Check bitfield|enum enclosing type. + if (TK_BITSET == parent_kind_ || + TK_ENUM == parent_kind_) + { + + TypeKind kind = type->resolve_alias_enclosed_type()->get_kind(); + + switch (kind) + { + case TK_INT8: + case TK_UINT8: + case TK_INT16: + case TK_UINT16: + case TK_INT32: + case TK_UINT32: + break; + case TK_INT64: + case TK_UINT64: + case TK_BOOLEAN: + case TK_BYTE: + if (TK_ENUM == parent_kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is an ENUM and the enclosing type is not valid"); + return false; + } + break; + default: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is an BITSET|ENUM and the enclosing type is not valid"); + return false; + break; + } + } + + // Check bitmask enclosing type. + if (TK_BITMASK == parent_kind_ && TK_BOOLEAN != type->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Parent type is a BITMASK and the enclosing type is not BOOLEAN"); + return false; + } + + // TK_MAP member cannot be key. + if (TK_MAP == type->get_kind() && is_key_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "TK_MAP member cannot be part of the key."); + return false; + } + + // Check name consistency + if (0 == name_.size() && (TK_ANNOTATION == parent_kind_ || + TK_BITMASK == parent_kind_ || + TK_BITSET == parent_kind_ || + TK_ENUM == parent_kind_ || + TK_STRUCTURE == parent_kind_ || + TK_UNION == parent_kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Parent type is an ANNOTATION|BITMASK|BITSET|ENUM|STRUCTURE|UNION and the member has no name."); + return false; + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp new file mode 100644 index 00000000000..ff990a66545 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp @@ -0,0 +1,327 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_IMPL_HPP_ +#define _FASTDDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_IMPL_HPP_ + +#include + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class MemberDescriptorImpl : public virtual MemberDescriptor +{ + //! Default value of the member in string form. + std::string default_value_; + + //! MemberId, it should be filled automatically when the member is added if not set (MEMBER_ID_INVALID). + MemberId id_ {MEMBER_ID_INVALID}; + + //! Definition order of the member inside its parent. + uint32_t index_ {0xFFFFFFFF}; + + //! If the union member is default. + bool is_default_label_ {false}; + + //! If the member is key. + bool is_key_ {false}; + + //! If the member is must_understand. + bool is_must_understand_ {false}; + + //! If the member is optional. + bool is_optional_ {false}; + + //! If the member is shared (external). + bool is_shared_ {false}; + + //! Case Labels for unions. + UnionCaseLabelSeq label_; + + //! Name of the member + ObjectName name_; + + //! Kind of the DynamicType which will contain this member. + TypeKind parent_kind_ {TK_NONE}; + + //! @ref TryConstructKind + TryConstructKind try_construct_kind_ {TryConstructKind::DISCARD}; + + //! Member's type + traits::ref_type type_; + +public: + + MemberDescriptorImpl() noexcept = default; + + MemberDescriptorImpl( + const MemberDescriptorImpl& descriptor) noexcept = default; + + MemberDescriptorImpl( + MemberDescriptorImpl&& descriptor) noexcept = default; + + virtual ~MemberDescriptorImpl() noexcept = default; + + ObjectName& name() noexcept override + { + return name_; + } + + const ObjectName& name() const noexcept override + { + return name_; + } + + void name( + const ObjectName& name) noexcept override + { + name_ = name; + } + + virtual void name( + ObjectName&& name) noexcept override + { + name_ = std::move(name); + } + + MemberId id() const noexcept override + { + return id_; + } + + MemberId& id() noexcept override + { + return id_; + } + + void id( + MemberId id) noexcept override + { + id_ = id; + } + + traits::ref_type type() const noexcept override + { + return type_; + } + + traits::ref_type& type() noexcept override + { + return type_; + } + + void type( + traits::ref_type type) noexcept override + { + type_ = type; + } + + std::string& default_value() noexcept override + { + return default_value_; + } + + const std::string& default_value() const noexcept override + { + return default_value_; + } + + void default_value( + const std::string& default_value) noexcept override + { + default_value_ = default_value; + } + + virtual void default_value( + std::string&& default_value) noexcept override + { + default_value_ = std::move(default_value); + } + + uint32_t index() const noexcept override + { + return index_; + } + + uint32_t& index() noexcept override + { + return index_; + } + + void index( + uint32_t index) noexcept + { + index_ = index; + } + + const UnionCaseLabelSeq& label() const noexcept override + { + return label_; + } + + UnionCaseLabelSeq& label() noexcept override + { + return label_; + } + + void label( + const UnionCaseLabelSeq& label) noexcept override + { + label_ = label; + } + + void label( + UnionCaseLabelSeq&& label) noexcept override + { + label_ = std::move(label); + } + + TypeKind parent_kind() const noexcept + { + return parent_kind_; + } + + TypeKind& parent_kind() noexcept + { + return parent_kind_; + } + + void parent_kind( + TypeKind parent_kind) noexcept + { + parent_kind_ = parent_kind; + } + + TryConstructKind try_construct_kind() const noexcept override + { + return try_construct_kind_; + } + + TryConstructKind& try_construct_kind() noexcept override + { + return try_construct_kind_; + } + + void try_construct_kind( + TryConstructKind try_construct_kind) noexcept override + { + try_construct_kind_ = try_construct_kind; + } + + bool is_key() const noexcept override + { + return is_key_; + } + + bool& is_key() noexcept override + { + return is_key_; + } + + void is_key( + bool is_key) noexcept override + { + is_key_ = is_key; + } + + bool is_optional() const noexcept override + { + return is_optional_; + } + + bool& is_optional() noexcept override + { + return is_optional_; + } + + void is_optional( + bool is_optional) noexcept override + { + is_optional_ = is_optional; + } + + bool is_must_understand() const noexcept override + { + return is_must_understand_; + } + + bool& is_must_understand() noexcept override + { + return is_must_understand_; + } + + void is_must_understand( + bool is_must_understand) noexcept override + { + is_must_understand_ = is_must_understand; + } + + bool is_shared() const noexcept override + { + return is_shared_; + } + + bool& is_shared() noexcept override + { + return is_shared_; + } + + void is_shared( + bool is_shared) noexcept override + { + is_shared_ = is_shared; + } + + bool is_default_label() const noexcept override + { + return is_default_label_; + } + + bool& is_default_label() noexcept override + { + return is_default_label_; + } + + void is_default_label( + bool is_default_label) noexcept override + { + is_default_label_ = is_default_label; + } + + ReturnCode_t copy_from( + traits::ref_type descriptor) noexcept override; + + ReturnCode_t copy_from( + const MemberDescriptorImpl& descriptor) noexcept; + + bool equals( + traits::ref_type descriptor) noexcept override; + + bool equals( + MemberDescriptorImpl& descriptor) noexcept; + + bool is_consistent() noexcept override; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_IMPL_HPP_ diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp new file mode 100644 index 00000000000..eaa86e5682e --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp @@ -0,0 +1,326 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "TypeDescriptorImpl.hpp" + +#include +#include + +#include +#include +#include + +#include "DynamicTypeImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +enum FSM_INPUTS +{ + LETTER = 1, + NUMBER, + UNDERSCORE, + COLON, + OTHER +}; + +enum FSM_STATES +{ + INVALID = 0, + SINGLECOLON, + DOUBLECOLON, + VALID +}; + +static const int stateTable[4][6] = +{ + /* Input: letter, number, underscore, colon, other */ + {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, + {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, + {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, + {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID} +}; + +bool is_type_name_consistent( + const ObjectName& sName) +{ + // Implement an FSM string parser to deal with both a plain type name + // and a fully qualified name. According to the DDS xtypes standard, + // type's fully qualified name is a concatenation of module names with + // the name of a type inside of those modules. + int currState = INVALID; + for (uint32_t i = 0; i < sName.size(); ++i) + { + int col = 0; + if (std::isalpha(sName[i])) + { + col = LETTER; + } + else if (std::isdigit(sName[i])) + { + col = NUMBER; + } + else if (sName[i] == '_') + { + col = UNDERSCORE; + } + else if (sName[i] == ':') + { + col = COLON; + } + else + { + col = OTHER; + } + currState = stateTable[currState][col]; + if (currState == INVALID) + { + return false; + } + } + return true; +} + +TypeDescriptorImpl::TypeDescriptorImpl( + TypeKind kind, + const ObjectName& name) + : kind_(kind) + , name_(name) +{ +} + +ReturnCode_t TypeDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t TypeDescriptorImpl::copy_from( + const TypeDescriptorImpl& descriptor) noexcept +{ + kind_ = descriptor.kind_; + name_ = descriptor.name_; + base_type_ = descriptor.base_type_; + discriminator_type_ = descriptor.discriminator_type_; + bound_ = descriptor.bound_; + element_type_ = descriptor.element_type_; + key_element_type_ = descriptor.key_element_type_; + extensibility_kind_ = descriptor.extensibility_kind_; + is_nested_ = descriptor.is_nested_; + + return RETCODE_OK; +} + +bool TypeDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool TypeDescriptorImpl::equals( + TypeDescriptorImpl& descriptor) noexcept +{ + return kind_ == descriptor.kind_ && + name_ == descriptor.name_ && + ((!base_type_ && !descriptor.base_type_) || (base_type_ && base_type_->equals(descriptor.base_type_))) && + ((!discriminator_type_ && !descriptor.discriminator_type_) || + (discriminator_type_ && discriminator_type_->equals(descriptor.discriminator_type_))) && + bound_ == descriptor.bound_ && + ((!element_type_ && !descriptor.element_type_) || + (element_type_ && element_type_->equals(descriptor.element_type_))) && + ((!key_element_type_ && !descriptor.key_element_type_) || + (key_element_type_ && key_element_type_->equals(descriptor.key_element_type_))) && + extensibility_kind_ == descriptor.extensibility_kind_ && + is_nested_ == descriptor.is_nested_; +} + +bool TypeDescriptorImpl::is_consistent() noexcept +{ + // Alias Types need the base type to indicate what type has been aliased. + if (TK_ALIAS == kind_ && !base_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an ALIAS but the base_type was not set"); + return false; + } + + // Alias must have base type, and structures and bitsets optionally can have it. + if (base_type_ && + TK_ALIAS != kind_ && + TK_BITSET != kind_ && + TK_STRUCTURE != kind_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor doesn't describe an ALIAS|BITSET|STRUCTURE but the base_type was set"); + return false; + } + + // Check the parent is of the same kind. + if (base_type_ && TK_ALIAS != kind_) + { + auto base_type = + traits::narrow(base_type_)->resolve_alias_enclosed_type(); + + if (kind_ != base_type->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor type and the base_type are not of the same kind"); + return false; + } + } + + // Arrays need one or more bound fields with the lenghts of each dimension. + if (TK_ARRAY == kind_ && 0 == bound_.size()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an ARRAY but bound is empty"); + return false; + } + + // These types need one bound with the length of the field. + if (1 != bound_.size() && ( + TK_SEQUENCE == kind_ || + TK_MAP == kind_ || + TK_BITMASK == kind_ || + TK_STRING8 == kind_ || + TK_STRING16 == kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an SEQUENCE|MAP|BITMASK|STRING but bound doesn't contain only one element"); + return false; + } + + // Check no bound is zero. + if (bound_.end() != std::find_if(bound_.begin(), bound_.end(), + [](uint32_t bound) + { + return 0 == bound; + })) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Bounds contains a zero and it is not a valid value."); + return false; + } + + // Bitmask bound must be greater than zero and no greater than 64. + if (TK_BITMASK == kind_ && (0 == bound_.at(0) || 64 < bound_.at(0))) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an BITMASK but bound is not valid."); + return false; + } + + // Only union types need the discriminator of the union + if (TK_UNION == kind_) + { + if (!discriminator_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes an UNION but discriminant_type was not set"); + return false; + } + else + { + // Check discriminator kind and the type is a integer (labels are int32_t). + // boolean, byte, char8, char16, int8, uint8, int16, uint16, int32, uint32, enum, alias + TypeKind discriminator_kind = + traits::narrow(discriminator_type_)->resolve_alias_enclosed_type() + ->get_kind(); + + switch (discriminator_kind) + { + case TK_BOOLEAN: + case TK_BYTE: + case TK_CHAR8: + case TK_CHAR16: + case TK_INT8: + case TK_UINT8: + case TK_INT16: + case TK_UINT16: + case TK_INT32: + case TK_UINT32: + case TK_INT64: + case TK_UINT64: + case TK_ENUM: + break; + default: + EPROSIMA_LOG_ERROR(DYN_TYPES, "Discriminantor kind was not valid"); + return false; + break; + } + } + } + + // ElementType is used by these types to set the "value" type of the element, otherwise it should be null. + if (!element_type_ && ( + TK_ARRAY == kind_ || + TK_SEQUENCE == kind_ || + TK_STRING8 == kind_ || + TK_STRING16 == kind_ || + TK_MAP == kind_ || + TK_BITMASK == kind_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, + "Descriptor describes an ARRAY|SEQUENCE|MAP|BITMASK|STRING but element_type was not set"); + return false; + } + + // For Bitmask types is mandatory that this element is boolean. + if (TK_BITMASK == kind_ && TK_BOOLEAN != element_type_->get_kind()) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a BITMASK but element_type is not of BOOLEAN type"); + return false; + } + + // Only map types need the keyElementType to store the "Key" type of the pair. + if (TK_MAP == kind_ && !key_element_type_) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a MAP but key_element_type was not set"); + return false; + } + + if (TK_MAP == kind_ && (TK_ANNOTATION == key_element_type()->get_kind() || + TK_ARRAY == key_element_type()->get_kind() || + TK_BITSET == key_element_type()->get_kind() || + TK_BITMASK == key_element_type()->get_kind() || + TK_MAP == key_element_type()->get_kind() || + TK_SEQUENCE == key_element_type()->get_kind() || + TK_STRING16 == key_element_type()->get_kind() || + TK_STRUCTURE == key_element_type()->get_kind() || + TK_UNION == key_element_type()->get_kind() + )) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor describes a MAP with an invalid key_element_type"); + return false; + } + + if (!is_type_name_consistent(name_)) + { + EPROSIMA_LOG_ERROR(DYN_TYPES, "Descriptor name is not a fully qualified name"); + return false; + } + + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.hpp new file mode 100644 index 00000000000..a4025960470 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeDescriptorImpl.hpp @@ -0,0 +1,243 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_IMPL_HPP_ +#define _FASTDDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_IMPL_HPP_ + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class TypeDescriptorImpl : public virtual TypeDescriptor +{ + //! Type kind. + TypeKind kind_ {TK_NONE}; + + //! Type name. + ObjectName name_; + + //! SuperType of an structure or base type of an alias type. + traits::ref_type base_type_; + + //! Discriminator type for a union. + traits::ref_type discriminator_type_; + + //! Length for strings, arrays, sequences, maps and bitmasks. + BoundSeq bound_; + + //! Value Type for strings, arrays, sequences, maps and bitmasks. + traits::ref_type element_type_; + + //! Key Type for maps. + traits::ref_type key_element_type_; + + ExtensibilityKind extensibility_kind_ {ExtensibilityKind::APPENDABLE}; + + bool is_nested_ {false}; + +public: + + TypeDescriptorImpl() noexcept = default; + + TypeDescriptorImpl( + TypeKind kind, + const ObjectName& name); + + TypeDescriptorImpl( + const TypeDescriptorImpl& type) noexcept = default; + + TypeDescriptorImpl( + TypeDescriptorImpl&& type) noexcept = default; + + virtual ~TypeDescriptorImpl() noexcept = default; + + TypeKind kind() const noexcept override + { + return kind_; + } + + TypeKind& kind() noexcept override + { + return kind_; + } + + void kind( + TypeKind kind) noexcept override + { + kind_ = kind; + } + + ObjectName& name() noexcept override + { + return name_; + } + + const ObjectName& name() const noexcept override + { + return name_; + } + + void name( + const ObjectName& name) noexcept override + { + name_ = name; + } + + virtual void name( + ObjectName&& name) noexcept override + { + name_ = std::move(name); + } + + traits::ref_type base_type() const noexcept override + { + return base_type_; + } + + traits::ref_type& base_type() noexcept override + { + return base_type_; + } + + void base_type( + traits::ref_type type) noexcept override + { + base_type_ = type; + } + + traits::ref_type discriminator_type() const noexcept override + { + return discriminator_type_; + } + + traits::ref_type& discriminator_type() noexcept override + { + return discriminator_type_; + } + + void discriminator_type( + traits::ref_type type) noexcept override + { + discriminator_type_ = type; + } + + const BoundSeq& bound() const noexcept override + { + return bound_; + } + + BoundSeq& bound() noexcept override + { + return bound_; + } + + void bound( + const BoundSeq& bound) noexcept override + { + bound_ = bound; + } + + void bound( + BoundSeq&& bound) noexcept override + { + bound_ = std::move(bound); + } + + traits::ref_type element_type() const noexcept override + { + return element_type_; + } + + traits::ref_type& element_type() noexcept override + { + return element_type_; + } + + void element_type( + traits::ref_type type) noexcept override + { + element_type_ = type; + } + + traits::ref_type key_element_type() const noexcept override + { + return key_element_type_; + } + + traits::ref_type& key_element_type() noexcept override + { + return key_element_type_; + } + + void key_element_type( + traits::ref_type type) noexcept override + { + key_element_type_ = type; + } + + ExtensibilityKind extensibility_kind() const noexcept override + { + return extensibility_kind_; + } + + ExtensibilityKind& extensibility_kind() noexcept override + { + return extensibility_kind_; + } + + void extensibility_kind( + ExtensibilityKind extensibility_kind) noexcept override + { + extensibility_kind_ = extensibility_kind; + } + + bool is_nested() const noexcept override + { + return is_nested_; + } + + bool& is_nested() noexcept override + { + return is_nested_; + } + + void is_nested( + bool is_nested) noexcept override + { + is_nested_ = is_nested; + } + + ReturnCode_t copy_from( + traits::ref_type descriptor) noexcept override; + + ReturnCode_t copy_from( + const TypeDescriptorImpl& descriptor) noexcept; + + bool equals( + traits::ref_type descriptor) noexcept override; + + bool equals( + TypeDescriptorImpl& descriptor) noexcept; + + bool is_consistent() noexcept override; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_IMPL_HPP_ + diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp new file mode 100644 index 00000000000..173c0f56a76 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeForKind.hpp @@ -0,0 +1,399 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP + +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +//{{{ Type traits + +template +struct TypeForKind_; + +template <> +struct TypeForKind_ +{ + using type = int8_t; + using sequence_type = Int8Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint8_t; + using sequence_type = UInt8Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int16_t; + using sequence_type = Int16Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint16_t; + using sequence_type = UInt16Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int32_t; + using sequence_type = Int32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint32_t; + using sequence_type = UInt32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = int64_t; + using sequence_type = Int64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = uint64_t; + using sequence_type = UInt64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = float; + using sequence_type = Float32Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = double; + using sequence_type = Float64Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = long double; + using sequence_type = Float128Seq; +}; + +template <> +struct TypeForKind_ +{ + using type = char; + using sequence_type = CharSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = wchar_t; + using sequence_type = WcharSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = eprosima::fastrtps::rtps::octet; + using sequence_type = ByteSeq; +}; + + +template <> +struct TypeForKind_ +{ + using type = bool; + using sequence_type = BooleanSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = std::string; + using sequence_type = StringSeq; +}; + +template <> +struct TypeForKind_ +{ + using type = std::wstring; + using sequence_type = WstringSeq; +}; + +template +using TypeForKind = typename TypeForKind_::type; + +template +using SequenceTypeForKind = typename TypeForKind_::sequence_type; + +//}}} + +//{{{ Promotion traits + +template +struct TypePromotion : std::false_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +template <> +struct TypePromotion : std::true_type {}; + +//}}} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEFORKIND_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp b/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp new file mode 100644 index 00000000000..f7d531f4d3d --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/TypeValueConverter.hpp @@ -0,0 +1,255 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP + +#include + +#include "DynamicTypeMemberImpl.hpp" +#include "TypeForKind.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +const char* const CONST_TRUE = "true"; +const char* const CONST_FALSE = "false"; + +namespace detail { + +struct converter +{ + const std::string& x; + template operator T() + { + return 0; + } + +}; + + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stol(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stol(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoul(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoll(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return static_cast(std::stoull(x)); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stof(x); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stod(x); +} + +template <> inline converter::operator TypeForKind() +{ + return std::stold(x); +} + +template <> inline converter::operator TypeForKind() +{ + if (0 == x.compare(CONST_TRUE)) + { + return true; + } + if (0 == x.compare(CONST_FALSE)) + { + return false; + } + + return 0 < stoul(x) ? true : false; +} + +} // namespace detail + +class TypeValueConverter final +{ +public: + + static detail::converter sto( + const std::string& str) + { + return {str}; + } + + static bool is_string_consistent( + TypeKind kind, + const std::vector::ref_type>& members, + const std::string& str) + { + + if (str.empty()) + { + return false; + } + bool ret_value = true; + + try + { + switch (kind) + { + case TK_INT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT8: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT16: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT16: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_INT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT32: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT64: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_FLOAT128: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_CHAR8: + case TK_CHAR16: + { + if (str.size() != 1) + { + ret_value = false; + } + } + break; + case TK_BOOLEAN: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_BYTE: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_UINT8: + { + TypeForKind value = sto(str); + static_cast(value); + } + break; + case TK_STRING8: + case TK_STRING16: + break; + case TK_ENUM: + ret_value = false; + for (auto& member : members) + { + if (0 == str.compare(member->get_name().to_string())) + { + ret_value = true; + break; + } + } + break; + default: + ret_value = false; + break; + } + } + catch (...) + { + ret_value = false; + } + + return ret_value; + } + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_TYPEVALUECONVERTER_HPP diff --git a/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp new file mode 100644 index 00000000000..8787c0284d2 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp @@ -0,0 +1,68 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "VerbatimTextDescriptorImpl.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +template<> +traits::ref_type traits::make_shared() +{ + return std::make_shared(); +} + +ReturnCode_t VerbatimTextDescriptorImpl::copy_from( + traits::ref_type descriptor) noexcept +{ + if (!descriptor) + { + return RETCODE_BAD_PARAMETER; + } + + return copy_from(*traits::narrow(descriptor)); +} + +ReturnCode_t VerbatimTextDescriptorImpl::copy_from( + const VerbatimTextDescriptorImpl& descriptor) noexcept +{ + placement_ = descriptor.placement_; + text_ = descriptor.text_; + + return RETCODE_OK; +} + +bool VerbatimTextDescriptorImpl::equals( + traits::ref_type descriptor) noexcept +{ + return equals(*traits::narrow(descriptor)); +} + +bool VerbatimTextDescriptorImpl::equals( + VerbatimTextDescriptorImpl& descriptor) noexcept +{ + return placement_ == descriptor.placement_ && + text_ == descriptor.text_; +} + +bool VerbatimTextDescriptorImpl::is_consistent() noexcept +{ + //TODO + return true; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima diff --git a/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.hpp b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.hpp new file mode 100644 index 00000000000..ee8a487207c --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.hpp @@ -0,0 +1,105 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_IMPL_HPP_ +#define _FASTDDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_IMPL_HPP_ + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class VerbatimTextDescriptorImpl : public virtual VerbatimTextDescriptor +{ + std::string placement_; + + std::string text_; + +public: + + VerbatimTextDescriptorImpl() noexcept = default; + + VerbatimTextDescriptorImpl( + const VerbatimTextDescriptorImpl& descriptor) noexcept = default; + + VerbatimTextDescriptorImpl( + VerbatimTextDescriptorImpl&& descriptor) noexcept = default; + + virtual ~VerbatimTextDescriptorImpl() noexcept = default; + + std::string& placement() noexcept override + { + return placement_; + } + + const std::string& placement() const noexcept override + { + return placement_; + } + + void placement( + const std::string& placement) noexcept override + { + placement_ = placement; + } + + virtual void placement( + std::string&& placement) noexcept override + { + placement_ = std::move(placement); + } + + std::string& text() noexcept override + { + return text_; + } + + const std::string& text() const noexcept override + { + return text_; + } + + void text( + const std::string& text) noexcept override + { + text_ = text; + } + + virtual void text( + std::string&& text) noexcept override + { + text_ = std::move(text); + } + + ReturnCode_t copy_from( + traits::ref_type descriptor) noexcept override; + + ReturnCode_t copy_from( + const VerbatimTextDescriptorImpl& descriptor) noexcept; + + bool equals( + traits::ref_type descriptor) noexcept override; + + bool equals( + VerbatimTextDescriptorImpl& descriptor) noexcept; + + bool is_consistent() noexcept override; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_IMPL_HPP_ diff --git a/src/cpp/fastdds/xtypes/dynamic_types/common.hpp b/src/cpp/fastdds/xtypes/dynamic_types/common.hpp new file mode 100644 index 00000000000..f9ac3d31b02 --- /dev/null +++ b/src/cpp/fastdds/xtypes/dynamic_types/common.hpp @@ -0,0 +1,62 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP +#define FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +inline eprosima::fastcdr::EncodingAlgorithmFlag get_fastcdr_encoding_flag( + ExtensibilityKind ext_kind, + eprosima::fastcdr::CdrVersion cdr_version) +{ + eprosima::fastcdr::EncodingAlgorithmFlag ret_value {eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR}; + + if (eprosima::fastcdr::CdrVersion::XCDRv2 == cdr_version) + { + switch (ext_kind) + { + case ExtensibilityKind::MUTABLE: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2; + break; + case ExtensibilityKind::APPENDABLE: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2; + break; + case ExtensibilityKind::FINAL: + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2; + break; + } + } + else + { + if (ExtensibilityKind::MUTABLE == ext_kind) + { + ret_value = eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR; + } + } + + return ret_value; +} + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_XTYPES_DYNAMIC_TYPES_COMMON_HPP diff --git a/src/cpp/fastdds/xtypes/exception/Exception.cpp b/src/cpp/fastdds/xtypes/exception/Exception.cpp new file mode 100644 index 00000000000..f69179a8398 --- /dev/null +++ b/src/cpp/fastdds/xtypes/exception/Exception.cpp @@ -0,0 +1,51 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +InvalidArgumentError::InvalidArgumentError( + const std::string& msg) + : Exception() + , std::invalid_argument(msg) +{ +} + +InvalidArgumentError::InvalidArgumentError( + const InvalidArgumentError& src) + : Exception() + , std::invalid_argument(src.what()) +{ +} + +InvalidArgumentError::~InvalidArgumentError() throw() +{ +} + +const char* InvalidArgumentError::what() const throw() +{ + return this->std::invalid_argument::what(); +} + +} // xtypes +} // dds +} // fastdds +} // eprosima diff --git a/src/cpp/fastdds/xtypes/type_representation/TypeIdentifierWithSizeHashSpecialization.h b/src/cpp/fastdds/xtypes/type_representation/TypeIdentifierWithSizeHashSpecialization.h new file mode 100644 index 00000000000..acc0a82a41b --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/TypeIdentifierWithSizeHashSpecialization.h @@ -0,0 +1,43 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TypeIdentifierWithSizeHashSpecialization.h + * + */ + +#include + +#include + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_IDENTIFIER_WITH_SIZE_HASH_SPECIALIZATION +#define _FASTDDS_DDS_XTYPES_TYPE_IDENTIFIER_WITH_SIZE_HASH_SPECIALIZATION + +namespace std { + +template<> +struct hash +{ + std::size_t operator ()( + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& k) const + { + return static_cast(k.typeobject_serialized_size()); + } + +}; + +} // namespace std + +#endif // _FASTDDS_DDS_XTYPES_TYPE_IDENTIFIER_WITH_SIZE_HASH_SPECIALIZATION + diff --git a/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp new file mode 100644 index 00000000000..7329161c7b9 --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.cpp @@ -0,0 +1,1165 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +constexpr const int32_t NO_DEPENDENCIES = -1; + +bool TypeRegistryEntry::operator !=( + const TypeRegistryEntry& entry) +{ + return this->type_object_ != entry.type_object_ || + this->type_object_serialized_size_ != entry.type_object_serialized_size_; +} + +ReturnCode_t TypeObjectRegistry::register_type_object( + const std::string& type_name, + const CompleteTypeObject& complete_type_object) +{ + if (type_name.empty()) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } +#if !defined(NDEBUG) + try + { + TypeObjectUtils::complete_type_object_consistency(complete_type_object); + } + catch (eprosima::fastdds::dds::xtypes::InvalidArgumentError& exception) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Inconsistent CompleteTypeObject: " << exception.what()); + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } +#endif // !defined(NDEBUG) + TypeRegistryEntry complete_entry; + TypeRegistryEntry minimal_entry; + complete_entry.type_object_.complete(complete_type_object); + minimal_entry.type_object_ = build_minimal_from_complete_type_object(complete_type_object); + TypeIdentifierPair type_ids; + type_ids.type_identifier1(calculate_type_identifier(minimal_entry.type_object_, + minimal_entry.type_object_serialized_size_)); + type_ids.type_identifier2(calculate_type_identifier(complete_entry.type_object_, + complete_entry.type_object_serialized_size_)); + + std::lock_guard data_guard(type_object_registry_mutex_); + auto type_ids_result = local_type_identifiers_.insert({type_name, type_ids}); + auto min_entry_result = type_registry_entries_.insert({type_ids.type_identifier1(), minimal_entry}); + auto max_entry_result = type_registry_entries_.insert({type_ids.type_identifier2(), complete_entry}); + if (!type_ids_result.second || !max_entry_result.second) + { + if (local_type_identifiers_[type_name] != type_ids || + type_registry_entries_[type_ids.type_identifier1()] != minimal_entry || + type_registry_entries_[type_ids.type_identifier2()] != complete_entry) + { + if (type_ids_result.second) + { + local_type_identifiers_.erase(type_name); + } + if (min_entry_result.second) + { + type_registry_entries_.erase(type_ids.type_identifier1()); + } + if (max_entry_result.second) + { + type_registry_entries_.erase(type_ids.type_identifier2()); + } + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + } + return eprosima::fastdds::dds::RETCODE_OK; +} + +ReturnCode_t TypeObjectRegistry::register_type_identifier( + const std::string& type_name, + const TypeIdentifier& type_identifier) +{ + // Preconditions + if (TypeObjectUtils::is_direct_hash_type_identifier(type_identifier) || type_name.empty()) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } +#if !defined(NDEBUG) + try + { + TypeObjectUtils::type_identifier_consistency(type_identifier); + } + catch (eprosima::fastdds::dds::xtypes::InvalidArgumentError& exception) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Inconsistent TypeIdentifier: " << exception.what()); + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } +#endif // !defined(NDEBUG) + TypeIdentifierPair type_identifiers; + type_identifiers.type_identifier1(type_identifier); + + switch (type_identifier._d()) + { + case TI_PLAIN_SEQUENCE_SMALL: + if (EK_BOTH != type_identifier.seq_sdefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().seq_sdefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().seq_sdefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().seq_sdefn().element_identifier()))); + } + break; + case TI_PLAIN_SEQUENCE_LARGE: + if (EK_BOTH != type_identifier.seq_ldefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().seq_ldefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().seq_ldefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().seq_ldefn().element_identifier()))); + } + break; + case TI_PLAIN_ARRAY_SMALL: + if (EK_BOTH != type_identifier.array_sdefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().array_sdefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().array_sdefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().array_sdefn().element_identifier()))); + } + break; + case TI_PLAIN_ARRAY_LARGE: + if (EK_BOTH != type_identifier.array_ldefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().array_ldefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().array_ldefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().array_ldefn().element_identifier()))); + } + break; + case TI_PLAIN_MAP_SMALL: + if (EK_BOTH != type_identifier.map_sdefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().map_sdefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().map_sdefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().map_sdefn().element_identifier()))); + } + if (TypeObjectUtils::is_direct_hash_type_identifier(*type_identifier.map_sdefn().key_identifier())) + { + if (TK_NONE == type_identifiers.type_identifier2()._d()) + { + type_identifiers.type_identifier2(type_identifier); + } + type_identifiers.type_identifier1().map_sdefn().key_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().map_sdefn().key_identifier()))); + } + break; + case TI_PLAIN_MAP_LARGE: + if (EK_BOTH != type_identifier.map_ldefn().header().equiv_kind()) + { + type_identifiers.type_identifier2(type_identifier); + type_identifiers.type_identifier1().map_ldefn().header().equiv_kind(EK_MINIMAL); + type_identifiers.type_identifier1().map_ldefn().element_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().map_ldefn().element_identifier()))); + } + if (TypeObjectUtils::is_direct_hash_type_identifier(*type_identifier.map_ldefn().key_identifier())) + { + if (TK_NONE == type_identifiers.type_identifier2()._d()) + { + type_identifiers.type_identifier2(type_identifier); + } + type_identifiers.type_identifier1().map_ldefn().key_identifier(new TypeIdentifier( + get_complementary_type_identifier( + *type_identifiers.type_identifier2().map_ldefn().key_identifier()))); + } + break; + default: + break; + } + + std::lock_guard data_guard(type_object_registry_mutex_); + auto result = local_type_identifiers_.insert({type_name, type_identifiers}); + if (!result.second) + { + if (local_type_identifiers_[type_name] != type_identifiers) + { + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + } + return eprosima::fastdds::dds::RETCODE_OK; +} + +ReturnCode_t TypeObjectRegistry::get_type_objects( + const std::string& type_name, + TypeObjectPair& type_objects) +{ + if (type_name.empty()) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } + TypeIdentifierPair type_ids; + ReturnCode_t ret_code = get_type_identifiers(type_name, type_ids); + if (eprosima::fastdds::dds::RETCODE_OK == ret_code) + { + if (!TypeObjectUtils::is_direct_hash_type_identifier(type_ids.type_identifier1()) || + !TypeObjectUtils::is_direct_hash_type_identifier(type_ids.type_identifier2())) + { + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + + std::lock_guard data_guard(type_object_registry_mutex_); + if (EK_MINIMAL == type_ids.type_identifier1()._d()) + { + type_objects.minimal_type_object = + type_registry_entries_.at(type_ids.type_identifier1()).type_object_; + type_objects.complete_type_object = + type_registry_entries_.at(type_ids.type_identifier2()).type_object_; + } + else + { + type_objects.complete_type_object = + type_registry_entries_.at(type_ids.type_identifier1()).type_object_; + type_objects.minimal_type_object = + type_registry_entries_.at(type_ids.type_identifier2()).type_object_; + } + } + return ret_code; +} + +ReturnCode_t TypeObjectRegistry::get_type_identifiers( + const std::string& type_name, + TypeIdentifierPair& type_identifiers) +{ + if (type_name.empty()) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } + try + { + std::lock_guard data_guard(type_object_registry_mutex_); + type_identifiers = local_type_identifiers_.at(type_name); + } + catch (std::exception&) + { + return eprosima::fastdds::dds::RETCODE_NO_DATA; + } + return eprosima::fastdds::dds::RETCODE_OK; +} + +ReturnCode_t TypeObjectRegistry::get_type_object( + const TypeIdentifier& type_identifier, + TypeObject& type_object) +{ + if (!TypeObjectUtils::is_direct_hash_type_identifier(type_identifier)) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } + try + { + std::lock_guard data_guard(type_object_registry_mutex_); + type_object = type_registry_entries_.at(type_identifier).type_object_; + } + catch (std::exception&) + { + return eprosima::fastdds::dds::RETCODE_NO_DATA; + } + return eprosima::fastdds::dds::RETCODE_OK; +} + +ReturnCode_t TypeObjectRegistry::get_type_information( + const std::string& type_name, + TypeInformation& type_information) +{ + TypeIdentifierPair type_ids; + ReturnCode_t ret_code = get_type_identifiers(type_name, type_ids); + if (eprosima::fastdds::dds::RETCODE_OK == ret_code) + { + if (!TypeObjectUtils::is_direct_hash_type_identifier(type_ids.type_identifier1()) || + !TypeObjectUtils::is_direct_hash_type_identifier(type_ids.type_identifier2())) + { + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + type_information.complete().typeid_with_size().type_id(type_ids.type_identifier1()); + type_information.complete().dependent_typeid_count(NO_DEPENDENCIES); + type_information.minimal().typeid_with_size().type_id(type_ids.type_identifier2()); + type_information.minimal().dependent_typeid_count(NO_DEPENDENCIES); + + std::lock_guard data_guard(type_object_registry_mutex_); + type_information.complete().typeid_with_size().typeobject_serialized_size(type_registry_entries_.at( + type_ids.type_identifier1()).type_object_serialized_size_); + type_information.minimal().typeid_with_size().typeobject_serialized_size(type_registry_entries_.at( + type_ids.type_identifier2()).type_object_serialized_size_); + } + else + { + type_information.minimal().typeid_with_size().type_id(type_ids.type_identifier1()); + type_information.minimal().dependent_typeid_count(NO_DEPENDENCIES); + type_information.complete().typeid_with_size().type_id(type_ids.type_identifier2()); + type_information.complete().dependent_typeid_count(NO_DEPENDENCIES); + + std::lock_guard data_guard(type_object_registry_mutex_); + type_information.minimal().typeid_with_size().typeobject_serialized_size(type_registry_entries_.at( + type_ids.type_identifier1()).type_object_serialized_size_); + type_information.complete().typeid_with_size().typeobject_serialized_size(type_registry_entries_.at( + type_ids.type_identifier2()).type_object_serialized_size_); + } + } + return ret_code; +} + +ReturnCode_t TypeObjectRegistry::get_type_dependencies( + const TypeIdentifierSeq& type_identifiers, + std::unordered_set& type_dependencies) +{ + for (const TypeIdentifier& type_id : type_identifiers) + { + if (!TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + } + return get_type_dependencies_impl(type_identifiers, type_dependencies); +} + +bool TypeObjectRegistry::is_type_identifier_known( + const TypeIdentfierWithSize& type_identifier_with_size) +{ + if (TypeObjectUtils::is_direct_hash_type_identifier(type_identifier_with_size.type_id())) + { + std::lock_guard data_guard(type_object_registry_mutex_); + // Check TypeIdentifier is known + auto it = type_registry_entries_.find(type_identifier_with_size.type_id()); + if (it != type_registry_entries_.end()) + { + // Check typeobject_serialized_size is the same + if (it->second.type_object_serialized_size_ == type_identifier_with_size.typeobject_serialized_size()) + { + return true; + } + } + } + + std::lock_guard data_guard(type_object_registry_mutex_); + for (const auto& it : local_type_identifiers_) + { + if (it.second.type_identifier1() == type_identifier_with_size.type_id() || + it.second.type_identifier2() == type_identifier_with_size.type_id()) + { + return true; + } + } + return false; +} + +bool TypeObjectRegistry::is_builtin_annotation( + const TypeIdentifier& type_identifier) +{ + if (!TypeObjectUtils::is_direct_hash_type_identifier(type_identifier)) + { + return false; + } + + std::lock_guard data_guard(type_object_registry_mutex_); + for (const auto& it : local_type_identifiers_) + { + if (it.second.type_identifier1() == type_identifier || it.second.type_identifier2() == type_identifier) + { + return is_builtin_annotation_name(it.first); + } + } + return false; +} + +const TypeIdentifier TypeObjectRegistry::calculate_type_identifier( + const TypeObject& type_object, + uint32_t& type_object_serialized_size) +{ + TypeIdentifier type_id; + eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + eprosima::fastrtps::rtps::SerializedPayload_t payload(static_cast( + calculator.calculate_serialized_size(type_object, current_alignment))); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, + eprosima::fastcdr::CdrVersion::XCDRv2); + ser << type_object; + type_object_serialized_size = static_cast(ser.get_serialized_data_length()); + EquivalenceHash equivalence_hash; + MD5 type_object_hash; + type_object_hash.update(reinterpret_cast(payload.data), type_object_serialized_size); + type_object_hash.finalize(); + for (size_t i = 0; i < equivalence_hash.size(); i++) + { + equivalence_hash[i] = type_object_hash.digest[i]; + } + type_id.equivalence_hash(equivalence_hash); + type_id._d(type_object._d()); + return type_id; +} + +TypeObjectRegistry::TypeObjectRegistry() +{ + register_primitive_type_identifiers(); +} + +ReturnCode_t TypeObjectRegistry::register_type_object( + const TypeIdentifier& type_identifier, + const TypeObject& type_object) +{ + uint32_t type_object_serialized_size = 0; + if (type_identifier._d() != type_object._d() || + type_identifier != calculate_type_identifier(type_object, type_object_serialized_size)) + { + return eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET; + } + if (EK_COMPLETE == type_object._d()) + { + TypeRegistryEntry entry; + entry.type_object_ = build_minimal_from_complete_type_object(type_object.complete()); + TypeIdentifier minimal_type_id = calculate_type_identifier(entry.type_object_, + entry.type_object_serialized_size_); + + std::lock_guard data_guard(type_object_registry_mutex_); + type_registry_entries_.insert({minimal_type_id, entry}); + } + TypeRegistryEntry entry; + entry.type_object_ = type_object; + entry.type_object_serialized_size_ = type_object_serialized_size; + + std::lock_guard data_guard(type_object_registry_mutex_); + type_registry_entries_.insert({type_identifier, entry}); + return eprosima::fastdds::dds::RETCODE_OK; +} + +ReturnCode_t TypeObjectRegistry::are_types_compatible( + const TypeIdentifierPair& type_identifiers, + const TypeConsistencyEnforcementQosPolicy& type_consistency_qos) +{ + static_cast(type_identifiers); + static_cast(type_consistency_qos); + return eprosima::fastdds::dds::RETCODE_UNSUPPORTED; +} + +ReturnCode_t TypeObjectRegistry::get_dependencies_from_type_object( + const TypeObject& type_object, + std::unordered_set& type_dependencies) +{ + ReturnCode_t ret_code = eprosima::fastdds::dds::RETCODE_OK; + TypeIdentifierSeq dependent_type_ids; + TypeIdentfierWithSize type_id_size; + switch (type_object._d()) + { + case EK_MINIMAL: + switch (type_object.minimal()._d()) + { + case TK_ALIAS: + ret_code = get_alias_dependencies(type_object.minimal().alias_type(), type_dependencies); + break; + case TK_ANNOTATION: + ret_code = get_annotation_dependencies(type_object.minimal().annotation_type(), type_dependencies); + break; + case TK_STRUCTURE: + ret_code = get_structure_dependencies(type_object.minimal().struct_type(), type_dependencies); + break; + case TK_UNION: + ret_code = get_union_dependencies(type_object.minimal().union_type(), type_dependencies); + break; + case TK_SEQUENCE: + ret_code = get_sequence_array_dependencies(type_object.minimal().sequence_type(), + type_dependencies); + break; + case TK_ARRAY: + ret_code = get_sequence_array_dependencies(type_object.minimal().array_type(), type_dependencies); + break; + case TK_MAP: + ret_code = get_map_dependencies(type_object.minimal().map_type(), type_dependencies); + break; + // No dependencies + case TK_BITSET: + case TK_ENUM: + case TK_BITMASK: + break; + } + break; + case EK_COMPLETE: + switch (type_object.complete()._d()) + { + case TK_ALIAS: + ret_code = get_alias_dependencies(type_object.complete().alias_type(), type_dependencies); + + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().alias_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().alias_type().header().detail().ann_custom().value(), + type_dependencies); + } + + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().alias_type().body().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().alias_type().body().ann_custom().value(), + type_dependencies); + } + break; + case TK_ANNOTATION: + ret_code = get_annotation_dependencies(type_object.complete().annotation_type(), type_dependencies); + break; + case TK_STRUCTURE: + ret_code = get_structure_dependencies(type_object.complete().struct_type(), type_dependencies); + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().struct_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().struct_type().header().detail().ann_custom().value(), + type_dependencies); + } + if (ret_code == eprosima::fastdds::dds::RETCODE_OK) + { + for (CompleteStructMember member : type_object.complete().struct_type().member_seq()) + { + if (member.detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + member.detail().ann_custom().value(), type_dependencies); + if (ret_code != eprosima::fastdds::dds::RETCODE_OK) + { + break; + } + } + } + } + break; + case TK_UNION: + ret_code = get_union_dependencies(type_object.complete().union_type(), type_dependencies); + + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().union_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().union_type().header().detail().ann_custom().value(), + type_dependencies); + } + + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().union_type().discriminator().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().union_type().discriminator().ann_custom().value(), + type_dependencies); + } + if (ret_code == eprosima::fastdds::dds::RETCODE_OK) + { + for (CompleteUnionMember member : type_object.complete().union_type().member_seq()) + { + if (member.detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + member.detail().ann_custom().value(), type_dependencies); + if (ret_code != eprosima::fastdds::dds::RETCODE_OK) + { + break; + } + } + } + } + break; + case TK_SEQUENCE: + ret_code = get_sequence_array_dependencies(type_object.complete().sequence_type(), + type_dependencies); + //TODO Collection annotations are not currently supported, so their dependencies are ignored. + break; + case TK_ARRAY: + ret_code = get_sequence_array_dependencies(type_object.complete().array_type(), type_dependencies); + //TODO Collection annotations are not currently supported, so their dependencies are ignored. + break; + case TK_MAP: + ret_code = get_map_dependencies(type_object.complete().map_type(), type_dependencies); + //TODO Collection annotations are not currently supported, so their dependencies are ignored. + break; + case TK_BITSET: + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().bitset_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().bitset_type().header().detail().ann_custom().value(), + type_dependencies); + } + if (ret_code == eprosima::fastdds::dds::RETCODE_OK) + { + for (CompleteBitfield member : type_object.complete().bitset_type().field_seq()) + { + if (member.detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + member.detail().ann_custom().value(), type_dependencies); + if (ret_code != eprosima::fastdds::dds::RETCODE_OK) + { + break; + } + } + } + } + break; + case TK_ENUM: + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().enumerated_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().enumerated_type().header().detail().ann_custom().value(), + type_dependencies); + } + if (ret_code == eprosima::fastdds::dds::RETCODE_OK) + { + for (CompleteEnumeratedLiteral member : type_object.complete().enumerated_type().literal_seq()) + { + if (member.detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + member.detail().ann_custom().value(), type_dependencies); + if (ret_code != eprosima::fastdds::dds::RETCODE_OK) + { + break; + } + } + } + } + break; + case TK_BITMASK: + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + type_object.complete().bitmask_type().header().detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + type_object.complete().bitmask_type().header().detail().ann_custom().value(), + type_dependencies); + } + if (ret_code == eprosima::fastdds::dds::RETCODE_OK) + { + for (CompleteBitflag member : type_object.complete().bitmask_type().flag_seq()) + { + if (member.detail().ann_custom().has_value()) + { + ret_code = get_custom_annotations_dependencies( + member.detail().ann_custom().value(), type_dependencies); + if (ret_code != eprosima::fastdds::dds::RETCODE_OK) + { + break; + } + } + } + } + break; + } + break; + } + return ret_code; +} + +const TypeIdentifier TypeObjectRegistry::get_complementary_type_identifier( + const TypeIdentifier& type_id) +{ + std::lock_guard data_guard(type_object_registry_mutex_); + for (const auto& it : local_type_identifiers_) + { + if (it.second.type_identifier1() == type_id) + { + if (TK_NONE != it.second.type_identifier2()._d()) + { + return it.second.type_identifier2(); + } + else + { + return it.second.type_identifier1(); + } + } + else if (it.second.type_identifier2() == type_id) + { + return it.second.type_identifier1(); + } + } + return type_id; +} + +ReturnCode_t TypeObjectRegistry::get_type_dependencies_impl( + const TypeIdentifierSeq& type_identifiers, + std::unordered_set& type_dependencies) +{ + ReturnCode_t ret_code = eprosima::fastdds::dds::RETCODE_OK; + for (const TypeIdentifier& type_id : type_identifiers) + { + if (TypeObjectUtils::is_fully_descriptive_type_identifier(type_id)) + { + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + else if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + TypeObject type_object; + ret_code = get_type_object(type_id, type_object); + if (eprosima::fastdds::dds::RETCODE_OK == ret_code) + { + ret_code = get_dependencies_from_type_object(type_object, type_dependencies); + if (eprosima::fastdds::dds::RETCODE_OK != ret_code) + { + break; + } + } + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + switch (type_id._d()) + { + case TI_PLAIN_SEQUENCE_SMALL: + get_indirect_hash_collection_dependencies(type_id.seq_sdefn(), type_dependencies); + break; + case TI_PLAIN_SEQUENCE_LARGE: + get_indirect_hash_collection_dependencies(type_id.seq_ldefn(), type_dependencies); + break; + case TI_PLAIN_ARRAY_SMALL: + get_indirect_hash_collection_dependencies(type_id.array_sdefn(), type_dependencies); + break; + case TI_PLAIN_ARRAY_LARGE: + get_indirect_hash_collection_dependencies(type_id.array_ldefn(), type_dependencies); + break; + case TI_PLAIN_MAP_SMALL: + get_indirect_hash_map_dependencies(type_id.map_sdefn(), type_dependencies); + break; + case TI_PLAIN_MAP_LARGE: + get_indirect_hash_map_dependencies(type_id.map_ldefn(), type_dependencies); + break; + default: + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + } + } + return ret_code; +} + +void TypeObjectRegistry::add_dependency( + const TypeIdentifier& type_id, + std::unordered_set& type_dependencies) +{ + TypeIdentfierWithSize type_id_size; + type_id_size.type_id(type_id); + { + std::lock_guard data_guard(type_object_registry_mutex_); + type_id_size.typeobject_serialized_size(type_registry_entries_.at(type_id).type_object_serialized_size_); + } + type_dependencies.insert(type_id_size); +} + +ReturnCode_t TypeObjectRegistry::get_custom_annotations_dependencies( + const AppliedAnnotationSeq& custom_annotation_seq, + std::unordered_set& type_dependencies) +{ + TypeIdentifierSeq type_ids; + for (auto ann : custom_annotation_seq) + { + TypeIdentifier type_id = ann.annotation_typeid(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + } + if (!type_ids.empty()) + { + return get_type_dependencies(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; +} + +bool TypeObjectRegistry::is_builtin_annotation_name( + const std::string& name) +{ + if (name == id_annotation_name || name == autoid_annotation_name || name == optional_annotation_name || + name == position_annotation_name || name == value_annotation_name || + name == extensibility_annotation_name || + name == final_annotation_name || name == appendable_annotation_name || name == mutable_annotation_name || + name == key_annotation_name || name == must_understand_annotation_name || + name == default_literal_annotation_name || name == default_annotation_name || + name == range_annotation_name || + name == min_annotation_name || name == max_annotation_name || name == unit_annotation_name || + name == bit_bound_annotation_name || name == external_annotation_name || name == nested_annotation_name || + name == verbatim_annotation_name || name == service_annotation_name || name == oneway_annotation_name || + name == ami_annotation_name || name == hashid_annotation_name || name == default_nested_annotation_name || + name == ignore_literal_names_annotation_name || name == try_construct_annotation_name || + name == non_serialized_annotation_name || name == data_representation_annotation_name || + name == topic_annotation_name) + { + return true; + } + return false; +} + +const TypeObject TypeObjectRegistry::build_minimal_from_complete_type_object( + const CompleteTypeObject& complete_type_object) +{ + MinimalTypeObject minimal_type_object; + switch (complete_type_object._d()) + { + case TK_ALIAS: + { + MinimalAliasType minimal_alias_type = build_minimal_from_complete_alias_type( + complete_type_object.alias_type()); + minimal_type_object.alias_type(minimal_alias_type); + break; + } + case TK_ANNOTATION: + { + MinimalAnnotationType minimal_annotation_type = build_minimal_from_complete_annotation_type( + complete_type_object.annotation_type()); + minimal_type_object.annotation_type(minimal_annotation_type); + break; + } + case TK_STRUCTURE: + { + MinimalStructType minimal_struct_type = build_minimal_from_complete_struct_type( + complete_type_object.struct_type()); + minimal_type_object.struct_type(minimal_struct_type); + break; + } + case TK_UNION: + { + MinimalUnionType minimal_union_type = build_minimal_from_complete_union_type( + complete_type_object.union_type()); + minimal_type_object.union_type(minimal_union_type); + break; + } + case TK_BITSET: + { + MinimalBitsetType minimal_bitset_type = build_minimal_from_complete_bitset_type( + complete_type_object.bitset_type()); + minimal_type_object.bitset_type(minimal_bitset_type); + break; + } + case TK_SEQUENCE: + { + MinimalSequenceType minimal_sequence_type = build_minimal_from_complete_sequence_type( + complete_type_object.sequence_type()); + minimal_type_object.sequence_type(minimal_sequence_type); + break; + } + case TK_ARRAY: + { + MinimalArrayType minimal_array_type = build_minimal_from_complete_array_type( + complete_type_object.array_type()); + minimal_type_object.array_type(minimal_array_type); + break; + } + case TK_MAP: + { + MinimalMapType minimal_map_type = build_minimal_from_complete_map_type( + complete_type_object.map_type()); + minimal_type_object.map_type(minimal_map_type); + break; + } + case TK_ENUM: + { + MinimalEnumeratedType minimal_enumerated_type = build_minimal_from_complete_enumerated_type( + complete_type_object.enumerated_type()); + minimal_type_object.enumerated_type(minimal_enumerated_type); + break; + } + case TK_BITMASK: + { + MinimalBitmaskType minimal_bitmask_type = build_minimal_from_complete_bitmask_type( + complete_type_object.bitmask_type()); + minimal_type_object.bitmask_type(minimal_bitmask_type); + break; + } + } + TypeObject type_object; + type_object.minimal(minimal_type_object); + return type_object; +} + +const MinimalAliasType TypeObjectRegistry::build_minimal_from_complete_alias_type( + const CompleteAliasType& complete_alias_type) +{ + MinimalAliasType minimal_alias_type; + // alias_flags: unused. No flags apply. + // header: empty. Available for future extension. + minimal_alias_type.body().common(complete_alias_type.body().common()); + minimal_alias_type.body().common().related_type(minimal_from_complete_type_identifier( + complete_alias_type.body().common().related_type())); + return minimal_alias_type; +} + +const MinimalAnnotationType TypeObjectRegistry::build_minimal_from_complete_annotation_type( + const CompleteAnnotationType& complete_annotation_type) +{ + MinimalAnnotationType minimal_annotation_type; + // annotation_flag: unused. No flags apply. + // header: empty. Available for future extension. + MinimalAnnotationParameterSeq minimal_annotation_parameter_sequence; + for (const CompleteAnnotationParameter& complete_annotation_parameter : complete_annotation_type.member_seq()) + { + MinimalAnnotationParameter minimal_annotation_parameter; + minimal_annotation_parameter.common(complete_annotation_parameter.common()); + minimal_annotation_parameter.common().member_type_id(minimal_from_complete_type_identifier( + complete_annotation_parameter.common().member_type_id())); + minimal_annotation_parameter.name_hash(TypeObjectUtils::name_hash( + complete_annotation_parameter.name().c_str())); + minimal_annotation_parameter.default_value(complete_annotation_parameter.default_value()); + auto it = minimal_annotation_parameter_sequence.begin(); + for (; it != minimal_annotation_parameter_sequence.end(); ++it) + { + if (it->name_hash() > minimal_annotation_parameter.name_hash()) + { + break; + } + } + minimal_annotation_parameter_sequence.emplace(it, minimal_annotation_parameter); + } + minimal_annotation_type.member_seq(minimal_annotation_parameter_sequence); + return minimal_annotation_type; +} + +const MinimalStructType TypeObjectRegistry::build_minimal_from_complete_struct_type( + const CompleteStructType& complete_struct_type) +{ + MinimalStructType minimal_struct_type; + minimal_struct_type.struct_flags(complete_struct_type.struct_flags()); + minimal_struct_type.header().base_type(minimal_from_complete_type_identifier( + complete_struct_type.header().base_type())); + // header().detail: empty. Available for future extension. + MinimalStructMemberSeq minimal_struct_member_sequence; + for (const CompleteStructMember& complete_struct_member : complete_struct_type.member_seq()) + { + MinimalStructMember minimal_struct_member; + minimal_struct_member.common(complete_struct_member.common()); + minimal_struct_member.common().member_type_id(minimal_from_complete_type_identifier( + complete_struct_member.common().member_type_id())); + minimal_struct_member.detail().name_hash(TypeObjectUtils::name_hash( + complete_struct_member.detail().name().c_str())); + minimal_struct_member_sequence.push_back(minimal_struct_member); + } + minimal_struct_type.member_seq(minimal_struct_member_sequence); + return minimal_struct_type; +} + +const MinimalUnionType TypeObjectRegistry::build_minimal_from_complete_union_type( + const CompleteUnionType& complete_union_type) +{ + MinimalUnionType minimal_union_type; + minimal_union_type.union_flags(complete_union_type.union_flags()); + // header: empty. Available for future extension. + minimal_union_type.discriminator().common(complete_union_type.discriminator().common()); + minimal_union_type.discriminator().common().type_id(minimal_from_complete_type_identifier( + complete_union_type.discriminator().common().type_id())); + MinimalUnionMemberSeq minimal_union_member_sequence; + for (const CompleteUnionMember& complete_union_member : complete_union_type.member_seq()) + { + MinimalUnionMember minimal_union_member; + minimal_union_member.common(complete_union_member.common()); + minimal_union_member.common().type_id(minimal_from_complete_type_identifier( + minimal_union_member.common().type_id())); + minimal_union_member.detail().name_hash(TypeObjectUtils::name_hash( + complete_union_member.detail().name().c_str())); + minimal_union_member_sequence.push_back(minimal_union_member); + } + minimal_union_type.member_seq(minimal_union_member_sequence); + return minimal_union_type; +} + +const MinimalBitsetType TypeObjectRegistry::build_minimal_from_complete_bitset_type( + const CompleteBitsetType& complete_bitset_type) +{ + MinimalBitsetType minimal_bitset_type; + // bitset_flags: unused. No flags apply. + // header: empty. Available for future extension. + MinimalBitfieldSeq minimal_bitfield_sequence; + for (const CompleteBitfield& complete_bitfield : complete_bitset_type.field_seq()) + { + MinimalBitfield minimal_bitfield; + minimal_bitfield.common(complete_bitfield.common()); + minimal_bitfield.name_hash(TypeObjectUtils::name_hash( + complete_bitfield.detail().name().c_str())); + minimal_bitfield_sequence.push_back(minimal_bitfield); + } + minimal_bitset_type.field_seq(minimal_bitfield_sequence); + return minimal_bitset_type; +} + +const MinimalSequenceType TypeObjectRegistry::build_minimal_from_complete_sequence_type( + const CompleteSequenceType& complete_sequence_type) +{ + MinimalSequenceType minimal_sequence_type; + // collection_flag: unused. No flags apply. + minimal_sequence_type.header().common(complete_sequence_type.header().common()); + minimal_sequence_type.element().common(complete_sequence_type.element().common()); + minimal_sequence_type.element().common().type(minimal_from_complete_type_identifier( + complete_sequence_type.element().common().type())); + return minimal_sequence_type; +} + +const MinimalArrayType TypeObjectRegistry::build_minimal_from_complete_array_type( + const CompleteArrayType& complete_array_type) +{ + MinimalArrayType minimal_array_type; + // collection_flag: unused. No flags apply. + minimal_array_type.header().common(complete_array_type.header().common()); + minimal_array_type.element().common(complete_array_type.element().common()); + minimal_array_type.element().common().type(minimal_from_complete_type_identifier( + complete_array_type.element().common().type())); + return minimal_array_type; +} + +const MinimalMapType TypeObjectRegistry::build_minimal_from_complete_map_type( + const CompleteMapType& complete_map_type) +{ + MinimalMapType minimal_map_type; + // collection_flag: unused. No flags apply. + minimal_map_type.header().common(complete_map_type.header().common()); + minimal_map_type.key().common(complete_map_type.key().common()); + minimal_map_type.key().common().type(minimal_from_complete_type_identifier( + complete_map_type.key().common().type())); + minimal_map_type.element().common(complete_map_type.element().common()); + minimal_map_type.element().common().type(minimal_from_complete_type_identifier( + complete_map_type.element().common().type())); + return minimal_map_type; +} + +const MinimalEnumeratedType TypeObjectRegistry::build_minimal_from_complete_enumerated_type( + const CompleteEnumeratedType& complete_enumerated_type) +{ + MinimalEnumeratedType minimal_enumerated_type; + // enum_flags: unused. No flags apply. + minimal_enumerated_type.header().common(complete_enumerated_type.header().common()); + MinimalEnumeratedLiteralSeq minimal_enumerated_literal_sequence; + for (const CompleteEnumeratedLiteral& complete_enumerated_literal : complete_enumerated_type.literal_seq()) + { + MinimalEnumeratedLiteral minimal_enumerated_literal; + minimal_enumerated_literal.common(complete_enumerated_literal.common()); + minimal_enumerated_literal.detail().name_hash(TypeObjectUtils::name_hash( + complete_enumerated_literal.detail().name().c_str())); + minimal_enumerated_literal_sequence.push_back(minimal_enumerated_literal); + } + minimal_enumerated_type.literal_seq(minimal_enumerated_literal_sequence); + return minimal_enumerated_type; +} + +const MinimalBitmaskType TypeObjectRegistry::build_minimal_from_complete_bitmask_type( + const CompleteBitmaskType& complete_bitmask_type) +{ + MinimalBitmaskType minimal_bitmask_type; + // bitmask_flags: unused. No flags apply. + minimal_bitmask_type.header().common(complete_bitmask_type.header().common()); + MinimalBitflagSeq minimal_bitflag_sequence; + for (const CompleteBitflag& complete_bitflag : complete_bitmask_type.flag_seq()) + { + MinimalBitflag minimal_bitflag; + minimal_bitflag.common(complete_bitflag.common()); + minimal_bitflag.detail().name_hash(TypeObjectUtils::name_hash( + complete_bitflag.detail().name().c_str())); + minimal_bitflag_sequence.push_back(minimal_bitflag); + } + minimal_bitmask_type.flag_seq(minimal_bitflag_sequence); + return minimal_bitmask_type; +} + +void TypeObjectRegistry::register_primitive_type_identifiers() +{ + std::lock_guard data_guard(type_object_registry_mutex_); + TypeIdentifierPair type_ids; + type_ids.type_identifier1()._d(TK_BOOLEAN); + local_type_identifiers_.insert({boolean_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_BYTE); + local_type_identifiers_.insert({byte_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_INT16); + local_type_identifiers_.insert({int16_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_INT32); + local_type_identifiers_.insert({int32_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_INT64); + local_type_identifiers_.insert({int64_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_UINT16); + local_type_identifiers_.insert({uint16_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_UINT32); + local_type_identifiers_.insert({uint32_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_UINT64); + local_type_identifiers_.insert({uint64_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_FLOAT32); + local_type_identifiers_.insert({float32_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_FLOAT64); + local_type_identifiers_.insert({float64_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_FLOAT128); + local_type_identifiers_.insert({float128_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_INT8); + local_type_identifiers_.insert({int8_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_UINT8); + local_type_identifiers_.insert({uint8_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_CHAR8); + local_type_identifiers_.insert({char8_type_name, type_ids}); + type_ids.type_identifier1()._d(TK_CHAR16); + local_type_identifiers_.insert({char16_type_name, type_ids}); +} + +const TypeIdentifier TypeObjectRegistry::minimal_from_complete_type_identifier( + const TypeIdentifier& type_id) +{ + if (EK_COMPLETE == type_id._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_id._d() && type_id.seq_sdefn().header().equiv_kind() == EK_COMPLETE) || + (TI_PLAIN_SEQUENCE_LARGE == type_id._d() && type_id.seq_ldefn().header().equiv_kind() == EK_COMPLETE) || + (TI_PLAIN_ARRAY_SMALL == type_id._d() && type_id.array_sdefn().header().equiv_kind() == EK_COMPLETE) || + (TI_PLAIN_ARRAY_LARGE == type_id._d() && type_id.array_ldefn().header().equiv_kind() == EK_COMPLETE) || + (TI_PLAIN_MAP_SMALL == type_id._d() && (type_id.map_sdefn().header().equiv_kind() == EK_COMPLETE || + type_id.map_sdefn().key_identifier()->_d() == EK_COMPLETE)) || + (TI_PLAIN_MAP_LARGE == type_id._d() && (type_id.map_ldefn().header().equiv_kind() == EK_COMPLETE || + type_id.map_ldefn().key_identifier()->_d() == EK_COMPLETE))) + { + std::lock_guard data_guard(type_object_registry_mutex_); + for (const auto& it : local_type_identifiers_) + { + if (it.second.type_identifier1() == type_id) + { + return it.second.type_identifier2(); + } + else if (it.second.type_identifier2() == type_id) + { + return it.second.type_identifier1(); + } + } + } + return type_id; +} + +} // xtypes +} // dds +} // fastdds +} // eprosima diff --git a/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp new file mode 100644 index 00000000000..6a65a476d53 --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp @@ -0,0 +1,771 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file contains the required classes to keep a TypeObject/TypeIdentifier registry. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +namespace std { +template<> +struct hash +{ + std::size_t operator ()( + const eprosima::fastdds::dds::xtypes::TypeIdentifier& k) const + { + // The collection only has direct hash TypeIdentifiers so the EquivalenceHash can be used. + return (static_cast(k.equivalence_hash()[0]) << 16) | + (static_cast(k.equivalence_hash()[1]) << 8) | + (static_cast(k.equivalence_hash()[2])); + } + +}; + +} // std + +namespace eprosima { +namespace fastdds { +namespace dds { + +namespace xtypes { + +using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; + +// TypeObject information +struct TypeRegistryEntry +{ + // TypeObject + TypeObject type_object_; + // TypeObject serialized size + uint32_t type_object_serialized_size_ {0}; + + bool operator !=( + const TypeRegistryEntry& entry); + +}; + +// Class which holds the TypeObject registry, including every TypeIdentifier (plain and non-plain types), every +// non-plain TypeObject and the non-plain TypeObject serialized sizes. +class TypeObjectRegistry : public ITypeObjectRegistry +{ + +public: + + /** + * @brief Register a local TypeObject. + * The MinimalTypeObject is generated from the CompleteTypeObject, and both are registered into the registry + * with the corresponding TypeIdentifiers and TypeObject serialized sizes. + * + * @pre type_name must not be empty. + * @pre complete_type_object must be consistent (only checked in Debug build mode). + * + * @param[in] type_name Name of the type being registered. + * @param[in] complete_type_object CompleteTypeObject related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with the + * given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given type_name is empty or if the type_object + * is inconsistent. + */ + ReturnCode_t register_type_object( + const std::string& type_name, + const CompleteTypeObject& complete_type_object) override; + + /** + * @brief Register an indirect hash TypeIdentifier. + * + * @pre TypeIdentifier must not be a direct hash TypeIdentifier. + * @pre TypeIdentifier must be consistent (only checked in Debug build mode). + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being registered. + * @param[in] type_identifier TypeIdentier related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given TypeIdentifier is inconsistent or a direct hash + * TypeIdentifier or if the given type_name is empty. + */ + ReturnCode_t register_type_identifier( + const std::string& type_name, + const TypeIdentifier& type_identifier) override; + + /** + * @brief Get the TypeObjects related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_objects Both complete and minimal TypeObjects related with the given type_name. + * @return ReturnCode_t RETCODE_OK if the TypeObjects are found in the registry. + * RETCODE_NO_DATA if the given type_name has not been registered. + * RETCODE_BAD_PARAMETER if the type_name correspond to a indirect hash TypeIdentifier. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + ReturnCode_t get_type_objects( + const std::string& type_name, + TypeObjectPair& type_objects) override; + + /** + * @brief Get the TypeIdentifiers related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_identifiers For direct hash TypeIdentifiers, both minimal and complete TypeIdentifiers are + * returned. + * For indirect hash TypeIdentifiers, only the corresponding TypeIdentifier is returned + * @return ReturnCode_t RETCODE_OK if the TypeIdentifiers are found in the registry. + * RETCODE_NO_DATA if the type_name has not been registered. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + ReturnCode_t get_type_identifiers( + const std::string& type_name, + TypeIdentifierPair& type_identifiers) override; + + /** + * @brief Get the TypeObject related to the given TypeIdentifier. + * + * @pre TypeIdentifier must be a direct hash TypeIdentifier. + * + * @param[in] type_identifier TypeIdentifier being queried. + * @param[out] type_object TypeObject related with the given TypeIdentifier. + * @return ReturnCode_t RETCODE_OK if the TypeObject is found within the registry. + * RETCODE_NO_DATA if the given TypeIdentifier is not found in the registry. + * RETCODE_PRECONDITION_NOT_MET if the TypeIdentifier is not a direct hash. + */ + ReturnCode_t get_type_object( + const TypeIdentifier& type_identifier, + TypeObject& type_object) override; + + /** + * @brief Get the TypeInformation related to a specific type_name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Type which type information is queried. + * @param[out] type_information Related TypeInformation for the given type name. + * @return ReturnCode_t RETCODE_OK if the type_name is found within the registry. + * RETCODE_NO_DATA if the given type_name is not found. + * RETCODE_BAD_PARAMETER if the given type name corresponds to a indirect hash TypeIdentifier. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + ReturnCode_t get_type_information( + const std::string& type_name, + TypeInformation& type_information); + + /** + * @brief Get the type dependencies of the given direct hash type identifiers. + * + * @param[in] type_identifiers Sequence with the queried direct hash TypeIdentifiers. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any given TypeIdentifier is unknown to the registry. + * RETCODE_BAD_PARAMETER if any given TypeIdentifier is not a direct hash. + */ + ReturnCode_t get_type_dependencies( + const TypeIdentifierSeq& type_identifiers, + std::unordered_set& type_dependencies); + + /** + * @brief Check if the given TypeIdentfierWithSize is known by the registry. + * + * @param[in] type_identifier_with_size TypeIdentfierWithSize to query. + * @return true if TypeIdentfierWithSize is known. false otherwise. + */ + bool is_type_identifier_known( + const TypeIdentfierWithSize& type_identifier_with_size); + + /** + * @brief Check if a given TypeIdentifier corresponds to a builtin annotation. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the TypeIdentifier is from a builtin annotation. false otherwise. + */ + bool is_builtin_annotation( + const TypeIdentifier& type_identifier); + + /** + * @brief Calculate the TypeIdentifier given a TypeObject. + * + * @param[in] type_object TypeObject which is to be hashed. + * @param[out] type_object_serialized_size + * @return const TypeIdentifier related with the given TypeObject. + */ + const TypeIdentifier calculate_type_identifier( + const TypeObject& type_object, + uint32_t& type_object_serialized_size); + + /** + * @brief Register a remote TypeObject. + * This auxiliary method might register only the minimal TypeObject and TypeIdentifier or register both + * TypeObjects constructing the minimal from the complete TypeObject information. + * TypeObject consistency is not checked in this method as the order of the dependencies received by the + * TypeLookupService is not guaranteed. + * The consistency is checked by the TypeLookupService after all denpendencies are registered + * + * @pre TypeIdentifier discriminator must match TypeObject discriminator. + * TypeIdentifier consistency is only checked in Debug build mode. + * + * @param[in] type_identifier TypeIdentifier to register. + * @param[in] type_object Related TypeObject being registered. + * @return ReturnCode_t RETCODE_OK if correctly registered. + * RETCODE_PRECONDITION_NOT_MET if the discriminators differ. + * RETCODE_PRECONDITION_NOT_MET if the TypeIdentifier is not consistent with the given + * TypeObject. + */ + ReturnCode_t register_type_object( + const TypeIdentifier& type_identifier, + const TypeObject& type_object); + + /** + * @brief Check if two given types are compatible according to the given TypeConsistencyEnforcement QoS. + * + * @param[in] type_identifiers Pair of TypeIdentifiers to check compatibility. + * @param[in] type_consistency_qos TypeConsistencyEnforcement QoS to apply. + * @return ReturnCode_t RETCODE_OK if the two types are compatible. + * RETCODE_ERROR if the types are not compatible according to the TypeConsistencyEnforcement + * QoS. + */ + ReturnCode_t are_types_compatible( + const TypeIdentifierPair& type_identifiers, + const TypeConsistencyEnforcementQosPolicy& type_consistency_qos); + + /** + * @brief Get the type dependencies of the given TypeObject. + * + * @param[in] type_object TypeObject queried for its dependencies. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + * RETCODE_BAD_PARAMETER if any given TypeIdentifier is not a direct hash. + */ + ReturnCode_t get_dependencies_from_type_object( + const TypeObject& type_object, + std::unordered_set& type_dependencies); + + /** + * @brief Get Complementary TypeIdentifier. + * Meaning that if the given TypeIdentifier is a complete TypeIdentifier, + * the returned TypeIdentifier will be the minimal TypeIdentifier and vice versa. + * + * @param type_id TypeIdentifier of which the complementary is to be obtained. + * @return TypeIdentifier complementary to the given type_id. + * Same TypeIdentifier if the given TypeIdentifier does not have complementary. + */ + const TypeIdentifier get_complementary_type_identifier( + const TypeIdentifier& type_id); + + // Only DomainParticipantFactory is allowed to instantiate the TypeObjectRegistry class. + // It cannot be protected as the standard library needs to access the constructor to allocate the resources. + // Rule of zero: resource managing types. + TypeObjectRegistry(); + +protected: + + /** + * @brief Get the type dependencies of the given type identifiers. + * + * @param[in] type_identifiers Sequence with the queried TypeIdentifiers. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any given TypeIdentifier is unknown to the registry. + * RETCODE_BAD_PARAMETER if any given TypeIdentifier is fully descriptive. + */ + ReturnCode_t get_type_dependencies_impl( + const TypeIdentifierSeq& type_identifiers, + std::unordered_set& type_dependencies); + + /** + * @brief Add type dependency to the sequence. + * + * @param[in] type_id TypeIdentifier to be added. + * @param[in out] type_dependencies TypeIdentfierWithSize sequence. + */ + void add_dependency( + const TypeIdentifier& type_id, + std::unordered_set& type_dependencies); + + /** + * @brief Get the type dependencies of custom annotations. + * + * @param[in] custom_annotation_seq Sequence of custom annotations. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + ReturnCode_t get_custom_annotations_dependencies( + const AppliedAnnotationSeq& custom_annotation_seq, + std::unordered_set& type_dependencies); + + /** + * @brief Get the type dependencies of plain sequences or arrays. + * + * @tparam T Either PlainSequenceSElemDefn, PlainSequenceLElemDefn, PlainArraySElemDefn or PlainArrayLElemDefn. + * @param[in] collection_type Plain collection Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + * RETCODE_BAD_PARAMETER if the collection type is fully descriptive. + */ + template + ReturnCode_t get_indirect_hash_collection_dependencies( + const T& collection_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier type_id = *collection_type.element_identifier(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + + /** + * @brief Get the type dependencies of plain maps. + * + * @tparam T Either PlainMapSTypeDefn or PlainMapLTypeDefn. + * @param[in] map_type Plain map Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + * RETCODE_BAD_PARAMETER if both the key and the elements types are fully descriptive. + */ + template + ReturnCode_t get_indirect_hash_map_dependencies( + const T& map_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier key_id = *map_type.key_identifier(); + if (TypeObjectUtils::is_direct_hash_type_identifier(key_id)) + { + add_dependency(key_id, type_dependencies); + type_ids.push_back(key_id); + } + TypeIdentifier element_id = *map_type.element_identifier(); + if (TypeObjectUtils::is_direct_hash_type_identifier(element_id)) + { + add_dependency(element_id, type_dependencies); + type_ids.push_back(element_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(element_id)) + { + type_ids.push_back(element_id); + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; + } + + /** + * @brief Get the alias type dependencies. + * + * @tparam T Either a CompleteAliasType or MinimalAliasType. + * @param[in] alias_type Alias Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_alias_dependencies( + const T& alias_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier type_id = alias_type.body().common().related_type(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Get the annotation type dependencies. + * + * @tparam T Either a CompleteAnnotationType or MinimalAnnotationType. + * @param[in] annotation_type Annotation Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_annotation_dependencies( + const T& annotation_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + for (auto member : annotation_type.member_seq()) + { + TypeIdentifier type_id = member.common().member_type_id(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Get the structure type dependencies. + * + * @tparam T Either a CompleteStructType or MinimalStructType. + * @param[in] struct_type Structure Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_structure_dependencies( + const T& struct_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + TypeIdentifier parent_type_id = struct_type.header().base_type(); + if (TypeObjectUtils::is_direct_hash_type_identifier(parent_type_id)) + { + add_dependency(parent_type_id, type_dependencies); + type_ids.push_back(parent_type_id); + } + for (auto member : struct_type.member_seq()) + { + TypeIdentifier type_id = member.common().member_type_id(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + } + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Get the union type dependencies. + * + * @tparam T Either a CompleteUnionType or MinimalUnionType. + * @param[in] union_type Union Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_union_dependencies( + const T& union_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier discriminator_type_id = union_type.discriminator().common().type_id(); + if (TypeObjectUtils::is_direct_hash_type_identifier(discriminator_type_id)) + { + add_dependency(discriminator_type_id, type_dependencies); + type_ids.push_back(discriminator_type_id); + } + for (auto member : union_type.member_seq()) + { + TypeIdentifier type_id = member.common().type_id(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Get the sequence/array type dependencies. + * + * @tparam T Either a CompleteSequenceType/MinimalSequenceType/CompleteArrayType/MinimalArrayType. + * @param[in] collection_type Sequence or Array Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_sequence_array_dependencies( + const T& collection_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier type_id = collection_type.element().common().type(); + if (TypeObjectUtils::is_direct_hash_type_identifier(type_id)) + { + add_dependency(type_id, type_dependencies); + type_ids.push_back(type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(type_id)) + { + type_ids.push_back(type_id); + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Get the map type dependencies. + * + * @tparam T Either a CompleteMapType or MinimalmapType. + * @param[in] map_type Map Type. + * @param[in out] type_dependencies Unordered set of TypeIdentifiers with related TypeObject serialized size. + * @return ReturnCode_t RETCODE_OK if the operation is successful. + * RETCODE_NO_DATA if any dependent TypeIdentifier is unknown to the registry. + */ + template + ReturnCode_t get_map_dependencies( + const T& map_type, + std::unordered_set& type_dependencies) + { + TypeIdentifierSeq type_ids; + + TypeIdentifier key_type_id = map_type.key().common().type(); + if (TypeObjectUtils::is_direct_hash_type_identifier(key_type_id)) + { + add_dependency(key_type_id, type_dependencies); + type_ids.push_back(key_type_id); + } + TypeIdentifier element_type_id = map_type.element().common().type(); + if (TypeObjectUtils::is_direct_hash_type_identifier(element_type_id)) + { + add_dependency(element_type_id, type_dependencies); + type_ids.push_back(element_type_id); + } + else if (TypeObjectUtils::is_indirect_hash_type_identifier(element_type_id)) + { + type_ids.push_back(element_type_id); + } + + if (!type_ids.empty()) + { + return get_type_dependencies_impl(type_ids, type_dependencies); + } + return eprosima::fastdds::dds::RETCODE_OK; + } + + /** + * @brief Check if a given name corresponds to a builtin annotation. + * + * @param[in] name to check. + * @return true if the name is from a builtin annotation. false otherwise. + */ + bool is_builtin_annotation_name( + const std::string& name); + + /** + * @brief Build minimal TypeObject given a CompleteTypeObject. + * + * @param[in] complete_type_object CompleteTypeObject. + * @return const minimal TypeObject instance. + */ + const TypeObject build_minimal_from_complete_type_object( + const CompleteTypeObject& complete_type_object); + + /** + * @brief Build MinimalAliasType given a CompleteAliasType. + * + * @param[in] complete_alias_type CompleteAliasType. + * @return const MinimalAliasType instance. + */ + const MinimalAliasType build_minimal_from_complete_alias_type( + const CompleteAliasType& complete_alias_type); + + /** + * @brief Build MinimalAnnotationType given a CompleteAnnotationType. + * + * @param[in] complete_annotation_type CompleteAnnotationType. + * @return const MinimalAnnotationType instance. + */ + const MinimalAnnotationType build_minimal_from_complete_annotation_type( + const CompleteAnnotationType& complete_annotation_type); + + /** + * @brief Build MinimalStructType given a CompleteStructType. + * + * @param[in] complete_struct_type CompleteStructType. + * @return const MinimalStructType instance. + */ + const MinimalStructType build_minimal_from_complete_struct_type( + const CompleteStructType& complete_struct_type); + + /** + * @brief Build MinimalUnionType given a CompleteUnionType. + * + * @param[in] complete_union_type CompleteUnionType. + * @return const MinimalUnionType instance. + */ + const MinimalUnionType build_minimal_from_complete_union_type( + const CompleteUnionType& complete_union_type); + + /** + * @brief Build MinimalBitsetType given a CompleteBitsetType. + * + * @param[in] complete_bitset_type CompleteBitsetType. + * @return const MinimalBitsetType instance. + */ + const MinimalBitsetType build_minimal_from_complete_bitset_type( + const CompleteBitsetType& complete_bitset_type); + + /** + * @brief Build MinimalSequenceType given a CompleteSequenceType. + * + * @param[in] complete_sequence_type CompleteSequenceType. + * @return const MinimalSequenceType instance. + */ + const MinimalSequenceType build_minimal_from_complete_sequence_type( + const CompleteSequenceType& complete_sequence_type); + + /** + * @brief Build MinimalArrayType given a CompleteArrayType. + * + * @param[in] complete_array_type CompleteArrayType. + * @return const MinimalArrayType instance. + */ + const MinimalArrayType build_minimal_from_complete_array_type( + const CompleteArrayType& complete_array_type); + + /** + * @brief Build MinimalMapType given a CompleteMapType. + * + * @param[in] complete_map_type CompleteMapType. + * @return const MinimalMapType instance. + */ + const MinimalMapType build_minimal_from_complete_map_type( + const CompleteMapType& complete_map_type); + + /** + * @brief Build MinimalEnumeratedType given a CompleteEnumeratedType. + * + * @param[in] complete_enumerated_type CompleteEnumeratedType. + * @return const MinimalEnumeratedType instance. + */ + const MinimalEnumeratedType build_minimal_from_complete_enumerated_type( + const CompleteEnumeratedType& complete_enumerated_type); + + /** + * @brief Build MinimalBitmaskType given a CompleteBitmaskType. + * + * @param[in] complete_bitmask_type CompleteBitmaskType. + * @return const MinimalBitmaskType instance. + */ + const MinimalBitmaskType build_minimal_from_complete_bitmask_type( + const CompleteBitmaskType& complete_bitmask_type); + + /** + * @brief Register TypeIdentifiers corresponding to the primitive types. + */ + void register_primitive_type_identifiers(); + + /** + * @brief Get Minimal TypeIdentifier from Complete TypeIdentifier. + * + * @param complete_type_id Direct hash complete TypeIdentifier + * @return TypeIdentifier Minimal TypeIdentifier related to the given Complete TypeIdentifier. + * Same TypeIdentifier if the given TypeIdentifier is not a direct hash complete TypeIdentifier. + */ + const TypeIdentifier minimal_from_complete_type_identifier( + const TypeIdentifier& complete_type_id); + + // Collection of local TypeIdentifiers hashed by type_name. + // TypeIdentifierPair contains both the minimal and complete TypeObject TypeIdentifiers. + // In case of indirect hash TypeIdentifiers, type_identifier_2 would be uninitialized (TK_NONE). + std::unordered_map local_type_identifiers_; + + // Collection of TypeObjects hashed by its TypeIdentifier. + // Only direct hash TypeIdentifiers are included in this collection. + std::unordered_map type_registry_entries_; + + // Mutex to protect concurrent access to collections contained in this class + std::mutex type_object_registry_mutex_; + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ diff --git a/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp b/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp new file mode 100644 index 00000000000..4cccc9b041e --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/TypeObjectUtils.cpp @@ -0,0 +1,3569 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +constexpr const char* begin_declaration_file = "begin-declaration-file"; +constexpr const char* before_declaration = "before-declaration"; +constexpr const char* begin_declaration = "begin-declaration"; +constexpr const char* end_declaration = "end-declaration"; +constexpr const char* after_declaration = "after-declaration"; +constexpr const char* end_declaration_file = "end-declaration-file"; +constexpr const char* union_member_protected_name = "discriminator"; +constexpr const CollectionElementFlag collection_element_flag_mask = MemberFlagBits::IS_OPTIONAL | + MemberFlagBits::IS_MUST_UNDERSTAND | MemberFlagBits::IS_KEY | MemberFlagBits::IS_DEFAULT; +constexpr const UnionMemberFlag union_member_flag_mask = MemberFlagBits::IS_OPTIONAL | + MemberFlagBits::IS_MUST_UNDERSTAND | MemberFlagBits::IS_KEY; +constexpr const UnionDiscriminatorFlag union_discriminator_flag_mask = MemberFlagBits::IS_EXTERNAL | + MemberFlagBits::IS_OPTIONAL | MemberFlagBits::IS_MUST_UNDERSTAND | MemberFlagBits::IS_DEFAULT; +constexpr const EnumeratedLiteralFlag enum_literal_flag_mask = MemberFlagBits::TRY_CONSTRUCT1 | + MemberFlagBits::TRY_CONSTRUCT2 | MemberFlagBits::IS_EXTERNAL | MemberFlagBits::IS_OPTIONAL | + MemberFlagBits::IS_MUST_UNDERSTAND | MemberFlagBits::IS_KEY; + +fastdds::dds::xtypes::TypeObjectRegistry& type_object_registry_observer() +{ + return eprosima::fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(); +} + +const TypeObjectHashId TypeObjectUtils::build_type_object_hash_id( + uint8_t discriminator, + const EquivalenceHash& hash) +{ + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "StronglyConnectedComponents not yet supported."); + TypeObjectHashId type_object_hash_id; + type_object_hash_id.hash(hash); + try + { + type_object_hash_id._d(discriminator); + } + catch (const eprosima::fastcdr::exception::BadParamException& e) + { + throw InvalidArgumentError(e.what()); + } + return type_object_hash_id; +} + +CollectionElementFlag TypeObjectUtils::build_collection_element_flag( + TryConstructKind try_construct_kind, + bool external) +{ + CollectionElementFlag collection_element_flag = 0; + set_try_construct_behavior(collection_element_flag, try_construct_kind); + if (external) + { + collection_element_flag |= MemberFlagBits::IS_EXTERNAL; + } + return collection_element_flag; +} + +StructMemberFlag TypeObjectUtils::build_struct_member_flag( + TryConstructKind try_construct_kind, + bool optional, + bool must_understand, + bool key, + bool external) +{ + if (optional && key) + { + throw InvalidArgumentError("Keyed members cannot be optional"); + } + StructMemberFlag struct_member_flag = 0; + set_try_construct_behavior(struct_member_flag, try_construct_kind); + if (optional) + { + struct_member_flag |= MemberFlagBits::IS_OPTIONAL; + } + if (must_understand) + { + struct_member_flag |= MemberFlagBits::IS_MUST_UNDERSTAND; + } + if (key) + { + struct_member_flag |= MemberFlagBits::IS_KEY; + } + if (external) + { + struct_member_flag |= MemberFlagBits::IS_EXTERNAL; + } + return struct_member_flag; +} + +UnionMemberFlag TypeObjectUtils::build_union_member_flag( + TryConstructKind try_construct_kind, + bool default_member, + bool external) +{ + UnionMemberFlag union_member_flag = 0; + set_try_construct_behavior(union_member_flag, try_construct_kind); + if (default_member) + { + union_member_flag |= MemberFlagBits::IS_DEFAULT; + } + if (external) + { + union_member_flag |= MemberFlagBits::IS_EXTERNAL; + } + return union_member_flag; +} + +UnionDiscriminatorFlag TypeObjectUtils::build_union_discriminator_flag( + TryConstructKind try_construct_kind, + bool key) +{ + UnionDiscriminatorFlag union_discriminator_flag = 0; + set_try_construct_behavior(union_discriminator_flag, try_construct_kind); + if (key) + { + union_discriminator_flag |= MemberFlagBits::IS_KEY; + } + return union_discriminator_flag; +} + +EnumeratedLiteralFlag TypeObjectUtils::build_enumerated_literal_flag( + bool default_literal) +{ + EnumeratedLiteralFlag enumerated_literal_flag = 0; + if (default_literal) + { + enumerated_literal_flag |= MemberFlagBits::IS_DEFAULT; + } + return enumerated_literal_flag; +} + +StructTypeFlag TypeObjectUtils::build_struct_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash) +{ + StructTypeFlag struct_type_flag = 0; + set_type_flag(struct_type_flag, extensibility_kind, nested, autoid_hash); + return struct_type_flag; +} + +UnionTypeFlag TypeObjectUtils::build_union_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash) +{ + UnionTypeFlag union_type_flag = 0; + set_type_flag(union_type_flag, extensibility_kind, nested, autoid_hash); + return union_type_flag; +} + +const StringSTypeDefn TypeObjectUtils::build_string_s_type_defn( + SBound bound) +{ + StringSTypeDefn string_s_type_defn; + string_s_type_defn.bound(bound); + return string_s_type_defn; +} + +const StringLTypeDefn TypeObjectUtils::build_string_l_type_defn( + LBound bound) +{ + l_bound_consistency(bound); + StringLTypeDefn string_l_type_defn; + string_l_type_defn.bound(bound); + return string_l_type_defn; +} + +const PlainCollectionHeader TypeObjectUtils::build_plain_collection_header( + EquivalenceKind equiv_kind, + CollectionElementFlag element_flags) +{ + equivalence_kind_consistency(equiv_kind); +#if !defined(NDEBUG) + collection_element_flag_consistency(element_flags); +#endif // !defined(NDEBUG) + PlainCollectionHeader plain_collection_header; + plain_collection_header.equiv_kind(equiv_kind); + plain_collection_header.element_flags(element_flags); + return plain_collection_header; +} + +const PlainSequenceSElemDefn TypeObjectUtils::build_plain_sequence_s_elem_defn( + const PlainCollectionHeader& header, + SBound s_bound, + const eprosima::fastcdr::external& element_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); +#endif // !defined(NDEBUG) + plain_collection_type_identifier_header_consistency(header, *element_identifier); + PlainSequenceSElemDefn plain_sequence_s_elem_defn; + plain_sequence_s_elem_defn.header(header); + plain_sequence_s_elem_defn.bound(s_bound); + plain_sequence_s_elem_defn.element_identifier(element_identifier); + return plain_sequence_s_elem_defn; +} + +const PlainSequenceLElemDefn TypeObjectUtils::build_plain_sequence_l_elem_defn( + const PlainCollectionHeader& header, + LBound l_bound, + const eprosima::fastcdr::external& element_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); +#endif // !defined(NDEBUG) + l_bound_consistency(l_bound); + plain_collection_type_identifier_header_consistency(header, *element_identifier); + PlainSequenceLElemDefn plain_sequence_l_elem_defn; + plain_sequence_l_elem_defn.header(header); + plain_sequence_l_elem_defn.bound(l_bound); + plain_sequence_l_elem_defn.element_identifier(element_identifier); + return plain_sequence_l_elem_defn; +} + +const PlainArraySElemDefn TypeObjectUtils::build_plain_array_s_elem_defn( + const PlainCollectionHeader& header, + const SBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); +#endif // !defined(NDEBUG) + array_bound_seq_consistency(array_bound_seq); + plain_collection_type_identifier_header_consistency(header, *element_identifier); + PlainArraySElemDefn plain_array_s_elem_defn; + plain_array_s_elem_defn.header(header); + plain_array_s_elem_defn.array_bound_seq(array_bound_seq); + plain_array_s_elem_defn.element_identifier(element_identifier); + return plain_array_s_elem_defn; +} + +const PlainArrayLElemDefn TypeObjectUtils::build_plain_array_l_elem_defn( + const PlainCollectionHeader& header, + const LBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); +#endif // !defined(NDEBUG) + l_bound_seq_consistency(array_bound_seq); + plain_collection_type_identifier_header_consistency(header, *element_identifier); + PlainArrayLElemDefn plain_array_l_elem_defn; + plain_array_l_elem_defn.header(header); + plain_array_l_elem_defn.array_bound_seq(array_bound_seq); + plain_array_l_elem_defn.element_identifier(element_identifier); + return plain_array_l_elem_defn; +} + +const PlainMapSTypeDefn TypeObjectUtils::build_plain_map_s_type_defn( + const PlainCollectionHeader& header, + const SBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); + collection_element_flag_consistency(key_flags); +#endif // !defined(NDEBUG) + PlainMapSTypeDefn plain_map_s_type_defn; + plain_map_s_type_defn.element_identifier(element_identifier); + plain_map_s_type_defn.key_identifier(key_identifier); + TypeIdentifier type_identifier; + type_identifier.map_sdefn(plain_map_s_type_defn); + plain_map_type_components_consistency(header, type_identifier); + plain_map_s_type_defn.header(header); + plain_map_s_type_defn.bound(bound); + plain_map_s_type_defn.key_flags(key_flags); + return plain_map_s_type_defn; +} + +const PlainMapLTypeDefn TypeObjectUtils::build_plain_map_l_type_defn( + const PlainCollectionHeader& header, + const LBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier) +{ +#if !defined(NDEBUG) + plain_collection_header_consistency(header); + type_identifier_consistency(*element_identifier); + collection_element_flag_consistency(key_flags); +#endif // !defined(NDEBUG) + l_bound_consistency(bound); + PlainMapLTypeDefn plain_map_l_type_defn; + plain_map_l_type_defn.element_identifier(element_identifier); + plain_map_l_type_defn.key_identifier(key_identifier); + TypeIdentifier type_identifier; + type_identifier.map_ldefn(plain_map_l_type_defn); + plain_map_type_components_consistency(header, type_identifier); + plain_map_l_type_defn.key_flags(key_flags); + plain_map_l_type_defn.header(header); + plain_map_l_type_defn.bound(bound); + return plain_map_l_type_defn; +} + +const StronglyConnectedComponentId TypeObjectUtils::build_strongly_connected_component_id( + const TypeObjectHashId& sc_component_id, + int32_t scc_length, + int32_t scc_index) +{ + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "StronglyConnectedComponents not yet supported."); + StronglyConnectedComponentId scc_id; + scc_id.sc_component_id(sc_component_id); + scc_id.scc_length(scc_length); + scc_id.scc_index(scc_index); + return scc_id; +} + +const ExtendedTypeDefn TypeObjectUtils::build_extended_type_defn() +{ + ExtendedTypeDefn extended_type_defn; + return extended_type_defn; +} + +ReturnCode_t TypeObjectUtils::build_and_register_s_string_type_identifier( + const StringSTypeDefn& string, + const std::string& type_name, + bool wstring) +{ + TypeIdentifier type_identifier; + type_identifier.string_sdefn(string); + if (wstring) + { + type_identifier._d(TI_STRING16_SMALL); + } + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_l_string_type_identifier( + const StringLTypeDefn& string, + const std::string& type_name, + bool wstring) +{ +#if !defined(NDEBUG) + string_ldefn_consistency(string); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.string_ldefn(string); + if (wstring) + { + type_identifier._d(TI_STRING16_LARGE); + } + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_s_sequence_type_identifier( + const PlainSequenceSElemDefn& plain_seq, + const std::string& type_name) +{ +#if !defined(NDEBUG) + seq_sdefn_consistency(plain_seq); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.seq_sdefn(plain_seq); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_l_sequence_type_identifier( + const PlainSequenceLElemDefn& plain_seq, + const std::string& type_name) +{ +#if !defined(NDEBUG) + seq_ldefn_consistency(plain_seq); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.seq_ldefn(plain_seq); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_s_array_type_identifier( + const PlainArraySElemDefn& plain_array, + const std::string& type_name) +{ +#if !defined(NDEBUG) + array_sdefn_consistency(plain_array); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.array_sdefn(plain_array); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_l_array_type_identifier( + const PlainArrayLElemDefn& plain_array, + const std::string& type_name) +{ +#if !defined(NDEBUG) + array_ldefn_consistency(plain_array); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.array_ldefn(plain_array); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_s_map_type_identifier( + const PlainMapSTypeDefn& plain_map, + const std::string& type_name) +{ +#if !defined(NDEBUG) + map_sdefn_consistency(plain_map); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.map_sdefn(plain_map); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_l_map_type_identifier( + const PlainMapLTypeDefn& plain_map, + const std::string& type_name) +{ +#if !defined(NDEBUG) + map_ldefn_consistency(plain_map); +#endif // !defined(NDEBUG) + TypeIdentifier type_identifier; + type_identifier.map_ldefn(plain_map); + return type_object_registry_observer().register_type_identifier(type_name, type_identifier); +} + +ReturnCode_t TypeObjectUtils::build_and_register_scc_type_identifier( + const StronglyConnectedComponentId& scc, + const std::string& type_name) +{ + /* + TypeIdentifier type_identifier; + type_identifier.sc_component_id(scc); + return type_object_registry_observer()->register_type_identifier(type_name, type_identifier); + */ + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "StronglyConnectedComponents not yet supported."); + static_cast(scc); + static_cast(type_name); + return eprosima::fastdds::dds::RETCODE_UNSUPPORTED; +} + +const ExtendedAnnotationParameterValue TypeObjectUtils::build_extended_annotation_parameter_value() +{ + ExtendedAnnotationParameterValue extended_annotation_parameter_value; + return extended_annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + bool boolean_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.boolean_value(boolean_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value_byte( + uint8_t byte_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.byte_value(byte_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + int8_t int8_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.int8_value(int8_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + uint8_t uint8_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.uint8_value(uint8_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + int16_t int16_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.int16_value(int16_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + uint16_t uint16_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.uint_16_value(uint16_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + int32_t int32_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.int32_value(int32_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + uint32_t uint32_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.uint32_value(uint32_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + int64_t int64_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.int64_value(int64_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + uint64_t uint64_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.uint64_value(uint64_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + float float32_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.float32_value(float32_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + double float64_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.float64_value(float64_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + long double float128_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.float128_value(float128_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + char char_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.char_value(char_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + wchar_t wchar_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.wchar_value(wchar_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value_enum( + int32_t enumerated_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.enumerated_value(enumerated_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + const eprosima::fastcdr::fixed_string<128>& string8_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.string8_value(string8_value); + return annotation_parameter_value; +} + +const AnnotationParameterValue TypeObjectUtils::build_annotation_parameter_value( + const std::wstring& string16_value) +{ + AnnotationParameterValue annotation_parameter_value; + annotation_parameter_value.string16_value(string16_value); + return annotation_parameter_value; +} + +const AppliedAnnotationParameter TypeObjectUtils::build_applied_annotation_parameter( + const NameHash& paramname_hash, + const AnnotationParameterValue& value) +{ + AppliedAnnotationParameter applied_annotation_parameter; + applied_annotation_parameter.paramname_hash(paramname_hash); + applied_annotation_parameter.value(value); + return applied_annotation_parameter; +} + +void TypeObjectUtils::add_applied_annotation_parameter( + AppliedAnnotationParameterSeq& param_seq, + const AppliedAnnotationParameter& param) +{ + auto it = param_seq.begin(); + for (; it != param_seq.end(); ++it) + { + // Sorted by AppliedAnnotationParameter.paramname_hash + if (it->paramname_hash() > param.paramname_hash()) + { + break; + } + else if (it->paramname_hash() == param.paramname_hash()) + { + throw InvalidArgumentError("Annotation parameter already applied"); + } + } + param_seq.emplace(it, param); +} + +const AppliedAnnotation TypeObjectUtils::build_applied_annotation( + const TypeIdentifier& annotation_typeid, + const eprosima::fastcdr::optional& param_seq) +{ + applied_annotation_type_identifier_consistency(annotation_typeid); +#if !defined(NDEBUG) + if (param_seq.has_value()) + { + applied_annotation_parameter_seq_consistency(param_seq.value()); + } + if (type_object_registry_observer().is_builtin_annotation(annotation_typeid)) + { + throw InvalidArgumentError("Found builtin annotation in custom annotation sequence"); + } +#endif // !defined(NDEBUG) + AppliedAnnotation applied_annotation; + applied_annotation.annotation_typeid(annotation_typeid); + applied_annotation.param_seq(param_seq); + return applied_annotation; +} + +void TypeObjectUtils::add_applied_annotation( + AppliedAnnotationSeq& ann_custom_seq, + const AppliedAnnotation& ann_custom) +{ +#if !defined(NDEBUG) + applied_annotation_consistency(ann_custom); +#endif // !defined(NDEBUG) + if (!is_direct_hash_type_identifier(ann_custom.annotation_typeid())) + { + throw InvalidArgumentError("Invalid annotation TypeIdentifier"); + } + else + { + auto it = ann_custom_seq.begin(); + for (; it != ann_custom_seq.end(); ++it) + { + // Sorted by AppliedAnnotation.annotation_typeid + if (it->annotation_typeid().equivalence_hash() > ann_custom.annotation_typeid().equivalence_hash()) + { + break; + } + else if (it->annotation_typeid().equivalence_hash() == ann_custom.annotation_typeid().equivalence_hash()) + { + throw InvalidArgumentError("Annotation already applied"); + } + } + ann_custom_seq.emplace(it, ann_custom); + } +} + +const AppliedVerbatimAnnotation TypeObjectUtils::build_applied_verbatim_annotation( + PlacementKind placement, + const eprosima::fastcdr::fixed_string<32>& language, + const std::string& text) +{ + AppliedVerbatimAnnotation applied_verbatim_annotation; + switch (placement) + { + case PlacementKind::AFTER_DECLARATION: + applied_verbatim_annotation.placement(after_declaration); + break; + case PlacementKind::BEFORE_DECLARATION: + applied_verbatim_annotation.placement(before_declaration); + break; + case PlacementKind::BEGIN_DECLARATION: + applied_verbatim_annotation.placement(begin_declaration); + break; + case PlacementKind::BEGIN_FILE: + applied_verbatim_annotation.placement(begin_declaration_file); + break; + case PlacementKind::END_DECLARATION: + applied_verbatim_annotation.placement(end_declaration); + break; + case PlacementKind::END_FILE: + applied_verbatim_annotation.placement(end_declaration_file); + break; + default: + break; + } + applied_verbatim_annotation.language(language); + applied_verbatim_annotation.text(text); + return applied_verbatim_annotation; +} + +const AppliedBuiltinMemberAnnotations TypeObjectUtils::build_applied_builtin_member_annotations( + const eprosima::fastcdr::optional& unit, + const eprosima::fastcdr::optional& min, + const eprosima::fastcdr::optional& max, + const eprosima::fastcdr::optional& hash_id) +{ + AppliedBuiltinMemberAnnotations applied_builtin_member_annotations; + applied_builtin_member_annotations.unit(unit); + if (min.has_value()) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "@min annotation not yet supported."); + } + if (max.has_value()) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "@max annotation not yet supported."); + } + applied_builtin_member_annotations.hash_id(hash_id); + return applied_builtin_member_annotations; +} + +const CommonStructMember TypeObjectUtils::build_common_struct_member( + MemberId member_id, + StructMemberFlag member_flags, + const TypeIdentifier& member_type_id) +{ +#if !defined(NDEBUG) + struct_member_flag_consistency(member_flags); + type_identifier_consistency(member_type_id); +#endif // !defined(NDEBUG) + CommonStructMember common_struct_member; + common_struct_member.member_id(member_id); + common_struct_member.member_flags(member_flags); + common_struct_member.member_type_id(member_type_id); + return common_struct_member; +} + +const CompleteMemberDetail TypeObjectUtils::build_complete_member_detail( + const MemberName& name, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom) +{ +#if !defined(NDEBUG) + if (ann_custom.has_value()) + { + applied_annotation_seq_consistency(ann_custom.value()); + } +#endif // !defined(NDEBUG) + if (name.size() == 0) + { + throw InvalidArgumentError("Member name cannot be empty"); + } + CompleteMemberDetail complete_member_detail; + complete_member_detail.name(name); + complete_member_detail.ann_builtin(ann_builtin); + complete_member_detail.ann_custom(ann_custom); + return complete_member_detail; +} + +const CompleteStructMember TypeObjectUtils::build_complete_struct_member( + const CommonStructMember& common, + const CompleteMemberDetail& detail) +{ +#if !defined(NDEBUG) + common_struct_member_consistency(common); + complete_member_detail_consistency(detail); +#endif // if !defined(NDEBUG) + common_struct_member_and_complete_member_detail_consistency(common, detail); + CompleteStructMember complete_struct_member; + complete_struct_member.common(common); + complete_struct_member.detail(detail); + return complete_struct_member; +} + +void TypeObjectUtils::add_complete_struct_member( + CompleteStructMemberSeq& member_seq, + const CompleteStructMember& member) +{ +#if !defined(NDEBUG) + complete_struct_member_consistency(member); + for (const CompleteStructMember& struct_member : member_seq) + { + if (struct_member.detail().name() == member.detail().name()) + { + throw InvalidArgumentError("Sequence has another member with same name"); + } + } +#endif // !defined(NDEBUG) + auto it = member_seq.begin(); + for (; it != member_seq.end(); ++it) + { + // Ordered by the member_index + if (it->common().member_id() > member.common().member_id()) + { + break; + } + else if (it->common().member_id() == member.common().member_id()) + { + throw InvalidArgumentError("Sequence has another member with same ID"); + } + } + member_seq.emplace(it, member); +} + +const AppliedBuiltinTypeAnnotations TypeObjectUtils::build_applied_builtin_type_annotations( + const eprosima::fastcdr::optional& verbatim) +{ +#if !defined(NDEBUG) + if (verbatim.has_value()) + { + applied_verbatim_annotation_consistency(verbatim.value()); + } +#endif // !defined(NDEBUG) + AppliedBuiltinTypeAnnotations applied_builtin_type_annotations; + applied_builtin_type_annotations.verbatim(verbatim); + return applied_builtin_type_annotations; +} + +const CompleteTypeDetail TypeObjectUtils::build_complete_type_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom, + const QualifiedTypeName& type_name) +{ + if (type_name.size() == 0) + { + throw InvalidArgumentError("QualifiedTypeName cannot be empty"); + } +#if !defined(NDEBUG) + if (ann_builtin.has_value()) + { + applied_builtin_type_annotations_consistency(ann_builtin.value()); + } + if (ann_custom.has_value()) + { + applied_annotation_seq_consistency(ann_custom.value()); + } +#endif // !defined(NDEBUG) + CompleteTypeDetail complete_type_detail; + complete_type_detail.ann_builtin(ann_builtin); + complete_type_detail.ann_custom(ann_custom); + complete_type_detail.type_name(type_name); + return complete_type_detail; +} + +const CompleteStructHeader TypeObjectUtils::build_complete_struct_header( + const TypeIdentifier& base_type, + const CompleteTypeDetail& detail) +{ +#if !defined(NDEBUG) + if (base_type._d() != TK_NONE) + { + structure_base_type_consistency(base_type); + } + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteStructHeader complete_struct_header; + complete_struct_header.base_type(base_type); + complete_struct_header.detail(detail); + return complete_struct_header; +} + +const CompleteStructType TypeObjectUtils::build_complete_struct_type( + StructTypeFlag struct_flags, + const CompleteStructHeader& header, + const CompleteStructMemberSeq& member_seq) +{ +#if !defined(NDEBUG) + type_flag_consistency(struct_flags); + complete_struct_header_consistency(header); + complete_struct_member_seq_consistency(member_seq); +#endif // !defined(NDEBUG) + CompleteStructType complete_struct_type; + complete_struct_type.struct_flags(struct_flags); + complete_struct_type.header(header); + complete_struct_type.member_seq(member_seq); + return complete_struct_type; +} + +void TypeObjectUtils::add_union_case_label( + UnionCaseLabelSeq& label_seq, + int32_t label) +{ + auto it = label_seq.begin(); + for (; it != label_seq.end(); ++it) + { + // Ordered by their values + if (*it > label) + { + break; + } + else if (label == *it) + { + // Not fail but not add repeated member. + return; + } + } + label_seq.emplace(it, label); +} + +const CommonUnionMember TypeObjectUtils::build_common_union_member( + MemberId member_id, + UnionMemberFlag member_flags, + const TypeIdentifier& type_id, + const UnionCaseLabelSeq& label_seq) +{ +#if !defined(NDEBUG) + union_member_flag_consistency(member_flags); + type_identifier_consistency(type_id); + union_case_label_seq_consistency(label_seq); +#endif // !defined(NDEBUG) + if (!(member_flags & MemberFlagBits::IS_DEFAULT) && label_seq.size() == 0) + { + throw InvalidArgumentError("Non default members require at least one associated case"); + } + CommonUnionMember common_union_member; + common_union_member.member_id(member_id); + common_union_member.member_flags(member_flags); + common_union_member.type_id(type_id); + common_union_member.label_seq(label_seq); + return common_union_member; +} + +const CompleteUnionMember TypeObjectUtils::build_complete_union_member( + const CommonUnionMember& common, + const CompleteMemberDetail& detail) +{ +#if !defined(NDEBUG) + common_union_member_consistency(common); + complete_member_detail_consistency(detail); +#endif // !defined(NDEBUG) + common_union_member_complete_member_detail_consistency(common, detail); + CompleteUnionMember complete_union_member; + complete_union_member.common(common); + complete_union_member.detail(detail); + return complete_union_member; +} + +void TypeObjectUtils::add_complete_union_member( + CompleteUnionMemberSeq& complete_union_member_seq, + const CompleteUnionMember& member) +{ + if (union_member_protected_name == member.detail().name().to_string()) + { + throw InvalidArgumentError( + "discriminator name is reserved and is not permitted for type-specific union members"); + } +#if !defined(NDEBUG) + complete_union_member_consistency(member); + std::set case_labels; + // New member labels are ensured to be unique (complete_union_member_consistency) + for (int32_t label : member.common().label_seq()) + { + case_labels.insert(label); + } + for (const CompleteUnionMember& union_member : complete_union_member_seq) + { + if (union_member.detail().name() == member.detail().name()) + { + throw InvalidArgumentError("Sequence has another member with same name"); + } + if (member.common().member_flags() & MemberFlagBits::IS_DEFAULT && + union_member.common().member_flags() & MemberFlagBits::IS_DEFAULT) + { + throw InvalidArgumentError("Union member sequence already has a default member"); + } + for (int32_t label : union_member.common().label_seq()) + { + if (!case_labels.insert(label).second) + { + throw InvalidArgumentError("Repeated union case label"); + } + } + } +#endif // !defined(NDEBUG) + auto it = complete_union_member_seq.begin(); + for (; it != complete_union_member_seq.end(); ++it) + { + // Ordered by member_index + if (it->common().member_id() > member.common().member_id()) + { + break; + } + else if (it->common().member_id() == member.common().member_id()) + { + throw InvalidArgumentError("Sequence has another member with same ID"); + } + } + complete_union_member_seq.emplace(it, member); +} + +const CommonDiscriminatorMember TypeObjectUtils::build_common_discriminator_member( + UnionDiscriminatorFlag member_flags, + const TypeIdentifier& type_id) +{ +#if !defined(NDEBUG) + union_discriminator_flag_consistency(member_flags); +#endif // if !defined(NDEBUG) + common_discriminator_member_type_identifier_consistency(type_id); + CommonDiscriminatorMember common_discriminator_member; + common_discriminator_member.member_flags(member_flags); + common_discriminator_member.type_id(type_id); + return common_discriminator_member; +} + +const CompleteDiscriminatorMember TypeObjectUtils::build_complete_discriminator_member( + const CommonDiscriminatorMember& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom) +{ +#if !defined(NDEBUG) + common_discriminator_member_consistency(common); + if (ann_builtin.has_value()) + { + applied_builtin_type_annotations_consistency(ann_builtin.value()); + } + if (ann_custom.has_value()) + { + applied_annotation_seq_consistency(ann_custom.value()); + } +#endif // !defined(NDEBUG) + CompleteDiscriminatorMember complete_discriminator_member; + complete_discriminator_member.common(common); + complete_discriminator_member.ann_builtin(ann_builtin); + complete_discriminator_member.ann_custom(ann_custom); + return complete_discriminator_member; +} + +const CompleteUnionHeader TypeObjectUtils::build_complete_union_header( + const CompleteTypeDetail& detail) +{ +#if !defined(NDEBUG) + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteUnionHeader complete_union_header; + complete_union_header.detail(detail); + return complete_union_header; +} + +const CompleteUnionType TypeObjectUtils::build_complete_union_type( + UnionTypeFlag union_flags, + const CompleteUnionHeader& header, + const CompleteDiscriminatorMember& discriminator, + const CompleteUnionMemberSeq& member_seq) +{ +#if !defined(NDEBUG) + type_flag_consistency(union_flags); + complete_union_header_consistency(header); + complete_discriminator_member_consistency(discriminator); + complete_union_member_seq_consistency(member_seq); +#endif // !defined(NDEBUG) + CompleteUnionType complete_union_type; + complete_union_type.union_flags(union_flags); + complete_union_type.header(header); + complete_union_type.discriminator(discriminator); + complete_union_type.member_seq(member_seq); + return complete_union_type; +} + +const CommonAnnotationParameter TypeObjectUtils::build_common_annotation_parameter( + AnnotationParameterFlag member_flags, + const TypeIdentifier& member_type_id) +{ +#if !defined(NDEBUG) + type_identifier_consistency(member_type_id); +#endif // if !defined(NDEBUG) + empty_flags_consistency(member_flags); + CommonAnnotationParameter common_annotation_parameter; + common_annotation_parameter.member_flags(member_flags); + common_annotation_parameter.member_type_id(member_type_id); + return common_annotation_parameter; +} + +const CompleteAnnotationParameter TypeObjectUtils::build_complete_annotation_parameter( + const CommonAnnotationParameter& common, + const MemberName& name, + const AnnotationParameterValue& default_value) +{ +#if !defined(NDEBUG) + common_annotation_parameter_consistency(common); +#endif // !defined(NDEBUG) + common_annotation_parameter_type_identifier_default_value_consistency(common.member_type_id(), default_value); + if (name.size() == 0) + { + throw InvalidArgumentError("Annotation parameter name cannot be empty"); + } + CompleteAnnotationParameter complete_annotation_parameter; + complete_annotation_parameter.common(common); + complete_annotation_parameter.name(name); + complete_annotation_parameter.default_value(default_value); + return complete_annotation_parameter; +} + +void TypeObjectUtils::add_complete_annotation_parameter( + CompleteAnnotationParameterSeq& sequence, + const CompleteAnnotationParameter& param) +{ +#if !defined(NDEBUG) + complete_annotation_parameter_consistency(param); +#endif // if !defined(NDEBUG) + auto it = sequence.begin(); + for (; it != sequence.end(); ++it) + { + // Ordered by CompleteAnnotationParameter.name + if (it->name() > param.name()) + { + break; + } + else if (it->name() == param.name()) + { + throw InvalidArgumentError("Sequence has another parameter with same name"); + } + } + sequence.emplace(it, param); +} + +const CompleteAnnotationHeader TypeObjectUtils::build_complete_annotation_header( + const QualifiedTypeName& annotation_name) +{ + if (annotation_name.size() == 0) + { + throw InvalidArgumentError("QualifiedTypeName cannot be empty"); + } + CompleteAnnotationHeader complete_annotation_header; + complete_annotation_header.annotation_name(annotation_name); + return complete_annotation_header; +} + +const CompleteAnnotationType TypeObjectUtils::build_complete_annotation_type( + AnnotationTypeFlag annotation_flag, + const CompleteAnnotationHeader& header, + const CompleteAnnotationParameterSeq& member_seq) +{ + empty_flags_consistency(annotation_flag); +#if !defined(NDEBUG) + complete_annotation_header_consistency(header); + complete_annotation_parameter_seq_consistency(member_seq); +#endif // !defined(NDEBUG) + CompleteAnnotationType complete_annotation_type; + complete_annotation_type.annotation_flag(annotation_flag); + complete_annotation_type.header(header); + complete_annotation_type.member_seq(member_seq); + return complete_annotation_type; +} + +const CommonAliasBody TypeObjectUtils::build_common_alias_body( + AliasMemberFlag related_flags, + const TypeIdentifier& related_type) +{ + empty_flags_consistency(related_flags); +#if !defined(NDEBUG) + type_identifier_consistency(related_type); +#endif // !defined(NDEBUG) + CommonAliasBody common_alias_body; + common_alias_body.related_flags(related_flags); + common_alias_body.related_type(related_type); + return common_alias_body; +} + +const CompleteAliasBody TypeObjectUtils::build_complete_alias_body( + const CommonAliasBody& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom) +{ +#if !defined(NDEBUG) + common_alias_body_consistency(common); + if (ann_custom.has_value()) + { + applied_annotation_seq_consistency(ann_custom.value()); + } +#endif // !defined(NDEBUG) + hashid_builtin_annotation_not_applied_consistency(ann_builtin); + CompleteAliasBody complete_alias_body; + complete_alias_body.common(common); + complete_alias_body.ann_builtin(ann_builtin); + complete_alias_body.ann_custom(ann_custom); + return complete_alias_body; +} + +const CompleteAliasHeader TypeObjectUtils::build_complete_alias_header( + const CompleteTypeDetail& detail) +{ +#if !defined(NDEBUG) + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteAliasHeader complete_alias_header; + complete_alias_header.detail(detail); + return complete_alias_header; +} + +const CompleteAliasType TypeObjectUtils::build_complete_alias_type( + AliasTypeFlag alias_flags, + const CompleteAliasHeader& header, + const CompleteAliasBody& body) +{ + empty_flags_consistency(alias_flags); +#if !defined(NDEBUG) + complete_alias_header_consistency(header); + complete_alias_body_consistency(body); +#endif // !defined(NDEBUF) + CompleteAliasType complete_alias_type; + complete_alias_type.alias_flags(alias_flags); + complete_alias_type.header(header); + complete_alias_type.body(body); + return complete_alias_type; +} + +const CompleteElementDetail TypeObjectUtils::build_complete_element_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom) +{ +#if !defined(NDEBUG) + if (ann_custom.has_value()) + { + applied_annotation_seq_consistency(ann_custom.value()); + } +#endif // !defined(NDEBUG) + hashid_builtin_annotation_not_applied_consistency(ann_builtin); + CompleteElementDetail complete_element_detail; + complete_element_detail.ann_builtin(ann_builtin); + complete_element_detail.ann_custom(ann_custom); + return complete_element_detail; +} + +const CommonCollectionElement TypeObjectUtils::build_common_collection_element( + CollectionElementFlag element_flags, + const TypeIdentifier& type) +{ +#if !defined(NDEBUG) + collection_element_flag_consistency(element_flags); + type_identifier_consistency(type); +#endif // !defined(NDEBUG) + CommonCollectionElement common_collection_element; + common_collection_element.element_flags(element_flags); + common_collection_element.type(type); + return common_collection_element; +} + +const CompleteCollectionElement TypeObjectUtils::build_complete_collection_element( + const CommonCollectionElement& common, + const CompleteElementDetail& detail) +{ +#if !defined(NDEBUG) + common_collection_element_consistency(common); + complete_element_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteCollectionElement complete_collection_element; + complete_collection_element.common(common); + complete_collection_element.detail(detail); + return complete_collection_element; +} + +const CommonCollectionHeader TypeObjectUtils::build_common_collection_header( + LBound bound) +{ + CommonCollectionHeader common_collection_header; + common_collection_header.bound(bound); + return common_collection_header; +} + +const CompleteCollectionHeader TypeObjectUtils::build_complete_collection_header( + const CommonCollectionHeader& common, + const eprosima::fastcdr::optional& detail) +{ +#if !defined(NDEBUG) + if (detail.has_value()) + { + complete_type_detail_consistency(detail.value()); + } +#endif // !defined(NDEBUG) + CompleteCollectionHeader complete_collection_header; + complete_collection_header.common(common); + complete_collection_header.detail(detail); + return complete_collection_header; +} + +const CompleteSequenceType TypeObjectUtils::build_complete_sequence_type( + CollectionTypeFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& element) +{ + empty_flags_consistency(collection_flag); +#if !defined(NDEBUG) + complete_collection_header_consistency(header); + complete_collection_element_consistency(element); +#endif // !defined(NDEBUG) + CompleteSequenceType complete_sequence_type; + complete_sequence_type.collection_flag(collection_flag); + complete_sequence_type.header(header); + complete_sequence_type.element(element); + return complete_sequence_type; +} + +const CommonArrayHeader TypeObjectUtils::build_common_array_header( + const LBoundSeq& bound_seq) +{ + array_bound_seq_consistency(bound_seq); + CommonArrayHeader common_array_header; + common_array_header.bound_seq(bound_seq); + return common_array_header; +} + +const CompleteArrayHeader TypeObjectUtils::build_complete_array_header( + const CommonArrayHeader& common, + const CompleteTypeDetail& detail) +{ +#if !defined(NDEBUG) + common_array_header_consistency(common); + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteArrayHeader complete_array_header; + complete_array_header.common(common); + complete_array_header.detail(detail); + return complete_array_header; +} + +const CompleteArrayType TypeObjectUtils::build_complete_array_type( + CollectionTypeFlag collection_flag, + const CompleteArrayHeader& header, + const CompleteCollectionElement& element) +{ + empty_flags_consistency(collection_flag); +#if !defined(NDEBUG) + complete_array_header_consistency(header); + complete_collection_element_consistency(element); +#endif // !defined(NDEBUG) + CompleteArrayType complete_array_type; + complete_array_type.collection_flag(collection_flag); + complete_array_type.header(header); + complete_array_type.element(element); + return complete_array_type; +} + +const CompleteMapType TypeObjectUtils::build_complete_map_type( + CollectionElementFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& key, + const CompleteCollectionElement& element) +{ + empty_flags_consistency(collection_flag); +#if !defined(NDEBUG) + complete_collection_header_consistency(header); + complete_collection_element_consistency(key); + complete_collection_element_consistency(element); +#endif // !defined(NDEBUG) + map_key_type_identifier_consistency(key.common().type()); + CompleteMapType complete_map_type; + complete_map_type.collection_flag(collection_flag); + complete_map_type.header(header); + complete_map_type.key(key); + complete_map_type.element(element); + return complete_map_type; +} + +const CommonEnumeratedLiteral TypeObjectUtils::build_common_enumerated_literal( + int32_t value, + EnumeratedLiteralFlag flags) +{ +#if !defined(NDEBUG) + enumerated_literal_flag_consistency(flags); +#endif // !defined(NDEBUG) + CommonEnumeratedLiteral common_enumerated_literal; + common_enumerated_literal.value(value); + common_enumerated_literal.flags(flags); + return common_enumerated_literal; +} + +const CompleteEnumeratedLiteral TypeObjectUtils::build_complete_enumerated_literal( + const CommonEnumeratedLiteral& common, + const CompleteMemberDetail& detail) +{ +#if !defined(NDEBUG) + common_enumerated_literal_consistency(common); + complete_member_detail_consistency(detail); +#endif // !defined(NDEBUG) + if (detail.ann_builtin().has_value()) + { + throw InvalidArgumentError("Only @default_literal and @value builtin annotations apply to enum literals"); + } + CompleteEnumeratedLiteral complete_enumerated_literal; + complete_enumerated_literal.common(common); + complete_enumerated_literal.detail(detail); + return complete_enumerated_literal; +} + +void TypeObjectUtils::add_complete_enumerated_literal( + CompleteEnumeratedLiteralSeq& sequence, + const CompleteEnumeratedLiteral& enum_literal) +{ +#if !defined(NDEBUG) + complete_enumerated_literal_consistency(enum_literal); + for (const CompleteEnumeratedLiteral& literal : sequence) + { + if (literal.detail().name() == enum_literal.detail().name()) + { + throw InvalidArgumentError("Sequence has another literal with the same member name"); + } + } +#endif // !defined(NDEBUG) + auto it = sequence.begin(); + for (; it != sequence.end(); ++it) + { + // Ordered by EnumeratedLiteral.common.value + if (it->common().value() > enum_literal.common().value()) + { + break; + } + else if (it->common().value() == enum_literal.common().value()) + { + throw InvalidArgumentError("Sequence has another literal with the same value"); + } + } + sequence.emplace(it, enum_literal); +} + +const CommonEnumeratedHeader TypeObjectUtils::build_common_enumerated_header( + BitBound bit_bound, + bool bitmask) +{ + if (bitmask) + { + bitmask_bit_bound_consistency(bit_bound); + } + else + { + enum_bit_bound_consistency(bit_bound); + } + CommonEnumeratedHeader common_enumerated_header; + common_enumerated_header.bit_bound(bit_bound); + return common_enumerated_header; +} + +const CompleteEnumeratedHeader TypeObjectUtils::build_complete_enumerated_header( + const CommonEnumeratedHeader& common, + const CompleteTypeDetail& detail, + bool bitmask) +{ + static_cast(bitmask); +#if !defined(NDEBUG) + common_enumerated_header_consistency(common, bitmask); + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteEnumeratedHeader complete_enumerated_header; + complete_enumerated_header.common(common); + complete_enumerated_header.detail(detail); + return complete_enumerated_header; +} + +const CompleteEnumeratedType TypeObjectUtils::build_complete_enumerated_type( + EnumTypeFlag enum_flags, + const CompleteEnumeratedHeader& header, + const CompleteEnumeratedLiteralSeq& literal_seq) +{ + empty_flags_consistency(enum_flags); +#if !defined(NDEBUG) + complete_enumerated_header_consistency(header); + complete_enumerated_literal_seq_consistency(literal_seq); +#endif // !defined(NDEBUG) + CompleteEnumeratedType complete_enumerated_type; + complete_enumerated_type.enum_flags(enum_flags); + complete_enumerated_type.header(header); + complete_enumerated_type.literal_seq(literal_seq); + return complete_enumerated_type; +} + +const CommonBitflag TypeObjectUtils::build_common_bitflag( + uint16_t position, + BitflagFlag flags) +{ + bit_position_consistency(position); + empty_flags_consistency(flags); + CommonBitflag common_bitflag; + common_bitflag.position(position); + common_bitflag.flags(flags); + return common_bitflag; +} + +const CompleteBitflag TypeObjectUtils::build_complete_bitflag( + const CommonBitflag& common, + const CompleteMemberDetail& detail) +{ +#if !defined(NDEBUG) + common_bitflag_consistency(common); + complete_member_detail_consistency(detail); +#endif // !defined(NDEBUG) + if (detail.ann_builtin().has_value()) + { + throw InvalidArgumentError("Only @position builtin annotation apply defining bitmask bitflags"); + } + CompleteBitflag complete_bitflag; + complete_bitflag.common(common); + complete_bitflag.detail(detail); + return complete_bitflag; +} + +void TypeObjectUtils::add_complete_bitflag( + CompleteBitflagSeq& sequence, + const CompleteBitflag& bitflag) +{ +#if !defined(NDEBUG) + complete_bitflag_consistency(bitflag); + for (const CompleteBitflag& bitflag_elem : sequence) + { + if (bitflag_elem.detail().name() == bitflag.detail().name()) + { + throw InvalidArgumentError("Sequence has another bitflag with the same name"); + } + } +#endif // !defined(NDEBUG) + auto it = sequence.begin(); + for (; it != sequence.end(); ++it) + { + // Ordered by Bitflag.position + if (it->common().position() > bitflag.common().position()) + { + break; + } + else if (it->common().position() == bitflag.common().position()) + { + throw InvalidArgumentError("Sequence has another bitflag with the same position"); + } + } + sequence.emplace(it, bitflag); +} + +const CompleteBitmaskType TypeObjectUtils::build_complete_bitmask_type( + BitmaskTypeFlag bitmask_flags, + const CompleteBitmaskHeader& header, + const CompleteBitflagSeq& flag_seq) +{ + empty_flags_consistency(bitmask_flags); +#if !defined(NDEBUG) + complete_enumerated_header_consistency(header, true); + complete_bitflag_seq_consistency(flag_seq); +#endif // !defined(NDEBUG) + CompleteBitmaskType complete_bitmask_type; + complete_bitmask_type.bitmask_flags(bitmask_flags); + complete_bitmask_type.header(header); + complete_bitmask_type.flag_seq(flag_seq); + return complete_bitmask_type; +} + +const CommonBitfield TypeObjectUtils::build_common_bitfield( + uint16_t position, + BitsetMemberFlag flags, + uint8_t bitcount, + TypeKind holder_type) +{ + bit_position_consistency(position); + empty_flags_consistency(flags); + bitmask_bit_bound_consistency(bitcount); + bitmask_bit_bound_consistency(bitcount + position); + bitfield_holder_type_consistency(holder_type, bitcount); + CommonBitfield common_bitfield; + common_bitfield.position(position); + common_bitfield.flags(flags); + common_bitfield.bitcount(bitcount); + common_bitfield.holder_type(holder_type); + return common_bitfield; +} + +const CompleteBitfield TypeObjectUtils::build_complete_bitfield( + const CommonBitfield& common, + const CompleteMemberDetail& detail) +{ +#if !defined(NDEBUG) + common_bitfield_consistency(common); + complete_member_detail_consistency(detail); +#endif // !defined(NDEBUG) + if (detail.ann_builtin().has_value()) + { + throw InvalidArgumentError("No builtin annotation applies to bitfield declaration"); + } + CompleteBitfield complete_bitfield; + complete_bitfield.common(common); + complete_bitfield.detail(detail); + return complete_bitfield; +} + +void TypeObjectUtils::add_complete_bitfield( + CompleteBitfieldSeq& sequence, + const CompleteBitfield& bitfield) +{ +#if !defined(NDEBUG) + complete_bitfield_consistency(bitfield); + for (const CompleteBitfield& bitfield_elem : sequence) + { + size_t bitfield_elem_init = bitfield_elem.common().position(); + size_t bitfield_elem_end = bitfield_elem_init + bitfield_elem.common().bitcount() - 1; + size_t bitfield_init = bitfield.common().position(); + size_t bitfield_end = bitfield_init + bitfield.common().bitcount() - 1; + if (bitfield.detail().name().size() != 0 && bitfield_elem.detail().name() == bitfield.detail().name()) + { + throw InvalidArgumentError("Sequence has another bitfield with the same name"); + } + if (bitfield_init <= bitfield_elem_end && bitfield_end >= bitfield_elem_init) + { + throw InvalidArgumentError("Sequence has another bitfield with the same positions"); + } + } +#endif // !defined(NDEBUG) + auto it = sequence.begin(); + for (; it != sequence.end(); ++it) + { + // Ordered by Bitfield.position + if (it->common().position() > bitfield.common().position()) + { + break; + } + else if (it->common().position() == bitfield.common().position()) + { + throw InvalidArgumentError("Sequence has another bitfield with the same positions"); + } + } + sequence.emplace(it, bitfield); +} + +const CompleteBitsetHeader TypeObjectUtils::build_complete_bitset_header( + const CompleteTypeDetail& detail) +{ +#if !defined(NDEBUG) + complete_type_detail_consistency(detail); +#endif // !defined(NDEBUG) + CompleteBitsetHeader complete_bitset_header; + complete_bitset_header.detail(detail); + return complete_bitset_header; +} + +const CompleteBitsetType TypeObjectUtils::build_complete_bitset_type( + BitsetTypeFlag bitset_flags, + const CompleteBitsetHeader& header, + const CompleteBitfieldSeq& field_seq) +{ + empty_flags_consistency(bitset_flags); +#if !defined(NDEBUG) + complete_bitset_header_consistency(header); + complete_bitfield_seq_consistency(field_seq); +#endif // !defined(NDEBUG) + CompleteBitsetType complete_bitset_type; + complete_bitset_type.bitset_flags(bitset_flags); + complete_bitset_type.header(header); + complete_bitset_type.field_seq(field_seq); + return complete_bitset_type; +} + +const CompleteExtendedType TypeObjectUtils::build_complete_extended_type() +{ + CompleteExtendedType complete_extended_type; + return complete_extended_type; +} + +ReturnCode_t TypeObjectUtils::build_and_register_alias_type_object( + const CompleteAliasType& alias_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_alias_type_consistency(alias_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.alias_type(alias_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_annotation_type_object( + const CompleteAnnotationType& annotation_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_annotation_type_consistency(annotation_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.annotation_type(annotation_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_struct_type_object( + const CompleteStructType& struct_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_struct_type_consistency(struct_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.struct_type(struct_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_union_type_object( + const CompleteUnionType& union_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_union_type_consistency(union_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.union_type(union_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_bitset_type_object( + const CompleteBitsetType& bitset_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_bitset_type_consistency(bitset_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.bitset_type(bitset_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_sequence_type_object( + const CompleteSequenceType& sequence_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_sequence_type_consistency(sequence_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.sequence_type(sequence_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_array_type_object( + const CompleteArrayType& array_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_array_type_consistency(array_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.array_type(array_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_map_type_object( + const CompleteMapType& map_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_map_type_consistency(map_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.map_type(map_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_enumerated_type_object( + const CompleteEnumeratedType& enumerated_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_enumerated_type_consistency(enumerated_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.enumerated_type(enumerated_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +ReturnCode_t TypeObjectUtils::build_and_register_bitmask_type_object( + const CompleteBitmaskType& bitmask_type, + const std::string& type_name) +{ +#if !defined(NDEBUG) + complete_bitmask_type_consistency(bitmask_type); +#endif // !defined(NDEBUG) + CompleteTypeObject type_object; + type_object.bitmask_type(bitmask_type); + return type_object_registry_observer().register_type_object(type_name, type_object); +} + +const NameHash TypeObjectUtils::name_hash( + const std::string& name) +{ + NameHash name_hashed; + MD5 hash(name); + for (size_t i = 0; i < name_hashed.size(); i++) + { + name_hashed[i] = hash.digest[i]; + } + return name_hashed; +} + +void TypeObjectUtils::type_object_consistency( + const TypeObject& type_object) +{ + switch (type_object._d()) + { + case EK_COMPLETE: + complete_type_object_consistency(type_object.complete()); + break; + case EK_MINIMAL: + minimal_type_object_consistency(type_object.minimal()); + break; + default: + throw InvalidArgumentError("Inconsistent TypeObject"); + } +} + +void TypeObjectUtils::set_try_construct_behavior( + MemberFlag& member_flag, + TryConstructKind try_construct_kind) +{ + switch (try_construct_kind) + { + case TryConstructKind::USE_DEFAULT: + member_flag |= MemberFlagBits::TRY_CONSTRUCT2; + break; + + case TryConstructKind::TRIM: + member_flag |= MemberFlagBits::TRY_CONSTRUCT1 | MemberFlagBits::TRY_CONSTRUCT2; + break; + + case TryConstructKind::DISCARD: + member_flag |= MemberFlagBits::TRY_CONSTRUCT1; + break; + + // TryContructKind::NOT_APPLIED + default: + break; + } +} + +void TypeObjectUtils::set_type_flag( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash) +{ + set_extensibility_kind(type_flag, extensibility_kind); + if (nested) + { + type_flag |= TypeFlagBits::IS_NESTED; + } + if (autoid_hash) + { + type_flag |= TypeFlagBits::IS_AUTOID_HASH; + } +} + +void TypeObjectUtils::set_extensibility_kind( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind) +{ + switch (extensibility_kind) + { + case ExtensibilityKind::FINAL: + type_flag |= TypeFlagBits::IS_FINAL; + break; + + case ExtensibilityKind::MUTABLE: + type_flag |= TypeFlagBits::IS_MUTABLE; + break; + + case ExtensibilityKind::APPENDABLE: + type_flag |= TypeFlagBits::IS_APPENDABLE; + break; + + // ExtensibilityKind::NOT_APPLIED + default: + break; + } +} + +bool TypeObjectUtils::is_fully_descriptive_type_identifier( + const TypeIdentifier& type_identifier) +{ + return !is_direct_hash_type_identifier(type_identifier) && !is_indirect_hash_type_identifier(type_identifier); +} + +bool TypeObjectUtils::is_direct_hash_type_identifier( + const TypeIdentifier& type_identifier) +{ + bool direct_hash = false; + if (type_identifier._d() == EK_MINIMAL || + type_identifier._d() == EK_COMPLETE || + type_identifier._d() == TI_STRONGLY_CONNECTED_COMPONENT) + { + direct_hash = true; + } + return direct_hash; +} + +bool TypeObjectUtils::is_indirect_hash_type_identifier( + const TypeIdentifier& type_identifier) +{ + bool indirect_hash = false; + if ((type_identifier._d() == TI_PLAIN_SEQUENCE_SMALL && + type_identifier.seq_sdefn().header().equiv_kind() != EK_BOTH) || + (type_identifier._d() == TI_PLAIN_SEQUENCE_LARGE && + type_identifier.seq_ldefn().header().equiv_kind() != EK_BOTH) || + (type_identifier._d() == TI_PLAIN_ARRAY_SMALL && + type_identifier.array_sdefn().header().equiv_kind() != EK_BOTH) || + (type_identifier._d() == TI_PLAIN_ARRAY_LARGE && + type_identifier.array_ldefn().header().equiv_kind() != EK_BOTH) || + (type_identifier._d() == TI_PLAIN_MAP_SMALL && + type_identifier.map_sdefn().header().equiv_kind() != EK_BOTH) || + (type_identifier._d() == TI_PLAIN_MAP_LARGE && + type_identifier.map_ldefn().header().equiv_kind() != EK_BOTH)) + { + indirect_hash = true; + } + return indirect_hash; +} + +void TypeObjectUtils::l_bound_consistency( + LBound bound) +{ + if (bound < 256) + { + throw InvalidArgumentError("bound parameter must be greater than 255"); + } +} + +void TypeObjectUtils::l_bound_seq_consistency( + const LBoundSeq& bound_seq) +{ + if (bound_seq.empty()) + { + throw InvalidArgumentError("array_bound_seq parameter must not be empty"); + } + bool large_dimension = false; + for (LBound lbound : bound_seq) + { + if (INVALID_LBOUND == lbound) + { + throw InvalidArgumentError("bound must always be greater than 0"); + } + if (lbound > 255) + { + large_dimension = true; + } + } + if (!large_dimension) + { + throw InvalidArgumentError("no large bound in array_bound_seq"); + } +} + +void TypeObjectUtils::collection_element_flag_consistency( + CollectionElementFlag collection_element_flag) +{ + if ((collection_element_flag & collection_element_flag_mask) != 0) + { + throw InvalidArgumentError("Only try construct and external flags apply to collection elements"); + } +} + +void TypeObjectUtils::struct_member_flag_consistency( + StructMemberFlag member_flags) +{ + if (member_flags & MemberFlagBits::IS_KEY && member_flags & MemberFlagBits::IS_OPTIONAL) + { + throw InvalidArgumentError("Keyed members cannot be optional"); + } + if ((MemberFlagBits::IS_DEFAULT& member_flags) != 0) + { + throw InvalidArgumentError("Default flag does not apply to structure members"); + } +} + +void TypeObjectUtils::union_member_flag_consistency( + UnionMemberFlag union_member_flag) +{ + if ((union_member_flag & union_member_flag_mask) != 0) + { + throw InvalidArgumentError("Only try construct, default and external flags apply to union members"); + } +} + +void TypeObjectUtils::union_discriminator_flag_consistency( + UnionDiscriminatorFlag union_discriminator_flag) +{ + if ((union_discriminator_flag & union_discriminator_flag_mask) != 0) + { + throw InvalidArgumentError("Only try construct and key flags apply to union discriminator member"); + } +} + +void TypeObjectUtils::enumerated_literal_flag_consistency( + EnumeratedLiteralFlag enumerated_literal_flag) +{ + if ((enumerated_literal_flag & enum_literal_flag_mask) != 0) + { + throw InvalidArgumentError("Only default flag applies to enumerated literals"); + } +} + +void TypeObjectUtils::type_flag_consistency( + TypeFlag type_flag) +{ + if ((type_flag & TypeFlagBits::IS_APPENDABLE && type_flag & TypeFlagBits::IS_FINAL) || + (type_flag & TypeFlagBits::IS_APPENDABLE && type_flag & TypeFlagBits::IS_MUTABLE) || + (type_flag & TypeFlagBits::IS_FINAL && type_flag & TypeFlagBits::IS_MUTABLE)) + { + throw InvalidArgumentError("Exactly one extensibility flag must be set"); + } +} + +void TypeObjectUtils::equivalence_kind_consistency( + EquivalenceKind equiv_kind) +{ + if (EK_BOTH != equiv_kind && EK_COMPLETE != equiv_kind && EK_MINIMAL != equiv_kind) + { + throw InvalidArgumentError("Inconsistent PlainCollectionHeader, invalid EquivalenceKind"); + } +} + +void TypeObjectUtils::plain_collection_header_consistency( + const PlainCollectionHeader& header) +{ + equivalence_kind_consistency(header.equiv_kind()); + collection_element_flag_consistency(header.element_flags()); +} + +void TypeObjectUtils::plain_collection_type_identifier_header_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& element_identifier) +{ + if ((header.equiv_kind() != EK_BOTH && header.equiv_kind() != element_identifier._d()) || + (header.equiv_kind() == EK_BOTH && !is_fully_descriptive_type_identifier(element_identifier))) + { + throw InvalidArgumentError("Inconsistency between given header and element_identifier parameters"); + } +} + +EquivalenceKind TypeObjectUtils::get_map_component_equiv_kind_for_consistency( + const TypeIdentifier& identifier) +{ + if (identifier._d() == TK_NONE) + { + return TK_NONE; + } + else if (is_direct_hash_type_identifier(identifier)) + { + TypeObject type_object; + if (eprosima::fastdds::dds::RETCODE_OK == + type_object_registry_observer().get_type_object(identifier, type_object)) + { + return type_object._d(); + } + else + { + throw InvalidArgumentError("Given TypeIdentifier is not found in TypeObjectRegistry"); + } + } + else if (is_indirect_hash_type_identifier(identifier)) + { + EquivalenceKind element_equiv_kind; + EquivalenceKind key_equiv_kind; + + switch (identifier._d()) + { + case TI_PLAIN_SEQUENCE_SMALL: + return get_map_component_equiv_kind_for_consistency(*identifier.seq_sdefn().element_identifier()); + case TI_PLAIN_SEQUENCE_LARGE: + return get_map_component_equiv_kind_for_consistency(*identifier.seq_ldefn().element_identifier()); + case TI_PLAIN_ARRAY_SMALL: + return get_map_component_equiv_kind_for_consistency(*identifier.array_sdefn().element_identifier()); + case TI_PLAIN_ARRAY_LARGE: + return get_map_component_equiv_kind_for_consistency(*identifier.array_ldefn().element_identifier()); + case TI_PLAIN_MAP_SMALL: + element_equiv_kind = get_map_component_equiv_kind_for_consistency( + *identifier.map_sdefn().element_identifier()); + key_equiv_kind = get_map_component_equiv_kind_for_consistency( + *identifier.map_sdefn().key_identifier()); + + if (EK_BOTH == element_equiv_kind && EK_BOTH == key_equiv_kind) + { + return EK_BOTH; + } + else if ((EK_COMPLETE == element_equiv_kind || EK_BOTH == element_equiv_kind) && + (EK_COMPLETE == key_equiv_kind || EK_BOTH == key_equiv_kind)) + { + return EK_COMPLETE; + } + else if ((EK_MINIMAL == element_equiv_kind || EK_BOTH == element_equiv_kind) && + (EK_MINIMAL == key_equiv_kind || EK_BOTH == key_equiv_kind)) + { + return EK_MINIMAL; + } + else + { + return TK_NONE; + } + case TI_PLAIN_MAP_LARGE: + element_equiv_kind = get_map_component_equiv_kind_for_consistency( + *identifier.map_ldefn().element_identifier()); + key_equiv_kind = get_map_component_equiv_kind_for_consistency( + *identifier.map_ldefn().key_identifier()); + + if (EK_BOTH == element_equiv_kind && EK_BOTH == key_equiv_kind) + { + return EK_BOTH; + } + else if ((EK_COMPLETE == element_equiv_kind || EK_BOTH == element_equiv_kind) && + (EK_COMPLETE == key_equiv_kind || EK_BOTH == key_equiv_kind)) + { + return EK_COMPLETE; + } + else if ((EK_MINIMAL == element_equiv_kind || EK_BOTH == element_equiv_kind) && + (EK_MINIMAL == key_equiv_kind || EK_BOTH == key_equiv_kind)) + { + return EK_MINIMAL; + } + else + { + return TK_NONE; + } + default: + return TK_NONE; + } + } + else + { + return EK_BOTH; + } +} + +void TypeObjectUtils::plain_map_type_components_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& identifier) +{ + switch (identifier._d()) + { + case TI_PLAIN_MAP_SMALL: + map_key_type_identifier_consistency(*identifier.map_sdefn().key_identifier()); + break; + case TI_PLAIN_MAP_LARGE: + map_key_type_identifier_consistency(*identifier.map_ldefn().key_identifier()); + break; + default: + throw InvalidArgumentError("Inconsistent TypeIdentifier, it is not a map type"); + } + + if (header.equiv_kind() != get_map_component_equiv_kind_for_consistency(identifier)) + { + throw InvalidArgumentError( + "Inconsistent PlainCollectionHeader, different equiv_kind between header and components"); + } +} + +void TypeObjectUtils::map_key_type_identifier_consistency( + const TypeIdentifier& key_identifier) +{ + if (key_identifier._d() != TK_INT8 && key_identifier._d() != TK_UINT8 && key_identifier._d() != TK_INT16 && + key_identifier._d() != TK_UINT16 && key_identifier._d() != TK_INT32 && key_identifier._d() != TK_UINT32 && + key_identifier._d() != TK_INT64 && key_identifier._d() != TK_UINT64 && + key_identifier._d() != TI_STRING8_SMALL && key_identifier._d() != TI_STRING8_LARGE && + key_identifier._d() != TI_STRING16_SMALL && key_identifier._d() != TI_STRING16_LARGE && + !is_direct_hash_type_identifier(key_identifier)) + { + throw InvalidArgumentError( + "Inconsistent key identifier: only signed/unsigned integer types and w/string keys are supported"); + } + if (is_direct_hash_type_identifier(key_identifier)) + { + TypeObject type_object; + if (eprosima::fastdds::dds::RETCODE_OK == + type_object_registry_observer().get_type_object(key_identifier, type_object)) + { + if (EK_COMPLETE == type_object._d() && type_object.complete()._d() == TK_ALIAS) + { + map_key_type_identifier_consistency( + type_object.complete().alias_type().body().common().related_type()); + } + else if (EK_MINIMAL == type_object._d() && type_object.minimal()._d() == TK_ALIAS) + { + map_key_type_identifier_consistency( + type_object.minimal().alias_type().body().common().related_type()); + } + else + { + throw InvalidArgumentError( + "Inconsistent key identifier: only signed/unsigned integer types and w/string keys are supported"); + } + } + else + { + throw InvalidArgumentError("Given key TypeIdentifier is not found in TypeObjectRegistry"); + } + } +#if !defined(NDEBUG) + type_identifier_consistency(key_identifier); +#endif // !defined(NDEBUG) +} + +void TypeObjectUtils::string_ldefn_consistency( + const StringLTypeDefn& string) +{ + l_bound_consistency(string.bound()); +} + +void TypeObjectUtils::seq_sdefn_consistency( + const PlainSequenceSElemDefn& plain_seq) +{ + plain_collection_header_consistency(plain_seq.header()); + type_identifier_consistency(*plain_seq.element_identifier()); + plain_collection_type_identifier_header_consistency(plain_seq.header(), *plain_seq.element_identifier()); +} + +void TypeObjectUtils::seq_ldefn_consistency( + const PlainSequenceLElemDefn& plain_seq) +{ + plain_collection_header_consistency(plain_seq.header()); + l_bound_consistency(plain_seq.bound()); + type_identifier_consistency(*plain_seq.element_identifier()); + plain_collection_type_identifier_header_consistency(plain_seq.header(), *plain_seq.element_identifier()); +} + +void TypeObjectUtils::array_sdefn_consistency( + const PlainArraySElemDefn& plain_array) +{ + plain_collection_header_consistency(plain_array.header()); + array_bound_seq_consistency(plain_array.array_bound_seq()); + type_identifier_consistency(*plain_array.element_identifier()); + plain_collection_type_identifier_header_consistency(plain_array.header(), *plain_array.element_identifier()); +} + +void TypeObjectUtils::array_ldefn_consistency( + const PlainArrayLElemDefn& plain_array) +{ + plain_collection_header_consistency(plain_array.header()); + l_bound_seq_consistency(plain_array.array_bound_seq()); + type_identifier_consistency(*plain_array.element_identifier()); + plain_collection_type_identifier_header_consistency(plain_array.header(), *plain_array.element_identifier()); +} + +void TypeObjectUtils::map_sdefn_consistency( + const PlainMapSTypeDefn& plain_map) +{ + plain_collection_header_consistency(plain_map.header()); + type_identifier_consistency(*plain_map.element_identifier()); + collection_element_flag_consistency(plain_map.key_flags()); + TypeIdentifier type_identifier; + type_identifier.map_sdefn(plain_map); + plain_map_type_components_consistency(plain_map.header(), type_identifier); + map_key_type_identifier_consistency(*plain_map.key_identifier()); +} + +void TypeObjectUtils::map_ldefn_consistency( + const PlainMapLTypeDefn& plain_map) +{ + plain_collection_header_consistency(plain_map.header()); + l_bound_consistency(plain_map.bound()); + type_identifier_consistency(*plain_map.element_identifier()); + collection_element_flag_consistency(plain_map.key_flags()); + TypeIdentifier type_identifier; + type_identifier.map_ldefn(plain_map); + plain_map_type_components_consistency(plain_map.header(), type_identifier); + + map_key_type_identifier_consistency(*plain_map.key_identifier()); +} + +void TypeObjectUtils::direct_hash_type_identifier_consistency( + const TypeIdentifier& type_id) +{ + TypeObject type_object; + if (eprosima::fastdds::dds::RETCODE_OK != type_object_registry_observer().get_type_object(type_id, type_object)) + { + throw InvalidArgumentError("TypeIdentifier unknown to TypeObjectRegistry"); + } + uint32_t dummy = 0; + if (type_id != type_object_registry_observer().calculate_type_identifier(type_object, dummy)) + { + throw InvalidArgumentError("Inconsistent TypeIdentifier with registered TypeObject"); + } +} + +void TypeObjectUtils::type_identifier_consistency( + const TypeIdentifier& type_identifier) +{ + switch (type_identifier._d()) + { + case TK_NONE: + throw InvalidArgumentError("Inconsistent TypeIdentifier: non-initialized"); + + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + string_ldefn_consistency(type_identifier.string_ldefn()); + break; + + case TI_PLAIN_SEQUENCE_SMALL: + seq_sdefn_consistency(type_identifier.seq_sdefn()); + break; + + case TI_PLAIN_SEQUENCE_LARGE: + seq_ldefn_consistency(type_identifier.seq_ldefn()); + break; + + case TI_PLAIN_ARRAY_SMALL: + array_sdefn_consistency(type_identifier.array_sdefn()); + break; + + case TI_PLAIN_ARRAY_LARGE: + array_ldefn_consistency(type_identifier.array_ldefn()); + break; + + case TI_PLAIN_MAP_SMALL: + map_sdefn_consistency(type_identifier.map_sdefn()); + break; + + case TI_PLAIN_MAP_LARGE: + map_ldefn_consistency(type_identifier.map_ldefn()); + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "StronglyConnectedComponents not yet supported."); + break; + + case EK_COMPLETE: + case EK_MINIMAL: + direct_hash_type_identifier_consistency(type_identifier); + break; + + // Primitive TypeIdentifiers/ExtendedTypeDefn/StringSTypeDefn: no inconsistency rule apply. + default: + break; + } +} + +void TypeObjectUtils::applied_annotation_parameter_seq_consistency( + const AppliedAnnotationParameterSeq& applied_annotation_parameter_seq) +{ + std::set param_hashes; + for (const AppliedAnnotationParameter& param : applied_annotation_parameter_seq) + { + if (!param_hashes.insert(param.paramname_hash()).second) + { + throw InvalidArgumentError("Repeated annotation parameters in the sequence"); + } + } +} + +void TypeObjectUtils::applied_annotation_type_identifier_consistency( + const TypeIdentifier& annotation_type_id) +{ + if (!is_direct_hash_type_identifier(annotation_type_id)) + { + throw InvalidArgumentError("Applied Annotation TypeIdentifier is not direct HASH"); + } + TypeObject type_object; + ReturnCode_t ret_code = type_object_registry_observer().get_type_object(annotation_type_id, type_object); + if (eprosima::fastdds::dds::RETCODE_OK == ret_code) + { + if ((EK_COMPLETE == type_object._d() && type_object.complete()._d() != TK_ANNOTATION) || + (EK_MINIMAL == type_object._d() && type_object.minimal()._d() != TK_ANNOTATION)) + { + throw InvalidArgumentError("Applied Annotation TypeIdentifier does not correspond with an Annotation type"); + } + } + else if (eprosima::fastdds::dds::RETCODE_NO_DATA == ret_code) + { + throw InvalidArgumentError("Applied Annotation TypeIdentifier unknown to TypeObjectRegistry"); + } +} + +void TypeObjectUtils::applied_annotation_consistency( + const AppliedAnnotation& applied_annotation) +{ + applied_annotation_type_identifier_consistency(applied_annotation.annotation_typeid()); + if (applied_annotation.param_seq().has_value()) + { + applied_annotation_parameter_seq_consistency(applied_annotation.param_seq().value()); + } + if (type_object_registry_observer().is_builtin_annotation( + applied_annotation.annotation_typeid())) + { + throw InvalidArgumentError("Builtin annotation cannot be defined as custom annotation"); + } +} + +void TypeObjectUtils::applied_annotation_seq_consistency( + const AppliedAnnotationSeq& applied_annotation_seq) +{ + std::unordered_set annotation_typeids; + for (const AppliedAnnotation& annotation : applied_annotation_seq) + { + if (!annotation_typeids.insert(annotation.annotation_typeid()).second) + { + throw InvalidArgumentError("Repeated annotation in the sequence"); + } + applied_annotation_consistency(annotation); + } +} + +void TypeObjectUtils::applied_verbatim_annotation_consistency( + const AppliedVerbatimAnnotation& applied_verbatim_annotation) +{ + // Placement + if (applied_verbatim_annotation.placement().compare(begin_declaration_file) != 0 && + applied_verbatim_annotation.placement().compare(before_declaration) != 0 && + applied_verbatim_annotation.placement().compare(begin_declaration) != 0 && + applied_verbatim_annotation.placement().compare(end_declaration) != 0 && + applied_verbatim_annotation.placement().compare(after_declaration) != 0 && + applied_verbatim_annotation.placement().compare(end_declaration_file) != 0) + { + throw InvalidArgumentError("Verbatim annotation placement unknown"); + } + // Language: IDL v4.2 The defined values are as follows: "c", "c++", "java", "idl", "*". Note - Other values may be + // used when relevant. Consequently no consistency check is done with this parameter. + // Text + if (applied_verbatim_annotation.text().empty()) + { + throw InvalidArgumentError("Verbatim annotation requires text parameter"); + } +} + +void TypeObjectUtils::common_struct_member_consistency( + const CommonStructMember& common_struct_member) +{ + struct_member_flag_consistency(common_struct_member.member_flags()); + type_identifier_consistency(common_struct_member.member_type_id()); +} + +void TypeObjectUtils::complete_member_detail_consistency( + const CompleteMemberDetail& complete_member_detail) +{ + if (complete_member_detail.name().size() == 0) + { + throw InvalidArgumentError("Member name cannot be empty"); + } + if (complete_member_detail.ann_custom().has_value()) + { + applied_annotation_seq_consistency(complete_member_detail.ann_custom().value()); + } +} + +void TypeObjectUtils::common_struct_member_and_complete_member_detail_consistency( + const CommonStructMember& common_struct_member, + const CompleteMemberDetail& complete_member_detail) +{ + // Check @hashid consistency with MemberId + if (complete_member_detail.ann_builtin().has_value() && + complete_member_detail.ann_builtin().value().hash_id().has_value()) + { + std::string string_value; + // If the annotation [@hashid] is used without any parameter or with the empty string as a parameter, then the + // Member ID shall be computed from the member name. + if (complete_member_detail.ann_builtin().value().hash_id().value().empty()) + { + string_value = complete_member_detail.name(); + } + else + { + string_value = complete_member_detail.ann_builtin().value().hash_id().value(); + } + string_member_id_consistency(common_struct_member.member_id(), string_value); + } +} + +void TypeObjectUtils::string_member_id_consistency( + MemberId member_id, + const std::string& string_value) +{ + NameHash hash = name_hash(string_value); + if (member_id != static_cast((hash[3] << 24 | hash[2] << 16 | hash[1] << 8 | hash[0]) & 0x0FFFFFFF)) + { + throw InvalidArgumentError("Inconsistent member id coming from a string value"); + } +} + +void TypeObjectUtils::complete_struct_member_consistency( + const CompleteStructMember& complete_struct_member) +{ + common_struct_member_consistency(complete_struct_member.common()); + complete_member_detail_consistency(complete_struct_member.detail()); + common_struct_member_and_complete_member_detail_consistency(complete_struct_member.common(), + complete_struct_member.detail()); +} + +void TypeObjectUtils::complete_struct_member_seq_consistency( + const CompleteStructMemberSeq& complete_struct_member_seq) +{ + std::set member_ids; + std::set member_names; + for (const CompleteStructMember& member : complete_struct_member_seq) + { + if (!member_ids.insert(member.common().member_id()).second) + { + throw InvalidArgumentError("Repeated member id in the sequence"); + } + if (!member_names.insert(member.detail().name()).second) + { + throw InvalidArgumentError("Repeated member name in the sequence"); + } + complete_struct_member_consistency(member); + } +} + +void TypeObjectUtils::applied_builtin_type_annotations_consistency( + const AppliedBuiltinTypeAnnotations& applied_builtin_type_annotations) +{ + if (applied_builtin_type_annotations.verbatim().has_value()) + { + applied_verbatim_annotation_consistency(applied_builtin_type_annotations.verbatim().value()); + } +} + +void TypeObjectUtils::complete_type_detail_consistency( + const CompleteTypeDetail& complete_type_detail) +{ + if (complete_type_detail.type_name().size() == 0) + { + throw InvalidArgumentError("QualifiedTypeName cannot be empty"); + } + if (complete_type_detail.ann_builtin().has_value()) + { + applied_builtin_type_annotations_consistency(complete_type_detail.ann_builtin().value()); + } + if (complete_type_detail.ann_custom().has_value()) + { + applied_annotation_seq_consistency(complete_type_detail.ann_custom().value()); + } +} + +void TypeObjectUtils::structure_base_type_consistency( + const TypeIdentifier& base_type) +{ + if (!is_direct_hash_type_identifier(base_type)) + { + throw InvalidArgumentError("Structure base_type TypeIdentifier is not direct HASH"); + } + TypeObject type_object; + ReturnCode_t ret_code = type_object_registry_observer().get_type_object(base_type, type_object); + if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + EK_COMPLETE == type_object._d() && type_object.complete()._d() == TK_ALIAS) + { + structure_base_type_consistency(type_object.complete().alias_type().body().common().related_type()); + } + else if (ret_code == eprosima::fastdds::dds::RETCODE_OK && + EK_MINIMAL == type_object._d() && type_object.minimal()._d() == TK_ALIAS) + { + structure_base_type_consistency(type_object.minimal().alias_type().body().common().related_type()); + } + else if (ret_code != eprosima::fastdds::dds::RETCODE_OK || + (EK_COMPLETE == type_object._d() && type_object.complete()._d() != TK_STRUCTURE) || + (EK_MINIMAL == type_object._d() && type_object.minimal()._d() != TK_STRUCTURE)) + { + throw InvalidArgumentError("Inconsistent base TypeIdentifier: must be related to a structure TypeObject"); + } +} + +void TypeObjectUtils::complete_struct_header_consistency( + const CompleteStructHeader& complete_struct_header) +{ + if (complete_struct_header.base_type()._d() != TK_NONE) + { + structure_base_type_consistency(complete_struct_header.base_type()); + } + complete_type_detail_consistency(complete_struct_header.detail()); +} + +void TypeObjectUtils::complete_struct_type_consistency( + const CompleteStructType& complete_struct_type) +{ + type_flag_consistency(complete_struct_type.struct_flags()); + complete_struct_header_consistency(complete_struct_type.header()); + complete_struct_member_seq_consistency(complete_struct_type.member_seq()); +} + +void TypeObjectUtils::minimal_struct_type_consistency( + const MinimalStructType& minimal_struct_type) +{ + type_flag_consistency(minimal_struct_type.struct_flags()); + if (minimal_struct_type.header().base_type()._d() != TK_NONE) + { + structure_base_type_consistency(minimal_struct_type.header().base_type()); + } + std::set member_ids; + std::set hash_names; + for (const MinimalStructMember& member : minimal_struct_type.member_seq()) + { + if (!member_ids.insert(member.common().member_id()).second) + { + throw InvalidArgumentError("Repeated member id in the sequence"); + } + if (!hash_names.insert(member.detail().name_hash()).second) + { + throw InvalidArgumentError("Repeated member name in the sequence"); + } + common_struct_member_consistency(member.common()); + if (member.detail().name_hash() == NameHash()) + { + throw InvalidArgumentError("Structure member hashed name cannot be empty"); + } + } +} + +void TypeObjectUtils::union_case_label_seq_consistency( + const UnionCaseLabelSeq& union_case_label_seq) +{ + std::set labels; + for (int32_t label : union_case_label_seq) + { + if (!labels.insert(label).second) + { + throw InvalidArgumentError("Repeated union case labels"); + } + } +} + +void TypeObjectUtils::common_union_member_consistency( + const CommonUnionMember& common_union_member) +{ + union_member_flag_consistency(common_union_member.member_flags()); + type_identifier_consistency(common_union_member.type_id()); + union_case_label_seq_consistency(common_union_member.label_seq()); + if (!(common_union_member.member_flags() & MemberFlagBits::IS_DEFAULT) && + common_union_member.label_seq().size() == 0) + { + throw InvalidArgumentError("Non default members require at least one associated case"); + } +} + +void TypeObjectUtils::common_union_member_complete_member_detail_consistency( + const CommonUnionMember& common_union_member, + const CompleteMemberDetail& complete_member_detail) +{ + // Check @hashid consistency with MemberId + if (complete_member_detail.ann_builtin().has_value() && + complete_member_detail.ann_builtin().value().hash_id().has_value()) + { + std::string string_value; + // If the annotation [@hashid] is used without any parameter or with the empty string as a parameter, then the + // Member ID shall be computed from the member name. + if (complete_member_detail.ann_builtin().value().hash_id().value().empty()) + { + string_value = complete_member_detail.name(); + } + else + { + string_value = complete_member_detail.ann_builtin().value().hash_id().value(); + } + string_member_id_consistency(common_union_member.member_id(), string_value); + } +} + +void TypeObjectUtils::complete_union_member_consistency( + const CompleteUnionMember& complete_union_member) +{ + common_union_member_consistency(complete_union_member.common()); + complete_member_detail_consistency(complete_union_member.detail()); + common_union_member_complete_member_detail_consistency(complete_union_member.common(), + complete_union_member.detail()); +} + +void TypeObjectUtils::complete_union_member_seq_consistency( + const CompleteUnionMemberSeq& complete_member_union_seq) +{ + if (complete_member_union_seq.size() == 0) + { + throw InvalidArgumentError("Unions require at least one union member"); + } + std::set member_ids; + std::set member_names; + std::set case_labels; + bool default_member = false; + for (const CompleteUnionMember& member : complete_member_union_seq) + { + if (union_member_protected_name == member.detail().name().to_string()) + { + throw InvalidArgumentError( + "discriminator name is reserved and is not permitted for type-specific union members"); + } + if (!member_ids.insert(member.common().member_id()).second) + { + throw InvalidArgumentError("Repeated member id in the sequence"); + } + if (!member_names.insert(member.detail().name()).second) + { + throw InvalidArgumentError("Repeated member name in the sequence"); + } + if (member.common().member_flags() & MemberFlagBits::IS_DEFAULT) + { + if (default_member) + { + throw InvalidArgumentError("Union should have at most one default member"); + } + default_member = true; + } + for (int32_t label : member.common().label_seq()) + { + if (!case_labels.insert(label).second) + { + throw InvalidArgumentError("Repeated union case label"); + } + } + complete_union_member_consistency(member); + } +} + +void TypeObjectUtils::common_discriminator_member_type_identifier_consistency( + const TypeIdentifier& type_id) +{ + if (type_id._d() != TK_BOOLEAN && type_id._d() != TK_BYTE && type_id._d() != TK_CHAR8 && type_id._d() != TK_CHAR16 + && type_id._d() != TK_INT8 && type_id._d() != TK_UINT8 && type_id._d() != TK_INT16 && + type_id._d() != TK_UINT16 + && type_id._d() != TK_INT32 && type_id._d() != TK_UINT32 && type_id._d() != TK_INT64 + && type_id._d() != TK_UINT64 && type_id._d() != EK_COMPLETE && type_id._d() != EK_MINIMAL) + { + throw InvalidArgumentError("Inconsistent CommonDiscriminatorMember TypeIdentifier"); + } + TypeObject type_object; + if (is_direct_hash_type_identifier(type_id)) + { + if (eprosima::fastdds::dds::RETCODE_OK == type_object_registry_observer().get_type_object(type_id, type_object)) + { + if (EK_COMPLETE == type_object._d() && type_object.complete()._d() == TK_ALIAS) + { + common_discriminator_member_type_identifier_consistency( + type_object.complete().alias_type().body().common().related_type()); + } + else if (EK_MINIMAL == type_object._d() && type_object.minimal()._d() == TK_ALIAS) + { + common_discriminator_member_type_identifier_consistency( + type_object.minimal().alias_type().body().common().related_type()); + } + else if ((EK_COMPLETE == type_object._d() && type_object.complete()._d() != TK_ENUM) || + (EK_MINIMAL == type_object._d() && type_object.minimal()._d() != TK_ENUM)) + { + throw InvalidArgumentError("Inconsistent CommonDiscriminatorMember TypeIdentifier"); + } + } + else + { + throw InvalidArgumentError("Given TypeIdentifier is not found in TypeObjectRegistry"); + } + } +} + +void TypeObjectUtils::common_discriminator_member_consistency( + const CommonDiscriminatorMember& common_discriminator_member) +{ + union_discriminator_flag_consistency(common_discriminator_member.member_flags()); + common_discriminator_member_type_identifier_consistency(common_discriminator_member.type_id()); +} + +void TypeObjectUtils::complete_union_header_consistency( + const CompleteUnionHeader& complete_union_header) +{ + complete_type_detail_consistency(complete_union_header.detail()); +} + +void TypeObjectUtils::complete_discriminator_member_consistency( + const CompleteDiscriminatorMember& complete_discriminator_member) +{ + common_discriminator_member_consistency(complete_discriminator_member.common()); + if (complete_discriminator_member.ann_builtin().has_value()) + { + applied_builtin_type_annotations_consistency(complete_discriminator_member.ann_builtin().value()); + } + if (complete_discriminator_member.ann_custom().has_value()) + { + applied_annotation_seq_consistency(complete_discriminator_member.ann_custom().value()); + } +} + +void TypeObjectUtils::complete_union_type_consistency( + const CompleteUnionType& complete_union_type) +{ + type_flag_consistency(complete_union_type.union_flags()); + complete_union_header_consistency(complete_union_type.header()); + complete_discriminator_member_consistency(complete_union_type.discriminator()); + complete_union_member_seq_consistency(complete_union_type.member_seq()); +} + +void TypeObjectUtils::minimal_union_type_consistency( + const MinimalUnionType& minimal_union_type) +{ + type_flag_consistency(minimal_union_type.union_flags()); + common_discriminator_member_consistency(minimal_union_type.discriminator().common()); + if (minimal_union_type.member_seq().size() == 0) + { + throw InvalidArgumentError("Unions require at least one union member"); + } + std::set member_ids; + std::set hash_names; + std::set case_labels; + bool default_member = false; + for (const MinimalUnionMember& member : minimal_union_type.member_seq()) + { + if (!member_ids.insert(member.common().member_id()).second) + { + throw InvalidArgumentError("Repeated member id in the sequence"); + } + if (!hash_names.insert(member.detail().name_hash()).second) + { + throw InvalidArgumentError("Repeated member name in the sequence"); + } + if (member.common().member_flags() & MemberFlagBits::IS_DEFAULT) + { + if (default_member) + { + throw InvalidArgumentError("Union should have at most one default member"); + } + default_member = true; + } + for (int32_t label : member.common().label_seq()) + { + if (!case_labels.insert(label).second) + { + throw InvalidArgumentError("Repeated union case label"); + } + } + if (member.detail().name_hash() == NameHash()) + { + throw InvalidArgumentError("Union member hashed name cannot be empty"); + } + } +} + +void TypeObjectUtils::common_annotation_parameter_type_identifier_default_value_consistency( + const TypeIdentifier& type_id, + const AnnotationParameterValue& value) +{ + switch (type_id._d()) + { + // Primitive types + case TK_BOOLEAN: + case TK_BYTE: + case TK_INT16: + case TK_INT32: + case TK_INT64: + case TK_UINT16: + case TK_UINT32: + case TK_UINT64: + case TK_FLOAT32: + case TK_FLOAT64: + case TK_FLOAT128: + case TK_INT8: + case TK_UINT8: + case TK_CHAR8: + case TK_CHAR16: + if (type_id._d() != value._d()) + { + throw InvalidArgumentError("Given annotation parameter value is inconsistent with given TypeIdentifier"); + } + break; + // String + case TI_STRING8_SMALL: + case TI_STRING8_LARGE: + if (value._d() != TK_STRING8) + { + throw InvalidArgumentError("Given annotation parameter value is inconsistent with given TypeIdentifier"); + } + break; + // Wstring + case TI_STRING16_SMALL: + case TI_STRING16_LARGE: + if (value._d() != TK_STRING16) + { + throw InvalidArgumentError("Given annotation parameter value is inconsistent with given TypeIdentifier"); + } + break; + // Enum & Alias + case EK_COMPLETE: + case EK_MINIMAL: + { + TypeObject type_object; + if (eprosima::fastdds::dds::RETCODE_OK == + type_object_registry_observer().get_type_object(type_id, type_object)) + { + if (EK_COMPLETE == type_object._d() && type_object.complete()._d() == TK_ALIAS) + { + common_annotation_parameter_type_identifier_default_value_consistency( + type_object.complete().alias_type().body().common().related_type(), value); + return; + } + else if (EK_MINIMAL == type_object._d() && type_object.minimal()._d() == TK_ALIAS) + { + common_annotation_parameter_type_identifier_default_value_consistency( + type_object.minimal().alias_type().body().common().related_type(), value); + return; + } + if (TK_ENUM != value._d()) + { + throw InvalidArgumentError( + "Given annotation parameter value is inconsistent with given TypeIdentifier"); + } + else if ((EK_COMPLETE == type_object._d() && type_object.complete()._d() != TK_ENUM) || + (EK_MINIMAL == type_object._d() && type_object.minimal()._d() != TK_ENUM)) + { + throw InvalidArgumentError( + "Given annotation parameter value is inconsistent with given TypeIdentifier"); + } + } + else + { + throw InvalidArgumentError("Given TypeIdentifier is not found in TypeObjectRegistry"); + } + break; + } + // Any other TypeIdentifier is erroneous + default: + throw InvalidArgumentError("Given annotation parameter value is inconsistent with given TypeIdentifier"); + break; + } +} + +void TypeObjectUtils::common_annotation_parameter_consistency( + const CommonAnnotationParameter& common_annotation_parameter) +{ + empty_flags_consistency(common_annotation_parameter.member_flags()); + type_identifier_consistency(common_annotation_parameter.member_type_id()); +} + +void TypeObjectUtils::complete_annotation_parameter_consistency( + const CompleteAnnotationParameter& complete_annotation_parameter) +{ + common_annotation_parameter_consistency(complete_annotation_parameter.common()); + common_annotation_parameter_type_identifier_default_value_consistency( + complete_annotation_parameter.common().member_type_id(), complete_annotation_parameter.default_value()); + if (complete_annotation_parameter.name().size() == 0) + { + throw InvalidArgumentError("Annotation parameter name cannot be empty"); + } +} + +void TypeObjectUtils::complete_annotation_parameter_seq_consistency( + const CompleteAnnotationParameterSeq& complete_annotation_parameter_seq) +{ + std::set member_names; + for (const CompleteAnnotationParameter& param : complete_annotation_parameter_seq) + { + if (!member_names.insert(param.name()).second) + { + throw InvalidArgumentError("Repeated parameter name in the sequence"); + } + complete_annotation_parameter_consistency(param); + } +} + +void TypeObjectUtils::complete_annotation_header_consistency( + const CompleteAnnotationHeader& complete_annotation_header) +{ + if (complete_annotation_header.annotation_name().size() == 0) + { + throw InvalidArgumentError("QualifiedTypeName cannot be empty"); + } +} + +void TypeObjectUtils::complete_annotation_type_consistency( + const CompleteAnnotationType& complete_annotation_type) +{ + empty_flags_consistency(complete_annotation_type.annotation_flag()); + complete_annotation_header_consistency(complete_annotation_type.header()); + complete_annotation_parameter_seq_consistency(complete_annotation_type.member_seq()); +} + +void TypeObjectUtils::minimal_annotation_type_consistency( + const MinimalAnnotationType& minimal_annotation_type) +{ + empty_flags_consistency(minimal_annotation_type.annotation_flag()); + std::set hash_names; + for (const MinimalAnnotationParameter& param : minimal_annotation_type.member_seq()) + { + if (!hash_names.insert(param.name_hash()).second) + { + throw InvalidArgumentError("Repeated parameter name in the sequence"); + } + common_annotation_parameter_consistency(param.common()); + common_annotation_parameter_type_identifier_default_value_consistency(param.common().member_type_id(), + param.default_value()); + if (param.name_hash() == NameHash()) + { + throw InvalidArgumentError("Annotation parameter hashed name cannot be empty"); + } + } +} + +void TypeObjectUtils::common_alias_body_consistency( + const CommonAliasBody& common_alias_body) +{ + empty_flags_consistency(common_alias_body.related_flags()); + type_identifier_consistency(common_alias_body.related_type()); +} + +void TypeObjectUtils::hashid_builtin_annotation_not_applied_consistency( + const eprosima::fastcdr::optional& ann_builtin) +{ + if (ann_builtin.has_value() && ann_builtin.value().hash_id().has_value()) + { + throw InvalidArgumentError("@hashid builtin annotation cannot be applied to this specific declaration"); + } +} + +void TypeObjectUtils::complete_alias_body_consistency( + const CompleteAliasBody& complete_alias_body) +{ + common_alias_body_consistency(complete_alias_body.common()); + if (complete_alias_body.ann_custom().has_value()) + { + applied_annotation_seq_consistency(complete_alias_body.ann_custom().value()); + } + hashid_builtin_annotation_not_applied_consistency(complete_alias_body.ann_builtin()); +} + +void TypeObjectUtils::complete_alias_header_consistency( + const CompleteAliasHeader& complete_alias_header) +{ + complete_type_detail_consistency(complete_alias_header.detail()); +} + +void TypeObjectUtils::complete_alias_type_consistency( + const CompleteAliasType& complete_alias_type) +{ + empty_flags_consistency(complete_alias_type.alias_flags()); + complete_alias_header_consistency(complete_alias_type.header()); + complete_alias_body_consistency(complete_alias_type.body()); +} + +void TypeObjectUtils::minimal_alias_type_consistency( + const MinimalAliasType& minimal_alias_type) +{ + empty_flags_consistency(minimal_alias_type.alias_flags()); + common_alias_body_consistency(minimal_alias_type.body().common()); +} + +void TypeObjectUtils::complete_element_detail_consistency( + const CompleteElementDetail& complete_element_detail) +{ + if (complete_element_detail.ann_custom().has_value()) + { + applied_annotation_seq_consistency(complete_element_detail.ann_custom().value()); + } + hashid_builtin_annotation_not_applied_consistency(complete_element_detail.ann_builtin()); +} + +void TypeObjectUtils::common_collection_element_consistency( + const CommonCollectionElement& common_collection_element) +{ + collection_element_flag_consistency(common_collection_element.element_flags()); + type_identifier_consistency(common_collection_element.type()); +} + +void TypeObjectUtils::complete_collection_element_consistency( + const CompleteCollectionElement& complete_collection_element) +{ + common_collection_element_consistency(complete_collection_element.common()); + complete_element_detail_consistency(complete_collection_element.detail()); +} + +void TypeObjectUtils::complete_collection_header_consistency( + const CompleteCollectionHeader& complete_collection_header) +{ + if (complete_collection_header.detail().has_value()) + { + complete_type_detail_consistency(complete_collection_header.detail().value()); + } +} + +void TypeObjectUtils::complete_sequence_type_consistency( + const CompleteSequenceType& complete_sequence_type) +{ + empty_flags_consistency(complete_sequence_type.collection_flag()); + complete_collection_header_consistency(complete_sequence_type.header()); + complete_collection_element_consistency(complete_sequence_type.element()); +} + +void TypeObjectUtils::minimal_sequence_type_consistency( + const MinimalSequenceType& minimal_sequence_type) +{ + empty_flags_consistency(minimal_sequence_type.collection_flag()); + common_collection_element_consistency(minimal_sequence_type.element().common()); +} + +void TypeObjectUtils::common_array_header_consistency( + const CommonArrayHeader& common_array_header) +{ + array_bound_seq_consistency(common_array_header.bound_seq()); +} + +void TypeObjectUtils::complete_array_header_consistency( + const CompleteArrayHeader& complete_array_header) +{ + common_array_header_consistency(complete_array_header.common()); + complete_type_detail_consistency(complete_array_header.detail()); +} + +void TypeObjectUtils::complete_array_type_consistency( + const CompleteArrayType& complete_array_type) +{ + empty_flags_consistency(complete_array_type.collection_flag()); + complete_array_header_consistency(complete_array_type.header()); + complete_collection_element_consistency(complete_array_type.element()); +} + +void TypeObjectUtils::minimal_array_type_consistency( + const MinimalArrayType& minimal_array_type) +{ + empty_flags_consistency(minimal_array_type.collection_flag()); + common_array_header_consistency(minimal_array_type.header().common()); + common_collection_element_consistency(minimal_array_type.element().common()); +} + +void TypeObjectUtils::complete_map_type_consistency( + const CompleteMapType& complete_map_type) +{ + empty_flags_consistency(complete_map_type.collection_flag()); + complete_collection_header_consistency(complete_map_type.header()); + map_key_type_identifier_consistency(complete_map_type.key().common().type()); + complete_collection_element_consistency(complete_map_type.key()); + complete_collection_element_consistency(complete_map_type.element()); +} + +void TypeObjectUtils::minimal_map_type_consistency( + const MinimalMapType& minimal_map_type) +{ + empty_flags_consistency(minimal_map_type.collection_flag()); + map_key_type_identifier_consistency(minimal_map_type.key().common().type()); + common_collection_element_consistency(minimal_map_type.key().common()); + common_collection_element_consistency(minimal_map_type.element().common()); +} + +void TypeObjectUtils::common_enumerated_literal_consistency( + const CommonEnumeratedLiteral& common_enumerated_literal) +{ + enumerated_literal_flag_consistency(common_enumerated_literal.flags()); +} + +void TypeObjectUtils::complete_enumerated_literal_consistency( + const CompleteEnumeratedLiteral& complete_enumerated_literal) +{ + common_enumerated_literal_consistency(complete_enumerated_literal.common()); + complete_member_detail_consistency(complete_enumerated_literal.detail()); + if (complete_enumerated_literal.detail().ann_builtin().has_value()) + { + throw InvalidArgumentError("Only @default_literal and @value builtin annotations apply to enum literals"); + } +} + +void TypeObjectUtils::complete_enumerated_literal_seq_consistency( + const CompleteEnumeratedLiteralSeq& complete_enumerated_literal_seq) +{ + if (complete_enumerated_literal_seq.size() == 0) + { + throw InvalidArgumentError("Enumerations require at least one enum literal"); + } + std::set values; + std::set member_names; + bool default_member = false; + for (const CompleteEnumeratedLiteral& literal : complete_enumerated_literal_seq) + { + if (!values.insert(literal.common().value()).second) + { + throw InvalidArgumentError("Repeated literal value in the sequence"); + } + if (!member_names.insert(literal.detail().name()).second) + { + throw InvalidArgumentError("Repeated literal name in the sequence"); + } + if (literal.common().flags() & MemberFlagBits::IS_DEFAULT) + { + if (default_member) + { + throw InvalidArgumentError("Enumeration should have at most one default literal"); + } + default_member = true; + } + complete_enumerated_literal_consistency(literal); + } +} + +void TypeObjectUtils::enum_bit_bound_consistency( + BitBound bit_bound) +{ + if (bit_bound == 0 || bit_bound > 32) + { + throw InvalidArgumentError("Enumeration bit_bound must take a value between 1 and 32"); + } +} + +void TypeObjectUtils::bitmask_bit_bound_consistency( + BitBound bit_bound) +{ + if (bit_bound == 0 || bit_bound > 64) + { + throw InvalidArgumentError("Bitmask bit_bound must must take a value between 1 and 64"); + } +} + +void TypeObjectUtils::common_enumerated_header_consistency( + const CommonEnumeratedHeader& common_enumerated_header, + bool bitmask) +{ + if (bitmask) + { + bitmask_bit_bound_consistency(common_enumerated_header.bit_bound()); + } + else + { + enum_bit_bound_consistency(common_enumerated_header.bit_bound()); + } +} + +void TypeObjectUtils::complete_enumerated_header_consistency( + const CompleteEnumeratedHeader& complete_enumerated_header, + bool bitmask) +{ + common_enumerated_header_consistency(complete_enumerated_header.common(), bitmask); + complete_type_detail_consistency(complete_enumerated_header.detail()); +} + +void TypeObjectUtils::complete_enumerated_type_consistency( + const CompleteEnumeratedType& complete_enumerated_type) +{ + empty_flags_consistency(complete_enumerated_type.enum_flags()); + complete_enumerated_header_consistency(complete_enumerated_type.header()); + complete_enumerated_literal_seq_consistency(complete_enumerated_type.literal_seq()); +} + +void TypeObjectUtils::minimal_enumerated_type_consistency( + const MinimalEnumeratedType& minimal_enumerated_type) +{ + empty_flags_consistency(minimal_enumerated_type.enum_flags()); + common_enumerated_header_consistency(minimal_enumerated_type.header().common()); + if (minimal_enumerated_type.literal_seq().size() == 0) + { + throw InvalidArgumentError("Enumerations require at least one enum literal"); + } + std::set values; + std::set hash_names; + bool default_member = false; + for (const MinimalEnumeratedLiteral& literal : minimal_enumerated_type.literal_seq()) + { + if (!values.insert(literal.common().value()).second) + { + throw InvalidArgumentError("Repeated literal value in the sequence"); + } + if (!hash_names.insert(literal.detail().name_hash()).second) + { + throw InvalidArgumentError("Repeated literal name in the sequence"); + } + if (literal.common().flags() & MemberFlagBits::IS_DEFAULT) + { + if (default_member) + { + throw InvalidArgumentError("Enumeration should have at most one default literal"); + } + default_member = true; + } + common_enumerated_literal_consistency(literal.common()); + if (literal.detail().name_hash() == NameHash()) + { + throw InvalidArgumentError("Literal hashed name cannot be empty"); + } + } +} + +void TypeObjectUtils::bit_position_consistency( + uint16_t position) +{ + if (position >= 64) + { + throw InvalidArgumentError("Bitflag/Bitfield position must take a value under 64"); + } +} + +void TypeObjectUtils::common_bitflag_consistency( + const CommonBitflag& common_bitflag) +{ + bit_position_consistency(common_bitflag.position()); + empty_flags_consistency(common_bitflag.flags()); +} + +void TypeObjectUtils::complete_bitflag_consistency( + const CompleteBitflag& complete_bitflag) +{ + common_bitflag_consistency(complete_bitflag.common()); + complete_member_detail_consistency(complete_bitflag.detail()); + if (complete_bitflag.detail().ann_builtin().has_value()) + { + throw InvalidArgumentError("Only @position builtin annotation apply defining bitmask bitflags"); + } +} + +void TypeObjectUtils::complete_bitflag_seq_consistency( + const CompleteBitflagSeq& complete_bitflag_seq) +{ + if (complete_bitflag_seq.size() == 0) + { + throw InvalidArgumentError("At least one bitflag must be defined within the bitmask"); + } + std::set positions; + std::set bitflag_names; + for (const CompleteBitflag& bitflag : complete_bitflag_seq) + { + if (!positions.insert(bitflag.common().position()).second) + { + throw InvalidArgumentError("Repeated bitflag position"); + } + if (!bitflag_names.insert(bitflag.detail().name()).second) + { + throw InvalidArgumentError("Repeated bitflag name"); + } + complete_bitflag_consistency(bitflag); + } +} + +void TypeObjectUtils::complete_bitmask_type_consistency( + const CompleteBitmaskType& complete_bitmask_type) +{ + empty_flags_consistency(complete_bitmask_type.bitmask_flags()); + complete_enumerated_header_consistency(complete_bitmask_type.header(), true); + complete_bitflag_seq_consistency(complete_bitmask_type.flag_seq()); +} + +void TypeObjectUtils::minimal_bitmask_type_consistency( + const MinimalBitmaskType& minimal_bitmask_type) +{ + empty_flags_consistency(minimal_bitmask_type.bitmask_flags()); + common_enumerated_header_consistency(minimal_bitmask_type.header().common(), true); + if (minimal_bitmask_type.flag_seq().size() == 0) + { + throw InvalidArgumentError("At least one bitflag must be defined within the bitmask"); + } + std::set positions; + std::set bitflag_hash_names; + for (const MinimalBitflag& bitflag : minimal_bitmask_type.flag_seq()) + { + if (!positions.insert(bitflag.common().position()).second) + { + throw InvalidArgumentError("Repeated bitflag position"); + } + if (!bitflag_hash_names.insert(bitflag.detail().name_hash()).second) + { + throw InvalidArgumentError("Repeated bitflag name"); + } + common_bitflag_consistency(bitflag.common()); + } +} + +void TypeObjectUtils::bitfield_holder_type_consistency( + TypeKind holder_type, + uint8_t bitcount) +{ + bool holds_1_bit = (holder_type == TK_BOOLEAN); + bool holds_8_bits = (holder_type == TK_BYTE || holder_type == TK_INT8 || holder_type == TK_UINT8); + bool holds_16_bits = (holder_type == TK_INT16 || holder_type == TK_UINT16); + bool holds_32_bits = (holder_type == TK_INT32 || holder_type == TK_UINT32); + bool holds_64_bits = (holder_type == TK_INT64 || holder_type == TK_UINT64); + if (!(holds_1_bit || holds_8_bits || holds_16_bits || holds_32_bits || holds_64_bits)) + { + throw InvalidArgumentError("Inconsistent bitfield holder type"); + } + if ((holds_1_bit && bitcount > 1) || (holds_8_bits && bitcount > 8) || (holds_16_bits && bitcount > 16) || + (holds_32_bits && bitcount > 32)) + { + throw InvalidArgumentError("Bitcount exceeds the size of the holder type"); + } +} + +void TypeObjectUtils::common_bitfield_consistency( + const CommonBitfield& common_bitfield) +{ + bit_position_consistency(common_bitfield.position()); + empty_flags_consistency(common_bitfield.flags()); + bitmask_bit_bound_consistency(common_bitfield.bitcount()); + bitmask_bit_bound_consistency(common_bitfield.bitcount() + common_bitfield.position()); + bitfield_holder_type_consistency(common_bitfield.holder_type(), common_bitfield.bitcount()); +} + +void TypeObjectUtils::complete_bitfield_consistency( + const CompleteBitfield& complete_bitfield) +{ + common_bitfield_consistency(complete_bitfield.common()); + complete_member_detail_consistency(complete_bitfield.detail()); + if (complete_bitfield.detail().ann_builtin().has_value()) + { + throw InvalidArgumentError("No builtin annotation applies to bitfield declaration"); + } +} + +void TypeObjectUtils::complete_bitfield_seq_consistency( + const CompleteBitfieldSeq& complete_bitfield_seq) +{ + if (complete_bitfield_seq.size() == 0) + { + throw InvalidArgumentError("Bitset requires at least one bitfield definition"); + } + std::set bitfield_names; + std::set positions; + for (const CompleteBitfield& bitfield : complete_bitfield_seq) + { + if (!bitfield_names.insert(bitfield.detail().name()).second) + { + throw InvalidArgumentError("Repeated bitfield name"); + } + for (uint16_t j = bitfield.common().position(); + j < bitfield.common().bitcount(); j++) + { + if (!positions.insert(bitfield.common().position() + j).second) + { + throw InvalidArgumentError("Bitfields with repeated/overlapping positions"); + } + } + complete_bitfield_consistency(bitfield); + } +} + +void TypeObjectUtils::complete_bitset_header_consistency( + const CompleteBitsetHeader& complete_bitset_header) +{ + complete_type_detail_consistency(complete_bitset_header.detail()); +} + +void TypeObjectUtils::complete_bitset_type_consistency( + const CompleteBitsetType& complete_bitset_type) +{ + empty_flags_consistency(complete_bitset_type.bitset_flags()); + complete_bitset_header_consistency(complete_bitset_type.header()); + complete_bitfield_seq_consistency(complete_bitset_type.field_seq()); +} + +void TypeObjectUtils::minimal_bitset_type_consistency( + const MinimalBitsetType& minimal_bitset_type) +{ + empty_flags_consistency(minimal_bitset_type.bitset_flags()); + if (minimal_bitset_type.field_seq().size() == 0) + { + throw InvalidArgumentError("Bitset requires at least one bitfield definition"); + } + std::set bitfield_hash_names; + std::set positions; + for (const MinimalBitfield& bitfield : minimal_bitset_type.field_seq()) + { + if (!bitfield_hash_names.insert(bitfield.name_hash()).second) + { + throw InvalidArgumentError("Repeated bitfield name"); + } + for (uint16_t j = bitfield.common().position(); + j < bitfield.common().bitcount(); j++) + { + if (!positions.insert(bitfield.common().position() + j).second) + { + throw InvalidArgumentError("Bitfields with repeated/overlapping positions"); + } + } + common_bitfield_consistency(bitfield.common()); + if (bitfield.name_hash() == NameHash()) + { + throw InvalidArgumentError("Bitfield hashed name cannot be empty"); + } + } +} + +void TypeObjectUtils::complete_type_object_consistency( + const CompleteTypeObject& complete_type_object) +{ + switch (complete_type_object._d()) + { + case TK_ALIAS: + complete_alias_type_consistency(complete_type_object.alias_type()); + break; + case TK_ANNOTATION: + complete_annotation_type_consistency(complete_type_object.annotation_type()); + break; + case TK_STRUCTURE: + complete_struct_type_consistency(complete_type_object.struct_type()); + break; + case TK_UNION: + complete_union_type_consistency(complete_type_object.union_type()); + break; + case TK_BITSET: + complete_bitset_type_consistency(complete_type_object.bitset_type()); + break; + case TK_SEQUENCE: + complete_sequence_type_consistency(complete_type_object.sequence_type()); + break; + case TK_ARRAY: + complete_array_type_consistency(complete_type_object.array_type()); + break; + case TK_MAP: + complete_map_type_consistency(complete_type_object.map_type()); + break; + case TK_ENUM: + complete_enumerated_type_consistency(complete_type_object.enumerated_type()); + break; + case TK_BITMASK: + complete_bitmask_type_consistency(complete_type_object.bitmask_type()); + break; + default: + throw InvalidArgumentError("Inconsistent TypeObject"); + } +} + +void TypeObjectUtils::minimal_type_object_consistency( + const MinimalTypeObject& minimal_type_object) +{ + switch (minimal_type_object._d()) + { + case TK_ALIAS: + minimal_alias_type_consistency(minimal_type_object.alias_type()); + break; + case TK_ANNOTATION: + minimal_annotation_type_consistency(minimal_type_object.annotation_type()); + break; + case TK_STRUCTURE: + minimal_struct_type_consistency(minimal_type_object.struct_type()); + break; + case TK_UNION: + minimal_union_type_consistency(minimal_type_object.union_type()); + break; + case TK_BITSET: + minimal_bitset_type_consistency(minimal_type_object.bitset_type()); + break; + case TK_SEQUENCE: + minimal_sequence_type_consistency(minimal_type_object.sequence_type()); + break; + case TK_ARRAY: + minimal_array_type_consistency(minimal_type_object.array_type()); + break; + case TK_MAP: + minimal_map_type_consistency(minimal_type_object.map_type()); + break; + case TK_ENUM: + minimal_enumerated_type_consistency(minimal_type_object.enumerated_type()); + break; + case TK_BITMASK: + minimal_bitmask_type_consistency(minimal_type_object.bitmask_type()); + break; + default: + throw InvalidArgumentError("Inconsistent TypeObject"); + } +} + +} // xtypes +} // dds +} // fastdds +} // eprosima diff --git a/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectCdrAux.ipp b/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectCdrAux.ipp new file mode 100644 index 00000000000..811667c8fbc --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectCdrAux.ipp @@ -0,0 +1,10712 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dds_xtypes_typeobjectCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_IPP_ + +#include + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeObjectHashId& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case EK_COMPLETE: + case EK_MINIMAL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.hash(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeObjectHashId& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case EK_COMPLETE: + case EK_MINIMAL: + scdr << eprosima::fastcdr::MemberId(1) << data.hash(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeObjectHashId& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case EK_COMPLETE: + case EK_MINIMAL: + { + eprosima::fastdds::dds::xtypes::EquivalenceHash hash_value{0}; + data.hash(std::move(hash_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case EK_COMPLETE: + case EK_MINIMAL: + dcdr >> data.hash(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + + + + + + + + + + + + + + + + + + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::StringSTypeDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bound(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bound() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::StringSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bound(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::StringLTypeDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bound(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bound() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::StringLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bound(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.equiv_kind(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.element_flags(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.equiv_kind() + << eprosima::fastcdr::MemberId(1) << data.element_flags() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.equiv_kind(); + break; + + case 1: + dcdr >> data.element_flags(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bound(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.bound() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.bound(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bound(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.bound() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.bound(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.array_bound_seq(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.array_bound_seq() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.array_bound_seq(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.array_bound_seq(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.array_bound_seq() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.array_bound_seq(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bound(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.key_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.key_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.bound() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() + << eprosima::fastcdr::MemberId(3) << data.key_flags() + << eprosima::fastcdr::MemberId(4) << data.key_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.bound(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + case 3: + dcdr >> data.key_flags(); + break; + + case 4: + dcdr >> data.key_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.bound(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element_identifier(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.key_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.key_identifier(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.header() + << eprosima::fastcdr::MemberId(1) << data.bound() + << eprosima::fastcdr::MemberId(2) << data.element_identifier() + << eprosima::fastcdr::MemberId(3) << data.key_flags() + << eprosima::fastcdr::MemberId(4) << data.key_identifier() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.header(); + break; + + case 1: + dcdr >> data.bound(); + break; + + case 2: + dcdr >> data.element_identifier(); + break; + + case 3: + dcdr >> data.key_flags(); + break; + + case 4: + dcdr >> data.key_identifier(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.sc_component_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.scc_length(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.scc_index(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.sc_component_id() + << eprosima::fastcdr::MemberId(1) << data.scc_length() + << eprosima::fastcdr::MemberId(2) << data.scc_index() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.sc_component_id(); + break; + + case 1: + dcdr >> data.scc_length(); + break; + + case 2: + dcdr >> data.scc_index(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeIdentifier& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.string_sdefn(), current_alignment); + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.string_ldefn(), current_alignment); + break; + + case TI_PLAIN_SEQUENCE_SMALL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.seq_sdefn(), current_alignment); + break; + + case TI_PLAIN_SEQUENCE_LARGE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.seq_ldefn(), current_alignment); + break; + + case TI_PLAIN_ARRAY_SMALL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.array_sdefn(), current_alignment); + break; + + case TI_PLAIN_ARRAY_LARGE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.array_ldefn(), current_alignment); + break; + + case TI_PLAIN_MAP_SMALL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.map_sdefn(), current_alignment); + break; + + case TI_PLAIN_MAP_LARGE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.map_ldefn(), current_alignment); + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.sc_component_id(), current_alignment); + break; + + case EK_COMPLETE: + case EK_MINIMAL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.equivalence_hash(), current_alignment); + break; + + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.extended_defn(), current_alignment); + break; + + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifier& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + scdr << eprosima::fastcdr::MemberId(1) << data.string_sdefn(); + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + scdr << eprosima::fastcdr::MemberId(2) << data.string_ldefn(); + break; + + case TI_PLAIN_SEQUENCE_SMALL: + scdr << eprosima::fastcdr::MemberId(3) << data.seq_sdefn(); + break; + + case TI_PLAIN_SEQUENCE_LARGE: + scdr << eprosima::fastcdr::MemberId(4) << data.seq_ldefn(); + break; + + case TI_PLAIN_ARRAY_SMALL: + scdr << eprosima::fastcdr::MemberId(5) << data.array_sdefn(); + break; + + case TI_PLAIN_ARRAY_LARGE: + scdr << eprosima::fastcdr::MemberId(6) << data.array_ldefn(); + break; + + case TI_PLAIN_MAP_SMALL: + scdr << eprosima::fastcdr::MemberId(7) << data.map_sdefn(); + break; + + case TI_PLAIN_MAP_LARGE: + scdr << eprosima::fastcdr::MemberId(8) << data.map_ldefn(); + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + scdr << eprosima::fastcdr::MemberId(9) << data.sc_component_id(); + break; + + case EK_COMPLETE: + case EK_MINIMAL: + scdr << eprosima::fastcdr::MemberId(10) << data.equivalence_hash(); + break; + + default: + scdr << eprosima::fastcdr::MemberId(11) << data.extended_defn(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeIdentifier& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + { + eprosima::fastdds::dds::xtypes::StringSTypeDefn string_sdefn_value; + data.string_sdefn(std::move(string_sdefn_value)); + data._d(discriminator); + break; + } + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + { + eprosima::fastdds::dds::xtypes::StringLTypeDefn string_ldefn_value; + data.string_ldefn(std::move(string_ldefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_SEQUENCE_SMALL: + { + eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn seq_sdefn_value; + data.seq_sdefn(std::move(seq_sdefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_SEQUENCE_LARGE: + { + eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn seq_ldefn_value; + data.seq_ldefn(std::move(seq_ldefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_ARRAY_SMALL: + { + eprosima::fastdds::dds::xtypes::PlainArraySElemDefn array_sdefn_value; + data.array_sdefn(std::move(array_sdefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_ARRAY_LARGE: + { + eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn array_ldefn_value; + data.array_ldefn(std::move(array_ldefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_MAP_SMALL: + { + eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn map_sdefn_value; + data.map_sdefn(std::move(map_sdefn_value)); + data._d(discriminator); + break; + } + + case TI_PLAIN_MAP_LARGE: + { + eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn map_ldefn_value; + data.map_ldefn(std::move(map_ldefn_value)); + data._d(discriminator); + break; + } + + case TI_STRONGLY_CONNECTED_COMPONENT: + { + eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId sc_component_id_value; + data.sc_component_id(std::move(sc_component_id_value)); + data._d(discriminator); + break; + } + + case EK_COMPLETE: + case EK_MINIMAL: + { + eprosima::fastdds::dds::xtypes::EquivalenceHash equivalence_hash_value{0}; + data.equivalence_hash(std::move(equivalence_hash_value)); + data._d(discriminator); + break; + } + + default: + { + eprosima::fastdds::dds::xtypes::ExtendedTypeDefn extended_defn_value; + data.extended_defn(std::move(extended_defn_value)); + data._d(discriminator); + break; + } + + } + } + else + { + switch (data._d()) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + dcdr >> data.string_sdefn(); + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + dcdr >> data.string_ldefn(); + break; + + case TI_PLAIN_SEQUENCE_SMALL: + dcdr >> data.seq_sdefn(); + break; + + case TI_PLAIN_SEQUENCE_LARGE: + dcdr >> data.seq_ldefn(); + break; + + case TI_PLAIN_ARRAY_SMALL: + dcdr >> data.array_sdefn(); + break; + + case TI_PLAIN_ARRAY_LARGE: + dcdr >> data.array_ldefn(); + break; + + case TI_PLAIN_MAP_SMALL: + dcdr >> data.map_sdefn(); + break; + + case TI_PLAIN_MAP_LARGE: + dcdr >> data.map_ldefn(); + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + dcdr >> data.sc_component_id(); + break; + + case EK_COMPLETE: + case EK_MINIMAL: + dcdr >> data.equivalence_hash(); + break; + + default: + dcdr >> data.extended_defn(); + break; + + } + ret_value = false; + } + return ret_value; + }); +} + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AnnotationParameterValue& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TK_BOOLEAN: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.boolean_value(), current_alignment); + break; + + case TK_BYTE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.byte_value(), current_alignment); + break; + + case TK_INT8: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.int8_value(), current_alignment); + break; + + case TK_UINT8: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.uint8_value(), current_alignment); + break; + + case TK_INT16: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.int16_value(), current_alignment); + break; + + case TK_UINT16: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.uint_16_value(), current_alignment); + break; + + case TK_INT32: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.int32_value(), current_alignment); + break; + + case TK_UINT32: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.uint32_value(), current_alignment); + break; + + case TK_INT64: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.int64_value(), current_alignment); + break; + + case TK_UINT64: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.uint64_value(), current_alignment); + break; + + case TK_FLOAT32: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.float32_value(), current_alignment); + break; + + case TK_FLOAT64: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.float64_value(), current_alignment); + break; + + case TK_FLOAT128: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.float128_value(), current_alignment); + break; + + case TK_CHAR8: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.char_value(), current_alignment); + break; + + case TK_CHAR16: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), + data.wchar_value(), current_alignment); + break; + + case TK_ENUM: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), + data.enumerated_value(), current_alignment); + break; + + case TK_STRING8: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), + data.string8_value(), current_alignment); + break; + + case TK_STRING16: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), + data.string16_value(), current_alignment); + break; + + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), + data.extended_value(), current_alignment); + break; + + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AnnotationParameterValue& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TK_BOOLEAN: + scdr << eprosima::fastcdr::MemberId(1) << data.boolean_value(); + break; + + case TK_BYTE: + scdr << eprosima::fastcdr::MemberId(2) << data.byte_value(); + break; + + case TK_INT8: + scdr << eprosima::fastcdr::MemberId(3) << data.int8_value(); + break; + + case TK_UINT8: + scdr << eprosima::fastcdr::MemberId(4) << data.uint8_value(); + break; + + case TK_INT16: + scdr << eprosima::fastcdr::MemberId(5) << data.int16_value(); + break; + + case TK_UINT16: + scdr << eprosima::fastcdr::MemberId(6) << data.uint_16_value(); + break; + + case TK_INT32: + scdr << eprosima::fastcdr::MemberId(7) << data.int32_value(); + break; + + case TK_UINT32: + scdr << eprosima::fastcdr::MemberId(8) << data.uint32_value(); + break; + + case TK_INT64: + scdr << eprosima::fastcdr::MemberId(9) << data.int64_value(); + break; + + case TK_UINT64: + scdr << eprosima::fastcdr::MemberId(10) << data.uint64_value(); + break; + + case TK_FLOAT32: + scdr << eprosima::fastcdr::MemberId(11) << data.float32_value(); + break; + + case TK_FLOAT64: + scdr << eprosima::fastcdr::MemberId(12) << data.float64_value(); + break; + + case TK_FLOAT128: + scdr << eprosima::fastcdr::MemberId(13) << data.float128_value(); + break; + + case TK_CHAR8: + scdr << eprosima::fastcdr::MemberId(14) << data.char_value(); + break; + + case TK_CHAR16: + scdr << eprosima::fastcdr::MemberId(15) << data.wchar_value(); + break; + + case TK_ENUM: + scdr << eprosima::fastcdr::MemberId(16) << data.enumerated_value(); + break; + + case TK_STRING8: + scdr << eprosima::fastcdr::MemberId(17) << data.string8_value(); + break; + + case TK_STRING16: + scdr << eprosima::fastcdr::MemberId(18) << data.string16_value(); + break; + + default: + scdr << eprosima::fastcdr::MemberId(19) << data.extended_value(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AnnotationParameterValue& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TK_BOOLEAN: + { + bool boolean_value_value{false}; + data.boolean_value(std::move(boolean_value_value)); + data._d(discriminator); + break; + } + + case TK_BYTE: + { + uint8_t byte_value_value{0}; + data.byte_value(std::move(byte_value_value)); + data._d(discriminator); + break; + } + + case TK_INT8: + { + int8_t int8_value_value{0}; + data.int8_value(std::move(int8_value_value)); + data._d(discriminator); + break; + } + + case TK_UINT8: + { + uint8_t uint8_value_value{0}; + data.uint8_value(std::move(uint8_value_value)); + data._d(discriminator); + break; + } + + case TK_INT16: + { + int16_t int16_value_value{0}; + data.int16_value(std::move(int16_value_value)); + data._d(discriminator); + break; + } + + case TK_UINT16: + { + uint16_t uint_16_value_value{0}; + data.uint_16_value(std::move(uint_16_value_value)); + data._d(discriminator); + break; + } + + case TK_INT32: + { + int32_t int32_value_value{0}; + data.int32_value(std::move(int32_value_value)); + data._d(discriminator); + break; + } + + case TK_UINT32: + { + uint32_t uint32_value_value{0}; + data.uint32_value(std::move(uint32_value_value)); + data._d(discriminator); + break; + } + + case TK_INT64: + { + int64_t int64_value_value{0}; + data.int64_value(std::move(int64_value_value)); + data._d(discriminator); + break; + } + + case TK_UINT64: + { + uint64_t uint64_value_value{0}; + data.uint64_value(std::move(uint64_value_value)); + data._d(discriminator); + break; + } + + case TK_FLOAT32: + { + float float32_value_value{0.0}; + data.float32_value(std::move(float32_value_value)); + data._d(discriminator); + break; + } + + case TK_FLOAT64: + { + double float64_value_value{0.0}; + data.float64_value(std::move(float64_value_value)); + data._d(discriminator); + break; + } + + case TK_FLOAT128: + { + long double float128_value_value{0.0}; + data.float128_value(std::move(float128_value_value)); + data._d(discriminator); + break; + } + + case TK_CHAR8: + { + char char_value_value{0}; + data.char_value(std::move(char_value_value)); + data._d(discriminator); + break; + } + + case TK_CHAR16: + { + wchar_t wchar_value_value{0}; + data.wchar_value(std::move(wchar_value_value)); + data._d(discriminator); + break; + } + + case TK_ENUM: + { + int32_t enumerated_value_value{0}; + data.enumerated_value(std::move(enumerated_value_value)); + data._d(discriminator); + break; + } + + case TK_STRING8: + { + eprosima::fastcdr::fixed_string string8_value_value; + data.string8_value(std::move(string8_value_value)); + data._d(discriminator); + break; + } + + case TK_STRING16: + { + std::wstring string16_value_value; + data.string16_value(std::move(string16_value_value)); + data._d(discriminator); + break; + } + + default: + { + eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue extended_value_value; + data.extended_value(std::move(extended_value_value)); + data._d(discriminator); + break; + } + + } + } + else + { + switch (data._d()) + { + case TK_BOOLEAN: + dcdr >> data.boolean_value(); + break; + + case TK_BYTE: + dcdr >> data.byte_value(); + break; + + case TK_INT8: + dcdr >> data.int8_value(); + break; + + case TK_UINT8: + dcdr >> data.uint8_value(); + break; + + case TK_INT16: + dcdr >> data.int16_value(); + break; + + case TK_UINT16: + dcdr >> data.uint_16_value(); + break; + + case TK_INT32: + dcdr >> data.int32_value(); + break; + + case TK_UINT32: + dcdr >> data.uint32_value(); + break; + + case TK_INT64: + dcdr >> data.int64_value(); + break; + + case TK_UINT64: + dcdr >> data.uint64_value(); + break; + + case TK_FLOAT32: + dcdr >> data.float32_value(); + break; + + case TK_FLOAT64: + dcdr >> data.float64_value(); + break; + + case TK_FLOAT128: + dcdr >> data.float128_value(); + break; + + case TK_CHAR8: + dcdr >> data.char_value(); + break; + + case TK_CHAR16: + dcdr >> data.wchar_value(); + break; + + case TK_ENUM: + dcdr >> data.enumerated_value(); + break; + + case TK_STRING8: + dcdr >> data.string8_value(); + break; + + case TK_STRING16: + dcdr >> data.string16_value(); + break; + + default: + dcdr >> data.extended_value(); + break; + + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.paramname_hash(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.paramname_hash() + << eprosima::fastcdr::MemberId(1) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.paramname_hash(); + break; + + case 1: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AppliedAnnotation& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.annotation_typeid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.param_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.annotation_typeid() + << eprosima::fastcdr::MemberId(1) << data.param_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AppliedAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.annotation_typeid(); + break; + + case 1: + dcdr >> data.param_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.placement(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.language(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.text(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.placement() + << eprosima::fastcdr::MemberId(1) << data.language() + << eprosima::fastcdr::MemberId(2) << data.text() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.placement(); + break; + + case 1: + dcdr >> data.language(); + break; + + case 2: + dcdr >> data.text(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.unit(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.min(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.max(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.hash_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.unit() + << eprosima::fastcdr::MemberId(1) << data.min() + << eprosima::fastcdr::MemberId(2) << data.max() + << eprosima::fastcdr::MemberId(3) << data.hash_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.unit(); + break; + + case 1: + dcdr >> data.min(); + break; + + case 2: + dcdr >> data.max(); + break; + + case 3: + dcdr >> data.hash_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonStructMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.member_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.member_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.member_type_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.member_id() + << eprosima::fastcdr::MemberId(1) << data.member_flags() + << eprosima::fastcdr::MemberId(2) << data.member_type_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.member_id(); + break; + + case 1: + dcdr >> data.member_flags(); + break; + + case 2: + dcdr >> data.member_type_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.name(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ann_builtin(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.ann_custom(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.name() + << eprosima::fastcdr::MemberId(1) << data.ann_builtin() + << eprosima::fastcdr::MemberId(2) << data.ann_custom() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.name(); + break; + + case 1: + dcdr >> data.ann_builtin(); + break; + + case 2: + dcdr >> data.ann_custom(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.name_hash(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.name_hash() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.name_hash(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteStructMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalStructMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.verbatim(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.verbatim() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.verbatim(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.ann_builtin(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ann_custom(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.type_name(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.ann_builtin() + << eprosima::fastcdr::MemberId(1) << data.ann_custom() + << eprosima::fastcdr::MemberId(2) << data.type_name() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.ann_builtin(); + break; + + case 1: + dcdr >> data.ann_custom(); + break; + + case 2: + dcdr >> data.type_name(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteStructHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.base_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.base_type() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.base_type(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalStructHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.base_type(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.base_type() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.base_type(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteStructType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.struct_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.struct_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.struct_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalStructType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.struct_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.struct_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.struct_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonUnionMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.member_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.member_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.type_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.label_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.member_id() + << eprosima::fastcdr::MemberId(1) << data.member_flags() + << eprosima::fastcdr::MemberId(2) << data.type_id() + << eprosima::fastcdr::MemberId(3) << data.label_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.member_id(); + break; + + case 1: + dcdr >> data.member_flags(); + break; + + case 2: + dcdr >> data.type_id(); + break; + + case 3: + dcdr >> data.label_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteUnionMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalUnionMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.member_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.type_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.member_flags() + << eprosima::fastcdr::MemberId(1) << data.type_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.member_flags(); + break; + + case 1: + dcdr >> data.type_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ann_builtin(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.ann_custom(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.ann_builtin() + << eprosima::fastcdr::MemberId(2) << data.ann_custom() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.ann_builtin(); + break; + + case 2: + dcdr >> data.ann_custom(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteUnionType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.union_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.discriminator(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.union_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.discriminator() + << eprosima::fastcdr::MemberId(3) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.union_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.discriminator(); + break; + + case 3: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalUnionType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.union_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.discriminator(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.union_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.discriminator() + << eprosima::fastcdr::MemberId(3) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.union_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.discriminator(); + break; + + case 3: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.member_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.member_type_id(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.member_flags() + << eprosima::fastcdr::MemberId(1) << data.member_type_id() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.member_flags(); + break; + + case 1: + dcdr >> data.member_type_id(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.name(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.default_value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.name() + << eprosima::fastcdr::MemberId(2) << data.default_value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.name(); + break; + + case 2: + dcdr >> data.default_value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.name_hash(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.default_value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.name_hash() + << eprosima::fastcdr::MemberId(2) << data.default_value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.name_hash(); + break; + + case 2: + dcdr >> data.default_value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.annotation_name(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.annotation_name() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.annotation_name(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.annotation_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.annotation_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.annotation_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.annotation_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.member_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.annotation_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.member_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.annotation_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.member_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonAliasBody& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.related_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.related_type(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.related_flags() + << eprosima::fastcdr::MemberId(1) << data.related_type() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.related_flags(); + break; + + case 1: + dcdr >> data.related_type(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAliasBody& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ann_builtin(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.ann_custom(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.ann_builtin() + << eprosima::fastcdr::MemberId(2) << data.ann_custom() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.ann_builtin(); + break; + + case 2: + dcdr >> data.ann_custom(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAliasBody& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasBody& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteAliasType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.alias_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.body(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.alias_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.body() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.alias_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.body(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalAliasType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.alias_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.body(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.alias_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.body() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.alias_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.body(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteElementDetail& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.ann_builtin(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ann_custom(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteElementDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.ann_builtin() + << eprosima::fastcdr::MemberId(1) << data.ann_custom() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteElementDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.ann_builtin(); + break; + + case 1: + dcdr >> data.ann_custom(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteElementDetail& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonCollectionElement& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.element_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.type(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.element_flags() + << eprosima::fastcdr::MemberId(1) << data.type() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.element_flags(); + break; + + case 1: + dcdr >> data.type(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bound(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bound() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bound(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteSequenceType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalSequenceType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalSequenceType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonArrayHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bound_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bound_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bound_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteArrayType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalArrayType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteMapType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.key(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.key() + << eprosima::fastcdr::MemberId(3) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.key(); + break; + + case 3: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalMapType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.collection_flag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.key(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.element(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.collection_flag() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.key() + << eprosima::fastcdr::MemberId(3) << data.element() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.collection_flag(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.key(); + break; + + case 3: + dcdr >> data.element(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMapType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.flags(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.value() + << eprosima::fastcdr::MemberId(1) << data.flags() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.value(); + break; + + case 1: + dcdr >> data.flags(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bit_bound(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bit_bound() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bit_bound(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.enum_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.literal_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.enum_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.literal_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.enum_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.literal_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.enum_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.literal_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.enum_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.literal_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.enum_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.literal_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonBitflag& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.flags(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.position() + << eprosima::fastcdr::MemberId(1) << data.flags() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.position(); + break; + + case 1: + dcdr >> data.flags(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteBitflag& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalBitflag& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitflag& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bit_bound(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bit_bound() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bit_bound(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bitmask_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.flag_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bitmask_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.flag_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bitmask_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.flag_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bitmask_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.flag_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bitmask_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.flag_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bitmask_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.flag_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CommonBitfield& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.position(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.bitcount(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.holder_type(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.position() + << eprosima::fastcdr::MemberId(1) << data.flags() + << eprosima::fastcdr::MemberId(2) << data.bitcount() + << eprosima::fastcdr::MemberId(3) << data.holder_type() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CommonBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.position(); + break; + + case 1: + dcdr >> data.flags(); + break; + + case 2: + dcdr >> data.bitcount(); + break; + + case 3: + dcdr >> data.holder_type(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteBitfield& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalBitfield& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.common(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.name_hash(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.common() + << eprosima::fastcdr::MemberId(1) << data.name_hash() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.common(); + break; + + case 1: + dcdr >> data.name_hash(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitfield& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.detail(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.detail() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.detail(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteBitsetType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bitset_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.field_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bitset_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.field_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bitset_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.field_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalBitsetType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.bitset_flags(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.header(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.field_seq(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.bitset_flags() + << eprosima::fastcdr::MemberId(1) << data.header() + << eprosima::fastcdr::MemberId(2) << data.field_seq() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.bitset_flags(); + break; + + case 1: + dcdr >> data.header(); + break; + + case 2: + dcdr >> data.field_seq(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteExtendedType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::CompleteTypeObject& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TK_ALIAS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.alias_type(), current_alignment); + break; + + case TK_ANNOTATION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.annotation_type(), current_alignment); + break; + + case TK_STRUCTURE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.struct_type(), current_alignment); + break; + + case TK_UNION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.union_type(), current_alignment); + break; + + case TK_BITSET: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.bitset_type(), current_alignment); + break; + + case TK_SEQUENCE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.sequence_type(), current_alignment); + break; + + case TK_ARRAY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.array_type(), current_alignment); + break; + + case TK_MAP: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.map_type(), current_alignment); + break; + + case TK_ENUM: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.enumerated_type(), current_alignment); + break; + + case TK_BITMASK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.bitmask_type(), current_alignment); + break; + + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.extended_type(), current_alignment); + break; + + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteTypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TK_ALIAS: + scdr << eprosima::fastcdr::MemberId(1) << data.alias_type(); + break; + + case TK_ANNOTATION: + scdr << eprosima::fastcdr::MemberId(2) << data.annotation_type(); + break; + + case TK_STRUCTURE: + scdr << eprosima::fastcdr::MemberId(3) << data.struct_type(); + break; + + case TK_UNION: + scdr << eprosima::fastcdr::MemberId(4) << data.union_type(); + break; + + case TK_BITSET: + scdr << eprosima::fastcdr::MemberId(5) << data.bitset_type(); + break; + + case TK_SEQUENCE: + scdr << eprosima::fastcdr::MemberId(6) << data.sequence_type(); + break; + + case TK_ARRAY: + scdr << eprosima::fastcdr::MemberId(7) << data.array_type(); + break; + + case TK_MAP: + scdr << eprosima::fastcdr::MemberId(8) << data.map_type(); + break; + + case TK_ENUM: + scdr << eprosima::fastcdr::MemberId(9) << data.enumerated_type(); + break; + + case TK_BITMASK: + scdr << eprosima::fastcdr::MemberId(10) << data.bitmask_type(); + break; + + default: + scdr << eprosima::fastcdr::MemberId(11) << data.extended_type(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::CompleteTypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TK_ALIAS: + { + eprosima::fastdds::dds::xtypes::CompleteAliasType alias_type_value; + data.alias_type(std::move(alias_type_value)); + data._d(discriminator); + break; + } + + case TK_ANNOTATION: + { + eprosima::fastdds::dds::xtypes::CompleteAnnotationType annotation_type_value; + data.annotation_type(std::move(annotation_type_value)); + data._d(discriminator); + break; + } + + case TK_STRUCTURE: + { + eprosima::fastdds::dds::xtypes::CompleteStructType struct_type_value; + data.struct_type(std::move(struct_type_value)); + data._d(discriminator); + break; + } + + case TK_UNION: + { + eprosima::fastdds::dds::xtypes::CompleteUnionType union_type_value; + data.union_type(std::move(union_type_value)); + data._d(discriminator); + break; + } + + case TK_BITSET: + { + eprosima::fastdds::dds::xtypes::CompleteBitsetType bitset_type_value; + data.bitset_type(std::move(bitset_type_value)); + data._d(discriminator); + break; + } + + case TK_SEQUENCE: + { + eprosima::fastdds::dds::xtypes::CompleteSequenceType sequence_type_value; + data.sequence_type(std::move(sequence_type_value)); + data._d(discriminator); + break; + } + + case TK_ARRAY: + { + eprosima::fastdds::dds::xtypes::CompleteArrayType array_type_value; + data.array_type(std::move(array_type_value)); + data._d(discriminator); + break; + } + + case TK_MAP: + { + eprosima::fastdds::dds::xtypes::CompleteMapType map_type_value; + data.map_type(std::move(map_type_value)); + data._d(discriminator); + break; + } + + case TK_ENUM: + { + eprosima::fastdds::dds::xtypes::CompleteEnumeratedType enumerated_type_value; + data.enumerated_type(std::move(enumerated_type_value)); + data._d(discriminator); + break; + } + + case TK_BITMASK: + { + eprosima::fastdds::dds::xtypes::CompleteBitmaskType bitmask_type_value; + data.bitmask_type(std::move(bitmask_type_value)); + data._d(discriminator); + break; + } + + default: + { + eprosima::fastdds::dds::xtypes::CompleteExtendedType extended_type_value; + data.extended_type(std::move(extended_type_value)); + data._d(discriminator); + break; + } + + } + } + else + { + switch (data._d()) + { + case TK_ALIAS: + dcdr >> data.alias_type(); + break; + + case TK_ANNOTATION: + dcdr >> data.annotation_type(); + break; + + case TK_STRUCTURE: + dcdr >> data.struct_type(); + break; + + case TK_UNION: + dcdr >> data.union_type(); + break; + + case TK_BITSET: + dcdr >> data.bitset_type(); + break; + + case TK_SEQUENCE: + dcdr >> data.sequence_type(); + break; + + case TK_ARRAY: + dcdr >> data.array_type(); + break; + + case TK_MAP: + dcdr >> data.map_type(); + break; + + case TK_ENUM: + dcdr >> data.enumerated_type(); + break; + + case TK_BITMASK: + dcdr >> data.bitmask_type(); + break; + + default: + dcdr >> data.extended_type(); + break; + + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalExtendedType& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + static_cast(data); + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + static_cast(data); + static_cast(dcdr); + static_cast(mid); + return false; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalExtendedType& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::MinimalTypeObject& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case TK_ALIAS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.alias_type(), current_alignment); + break; + + case TK_ANNOTATION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.annotation_type(), current_alignment); + break; + + case TK_STRUCTURE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.struct_type(), current_alignment); + break; + + case TK_UNION: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.union_type(), current_alignment); + break; + + case TK_BITSET: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.bitset_type(), current_alignment); + break; + + case TK_SEQUENCE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.sequence_type(), current_alignment); + break; + + case TK_ARRAY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.array_type(), current_alignment); + break; + + case TK_MAP: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.map_type(), current_alignment); + break; + + case TK_ENUM: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.enumerated_type(), current_alignment); + break; + + case TK_BITMASK: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.bitmask_type(), current_alignment); + break; + + default: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.extended_type(), current_alignment); + break; + + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalTypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case TK_ALIAS: + scdr << eprosima::fastcdr::MemberId(1) << data.alias_type(); + break; + + case TK_ANNOTATION: + scdr << eprosima::fastcdr::MemberId(2) << data.annotation_type(); + break; + + case TK_STRUCTURE: + scdr << eprosima::fastcdr::MemberId(3) << data.struct_type(); + break; + + case TK_UNION: + scdr << eprosima::fastcdr::MemberId(4) << data.union_type(); + break; + + case TK_BITSET: + scdr << eprosima::fastcdr::MemberId(5) << data.bitset_type(); + break; + + case TK_SEQUENCE: + scdr << eprosima::fastcdr::MemberId(6) << data.sequence_type(); + break; + + case TK_ARRAY: + scdr << eprosima::fastcdr::MemberId(7) << data.array_type(); + break; + + case TK_MAP: + scdr << eprosima::fastcdr::MemberId(8) << data.map_type(); + break; + + case TK_ENUM: + scdr << eprosima::fastcdr::MemberId(9) << data.enumerated_type(); + break; + + case TK_BITMASK: + scdr << eprosima::fastcdr::MemberId(10) << data.bitmask_type(); + break; + + default: + scdr << eprosima::fastcdr::MemberId(11) << data.extended_type(); + break; + + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::MinimalTypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case TK_ALIAS: + { + eprosima::fastdds::dds::xtypes::MinimalAliasType alias_type_value; + data.alias_type(std::move(alias_type_value)); + data._d(discriminator); + break; + } + + case TK_ANNOTATION: + { + eprosima::fastdds::dds::xtypes::MinimalAnnotationType annotation_type_value; + data.annotation_type(std::move(annotation_type_value)); + data._d(discriminator); + break; + } + + case TK_STRUCTURE: + { + eprosima::fastdds::dds::xtypes::MinimalStructType struct_type_value; + data.struct_type(std::move(struct_type_value)); + data._d(discriminator); + break; + } + + case TK_UNION: + { + eprosima::fastdds::dds::xtypes::MinimalUnionType union_type_value; + data.union_type(std::move(union_type_value)); + data._d(discriminator); + break; + } + + case TK_BITSET: + { + eprosima::fastdds::dds::xtypes::MinimalBitsetType bitset_type_value; + data.bitset_type(std::move(bitset_type_value)); + data._d(discriminator); + break; + } + + case TK_SEQUENCE: + { + eprosima::fastdds::dds::xtypes::MinimalSequenceType sequence_type_value; + data.sequence_type(std::move(sequence_type_value)); + data._d(discriminator); + break; + } + + case TK_ARRAY: + { + eprosima::fastdds::dds::xtypes::MinimalArrayType array_type_value; + data.array_type(std::move(array_type_value)); + data._d(discriminator); + break; + } + + case TK_MAP: + { + eprosima::fastdds::dds::xtypes::MinimalMapType map_type_value; + data.map_type(std::move(map_type_value)); + data._d(discriminator); + break; + } + + case TK_ENUM: + { + eprosima::fastdds::dds::xtypes::MinimalEnumeratedType enumerated_type_value; + data.enumerated_type(std::move(enumerated_type_value)); + data._d(discriminator); + break; + } + + case TK_BITMASK: + { + eprosima::fastdds::dds::xtypes::MinimalBitmaskType bitmask_type_value; + data.bitmask_type(std::move(bitmask_type_value)); + data._d(discriminator); + break; + } + + default: + { + eprosima::fastdds::dds::xtypes::MinimalExtendedType extended_type_value; + data.extended_type(std::move(extended_type_value)); + data._d(discriminator); + break; + } + + } + } + else + { + switch (data._d()) + { + case TK_ALIAS: + dcdr >> data.alias_type(); + break; + + case TK_ANNOTATION: + dcdr >> data.annotation_type(); + break; + + case TK_STRUCTURE: + dcdr >> data.struct_type(); + break; + + case TK_UNION: + dcdr >> data.union_type(); + break; + + case TK_BITSET: + dcdr >> data.bitset_type(); + break; + + case TK_SEQUENCE: + dcdr >> data.sequence_type(); + break; + + case TK_ARRAY: + dcdr >> data.array_type(); + break; + + case TK_MAP: + dcdr >> data.map_type(); + break; + + case TK_ENUM: + dcdr >> data.enumerated_type(); + break; + + case TK_BITMASK: + dcdr >> data.bitmask_type(); + break; + + default: + dcdr >> data.extended_type(); + break; + + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeObject& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case EK_COMPLETE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.complete(), current_alignment); + break; + + case EK_MINIMAL: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.minimal(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case EK_COMPLETE: + scdr << eprosima::fastcdr::MemberId(1) << data.complete(); + break; + + case EK_MINIMAL: + scdr << eprosima::fastcdr::MemberId(2) << data.minimal(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeObject& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + uint8_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case EK_COMPLETE: + { + eprosima::fastdds::dds::xtypes::CompleteTypeObject complete_value; + data.complete(std::move(complete_value)); + data._d(discriminator); + break; + } + + case EK_MINIMAL: + { + eprosima::fastdds::dds::xtypes::MinimalTypeObject minimal_value; + data.minimal(std::move(minimal_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case EK_COMPLETE: + dcdr >> data.complete(); + break; + + case EK_MINIMAL: + dcdr >> data.minimal(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.type_identifier(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.type_object(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.type_identifier() + << eprosima::fastcdr::MemberId(1) << data.type_object() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.type_identifier(); + break; + + case 1: + dcdr >> data.type_object(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.type_identifier1(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.type_identifier2(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.type_identifier1() + << eprosima::fastcdr::MemberId(1) << data.type_identifier2() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.type_identifier1(); + break; + + case 1: + dcdr >> data.type_identifier2(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.type_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.typeobject_serialized_size(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.type_id() + << eprosima::fastcdr::MemberId(1) << data.typeobject_serialized_size() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.type_id(); + break; + + case 1: + dcdr >> data.typeobject_serialized_size(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.typeid_with_size(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.dependent_typeid_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.dependent_typeids(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.typeid_with_size() + << eprosima::fastcdr::MemberId(1) << data.dependent_typeid_count() + << eprosima::fastcdr::MemberId(2) << data.dependent_typeids() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.typeid_with_size(); + break; + + case 1: + dcdr >> data.dependent_typeid_count(); + break; + + case 2: + dcdr >> data.dependent_typeids(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::dds::xtypes::TypeInformation& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x00001001), + data.minimal(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0x00001002), + data.complete(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeInformation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR); + + scdr + << eprosima::fastcdr::MemberId(0x00001001) << data.minimal() + << eprosima::fastcdr::MemberId(0x00001002) << data.complete() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::dds::xtypes::TypeInformation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0x00001001: + dcdr >> data.minimal(); + break; + + case 0x00001002: + dcdr >> data.complete(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeInformation& data) +{ + using namespace eprosima::fastdds::dds::xtypes; + + static_cast(scdr); + static_cast(data); +} + + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_IPP_ + diff --git a/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx b/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx new file mode 100644 index 00000000000..b742c7d6047 --- /dev/null +++ b/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx @@ -0,0 +1,18712 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file dds_xtypes_typeobjectPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#include +#include + +#include +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace xtypes { + + +StringSTypeDefnPubSubType::StringSTypeDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::StringSTypeDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringSTypeDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_StringSTypeDefn_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_fastdds_dds_xtypes_StringSTypeDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_StringSTypeDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +StringSTypeDefnPubSubType::~StringSTypeDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool StringSTypeDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StringSTypeDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 StringSTypeDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StringSTypeDefn* 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 StringSTypeDefnPubSubType::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* StringSTypeDefnPubSubType::createData() +{ + return reinterpret_cast(new StringSTypeDefn()); +} + +void StringSTypeDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StringSTypeDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + StringSTypeDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_StringSTypeDefn_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_fastdds_dds_xtypes_StringSTypeDefn_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; +} + +void StringSTypeDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +StringLTypeDefnPubSubType::StringLTypeDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::StringLTypeDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringLTypeDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_StringLTypeDefn_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_fastdds_dds_xtypes_StringLTypeDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_StringLTypeDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +StringLTypeDefnPubSubType::~StringLTypeDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool StringLTypeDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StringLTypeDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 StringLTypeDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StringLTypeDefn* 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 StringLTypeDefnPubSubType::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* StringLTypeDefnPubSubType::createData() +{ + return reinterpret_cast(new StringLTypeDefn()); +} + +void StringLTypeDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StringLTypeDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + StringLTypeDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_StringLTypeDefn_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_fastdds_dds_xtypes_StringLTypeDefn_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; +} + +void StringLTypeDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainCollectionHeaderPubSubType::PlainCollectionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainCollectionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainCollectionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainCollectionHeader_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_fastdds_dds_xtypes_PlainCollectionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainCollectionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainCollectionHeaderPubSubType::~PlainCollectionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainCollectionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainCollectionHeader* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainCollectionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainCollectionHeader* 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 PlainCollectionHeaderPubSubType::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* PlainCollectionHeaderPubSubType::createData() +{ + return reinterpret_cast(new PlainCollectionHeader()); +} + +void PlainCollectionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainCollectionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainCollectionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainCollectionHeader_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_fastdds_dds_xtypes_PlainCollectionHeader_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; +} + +void PlainCollectionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainSequenceSElemDefnPubSubType::PlainSequenceSElemDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainSequenceSElemDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_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_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainSequenceSElemDefnPubSubType::~PlainSequenceSElemDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainSequenceSElemDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainSequenceSElemDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainSequenceSElemDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainSequenceSElemDefn* 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 PlainSequenceSElemDefnPubSubType::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* PlainSequenceSElemDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainSequenceSElemDefn()); +} + +void PlainSequenceSElemDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainSequenceSElemDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainSequenceSElemDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_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_fastdds_dds_xtypes_PlainSequenceSElemDefn_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; +} + +void PlainSequenceSElemDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainSequenceLElemDefnPubSubType::PlainSequenceLElemDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainSequenceLElemDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_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_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainSequenceLElemDefnPubSubType::~PlainSequenceLElemDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainSequenceLElemDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainSequenceLElemDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainSequenceLElemDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainSequenceLElemDefn* 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 PlainSequenceLElemDefnPubSubType::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* PlainSequenceLElemDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainSequenceLElemDefn()); +} + +void PlainSequenceLElemDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainSequenceLElemDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainSequenceLElemDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_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_fastdds_dds_xtypes_PlainSequenceLElemDefn_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; +} + +void PlainSequenceLElemDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainArraySElemDefnPubSubType::PlainArraySElemDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainArraySElemDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainArraySElemDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_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_fastdds_dds_xtypes_PlainArraySElemDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainArraySElemDefnPubSubType::~PlainArraySElemDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainArraySElemDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainArraySElemDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainArraySElemDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainArraySElemDefn* 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 PlainArraySElemDefnPubSubType::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* PlainArraySElemDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainArraySElemDefn()); +} + +void PlainArraySElemDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainArraySElemDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainArraySElemDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_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_fastdds_dds_xtypes_PlainArraySElemDefn_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; +} + +void PlainArraySElemDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainArrayLElemDefnPubSubType::PlainArrayLElemDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainArrayLElemDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_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_fastdds_dds_xtypes_PlainArrayLElemDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainArrayLElemDefnPubSubType::~PlainArrayLElemDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainArrayLElemDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainArrayLElemDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainArrayLElemDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainArrayLElemDefn* 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 PlainArrayLElemDefnPubSubType::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* PlainArrayLElemDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainArrayLElemDefn()); +} + +void PlainArrayLElemDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainArrayLElemDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainArrayLElemDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_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_fastdds_dds_xtypes_PlainArrayLElemDefn_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; +} + +void PlainArrayLElemDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainMapSTypeDefnPubSubType::PlainMapSTypeDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainMapSTypeDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_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_fastdds_dds_xtypes_PlainMapSTypeDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainMapSTypeDefnPubSubType::~PlainMapSTypeDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainMapSTypeDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainMapSTypeDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainMapSTypeDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainMapSTypeDefn* 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 PlainMapSTypeDefnPubSubType::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* PlainMapSTypeDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainMapSTypeDefn()); +} + +void PlainMapSTypeDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainMapSTypeDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainMapSTypeDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_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_fastdds_dds_xtypes_PlainMapSTypeDefn_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; +} + +void PlainMapSTypeDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +PlainMapLTypeDefnPubSubType::PlainMapLTypeDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(PlainMapLTypeDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_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_fastdds_dds_xtypes_PlainMapLTypeDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +PlainMapLTypeDefnPubSubType::~PlainMapLTypeDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool PlainMapLTypeDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + PlainMapLTypeDefn* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 PlainMapLTypeDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + PlainMapLTypeDefn* 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 PlainMapLTypeDefnPubSubType::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* PlainMapLTypeDefnPubSubType::createData() +{ + return reinterpret_cast(new PlainMapLTypeDefn()); +} + +void PlainMapLTypeDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool PlainMapLTypeDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + PlainMapLTypeDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_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_fastdds_dds_xtypes_PlainMapLTypeDefn_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; +} + +void PlainMapLTypeDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +StronglyConnectedComponentIdPubSubType::StronglyConnectedComponentIdPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StronglyConnectedComponentId::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_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_fastdds_dds_xtypes_StronglyConnectedComponentId_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +StronglyConnectedComponentIdPubSubType::~StronglyConnectedComponentIdPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool StronglyConnectedComponentIdPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + StronglyConnectedComponentId* 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; + } + 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 StronglyConnectedComponentIdPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + StronglyConnectedComponentId* 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 StronglyConnectedComponentIdPubSubType::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* StronglyConnectedComponentIdPubSubType::createData() +{ + return reinterpret_cast(new StronglyConnectedComponentId()); +} + +void StronglyConnectedComponentIdPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool StronglyConnectedComponentIdPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + StronglyConnectedComponentId* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_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_fastdds_dds_xtypes_StronglyConnectedComponentId_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; +} + +void StronglyConnectedComponentIdPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +ExtendedTypeDefnPubSubType::ExtendedTypeDefnPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::ExtendedTypeDefn"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ExtendedTypeDefn::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_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_fastdds_dds_xtypes_ExtendedTypeDefn_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +ExtendedTypeDefnPubSubType::~ExtendedTypeDefnPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool ExtendedTypeDefnPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ExtendedTypeDefn* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 ExtendedTypeDefnPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ExtendedTypeDefn* 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 ExtendedTypeDefnPubSubType::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* ExtendedTypeDefnPubSubType::createData() +{ + return reinterpret_cast(new ExtendedTypeDefn()); +} + +void ExtendedTypeDefnPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ExtendedTypeDefnPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + ExtendedTypeDefn* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_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_fastdds_dds_xtypes_ExtendedTypeDefn_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; +} + +void ExtendedTypeDefnPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + + + + + +ExtendedAnnotationParameterValuePubSubType::ExtendedAnnotationParameterValuePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ExtendedAnnotationParameterValue::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_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_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +ExtendedAnnotationParameterValuePubSubType::~ExtendedAnnotationParameterValuePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool ExtendedAnnotationParameterValuePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + ExtendedAnnotationParameterValue* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 ExtendedAnnotationParameterValuePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + ExtendedAnnotationParameterValue* 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 ExtendedAnnotationParameterValuePubSubType::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* ExtendedAnnotationParameterValuePubSubType::createData() +{ + return reinterpret_cast(new ExtendedAnnotationParameterValue()); +} + +void ExtendedAnnotationParameterValuePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool ExtendedAnnotationParameterValuePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + ExtendedAnnotationParameterValue* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_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_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_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; +} + +void ExtendedAnnotationParameterValuePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +AppliedAnnotationParameterPubSubType::AppliedAnnotationParameterPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AppliedAnnotationParameter::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_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_fastdds_dds_xtypes_AppliedAnnotationParameter_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +AppliedAnnotationParameterPubSubType::~AppliedAnnotationParameterPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool AppliedAnnotationParameterPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AppliedAnnotationParameter* 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; + } + 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 AppliedAnnotationParameterPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AppliedAnnotationParameter* 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 AppliedAnnotationParameterPubSubType::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* AppliedAnnotationParameterPubSubType::createData() +{ + return reinterpret_cast(new AppliedAnnotationParameter()); +} + +void AppliedAnnotationParameterPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AppliedAnnotationParameterPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + AppliedAnnotationParameter* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_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_fastdds_dds_xtypes_AppliedAnnotationParameter_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; +} + +void AppliedAnnotationParameterPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +AppliedAnnotationPubSubType::AppliedAnnotationPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::AppliedAnnotation"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AppliedAnnotation::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_AppliedAnnotation_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_fastdds_dds_xtypes_AppliedAnnotation_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_AppliedAnnotation_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +AppliedAnnotationPubSubType::~AppliedAnnotationPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool AppliedAnnotationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AppliedAnnotation* 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; + } + 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 AppliedAnnotationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AppliedAnnotation* 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 AppliedAnnotationPubSubType::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* AppliedAnnotationPubSubType::createData() +{ + return reinterpret_cast(new AppliedAnnotation()); +} + +void AppliedAnnotationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AppliedAnnotationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + AppliedAnnotation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_AppliedAnnotation_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_fastdds_dds_xtypes_AppliedAnnotation_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; +} + +void AppliedAnnotationPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +AppliedVerbatimAnnotationPubSubType::AppliedVerbatimAnnotationPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AppliedVerbatimAnnotation::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_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_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +AppliedVerbatimAnnotationPubSubType::~AppliedVerbatimAnnotationPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool AppliedVerbatimAnnotationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AppliedVerbatimAnnotation* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 AppliedVerbatimAnnotationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AppliedVerbatimAnnotation* 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 AppliedVerbatimAnnotationPubSubType::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* AppliedVerbatimAnnotationPubSubType::createData() +{ + return reinterpret_cast(new AppliedVerbatimAnnotation()); +} + +void AppliedVerbatimAnnotationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AppliedVerbatimAnnotationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + AppliedVerbatimAnnotation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_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_fastdds_dds_xtypes_AppliedVerbatimAnnotation_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; +} + +void AppliedVerbatimAnnotationPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +AppliedBuiltinMemberAnnotationsPubSubType::AppliedBuiltinMemberAnnotationsPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AppliedBuiltinMemberAnnotations::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_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_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +AppliedBuiltinMemberAnnotationsPubSubType::~AppliedBuiltinMemberAnnotationsPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool AppliedBuiltinMemberAnnotationsPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AppliedBuiltinMemberAnnotations* 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; + } + 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 AppliedBuiltinMemberAnnotationsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AppliedBuiltinMemberAnnotations* 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 AppliedBuiltinMemberAnnotationsPubSubType::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* AppliedBuiltinMemberAnnotationsPubSubType::createData() +{ + return reinterpret_cast(new AppliedBuiltinMemberAnnotations()); +} + +void AppliedBuiltinMemberAnnotationsPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AppliedBuiltinMemberAnnotationsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + AppliedBuiltinMemberAnnotations* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_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_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_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; +} + +void AppliedBuiltinMemberAnnotationsPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonStructMemberPubSubType::CommonStructMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonStructMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonStructMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonStructMember_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_fastdds_dds_xtypes_CommonStructMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonStructMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonStructMemberPubSubType::~CommonStructMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonStructMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonStructMember* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonStructMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonStructMember* 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 CommonStructMemberPubSubType::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* CommonStructMemberPubSubType::createData() +{ + return reinterpret_cast(new CommonStructMember()); +} + +void CommonStructMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonStructMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonStructMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonStructMember_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_fastdds_dds_xtypes_CommonStructMember_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; +} + +void CommonStructMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteMemberDetailPubSubType::CompleteMemberDetailPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteMemberDetail"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteMemberDetail::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteMemberDetail_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_fastdds_dds_xtypes_CompleteMemberDetail_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteMemberDetail_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteMemberDetailPubSubType::~CompleteMemberDetailPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteMemberDetailPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteMemberDetail* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteMemberDetailPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteMemberDetail* 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 CompleteMemberDetailPubSubType::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* CompleteMemberDetailPubSubType::createData() +{ + return reinterpret_cast(new CompleteMemberDetail()); +} + +void CompleteMemberDetailPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteMemberDetailPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteMemberDetail* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteMemberDetail_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_fastdds_dds_xtypes_CompleteMemberDetail_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; +} + +void CompleteMemberDetailPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalMemberDetailPubSubType::MinimalMemberDetailPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalMemberDetail"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalMemberDetail::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalMemberDetail_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_fastdds_dds_xtypes_MinimalMemberDetail_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalMemberDetail_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalMemberDetailPubSubType::~MinimalMemberDetailPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalMemberDetailPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalMemberDetail* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalMemberDetailPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalMemberDetail* 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 MinimalMemberDetailPubSubType::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* MinimalMemberDetailPubSubType::createData() +{ + return reinterpret_cast(new MinimalMemberDetail()); +} + +void MinimalMemberDetailPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalMemberDetailPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalMemberDetail* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalMemberDetail_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_fastdds_dds_xtypes_MinimalMemberDetail_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; +} + +void MinimalMemberDetailPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteStructMemberPubSubType::CompleteStructMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteStructMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteStructMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteStructMember_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_fastdds_dds_xtypes_CompleteStructMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteStructMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteStructMemberPubSubType::~CompleteStructMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteStructMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteStructMember* 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; + } + 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 CompleteStructMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteStructMember* 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 CompleteStructMemberPubSubType::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* CompleteStructMemberPubSubType::createData() +{ + return reinterpret_cast(new CompleteStructMember()); +} + +void CompleteStructMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteStructMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteStructMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteStructMember_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_fastdds_dds_xtypes_CompleteStructMember_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; +} + +void CompleteStructMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalStructMemberPubSubType::MinimalStructMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalStructMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalStructMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalStructMember_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_fastdds_dds_xtypes_MinimalStructMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalStructMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalStructMemberPubSubType::~MinimalStructMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalStructMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalStructMember* 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; + } + 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 MinimalStructMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalStructMember* 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 MinimalStructMemberPubSubType::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* MinimalStructMemberPubSubType::createData() +{ + return reinterpret_cast(new MinimalStructMember()); +} + +void MinimalStructMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalStructMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalStructMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalStructMember_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_fastdds_dds_xtypes_MinimalStructMember_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; +} + +void MinimalStructMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +AppliedBuiltinTypeAnnotationsPubSubType::AppliedBuiltinTypeAnnotationsPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AppliedBuiltinTypeAnnotations::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_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_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +AppliedBuiltinTypeAnnotationsPubSubType::~AppliedBuiltinTypeAnnotationsPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool AppliedBuiltinTypeAnnotationsPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + AppliedBuiltinTypeAnnotations* 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; + } + 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 AppliedBuiltinTypeAnnotationsPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + AppliedBuiltinTypeAnnotations* 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 AppliedBuiltinTypeAnnotationsPubSubType::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* AppliedBuiltinTypeAnnotationsPubSubType::createData() +{ + return reinterpret_cast(new AppliedBuiltinTypeAnnotations()); +} + +void AppliedBuiltinTypeAnnotationsPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool AppliedBuiltinTypeAnnotationsPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + AppliedBuiltinTypeAnnotations* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_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_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_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; +} + +void AppliedBuiltinTypeAnnotationsPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalTypeDetailPubSubType::MinimalTypeDetailPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalTypeDetail"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalTypeDetail::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalTypeDetail_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_fastdds_dds_xtypes_MinimalTypeDetail_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalTypeDetail_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalTypeDetailPubSubType::~MinimalTypeDetailPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalTypeDetailPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalTypeDetail* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalTypeDetailPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalTypeDetail* 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 MinimalTypeDetailPubSubType::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* MinimalTypeDetailPubSubType::createData() +{ + return reinterpret_cast(new MinimalTypeDetail()); +} + +void MinimalTypeDetailPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalTypeDetailPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalTypeDetail* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalTypeDetail_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_fastdds_dds_xtypes_MinimalTypeDetail_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; +} + +void MinimalTypeDetailPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteTypeDetailPubSubType::CompleteTypeDetailPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteTypeDetail"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteTypeDetail::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteTypeDetail_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_fastdds_dds_xtypes_CompleteTypeDetail_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteTypeDetail_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteTypeDetailPubSubType::~CompleteTypeDetailPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteTypeDetailPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteTypeDetail* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteTypeDetailPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteTypeDetail* 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 CompleteTypeDetailPubSubType::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* CompleteTypeDetailPubSubType::createData() +{ + return reinterpret_cast(new CompleteTypeDetail()); +} + +void CompleteTypeDetailPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteTypeDetailPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteTypeDetail* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteTypeDetail_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_fastdds_dds_xtypes_CompleteTypeDetail_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; +} + +void CompleteTypeDetailPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteStructHeaderPubSubType::CompleteStructHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteStructHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteStructHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteStructHeader_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_fastdds_dds_xtypes_CompleteStructHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteStructHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteStructHeaderPubSubType::~CompleteStructHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteStructHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteStructHeader* 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; + } + 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 CompleteStructHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteStructHeader* 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 CompleteStructHeaderPubSubType::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* CompleteStructHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteStructHeader()); +} + +void CompleteStructHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteStructHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteStructHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteStructHeader_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_fastdds_dds_xtypes_CompleteStructHeader_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; +} + +void CompleteStructHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalStructHeaderPubSubType::MinimalStructHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalStructHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalStructHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalStructHeader_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_fastdds_dds_xtypes_MinimalStructHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalStructHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalStructHeaderPubSubType::~MinimalStructHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalStructHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalStructHeader* 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; + } + 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 MinimalStructHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalStructHeader* 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 MinimalStructHeaderPubSubType::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* MinimalStructHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalStructHeader()); +} + +void MinimalStructHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalStructHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalStructHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalStructHeader_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_fastdds_dds_xtypes_MinimalStructHeader_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; +} + +void MinimalStructHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteStructTypePubSubType::CompleteStructTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteStructType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteStructType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteStructType_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_fastdds_dds_xtypes_CompleteStructType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteStructType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteStructTypePubSubType::~CompleteStructTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteStructTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteStructType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteStructTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteStructType* 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 CompleteStructTypePubSubType::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* CompleteStructTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteStructType()); +} + +void CompleteStructTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteStructTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteStructType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteStructType_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_fastdds_dds_xtypes_CompleteStructType_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; +} + +void CompleteStructTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalStructTypePubSubType::MinimalStructTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalStructType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalStructType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalStructType_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_fastdds_dds_xtypes_MinimalStructType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalStructType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalStructTypePubSubType::~MinimalStructTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalStructTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalStructType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalStructTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalStructType* 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 MinimalStructTypePubSubType::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* MinimalStructTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalStructType()); +} + +void MinimalStructTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalStructTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalStructType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalStructType_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_fastdds_dds_xtypes_MinimalStructType_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; +} + +void MinimalStructTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CommonUnionMemberPubSubType::CommonUnionMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonUnionMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonUnionMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonUnionMember_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_fastdds_dds_xtypes_CommonUnionMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonUnionMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonUnionMemberPubSubType::~CommonUnionMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonUnionMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonUnionMember* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonUnionMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonUnionMember* 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 CommonUnionMemberPubSubType::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* CommonUnionMemberPubSubType::createData() +{ + return reinterpret_cast(new CommonUnionMember()); +} + +void CommonUnionMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonUnionMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonUnionMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonUnionMember_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_fastdds_dds_xtypes_CommonUnionMember_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; +} + +void CommonUnionMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteUnionMemberPubSubType::CompleteUnionMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteUnionMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteUnionMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteUnionMember_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_fastdds_dds_xtypes_CompleteUnionMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteUnionMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteUnionMemberPubSubType::~CompleteUnionMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteUnionMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteUnionMember* 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; + } + 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 CompleteUnionMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteUnionMember* 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 CompleteUnionMemberPubSubType::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* CompleteUnionMemberPubSubType::createData() +{ + return reinterpret_cast(new CompleteUnionMember()); +} + +void CompleteUnionMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteUnionMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteUnionMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteUnionMember_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_fastdds_dds_xtypes_CompleteUnionMember_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; +} + +void CompleteUnionMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalUnionMemberPubSubType::MinimalUnionMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalUnionMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalUnionMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalUnionMember_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_fastdds_dds_xtypes_MinimalUnionMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalUnionMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalUnionMemberPubSubType::~MinimalUnionMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalUnionMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalUnionMember* 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; + } + 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 MinimalUnionMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalUnionMember* 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 MinimalUnionMemberPubSubType::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* MinimalUnionMemberPubSubType::createData() +{ + return reinterpret_cast(new MinimalUnionMember()); +} + +void MinimalUnionMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalUnionMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalUnionMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalUnionMember_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_fastdds_dds_xtypes_MinimalUnionMember_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; +} + +void MinimalUnionMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CommonDiscriminatorMemberPubSubType::CommonDiscriminatorMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonDiscriminatorMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_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_fastdds_dds_xtypes_CommonDiscriminatorMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonDiscriminatorMemberPubSubType::~CommonDiscriminatorMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonDiscriminatorMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonDiscriminatorMember* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonDiscriminatorMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonDiscriminatorMember* 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 CommonDiscriminatorMemberPubSubType::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* CommonDiscriminatorMemberPubSubType::createData() +{ + return reinterpret_cast(new CommonDiscriminatorMember()); +} + +void CommonDiscriminatorMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonDiscriminatorMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonDiscriminatorMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_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_fastdds_dds_xtypes_CommonDiscriminatorMember_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; +} + +void CommonDiscriminatorMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteDiscriminatorMemberPubSubType::CompleteDiscriminatorMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteDiscriminatorMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_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_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteDiscriminatorMemberPubSubType::~CompleteDiscriminatorMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteDiscriminatorMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteDiscriminatorMember* 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; + } + 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 CompleteDiscriminatorMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteDiscriminatorMember* 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 CompleteDiscriminatorMemberPubSubType::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* CompleteDiscriminatorMemberPubSubType::createData() +{ + return reinterpret_cast(new CompleteDiscriminatorMember()); +} + +void CompleteDiscriminatorMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteDiscriminatorMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteDiscriminatorMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_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_fastdds_dds_xtypes_CompleteDiscriminatorMember_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; +} + +void CompleteDiscriminatorMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalDiscriminatorMemberPubSubType::MinimalDiscriminatorMemberPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalDiscriminatorMember::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_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_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalDiscriminatorMemberPubSubType::~MinimalDiscriminatorMemberPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalDiscriminatorMemberPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalDiscriminatorMember* 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; + } + 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 MinimalDiscriminatorMemberPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalDiscriminatorMember* 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 MinimalDiscriminatorMemberPubSubType::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* MinimalDiscriminatorMemberPubSubType::createData() +{ + return reinterpret_cast(new MinimalDiscriminatorMember()); +} + +void MinimalDiscriminatorMemberPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalDiscriminatorMemberPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalDiscriminatorMember* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_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_fastdds_dds_xtypes_MinimalDiscriminatorMember_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; +} + +void MinimalDiscriminatorMemberPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteUnionHeaderPubSubType::CompleteUnionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteUnionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteUnionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteUnionHeader_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_fastdds_dds_xtypes_CompleteUnionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteUnionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteUnionHeaderPubSubType::~CompleteUnionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteUnionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteUnionHeader* 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; + } + 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 CompleteUnionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteUnionHeader* 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 CompleteUnionHeaderPubSubType::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* CompleteUnionHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteUnionHeader()); +} + +void CompleteUnionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteUnionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteUnionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteUnionHeader_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_fastdds_dds_xtypes_CompleteUnionHeader_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; +} + +void CompleteUnionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalUnionHeaderPubSubType::MinimalUnionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalUnionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalUnionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalUnionHeader_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_fastdds_dds_xtypes_MinimalUnionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalUnionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalUnionHeaderPubSubType::~MinimalUnionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalUnionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalUnionHeader* 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; + } + 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 MinimalUnionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalUnionHeader* 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 MinimalUnionHeaderPubSubType::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* MinimalUnionHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalUnionHeader()); +} + +void MinimalUnionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalUnionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalUnionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalUnionHeader_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_fastdds_dds_xtypes_MinimalUnionHeader_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; +} + +void MinimalUnionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteUnionTypePubSubType::CompleteUnionTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteUnionType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteUnionType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteUnionType_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_fastdds_dds_xtypes_CompleteUnionType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteUnionType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteUnionTypePubSubType::~CompleteUnionTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteUnionTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteUnionType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteUnionTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteUnionType* 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 CompleteUnionTypePubSubType::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* CompleteUnionTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteUnionType()); +} + +void CompleteUnionTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteUnionTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteUnionType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteUnionType_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_fastdds_dds_xtypes_CompleteUnionType_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; +} + +void CompleteUnionTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalUnionTypePubSubType::MinimalUnionTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalUnionType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalUnionType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalUnionType_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_fastdds_dds_xtypes_MinimalUnionType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalUnionType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalUnionTypePubSubType::~MinimalUnionTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalUnionTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalUnionType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalUnionTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalUnionType* 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 MinimalUnionTypePubSubType::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* MinimalUnionTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalUnionType()); +} + +void MinimalUnionTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalUnionTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalUnionType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalUnionType_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_fastdds_dds_xtypes_MinimalUnionType_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; +} + +void MinimalUnionTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonAnnotationParameterPubSubType::CommonAnnotationParameterPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonAnnotationParameter"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonAnnotationParameter::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_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_fastdds_dds_xtypes_CommonAnnotationParameter_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonAnnotationParameterPubSubType::~CommonAnnotationParameterPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonAnnotationParameterPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonAnnotationParameter* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonAnnotationParameterPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonAnnotationParameter* 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 CommonAnnotationParameterPubSubType::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* CommonAnnotationParameterPubSubType::createData() +{ + return reinterpret_cast(new CommonAnnotationParameter()); +} + +void CommonAnnotationParameterPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonAnnotationParameterPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonAnnotationParameter* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_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_fastdds_dds_xtypes_CommonAnnotationParameter_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; +} + +void CommonAnnotationParameterPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteAnnotationParameterPubSubType::CompleteAnnotationParameterPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAnnotationParameter::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_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_fastdds_dds_xtypes_CompleteAnnotationParameter_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAnnotationParameterPubSubType::~CompleteAnnotationParameterPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAnnotationParameterPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAnnotationParameter* 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; + } + 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 CompleteAnnotationParameterPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAnnotationParameter* 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 CompleteAnnotationParameterPubSubType::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* CompleteAnnotationParameterPubSubType::createData() +{ + return reinterpret_cast(new CompleteAnnotationParameter()); +} + +void CompleteAnnotationParameterPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAnnotationParameterPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAnnotationParameter* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_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_fastdds_dds_xtypes_CompleteAnnotationParameter_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; +} + +void CompleteAnnotationParameterPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalAnnotationParameterPubSubType::MinimalAnnotationParameterPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAnnotationParameter::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_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_fastdds_dds_xtypes_MinimalAnnotationParameter_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAnnotationParameterPubSubType::~MinimalAnnotationParameterPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAnnotationParameterPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAnnotationParameter* 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; + } + 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 MinimalAnnotationParameterPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAnnotationParameter* 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 MinimalAnnotationParameterPubSubType::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* MinimalAnnotationParameterPubSubType::createData() +{ + return reinterpret_cast(new MinimalAnnotationParameter()); +} + +void MinimalAnnotationParameterPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAnnotationParameterPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAnnotationParameter* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_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_fastdds_dds_xtypes_MinimalAnnotationParameter_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; +} + +void MinimalAnnotationParameterPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CompleteAnnotationHeaderPubSubType::CompleteAnnotationHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAnnotationHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_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_fastdds_dds_xtypes_CompleteAnnotationHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAnnotationHeaderPubSubType::~CompleteAnnotationHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAnnotationHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAnnotationHeader* 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; + } + 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 CompleteAnnotationHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAnnotationHeader* 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 CompleteAnnotationHeaderPubSubType::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* CompleteAnnotationHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteAnnotationHeader()); +} + +void CompleteAnnotationHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAnnotationHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAnnotationHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_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_fastdds_dds_xtypes_CompleteAnnotationHeader_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; +} + +void CompleteAnnotationHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalAnnotationHeaderPubSubType::MinimalAnnotationHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAnnotationHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_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_fastdds_dds_xtypes_MinimalAnnotationHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAnnotationHeaderPubSubType::~MinimalAnnotationHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAnnotationHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAnnotationHeader* 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; + } + 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 MinimalAnnotationHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAnnotationHeader* 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 MinimalAnnotationHeaderPubSubType::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* MinimalAnnotationHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalAnnotationHeader()); +} + +void MinimalAnnotationHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAnnotationHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAnnotationHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_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_fastdds_dds_xtypes_MinimalAnnotationHeader_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; +} + +void MinimalAnnotationHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteAnnotationTypePubSubType::CompleteAnnotationTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAnnotationType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAnnotationType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAnnotationType_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_fastdds_dds_xtypes_CompleteAnnotationType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAnnotationType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAnnotationTypePubSubType::~CompleteAnnotationTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAnnotationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAnnotationType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteAnnotationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAnnotationType* 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 CompleteAnnotationTypePubSubType::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* CompleteAnnotationTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteAnnotationType()); +} + +void CompleteAnnotationTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAnnotationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAnnotationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAnnotationType_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_fastdds_dds_xtypes_CompleteAnnotationType_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; +} + +void CompleteAnnotationTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalAnnotationTypePubSubType::MinimalAnnotationTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAnnotationType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAnnotationType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAnnotationType_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_fastdds_dds_xtypes_MinimalAnnotationType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAnnotationType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAnnotationTypePubSubType::~MinimalAnnotationTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAnnotationTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAnnotationType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalAnnotationTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAnnotationType* 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 MinimalAnnotationTypePubSubType::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* MinimalAnnotationTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalAnnotationType()); +} + +void MinimalAnnotationTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAnnotationTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAnnotationType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAnnotationType_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_fastdds_dds_xtypes_MinimalAnnotationType_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; +} + +void MinimalAnnotationTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonAliasBodyPubSubType::CommonAliasBodyPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonAliasBody"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonAliasBody::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonAliasBody_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_fastdds_dds_xtypes_CommonAliasBody_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonAliasBody_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonAliasBodyPubSubType::~CommonAliasBodyPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonAliasBodyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonAliasBody* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonAliasBodyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonAliasBody* 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 CommonAliasBodyPubSubType::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* CommonAliasBodyPubSubType::createData() +{ + return reinterpret_cast(new CommonAliasBody()); +} + +void CommonAliasBodyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonAliasBodyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonAliasBody* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonAliasBody_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_fastdds_dds_xtypes_CommonAliasBody_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; +} + +void CommonAliasBodyPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteAliasBodyPubSubType::CompleteAliasBodyPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAliasBody"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAliasBody::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAliasBody_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_fastdds_dds_xtypes_CompleteAliasBody_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAliasBody_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAliasBodyPubSubType::~CompleteAliasBodyPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAliasBodyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAliasBody* 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; + } + 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 CompleteAliasBodyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAliasBody* 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 CompleteAliasBodyPubSubType::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* CompleteAliasBodyPubSubType::createData() +{ + return reinterpret_cast(new CompleteAliasBody()); +} + +void CompleteAliasBodyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAliasBodyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAliasBody* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAliasBody_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_fastdds_dds_xtypes_CompleteAliasBody_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; +} + +void CompleteAliasBodyPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalAliasBodyPubSubType::MinimalAliasBodyPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAliasBody"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAliasBody::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAliasBody_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_fastdds_dds_xtypes_MinimalAliasBody_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAliasBody_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAliasBodyPubSubType::~MinimalAliasBodyPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAliasBodyPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAliasBody* 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; + } + 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 MinimalAliasBodyPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAliasBody* 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 MinimalAliasBodyPubSubType::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* MinimalAliasBodyPubSubType::createData() +{ + return reinterpret_cast(new MinimalAliasBody()); +} + +void MinimalAliasBodyPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAliasBodyPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAliasBody* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAliasBody_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_fastdds_dds_xtypes_MinimalAliasBody_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; +} + +void MinimalAliasBodyPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteAliasHeaderPubSubType::CompleteAliasHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAliasHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAliasHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAliasHeader_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_fastdds_dds_xtypes_CompleteAliasHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAliasHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAliasHeaderPubSubType::~CompleteAliasHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAliasHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAliasHeader* 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; + } + 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 CompleteAliasHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAliasHeader* 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 CompleteAliasHeaderPubSubType::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* CompleteAliasHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteAliasHeader()); +} + +void CompleteAliasHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAliasHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAliasHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAliasHeader_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_fastdds_dds_xtypes_CompleteAliasHeader_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; +} + +void CompleteAliasHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalAliasHeaderPubSubType::MinimalAliasHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAliasHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAliasHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAliasHeader_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_fastdds_dds_xtypes_MinimalAliasHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAliasHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAliasHeaderPubSubType::~MinimalAliasHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAliasHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAliasHeader* 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; + } + 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 MinimalAliasHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAliasHeader* 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 MinimalAliasHeaderPubSubType::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* MinimalAliasHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalAliasHeader()); +} + +void MinimalAliasHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAliasHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAliasHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAliasHeader_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_fastdds_dds_xtypes_MinimalAliasHeader_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; +} + +void MinimalAliasHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteAliasTypePubSubType::CompleteAliasTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteAliasType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteAliasType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteAliasType_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_fastdds_dds_xtypes_CompleteAliasType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteAliasType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteAliasTypePubSubType::~CompleteAliasTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteAliasTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteAliasType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteAliasTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteAliasType* 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 CompleteAliasTypePubSubType::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* CompleteAliasTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteAliasType()); +} + +void CompleteAliasTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteAliasTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteAliasType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteAliasType_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_fastdds_dds_xtypes_CompleteAliasType_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; +} + +void CompleteAliasTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalAliasTypePubSubType::MinimalAliasTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalAliasType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalAliasType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalAliasType_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_fastdds_dds_xtypes_MinimalAliasType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalAliasType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalAliasTypePubSubType::~MinimalAliasTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalAliasTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalAliasType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalAliasTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalAliasType* 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 MinimalAliasTypePubSubType::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* MinimalAliasTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalAliasType()); +} + +void MinimalAliasTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalAliasTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalAliasType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalAliasType_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_fastdds_dds_xtypes_MinimalAliasType_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; +} + +void MinimalAliasTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteElementDetailPubSubType::CompleteElementDetailPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteElementDetail"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteElementDetail::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteElementDetail_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_fastdds_dds_xtypes_CompleteElementDetail_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteElementDetail_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteElementDetailPubSubType::~CompleteElementDetailPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteElementDetailPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteElementDetail* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteElementDetailPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteElementDetail* 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 CompleteElementDetailPubSubType::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* CompleteElementDetailPubSubType::createData() +{ + return reinterpret_cast(new CompleteElementDetail()); +} + +void CompleteElementDetailPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteElementDetailPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteElementDetail* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteElementDetail_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_fastdds_dds_xtypes_CompleteElementDetail_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; +} + +void CompleteElementDetailPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonCollectionElementPubSubType::CommonCollectionElementPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonCollectionElement"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonCollectionElement::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonCollectionElement_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_fastdds_dds_xtypes_CommonCollectionElement_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonCollectionElement_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonCollectionElementPubSubType::~CommonCollectionElementPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonCollectionElementPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonCollectionElement* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonCollectionElementPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonCollectionElement* 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 CommonCollectionElementPubSubType::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* CommonCollectionElementPubSubType::createData() +{ + return reinterpret_cast(new CommonCollectionElement()); +} + +void CommonCollectionElementPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonCollectionElementPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonCollectionElement* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonCollectionElement_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_fastdds_dds_xtypes_CommonCollectionElement_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; +} + +void CommonCollectionElementPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteCollectionElementPubSubType::CompleteCollectionElementPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteCollectionElement"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteCollectionElement::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteCollectionElement_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_fastdds_dds_xtypes_CompleteCollectionElement_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteCollectionElement_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteCollectionElementPubSubType::~CompleteCollectionElementPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteCollectionElementPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteCollectionElement* 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; + } + 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 CompleteCollectionElementPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteCollectionElement* 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 CompleteCollectionElementPubSubType::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* CompleteCollectionElementPubSubType::createData() +{ + return reinterpret_cast(new CompleteCollectionElement()); +} + +void CompleteCollectionElementPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteCollectionElementPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteCollectionElement* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteCollectionElement_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_fastdds_dds_xtypes_CompleteCollectionElement_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; +} + +void CompleteCollectionElementPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalCollectionElementPubSubType::MinimalCollectionElementPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalCollectionElement"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalCollectionElement::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalCollectionElement_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_fastdds_dds_xtypes_MinimalCollectionElement_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalCollectionElement_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalCollectionElementPubSubType::~MinimalCollectionElementPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalCollectionElementPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalCollectionElement* 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; + } + 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 MinimalCollectionElementPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalCollectionElement* 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 MinimalCollectionElementPubSubType::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* MinimalCollectionElementPubSubType::createData() +{ + return reinterpret_cast(new MinimalCollectionElement()); +} + +void MinimalCollectionElementPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalCollectionElementPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalCollectionElement* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalCollectionElement_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_fastdds_dds_xtypes_MinimalCollectionElement_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; +} + +void MinimalCollectionElementPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonCollectionHeaderPubSubType::CommonCollectionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonCollectionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonCollectionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonCollectionHeader_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_fastdds_dds_xtypes_CommonCollectionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonCollectionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonCollectionHeaderPubSubType::~CommonCollectionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonCollectionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonCollectionHeader* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonCollectionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonCollectionHeader* 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 CommonCollectionHeaderPubSubType::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* CommonCollectionHeaderPubSubType::createData() +{ + return reinterpret_cast(new CommonCollectionHeader()); +} + +void CommonCollectionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonCollectionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonCollectionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonCollectionHeader_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_fastdds_dds_xtypes_CommonCollectionHeader_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; +} + +void CommonCollectionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteCollectionHeaderPubSubType::CompleteCollectionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteCollectionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteCollectionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_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_fastdds_dds_xtypes_CompleteCollectionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteCollectionHeaderPubSubType::~CompleteCollectionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteCollectionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteCollectionHeader* 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; + } + 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 CompleteCollectionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteCollectionHeader* 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 CompleteCollectionHeaderPubSubType::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* CompleteCollectionHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteCollectionHeader()); +} + +void CompleteCollectionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteCollectionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteCollectionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_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_fastdds_dds_xtypes_CompleteCollectionHeader_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; +} + +void CompleteCollectionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalCollectionHeaderPubSubType::MinimalCollectionHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalCollectionHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalCollectionHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_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_fastdds_dds_xtypes_MinimalCollectionHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalCollectionHeaderPubSubType::~MinimalCollectionHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalCollectionHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalCollectionHeader* 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; + } + 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 MinimalCollectionHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalCollectionHeader* 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 MinimalCollectionHeaderPubSubType::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* MinimalCollectionHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalCollectionHeader()); +} + +void MinimalCollectionHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalCollectionHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalCollectionHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_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_fastdds_dds_xtypes_MinimalCollectionHeader_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; +} + +void MinimalCollectionHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteSequenceTypePubSubType::CompleteSequenceTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteSequenceType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteSequenceType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteSequenceType_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_fastdds_dds_xtypes_CompleteSequenceType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteSequenceType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteSequenceTypePubSubType::~CompleteSequenceTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteSequenceTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteSequenceType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteSequenceTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteSequenceType* 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 CompleteSequenceTypePubSubType::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* CompleteSequenceTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteSequenceType()); +} + +void CompleteSequenceTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteSequenceTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteSequenceType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteSequenceType_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_fastdds_dds_xtypes_CompleteSequenceType_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; +} + +void CompleteSequenceTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalSequenceTypePubSubType::MinimalSequenceTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalSequenceType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalSequenceType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalSequenceType_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_fastdds_dds_xtypes_MinimalSequenceType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalSequenceType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalSequenceTypePubSubType::~MinimalSequenceTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalSequenceTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalSequenceType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalSequenceTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalSequenceType* 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 MinimalSequenceTypePubSubType::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* MinimalSequenceTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalSequenceType()); +} + +void MinimalSequenceTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalSequenceTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalSequenceType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalSequenceType_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_fastdds_dds_xtypes_MinimalSequenceType_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; +} + +void MinimalSequenceTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonArrayHeaderPubSubType::CommonArrayHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonArrayHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonArrayHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonArrayHeader_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_fastdds_dds_xtypes_CommonArrayHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonArrayHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonArrayHeaderPubSubType::~CommonArrayHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonArrayHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonArrayHeader* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonArrayHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonArrayHeader* 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 CommonArrayHeaderPubSubType::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* CommonArrayHeaderPubSubType::createData() +{ + return reinterpret_cast(new CommonArrayHeader()); +} + +void CommonArrayHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonArrayHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonArrayHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonArrayHeader_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_fastdds_dds_xtypes_CommonArrayHeader_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; +} + +void CommonArrayHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteArrayHeaderPubSubType::CompleteArrayHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteArrayHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteArrayHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteArrayHeader_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_fastdds_dds_xtypes_CompleteArrayHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteArrayHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteArrayHeaderPubSubType::~CompleteArrayHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteArrayHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteArrayHeader* 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; + } + 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 CompleteArrayHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteArrayHeader* 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 CompleteArrayHeaderPubSubType::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* CompleteArrayHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteArrayHeader()); +} + +void CompleteArrayHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteArrayHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteArrayHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteArrayHeader_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_fastdds_dds_xtypes_CompleteArrayHeader_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; +} + +void CompleteArrayHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalArrayHeaderPubSubType::MinimalArrayHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalArrayHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalArrayHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalArrayHeader_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_fastdds_dds_xtypes_MinimalArrayHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalArrayHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalArrayHeaderPubSubType::~MinimalArrayHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalArrayHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalArrayHeader* 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; + } + 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 MinimalArrayHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalArrayHeader* 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 MinimalArrayHeaderPubSubType::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* MinimalArrayHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalArrayHeader()); +} + +void MinimalArrayHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalArrayHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalArrayHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalArrayHeader_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_fastdds_dds_xtypes_MinimalArrayHeader_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; +} + +void MinimalArrayHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteArrayTypePubSubType::CompleteArrayTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteArrayType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteArrayType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteArrayType_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_fastdds_dds_xtypes_CompleteArrayType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteArrayType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteArrayTypePubSubType::~CompleteArrayTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteArrayTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteArrayType* 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; + } + 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 CompleteArrayTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteArrayType* 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 CompleteArrayTypePubSubType::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* CompleteArrayTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteArrayType()); +} + +void CompleteArrayTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteArrayTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteArrayType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteArrayType_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_fastdds_dds_xtypes_CompleteArrayType_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; +} + +void CompleteArrayTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalArrayTypePubSubType::MinimalArrayTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalArrayType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalArrayType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalArrayType_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_fastdds_dds_xtypes_MinimalArrayType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalArrayType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalArrayTypePubSubType::~MinimalArrayTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalArrayTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalArrayType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalArrayTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalArrayType* 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 MinimalArrayTypePubSubType::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* MinimalArrayTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalArrayType()); +} + +void MinimalArrayTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalArrayTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalArrayType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalArrayType_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_fastdds_dds_xtypes_MinimalArrayType_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; +} + +void MinimalArrayTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteMapTypePubSubType::CompleteMapTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteMapType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteMapType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteMapType_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_fastdds_dds_xtypes_CompleteMapType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteMapType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteMapTypePubSubType::~CompleteMapTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteMapTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteMapType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteMapTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteMapType* 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 CompleteMapTypePubSubType::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* CompleteMapTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteMapType()); +} + +void CompleteMapTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteMapTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteMapType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteMapType_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_fastdds_dds_xtypes_CompleteMapType_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; +} + +void CompleteMapTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalMapTypePubSubType::MinimalMapTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalMapType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalMapType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalMapType_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_fastdds_dds_xtypes_MinimalMapType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalMapType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalMapTypePubSubType::~MinimalMapTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalMapTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalMapType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalMapTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalMapType* 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 MinimalMapTypePubSubType::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* MinimalMapTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalMapType()); +} + +void MinimalMapTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalMapTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalMapType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalMapType_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_fastdds_dds_xtypes_MinimalMapType_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; +} + +void MinimalMapTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CommonEnumeratedLiteralPubSubType::CommonEnumeratedLiteralPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonEnumeratedLiteral::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_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_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonEnumeratedLiteralPubSubType::~CommonEnumeratedLiteralPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonEnumeratedLiteralPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonEnumeratedLiteral* 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; + } + 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 CommonEnumeratedLiteralPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonEnumeratedLiteral* 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 CommonEnumeratedLiteralPubSubType::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* CommonEnumeratedLiteralPubSubType::createData() +{ + return reinterpret_cast(new CommonEnumeratedLiteral()); +} + +void CommonEnumeratedLiteralPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonEnumeratedLiteralPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonEnumeratedLiteral* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_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_fastdds_dds_xtypes_CommonEnumeratedLiteral_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; +} + +void CommonEnumeratedLiteralPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteEnumeratedLiteralPubSubType::CompleteEnumeratedLiteralPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteEnumeratedLiteral::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_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_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteEnumeratedLiteralPubSubType::~CompleteEnumeratedLiteralPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteEnumeratedLiteralPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteEnumeratedLiteral* 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; + } + 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 CompleteEnumeratedLiteralPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteEnumeratedLiteral* 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 CompleteEnumeratedLiteralPubSubType::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* CompleteEnumeratedLiteralPubSubType::createData() +{ + return reinterpret_cast(new CompleteEnumeratedLiteral()); +} + +void CompleteEnumeratedLiteralPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteEnumeratedLiteralPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteEnumeratedLiteral* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_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_fastdds_dds_xtypes_CompleteEnumeratedLiteral_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; +} + +void CompleteEnumeratedLiteralPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalEnumeratedLiteralPubSubType::MinimalEnumeratedLiteralPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalEnumeratedLiteral::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_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_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalEnumeratedLiteralPubSubType::~MinimalEnumeratedLiteralPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalEnumeratedLiteralPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalEnumeratedLiteral* 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; + } + 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 MinimalEnumeratedLiteralPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalEnumeratedLiteral* 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 MinimalEnumeratedLiteralPubSubType::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* MinimalEnumeratedLiteralPubSubType::createData() +{ + return reinterpret_cast(new MinimalEnumeratedLiteral()); +} + +void MinimalEnumeratedLiteralPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalEnumeratedLiteralPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalEnumeratedLiteral* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_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_fastdds_dds_xtypes_MinimalEnumeratedLiteral_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; +} + +void MinimalEnumeratedLiteralPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CommonEnumeratedHeaderPubSubType::CommonEnumeratedHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonEnumeratedHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_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_fastdds_dds_xtypes_CommonEnumeratedHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonEnumeratedHeaderPubSubType::~CommonEnumeratedHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonEnumeratedHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonEnumeratedHeader* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonEnumeratedHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonEnumeratedHeader* 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 CommonEnumeratedHeaderPubSubType::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* CommonEnumeratedHeaderPubSubType::createData() +{ + return reinterpret_cast(new CommonEnumeratedHeader()); +} + +void CommonEnumeratedHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonEnumeratedHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonEnumeratedHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_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_fastdds_dds_xtypes_CommonEnumeratedHeader_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; +} + +void CommonEnumeratedHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteEnumeratedHeaderPubSubType::CompleteEnumeratedHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteEnumeratedHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_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_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteEnumeratedHeaderPubSubType::~CompleteEnumeratedHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteEnumeratedHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteEnumeratedHeader* 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; + } + 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 CompleteEnumeratedHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteEnumeratedHeader* 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 CompleteEnumeratedHeaderPubSubType::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* CompleteEnumeratedHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteEnumeratedHeader()); +} + +void CompleteEnumeratedHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteEnumeratedHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteEnumeratedHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_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_fastdds_dds_xtypes_CompleteEnumeratedHeader_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; +} + +void CompleteEnumeratedHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalEnumeratedHeaderPubSubType::MinimalEnumeratedHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalEnumeratedHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_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_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalEnumeratedHeaderPubSubType::~MinimalEnumeratedHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalEnumeratedHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalEnumeratedHeader* 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; + } + 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 MinimalEnumeratedHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalEnumeratedHeader* 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 MinimalEnumeratedHeaderPubSubType::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* MinimalEnumeratedHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalEnumeratedHeader()); +} + +void MinimalEnumeratedHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalEnumeratedHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalEnumeratedHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_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_fastdds_dds_xtypes_MinimalEnumeratedHeader_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; +} + +void MinimalEnumeratedHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteEnumeratedTypePubSubType::CompleteEnumeratedTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteEnumeratedType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteEnumeratedType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_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_fastdds_dds_xtypes_CompleteEnumeratedType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteEnumeratedTypePubSubType::~CompleteEnumeratedTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteEnumeratedTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteEnumeratedType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteEnumeratedTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteEnumeratedType* 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 CompleteEnumeratedTypePubSubType::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* CompleteEnumeratedTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteEnumeratedType()); +} + +void CompleteEnumeratedTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteEnumeratedTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteEnumeratedType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_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_fastdds_dds_xtypes_CompleteEnumeratedType_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; +} + +void CompleteEnumeratedTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalEnumeratedTypePubSubType::MinimalEnumeratedTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalEnumeratedType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalEnumeratedType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_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_fastdds_dds_xtypes_MinimalEnumeratedType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalEnumeratedTypePubSubType::~MinimalEnumeratedTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalEnumeratedTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalEnumeratedType* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalEnumeratedTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalEnumeratedType* 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 MinimalEnumeratedTypePubSubType::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* MinimalEnumeratedTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalEnumeratedType()); +} + +void MinimalEnumeratedTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalEnumeratedTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalEnumeratedType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_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_fastdds_dds_xtypes_MinimalEnumeratedType_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; +} + +void MinimalEnumeratedTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonBitflagPubSubType::CommonBitflagPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonBitflag"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonBitflag::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonBitflag_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_fastdds_dds_xtypes_CommonBitflag_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonBitflag_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonBitflagPubSubType::~CommonBitflagPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonBitflagPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonBitflag* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonBitflagPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonBitflag* 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 CommonBitflagPubSubType::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* CommonBitflagPubSubType::createData() +{ + return reinterpret_cast(new CommonBitflag()); +} + +void CommonBitflagPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonBitflagPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonBitflag* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonBitflag_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_fastdds_dds_xtypes_CommonBitflag_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; +} + +void CommonBitflagPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteBitflagPubSubType::CompleteBitflagPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteBitflag"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteBitflag::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteBitflag_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_fastdds_dds_xtypes_CompleteBitflag_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteBitflag_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteBitflagPubSubType::~CompleteBitflagPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteBitflagPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteBitflag* 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; + } + 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 CompleteBitflagPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteBitflag* 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 CompleteBitflagPubSubType::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* CompleteBitflagPubSubType::createData() +{ + return reinterpret_cast(new CompleteBitflag()); +} + +void CompleteBitflagPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteBitflagPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteBitflag* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteBitflag_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_fastdds_dds_xtypes_CompleteBitflag_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; +} + +void CompleteBitflagPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalBitflagPubSubType::MinimalBitflagPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalBitflag"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalBitflag::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalBitflag_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_fastdds_dds_xtypes_MinimalBitflag_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalBitflag_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalBitflagPubSubType::~MinimalBitflagPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalBitflagPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalBitflag* 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; + } + 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 MinimalBitflagPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalBitflag* 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 MinimalBitflagPubSubType::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* MinimalBitflagPubSubType::createData() +{ + return reinterpret_cast(new MinimalBitflag()); +} + +void MinimalBitflagPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalBitflagPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalBitflag* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalBitflag_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_fastdds_dds_xtypes_MinimalBitflag_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; +} + +void MinimalBitflagPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CommonBitmaskHeaderPubSubType::CommonBitmaskHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonBitmaskHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonBitmaskHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_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_fastdds_dds_xtypes_CommonBitmaskHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonBitmaskHeaderPubSubType::~CommonBitmaskHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonBitmaskHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonBitmaskHeader* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonBitmaskHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonBitmaskHeader* 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 CommonBitmaskHeaderPubSubType::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* CommonBitmaskHeaderPubSubType::createData() +{ + return reinterpret_cast(new CommonBitmaskHeader()); +} + +void CommonBitmaskHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonBitmaskHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonBitmaskHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_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_fastdds_dds_xtypes_CommonBitmaskHeader_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; +} + +void CommonBitmaskHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + + +CompleteBitmaskTypePubSubType::CompleteBitmaskTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteBitmaskType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteBitmaskType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteBitmaskType_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_fastdds_dds_xtypes_CompleteBitmaskType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteBitmaskType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteBitmaskTypePubSubType::~CompleteBitmaskTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteBitmaskTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteBitmaskType* 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; + } + 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 CompleteBitmaskTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteBitmaskType* 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 CompleteBitmaskTypePubSubType::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* CompleteBitmaskTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteBitmaskType()); +} + +void CompleteBitmaskTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteBitmaskTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteBitmaskType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteBitmaskType_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_fastdds_dds_xtypes_CompleteBitmaskType_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; +} + +void CompleteBitmaskTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalBitmaskTypePubSubType::MinimalBitmaskTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalBitmaskType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalBitmaskType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalBitmaskType_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_fastdds_dds_xtypes_MinimalBitmaskType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalBitmaskType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalBitmaskTypePubSubType::~MinimalBitmaskTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalBitmaskTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalBitmaskType* 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; + } + 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 MinimalBitmaskTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalBitmaskType* 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 MinimalBitmaskTypePubSubType::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* MinimalBitmaskTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalBitmaskType()); +} + +void MinimalBitmaskTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalBitmaskTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalBitmaskType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalBitmaskType_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_fastdds_dds_xtypes_MinimalBitmaskType_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; +} + +void MinimalBitmaskTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CommonBitfieldPubSubType::CommonBitfieldPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CommonBitfield"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CommonBitfield::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CommonBitfield_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_fastdds_dds_xtypes_CommonBitfield_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CommonBitfield_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CommonBitfieldPubSubType::~CommonBitfieldPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CommonBitfieldPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CommonBitfield* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CommonBitfieldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CommonBitfield* 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 CommonBitfieldPubSubType::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* CommonBitfieldPubSubType::createData() +{ + return reinterpret_cast(new CommonBitfield()); +} + +void CommonBitfieldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CommonBitfieldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CommonBitfield* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CommonBitfield_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_fastdds_dds_xtypes_CommonBitfield_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; +} + +void CommonBitfieldPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteBitfieldPubSubType::CompleteBitfieldPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteBitfield"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteBitfield::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteBitfield_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_fastdds_dds_xtypes_CompleteBitfield_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteBitfield_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteBitfieldPubSubType::~CompleteBitfieldPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteBitfieldPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteBitfield* 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; + } + 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 CompleteBitfieldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteBitfield* 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 CompleteBitfieldPubSubType::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* CompleteBitfieldPubSubType::createData() +{ + return reinterpret_cast(new CompleteBitfield()); +} + +void CompleteBitfieldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteBitfieldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteBitfield* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteBitfield_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_fastdds_dds_xtypes_CompleteBitfield_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; +} + +void CompleteBitfieldPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalBitfieldPubSubType::MinimalBitfieldPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalBitfield"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalBitfield::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalBitfield_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_fastdds_dds_xtypes_MinimalBitfield_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalBitfield_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalBitfieldPubSubType::~MinimalBitfieldPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalBitfieldPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalBitfield* 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; + } + 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 MinimalBitfieldPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalBitfield* 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 MinimalBitfieldPubSubType::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* MinimalBitfieldPubSubType::createData() +{ + return reinterpret_cast(new MinimalBitfield()); +} + +void MinimalBitfieldPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalBitfieldPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalBitfield* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalBitfield_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_fastdds_dds_xtypes_MinimalBitfield_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; +} + +void MinimalBitfieldPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +CompleteBitsetHeaderPubSubType::CompleteBitsetHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteBitsetHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteBitsetHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_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_fastdds_dds_xtypes_CompleteBitsetHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteBitsetHeaderPubSubType::~CompleteBitsetHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteBitsetHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteBitsetHeader* 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; + } + 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 CompleteBitsetHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteBitsetHeader* 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 CompleteBitsetHeaderPubSubType::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* CompleteBitsetHeaderPubSubType::createData() +{ + return reinterpret_cast(new CompleteBitsetHeader()); +} + +void CompleteBitsetHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteBitsetHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteBitsetHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_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_fastdds_dds_xtypes_CompleteBitsetHeader_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; +} + +void CompleteBitsetHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalBitsetHeaderPubSubType::MinimalBitsetHeaderPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalBitsetHeader"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalBitsetHeader::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_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_fastdds_dds_xtypes_MinimalBitsetHeader_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalBitsetHeaderPubSubType::~MinimalBitsetHeaderPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalBitsetHeaderPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalBitsetHeader* 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; + } + 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 MinimalBitsetHeaderPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalBitsetHeader* 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 MinimalBitsetHeaderPubSubType::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* MinimalBitsetHeaderPubSubType::createData() +{ + return reinterpret_cast(new MinimalBitsetHeader()); +} + +void MinimalBitsetHeaderPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalBitsetHeaderPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalBitsetHeader* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_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_fastdds_dds_xtypes_MinimalBitsetHeader_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; +} + +void MinimalBitsetHeaderPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteBitsetTypePubSubType::CompleteBitsetTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteBitsetType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteBitsetType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteBitsetType_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_fastdds_dds_xtypes_CompleteBitsetType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteBitsetType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteBitsetTypePubSubType::~CompleteBitsetTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteBitsetTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteBitsetType* 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; + } + 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 CompleteBitsetTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteBitsetType* 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 CompleteBitsetTypePubSubType::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* CompleteBitsetTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteBitsetType()); +} + +void CompleteBitsetTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteBitsetTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteBitsetType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteBitsetType_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_fastdds_dds_xtypes_CompleteBitsetType_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; +} + +void CompleteBitsetTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +MinimalBitsetTypePubSubType::MinimalBitsetTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalBitsetType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalBitsetType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalBitsetType_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_fastdds_dds_xtypes_MinimalBitsetType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalBitsetType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalBitsetTypePubSubType::~MinimalBitsetTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalBitsetTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalBitsetType* 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; + } + 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 MinimalBitsetTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalBitsetType* 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 MinimalBitsetTypePubSubType::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* MinimalBitsetTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalBitsetType()); +} + +void MinimalBitsetTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalBitsetTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalBitsetType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalBitsetType_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_fastdds_dds_xtypes_MinimalBitsetType_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; +} + +void MinimalBitsetTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + +CompleteExtendedTypePubSubType::CompleteExtendedTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::CompleteExtendedType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteExtendedType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_CompleteExtendedType_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_fastdds_dds_xtypes_CompleteExtendedType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_CompleteExtendedType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +CompleteExtendedTypePubSubType::~CompleteExtendedTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool CompleteExtendedTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + CompleteExtendedType* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 CompleteExtendedTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + CompleteExtendedType* 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 CompleteExtendedTypePubSubType::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* CompleteExtendedTypePubSubType::createData() +{ + return reinterpret_cast(new CompleteExtendedType()); +} + +void CompleteExtendedTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool CompleteExtendedTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + CompleteExtendedType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_CompleteExtendedType_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_fastdds_dds_xtypes_CompleteExtendedType_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; +} + +void CompleteExtendedTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +MinimalExtendedTypePubSubType::MinimalExtendedTypePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::MinimalExtendedType"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MinimalExtendedType::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_MinimalExtendedType_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_fastdds_dds_xtypes_MinimalExtendedType_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_MinimalExtendedType_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +MinimalExtendedTypePubSubType::~MinimalExtendedTypePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool MinimalExtendedTypePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + MinimalExtendedType* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 MinimalExtendedTypePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + MinimalExtendedType* 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 MinimalExtendedTypePubSubType::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* MinimalExtendedTypePubSubType::createData() +{ + return reinterpret_cast(new MinimalExtendedType()); +} + +void MinimalExtendedTypePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool MinimalExtendedTypePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + MinimalExtendedType* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_MinimalExtendedType_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_fastdds_dds_xtypes_MinimalExtendedType_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; +} + +void MinimalExtendedTypePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + + + + +TypeIdentifierTypeObjectPairPubSubType::TypeIdentifierTypeObjectPairPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeIdentifierTypeObjectPair::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_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_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +TypeIdentifierTypeObjectPairPubSubType::~TypeIdentifierTypeObjectPairPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool TypeIdentifierTypeObjectPairPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TypeIdentifierTypeObjectPair* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeIdentifierTypeObjectPairPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TypeIdentifierTypeObjectPair* 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 TypeIdentifierTypeObjectPairPubSubType::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* TypeIdentifierTypeObjectPairPubSubType::createData() +{ + return reinterpret_cast(new TypeIdentifierTypeObjectPair()); +} + +void TypeIdentifierTypeObjectPairPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TypeIdentifierTypeObjectPairPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + TypeIdentifierTypeObjectPair* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_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_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_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; +} + +void TypeIdentifierTypeObjectPairPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +TypeIdentifierPairPubSubType::TypeIdentifierPairPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::TypeIdentifierPair"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeIdentifierPair::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_TypeIdentifierPair_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_fastdds_dds_xtypes_TypeIdentifierPair_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_TypeIdentifierPair_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +TypeIdentifierPairPubSubType::~TypeIdentifierPairPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool TypeIdentifierPairPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TypeIdentifierPair* 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::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeIdentifierPairPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TypeIdentifierPair* 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 TypeIdentifierPairPubSubType::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* TypeIdentifierPairPubSubType::createData() +{ + return reinterpret_cast(new TypeIdentifierPair()); +} + +void TypeIdentifierPairPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TypeIdentifierPairPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + TypeIdentifierPair* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_TypeIdentifierPair_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_fastdds_dds_xtypes_TypeIdentifierPair_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; +} + +void TypeIdentifierPairPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +TypeIdentfierWithSizePubSubType::TypeIdentfierWithSizePubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeIdentfierWithSize::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_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_fastdds_dds_xtypes_TypeIdentfierWithSize_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +TypeIdentfierWithSizePubSubType::~TypeIdentfierWithSizePubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool TypeIdentfierWithSizePubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TypeIdentfierWithSize* 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; + } + 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 TypeIdentfierWithSizePubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TypeIdentfierWithSize* 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 TypeIdentfierWithSizePubSubType::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* TypeIdentfierWithSizePubSubType::createData() +{ + return reinterpret_cast(new TypeIdentfierWithSize()); +} + +void TypeIdentfierWithSizePubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TypeIdentfierWithSizePubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + TypeIdentfierWithSize* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_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_fastdds_dds_xtypes_TypeIdentfierWithSize_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; +} + +void TypeIdentfierWithSizePubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +TypeIdentifierWithDependenciesPubSubType::TypeIdentifierWithDependenciesPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeIdentifierWithDependencies::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_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_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +TypeIdentifierWithDependenciesPubSubType::~TypeIdentifierWithDependenciesPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool TypeIdentifierWithDependenciesPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TypeIdentifierWithDependencies* 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; + } + 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 TypeIdentifierWithDependenciesPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TypeIdentifierWithDependencies* 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 TypeIdentifierWithDependenciesPubSubType::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* TypeIdentifierWithDependenciesPubSubType::createData() +{ + return reinterpret_cast(new TypeIdentifierWithDependencies()); +} + +void TypeIdentifierWithDependenciesPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TypeIdentifierWithDependenciesPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + TypeIdentifierWithDependencies* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_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_fastdds_dds_xtypes_TypeIdentifierWithDependencies_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; +} + +void TypeIdentifierWithDependenciesPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + +TypeInformationPubSubType::TypeInformationPubSubType() +{ + setName("eprosima::fastdds::dds::xtypes::TypeInformation"); + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TypeInformation::getMaxCdrSerializedSize()); +#else + eprosima_fastdds_dds_xtypes_TypeInformation_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_fastdds_dds_xtypes_TypeInformation_max_key_cdr_typesize > 16 ? eprosima_fastdds_dds_xtypes_TypeInformation_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); +} + +TypeInformationPubSubType::~TypeInformationPubSubType() +{ + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } +} + +bool TypeInformationPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) +{ + TypeInformation* 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::PL_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 + + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + } + 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 TypeInformationPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) +{ + try + { + // Convert DATA to pointer of your type + TypeInformation* 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 TypeInformationPubSubType::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* TypeInformationPubSubType::createData() +{ + return reinterpret_cast(new TypeInformation()); +} + +void TypeInformationPubSubType::deleteData( + void* data) +{ + delete(reinterpret_cast(data)); +} + +bool TypeInformationPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) +{ + if (!m_isGetKeyDefined) + { + return false; + } + + TypeInformation* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_dds_xtypes_TypeInformation_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_fastdds_dds_xtypes_TypeInformation_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; +} + +void TypeInformationPubSubType::register_type_object_representation() const +{ + EPROSIMA_LOG_WARNING(XTYPES_TYPE_REPRESENTATION, + "TypeObject type representation support disabled in generated code"); +} + + + +} // namespace xtypes + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +// Include auxiliary functions like for serializing/deserializing. +#include "dds_xtypes_typeobjectCdrAux.ipp" diff --git a/src/cpp/fastrtps.rc b/src/cpp/fastrtps.rc index 050833f63fb..621ab1fac9a 100644 --- a/src/cpp/fastrtps.rc +++ b/src/cpp/fastrtps.rc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #define VC_EXTRALEAN #define WIN32_LEAN_AND_MEAN @@ -53,18 +53,18 @@ LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -78,15 +78,15 @@ END // Version // -#define VER_PRODUCTVERSION FASTRTPS_VERSION_MAJOR,FASTRTPS_VERSION_MINOR,FASTRTPS_VERSION_MICRO,0 -#define VER_PRODUCTVERSION_STR FASTRTPS_VERSION_STR +#define VER_PRODUCTVERSION FASTDDS_VERSION_MAJOR,FASTDDS_VERSION_MINOR,FASTDDS_VERSION_MICRO,0 +#define VER_PRODUCTVERSION_STR FASTDDS_VERSION_STR #define VER_COMPANYNAME_STR "eProsima" -#define VER_FILEDESCRIPTION_STR "Library to use RTPS protocol" +#define VER_FILEDESCRIPTION_STR "Library to use DDS protocol" #define VER_LEGALCOPYRIGHT_STR "Copyright 2015 (c)" -#define VER_PRODUCTNAME_STR "FastRTPS" +#define VER_PRODUCTNAME_STR "Fast DDS" #ifdef _WIN32 -#if defined(fastrtps_EXPORTS) +#if defined(fastdds_EXPORTS) #ifndef _DEBUG #define VER_DEBUG 0 diff --git a/src/cpp/fastrtps_deprecated/Domain.cpp b/src/cpp/fastrtps_deprecated/Domain.cpp deleted file mode 100644 index f2f595bdcac..00000000000 --- a/src/cpp/fastrtps_deprecated/Domain.cpp +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Domain.cpp - * - */ - -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::xmlparser; -using namespace eprosima::fastrtps::types; - -namespace eprosima { -namespace fastrtps { - -std::mutex Domain::m_mutex; -std::vector Domain::m_participants; -bool Domain::default_xml_profiles_loaded = false; - - -Domain::Domain() -{ - // TODO Auto-generated constructor stub -} - -Domain::~Domain() -{ - -} - -void Domain::stopAll() -{ - { - std::lock_guard guard(m_mutex); - while (m_participants.size() > 0) - { - delete(m_participants.back().second); - m_participants.pop_back(); - } - } - - // Deletes DynamicTypes and TypeObject factories - types::DynamicTypeBuilderFactory::delete_instance(); - types::DynamicDataFactory::delete_instance(); - types::TypeObjectFactory::delete_instance(); - XMLProfileManager::DeleteInstance(); - - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - eprosima::fastdds::dds::Log::KillThread(); -} - -bool Domain::removeParticipant( - Participant* part) -{ - if (part != nullptr) - { - std::lock_guard guard(m_mutex); - - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - //FOUND - delete(it->second); - m_participants.erase(it); - return true; - } - } - } - return false; -} - -bool Domain::removePublisher( - Publisher* pub) -{ - if (pub != nullptr) - { - std::lock_guard guard(m_mutex); - - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid().guidPrefix == pub->getGuid().guidPrefix) - { - //FOUND - return it->second->removePublisher(pub); - } - } - } - return false; -} - -bool Domain::removeSubscriber( - Subscriber* sub) -{ - if (sub != nullptr) - { - std::lock_guard guard(m_mutex); - - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid().guidPrefix == sub->getGuid().guidPrefix) - { - //FOUND - return it->second->removeSubscriber(sub); - } - } - } - return false; -} - -Participant* Domain::createParticipant( - const std::string& participant_profile, - ParticipantListener* listen) -{ - if (false == default_xml_profiles_loaded) - { - SystemInfo::set_environment_file(); - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - ParticipantAttributes participant_att; - if ( XMLP_ret::XML_ERROR == XMLProfileManager::fillParticipantAttributes(participant_profile, participant_att)) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Problem loading profile '" << participant_profile << "'"); - return nullptr; - } - - return createParticipant(participant_att, listen); -} - -Participant* Domain::createParticipant( - const eprosima::fastrtps::ParticipantAttributes& att, - ParticipantListener* listen) -{ - // If the user is not using XML and the environment variable is not set, this is going to be called always - if (!default_xml_profiles_loaded && SystemInfo::get_environment_file().empty()) - { - SystemInfo::set_environment_file(); - } - - Participant* pubsubpar = new Participant(); - ParticipantImpl* pspartimpl = new ParticipantImpl(att, pubsubpar, listen); - - // If DEFAULT_ROS2_MASTER_URI is specified then try to create default client if - // that already exists. - RTPSParticipant* part = RTPSDomainImpl::clientServerEnvironmentCreationOverride( - att.domainId, - false, - att.rtps, - &pspartimpl->m_rtps_listener); - - if (part == nullptr) - { - // Creation procedure without enable - part = RTPSDomain::createParticipant(att.domainId, false, att.rtps, &pspartimpl->m_rtps_listener); - } - - if (part == nullptr) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Problem creating RTPSParticipant"); - delete pspartimpl; - return nullptr; - } - - pspartimpl->mp_rtpsParticipant = part; - t_p_Participant pubsubpair; - pubsubpair.first = pubsubpar; - pubsubpair.second = pspartimpl; - - { - std::lock_guard guard(m_mutex); - m_participants.push_back(pubsubpair); - } - - // Enable participant - part->enable(); - - return pubsubpar; -} - -void Domain::getDefaultParticipantAttributes( - ParticipantAttributes& participant_attributes) -{ - if (false == default_xml_profiles_loaded) - { - SystemInfo::set_environment_file(); - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - return XMLProfileManager::getDefaultParticipantAttributes(participant_attributes); -} - -Publisher* Domain::createPublisher( - Participant* part, - const std::string& publisher_profile, - PublisherListener* listen) -{ - PublisherAttributes publisher_att; - if ( XMLP_ret::XML_ERROR == XMLProfileManager::fillPublisherAttributes(publisher_profile, publisher_att)) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Problem loading profile '" << publisher_profile << "'"); - return nullptr; - } - - return createPublisher(part, publisher_att, listen); -} - -Publisher* Domain::createPublisher( - Participant* part, - const PublisherAttributes& att, - PublisherListener* listen) -{ - std::lock_guard guard(m_mutex); - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - return part->mp_impl->createPublisher(att, listen); - } - } - //TODO MOSTRAR MENSAJE DE ERROR WARNING y COMPROBAR QUE EL PUNTERO QUE ME PASA NO ES NULL - return nullptr; -} - -void Domain::getDefaultPublisherAttributes( - PublisherAttributes& publisher_attributes) -{ - if (false == default_xml_profiles_loaded) - { - SystemInfo::set_environment_file(); - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - return XMLProfileManager::getDefaultPublisherAttributes(publisher_attributes); -} - -void Domain::getDefaultSubscriberAttributes( - SubscriberAttributes& subscriber_attributes) -{ - if (false == default_xml_profiles_loaded) - { - SystemInfo::set_environment_file(); - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - return XMLProfileManager::getDefaultSubscriberAttributes(subscriber_attributes); -} - -Subscriber* Domain::createSubscriber( - Participant* part, - const std::string& subscriber_profile, - SubscriberListener* listen) -{ - SubscriberAttributes subscriber_att; - if ( XMLP_ret::XML_ERROR == XMLProfileManager::fillSubscriberAttributes(subscriber_profile, subscriber_att)) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Problem loading profile '" << subscriber_profile << "'"); - return nullptr; - } - - return createSubscriber(part, subscriber_att, listen); -} - -Subscriber* Domain::createSubscriber( - Participant* part, - const SubscriberAttributes& att, - SubscriberListener* listen) -{ - std::lock_guard guard(m_mutex); - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - return part->mp_impl->createSubscriber(att, listen); - } - } - return nullptr; -} - -bool Domain::getRegisteredType( - Participant* part, - const char* typeName, - fastdds::dds::TopicDataType** type) -{ - std::lock_guard guard(m_mutex); - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - return part->mp_impl->getRegisteredType(typeName, type); - } - } - return false; -} - -bool Domain::registerType( - Participant* part, - fastdds::dds::TopicDataType* type) -{ - std::lock_guard guard(m_mutex); - //TODO El registro deberΓ­a hacerse de manera que no tengamos un objeto del usuario sino que tengamos un objeto TopicDataTYpe propio para que no - //haya problemas si el usuario lo destruye antes de tiempo. - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - return part->mp_impl->registerType(type); - } - } - return false; -} - -bool Domain::registerDynamicType( - Participant* part, - types::DynamicPubSubType* type) -{ - using namespace eprosima::fastrtps::types; - TypeObjectFactory* typeFactory = TypeObjectFactory::get_instance(); - - const TypeIdentifier* type_id_min = typeFactory->get_type_identifier(type->getName()); - - if (type_id_min == nullptr) - { - DynamicTypeBuilderFactory* dynFactory = DynamicTypeBuilderFactory::get_instance(); - std::map membersMap; - type->GetDynamicType()->get_all_members(membersMap); - std::vector members; - for (auto it : membersMap) - { - members.push_back(it.second->get_descriptor()); - } - TypeObject typeObj; - dynFactory->build_type_object(type->GetDynamicType()->get_type_descriptor(), typeObj, &members); - // Minimal too - dynFactory->build_type_object(type->GetDynamicType()->get_type_descriptor(), typeObj, &members, false); - const TypeIdentifier* type_id2 = typeFactory->get_type_identifier(type->getName()); - const TypeObject* type_obj = typeFactory->get_type_object(type->getName()); - if (type_id2 == nullptr) - { - EPROSIMA_LOG_ERROR(DYN_TYPES, "Cannot register dynamic type " << type->getName()); - } - else - { - typeFactory->add_type_object(type->getName(), type_id2, type_obj); - - // Complete, just to make sure it is generated - const TypeIdentifier* type_id_complete = typeFactory->get_type_identifier(type->getName(), true); - const TypeObject* type_obj_complete = typeFactory->get_type_object(type->getName(), true); - typeFactory->add_type_object(type->getName(), type_id_complete, type_obj_complete); // Add complete - } - } - return registerType(part, type); -} - -bool Domain::unregisterType( - Participant* part, - const char* typeName) -{ - //TODO El registro deberΓ­a hacerse de manera que no tengamos un objeto del usuario sino que tengamos un objeto TopicDataTYpe propio para que no - //haya problemas si el usuario lo destruye antes de tiempo. - std::lock_guard guard(m_mutex); - for (auto it = m_participants.begin(); it != m_participants.end(); ++it) - { - if (it->second->getGuid() == part->getGuid()) - { - return part->mp_impl->unregisterType(typeName); - } - } - return true; -} - -bool Domain::loadXMLProfilesFile( - const std::string& xml_profile_file) -{ - if (false == default_xml_profiles_loaded) - { - SystemInfo::set_environment_file(); - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - if ( XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLFile(xml_profile_file)) - { - EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML file '" << xml_profile_file << "'"); - return false; - } - return true; -} - -bool Domain::loadXMLProfilesString( - const char* data, - size_t length) -{ - if (false == default_xml_profiles_loaded) - { - XMLProfileManager::loadDefaultXMLFile(); - default_xml_profiles_loaded = true; - } - - if ( XMLP_ret::XML_ERROR == XMLProfileManager::loadXMLString(data, length)) - { - EPROSIMA_LOG_ERROR(DOMAIN, "Problem loading XML string"); - return false; - } - return true; -} - -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/fastrtps_deprecated/participant/Participant.cpp b/src/cpp/fastrtps_deprecated/participant/Participant.cpp deleted file mode 100644 index fcad54e90fa..00000000000 --- a/src/cpp/fastrtps_deprecated/participant/Participant.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Participant.cpp - * - */ - -#include - -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -Participant::Participant() - : mp_impl(nullptr) -{ -} - -Participant::~Participant() -{ - // TODO Auto-generated destructor stub -} - -const GUID_t& Participant::getGuid() const -{ - return mp_impl->getGuid(); -} - -const ParticipantAttributes& Participant::getAttributes() const -{ - return mp_impl->getAttributes(); -} - -bool Participant::newRemoteEndpointDiscovered( - const GUID_t& partguid, - uint16_t endpointId, - EndpointKind_t kind) -{ - return mp_impl->newRemoteEndpointDiscovered(partguid, endpointId, kind); -} - -std::vector Participant::getParticipantNames() const -{ - return mp_impl->getParticipantNames(); -} - -void Participant::assert_liveliness() -{ - mp_impl->assert_liveliness(); -} - -ResourceEvent& Participant::get_resource_event() const -{ - return mp_impl->get_resource_event(); -} diff --git a/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.cpp b/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.cpp deleted file mode 100644 index 33d865364aa..00000000000 --- a/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.cpp +++ /dev/null @@ -1,555 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ParticipantImpl.cpp - * - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -using eprosima::fastdds::dds::TopicDataType; - -ParticipantImpl::ParticipantImpl( - const ParticipantAttributes& patt, - Participant* pspart, - ParticipantListener* listen) - : m_att(patt) - , mp_rtpsParticipant(nullptr) - , mp_participant(pspart) - , mp_listener(listen) -#pragma warning (disable : 4355 ) - , m_rtps_listener(this) -{ - mp_participant->mp_impl = this; -} - -ParticipantImpl::~ParticipantImpl() -{ - while (m_publishers.size() > 0) - { - this->removePublisher(m_publishers.begin()->first); - } - while (m_subscribers.size() > 0) - { - this->removeSubscriber(m_subscribers.begin()->first); - } - - if (this->mp_rtpsParticipant != nullptr) - { - RTPSDomain::removeRTPSParticipant(this->mp_rtpsParticipant); - } - - delete(mp_participant); -} - -bool ParticipantImpl::removePublisher( - Publisher* pub) -{ - for (auto pit = this->m_publishers.begin(); pit != m_publishers.end(); ++pit) - { - if (pit->second->getGuid() == pub->getGuid()) - { - delete(pit->second); - m_publishers.erase(pit); - return true; - } - } - return false; -} - -bool ParticipantImpl::removeSubscriber( - Subscriber* sub) -{ - for (auto sit = m_subscribers.begin(); sit != m_subscribers.end(); ++sit) - { - if (sit->second->getGuid() == sub->getGuid()) - { - delete(sit->second); - m_subscribers.erase(sit); - return true; - } - } - return false; -} - -const GUID_t& ParticipantImpl::getGuid() const -{ - return this->mp_rtpsParticipant->getGuid(); -} - -Publisher* ParticipantImpl::createPublisher( - const PublisherAttributes& att, - PublisherListener* listen) -{ - EPROSIMA_LOG_INFO(PARTICIPANT, "CREATING PUBLISHER IN TOPIC: " << att.topic.getTopicName()); - //Look for the correct type registration - - TopicDataType* p_type = nullptr; - - /// Preconditions - // Check the type was registered. - if (!getRegisteredType(att.topic.getTopicDataType().c_str(), &p_type)) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Type : " << att.topic.getTopicDataType() << " Not Registered"); - return nullptr; - } - // Check the type supports keys. - if (att.topic.topicKind == WITH_KEY && !p_type->m_isGetKeyDefined) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Keyed Topic needs getKey function"); - return nullptr; - } - - if (m_att.rtps.builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol) - { - if (att.getUserDefinedID() <= 0) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Static EDP requires user defined Id"); - return nullptr; - } - } - if (!att.unicastLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Unicast Locator List for Publisher contains invalid Locator"); - return nullptr; - } - if (!att.multicastLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, " Multicast Locator List for Publisher contains invalid Locator"); - return nullptr; - } - if (!att.remoteLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Remote Locator List for Publisher contains invalid Locator"); - return nullptr; - } - if (!att.qos.checkQos() || !att.topic.checkQos()) - { - return nullptr; - } - - //TODO CONSTRUIR LA IMPLEMENTACION DENTRO DEL OBJETO DEL USUARIO. - PublisherImpl* pubimpl = new PublisherImpl(this, p_type, att, listen); - Publisher* pub = new Publisher(pubimpl); - pubimpl->mp_userPublisher = pub; - pubimpl->mp_rtpsParticipant = this->mp_rtpsParticipant; - - WriterAttributes watt; - watt.throughputController = att.throughputController; - watt.endpoint.durabilityKind = att.qos.m_durability.durabilityKind(); - watt.endpoint.endpointKind = WRITER; - watt.endpoint.multicastLocatorList = att.multicastLocatorList; - watt.endpoint.reliabilityKind = att.qos.m_reliability.kind == RELIABLE_RELIABILITY_QOS ? RELIABLE : BEST_EFFORT; - watt.endpoint.topicKind = att.topic.topicKind; - watt.endpoint.unicastLocatorList = att.unicastLocatorList; - watt.endpoint.remoteLocatorList = att.remoteLocatorList; - watt.mode = att.qos.m_publishMode.kind == - eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE ? SYNCHRONOUS_WRITER : ASYNCHRONOUS_WRITER; - watt.endpoint.properties = att.properties; - watt.flow_controller_name = att.qos.m_publishMode.flow_controller_name; - if (att.getEntityID() > 0) - { - watt.endpoint.setEntityID((uint8_t)att.getEntityID()); - } - if (att.getUserDefinedID() > 0) - { - watt.endpoint.setUserDefinedID((uint8_t)att.getUserDefinedID()); - } - watt.times = att.times; - watt.liveliness_kind = att.qos.m_liveliness.kind; - watt.liveliness_lease_duration = att.qos.m_liveliness.lease_duration; - watt.liveliness_announcement_period = att.qos.m_liveliness.announcement_period; - watt.matched_readers_allocation = att.matched_subscriber_allocation; - watt.disable_heartbeat_piggyback = att.qos.disable_heartbeat_piggyback; - - // TODO(Ricardo) Remove in future - // Insert topic_name and partitions - Property property; - property.name("topic_name"); - property.value(att.topic.getTopicName().c_str()); - watt.endpoint.properties.properties().push_back(std::move(property)); - if (att.qos.m_partition.names().size() > 0) - { - property.name("partitions"); - std::string partitions; - bool is_first_partition = true; - for (auto partition : att.qos.m_partition.names()) - { - partitions += (is_first_partition ? "" : ";") + partition; - is_first_partition = false; - } - property.value(std::move(partitions)); - watt.endpoint.properties.properties().push_back(std::move(property)); - } - if (att.qos.m_disablePositiveACKs.enabled && - att.qos.m_disablePositiveACKs.duration != c_TimeInfinite) - { - watt.disable_positive_acks = true; - watt.keep_duration = att.qos.m_disablePositiveACKs.duration; - } - - RTPSWriter* writer = RTPSDomain::createRTPSWriter( - this->mp_rtpsParticipant, - watt, pubimpl->payload_pool(), - (WriterHistory*)&pubimpl->m_history, - (WriterListener*)&pubimpl->m_writerListener); - if (writer == nullptr) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Problem creating associated Writer"); - delete(pubimpl); - return nullptr; - } - pubimpl->mp_writer = writer; - - // In case it has been loaded from the persistence DB, rebuild instances on history - pubimpl->m_history.rebuild_instances(); - if (att.qos.m_lifespan.duration != c_TimeInfinite) - { - if (pubimpl->lifespan_expired()) - { - pubimpl->lifespan_timer_->restart_timer(); - } - } - - //SAVE THE PUBLISHER PAIR - t_p_PublisherPair pubpair; - pubpair.first = pub; - pubpair.second = pubimpl; - m_publishers.push_back(pubpair); - - //REGISTER THE WRITER - this->mp_rtpsParticipant->registerWriter(writer, att.topic, att.qos); - - return pub; -} - -std::vector ParticipantImpl::getParticipantNames() const -{ - return mp_rtpsParticipant->getParticipantNames(); -} - -Subscriber* ParticipantImpl::createSubscriber( - const SubscriberAttributes& att, - SubscriberListener* listen) -{ - EPROSIMA_LOG_INFO(PARTICIPANT, "CREATING SUBSCRIBER IN TOPIC: " << att.topic.getTopicName()); - //Look for the correct type registration - - TopicDataType* p_type = nullptr; - - if (!getRegisteredType(att.topic.getTopicDataType().c_str(), &p_type)) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Type : " << att.topic.getTopicDataType() << " Not Registered"); - return nullptr; - } - if (att.topic.topicKind == WITH_KEY && !p_type->m_isGetKeyDefined) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Keyed Topic needs getKey function"); - return nullptr; - } - if (m_att.rtps.builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol) - { - if (att.getUserDefinedID() <= 0) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Static EDP requires user defined Id"); - return nullptr; - } - } - if (!att.unicastLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Unicast Locator List for Subscriber contains invalid Locator"); - return nullptr; - } - if (!att.multicastLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, " Multicast Locator List for Subscriber contains invalid Locator"); - return nullptr; - } - if (!att.remoteLocatorList.isValid()) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Output Locator List for Subscriber contains invalid Locator"); - return nullptr; - } - if (!att.qos.checkQos() || !att.topic.checkQos()) - { - return nullptr; - } - - SubscriberImpl* subimpl = new SubscriberImpl(this, p_type, att, listen); - Subscriber* sub = new Subscriber(subimpl); - subimpl->mp_userSubscriber = sub; - subimpl->mp_rtpsParticipant = this->mp_rtpsParticipant; - - ReaderAttributes ratt; - ratt.endpoint.durabilityKind = att.qos.m_durability.durabilityKind(); - ratt.endpoint.endpointKind = READER; - ratt.endpoint.multicastLocatorList = att.multicastLocatorList; - ratt.endpoint.reliabilityKind = att.qos.m_reliability.kind == RELIABLE_RELIABILITY_QOS ? RELIABLE : BEST_EFFORT; - ratt.endpoint.topicKind = att.topic.topicKind; - ratt.endpoint.unicastLocatorList = att.unicastLocatorList; - ratt.endpoint.remoteLocatorList = att.remoteLocatorList; - ratt.expectsInlineQos = att.expectsInlineQos; - ratt.endpoint.properties = att.properties; - if (att.getEntityID() > 0) - { - ratt.endpoint.setEntityID((uint8_t)att.getEntityID()); - } - if (att.getUserDefinedID() > 0) - { - ratt.endpoint.setUserDefinedID((uint8_t)att.getUserDefinedID()); - } - ratt.times = att.times; - ratt.matched_writers_allocation = att.matched_publisher_allocation; - ratt.liveliness_kind_ = att.qos.m_liveliness.kind; - ratt.liveliness_lease_duration = att.qos.m_liveliness.lease_duration; - - // TODO(Ricardo) Remove in future - // Insert topic_name and partitions - Property property; - property.name("topic_name"); - property.value(att.topic.getTopicName().c_str()); - ratt.endpoint.properties.properties().push_back(std::move(property)); - if (att.qos.m_partition.names().size() > 0) - { - property.name("partitions"); - std::string partitions; - bool is_first_partition = true; - for (auto partition : att.qos.m_partition.names()) - { - partitions += (is_first_partition ? "" : ";") + partition; - is_first_partition = false; - } - property.value(std::move(partitions)); - ratt.endpoint.properties.properties().push_back(std::move(property)); - } - if (att.qos.m_disablePositiveACKs.enabled) - { - ratt.disable_positive_acks = true; - } - - RTPSReader* reader = RTPSDomain::createRTPSReader(this->mp_rtpsParticipant, - ratt, subimpl->payload_pool(), - (ReaderHistory*)&subimpl->m_history, - (ReaderListener*)&subimpl->m_readerListener); - if (reader == nullptr) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Problem creating associated Reader"); - delete(subimpl); - return nullptr; - } - subimpl->mp_reader = reader; - //SAVE THE PUBLICHER PAIR - t_p_SubscriberPair subpair; - subpair.first = sub; - subpair.second = subimpl; - m_subscribers.push_back(subpair); - - //REGISTER THE READER - this->mp_rtpsParticipant->registerReader(reader, att.topic, att.qos); - - return sub; -} - -bool ParticipantImpl::getRegisteredType( - const char* typeName, - TopicDataType** type) -{ - for (std::vector::iterator it = m_types.begin(); - it != m_types.end(); ++it) - { - if (strcmp((*it)->getName(), typeName) == 0) - { - *type = *it; - return true; - } - } - return false; -} - -bool ParticipantImpl::registerType( - TopicDataType* type) -{ - if (type->m_typeSize <= 0) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have maximum byte size > 0"); - return false; - } - const char* name = type->getName(); - if (strlen(name) <= 0) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Registered Type must have a name"); - return false; - } - for (auto ty = m_types.begin(); ty != m_types.end(); ++ty) - { - if (strcmp((*ty)->getName(), type->getName()) == 0) - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Type with the same name already exists:" << type->getName()); - return false; - } - } - m_types.push_back(type); - EPROSIMA_LOG_INFO(PARTICIPANT, "Type " << type->getName() << " registered."); - return true; -} - -bool ParticipantImpl::unregisterType( - const char* typeName) -{ - bool retValue = false; - std::vector::iterator typeit; - - for (typeit = m_types.begin(); typeit != m_types.end(); ++typeit) - { - if (strcmp((*typeit)->getName(), typeName) == 0) - { - break; - } - } - - if (typeit != m_types.end()) - { - bool inUse = false; - - for (auto sit = m_subscribers.begin(); !inUse && sit != m_subscribers.end(); ++sit) - { - if (strcmp(sit->second->getType()->getName(), typeName) == 0) - { - inUse = true; - } - } - - for (auto pit = m_publishers.begin(); pit != m_publishers.end(); ++pit) - { - if (strcmp(pit->second->getType()->getName(), typeName) == 0) - { - inUse = true; - } - } - - if (!inUse) - { - m_types.erase(typeit); - retValue = true; - } - } - - return retValue; -} - -void ParticipantImpl::MyRTPSParticipantListener::onParticipantDiscovery( - RTPSParticipant*, - rtps::ParticipantDiscoveryInfo&& info) -{ - if (this->mp_participantimpl->mp_listener != nullptr) - { - this->mp_participantimpl->mp_listener->onParticipantDiscovery(mp_participantimpl->mp_participant, std::move( - info)); - } -} - -#if HAVE_SECURITY -void ParticipantImpl::MyRTPSParticipantListener::onParticipantAuthentication( - RTPSParticipant*, - ParticipantAuthenticationInfo&& info) -{ - if (this->mp_participantimpl->mp_listener != nullptr) - { - this->mp_participantimpl->mp_listener->onParticipantAuthentication(mp_participantimpl->mp_participant, std::move( - info)); - } -} - -#endif // if HAVE_SECURITY - -void ParticipantImpl::MyRTPSParticipantListener::onReaderDiscovery( - RTPSParticipant*, - rtps::ReaderDiscoveryInfo&& info) -{ - if (this->mp_participantimpl->mp_listener != nullptr) - { - this->mp_participantimpl->mp_listener->onSubscriberDiscovery(mp_participantimpl->mp_participant, - std::move(info)); - } -} - -void ParticipantImpl::MyRTPSParticipantListener::onWriterDiscovery( - RTPSParticipant*, - rtps::WriterDiscoveryInfo&& info) -{ - if (this->mp_participantimpl->mp_listener != nullptr) - { - this->mp_participantimpl->mp_listener->onPublisherDiscovery(mp_participantimpl->mp_participant, - std::move(info)); - } -} - -bool ParticipantImpl::newRemoteEndpointDiscovered( - const GUID_t& partguid, - uint16_t endpointId, - EndpointKind_t kind) -{ - if (kind == WRITER) - { - return this->mp_rtpsParticipant->newRemoteWriterDiscovered(partguid, endpointId); - } - else - { - return this->mp_rtpsParticipant->newRemoteReaderDiscovered(partguid, endpointId); - } -} - -ResourceEvent& ParticipantImpl::get_resource_event() const -{ - return mp_rtpsParticipant->get_resource_event(); -} - -void ParticipantImpl::assert_liveliness() -{ - if (mp_rtpsParticipant->wlp() != nullptr) - { - mp_rtpsParticipant->wlp()->assert_liveliness_manual_by_participant(); - } - else - { - EPROSIMA_LOG_ERROR(PARTICIPANT, "Invalid WLP, cannot assert liveliness of participant"); - } -} - -const Participant* ParticipantImpl::get_participant() const -{ - return mp_participant; -} diff --git a/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.h b/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.h deleted file mode 100644 index a0165ac0c75..00000000000 --- a/src/cpp/fastrtps_deprecated/participant/ParticipantImpl.h +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ParticipantImpl.h - * - */ - -#ifndef PARTICIPANTIMPL_H_ -#define PARTICIPANTIMPL_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include -#include -#include -#include - -namespace eprosima { - -namespace fastrtps { - -namespace rtps { -class RTPSParticipant; -class WriterProxyData; -class ReaderProxyData; -} // namespace rtps - - - -class Participant; -class ParticipantListener; - -class Publisher; -class PublisherImpl; -class PublisherAttributes; -class PublisherListener; -class Subscriber; -class SubscriberImpl; -class SubscriberAttributes; -class SubscriberListener; - - -/** - * This is the implementation class of the Participant. - * @ingroup FASTRTPS_MODULE - */ -class ParticipantImpl -{ - friend class Domain; - typedef std::pair t_p_PublisherPair; - typedef std::pair t_p_SubscriberPair; - typedef std::vector t_v_PublisherPairs; - typedef std::vector t_v_SubscriberPairs; - -private: - - ParticipantImpl( - const ParticipantAttributes& patt, - Participant* pspart, - ParticipantListener* listen = nullptr); - virtual ~ParticipantImpl(); - -public: - - /** - * Register a type in this participant. - * @param type Pointer to the TopicDatType. - * @return True if registered. - */ - bool registerType( - fastdds::dds::TopicDataType* type); - - /** - * Unregister a type in this participant. - * @param typeName Name of the type - * @return True if unregistered. - */ - bool unregisterType( - const char* typeName); - - /** - * Create a Publisher in this Participant. - * @param att Attributes of the Publisher. - * @param listen Pointer to the listener. - * @return Pointer to the created Publisher. - */ - Publisher* createPublisher( - const PublisherAttributes& att, - PublisherListener* listen = nullptr); - - /** - * Create a Subscriber in this Participant. - * @param att Attributes of the Subscriber - * @param listen Pointer to the listener. - * @return Pointer to the created Subscriber. - */ - Subscriber* createSubscriber( - const SubscriberAttributes& att, - SubscriberListener* listen = nullptr); - - /** - * Remove a Publisher from this participant. - * @param pub Pointer to the Publisher. - * @return True if correctly removed. - */ - bool removePublisher( - Publisher* pub); - - /** - * Remove a Subscriber from this participant. - * @param sub Pointer to the Subscriber. - * @return True if correctly removed. - */ - bool removeSubscriber( - Subscriber* sub); - - /** - * Get the GUID_t of the associated RTPSParticipant. - * @return GUID_t. - */ - const rtps::GUID_t& getGuid() const; - - /** - * Get the participant attributes - * @return Participant attributes - */ - inline const ParticipantAttributes& getAttributes() const - { - return m_att; - } - - std::pair getEDPReaders(); - - std::vector getParticipantNames() const; - - /** - * This method can be used when using a StaticEndpointDiscovery mechanism different that the one - * included in FastRTPS, for example when communicating with other implementations. - * It indicates the Participant that an Endpoint from the XML has been discovered and - * should be activated. - * @param partguid Participant GUID_t. - * @param userId User defined ID as shown in the XML file. - * @param kind EndpointKind (WRITER or READER) - * @return True if correctly found and activated. - */ - bool newRemoteEndpointDiscovered( - const rtps::GUID_t& partguid, - uint16_t userId, - rtps::EndpointKind_t kind); - - rtps::ResourceEvent& get_resource_event() const; - - /** - * @brief Asserts liveliness of manual by participant readers - */ - void assert_liveliness(); - - const Participant* get_participant() const; - - const rtps::RTPSParticipant* rtps_participant() const - { - return mp_rtpsParticipant; - } - - rtps::RTPSParticipant* rtps_participant() - { - return mp_rtpsParticipant; - } - -private: - - //!Participant Attributes - ParticipantAttributes m_att; - //!RTPSParticipant - rtps::RTPSParticipant* mp_rtpsParticipant; - //!Participant* - Participant* mp_participant; - //!Participant Listener - ParticipantListener* mp_listener; - //!Publisher Vector - t_v_PublisherPairs m_publishers; - //!Subscriber Vector - t_v_SubscriberPairs m_subscribers; - //!TOpicDatType vector - std::vector m_types; - - bool getRegisteredType( - const char* typeName, - fastdds::dds::TopicDataType** type); - - class MyRTPSParticipantListener : public rtps::RTPSParticipantListener - { - public: - - MyRTPSParticipantListener( - ParticipantImpl* impl) - : mp_participantimpl(impl) - { - } - - virtual ~MyRTPSParticipantListener() - { - } - - void onParticipantDiscovery( - rtps::RTPSParticipant* participant, - rtps::ParticipantDiscoveryInfo&& info) override; - -#if HAVE_SECURITY - void onParticipantAuthentication( - rtps::RTPSParticipant* participant, - rtps::ParticipantAuthenticationInfo&& info) override; -#endif // if HAVE_SECURITY - - void onReaderDiscovery( - rtps::RTPSParticipant* participant, - rtps::ReaderDiscoveryInfo&& info) override; - - void onWriterDiscovery( - rtps::RTPSParticipant* participant, - rtps::WriterDiscoveryInfo&& info) override; - - ParticipantImpl* mp_participantimpl; - - private: - - using rtps::RTPSParticipantListener::onParticipantDiscovery; - using rtps::RTPSParticipantListener::onReaderDiscovery; - using rtps::RTPSParticipantListener::onWriterDiscovery; - - } - m_rtps_listener; - -}; - -} /* namespace */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* PARTICIPANTIMPL_H_ */ diff --git a/src/cpp/fastrtps_deprecated/publisher/Publisher.cpp b/src/cpp/fastrtps_deprecated/publisher/Publisher.cpp deleted file mode 100644 index ba8b5fe877d..00000000000 --- a/src/cpp/fastrtps_deprecated/publisher/Publisher.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Publisher.cpp - * - */ - -#include -#include -#include - -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -Publisher::Publisher( - PublisherImpl* pimpl) - : mp_impl(pimpl) -{ - // TODO Auto-generated constructor stub -} - -Publisher::~Publisher() -{ - // TODO Auto-generated destructor stub -} - -bool Publisher::write( - void* Data) -{ - EPROSIMA_LOG_INFO(PUBLISHER, "Writing new data"); - return mp_impl->create_new_change(ALIVE, Data); -} - -bool Publisher::write( - void* Data, - WriteParams& wparams) -{ - EPROSIMA_LOG_INFO(PUBLISHER, "Writing new data with WriteParams"); - return mp_impl->create_new_change_with_params(ALIVE, Data, wparams); -} - -rtps::InstanceHandle_t Publisher::register_instance( - void* sample) -{ - return mp_impl->register_instance(sample); -} - -bool Publisher::dispose( - void* data, - const rtps::InstanceHandle_t& handle) -{ - EPROSIMA_LOG_INFO(PUBLISHER, "Disposing of Data"); - return mp_impl->unregister_instance(data, handle, true); -} - -bool Publisher::unregister_instance( - void* instance, - const rtps::InstanceHandle_t& handle) -{ - //Convert data to serialized Payload - return mp_impl->unregister_instance(instance, handle); -} - -bool Publisher::removeAllChange( - size_t* removed ) -{ - EPROSIMA_LOG_INFO(PUBLISHER, "Removing all data from history"); - return mp_impl->removeAllChange(removed); -} - -bool Publisher::wait_for_all_acked( - const eprosima::fastrtps::Duration_t& max_wait) -{ - EPROSIMA_LOG_INFO(PUBLISHER, "Waiting for all samples acknowledged"); - return mp_impl->wait_for_all_acked(max_wait); -} - -const GUID_t& Publisher::getGuid() -{ - return mp_impl->getGuid(); -} - -const PublisherAttributes& Publisher::getAttributes() const -{ - return mp_impl->getAttributes(); -} - -bool Publisher::updateAttributes( - const PublisherAttributes& att) -{ - return mp_impl->updateAttributes(att); -} - -void Publisher::get_offered_deadline_missed_status( - OfferedDeadlineMissedStatus& status) -{ - mp_impl->get_offered_deadline_missed_status(status); -} - -void Publisher::get_liveliness_lost_status( - LivelinessLostStatus& status) -{ - mp_impl->get_liveliness_lost_status(status); -} - -void Publisher::assert_liveliness() -{ - mp_impl->assert_liveliness(); -} - -void Publisher::get_sending_locators( - rtps::LocatorList_t& locators) const -{ - mp_impl->get_sending_locators(locators); -} diff --git a/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp b/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp deleted file mode 100644 index a29dd48ac9c..00000000000 --- a/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PublisherHistory.cpp - * - */ -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -using namespace rtps; - -static HistoryAttributes to_history_attributes( - const TopicAttributes& topic_att, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) -{ - auto initial_samples = topic_att.resourceLimitsQos.allocated_samples; - auto max_samples = topic_att.resourceLimitsQos.max_samples; - auto extra_samples = topic_att.resourceLimitsQos.extra_samples; - - if (topic_att.historyQos.kind != KEEP_ALL_HISTORY_QOS) - { - max_samples = topic_att.historyQos.depth; - if (topic_att.getTopicKind() != NO_KEY) - { - max_samples *= topic_att.resourceLimitsQos.max_instances; - } - - initial_samples = std::min(initial_samples, max_samples); - } - - return HistoryAttributes(mempolicy, payloadMaxSize, initial_samples, max_samples, extra_samples); -} - -PublisherHistory::PublisherHistory( - const TopicAttributes& topic_att, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) - : WriterHistory(to_history_attributes(topic_att, payloadMaxSize, mempolicy)) - , history_qos_(topic_att.historyQos) - , resource_limited_qos_(topic_att.resourceLimitsQos) - , topic_att_(topic_att) -{ - if (resource_limited_qos_.max_samples <= 0) - { - resource_limited_qos_.max_samples = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_instances <= 0) - { - resource_limited_qos_.max_instances = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_samples_per_instance <= 0) - { - resource_limited_qos_.max_samples_per_instance = std::numeric_limits::max(); - } -} - -PublisherHistory::~PublisherHistory() -{ -} - -void PublisherHistory::rebuild_instances() -{ - if (topic_att_.getTopicKind() == WITH_KEY) - { - for (CacheChange_t* change : m_changes) - { - t_m_Inst_Caches::iterator vit; - if (find_or_add_key(change->instanceHandle, &vit)) - { - vit->second.cache_changes.push_back(change); - } - } - } -} - -bool PublisherHistory::register_instance( - const InstanceHandle_t& instance_handle, - std::unique_lock&, - const std::chrono::time_point&) -{ - /// Preconditions - if (topic_att_.getTopicKind() == NO_KEY) - { - return false; - } - - t_m_Inst_Caches::iterator vit; - return find_or_add_key(instance_handle, &vit); -} - -bool PublisherHistory::prepare_change( - CacheChange_t* change, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time) -{ - if (m_isHistoryFull) - { - bool ret = false; - - if (history_qos_.kind == KEEP_ALL_HISTORY_QOS) - { - ret = this->mp_writer->try_remove_change(max_blocking_time, lock); - } - else if (history_qos_.kind == KEEP_LAST_HISTORY_QOS) - { - ret = this->remove_min_change(); - } - - if (!ret) - { - EPROSIMA_LOG_WARNING(RTPS_HISTORY, - "Attempting to add Data to Full WriterCache: " << topic_att_.getTopicDataType()); - return false; - } - } - - assert(!m_isHistoryFull); - - // For NO_KEY we can directly add the change - bool add = (topic_att_.getTopicKind() == NO_KEY); - if (topic_att_.getTopicKind() == WITH_KEY) - { - t_m_Inst_Caches::iterator vit; - - // For WITH_KEY, we take into account the limits on the instance - // In case we wait for a sequence to be acknowledged, we try several times - // until we reach the max blocking timepoint - while (!add) - { - // We should have the instance - if (!find_or_add_key(change->instanceHandle, &vit)) - { - break; - } - - if (history_qos_.kind == KEEP_LAST_HISTORY_QOS) - { - if (vit->second.cache_changes.size() < static_cast(history_qos_.depth)) - { - add = true; - } - else - { - add = remove_change_pub(vit->second.cache_changes.front()); - } - } - else if (history_qos_.kind == KEEP_ALL_HISTORY_QOS) - { - if (vit->second.cache_changes.size() < - static_cast(resource_limited_qos_.max_samples_per_instance)) - { - add = true; - } - else - { - SequenceNumber_t seq_to_remove = vit->second.cache_changes.front()->sequenceNumber; - if (!mp_writer->wait_for_acknowledgement(seq_to_remove, max_blocking_time, lock)) - { - // Timeout waiting. Will not add change to history. - break; - } - - // vit may have been invalidated - if (!find_or_add_key(change->instanceHandle, &vit)) - { - break; - } - - // If the change we were trying to remove was already removed, try again - if (vit->second.cache_changes.empty() || - vit->second.cache_changes.front()->sequenceNumber != seq_to_remove) - { - continue; - } - - // Remove change if still present - add = remove_change_pub(vit->second.cache_changes.front()); - } - } - } - - if (add) - { - vit->second.cache_changes.push_back(change); - } - } - - return add; -} - -bool PublisherHistory::add_pub_change( - CacheChange_t* change, - WriteParams& wparams, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time) -{ - bool returnedValue = false; - bool add = prepare_change(change, lock, max_blocking_time); - - if (add) - { -#if HAVE_STRICT_REALTIME - if (this->add_change_(change, wparams, max_blocking_time)) -#else - if (this->add_change_(change, wparams)) -#endif // if HAVE_STRICT_REALTIME - { - EPROSIMA_LOG_INFO(RTPS_HISTORY, - topic_att_.getTopicDataType() - << " Change " << change->sequenceNumber << " added with key: " << change->instanceHandle - << " and " << change->serializedPayload.length << " bytes"); - returnedValue = true; - } - } - - return returnedValue; -} - -bool PublisherHistory::find_or_add_key( - const InstanceHandle_t& instance_handle, - t_m_Inst_Caches::iterator* vit_out) -{ - t_m_Inst_Caches::iterator vit; - vit = keyed_changes_.find(instance_handle); - if (vit != keyed_changes_.end()) - { - *vit_out = vit; - return true; - } - - if (static_cast(keyed_changes_.size()) < resource_limited_qos_.max_instances) - { - *vit_out = keyed_changes_.insert(std::make_pair(instance_handle, KeyedChanges())).first; - return true; - } - - return false; -} - -bool PublisherHistory::removeAllChange( - size_t* removed) -{ - - size_t rem = 0; - std::lock_guard guard(*this->mp_mutex); - - while (m_changes.size() > 0) - { - if (remove_change_pub(m_changes.front())) - { - ++rem; - } - else - { - break; - } - } - if (removed != nullptr) - { - *removed = rem; - } - if (rem > 0) - { - return true; - } - return false; -} - -bool PublisherHistory::removeMinChange() -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - - std::lock_guard guard(*this->mp_mutex); - if (m_changes.size() > 0) - { - return remove_change_pub(m_changes.front()); - } - return false; -} - -bool PublisherHistory::remove_change_pub( - CacheChange_t* change) -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - - std::lock_guard guard(*this->mp_mutex); - if (topic_att_.getTopicKind() == NO_KEY) - { - if (remove_change(change)) - { - m_isHistoryFull = false; - return true; - } - - return false; - } - else - { - t_m_Inst_Caches::iterator vit; - if (!this->find_or_add_key(change->instanceHandle, &vit)) - { - return false; - } - - for (auto chit = vit->second.cache_changes.begin(); chit != vit->second.cache_changes.end(); ++chit) - { - if (((*chit)->sequenceNumber == change->sequenceNumber) && ((*chit)->writerGUID == change->writerGUID)) - { - if (remove_change(change)) - { - vit->second.cache_changes.erase(chit); - m_isHistoryFull = false; - return true; - } - } - } - EPROSIMA_LOG_ERROR(PUBLISHER, "Change not found, something is wrong"); - } - return false; -} - -bool PublisherHistory::remove_change_g( - CacheChange_t* a_change) -{ - return remove_change_pub(a_change); -} - -bool PublisherHistory::remove_change_g( - CacheChange_t* a_change, - const std::chrono::time_point&) -{ - return remove_change_pub(a_change); -} - -bool PublisherHistory::remove_instance_changes( - const rtps::InstanceHandle_t& handle, - const rtps::SequenceNumber_t& seq_up_to) -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - - if (topic_att_.getTopicKind() == NO_KEY) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "Cannot be removed instance changes of a NO_KEY DataType"); - return false; - } - - std::lock_guard guard(*this->mp_mutex); - t_m_Inst_Caches::iterator vit; - vit = keyed_changes_.find(handle); - if (vit == keyed_changes_.end()) - { - return false; - } - - auto chit = vit->second.cache_changes.begin(); - - for (; chit != vit->second.cache_changes.end() && (*chit)->sequenceNumber <= seq_up_to; ++chit) - { - if (remove_change(*chit)) - { - m_isHistoryFull = false; - } - } - - vit->second.cache_changes.erase(vit->second.cache_changes.begin(), chit); - - if (vit->second.cache_changes.empty()) - { - keyed_changes_.erase(vit); - } - - return true; -} - -bool PublisherHistory::set_next_deadline( - const InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us) -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - std::lock_guard guard(*this->mp_mutex); - - if (topic_att_.getTopicKind() == NO_KEY) - { - next_deadline_us_ = next_deadline_us; - return true; - } - else if (topic_att_.getTopicKind() == WITH_KEY) - { - if (keyed_changes_.find(handle) == keyed_changes_.end()) - { - return false; - } - - keyed_changes_[handle].next_deadline_us = next_deadline_us; - return true; - } - - return false; -} - -bool PublisherHistory::get_next_deadline( - InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us) -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - std::lock_guard guard(*this->mp_mutex); - - if (topic_att_.getTopicKind() == WITH_KEY) - { - auto min = std::min_element( - keyed_changes_.begin(), - keyed_changes_.end(), - []( - const std::pair& lhs, - const std::pair& rhs) - { - return lhs.second.next_deadline_us < rhs.second.next_deadline_us; - }); - - handle = min->first; - next_deadline_us = min->second.next_deadline_us; - return true; - } - else if (topic_att_.getTopicKind() == NO_KEY) - { - next_deadline_us = next_deadline_us_; - return true; - } - - return false; -} - -bool PublisherHistory::is_key_registered( - const InstanceHandle_t& handle) -{ - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - std::lock_guard guard(*this->mp_mutex); - t_m_Inst_Caches::iterator vit; - vit = keyed_changes_.find(handle); - return (vit != keyed_changes_.end() && - (vit->second.cache_changes.empty() || - (NOT_ALIVE_UNREGISTERED != vit->second.cache_changes.back()->kind && - NOT_ALIVE_DISPOSED_UNREGISTERED != vit->second.cache_changes.back()->kind - ) - ) - ); -} - -bool PublisherHistory::wait_for_acknowledgement_last_change( - const InstanceHandle_t& handle, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time) -{ - if (WITH_KEY == topic_att_.getTopicKind()) - { - // Find the instance - t_m_Inst_Caches::iterator vit = keyed_changes_.find(handle); - if (vit != keyed_changes_.end()) - { - SequenceNumber_t seq = vit->second.cache_changes.back()->sequenceNumber; - return mp_writer->wait_for_acknowledgement(seq, max_blocking_time, lock); - } - } - return false; -} - -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.cpp b/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.cpp deleted file mode 100644 index f4b17fb41bb..00000000000 --- a/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.cpp +++ /dev/null @@ -1,637 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - * Publisher.cpp - * - */ -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -using namespace eprosima::fastrtps; -using namespace ::rtps; -using namespace std::chrono; - -using eprosima::fastdds::dds::TopicDataType; - -PublisherImpl::PublisherImpl( - ParticipantImpl* p, - TopicDataType* pdatatype, - const PublisherAttributes& att, - PublisherListener* listen ) - : mp_participant(p) - , mp_writer(nullptr) - , mp_type(pdatatype) - , m_att(att) -#pragma warning (disable : 4355 ) - , m_history(att.topic, - pdatatype->m_typeSize -#if HAVE_SECURITY - // In future v2 changepool is in writer, and writer set this value to cachechagepool. - + 20 /*SecureDataHeader*/ + 4 + ((2 * 16) /*EVP_MAX_IV_LENGTH max block size*/ - 1 ) /* SecureDataBodey*/ - + 16 + 4 /*SecureDataTag*/ -#endif // if HAVE_SECURITY - , att.historyMemoryPolicy) - , mp_listener(listen) -#pragma warning (disable : 4355 ) - , m_writerListener(this) - , mp_userPublisher(nullptr) - , mp_rtpsParticipant(nullptr) - , deadline_duration_us_(m_att.qos.m_deadline.period.to_ns() * 1e-3) - , timer_owner_() - , deadline_missed_status_() - , lifespan_duration_us_(m_att.qos.m_lifespan.duration.to_ns() * 1e-3) -{ - std::string topic_name = m_att.topic.getTopicName().to_string(); - PoolConfig pool_cfg = PoolConfig::from_history_attributes(m_history.m_att); - payload_pool_ = TopicPayloadPoolRegistry::get(topic_name, pool_cfg); - payload_pool_->reserve_history(pool_cfg, false); - - deadline_timer_ = new TimedEvent(mp_participant->get_resource_event(), - [&]() -> bool - { - return deadline_missed(); - }, - att.qos.m_deadline.period.to_ns() * 1e-6); - - lifespan_timer_ = new TimedEvent(mp_participant->get_resource_event(), - [&]() -> bool - { - return lifespan_expired(); - }, - m_att.qos.m_lifespan.duration.to_ns() * 1e-6); -} - -PublisherImpl::~PublisherImpl() -{ - delete(lifespan_timer_); - delete(deadline_timer_); - - if (mp_writer != nullptr) - { - EPROSIMA_LOG_INFO(PUBLISHER, this->getGuid().entityId << " in topic: " << this->m_att.topic.topicName); - } - - RTPSDomain::removeRTPSWriter(mp_writer); - delete(this->mp_userPublisher); - - std::string topic_name = m_att.topic.getTopicName().to_string(); - PoolConfig pool_cfg = PoolConfig::from_history_attributes(m_history.m_att); - payload_pool_->release_history(pool_cfg, false); -} - -bool PublisherImpl::create_new_change( - ChangeKind_t changeKind, - void* data) -{ - WriteParams wparams; - return create_new_change_with_params(changeKind, data, wparams); -} - -bool PublisherImpl::create_new_change_with_params( - ChangeKind_t changeKind, - void* data, - WriteParams& wparams) -{ - InstanceHandle_t handle; - if (m_att.topic.topicKind == WITH_KEY) - { - bool is_key_protected = false; -#if HAVE_SECURITY - is_key_protected = mp_writer->getAttributes().security_attributes().is_key_protected; -#endif // if HAVE_SECURITY - mp_type->getKey(data, &handle, is_key_protected); - } - - return create_new_change_with_params(changeKind, data, wparams, handle); -} - -bool PublisherImpl::create_new_change_with_params( - ChangeKind_t changeKind, - void* data, - WriteParams& wparams, - const InstanceHandle_t& handle) -{ - /// Preconditions - if (data == nullptr) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Data pointer not valid"); - return false; - } - - if (changeKind == NOT_ALIVE_UNREGISTERED || changeKind == NOT_ALIVE_DISPOSED || - changeKind == NOT_ALIVE_DISPOSED_UNREGISTERED) - { - if (m_att.topic.topicKind == NO_KEY) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Topic is NO_KEY, operation not permitted"); - return false; - } - } - - // Block lowlevel writer - auto max_blocking_time = steady_clock::now() + - microseconds(::TimeConv::Time_t2MicroSecondsInt64(m_att.qos.m_reliability.max_blocking_time)); - -#if HAVE_STRICT_REALTIME - std::unique_lock lock(mp_writer->getMutex(), std::defer_lock); - if (lock.try_lock_until(max_blocking_time)) -#else - std::unique_lock lock(mp_writer->getMutex()); -#endif // if HAVE_STRICT_REALTIME - { - CacheChange_t* ch = mp_writer->new_change(mp_type->getSerializedSizeProvider(data), changeKind, handle); - if (ch != nullptr) - { - if (changeKind == ALIVE) - { - //If these two checks are correct, we asume the cachechange is valid and thwn we can write to it. - if (!mp_type->serialize(data, &ch->serializedPayload)) - { - EPROSIMA_LOG_WARNING(RTPS_WRITER, "RTPSWriter:Serialization returns false"; ); - mp_writer->release_change(ch); - return false; - } - } - - InstanceHandle_t change_handle = ch->instanceHandle; - if (!this->m_history.add_pub_change(ch, wparams, lock, max_blocking_time)) - { - mp_writer->release_change(ch); - return false; - } - - if (m_att.qos.m_deadline.period != c_TimeInfinite) - { - if (!m_history.set_next_deadline( - change_handle, - steady_clock::now() + duration_cast(deadline_duration_us_))) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Could not set the next deadline in the history"); - } - else - { - if (timer_owner_ == handle || timer_owner_ == InstanceHandle_t()) - { - if (deadline_timer_reschedule()) - { - deadline_timer_->cancel_timer(); - deadline_timer_->restart_timer(); - } - } - } - } - - if (m_att.qos.m_lifespan.duration != c_TimeInfinite) - { - lifespan_duration_us_ = duration>( - m_att.qos.m_lifespan.duration.to_ns() * 1e-3); - lifespan_timer_->update_interval_millisec(m_att.qos.m_lifespan.duration.to_ns() * 1e-6); - lifespan_timer_->restart_timer(); - } - - return true; - } - } - - return false; -} - -InstanceHandle_t PublisherImpl::register_instance( - void* instance) -{ - /// Preconditions - if (instance == nullptr) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Data pointer not valid"); - return c_InstanceHandle_Unknown; - } - - if (m_att.topic.topicKind == NO_KEY) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Topic is NO_KEY, operation not permitted"); - return c_InstanceHandle_Unknown; - } - - InstanceHandle_t instance_handle = c_InstanceHandle_Unknown; - bool is_key_protected = false; -#if HAVE_SECURITY - is_key_protected = mp_writer->getAttributes().security_attributes().is_key_protected; -#endif // if HAVE_SECURITY - mp_type->getKey(instance, &instance_handle, is_key_protected); - - // Block lowlevel writer - auto max_blocking_time = std::chrono::steady_clock::now() + - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(m_att.qos.m_reliability.max_blocking_time)); - -#if HAVE_STRICT_REALTIME - std::unique_lock lock(mp_writer->getMutex(), std::defer_lock); - if (lock.try_lock_until(max_blocking_time)) -#else - std::unique_lock lock(mp_writer->getMutex()); -#endif // if HAVE_STRICT_REALTIME - { - if (m_history.register_instance(instance_handle, lock, max_blocking_time)) - { - return instance_handle; - } - } - - return c_InstanceHandle_Unknown; -} - -bool PublisherImpl::unregister_instance( - void* instance, - const InstanceHandle_t& handle, - bool dispose) -{ - /// Preconditions - if (instance == nullptr) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Data pointer not valid"); - return false; - } - - if (m_att.topic.topicKind == NO_KEY) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Topic is NO_KEY, operation not permitted"); - return false; - } - - bool returned_value = false; - InstanceHandle_t ih = handle; - -#if !defined(NDEBUG) - if (c_InstanceHandle_Unknown == ih) -#endif // if !defined(NDEBUG) - { - bool is_key_protected = false; -#if HAVE_SECURITY - is_key_protected = mp_writer->getAttributes().security_attributes().is_key_protected; -#endif // if HAVE_SECURITY - mp_type->getKey(instance, &ih, is_key_protected); - } - -#if !defined(NDEBUG) - if (c_InstanceHandle_Unknown != handle && ih != handle) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "handle differs from data's key."); - return false; - } -#endif // if !defined(NDEBUG) - - if (m_history.is_key_registered(ih)) - { - WriteParams wparams; - ChangeKind_t change_kind = dispose ? NOT_ALIVE_DISPOSED : NOT_ALIVE_UNREGISTERED; - returned_value = create_new_change_with_params(change_kind, instance, wparams, ih); - } - - return returned_value; -} - -bool PublisherImpl::removeMinSeqChange() -{ - return m_history.removeMinChange(); -} - -bool PublisherImpl::removeAllChange( - size_t* removed) -{ - return m_history.removeAllChange(removed); -} - -const GUID_t& PublisherImpl::getGuid() -{ - return mp_writer->getGuid(); -} - -// -bool PublisherImpl::updateAttributes( - const PublisherAttributes& att) -{ - bool updated = true; - bool missing = false; - if (this->m_att.qos.m_reliability.kind == RELIABLE_RELIABILITY_QOS) - { - if (att.unicastLocatorList.size() != this->m_att.unicastLocatorList.size() || - att.multicastLocatorList.size() != this->m_att.multicastLocatorList.size()) - { - EPROSIMA_LOG_WARNING(PUBLISHER, "Locator Lists cannot be changed or updated in this version"); - updated &= false; - } - else - { - for (LocatorListConstIterator lit1 = this->m_att.unicastLocatorList.begin(); - lit1 != this->m_att.unicastLocatorList.end(); ++lit1) - { - missing = true; - for (LocatorListConstIterator lit2 = att.unicastLocatorList.begin(); - lit2 != att.unicastLocatorList.end(); ++lit2) - { - if (*lit1 == *lit2) - { - missing = false; - break; - } - } - if (missing) - { - EPROSIMA_LOG_WARNING(PUBLISHER, "Locator: " << *lit1 << " not present in new list"); - EPROSIMA_LOG_WARNING(PUBLISHER, "Locator Lists cannot be changed or updated in this version"); - } - } - for (LocatorListConstIterator lit1 = this->m_att.multicastLocatorList.begin(); - lit1 != this->m_att.multicastLocatorList.end(); ++lit1) - { - missing = true; - for (LocatorListConstIterator lit2 = att.multicastLocatorList.begin(); - lit2 != att.multicastLocatorList.end(); ++lit2) - { - if (*lit1 == *lit2) - { - missing = false; - break; - } - } - if (missing) - { - EPROSIMA_LOG_WARNING(PUBLISHER, "Locator: " << *lit1 << " not present in new list"); - EPROSIMA_LOG_WARNING(PUBLISHER, "Locator Lists cannot be changed or updated in this version"); - } - } - } - } - - //TOPIC ATTRIBUTES - if (this->m_att.topic != att.topic) - { - EPROSIMA_LOG_WARNING(PUBLISHER, "Topic Attributes cannot be updated"); - updated &= false; - } - //QOS: - //CHECK IF THE QOS CAN BE SET - if (!this->m_att.qos.canQosBeUpdated(att.qos)) - { - updated &= false; - } - if (updated) - { - if (this->m_att.qos.m_reliability.kind == RELIABLE_RELIABILITY_QOS) - { - //UPDATE TIMES: - StatefulWriter* sfw = (StatefulWriter*)mp_writer; - sfw->updateTimes(att.times); - } - - this->m_att.qos.setQos(att.qos, false); - this->m_att = att; - //Notify the participant that a Writer has changed its QOS - mp_rtpsParticipant->updateWriter(this->mp_writer, m_att.topic, m_att.qos); - - // Deadline - - if (m_att.qos.m_deadline.period != c_TimeInfinite) - { - deadline_duration_us_ = - duration>(m_att.qos.m_deadline.period.to_ns() * 1e-3); - deadline_timer_->update_interval_millisec(m_att.qos.m_deadline.period.to_ns() * 1e-6); - } - else - { - deadline_timer_->cancel_timer(); - } - - // Lifespan - - if (m_att.qos.m_lifespan.duration != c_TimeInfinite) - { - lifespan_duration_us_ = - duration>(m_att.qos.m_lifespan.duration.to_ns() * 1e-3); - lifespan_timer_->update_interval_millisec(m_att.qos.m_lifespan.duration.to_ns() * 1e-6); - } - else - { - lifespan_timer_->cancel_timer(); - } - } - - return updated; -} - -void PublisherImpl::PublisherWriterListener::onWriterMatched( - RTPSWriter* /*writer*/, - MatchingInfo& info) -{ - if ( mp_publisherImpl->mp_listener != nullptr ) - { - mp_publisherImpl->mp_listener->onPublicationMatched(mp_publisherImpl->mp_userPublisher, info); - } -} - -void PublisherImpl::PublisherWriterListener::onWriterChangeReceivedByAll( - RTPSWriter* /*writer*/, - CacheChange_t* ch) -{ - if (mp_publisherImpl->m_att.topic.topicKind == WITH_KEY && - (NOT_ALIVE_UNREGISTERED == ch->kind || - NOT_ALIVE_DISPOSED_UNREGISTERED == ch->kind)) - { - mp_publisherImpl->m_history.remove_instance_changes(ch->instanceHandle, ch->sequenceNumber); - } - else if (mp_publisherImpl->m_att.qos.m_durability.kind == VOLATILE_DURABILITY_QOS) - { - mp_publisherImpl->m_history.remove_change_g(ch); - } -} - -void PublisherImpl::PublisherWriterListener::on_liveliness_lost( - RTPSWriter* writer, - const LivelinessLostStatus& status) -{ - (void)writer; - - if (mp_publisherImpl->mp_listener != nullptr) - { - mp_publisherImpl->mp_listener->on_liveliness_lost( - mp_publisherImpl->mp_userPublisher, - status); - } -} - -bool PublisherImpl::wait_for_all_acked( - const eprosima::fastrtps::Duration_t& max_wait) -{ - return mp_writer->wait_for_all_acked(max_wait); -} - -bool PublisherImpl::deadline_timer_reschedule() -{ - assert(m_att.qos.m_deadline.period != c_TimeInfinite); - - std::unique_lock lock(mp_writer->getMutex()); - - steady_clock::time_point next_deadline_us; - if (!m_history.get_next_deadline(timer_owner_, next_deadline_us)) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Could not get the next deadline from the history"); - return false; - } - - auto interval_ms = duration_cast(next_deadline_us - steady_clock::now()); - deadline_timer_->update_interval_millisec((double)interval_ms.count()); - return true; - -} - -bool PublisherImpl::deadline_missed() -{ - assert(m_att.qos.m_deadline.period != c_TimeInfinite); - - std::unique_lock lock(mp_writer->getMutex()); - - deadline_missed_status_.total_count++; - deadline_missed_status_.total_count_change++; - deadline_missed_status_.last_instance_handle = timer_owner_; - mp_listener->on_offered_deadline_missed(mp_userPublisher, deadline_missed_status_); - deadline_missed_status_.total_count_change = 0; - - if (!m_history.set_next_deadline( - timer_owner_, - steady_clock::now() + duration_cast(deadline_duration_us_))) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Could not set the next deadline in the history"); - return false; - } - - return deadline_timer_reschedule(); -} - -void PublisherImpl::get_offered_deadline_missed_status( - OfferedDeadlineMissedStatus& status) -{ - std::unique_lock lock(mp_writer->getMutex()); - - status = deadline_missed_status_; - deadline_missed_status_.total_count_change = 0; -} - -bool PublisherImpl::lifespan_expired() -{ - std::unique_lock lock(mp_writer->getMutex()); - - CacheChange_t* earliest_change; - while (m_history.get_earliest_change(&earliest_change)) - { - auto source_timestamp = system_clock::time_point() + nanoseconds(earliest_change->sourceTimestamp.to_ns()); - auto now = system_clock::now(); - - // Check that the earliest change has expired (the change which started the timer could have been removed from the history) - if (now - source_timestamp < lifespan_duration_us_) - { - auto interval = source_timestamp - now + lifespan_duration_us_; - lifespan_timer_->update_interval_millisec((double)duration_cast(interval).count()); - return true; - } - - // The earliest change has expired - m_history.remove_change_pub(earliest_change); - - // Set the timer for the next change if there is one - if (!m_history.get_earliest_change(&earliest_change)) - { - return false; - } - - // Calculate when the next change is due to expire and restart - source_timestamp = system_clock::time_point() + nanoseconds(earliest_change->sourceTimestamp.to_ns()); - now = system_clock::now(); - auto interval = source_timestamp - now + lifespan_duration_us_; - - if (interval.count() > 0) - { - lifespan_timer_->update_interval_millisec((double)duration_cast(interval).count()); - return true; - } - } - - return false; -} - -void PublisherImpl::get_liveliness_lost_status( - LivelinessLostStatus& status) -{ - std::unique_lock lock(mp_writer->getMutex()); - - status = mp_writer->liveliness_lost_status_; - - mp_writer->liveliness_lost_status_.total_count_change = 0u; -} - -void PublisherImpl::assert_liveliness() -{ - if (!mp_rtpsParticipant->wlp()->assert_liveliness( - mp_writer->getGuid(), - mp_writer->get_liveliness_kind(), - mp_writer->get_liveliness_lease_duration())) - { - EPROSIMA_LOG_ERROR(PUBLISHER, "Could not assert liveliness of writer " << mp_writer->getGuid()); - } - - if (m_att.qos.m_liveliness.kind == MANUAL_BY_TOPIC_LIVELINESS_QOS) - { - // As described in the RTPS specification, if liveliness kind is manual a heartbeat must be sent - // This only applies to stateful writers, as stateless writers do not send heartbeats - - StatefulWriter* stateful_writer = dynamic_cast(mp_writer); - - if (stateful_writer != nullptr) - { - stateful_writer->send_periodic_heartbeat(true, true); - } - } -} - -void PublisherImpl::get_sending_locators( - rtps::LocatorList_t& locators) const -{ - mp_writer->getRTPSParticipant()->get_sending_locators(locators); -} - -std::shared_ptr PublisherImpl::payload_pool() -{ - return payload_pool_; -} diff --git a/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.h b/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.h deleted file mode 100644 index ca0db2822b0..00000000000 --- a/src/cpp/fastrtps_deprecated/publisher/PublisherImpl.h +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file Publisher.h - */ - - - -#ifndef PUBLISHERIMPL_H_ -#define PUBLISHERIMPL_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include - -#include - -#include -#include - -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { -class RTPSWriter; -class RTPSParticipant; -class TimedEvent; -} // namespace rtps - -class PublisherListener; -class ParticipantImpl; -class Participant; -class Publisher; - - -/** - * Class PublisherImpl, contains the actual implementation of the behaviour of the Publisher. - * @ingroup FASTRTPS_MODULE - */ -class PublisherImpl -{ - friend class ParticipantImpl; - -public: - - /** - * Create a publisher, assigning its pointer to the associated writer. - * Don't use directly, create Publisher using DomainRTPSParticipant static function. - */ - PublisherImpl( - ParticipantImpl* p, - fastdds::dds::TopicDataType* ptype, - const PublisherAttributes& att, - PublisherListener* p_listen = nullptr); - - virtual ~PublisherImpl(); - - /** - * - * @param kind - * @param Data - * @return - */ - bool create_new_change( - rtps::ChangeKind_t kind, - void* Data); - - /** - * - * @param kind - * @param Data - * @param wparams - * @return - */ - bool create_new_change_with_params( - rtps::ChangeKind_t kind, - void* Data, - rtps::WriteParams& wparams); - - bool create_new_change_with_params( - rtps::ChangeKind_t kind, - void* Data, - rtps::WriteParams& wparams, - const rtps::InstanceHandle_t& handle); - - /*! - * @brief Implementation of the DDS `register_instance` operation. - * It deduces the instance's key and tries to get resources in the PublisherHistory. - * @param[in] instance Sample used to get the instance's key. - * @return Handle containing the instance's key. - * This handle could be used in successive `write` or `dispose` operations. - * In case of error, HANDLE_NIL will be returned. - */ - rtps::InstanceHandle_t register_instance( - void* instance); - - /*! - * @brief Implementation of the DDS `register_instance` and `dispose` operations. - * It sends a CacheChange_t with the king to NOT_ALIVE_UNREGISTERED or NOT_ALIVE_DISPOSED, - * depending on the `dispose` parameter. - * @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. - * @param[in] handle Instance's key to be unregistered or disposed. - * @param[in] dispose If it is `false`, a CacheChange_t with kind to NOT_ALIVE_UNREGISTERED is sent. - * If it is `true`, a CacheChange_t with kind to NOT_ALIVE_DISPOSED is sent. - * @return Returns the operation's result. - * If the operation finishes successfully, `true` is returned. - */ - bool unregister_instance( - void* instance, - const rtps::InstanceHandle_t& handle, - bool dispose = false); - - /** - * Removes the cache change with the minimum sequence number - * @return True if correct. - */ - bool removeMinSeqChange(); - /** - * Removes all changes from the History. - * @param[out] removed Number of removed elements - * @return True if correct. - */ - bool removeAllChange( - size_t* removed); - - /** - * - * @return - */ - const rtps::GUID_t& getGuid(); - - /** - * Update the Attributes of the publisher; - * @param att Reference to a PublisherAttributes object to update the parameters; - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated - */ - bool updateAttributes( - const PublisherAttributes& att); - - /** - * Get the Attributes of the Subscriber. - * @return Attributes of the Subscriber. - */ - inline const PublisherAttributes& getAttributes() - { - return m_att; - } - - /** - * Get topic data type - * @return Topic data type - */ - fastdds::dds::TopicDataType* getType() - { - return mp_type; - } - - bool wait_for_all_acked( - const Duration_t& max_wait); - - /** - * @brief Returns the offered deadline missed status - * @param Deadline missed status struct - */ - void get_offered_deadline_missed_status( - OfferedDeadlineMissedStatus& status); - - /** - * @brief Returns the liveliness lost status - * @param status Liveliness lost status - */ - void get_liveliness_lost_status( - LivelinessLostStatus& status); - - /** - * @brief Asserts liveliness - */ - void assert_liveliness(); - - /** - * Get the list of locators from which this publisher may send data. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_sending_locators( - rtps::LocatorList_t& locators) const; - - std::shared_ptr payload_pool(); - -private: - - ParticipantImpl* mp_participant; - //! Pointer to the associated Data Writer. - rtps::RTPSWriter* mp_writer; - //! Pointer to the TopicDataType object. - fastdds::dds::TopicDataType* mp_type; - //!Attributes of the Publisher - PublisherAttributes m_att; - //!Publisher History - PublisherHistory m_history; - //!PublisherListener - PublisherListener* mp_listener; - //!Listener to capture the events of the Writer - class PublisherWriterListener : public rtps::WriterListener - { - public: - - PublisherWriterListener( - PublisherImpl* p) - : mp_publisherImpl(p) - { - } - - virtual ~PublisherWriterListener() - { - } - - void onWriterMatched( - rtps::RTPSWriter* writer, - rtps::MatchingInfo& info) override; - void onWriterChangeReceivedByAll( - rtps::RTPSWriter* writer, - rtps::CacheChange_t* change) override; - void on_liveliness_lost( - rtps::RTPSWriter* writer, - const LivelinessLostStatus& status) override; - - PublisherImpl* mp_publisherImpl; - - private: - - using rtps::WriterListener::onWriterMatched; - } - m_writerListener; - - Publisher* mp_userPublisher; - - rtps::RTPSParticipant* mp_rtpsParticipant; - - //! A timer used to check for deadlines - rtps::TimedEvent* deadline_timer_; - //! Deadline duration in microseconds - std::chrono::duration> deadline_duration_us_; - //! The current timer owner, i.e. the instance which started the deadline timer - rtps::InstanceHandle_t timer_owner_; - //! The offered deadline missed status - OfferedDeadlineMissedStatus deadline_missed_status_; - - //! A timed callback to remove expired samples for lifespan QoS - rtps::TimedEvent* lifespan_timer_; - //! The lifespan duration, in microseconds - std::chrono::duration> lifespan_duration_us_; - - std::shared_ptr payload_pool_; - - /** - * @brief A method called when an instance misses the deadline - */ - bool deadline_missed(); - - /** - * @brief A method to reschedule the deadline timer - * @return true value when the event has to be rescheduled. false value if not. - */ - bool deadline_timer_reschedule(); - - /** - * @brief A method to remove expired samples, invoked when the lifespan timer expires - * @return true value when the event has to be rescheduled. false value if not. - */ - bool lifespan_expired(); -}; - - -} // namespace fastrtps -} // namespace eprosima - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* PUBLISHERIMPL_H_ */ diff --git a/src/cpp/fastrtps_deprecated/subscriber/Subscriber.cpp b/src/cpp/fastrtps_deprecated/subscriber/Subscriber.cpp deleted file mode 100644 index d4d738d2991..00000000000 --- a/src/cpp/fastrtps_deprecated/subscriber/Subscriber.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - * Subscriber.cpp - * - */ - -#include -#include - -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -const GUID_t& Subscriber::getGuid() -{ - return mp_impl->getGuid(); -} - -bool Subscriber::wait_for_unread_samples( - const Duration_t& timeout) -{ - return mp_impl->wait_for_unread_samples(timeout); -} - -bool Subscriber::readNextData( - void* data, - SampleInfo_t* info) -{ - return mp_impl->readNextData(data, info); -} - -bool Subscriber::takeNextData( - void* data, - SampleInfo_t* info) -{ - return mp_impl->takeNextData(data, info); -} - -bool Subscriber::get_first_untaken_info( - SampleInfo_t* info) -{ - return mp_impl->get_first_untaken_info(info); -} - -bool Subscriber::updateAttributes( - const SubscriberAttributes& att) -{ - return mp_impl->updateAttributes(att); -} - -const SubscriberAttributes& Subscriber::getAttributes() const -{ - return mp_impl->getAttributes(); -} - -bool Subscriber::isInCleanState() const -{ - return mp_impl->isInCleanState(); -} - -uint64_t Subscriber::get_unread_count() const -{ - return mp_impl->get_unread_count(); -} - -void Subscriber::get_requested_deadline_missed_status( - RequestedDeadlineMissedStatus& status) -{ - mp_impl->get_requested_deadline_missed_status(status); -} - -void Subscriber::get_liveliness_changed_status( - LivelinessChangedStatus& status) -{ - mp_impl->get_liveliness_changed_status(status); -} - -void Subscriber::get_listening_locators( - rtps::LocatorList_t& locators) const -{ - assert(mp_impl != nullptr); - mp_impl->get_listening_locators(locators); -} diff --git a/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp b/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp deleted file mode 100644 index 6cc37ed0269..00000000000 --- a/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp +++ /dev/null @@ -1,835 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberHistory.cpp - * - */ - -#include - -#include -#include - -#include -#include - -#include - -#include - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -using namespace rtps; - -using eprosima::fastdds::dds::TopicDataType; - -static void get_sample_info( - SampleInfo_t* info, - CacheChange_t* change, - uint32_t ownership_strength) -{ - info->sampleKind = change->kind; - info->sample_identity.writer_guid(change->writerGUID); - info->sample_identity.sequence_number(change->sequenceNumber); - info->sourceTimestamp = change->sourceTimestamp; - info->receptionTimestamp = change->reader_info.receptionTimestamp; - info->ownershipStrength = ownership_strength; - info->iHandle = change->instanceHandle; - info->related_sample_identity = change->write_params.sample_identity(); -} - -static HistoryAttributes to_history_attributes( - const TopicAttributes& topic_att, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) -{ - auto initial_samples = topic_att.resourceLimitsQos.allocated_samples; - auto max_samples = topic_att.resourceLimitsQos.max_samples; - - if (topic_att.historyQos.kind != KEEP_ALL_HISTORY_QOS) - { - max_samples = topic_att.historyQos.depth; - if (topic_att.getTopicKind() != NO_KEY) - { - max_samples *= topic_att.resourceLimitsQos.max_instances; - } - - initial_samples = std::min(initial_samples, max_samples); - } - - return HistoryAttributes(mempolicy, payloadMaxSize, initial_samples, max_samples); -} - -SubscriberHistory::SubscriberHistory( - const TopicAttributes& topic_att, - TopicDataType* type, - const ReaderQos& qos, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) - : ReaderHistory(to_history_attributes(topic_att, payloadMaxSize, mempolicy)) - , history_qos_(topic_att.historyQos) - , resource_limited_qos_(topic_att.resourceLimitsQos) - , topic_att_(topic_att) - , type_(type) - , qos_(qos) - , get_key_object_(nullptr) -{ - if (type_->m_isGetKeyDefined) - { - get_key_object_ = type_->createData(); - } - - if (resource_limited_qos_.max_samples <= 0) - { - resource_limited_qos_.max_samples = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_instances <= 0) - { - resource_limited_qos_.max_instances = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_samples_per_instance <= 0) - { - resource_limited_qos_.max_samples_per_instance = std::numeric_limits::max(); - } - - using std::placeholders::_1; - using std::placeholders::_2; - - if (topic_att.getTopicKind() == NO_KEY) - { - receive_fn_ = topic_att.historyQos.kind == KEEP_ALL_HISTORY_QOS ? - std::bind(&SubscriberHistory::received_change_keep_all_no_key, this, _1, _2) : - std::bind(&SubscriberHistory::received_change_keep_last_no_key, this, _1, _2); - } - else - { - receive_fn_ = topic_att.historyQos.kind == KEEP_ALL_HISTORY_QOS ? - std::bind(&SubscriberHistory::received_change_keep_all_with_key, this, _1, _2) : - std::bind(&SubscriberHistory::received_change_keep_last_with_key, this, _1, _2); - complete_fn_ = topic_att.historyQos.kind == KEEP_ALL_HISTORY_QOS ? - std::bind(&SubscriberHistory::completed_change_keep_all_with_key, this, _1) : - std::bind(&SubscriberHistory::completed_change_keep_last_with_key, this, _1); - } -} - -SubscriberHistory::~SubscriberHistory() -{ - if (type_->m_isGetKeyDefined) - { - type_->deleteData(get_key_object_); - } -} - -bool SubscriberHistory::can_change_be_added_nts( - const rtps::GUID_t& writer_guid, - uint32_t total_payload_size, - size_t unknown_missing_changes_up_to, - bool& will_never_be_accepted) const -{ - if (!ReaderHistory::can_change_be_added_nts(writer_guid, total_payload_size, unknown_missing_changes_up_to, - will_never_be_accepted)) - { - return false; - } - - will_never_be_accepted = false; - return (KEEP_ALL_HISTORY_QOS != history_qos_.kind) || - (m_changes.size() + unknown_missing_changes_up_to < static_cast(resource_limited_qos_.max_samples)); -} - -bool SubscriberHistory::received_change( - CacheChange_t* a_change, - size_t unknown_missing_changes_up_to) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - - std::lock_guard guard(*mp_mutex); - return receive_fn_(a_change, unknown_missing_changes_up_to); -} - -bool SubscriberHistory::received_change_keep_all_no_key( - CacheChange_t* a_change, - size_t unknown_missing_changes_up_to) -{ - // TODO(Ricardo) Check - if (m_changes.size() + unknown_missing_changes_up_to < static_cast(resource_limited_qos_.max_samples)) - { - return add_received_change(a_change); - } - - return false; -} - -bool SubscriberHistory::received_change_keep_last_no_key( - CacheChange_t* a_change, - size_t /* unknown_missing_changes_up_to */ ) -{ - bool add = false; - if (m_changes.size() < static_cast(history_qos_.depth)) - { - add = true; - } - else - { - // Try to substitute the oldest sample. - - // As the history should be ordered following the presentation QoS, we can always remove the first one. - add = remove_change_sub(m_changes.at(0)); - } - - if (add) - { - return add_received_change(a_change); - } - - return false; -} - -bool SubscriberHistory::received_change_keep_all_with_key( - CacheChange_t* a_change, - size_t /* unknown_missing_changes_up_to */ ) -{ - // TODO(Miguel C): Should we check unknown_missing_changes_up_to as it is done in received_change_keep_all_no_key? - - bool ret_value = false; - t_m_Inst_Caches::iterator vit; - if (a_change->instanceHandle.isDefined() || a_change->is_fully_assembled()) // In this case we can obtain the the key. - { - if (find_key_for_change(a_change, vit)) - { - std::vector& instance_changes = vit->second.cache_changes; - if (instance_changes.size() < static_cast(resource_limited_qos_.max_samples_per_instance)) - { - ret_value = add_received_change_with_key(a_change, vit->second.cache_changes); - } - else - { - EPROSIMA_LOG_WARNING(SUBSCRIBER, "Change not added due to maximum number of samples per instance"); - } - } - } - else // Store the sample temporally only in ReaderHistory. When completed it will be stored in SubscriberHistory too. - { - if (!m_isHistoryFull) - { - ret_value = add_change(a_change); - - if (m_changes.size() == static_cast(m_att.maximumReservedCaches)) - { - m_isHistoryFull = true; - } - } - else - { - // Discarting the sample. - EPROSIMA_LOG_WARNING(SUBSCRIBER, - "Attempting to add Data to Full ReaderHistory: " << topic_att_.getTopicDataType()); - } - } - - return ret_value; -} - -bool SubscriberHistory::received_change_keep_last_with_key( - CacheChange_t* a_change, - size_t /* unknown_missing_changes_up_to */) -{ - bool ret_value = false; - t_m_Inst_Caches::iterator vit; - if (a_change->instanceHandle.isDefined() || a_change->is_fully_assembled()) // In this case we can obtain the the key. - { - if (find_key_for_change(a_change, vit)) - { - bool add = false; - std::vector& instance_changes = vit->second.cache_changes; - if (instance_changes.size() < static_cast(history_qos_.depth)) - { - add = true; - } - else - { - // Try to substitute the oldest sample. - - // As the instance should be ordered following the presentation QoS, we can always remove the first one. - add = remove_change_sub(instance_changes.at(0)); - } - - if (add) - { - ret_value = add_received_change_with_key(a_change, instance_changes); - } - } - } - else // Store the sample temporally only in ReaderHistory. When completed it will be stored in SubscriberHistory too. - { - if (!m_isHistoryFull) - { - ret_value = add_change(a_change); - - if (m_changes.size() == static_cast(m_att.maximumReservedCaches)) - { - m_isHistoryFull = true; - } - } - else - { - // Discarting the sample. - EPROSIMA_LOG_WARNING(SUBSCRIBER, - "Attempting to add Data to Full ReaderHistory: " << topic_att_.getTopicDataType()); - } - } - - return ret_value; -} - -bool SubscriberHistory::add_received_change( - CacheChange_t* a_change) -{ - if (m_isHistoryFull) - { - // Discarding the sample. - EPROSIMA_LOG_WARNING(SUBSCRIBER, - "Attempting to add Data to Full ReaderHistory: " << topic_att_.getTopicDataType()); - return false; - } - - if (add_change(a_change)) - { - if (m_changes.size() == static_cast(m_att.maximumReservedCaches)) - { - m_isHistoryFull = true; - } - - EPROSIMA_LOG_INFO(SUBSCRIBER, topic_att_.getTopicDataType() - << ": Change " << a_change->sequenceNumber << " added from: " - << a_change->writerGUID; ); - - return true; - } - - return false; -} - -bool SubscriberHistory::add_received_change_with_key( - CacheChange_t* a_change, - std::vector& instance_changes) -{ - if (m_isHistoryFull) - { - // Discarting the sample. - EPROSIMA_LOG_WARNING(SUBSCRIBER, - "Attempting to add Data to Full ReaderHistory: " << topic_att_.getTopicDataType()); - return false; - } - - if (add_change(a_change)) - { - if (m_changes.size() == static_cast(m_att.maximumReservedCaches)) - { - m_isHistoryFull = true; - } - - //ADD TO KEY VECTOR - eprosima::utilities::collections::sorted_vector_insert(instance_changes, a_change, - fastdds::rtps::history_order_cmp); - - EPROSIMA_LOG_INFO(SUBSCRIBER, mp_reader->getGuid().entityId - << ": Change " << a_change->sequenceNumber << " added from: " - << a_change->writerGUID << " with KEY: " << a_change->instanceHandle; ); - - return true; - } - - return false; -} - -bool SubscriberHistory::find_key_for_change( - rtps::CacheChange_t* a_change, - t_m_Inst_Caches::iterator& map_it) -{ - if (!a_change->instanceHandle.isDefined() && type_ != nullptr) - { - EPROSIMA_LOG_INFO(SUBSCRIBER, "Getting Key of change with no Key transmitted"); - type_->deserialize(&a_change->serializedPayload, get_key_object_); - bool is_key_protected = false; -#if HAVE_SECURITY - is_key_protected = mp_reader->getAttributes().security_attributes().is_key_protected; -#endif // if HAVE_SECURITY - if (!type_->getKey(get_key_object_, &a_change->instanceHandle, is_key_protected)) - { - return false; - } - } - else if (!a_change->instanceHandle.isDefined()) - { - EPROSIMA_LOG_WARNING(SUBSCRIBER, "NO KEY in topic: " << topic_att_.topicName - << " and no method to obtain it"; ); - return false; - } - - return find_key(a_change, map_it); -} - -bool SubscriberHistory::deserialize_change( - CacheChange_t* change, - uint32_t ownership_strength, - void* data, - SampleInfo_t* info) -{ - if (change->kind == ALIVE) - { - if (!type_->deserialize(&change->serializedPayload, data)) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Deserialization of data failed"); - return false; - } - } - - if (info != nullptr) - { - if (topic_att_.topicKind == WITH_KEY && - change->instanceHandle == c_InstanceHandle_Unknown && - change->kind == ALIVE) - { - bool is_key_protected = false; -#if HAVE_SECURITY - is_key_protected = mp_reader->getAttributes().security_attributes().is_key_protected; -#endif // if HAVE_SECURITY - type_->getKey(data, &change->instanceHandle, is_key_protected); - } - - get_sample_info(info, change, ownership_strength); - } - - return true; -} - -bool SubscriberHistory::readNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - - std::unique_lock lock(*mp_mutex, std::defer_lock); - - if (lock.try_lock_until(max_blocking_time)) - { - CacheChange_t* change; - WriterProxy* wp = nullptr; - if (mp_reader->nextUnreadCache(&change, &wp)) - { - EPROSIMA_LOG_INFO(SUBSCRIBER, mp_reader->getGuid().entityId << ": reading " << change->sequenceNumber); - uint32_t ownership = wp && qos_.m_ownership.kind == EXCLUSIVE_OWNERSHIP_QOS ? - wp->ownership_strength() : 0; - bool deserialized = deserialize_change(change, ownership, data, info); - mp_reader->change_read_by_user(change, wp); - return deserialized; - } - } - return false; -} - -bool SubscriberHistory::takeNextData( - void* data, - SampleInfo_t* info, - std::chrono::steady_clock::time_point& max_blocking_time) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - - std::unique_lock lock(*mp_mutex, std::defer_lock); - - if (lock.try_lock_until(max_blocking_time)) - { - CacheChange_t* change = nullptr; - WriterProxy* wp = nullptr; - if (mp_reader->nextUntakenCache(&change, &wp)) - { - EPROSIMA_LOG_INFO(SUBSCRIBER, - mp_reader->getGuid().entityId << ": taking seqNum" << change->sequenceNumber << - " from writer: " << change->writerGUID); - uint32_t ownership = wp && qos_.m_ownership.kind == EXCLUSIVE_OWNERSHIP_QOS ? - wp->ownership_strength() : 0; - bool deserialized = deserialize_change(change, ownership, data, info); - mp_reader->change_read_by_user(change, wp); - bool removed = remove_change_sub(change); - return (deserialized && removed); - } - } - - return false; -} - -bool SubscriberHistory::get_first_untaken_info( - SampleInfo_t* info) -{ - std::lock_guard lock(*mp_mutex); - - CacheChange_t* change = nullptr; - WriterProxy* wp = nullptr; - if (mp_reader->nextUntakenCache(&change, &wp)) - { - uint32_t ownership = wp && qos_.m_ownership.kind == EXCLUSIVE_OWNERSHIP_QOS ? wp->ownership_strength() : 0; - get_sample_info(info, change, ownership); - mp_reader->change_read_by_user(change, wp, false); - return true; - } - - return false; -} - -bool SubscriberHistory::find_key( - CacheChange_t* a_change, - t_m_Inst_Caches::iterator& vit_out) -{ - vit_out = keyed_changes_.find(a_change->instanceHandle); - if (vit_out != keyed_changes_.end()) - { - return true; - } - - if (keyed_changes_.size() < static_cast(resource_limited_qos_.max_instances)) - { - vit_out = keyed_changes_.insert(std::make_pair(a_change->instanceHandle, KeyedChanges())).first; - return true; - } - else - { - for (t_m_Inst_Caches::iterator vit = keyed_changes_.begin(); vit != keyed_changes_.end(); ++vit) - { - if (vit->second.cache_changes.size() == 0) - { - keyed_changes_.erase(vit); - vit_out = keyed_changes_.insert(std::make_pair(a_change->instanceHandle, KeyedChanges())).first; - return true; - } - } - EPROSIMA_LOG_WARNING(SUBSCRIBER, "History has reached the maximum number of instances"); - } - return false; -} - -bool SubscriberHistory::remove_change_sub( - CacheChange_t* change) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - - std::lock_guard guard(*mp_mutex); - if (topic_att_.getTopicKind() == WITH_KEY) - { - bool found = false; - t_m_Inst_Caches::iterator vit; - if (find_key(change, vit)) - { - for (auto chit = vit->second.cache_changes.begin(); chit != vit->second.cache_changes.end(); ++chit) - { - if ((*chit)->sequenceNumber == change->sequenceNumber && (*chit)->writerGUID == change->writerGUID) - { - vit->second.cache_changes.erase(chit); - found = true; - break; - } - } - } - if (!found) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Change not found on this key, something is wrong"); - } - } - - if (remove_change(change)) - { - m_isHistoryFull = false; - return true; - } - - return false; -} - -bool SubscriberHistory::remove_change_sub( - CacheChange_t* change, - iterator& it) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - - std::lock_guard guard(*mp_mutex); - if (topic_att_.getTopicKind() == WITH_KEY) - { - bool found = false; - t_m_Inst_Caches::iterator vit; - if (find_key(change, vit)) - { - for (auto chit = vit->second.cache_changes.begin(); chit != vit->second.cache_changes.end(); ++chit) - { - if ((*chit)->sequenceNumber == change->sequenceNumber && (*chit)->writerGUID == change->writerGUID) - { - assert(it == chit); - it = vit->second.cache_changes.erase(chit); - found = true; - break; - } - } - } - if (!found) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Change not found on this key, something is wrong"); - } - } - - const_iterator chit = find_change_nts(change); - if (chit == changesEnd()) - { - EPROSIMA_LOG_INFO(RTPS_WRITER_HISTORY, "Trying to remove a change not in history"); - return false; - } - - m_isHistoryFull = false; - iterator ret_it = remove_change_nts(chit); - - if (topic_att_.getTopicKind() != WITH_KEY) - { - it = ret_it; - } - - return true; -} - -bool SubscriberHistory::set_next_deadline( - const InstanceHandle_t& handle, - const std::chrono::steady_clock::time_point& next_deadline_us) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - std::lock_guard guard(*mp_mutex); - - if (topic_att_.getTopicKind() == NO_KEY) - { - next_deadline_us_ = next_deadline_us; - return true; - } - else if (topic_att_.getTopicKind() == WITH_KEY) - { - if (keyed_changes_.find(handle) == keyed_changes_.end()) - { - return false; - } - - keyed_changes_[handle].next_deadline_us = next_deadline_us; - return true; - } - - return false; -} - -bool SubscriberHistory::get_next_deadline( - InstanceHandle_t& handle, - std::chrono::steady_clock::time_point& next_deadline_us) -{ - if (mp_reader == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "You need to create a Reader with this History before using it"); - return false; - } - std::lock_guard guard(*mp_mutex); - - if (topic_att_.getTopicKind() == NO_KEY) - { - next_deadline_us = next_deadline_us_; - return true; - } - else if (topic_att_.getTopicKind() == WITH_KEY) - { - auto min = std::min_element(keyed_changes_.begin(), - keyed_changes_.end(), - []( - const std::pair& lhs, - const std::pair& rhs) - { - return lhs.second.next_deadline_us < rhs.second.next_deadline_us; - }); - handle = min->first; - next_deadline_us = min->second.next_deadline_us; - return true; - } - - return false; -} - -ReaderHistory::iterator SubscriberHistory::remove_change_nts( - ReaderHistory::const_iterator removal, - bool release) -{ - CacheChange_t* p_sample = nullptr; - - if ( removal != changesEnd() - && (p_sample = *removal)->instanceHandle.isDefined() - && topic_att_.getTopicKind() == WITH_KEY) - { - // clean any references to this CacheChange in the key state collection - auto it = keyed_changes_.find(p_sample->instanceHandle); - - // if keyed and in history must be in the map - assert(it != keyed_changes_.end()); - - auto& c = it->second.cache_changes; - c.erase(std::remove(c.begin(), c.end(), p_sample), c.end()); - } - - // call the base class - return ReaderHistory::remove_change_nts(removal, release); -} - -bool SubscriberHistory::completed_change( - rtps::CacheChange_t* change) -{ - bool ret_value = true; - - if (complete_fn_) - { - ret_value = complete_fn_(change); - } - - return ret_value; -} - -bool SubscriberHistory::completed_change_keep_all_with_key( - CacheChange_t* a_change) -{ - bool ret_value = false; - - if (!a_change->instanceHandle.isDefined()) - { - t_m_Inst_Caches::iterator vit; - if (find_key_for_change(a_change, vit)) - { - std::vector& instance_changes = vit->second.cache_changes; - if (instance_changes.size() < static_cast(resource_limited_qos_.max_samples_per_instance)) - { - //ADD TO KEY VECTOR - eprosima::utilities::collections::sorted_vector_insert(instance_changes, a_change, - fastdds::rtps::history_order_cmp); - ret_value = true; - - EPROSIMA_LOG_INFO(SUBSCRIBER, mp_reader->getGuid().entityId - << ": Change " << a_change->sequenceNumber << " added from: " - << a_change->writerGUID << " with KEY: " << a_change->instanceHandle; ); - } - else - { - EPROSIMA_LOG_WARNING(SUBSCRIBER, "Change not added due to maximum number of samples per instance"); - - const_iterator chit = find_change_nts(a_change); - if (chit != changesEnd()) - { - m_isHistoryFull = false; - remove_change_nts(chit); - } - else - { - EPROSIMA_LOG_ERROR(RTPS_WRITER_HISTORY, "Change should exists but didn't find it"); - } - } - } - } - - return ret_value; -} - -bool SubscriberHistory::completed_change_keep_last_with_key( - CacheChange_t* a_change) -{ - bool ret_value = false; - - if (!a_change->instanceHandle.isDefined()) - { - t_m_Inst_Caches::iterator vit; - if (find_key_for_change(a_change, vit)) - { - bool add = false; - std::vector& instance_changes = vit->second.cache_changes; - if (instance_changes.size() < static_cast(history_qos_.depth)) - { - add = true; - } - else - { - // Try to substitute the oldest sample. - - // As the instance should be ordered following the presentation QoS, we can always remove the first one. - add = remove_change_sub(instance_changes.at(0)); - } - - if (add) - { - //ADD TO KEY VECTOR - eprosima::utilities::collections::sorted_vector_insert(instance_changes, a_change, - fastdds::rtps::history_order_cmp); - ret_value = true; - - EPROSIMA_LOG_INFO(SUBSCRIBER, mp_reader->getGuid().entityId - << ": Change " << a_change->sequenceNumber << " added from: " - << a_change->writerGUID << " with KEY: " << a_change->instanceHandle; ); - } - else - { - const_iterator chit = find_change_nts(a_change); - if (chit != changesEnd()) - { - m_isHistoryFull = false; - remove_change_nts(chit); - } - else - { - EPROSIMA_LOG_ERROR(RTPS_WRITER_HISTORY, "Change should exists but didn't find it"); - } - } - } - } - - return ret_value; -} - -} // namespace fastrtps -} // namsepace eprosima diff --git a/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.cpp b/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.cpp deleted file mode 100644 index 487a3a8662e..00000000000 --- a/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.cpp +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberImpl.cpp - * - */ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace eprosima::fastrtps::rtps; -using namespace std::chrono; - -using eprosima::fastdds::dds::TopicDataType; - -namespace eprosima { -namespace fastrtps { - - -SubscriberImpl::SubscriberImpl( - ParticipantImpl* p, - TopicDataType* ptype, - const SubscriberAttributes& att, - SubscriberListener* listen) - : mp_participant(p) - , mp_reader(nullptr) - , mp_type(ptype) - , m_att(att) -#pragma warning (disable : 4355 ) - , m_history(att.topic, - ptype, - att.qos, - ptype->m_typeSize + 3 /*Possible alignment*/, - att.historyMemoryPolicy) - , mp_listener(listen) - , m_readerListener(this) - , mp_userSubscriber(nullptr) - , mp_rtpsParticipant(nullptr) - , deadline_duration_us_(m_att.qos.m_deadline.period.to_ns() * 1e-3) - , deadline_missed_status_() - , lifespan_duration_us_(m_att.qos.m_lifespan.duration.to_ns() * 1e-3) -{ - std::string topic_name = m_att.topic.getTopicName().to_string(); - PoolConfig pool_cfg = PoolConfig::from_history_attributes(m_history.m_att); - payload_pool_ = TopicPayloadPoolRegistry::get(topic_name, pool_cfg); - payload_pool_->reserve_history(pool_cfg, true); - - deadline_timer_ = new TimedEvent(mp_participant->get_resource_event(), - [&]() -> bool - { - return deadline_missed(); - }, - att.qos.m_deadline.period.to_ns() * 1e-6); - - lifespan_timer_ = new TimedEvent(mp_participant->get_resource_event(), - [&]() -> bool - { - return lifespan_expired(); - }, - att.qos.m_lifespan.duration.to_ns() * 1e-6); -} - -SubscriberImpl::~SubscriberImpl() -{ - delete(lifespan_timer_); - delete(deadline_timer_); - - if (mp_reader != nullptr) - { - EPROSIMA_LOG_INFO(SUBSCRIBER, this->getGuid().entityId << " in topic: " << this->m_att.topic.topicName); - } - - RTPSDomain::removeRTPSReader(mp_reader); - delete(this->mp_userSubscriber); - - std::string topic_name = m_att.topic.getTopicName().to_string(); - PoolConfig pool_cfg = PoolConfig::from_history_attributes(m_history.m_att); - payload_pool_->release_history(pool_cfg, true); -} - -bool SubscriberImpl::wait_for_unread_samples( - const Duration_t& timeout) -{ - return mp_reader->wait_for_unread_cache(timeout); -} - -bool SubscriberImpl::readNextData( - void* data, - SampleInfo_t* info) -{ - auto max_blocking_time = std::chrono::steady_clock::now() + -#if HAVE_STRICT_REALTIME - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(m_att.qos.m_reliability.max_blocking_time)); -#else - std::chrono::hours(24); -#endif // if HAVE_STRICT_REALTIME - return this->m_history.readNextData(data, info, max_blocking_time); -} - -bool SubscriberImpl::takeNextData( - void* data, - SampleInfo_t* info) -{ - auto max_blocking_time = std::chrono::steady_clock::now() + -#if HAVE_STRICT_REALTIME - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(m_att.qos.m_reliability.max_blocking_time)); -#else - std::chrono::hours(24); -#endif // if HAVE_STRICT_REALTIME - return this->m_history.takeNextData(data, info, max_blocking_time); -} - -bool SubscriberImpl::get_first_untaken_info( - SampleInfo_t* info) -{ - return m_history.get_first_untaken_info(info); -} - -const GUID_t& SubscriberImpl::getGuid() -{ - return mp_reader->getGuid(); -} - -bool SubscriberImpl::updateAttributes( - const SubscriberAttributes& att) -{ - bool updated = true; - bool missing = false; - if (att.unicastLocatorList.size() != this->m_att.unicastLocatorList.size() || - att.multicastLocatorList.size() != this->m_att.multicastLocatorList.size()) - { - EPROSIMA_LOG_WARNING(RTPS_READER, "Locator Lists cannot be changed or updated in this version"); - updated &= false; - } - else - { - for (LocatorListConstIterator lit1 = this->m_att.unicastLocatorList.begin(); - lit1 != this->m_att.unicastLocatorList.end(); ++lit1) - { - missing = true; - for (LocatorListConstIterator lit2 = att.unicastLocatorList.begin(); - lit2 != att.unicastLocatorList.end(); ++lit2) - { - if (*lit1 == *lit2) - { - missing = false; - break; - } - } - if (missing) - { - EPROSIMA_LOG_WARNING(RTPS_READER, "Locator: " << *lit1 << " not present in new list"); - EPROSIMA_LOG_WARNING(RTPS_READER, "Locator Lists cannot be changed or updated in this version"); - } - } - for (LocatorListConstIterator lit1 = this->m_att.multicastLocatorList.begin(); - lit1 != this->m_att.multicastLocatorList.end(); ++lit1) - { - missing = true; - for (LocatorListConstIterator lit2 = att.multicastLocatorList.begin(); - lit2 != att.multicastLocatorList.end(); ++lit2) - { - if (*lit1 == *lit2) - { - missing = false; - break; - } - } - if (missing) - { - EPROSIMA_LOG_WARNING(RTPS_READER, "Locator: " << *lit1 << " not present in new list"); - EPROSIMA_LOG_WARNING(RTPS_READER, "Locator Lists cannot be changed or updated in this version"); - } - } - } - - //TOPIC ATTRIBUTES - if (this->m_att.topic != att.topic) - { - EPROSIMA_LOG_WARNING(RTPS_READER, "Topic Attributes cannot be updated"); - updated &= false; - } - //QOS: - //CHECK IF THE QOS CAN BE SET - if (!this->m_att.qos.canQosBeUpdated(att.qos)) - { - updated &= false; - } - if (updated) - { - this->m_att.expectsInlineQos = att.expectsInlineQos; - if (this->m_att.qos.m_reliability.kind == RELIABLE_RELIABILITY_QOS) - { - //UPDATE TIMES: - StatefulReader* sfr = (StatefulReader*)mp_reader; - sfr->updateTimes(att.times); - } - this->m_att.qos.setQos(att.qos, false); - //NOTIFY THE BUILTIN PROTOCOLS THAT THE READER HAS CHANGED - mp_rtpsParticipant->updateReader(this->mp_reader, m_att.topic, m_att.qos); - - // Deadline - - if (m_att.qos.m_deadline.period != c_TimeInfinite) - { - deadline_duration_us_ = - duration>(m_att.qos.m_deadline.period.to_ns() * 1e-3); - deadline_timer_->update_interval_millisec(m_att.qos.m_deadline.period.to_ns() * 1e-6); - } - else - { - deadline_timer_->cancel_timer(); - } - - // Lifespan - - if (m_att.qos.m_lifespan.duration != c_TimeInfinite) - { - lifespan_duration_us_ = - std::chrono::duration>(m_att.qos.m_lifespan.duration.to_ns() * 1e-3); - lifespan_timer_->update_interval_millisec(m_att.qos.m_lifespan.duration.to_ns() * 1e-6); - } - else - { - lifespan_timer_->cancel_timer(); - } - } - - return updated; -} - -void SubscriberImpl::SubscriberReaderListener::onNewCacheChangeAdded( - RTPSReader* /*reader*/, - const CacheChange_t* const change_in) -{ - if (mp_subscriberImpl->onNewCacheChangeAdded(change_in)) - { - if (mp_subscriberImpl->mp_listener != nullptr) - { - //cout << "FIRST BYTE: "<< (int)change->serializedPayload.data[0] << endl; - mp_subscriberImpl->mp_listener->onNewDataMessage(mp_subscriberImpl->mp_userSubscriber); - } - } -} - -void SubscriberImpl::SubscriberReaderListener::onReaderMatched( - RTPSReader* /*reader*/, - MatchingInfo& info) -{ - if (this->mp_subscriberImpl->mp_listener != nullptr) - { - mp_subscriberImpl->mp_listener->onSubscriptionMatched(mp_subscriberImpl->mp_userSubscriber, info); - } -} - -void SubscriberImpl::SubscriberReaderListener::on_liveliness_changed( - RTPSReader* reader, - const LivelinessChangedStatus& status) -{ - (void)reader; - - if (mp_subscriberImpl->mp_listener != nullptr) - { - mp_subscriberImpl->mp_listener->on_liveliness_changed( - mp_subscriberImpl->mp_userSubscriber, - status); - } -} - -bool SubscriberImpl::onNewCacheChangeAdded( - const CacheChange_t* const change_in) -{ - if (m_att.qos.m_deadline.period != c_TimeInfinite) - { - std::unique_lock lock(mp_reader->getMutex()); - - if (!m_history.set_next_deadline( - change_in->instanceHandle, - steady_clock::now() + duration_cast(deadline_duration_us_))) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Could not set next deadline in the history"); - } - else if (timer_owner_ == change_in->instanceHandle || timer_owner_ == InstanceHandle_t()) - { - if (deadline_timer_reschedule()) - { - deadline_timer_->cancel_timer(); - deadline_timer_->restart_timer(); - } - } - } - - CacheChange_t* change = (CacheChange_t*)change_in; - - if (m_att.qos.m_lifespan.duration == c_TimeInfinite) - { - return true; - } - - auto source_timestamp = system_clock::time_point() + nanoseconds(change->sourceTimestamp.to_ns()); - auto now = system_clock::now(); - - // The new change could have expired if it arrived too late - // If so, remove it from the history and return false to avoid notifying the listener - if (now - source_timestamp >= lifespan_duration_us_) - { - m_history.remove_change_sub(change); - return false; - } - - CacheChange_t* earliest_change; - if (m_history.get_earliest_change(&earliest_change)) - { - if (earliest_change == change) - { - // The new change has been added at the beginning of the the history - // As the history is sorted by timestamp, this means that the new change has the smallest timestamp - // We have to stop the timer as this will be the next change to expire - lifespan_timer_->cancel_timer(); - } - } - else - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "A change was added to history that could not be retrieved"); - } - - auto interval = source_timestamp - now + duration_cast(lifespan_duration_us_); - - // Update and restart the timer - // If the timer is already running this will not have any effect - lifespan_timer_->update_interval_millisec(interval.count() * 1e-6); - lifespan_timer_->restart_timer(); - return true; -} - -/*! - * @brief Returns there is a clean state with all Publishers. - * It occurs when the Subscriber received all samples sent by Publishers. In other words, - * its WriterProxies are up to date. - * @return There is a clean state with all Publishers. - */ -bool SubscriberImpl::isInCleanState() const -{ - return mp_reader->isInCleanState(); -} - -uint64_t SubscriberImpl::get_unread_count() const -{ - return mp_reader->get_unread_count(); -} - -bool SubscriberImpl::deadline_timer_reschedule() -{ - assert(m_att.qos.m_deadline.period != c_TimeInfinite); - - std::unique_lock lock(mp_reader->getMutex()); - - steady_clock::time_point next_deadline_us; - if (!m_history.get_next_deadline(timer_owner_, next_deadline_us)) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Could not get the next deadline from the history"); - return false; - } - auto interval_ms = duration_cast(next_deadline_us - steady_clock::now()); - deadline_timer_->update_interval_millisec((double)interval_ms.count()); - return true; -} - -bool SubscriberImpl::deadline_missed() -{ - assert(m_att.qos.m_deadline.period != c_TimeInfinite); - - std::unique_lock lock(mp_reader->getMutex()); - - deadline_missed_status_.total_count++; - deadline_missed_status_.total_count_change++; - deadline_missed_status_.last_instance_handle = timer_owner_; - mp_listener->on_requested_deadline_missed(mp_userSubscriber, deadline_missed_status_); - deadline_missed_status_.total_count_change = 0; - - if (!m_history.set_next_deadline( - timer_owner_, - steady_clock::now() + duration_cast(deadline_duration_us_))) - { - EPROSIMA_LOG_ERROR(SUBSCRIBER, "Could not set next deadline in the history"); - return false; - } - return deadline_timer_reschedule(); -} - -void SubscriberImpl::get_requested_deadline_missed_status( - RequestedDeadlineMissedStatus& status) -{ - std::unique_lock lock(mp_reader->getMutex()); - - status = deadline_missed_status_; - deadline_missed_status_.total_count_change = 0; -} - -bool SubscriberImpl::lifespan_expired() -{ - std::unique_lock lock(mp_reader->getMutex()); - - CacheChange_t* earliest_change; - while (m_history.get_earliest_change(&earliest_change)) - { - auto source_timestamp = system_clock::time_point() + nanoseconds(earliest_change->sourceTimestamp.to_ns()); - auto now = system_clock::now(); - - // Check that the earliest change has expired (the change which started the timer could have been removed from the history) - if (now - source_timestamp < lifespan_duration_us_) - { - auto interval = source_timestamp - now + lifespan_duration_us_; - lifespan_timer_->update_interval_millisec((double)duration_cast(interval).count()); - return true; - } - - // The earliest change has expired - m_history.remove_change_sub(earliest_change); - - // Set the timer for the next change if there is one - if (!m_history.get_earliest_change(&earliest_change)) - { - return false; - } - - // Calculate when the next change is due to expire and restart - source_timestamp = system_clock::time_point() + nanoseconds(earliest_change->sourceTimestamp.to_ns()); - now = system_clock::now(); - auto interval = source_timestamp - now + lifespan_duration_us_; - - if (interval.count() > 0) - { - lifespan_timer_->update_interval_millisec((double)duration_cast(interval).count()); - return true; - } - } - - return false; -} - -void SubscriberImpl::get_liveliness_changed_status( - LivelinessChangedStatus& status) -{ - std::unique_lock lock(mp_reader->getMutex()); - - status = mp_reader->liveliness_changed_status_; - - mp_reader->liveliness_changed_status_.alive_count_change = 0u; - mp_reader->liveliness_changed_status_.not_alive_count_change = 0u; -} - -std::shared_ptr SubscriberImpl::payload_pool() -{ - return payload_pool_; -} - -void SubscriberImpl::get_listening_locators( - rtps::LocatorList_t& locators) const -{ - assert(mp_reader != nullptr); - locators.assign(mp_reader->getAttributes().unicastLocatorList); - locators.push_back(mp_reader->getAttributes().multicastLocatorList); -} - -} /* namespace fastrtps */ -} /* namespace eprosima */ diff --git a/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.h b/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.h deleted file mode 100644 index 49429570bfd..00000000000 --- a/src/cpp/fastrtps_deprecated/subscriber/SubscriberImpl.h +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file SubscriberImpl.h - * - */ - -#ifndef SUBSCRIBERIMPL_H_ -#define SUBSCRIBERIMPL_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { -class RTPSReader; -class RTPSParticipant; -class TimedEvent; -} // namespace rtps - -class SubscriberListener; -class Participant; -class ParticipantImpl; -class SampleInfo_t; -class Subscriber; - -/** - * Class SubscriberImpl, contains the actual implementation of the behaviour of the Subscriber. - * @ingroup FASTRTPS_MODULE - */ -class SubscriberImpl -{ - friend class ParticipantImpl; - using LivelinessChangedStatus = eprosima::fastdds::dds::LivelinessChangedStatus; - -public: - - /** - * @param p - * @param ptype - * @param attr - * @param listen - */ - SubscriberImpl( - ParticipantImpl* p, - fastdds::dds::TopicDataType* ptype, - const SubscriberAttributes& attr, - SubscriberListener* listen = nullptr); - - virtual ~SubscriberImpl(); - - /*! - * Method to block the current thread until an unread sasmple is available. - * @param timeout maximum time the function will be blocked if any sample is received. - */ - bool wait_for_unread_samples( - const eprosima::fastrtps::Duration_t& timeout); - - - /** @name Read or take data methods. - * Methods to read or take data from the History. - */ - - ///@{ - - bool readNextData( - void* data, - SampleInfo_t* info); - bool takeNextData( - void* data, - SampleInfo_t* info); - - ///@} - - /** - * @brief Returns information about the first untaken sample. - * @param [out] info Pointer to a SampleInfo_t structure to store first untaken sample information. - * @return true if sample info was returned. false if there is no sample to take. - */ - bool get_first_untaken_info( - SampleInfo_t* info); - - /** - * Update the Attributes of the subscriber; - * @param att Reference to a SubscriberAttributes object to update the parameters; - * @return True if correctly updated, false if ANY of the updated parameters cannot be updated - */ - bool updateAttributes( - const SubscriberAttributes& att); - - /** - * Get associated GUID - * @return Associated GUID - */ - const rtps::GUID_t& getGuid(); - - /** - * Get the Attributes of the Subscriber. - * @return Attributes of the Subscriber. - */ - const SubscriberAttributes& getAttributes() const - { - return m_att; - } - - /** - * Get topic data type - * @return Topic data type - */ - fastdds::dds::TopicDataType* getType() - { - return mp_type; - } - - /*! - * @brief Returns there is a clean state with all Publishers. - * It occurs when the Subscriber received all samples sent by Publishers. In other words, - * its WriterProxies are up to date. - * @return There is a clean state with all Publishers. - */ - bool isInCleanState() const; - - /** - * Get the unread count. - * @return Unread count - */ - uint64_t get_unread_count() const; - - /** - * @brief A method called when a new cache change is added - * @param change The cache change that has been added - * @return True if the change was added (due to some QoS it could have been 'rejected') - */ - bool onNewCacheChangeAdded( - const rtps::CacheChange_t* const change); - - /** - * @brief Get the requested deadline missed status - * @return The deadline missed status - */ - void get_requested_deadline_missed_status( - RequestedDeadlineMissedStatus& status); - - /** - * @brief Returns the liveliness changed status - * @param status Liveliness changed status - */ - void get_liveliness_changed_status( - LivelinessChangedStatus& status); - - std::shared_ptr payload_pool(); - - /** - * Get the list of locators on which this subscriber is listening. - * - * @param [out] locators LocatorList_t where the list of locators will be stored. - */ - void get_listening_locators( - rtps::LocatorList_t& locators) const; - -private: - - //!Participant - ParticipantImpl* mp_participant; - - //!Pointer to associated RTPSReader - rtps::RTPSReader* mp_reader; - //! Pointer to the TopicDataType object. - fastdds::dds::TopicDataType* mp_type; - //!Attributes of the Subscriber - SubscriberAttributes m_att; - //!History - SubscriberHistory m_history; - //!Listener - SubscriberListener* mp_listener; - - class SubscriberReaderListener : public rtps::ReaderListener - { - public: - - SubscriberReaderListener( - SubscriberImpl* s) - : mp_subscriberImpl(s) - { - } - - virtual ~SubscriberReaderListener() - { - } - - void onReaderMatched( - rtps::RTPSReader* reader, - rtps::MatchingInfo& info) override; - void onNewCacheChangeAdded( - rtps::RTPSReader* reader, - const rtps::CacheChange_t* const change) override; - void on_liveliness_changed( - rtps::RTPSReader* reader, - const LivelinessChangedStatus& status) override; - SubscriberImpl* mp_subscriberImpl; - - private: - - using rtps::ReaderListener::onReaderMatched; - } - m_readerListener; - - Subscriber* mp_userSubscriber; - //!RTPSParticipant - rtps::RTPSParticipant* mp_rtpsParticipant; - - //! A timer used to check for deadlines - rtps::TimedEvent* deadline_timer_; - //! Deadline duration in microseconds - std::chrono::duration> deadline_duration_us_; - //! The current timer owner, i.e. the instance which started the deadline timer - rtps::InstanceHandle_t timer_owner_; - //! Requested deadline missed status - RequestedDeadlineMissedStatus deadline_missed_status_; - - //! A timed callback to remove expired samples - rtps::TimedEvent* lifespan_timer_; - //! The lifespan duration - std::chrono::duration> lifespan_duration_us_; - - std::shared_ptr payload_pool_; - - /** - * @brief Method called when an instance misses the deadline - */ - bool deadline_missed(); - - /** - * @brief A method to reschedule the deadline timer - */ - bool deadline_timer_reschedule(); - - /** - * @brief A method called when the lifespan timer expires - */ - bool lifespan_expired(); - -}; - - -} /* namespace fastrtps */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* SUBSCRIBERIMPL_H_ */ diff --git a/src/cpp/libfastdds.version b/src/cpp/libfastdds.version new file mode 100644 index 00000000000..a6f3ac1ca43 --- /dev/null +++ b/src/cpp/libfastdds.version @@ -0,0 +1,4 @@ +CODEABI_1.0 { + global: *eprosima*;*MD5*; + local: *; +}; diff --git a/src/cpp/libfastrtps.version b/src/cpp/libfastrtps.version deleted file mode 100644 index f2ccceb6227..00000000000 --- a/src/cpp/libfastrtps.version +++ /dev/null @@ -1,4 +0,0 @@ -CODEABI_1.0 { - global: *eprosima*;*MD5*;*dds*; - local: *; -}; diff --git a/src/cpp/rtps/DataSharing/DataSharingListener.hpp b/src/cpp/rtps/DataSharing/DataSharingListener.hpp index 392764b3a48..1333e97dc61 100644 --- a/src/cpp/rtps/DataSharing/DataSharingListener.hpp +++ b/src/cpp/rtps/DataSharing/DataSharingListener.hpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/src/cpp/rtps/DataSharing/IDataSharingListener.hpp b/src/cpp/rtps/DataSharing/IDataSharingListener.hpp index 5d1a2f5da67..b99e5d0a892 100644 --- a/src/cpp/rtps/DataSharing/IDataSharingListener.hpp +++ b/src/cpp/rtps/DataSharing/IDataSharingListener.hpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/cpp/rtps/RTPSDomain.cpp b/src/cpp/rtps/RTPSDomain.cpp index 20e48e89e5f..3aba710ba76 100644 --- a/src/cpp/rtps/RTPSDomain.cpp +++ b/src/cpp/rtps/RTPSDomain.cpp @@ -27,29 +27,27 @@ #include #include +#include #include #include #include #include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include +#include namespace eprosima { namespace fastrtps { @@ -122,6 +120,9 @@ void RTPSDomainImpl::stopAll() instance->removeRTPSParticipant_nts(participant); lock.lock(); } + + xmlparser::XMLProfileManager::DeleteInstance(); + EPROSIMA_LOG_INFO(RTPS_PARTICIPANT, "RTPSParticipants deleted correctly "); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -837,13 +838,13 @@ bool RTPSDomainImpl::should_intraprocess_between( switch (xmlparser::XMLProfileManager::library_settings().intraprocess_delivery) { - case IntraprocessDeliveryType::INTRAPROCESS_FULL: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL: return true; - case IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY: return !matched_guid.is_builtin(); - case IntraprocessDeliveryType::INTRAPROCESS_OFF: + case fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF: default: break; } @@ -877,6 +878,65 @@ void RTPSDomainImpl::set_filewatch_thread_config( instance->callback_thread_config_ = callback_thread; } +bool RTPSDomain::get_library_settings( + fastdds::LibrarySettings& library_settings) +{ + return RTPSDomainImpl::get_library_settings(library_settings); +} + +bool RTPSDomainImpl::get_library_settings( + fastdds::LibrarySettings& library_settings) +{ + library_settings = xmlparser::XMLProfileManager::library_settings(); + return true; +} + +bool RTPSDomain::set_library_settings( + const fastdds::LibrarySettings& library_settings) +{ + return RTPSDomainImpl::set_library_settings(library_settings); +} + +bool RTPSDomainImpl::set_library_settings( + const fastdds::LibrarySettings& library_settings) +{ + if (!get_instance()->m_RTPSParticipants.empty()) + { + return false; + } + xmlparser::XMLProfileManager::library_settings(library_settings); + return true; +} + +bool RTPSDomain::get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes) +{ + return RTPSDomainImpl::get_topic_attributes_from_profile(profile_name, topic_attributes); +} + +bool RTPSDomainImpl::get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes) +{ + if (xmlparser::XMLP_ret::XML_OK == + xmlparser::XMLProfileManager::fillTopicAttributes(profile_name, topic_attributes)) + { + return true; + } + return false; +} + +fastdds::dds::xtypes::ITypeObjectRegistry& RTPSDomainImpl::type_object_registry() +{ + return get_instance()->type_object_registry_; +} + +fastdds::dds::xtypes::TypeObjectRegistry& RTPSDomainImpl::type_object_registry_observer() +{ + return get_instance()->type_object_registry_; +} + } // namespace rtps } // namespace fastrtps } // namespace eprosima diff --git a/src/cpp/rtps/RTPSDomainImpl.hpp b/src/cpp/rtps/RTPSDomainImpl.hpp index 1f736cd66f2..629af0aeef7 100644 --- a/src/cpp/rtps/RTPSDomainImpl.hpp +++ b/src/cpp/rtps/RTPSDomainImpl.hpp @@ -25,13 +25,14 @@ #endif // defined(_WIN32) || defined(__unix__) #include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include namespace eprosima { namespace fastrtps { @@ -215,6 +216,51 @@ class RTPSDomainImpl const fastdds::rtps::ThreadSettings& watch_thread, const fastdds::rtps::ThreadSettings& callback_thread); + /** + * @brief Get the library settings. + * + * @param library_settings LibrarySettings reference where the settings are returned. + * @return True. + */ + static bool get_library_settings( + fastdds::LibrarySettings& library_settings); + + /** + * @brief Set the library settings. + * + * @param library_settings LibrarySettings to be set. + * @return False if there is any RTPSParticipant already created. + * True if correctly set. + */ + static bool set_library_settings( + const fastdds::LibrarySettings& library_settings); + + /** + * @brief Get the TopicAttributes from XML profile. + * + * @param profile_name Topic profile name. + * @param topic_att TopicAttributes object where the attributes are returned. + * @return bool true if the profile exists. + * false otherwise. + */ + static bool get_topic_attributes_from_profile( + const std::string& profile_name, + TopicAttributes& topic_attributes); + + /** + * @brief Return the ITypeObjectRegistry member to access the interface for the public API. + * + * @return const xtypes::ITypeObjectRegistry reference. + */ + static fastdds::dds::xtypes::ITypeObjectRegistry& type_object_registry(); + + /** + * @brief Return the TypeObjectRegistry member to access the API. + * + * @return const xtypes::TypeObjectRegistry reference. + */ + static fastdds::dds::xtypes::TypeObjectRegistry& type_object_registry_observer(); + private: /** @@ -266,6 +312,9 @@ class RTPSDomainImpl FileWatchHandle file_watch_handle_; fastdds::rtps::ThreadSettings watch_thread_config_; fastdds::rtps::ThreadSettings callback_thread_config_; + + eprosima::fastdds::dds::xtypes::TypeObjectRegistry type_object_registry_; + }; } // namespace rtps diff --git a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp index 88a7f1dc389..85dfde5e1d9 100644 --- a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp +++ b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -25,10 +26,10 @@ #include #include #include -#include -#include +#include #include +#include namespace eprosima { namespace fastrtps { @@ -38,7 +39,7 @@ static bool is_intraprocess_only( const RTPSParticipantAttributes& att) { return - xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == INTRAPROCESS_FULL && + xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == fastdds::INTRAPROCESS_FULL && att.builtin.discovery_config.ignoreParticipantFlags == (ParticipantFilteringFlags::FILTER_DIFFERENT_HOST | ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS); } diff --git a/src/cpp/fastrtps_deprecated/attributes/TopicAttributes.cpp b/src/cpp/rtps/attributes/TopicAttributes.cpp similarity index 98% rename from src/cpp/fastrtps_deprecated/attributes/TopicAttributes.cpp rename to src/cpp/rtps/attributes/TopicAttributes.cpp index 2ca7d7daba3..0e7ba4bab34 100644 --- a/src/cpp/fastrtps_deprecated/attributes/TopicAttributes.cpp +++ b/src/cpp/rtps/attributes/TopicAttributes.cpp @@ -16,7 +16,7 @@ * @file TopicAttributes.cpp */ -#include +#include #include using namespace eprosima::fastrtps; diff --git a/src/cpp/rtps/builtin/BuiltinProtocols.cpp b/src/cpp/rtps/builtin/BuiltinProtocols.cpp index 951d1ed2f8f..420fc946da1 100644 --- a/src/cpp/rtps/builtin/BuiltinProtocols.cpp +++ b/src/cpp/rtps/builtin/BuiltinProtocols.cpp @@ -17,29 +17,24 @@ * */ -#include -#include - -#include -#include -#include +#include -#include -#include +#include +#include #include +#include +#include -#include - -#include - +#include +#include +#include +#include +#include +#include +#include #include -#include -#include - -#include - using namespace eprosima::fastrtps; namespace eprosima { @@ -51,12 +46,15 @@ BuiltinProtocols::BuiltinProtocols() : mp_participantImpl(nullptr) , mp_PDP(nullptr) , mp_WLP(nullptr) - , tlm_(nullptr) + , typelookup_manager_(nullptr) { } BuiltinProtocols::~BuiltinProtocols() { + // This needs to be done first because of the WriterProxydata and ReaderProxyData smart_ptr + delete typelookup_manager_; + // Send participant is disposed if (mp_PDP != nullptr) { @@ -65,7 +63,6 @@ BuiltinProtocols::~BuiltinProtocols() // TODO Auto-generated destructor stub delete mp_WLP; - delete tlm_; delete mp_PDP; } @@ -143,11 +140,8 @@ bool BuiltinProtocols::initBuiltinProtocols( } // TypeLookupManager - if (m_att.typelookup_config.use_client || m_att.typelookup_config.use_server) - { - tlm_ = new fastdds::dds::builtin::TypeLookupManager(this); - tlm_->init_typelookup_service(mp_participantImpl); - } + typelookup_manager_ = new fastdds::dds::builtin::TypeLookupManager(); + typelookup_manager_->init(this); return true; } @@ -195,7 +189,7 @@ void BuiltinProtocols::filter_server_remote_locators( bool BuiltinProtocols::addLocalWriter( RTPSWriter* w, const fastrtps::TopicAttributes& topicAtt, - const fastrtps::WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { bool ok = true; @@ -229,7 +223,7 @@ bool BuiltinProtocols::addLocalWriter( bool BuiltinProtocols::addLocalReader( RTPSReader* R, const fastrtps::TopicAttributes& topicAtt, - const fastrtps::ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { bool ok = true; @@ -260,7 +254,7 @@ bool BuiltinProtocols::addLocalReader( bool BuiltinProtocols::updateLocalWriter( RTPSWriter* W, const TopicAttributes& topicAtt, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { bool ok = false; if (mp_PDP != nullptr && mp_PDP->getEDP() != nullptr) @@ -273,7 +267,7 @@ bool BuiltinProtocols::updateLocalWriter( bool BuiltinProtocols::updateLocalReader( RTPSReader* R, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { bool ok = false; diff --git a/src/cpp/rtps/builtin/BuiltinProtocols.h b/src/cpp/rtps/builtin/BuiltinProtocols.h new file mode 100644 index 00000000000..a2c2ccd9466 --- /dev/null +++ b/src/cpp/rtps/builtin/BuiltinProtocols.h @@ -0,0 +1,217 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file BuiltinProtocols.h + * + */ + +#ifndef _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ +#define _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include + +#include +#include + +#include + +namespace eprosima { + +namespace fastdds { +namespace dds { + +namespace builtin { + +class TypeLookupManager; + +} // namespace builtin + +class ReaderQos; +class WriterQos; +} // namespace dds +} // namespace fastdds + +namespace fastrtps { + +class TopicAttributes; + +namespace rtps { + +class PDP; +class WLP; +class RTPSParticipantImpl; +class RTPSWriter; +class RTPSReader; +class NetworkFactory; + +/** + * Class BuiltinProtocols that contains builtin endpoints implementing the discovery and liveliness protocols. + * *@ingroup BUILTIN_MODULE + */ +class BuiltinProtocols +{ + friend class RTPSParticipantImpl; + +private: + + BuiltinProtocols(); + virtual ~BuiltinProtocols(); + + /* + * Mutex to protect the m_DiscoveryServers collection. Element access is not protected by this mutex, the PDP mutex + * needs to be used when querying or modifying mutable members of the collection. + */ + mutable eprosima::shared_mutex discovery_mutex_; + +public: + + /** + * Initialize the builtin protocols. + * @param attributes Discovery configuration attributes + * @param p_part Pointer to the Participant implementation + * @return True if correct. + */ + bool initBuiltinProtocols( + RTPSParticipantImpl* p_part, + BuiltinAttributes& attributes); + + /** + * Enable the builtin protocols + */ + void enable(); + + /** + * Update the metatraffic locatorlist after it was created. Because when you create + * the EDP readers you are not sure the selected endpoints can be used. + * @param loclist LocatorList to update + * @return True on success + */ + bool updateMetatrafficLocators( + LocatorList_t& loclist); + + /** + * Traverses the list of discover servers filtering out unsupported or not allowed remote locators + * @param nf NetworkFactory used to make the filtering + */ + void filter_server_remote_locators( + NetworkFactory& nf); + + //!BuiltinAttributes of the builtin protocols. + BuiltinAttributes m_att; + //!Pointer to the RTPSParticipantImpl. + RTPSParticipantImpl* mp_participantImpl; + //!Pointer to the PDPSimple. + PDP* mp_PDP; + //!Pointer to the WLP + WLP* mp_WLP; + //!Pointer to the TypeLookupManager + fastdds::dds::builtin::TypeLookupManager* typelookup_manager_; + //!Locator list for metatraffic + LocatorList_t m_metatrafficMulticastLocatorList; + //!Locator List for metatraffic unicast + LocatorList_t m_metatrafficUnicastLocatorList; + //! Initial peers + LocatorList_t m_initialPeersList; + //! Known discovery and backup server container + std::list m_DiscoveryServers; + + /** + * Add a local Writer to the BuiltinProtocols. + * @param w Pointer to the RTPSWriter + * @param topicAtt Attributes of the associated topic + * @param wqos QoS policies dictated by the publisher + * @return True if correct. + */ + bool addLocalWriter( + RTPSWriter* w, + const TopicAttributes& topicAtt, + const fastdds::dds::WriterQos& wqos); + /** + * Add a local Reader to the BuiltinProtocols. + * @param R Pointer to the RTPSReader. + * @param topicAtt Attributes of the associated topic + * @param rqos QoS policies dictated by the subscriber + * @param content_filter Optional content filtering information. + * @return True if correct. + */ + bool addLocalReader( + RTPSReader* R, + const TopicAttributes& topicAtt, + const fastdds::dds::ReaderQos& rqos, + const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); + + /** + * Update a local Writer QOS + * @param W Writer to update + * @param topicAtt Attributes of the associated topic + * @param wqos New Writer QoS + * @return + */ + bool updateLocalWriter( + RTPSWriter* W, + const TopicAttributes& topicAtt, + const fastdds::dds::WriterQos& wqos); + /** + * Update a local Reader QOS + * @param R Reader to update + * @param topicAtt Attributes of the associated topic + * @param qos New Reader QoS + * @param content_filter Optional content filtering information. + * @return + */ + bool updateLocalReader( + RTPSReader* R, + const TopicAttributes& topicAtt, + const fastdds::dds::ReaderQos& qos, + const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); + /** + * Remove a local Writer from the builtinProtocols. + * @param W Pointer to the writer. + * @return True if correctly removed. + */ + bool removeLocalWriter( + RTPSWriter* W); + /** + * Remove a local Reader from the builtinProtocols. + * @param R Pointer to the reader. + * @return True if correctly removed. + */ + bool removeLocalReader( + RTPSReader* R); + + //! Announce RTPSParticipantState (force the sending of a DPD message.) + void announceRTPSParticipantState(); + //!Stop the RTPSParticipant Announcement (used in tests to avoid multiple packets being send) + void stopRTPSParticipantAnnouncement(); + //!Reset to timer to make periodic RTPSParticipant Announcements. + void resetRTPSParticipantAnnouncement(); + + /** + * Get Discovery mutex + * @return Associated Mutex + */ + inline eprosima::shared_mutex& getDiscoveryMutex() const + { + return discovery_mutex_; + } + +}; + +} // namespace rtps +} /* namespace rtps */ +} /* namespace eprosima */ +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ */ diff --git a/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp b/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp index 17475f93718..c06e5337d9e 100644 --- a/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp +++ b/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp @@ -25,16 +25,16 @@ #include #include #include -#include #include #include -#include #include #include -#include +#include +#include #include #include +#include #include "ProxyDataFilters.hpp" #include "ProxyHashTables.hpp" @@ -614,7 +614,7 @@ bool ParticipantProxyData::readFromCDRMessage( m_leaseDuration = p.time.to_duration_t(); lease_duration_ = - std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64( + std::chrono::microseconds(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64( m_leaseDuration)); break; } @@ -777,7 +777,9 @@ void ParticipantProxyData::copy( default_locators = pdata.default_locators; m_participantName = pdata.m_participantName; m_leaseDuration = pdata.m_leaseDuration; - lease_duration_ = std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64(pdata.m_leaseDuration)); + lease_duration_ = + std::chrono::microseconds(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64( + pdata.m_leaseDuration)); m_key = pdata.m_key; isAlive = pdata.isAlive; m_userData = pdata.m_userData; @@ -811,7 +813,8 @@ bool ParticipantProxyData::updateData( security_attributes_ = pdata.security_attributes_; plugin_security_attributes_ = pdata.plugin_security_attributes_; #endif // if HAVE_SECURITY - auto new_lease_duration = std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64(m_leaseDuration)); + auto new_lease_duration = + std::chrono::microseconds(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64(m_leaseDuration)); if (lease_duration_event != nullptr) { if (new_lease_duration < lease_duration_) diff --git a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp index 20415b6d1ae..58cba2aec6f 100644 --- a/src/cpp/rtps/builtin/data/ReaderProxyData.cpp +++ b/src/cpp/rtps/builtin/data/ReaderProxyData.cpp @@ -288,21 +288,22 @@ uint32_t ReaderProxyData::get_serialized_size( ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( m_qos.m_disablePositiveACKs); } - - if ((m_qos.data_sharing.send_always() || m_qos.data_sharing.hasChanged) && - m_qos.data_sharing.kind() != fastdds::dds::OFF) + if (m_type_information && m_type_information->assigned()) { - ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( - m_qos.data_sharing); + ret_val += + fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( + *m_type_information); } - - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_qos.type_consistency.send_always() || m_qos.type_consistency.hasChanged) { - ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_id); + ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( + m_qos.type_consistency); } - if (m_type && m_type->m_type_object._d() != 0) + if ((m_qos.data_sharing.send_always() || m_qos.data_sharing.hasChanged) && + m_qos.data_sharing.kind() != fastdds::dds::OFF) { - ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type); + ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( + m_qos.data_sharing); } if (m_properties.size() > 0) @@ -339,7 +340,8 @@ uint32_t ReaderProxyData::get_serialized_size( if (m_type_information && m_type_information->assigned()) { ret_val += - fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_information); + fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( + *m_type_information); } // PID_SENTINEL @@ -568,22 +570,14 @@ bool ReaderProxyData::writeToCDRMessage( } } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_id, msg)) + if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(* + m_type_information, msg)) { return false; } } - - if (m_type && m_type->m_type_object._d() != 0) - { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type, msg)) - { - return false; - } - } - if (m_properties.size() > 0) { if (!fastdds::dds::ParameterSerializer::add_to_cdr_message(m_properties, msg)) @@ -634,7 +628,8 @@ bool ReaderProxyData::writeToCDRMessage( if (m_type_information && m_type_information->assigned()) { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_information, msg)) + if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(* + m_type_information, msg)) { return false; } @@ -981,26 +976,20 @@ bool ReaderProxyData::readFromCDRMessage( } case fastdds::dds::PID_TYPE_IDV1: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message(type_id(), msg, - plength)) - { - return false; - } + EPROSIMA_LOG_WARNING(RTPS_PROXY_DATA, + "Reception of TypeIdentifiers is not supported. They will be ignored."); break; } case fastdds::dds::PID_TYPE_OBJECTV1: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message(type(), msg, - plength)) - { - return false; - } + EPROSIMA_LOG_WARNING(RTPS_PROXY_DATA, + "Reception of TypeObjects is not supported. They will be ignored."); break; } case fastdds::dds::PID_TYPE_INFORMATION: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message( - type_information(), msg, plength)) + if (!fastdds::dds::QosPoliciesSerializer:: + read_from_cdr_message(type_information(), msg, plength)) { return false; } @@ -1175,7 +1164,7 @@ void ReaderProxyData::clear() } if (m_type_information) { - *m_type_information = xtypes::TypeInformation(); + *m_type_information = xtypes::TypeInformationParameter(); } } diff --git a/src/cpp/rtps/builtin/data/WriterProxyData.cpp b/src/cpp/rtps/builtin/data/WriterProxyData.cpp index 5fd05d08bda..ceaad38437f 100644 --- a/src/cpp/rtps/builtin/data/WriterProxyData.cpp +++ b/src/cpp/rtps/builtin/data/WriterProxyData.cpp @@ -296,11 +296,11 @@ uint32_t WriterProxyData::get_serialized_size( { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(m_qos.m_groupData); } - if (m_type_id && m_type_id->m_type_identifier._d() != 0) + if (m_type_id && m_type_id->m_type_identifier._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_id); } - if (m_type && m_type->m_type_object._d() != 0) + if (m_type && m_type->m_type_object._d() != fastdds::dds::xtypes::TK_NONE) { ret_val += fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type); } @@ -327,7 +327,8 @@ uint32_t WriterProxyData::get_serialized_size( if (m_type_information && m_type_information->assigned()) { ret_val += - fastdds::dds::QosPoliciesSerializer::cdr_serialized_size(*m_type_information); + fastdds::dds::QosPoliciesSerializer::cdr_serialized_size( + *m_type_information); } // PID_SENTINEL @@ -570,23 +571,14 @@ bool WriterProxyData::writeToCDRMessage( return false; } } - - if (m_type_id && m_type_id->m_type_identifier._d() != 0) - { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_id, msg)) - { - return false; - } - } - - if (m_type && m_type->m_type_object._d() != 0) + if (m_type_information && m_type_information->assigned()) { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type, msg)) + if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(* + m_type_information, msg)) { return false; } } - if (m_properties.size() > 0) { if (!fastdds::dds::ParameterSerializer::add_to_cdr_message(m_properties, msg)) @@ -617,13 +609,7 @@ bool WriterProxyData::writeToCDRMessage( } } - if (m_type_information && m_type_information->assigned()) - { - if (!fastdds::dds::QosPoliciesSerializer::add_to_cdr_message(*m_type_information, msg)) - { - return false; - } - } + return fastdds::dds::ParameterSerializer::add_parameter_sentinel(msg); } @@ -968,26 +954,20 @@ bool WriterProxyData::readFromCDRMessage( } case fastdds::dds::PID_TYPE_IDV1: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message(type_id(), msg, - plength)) - { - return false; - } + EPROSIMA_LOG_WARNING(RTPS_PROXY_DATA, + "Reception of TypeIdentifiers is not supported. They will be ignored"); break; } case fastdds::dds::PID_TYPE_OBJECTV1: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message(type(), msg, - plength)) - { - return false; - } + EPROSIMA_LOG_WARNING(RTPS_PROXY_DATA, + "Reception of TypeObjects is not supported. They will be ignored"); break; } case fastdds::dds::PID_TYPE_INFORMATION: { - if (!fastdds::dds::QosPoliciesSerializer::read_from_cdr_message( - type_information(), msg, plength)) + if (!fastdds::dds::QosPoliciesSerializer:: + read_from_cdr_message(type_information(), msg, plength)) { return false; } @@ -1162,7 +1142,7 @@ void WriterProxyData::clear() } if (m_type_information) { - *m_type_information = xtypes::TypeInformation(); + *m_type_information = xtypes::TypeInformationParameter(); } } diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp index f5ca2daf801..7077b10e2c3 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.hpp @@ -27,18 +27,17 @@ #include #include -#include +#include + +#include #include #include -#include -#include #include -#include -#include #include - -#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -521,9 +520,9 @@ class DiscoveryDataBase //////////////// // Variables - fastrtps::DBQueue pdp_data_queue_; + DBQueue pdp_data_queue_; - fastrtps::DBQueue edp_data_queue_; + DBQueue edp_data_queue_; //! Covenient per-topic mapping of readers and writers to speed-up queries std::map> readers_by_topic_; diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataQueueInfo.hpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataQueueInfo.hpp index dbe8b276c42..6284fc3399d 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataQueueInfo.hpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataQueueInfo.hpp @@ -18,7 +18,6 @@ */ #include -#include #include #include @@ -87,7 +86,7 @@ class DiscoveryEDPDataQueueInfo : public DiscoveryDataQueueInfo DiscoveryEDPDataQueueInfo( eprosima::fastrtps::rtps::CacheChange_t* change, - const eprosima::fastrtps::string_255& topic) + const eprosima::fastcdr::string_255& topic) : DiscoveryDataQueueInfo(change) , topic_(topic) { @@ -97,14 +96,14 @@ class DiscoveryEDPDataQueueInfo : public DiscoveryDataQueueInfo { } - eprosima::fastrtps::string_255 topic() + eprosima::fastcdr::string_255 topic() { return topic_; } private: - const eprosima::fastrtps::string_255 topic_; + const eprosima::fastcdr::string_255 topic_; }; diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryEndpointInfo.hpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryEndpointInfo.hpp index 5acf4f9dbec..87b31ab3322 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryEndpointInfo.hpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryEndpointInfo.hpp @@ -20,11 +20,12 @@ #ifndef _FASTDDS_RTPS_DISCOVERY_ENDPOINT_INFO_H_ #define _FASTDDS_RTPS_DISCOVERY_ENDPOINT_INFO_H_ +#include + +#include + #include #include -#include - -#include #include diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp index 53ebb47275b..264f4319c2f 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp @@ -17,45 +17,37 @@ * */ -#include +#include -#include - -#include -#include -#include +#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include - -#include - -#include - -#include - -#include -#include - #include +#include #include #include +#include +#include +#include #ifdef FASTDDS_STATISTICS #include #endif //FASTDDS_STATISTICS -#include - -#include - +using namespace eprosima::fastdds::rtps; using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::types; using eprosima::fastdds::dds::PublicationMatchedStatus; using eprosima::fastdds::dds::SubscriptionMatchedStatus; using ParameterList = eprosima::fastdds::dds::ParameterList; @@ -99,7 +91,7 @@ EDP::~EDP() bool EDP::newLocalReaderProxyData( RTPSReader* reader, const TopicAttributes& att, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { EPROSIMA_LOG_INFO(RTPS_EDP, "Adding " << reader->getGuid().entityId << " in topic " << att.topicName); @@ -139,14 +131,6 @@ bool EDP::newLocalReaderProxyData( rpd->topicName(att.getTopicName()); rpd->typeName(att.getTopicDataType()); rpd->topicKind(att.getTopicKind()); - if (att.type_id.m_type_identifier._d() != static_cast(0x00)) - { - rpd->type_id(att.type_id); - } - if (att.type.m_type_object._d() != static_cast(0x00)) - { - rpd->type(att.type); - } if (att.type_information.assigned()) { rpd->type_information(att.type_information); @@ -182,44 +166,15 @@ bool EDP::newLocalReaderProxyData( #endif // if HAVE_SECURITY if (att.auto_fill_type_information) { - // TypeInformation, TypeObject and TypeIdentifier + // TypeInformation if (!att.type_information.assigned()) { - const types::TypeInformation* type_info = - types::TypeObjectFactory::get_instance()->get_type_information(rpd->typeName().c_str()); - if (type_info != nullptr) - { - rpd->type_information() = *type_info; - } - } - } - - if (att.auto_fill_type_object) - { - bool has_type_id = true; - if (att.type_id.m_type_identifier._d() == static_cast(0x00)) - { - has_type_id = false; - const types::TypeIdentifier* type_id = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - rpd->typeName().c_str()); - if (type_id != nullptr) - { - has_type_id = true; - rpd->type_id().m_type_identifier = *type_id; - } - } - - if (att.type.m_type_object._d() == static_cast(0x00)) - { - bool type_is_complete = has_type_id && - rpd->type_id().m_type_identifier._d() == types::EK_COMPLETE; - const types::TypeObject* type_obj = - types::TypeObjectFactory::get_instance()->get_type_object( - rpd->typeName().c_str(), type_is_complete); - if (type_obj != nullptr) + fastdds::dds::xtypes::TypeInformation type_info; + if (eprosima::fastdds::dds::RETCODE_OK == + eprosima::fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer() + .get_type_information(rpd->typeName().c_str(), type_info)) { - rpd->type().m_type_object = *type_obj; + rpd->type_information() = type_info; } } } @@ -229,7 +184,8 @@ bool EDP::newLocalReaderProxyData( //ADD IT TO THE LIST OF READERPROXYDATA GUID_t participant_guid; - ReaderProxyData* reader_data = this->mp_PDP->addReaderProxyData(reader->getGuid(), participant_guid, init_fun); + ReaderProxyData* reader_data = this->mp_PDP->addReaderProxyData( + reader->getGuid(), participant_guid, init_fun); if (reader_data == nullptr) { return false; @@ -257,7 +213,7 @@ bool EDP::newLocalReaderProxyData( bool EDP::newLocalWriterProxyData( RTPSWriter* writer, const TopicAttributes& att, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { EPROSIMA_LOG_INFO(RTPS_EDP, "Adding " << writer->getGuid().entityId << " in topic " << att.topicName); @@ -294,14 +250,6 @@ bool EDP::newLocalWriterProxyData( wpd->topicName(att.getTopicName()); wpd->typeName(att.getTopicDataType()); wpd->topicKind(att.getTopicKind()); - if (att.type_id.m_type_identifier._d() != static_cast(0x00)) - { - wpd->type_id(att.type_id); - } - if (att.type.m_type_object._d() != static_cast(0x00)) - { - wpd->type(att.type); - } if (att.type_information.assigned()) { wpd->type_information(att.type_information); @@ -325,44 +273,15 @@ bool EDP::newLocalWriterProxyData( if (att.auto_fill_type_information) { - // TypeInformation, TypeObject and TypeIdentifier + // TypeInformation if (!att.type_information.assigned()) { - const types::TypeInformation* type_info = - types::TypeObjectFactory::get_instance()->get_type_information(wpd->typeName().c_str()); - if (type_info != nullptr) - { - wpd->type_information() = *type_info; - } - } - } - - if (att.auto_fill_type_object) - { - bool has_type_id = true; - if (att.type_id.m_type_identifier._d() == static_cast(0x00)) - { - has_type_id = false; - const types::TypeIdentifier* type_id = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - wpd->typeName().c_str()); - if (type_id != nullptr) - { - has_type_id = true; - wpd->type_id().m_type_identifier = *type_id; - } - } - - if (att.type.m_type_object._d() == static_cast(0x00)) - { - bool type_is_complete = has_type_id && - wpd->type_id().m_type_identifier._d() == types::EK_COMPLETE; - const types::TypeObject* type_obj = - types::TypeObjectFactory::get_instance()->get_type_object( - wpd->typeName().c_str(), type_is_complete); - if (type_obj != nullptr) + fastdds::dds::xtypes::TypeInformation type_info; + if (eprosima::fastdds::dds::RETCODE_OK == + eprosima::fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer() + .get_type_information(wpd->typeName().c_str(), type_info)) { - wpd->type().m_type_object = *type_obj; + wpd->type_information() = type_info; } } } @@ -400,7 +319,7 @@ bool EDP::newLocalWriterProxyData( bool EDP::updatedLocalReader( RTPSReader* reader, const TopicAttributes& att, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { auto init_fun = [this, reader, &rqos, &att, content_filter]( @@ -448,40 +367,15 @@ bool EDP::updatedLocalReader( if (att.auto_fill_type_information) { - // TypeInformation, TypeObject and TypeIdentifier + // TypeInformation if (!rdata->type_information().assigned()) { - const types::TypeInformation* type_info = - types::TypeObjectFactory::get_instance()->get_type_information(rdata->typeName().c_str()); - if (type_info != nullptr) + fastdds::dds::xtypes::TypeInformation type_info; + if (eprosima::fastdds::dds::RETCODE_OK == + eprosima::fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer() + .get_type_information(rdata->typeName().c_str(), type_info)) { - rdata->type_information() = *type_info; - } - } - } - - if (att.auto_fill_type_object) - { - - if (rdata->type_id().m_type_identifier._d() == static_cast(0x00)) - { - const types::TypeIdentifier* type_id = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - rdata->typeName().c_str()); - if (type_id != nullptr) - { - rdata->type_id().m_type_identifier = *type_id; - } - } - - if (rdata->type().m_type_object._d() == static_cast(0x00)) - { - const types::TypeObject* type_obj = - types::TypeObjectFactory::get_instance()->get_type_object( - rdata->typeName().c_str(), rdata->type_id().m_type_identifier._d() == types::EK_COMPLETE); - if (type_obj != nullptr) - { - rdata->type().m_type_object = *type_obj; + rdata->type_information() = type_info; } } } @@ -514,7 +408,7 @@ bool EDP::updatedLocalReader( bool EDP::updatedLocalWriter( RTPSWriter* writer, const TopicAttributes& att, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { auto init_fun = [this, writer, &wqos, &att]( WriterProxyData* wdata, @@ -540,40 +434,15 @@ bool EDP::updatedLocalWriter( if (att.auto_fill_type_information) { - // TypeInformation, TypeObject and TypeIdentifier + // TypeInformation if (!wdata->type_information().assigned()) { - const types::TypeInformation* type_info = - types::TypeObjectFactory::get_instance()->get_type_information(wdata->typeName().c_str()); - if (type_info != nullptr) - { - wdata->type_information() = *type_info; - } - } - } - - if (att.auto_fill_type_object) - { - - if (wdata->type_id().m_type_identifier._d() == static_cast(0x00)) - { - const types::TypeIdentifier* type_id = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - wdata->typeName().c_str()); - if (type_id != nullptr) - { - wdata->type_id().m_type_identifier = *type_id; - } - } - - if (wdata->type().m_type_object._d() == static_cast(0x00)) - { - const types::TypeObject* type_obj = - types::TypeObjectFactory::get_instance()->get_type_object( - wdata->typeName().c_str(), wdata->type_id().m_type_identifier._d() == types::EK_COMPLETE); - if (type_obj != nullptr) + fastdds::dds::xtypes::TypeInformation type_info; + if (eprosima::fastdds::dds::RETCODE_OK == + eprosima::fastrtps::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer() + .get_type_information(wdata->typeName().c_str(), type_info)) { - wdata->type().m_type_object = *type_obj; + wdata->type_information() = type_info; } } } @@ -709,12 +578,22 @@ bool EDP::valid_matching( return false; } - // Type Consistency Enforcement QosPolicy - if (!checkTypeValidation(wdata, rdata)) + if ((wdata->has_type_information() && wdata->type_information().assigned()) && + (rdata->has_type_information() && rdata->type_information().assigned())) { - // TODO Trigger INCONSISTENT_TOPIC status change - reason.set(MatchingFailureMask::inconsistent_topic); - return false; + if (wdata->type_information().type_information != rdata->type_information().type_information) + { + reason.set(MatchingFailureMask::different_typeinfo); + return false; + } + } + else + { + if (wdata->typeName() != rdata->typeName()) + { + reason.set(MatchingFailureMask::inconsistent_topic); + return false; + } } if (wdata->topicKind() != rdata->topicKind()) @@ -722,7 +601,6 @@ bool EDP::valid_matching( EPROSIMA_LOG_WARNING(RTPS_EDP, "INCOMPATIBLE QOS:Remote Reader " << rdata->guid() << " is publishing in topic " << rdata->topicName() << "(keyed:" << rdata->topicKind() << "), local writer publishes as keyed: " << wdata->topicKind()); - reason.set(MatchingFailureMask::inconsistent_topic); return false; } @@ -910,25 +788,6 @@ bool EDP::checkDataRepresentationQos( return compatible; } -bool EDP::checkTypeValidation( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const -{ - // Step 1: Both specify a TypeObject - if (hasTypeObject(wdata, rdata)) - { - return checkTypeObject(wdata, rdata); - } - // Not explicitely said in the standard, but is not done, what's the intention of TypeIdV1? - if (hasTypeIdentifier(wdata, rdata)) - { - return checkTypeIdentifier(wdata, rdata); - } - - // Step 2: Writer or reader doesn't specify a TypeObject - return !rdata->m_qos.type_consistency.m_force_type_validation && (wdata->typeName() == rdata->typeName()); -} - bool EDP::validMatching( const ReaderProxyData* rdata, const WriterProxyData* wdata) @@ -1532,7 +1391,6 @@ bool EDP::pairing_remote_writer_with_local_reader_after_security( { found = true; - // TODO(richiware) Implement and use move with attributes if (r.matched_writer_add(remote_writer_data)) { EPROSIMA_LOG_INFO(RTPS_EDP, "Valid Matching to local reader: " << readerGUID.entityId); @@ -1566,143 +1424,6 @@ bool EDP::pairing_remote_writer_with_local_reader_after_security( #endif // if HAVE_SECURITY -bool EDP::checkTypeIdentifier( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const -{ - // TODO - Remove once XCDR or XCDR2 is implemented. - TypeConsistencyEnforcementQosPolicy coercion; - coercion.m_kind = DISALLOW_TYPE_COERCION; - coercion.m_ignore_member_names = false; - coercion.m_ignore_string_bounds = false; - coercion.m_force_type_validation = true; - coercion.m_prevent_type_widening = true; - coercion.m_ignore_sequence_bounds = false; - return wdata->type_id().m_type_identifier._d() != static_cast(0x00) && - wdata->type_id().m_type_identifier.consistent( - //rdata->type_id().m_type_identifier, rdata->m_qos.type_consistency); - rdata->type_id().m_type_identifier, coercion); -} - -bool EDP::hasTypeIdentifier( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const -{ - return wdata->has_type_id() && wdata->type_id().m_type_identifier._d() != static_cast(0x00) && - rdata->has_type_id() && rdata->type_id().m_type_identifier._d() != static_cast(0x00); -} - -bool EDP::checkTypeObject( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const -{ - if (wdata->has_type_information() && wdata->type_information().assigned() && - rdata->has_type_information() && rdata->type_information().assigned()) - { - const types::TypeIdentifier* rtype = nullptr; - const types::TypeIdentifier* wtype = nullptr; - - if (wdata->type_information().type_information.complete().typeid_with_size().type_id()._d() != - static_cast(0x00) && - rdata->type_information().type_information.complete().typeid_with_size().type_id()._d() != - static_cast(0x00)) - { - rtype = &rdata->type_information().type_information.complete().typeid_with_size().type_id(); - wtype = &wdata->type_information().type_information.complete().typeid_with_size().type_id(); - } - else if (wdata->type_information().type_information.minimal().typeid_with_size().type_id()._d() != - static_cast(0x00) && - rdata->type_information().type_information.minimal().typeid_with_size().type_id()._d() != - static_cast(0x00)) - { - rtype = &rdata->type_information().type_information.minimal().typeid_with_size().type_id(); - wtype = &wdata->type_information().type_information.minimal().typeid_with_size().type_id(); - } - - if (wtype != nullptr) - { - // TODO - Remove once XCDR or XCDR2 is implemented. - /* - * Currently consistency checks are applied to type structure and compatibility, - * but doesn't check about annotations behavior. - * This may cause false matching cases with annotations @key or @non_serialize, - * for example. - * Once XCDR or XCDR2 is implemented, is it doesn't solve this cases, we must - * think about this problem and how consistency could solve it. - */ - TypeConsistencyEnforcementQosPolicy coercion; - coercion.m_kind = DISALLOW_TYPE_COERCION; - coercion.m_ignore_member_names = false; - coercion.m_ignore_string_bounds = false; - coercion.m_force_type_validation = true; - coercion.m_prevent_type_widening = true; - coercion.m_ignore_sequence_bounds = false; - //return wtype->consistent(*rtype, rdata->m_qos.type_consistency); - return wtype->consistent(*rtype, coercion); - } - - return false; - } - - if (wdata->has_type() && wdata->type().m_type_object._d() != static_cast(0x00) && - rdata->has_type() && rdata->type().m_type_object._d() != static_cast(0x00)) - { - // TODO - Remove once XCDR or XCDR2 is implemented. - /* - * Currently consistency checks are applied to type structure and compatibility, - * but doesn't check about annotations behavior. - * This may cause false matching cases with annotations @key or @non_serialize, - * for example. - * Once XCDR or XCDR2 is implemented, is it doesn't solve this cases, we must - * think about this problem and how consistency could solve it. - */ - TypeConsistencyEnforcementQosPolicy coercion; - coercion.m_kind = DISALLOW_TYPE_COERCION; - coercion.m_ignore_member_names = false; - coercion.m_ignore_string_bounds = false; - coercion.m_force_type_validation = true; - coercion.m_prevent_type_widening = true; - coercion.m_ignore_sequence_bounds = false; - //return wdata->type().m_type_object.consistent(rdata->type().m_type_object, rdata->m_qos.type_consistency); - return wdata->type().m_type_object.consistent(rdata->type().m_type_object, coercion); - } - - return false; -} - -bool EDP::hasTypeObject( - const WriterProxyData* wdata, - const ReaderProxyData* rdata) const -{ - if (wdata->has_type_information() && wdata->type_information().assigned() && - rdata->has_type_information() && rdata->type_information().assigned()) - { - if (wdata->type_information().type_information.complete().typeid_with_size().type_id()._d() != - static_cast(0x00) && - rdata->type_information().type_information.complete().typeid_with_size().type_id()._d() != - static_cast(0x00)) - { - return true; - } - else if (wdata->type_information().type_information.minimal().typeid_with_size().type_id()._d() != - static_cast(0x00) && - rdata->type_information().type_information.minimal().typeid_with_size().type_id()._d() != - static_cast(0x00)) - { - return true; - } - return false; - } - - if (wdata->has_type() && wdata->type().m_type_object._d() != static_cast(0x00) && - rdata->has_type() && rdata->type().m_type_object._d() != static_cast(0x00)) - { - return true; - } - - return false; -} - const SubscriptionMatchedStatus& EDP::update_subscription_matched_status( const GUID_t& reader_guid, const GUID_t& writer_guid, @@ -1760,5 +1481,6 @@ const fastdds::dds::PublicationMatchedStatus& EDP::update_publication_matched_st } } // namespace rtps + } // namespace fastrtps } // namespace eprosima diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDP.h b/src/cpp/rtps/builtin/discovery/endpoint/EDP.h new file mode 100644 index 00000000000..e105c64d5d8 --- /dev/null +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDP.h @@ -0,0 +1,419 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file EDP.h + * + */ + +#ifndef _FASTDDS_RTPS_EDP_H_ +#define _FASTDDS_RTPS_EDP_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define MATCH_FAILURE_REASON_COUNT size_t(16) + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +class TypeIdentifier; + +} // namespace xtypes +} // namespace dds +} // namespace fastdds + +namespace fastrtps { + +class TopicAttributes; + +namespace rtps { + +class PDP; +class ParticipantProxyData; +class RTPSWriter; +class RTPSReader; +class WriterProxyData; +class RTPSParticipantImpl; + +/** + * Class EDP, base class for Endpoint Discovery Protocols. It contains generic methods used by the two EDP implemented (EDPSimple and EDPStatic), as well as abstract methods + * definitions required by the specific implementations. + * @ingroup DISCOVERY_MODULE + */ +class EDP +{ +public: + + /** + * Mask to hold the reasons why two endpoints do not match. + */ + class MatchingFailureMask : public std::bitset + { + public: + + //! Bit index for matching failing due to different topic + static const uint32_t different_topic = (0x00000001 << 0u); + + //! Bit index for matching failing due to inconsistent topic (same topic name but different characteristics) + static const uint32_t inconsistent_topic = (0x00000001 << 1u); + + //! Bit index for matching failing due to incompatible QoS + static const uint32_t incompatible_qos = (0x00000001 << 2u); + + //! Bit index for matching failing due to inconsistent partitions + static const uint32_t partitions = (0x00000001 << 3u); + + //! Bit index for matching failing due to incompatible TypeInformation + static const uint32_t different_typeinfo = (0x00000001 << 4u); + }; + + /** + * Constructor. + * @param p Pointer to the PDPSimple + * @param part Pointer to the RTPSParticipantImpl + */ + EDP( + PDP* p, + RTPSParticipantImpl* part); + virtual ~EDP(); + + /** + * Abstract method to initialize the EDP. + * @param attributes DiscoveryAttributes structure. + * @return True if correct. + */ + virtual bool initEDP( + BuiltinAttributes& attributes) = 0; + /** + * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered. + * @param pdata Discovered ParticipantProxyData + * @param assign_secure_endpoints Whether to try assigning secure endpoints + */ + virtual void assignRemoteEndpoints( + const ParticipantProxyData& pdata, + bool assign_secure_endpoints) = 0; + /** + * Remove remote endpoints from the endpoint discovery protocol + * @param pdata Pointer to the ParticipantProxyData to remove + */ + virtual void removeRemoteEndpoints( + ParticipantProxyData* pdata) + { + (void) pdata; + } + + //! Verify whether the given participant EDP endpoints are matched with us + virtual bool areRemoteEndpointsMatched( + const ParticipantProxyData*) + { + return false; + } + + /** + * Abstract method that removes a local Reader from the discovery method + * @param R Pointer to the Reader to remove. + * @return True if correctly removed. + */ + virtual bool removeLocalReader( + RTPSReader* R) = 0; + /** + * Abstract method that removes a local Writer from the discovery method + * @param W Pointer to the Writer to remove. + * @return True if correctly removed. + */ + virtual bool removeLocalWriter( + RTPSWriter* W) = 0; + + /** + * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation). + * @param reader Pointer to the Reader object. + * @param rdata Pointer to the ReaderProxyData object. + * @return True if correct. + */ + virtual bool processLocalReaderProxyData( + RTPSReader* reader, + ReaderProxyData* rdata) = 0; + + /** + * After a new local WriterProxyData has been created some processing is needed (depends on the implementation). + * @param writer Pointer to the Writer object. + * @param wdata Pointer to the Writer ProxyData object. + * @return True if correct. + */ + virtual bool processLocalWriterProxyData( + RTPSWriter* writer, + WriterProxyData* wdata) = 0; + + /** + * Create a new ReaderPD for a local Reader. + * @param R Pointer to the RTPSReader. + * @param att Attributes of the associated topic + * @param qos QoS policies dictated by the subscriber + * @param content_filter Optional content filtering information. + * @return True if correct. + */ + bool newLocalReaderProxyData( + RTPSReader* R, + const TopicAttributes& att, + const fastdds::dds::ReaderQos& qos, + const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); + /** + * Create a new ReaderPD for a local Writer. + * @param W Pointer to the RTPSWriter. + * @param att Attributes of the associated topic + * @param qos QoS policies dictated by the publisher + * @return True if correct. + */ + bool newLocalWriterProxyData( + RTPSWriter* W, + const TopicAttributes& att, + const fastdds::dds::WriterQos& qos); + /** + * A previously created Reader has been updated + * @param R Pointer to the reader + * @param att Attributes of the associated topic + * @param qos QoS policies dictated by the subscriber + * @param content_filter Optional content filtering information. + * @return True if correctly updated + */ + bool updatedLocalReader( + RTPSReader* R, + const TopicAttributes& att, + const fastdds::dds::ReaderQos& qos, + const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); + /** + * A previously created Writer has been updated + * @param W Pointer to the Writer + * @param att Attributes of the associated topic + * @param qos QoS policies dictated by the publisher + * @return True if correctly updated + */ + bool updatedLocalWriter( + RTPSWriter* W, + const TopicAttributes& att, + const fastdds::dds::WriterQos& qos); + + /** + * Check the validity of a matching between a local RTPSWriter and a ReaderProxyData object. + * @param wdata Pointer to the WriterProxyData object of the local RTPSWriter. + * @param rdata Pointer to the ReaderProxyData object. + * @return True if the two can be matched. + */ + bool validMatching( + const WriterProxyData* wdata, + const ReaderProxyData* rdata); + + /** + * Check the validity of a matching between a local RTPSReader and a WriterProxyData object. + * @param rdata Pointer to the ReaderProxyData object of the local RTPSReader. + * @param wdata Pointer to the WriterProxyData object. + * @return True if the two can be matched. + */ + bool validMatching( + const ReaderProxyData* rdata, + const WriterProxyData* wdata); + + /** + * Check the validity of a matching between a local RTPSWriter and a ReaderProxyData object. + * @param wdata Pointer to the WriterProxyData object of the local RTPSWriter. + * @param rdata Pointer to the ReaderProxyData object. + * @param [out] reason On return will specify the reason of failed matching (if any). + * @param [out] incompatible_qos On return will specify all the QoS values that were incompatible (if any). + * @return True if the two can be matched. + */ + bool valid_matching( + const WriterProxyData* wdata, + const ReaderProxyData* rdata, + MatchingFailureMask& reason, + fastdds::dds::PolicyMask& incompatible_qos); + + /** + * Check the validity of a matching between a local RTPSReader and a WriterProxyData object. + * @param rdata Pointer to the ReaderProxyData object of the local RTPSReader. + * @param wdata Pointer to the WriterProxyData object. + * @param [out] reason On return will specify the reason of failed matching (if any). + * @param [out] incompatible_qos On return will specify all the QoS values that were incompatible (if any). + * @return True if the two can be matched. + */ + bool valid_matching( + const ReaderProxyData* rdata, + const WriterProxyData* wdata, + MatchingFailureMask& reason, + fastdds::dds::PolicyMask& incompatible_qos); + + /** + * Unpair a WriterProxyData object from all local readers. + * @param participant_guid GUID of the participant. + * @param writer_guid GUID of the writer. + * @param removed_by_lease Whether the writer is being unpaired due to a participant drop. + * @return True if correct. + */ + bool unpairWriterProxy( + const GUID_t& participant_guid, + const GUID_t& writer_guid, + bool removed_by_lease); + + /** + * Unpair a ReaderProxyData object from all local writers. + * @param participant_guid GUID of the participant. + * @param reader_guid GUID of the reader. + * @return True if correct. + */ + bool unpairReaderProxy( + const GUID_t& participant_guid, + const GUID_t& reader_guid); + + /** + * Try to pair/unpair ReaderProxyData. + * @param participant_guid Identifier of the participant. + * @param rdata Pointer to the ReaderProxyData object. + * @return True. + */ + bool pairing_reader_proxy_with_any_local_writer( + const GUID_t& participant_guid, + ReaderProxyData* rdata); + +#if HAVE_SECURITY + bool pairing_reader_proxy_with_local_writer( + const GUID_t& local_writer, + const GUID_t& remote_participant_guid, + ReaderProxyData& rdata); + + bool pairing_remote_reader_with_local_writer_after_security( + const GUID_t& local_writer, + const ReaderProxyData& remote_reader_data); +#endif // if HAVE_SECURITY + + /** + * Try to pair/unpair WriterProxyData. + * @param participant_guid Identifier of the participant. + * @param wdata Pointer to the WriterProxyData. + * @return True. + */ + bool pairing_writer_proxy_with_any_local_reader( + const GUID_t& participant_guid, + WriterProxyData* wdata); + +#if HAVE_SECURITY + bool pairing_writer_proxy_with_local_reader( + const GUID_t& local_reader, + const GUID_t& remote_participant_guid, + WriterProxyData& wdata); + + bool pairing_remote_writer_with_local_reader_after_security( + const GUID_t& local_reader, + const WriterProxyData& remote_writer_data); + + virtual bool pairing_remote_writer_with_local_builtin_reader_after_security( + const GUID_t& /*local_reader*/, + const WriterProxyData& /*remote_writer_data*/) + { + return false; + } + + virtual bool pairing_remote_reader_with_local_builtin_writer_after_security( + const GUID_t& /*local_writer*/, + const ReaderProxyData& /*remote_reader_data*/) + { + return false; + } + +#endif // if HAVE_SECURITY + const fastdds::dds::SubscriptionMatchedStatus& update_subscription_matched_status( + const GUID_t& reader_guid, + const GUID_t& writer_guid, + int change); + + const fastdds::dds::PublicationMatchedStatus& update_publication_matched_status( + const GUID_t& reader_guid, + const GUID_t& writer_guid, + int change); + + //! Pointer to the PDP object that contains the endpoint discovery protocol. + PDP* mp_PDP; + //! Pointer to the RTPSParticipant. + RTPSParticipantImpl* mp_RTPSParticipant; + + /** + * Access the temporary proxy pool for reader proxies + * @return pool reference + */ + ProxyPool& get_temporary_reader_proxies_pool(); + + /** + * Access the temporary proxy pool for writer proxies + * @return pool reference + */ + ProxyPool& get_temporary_writer_proxies_pool(); + +private: + + /** + * Try to pair/unpair a local Reader against all possible writerProxy Data. + * @param R Pointer to the Reader + * @param participant_guid + * @param rdata + * @return True + */ + bool pairingReader( + RTPSReader* R, + const GUID_t& participant_guid, + const ReaderProxyData& rdata); + /** + * Try to pair/unpair a local Writer against all possible readerProxy Data. + * @param W Pointer to the Writer + * @param participant_guid + * @param wdata + * @return True + */ + bool pairingWriter( + RTPSWriter* W, + const GUID_t& participant_guid, + const WriterProxyData& wdata); + + bool checkDataRepresentationQos( + const WriterProxyData* wdata, + const ReaderProxyData* rdata) const; + + using pool_allocator_t = + foonathan::memory::memory_pool; + + pool_allocator_t reader_status_allocator_; + pool_allocator_t writer_status_allocator_; + + foonathan::memory::map reader_status_; + foonathan::memory::map writer_status_; +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_EDP_H_ */ diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp index 5dbba385624..9355eb3348e 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp @@ -17,19 +17,19 @@ * */ -#include -#include -#include -#include -#include -#include -#include - -#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include + +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.h b/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.h index 918e1431d53..044069e197b 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.h +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.h @@ -21,7 +21,7 @@ #define _FASTDDS_RTPS_EDPCLIENT_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp index df2d1cdcaa1..09cb3132888 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp @@ -16,6 +16,8 @@ * @file EDPServer.cpp * */ +#include +#include #include #include @@ -24,11 +26,6 @@ #include #include -#include - -#include -#include - using namespace ::eprosima::fastrtps::rtps; namespace eprosima { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.hpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.hpp index 88360adcfef..c8363b23beb 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.hpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.hpp @@ -21,11 +21,12 @@ #define _FASTDDS_RTPS_EDPSERVER2_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include #include -#include +#include + #include -#include +#include +#include #include namespace eprosima { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp index aface87689e..23c4156e7f3 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp @@ -16,20 +16,16 @@ * @file EDPServerListener.cpp * */ +#include +#include +#include #include #include #include #include -#include - #include - -#include -#include -#include - namespace eprosima { namespace fastdds { namespace rtps { @@ -66,8 +62,7 @@ void EDPServerPUBListener::onNewCacheChangeAdded( EPROSIMA_LOG_WARNING(RTPS_EDP_LISTENER, "Received change with no Key"); } - // Get writer's GUID and EDP publications' reader history - GUID_t auxGUID = iHandle2GUID(change->instanceHandle); + // Get EDP publications' reader history ReaderHistory* reader_history = reader->getHistory(); // Related_sample_identity could be lost in message delivered, so we set as sample_identity @@ -82,49 +77,62 @@ void EDPServerPUBListener::onNewCacheChangeAdded( change->writer_info.previous = nullptr; change->writer_info.num_sent_submessages = 0; - // String to store the topic of the writer - std::string topic_name = ""; - // DATA(w) case: new writer or updated information about an existing writer if (change->kind == ALIVE) { + EndpointAddedCallback writer_added_callback = + std::bind(&EDPServerPUBListener::continue_with_writer, this, reader, change); + // Note: add_writer_from_change() removes the change from the EDP publications' reader history, but it does not // return it to the pool - add_writer_from_change(reader, reader_history, change, sedp_, false); + add_writer_from_change(reader, reader_history, change, sedp_, false, writer_added_callback); - // Retrieve the topic after creating the WriterProxyData (in add_writer_from_change()). This way, not matter + // DATA(w) case: Retrieve the topic after creating the WriterProxyData (in add_writer_from_change()). This way, not matter // whether the DATA(w) is a new one or an update, the WriterProxyData exists, and so the topic can be retrieved - auto temp_writer_data = get_pdp()->get_temporary_writer_proxies_pool().get(); - if (get_pdp()->lookupWriterProxyData(auxGUID, *temp_writer_data)) - { - topic_name = temp_writer_data->topicName().to_string(); - } + + // Stop and wait for callback in case of TypeLookupService needed time to process the types + return; } // DATA(Uw) case else { EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, "Disposed Remote Writer, removing..."); - // Retrieve the topic before removing the WriterProxyData. We need it to add the DATA(Uw) to the database - auto temp_writer_data = get_pdp()->get_temporary_writer_proxies_pool().get(); - if (get_pdp()->lookupWriterProxyData(auxGUID, *temp_writer_data)) - { - topic_name = temp_writer_data->topicName().to_string(); - } - else - { - EPROSIMA_LOG_WARNING(RTPS_EDP_LISTENER, "Writer Proxy Data missing for change " << auxGUID); - } - + // DATA(Uw) case: Retrieve the topic before removing the WriterProxyData. We need it to add the DATA(Uw) to the database + GUID_t auxGUID = iHandle2GUID(change->instanceHandle); + std::string topic_name = get_writer_proxy_topic_name(auxGUID); // Remove WriterProxy data information get_pdp()->removeWriterProxyData(auxGUID); - // Removing change from history, not returning the change to the pool, since the ownership will be yielded to - // the database + // Removing change from history, not returning the change to the pool, since the ownership will be yielded to the database reader_history->remove_change(reader_history->find_change(change), false); + + notify_discoverydatabase(topic_name, reader, change); } +} +std::string EDPServerPUBListener::get_writer_proxy_topic_name( + GUID_t auxGUID) +{ + std::string topic_name = ""; + auto temp_writer_data = get_pdp()->get_temporary_writer_proxies_pool().get(); + if (get_pdp()->lookupWriterProxyData(auxGUID, *temp_writer_data)) + { + topic_name = temp_writer_data->topicName().to_string(); + } + else + { + EPROSIMA_LOG_WARNING(RTPS_EDP_LISTENER, "Writer Proxy Data missing for change " << auxGUID); + } + return topic_name; +} + +void EDPServerPUBListener::notify_discoverydatabase( + std::string topic_name, + RTPSReader* reader, + CacheChange_t* change) +{ // Notify the DiscoveryDataBase if it is enabled already // In case it is not enable, the change should not be updated or released because it is been // updated from a backup @@ -144,12 +152,21 @@ void EDPServerPUBListener::onNewCacheChangeAdded( reader->releaseCache(change); } } + EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, "-------------------- " << sedp_->mp_RTPSParticipant->getGuid() << " --------------------"); EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, "------------------ EDP PUB SERVER LISTENER END ------------------"); EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, ""); } +void EDPServerPUBListener::continue_with_writer( + RTPSReader* reader, + CacheChange_t* change) +{ + std::string topic_name = get_writer_proxy_topic_name(iHandle2GUID(change->instanceHandle)); + notify_discoverydatabase(topic_name, reader, change); +} + PDPServer* EDPServerSUBListener::get_pdp() { return sedp_->get_pdp(); @@ -192,31 +209,24 @@ void EDPServerSUBListener::onNewCacheChangeAdded( change->writer_info.previous = nullptr; change->writer_info.num_sent_submessages = 0; - // Get readers's GUID and EDP subscriptions' reader history - GUID_t auxGUID = iHandle2GUID(change->instanceHandle); + // Get EDP subscriptions' reader history ReaderHistory* reader_history = reader->getHistory(); - // String to store the topic of the reader - std::string topic_name = ""; - // DATA(r) case: new reader or updated information about an existing reader if (change->kind == ALIVE) { + EndpointAddedCallback reader_added_callback = + std::bind(&EDPServerSUBListener::continue_with_reader, this, reader, change); + // Note: add_reader_from_change() removes the change from the EDP subscriptions' reader history, but it does not // return it to the pool - add_reader_from_change(reader, reader_history, change, sedp_, false); + add_reader_from_change(reader, reader_history, change, sedp_, false, reader_added_callback); - // Retrieve the topic after creating the ReaderProxyData (in add_reader_from_change()). This way, not matter + // DATA(w) case: Retrieve the topic after creating the ReaderProxyData (in add_reader_from_change()). This way, not matter // whether the DATA(r) is a new one or an update, the ReaderProxyData exists, and so the topic can be retrieved - auto temp_reader_data = get_pdp()->get_temporary_reader_proxies_pool().get(); - if (get_pdp()->lookupReaderProxyData(auxGUID, *temp_reader_data)) - { - topic_name = temp_reader_data->topicName().to_string(); - } - else - { - EPROSIMA_LOG_WARNING(RTPS_EDP_LISTENER, "Reader Proxy Data missing for change " << auxGUID); - } + + // Stop and wait for callback in case of TypeLookupService needed time to process the types + return; } // DATA(Ur) case else @@ -224,12 +234,9 @@ void EDPServerSUBListener::onNewCacheChangeAdded( //REMOVE WRITER FROM OUR READERS: EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, "Disposed Remote Reader, removing..."); - // Retrieve the topic before removing the ReaderProxyData. We need it to add the DATA(Ur) to the database - auto temp_reader_data = get_pdp()->get_temporary_reader_proxies_pool().get(); - if (get_pdp()->lookupReaderProxyData(auxGUID, *temp_reader_data)) - { - topic_name = temp_reader_data->topicName().to_string(); - } + // DATA(Uw) case: Retrieve the topic before removing the ReaderProxyData. We need it to add the DATA(Ur) to the database + GUID_t auxGUID = iHandle2GUID(change->instanceHandle); + std::string topic_name = get_reader_proxy_topic_name(auxGUID); // Remove ReaderProxy data information get_pdp()->removeReaderProxyData(auxGUID); @@ -237,8 +244,32 @@ void EDPServerSUBListener::onNewCacheChangeAdded( // Removing change from history, not returning the change to the pool, since the ownership will be yielded to // the database reader_history->remove_change(reader_history->find_change(change), false); + + notify_discoverydatabase(topic_name, reader, change); } +} +std::string EDPServerSUBListener::get_reader_proxy_topic_name( + GUID_t auxGUID) +{ + std::string topic_name = ""; + auto temp_reader_data = get_pdp()->get_temporary_reader_proxies_pool().get(); + if (get_pdp()->lookupReaderProxyData(auxGUID, *temp_reader_data)) + { + topic_name = temp_reader_data->topicName().to_string(); + } + else + { + EPROSIMA_LOG_WARNING(RTPS_EDP_LISTENER, "Reader Proxy Data missing for change " << auxGUID); + } + return topic_name; +} + +void EDPServerSUBListener::notify_discoverydatabase( + std::string topic_name, + RTPSReader* reader, + CacheChange_t* change) +{ // Notify the DiscoveryDataBase if it is enabled already // In case it is not enable, the change should not be updated or released because it is been // updated from a backup @@ -265,6 +296,14 @@ void EDPServerSUBListener::onNewCacheChangeAdded( EPROSIMA_LOG_INFO(RTPS_EDP_LISTENER, ""); } +void EDPServerSUBListener::continue_with_reader( + RTPSReader* reader, + CacheChange_t* change) +{ + std::string topic_name = get_reader_proxy_topic_name(iHandle2GUID(change->instanceHandle)); + notify_discoverydatabase(topic_name, reader, change); +} + } /* namespace rtps */ } // namespace fastdds } /* namespace eprosima */ diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.hpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.hpp index 8a3d1bd4694..5dd370ec426 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.hpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.hpp @@ -74,6 +74,18 @@ class EDPServerPUBListener : public fastrtps::rtps::EDPBasePUBListener private: + std::string get_writer_proxy_topic_name( + fastrtps::rtps::GUID_t auxGUID); + + void notify_discoverydatabase( + std::string topic_name, + fastrtps::rtps::RTPSReader* reader, + fastrtps::rtps::CacheChange_t* change); + + void continue_with_writer( + fastrtps::rtps::RTPSReader* reader, + fastrtps::rtps::CacheChange_t* change); + //!Pointer to the EDPServer EDPServer* sedp_; }; @@ -108,6 +120,18 @@ class EDPServerSUBListener : public fastrtps::rtps::EDPBaseSUBListener private: + std::string get_reader_proxy_topic_name( + fastrtps::rtps::GUID_t auxGUID); + + void notify_discoverydatabase( + std::string topic_name, + fastrtps::rtps::RTPSReader* reader, + fastrtps::rtps::CacheChange_t* change); + + void continue_with_reader( + fastrtps::rtps::RTPSReader* reader, + fastrtps::rtps::CacheChange_t* change); + //!Pointer to the EDPServer EDPServer* sedp_; }; diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp index 521400becce..2d6a6302e26 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp @@ -17,36 +17,35 @@ * */ +#include + +#include +#include +#include + #include -#include -#include -#include -#include -#include -#include +#include #include -#include #include +#include +#include +#include +#include #include #include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include +#include +#include #include #ifdef FASTDDS_STATISTICS #include #endif //FASTDDS_STATISTICS -#include - -#include -#include -#include - using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.h b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.h new file mode 100644 index 00000000000..fb9e3b7f819 --- /dev/null +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.h @@ -0,0 +1,293 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file EDPSimple.h + * + */ + +#ifndef _FASTDDS_RTPS_EDPSIMPLE_H_ +#define _FASTDDS_RTPS_EDPSIMPLE_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include + +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class StatefulReader; +class StatefulWriter; +class RTPSWriter; +class RTPSReader; +class ReaderHistory; +class WriterHistory; +class HistoryAttributes; +class ReaderAttributes; +class WriterAttributes; +class EDPListener; +class ITopicPayloadPool; + +/** + * Class EDPSimple, implements the Simple Endpoint Discovery Protocol defined in the RTPS specification. + * Inherits from EDP class. + *@ingroup DISCOVERY_MODULE + */ +class EDPSimple : public EDP +{ + using t_p_StatefulWriter = std::pair; + using t_p_StatefulReader = std::pair; + +public: + + typedef std::set key_list; + + /** + * Constructor. + * @param p Pointer to the PDP + * @param part Pointer to the RTPSParticipantImpl + */ + EDPSimple( + PDP* p, + RTPSParticipantImpl* part); + + virtual ~EDPSimple(); + //!Discovery attributes. + BuiltinAttributes m_discovery; + //!Pointer to the Publications Writer (only created if indicated in the DiscoveryAtributes). + t_p_StatefulWriter publications_writer_; + //!Pointer to the Subscriptions Writer (only created if indicated in the DiscoveryAtributes). + t_p_StatefulWriter subscriptions_writer_; + //!Pointer to the Publications Reader (only created if indicated in the DiscoveryAtributes). + t_p_StatefulReader publications_reader_; + //!Pointer to the Subscriptions Reader (only created if indicated in the DiscoveryAtributes). + t_p_StatefulReader subscriptions_reader_; + +#if HAVE_SECURITY + t_p_StatefulWriter publications_secure_writer_; + + t_p_StatefulReader publications_secure_reader_; + + t_p_StatefulWriter subscriptions_secure_writer_; + + t_p_StatefulReader subscriptions_secure_reader_; +#endif // if HAVE_SECURITY + + //!Pointer to the listener associated with PubReader and PubWriter. + EDPListener* publications_listener_; + + //!Pointer to the listener associated with SubReader and SubWriter. + EDPListener* subscriptions_listener_; + + /** + * Initialization method. + * @param attributes Reference to the DiscoveryAttributes. + * @return True if correct. + */ + bool initEDP( + BuiltinAttributes& attributes) override; + /** + * This method assigns the remote builtin endpoints that the remote RTPSParticipant indicates is using to our local builtin endpoints. + * @param pdata Pointer to the RTPSParticipantProxyData object. + * @param assign_secure_endpoints Whether to try assigning secure endpoints + */ + void assignRemoteEndpoints( + const ParticipantProxyData& pdata, + bool assign_secure_endpoints) override; + /** + * Remove remote endpoints from the endpoint discovery protocol + * @param pdata Pointer to the ParticipantProxyData to remove + */ + void removeRemoteEndpoints( + ParticipantProxyData* pdata) override; + + //! Verify whether the given participant EDP endpoints are matched with us + bool areRemoteEndpointsMatched( + const ParticipantProxyData* pdata) override; + + /** + * This method generates the corresponding change in the subscription writer and send it to all known remote endpoints. + * @param reader Pointer to the Reader object. + * @param rdata Pointer to the ReaderProxyData object. + * @return true if correct. + */ + bool processLocalReaderProxyData( + RTPSReader* reader, + ReaderProxyData* rdata) override; + /** + * This method generates the corresponding change in the publciations writer and send it to all known remote endpoints. + * @param writer Pointer to the Writer object. + * @param wdata Pointer to the WriterProxyData object. + * @return true if correct. + */ + bool processLocalWriterProxyData( + RTPSWriter* writer, + WriterProxyData* wdata) override; + /** + * This methods generates the change disposing of the local Reader and calls the unpairing and removal methods of the base class. + * @param R Pointer to the RTPSReader object. + * @return True if correct. + */ + bool removeLocalReader( + RTPSReader* R) override; + /** + * This methods generates the change disposing of the local Writer and calls the unpairing and removal methods of the base class. + * @param W Pointer to the RTPSWriter object. + * @return True if correct. + */ + bool removeLocalWriter( + RTPSWriter* W) override; + +protected: + + /** + * Initialization of history attributes for EDP built-in readers + * + * @param [out] attributes History attributes to initialize + */ + virtual void set_builtin_reader_history_attributes( + HistoryAttributes& attributes); + + /** + * Initialization of history attributes for EDP built-in writers + * + * @param [out] attributes History attributes to initialize + */ + virtual void set_builtin_writer_history_attributes( + HistoryAttributes& attributes); + + /** + * Initialization of reader attributes for EDP built-in readers + * + * @param [out] attributes Reader attributes to initialize + */ + virtual void set_builtin_reader_attributes( + ReaderAttributes& attributes); + + /** + * Initialization of writer attributes for EDP built-in writers + * + * @param [out] attributes Writer attributes to initialize + */ + virtual void set_builtin_writer_attributes( + WriterAttributes& attributes); + + /** + * Create local SEDP Endpoints based on the DiscoveryAttributes. + * @return True if correct. + */ + virtual bool createSEDPEndpoints(); + + /** + * Create a cache change on a builtin writer and serialize a WriterProxyData on it. + * @param [in] data The WriterProxyData object to be serialized. + * @param [in] writer The writer,history pair where the change should be added. + * @param [in] remove_same_instance Should previous changes with same key be removed? + * @param [out] created_change Where the pointer to the created change should be returned. + * @return false if data could not be serialized into the created change. + */ + bool serialize_writer_proxy_data( + const WriterProxyData& data, + const t_p_StatefulWriter& writer, + bool remove_same_instance, + CacheChange_t** created_change); + + /** + * Create a cache change on a builtin writer and serialize a ReaderProxyData on it. + * @param [in] data The ReaderProxyData object to be serialized. + * @param [in] writer The writer,history pair where the change should be added. + * @param [in] remove_same_instance Should previous changes with same key be removed? + * @param [out] created_change Where the pointer to the created change should be returned. + * @return false if data could not be serialized into the created change. + */ + bool serialize_reader_proxy_data( + const ReaderProxyData& data, + const t_p_StatefulWriter& writer, + bool remove_same_instance, + CacheChange_t** created_change); + + //! Process the info recorded in the persistence database + void processPersistentData( + t_p_StatefulReader& reader, + t_p_StatefulWriter& writer, + key_list& demises); + + /** + * Get a pointer pair of the corresponding writer builtin endpoint for the entity_id + * @param [in] entity_id The entity_id to obtain the pair from. + * @return A pair of nullptrs if operation was unsuccessful + */ + t_p_StatefulWriter get_builtin_writer_history_pair_by_entity( + const EntityId_t& entity_id); + + /** + * Get a pointer pair of the corresponding reader builtin endpoint for the entity_id. + * If a builtin writer Entity is passed, the equivalent reader entity builtin is returned. + * @param [in] entity_id The entity_id to obtain the pair from. + * @return A pair of nullptrs if operation was unsuccessful + */ + t_p_StatefulReader get_builtin_reader_history_pair_by_entity( + const EntityId_t& entity_id); + + std::shared_ptr pub_writer_payload_pool_; + std::shared_ptr pub_reader_payload_pool_; + std::shared_ptr sub_writer_payload_pool_; + std::shared_ptr sub_reader_payload_pool_; + +#if HAVE_SECURITY + std::shared_ptr sec_pub_writer_payload_pool_; + std::shared_ptr sec_pub_reader_payload_pool_; + std::shared_ptr sec_sub_writer_payload_pool_; + std::shared_ptr sec_sub_reader_payload_pool_; +#endif // if HAVE_SECURITY + +private: + + /** + * Create a cache change on a builtin writer and serialize a ProxyData on it. + * @param [in] data The ProxyData object to be serialized. + * @param [in] writer The writer,history pair where the change should be added. + * @param [in] remove_same_instance Should previous changes with same key be removed? + * @param [out] created_change Where the pointer to the created change should be returned. + * @return false if data could not be serialized into the created change. + */ + template + bool serialize_proxy_data( + const ProxyData& data, + const t_p_StatefulWriter& writer, + bool remove_same_instance, + CacheChange_t** created_change); + +#if HAVE_SECURITY + bool create_sedp_secure_endpoints(); + + bool pairing_remote_writer_with_local_builtin_reader_after_security( + const GUID_t& local_reader, + const WriterProxyData& remote_writer_data) override; + + bool pairing_remote_reader_with_local_builtin_writer_after_security( + const GUID_t& local_writer, + const ReaderProxyData& remote_reader_data) override; +#endif // if HAVE_SECURITY +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_EDPSIMPLE_H_ */ diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp index e62f4d6e135..5a3deab0908 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp @@ -21,23 +21,25 @@ #include +#include #include #include #include #include -#include -#include #include #include #include #include #include -#include +#include +#include +#include #include using ParameterList = eprosima::fastdds::dds::ParameterList; + // Release reader lock to avoid ABBA lock. PDP mutex should always be first. // Keep change information on local variables to check consistency later #define PREVENT_PDP_DEADLOCK(reader, change, pdp) \ @@ -64,7 +66,8 @@ void EDPBasePUBListener::add_writer_from_change( ReaderHistory* reader_history, CacheChange_t* change, EDP* edp, - bool release_change /*=true*/) + bool release_change /*= true*/, + const EndpointAddedCallback& writer_added_callback /* = nullptr*/) { //LOAD INFORMATION IN DESTINATION WRITER PROXY DATA const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory(); @@ -80,47 +83,75 @@ void EDPBasePUBListener::add_writer_from_change( return; } - //LOAD INFORMATION IN DESTINATION WRITER PROXY DATA - auto copy_data_fun = [&temp_writer_data, &network]( - WriterProxyData* data, - bool updating, - const ParticipantProxyData& participant_data) + // Callback function to continue after typelookup is complete + fastdds::dds::builtin::AsyncGetTypeWriterCallback after_typelookup_callback = + [reader, change, edp, &network, writer_added_callback] + (eprosima::ProxyPool::smart_ptr& temp_writer_data) { - if (!temp_writer_data->has_locators()) + //LOAD INFORMATION IN DESTINATION WRITER PROXY DATA + auto copy_data_fun = [&temp_writer_data, &network]( + WriterProxyData* data, + bool updating, + const ParticipantProxyData& participant_data) + { + if (!temp_writer_data->has_locators()) + { + temp_writer_data->set_remote_locators(participant_data.default_locators, network, + true); + } + + if (updating && !data->is_update_allowed(*temp_writer_data)) + { + EPROSIMA_LOG_WARNING(RTPS_EDP, + "Received incompatible update for WriterQos. writer_guid = " << + data->guid()); + } + *data = *temp_writer_data; + return true; + }; + + GUID_t participant_guid; + WriterProxyData* writer_data = + edp->mp_PDP->addWriterProxyData(temp_writer_data->guid(), participant_guid, copy_data_fun); + + // release temporary proxy + temp_writer_data.reset(); + + if (writer_data != nullptr) { - temp_writer_data->set_remote_locators(participant_data.default_locators, network, true); + edp->pairing_writer_proxy_with_any_local_reader(participant_guid, writer_data); + if (nullptr != writer_added_callback) + { + writer_added_callback(reader, change); + } } - - if (updating && !data->is_update_allowed(*temp_writer_data)) + else { - EPROSIMA_LOG_WARNING(RTPS_EDP, - "Received incompatible update for WriterQos. writer_guid = " << data->guid()); + EPROSIMA_LOG_WARNING(RTPS_EDP, "Received message from UNKNOWN RTPSParticipant, removing"); } - *data = *temp_writer_data; - return true; }; - GUID_t participant_guid; - WriterProxyData* writer_data = - edp->mp_PDP->addWriterProxyData(temp_writer_data->guid(), participant_guid, copy_data_fun); - - // release temporary proxy - temp_writer_data.reset(); - - //Removing change from history + // Remove change from history. reader_history->remove_change(reader_history->find_change(change), release_change); - // At this point we can release reader lock, cause change is not used + // At this point, we can release the reader lock because the change is not used reader->getMutex().unlock(); - if (writer_data != nullptr) + + // Check if TypeInformation exists to start the typelookup service + if (temp_writer_data->type_information().assigned()) { - edp->pairing_writer_proxy_with_any_local_reader(participant_guid, writer_data); + edp->mp_RTPSParticipant->typelookup_manager()->async_get_type( + temp_writer_data, + after_typelookup_callback); } - else //NOT ADDED BECAUSE IT WAS ALREADY THERE + // If TypeInformation does not exist, try fallback mechanism + else { - EPROSIMA_LOG_WARNING(RTPS_EDP, "Received message from UNKNOWN RTPSParticipant, removing"); + EPROSIMA_LOG_INFO(RTPS_EDP, "EDPBasePUBListener: No TypeInformation. Trying fallback mechanism"); + after_typelookup_callback(temp_writer_data); } - // Take again the reader lock. + + // Take the reader lock again if needed. reader->getMutex().lock(); } } @@ -175,9 +206,10 @@ void EDPBaseSUBListener::add_reader_from_change( ReaderHistory* reader_history, CacheChange_t* change, EDP* edp, - bool release_change /*=true*/) + bool release_change /*= true*/, + const EndpointAddedCallback& reader_added_callback /* = nullptr*/) { - //LOAD INFORMATION IN TEMPORAL WRITER PROXY DATA + //LOAD INFORMATION IN TEMPORAL READER PROXY DATA const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory(); CDRMessage_t tempMsg(change->serializedPayload); auto temp_reader_data = edp->get_temporary_reader_proxies_pool().get(); @@ -191,50 +223,75 @@ void EDPBaseSUBListener::add_reader_from_change( return; } - auto copy_data_fun = [&temp_reader_data, &network]( - ReaderProxyData* data, - bool updating, - const ParticipantProxyData& participant_data) + // Callback function to continue after typelookup is complete + fastdds::dds::builtin::AsyncGetTypeReaderCallback after_typelookup_callback = + [reader, change, edp, &network, reader_added_callback] + (eprosima::ProxyPool::smart_ptr& temp_reader_data) { - if (!temp_reader_data->has_locators()) + auto copy_data_fun = [&temp_reader_data, &network]( + ReaderProxyData* data, + bool updating, + const ParticipantProxyData& participant_data) + { + if (!temp_reader_data->has_locators()) + { + temp_reader_data->set_remote_locators(participant_data.default_locators, network, + true); + } + + if (updating && !data->is_update_allowed(*temp_reader_data)) + { + EPROSIMA_LOG_WARNING(RTPS_EDP, + "Received incompatible update for ReaderQos. reader_guid = " << + data->guid()); + } + *data = *temp_reader_data; + return true; + }; + + //LOOK IF IS AN UPDATED INFORMATION + GUID_t participant_guid; + ReaderProxyData* reader_data = + edp->mp_PDP->addReaderProxyData(temp_reader_data->guid(), participant_guid, copy_data_fun); + + // Release the temporary proxy + temp_reader_data.reset(); + + if (reader_data != nullptr) //ADDED NEW DATA { - temp_reader_data->set_remote_locators(participant_data.default_locators, network, true); + edp->pairing_reader_proxy_with_any_local_writer(participant_guid, reader_data); + if (nullptr != reader_added_callback) + { + reader_added_callback(reader, change); + } } - - if (updating && !data->is_update_allowed(*temp_reader_data)) + else { - EPROSIMA_LOG_WARNING(RTPS_EDP, - "Received incompatible update for ReaderQos. reader_guid = " << data->guid()); + EPROSIMA_LOG_WARNING(RTPS_EDP, "From UNKNOWN RTPSParticipant, removing"); } - *data = *temp_reader_data; - return true; }; - //LOOK IF IS AN UPDATED INFORMATION - GUID_t participant_guid; - ReaderProxyData* reader_data = - edp->mp_PDP->addReaderProxyData(temp_reader_data->guid(), participant_guid, copy_data_fun); - - // Release the temporary proxy - temp_reader_data.reset(); - // Remove change from history. reader_history->remove_change(reader_history->find_change(change), release_change); - // At this point we can release reader lock, cause change is not used + // At this point, we can release the reader lock because the change is not used reader->getMutex().unlock(); - if (reader_data != nullptr) //ADDED NEW DATA + // Check if TypeInformation exists to start the typelookup service + if (temp_reader_data->type_information().assigned()) { - edp->pairing_reader_proxy_with_any_local_writer(participant_guid, reader_data); - + edp->mp_RTPSParticipant->typelookup_manager()->async_get_type( + temp_reader_data, + after_typelookup_callback); } + // If TypeInformation does not exist, try fallback mechanism else { - EPROSIMA_LOG_WARNING(RTPS_EDP, "From UNKNOWN RTPSParticipant, removing"); + EPROSIMA_LOG_INFO(RTPS_EDP, "EDPBasePUBListener: No TypeInformation. Trying fallback mechanism"); + after_typelookup_callback(temp_reader_data); } - // Take again the reader lock. + // Take the reader lock again if needed. reader->getMutex().lock(); } } diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.h b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.h index 8541c62bf4c..9c9c34b54ac 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.h +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.h @@ -23,18 +23,19 @@ #include #include - -#include - #include #include +#include #include namespace eprosima { namespace fastrtps { namespace rtps { +using EndpointAddedCallback = std::function< + void (RTPSReader* reader, const CacheChange_t* change)>; + class RTPSReader; struct CacheChange_t; @@ -79,7 +80,9 @@ class EDPBasePUBListener : public EDPListener ReaderHistory* reader_history, CacheChange_t* change, EDP* edp, - bool release_change = true); + bool release_change = true, + const EndpointAddedCallback& writer_added_callback = nullptr + ); }; /** @@ -101,7 +104,9 @@ class EDPBaseSUBListener : public EDPListener ReaderHistory* reader_history, CacheChange_t* change, EDP* edp, - bool release_change = true); + bool release_change = true, + const EndpointAddedCallback& reader_added_callback = nullptr + ); }; /*! diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp index a616dd6669f..ea17bcdb8a5 100644 --- a/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp @@ -17,24 +17,23 @@ * */ -#include -#include -#include +#include -#include -#include -#include +#include +#include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include #include - -#include -#include -#include +#include namespace eprosima { namespace fastrtps { @@ -491,7 +490,7 @@ void EDPStatic::assignRemoteEndpoints( bool EDPStatic::newRemoteReader( const GUID_t& participant_guid, - const string_255& participant_name, + const fastcdr::string_255& participant_name, uint16_t user_id, EntityId_t ent_id) { @@ -542,7 +541,7 @@ bool EDPStatic::newRemoteReader( bool EDPStatic::newRemoteWriter( const GUID_t& participant_guid, - const string_255& participant_name, + const fastcdr::string_255& participant_name, uint16_t user_id, EntityId_t ent_id, const GUID_t& persistence_guid) diff --git a/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.h b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.h new file mode 100644 index 00000000000..1be2359d04b --- /dev/null +++ b/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.h @@ -0,0 +1,166 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file EDPStatic.h + * + */ + +#ifndef _FASTDDS_RTPS_EDPSTATIC_H_ +#define _FASTDDS_RTPS_EDPSTATIC_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include + +namespace eprosima { + +namespace fastrtps { +namespace xmlparser { +class XMLEndpointParser; +} // namespace xmlparser + +namespace rtps { + +/** + * Class EDPStatic, implements a static endpoint discovery module. + * @ingroup DISCOVERYMODULE + */ +class EDPStatic : public EDP +{ +public: + + //! Different exchange formats supported by Static Discovery. + enum class ExchangeFormat : uint32_t + { + v1, //! Standard exchange format for Static Discovery. + v1_Reduced //! Exchange format that reduces the used network bandwidth. + }; + + /** + * Constructor. + * @param p Pointer to the PDPSimple. + * @param part Pointer to the RTPSParticipantImpl. + */ + EDPStatic( + PDP* p, + RTPSParticipantImpl* part); + virtual ~EDPStatic(); + /** + * Abstract method to initialize the EDP. + * @param attributes DiscoveryAttributes structure. + * @return True if correct. + */ + bool initEDP( + BuiltinAttributes& attributes) override; + /** + * Abstract method that assigns remote endpoints when a new RTPSParticipantProxyData is discovered. + * @param pdata Pointer to the ParticipantProxyData. + * @param assign_secure_endpoints Whether to try assigning secure endpoints + */ + void assignRemoteEndpoints( + const ParticipantProxyData& pdata, + bool assign_secure_endpoints) override; + /** + * Abstract method that removes a local Reader from the discovery method + * @param R Pointer to the Reader to remove. + * @return True if correctly removed. + */ + bool removeLocalReader( + RTPSReader* R) override; + /** + * Abstract method that removes a local Writer from the discovery method + * @param W Pointer to the Writer to remove. + * @return True if correctly removed. + */ + bool removeLocalWriter( + RTPSWriter* W) override; + + /** + * After a new local ReaderProxyData has been created some processing is needed (depends on the implementation). + * @param reader Pointer to the RTPSReader object. + * @param rdata Pointer to the ReaderProxyData object. + * @return True if correct. + */ + bool processLocalReaderProxyData( + RTPSReader* reader, + ReaderProxyData* rdata) override; + /** + * After a new local WriterProxyData has been created some processing is needed (depends on the implementation). + * @param writer Pointer to the RTPSWriter object. + * @param wdata Pointer to the Writer ProxyData object. + * @return True if correct. + */ + bool processLocalWriterProxyData( + RTPSWriter* writer, + WriterProxyData* wdata) override; + + /** + * New Remote Writer has been found and this method process it and calls the pairing methods. + * @param participant_guid GUID of the participant. + * @param participant_name Name of the participant. + * @param user_id User Id. + * @param ent_id Entity Id. + * @param persistence_guid GUID used for persistence. + * @return True if correct. + */ + bool newRemoteWriter( + const GUID_t& participant_guid, + const fastcdr::string_255& participant_name, + uint16_t user_id, + EntityId_t ent_id = c_EntityId_Unknown, + const GUID_t& persistence_guid = GUID_t::unknown()); + /** + * New Remote Reader has been found and this method process it and calls the pairing methods. + * @param participant_guid GUID of the participant. + * @param participant_name Name of the participant. + * @param user_id User Id. + * @param ent_id Entity Id. + * @return true if correct. + */ + bool newRemoteReader( + const GUID_t& participant_guid, + const fastcdr::string_255& participant_name, + uint16_t user_id, + EntityId_t ent_id = c_EntityId_Unknown); + + /** + * This method checks the provided entityId against the topic type to see if it matches + * @param rdata Pointer to the readerProxyData + * @return True if its correct. + **/ + bool checkEntityId( + ReaderProxyData* rdata); + /** + * This method checks the provided entityId against the topic type to see if it matches + * @param wdata Pointer to the writerProxyData + * @return True if its correct. + **/ + bool checkEntityId( + WriterProxyData* wdata); + +private: + + xmlparser::XMLEndpointParser* mp_edpXML; + + BuiltinAttributes m_attributes; + + ExchangeFormat exchange_format_ = ExchangeFormat::v1; +}; + +} // namespace rtps +} /* namespace rtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_EDPSTATIC_H_ */ diff --git a/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp b/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp index cb7bb49ffd6..6a6dc849263 100644 --- a/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp @@ -19,26 +19,23 @@ #include -#include +#include -#include -#include -#include +#include +#include #include #include #include #include #include -#include - -#include +#include +#include #include +#include #include #include -#include - using ParameterList = eprosima::fastdds::dds::ParameterList; namespace eprosima { diff --git a/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.hpp b/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.hpp index c15a283e9b8..25e70ac2f7f 100644 --- a/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.hpp +++ b/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.hpp @@ -21,10 +21,11 @@ #define _DS_PDP_SECURITY_INITIATOR_LISTENER_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include + #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp b/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp index f2f5dcaaf13..40ea83b5cac 100644 --- a/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp @@ -19,8 +19,10 @@ #include -#include + #include +#include + #include namespace eprosima { diff --git a/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.hpp b/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.hpp index 16326afcd9a..da25156da4b 100644 --- a/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.hpp +++ b/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.hpp @@ -17,13 +17,13 @@ * */ -#ifndef FASTRTPS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ -#define FASTRTPS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ +#ifndef FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ +#define FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include +#include namespace eprosima { namespace fastrtps { @@ -113,4 +113,4 @@ class DirectMessageSender : public RTPSMessageSenderInterface #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* FASTRTPS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ */ +#endif /* FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_DIRECTMESSAGESENDER_HPP_ */ diff --git a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp index 96d862ea5cf..89989335e65 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp @@ -17,54 +17,41 @@ * */ -#include -#include +#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include #include #include - -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#include -#include - #include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include "fastrtps/utils/shared_mutex.hpp" - -#include -#include -#include - -#include +#include +#include +#include #include - -#include - +#include +#include #include +#include +#include #include #include - -#include -#include +#include +#include +#include namespace eprosima { namespace fastrtps { @@ -262,18 +249,11 @@ void PDP::initializeParticipantProxyData( } #endif // if HAVE_SECURITY } + participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; + participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; - if (attributes.builtin.typelookup_config.use_server) - { - participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_READER; - participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_WRITER; - } - - if (attributes.builtin.typelookup_config.use_client) - { - participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; - participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; - } + participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REQUEST_DATA_WRITER; + participant_data->m_availableBuiltinEndpoints |= BUILTIN_ENDPOINT_TYPELOOKUP_SERVICE_REPLY_DATA_READER; #if HAVE_SECURITY if (mp_RTPSParticipant->is_secure()) @@ -773,7 +753,7 @@ bool PDP::removeWriterProxyData( bool PDP::lookup_participant_name( const GUID_t& guid, - string_255& name) + fastcdr::string_255& name) { std::lock_guard guardPDP(*this->mp_mutex); for (ParticipantProxyData* pit : participant_proxies_) @@ -841,7 +821,6 @@ ReaderProxyData* PDP::addReaderProxyData( ReaderDiscoveryInfo info(*ret_val); info.status = ReaderDiscoveryInfo::CHANGED_QOS_READER; listener->onReaderDiscovery(mp_RTPSParticipant->getUserRTPSParticipant(), std::move(info)); - check_and_notify_type_discovery(listener, *ret_val); } return ret_val; @@ -892,7 +871,6 @@ ReaderProxyData* PDP::addReaderProxyData( ReaderDiscoveryInfo info(*ret_val); info.status = ReaderDiscoveryInfo::DISCOVERED_READER; listener->onReaderDiscovery(mp_RTPSParticipant->getUserRTPSParticipant(), std::move(info)); - check_and_notify_type_discovery(listener, *ret_val); } return ret_val; @@ -940,7 +918,6 @@ WriterProxyData* PDP::addWriterProxyData( WriterDiscoveryInfo info(*ret_val); info.status = WriterDiscoveryInfo::CHANGED_QOS_WRITER; listener->onWriterDiscovery(mp_RTPSParticipant->getUserRTPSParticipant(), std::move(info)); - check_and_notify_type_discovery(listener, *ret_val); } return ret_val; @@ -990,7 +967,6 @@ WriterProxyData* PDP::addWriterProxyData( WriterDiscoveryInfo info(*ret_val); info.status = WriterDiscoveryInfo::DISCOVERED_WRITER; listener->onWriterDiscovery(mp_RTPSParticipant->getUserRTPSParticipant(), std::move(info)); - check_and_notify_type_discovery(listener, *ret_val); } return ret_val; @@ -1214,10 +1190,7 @@ bool PDP::remove_remote_participant( this->mp_builtin->mp_WLP->removeRemoteEndpoints(pdata); } - if (mp_builtin->tlm_ != nullptr) - { - mp_builtin->tlm_->remove_remote_endpoints(pdata); - } + mp_builtin->typelookup_manager_->remove_remote_endpoints(pdata); this->mp_EDP->removeRemoteEndpoints(pdata); this->removeRemoteEndpoints(pdata); @@ -1358,7 +1331,8 @@ void PDP::check_remote_participant_liveliness( // If overcame, remove participant. auto now = std::chrono::steady_clock::now(); auto real_lease_tm = remote_participant->last_received_message_tm() + - std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64(remote_participant->m_leaseDuration)); + std::chrono::microseconds(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64(remote_participant-> + m_leaseDuration)); if (now > real_lease_tm) { guard.unlock(); @@ -1374,79 +1348,6 @@ void PDP::check_remote_participant_liveliness( } } -void PDP::check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const WriterProxyData& wdata) const -{ - check_and_notify_type_discovery( - listener, - wdata.topicName(), - wdata.typeName(), - wdata.has_type_id() ? &wdata.type_id().m_type_identifier : nullptr, - wdata.has_type() ? &wdata.type().m_type_object : nullptr, - wdata.has_type_information() ? &wdata.type_information() : nullptr); -} - -void PDP::check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const ReaderProxyData& rdata) const -{ - check_and_notify_type_discovery( - listener, - rdata.topicName(), - rdata.typeName(), - rdata.has_type_id() ? &rdata.type_id().m_type_identifier : nullptr, - rdata.has_type() ? &rdata.type().m_type_object : nullptr, - rdata.has_type_information() ? &rdata.type_information() : nullptr); -} - -void PDP::check_and_notify_type_discovery( - RTPSParticipantListener* listener, - const string_255& topic_name, - const string_255& type_name, - const types::TypeIdentifier* type_id, - const types::TypeObject* type_obj, - const xtypes::TypeInformation* type_info) const -{ - // Notify about type_info - if (type_info && type_info->assigned()) - { - listener->on_type_information_received( - mp_RTPSParticipant->getUserRTPSParticipant(), topic_name, type_name, type_info->type_information); - } - - // Are we discovering a type? - types::DynamicType_ptr dyn_type; - if (type_obj && type_obj->_d() == types::EK_COMPLETE) // Writer shares a Complete TypeObject - { - dyn_type = types::TypeObjectFactory::get_instance()->build_dynamic_type( - type_name.to_string(), type_id, type_obj); - } - else if (type_id && type_id->_d() != static_cast(0x00) - && type_id->_d() < types::EK_MINIMAL) // Writer shares a TypeIdentifier that doesn't need TypeObject - { - dyn_type = types::TypeObjectFactory::get_instance()->build_dynamic_type( - type_name.to_string(), type_id); - } - - if (dyn_type != nullptr) - { - types::DynamicPubSubType type_support(dyn_type); - - if (!mp_RTPSParticipant->check_type(type_name.to_string())) - { - // Discovering a type - listener->on_type_discovery( - mp_RTPSParticipant->getUserRTPSParticipant(), - fastdds::dds::builtin::INVALID_SAMPLE_IDENTITY, - topic_name, - type_id, - type_obj, - dyn_type); - } - } -} - void PDP::set_next_announcement_interval() { if (initial_announcements_.count > 0) diff --git a/src/cpp/rtps/builtin/discovery/participant/PDP.h b/src/cpp/rtps/builtin/discovery/participant/PDP.h new file mode 100644 index 00000000000..d3a6e5f6033 --- /dev/null +++ b/src/cpp/rtps/builtin/discovery/participant/PDP.h @@ -0,0 +1,647 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file PDP.h + * + */ + +#ifndef _FASTDDS_RTPS_PDP_H_ +#define _FASTDDS_RTPS_PDP_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace eprosima { + +namespace fastdds { +namespace statistics { +namespace rtps { + +struct IProxyObserver; + +} // namespace rtps +} // namespace statistics + +namespace dds { +namespace xtypes { + +class TypeObject; +class TypeIdentifier; + +} // namespace xtypes +} // namespace dds + +namespace rtps { + +class PDPServerListener; +class PDPEndpoints; + +} // namespace rtps +} // namespace fastdds + +namespace fastrtps { +namespace rtps { + +class RTPSWriter; +class RTPSReader; +class WriterHistory; +class ReaderHistory; +class RTPSParticipantImpl; +class RTPSParticipantListener; +class BuiltinProtocols; +class EDP; +class TimedEvent; +class ReaderProxyData; +class WriterProxyData; +class ParticipantProxyData; +class ReaderListener; +class PDPListener; +class PDPServerListener; +class ITopicPayloadPool; + +/** + * Abstract class PDP that implements the basic interfaces for all Participant Discovery implementations + * It also keeps the Participant Discovery Data and provides interfaces to access it + *@ingroup DISCOVERY_MODULE + */ +class PDP : public fastdds::statistics::rtps::IProxyQueryable +{ + friend class PDPListener; + friend class PDPServerListener; + friend class fastdds::rtps::PDPServerListener; + friend class PDPSecurityInitiatorListener; + +public: + + /** + * Constructor + * @param builtin Pointer to the BuiltinProtocols object. + * @param allocation Participant allocation parameters. + */ + PDP( + BuiltinProtocols* builtin, + const RTPSParticipantAllocationAttributes& allocation); + + virtual ~PDP(); + + virtual void initializeParticipantProxyData( + ParticipantProxyData* participant_data); + + /** + * Initialize the PDP. + * @param part Pointer to the RTPSParticipant. + * @return True on success + */ + bool initPDP( + RTPSParticipantImpl* part); + + /** + * @brief Enable the Participant Discovery Protocol + * + * @return true if enabled correctly, or if already enabled; false otherwise + */ + bool enable(); + + virtual bool init( + RTPSParticipantImpl* part) = 0; + + /** + * Creates an initializes a new participant proxy from a DATA(p) raw info + * @param p from DATA msg deserialization + * @param writer_guid GUID of originating writer + * @return new ParticipantProxyData * or nullptr on failure + */ + virtual ParticipantProxyData* createParticipantProxyData( + const ParticipantProxyData& p, + const GUID_t& writer_guid) = 0; + + /** + * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. + * @param new_change If true a new change (with new seqNum) is created and sent;If false the last change is re-sent + * @param dispose sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED + * @param wparams allows to identify the change + */ + virtual void announceParticipantState( + bool new_change, + bool dispose, + WriteParams& wparams) = 0; + + /** + * \c announceParticipantState method without optional output parameter \c wparams . + */ + virtual void announceParticipantState( + bool new_change, + bool dispose = false); + + //!Stop the RTPSParticipantAnnouncement (only used in tests). + virtual void stopParticipantAnnouncement(); + + //!Reset the RTPSParticipantAnnouncement (only used in tests). + virtual void resetParticipantAnnouncement(); + + /** + * Add a ReaderProxyData to the correct ParticipantProxyData. + * @param [in] reader_guid GUID of the reader to add. + * @param [out] participant_guid GUID of the ParticipantProxyData where the reader was added. + * @param [in] initializer_func Function to be called in order to set the data of the ReaderProxyData. + * + * @return A pointer to the added ReaderProxyData (nullptr if it could not be added). + */ + ReaderProxyData* addReaderProxyData( + const GUID_t& reader_guid, + GUID_t& participant_guid, + std::function initializer_func); + + /** + * Add a WriterProxyData to the correct ParticipantProxyData. + * @param [in] writer_guid GUID of the writer to add. + * @param [out] participant_guid GUID of the ParticipantProxyData where the writer was added. + * @param [in] initializer_func Function to be called in order to set the data of the WriterProxyData. + * + * @return A pointer to the added WriterProxyData (nullptr if it could not be added). + */ + WriterProxyData* addWriterProxyData( + const GUID_t& writer_guid, + GUID_t& participant_guid, + std::function initializer_func); + + /** + * This method returns whether a ReaderProxyDataObject exists among the registered RTPSParticipants + * (including the local RTPSParticipant). + * @param [in] reader GUID_t of the reader we are looking for. + * @return True if found. + */ + bool has_reader_proxy_data( + const GUID_t& reader); + + /** + * This method gets a copy of a ReaderProxyData object if it is found among the registered RTPSParticipants + * (including the local RTPSParticipant). + * @param [in] reader GUID_t of the reader we are looking for. + * @param [out] rdata Reference to the ReaderProxyData object where data is to be returned. + * @return True if found. + */ + bool lookupReaderProxyData( + const GUID_t& reader, + ReaderProxyData& rdata); + + /** + * This method returns whether a WriterProxyData exists among the registered RTPSParticipants + * (including the local RTPSParticipant). + * @param [in] writer GUID_t of the writer we are looking for. + * @return True if found. + */ + bool has_writer_proxy_data( + const GUID_t& writer); + + /** + * This method gets a copy of a WriterProxyData object if it is found among the registered RTPSParticipants + * (including the local RTPSParticipant). + * @param [in] writer GUID_t of the writer we are looking for. + * @param [out] wdata Reference to the WriterProxyData object where data is to be returned. + * @return True if found. + */ + bool lookupWriterProxyData( + const GUID_t& writer, + WriterProxyData& wdata); + + /** + * This method returns the name of a participant if it is found among the registered RTPSParticipants. + * @param [in] guid GUID_t of the RTPSParticipant we are looking for. + * @param [out] name Copy of name on ParticipantProxyData object. + * @return True if found. + */ + bool lookup_participant_name( + const GUID_t& guid, + fastcdr::string_255& name); + + /** + * This method removes and deletes a ReaderProxyData object from its corresponding RTPSParticipant. + * + * @param[in] reader_guid GUID_t of the reader to remove. + * @return true if found and deleted. + */ + bool removeReaderProxyData( + const GUID_t& reader_guid); + + /** + * This method removes and deletes a ReaderProxyData object from its corresponding RTPSParticipant. + * + * @param[in] reader_guid GUID_t of the reader to remove. + * @param[in] reason Why the reader is being removed (dropped, removed, or ignored) + * @return true if found and deleted. + */ + bool removeReaderProxyData( + const GUID_t& reader_guid, + ReaderDiscoveryInfo::DISCOVERY_STATUS reason); + + /** + * This method removes and deletes a WriterProxyData object from its corresponding RTPSParticipant. + * + * @param[in] writer_guid GUID_t of the writer to remove. + * @return true if found and deleted. + */ + bool removeWriterProxyData( + const GUID_t& writer_guid); + + /** + * This method removes and deletes a WriterProxyData object from its corresponding RTPSParticipant. + * + * @param[in] writer_guid GUID_t of the writer to remove. + * @param[in] reason Why the writer is being removed (dropped, removed, or ignored) + * @return true if found and deleted. + */ + bool removeWriterProxyData( + const GUID_t& writer_guid, + WriterDiscoveryInfo::DISCOVERY_STATUS reason); + + /** + * Create the SPDP Writer and Reader + * @return True if correct. + */ + virtual bool createPDPEndpoints() = 0; + + /** + * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls the corresponding methods in EDP and WLP. + * @param pdata Pointer to the RTPSParticipantProxyData object. + */ + virtual void assignRemoteEndpoints( + ParticipantProxyData* pdata) = 0; + + /** + * Override to match additional endpoints to PDP. Like EDP or WLP. + * @param pdata Pointer to the ParticipantProxyData object. + * @param notify_secure_endpoints Whether to try notifying secure endpoints. + */ + virtual void notifyAboveRemoteEndpoints( + const ParticipantProxyData& pdata, + bool notify_secure_endpoints) = 0; + + /** + * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic + * @return true if EDP endpoinst must be match + */ + virtual bool updateInfoMatchesEDP() + { + return false; + } + + /** + * Remove remote endpoints from the participant discovery protocol + * @param pdata Pointer to the ParticipantProxyData to remove + */ + virtual void removeRemoteEndpoints( + ParticipantProxyData* pdata) = 0; + + /** + * This method removes a remote RTPSParticipant and all its writers and readers. + * @param participant_guid GUID_t of the remote RTPSParticipant. + * @param reason Why the participant is being removed (dropped, removed, or ignored) + * @return true if correct. + */ + virtual bool remove_remote_participant( + const GUID_t& participant_guid, + ParticipantDiscoveryInfo::DISCOVERY_STATUS reason); + + /** + * This method returns the BuiltinAttributes of the local participant. + * @return const reference to the BuiltinAttributes of the local participant. + */ + const BuiltinAttributes& builtin_attributes() const; + + /** + * Get a pointer to the local RTPSParticipant ParticipantProxyData object. + * @return Pointer to the local RTPSParticipant ParticipantProxyData object. + */ + ParticipantProxyData* getLocalParticipantProxyData() const + { + return participant_proxies_.empty() ? nullptr : participant_proxies_.front(); + } + + /** + * Get a pointer to the EDP object. + * @return pointer to the EDP object. + */ + inline EDP* getEDP() + { + return mp_EDP; + } + + /** + * Get a const_iterator to the beginning of the RTPSParticipant Proxies. + * @return const_iterator. + */ + ResourceLimitedVector::const_iterator ParticipantProxiesBegin() + { + return participant_proxies_.begin(); + } + + /** + * Get a const_iterator to the end of the RTPSParticipant Proxies. + * @return const_iterator. + */ + ResourceLimitedVector::const_iterator ParticipantProxiesEnd() + { + return participant_proxies_.end(); + } + + /** + * Get the number of participant proxies. + * @return size_t. + */ + size_t participant_proxies_number() + { + return participant_proxies_number_; + } + + /** + * Assert the liveliness of a Remote Participant. + * @param remote_guid GuidPrefix_t of the participant whose liveliness is being asserted. + */ + void assert_remote_participant_liveliness( + const GuidPrefix_t& remote_guid); + + /** + * Get the RTPS participant + * @return RTPS participant + */ + inline RTPSParticipantImpl* getRTPSParticipant() const + { + return mp_RTPSParticipant; + } + + /** + * Get the mutex. + * @return Pointer to the Mutex + */ + inline std::recursive_mutex* getMutex() const + { + return mp_mutex; + } + + CDRMessage_t get_participant_proxy_data_serialized( + Endianness_t endian); + + /** + * Retrive the ParticipantProxyData of a participant + * @param guid_prefix The GUID prefix of the participant of which the proxy data is retrieved + * @return A pointer to the ParticipantProxyData. nullptr if there is no such ParticipantProxyData + */ + ParticipantProxyData* get_participant_proxy_data( + const GuidPrefix_t& guid_prefix); + + /** + * Get the list of remote servers to which the client should connect + * @return A reference to the list of RemoteServerAttributes + */ + std::list& remote_server_attributes(); + + /** + * Access the temporary proxy pool for reader proxies + * @return pool reference + */ + ProxyPool& get_temporary_reader_proxies_pool() + { + return temp_reader_proxies_; + } + + /** + * Access the temporary proxy pool for writer proxies + * @return pool reference + */ + ProxyPool& get_temporary_writer_proxies_pool() + { + return temp_writer_proxies_; + } + + ReaderAttributes create_builtin_reader_attributes() const; + + WriterAttributes create_builtin_writer_attributes() const; + +#if HAVE_SECURITY + void add_builtin_security_attributes( + ReaderAttributes& ratt, + WriterAttributes& watt) const; + + virtual bool pairing_remote_writer_with_local_reader_after_security( + const GUID_t& local_reader, + const WriterProxyData& remote_writer_data); + + virtual bool pairing_remote_reader_with_local_writer_after_security( + const GUID_t& local_writer, + const ReaderProxyData& remote_reader_data); +#endif // HAVE_SECURITY + +#ifdef FASTDDS_STATISTICS + bool get_all_local_proxies( + std::vector& guids) override; + + bool get_serialized_proxy( + const GUID_t& guid, + CDRMessage_t* msg) override; + + void set_proxy_observer( + const fastdds::statistics::rtps::IProxyObserver* proxy_observer); + + const fastdds::statistics::rtps::IProxyObserver* get_proxy_observer() + { + return proxy_observer_.load(); + } + +#else + bool get_all_local_proxies( + std::vector&) override + { + return false; + } + + bool get_serialized_proxy( + const GUID_t&, + CDRMessage_t*) override + { + return false; + } + +#endif // FASTDDS_STATISTICS + +protected: + + //!Pointer to the builtin protocols object. + BuiltinProtocols* mp_builtin; + //!Pointer to the local RTPSParticipant. + RTPSParticipantImpl* mp_RTPSParticipant; + //!Discovery attributes. + BuiltinAttributes m_discovery; + //!Builtin PDP endpoints + std::unique_ptr builtin_endpoints_; + //!Pointer to the EDP object. + EDP* mp_EDP; + //!Number of participant proxy data objects created + size_t participant_proxies_number_; + //!Registered RTPSParticipants (including the local one, that is the first one.) + ResourceLimitedVector participant_proxies_; + //!Pool of participant proxy data objects ready for reuse + ResourceLimitedVector participant_proxies_pool_; + //!Number of reader proxy data objects created + size_t reader_proxies_number_; + //!Pool of reader proxy data objects ready for reuse + ResourceLimitedVector reader_proxies_pool_; + //!Number of writer proxy data objects created + size_t writer_proxies_number_; + //!Pool of writer proxy data objects ready for reuse + ResourceLimitedVector writer_proxies_pool_; + //!Variable to indicate if any parameter has changed. + std::atomic_bool m_hasChangedLocalPDP; + //! ProxyPool for temporary reader proxies + ProxyPool temp_reader_proxies_; + //! ProxyPool for temporary writer proxies + ProxyPool temp_writer_proxies_; + //!Participant data atomic access assurance + std::recursive_mutex* mp_mutex; + //!To protect callbacks (ParticipantProxyData&) + std::mutex callback_mtx_; + //!Tell if object is enabled + std::atomic enabled_ {false}; + + /** + * Adds an entry to the collection of participant proxy information. + * May use one of the entries present in the pool. + * + * @param participant_guid GUID of the participant for which to create the proxy object. + * @param with_lease_duration indicates whether lease duration event should be created. + * @param participant_proxy_data The participant proxy data from which the copy is made (if provided) + * + * @return pointer to the currently inserted entry, nullptr if allocation limits were reached. + */ + ParticipantProxyData* add_participant_proxy_data( + const GUID_t& participant_guid, + bool with_lease_duration, + const ParticipantProxyData* participant_proxy_data = nullptr); + + /** + * Checks whether two participant prefixes are equal by calculating the mangled + * GUID and comparing it with the remote participant prefix. + * + * @param guid_prefix the original desired guid_prefix to compare + * @param participant_data The participant proxy data to compare against + * + * @return true when prefixes are equivalent + */ + bool data_matches_with_prefix( + const GuidPrefix_t& guid_prefix, + const ParticipantProxyData& participant_data); + + /** + * Gets the key of a participant proxy data. + * + * @param [in] participant_guid GUID of the participant to look for. + * @param [out] key of the corresponding proxy object. + * + * @return true when input GUID is found. + */ + bool lookup_participant_key( + const GUID_t& participant_guid, + InstanceHandle_t& key); + + /** + * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. + * @param writer RTPSWriter to use for sending the announcement + * @param history history where the change should be added + * @param new_change If true a new change (with new seqNum) is created and sent;If false the last change is re-sent + * @param dispose sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED + * @param wparams allows to identify the change + */ + void announceParticipantState( + RTPSWriter& writer, + WriterHistory& history, + bool new_change, + bool dispose = false, + WriteParams& wparams = WriteParams::WRITE_PARAM_DEFAULT); + + /** + * Called after creating the builtin endpoints to update the metatraffic unicast locators of BuiltinProtocols + */ + virtual void update_builtin_locators() = 0; + + void notify_and_maybe_ignore_new_participant( + ParticipantProxyData* pdata, + bool& should_be_ignored); + +#ifdef FASTDDS_STATISTICS + + std::atomic proxy_observer_; + +#endif // FASTDDS_STATISTICS + +private: + + //!TimedEvent to periodically resend the local RTPSParticipant information. + TimedEvent* resend_participant_info_event_; + + //!Participant's initial announcements config + InitialAnnouncementConfig initial_announcements_; + + void check_remote_participant_liveliness( + ParticipantProxyData* remote_participant); + + /** + * Calculates the next announcement interval + */ + void set_next_announcement_interval(); + + /** + * Calculates the initial announcement interval + */ + void set_initial_announcement_interval(); + + /** + * Set to a Participant Proxy those properties from this participant that must be sent. + */ + void set_external_participant_properties_( + ParticipantProxyData* participant_data); +}; + + +// configuration values for PDP reliable entities. +extern const Duration_t pdp_heartbeat_period; +extern const Duration_t pdp_nack_response_delay; +extern const Duration_t pdp_nack_supression_duration; +extern const Duration_t pdp_heartbeat_response_delay; + +extern const int32_t pdp_initial_reserved_caches; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_PDP_H_ */ diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp index 49faa1d11fa..f41b1ed59fd 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp @@ -25,28 +25,30 @@ #include #include #include +#include #include #include -#include -#include -#include #include #include #include #include #include #include -#include -#include + +#include +#include #include #include #include #include +#include #include +#include #include +#include #include -#include +#include using namespace eprosima::fastrtps; @@ -575,6 +577,8 @@ void PDPClient::perform_builtin_endpoints_matching( { mp_builtin->mp_WLP->assignRemoteEndpoints(pdata, true); } + + mp_builtin->typelookup_manager_->assign_remote_endpoints(pdata); } void PDPClient::removeRemoteEndpoints( diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPClient.h b/src/cpp/rtps/builtin/discovery/participant/PDPClient.h index a835ef74efa..09855bca335 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPClient.h +++ b/src/cpp/rtps/builtin/discovery/participant/PDPClient.h @@ -21,13 +21,12 @@ #define _FASTDDS_RTPS_PDPCLIENT_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include #include -#include - #include #include +#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp index a6d210faa94..98aee8fc88f 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp @@ -17,27 +17,23 @@ * */ -#include +#include -#include +#include -#include -#include +#include +#include #include #include #include #include #include -#include - -#include +#include +#include #include #include #include - -#include - #ifdef FASTDDS_STATISTICS #include #endif //FASTDDS_STATISTICS diff --git a/include/fastdds/rtps/builtin/discovery/participant/PDPListener.h b/src/cpp/rtps/builtin/discovery/participant/PDPListener.h similarity index 100% rename from include/fastdds/rtps/builtin/discovery/participant/PDPListener.h rename to src/cpp/rtps/builtin/discovery/participant/PDPListener.h diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp index 0c77f1e6015..9ce04ef45e4 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp @@ -22,37 +22,32 @@ #include #include -#include - -#include -#include - +#include +#include +#include +#include +#include #include #include #include +#include -#include -#include -#include - -#include -#include -#include - +#include +#include +#include #include #include #include -#include -#include #include #include #include #include +#include +#include #include - +#include #include - -#include +#include namespace eprosima { namespace fastdds { @@ -727,6 +722,8 @@ void PDPServer::perform_builtin_endpoints_matching( { mp_builtin->mp_WLP->assignRemoteEndpoints(pdata, true); } + + mp_builtin->typelookup_manager_->assign_remote_endpoints(pdata); } void PDPServer::removeRemoteEndpoints( diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp b/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp index 5b9fdcfd7d2..3d54c147ef2 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServer.hpp @@ -21,7 +21,7 @@ #define _FASTDDS_RTPS_PDPSERVER2_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include #include #include @@ -31,10 +31,11 @@ #include #include #include + #include #include -#include #include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp index 5d3dbf37169..2b9e7abbe93 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp @@ -17,20 +17,19 @@ * */ -#include - #include -#include +#include -#include +#include #include #include #include #include -#include +#include #include +#include #include #include @@ -162,7 +161,7 @@ void PDPServerListener::onNewCacheChangeAdded( return; } - fastrtps::ParameterPropertyList_t properties = participant_data.m_properties; + fastdds::dds::ParameterPropertyList_t properties = participant_data.m_properties; /* Check DS_VERSION */ auto ds_version = std::find_if( diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.hpp b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.hpp index af87e1b53b4..b0f96268240 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.hpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.hpp @@ -21,7 +21,7 @@ #define _FASTDDS_RTPS_PDPSERVERLISTENER2_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp index 99cec6078ab..62cc45d910c 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp @@ -16,21 +16,15 @@ * @file PDPSimple.cpp * */ -#include +#include #include -#include #include -#include #include #include #include #include -#include -#include -#include -#include #include #include #include @@ -38,12 +32,17 @@ #include #include #include -#include -#include +#include +#include +#include +#include +#include #include +#include #include #include +#include #include #include @@ -727,10 +726,7 @@ void PDPSimple::assign_low_level_remote_endpoints( mp_builtin->mp_WLP->assignRemoteEndpoints(pdata, notify_secure_endpoints); } - if (mp_builtin->tlm_ != nullptr) - { - mp_builtin->tlm_->assign_remote_endpoints(pdata); - } + mp_builtin->typelookup_manager_->assign_remote_endpoints(pdata); } #if HAVE_SECURITY @@ -769,7 +765,7 @@ bool PDPSimple::newRemoteEndpointStaticallyDiscovered( int16_t userDefinedId, EndpointKind_t kind) { - string_255 pname; + fastcdr::string_255 pname; if (lookup_participant_name(pguid, pname)) { if (kind == WRITER) diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h new file mode 100644 index 00000000000..5065373e3f6 --- /dev/null +++ b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h @@ -0,0 +1,171 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file PDPSimple.h + * + */ + +#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ +#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class StatelessWriter; +class StatelessReader; + +/** + * Class PDPSimple that implements the SimpleRTPSParticipantDiscoveryProtocol as defined in the RTPS specification. + * @ingroup DISCOVERY_MODULE + */ +class PDPSimple : public PDP +{ +public: + + /** + * Constructor + * @param builtin Pointer to the BuiltinProcols object. + * @param allocation Participant allocation parameters. + */ + PDPSimple( + BuiltinProtocols* builtin, + const RTPSParticipantAllocationAttributes& allocation); + + virtual ~PDPSimple(); + + /** + * Initialize the PDP. + * @param part Pointer to the RTPSParticipant. + * @return True on success + */ + bool init( + RTPSParticipantImpl* part) override; + + /** + * Creates an initializes a new participant proxy from a DATA(p) raw info + * @param p ParticipantProxyData from DATA msg deserialization + * @param writer_guid GUID of originating writer + * @return new ParticipantProxyData * or nullptr on failure + */ + ParticipantProxyData* createParticipantProxyData( + const ParticipantProxyData& p, + const GUID_t& writer_guid) override; + + /** + * Some PDP classes require EDP matching with update PDP DATAs like EDPStatic + * @return true if EDP endpoinst must be match + */ + bool updateInfoMatchesEDP() override; + + /** + * Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators. + * @param new_change If true a new change (with new seqNum) is created and sent; if false the last change is re-sent + * @param dispose Sets change kind to NOT_ALIVE_DISPOSED_UNREGISTERED + * @param[in, out] wparams allows to identify the change + */ + void announceParticipantState( + bool new_change, + bool dispose, + WriteParams& wparams) override; + + /** + * \c announceParticipantState method without optional output parameter \c wparams . + */ + void announceParticipantState( + bool new_change, + bool dispose = false) override; + + /** + * This method assigns remote endpoints to the builtin endpoints defined in this protocol. It also calls + * the corresponding methods in EDP and WLP. + * @param pdata Pointer to the ParticipantProxyData object. + */ + void assignRemoteEndpoints( + ParticipantProxyData* pdata) override; + + /** + * Remove remote endpoints from the participant discovery protocol + * @param pdata Pointer to the ParticipantProxyData to remove + */ + void removeRemoteEndpoints( + ParticipantProxyData* pdata) override; + + /** + * Override to match additional endpoints to PDP. Like EDP or WLP. + * @param pdata Pointer to the ParticipantProxyData object. + * @param notify_secure_endpoints Whether to try notifying secure endpoints. + */ + void notifyAboveRemoteEndpoints( + const ParticipantProxyData& pdata, + bool notify_secure_endpoints) override; + + /** + * Activate a new Remote Endpoint that has been statically discovered. + * @param pguid GUID_t of the participant. + * @param userDefinedId User Defined ID. + * @param kind Kind of endpoint. + */ + bool newRemoteEndpointStaticallyDiscovered( + const GUID_t& pguid, + int16_t userDefinedId, + EndpointKind_t kind); + + void update_builtin_locators() override; + +private: + + void initializeParticipantProxyData( + ParticipantProxyData* participant_data) override; + + /** + * Create the SPDP Writer and Reader + * @return True if correct. + */ + bool createPDPEndpoints() override; + + bool create_dcps_participant_endpoints(); + + void match_pdp_remote_endpoints( + const ParticipantProxyData& pdata, + bool notify_secure_endpoints); + + void assign_low_level_remote_endpoints( + const ParticipantProxyData& pdata, + bool notify_secure_endpoints); + +#if HAVE_SECURITY + bool create_dcps_participant_secure_endpoints(); + + bool pairing_remote_writer_with_local_reader_after_security( + const GUID_t& local_reader, + const WriterProxyData& remote_writer_data) override; + + bool pairing_remote_reader_with_local_writer_after_security( + const GUID_t& local_reader, + const ReaderProxyData& remote_reader_data) override; +#endif // HAVE_SECURITY + +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif //_FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp b/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp index deb44928545..007289a0bb5 100644 --- a/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp @@ -24,12 +24,12 @@ #include #include -#include -#include -#include -#include +#include #include +#include +#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/rtps/builtin/liveliness/WLP.cpp b/src/cpp/rtps/builtin/liveliness/WLP.cpp index 7283076e2c6..123aa2f4dd2 100644 --- a/src/cpp/rtps/builtin/liveliness/WLP.cpp +++ b/src/cpp/rtps/builtin/liveliness/WLP.cpp @@ -16,32 +16,31 @@ * @file WLP.cpp * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -#include -#include +#include +#include +#include #include #include - -#include -#include +#include +#include +#include +#include #include -#include +#include +#include -#include +#include +#include +#include +#include +#include +#include +#include namespace eprosima { namespace fastrtps { @@ -618,12 +617,13 @@ void WLP::removeRemoteEndpoints( bool WLP::add_local_writer( RTPSWriter* W, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { std::lock_guard guard(*mp_builtinProtocols->mp_PDP->getMutex()); EPROSIMA_LOG_INFO(RTPS_LIVELINESS, W->getGuid().entityId << " to Liveliness Protocol"); - double wAnnouncementPeriodMilliSec(TimeConv::Duration_t2MilliSecondsDouble(wqos.m_liveliness.announcement_period)); + double wAnnouncementPeriodMilliSec(fastdds::rtps::TimeConv::Duration_t2MilliSecondsDouble(wqos.m_liveliness. + announcement_period)); if (wqos.m_liveliness.kind == AUTOMATIC_LIVELINESS_QOS ) { @@ -737,7 +737,8 @@ bool WLP::remove_local_writer( // There are still some writers. Calculate the new minimum announcement period for (const auto& w : automatic_writers_) { - auto announcement_period = TimeConv::Duration_t2MilliSecondsDouble(w->get_liveliness_announcement_period()); + auto announcement_period = fastdds::rtps::TimeConv::Duration_t2MilliSecondsDouble( + w->get_liveliness_announcement_period()); if (min_automatic_ms_ > announcement_period) { min_automatic_ms_ = announcement_period; @@ -780,7 +781,8 @@ bool WLP::remove_local_writer( // There are still some writers. Calculate the new minimum announcement period for (const auto& w : manual_by_participant_writers_) { - auto announcement_period = TimeConv::Duration_t2MilliSecondsDouble(w->get_liveliness_announcement_period()); + auto announcement_period = fastdds::rtps::TimeConv::Duration_t2MilliSecondsDouble( + w->get_liveliness_announcement_period()); if (min_manual_by_participant_ms_ > announcement_period) { min_manual_by_participant_ms_ = announcement_period; @@ -821,7 +823,7 @@ bool WLP::remove_local_writer( bool WLP::add_local_reader( RTPSReader* reader, - const ReaderQos& rqos) + const fastdds::dds::ReaderQos& rqos) { std::lock_guard guard(*mp_builtinProtocols->mp_PDP->getMutex()); diff --git a/src/cpp/rtps/builtin/liveliness/WLP.h b/src/cpp/rtps/builtin/liveliness/WLP.h new file mode 100644 index 00000000000..0b014ef14e8 --- /dev/null +++ b/src/cpp/rtps/builtin/liveliness/WLP.h @@ -0,0 +1,313 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file WLP.h + * + */ + +#ifndef _FASTDDS_RTPS_WLP_H_ +#define _FASTDDS_RTPS_WLP_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class BuiltinProtocols; +class LivelinessManager; +class ReaderHistory; +class ReaderProxyData; +class RTPSParticipantImpl; +class RTPSReader; +class RTPSWriter; +class StatefulReader; +class StatefulWriter; +class ParticipantProxyData; +class TimedEvent; +class WLPListener; +class WriterHistory; +class WriterProxyData; +class ITopicPayloadPool; + +/** + * Class WLP that implements the Writer Liveliness Protocol described in the RTPS specification. + * @ingroup LIVELINESS_MODULE + */ +class WLP +{ + friend class WLPListener; + friend class StatefulReader; + friend class StatelessReader; + +public: + + /** + * Constructor + * @param prot Pointer to the BuiltinProtocols object. + */ + WLP( + BuiltinProtocols* prot); + virtual ~WLP(); + /** + * Initialize the WLP protocol. + * @param p Pointer to the RTPS participant implementation. + * @return true if the initialziacion was successful. + */ + bool initWL( + RTPSParticipantImpl* p); + /** + * Assign the remote endpoints for a newly discovered RTPSParticipant. + * @param pdata Pointer to the RTPSParticipantProxyData object. + * @param assign_secure_endpoints Whether to try assigning secure endpoints. + * @return True if correct. + */ + bool assignRemoteEndpoints( + const ParticipantProxyData& pdata, + bool assign_secure_endpoints); + /** + * Remove remote endpoints from the liveliness protocol. + * @param pdata Pointer to the ParticipantProxyData to remove + */ + void removeRemoteEndpoints( + ParticipantProxyData* pdata); + /** + * Add a local writer to the liveliness protocol. + * @param W Pointer to the RTPSWriter. + * @param wqos Quality of service policies for the writer. + * @return True if correct. + */ + bool add_local_writer( + RTPSWriter* W, + const fastdds::dds::WriterQos& wqos); + /** + * Remove a local writer from the liveliness protocol. + * @param W Pointer to the RTPSWriter. + * @return True if removed. + */ + bool remove_local_writer( + RTPSWriter* W); + + /** + * @brief Adds a local reader to the liveliness protocol + * @param reader Pointer to the RTPS reader + * @param rqos Quality of service policies for the reader + * @return True if added successfully + */ + bool add_local_reader( + RTPSReader* reader, + const fastdds::dds::ReaderQos& rqos); + + /** + * @brief Removes a local reader from the livliness protocol + * @param reader Pointer to the reader to remove + * @return True if removed successfully + */ + bool remove_local_reader( + RTPSReader* reader); + + /** + * @brief A method to assert liveliness of a given writer + * @param writer The writer, specified via its id + * @param kind The writer liveliness kind + * @param lease_duration The writer lease duration + * @return True if liveliness was asserted + */ + bool assert_liveliness( + GUID_t writer, + LivelinessQosPolicyKind kind, + Duration_t lease_duration); + + /** + * @brief A method to assert liveliness of MANUAL_BY_PARTICIPANT writers + * @return True if there were any MANUAL_BY_PARTICIPANT writers + */ + bool assert_liveliness_manual_by_participant(); + + /** + * Get the livelines builtin writer + * @return stateful writer + */ + StatefulWriter* builtin_writer(); + + /** + * Get the livelines builtin writer's history + * @return writer history + */ + WriterHistory* builtin_writer_history(); + +#if HAVE_SECURITY + bool pairing_remote_reader_with_local_writer_after_security( + const GUID_t& local_writer, + const ReaderProxyData& remote_reader_data); + + bool pairing_remote_writer_with_local_reader_after_security( + const GUID_t& local_reader, + const WriterProxyData& remote_writer_data); +#endif // if HAVE_SECURITY + +private: + + /** + * Create the endpoints used in the WLP. + * @return true if correct. + */ + bool createEndpoints(); + + //! Minimum time among liveliness periods of automatic writers, in milliseconds + double min_automatic_ms_; + //! Minimum time among liveliness periods of manual by participant writers, in milliseconds + double min_manual_by_participant_ms_; + //!Pointer to the local RTPSParticipant. + RTPSParticipantImpl* mp_participant; + //!Pointer to the builtinprotocol class. + BuiltinProtocols* mp_builtinProtocols; + //!Pointer to the builtinRTPSParticipantMEssageWriter. + StatefulWriter* mp_builtinWriter; + //!Pointer to the builtinRTPSParticipantMEssageReader. + StatefulReader* mp_builtinReader; + //!Writer History + WriterHistory* mp_builtinWriterHistory; + //!Reader History + ReaderHistory* mp_builtinReaderHistory; + //!Listener object. + WLPListener* mp_listener; + //!Pointer to the periodic assertion timer object for automatic liveliness writers + TimedEvent* automatic_liveliness_assertion_; + //!Pointer to the periodic assertion timer object for manual by participant liveliness writers + TimedEvent* manual_liveliness_assertion_; + //! List of the writers using automatic liveliness. + std::vector automatic_writers_; + //! List of the writers using manual by participant liveliness. + std::vector manual_by_participant_writers_; + //! List of writers using manual by topic liveliness + std::vector manual_by_topic_writers_; + + //! List of readers + std::vector readers_; + //! A boolean indicating that there is at least one reader requesting automatic liveliness + bool automatic_readers_; + + //! A class used by writers in this participant to keep track of their liveliness + LivelinessManager* pub_liveliness_manager_; + //! A class used by readers in this participant to keep track of liveliness of matched writers + LivelinessManager* sub_liveliness_manager_; + + InstanceHandle_t automatic_instance_handle_; + InstanceHandle_t manual_by_participant_instance_handle_; + + /** + * @brief A method invoked by pub_liveliness_manager_ to inform that a writer changed its liveliness + * @param writer The writer losing liveliness + * @param kind The liveliness kind + * @param lease_duration The liveliness lease duration + * @param alive_change The change in the alive count + * @param not_alive_change The change in the not alive count + */ + void pub_liveliness_changed( + const GUID_t& writer, + const LivelinessQosPolicyKind& kind, + const Duration_t& lease_duration, + int32_t alive_change, + int32_t not_alive_change); + + /** + * @brief A method invoked by sub_liveliness_manager_ to inform that a writer changed its liveliness + * @param writer The writer losing liveliness + * @param kind The liveliness kind of the writer losing liveliness + * @param lease_duration The liveliness lease duration of the writer losing liveliness + * @param alive_change The change in the alive count + * @param not_alive_change The change in the not alive count + */ + void sub_liveliness_changed( + const GUID_t& writer, + const LivelinessQosPolicyKind& kind, + const Duration_t& lease_duration, + int32_t alive_change, + int32_t not_alive_change); + + /** + * @brief A method to update the liveliness changed status of a given reader + * @param writer The writer changing liveliness, specified by its guid + * @param reader The reader whose liveliness needs to be updated + * @param alive_change The change requested for alive count. Should be -1, 0 or +1 + * @param not_alive_change The change requested for not alive count. Should be -1, 0 or +1 + */ + void update_liveliness_changed_status( + GUID_t writer, + RTPSReader* reader, + int32_t alive_change, + int32_t not_alive_change); + + /** + * Implements the automatic liveliness timed event + */ + bool automatic_liveliness_assertion(); + + /** + * Implements the manual by participant liveliness timed event + */ + bool participant_liveliness_assertion(); + + /** + * Adds a cache change to the WLP writer + * @param instance key of the change to add + * @return true if change is correctly added + */ + bool send_liveliness_message( + const InstanceHandle_t& instance); + +#if HAVE_SECURITY + //!Pointer to the builtinRTPSParticipantMEssageWriter. + StatefulWriter* mp_builtinWriterSecure; + //!Pointer to the builtinRTPSParticipantMEssageReader. + StatefulReader* mp_builtinReaderSecure; + //!Writer History + WriterHistory* mp_builtinWriterSecureHistory; + //!Reader History + ReaderHistory* mp_builtinReaderSecureHistory; + + /** + * Create the secure endpoitns used in the WLP. + * @return true if correct. + */ + bool createSecureEndpoints(); +#endif // if HAVE_SECURITY + + std::mutex temp_data_lock_; + ReaderProxyData temp_reader_proxy_data_; + WriterProxyData temp_writer_proxy_data_; + + std::shared_ptr payload_pool_; +#if HAVE_SECURITY + std::shared_ptr secure_payload_pool_; +#endif // if HAVE_SECURITY +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_WLP_H_ */ diff --git a/src/cpp/rtps/builtin/liveliness/WLPListener.cpp b/src/cpp/rtps/builtin/liveliness/WLPListener.cpp index 273fad11e06..d0f6e4ed492 100644 --- a/src/cpp/rtps/builtin/liveliness/WLPListener.cpp +++ b/src/cpp/rtps/builtin/liveliness/WLPListener.cpp @@ -16,17 +16,15 @@ * @file WLPListener.cpp * */ -#include +#include #include #include #include #include +#include #include -#include -#include -#include #include #include #include @@ -36,8 +34,11 @@ #include #include #include -#include -#include + +#include +#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/builtin/liveliness/WLPListener.h b/src/cpp/rtps/builtin/liveliness/WLPListener.h new file mode 100644 index 00000000000..b21e1170316 --- /dev/null +++ b/src/cpp/rtps/builtin/liveliness/WLPListener.h @@ -0,0 +1,110 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file WLPListener.h + * + */ + +#ifndef _FASTDDS_RTPS_WLPLISTENER_H_ +#define _FASTDDS_RTPS_WLPLISTENER_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class WLP; +class RTPSReader; +struct CacheChange_t; + +/** + * Class WLPListener that receives the liveliness messages asserting the liveliness of remote endpoints. + * @ingroup LIVELINESS_MODULE + */ +class WLPListener : public ReaderListener +{ +public: + + /** + * @brief Constructor + * @param pwlp Pointer to the writer liveliness protocol + */ + WLPListener( + WLP* pwlp); + + /** + * @brief Destructor + */ + virtual ~WLPListener(); + + /** + * @brief Method call when this class is notified of a new cache change + * @param reader The reader receiving the cache change + * @param change The cache change + */ + void onNewCacheChangeAdded( + RTPSReader* reader, + const CacheChange_t* const change) override; + +private: + + /** + * Separate the Key between the GuidPrefix_t and the liveliness Kind + * @param key InstanceHandle_t to separate. + * @param guidP GuidPrefix_t pointer to store the info. + * @param liveliness Liveliness Kind Pointer. + * @return True if correctly separated. + */ + bool separateKey( + InstanceHandle_t& key, + GuidPrefix_t* guidP, + LivelinessQosPolicyKind* liveliness); + + /** + * Compute the key from a CacheChange_t + * @param change + */ + bool computeKey( + CacheChange_t* change); + + /** + * @brief Check that the ParticipantMessageData kind is a valid one for WLP and extract the liveliness kind. + * + * @param[in] serialized_kind A pointer to the first octet of the kind array. The function assumes 4 elements + * in the array. + * @param[out] liveliness_kind A reference to the LivelinessQosPolicyKind. + * + * @return True if the kind corresponds with one for WLP, false otherwise. + */ + bool get_wlp_kind( + const octet* serialized_kind, + LivelinessQosPolicyKind& liveliness_kind); + + //! A pointer to the writer liveliness protocol + WLP* mp_WLP; + +}; + +} /* namespace rtps */ +} /* namespace eprosima */ +} // namespace eprosima +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_WLPLISTENER_H_ */ diff --git a/src/cpp/rtps/flowcontrol/FlowControllerImpl.hpp b/src/cpp/rtps/flowcontrol/FlowControllerImpl.hpp index 70a906db2e1..c245866a73d 100644 --- a/src/cpp/rtps/flowcontrol/FlowControllerImpl.hpp +++ b/src/cpp/rtps/flowcontrol/FlowControllerImpl.hpp @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/src/cpp/rtps/history/History.cpp b/src/cpp/rtps/history/History.cpp index f2b12f971f7..8d87f2eab50 100644 --- a/src/cpp/rtps/history/History.cpp +++ b/src/cpp/rtps/history/History.cpp @@ -56,7 +56,7 @@ History::const_iterator History::find_change_nts( return std::find_if(changesBegin(), changesEnd(), [this, ch](const CacheChange_t* chi) { - // use the derived classes comparisson criteria for searching + // use the derived classes comparison criteria for searching return this->matches_change(chi, ch); }); } diff --git a/src/cpp/rtps/history/HistoryAttributesExtension.hpp b/src/cpp/rtps/history/HistoryAttributesExtension.hpp index c263a1bce13..455473a1746 100644 --- a/src/cpp/rtps/history/HistoryAttributesExtension.hpp +++ b/src/cpp/rtps/history/HistoryAttributesExtension.hpp @@ -17,13 +17,13 @@ * */ -#ifndef FASTRTPS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ -#define FASTRTPS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ +#ifndef FASTDDS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ +#define FASTDDS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include +#include namespace eprosima { namespace fastrtps { @@ -34,19 +34,19 @@ static inline ResourceLimitedContainerConfig resource_limits_from_history( size_t increment = 1u) { if (history_attributes.maximumReservedCaches > 0 && - history_attributes.initialReservedCaches == history_attributes.maximumReservedCaches) + history_attributes.initialReservedCaches == history_attributes.maximumReservedCaches) { return ResourceLimitedContainerConfig::fixed_size_configuration(history_attributes.maximumReservedCaches); } return - { - history_attributes.initialReservedCaches > 0 ? + { + history_attributes.initialReservedCaches > 0 ? static_cast(history_attributes.initialReservedCaches) : 0, - history_attributes.maximumReservedCaches > 0 ? + history_attributes.maximumReservedCaches > 0 ? static_cast(history_attributes.maximumReservedCaches) : std::numeric_limits::max(), - increment > 0 ? increment : 1u - }; + increment > 0 ? increment : 1u + }; } } // namespace rtps @@ -54,4 +54,4 @@ static inline ResourceLimitedContainerConfig resource_limits_from_history( } // namespace eprosima #endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif // FASTRTPS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ +#endif // FASTDDS_RTPS_HISTORY_HISTORYATTRIBUTESEXTENSION_HPP_ diff --git a/src/cpp/rtps/history/ReaderHistory.cpp b/src/cpp/rtps/history/ReaderHistory.cpp index 274d07f5485..e39a7483c28 100644 --- a/src/cpp/rtps/history/ReaderHistory.cpp +++ b/src/cpp/rtps/history/ReaderHistory.cpp @@ -20,12 +20,12 @@ #include #include -#include #include #include #include #include +#include #include diff --git a/src/cpp/rtps/messages/MessageReceiver.cpp b/src/cpp/rtps/messages/MessageReceiver.cpp index c04d3d5b4f0..aab960c7ac5 100644 --- a/src/cpp/rtps/messages/MessageReceiver.cpp +++ b/src/cpp/rtps/messages/MessageReceiver.cpp @@ -23,17 +23,17 @@ #include #include -#include #include #include #include #include -#include +#include #include -#include #include +#include +#include #define INFO_SRC_SUBMSG_LENGTH 20 diff --git a/src/cpp/rtps/messages/MessageReceiver.h b/src/cpp/rtps/messages/MessageReceiver.h new file mode 100644 index 00000000000..a0bfd7e911e --- /dev/null +++ b/src/cpp/rtps/messages/MessageReceiver.h @@ -0,0 +1,293 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file MessageReceiver.h + */ + +#ifndef _FASTDDS_RTPS_MESSAGERECEIVER_H_ +#define _FASTDDS_RTPS_MESSAGERECEIVER_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include + +#include +#include + +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class RTPSParticipantImpl; +class Endpoint; +class RTPSWriter; +class RTPSReader; +struct SubmessageHeader_t; + +/** + * Class MessageReceiver, process the received messages. + * @ingroup MANAGEMENT_MODULE + */ +class MessageReceiver +{ +public: + + /** + * @param participant + * @param rec_buffer_size + */ + MessageReceiver( + RTPSParticipantImpl* participant, + uint32_t rec_buffer_size); + + virtual ~MessageReceiver(); + + /** + * Process a new CDR message. + * @param [in] source_locator Locator indicating the sending address. + * @param [in] reception_locator Locator indicating the listening address. + * @param [in] msg Pointer to the message + */ + void processCDRMsg( + const Locator_t& source_locator, + const Locator_t& reception_locator, + CDRMessage_t* msg); + + // Functions to associate/remove associatedendpoints + void associateEndpoint( + Endpoint* to_add); + void removeEndpoint( + Endpoint* to_remove); + +private: + + mutable eprosima::shared_mutex mtx_; + std::vector associated_writers_; + std::unordered_map> associated_readers_; + + RTPSParticipantImpl* participant_; + //!Protocol version of the message + ProtocolVersion_t source_version_; + //!VendorID that created the message + fastdds::rtps::VendorId_t source_vendor_id_; + //!GuidPrefix of the entity that created the message + GuidPrefix_t source_guid_prefix_; + //!GuidPrefix of the entity that receives the message. GuidPrefix of the RTPSParticipant. + GuidPrefix_t dest_guid_prefix_; + //!Has the message timestamp? + bool have_timestamp_; + //!Timestamp associated with the message + Time_t timestamp_; + +#if HAVE_SECURITY + //!Buffer to process the decoded RTPS message + CDRMessage_t crypto_msg_; + //!Buffer to process each decoded RTPS sub-message + CDRMessage_t crypto_submsg_; + //!Buffer to process a decoded payload + SerializedPayload_t crypto_payload_; +#endif // if HAVE_SECURITY + + //! Function used to process a received message + std::function process_data_message_function_; + //! Function used to process a received fragment message + std::function process_data_fragment_message_function_; + + //!Reset the MessageReceiver to process a new message. + void reset(); + + /** + * Check the RTPSHeader of a received message. + * @param msg Pointer to the message. + * @return True if correct. + */ + bool checkRTPSHeader( + CDRMessage_t* msg); + /** + * Read the submessage header of a message. + * @param msg Pointer to the CDRMessage_t to read. + * @param smh Pointer to the submessageheader structure. + * @return True if correctly read. + */ + bool readSubmessageHeader( + CDRMessage_t* msg, + SubmessageHeader_t* smh) const; + + /** + * Find if there is a reader (in associated_readers_) that will accept a msg directed + * to the given entity ID. + */ + bool willAReaderAcceptMsgDirectedTo( + const EntityId_t& readerID, + RTPSReader*& first_reader) const; + + /** + * Find all readers (in associated_readers_), with the given entity ID, and call the + * callback provided. + */ + template + void findAllReaders( + const EntityId_t& readerID, + const Functor& callback) const; + + /**@name Processing methods. + * These methods are designed to read a part of the message + * and perform the corresponding actions: + * -Modify the message receiver state if necessary. + * -Add information to the history. + * -Return an error if the message is malformed. + * @param[in,out] msg Pointer to the message + * @param[in] smh Pointer to the submessage header + * @param[out] WriterID Writer EntityID (only for DATA messages) + * @param[in] was_decoded Whether the submessage being processed came from decoding a secured submessage + * @return True if correct, false otherwise + */ + + ///@{ + /** + * + * @param msg + * @param smh + * @param writerID + * @param was_decoded + * @return + */ + bool proc_Submsg_Data( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + EntityId_t& writerID, + bool was_decoded) const; + bool proc_Submsg_DataFrag( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + bool proc_Submsg_Heartbeat( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + bool proc_Submsg_Acknack( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + bool proc_Submsg_Gap( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + bool proc_Submsg_InfoTS( + CDRMessage_t* msg, + SubmessageHeader_t* smh); + bool proc_Submsg_InfoDST( + CDRMessage_t* msg, + SubmessageHeader_t* smh); + bool proc_Submsg_InfoSRC( + CDRMessage_t* msg, + SubmessageHeader_t* smh); + bool proc_Submsg_NackFrag( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + bool proc_Submsg_HeartbeatFrag( + CDRMessage_t* msg, + SubmessageHeader_t* smh, + bool was_decoded) const; + ///@} + + + /** + * @name Variants of received data message processing functions. + * + * @param[in] reader_id The ID of the reader to which the changes is addressed + * @param[in] change The CacheChange with the received data to process + * @param[in] was_decoded Whether the submessage being processed came from decoding a secured submessage + */ + ///@{ + #if HAVE_SECURITY + void process_data_message_with_security( + const EntityId_t& reader_id, + CacheChange_t& change, + bool was_decoded); +#endif // HAVE_SECURITY + + void process_data_message_without_security( + const EntityId_t& reader_id, + CacheChange_t& change, + bool was_decoded); + ///@} + + /** + * @name Variants of received data fragment message processing functions. + * + * @param[in] reader_id The ID of the reader to which the changes is addressed + * @param[in] change The CacheChange with the received data to process + * + * @param[in] sample_size The size of the message + * @param[in] fragment_starting_num The index of the first fragment in the message + * @param[in] fragments_in_submessage The number of fragments in the message + * @param[in] was_decoded Whether the submessage being processed came from decoding a secured + * submessage + */ + ///@{ + #if HAVE_SECURITY + void process_data_fragment_message_with_security( + const EntityId_t& reader_id, + CacheChange_t& change, + uint32_t sample_size, + uint32_t fragment_starting_num, + uint16_t fragments_in_submessage, + bool was_decoded); +#endif // HAVE_SECURITY + + void process_data_fragment_message_without_security( + const EntityId_t& reader_id, + CacheChange_t& change, + uint32_t sample_size, + uint32_t fragment_starting_num, + uint16_t fragments_in_submessage, + bool was_decoded); + ///@} + + /** + * Looks for the statistics specific submessage and notifies statistics related to the received message. + * + * @param [in] source_locator Locator indicating the sending address. + * @param [in] reception_locator Locator indicating the listening address. + * @param [in] msg Pointer to the message + * + * @pre The message header has already been read and validated. + */ + void notify_network_statistics( + const Locator_t& source_locator, + const Locator_t& reception_locator, + CDRMessage_t* msg) const; + +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_MESSAGERECEIVER_H_ */ diff --git a/src/cpp/rtps/messages/RTPSGapBuilder.hpp b/src/cpp/rtps/messages/RTPSGapBuilder.hpp index 94ce318f547..a9ad290361c 100644 --- a/src/cpp/rtps/messages/RTPSGapBuilder.hpp +++ b/src/cpp/rtps/messages/RTPSGapBuilder.hpp @@ -21,7 +21,7 @@ #define RTPSGAPBUILDER_HPP #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include +#include namespace eprosima { namespace fastrtps { @@ -67,7 +67,7 @@ class RTPSGapBuilder * Adds a sequence number to the GAP list. * * @remark Sequence numbers should be added in strict increasing order. - * + * * @param gap_sequence Sequence number to be added to the GAP list. * @return false if a GAP message couldn't be added to the message group, * true if no GAP message was needed or it was successfully added. @@ -103,5 +103,5 @@ class RTPSGapBuilder } /* namespace fastrtps */ } /* namespace eprosima */ -#endif +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #endif /* RTPSGAPBUILDER_HPP */ diff --git a/src/cpp/rtps/messages/RTPSMessageGroup_t.hpp b/src/cpp/rtps/messages/RTPSMessageGroup_t.hpp index 75730544ef9..f1b31218440 100644 --- a/src/cpp/rtps/messages/RTPSMessageGroup_t.hpp +++ b/src/cpp/rtps/messages/RTPSMessageGroup_t.hpp @@ -21,15 +21,15 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastrtps { namespace rtps { - /** +/** * Class RTPSMessageGroup_t that contains the messages used to send multiples changes as one message. * @ingroup WRITER_MODULE */ @@ -40,14 +40,14 @@ class RTPSMessageGroup_t RTPSMessageGroup_t( #if HAVE_SECURITY bool has_security, -#endif +#endif // if HAVE_SECURITY uint32_t payload, const GuidPrefix_t& participant_guid) : rtpsmsg_submessage_(0u) , rtpsmsg_fullmsg_(0u) #if HAVE_SECURITY , rtpsmsg_encrypt_(0u) -#endif +#endif // if HAVE_SECURITY { rtpsmsg_fullmsg_.reserve(payload); rtpsmsg_submessage_.reserve(payload); @@ -57,7 +57,7 @@ class RTPSMessageGroup_t { rtpsmsg_encrypt_.reserve(payload); } -#endif +#endif // if HAVE_SECURITY init(participant_guid); } @@ -66,14 +66,14 @@ class RTPSMessageGroup_t octet* buffer_ptr, #if HAVE_SECURITY bool has_security, -#endif +#endif // if HAVE_SECURITY uint32_t payload, const GuidPrefix_t& participant_guid) : rtpsmsg_submessage_(0u) , rtpsmsg_fullmsg_(0u) #if HAVE_SECURITY , rtpsmsg_encrypt_(0u) -#endif +#endif // if HAVE_SECURITY { rtpsmsg_fullmsg_.init(buffer_ptr, payload); buffer_ptr += payload; @@ -85,7 +85,7 @@ class RTPSMessageGroup_t buffer_ptr += payload; rtpsmsg_encrypt_.init(buffer_ptr, payload); } -#endif +#endif // if HAVE_SECURITY init(participant_guid); } @@ -103,7 +103,7 @@ class RTPSMessageGroup_t #if HAVE_SECURITY CDRMessage_t rtpsmsg_encrypt_; -#endif +#endif // if HAVE_SECURITY }; } // namespace rtps diff --git a/src/cpp/rtps/messages/SendBuffersManager.hpp b/src/cpp/rtps/messages/SendBuffersManager.hpp index fccc584a0a8..bb6a1ecf828 100644 --- a/src/cpp/rtps/messages/SendBuffersManager.hpp +++ b/src/cpp/rtps/messages/SendBuffersManager.hpp @@ -22,8 +22,8 @@ #include "RTPSMessageGroup_t.hpp" #include -#include -#include +#include +#include #include // std::vector #include // std::unique_ptr diff --git a/src/cpp/rtps/messages/submessages/DataMsg.hpp b/src/cpp/rtps/messages/submessages/DataMsg.hpp index 8a295d5e5cb..65e11a48d60 100644 --- a/src/cpp/rtps/messages/submessages/DataMsg.hpp +++ b/src/cpp/rtps/messages/submessages/DataMsg.hpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include @@ -124,19 +124,21 @@ struct DataMsgUtils { if (change->write_params.related_sample_identity() != SampleIdentity::unknown()) { - fastdds::dds::ParameterSerializer::add_parameter_sample_identity(msg, - change->write_params.related_sample_identity()); - fastdds::dds::ParameterSerializer::add_parameter_custom_related_sample_identity(msg, + fastdds::dds::ParameterSerializer::add_parameter_sample_identity(msg, change->write_params.related_sample_identity()); + fastdds::dds::ParameterSerializer::add_parameter_custom_related_sample_identity( + msg, + change->write_params.related_sample_identity()); } if (WITH_KEY == topicKind && (!change->writerGUID.is_builtin() || expectsInlineQos || ALIVE != change->kind)) { - fastdds::dds::ParameterSerializer::add_parameter_key(msg, change->instanceHandle); + fastdds::dds::ParameterSerializer::add_parameter_key(msg, + change->instanceHandle); if (ALIVE != change->kind) { - fastdds::dds::ParameterSerializer::add_parameter_status(msg, status); + fastdds::dds::ParameterSerializer::add_parameter_status(msg, status); } } @@ -145,7 +147,7 @@ struct DataMsgUtils inlineQos->writeQosToCDRMessage(msg); } - fastdds::dds::ParameterSerializer::add_parameter_sentinel(msg); + fastdds::dds::ParameterSerializer::add_parameter_sentinel(msg); } }; @@ -250,10 +252,12 @@ bool RTPSMessageCreator::addSubmessageData( added_no_error &= CDRMessage::addUInt16(msg, 0); //ENCAPSULATION OPTIONS added_no_error &= - fastdds::dds::ParameterSerializer::add_parameter_key(msg, + fastdds::dds::ParameterSerializer::add_parameter_key(msg, change->instanceHandle); - added_no_error &= fastdds::dds::ParameterSerializer::add_parameter_status(msg, status); - added_no_error &= fastdds::dds::ParameterSerializer::add_parameter_sentinel(msg); + added_no_error &= + fastdds::dds::ParameterSerializer::add_parameter_status(msg, + status); + added_no_error &= fastdds::dds::ParameterSerializer::add_parameter_sentinel(msg); } // Align submessage to rtps alignment (4). diff --git a/src/cpp/rtps/network/NetworkFactory.cpp b/src/cpp/rtps/network/NetworkFactory.cpp index 80a6f1c9482..47a46b95fe9 100644 --- a/src/cpp/rtps/network/NetworkFactory.cpp +++ b/src/cpp/rtps/network/NetworkFactory.cpp @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/src/cpp/rtps/network/NetworkFactory.h b/src/cpp/rtps/network/NetworkFactory.h index 1071230210b..50ac606ed7a 100644 --- a/src/cpp/rtps/network/NetworkFactory.h +++ b/src/cpp/rtps/network/NetworkFactory.h @@ -21,10 +21,10 @@ #include #include #include -#include #include #include +#include #include namespace eprosima { @@ -34,7 +34,7 @@ namespace rtps { class RTPSParticipantAttributes; /** - * Provides the FastRTPS library with abstract resources, which + * Provides the Fast DDS library with abstract resources, which * in turn manage the SEND and RECEIVE operations over some transport. * Once a transport is registered, it becomes invisible to the library * and is abstracted away for good. diff --git a/src/cpp/rtps/network/ReceiverResource.cpp b/src/cpp/rtps/network/ReceiverResource.cpp index f2b1a37a195..d65601cfc1b 100644 --- a/src/cpp/rtps/network/ReceiverResource.cpp +++ b/src/cpp/rtps/network/ReceiverResource.cpp @@ -18,7 +18,8 @@ #include #include -#include + +#include #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << diff --git a/src/cpp/rtps/network/ReceiverResource.h b/src/cpp/rtps/network/ReceiverResource.h index d2744c52f8b..62ad7219b02 100644 --- a/src/cpp/rtps/network/ReceiverResource.h +++ b/src/cpp/rtps/network/ReceiverResource.h @@ -20,9 +20,10 @@ #include #include -#include #include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/src/cpp/rtps/network/utils/external_locators.cpp b/src/cpp/rtps/network/utils/external_locators.cpp index bee1ac324a6..5d4045e1b32 100644 --- a/src/cpp/rtps/network/utils/external_locators.cpp +++ b/src/cpp/rtps/network/utils/external_locators.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/cpp/rtps/participant/RTPSParticipant.cpp b/src/cpp/rtps/participant/RTPSParticipant.cpp index f6a32273acb..460a899c5b7 100644 --- a/src/cpp/rtps/participant/RTPSParticipant.cpp +++ b/src/cpp/rtps/participant/RTPSParticipant.cpp @@ -78,7 +78,7 @@ uint32_t RTPSParticipant::getRTPSParticipantID() const bool RTPSParticipant::registerWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { return mp_impl->registerWriter(Writer, topicAtt, wqos); } @@ -86,7 +86,7 @@ bool RTPSParticipant::registerWriter( bool RTPSParticipant::registerReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { return mp_impl->registerReader(Reader, topicAtt, rqos, content_filter); @@ -101,7 +101,7 @@ void RTPSParticipant::update_attributes( bool RTPSParticipant::updateWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos) + const fastdds::dds::WriterQos& wqos) { return mp_impl->updateLocalWriter(Writer, topicAtt, wqos); } @@ -109,7 +109,7 @@ bool RTPSParticipant::updateWriter( bool RTPSParticipant::updateReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter) { return mp_impl->updateLocalReader(Reader, topicAtt, rqos, content_filter); @@ -145,11 +145,6 @@ WLP* RTPSParticipant::wlp() const return mp_impl->wlp(); } -fastdds::dds::builtin::TypeLookupManager* RTPSParticipant::typelookup_manager() const -{ - return mp_impl->typelookup_manager(); -} - bool RTPSParticipant::get_new_entity_id( EntityId_t& entityId) { diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index 2e8a95698e0..92c2fb75ad1 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -17,60 +17,60 @@ * */ +#include + #include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include -#include #include -#include #include +#include #include -#include #include #include -#include +#include #include #include -#include +#include #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include -#include - -#include -#include -#include - +#include +#include +#include #include #include +#include +#include #include +#include #include #include #include #include #include +#include #include #include - +#include #ifdef FASTDDS_STATISTICS -#include #include #endif // ifdef FASTDDS_STATISTICS @@ -98,7 +98,7 @@ static void set_builtin_transports_from_env_var( BuiltinTransports ret_val = BuiltinTransports::DEFAULT; std::string env_value; - if (SystemInfo::get_env(env_var_name, env_value) == ReturnCode_t::RETCODE_OK) + if (SystemInfo::get_env(env_var_name, env_value) == fastdds::dds::RETCODE_OK) { std::regex COMMON_REGEX(R"((\w+))"); std::regex OPTIONS_REGEX( @@ -207,7 +207,7 @@ static bool should_be_intraprocess_only( const RTPSParticipantAttributes& att) { return - xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == INTRAPROCESS_FULL && + xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == fastdds::INTRAPROCESS_FULL && att.builtin.discovery_config.ignoreParticipantFlags == (ParticipantFilteringFlags::FILTER_DIFFERENT_HOST | ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS); } @@ -2521,7 +2521,7 @@ WLP* RTPSParticipantImpl::wlp() fastdds::dds::builtin::TypeLookupManager* RTPSParticipantImpl::typelookup_manager() const { - return mp_builtinProtocols->tlm_; + return mp_builtinProtocols->typelookup_manager_; } IPersistenceService* RTPSParticipantImpl::get_persistence_service( @@ -3034,7 +3034,7 @@ const fastdds::statistics::rtps::IStatusObserver* RTPSParticipantImpl::create_mo }, [&](RTPSWriter* w, const fastrtps::TopicAttributes& topicAtt, - const fastrtps::WriterQos& wqos) -> bool + const fastdds::dds::WriterQos& wqos) -> bool { return this->registerWriter(w, topicAtt, wqos); }, @@ -3179,7 +3179,7 @@ RTPSParticipantImpl::get_entity_connections( { fastdds::statistics::Connection connection; connection.guid(fastdds::statistics::to_statistics_type((*pit)->m_guid)); - connection.mode(fastdds::statistics::TRANSPORT); + connection.mode(fastdds::statistics::ConnectionMode::TRANSPORT); std::vector statistic_locators; statistic_locators.reserve((*pit)->metatraffic_locators.multicast.size() + diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.h b/src/cpp/rtps/participant/RTPSParticipantImpl.h index 21aeed182bb..b87ea3368e9 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.h +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.h @@ -43,13 +43,11 @@ #include #include #include -#include #include #include -#include -#include #include "../flowcontrol/FlowControllerFactory.hpp" +#include #include #include #include @@ -57,7 +55,9 @@ #include #include #include -#include +#include +#include +#include #if HAVE_SECURITY #include @@ -559,8 +559,6 @@ class RTPSParticipantImpl std::string guid_str_; //!Persistence guid of the RTPSParticipant GUID_t m_persistence_guid; - //! Sending resources. - DEPRECATED -Stays commented for reference purposes - // ResourceSend* mp_send_thr; //! Event Resource ResourceEvent mp_event_thr; //! BuiltinProtocols of this RTPSParticipant @@ -915,7 +913,7 @@ class RTPSParticipantImpl bool registerWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos); + const fastdds::dds::WriterQos& wqos); /** * Register a Reader in the BuiltinProtocols. @@ -928,7 +926,7 @@ class RTPSParticipantImpl bool registerReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); /** @@ -948,7 +946,7 @@ class RTPSParticipantImpl bool updateLocalWriter( RTPSWriter* Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos); + const fastdds::dds::WriterQos& wqos); /** * Update local reader QoS @@ -961,7 +959,7 @@ class RTPSParticipantImpl bool updateLocalReader( RTPSReader* Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter = nullptr); /** diff --git a/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp b/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp index cb59fdf0d5d..4e016485bee 100644 --- a/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp +++ b/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include diff --git a/src/cpp/rtps/reader/ReaderHistoryState.hpp b/src/cpp/rtps/reader/ReaderHistoryState.hpp index d464333d5f8..cdac9749cb6 100644 --- a/src/cpp/rtps/reader/ReaderHistoryState.hpp +++ b/src/cpp/rtps/reader/ReaderHistoryState.hpp @@ -16,8 +16,8 @@ * @file ReaderHistoryState.hpp */ -#ifndef FASTRTPS_RTPS_READER_READERHISTORYSTATE_HPP_ -#define FASTRTPS_RTPS_READER_READERHISTORYSTATE_HPP_ +#ifndef FASTDDS_RTPS_READER_READERHISTORYSTATE_HPP_ +#define FASTDDS_RTPS_READER_READERHISTORYSTATE_HPP_ #include #include @@ -79,4 +79,4 @@ struct ReaderHistoryState } /* namespace fastrtps */ } /* namespace eprosima */ -#endif /* FASTRTPS_RTPS_READER_READERHISTORYSTATE_HPP_ */ +#endif /* FASTDDS_RTPS_READER_READERHISTORYSTATE_HPP_ */ diff --git a/src/cpp/rtps/reader/StatefulPersistentReader.cpp b/src/cpp/rtps/reader/StatefulPersistentReader.cpp index e971a68d64f..d7e958545a3 100644 --- a/src/cpp/rtps/reader/StatefulPersistentReader.cpp +++ b/src/cpp/rtps/reader/StatefulPersistentReader.cpp @@ -18,9 +18,10 @@ */ #include + #include + #include -#include #include namespace eprosima { diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index ef4a1991312..95a7da8e3ae 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -22,24 +22,27 @@ #include #include -#include -#include #include #include #include #include #include -#include -#include +#include +#include #include #include #include #include #include +#include #include "rtps/RTPSDomainImpl.hpp" +#ifdef FASTDDS_STATISTICS +#include +#endif // FASTDDS_STATISTICS + #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << using namespace eprosima::fastrtps::rtps; @@ -1501,15 +1504,15 @@ bool StatefulReader::get_connections( if (writer->is_datasharing_writer()) { - mode = fastdds::statistics::DATA_SHARING; + mode = fastdds::statistics::ConnectionMode::DATA_SHARING; } else if (RTPSDomainImpl::should_intraprocess_between(m_guid, writer->guid())) { - mode = fastdds::statistics::INTRAPROCESS; + mode = fastdds::statistics::ConnectionMode::INTRAPROCESS; } else { - mode = fastdds::statistics::TRANSPORT; + mode = fastdds::statistics::ConnectionMode::TRANSPORT; //! Announced locators is, for the moment, //! equal to the used_locators diff --git a/src/cpp/rtps/reader/StatelessPersistentReader.cpp b/src/cpp/rtps/reader/StatelessPersistentReader.cpp index ecb9f8b5b09..d0c5f1e2c66 100644 --- a/src/cpp/rtps/reader/StatelessPersistentReader.cpp +++ b/src/cpp/rtps/reader/StatelessPersistentReader.cpp @@ -18,9 +18,10 @@ */ #include + #include + #include -#include #include namespace eprosima { diff --git a/src/cpp/rtps/reader/StatelessReader.cpp b/src/cpp/rtps/reader/StatelessReader.cpp index a39b182042f..750eae24afb 100644 --- a/src/cpp/rtps/reader/StatelessReader.cpp +++ b/src/cpp/rtps/reader/StatelessReader.cpp @@ -22,21 +22,25 @@ #include #include -#include -#include #include #include #include #include #include -#include -#include +#include +#include #include #include +#include +#include #include "rtps/RTPSDomainImpl.hpp" +#ifdef FASTDDS_STATISTICS +#include +#endif // FASTDDS_STATISTICS + #define IDSTRING "(ID:" << std::this_thread::get_id() << ") " << using namespace eprosima::fastrtps::rtps; @@ -520,15 +524,15 @@ bool StatelessReader::get_connections( if (writer.is_datasharing) { - mode = fastdds::statistics::DATA_SHARING; + mode = fastdds::statistics::ConnectionMode::DATA_SHARING; } else if (RTPSDomainImpl::should_intraprocess_between(m_guid, writer.guid)) { - mode = fastdds::statistics::INTRAPROCESS; + mode = fastdds::statistics::ConnectionMode::INTRAPROCESS; } else { - mode = fastdds::statistics::TRANSPORT; + mode = fastdds::statistics::ConnectionMode::TRANSPORT; //! In the case of a stateless reader //! there is no need to communicate with the writer diff --git a/src/cpp/rtps/reader/WriterProxy.cpp b/src/cpp/rtps/reader/WriterProxy.cpp index be9e927b19d..55f3a741855 100644 --- a/src/cpp/rtps/reader/WriterProxy.cpp +++ b/src/cpp/rtps/reader/WriterProxy.cpp @@ -20,21 +20,19 @@ #include #include - #include #include #include #include - -#include - -#include -#include +#include #include "rtps/RTPSDomainImpl.hpp" #include "utils/collections/node_size_helpers.hpp" +#include +#include +#include -#if !defined(NDEBUG) && !defined(ANDROID) && defined(FASTRTPS_SOURCE) && defined(__unix__) +#if !defined(NDEBUG) && !defined(ANDROID) && defined(FASTDDS_SOURCE) && defined(__unix__) #define SHOULD_DEBUG_LINUX #endif // SHOULD_DEBUG_LINUX diff --git a/src/cpp/rtps/reader/WriterProxy.h b/src/cpp/rtps/reader/WriterProxy.h index 59f58719ea0..d8cf1eb6021 100644 --- a/src/cpp/rtps/reader/WriterProxy.h +++ b/src/cpp/rtps/reader/WriterProxy.h @@ -16,8 +16,8 @@ * @file WriterProxy.h */ -#ifndef FASTRTPS_RTPS_READER_WRITERPROXY_H_ -#define FASTRTPS_RTPS_READER_WRITERPROXY_H_ +#ifndef FASTDDS_RTPS_READER_WRITERPROXY_H_ +#define FASTDDS_RTPS_READER_WRITERPROXY_H_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -420,11 +420,11 @@ class WriterProxy : public RTPSMessageSenderInterface using ChangeIterator = decltype(changes_received_)::iterator; -#if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__unix__) +#if !defined(NDEBUG) && defined(FASTDDS_SOURCE) && defined(__unix__) int get_mutex_owner() const; int get_thread_id() const; -#endif // if !defined(NDEBUG) && defined(FASTRTPS_SOURCE) && defined(__unix__) +#endif // if !defined(NDEBUG) && defined(FASTDDS_SOURCE) && defined(__unix__) }; } /* namespace rtps */ @@ -432,4 +432,4 @@ class WriterProxy : public RTPSMessageSenderInterface } /* namespace eprosima */ #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* FASTRTPS_RTPS_READER_WRITERPROXY_H_ */ +#endif /* FASTDDS_RTPS_READER_WRITERPROXY_H_ */ diff --git a/src/cpp/rtps/resources/TimedEventImpl.cpp b/src/cpp/rtps/resources/TimedEventImpl.cpp index 3bcddc6e09f..0249b500083 100644 --- a/src/cpp/rtps/resources/TimedEventImpl.cpp +++ b/src/cpp/rtps/resources/TimedEventImpl.cpp @@ -21,7 +21,7 @@ #include "TimedEventImpl.h" #include -#include +#include namespace eprosima { namespace fastrtps { @@ -113,7 +113,7 @@ void TimedEventImpl::trigger( bool TimedEventImpl::update_interval( const eprosima::fastrtps::Duration_t& interval) { - interval_microsec_ = std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64(interval)); + interval_microsec_ = std::chrono::microseconds(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64(interval)); return true; } diff --git a/src/cpp/rtps/security/SecurityManager.cpp b/src/cpp/rtps/security/SecurityManager.cpp index 020b12aa2fd..495087f8349 100644 --- a/src/cpp/rtps/security/SecurityManager.cpp +++ b/src/cpp/rtps/security/SecurityManager.cpp @@ -28,8 +28,6 @@ #include #include #include -#include -#include #include #include #include @@ -44,6 +42,8 @@ #include #include +#include +#include #include #include #include @@ -2096,8 +2096,9 @@ void SecurityManager::match_builtin_endpoints( temp_stateless_writer_proxy_data_->persistence_guid(temp_stateless_writer_proxy_data_->guid()); temp_stateless_writer_proxy_data_->set_remote_locators(participant_data.metatraffic_locators, network, false); temp_stateless_writer_proxy_data_->topicKind(NO_KEY); - temp_stateless_writer_proxy_data_->m_qos.m_reliability.kind = BEST_EFFORT_RELIABILITY_QOS; - temp_stateless_writer_proxy_data_->m_qos.m_durability.kind = VOLATILE_DURABILITY_QOS; + temp_stateless_writer_proxy_data_->m_qos.m_reliability.kind = + eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; + temp_stateless_writer_proxy_data_->m_qos.m_durability.kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; participant_stateless_message_reader_->matched_writer_add(*temp_stateless_writer_proxy_data_); } @@ -2112,8 +2113,9 @@ void SecurityManager::match_builtin_endpoints( temp_stateless_reader_proxy_data_->guid().entityId = participant_stateless_message_reader_entity_id; temp_stateless_reader_proxy_data_->set_remote_locators(participant_data.metatraffic_locators, network, false); temp_stateless_reader_proxy_data_->topicKind(NO_KEY); - temp_stateless_reader_proxy_data_->m_qos.m_reliability.kind = BEST_EFFORT_RELIABILITY_QOS; - temp_stateless_reader_proxy_data_->m_qos.m_durability.kind = VOLATILE_DURABILITY_QOS; + temp_stateless_reader_proxy_data_->m_qos.m_reliability.kind = + eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; + temp_stateless_reader_proxy_data_->m_qos.m_durability.kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; participant_stateless_message_writer_->matched_reader_add(*temp_stateless_reader_proxy_data_); } } @@ -2135,8 +2137,8 @@ void SecurityManager::match_builtin_key_exchange_endpoints( temp_volatile_writer_proxy_data_->persistence_guid(temp_volatile_writer_proxy_data_->guid()); temp_volatile_writer_proxy_data_->set_remote_locators(participant_data.metatraffic_locators, network, false); temp_volatile_writer_proxy_data_->topicKind(NO_KEY); - temp_volatile_writer_proxy_data_->m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - temp_volatile_writer_proxy_data_->m_qos.m_durability.kind = VOLATILE_DURABILITY_QOS; + temp_volatile_writer_proxy_data_->m_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + temp_volatile_writer_proxy_data_->m_qos.m_durability.kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; participant_volatile_message_secure_reader_->matched_writer_add(*temp_volatile_writer_proxy_data_); } @@ -2151,8 +2153,8 @@ void SecurityManager::match_builtin_key_exchange_endpoints( temp_volatile_reader_proxy_data_->guid().entityId = participant_volatile_message_secure_reader_entity_id; temp_volatile_reader_proxy_data_->set_remote_locators(participant_data.metatraffic_locators, network, false); temp_volatile_reader_proxy_data_->topicKind(NO_KEY); - temp_volatile_reader_proxy_data_->m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - temp_volatile_reader_proxy_data_->m_qos.m_durability.kind = VOLATILE_DURABILITY_QOS; + temp_volatile_reader_proxy_data_->m_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; + temp_volatile_reader_proxy_data_->m_qos.m_durability.kind = eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS; participant_volatile_message_secure_writer_->matched_reader_add(*temp_volatile_reader_proxy_data_); } } diff --git a/src/cpp/rtps/security/SecurityManager.h b/src/cpp/rtps/security/SecurityManager.h index 2e3b1f9dc09..6b9101c4ae7 100644 --- a/src/cpp/rtps/security/SecurityManager.h +++ b/src/cpp/rtps/security/SecurityManager.h @@ -25,8 +25,6 @@ #include #include -#include - #include #include #include @@ -38,8 +36,10 @@ #include #include #include -#include -#include + +#include +#include +#include namespace eprosima { namespace fastrtps { @@ -920,7 +920,7 @@ class SecurityManager : private WriterListener std::map> associated_writers; }; - // TODO(Ricardo) Temporal. Store individual in FastRTPS code. + // TODO(Ricardo) Temporal. Store individual in Fast DDS code. std::map writer_handles_; std::map reader_handles_; diff --git a/src/cpp/rtps/transport/ChannelResource.cpp b/src/cpp/rtps/transport/ChannelResource.cpp index 83a2806db88..1f880317354 100644 --- a/src/cpp/rtps/transport/ChannelResource.cpp +++ b/src/cpp/rtps/transport/ChannelResource.cpp @@ -73,5 +73,5 @@ void ChannelResource::clear() } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPAcceptor.cpp b/src/cpp/rtps/transport/TCPAcceptor.cpp index 919b725819a..65f35a2441d 100644 --- a/src/cpp/rtps/transport/TCPAcceptor.cpp +++ b/src/cpp/rtps/transport/TCPAcceptor.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include namespace eprosima { @@ -50,5 +50,5 @@ TCPAcceptor::TCPAcceptor( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPAcceptorBasic.cpp b/src/cpp/rtps/transport/TCPAcceptorBasic.cpp index b1b600b0a29..1ea675c60da 100644 --- a/src/cpp/rtps/transport/TCPAcceptorBasic.cpp +++ b/src/cpp/rtps/transport/TCPAcceptorBasic.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include namespace eprosima { @@ -63,5 +63,5 @@ void TCPAcceptorBasic::accept( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPAcceptorSecure.cpp b/src/cpp/rtps/transport/TCPAcceptorSecure.cpp index 159d34a41a4..8935092cdb5 100644 --- a/src/cpp/rtps/transport/TCPAcceptorSecure.cpp +++ b/src/cpp/rtps/transport/TCPAcceptorSecure.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include namespace eprosima { @@ -117,5 +117,5 @@ void TCPAcceptorSecure::accept( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPChannelResource.cpp b/src/cpp/rtps/transport/TCPChannelResource.cpp index efc7a6903b9..ea36dfa42ac 100644 --- a/src/cpp/rtps/transport/TCPChannelResource.cpp +++ b/src/cpp/rtps/transport/TCPChannelResource.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace eprosima { @@ -371,5 +371,5 @@ bool TCPChannelResource::check_socket_send_buffer( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp b/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp index 7d885164a40..2efc8873e82 100644 --- a/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp +++ b/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include using namespace asio; @@ -222,5 +222,5 @@ void TCPChannelResourceBasic::shutdown( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp b/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp index bf12d09874d..79e2391a732 100644 --- a/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp +++ b/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace eprosima { @@ -347,5 +347,5 @@ void TCPChannelResourceSecure::shutdown( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPSenderResource.hpp b/src/cpp/rtps/transport/TCPSenderResource.hpp index 6a6bcc46392..57e92e8ba89 100644 --- a/src/cpp/rtps/transport/TCPSenderResource.hpp +++ b/src/cpp/rtps/transport/TCPSenderResource.hpp @@ -106,7 +106,7 @@ class TCPSenderResource : public fastrtps::rtps::SenderResource }; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif // __TRANSPORT_UDPSENDERRESOURCE_HPP__ diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index d428bf4a53d..5ca68274cc6 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -37,6 +37,7 @@ #include #endif // if TLS_FOUND +#include #include #include #include @@ -49,9 +50,7 @@ #include #include #include -#include -#include -#include +#include #include #include @@ -97,7 +96,6 @@ TCPTransportDescriptor::TCPTransportDescriptor() , logical_port_increment(2) , tcp_negotiation_timeout(0) , enable_tcp_nodelay(false) - , wait_for_tcp_negotiation(false) , calculate_crc(true) , check_crc(true) , apply_security(false) @@ -116,7 +114,6 @@ TCPTransportDescriptor::TCPTransportDescriptor( , logical_port_increment(t.logical_port_increment) , tcp_negotiation_timeout(t.tcp_negotiation_timeout) , enable_tcp_nodelay(t.enable_tcp_nodelay) - , wait_for_tcp_negotiation(t.wait_for_tcp_negotiation) , calculate_crc(t.calculate_crc) , check_crc(t.check_crc) , apply_security(t.apply_security) @@ -139,7 +136,6 @@ TCPTransportDescriptor& TCPTransportDescriptor::operator =( logical_port_increment = t.logical_port_increment; tcp_negotiation_timeout = t.tcp_negotiation_timeout; enable_tcp_nodelay = t.enable_tcp_nodelay; - wait_for_tcp_negotiation = t.wait_for_tcp_negotiation; calculate_crc = t.calculate_crc; check_crc = t.check_crc; apply_security = t.apply_security; @@ -161,7 +157,6 @@ bool TCPTransportDescriptor::operator ==( this->logical_port_increment == t.logical_port_increment && this->tcp_negotiation_timeout == t.tcp_negotiation_timeout && this->enable_tcp_nodelay == t.enable_tcp_nodelay && - this->wait_for_tcp_negotiation == t.wait_for_tcp_negotiation && this->calculate_crc == t.calculate_crc && this->check_crc == t.check_crc && this->apply_security == t.apply_security && @@ -2070,5 +2065,5 @@ void TCPTransportInterface::send_channel_pending_logical_ports( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPTransportInterface.h b/src/cpp/rtps/transport/TCPTransportInterface.h index 7914bc0d192..7a1143d37c4 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.h +++ b/src/cpp/rtps/transport/TCPTransportInterface.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/cpp/rtps/transport/TCPv4Transport.cpp b/src/cpp/rtps/transport/TCPv4Transport.cpp index f96d5fdee05..ba05316402a 100644 --- a/src/cpp/rtps/transport/TCPv4Transport.cpp +++ b/src/cpp/rtps/transport/TCPv4Transport.cpp @@ -21,7 +21,8 @@ #include #include #include -#include +#include + #include #include @@ -540,5 +541,5 @@ bool TCPv4Transport::fillUnicastLocator( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPv4Transport.h b/src/cpp/rtps/transport/TCPv4Transport.h index 8dca1b8b085..2368a4527d2 100644 --- a/src/cpp/rtps/transport/TCPv4Transport.h +++ b/src/cpp/rtps/transport/TCPv4Transport.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -122,7 +122,7 @@ class TCPv4Transport : public TCPTransportInterface public: - RTPS_DllAPI TCPv4Transport( + FASTDDS_EXPORTED_API TCPv4Transport( const TCPv4TransportDescriptor&); virtual ~TCPv4Transport() override; diff --git a/src/cpp/rtps/transport/TCPv6Transport.cpp b/src/cpp/rtps/transport/TCPv6Transport.cpp index 1d43b731ca7..88a1b866a60 100644 --- a/src/cpp/rtps/transport/TCPv6Transport.cpp +++ b/src/cpp/rtps/transport/TCPv6Transport.cpp @@ -21,7 +21,8 @@ #include #include #include -#include +#include + #include #include @@ -35,7 +36,6 @@ namespace rtps { using IPFinder = fastrtps::rtps::IPFinder; using octet = fastrtps::rtps::octet; using IPLocator = fastrtps::rtps::IPLocator; -using octet = fastrtps::rtps::octet; using Log = fastdds::dds::Log; static bool get_ipv6s( @@ -510,5 +510,5 @@ bool TCPv6Transport::compare_ips( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/TCPv6Transport.h b/src/cpp/rtps/transport/TCPv6Transport.h index a33b4f5453d..27a878bd37a 100644 --- a/src/cpp/rtps/transport/TCPv6Transport.h +++ b/src/cpp/rtps/transport/TCPv6Transport.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -129,7 +129,7 @@ class TCPv6Transport : public TCPTransportInterface public: - RTPS_DllAPI TCPv6Transport( + FASTDDS_EXPORTED_API TCPv6Transport( const TCPv6TransportDescriptor&); virtual ~TCPv6Transport() override; diff --git a/src/cpp/rtps/transport/UDPChannelResource.cpp b/src/cpp/rtps/transport/UDPChannelResource.cpp index 03efd8737d1..b90efe284bf 100644 --- a/src/cpp/rtps/transport/UDPChannelResource.cpp +++ b/src/cpp/rtps/transport/UDPChannelResource.cpp @@ -17,8 +17,8 @@ #include #include -#include +#include #include #include @@ -137,5 +137,5 @@ void UDPChannelResource::release() } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/UDPSenderResource.hpp b/src/cpp/rtps/transport/UDPSenderResource.hpp index 70165141f80..5d6211d3324 100644 --- a/src/cpp/rtps/transport/UDPSenderResource.hpp +++ b/src/cpp/rtps/transport/UDPSenderResource.hpp @@ -129,7 +129,7 @@ class UDPSenderResource : public fastrtps::rtps::SenderResource }; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif // __TRANSPORT_UDPSENDERRESOURCE_HPP__ diff --git a/src/cpp/rtps/transport/UDPTransportInterface.cpp b/src/cpp/rtps/transport/UDPTransportInterface.cpp index bcf835b2d29..fa924ee0469 100644 --- a/src/cpp/rtps/transport/UDPTransportInterface.cpp +++ b/src/cpp/rtps/transport/UDPTransportInterface.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -783,5 +783,5 @@ NetmaskFilterInfo UDPTransportInterface::netmask_filter_info() const } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/UDPTransportInterface.h b/src/cpp/rtps/transport/UDPTransportInterface.h index 99770fcd99f..0f69318e74e 100644 --- a/src/cpp/rtps/transport/UDPTransportInterface.h +++ b/src/cpp/rtps/transport/UDPTransportInterface.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/cpp/rtps/transport/UDPv4Transport.cpp b/src/cpp/rtps/transport/UDPv4Transport.cpp index a941072fe34..5ade2ae6f43 100644 --- a/src/cpp/rtps/transport/UDPv4Transport.cpp +++ b/src/cpp/rtps/transport/UDPv4Transport.cpp @@ -20,11 +20,11 @@ #include #include -#include #include #include -#include +#include +#include #include #include @@ -720,5 +720,5 @@ void UDPv4Transport::update_network_interfaces() } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/UDPv4Transport.h b/src/cpp/rtps/transport/UDPv4Transport.h index 3355ec599d8..69b22b1b163 100644 --- a/src/cpp/rtps/transport/UDPv4Transport.h +++ b/src/cpp/rtps/transport/UDPv4Transport.h @@ -43,7 +43,7 @@ class UDPv4Transport : public UDPTransportInterface { public: - RTPS_DllAPI UDPv4Transport( + FASTDDS_EXPORTED_API UDPv4Transport( const UDPv4TransportDescriptor&); ~UDPv4Transport() override; diff --git a/src/cpp/rtps/transport/UDPv6Transport.cpp b/src/cpp/rtps/transport/UDPv6Transport.cpp index 81ac92b5bac..935944a4f13 100644 --- a/src/cpp/rtps/transport/UDPv6Transport.cpp +++ b/src/cpp/rtps/transport/UDPv6Transport.cpp @@ -19,10 +19,11 @@ #include #include -#include #include #include -#include +#include + +#include #include #include @@ -708,5 +709,5 @@ void UDPv6Transport::update_network_interfaces() } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/UDPv6Transport.h b/src/cpp/rtps/transport/UDPv6Transport.h index adf2b9fce0f..67fdf116845 100644 --- a/src/cpp/rtps/transport/UDPv6Transport.h +++ b/src/cpp/rtps/transport/UDPv6Transport.h @@ -43,7 +43,7 @@ class UDPv6Transport : public UDPTransportInterface { public: - RTPS_DllAPI UDPv6Transport( + FASTDDS_EXPORTED_API UDPv6Transport( const UDPv6TransportDescriptor&); ~UDPv6Transport() override; diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemChannelResource.hpp b/src/cpp/rtps/transport/shared_mem/SharedMemChannelResource.hpp index 3a110f6bb44..e51f3bd5e09 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemChannelResource.hpp +++ b/src/cpp/rtps/transport/shared_mem/SharedMemChannelResource.hpp @@ -16,13 +16,12 @@ #define _FASTDDS_SHAREDMEM_CHANNEL_RESOURCE_ #include -#include -#include +#include +#include #include #include #include - #include namespace eprosima { diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemLog.hpp b/src/cpp/rtps/transport/shared_mem/SharedMemLog.hpp index 22754952850..04d2ac249c6 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemLog.hpp +++ b/src/cpp/rtps/transport/shared_mem/SharedMemLog.hpp @@ -19,9 +19,9 @@ #include #include -#include #include +#include #include #include #include @@ -334,7 +334,7 @@ class PacketsLog struct Resources { - eprosima::fastrtps::DBQueue logs; + DBQueue logs; std::vector> consumers; eprosima::thread logging_thread; diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp index 065e3f61a9f..809c62e54a7 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp +++ b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp @@ -24,11 +24,11 @@ #include #include +#include #include #include -#include -#include +#include #include #include #include @@ -37,7 +37,7 @@ #include #include -#define SHM_MANAGER_DOMAIN ("fastrtps") +#define SHM_MANAGER_DOMAIN ("fastdds") using namespace std; diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h index 2b2989908c9..f1262aba62d 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h +++ b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h @@ -45,7 +45,7 @@ class SharedMemTransport : public TransportInterface { public: - RTPS_DllAPI SharedMemTransport( + FASTDDS_EXPORTED_API SharedMemTransport( const SharedMemTransportDescriptor&); const SharedMemTransportDescriptor* configuration() const; diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h index 0b60063fd52..1188d0f112b 100644 --- a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h +++ b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.h @@ -26,7 +26,7 @@ class test_SharedMemTransport : public SharedMemTransport { public: - RTPS_DllAPI test_SharedMemTransport( + FASTDDS_EXPORTED_API test_SharedMemTransport( const test_SharedMemTransportDescriptor&); bool send( diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h index 1e1cfe03b8d..f0576c700d4 100644 --- a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h +++ b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransportDescriptor.h @@ -28,10 +28,12 @@ namespace rtps { */ typedef struct test_SharedMemTransportDescriptor : public SharedMemTransportDescriptor { - virtual ~test_SharedMemTransportDescriptor() {} + virtual ~test_SharedMemTransportDescriptor() + { + } - RTPS_DllAPI test_SharedMemTransportDescriptor(); - RTPS_DllAPI test_SharedMemTransportDescriptor( + FASTDDS_EXPORTED_API test_SharedMemTransportDescriptor(); + FASTDDS_EXPORTED_API test_SharedMemTransportDescriptor( const test_SharedMemTransportDescriptor& t); virtual TransportInterface* create_transport() const override; diff --git a/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp b/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp index 2bf2e828a73..ee3e01a9b0b 100644 --- a/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp +++ b/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp @@ -24,8 +24,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -859,5 +858,5 @@ bool RTCPMessageManager::isCompatibleProtocol( } } /* namespace rtps */ -} /* namespace fastrtps */ +} /* namespace fastdds */ } /* namespace eprosima */ diff --git a/src/cpp/rtps/transport/test_UDPv4Transport.cpp b/src/cpp/rtps/transport/test_UDPv4Transport.cpp index 18560eadd6a..2b25aa5dd9b 100644 --- a/src/cpp/rtps/transport/test_UDPv4Transport.cpp +++ b/src/cpp/rtps/transport/test_UDPv4Transport.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include using namespace std; @@ -514,5 +514,5 @@ bool test_UDPv4Transport::should_be_dropped( } } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima diff --git a/src/cpp/rtps/transport/test_UDPv4Transport.h b/src/cpp/rtps/transport/test_UDPv4Transport.h index 9ef1df6398d..8bf175f1816 100644 --- a/src/cpp/rtps/transport/test_UDPv4Transport.h +++ b/src/cpp/rtps/transport/test_UDPv4Transport.h @@ -53,14 +53,14 @@ class test_UDPv4Transport : public UDPv4Transport virtual LocatorList NormalizeLocator( const Locator& locator) override; - RTPS_DllAPI static std::atomic test_UDPv4Transport_ShutdownAllNetwork; + FASTDDS_EXPORTED_API static std::atomic test_UDPv4Transport_ShutdownAllNetwork; // Handle to a persistent log of dropped packets. Defaults to length 0 (no logging) to prevent wasted resources. - RTPS_DllAPI static std::vector> test_UDPv4Transport_DropLog; - RTPS_DllAPI static std::atomic test_UDPv4Transport_DropLogLength; - RTPS_DllAPI static std::atomic always_drop_participant_builtin_topic_data; - RTPS_DllAPI static std::atomic simulate_no_interfaces; + FASTDDS_EXPORTED_API static std::vector> test_UDPv4Transport_DropLog; + FASTDDS_EXPORTED_API static std::atomic test_UDPv4Transport_DropLogLength; + FASTDDS_EXPORTED_API static std::atomic always_drop_participant_builtin_topic_data; + FASTDDS_EXPORTED_API static std::atomic simulate_no_interfaces; - RTPS_DllAPI static test_UDPv4TransportDescriptor::DestinationLocatorFilter locator_filter; + FASTDDS_EXPORTED_API static test_UDPv4TransportDescriptor::DestinationLocatorFilter locator_filter; protected: diff --git a/src/cpp/rtps/writer/LivelinessData.hpp b/src/cpp/rtps/writer/LivelinessData.hpp new file mode 100644 index 00000000000..21c35b08764 --- /dev/null +++ b/src/cpp/rtps/writer/LivelinessData.hpp @@ -0,0 +1,122 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file LivelinessData.h + */ +#ifndef _FASTDDS_RTPS_LIVELINESS_DATA_H_ +#define _FASTDDS_RTPS_LIVELINESS_DATA_H_ + +#include + +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +/** + * @brief A struct keeping relevant liveliness information of a writer + * @ingroup WRITER_MODULE + */ +struct LivelinessData +{ + enum WriterStatus + { + //! Writer is matched but liveliness has not been asserted yet + NOT_ASSERTED = 0, + //! Writer is alive + ALIVE = 1, + //! Writer is not alive + NOT_ALIVE = 2 + }; + + /** + * @brief Constructor + * @param guid_in GUID of the writer + * @param kind_in Liveliness kind + * @param lease_duration_in Liveliness lease duration + */ + LivelinessData( + GUID_t guid_in, + fastdds::dds::LivelinessQosPolicyKind kind_in, + Duration_t lease_duration_in) + : guid(guid_in) + , kind(kind_in) + , lease_duration(lease_duration_in) + , status(WriterStatus::NOT_ASSERTED) + { + } + + LivelinessData() + : guid() + , kind(fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) + , lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) + , status(WriterStatus::NOT_ASSERTED) + { + } + + ~LivelinessData() + { + } + + /** + * @brief Equality operator + * @param other Liveliness data to compare to + * @return True if equal + */ + bool operator ==( + const LivelinessData& other) const + { + return ((guid == other.guid) && + (kind == other.kind) && + (lease_duration == other.lease_duration)); + } + + /** + * @brief Inequality operator + * @param other Liveliness data to compare to + * @return True if different + */ + bool operator !=( + const LivelinessData& other) const + { + return (!operator ==(other)); + } + + //! GUID of the writer + GUID_t guid; + + //! Writer liveliness kind + fastdds::dds::LivelinessQosPolicyKind kind; + + //! The lease duration + Duration_t lease_duration; + + //! The number of times the writer is being counted + unsigned int count = 1; + + //! The writer status + WriterStatus status; + + //! The time when the writer will lose liveliness + std::chrono::steady_clock::time_point time; +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_RTPS_LIVELINESS_DATA_H_ */ diff --git a/src/cpp/rtps/writer/LivelinessManager.cpp b/src/cpp/rtps/writer/LivelinessManager.cpp index 42ed418dfec..357826bafb9 100644 --- a/src/cpp/rtps/writer/LivelinessManager.cpp +++ b/src/cpp/rtps/writer/LivelinessManager.cpp @@ -1,8 +1,23 @@ -#include -#include +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include #include +#include + using namespace std::chrono; namespace eprosima { @@ -40,10 +55,10 @@ LivelinessManager::~LivelinessManager() bool LivelinessManager::add_writer( GUID_t guid, - LivelinessQosPolicyKind kind, + fastdds::dds::LivelinessQosPolicyKind kind, Duration_t lease_duration) { - if (!manage_automatic_ && kind == LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) + if (!manage_automatic_ && kind == fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) { EPROSIMA_LOG_WARNING(RTPS_WRITER, "Liveliness manager not managing automatic writers, writer not added"); return false; @@ -91,7 +106,7 @@ bool LivelinessManager::add_writer( bool LivelinessManager::remove_writer( GUID_t guid, - LivelinessQosPolicyKind kind, + fastdds::dds::LivelinessQosPolicyKind kind, Duration_t lease_duration) { bool removed = false; @@ -159,7 +174,7 @@ bool LivelinessManager::remove_writer( bool LivelinessManager::assert_liveliness( GUID_t guid, - LivelinessQosPolicyKind kind, + fastdds::dds::LivelinessQosPolicyKind kind, Duration_t lease_duration) { bool found = false; @@ -182,8 +197,8 @@ bool LivelinessManager::assert_liveliness( found = true; // Execute the callbacks - if (writer.kind == LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS || - writer.kind == LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) + if (writer.kind == fastdds::dds::LivelinessQosPolicyKind::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS || + writer.kind == fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) { for (LivelinessData& w: writers_) { @@ -194,7 +209,7 @@ bool LivelinessManager::assert_liveliness( } } } - else if (writer.kind == LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS) + else if (writer.kind == fastdds::dds::LivelinessQosPolicyKind::MANUAL_BY_TOPIC_LIVELINESS_QOS) { assert_writer_liveliness(writer); } @@ -233,11 +248,11 @@ bool LivelinessManager::assert_liveliness( } bool LivelinessManager::assert_liveliness( - LivelinessQosPolicyKind kind, + fastdds::dds::LivelinessQosPolicyKind kind, GuidPrefix_t guid_prefix) { - if (!manage_automatic_ && kind == LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) + if (!manage_automatic_ && kind == fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS) { EPROSIMA_LOG_WARNING(RTPS_WRITER, "Liveliness manager not managing automatic writers, writer not added"); return false; @@ -360,7 +375,7 @@ bool LivelinessManager::timer_expired() } bool LivelinessManager::is_any_alive( - LivelinessQosPolicyKind kind) + fastdds::dds::LivelinessQosPolicyKind kind) { // Keep this lock order to prevent ABBA deadlocks shared_lock _(col_mutex_); diff --git a/src/cpp/rtps/writer/LivelinessManager.hpp b/src/cpp/rtps/writer/LivelinessManager.hpp new file mode 100644 index 00000000000..d2f811afc33 --- /dev/null +++ b/src/cpp/rtps/writer/LivelinessManager.hpp @@ -0,0 +1,181 @@ +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file LivelinessManager.h + */ +#ifndef _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ +#define _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ + +#include + +#include +#include + +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +using LivelinessCallback = std::function; + +/** + * @brief A class managing the liveliness of a set of writers. Writers are represented by their LivelinessData + * @details Uses a shared timed event and informs outside classes on liveliness changes + * @ingroup WRITER_MODULE + */ +class LivelinessManager +{ +public: + + /** + * @brief Constructor + * @param callback A callback that will be invoked when a writer changes its liveliness status + * @param service ResourceEvent object that will operate with the events. + * @param manage_automatic True to manage writers with automatic liveliness, false otherwise + */ + LivelinessManager( + const LivelinessCallback& callback, + ResourceEvent& service, + bool manage_automatic = true); + + /** + * @brief Constructor + */ + ~LivelinessManager(); + + /** + * @brief LivelinessManager + * @param other + */ + LivelinessManager( + const LivelinessManager& other) = delete; + + /** + * @brief Adds a writer to the set + * @param guid GUID of the writer + * @param kind Liveliness kind + * @param lease_duration Liveliness lease duration + * @return True if the writer was successfully added + */ + bool add_writer( + GUID_t guid, + fastdds::dds::LivelinessQosPolicyKind kind, + Duration_t lease_duration); + + /** + * @brief Removes a writer + * @param guid GUID of the writer + * @param kind Liveliness kind + * @param lease_duration Liveliness lease duration + * @return True if the writer was successfully removed + */ + bool remove_writer( + GUID_t guid, + fastdds::dds::LivelinessQosPolicyKind kind, + Duration_t lease_duration); + + /** + * @brief Asserts liveliness of a writer in the set + * @param guid The writer to assert liveliness of + * @param kind The kind of the writer + * @param lease_duration The lease duration + * @return True if liveliness was successfully asserted + */ + bool assert_liveliness( + GUID_t guid, + fastdds::dds::LivelinessQosPolicyKind kind, + Duration_t lease_duration); + + /** + * @brief Asserts liveliness of writers with given liveliness kind and GuidPrefix + * @param kind Liveliness kind + * @param guid_prefix The guid prefix of the writers to assert liveliness of + * @return True if liveliness was successfully asserted + */ + bool assert_liveliness( + fastdds::dds::LivelinessQosPolicyKind kind, + GuidPrefix_t guid_prefix); + + /** + * @brief A method to check any writer of the given kind is alive + * @param kind The liveliness kind to check for + * @return True if at least one writer of this kind is alive. False otherwise + */ + bool is_any_alive( + fastdds::dds::LivelinessQosPolicyKind kind); + + /** + * @brief A method to return liveliness data + * @details Should only be used for testing purposes + * @return Vector of liveliness data + */ + const ResourceLimitedVector& get_liveliness_data() const; + +private: + + /** + * @brief A method responsible for invoking the callback when liveliness is asserted + * @param writer The liveliness data of the writer asserting liveliness + * @pre The collection shared_mutex must be taken for reading + */ + void assert_writer_liveliness( + LivelinessData& writer); + + /** + * @brief A method to calculate the time when the next writer is going to lose liveliness + * @details This method is public for testing purposes but it should not be used from outside this class + * @pre std::mutex_ should not be taken on calling this method to avoid deadlock. + * @return True if at least one writer is alive + */ + bool calculate_next(); + + //! @brief A method called if the timer expires + //! @return True if the timer should be restarted + bool timer_expired(); + + //! A callback to inform outside classes that a writer changed its liveliness status + const LivelinessCallback callback_; + + //! A boolean indicating whether we are managing writers with automatic liveliness + const bool manage_automatic_; + + //! A vector of liveliness data + ResourceLimitedVector writers_; + + //! A mutex to protect the liveliness data included LivelinessData objects + std::mutex mutex_; + + //! A mutex devoted to protect the writers_ collection + eprosima::shared_mutex col_mutex_; + + //! The timer owner, i.e. the writer which is next due to lose its liveliness + LivelinessData* timer_owner_; + + //! A timed callback expiring when a writer (the timer owner) loses its liveliness + TimedEvent timer_; +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_RTPS_LIVELINESS_MANAGER_H_ */ diff --git a/src/cpp/rtps/writer/PersistentWriter.cpp b/src/cpp/rtps/writer/PersistentWriter.cpp index 2a69d21704e..987159e3d51 100644 --- a/src/cpp/rtps/writer/PersistentWriter.cpp +++ b/src/cpp/rtps/writer/PersistentWriter.cpp @@ -18,10 +18,11 @@ */ #include + #include -#include -#include + #include +#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/writer/ReaderLocator.cpp b/src/cpp/rtps/writer/ReaderLocator.cpp index cd847f185b7..b3321293bf9 100644 --- a/src/cpp/rtps/writer/ReaderLocator.cpp +++ b/src/cpp/rtps/writer/ReaderLocator.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/src/cpp/rtps/writer/ReaderProxy.cpp b/src/cpp/rtps/writer/ReaderProxy.cpp index e215280c206..005ad3e7716 100644 --- a/src/cpp/rtps/writer/ReaderProxy.cpp +++ b/src/cpp/rtps/writer/ReaderProxy.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ ReaderProxy::ReaderProxy( writer_->perform_nack_supression(guid()); return false; }, - TimeConv::Time_t2MilliSecondsDouble(times.nackSupressionDuration)); + fastdds::rtps::TimeConv::Time_t2MilliSecondsDouble(times.nackSupressionDuration)); initial_heartbeat_event_ = new TimedEvent(participant->getEventResource(), [&]() -> bool diff --git a/src/cpp/rtps/writer/StatefulPersistentWriter.cpp b/src/cpp/rtps/writer/StatefulPersistentWriter.cpp index 459dd28a468..e2b17ca9f98 100644 --- a/src/cpp/rtps/writer/StatefulPersistentWriter.cpp +++ b/src/cpp/rtps/writer/StatefulPersistentWriter.cpp @@ -18,9 +18,10 @@ */ #include + #include + #include -#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/writer/StatefulWriter.cpp b/src/cpp/rtps/writer/StatefulWriter.cpp index 88b8f9006c9..ec2b10342dc 100644 --- a/src/cpp/rtps/writer/StatefulWriter.cpp +++ b/src/cpp/rtps/writer/StatefulWriter.cpp @@ -22,8 +22,6 @@ #include #include -#include -#include #include #include #include @@ -31,13 +29,16 @@ #include #include #include +#include #include #include #include #include #include -#include +#include +#include +#include #include #include #include @@ -48,6 +49,10 @@ #include #include +#ifdef FASTDDS_STATISTICS +#include +#endif // ifdef FASTDDS_STATISTICS + #include "../builtin/discovery/database/DiscoveryDataBase.hpp" #include "../flowcontrol/FlowController.hpp" @@ -56,7 +61,6 @@ namespace eprosima { namespace fastrtps { namespace rtps { - /** * Loops over all the readers in the vector, applying the given routine. * The loop continues until the result of the routine is true for any reader @@ -281,7 +285,7 @@ void StatefulWriter::init( { return send_periodic_heartbeat(); }, - TimeConv::Time_t2MilliSecondsDouble(m_times.heartbeatPeriod)); + fastdds::rtps::TimeConv::Time_t2MilliSecondsDouble(m_times.heartbeatPeriod)); nack_response_event_ = new TimedEvent( pimpl->getEventResource(), @@ -290,7 +294,7 @@ void StatefulWriter::init( perform_nack_response(); return false; }, - TimeConv::Time_t2MilliSecondsDouble(m_times.nackResponseDelay)); + fastdds::rtps::TimeConv::Time_t2MilliSecondsDouble(m_times.nackResponseDelay)); if (disable_positive_acks_) { @@ -1458,7 +1462,7 @@ bool StatefulWriter::wait_for_all_acked( if (!all_acked_) { - std::chrono::microseconds max_w(TimeConv::Duration_t2MicroSecondsInt64(max_wait)); + std::chrono::microseconds max_w(fastdds::rtps::TimeConv::Duration_t2MicroSecondsInt64(max_wait)); all_acked_cond_.wait_for(all_acked_lock, max_w, [&]() { return all_acked_; @@ -2220,7 +2224,7 @@ bool StatefulWriter::get_connections( for_matched_readers(matched_local_readers_, [&connection, &connection_list](ReaderProxy*& reader) { connection.guid(fastdds::statistics::to_statistics_type(reader->guid())); - connection.mode(fastdds::statistics::INTRAPROCESS); + connection.mode(fastdds::statistics::ConnectionMode::INTRAPROCESS); connection_list.push_back(connection); return false; @@ -2234,7 +2238,7 @@ bool StatefulWriter::get_connections( for_matched_readers(matched_datasharing_readers_, [&connection, &connection_list](ReaderProxy*& reader) { connection.guid(fastdds::statistics::to_statistics_type(reader->guid())); - connection.mode(fastdds::statistics::DATA_SHARING); + connection.mode(fastdds::statistics::ConnectionMode::DATA_SHARING); connection_list.push_back(connection); return false; @@ -2268,7 +2272,7 @@ bool StatefulWriter::get_connections( }); connection.guid(fastdds::statistics::to_statistics_type(reader->guid())); - connection.mode(fastdds::statistics::TRANSPORT); + connection.mode(fastdds::statistics::ConnectionMode::TRANSPORT); connection.announced_locators(statistics_locators); connection.used_locators(statistics_locators); connection_list.push_back(connection); diff --git a/src/cpp/rtps/writer/StatelessPersistentWriter.cpp b/src/cpp/rtps/writer/StatelessPersistentWriter.cpp index 872e9a2da12..698084697ca 100644 --- a/src/cpp/rtps/writer/StatelessPersistentWriter.cpp +++ b/src/cpp/rtps/writer/StatelessPersistentWriter.cpp @@ -18,9 +18,10 @@ */ #include + #include + #include -#include namespace eprosima { namespace fastrtps { diff --git a/src/cpp/rtps/writer/StatelessWriter.cpp b/src/cpp/rtps/writer/StatelessWriter.cpp index 8c7a770b709..84c99aeb0ab 100644 --- a/src/cpp/rtps/writer/StatelessWriter.cpp +++ b/src/cpp/rtps/writer/StatelessWriter.cpp @@ -18,12 +18,6 @@ */ #include -#include -#include -#include -#include -#include -#include #include #include @@ -31,16 +25,23 @@ #include #include -#include +#include +#include +#include + +#include "../flowcontrol/FlowController.hpp" +#include +#include +#include #include #include -#include +#include #include +#include #include +#include #include -#include "../flowcontrol/FlowController.hpp" - namespace eprosima { namespace fastrtps { namespace rtps { @@ -930,7 +931,7 @@ bool StatelessWriter::get_connections( for_matched_readers(matched_local_readers_, [&connection, &connection_list](ReaderLocator& reader) { connection.guid(fastdds::statistics::to_statistics_type(reader.local_reader()->getGuid())); - connection.mode(fastdds::statistics::INTRAPROCESS); + connection.mode(fastdds::statistics::ConnectionMode::INTRAPROCESS); connection_list.push_back(connection); return false; @@ -944,7 +945,7 @@ bool StatelessWriter::get_connections( for_matched_readers(matched_datasharing_readers_, [&connection, &connection_list](ReaderLocator& reader) { connection.guid(fastdds::statistics::to_statistics_type(reader.remote_guid())); - connection.mode(fastdds::statistics::DATA_SHARING); + connection.mode(fastdds::statistics::ConnectionMode::DATA_SHARING); connection_list.push_back(connection); return false; @@ -978,7 +979,7 @@ bool StatelessWriter::get_connections( }); connection.guid(fastdds::statistics::to_statistics_type(reader.remote_guid())); - connection.mode(fastdds::statistics::TRANSPORT); + connection.mode(fastdds::statistics::ConnectionMode::TRANSPORT); connection.announced_locators(statistics_locators); connection.used_locators(statistics_locators); connection_list.push_back(connection); diff --git a/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp b/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp deleted file mode 100644 index 14c0de1c93f..00000000000 --- a/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp +++ /dev/null @@ -1,1508 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::xmlparser; - -XMLP_ret XMLParser::parseXMLDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - */ - XMLP_ret ret = XMLP_ret::XML_OK; - tinyxml2::XMLElement* p_aux0 = nullptr; - for (p_aux0 = p_root->FirstChildElement(); p_aux0 != nullptr; p_aux0 = p_aux0->NextSiblingElement()) - { - const std::string type = p_aux0->Value(); - if (type.compare(STRUCT) == 0) - { - ret = parseXMLStructDynamicType(p_aux0); - } - else if (type.compare(UNION) == 0) - { - ret = parseXMLUnionDynamicType(p_aux0); - } - else if (type.compare(ENUM) == 0) - { - ret = parseXMLEnumDynamicType(p_aux0); - } - else if (type.compare(TYPEDEF) == 0) - { - ret = parseXMLAliasDynamicType(p_aux0); - } - else if (type.compare(BITSET) == 0) - { - ret = parseXMLBitsetDynamicType(p_aux0); - } - else if (type.compare(BITMASK) == 0) - { - ret = parseXMLBitmaskDynamicType(p_aux0); - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing type: Type " << type << " not recognized."); - ret = XMLP_ret::XML_ERROR; - } - - if (ret != XMLP_ret::XML_OK) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing type " << type << "."); - break; - } - } - return ret; -} - -XMLP_ret XMLParser::parseXMLTypes( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - */ - - XMLP_ret ret = XMLP_ret::XML_OK; - tinyxml2::XMLElement* p_aux0 = nullptr, * p_aux1 = nullptr; - p_aux0 = p_root->FirstChildElement(TYPES); - if (p_aux0 != nullptr) - { - const char* name = nullptr; - for (p_aux1 = p_aux0->FirstChildElement(); p_aux1 != nullptr; p_aux1 = p_aux1->NextSiblingElement()) - { - name = p_aux1->Name(); - if (strcmp(name, TYPE) == 0) - { - if (XMLP_ret::XML_OK != parseXMLDynamicType(p_aux1)) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'types'. Name: " << name); - return XMLP_ret::XML_ERROR; - } - } - } - else // Directly root is TYPES? - { - const char* name = nullptr; - for (p_aux0 = p_root->FirstChildElement(); p_aux0 != nullptr; p_aux0 = p_aux0->NextSiblingElement()) - { - name = p_aux0->Name(); - if (strcmp(name, TYPE) == 0) - { - if (XMLP_ret::XML_OK != parseXMLDynamicType(p_aux0)) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'types'. Name: " << name); - return XMLP_ret::XML_ERROR; - } - } - } - return ret; -} - -XMLP_ret XMLParser::parseXMLBitvalueDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - uint16_t& field_position) -{ - /* - - - - - */ - if (p_root == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitmask: Node not found."); - return XMLP_ret::XML_ERROR; - } - - const char* memberName = p_root->Attribute(NAME); - const char* position = p_root->Attribute(POSITION); - - if (position != nullptr) - { - try - { - field_position = static_cast(std::stoul(position)); - } - catch (const std::exception&) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bit_value position: Invalid (must be an unsigned short)."); - return XMLP_ret::XML_ERROR; - } - } - - if (memberName == nullptr && p_dynamictype != nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bit_value name: Not found."); - return XMLP_ret::XML_ERROR; - } - - p_dynamictype->add_empty_member(field_position, memberName); - //p_dynamictype->apply_annotation_to_member( - // p_dynamictype->get_member_id_by_name(memberName), ANNOTATION_POSITION_ID, "value", position); - ++field_position; - - return XMLP_ret::XML_OK; -} - -static p_dynamictypebuilder_t getDiscriminatorTypeBuilder( - const std::string& disc, - uint32_t bound = 0); - -static p_dynamictypebuilder_t getDiscriminatorTypeBuilder( - const std::string& disc, - uint32_t bound) -{ - /* - mKind == TK_BOOLEAN || mKind == TK_BYTE || mKind == TK_INT16 || mKind == TK_INT32 || - mKind == TK_INT64 || mKind == TK_UINT16 || mKind == TK_UINT32 || mKind == TK_UINT64 || - mKind == TK_FLOAT32 || mKind == TK_FLOAT64 || mKind == TK_FLOAT128 || mKind == TK_CHAR8 || - mKind == TK_CHAR16 || mKind == TK_STRING8 || mKind == TK_STRING16 || mKind == TK_ENUM || mKind == TK_BITMASK - */ - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); - if (disc.compare(BOOLEAN) == 0) - { - return factory->create_bool_builder(); - } - else if (disc.compare(TBYTE) == 0 - || disc.compare(OCTET) == 0 - || disc.compare(INT8) == 0 - || disc.compare(UINT8) == 0) - { - return factory->create_byte_builder(); - } - else if (disc.compare(SHORT) == 0) - { - return factory->create_int16_builder(); - } - else if (disc.compare(LONG) == 0) - { - return factory->create_int32_builder(); - } - else if (disc.compare(LONGLONG) == 0) - { - return factory->create_int64_builder(); - } - else if (disc.compare(USHORT) == 0) - { - return factory->create_uint16_builder(); - } - else if (disc.compare(ULONG) == 0) - { - return factory->create_uint32_builder(); - } - else if (disc.compare(ULONGLONG) == 0) - { - return factory->create_uint64_builder(); - } - else if (disc.compare(FLOAT) == 0) - { - return factory->create_float32_builder(); - } - else if (disc.compare(DOUBLE) == 0) - { - return factory->create_float64_builder(); - } - else if (disc.compare(LONGDOUBLE) == 0) - { - return factory->create_float128_builder(); - } - else if (disc.compare(CHAR) == 0) - { - return factory->create_char8_builder(); - } - else if (disc.compare(WCHAR) == 0) - { - return factory->create_char16_builder(); - } - else if (disc.compare(STRING) == 0) - { - return factory->create_string_builder(bound); - } - else if (disc.compare(WSTRING) == 0) - { - return factory->create_wstring_builder(bound); - } - - return XMLProfileManager::getDynamicTypeByName(disc); -} - -XMLP_ret XMLParser::parseXMLAliasDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - - */ - XMLP_ret ret = XMLP_ret::XML_OK; - - const char* type = p_root->Attribute(TYPE); - if (type != nullptr) - { - if (strcmp(type, NON_BASIC_TYPE) == 0) - { - const char* typeNonBasicName = p_root->Attribute(NON_BASIC_TYPE_NAME); - if (typeNonBasicName != nullptr) - { - type = typeNonBasicName; - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); - ret = XMLP_ret::XML_ERROR; - } - } - - p_dynamictypebuilder_t valueBuilder; - if ((p_root->Attribute(ARRAY_DIMENSIONS) != nullptr) || - (p_root->Attribute(SEQ_MAXLENGTH) != nullptr) || - (p_root->Attribute(MAP_MAXLENGTH) != nullptr)) - { - valueBuilder = parseXMLMemberDynamicType(p_root, nullptr, types::MEMBER_ID_INVALID); - } - else - { - uint32_t bound = 0; - const char* boundStr = p_root->Attribute(STR_MAXLENGTH); - if (boundStr != nullptr) - { - bound = static_cast(std::atoi(boundStr)); - } - valueBuilder = getDiscriminatorTypeBuilder(type, bound); - } - - if (valueBuilder != nullptr) - { - const char* name = p_root->Attribute(NAME); - if (name != nullptr && name[0] != '\0') - { - if (nullptr == XMLProfileManager::getDynamicTypeByName(name)) - { - p_dynamictypebuilder_t typeBuilder = - types::DynamicTypeBuilderFactory::get_instance()->create_alias_builder(valueBuilder, name); - if (false == XMLProfileManager::insertDynamicTypeByName(name, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Type '" << name << "' already defined."); - ret = XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: No name attribute given."); - ret = XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Value not recognized."); - ret = XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Type not defined."); - ret = XMLP_ret::XML_ERROR; - } - return ret; -} - -XMLP_ret XMLParser::parseXMLBitsetDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - - - - - - */ - XMLP_ret ret = XMLP_ret::XML_OK; - p_dynamictypebuilder_t typeBuilder; - uint32_t mId = 0; - - const char* name = p_root->Attribute(NAME); - if (nullptr == name || name[0] == '\0') - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitsetDcl' type. No name attribute given."); - return XMLP_ret::XML_ERROR; - } - if (nullptr != XMLProfileManager::getDynamicTypeByName(name)) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitsetDcl' type: Type '" << name << "' already defined."); - return XMLP_ret::XML_ERROR; - } - - const char* baseType = p_root->Attribute(BASE_TYPE); - if (baseType != nullptr) - { - p_dynamictypebuilder_t parentType = XMLProfileManager::getDynamicTypeByName(baseType); - if (parentType != nullptr && parentType->get_kind() == types::TK_BITSET) - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(parentType); - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid baseType found into 'bitsetDcl'. Name: " << baseType); - return XMLP_ret::XML_ERROR; - } - } - else - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); - } - typeBuilder->set_name(name); - - const char* element_name = nullptr; - uint16_t position = 0; - for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); - p_element != nullptr; p_element = p_element->NextSiblingElement()) - { - element_name = p_element->Name(); - if (strcmp(element_name, BITFIELD) == 0) - { - p_dynamictypebuilder_t mType = parseXMLBitfieldDynamicType(p_element, typeBuilder, mId++, position); - if (mType == nullptr) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'bitsetDcl'. Name: " << element_name); - return XMLP_ret::XML_ERROR; - } - } - - if (false == XMLProfileManager::insertDynamicTypeByName(name, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - return ret; -} - -p_dynamictypebuilder_t XMLParser::parseXMLBitfieldDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - uint16_t& position) -{ - /* - - - - - - */ - if (p_root == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield: Node not found."); - return nullptr; - } - - const char* memberType = p_root->Attribute(TYPE); - const char* memberName = p_root->Attribute(NAME); - const char* bit_bound = p_root->Attribute(BIT_BOUND); - - if (bit_bound == nullptr && p_dynamictype != nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield bit_bound: Not found."); - return nullptr; - } - - if (memberName == nullptr) - { - memberName = ""; - } - - types::DynamicTypeBuilder* memberBuilder = nullptr; - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); - - if (memberType == nullptr) - { - try - { - uint16_t size = static_cast(std::stoul(bit_bound)); - if (size == 1) - { - memberType = BOOLEAN; - } - else if (size <= 8) - { - memberType = CHAR; - } - else if (size <= 16) - { - memberType = USHORT; - } - else if (size <= 32) - { - memberType = ULONG; - } - else if (size <= 64) - { - memberType = ULONGLONG; - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, size too big: " << bit_bound); - return nullptr; - } - } - catch (...) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, invalid bit_bound (must be an unsigned short): " - << bit_bound); - return nullptr; - } - } - - if (strncmp(memberType, BOOLEAN, 8) == 0) - { - memberBuilder = factory->create_bool_builder(); - } - else if (strncmp(memberType, CHAR, 5) == 0) - { - memberBuilder = factory->create_char8_builder(); - } - else if (strncmp(memberType, WCHAR, 6) == 0) - { - memberBuilder = factory->create_char16_builder(); - } - else if (strncmp(memberType, TBYTE, 6) == 0 - || strncmp(memberType, OCTET, 6) == 0 - || strncmp(memberType, UINT8, 6) == 0 - || strncmp(memberType, INT8, 5) == 0) - { - memberBuilder = factory->create_byte_builder(); - } - else if (strncmp(memberType, SHORT, 6) == 0) - { - memberBuilder = factory->create_int16_builder(); - } - else if (strncmp(memberType, LONG, 5) == 0) - { - memberBuilder = factory->create_int32_builder(); - } - else if (strncmp(memberType, ULONG, 13) == 0) - { - memberBuilder = factory->create_uint32_builder(); - } - else if (strncmp(memberType, USHORT, 14) == 0) - { - memberBuilder = factory->create_uint16_builder(); - } - else if (strncmp(memberType, LONGLONG, 9) == 0) - { - memberBuilder = factory->create_int64_builder(); - } - else if (strncmp(memberType, ULONGLONG, 17) == 0) - { - memberBuilder = factory->create_uint64_builder(); - } - else // Unsupported type? - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Failed creating bitfield " << memberName << ": Type " << memberType << " unsupported."); - } - - - if (memberBuilder == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating " << memberType << ": " << memberName); - } - - if (p_dynamictype != nullptr) - { - p_dynamictype->add_member(mId, memberName, memberBuilder); - if (!std::string(memberName).empty()) - { - p_dynamictype->apply_annotation_to_member(mId, types::ANNOTATION_BIT_BOUND_ID, "value", bit_bound); - //position += static_cast(mId); - p_dynamictype->apply_annotation_to_member(mId, types::ANNOTATION_POSITION_ID, "value", - std::to_string(position)); - } - position += static_cast(atoi(bit_bound)); - } - - return memberBuilder; -} - -XMLP_ret XMLParser::parseXMLBitmaskDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - - - */ - XMLP_ret ret = XMLP_ret::XML_OK; - uint16_t bit_bound = 32; - const char* anno_bit_bound = p_root->Attribute(BIT_BOUND); - if (anno_bit_bound != nullptr) - { - auto input_bit_bound = std::atoi(anno_bit_bound); - if (input_bit_bound < 1 || input_bit_bound > 64) - { - return XMLP_ret::XML_ERROR; - } - bit_bound = static_cast(input_bit_bound); - } - - const char* name = p_root->Attribute(NAME); - if (nullptr == name || name[0] == '\0') - { - return XMLP_ret::XML_ERROR; - } - if (nullptr != XMLProfileManager::getDynamicTypeByName(name)) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitmaskDcl' type: Type '" << name << "' already defined."); - return XMLP_ret::XML_ERROR; - } - - p_dynamictypebuilder_t typeBuilder = - types::DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(bit_bound); - typeBuilder->set_name(name); - uint16_t position = 0; - - const char* element_name = nullptr; - for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); - p_element != nullptr; p_element = p_element->NextSiblingElement()) - { - element_name = p_element->Name(); - if (strcmp(element_name, BIT_VALUE) == 0) - { - if (parseXMLBitvalueDynamicType(p_element, typeBuilder, position) != XMLP_ret::XML_OK) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'bitmaskDcl'. Name: " << element_name); - return XMLP_ret::XML_ERROR; - } - } - - if (false == XMLProfileManager::insertDynamicTypeByName(name, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - return ret; -} - -XMLP_ret XMLParser::parseXMLEnumDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - //TODO: Enum bitbound to set the internal field - */ - XMLP_ret ret = XMLP_ret::XML_OK; - const char* enumName = p_root->Attribute(NAME); - - if (enumName == nullptr || enumName[0] == '\0') - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'enum' type. No name attribute given."); - return XMLP_ret::XML_ERROR; - } - if (nullptr != XMLProfileManager::getDynamicTypeByName(enumName)) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'enum' type: Type '" << enumName << "' already defined."); - return XMLP_ret::XML_ERROR; - } - - p_dynamictypebuilder_t typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); - uint32_t currValue = 0; - for (tinyxml2::XMLElement* literal = p_root->FirstChildElement(ENUMERATOR); - literal != nullptr; literal = literal->NextSiblingElement(ENUMERATOR)) - { - const char* name = literal->Attribute(NAME); - if (name == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing enum type: Literals must have name."); - return XMLP_ret::XML_ERROR; - } - - const char* value = literal->Attribute(VALUE); - if (value != nullptr) - { - currValue = static_cast(std::atoi(value)); - } - typeBuilder->add_empty_member(currValue++, name); - } - - if (false == XMLProfileManager::insertDynamicTypeByName(enumName, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - return ret; -} - -XMLP_ret XMLParser::parseXMLStructDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - */ - XMLP_ret ret = XMLP_ret::XML_OK; - const char* name = p_root->Attribute(NAME); - if (nullptr == name || name[0] == '\0') - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Missing required attribute 'name' in 'structDcl'."); - return XMLP_ret::XML_ERROR; - } - if (nullptr != XMLProfileManager::getDynamicTypeByName(name)) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'structDcl' type: Type '" << name << "' already defined."); - return XMLP_ret::XML_ERROR; - } - - p_dynamictypebuilder_t typeBuilder; // = types::DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - //typeBuilder->set_name(name); - uint32_t mId = 0; - - const char* baseType = p_root->Attribute(BASE_TYPE); - if (baseType != nullptr) - { - p_dynamictypebuilder_t parentType = XMLProfileManager::getDynamicTypeByName(baseType); - if (parentType != nullptr && parentType->get_kind() == types::TK_STRUCTURE) - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(parentType); - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid baseType found into 'structDcl'. Name: " << baseType); - return XMLP_ret::XML_ERROR; - } - } - else - { - typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - } - typeBuilder->set_name(name); - - const char* element_name = nullptr; - for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); - p_element != nullptr; p_element = p_element->NextSiblingElement()) - { - element_name = p_element->Name(); - if (strcmp(element_name, MEMBER) == 0) - { - p_dynamictypebuilder_t mType = parseXMLMemberDynamicType(p_element, typeBuilder, mId++); - if (mType == nullptr) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'structDcl'. Name: " << element_name); - return XMLP_ret::XML_ERROR; - } - } - - if (false == XMLProfileManager::insertDynamicTypeByName(name, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - - return ret; -} - -XMLP_ret XMLParser::parseXMLUnionDynamicType( - tinyxml2::XMLElement* p_root) -{ - /* - - - - - - - - - - - - - - - - - - - */ - - XMLP_ret ret = XMLP_ret::XML_OK; - const char* name = p_root->Attribute(NAME); - if (nullptr == name || name[0] == '\0') - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Missing required attribute 'name' in 'unionDcl'."); - return XMLP_ret::XML_ERROR; - } - if (nullptr != XMLProfileManager::getDynamicTypeByName(name)) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'unionDcl' type: Type '" << name << "' already defined."); - return XMLP_ret::XML_ERROR; - } - - tinyxml2::XMLElement* p_element = p_root->FirstChildElement(DISCRIMINATOR); - if (p_element != nullptr) - { - const char* disc = p_element->Attribute(TYPE); - p_dynamictypebuilder_t discriminator = getDiscriminatorTypeBuilder(disc); - if (discriminator == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Error parsing union discriminator: Only primitive types allowed (found type " << disc << ")."); - ret = XMLP_ret::XML_ERROR; - } - else - { - p_dynamictypebuilder_t typeBuilder = types::DynamicTypeBuilderFactory::get_instance()->create_union_builder( - discriminator); - typeBuilder->set_name(name); - - uint32_t mId = 0; - for (p_element = p_root->FirstChildElement(CASE); - p_element != nullptr; p_element = p_element->NextSiblingElement(CASE)) - { - std::string valuesStr = ""; - for (tinyxml2::XMLElement* caseValue = p_element->FirstChildElement(CASE_DISCRIMINATOR); - caseValue != nullptr; caseValue = caseValue->NextSiblingElement(CASE_DISCRIMINATOR)) - { - const char* values = caseValue->Attribute(VALUE); - if (values == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union case value: Not found."); - return XMLP_ret::XML_ERROR; - } - - if (valuesStr.empty()) - { - valuesStr = values; - } - else - { - valuesStr += std::string(",") + values; - } - } - - tinyxml2::XMLElement* caseElement = p_element->FirstChildElement(); - while (caseElement != nullptr && strncmp(caseElement->Value(), CASE_DISCRIMINATOR, 10) == 0) - { - caseElement = caseElement->NextSiblingElement(); - } - if (caseElement != nullptr) - { - p_dynamictypebuilder_t mType = parseXMLMemberDynamicType - (caseElement, typeBuilder, mId++, valuesStr); - if (mType == nullptr) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union case member: Not found."); - return XMLP_ret::XML_ERROR; - } - } - - if (false == XMLProfileManager::insertDynamicTypeByName(name, typeBuilder)) - { - types::DynamicTypeBuilderFactory::get_instance()->delete_builder(typeBuilder); - ret = XMLP_ret::XML_ERROR; - } - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union discriminator: Not found."); - ret = XMLP_ret::XML_ERROR; - } - - return ret; -} - -static void dimensionsToArrayBounds( - const std::string& dimensions, - std::vector& bounds) -{ - std::stringstream ss(dimensions); - std::string item; - - bounds.clear(); - - while (std::getline(ss, item, ',')) - { - bounds.push_back(static_cast(std::atoi(item.c_str()))); - } -} - -static bool dimensionsToLabels( - const std::string& labelStr, - std::vector& labels) -{ - std::stringstream ss(labelStr); - std::string item; - bool def = false; - - labels.clear(); - while (std::getline(ss, item, ',')) - { - if (item == DEFAULT) - { - def = true; - } - else - { - labels.push_back(static_cast(std::atoi(item.c_str()))); - } - } - - return def; -} - -p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId) -{ - return parseXMLMemberDynamicType(p_root, p_dynamictype, mId, ""); -} - -p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType( - tinyxml2::XMLElement* p_root, - p_dynamictypebuilder_t p_dynamictype, - types::MemberId mId, - const std::string& values) -{ - /* - - - - - - - - - - - - */ - if (p_root == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member: Node not found."); - return nullptr; - } - - const char* memberType = p_root->Attribute(TYPE); - const char* memberName = p_root->Attribute(NAME); - bool isArray = false; - - if (memberName == nullptr && p_dynamictype != nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member name: Not found."); - return nullptr; - } - - if (memberType == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); - return nullptr; - } - - const char* memberArray = p_root->Attribute(ARRAY_DIMENSIONS); - if (memberArray != nullptr) - { - isArray = true; - } - - if (strcmp(memberType, NON_BASIC_TYPE) == 0) - { - const char* memberNonBasicTypeName = p_root->Attribute(NON_BASIC_TYPE_NAME); - if (memberNonBasicTypeName != nullptr) - { - memberType = memberNonBasicTypeName; - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); - return nullptr; - } - } - - types::DynamicTypeBuilder* memberBuilder = nullptr; - types::DynamicTypeBuilderFactory* factory = types::DynamicTypeBuilderFactory::get_instance(); - - const char* memberSequence = p_root->Attribute(SEQ_MAXLENGTH); - if (memberSequence != nullptr) - { - /* - In sequences allowed formats are (complex format includes the basic): - sequence,2> - - - - In this example, inner sequence's name is ignored and can be omited. - */ - p_dynamictypebuilder_t contentType = getDiscriminatorTypeBuilder(memberType); - if (contentType == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing sequence element type: Cannot be recognized: " << memberType); - return nullptr; - } - - const char* lengthStr = p_root->Attribute(SEQ_MAXLENGTH); - uint32_t length = types::MAX_ELEMENTS_COUNT; - if (lengthStr != nullptr) - { - try - { - length = static_cast(std::stoi(lengthStr)); - } - catch (const std::exception&) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member sequence length in line " << p_root->GetLineNum()); - return nullptr; - } - } - - if (!isArray) - { - memberBuilder = factory->create_sequence_builder(contentType, length); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_sequence_builder(contentType, length); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (p_root->Attribute(MAP_MAXLENGTH) != nullptr) - { - /* - In maps allowed formats are (complex format includes the basic): - map, map,2> - - - - - - - - - - - - - In this example, inner maps names are ignored and can be omited. - */ - // Parse key - - //const char* keyType = p_root->Attribute(KEY); - p_dynamictypebuilder_t keyTypeBuilder = nullptr; - const char* memberMapKeyType = p_root->Attribute(MAP_KEY_TYPE); - if (memberMapKeyType != nullptr) - { - keyTypeBuilder = getDiscriminatorTypeBuilder(memberMapKeyType); - if (keyTypeBuilder == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's key element type: Cannot be recognized."); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing key_type element: Not found."); - return nullptr; - } - - // Parse value - p_dynamictypebuilder_t valueTypeBuilder; - if (memberType != nullptr) - { - valueTypeBuilder = getDiscriminatorTypeBuilder(memberType); - if (valueTypeBuilder == nullptr) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's value element type: Cannot be recognized."); - return nullptr; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing value_value element: Not found."); - return nullptr; - } - - const char* lengthStr = p_root->Attribute(MAP_MAXLENGTH); - uint32_t length = types::MAX_ELEMENTS_COUNT; - if (lengthStr != nullptr) - { - try - { - length = static_cast(std::stoi(lengthStr)); - } - catch (const std::exception&) - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Error parsing map member sequence length in line " << p_root->GetLineNum()); - return nullptr; - } - } - - if (!isArray) - { - memberBuilder = factory->create_map_builder(keyTypeBuilder, valueTypeBuilder, length); - } - else - { - types::DynamicTypeBuilder* innerBuilder = - factory->create_map_builder(keyTypeBuilder, valueTypeBuilder, length); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, BOOLEAN, 8) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_bool_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_bool_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, CHAR, 5) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_char8_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_char8_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, WCHAR, 6) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_char16_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_char16_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, TBYTE, 6) == 0 - || strncmp(memberType, OCTET, 6) == 0 - || strncmp(memberType, UINT8, 6) == 0 - || strncmp(memberType, INT8, 5) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_byte_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_byte_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, SHORT, 6) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_int16_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_int16_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, LONG, 5) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_int32_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_int32_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, ULONG, 13) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_uint32_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint32_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, USHORT, 14) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_uint16_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint16_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, LONGLONG, 9) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_int64_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_int64_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, ULONGLONG, 17) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_uint64_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_uint64_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, FLOAT, 6) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_float32_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_float32_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, DOUBLE, 7) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_float64_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_float64_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, LONGDOUBLE, 11) == 0) - { - if (!isArray) - { - memberBuilder = factory->create_float128_builder(); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_float128_builder(); - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, STRING, 7) == 0) - { - uint32_t bound = 0; - const char* boundStr = p_root->Attribute(STR_MAXLENGTH); - if (boundStr != nullptr) - { - bound = static_cast(std::atoi(boundStr)); - } - if (!isArray) - { - memberBuilder = factory->create_string_builder(bound); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_string_builder(bound); - std::vector boundsArray; - dimensionsToArrayBounds(memberArray, boundsArray); - memberBuilder = factory->create_array_builder(innerBuilder, boundsArray); - //factory->DeleteBuilder(innerBuilder); - } - } - else if (strncmp(memberType, WSTRING, 8) == 0) - { - uint32_t bound = 0; - const char* boundStr = p_root->Attribute(STR_MAXLENGTH); - if (boundStr != nullptr) - { - bound = static_cast(std::atoi(boundStr)); - } - if (!isArray) - { - memberBuilder = factory->create_wstring_builder(bound); - } - else - { - types::DynamicTypeBuilder* innerBuilder = factory->create_wstring_builder(bound); - std::vector boundsArray; - dimensionsToArrayBounds(memberArray, boundsArray); - memberBuilder = factory->create_array_builder(innerBuilder, boundsArray); - //factory->DeleteBuilder(innerBuilder); - } - } - else // Complex type? - { - p_dynamictypebuilder_t typePtr = XMLProfileManager::getDynamicTypeByName(memberType); - if (!isArray) - { - memberBuilder = typePtr; - } - else - { - types::DynamicTypeBuilder* innerBuilder = typePtr; - std::vector bounds; - dimensionsToArrayBounds(memberArray, bounds); - memberBuilder = factory->create_array_builder(innerBuilder, bounds); - // Don't delete innerBuilder, it will be freed on destructors. - } - } - - - if (memberBuilder == nullptr) - { - if (!isArray) - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating " << memberType << ": " << (memberName ? memberName : "")); - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, - "Failed creating " << memberType << " array: " << (memberName ? memberName : "")); - } - return nullptr; - } - - const char* memberTopicKey = p_root->Attribute(KEY); - if (memberTopicKey != nullptr) - { - if (strncmp(memberTopicKey, "true", 5) == 0) - { - memberBuilder->apply_annotation(types::ANNOTATION_KEY_ID, "value", "true"); - } - } - - if (p_dynamictype != nullptr) - { - if (!values.empty()) - { - std::vector labels; - bool defaultLabel = dimensionsToLabels(values, labels); - p_dynamictype->add_member(mId, memberName, memberBuilder, - "", labels, defaultLabel); - } - else - { - p_dynamictype->add_member(mId, memberName, memberBuilder); - } - } - //factory->DeleteBuilder(memberBuilder); - - return memberBuilder; -} - -XMLP_ret XMLParser::parseXMLDynamicTypes( - tinyxml2::XMLElement& types) -{ - XMLP_ret ret = XMLP_ret::XML_OK; - ret = parseDynamicTypes(&types); - return ret; -} - -XMLP_ret XMLParser::parseDynamicTypes( - tinyxml2::XMLElement* p_root) -{ - return parseXMLTypes(p_root); -} - -XMLP_ret XMLParser::loadXMLDynamicTypes( - tinyxml2::XMLElement& xmlDoc) -{ - return parseXMLDynamicTypes(xmlDoc); -} diff --git a/src/cpp/security/accesscontrol/DistinguishedName.cpp b/src/cpp/security/accesscontrol/DistinguishedName.cpp index 3291284cdfc..65a2125fe69 100644 --- a/src/cpp/security/accesscontrol/DistinguishedName.cpp +++ b/src/cpp/security/accesscontrol/DistinguishedName.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include diff --git a/src/cpp/security/accesscontrol/Permissions.cpp b/src/cpp/security/accesscontrol/Permissions.cpp index 23ee39bbca2..58bd5a8f531 100644 --- a/src/cpp/security/accesscontrol/Permissions.cpp +++ b/src/cpp/security/accesscontrol/Permissions.cpp @@ -16,21 +16,10 @@ * @file Permissions.cpp */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include - #if OPENSSL_VERSION_NUMBER >= 0x10100000L #define IS_OPENSSL_1_1 1 #define OPENSSL_CONST const @@ -43,17 +32,28 @@ #include #include -#include -#include +#include +#include +#include +#include +#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define S1(x) #x #define S2(x) S1(x) #define LOCATION " (" __FILE__ ":" S2(__LINE__) ")" #define _SecurityException_(str) SecurityException(std::string(str) + LOCATION) +using namespace eprosima::fastdds::rtps; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; diff --git a/src/cpp/security/artifact_providers/Pkcs11Provider.cpp b/src/cpp/security/artifact_providers/Pkcs11Provider.cpp index c7598f86ff5..483d5ce0f1c 100644 --- a/src/cpp/security/artifact_providers/Pkcs11Provider.cpp +++ b/src/cpp/security/artifact_providers/Pkcs11Provider.cpp @@ -100,7 +100,7 @@ Pkcs11Provider::Pkcs11Provider() // Load the PIN from the environment std::string pin; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_env(FASTDDS_PKCS11_PIN, pin)) + if (fastdds::dds::RETCODE_OK == SystemInfo::get_env(FASTDDS_PKCS11_PIN, pin)) { if (!ENGINE_ctrl_cmd_string( pkcs11_, "PIN", pin.c_str(), 0)) { diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp index a260fac8c29..f8962b7bef0 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp @@ -20,9 +20,9 @@ #include +#include #include #include -#include #include @@ -31,7 +31,7 @@ namespace fastdds { namespace statistics { namespace dds { -ReturnCode_t DomainParticipant::enable_statistics_datawriter( +fastdds::dds::ReturnCode_t DomainParticipant::enable_statistics_datawriter( const std::string& topic_name, const eprosima::fastdds::dds::DataWriterQos& dwqos) { @@ -39,13 +39,13 @@ ReturnCode_t DomainParticipant::enable_statistics_datawriter( (void) topic_name; (void) dwqos; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->enable_statistics_datawriter(topic_name, dwqos); #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::enable_statistics_datawriter_with_profile( +fastdds::dds::ReturnCode_t DomainParticipant::enable_statistics_datawriter_with_profile( const std::string& profile_name, const std::string& topic_name) { @@ -53,20 +53,20 @@ ReturnCode_t DomainParticipant::enable_statistics_datawriter_with_profile( (void) profile_name; (void) topic_name; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->enable_statistics_datawriter_with_profile(profile_name, topic_name); #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::disable_statistics_datawriter( +fastdds::dds::ReturnCode_t DomainParticipant::disable_statistics_datawriter( const std::string& topic_name) { #ifndef FASTDDS_STATISTICS (void) topic_name; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #else return static_cast(impl_)->disable_statistics_datawriter(topic_name); #endif // FASTDDS_STATISTICS @@ -94,25 +94,25 @@ const DomainParticipant* DomainParticipant::narrow( #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::enable_monitor_service() +fastdds::dds::ReturnCode_t DomainParticipant::enable_monitor_service() { #ifdef FASTDDS_STATISTICS return static_cast(impl_)->enable_monitor_service(); #else - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::disable_monitor_service() +fastdds::dds::ReturnCode_t DomainParticipant::disable_monitor_service() { #ifdef FASTDDS_STATISTICS return static_cast(impl_)->disable_monitor_service(); #else - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( +fastdds::dds::ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { @@ -121,11 +121,11 @@ ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( #else (void)data; (void)msg; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( +fastdds::dds::ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { @@ -134,11 +134,11 @@ ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( #else (void)data; (void)msg; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #endif // FASTDDS_STATISTICS } -ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( +fastdds::dds::ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { @@ -147,7 +147,7 @@ ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message( #else (void)data; (void)msg; - return ReturnCode_t::RETCODE_UNSUPPORTED; + return fastdds::dds::RETCODE_UNSUPPORTED; #endif // FASTDDS_STATISTICS } diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp index afd8aa662ec..9eb6c315f6e 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp @@ -18,37 +18,38 @@ #include -#include #include +#include #include #include + +#include +#include #include #include #include #include +#include #include #include #include -#include #include #include #include #include -#include #include +#include #include #include #include -#include +#include #include #include - -#include -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -58,7 +59,6 @@ namespace dds { using fastrtps::xmlparser::XMLProfileManager; using fastrtps::xmlparser::XMLP_ret; using fastrtps::xmlparser::DEFAULT_STATISTICS_DATAWRITER_PROFILE; -using fastrtps::PublisherAttributes; constexpr const char* HISTORY_LATENCY_TOPIC_ALIAS = "HISTORY_LATENCY_TOPIC"; constexpr const char* NETWORK_LATENCY_TOPIC_ALIAS = "NETWORK_LATENCY_TOPIC"; @@ -80,36 +80,36 @@ constexpr const char* PHYSICAL_DATA_TOPIC_ALIAS = "PHYSICAL_DATA_TOPIC"; constexpr const char* MONITOR_SERVICE_TOPIC_ALIAS = "MONITOR_SERVICE_TOPIC"; static constexpr uint32_t participant_statistics_mask = - EventKindBits::RTPS_SENT | EventKindBits::RTPS_LOST | EventKindBits::NETWORK_LATENCY | - EventKindBits::EDP_PACKETS | EventKindBits::PDP_PACKETS | - EventKindBits::PHYSICAL_DATA | EventKindBits::DISCOVERED_ENTITY; + EventKind::RTPS_SENT | EventKind::RTPS_LOST | EventKind::NETWORK_LATENCY | + EventKind::EDP_PACKETS | EventKind::PDP_PACKETS | + EventKind::PHYSICAL_DATA | EventKind::DISCOVERED_ENTITY; struct ValidEntry { const char* alias; const char* name; - EventKind event_kind; + uint32_t event_kind; }; static const ValidEntry valid_entries[] = { - {HISTORY_LATENCY_TOPIC_ALIAS, HISTORY_LATENCY_TOPIC, HISTORY2HISTORY_LATENCY}, - {NETWORK_LATENCY_TOPIC_ALIAS, NETWORK_LATENCY_TOPIC, NETWORK_LATENCY}, - {PUBLICATION_THROUGHPUT_TOPIC_ALIAS, PUBLICATION_THROUGHPUT_TOPIC, PUBLICATION_THROUGHPUT}, - {SUBSCRIPTION_THROUGHPUT_TOPIC_ALIAS, SUBSCRIPTION_THROUGHPUT_TOPIC, SUBSCRIPTION_THROUGHPUT}, - {RTPS_SENT_TOPIC_ALIAS, RTPS_SENT_TOPIC, RTPS_SENT}, - {RTPS_LOST_TOPIC_ALIAS, RTPS_LOST_TOPIC, RTPS_LOST}, - {RESENT_DATAS_TOPIC_ALIAS, RESENT_DATAS_TOPIC, RESENT_DATAS}, - {HEARTBEAT_COUNT_TOPIC_ALIAS, HEARTBEAT_COUNT_TOPIC, HEARTBEAT_COUNT}, - {ACKNACK_COUNT_TOPIC_ALIAS, ACKNACK_COUNT_TOPIC, ACKNACK_COUNT}, - {NACKFRAG_COUNT_TOPIC_ALIAS, NACKFRAG_COUNT_TOPIC, NACKFRAG_COUNT}, - {GAP_COUNT_TOPIC_ALIAS, GAP_COUNT_TOPIC, GAP_COUNT}, - {DATA_COUNT_TOPIC_ALIAS, DATA_COUNT_TOPIC, DATA_COUNT}, - {PDP_PACKETS_TOPIC_ALIAS, PDP_PACKETS_TOPIC, PDP_PACKETS}, - {EDP_PACKETS_TOPIC_ALIAS, EDP_PACKETS_TOPIC, EDP_PACKETS}, - {DISCOVERY_TOPIC_ALIAS, DISCOVERY_TOPIC, DISCOVERED_ENTITY}, - {SAMPLE_DATAS_TOPIC_ALIAS, SAMPLE_DATAS_TOPIC, SAMPLE_DATAS}, - {PHYSICAL_DATA_TOPIC_ALIAS, PHYSICAL_DATA_TOPIC, PHYSICAL_DATA} + {HISTORY_LATENCY_TOPIC_ALIAS, HISTORY_LATENCY_TOPIC, EventKind::HISTORY2HISTORY_LATENCY}, + {NETWORK_LATENCY_TOPIC_ALIAS, NETWORK_LATENCY_TOPIC, EventKind::NETWORK_LATENCY}, + {PUBLICATION_THROUGHPUT_TOPIC_ALIAS, PUBLICATION_THROUGHPUT_TOPIC, EventKind::PUBLICATION_THROUGHPUT}, + {SUBSCRIPTION_THROUGHPUT_TOPIC_ALIAS, SUBSCRIPTION_THROUGHPUT_TOPIC, EventKind::SUBSCRIPTION_THROUGHPUT}, + {RTPS_SENT_TOPIC_ALIAS, RTPS_SENT_TOPIC, EventKind::RTPS_SENT}, + {RTPS_LOST_TOPIC_ALIAS, RTPS_LOST_TOPIC, EventKind::RTPS_LOST}, + {RESENT_DATAS_TOPIC_ALIAS, RESENT_DATAS_TOPIC, EventKind::RESENT_DATAS}, + {HEARTBEAT_COUNT_TOPIC_ALIAS, HEARTBEAT_COUNT_TOPIC, EventKind::HEARTBEAT_COUNT}, + {ACKNACK_COUNT_TOPIC_ALIAS, ACKNACK_COUNT_TOPIC, EventKind::ACKNACK_COUNT}, + {NACKFRAG_COUNT_TOPIC_ALIAS, NACKFRAG_COUNT_TOPIC, EventKind::NACKFRAG_COUNT}, + {GAP_COUNT_TOPIC_ALIAS, GAP_COUNT_TOPIC, EventKind::GAP_COUNT}, + {DATA_COUNT_TOPIC_ALIAS, DATA_COUNT_TOPIC, EventKind::DATA_COUNT}, + {PDP_PACKETS_TOPIC_ALIAS, PDP_PACKETS_TOPIC, EventKind::PDP_PACKETS}, + {EDP_PACKETS_TOPIC_ALIAS, EDP_PACKETS_TOPIC, EventKind::EDP_PACKETS}, + {DISCOVERY_TOPIC_ALIAS, DISCOVERY_TOPIC, EventKind::DISCOVERED_ENTITY}, + {SAMPLE_DATAS_TOPIC_ALIAS, SAMPLE_DATAS_TOPIC, EventKind::SAMPLE_DATAS}, + {PHYSICAL_DATA_TOPIC_ALIAS, PHYSICAL_DATA_TOPIC, EventKind::PHYSICAL_DATA} }; ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( @@ -117,15 +117,15 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( const efd::DataWriterQos& dwqos) { std::string use_topic_name; - EventKind event_kind; + uint32_t event_kind; if (!transform_and_check_topic_name(topic_name, use_topic_name, event_kind)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return efd::RETCODE_BAD_PARAMETER; } - if (!efd::DataWriterImpl::check_qos(dwqos)) + if (efd::RETCODE_OK != efd::DataWriterImpl::check_qos(dwqos)) { - return ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + return efd::RETCODE_INCONSISTENT_POLICY; } // Register type and topic @@ -147,7 +147,7 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( // Remove topic and type delete_topic_and_type(use_topic_name); EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, topic_name << " DataWriter creation has failed"); - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } if (PHYSICAL_DATA_TOPIC == use_topic_name) @@ -156,7 +156,7 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( notification.participant_guid(*reinterpret_cast(&guid())); notification.host(asio::ip::host_name() + ":" + std::to_string(efd::utils::default_domain_id())); std::string username; - if (ReturnCode_t::RETCODE_OK == SystemInfo::get_username(username)) + if (efd::RETCODE_OK == SystemInfo::get_username(username)) { notification.user(username); } @@ -173,9 +173,9 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter( rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); } } - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( @@ -189,17 +189,17 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( efd::utils::set_qos_from_attributes(datawriter_qos, attr); ReturnCode_t ret = enable_statistics_datawriter(topic_name, datawriter_qos); - // case RETCODE_ERROR is checked and logged in enable_statistics_datawriter. - // case RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. - // case RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS + // case efd::RETCODE_ERROR is checked and logged in enable_statistics_datawriter. + // case efd::RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. + // case efd::RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS // CMake option is enabled - if (ret == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (ret == efd::RETCODE_INCONSISTENT_POLICY) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Statistics DataWriter QoS from profile name " << profile_name << " are not consistent/compatible"); } - assert(ret != ReturnCode_t::RETCODE_UNSUPPORTED); - if (ret == ReturnCode_t::RETCODE_BAD_PARAMETER) + assert(ret != efd::RETCODE_UNSUPPORTED); + if (ret == efd::RETCODE_BAD_PARAMETER) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Profile name " << profile_name << " is not a valid statistics topic name/alias"); @@ -208,18 +208,18 @@ ReturnCode_t DomainParticipantImpl::enable_statistics_datawriter_with_profile( } EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Profile name " << profile_name << " has not been found"); - return ReturnCode_t::RETCODE_ERROR; + return efd::RETCODE_ERROR; } ReturnCode_t DomainParticipantImpl::disable_statistics_datawriter( const std::string& topic_name) { - ReturnCode_t ret = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = efd::RETCODE_OK; std::string use_topic_name; - EventKind event_kind; + uint32_t event_kind; if (!transform_and_check_topic_name(topic_name, use_topic_name, event_kind)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return efd::RETCODE_BAD_PARAMETER; } // Delete statistics DataWriter @@ -232,18 +232,18 @@ ReturnCode_t DomainParticipantImpl::disable_statistics_datawriter( rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); // Delete the DataWriter - if (ReturnCode_t::RETCODE_OK != builtin_publisher_->delete_datawriter(writer)) + if (efd::RETCODE_OK != builtin_publisher_->delete_datawriter(writer)) { // Restore writer on listener before returning the error statistics_listener_->set_datawriter(event_kind, writer); rtps_participant_->set_enabled_statistics_writers_mask(statistics_listener_->enabled_writers_mask()); - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } // Deregister type and delete topic if (!delete_topic_and_type(use_topic_name)) { - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } } return ret; @@ -253,7 +253,7 @@ ReturnCode_t DomainParticipantImpl::enable() { ReturnCode_t ret = efd::DomainParticipantImpl::enable(); - if (ReturnCode_t::RETCODE_OK == ret) + if (efd::RETCODE_OK == ret) { rtps_participant_->add_statistics_listener(statistics_listener_, participant_statistics_mask); create_statistics_builtin_entities(); @@ -265,7 +265,7 @@ ReturnCode_t DomainParticipantImpl::enable() if (nullptr != enable_ms_property_value && *enable_ms_property_value == "true") { - if (enable_monitor_service() != ReturnCode_t::RETCODE_OK) + if (enable_monitor_service() != efd::RETCODE_OK) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Could not enable the Monitor Service"); } @@ -289,7 +289,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() { ReturnCode_t ret = efd::DomainParticipantImpl::delete_contained_entities(); - if (ret == ReturnCode_t::RETCODE_OK) + if (ret == efd::RETCODE_OK) { builtin_publisher_impl_ = nullptr; builtin_publisher_ = nullptr; @@ -300,7 +300,7 @@ ReturnCode_t DomainParticipantImpl::delete_contained_entities() ReturnCode_t DomainParticipantImpl::enable_monitor_service() { - fastrtps::types::ReturnCode_t ret = fastrtps::types::ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = efd::RETCODE_OK; if (!rtps_participant_->is_monitor_service_created()) { @@ -310,7 +310,7 @@ ReturnCode_t DomainParticipantImpl::enable_monitor_service() if (!rtps_participant_->enable_monitor_service() || nullptr == status_observer_) { - ret = fastrtps::types::ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } return ret; @@ -318,12 +318,12 @@ ReturnCode_t DomainParticipantImpl::enable_monitor_service() ReturnCode_t DomainParticipantImpl::disable_monitor_service() { - fastrtps::types::ReturnCode_t ret = fastrtps::types::ReturnCode_t::RETCODE_OK; + ReturnCode_t ret = efd::RETCODE_OK; if (!rtps_participant_->is_monitor_service_created() || !rtps_participant_->disable_monitor_service()) { - ret = fastrtps::types::ReturnCode_t::RETCODE_NOT_ENABLED; + ret = efd::RETCODE_NOT_ENABLED; } return ret; @@ -333,11 +333,11 @@ ReturnCode_t DomainParticipantImpl::fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { - ReturnCode_t ret{ReturnCode_t::RETCODE_OK}; + ReturnCode_t ret{efd::RETCODE_OK}; if (!get_rtps_participant()->fill_discovery_data_from_cdr_message(data, msg)) { - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } return ret; @@ -347,11 +347,11 @@ ReturnCode_t DomainParticipantImpl::fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { - ReturnCode_t ret{ReturnCode_t::RETCODE_OK}; + ReturnCode_t ret{efd::RETCODE_OK}; if (!get_rtps_participant()->fill_discovery_data_from_cdr_message(data, msg)) { - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } return ret; @@ -361,11 +361,11 @@ ReturnCode_t DomainParticipantImpl::fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg) { - ReturnCode_t ret{ReturnCode_t::RETCODE_OK}; + ReturnCode_t ret{efd::RETCODE_OK}; if (!get_rtps_participant()->fill_discovery_data_from_cdr_message(data, msg)) { - ret = ReturnCode_t::RETCODE_ERROR; + ret = efd::RETCODE_ERROR; } return ret; @@ -426,7 +426,7 @@ void DomainParticipantImpl::enable_statistics_builtin_datawriters( if (MONITOR_SERVICE_TOPIC_ALIAS == topic) { if (!rtps_participant_->is_monitor_service_created() && - enable_monitor_service() != ReturnCode_t::RETCODE_OK) + enable_monitor_service() != efd::RETCODE_OK) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Could not enable the Monitor Service"); } @@ -446,17 +446,17 @@ void DomainParticipantImpl::enable_statistics_builtin_datawriters( } ReturnCode_t ret = enable_statistics_datawriter(topic, datawriter_qos); - // case RETCODE_ERROR is checked and logged in enable_statistics_datawriter. - // case RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. - // case RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS + // case efd::RETCODE_ERROR is checked and logged in enable_statistics_datawriter. + // case efd::RETCODE_INCONSISTENT_POLICY could happen if profile defined in XML is inconsistent. + // case efd::RETCODE_UNSUPPORTED cannot happen because this method is only called if FASTDDS_STATISTICS // CMake option is enabled - if (ret == ReturnCode_t::RETCODE_INCONSISTENT_POLICY) + if (ret == efd::RETCODE_INCONSISTENT_POLICY) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Statistics DataWriter QoS from topic " << topic << " are not consistent/compatible"); } - assert(ret != ReturnCode_t::RETCODE_UNSUPPORTED); - if (ret == ReturnCode_t::RETCODE_BAD_PARAMETER) + assert(ret != efd::RETCODE_UNSUPPORTED); + if (ret == efd::RETCODE_BAD_PARAMETER) { EPROSIMA_LOG_ERROR(STATISTICS_DOMAIN_PARTICIPANT, "Topic " << topic << " is not a valid statistics topic name/alias"); @@ -500,7 +500,7 @@ bool DomainParticipantImpl::is_statistics_topic_name( bool DomainParticipantImpl::transform_and_check_topic_name( const std::string& topic_name_or_alias, std::string& topic_name, - EventKind& event_kind) noexcept + uint32_t& event_kind) noexcept { for (const ValidEntry& entry : valid_entries) { @@ -590,7 +590,7 @@ bool DomainParticipantImpl::find_or_create_topic_and_type( } else { - if (ReturnCode_t::RETCODE_PRECONDITION_NOT_MET == register_type(type, type->getName())) + if (efd::RETCODE_PRECONDITION_NOT_MET == register_type(type, type->getName())) { // No log because it is already logged within register_type return false; @@ -612,7 +612,7 @@ bool DomainParticipantImpl::delete_topic_and_type( std::string type_name = topic->get_type_name(); // delete_topic can fail if the topic is referenced by any other entity. This case could happen even if // it should not. It also fails if topic is a nullptr (dynamic_cast failure). - if (ReturnCode_t::RETCODE_OK != delete_topic(topic)) + if (efd::RETCODE_OK != delete_topic(topic)) { return false; } @@ -626,7 +626,7 @@ bool DomainParticipantImpl::get_monitoring_status( const fastrtps::rtps::GUID_t& entity_guid, eprosima::fastdds::statistics::MonitorServiceData& status) { - ReturnCode_t ret = ReturnCode_t::RETCODE_ERROR; + ReturnCode_t ret = efd::RETCODE_ERROR; if (entity_guid.entityId.is_reader()) { @@ -635,7 +635,7 @@ bool DomainParticipantImpl::get_monitoring_status( { if (sub.second->get_monitoring_status(status, entity_guid)) { - ret = ReturnCode_t::RETCODE_OK; + ret = efd::RETCODE_OK; break; } } @@ -647,7 +647,7 @@ bool DomainParticipantImpl::get_monitoring_status( { if (pub.second->get_monitoring_status(status, entity_guid)) { - ret = ReturnCode_t::RETCODE_OK; + ret = efd::RETCODE_OK; break; } } @@ -658,7 +658,7 @@ bool DomainParticipantImpl::get_monitoring_status( "Unknown entity type to get the status from " << entity_guid.entityId); } - return (ret == ReturnCode_t::RETCODE_OK); + return (ret == efd::RETCODE_OK); } } // dds diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp index cec232c6ec0..08b64d57d6b 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp @@ -19,12 +19,13 @@ #ifndef _FASTDDS_STADISTICS_FASTDDS_DOMAIN_DOMAINPARTICIPANTIMPL_HPP_ #define _FASTDDS_STADISTICS_FASTDDS_DOMAIN_DOMAINPARTICIPANTIMPL_HPP_ -#include +#include #ifdef FASTDDS_STATISTICS #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include @@ -43,8 +43,6 @@ namespace efd = eprosima::fastdds::dds; -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace statistics { @@ -70,7 +68,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - ReturnCode_t enable_statistics_datawriter( + efd::ReturnCode_t enable_statistics_datawriter( const std::string& topic_name, const efd::DataWriterQos& dwqos); @@ -84,7 +82,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - ReturnCode_t enable_statistics_datawriter_with_profile( + efd::ReturnCode_t enable_statistics_datawriter_with_profile( const std::string& profile_name, const std::string& topic_name); @@ -97,7 +95,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * RETCODE_OK if the DataWriter has been correctly deleted or does not exist, * and RETCODE_ERROR otherwise */ - ReturnCode_t disable_statistics_datawriter( + efd::ReturnCode_t disable_statistics_datawriter( const std::string& topic_name); /** @@ -105,7 +103,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * * @return RETCODE_OK if successful */ - ReturnCode_t enable() override; + efd::ReturnCode_t enable() override; void disable() override; @@ -122,7 +120,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * * @return RETCODE_OK if successful */ - ReturnCode_t delete_contained_entities() override; + efd::ReturnCode_t delete_contained_entities() override; /** * Enables the monitor service in this DomainParticipant. @@ -132,7 +130,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @return RETCODE_UNSUPPORTED if FASTDDS_STATISTICS is not enabled. * */ - ReturnCode_t enable_monitor_service(); + efd::ReturnCode_t enable_monitor_service(); /** * Disables the monitor service in this DomainParticipant. Does nothing if the service was not enabled before. @@ -143,7 +141,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @return RETCODE_UNSUPPORTED if FASTDDS_STATISTICS is not enabled. * */ - ReturnCode_t disable_monitor_service(); + efd::ReturnCode_t disable_monitor_service(); /** * fills in the ParticipantProxyData from a MonitorService Message @@ -154,7 +152,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - ReturnCode_t fill_discovery_data_from_cdr_message( + efd::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg); @@ -167,7 +165,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - ReturnCode_t fill_discovery_data_from_cdr_message( + efd::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg); @@ -180,7 +178,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - ReturnCode_t fill_discovery_data_from_cdr_message( + efd::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, fastdds::statistics::MonitorServiceStatusData& msg); @@ -246,7 +244,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, bool transform_and_check_topic_name( const std::string& topic_name_or_alias, std::string& topic_name, - EventKind& event_kind) noexcept; + uint32_t& event_kind) noexcept; /** * Auxiliary function to register the statistics type depending on the statistics topic name. diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp index 0fb381db791..1c9cef8e365 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp @@ -22,14 +22,13 @@ #include -#include namespace eprosima { namespace fastdds { namespace statistics { namespace dds { void DomainParticipantStatisticsListener::set_datawriter( - EventKind kind, + uint32_t kind, DataWriter* writer) { std::lock_guard guard(mtx_); @@ -51,7 +50,7 @@ void DomainParticipantStatisticsListener::on_statistics_data( const Data& statistics_data) { DataWriter* writer = nullptr; - EventKind data_kind = statistics_data._d(); + uint32_t data_kind = statistics_data._d(); // Find corresponding writer { @@ -69,44 +68,44 @@ void DomainParticipantStatisticsListener::on_statistics_data( switch (data_kind) { - case EventKindBits::HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: data_sample = &statistics_data.writer_reader_data(); break; - case EventKindBits::NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: data_sample = &statistics_data.locator2locator_data(); break; - case EventKindBits::PUBLICATION_THROUGHPUT: - case EventKindBits::SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: data_sample = &statistics_data.entity_data(); break; - case EventKindBits::RTPS_SENT: - case EventKindBits::RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: data_sample = &statistics_data.entity2locator_traffic(); break; - case EventKindBits::RESENT_DATAS: - case EventKindBits::HEARTBEAT_COUNT: - case EventKindBits::ACKNACK_COUNT: - case EventKindBits::NACKFRAG_COUNT: - case EventKindBits::GAP_COUNT: - case EventKindBits::DATA_COUNT: - case EventKindBits::PDP_PACKETS: - case EventKindBits::EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: data_sample = &statistics_data.entity_count(); break; - case EventKindBits::DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: data_sample = &statistics_data.discovery_time(); break; - case EventKindBits::SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: data_sample = &statistics_data.sample_identity_count(); break; - case EventKindBits::PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: data_sample = &statistics_data.physical_data(); break; } diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.hpp b/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.hpp index eb45f0d8de7..dee3f1aece4 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.hpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.hpp @@ -19,7 +19,7 @@ #ifndef _STATISTICS_FASTDDS_DOMAIN_DOMAINPARTICIPANTSTATISTICSLISTENER_HPP #define _STATISTICS_FASTDDS_DOMAIN_DOMAINPARTICIPANTSTATISTICSLISTENER_HPP -#include +#include #ifdef FASTDDS_STATISTICS @@ -31,7 +31,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -43,7 +43,7 @@ struct DomainParticipantStatisticsListener : public IListener using DataWriter = eprosima::fastdds::dds::DataWriter; void set_datawriter( - EventKind kind, + uint32_t kind, DataWriter* writer); void on_statistics_data( @@ -54,7 +54,7 @@ struct DomainParticipantStatisticsListener : public IListener private: std::mutex mtx_; - std::map writers_; + std::map writers_; std::atomic enabled_writers_mask_{0}; }; diff --git a/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp b/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp index b91f9855dcf..5072d93cfd0 100644 --- a/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp +++ b/src/cpp/statistics/fastdds/publisher/DataWriterImpl.hpp @@ -21,10 +21,11 @@ #include -#include +#include #include #include +#include #include namespace eprosima { @@ -65,16 +66,16 @@ class DataWriterImpl : public efd::DataWriterImpl { } - ReturnCode_t enable() override + efd::ReturnCode_t enable() override { if (nullptr != writer_) { - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } - ReturnCode_t ret = BaseType::enable(); + efd::ReturnCode_t ret = BaseType::enable(); - if (ReturnCode_t::RETCODE_OK == ret && statistics_listener_) + if (efd::RETCODE_OK == ret && statistics_listener_) { writer_->add_statistics_listener(statistics_listener_); } diff --git a/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp b/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp index 0454c08bb50..304acfc6c20 100644 --- a/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp +++ b/src/cpp/statistics/fastdds/subscriber/DataReaderImpl.hpp @@ -55,16 +55,16 @@ class DataReaderImpl : public efd::DataReaderImpl { } - ReturnCode_t enable() override + efd::ReturnCode_t enable() override { if (nullptr != reader_) { - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } - ReturnCode_t ret = BaseType::enable(); + efd::ReturnCode_t ret = BaseType::enable(); - if (ReturnCode_t::RETCODE_OK == ret && + if (efd::RETCODE_OK == ret && !DomainParticipantImpl::is_statistics_topic_name(topic_->get_name())) { reader_->add_statistics_listener(statistics_listener_); diff --git a/src/cpp/statistics/rtps/GuidUtils.hpp b/src/cpp/statistics/rtps/GuidUtils.hpp index 31dbd62eebf..502ecafee35 100644 --- a/src/cpp/statistics/rtps/GuidUtils.hpp +++ b/src/cpp/statistics/rtps/GuidUtils.hpp @@ -19,11 +19,11 @@ #ifndef _STATISTICS_RTPS_GUIDUTILS_HPP_ #define _STATISTICS_RTPS_GUIDUTILS_HPP_ -#include +#include #include -#include +#include namespace eprosima { namespace fastdds { @@ -46,7 +46,7 @@ inline bool is_statistics_builtin( * @param [out] entity_id The corresponding entity id. */ inline void set_statistics_entity_id( - EventKind kind, + uint32_t kind, fastrtps::rtps::EntityId_t& entity_id) { entity_id.value[3] = 0x62; diff --git a/src/cpp/statistics/rtps/StatisticsBase.cpp b/src/cpp/statistics/rtps/StatisticsBase.cpp index 84d568a54de..b12e5bbe418 100644 --- a/src/cpp/statistics/rtps/StatisticsBase.cpp +++ b/src/cpp/statistics/rtps/StatisticsBase.cpp @@ -18,13 +18,13 @@ #include -#include - #include +#include #include +#include #include -#include + #include namespace eprosima { @@ -210,12 +210,12 @@ bool StatisticsParticipantImpl::are_writers_involved( { using namespace fastdds::statistics; - constexpr uint32_t writers_maks = PUBLICATION_THROUGHPUT \ - | RESENT_DATAS \ - | HEARTBEAT_COUNT \ - | GAP_COUNT \ - | DATA_COUNT \ - | SAMPLE_DATAS; + constexpr uint32_t writers_maks = EventKind::PUBLICATION_THROUGHPUT \ + | EventKind::RESENT_DATAS \ + | EventKind::HEARTBEAT_COUNT \ + | EventKind::GAP_COUNT \ + | EventKind::DATA_COUNT \ + | EventKind::SAMPLE_DATAS; return writers_maks & mask; } @@ -225,10 +225,10 @@ bool StatisticsParticipantImpl::are_readers_involved( { using namespace fastdds::statistics; - constexpr uint32_t readers_maks = HISTORY2HISTORY_LATENCY \ - | SUBSCRIPTION_THROUGHPUT \ - | ACKNACK_COUNT \ - | NACKFRAG_COUNT; + constexpr uint32_t readers_maks = EventKind::HISTORY2HISTORY_LATENCY \ + | EventKind::SUBSCRIPTION_THROUGHPUT \ + | EventKind::ACKNACK_COUNT \ + | EventKind::NACKFRAG_COUNT; return readers_maks & mask; } @@ -394,7 +394,7 @@ void StatisticsParticipantImpl::process_network_timestamp( { using namespace eprosima::fastrtps::rtps; - if (!are_statistics_writers_enabled(EventKindBits::NETWORK_LATENCY)) + if (!are_statistics_writers_enabled(EventKind::NETWORK_LATENCY)) { return; } @@ -432,7 +432,7 @@ void StatisticsParticipantImpl::process_network_sequence( const rtps::StatisticsSubmessageData::Sequence& seq, uint64_t datagram_size) { - if (!are_statistics_writers_enabled(EventKindBits::RTPS_LOST)) + if (!are_statistics_writers_enabled(EventKind::RTPS_LOST)) { return; } @@ -490,7 +490,7 @@ void StatisticsParticipantImpl::process_network_sequence( Data data; // note that the setter sets RTPS_SENT by default data.entity2locator_traffic(notification); - data._d(EventKindBits::RTPS_LOST); + data._d(EventKind::RTPS_LOST); for_each_listener([&data](const Key& listener) { @@ -506,7 +506,7 @@ void StatisticsParticipantImpl::on_rtps_sent( using namespace std; using eprosima::fastrtps::rtps::RTPSParticipantImpl; - if (!are_statistics_writers_enabled(EventKindBits::RTPS_SENT)) + if (!are_statistics_writers_enabled(EventKind::RTPS_SENT)) { return; } @@ -542,7 +542,7 @@ void StatisticsParticipantImpl::on_entity_discovery( { using namespace fastrtps; - if (!are_statistics_writers_enabled(EventKindBits::DISCOVERED_ENTITY)) + if (!are_statistics_writers_enabled(EventKind::DISCOVERED_ENTITY)) { return; } @@ -601,7 +601,7 @@ void StatisticsParticipantImpl::on_entity_discovery( void StatisticsParticipantImpl::on_pdp_packet( const uint32_t packages) { - if (!are_statistics_writers_enabled(EventKindBits::PDP_PACKETS)) + if (!are_statistics_writers_enabled(EventKind::PDP_PACKETS)) { return; } @@ -619,7 +619,7 @@ void StatisticsParticipantImpl::on_pdp_packet( Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(notification); - data._d(EventKindBits::PDP_PACKETS); + data._d(EventKind::PDP_PACKETS); for_each_listener([&data](const std::shared_ptr& listener) { @@ -630,7 +630,7 @@ void StatisticsParticipantImpl::on_pdp_packet( void StatisticsParticipantImpl::on_edp_packet( const uint32_t packages) { - if (!are_statistics_writers_enabled(EventKindBits::EDP_PACKETS)) + if (!are_statistics_writers_enabled(EventKind::EDP_PACKETS)) { return; } @@ -648,7 +648,7 @@ void StatisticsParticipantImpl::on_edp_packet( Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(notification); - data._d(EventKindBits::EDP_PACKETS); + data._d(EventKind::EDP_PACKETS); for_each_listener([&data](const std::shared_ptr& listener) { diff --git a/src/cpp/statistics/rtps/StatisticsBase.hpp b/src/cpp/statistics/rtps/StatisticsBase.hpp index 971e74a2402..941b502dc22 100644 --- a/src/cpp/statistics/rtps/StatisticsBase.hpp +++ b/src/cpp/statistics/rtps/StatisticsBase.hpp @@ -21,20 +21,19 @@ #include #include +#include #include #include -#include - +#include +#include #include #include #include #include -#include #include #include -#include - +#include namespace eprosima { namespace fastrtps { @@ -461,13 +460,14 @@ class StatisticsParticipantImpl }; // auxiliary conversion functions -RTPS_DllAPI detail::Locator_s to_statistics_type(fastrtps::rtps::Locator_t); -RTPS_DllAPI fastrtps::rtps::Locator_t to_fastdds_type( +// TODO(jlbueno): private headers shall not export API +FASTDDS_EXPORTED_API detail::Locator_s to_statistics_type(fastrtps::rtps::Locator_t); +FASTDDS_EXPORTED_API fastrtps::rtps::Locator_t to_fastdds_type( detail::Locator_s); -RTPS_DllAPI detail::GUID_s to_statistics_type(fastrtps::rtps::GUID_t); -RTPS_DllAPI fastrtps::rtps::GUID_t to_fastdds_type( +FASTDDS_EXPORTED_API detail::GUID_s to_statistics_type(fastrtps::rtps::GUID_t); +FASTDDS_EXPORTED_API fastrtps::rtps::GUID_t to_fastdds_type( detail::GUID_s); -RTPS_DllAPI detail::SampleIdentity_s to_statistics_type(fastrtps::rtps::SampleIdentity); +FASTDDS_EXPORTED_API detail::SampleIdentity_s to_statistics_type(fastrtps::rtps::SampleIdentity); #else // dummy implementation diff --git a/src/cpp/statistics/rtps/messages/OutputTrafficManager.hpp b/src/cpp/statistics/rtps/messages/OutputTrafficManager.hpp index 175f82c4992..fa557b8c589 100644 --- a/src/cpp/statistics/rtps/messages/OutputTrafficManager.hpp +++ b/src/cpp/statistics/rtps/messages/OutputTrafficManager.hpp @@ -24,10 +24,9 @@ #include #include +#include #include -#include - #include namespace eprosima { diff --git a/src/cpp/statistics/rtps/monitor-service/Interfaces.hpp b/src/cpp/statistics/rtps/monitor-service/Interfaces.hpp index c1d6c34e48a..9d7ece0a162 100644 --- a/src/cpp/statistics/rtps/monitor-service/Interfaces.hpp +++ b/src/cpp/statistics/rtps/monitor-service/Interfaces.hpp @@ -20,11 +20,10 @@ #ifndef _FASTDDS_STATISTICS_MONITOR_SERVICE_INTERFACES_HPP_ #define _FASTDDS_STATISTICS_MONITOR_SERVICE_INTERFACES_HPP_ -#include - #include "interfaces/IConnectionsObserver.hpp" #include "interfaces/IConnectionsQueryable.hpp" #include "interfaces/IProxyObserver.hpp" +#include "interfaces/IProxyQueryable.hpp" #include "interfaces/IStatusObserver.hpp" #include "interfaces/IStatusQueryable.hpp" diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp index 4cbb6e29ef2..8065cc33d7d 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp @@ -20,11 +20,11 @@ #include #include -#include #include #include #include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -176,9 +176,9 @@ bool MonitorService::initialize_entity( { bool retcode = false; - std::pair, bool>> local_entity; - local_entity.second.first[PROXY] = 1; - local_entity.second.first[CONNECTION_LIST] = 1; + std::pair, bool>> local_entity; + local_entity.second.first[StatusKind::PROXY] = 1; + local_entity.second.first[StatusKind::CONNECTION_LIST] = 1; local_entity.first = entity_id; local_entity.second.second = true; @@ -220,7 +220,8 @@ bool MonitorService::push_entity_update( } else { - if (entity_id != monitor_service_status_writer && status_id != PROXY && status_id != CONNECTION_LIST) + if (entity_id != monitor_service_status_writer && status_id != StatusKind::PROXY && + status_id != StatusKind::CONNECTION_LIST) { EPROSIMA_LOG_ERROR(MONITOR_SERVICE, "Trying to update the status of an entity without previously initialize it"); @@ -247,7 +248,7 @@ bool MonitorService::push_entity_update( bool MonitorService::write_status( const fastrtps::rtps::EntityId_t& entity_id, - const std::bitset& changed_statuses, + const std::bitset& changed_statuses, const bool& entity_disposed) { if (!entity_disposed) @@ -265,8 +266,9 @@ bool MonitorService::write_status( bool status_retrieved = true; switch (i) { - case PROXY: + case StatusKind::PROXY: { + data.entity_proxy({}); CDRMessage_t msg; //! Depending on the entity type [Participant, Writer, Reader] //! the size will be accordingly calculated @@ -274,45 +276,46 @@ bool MonitorService::write_status( data.entity_proxy().assign(msg.buffer, msg.buffer + msg.length); break; } - case CONNECTION_LIST: + case StatusKind::CONNECTION_LIST: { + data.connection_list({}); std::vector conns; status_retrieved = conns_queryable_->get_entity_connections(local_entity_guid, conns); data.connection_list(conns); break; } - case INCOMPATIBLE_QOS: + case StatusKind::INCOMPATIBLE_QOS: { data.incompatible_qos_status(IncompatibleQoSStatus_s{}); status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); break; } //Not triggered for the moment - case INCONSISTENT_TOPIC: + case StatusKind::INCONSISTENT_TOPIC: { EPROSIMA_LOG_ERROR(MONITOR_SERVICE, "Inconsistent topic status not supported yet"); static_cast(local_entity_guid); break; } - case LIVELINESS_LOST: + case StatusKind::LIVELINESS_LOST: { data.liveliness_lost_status(LivelinessLostStatus_s{}); status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); break; } - case LIVELINESS_CHANGED: + case StatusKind::LIVELINESS_CHANGED: { data.liveliness_changed_status(LivelinessChangedStatus_s{}); status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); break; } - case DEADLINE_MISSED: + case StatusKind::DEADLINE_MISSED: { data.deadline_missed_status(DeadlineMissedStatus_s{}); status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); break; } - case SAMPLE_LOST: + case StatusKind::SAMPLE_LOST: { data.sample_lost_status(SampleLostStatus_s{}); status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); @@ -328,7 +331,7 @@ bool MonitorService::write_status( if (status_retrieved) { - status_data.status_kind((StatusKind)i); + status_data.status_kind(static_cast(i)); status_data.value(data); add_change(status_data, false); } @@ -347,7 +350,7 @@ bool MonitorService::write_status( status_data.local_entity(to_statistics_type({local_participant_guid_.guidPrefix, entity_id})); - status_data.status_kind(PROXY); + status_data.status_kind(StatusKind::PROXY); status_data.value().entity_proxy(std::vector()); //! Communicate the application what entity was removed @@ -355,9 +358,9 @@ bool MonitorService::write_status( add_change(status_data, false); //! Send a dispose for every statuskind of this entity - for (uint32_t i = PROXY; i < STATUSES_SIZE; i++) + for (uint32_t i = StatusKind::PROXY; i < StatusKind::STATUSES_SIZE; i++) { - status_data.status_kind((StatusKind)i); + status_data.status_kind(i); add_change(status_data, true); } } @@ -393,13 +396,13 @@ bool MonitorService::add_change( std::unique_lock lock(status_writer_->getMutex()); auto max_blocking_time = std::chrono::steady_clock::now() + - std::chrono::microseconds(::TimeConv::Time_t2MicroSecondsInt64(Duration_t())); + std::chrono::microseconds(fastdds::rtps::TimeConv::Time_t2MicroSecondsInt64(Duration_t())); datawriter_history->add_pub_change(change, wp, lock, max_blocking_time); } else { - EPROSIMA_LOG_ERROR(MONITOR_SERVICE, "Could not request a valid CacheChange for " << status_data.status_kind() << - " of " << to_fastdds_type(status_data.local_entity())); + EPROSIMA_LOG_ERROR(MONITOR_SERVICE, "Could not request a valid CacheChange for " << + status_data.status_kind() << " of " << to_fastdds_type(status_data.local_entity())); return false; } @@ -467,7 +470,7 @@ bool MonitorService::create_endpoint() status_writer_ = dynamic_cast(tmp_writer); //! Register the writer in the participant - WriterQos wqos; + fastdds::dds::WriterQos wqos; wqos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; wqos.m_durability.kind = dds::TRANSIENT_LOCAL_DURABILITY_QOS; @@ -492,7 +495,7 @@ bool MonitorService::spin_queue() { EntityId_t entity_id; bool re_schedule = false; - std::bitset changed_statuses; + std::bitset changed_statuses; bool local_instance_disposed = false; { diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp b/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp index c9780829016..14d90c0bd3a 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp @@ -27,16 +27,16 @@ #include #include +#include #include #include #include #include -#include #include "Interfaces.hpp" #include #include -#include +#include #include namespace eprosima { @@ -83,7 +83,7 @@ class MonitorService using endpoint_registrator_t = std::function; + const fastdds::dds::WriterQos&)>; MonitorService( const fastrtps::rtps::GUID_t& guid, @@ -170,7 +170,7 @@ class MonitorService */ bool write_status( const fastrtps::rtps::EntityId_t& entity_id, - const std::bitset& changed_statuses, + const std::bitset& changed_statuses, const bool& entity_disposed); /** @@ -236,7 +236,7 @@ class MonitorService //! inserted twice. std::map, bool>> local_entities_; + std::bitset, bool>> local_entities_; std::unique_ptr event_; diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp b/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp index b5194482f74..7b5ebb54453 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp @@ -47,7 +47,7 @@ bool MonitorServiceListener::on_local_entity_change( if (is_alive) { - ret = monitor_srv_->push_entity_update(guid.entityId, PROXY); + ret = monitor_srv_->push_entity_update(guid.entityId, StatusKind::PROXY); } else { @@ -60,7 +60,7 @@ bool MonitorServiceListener::on_local_entity_change( bool MonitorServiceListener::on_local_entity_connections_change( const fastrtps::rtps::GUID_t& guid) const { - return monitor_srv_->push_entity_update(guid.entityId, CONNECTION_LIST); + return monitor_srv_->push_entity_update(guid.entityId, StatusKind::CONNECTION_LIST); } void MonitorServiceListener::onWriterMatched( diff --git a/src/cpp/statistics/rtps/monitor-service/interfaces/IConnectionsQueryable.hpp b/src/cpp/statistics/rtps/monitor-service/interfaces/IConnectionsQueryable.hpp index 3e8974b5394..4f4682740ec 100644 --- a/src/cpp/statistics/rtps/monitor-service/interfaces/IConnectionsQueryable.hpp +++ b/src/cpp/statistics/rtps/monitor-service/interfaces/IConnectionsQueryable.hpp @@ -28,7 +28,6 @@ namespace eprosima { namespace fastdds { namespace statistics { - namespace rtps { struct IConnectionsQueryable diff --git a/include/fastdds/statistics/rtps/monitor_service/interfaces/IProxyQueryable.hpp b/src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp similarity index 100% rename from include/fastdds/statistics/rtps/monitor_service/interfaces/IProxyQueryable.hpp rename to src/cpp/statistics/rtps/monitor-service/interfaces/IProxyQueryable.hpp diff --git a/src/cpp/statistics/rtps/monitor-service/interfaces/IStatusQueryable.hpp b/src/cpp/statistics/rtps/monitor-service/interfaces/IStatusQueryable.hpp index 9d11045cfc8..5b50d4e0ca8 100644 --- a/src/cpp/statistics/rtps/monitor-service/interfaces/IStatusQueryable.hpp +++ b/src/cpp/statistics/rtps/monitor-service/interfaces/IStatusQueryable.hpp @@ -26,7 +26,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { diff --git a/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp b/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp index 721974dbc9c..f27ed5da413 100644 --- a/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp +++ b/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include using eprosima::fastrtps::RecursiveTimedMutex; using eprosima::fastrtps::rtps::RTPSReader; @@ -65,7 +65,7 @@ void StatisticsReaderImpl::on_data_notify( const fastrtps::rtps::GUID_t& writer_guid, const fastrtps::rtps::Time_t& source_timestamp) { - if (!are_statistics_writers_enabled(EventKindBits::HISTORY2HISTORY_LATENCY)) + if (!are_statistics_writers_enabled(EventKind::HISTORY2HISTORY_LATENCY)) { return; } @@ -96,7 +96,7 @@ void StatisticsReaderImpl::on_data_notify( void StatisticsReaderImpl::on_acknack( int32_t count) { - if (!are_statistics_writers_enabled(EventKindBits::ACKNACK_COUNT)) + if (!are_statistics_writers_enabled(EventKind::ACKNACK_COUNT)) { return; } @@ -109,7 +109,7 @@ void StatisticsReaderImpl::on_acknack( Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(notification); - data._d(EventKindBits::ACKNACK_COUNT); + data._d(EventKind::ACKNACK_COUNT); for_each_listener([&data](const std::shared_ptr& listener) { @@ -120,7 +120,7 @@ void StatisticsReaderImpl::on_acknack( void StatisticsReaderImpl::on_nackfrag( int32_t count) { - if (!are_statistics_writers_enabled(EventKindBits::NACKFRAG_COUNT)) + if (!are_statistics_writers_enabled(EventKind::NACKFRAG_COUNT)) { return; } @@ -133,7 +133,7 @@ void StatisticsReaderImpl::on_nackfrag( Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(notification); - data._d(EventKindBits::NACKFRAG_COUNT); + data._d(EventKind::NACKFRAG_COUNT); for_each_listener([&data](const std::shared_ptr& listener) { @@ -149,7 +149,7 @@ void StatisticsReaderImpl::on_subscribe_throughput( if (payload > 0 ) { - if (!are_statistics_writers_enabled(EventKindBits::SUBSCRIPTION_THROUGHPUT)) + if (!are_statistics_writers_enabled(EventKind::SUBSCRIPTION_THROUGHPUT)) { return; } @@ -170,7 +170,7 @@ void StatisticsReaderImpl::on_subscribe_throughput( Data data; // note that the setter sets PUBLICATION_THROUGHPUT by default data.entity_data(std::move(notification)); - data._d(EventKindBits::SUBSCRIPTION_THROUGHPUT); + data._d(EventKind::SUBSCRIPTION_THROUGHPUT); for_each_listener([&data](const std::shared_ptr& listener) { diff --git a/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp b/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp index 1e289668ac1..38063150cd3 100644 --- a/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp +++ b/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include using eprosima::fastrtps::RecursiveTimedMutex; using eprosima::fastrtps::rtps::RTPSWriter; @@ -67,7 +67,7 @@ void StatisticsWriterImpl::on_sample_datas( const fastrtps::rtps::SampleIdentity& sample_identity, size_t num_sent_submessages) { - if (!are_statistics_writers_enabled(EventKindBits::SAMPLE_DATAS)) + if (!are_statistics_writers_enabled(EventKind::SAMPLE_DATAS)) { return; } @@ -97,7 +97,7 @@ void StatisticsWriterImpl::on_data_generated( void StatisticsWriterImpl::on_data_sent() { - if (!are_statistics_writers_enabled(EventKindBits::DATA_COUNT)) + if (!are_statistics_writers_enabled(EventKind::DATA_COUNT)) { return; } @@ -115,7 +115,7 @@ void StatisticsWriterImpl::on_data_sent() Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(std::move(notification)); - data._d(EventKindBits::DATA_COUNT); + data._d(EventKind::DATA_COUNT); for_each_listener([&data](const std::shared_ptr& listener) { @@ -126,7 +126,7 @@ void StatisticsWriterImpl::on_data_sent() void StatisticsWriterImpl::on_heartbeat( uint32_t count) { - if (!are_statistics_writers_enabled(EventKindBits::HEARTBEAT_COUNT)) + if (!are_statistics_writers_enabled(EventKind::HEARTBEAT_COUNT)) { return; } @@ -139,7 +139,7 @@ void StatisticsWriterImpl::on_heartbeat( Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(std::move(notification)); - data._d(EventKindBits::HEARTBEAT_COUNT); + data._d(EventKind::HEARTBEAT_COUNT); for_each_listener([&data](const std::shared_ptr& listener) { @@ -149,7 +149,7 @@ void StatisticsWriterImpl::on_heartbeat( void StatisticsWriterImpl::on_gap() { - if (!are_statistics_writers_enabled(EventKindBits::GAP_COUNT)) + if (!are_statistics_writers_enabled(EventKind::GAP_COUNT)) { return; } @@ -166,7 +166,7 @@ void StatisticsWriterImpl::on_gap() Data data; // note that the setter sets RESENT_DATAS by default data.entity_count(std::move(notification)); - data._d(EventKindBits::GAP_COUNT); + data._d(EventKind::GAP_COUNT); for_each_listener([&data](const std::shared_ptr& listener) { @@ -182,7 +182,7 @@ void StatisticsWriterImpl::on_resent_data( return; } - if (!are_statistics_writers_enabled(EventKindBits::RESENT_DATAS)) + if (!are_statistics_writers_enabled(EventKind::RESENT_DATAS)) { return; } @@ -214,7 +214,7 @@ void StatisticsWriterImpl::on_publish_throughput( if (payload > 0 ) { - if (!are_statistics_writers_enabled(EventKindBits::PUBLICATION_THROUGHPUT)) + if (!are_statistics_writers_enabled(EventKind::PUBLICATION_THROUGHPUT)) { return; } diff --git a/src/cpp/statistics/types/monitorservice_types.cxx b/src/cpp/statistics/types/monitorservice_types.cxx deleted file mode 100644 index 2ea9407d9ef..00000000000 --- a/src/cpp/statistics/types/monitorservice_types.cxx +++ /dev/null @@ -1,2056 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file monitorservice_types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "monitorservice_types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - - - - - -Connection::Connection() -{ -} - -Connection::~Connection() -{ -} - -Connection::Connection( - const Connection& x) -{ - m_mode = x.m_mode; - m_guid = x.m_guid; - m_announced_locators = x.m_announced_locators; - m_used_locators = x.m_used_locators; -} - -Connection::Connection( - Connection&& x) noexcept -{ - m_mode = x.m_mode; - m_guid = std::move(x.m_guid); - m_announced_locators = std::move(x.m_announced_locators); - m_used_locators = std::move(x.m_used_locators); -} - -Connection& Connection::operator =( - const Connection& x) -{ - - m_mode = x.m_mode; - m_guid = x.m_guid; - m_announced_locators = x.m_announced_locators; - m_used_locators = x.m_used_locators; - return *this; -} - -Connection& Connection::operator =( - Connection&& x) noexcept -{ - - m_mode = x.m_mode; - m_guid = std::move(x.m_guid); - m_announced_locators = std::move(x.m_announced_locators); - m_used_locators = std::move(x.m_used_locators); - return *this; -} - -bool Connection::operator ==( - const Connection& x) const -{ - return (m_mode == x.m_mode && - m_guid == x.m_guid && - m_announced_locators == x.m_announced_locators && - m_used_locators == x.m_used_locators); -} - -bool Connection::operator !=( - const Connection& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ -void Connection::mode( - eprosima::fastdds::statistics::ConnectionMode _mode) -{ - m_mode = _mode; -} - -/*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ -eprosima::fastdds::statistics::ConnectionMode Connection::mode() const -{ - return m_mode; -} - -/*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ -eprosima::fastdds::statistics::ConnectionMode& Connection::mode() -{ - return m_mode; -} - - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void Connection::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void Connection::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() -{ - return m_guid; -} - - -/*! - * @brief This function copies the value in member announced_locators - * @param _announced_locators New value to be copied in member announced_locators - */ -void Connection::announced_locators( - const std::vector& _announced_locators) -{ - m_announced_locators = _announced_locators; -} - -/*! - * @brief This function moves the value in member announced_locators - * @param _announced_locators New value to be moved in member announced_locators - */ -void Connection::announced_locators( - std::vector&& _announced_locators) -{ - m_announced_locators = std::move(_announced_locators); -} - -/*! - * @brief This function returns a constant reference to member announced_locators - * @return Constant reference to member announced_locators - */ -const std::vector& Connection::announced_locators() const -{ - return m_announced_locators; -} - -/*! - * @brief This function returns a reference to member announced_locators - * @return Reference to member announced_locators - */ -std::vector& Connection::announced_locators() -{ - return m_announced_locators; -} - - -/*! - * @brief This function copies the value in member used_locators - * @param _used_locators New value to be copied in member used_locators - */ -void Connection::used_locators( - const std::vector& _used_locators) -{ - m_used_locators = _used_locators; -} - -/*! - * @brief This function moves the value in member used_locators - * @param _used_locators New value to be moved in member used_locators - */ -void Connection::used_locators( - std::vector&& _used_locators) -{ - m_used_locators = std::move(_used_locators); -} - -/*! - * @brief This function returns a constant reference to member used_locators - * @return Constant reference to member used_locators - */ -const std::vector& Connection::used_locators() const -{ - return m_used_locators; -} - -/*! - * @brief This function returns a reference to member used_locators - * @return Reference to member used_locators - */ -std::vector& Connection::used_locators() -{ - return m_used_locators; -} - - - - -QosPolicyCount_s::QosPolicyCount_s() -{ -} - -QosPolicyCount_s::~QosPolicyCount_s() -{ -} - -QosPolicyCount_s::QosPolicyCount_s( - const QosPolicyCount_s& x) -{ - m_policy_id = x.m_policy_id; - m_count = x.m_count; -} - -QosPolicyCount_s::QosPolicyCount_s( - QosPolicyCount_s&& x) noexcept -{ - m_policy_id = x.m_policy_id; - m_count = x.m_count; -} - -QosPolicyCount_s& QosPolicyCount_s::operator =( - const QosPolicyCount_s& x) -{ - - m_policy_id = x.m_policy_id; - m_count = x.m_count; - return *this; -} - -QosPolicyCount_s& QosPolicyCount_s::operator =( - QosPolicyCount_s&& x) noexcept -{ - - m_policy_id = x.m_policy_id; - m_count = x.m_count; - return *this; -} - -bool QosPolicyCount_s::operator ==( - const QosPolicyCount_s& x) const -{ - return (m_policy_id == x.m_policy_id && - m_count == x.m_count); -} - -bool QosPolicyCount_s::operator !=( - const QosPolicyCount_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member policy_id - * @param _policy_id New value for member policy_id - */ -void QosPolicyCount_s::policy_id( - uint32_t _policy_id) -{ - m_policy_id = _policy_id; -} - -/*! - * @brief This function returns the value of member policy_id - * @return Value of member policy_id - */ -uint32_t QosPolicyCount_s::policy_id() const -{ - return m_policy_id; -} - -/*! - * @brief This function returns a reference to member policy_id - * @return Reference to member policy_id - */ -uint32_t& QosPolicyCount_s::policy_id() -{ - return m_policy_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void QosPolicyCount_s::count( - uint32_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint32_t QosPolicyCount_s::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint32_t& QosPolicyCount_s::count() -{ - return m_count; -} - - - - -BaseStatus_s::BaseStatus_s() -{ -} - -BaseStatus_s::~BaseStatus_s() -{ -} - -BaseStatus_s::BaseStatus_s( - const BaseStatus_s& x) -{ - m_total_count = x.m_total_count; -} - -BaseStatus_s::BaseStatus_s( - BaseStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; -} - -BaseStatus_s& BaseStatus_s::operator =( - const BaseStatus_s& x) -{ - - m_total_count = x.m_total_count; - return *this; -} - -BaseStatus_s& BaseStatus_s::operator =( - BaseStatus_s&& x) noexcept -{ - - m_total_count = x.m_total_count; - return *this; -} - -bool BaseStatus_s::operator ==( - const BaseStatus_s& x) const -{ - return (m_total_count == x.m_total_count); -} - -bool BaseStatus_s::operator !=( - const BaseStatus_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void BaseStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t BaseStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& BaseStatus_s::total_count() -{ - return m_total_count; -} - - - - - - - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s() -{ -} - -IncompatibleQoSStatus_s::~IncompatibleQoSStatus_s() -{ -} - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( - const IncompatibleQoSStatus_s& x) -{ - m_total_count = x.m_total_count; - m_last_policy_id = x.m_last_policy_id; - m_policies = x.m_policies; -} - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( - IncompatibleQoSStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - m_last_policy_id = x.m_last_policy_id; - m_policies = std::move(x.m_policies); -} - -IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( - const IncompatibleQoSStatus_s& x) -{ - - m_total_count = x.m_total_count; - m_last_policy_id = x.m_last_policy_id; - m_policies = x.m_policies; - return *this; -} - -IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( - IncompatibleQoSStatus_s&& x) noexcept -{ - - m_total_count = x.m_total_count; - m_last_policy_id = x.m_last_policy_id; - m_policies = std::move(x.m_policies); - return *this; -} - -bool IncompatibleQoSStatus_s::operator ==( - const IncompatibleQoSStatus_s& x) const -{ - return (m_total_count == x.m_total_count && - m_last_policy_id == x.m_last_policy_id && - m_policies == x.m_policies); -} - -bool IncompatibleQoSStatus_s::operator !=( - const IncompatibleQoSStatus_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void IncompatibleQoSStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t IncompatibleQoSStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& IncompatibleQoSStatus_s::total_count() -{ - return m_total_count; -} - - -/*! - * @brief This function sets a value in member last_policy_id - * @param _last_policy_id New value for member last_policy_id - */ -void IncompatibleQoSStatus_s::last_policy_id( - uint32_t _last_policy_id) -{ - m_last_policy_id = _last_policy_id; -} - -/*! - * @brief This function returns the value of member last_policy_id - * @return Value of member last_policy_id - */ -uint32_t IncompatibleQoSStatus_s::last_policy_id() const -{ - return m_last_policy_id; -} - -/*! - * @brief This function returns a reference to member last_policy_id - * @return Reference to member last_policy_id - */ -uint32_t& IncompatibleQoSStatus_s::last_policy_id() -{ - return m_last_policy_id; -} - - -/*! - * @brief This function copies the value in member policies - * @param _policies New value to be copied in member policies - */ -void IncompatibleQoSStatus_s::policies( - const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies) -{ - m_policies = _policies; -} - -/*! - * @brief This function moves the value in member policies - * @param _policies New value to be moved in member policies - */ -void IncompatibleQoSStatus_s::policies( - eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies) -{ - m_policies = std::move(_policies); -} - -/*! - * @brief This function returns a constant reference to member policies - * @return Constant reference to member policies - */ -const eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() const -{ - return m_policies; -} - -/*! - * @brief This function returns a reference to member policies - * @return Reference to member policies - */ -eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() -{ - return m_policies; -} - - - - -LivelinessChangedStatus_s::LivelinessChangedStatus_s() -{ -} - -LivelinessChangedStatus_s::~LivelinessChangedStatus_s() -{ -} - -LivelinessChangedStatus_s::LivelinessChangedStatus_s( - const LivelinessChangedStatus_s& x) -{ - m_alive_count = x.m_alive_count; - m_not_alive_count = x.m_not_alive_count; - m_last_publication_handle = x.m_last_publication_handle; -} - -LivelinessChangedStatus_s::LivelinessChangedStatus_s( - LivelinessChangedStatus_s&& x) noexcept -{ - m_alive_count = x.m_alive_count; - m_not_alive_count = x.m_not_alive_count; - m_last_publication_handle = std::move(x.m_last_publication_handle); -} - -LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( - const LivelinessChangedStatus_s& x) -{ - - m_alive_count = x.m_alive_count; - m_not_alive_count = x.m_not_alive_count; - m_last_publication_handle = x.m_last_publication_handle; - return *this; -} - -LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( - LivelinessChangedStatus_s&& x) noexcept -{ - - m_alive_count = x.m_alive_count; - m_not_alive_count = x.m_not_alive_count; - m_last_publication_handle = std::move(x.m_last_publication_handle); - return *this; -} - -bool LivelinessChangedStatus_s::operator ==( - const LivelinessChangedStatus_s& x) const -{ - return (m_alive_count == x.m_alive_count && - m_not_alive_count == x.m_not_alive_count && - m_last_publication_handle == x.m_last_publication_handle); -} - -bool LivelinessChangedStatus_s::operator !=( - const LivelinessChangedStatus_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member alive_count - * @param _alive_count New value for member alive_count - */ -void LivelinessChangedStatus_s::alive_count( - uint32_t _alive_count) -{ - m_alive_count = _alive_count; -} - -/*! - * @brief This function returns the value of member alive_count - * @return Value of member alive_count - */ -uint32_t LivelinessChangedStatus_s::alive_count() const -{ - return m_alive_count; -} - -/*! - * @brief This function returns a reference to member alive_count - * @return Reference to member alive_count - */ -uint32_t& LivelinessChangedStatus_s::alive_count() -{ - return m_alive_count; -} - - -/*! - * @brief This function sets a value in member not_alive_count - * @param _not_alive_count New value for member not_alive_count - */ -void LivelinessChangedStatus_s::not_alive_count( - uint32_t _not_alive_count) -{ - m_not_alive_count = _not_alive_count; -} - -/*! - * @brief This function returns the value of member not_alive_count - * @return Value of member not_alive_count - */ -uint32_t LivelinessChangedStatus_s::not_alive_count() const -{ - return m_not_alive_count; -} - -/*! - * @brief This function returns a reference to member not_alive_count - * @return Reference to member not_alive_count - */ -uint32_t& LivelinessChangedStatus_s::not_alive_count() -{ - return m_not_alive_count; -} - - -/*! - * @brief This function copies the value in member last_publication_handle - * @param _last_publication_handle New value to be copied in member last_publication_handle - */ -void LivelinessChangedStatus_s::last_publication_handle( - const std::array& _last_publication_handle) -{ - m_last_publication_handle = _last_publication_handle; -} - -/*! - * @brief This function moves the value in member last_publication_handle - * @param _last_publication_handle New value to be moved in member last_publication_handle - */ -void LivelinessChangedStatus_s::last_publication_handle( - std::array&& _last_publication_handle) -{ - m_last_publication_handle = std::move(_last_publication_handle); -} - -/*! - * @brief This function returns a constant reference to member last_publication_handle - * @return Constant reference to member last_publication_handle - */ -const std::array& LivelinessChangedStatus_s::last_publication_handle() const -{ - return m_last_publication_handle; -} - -/*! - * @brief This function returns a reference to member last_publication_handle - * @return Reference to member last_publication_handle - */ -std::array& LivelinessChangedStatus_s::last_publication_handle() -{ - return m_last_publication_handle; -} - - - - -DeadlineMissedStatus_s::DeadlineMissedStatus_s() -{ -} - -DeadlineMissedStatus_s::~DeadlineMissedStatus_s() -{ -} - -DeadlineMissedStatus_s::DeadlineMissedStatus_s( - const DeadlineMissedStatus_s& x) -{ - m_total_count = x.m_total_count; - m_last_instance_handle = x.m_last_instance_handle; -} - -DeadlineMissedStatus_s::DeadlineMissedStatus_s( - DeadlineMissedStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - m_last_instance_handle = std::move(x.m_last_instance_handle); -} - -DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( - const DeadlineMissedStatus_s& x) -{ - - m_total_count = x.m_total_count; - m_last_instance_handle = x.m_last_instance_handle; - return *this; -} - -DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( - DeadlineMissedStatus_s&& x) noexcept -{ - - m_total_count = x.m_total_count; - m_last_instance_handle = std::move(x.m_last_instance_handle); - return *this; -} - -bool DeadlineMissedStatus_s::operator ==( - const DeadlineMissedStatus_s& x) const -{ - return (m_total_count == x.m_total_count && - m_last_instance_handle == x.m_last_instance_handle); -} - -bool DeadlineMissedStatus_s::operator !=( - const DeadlineMissedStatus_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void DeadlineMissedStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t DeadlineMissedStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& DeadlineMissedStatus_s::total_count() -{ - return m_total_count; -} - - -/*! - * @brief This function copies the value in member last_instance_handle - * @param _last_instance_handle New value to be copied in member last_instance_handle - */ -void DeadlineMissedStatus_s::last_instance_handle( - const std::array& _last_instance_handle) -{ - m_last_instance_handle = _last_instance_handle; -} - -/*! - * @brief This function moves the value in member last_instance_handle - * @param _last_instance_handle New value to be moved in member last_instance_handle - */ -void DeadlineMissedStatus_s::last_instance_handle( - std::array&& _last_instance_handle) -{ - m_last_instance_handle = std::move(_last_instance_handle); -} - -/*! - * @brief This function returns a constant reference to member last_instance_handle - * @return Constant reference to member last_instance_handle - */ -const std::array& DeadlineMissedStatus_s::last_instance_handle() const -{ - return m_last_instance_handle; -} - -/*! - * @brief This function returns a reference to member last_instance_handle - * @return Reference to member last_instance_handle - */ -std::array& DeadlineMissedStatus_s::last_instance_handle() -{ - return m_last_instance_handle; -} - - - - - - - - -MonitorServiceData::MonitorServiceData() -{ - m__d = eprosima::fastdds::statistics::PROXY; -} - -MonitorServiceData::~MonitorServiceData() -{ -} - -MonitorServiceData::MonitorServiceData( - const MonitorServiceData& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = x.m_entity_proxy; - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = x.m_connection_list; - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = x.m_incompatible_qos_status; - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = x.m_inconsistent_topic_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = x.m_liveliness_lost_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = x.m_liveliness_changed_status; - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = x.m_deadline_missed_status; - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = x.m_sample_lost_status; - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } -} - -MonitorServiceData::MonitorServiceData( - MonitorServiceData&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = std::move(x.m_entity_proxy); - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = std::move(x.m_connection_list); - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = std::move(x.m_deadline_missed_status); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = std::move(x.m_sample_lost_status); - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } -} - -MonitorServiceData& MonitorServiceData::operator =( - const MonitorServiceData& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = x.m_entity_proxy; - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = x.m_connection_list; - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = x.m_incompatible_qos_status; - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = x.m_inconsistent_topic_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = x.m_liveliness_lost_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = x.m_liveliness_changed_status; - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = x.m_deadline_missed_status; - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = x.m_sample_lost_status; - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } - - return *this; -} - -MonitorServiceData& MonitorServiceData::operator =( - MonitorServiceData&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = std::move(x.m_entity_proxy); - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = std::move(x.m_connection_list); - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = std::move(x.m_deadline_missed_status); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = std::move(x.m_sample_lost_status); - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } - - return *this; -} - -bool MonitorServiceData::operator ==( - const MonitorServiceData& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - return (m_entity_proxy == x.m_entity_proxy); - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - return (m_connection_list == x.m_connection_list); - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - return (m_incompatible_qos_status == x.m_incompatible_qos_status); - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - return (m_inconsistent_topic_status == x.m_inconsistent_topic_status); - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - return (m_liveliness_lost_status == x.m_liveliness_lost_status); - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - return (m_liveliness_changed_status == x.m_liveliness_changed_status); - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - return (m_deadline_missed_status == x.m_deadline_missed_status); - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - return (m_sample_lost_status == x.m_sample_lost_status); - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - return (m_statuses_size == x.m_statuses_size); - break; - - default: - break; - } - return false; -} - -bool MonitorServiceData::operator !=( - const MonitorServiceData& x) const -{ - return !(*this == x); -} - -void MonitorServiceData::_d( - eprosima::fastdds::statistics::StatusKind __d) -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - switch (__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - switch (__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - switch (__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - switch (__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - switch (__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - switch (__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - switch (__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - switch (__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - switch (__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::StatusKind MonitorServiceData::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::StatusKind& MonitorServiceData::_d() -{ - return m__d; -} - -void MonitorServiceData::entity_proxy( - const std::vector& _entity_proxy) -{ - m_entity_proxy = _entity_proxy; - m__d = eprosima::fastdds::statistics::PROXY; - -} - -void MonitorServiceData::entity_proxy( - std::vector&& _entity_proxy) -{ - m_entity_proxy = std::move(_entity_proxy); - m__d = eprosima::fastdds::statistics::PROXY; - -} - -const std::vector& MonitorServiceData::entity_proxy() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_proxy; -} - -std::vector& MonitorServiceData::entity_proxy() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_proxy; -} - - -void MonitorServiceData::connection_list( - const std::vector& _connection_list) -{ - m_connection_list = _connection_list; - m__d = eprosima::fastdds::statistics::CONNECTION_LIST; - -} - -void MonitorServiceData::connection_list( - std::vector&& _connection_list) -{ - m_connection_list = std::move(_connection_list); - m__d = eprosima::fastdds::statistics::CONNECTION_LIST; - -} - -const std::vector& MonitorServiceData::connection_list() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_connection_list; -} - -std::vector& MonitorServiceData::connection_list() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_connection_list; -} - - -void MonitorServiceData::incompatible_qos_status( - const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status) -{ - m_incompatible_qos_status = _incompatible_qos_status; - m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; - -} - -void MonitorServiceData::incompatible_qos_status( - eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status) -{ - m_incompatible_qos_status = std::move(_incompatible_qos_status); - m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; - -} - -const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_incompatible_qos_status; -} - -eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_incompatible_qos_status; -} - - -void MonitorServiceData::inconsistent_topic_status( - const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status) -{ - m_inconsistent_topic_status = _inconsistent_topic_status; - m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; - -} - -void MonitorServiceData::inconsistent_topic_status( - eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status) -{ - m_inconsistent_topic_status = std::move(_inconsistent_topic_status); - m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; - -} - -const eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_inconsistent_topic_status; -} - -eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_inconsistent_topic_status; -} - - -void MonitorServiceData::liveliness_lost_status( - const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status) -{ - m_liveliness_lost_status = _liveliness_lost_status; - m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; - -} - -void MonitorServiceData::liveliness_lost_status( - eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status) -{ - m_liveliness_lost_status = std::move(_liveliness_lost_status); - m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; - -} - -const eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_lost_status; -} - -eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_lost_status; -} - - -void MonitorServiceData::liveliness_changed_status( - const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status) -{ - m_liveliness_changed_status = _liveliness_changed_status; - m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; - -} - -void MonitorServiceData::liveliness_changed_status( - eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status) -{ - m_liveliness_changed_status = std::move(_liveliness_changed_status); - m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; - -} - -const eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_changed_status; -} - -eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_changed_status; -} - - -void MonitorServiceData::deadline_missed_status( - const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status) -{ - m_deadline_missed_status = _deadline_missed_status; - m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; - -} - -void MonitorServiceData::deadline_missed_status( - eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status) -{ - m_deadline_missed_status = std::move(_deadline_missed_status); - m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; - -} - -const eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_deadline_missed_status; -} - -eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_deadline_missed_status; -} - - -void MonitorServiceData::sample_lost_status( - const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status) -{ - m_sample_lost_status = _sample_lost_status; - m__d = eprosima::fastdds::statistics::SAMPLE_LOST; - -} - -void MonitorServiceData::sample_lost_status( - eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status) -{ - m_sample_lost_status = std::move(_sample_lost_status); - m__d = eprosima::fastdds::statistics::SAMPLE_LOST; - -} - -const eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_lost_status; -} - -eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_lost_status; -} - - -void MonitorServiceData::statuses_size( - uint8_t _statuses_size) -{ - m_statuses_size = _statuses_size; - m__d = eprosima::fastdds::statistics::STATUSES_SIZE; - -} - -uint8_t MonitorServiceData::statuses_size() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_statuses_size; -} - -uint8_t& MonitorServiceData::statuses_size() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_statuses_size; -} - - - - -MonitorServiceStatusData::MonitorServiceStatusData() -{ -} - -MonitorServiceStatusData::~MonitorServiceStatusData() -{ -} - -MonitorServiceStatusData::MonitorServiceStatusData( - const MonitorServiceStatusData& x) -{ - m_local_entity = x.m_local_entity; - m_status_kind = x.m_status_kind; - m_value = x.m_value; -} - -MonitorServiceStatusData::MonitorServiceStatusData( - MonitorServiceStatusData&& x) noexcept -{ - m_local_entity = std::move(x.m_local_entity); - m_status_kind = x.m_status_kind; - m_value = std::move(x.m_value); -} - -MonitorServiceStatusData& MonitorServiceStatusData::operator =( - const MonitorServiceStatusData& x) -{ - - m_local_entity = x.m_local_entity; - m_status_kind = x.m_status_kind; - m_value = x.m_value; - return *this; -} - -MonitorServiceStatusData& MonitorServiceStatusData::operator =( - MonitorServiceStatusData&& x) noexcept -{ - - m_local_entity = std::move(x.m_local_entity); - m_status_kind = x.m_status_kind; - m_value = std::move(x.m_value); - return *this; -} - -bool MonitorServiceStatusData::operator ==( - const MonitorServiceStatusData& x) const -{ - return (m_local_entity == x.m_local_entity && - m_status_kind == x.m_status_kind && - m_value == x.m_value); -} - -bool MonitorServiceStatusData::operator !=( - const MonitorServiceStatusData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member local_entity - * @param _local_entity New value to be copied in member local_entity - */ -void MonitorServiceStatusData::local_entity( - const eprosima::fastdds::statistics::detail::GUID_s& _local_entity) -{ - m_local_entity = _local_entity; -} - -/*! - * @brief This function moves the value in member local_entity - * @param _local_entity New value to be moved in member local_entity - */ -void MonitorServiceStatusData::local_entity( - eprosima::fastdds::statistics::detail::GUID_s&& _local_entity) -{ - m_local_entity = std::move(_local_entity); -} - -/*! - * @brief This function returns a constant reference to member local_entity - * @return Constant reference to member local_entity - */ -const eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() const -{ - return m_local_entity; -} - -/*! - * @brief This function returns a reference to member local_entity - * @return Reference to member local_entity - */ -eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() -{ - return m_local_entity; -} - - -/*! - * @brief This function sets a value in member status_kind - * @param _status_kind New value for member status_kind - */ -void MonitorServiceStatusData::status_kind( - eprosima::fastdds::statistics::StatusKind _status_kind) -{ - m_status_kind = _status_kind; -} - -/*! - * @brief This function returns the value of member status_kind - * @return Value of member status_kind - */ -eprosima::fastdds::statistics::StatusKind MonitorServiceStatusData::status_kind() const -{ - return m_status_kind; -} - -/*! - * @brief This function returns a reference to member status_kind - * @return Reference to member status_kind - */ -eprosima::fastdds::statistics::StatusKind& MonitorServiceStatusData::status_kind() -{ - return m_status_kind; -} - - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void MonitorServiceStatusData::value( - const eprosima::fastdds::statistics::MonitorServiceData& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void MonitorServiceStatusData::value( - eprosima::fastdds::statistics::MonitorServiceData&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() -{ - return m_value; -} - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima -// Include auxiliary functions like for serializing/deserializing. -#include "monitorservice_typesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/monitorservice_types.h b/src/cpp/statistics/types/monitorservice_types.h deleted file mode 100644 index 08f713a0ee3..00000000000 --- a/src/cpp/statistics/types/monitorservice_types.h +++ /dev/null @@ -1,1370 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file monitorservice_types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "monitorservice_typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "types.h" - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(MONITORSERVICE_TYPES_SOURCE) -#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) -#else -#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) -#endif // MONITORSERVICE_TYPES_SOURCE -#else -#define MONITORSERVICE_TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define MONITORSERVICE_TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -/*! - * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -enum ConnectionMode : uint32_t -{ - DATA_SHARING, - INTRAPROCESS, - TRANSPORT -}; - - - - -/*! - * @brief This class represents the structure Connection defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class Connection -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Connection(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Connection(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection( - const Connection& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection( - Connection&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection& operator =( - const Connection& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection& operator =( - Connection&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Connection object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Connection& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Connection object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Connection& x) const; - - /*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ - eProsima_user_DllExport void mode( - eprosima::fastdds::statistics::ConnectionMode _mode); - - /*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ - eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode mode() const; - - /*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ - eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode& mode(); - - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function copies the value in member announced_locators - * @param _announced_locators New value to be copied in member announced_locators - */ - eProsima_user_DllExport void announced_locators( - const std::vector& _announced_locators); - - /*! - * @brief This function moves the value in member announced_locators - * @param _announced_locators New value to be moved in member announced_locators - */ - eProsima_user_DllExport void announced_locators( - std::vector&& _announced_locators); - - /*! - * @brief This function returns a constant reference to member announced_locators - * @return Constant reference to member announced_locators - */ - eProsima_user_DllExport const std::vector& announced_locators() const; - - /*! - * @brief This function returns a reference to member announced_locators - * @return Reference to member announced_locators - */ - eProsima_user_DllExport std::vector& announced_locators(); - - - /*! - * @brief This function copies the value in member used_locators - * @param _used_locators New value to be copied in member used_locators - */ - eProsima_user_DllExport void used_locators( - const std::vector& _used_locators); - - /*! - * @brief This function moves the value in member used_locators - * @param _used_locators New value to be moved in member used_locators - */ - eProsima_user_DllExport void used_locators( - std::vector&& _used_locators); - - /*! - * @brief This function returns a constant reference to member used_locators - * @return Constant reference to member used_locators - */ - eProsima_user_DllExport const std::vector& used_locators() const; - - /*! - * @brief This function returns a reference to member used_locators - * @return Reference to member used_locators - */ - eProsima_user_DllExport std::vector& used_locators(); - -private: - - eprosima::fastdds::statistics::ConnectionMode m_mode{eprosima::fastdds::statistics::DATA_SHARING}; - eprosima::fastdds::statistics::detail::GUID_s m_guid; - std::vector m_announced_locators; - std::vector m_used_locators; - -}; - - -/*! - * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class QosPolicyCount_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport QosPolicyCount_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~QosPolicyCount_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s( - const QosPolicyCount_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s( - QosPolicyCount_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s& operator =( - const QosPolicyCount_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s& operator =( - QosPolicyCount_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const QosPolicyCount_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const QosPolicyCount_s& x) const; - - /*! - * @brief This function sets a value in member policy_id - * @param _policy_id New value for member policy_id - */ - eProsima_user_DllExport void policy_id( - uint32_t _policy_id); - - /*! - * @brief This function returns the value of member policy_id - * @return Value of member policy_id - */ - eProsima_user_DllExport uint32_t policy_id() const; - - /*! - * @brief This function returns a reference to member policy_id - * @return Reference to member policy_id - */ - eProsima_user_DllExport uint32_t& policy_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint32_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint32_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint32_t& count(); - -private: - - uint32_t m_policy_id{0}; - uint32_t m_count{0}; - -}; - - -/*! - * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class BaseStatus_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BaseStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BaseStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s( - const BaseStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s( - BaseStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s& operator =( - const BaseStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s& operator =( - BaseStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BaseStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BaseStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - -private: - - uint32_t m_total_count{0}; - -}; - - -typedef std::vector QosPolicyCountSeq_s; - - - -/*! - * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class IncompatibleQoSStatus_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~IncompatibleQoSStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s( - const IncompatibleQoSStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s( - IncompatibleQoSStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( - const IncompatibleQoSStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( - IncompatibleQoSStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const IncompatibleQoSStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const IncompatibleQoSStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - - - /*! - * @brief This function sets a value in member last_policy_id - * @param _last_policy_id New value for member last_policy_id - */ - eProsima_user_DllExport void last_policy_id( - uint32_t _last_policy_id); - - /*! - * @brief This function returns the value of member last_policy_id - * @return Value of member last_policy_id - */ - eProsima_user_DllExport uint32_t last_policy_id() const; - - /*! - * @brief This function returns a reference to member last_policy_id - * @return Reference to member last_policy_id - */ - eProsima_user_DllExport uint32_t& last_policy_id(); - - - /*! - * @brief This function copies the value in member policies - * @param _policies New value to be copied in member policies - */ - eProsima_user_DllExport void policies( - const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies); - - /*! - * @brief This function moves the value in member policies - * @param _policies New value to be moved in member policies - */ - eProsima_user_DllExport void policies( - eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies); - - /*! - * @brief This function returns a constant reference to member policies - * @return Constant reference to member policies - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies() const; - - /*! - * @brief This function returns a reference to member policies - * @return Reference to member policies - */ - eProsima_user_DllExport eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies(); - -private: - - uint32_t m_total_count{0}; - uint32_t m_last_policy_id{0}; - eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies; - -}; - - -/*! - * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class LivelinessChangedStatus_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LivelinessChangedStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LivelinessChangedStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s( - const LivelinessChangedStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s( - LivelinessChangedStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s& operator =( - const LivelinessChangedStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s& operator =( - LivelinessChangedStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LivelinessChangedStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LivelinessChangedStatus_s& x) const; - - /*! - * @brief This function sets a value in member alive_count - * @param _alive_count New value for member alive_count - */ - eProsima_user_DllExport void alive_count( - uint32_t _alive_count); - - /*! - * @brief This function returns the value of member alive_count - * @return Value of member alive_count - */ - eProsima_user_DllExport uint32_t alive_count() const; - - /*! - * @brief This function returns a reference to member alive_count - * @return Reference to member alive_count - */ - eProsima_user_DllExport uint32_t& alive_count(); - - - /*! - * @brief This function sets a value in member not_alive_count - * @param _not_alive_count New value for member not_alive_count - */ - eProsima_user_DllExport void not_alive_count( - uint32_t _not_alive_count); - - /*! - * @brief This function returns the value of member not_alive_count - * @return Value of member not_alive_count - */ - eProsima_user_DllExport uint32_t not_alive_count() const; - - /*! - * @brief This function returns a reference to member not_alive_count - * @return Reference to member not_alive_count - */ - eProsima_user_DllExport uint32_t& not_alive_count(); - - - /*! - * @brief This function copies the value in member last_publication_handle - * @param _last_publication_handle New value to be copied in member last_publication_handle - */ - eProsima_user_DllExport void last_publication_handle( - const std::array& _last_publication_handle); - - /*! - * @brief This function moves the value in member last_publication_handle - * @param _last_publication_handle New value to be moved in member last_publication_handle - */ - eProsima_user_DllExport void last_publication_handle( - std::array&& _last_publication_handle); - - /*! - * @brief This function returns a constant reference to member last_publication_handle - * @return Constant reference to member last_publication_handle - */ - eProsima_user_DllExport const std::array& last_publication_handle() const; - - /*! - * @brief This function returns a reference to member last_publication_handle - * @return Reference to member last_publication_handle - */ - eProsima_user_DllExport std::array& last_publication_handle(); - -private: - - uint32_t m_alive_count{0}; - uint32_t m_not_alive_count{0}; - std::array m_last_publication_handle{0}; - -}; - - -/*! - * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class DeadlineMissedStatus_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeadlineMissedStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeadlineMissedStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s( - const DeadlineMissedStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s( - DeadlineMissedStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s& operator =( - const DeadlineMissedStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s& operator =( - DeadlineMissedStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeadlineMissedStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeadlineMissedStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - - - /*! - * @brief This function copies the value in member last_instance_handle - * @param _last_instance_handle New value to be copied in member last_instance_handle - */ - eProsima_user_DllExport void last_instance_handle( - const std::array& _last_instance_handle); - - /*! - * @brief This function moves the value in member last_instance_handle - * @param _last_instance_handle New value to be moved in member last_instance_handle - */ - eProsima_user_DllExport void last_instance_handle( - std::array&& _last_instance_handle); - - /*! - * @brief This function returns a constant reference to member last_instance_handle - * @return Constant reference to member last_instance_handle - */ - eProsima_user_DllExport const std::array& last_instance_handle() const; - - /*! - * @brief This function returns a reference to member last_instance_handle - * @return Reference to member last_instance_handle - */ - eProsima_user_DllExport std::array& last_instance_handle(); - -private: - - uint32_t m_total_count{0}; - std::array m_last_instance_handle{0}; - -}; -typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; - -typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; - -typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; - -/*! - * @brief This class represents the enumeration StatusKind defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -enum StatusKind : uint32_t -{ - PROXY, - CONNECTION_LIST, - INCOMPATIBLE_QOS, - INCONSISTENT_TOPIC, - LIVELINESS_LOST, - LIVELINESS_CHANGED, - DEADLINE_MISSED, - SAMPLE_LOST, - STATUSES_SIZE -}; - - -/*! - * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class MonitorServiceData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MonitorServiceData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MonitorServiceData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData( - const MonitorServiceData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData( - MonitorServiceData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData& operator =( - const MonitorServiceData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData& operator =( - MonitorServiceData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MonitorServiceData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MonitorServiceData& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::StatusKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& _d(); - - /*! - * @brief This function copies the value in member entity_proxy - * @param _entity_proxy New value to be copied in member entity_proxy - */ - eProsima_user_DllExport void entity_proxy( - const std::vector& _entity_proxy); - - /*! - * @brief This function moves the value in member entity_proxy - * @param _entity_proxy New value to be moved in member entity_proxy - */ - eProsima_user_DllExport void entity_proxy( - std::vector&& _entity_proxy); - - /*! - * @brief This function returns a constant reference to member entity_proxy - * @return Constant reference to member entity_proxy - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::vector& entity_proxy() const; - - /*! - * @brief This function returns a reference to member entity_proxy - * @return Reference to member entity_proxy - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::vector& entity_proxy(); - - - /*! - * @brief This function copies the value in member connection_list - * @param _connection_list New value to be copied in member connection_list - */ - eProsima_user_DllExport void connection_list( - const std::vector& _connection_list); - - /*! - * @brief This function moves the value in member connection_list - * @param _connection_list New value to be moved in member connection_list - */ - eProsima_user_DllExport void connection_list( - std::vector&& _connection_list); - - /*! - * @brief This function returns a constant reference to member connection_list - * @return Constant reference to member connection_list - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::vector& connection_list() const; - - /*! - * @brief This function returns a reference to member connection_list - * @return Reference to member connection_list - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::vector& connection_list(); - - - /*! - * @brief This function copies the value in member incompatible_qos_status - * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status - */ - eProsima_user_DllExport void incompatible_qos_status( - const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status); - - /*! - * @brief This function moves the value in member incompatible_qos_status - * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status - */ - eProsima_user_DllExport void incompatible_qos_status( - eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status); - - /*! - * @brief This function returns a constant reference to member incompatible_qos_status - * @return Constant reference to member incompatible_qos_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status() const; - - /*! - * @brief This function returns a reference to member incompatible_qos_status - * @return Reference to member incompatible_qos_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status(); - - - /*! - * @brief This function copies the value in member inconsistent_topic_status - * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status - */ - eProsima_user_DllExport void inconsistent_topic_status( - const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status); - - /*! - * @brief This function moves the value in member inconsistent_topic_status - * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status - */ - eProsima_user_DllExport void inconsistent_topic_status( - eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status); - - /*! - * @brief This function returns a constant reference to member inconsistent_topic_status - * @return Constant reference to member inconsistent_topic_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status() const; - - /*! - * @brief This function returns a reference to member inconsistent_topic_status - * @return Reference to member inconsistent_topic_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status(); - - - /*! - * @brief This function copies the value in member liveliness_lost_status - * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status - */ - eProsima_user_DllExport void liveliness_lost_status( - const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status); - - /*! - * @brief This function moves the value in member liveliness_lost_status - * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status - */ - eProsima_user_DllExport void liveliness_lost_status( - eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status); - - /*! - * @brief This function returns a constant reference to member liveliness_lost_status - * @return Constant reference to member liveliness_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status() const; - - /*! - * @brief This function returns a reference to member liveliness_lost_status - * @return Reference to member liveliness_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status(); - - - /*! - * @brief This function copies the value in member liveliness_changed_status - * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status - */ - eProsima_user_DllExport void liveliness_changed_status( - const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status); - - /*! - * @brief This function moves the value in member liveliness_changed_status - * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status - */ - eProsima_user_DllExport void liveliness_changed_status( - eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status); - - /*! - * @brief This function returns a constant reference to member liveliness_changed_status - * @return Constant reference to member liveliness_changed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status() const; - - /*! - * @brief This function returns a reference to member liveliness_changed_status - * @return Reference to member liveliness_changed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status(); - - - /*! - * @brief This function copies the value in member deadline_missed_status - * @param _deadline_missed_status New value to be copied in member deadline_missed_status - */ - eProsima_user_DllExport void deadline_missed_status( - const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status); - - /*! - * @brief This function moves the value in member deadline_missed_status - * @param _deadline_missed_status New value to be moved in member deadline_missed_status - */ - eProsima_user_DllExport void deadline_missed_status( - eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status); - - /*! - * @brief This function returns a constant reference to member deadline_missed_status - * @return Constant reference to member deadline_missed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status() const; - - /*! - * @brief This function returns a reference to member deadline_missed_status - * @return Reference to member deadline_missed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status(); - - - /*! - * @brief This function copies the value in member sample_lost_status - * @param _sample_lost_status New value to be copied in member sample_lost_status - */ - eProsima_user_DllExport void sample_lost_status( - const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status); - - /*! - * @brief This function moves the value in member sample_lost_status - * @param _sample_lost_status New value to be moved in member sample_lost_status - */ - eProsima_user_DllExport void sample_lost_status( - eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status); - - /*! - * @brief This function returns a constant reference to member sample_lost_status - * @return Constant reference to member sample_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status() const; - - /*! - * @brief This function returns a reference to member sample_lost_status - * @return Reference to member sample_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status(); - - - /*! - * @brief This function sets a value in member statuses_size - * @param _statuses_size New value for member statuses_size - */ - eProsima_user_DllExport void statuses_size( - uint8_t _statuses_size); - - /*! - * @brief This function returns the value of member statuses_size - * @return Value of member statuses_size - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t statuses_size() const; - - /*! - * @brief This function returns a reference to member statuses_size - * @return Reference to member statuses_size - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& statuses_size(); - -private: - - eprosima::fastdds::statistics::StatusKind m__d; - - std::vector m_entity_proxy; - std::vector m_connection_list; - eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status; - eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status; - eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status; - eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status; - eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status; - eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status; - uint8_t m_statuses_size{0}; -}; - - -/*! - * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. - * @ingroup monitorservice_types - */ -class MonitorServiceStatusData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MonitorServiceStatusData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MonitorServiceStatusData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData( - const MonitorServiceStatusData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData( - MonitorServiceStatusData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData& operator =( - const MonitorServiceStatusData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData& operator =( - MonitorServiceStatusData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MonitorServiceStatusData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MonitorServiceStatusData& x) const; - - /*! - * @brief This function copies the value in member local_entity - * @param _local_entity New value to be copied in member local_entity - */ - eProsima_user_DllExport void local_entity( - const eprosima::fastdds::statistics::detail::GUID_s& _local_entity); - - /*! - * @brief This function moves the value in member local_entity - * @param _local_entity New value to be moved in member local_entity - */ - eProsima_user_DllExport void local_entity( - eprosima::fastdds::statistics::detail::GUID_s&& _local_entity); - - /*! - * @brief This function returns a constant reference to member local_entity - * @return Constant reference to member local_entity - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_entity() const; - - /*! - * @brief This function returns a reference to member local_entity - * @return Reference to member local_entity - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_entity(); - - - /*! - * @brief This function sets a value in member status_kind - * @param _status_kind New value for member status_kind - */ - eProsima_user_DllExport void status_kind( - eprosima::fastdds::statistics::StatusKind _status_kind); - - /*! - * @brief This function returns the value of member status_kind - * @return Value of member status_kind - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind status_kind() const; - - /*! - * @brief This function returns a reference to member status_kind - * @return Reference to member status_kind - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& status_kind(); - - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const eprosima::fastdds::statistics::MonitorServiceData& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - eprosima::fastdds::statistics::MonitorServiceData&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::MonitorServiceData& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport eprosima::fastdds::statistics::MonitorServiceData& value(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_entity; - eprosima::fastdds::statistics::StatusKind m_status_kind{eprosima::fastdds::statistics::PROXY}; - eprosima::fastdds::statistics::MonitorServiceData m_value; - -}; - -} // namespace statistics - -} // namespace fastdds - -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/monitorservice_types.hpp b/src/cpp/statistics/types/monitorservice_types.hpp new file mode 100644 index 00000000000..71846357224 --- /dev/null +++ b/src/cpp/statistics/types/monitorservice_types.hpp @@ -0,0 +1,2506 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ + +#include +#include +#include +#include +#include + +#include + +#include "types.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(MONITORSERVICE_TYPES_SOURCE) +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) +#else +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) +#endif // MONITORSERVICE_TYPES_SOURCE +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +/*! + * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +enum class ConnectionMode : uint32_t +{ + DATA_SHARING, + INTRAPROCESS, + TRANSPORT +}; +/*! + * @brief This class represents the structure Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class Connection +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Connection() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Connection() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection( + const Connection& x) + { + m_mode = x.m_mode; + + m_guid = x.m_guid; + + m_announced_locators = x.m_announced_locators; + + m_used_locators = x.m_used_locators; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection( + Connection&& x) noexcept + { + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + const Connection& x) + { + + m_mode = x.m_mode; + + m_guid = x.m_guid; + + m_announced_locators = x.m_announced_locators; + + m_used_locators = x.m_used_locators; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + Connection&& x) noexcept + { + + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Connection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Connection& x) const + { + return (m_mode == x.m_mode && + m_guid == x.m_guid && + m_announced_locators == x.m_announced_locators && + m_used_locators == x.m_used_locators); + } + + /*! + * @brief Comparison operator. + * @param x Connection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Connection& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ + eProsima_user_DllExport void mode( + ConnectionMode _mode) + { + m_mode = _mode; + } + + /*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ + eProsima_user_DllExport ConnectionMode mode() const + { + return m_mode; + } + + /*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ + eProsima_user_DllExport ConnectionMode& mode() + { + return m_mode; + } + + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + const std::vector& _announced_locators) + { + m_announced_locators = _announced_locators; + } + + /*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + std::vector&& _announced_locators) + { + m_announced_locators = std::move(_announced_locators); + } + + /*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ + eProsima_user_DllExport const std::vector& announced_locators() const + { + return m_announced_locators; + } + + /*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ + eProsima_user_DllExport std::vector& announced_locators() + { + return m_announced_locators; + } + + + /*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ + eProsima_user_DllExport void used_locators( + const std::vector& _used_locators) + { + m_used_locators = _used_locators; + } + + /*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ + eProsima_user_DllExport void used_locators( + std::vector&& _used_locators) + { + m_used_locators = std::move(_used_locators); + } + + /*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ + eProsima_user_DllExport const std::vector& used_locators() const + { + return m_used_locators; + } + + /*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ + eProsima_user_DllExport std::vector& used_locators() + { + return m_used_locators; + } + + + +private: + + ConnectionMode m_mode{ConnectionMode::DATA_SHARING}; + detail::GUID_s m_guid; + std::vector m_announced_locators; + std::vector m_used_locators; + +}; +/*! + * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class QosPolicyCount_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport QosPolicyCount_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~QosPolicyCount_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + const QosPolicyCount_s& x) + { + m_policy_id = x.m_policy_id; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept + { + m_policy_id = x.m_policy_id; + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + const QosPolicyCount_s& x) + { + + m_policy_id = x.m_policy_id; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + QosPolicyCount_s&& x) noexcept + { + + m_policy_id = x.m_policy_id; + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const QosPolicyCount_s& x) const + { + return (m_policy_id == x.m_policy_id && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const QosPolicyCount_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ + eProsima_user_DllExport void policy_id( + uint32_t _policy_id) + { + m_policy_id = _policy_id; + } + + /*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ + eProsima_user_DllExport uint32_t policy_id() const + { + return m_policy_id; + } + + /*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ + eProsima_user_DllExport uint32_t& policy_id() + { + return m_policy_id; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint32_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count() + { + return m_count; + } + + + +private: + + uint32_t m_policy_id{0}; + uint32_t m_count{0}; + +}; +/*! + * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class BaseStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BaseStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BaseStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + const BaseStatus_s& x) + { + m_total_count = x.m_total_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + BaseStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + const BaseStatus_s& x) + { + + m_total_count = x.m_total_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + BaseStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BaseStatus_s& x) const + { + return (m_total_count == x.m_total_count); + } + + /*! + * @brief Comparison operator. + * @param x BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BaseStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + +private: + + uint32_t m_total_count{0}; + +}; +typedef std::vector QosPolicyCountSeq_s; + +/*! + * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class IncompatibleQoSStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~IncompatibleQoSStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x) + { + m_total_count = x.m_total_count; + + m_last_policy_id = x.m_last_policy_id; + + m_policies = x.m_policies; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + const IncompatibleQoSStatus_s& x) + { + + m_total_count = x.m_total_count; + + m_last_policy_id = x.m_last_policy_id; + + m_policies = x.m_policies; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + IncompatibleQoSStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const IncompatibleQoSStatus_s& x) const + { + return (m_total_count == x.m_total_count && + m_last_policy_id == x.m_last_policy_id && + m_policies == x.m_policies); + } + + /*! + * @brief Comparison operator. + * @param x IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const IncompatibleQoSStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + /*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ + eProsima_user_DllExport void last_policy_id( + uint32_t _last_policy_id) + { + m_last_policy_id = _last_policy_id; + } + + /*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ + eProsima_user_DllExport uint32_t last_policy_id() const + { + return m_last_policy_id; + } + + /*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ + eProsima_user_DllExport uint32_t& last_policy_id() + { + return m_last_policy_id; + } + + + /*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ + eProsima_user_DllExport void policies( + const QosPolicyCountSeq_s& _policies) + { + m_policies = _policies; + } + + /*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ + eProsima_user_DllExport void policies( + QosPolicyCountSeq_s&& _policies) + { + m_policies = std::move(_policies); + } + + /*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ + eProsima_user_DllExport const QosPolicyCountSeq_s& policies() const + { + return m_policies; + } + + /*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ + eProsima_user_DllExport QosPolicyCountSeq_s& policies() + { + return m_policies; + } + + + +private: + + uint32_t m_total_count{0}; + uint32_t m_last_policy_id{0}; + QosPolicyCountSeq_s m_policies; + +}; +/*! + * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class LivelinessChangedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LivelinessChangedStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LivelinessChangedStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x) + { + m_alive_count = x.m_alive_count; + + m_not_alive_count = x.m_not_alive_count; + + m_last_publication_handle = x.m_last_publication_handle; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept + { + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + const LivelinessChangedStatus_s& x) + { + + m_alive_count = x.m_alive_count; + + m_not_alive_count = x.m_not_alive_count; + + m_last_publication_handle = x.m_last_publication_handle; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + LivelinessChangedStatus_s&& x) noexcept + { + + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LivelinessChangedStatus_s& x) const + { + return (m_alive_count == x.m_alive_count && + m_not_alive_count == x.m_not_alive_count && + m_last_publication_handle == x.m_last_publication_handle); + } + + /*! + * @brief Comparison operator. + * @param x LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LivelinessChangedStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ + eProsima_user_DllExport void alive_count( + uint32_t _alive_count) + { + m_alive_count = _alive_count; + } + + /*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ + eProsima_user_DllExport uint32_t alive_count() const + { + return m_alive_count; + } + + /*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ + eProsima_user_DllExport uint32_t& alive_count() + { + return m_alive_count; + } + + + /*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ + eProsima_user_DllExport void not_alive_count( + uint32_t _not_alive_count) + { + m_not_alive_count = _not_alive_count; + } + + /*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ + eProsima_user_DllExport uint32_t not_alive_count() const + { + return m_not_alive_count; + } + + /*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ + eProsima_user_DllExport uint32_t& not_alive_count() + { + return m_not_alive_count; + } + + + /*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + const std::array& _last_publication_handle) + { + m_last_publication_handle = _last_publication_handle; + } + + /*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + std::array&& _last_publication_handle) + { + m_last_publication_handle = std::move(_last_publication_handle); + } + + /*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ + eProsima_user_DllExport const std::array& last_publication_handle() const + { + return m_last_publication_handle; + } + + /*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ + eProsima_user_DllExport std::array& last_publication_handle() + { + return m_last_publication_handle; + } + + + +private: + + uint32_t m_alive_count{0}; + uint32_t m_not_alive_count{0}; + std::array m_last_publication_handle{0}; + +}; +/*! + * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class DeadlineMissedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeadlineMissedStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeadlineMissedStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x) + { + m_total_count = x.m_total_count; + + m_last_instance_handle = x.m_last_instance_handle; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + const DeadlineMissedStatus_s& x) + { + + m_total_count = x.m_total_count; + + m_last_instance_handle = x.m_last_instance_handle; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + DeadlineMissedStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeadlineMissedStatus_s& x) const + { + return (m_total_count == x.m_total_count && + m_last_instance_handle == x.m_last_instance_handle); + } + + /*! + * @brief Comparison operator. + * @param x DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeadlineMissedStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + /*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + const std::array& _last_instance_handle) + { + m_last_instance_handle = _last_instance_handle; + } + + /*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + std::array&& _last_instance_handle) + { + m_last_instance_handle = std::move(_last_instance_handle); + } + + /*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ + eProsima_user_DllExport const std::array& last_instance_handle() const + { + return m_last_instance_handle; + } + + /*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ + eProsima_user_DllExport std::array& last_instance_handle() + { + return m_last_instance_handle; + } + + + +private: + + uint32_t m_total_count{0}; + std::array m_last_instance_handle{0}; + +}; +typedef BaseStatus_s LivelinessLostStatus_s; + +typedef BaseStatus_s InconsistentTopicStatus_s; + +typedef BaseStatus_s SampleLostStatus_s; + +namespace StatusKind { + +typedef uint32_t StatusKind; + +const StatusKind PROXY = 0; +const StatusKind CONNECTION_LIST = 1; +const StatusKind INCOMPATIBLE_QOS = 2; +const StatusKind INCONSISTENT_TOPIC = 3; +const StatusKind LIVELINESS_LOST = 4; +const StatusKind LIVELINESS_CHANGED = 5; +const StatusKind DEADLINE_MISSED = 6; +const StatusKind SAMPLE_LOST = 7; +const StatusKind STATUSES_SIZE = 8; + +} // namespace StatusKind +/*! + * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceData() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + const MonitorServiceData& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = x.m_entity_proxy; + break; + + case 0x00000002: + connection_list_() = x.m_connection_list; + break; + + case 0x00000003: + incompatible_qos_status_() = x.m_incompatible_qos_status; + break; + + case 0x00000004: + inconsistent_topic_status_() = x.m_inconsistent_topic_status; + break; + + case 0x00000005: + liveliness_lost_status_() = x.m_liveliness_lost_status; + break; + + case 0x00000006: + liveliness_changed_status_() = x.m_liveliness_changed_status; + break; + + case 0x00000007: + deadline_missed_status_() = x.m_deadline_missed_status; + break; + + case 0x00000008: + sample_lost_status_() = x.m_sample_lost_status; + break; + + case 0x00000009: + statuses_size_() = x.m_statuses_size; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + MonitorServiceData&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = std::move(x.m_entity_proxy); + break; + + case 0x00000002: + connection_list_() = std::move(x.m_connection_list); + break; + + case 0x00000003: + incompatible_qos_status_() = std::move(x.m_incompatible_qos_status); + break; + + case 0x00000004: + inconsistent_topic_status_() = std::move(x.m_inconsistent_topic_status); + break; + + case 0x00000005: + liveliness_lost_status_() = std::move(x.m_liveliness_lost_status); + break; + + case 0x00000006: + liveliness_changed_status_() = std::move(x.m_liveliness_changed_status); + break; + + case 0x00000007: + deadline_missed_status_() = std::move(x.m_deadline_missed_status); + break; + + case 0x00000008: + sample_lost_status_() = std::move(x.m_sample_lost_status); + break; + + case 0x00000009: + statuses_size_() = std::move(x.m_statuses_size); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + const MonitorServiceData& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = x.m_entity_proxy; + break; + + case 0x00000002: + connection_list_() = x.m_connection_list; + break; + + case 0x00000003: + incompatible_qos_status_() = x.m_incompatible_qos_status; + break; + + case 0x00000004: + inconsistent_topic_status_() = x.m_inconsistent_topic_status; + break; + + case 0x00000005: + liveliness_lost_status_() = x.m_liveliness_lost_status; + break; + + case 0x00000006: + liveliness_changed_status_() = x.m_liveliness_changed_status; + break; + + case 0x00000007: + deadline_missed_status_() = x.m_deadline_missed_status; + break; + + case 0x00000008: + sample_lost_status_() = x.m_sample_lost_status; + break; + + case 0x00000009: + statuses_size_() = x.m_statuses_size; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + MonitorServiceData&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = std::move(x.m_entity_proxy); + break; + + case 0x00000002: + connection_list_() = std::move(x.m_connection_list); + break; + + case 0x00000003: + incompatible_qos_status_() = std::move(x.m_incompatible_qos_status); + break; + + case 0x00000004: + inconsistent_topic_status_() = std::move(x.m_inconsistent_topic_status); + break; + + case 0x00000005: + liveliness_lost_status_() = std::move(x.m_liveliness_lost_status); + break; + + case 0x00000006: + liveliness_changed_status_() = std::move(x.m_liveliness_changed_status); + break; + + case 0x00000007: + deadline_missed_status_() = std::move(x.m_deadline_missed_status); + break; + + case 0x00000008: + sample_lost_status_() = std::move(x.m_sample_lost_status); + break; + + case 0x00000009: + statuses_size_() = std::move(x.m_statuses_size); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceData& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_entity_proxy == x.m_entity_proxy); + break; + + case 0x00000002: + ret_value = (m_connection_list == x.m_connection_list); + break; + + case 0x00000003: + ret_value = (m_incompatible_qos_status == x.m_incompatible_qos_status); + break; + + case 0x00000004: + ret_value = (m_inconsistent_topic_status == x.m_inconsistent_topic_status); + break; + + case 0x00000005: + ret_value = (m_liveliness_lost_status == x.m_liveliness_lost_status); + break; + + case 0x00000006: + ret_value = (m_liveliness_changed_status == x.m_liveliness_changed_status); + break; + + case 0x00000007: + ret_value = (m_deadline_missed_status == x.m_deadline_missed_status); + break; + + case 0x00000008: + ret_value = (m_sample_lost_status == x.m_sample_lost_status); + break; + + case 0x00000009: + ret_value = (m_statuses_size == x.m_statuses_size); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + StatusKind::StatusKind __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case StatusKind::PROXY: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::CONNECTION_LIST: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::INCOMPATIBLE_QOS: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::INCONSISTENT_TOPIC: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::LIVELINESS_LOST: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::LIVELINESS_CHANGED: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::DEADLINE_MISSED: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::SAMPLE_LOST: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::STATUSES_SIZE: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport StatusKind::StatusKind _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member entity_proxy + * @param _entity_proxy New value to be copied in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + const std::vector& _entity_proxy) + { + entity_proxy_() = _entity_proxy; + m__d = StatusKind::PROXY; + } + + /*! + * @brief This function moves the value in member entity_proxy + * @param _entity_proxy New value to be moved in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + std::vector&& _entity_proxy) + { + entity_proxy_() = _entity_proxy; + m__d = StatusKind::PROXY; + } + + /*! + * @brief This function returns a constant reference to member entity_proxy + * @return Constant reference to member entity_proxy + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& entity_proxy() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_proxy; + } + + /*! + * @brief This function returns a reference to member entity_proxy + * @return Reference to member entity_proxy + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& entity_proxy() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_proxy; + } + + + /*! + * @brief This function copies the value in member connection_list + * @param _connection_list New value to be copied in member connection_list + */ + eProsima_user_DllExport void connection_list( + const std::vector& _connection_list) + { + connection_list_() = _connection_list; + m__d = StatusKind::CONNECTION_LIST; + } + + /*! + * @brief This function moves the value in member connection_list + * @param _connection_list New value to be moved in member connection_list + */ + eProsima_user_DllExport void connection_list( + std::vector&& _connection_list) + { + connection_list_() = _connection_list; + m__d = StatusKind::CONNECTION_LIST; + } + + /*! + * @brief This function returns a constant reference to member connection_list + * @return Constant reference to member connection_list + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& connection_list() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_connection_list; + } + + /*! + * @brief This function returns a reference to member connection_list + * @return Reference to member connection_list + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& connection_list() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_connection_list; + } + + + /*! + * @brief This function copies the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + const IncompatibleQoSStatus_s& _incompatible_qos_status) + { + incompatible_qos_status_() = _incompatible_qos_status; + m__d = StatusKind::INCOMPATIBLE_QOS; + } + + /*! + * @brief This function moves the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + IncompatibleQoSStatus_s&& _incompatible_qos_status) + { + incompatible_qos_status_() = _incompatible_qos_status; + m__d = StatusKind::INCOMPATIBLE_QOS; + } + + /*! + * @brief This function returns a constant reference to member incompatible_qos_status + * @return Constant reference to member incompatible_qos_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const IncompatibleQoSStatus_s& incompatible_qos_status() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; + } + + /*! + * @brief This function returns a reference to member incompatible_qos_status + * @return Reference to member incompatible_qos_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& incompatible_qos_status() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; + } + + + /*! + * @brief This function copies the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + const InconsistentTopicStatus_s& _inconsistent_topic_status) + { + inconsistent_topic_status_() = _inconsistent_topic_status; + m__d = StatusKind::INCONSISTENT_TOPIC; + } + + /*! + * @brief This function moves the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + InconsistentTopicStatus_s&& _inconsistent_topic_status) + { + inconsistent_topic_status_() = _inconsistent_topic_status; + m__d = StatusKind::INCONSISTENT_TOPIC; + } + + /*! + * @brief This function returns a constant reference to member inconsistent_topic_status + * @return Constant reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const InconsistentTopicStatus_s& inconsistent_topic_status() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; + } + + /*! + * @brief This function returns a reference to member inconsistent_topic_status + * @return Reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport InconsistentTopicStatus_s& inconsistent_topic_status() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; + } + + + /*! + * @brief This function copies the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + const LivelinessLostStatus_s& _liveliness_lost_status) + { + liveliness_lost_status_() = _liveliness_lost_status; + m__d = StatusKind::LIVELINESS_LOST; + } + + /*! + * @brief This function moves the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + LivelinessLostStatus_s&& _liveliness_lost_status) + { + liveliness_lost_status_() = _liveliness_lost_status; + m__d = StatusKind::LIVELINESS_LOST; + } + + /*! + * @brief This function returns a constant reference to member liveliness_lost_status + * @return Constant reference to member liveliness_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const LivelinessLostStatus_s& liveliness_lost_status() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; + } + + /*! + * @brief This function returns a reference to member liveliness_lost_status + * @return Reference to member liveliness_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport LivelinessLostStatus_s& liveliness_lost_status() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; + } + + + /*! + * @brief This function copies the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + const LivelinessChangedStatus_s& _liveliness_changed_status) + { + liveliness_changed_status_() = _liveliness_changed_status; + m__d = StatusKind::LIVELINESS_CHANGED; + } + + /*! + * @brief This function moves the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + LivelinessChangedStatus_s&& _liveliness_changed_status) + { + liveliness_changed_status_() = _liveliness_changed_status; + m__d = StatusKind::LIVELINESS_CHANGED; + } + + /*! + * @brief This function returns a constant reference to member liveliness_changed_status + * @return Constant reference to member liveliness_changed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const LivelinessChangedStatus_s& liveliness_changed_status() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; + } + + /*! + * @brief This function returns a reference to member liveliness_changed_status + * @return Reference to member liveliness_changed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& liveliness_changed_status() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; + } + + + /*! + * @brief This function copies the value in member deadline_missed_status + * @param _deadline_missed_status New value to be copied in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + const DeadlineMissedStatus_s& _deadline_missed_status) + { + deadline_missed_status_() = _deadline_missed_status; + m__d = StatusKind::DEADLINE_MISSED; + } + + /*! + * @brief This function moves the value in member deadline_missed_status + * @param _deadline_missed_status New value to be moved in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + DeadlineMissedStatus_s&& _deadline_missed_status) + { + deadline_missed_status_() = _deadline_missed_status; + m__d = StatusKind::DEADLINE_MISSED; + } + + /*! + * @brief This function returns a constant reference to member deadline_missed_status + * @return Constant reference to member deadline_missed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const DeadlineMissedStatus_s& deadline_missed_status() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; + } + + /*! + * @brief This function returns a reference to member deadline_missed_status + * @return Reference to member deadline_missed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& deadline_missed_status() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; + } + + + /*! + * @brief This function copies the value in member sample_lost_status + * @param _sample_lost_status New value to be copied in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + const SampleLostStatus_s& _sample_lost_status) + { + sample_lost_status_() = _sample_lost_status; + m__d = StatusKind::SAMPLE_LOST; + } + + /*! + * @brief This function moves the value in member sample_lost_status + * @param _sample_lost_status New value to be moved in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + SampleLostStatus_s&& _sample_lost_status) + { + sample_lost_status_() = _sample_lost_status; + m__d = StatusKind::SAMPLE_LOST; + } + + /*! + * @brief This function returns a constant reference to member sample_lost_status + * @return Constant reference to member sample_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SampleLostStatus_s& sample_lost_status() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; + } + + /*! + * @brief This function returns a reference to member sample_lost_status + * @return Reference to member sample_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SampleLostStatus_s& sample_lost_status() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; + } + + + /*! + * @brief This function sets a value in member statuses_size + * @param _statuses_size New value for member statuses_size + */ + eProsima_user_DllExport void statuses_size( + uint8_t _statuses_size) + { + statuses_size_() = _statuses_size; + m__d = StatusKind::STATUSES_SIZE; + } + + /*! + * @brief This function returns the value of member statuses_size + * @return Value of member statuses_size + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t statuses_size() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_statuses_size; + } + + /*! + * @brief This function returns a reference to member statuses_size + * @return Reference to member statuses_size + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& statuses_size() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_statuses_size; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + std::vector& entity_proxy_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_entity_proxy.~vector();}; + new(&m_entity_proxy) std::vector(); + ; + } + + return m_entity_proxy; + } + + std::vector& connection_list_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_connection_list.~vector();}; + new(&m_connection_list) std::vector(); + ; + } + + return m_connection_list; + } + + IncompatibleQoSStatus_s& incompatible_qos_status_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_incompatible_qos_status.~IncompatibleQoSStatus_s();}; + new(&m_incompatible_qos_status) IncompatibleQoSStatus_s(); + ; + } + + return m_incompatible_qos_status; + } + + InconsistentTopicStatus_s& inconsistent_topic_status_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_inconsistent_topic_status.~InconsistentTopicStatus_s();}; + new(&m_inconsistent_topic_status) InconsistentTopicStatus_s(); + ; + } + + return m_inconsistent_topic_status; + } + + LivelinessLostStatus_s& liveliness_lost_status_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_liveliness_lost_status.~LivelinessLostStatus_s();}; + new(&m_liveliness_lost_status) LivelinessLostStatus_s(); + ; + } + + return m_liveliness_lost_status; + } + + LivelinessChangedStatus_s& liveliness_changed_status_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_liveliness_changed_status.~LivelinessChangedStatus_s();}; + new(&m_liveliness_changed_status) LivelinessChangedStatus_s(); + ; + } + + return m_liveliness_changed_status; + } + + DeadlineMissedStatus_s& deadline_missed_status_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_deadline_missed_status.~DeadlineMissedStatus_s();}; + new(&m_deadline_missed_status) DeadlineMissedStatus_s(); + ; + } + + return m_deadline_missed_status; + } + + SampleLostStatus_s& sample_lost_status_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_sample_lost_status.~SampleLostStatus_s();}; + new(&m_sample_lost_status) SampleLostStatus_s(); + ; + } + + return m_sample_lost_status; + } + + uint8_t& statuses_size_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = nullptr; + m_statuses_size = {0}; + ; + } + + return m_statuses_size; + } + + + StatusKind::StatusKind m__d {1}; + + union + { + std::vector m_entity_proxy; + std::vector m_connection_list; + IncompatibleQoSStatus_s m_incompatible_qos_status; + InconsistentTopicStatus_s m_inconsistent_topic_status; + LivelinessLostStatus_s m_liveliness_lost_status; + LivelinessChangedStatus_s m_liveliness_changed_status; + DeadlineMissedStatus_s m_deadline_missed_status; + SampleLostStatus_s m_sample_lost_status; + uint8_t m_statuses_size; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceStatusData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceStatusData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceStatusData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + const MonitorServiceStatusData& x) + { + m_local_entity = x.m_local_entity; + + m_status_kind = x.m_status_kind; + + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept + { + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + const MonitorServiceStatusData& x) + { + + m_local_entity = x.m_local_entity; + + m_status_kind = x.m_status_kind; + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + MonitorServiceStatusData&& x) noexcept + { + + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceStatusData& x) const + { + return (m_local_entity == x.m_local_entity && + m_status_kind == x.m_status_kind && + m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceStatusData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ + eProsima_user_DllExport void local_entity( + const detail::GUID_s& _local_entity) + { + m_local_entity = _local_entity; + } + + /*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ + eProsima_user_DllExport void local_entity( + detail::GUID_s&& _local_entity) + { + m_local_entity = std::move(_local_entity); + } + + /*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ + eProsima_user_DllExport const detail::GUID_s& local_entity() const + { + return m_local_entity; + } + + /*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ + eProsima_user_DllExport detail::GUID_s& local_entity() + { + return m_local_entity; + } + + + /*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ + eProsima_user_DllExport void status_kind( + StatusKind::StatusKind _status_kind) + { + m_status_kind = _status_kind; + } + + /*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ + eProsima_user_DllExport StatusKind::StatusKind status_kind() const + { + return m_status_kind; + } + + /*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ + eProsima_user_DllExport StatusKind::StatusKind& status_kind() + { + return m_status_kind; + } + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const MonitorServiceData& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + MonitorServiceData&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const MonitorServiceData& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport MonitorServiceData& value() + { + return m_value; + } + + + +private: + + detail::GUID_s m_local_entity; + StatusKind::StatusKind m_status_kind{0}; + MonitorServiceData m_value; + +}; + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ + + diff --git a/src/cpp/statistics/types/monitorservice_typesCdrAux.hpp b/src/cpp/statistics/types/monitorservice_typesCdrAux.hpp index f50dc36ec34..ee5fff198a7 100644 --- a/src/cpp/statistics/types/monitorservice_typesCdrAux.hpp +++ b/src/cpp/statistics/types/monitorservice_typesCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ -#include "monitorservice_types.h" +#include "monitorservice_types.hpp" constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize {8UL}; constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize {0UL}; @@ -37,24 +37,24 @@ constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_ty constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize {0UL}; + constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize {12UL}; constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize {0UL}; - -constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize {565252UL}; +constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize {72UL}; constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize {32UL}; -constexpr uint32_t eprosima_fastdds_statistics_Connection_max_cdr_typesize {5652UL}; +constexpr uint32_t eprosima_fastdds_statistics_Connection_max_cdr_typesize {52UL}; constexpr uint32_t eprosima_fastdds_statistics_Connection_max_key_cdr_typesize {0UL}; -constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize {1220UL}; +constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize {20UL}; constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize {0UL}; @@ -73,44 +73,27 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Connection& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::QosPolicyCount_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::BaseStatus_s& data); - - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data); @@ -120,22 +103,11 @@ eProsima_user_DllExport void serialize_key( - - - - - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::MonitorServiceStatusData& data); - - - } // namespace fastcdr } // namespace eprosima diff --git a/src/cpp/statistics/types/monitorservice_typesCdrAux.ipp b/src/cpp/statistics/types/monitorservice_typesCdrAux.ipp index 1a0877a6868..cf0924ab80b 100644 --- a/src/cpp/statistics/types/monitorservice_typesCdrAux.ipp +++ b/src/cpp/statistics/types/monitorservice_typesCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -146,8 +142,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -240,8 +234,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -327,11 +319,6 @@ void serialize_key( - - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -432,8 +419,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -534,8 +519,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -632,11 +615,6 @@ void serialize_key( - - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -659,47 +637,47 @@ eProsima_user_DllExport size_t calculate_serialized_size( switch (data._d()) { - case eprosima::fastdds::statistics::PROXY: + case StatusKind::PROXY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), data.entity_proxy(), current_alignment); break; - case eprosima::fastdds::statistics::CONNECTION_LIST: + case StatusKind::CONNECTION_LIST: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), data.connection_list(), current_alignment); break; - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + case StatusKind::INCOMPATIBLE_QOS: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), data.incompatible_qos_status(), current_alignment); break; - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + case StatusKind::INCONSISTENT_TOPIC: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), data.inconsistent_topic_status(), current_alignment); break; - case eprosima::fastdds::statistics::LIVELINESS_LOST: + case StatusKind::LIVELINESS_LOST: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), data.liveliness_lost_status(), current_alignment); break; - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + case StatusKind::LIVELINESS_CHANGED: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), data.liveliness_changed_status(), current_alignment); break; - case eprosima::fastdds::statistics::DEADLINE_MISSED: + case StatusKind::DEADLINE_MISSED: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), data.deadline_missed_status(), current_alignment); break; - case eprosima::fastdds::statistics::SAMPLE_LOST: + case StatusKind::SAMPLE_LOST: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), data.sample_lost_status(), current_alignment); break; - case eprosima::fastdds::statistics::STATUSES_SIZE: + case StatusKind::STATUSES_SIZE: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), data.statuses_size(), current_alignment); break; @@ -731,39 +709,39 @@ eProsima_user_DllExport void serialize( switch (data._d()) { - case eprosima::fastdds::statistics::PROXY: + case StatusKind::PROXY: scdr << eprosima::fastcdr::MemberId(1) << data.entity_proxy(); break; - case eprosima::fastdds::statistics::CONNECTION_LIST: + case StatusKind::CONNECTION_LIST: scdr << eprosima::fastcdr::MemberId(2) << data.connection_list(); break; - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: + case StatusKind::INCOMPATIBLE_QOS: scdr << eprosima::fastcdr::MemberId(3) << data.incompatible_qos_status(); break; - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: + case StatusKind::INCONSISTENT_TOPIC: scdr << eprosima::fastcdr::MemberId(4) << data.inconsistent_topic_status(); break; - case eprosima::fastdds::statistics::LIVELINESS_LOST: + case StatusKind::LIVELINESS_LOST: scdr << eprosima::fastcdr::MemberId(5) << data.liveliness_lost_status(); break; - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: + case StatusKind::LIVELINESS_CHANGED: scdr << eprosima::fastcdr::MemberId(6) << data.liveliness_changed_status(); break; - case eprosima::fastdds::statistics::DEADLINE_MISSED: + case StatusKind::DEADLINE_MISSED: scdr << eprosima::fastcdr::MemberId(7) << data.deadline_missed_status(); break; - case eprosima::fastdds::statistics::SAMPLE_LOST: + case StatusKind::SAMPLE_LOST: scdr << eprosima::fastcdr::MemberId(8) << data.sample_lost_status(); break; - case eprosima::fastdds::statistics::STATUSES_SIZE: + case StatusKind::STATUSES_SIZE: scdr << eprosima::fastcdr::MemberId(9) << data.statuses_size(); break; @@ -787,62 +765,139 @@ eProsima_user_DllExport void deserialize( [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { bool ret_value = true; - switch (mid.id) + if (0 == mid.id) { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case eprosima::fastdds::statistics::PROXY: - dcdr >> data.entity_proxy(); - break; - - case eprosima::fastdds::statistics::CONNECTION_LIST: - dcdr >> data.connection_list(); - break; - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - dcdr >> data.incompatible_qos_status(); - break; - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - dcdr >> data.inconsistent_topic_status(); - break; - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - dcdr >> data.liveliness_lost_status(); - break; - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - dcdr >> data.liveliness_changed_status(); - break; - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - dcdr >> data.deadline_missed_status(); - break; - - case eprosima::fastdds::statistics::SAMPLE_LOST: - dcdr >> data.sample_lost_status(); - break; - - case eprosima::fastdds::statistics::STATUSES_SIZE: - dcdr >> data.statuses_size(); - break; - - default: - break; - } - ret_value = false; - break; + eprosima::fastdds::statistics::StatusKind::StatusKind discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case StatusKind::PROXY: + { + std::vector entity_proxy_value; + data.entity_proxy(std::move(entity_proxy_value)); + data._d(discriminator); + break; + } + + case StatusKind::CONNECTION_LIST: + { + std::vector connection_list_value; + data.connection_list(std::move(connection_list_value)); + data._d(discriminator); + break; + } + + case StatusKind::INCOMPATIBLE_QOS: + { + eprosima::fastdds::statistics::IncompatibleQoSStatus_s incompatible_qos_status_value; + data.incompatible_qos_status(std::move(incompatible_qos_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::INCONSISTENT_TOPIC: + { + eprosima::fastdds::statistics::InconsistentTopicStatus_s inconsistent_topic_status_value; + data.inconsistent_topic_status(std::move(inconsistent_topic_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::LIVELINESS_LOST: + { + eprosima::fastdds::statistics::LivelinessLostStatus_s liveliness_lost_status_value; + data.liveliness_lost_status(std::move(liveliness_lost_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::LIVELINESS_CHANGED: + { + eprosima::fastdds::statistics::LivelinessChangedStatus_s liveliness_changed_status_value; + data.liveliness_changed_status(std::move(liveliness_changed_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::DEADLINE_MISSED: + { + eprosima::fastdds::statistics::DeadlineMissedStatus_s deadline_missed_status_value; + data.deadline_missed_status(std::move(deadline_missed_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::SAMPLE_LOST: + { + eprosima::fastdds::statistics::SampleLostStatus_s sample_lost_status_value; + data.sample_lost_status(std::move(sample_lost_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::STATUSES_SIZE: + { + uint8_t statuses_size_value{0}; + data.statuses_size(std::move(statuses_size_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case StatusKind::PROXY: + dcdr >> data.entity_proxy(); + break; + + case StatusKind::CONNECTION_LIST: + dcdr >> data.connection_list(); + break; + + case StatusKind::INCOMPATIBLE_QOS: + dcdr >> data.incompatible_qos_status(); + break; + + case StatusKind::INCONSISTENT_TOPIC: + dcdr >> data.inconsistent_topic_status(); + break; + + case StatusKind::LIVELINESS_LOST: + dcdr >> data.liveliness_lost_status(); + break; + + case StatusKind::LIVELINESS_CHANGED: + dcdr >> data.liveliness_changed_status(); + break; + + case StatusKind::DEADLINE_MISSED: + dcdr >> data.deadline_missed_status(); + break; + + case StatusKind::SAMPLE_LOST: + dcdr >> data.sample_lost_status(); + break; + + case StatusKind::STATUSES_SIZE: + dcdr >> data.statuses_size(); + break; + + default: + break; + } + ret_value = false; } return ret_value; }); } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -949,9 +1004,6 @@ void serialize_key( - - - } // namespace fastcdr } // namespace eprosima diff --git a/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx b/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx index f43bd3147b2..4fb6eeb1156 100644 --- a/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx +++ b/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx @@ -19,11 +19,13 @@ * This file was generated by the tool fastddsgen. */ +#include "monitorservice_typesPubSubTypes.h" +#include #include -#include "monitorservice_typesPubSubTypes.h" #include "monitorservice_typesCdrAux.hpp" +#include "monitorservice_typesTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -32,10 +34,6 @@ using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; namespace eprosima { namespace fastdds { namespace statistics { - - - - ConnectionPubSubType::ConnectionPubSubType() { setName("eprosima::fastdds::statistics::Connection"); @@ -224,7 +222,10 @@ namespace eprosima { return true; } - + void ConnectionPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } QosPolicyCount_sPubSubType::QosPolicyCount_sPubSubType() { @@ -414,7 +415,10 @@ namespace eprosima { return true; } - + void QosPolicyCount_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } BaseStatus_sPubSubType::BaseStatus_sPubSubType() { @@ -604,10 +608,10 @@ namespace eprosima { return true; } - - - - + void BaseStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } IncompatibleQoSStatus_sPubSubType::IncompatibleQoSStatus_sPubSubType() @@ -798,7 +802,10 @@ namespace eprosima { return true; } - + void IncompatibleQoSStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } LivelinessChangedStatus_sPubSubType::LivelinessChangedStatus_sPubSubType() { @@ -988,7 +995,10 @@ namespace eprosima { return true; } - + void LivelinessChangedStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } DeadlineMissedStatus_sPubSubType::DeadlineMissedStatus_sPubSubType() { @@ -1178,17 +1188,16 @@ namespace eprosima { return true; } + void DeadlineMissedStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } - - - - - - - + namespace StatusKind { + } // namespace StatusKind MonitorServiceStatusDataPubSubType::MonitorServiceStatusDataPubSubType() @@ -1379,12 +1388,17 @@ namespace eprosima { return true; } + void MonitorServiceStatusDataPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } - } //End of namespace statistics - + } // namespace statistics - } //End of namespace fastdds + } // namespace fastdds +} // namespace eprosima -} //End of namespace eprosima +// Include auxiliary functions like for serializing/deserializing. +#include "monitorservice_typesCdrAux.ipp" diff --git a/src/cpp/statistics/types/monitorservice_typesPubSubTypes.h b/src/cpp/statistics/types/monitorservice_typesPubSubTypes.h index c5b04255efd..cc0d28dffc7 100644 --- a/src/cpp/statistics/types/monitorservice_typesPubSubTypes.h +++ b/src/cpp/statistics/types/monitorservice_typesPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "monitorservice_types.h" +#include "monitorservice_types.hpp" #include "typesPubSubTypes.h" @@ -45,10 +45,6 @@ namespace eprosima namespace statistics { - - - - /*! * @brief This class represents the TopicDataType of the type Connection defined by the user in the IDL file. * @ingroup monitorservice_types @@ -99,6 +95,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -137,8 +136,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type QosPolicyCount_s defined by the user in the IDL file. * @ingroup monitorservice_types @@ -189,6 +186,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -227,8 +227,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type BaseStatus_s defined by the user in the IDL file. * @ingroup monitorservice_types @@ -279,6 +277,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -316,12 +317,8 @@ namespace eprosima unsigned char* m_keyBuffer; }; - - typedef std::vector QosPolicyCountSeq_s; - - /*! * @brief This class represents the TopicDataType of the type IncompatibleQoSStatus_s defined by the user in the IDL file. * @ingroup monitorservice_types @@ -372,6 +369,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -410,8 +410,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type LivelinessChangedStatus_s defined by the user in the IDL file. * @ingroup monitorservice_types @@ -462,6 +460,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -500,8 +501,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type DeadlineMissedStatus_s defined by the user in the IDL file. * @ingroup monitorservice_types @@ -552,6 +551,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -592,6 +594,10 @@ namespace eprosima typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; + namespace StatusKind + { + typedef uint32_t StatusKind; + @@ -600,6 +606,9 @@ namespace eprosima + } // namespace StatusKind + + /*! * @brief This class represents the TopicDataType of the type MonitorServiceStatusData defined by the user in the IDL file. * @ingroup monitorservice_types @@ -650,6 +659,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -687,9 +699,9 @@ namespace eprosima unsigned char* m_keyBuffer; }; - } - } -} + } // namespace statistics + } // namespace fastdds +} // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ diff --git a/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx b/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx new file mode 100644 index 00000000000..6d8d94198ce --- /dev/null +++ b/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx @@ -0,0 +1,12397 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "monitorservice_typesTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "monitorservice_types.hpp" + +#include "types.hpp" + +using namespace eprosima::fastdds::dds::xtypes; + +void register_monitorservice_types_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Data_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Connection_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier(); + + }); +} + +namespace eprosima { +namespace fastdds { +namespace statistics { +void register_eprosima_fastdds_statistics_Connection_type_identifier() +{ + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier() +{ + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +namespace StatusKind { +} // namespace StatusKind +void register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier() +{ + { + ReturnCode_t return_code_MonitorServiceData; + TypeIdentifierPair type_ids_MonitorServiceData; + UnionTypeFlag union_flags_MonitorServiceData = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_MonitorServiceData = "eprosima::fastdds::statistics::MonitorServiceData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceData; + eprosima::fastcdr::optional ann_custom_MonitorServiceData; + CompleteTypeDetail detail_MonitorServiceData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData, type_name_MonitorServiceData.to_string()); + CompleteUnionHeader header_MonitorServiceData = TypeObjectUtils::build_complete_union_header(detail_MonitorServiceData); + UnionDiscriminatorFlag member_flags_MonitorServiceData = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonDiscriminatorMember common_MonitorServiceData; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_MonitorServiceData.reset(); + ann_custom_MonitorServiceData.reset(); + CompleteDiscriminatorMember discriminator_MonitorServiceData = TypeObjectUtils::build_complete_discriminator_member(common_MonitorServiceData, + type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData); + CompleteUnionMemberSeq member_seq_MonitorServiceData; + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_entity_proxy = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_proxy; + TypeObjectUtils::add_union_case_label(label_seq_entity_proxy, static_cast(StatusKind::PROXY)); + CommonUnionMember common_entity_proxy; + MemberId member_id_entity_proxy = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier1(), + label_seq_entity_proxy); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier2(), + label_seq_entity_proxy); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_proxy member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_proxy = "entity_proxy"; + eprosima::fastcdr::optional member_ann_builtin_entity_proxy; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_entity_proxy = TypeObjectUtils::build_complete_member_detail(name_entity_proxy, member_ann_builtin_entity_proxy, ann_custom_MonitorServiceData); + CompleteUnionMember member_entity_proxy = TypeObjectUtils::build_complete_union_member(common_entity_proxy, detail_entity_proxy); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_entity_proxy); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_connection_list = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_connection_list; + TypeObjectUtils::add_union_case_label(label_seq_connection_list, static_cast(StatusKind::CONNECTION_LIST)); + CommonUnionMember common_connection_list; + MemberId member_id_connection_list = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier1(), + label_seq_connection_list); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier2(), + label_seq_connection_list); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union connection_list member TypeIdentifier inconsistent."); + return; + } + MemberName name_connection_list = "connection_list"; + eprosima::fastcdr::optional member_ann_builtin_connection_list; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_connection_list = TypeObjectUtils::build_complete_member_detail(name_connection_list, member_ann_builtin_connection_list, ann_custom_MonitorServiceData); + CompleteUnionMember member_connection_list = TypeObjectUtils::build_complete_union_member(common_connection_list, detail_connection_list); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_connection_list); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_incompatible_qos_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_incompatible_qos_status; + TypeObjectUtils::add_union_case_label(label_seq_incompatible_qos_status, static_cast(StatusKind::INCOMPATIBLE_QOS)); + CommonUnionMember common_incompatible_qos_status; + MemberId member_id_incompatible_qos_status = 0x00000003; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_incompatible_qos_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_incompatible_qos_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union incompatible_qos_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_incompatible_qos_status = "incompatible_qos_status"; + eprosima::fastcdr::optional member_ann_builtin_incompatible_qos_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_incompatible_qos_status = TypeObjectUtils::build_complete_member_detail(name_incompatible_qos_status, member_ann_builtin_incompatible_qos_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_incompatible_qos_status = TypeObjectUtils::build_complete_union_member(common_incompatible_qos_status, detail_incompatible_qos_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_incompatible_qos_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_InconsistentTopicStatus_s = 0; + QualifiedTypeName type_name_InconsistentTopicStatus_s = "eprosima::fastdds::statistics::InconsistentTopicStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_InconsistentTopicStatus_s; + eprosima::fastcdr::optional ann_custom_InconsistentTopicStatus_s; + CompleteTypeDetail detail_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string()); + CompleteAliasHeader header_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_header(detail_InconsistentTopicStatus_s); + AliasMemberFlag related_flags_InconsistentTopicStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_InconsistentTopicStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_InconsistentTopicStatus_s; + ann_custom_InconsistentTopicStatus_s.reset(); + CompleteAliasBody body_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_body(common_InconsistentTopicStatus_s, member_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s); + CompleteAliasType alias_type_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_InconsistentTopicStatus_s, header_InconsistentTopicStatus_s, body_InconsistentTopicStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_inconsistent_topic_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_inconsistent_topic_status; + TypeObjectUtils::add_union_case_label(label_seq_inconsistent_topic_status, static_cast(StatusKind::INCONSISTENT_TOPIC)); + CommonUnionMember common_inconsistent_topic_status; + MemberId member_id_inconsistent_topic_status = 0x00000004; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_inconsistent_topic_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_inconsistent_topic_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union inconsistent_topic_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_inconsistent_topic_status = "inconsistent_topic_status"; + eprosima::fastcdr::optional member_ann_builtin_inconsistent_topic_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_inconsistent_topic_status = TypeObjectUtils::build_complete_member_detail(name_inconsistent_topic_status, member_ann_builtin_inconsistent_topic_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_inconsistent_topic_status = TypeObjectUtils::build_complete_union_member(common_inconsistent_topic_status, detail_inconsistent_topic_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_inconsistent_topic_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_LivelinessLostStatus_s = 0; + QualifiedTypeName type_name_LivelinessLostStatus_s = "eprosima::fastdds::statistics::LivelinessLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessLostStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessLostStatus_s; + CompleteTypeDetail detail_LivelinessLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string()); + CompleteAliasHeader header_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_LivelinessLostStatus_s); + AliasMemberFlag related_flags_LivelinessLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_LivelinessLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_LivelinessLostStatus_s; + ann_custom_LivelinessLostStatus_s.reset(); + CompleteAliasBody body_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_LivelinessLostStatus_s, member_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s); + CompleteAliasType alias_type_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_LivelinessLostStatus_s, header_LivelinessLostStatus_s, body_LivelinessLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_liveliness_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_lost_status, static_cast(StatusKind::LIVELINESS_LOST)); + CommonUnionMember common_liveliness_lost_status; + MemberId member_id_liveliness_lost_status = 0x00000005; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_lost_status = "liveliness_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_lost_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_lost_status, member_ann_builtin_liveliness_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_lost_status = TypeObjectUtils::build_complete_union_member(common_liveliness_lost_status, detail_liveliness_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_liveliness_changed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_changed_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_changed_status, static_cast(StatusKind::LIVELINESS_CHANGED)); + CommonUnionMember common_liveliness_changed_status; + MemberId member_id_liveliness_changed_status = 0x00000006; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_changed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_changed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_changed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_changed_status = "liveliness_changed_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_changed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_changed_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_changed_status, member_ann_builtin_liveliness_changed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_changed_status = TypeObjectUtils::build_complete_union_member(common_liveliness_changed_status, detail_liveliness_changed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_changed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_deadline_missed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_deadline_missed_status; + TypeObjectUtils::add_union_case_label(label_seq_deadline_missed_status, static_cast(StatusKind::DEADLINE_MISSED)); + CommonUnionMember common_deadline_missed_status; + MemberId member_id_deadline_missed_status = 0x00000007; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_deadline_missed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_deadline_missed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union deadline_missed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadline_missed_status = "deadline_missed_status"; + eprosima::fastcdr::optional member_ann_builtin_deadline_missed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_deadline_missed_status = TypeObjectUtils::build_complete_member_detail(name_deadline_missed_status, member_ann_builtin_deadline_missed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_deadline_missed_status = TypeObjectUtils::build_complete_union_member(common_deadline_missed_status, detail_deadline_missed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_deadline_missed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_SampleLostStatus_s = 0; + QualifiedTypeName type_name_SampleLostStatus_s = "eprosima::fastdds::statistics::SampleLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleLostStatus_s; + eprosima::fastcdr::optional ann_custom_SampleLostStatus_s; + CompleteTypeDetail detail_SampleLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string()); + CompleteAliasHeader header_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_SampleLostStatus_s); + AliasMemberFlag related_flags_SampleLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_SampleLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_SampleLostStatus_s; + ann_custom_SampleLostStatus_s.reset(); + CompleteAliasBody body_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_SampleLostStatus_s, member_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s); + CompleteAliasType alias_type_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_SampleLostStatus_s, header_SampleLostStatus_s, body_SampleLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_sample_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_sample_lost_status, static_cast(StatusKind::SAMPLE_LOST)); + CommonUnionMember common_sample_lost_status; + MemberId member_id_sample_lost_status = 0x00000008; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_sample_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_sample_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_lost_status = "sample_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_sample_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_sample_lost_status = TypeObjectUtils::build_complete_member_detail(name_sample_lost_status, member_ann_builtin_sample_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_sample_lost_status = TypeObjectUtils::build_complete_union_member(common_sample_lost_status, detail_sample_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_sample_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "statuses_size Union member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + UnionMemberFlag member_flags_statuses_size = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_statuses_size; + TypeObjectUtils::add_union_case_label(label_seq_statuses_size, static_cast(StatusKind::STATUSES_SIZE)); + CommonUnionMember common_statuses_size; + MemberId member_id_statuses_size = 0x00000009; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier1(), + label_seq_statuses_size); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier2(), + label_seq_statuses_size); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union statuses_size member TypeIdentifier inconsistent."); + return; + } + MemberName name_statuses_size = "statuses_size"; + eprosima::fastcdr::optional member_ann_builtin_statuses_size; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_statuses_size = TypeObjectUtils::build_complete_member_detail(name_statuses_size, member_ann_builtin_statuses_size, ann_custom_MonitorServiceData); + CompleteUnionMember member_statuses_size = TypeObjectUtils::build_complete_union_member(common_statuses_size, detail_statuses_size); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_statuses_size); + } + CompleteUnionType union_type_MonitorServiceData = TypeObjectUtils::build_complete_union_type(union_flags_MonitorServiceData, header_MonitorServiceData, discriminator_MonitorServiceData, + member_seq_MonitorServiceData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_MonitorServiceData, type_name_MonitorServiceData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier() +{ + { + StructTypeFlag struct_flags_MonitorServiceStatusData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_MonitorServiceStatusData; + TypeIdentifierPair type_ids_MonitorServiceStatusData; + QualifiedTypeName type_name_MonitorServiceStatusData = "eprosima::fastdds::statistics::MonitorServiceStatusData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceStatusData; + eprosima::fastcdr::optional ann_custom_MonitorServiceStatusData; + CompleteTypeDetail detail_MonitorServiceStatusData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceStatusData, ann_custom_MonitorServiceStatusData, type_name_MonitorServiceStatusData.to_string()); + CompleteStructHeader header_MonitorServiceStatusData; + header_MonitorServiceStatusData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MonitorServiceStatusData); + CompleteStructMemberSeq member_seq_MonitorServiceStatusData; + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_entity = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_entity; + MemberId member_id_local_entity = 0x00000000; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_entity = TypeObjectUtils::build_common_struct_member(member_id_local_entity, member_flags_local_entity, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_entity = TypeObjectUtils::build_common_struct_member(member_id_local_entity, member_flags_local_entity, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_entity member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_entity = "local_entity"; + eprosima::fastcdr::optional member_ann_builtin_local_entity; + ann_custom_MonitorServiceStatusData.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_entity; + eprosima::fastcdr::optional unit_local_entity; + eprosima::fastcdr::optional min_local_entity; + eprosima::fastcdr::optional max_local_entity; + eprosima::fastcdr::optional hash_id_local_entity; + if (unit_local_entity.has_value() || min_local_entity.has_value() || max_local_entity.has_value() || hash_id_local_entity.has_value()) + { + member_ann_builtin_local_entity = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_entity, min_local_entity, max_local_entity, hash_id_local_entity); + } + if (!tmp_ann_custom_local_entity.empty()) + { + ann_custom_MonitorServiceStatusData = tmp_ann_custom_local_entity; + } + CompleteMemberDetail detail_local_entity = TypeObjectUtils::build_complete_member_detail(name_local_entity, member_ann_builtin_local_entity, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_local_entity = TypeObjectUtils::build_complete_struct_member(common_local_entity, detail_local_entity); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_local_entity); + } + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceStatusData); + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_status_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_status_kind; + MemberId member_id_status_kind = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_status_kind = TypeObjectUtils::build_common_struct_member(member_id_status_kind, member_flags_status_kind, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_status_kind = TypeObjectUtils::build_common_struct_member(member_id_status_kind, member_flags_status_kind, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure status_kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_status_kind = "status_kind"; + eprosima::fastcdr::optional member_ann_builtin_status_kind; + ann_custom_MonitorServiceStatusData.reset(); + AppliedAnnotationSeq tmp_ann_custom_status_kind; + eprosima::fastcdr::optional unit_status_kind; + eprosima::fastcdr::optional min_status_kind; + eprosima::fastcdr::optional max_status_kind; + eprosima::fastcdr::optional hash_id_status_kind; + if (unit_status_kind.has_value() || min_status_kind.has_value() || max_status_kind.has_value() || hash_id_status_kind.has_value()) + { + member_ann_builtin_status_kind = TypeObjectUtils::build_applied_builtin_member_annotations(unit_status_kind, min_status_kind, max_status_kind, hash_id_status_kind); + } + if (!tmp_ann_custom_status_kind.empty()) + { + ann_custom_MonitorServiceStatusData = tmp_ann_custom_status_kind; + } + CompleteMemberDetail detail_status_kind = TypeObjectUtils::build_complete_member_detail(name_status_kind, member_ann_builtin_status_kind, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_status_kind = TypeObjectUtils::build_complete_struct_member(common_status_kind, detail_status_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_status_kind); + } + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + { + ReturnCode_t return_code_MonitorServiceData; + TypeIdentifierPair type_ids_MonitorServiceData; + UnionTypeFlag union_flags_MonitorServiceData = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_MonitorServiceData = "eprosima::fastdds::statistics::MonitorServiceData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceData; + eprosima::fastcdr::optional ann_custom_MonitorServiceData; + CompleteTypeDetail detail_MonitorServiceData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData, type_name_MonitorServiceData.to_string()); + CompleteUnionHeader header_MonitorServiceData = TypeObjectUtils::build_complete_union_header(detail_MonitorServiceData); + UnionDiscriminatorFlag member_flags_MonitorServiceData = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonDiscriminatorMember common_MonitorServiceData; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_MonitorServiceData.reset(); + ann_custom_MonitorServiceData.reset(); + CompleteDiscriminatorMember discriminator_MonitorServiceData = TypeObjectUtils::build_complete_discriminator_member(common_MonitorServiceData, + type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData); + CompleteUnionMemberSeq member_seq_MonitorServiceData; + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_entity_proxy = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_proxy; + TypeObjectUtils::add_union_case_label(label_seq_entity_proxy, static_cast(StatusKind::PROXY)); + CommonUnionMember common_entity_proxy; + MemberId member_id_entity_proxy = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier1(), + label_seq_entity_proxy); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier2(), + label_seq_entity_proxy); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_proxy member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_proxy = "entity_proxy"; + eprosima::fastcdr::optional member_ann_builtin_entity_proxy; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_entity_proxy = TypeObjectUtils::build_complete_member_detail(name_entity_proxy, member_ann_builtin_entity_proxy, ann_custom_MonitorServiceData); + CompleteUnionMember member_entity_proxy = TypeObjectUtils::build_complete_union_member(common_entity_proxy, detail_entity_proxy); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_entity_proxy); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_connection_list = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_connection_list; + TypeObjectUtils::add_union_case_label(label_seq_connection_list, static_cast(StatusKind::CONNECTION_LIST)); + CommonUnionMember common_connection_list; + MemberId member_id_connection_list = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier1(), + label_seq_connection_list); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier2(), + label_seq_connection_list); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union connection_list member TypeIdentifier inconsistent."); + return; + } + MemberName name_connection_list = "connection_list"; + eprosima::fastcdr::optional member_ann_builtin_connection_list; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_connection_list = TypeObjectUtils::build_complete_member_detail(name_connection_list, member_ann_builtin_connection_list, ann_custom_MonitorServiceData); + CompleteUnionMember member_connection_list = TypeObjectUtils::build_complete_union_member(common_connection_list, detail_connection_list); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_connection_list); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_incompatible_qos_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_incompatible_qos_status; + TypeObjectUtils::add_union_case_label(label_seq_incompatible_qos_status, static_cast(StatusKind::INCOMPATIBLE_QOS)); + CommonUnionMember common_incompatible_qos_status; + MemberId member_id_incompatible_qos_status = 0x00000003; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_incompatible_qos_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_incompatible_qos_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union incompatible_qos_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_incompatible_qos_status = "incompatible_qos_status"; + eprosima::fastcdr::optional member_ann_builtin_incompatible_qos_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_incompatible_qos_status = TypeObjectUtils::build_complete_member_detail(name_incompatible_qos_status, member_ann_builtin_incompatible_qos_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_incompatible_qos_status = TypeObjectUtils::build_complete_union_member(common_incompatible_qos_status, detail_incompatible_qos_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_incompatible_qos_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_InconsistentTopicStatus_s = 0; + QualifiedTypeName type_name_InconsistentTopicStatus_s = "eprosima::fastdds::statistics::InconsistentTopicStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_InconsistentTopicStatus_s; + eprosima::fastcdr::optional ann_custom_InconsistentTopicStatus_s; + CompleteTypeDetail detail_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string()); + CompleteAliasHeader header_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_header(detail_InconsistentTopicStatus_s); + AliasMemberFlag related_flags_InconsistentTopicStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_InconsistentTopicStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_InconsistentTopicStatus_s; + ann_custom_InconsistentTopicStatus_s.reset(); + CompleteAliasBody body_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_body(common_InconsistentTopicStatus_s, member_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s); + CompleteAliasType alias_type_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_InconsistentTopicStatus_s, header_InconsistentTopicStatus_s, body_InconsistentTopicStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_inconsistent_topic_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_inconsistent_topic_status; + TypeObjectUtils::add_union_case_label(label_seq_inconsistent_topic_status, static_cast(StatusKind::INCONSISTENT_TOPIC)); + CommonUnionMember common_inconsistent_topic_status; + MemberId member_id_inconsistent_topic_status = 0x00000004; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_inconsistent_topic_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_inconsistent_topic_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union inconsistent_topic_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_inconsistent_topic_status = "inconsistent_topic_status"; + eprosima::fastcdr::optional member_ann_builtin_inconsistent_topic_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_inconsistent_topic_status = TypeObjectUtils::build_complete_member_detail(name_inconsistent_topic_status, member_ann_builtin_inconsistent_topic_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_inconsistent_topic_status = TypeObjectUtils::build_complete_union_member(common_inconsistent_topic_status, detail_inconsistent_topic_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_inconsistent_topic_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_LivelinessLostStatus_s = 0; + QualifiedTypeName type_name_LivelinessLostStatus_s = "eprosima::fastdds::statistics::LivelinessLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessLostStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessLostStatus_s; + CompleteTypeDetail detail_LivelinessLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string()); + CompleteAliasHeader header_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_LivelinessLostStatus_s); + AliasMemberFlag related_flags_LivelinessLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_LivelinessLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_LivelinessLostStatus_s; + ann_custom_LivelinessLostStatus_s.reset(); + CompleteAliasBody body_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_LivelinessLostStatus_s, member_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s); + CompleteAliasType alias_type_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_LivelinessLostStatus_s, header_LivelinessLostStatus_s, body_LivelinessLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_liveliness_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_lost_status, static_cast(StatusKind::LIVELINESS_LOST)); + CommonUnionMember common_liveliness_lost_status; + MemberId member_id_liveliness_lost_status = 0x00000005; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_lost_status = "liveliness_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_lost_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_lost_status, member_ann_builtin_liveliness_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_lost_status = TypeObjectUtils::build_complete_union_member(common_liveliness_lost_status, detail_liveliness_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_liveliness_changed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_changed_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_changed_status, static_cast(StatusKind::LIVELINESS_CHANGED)); + CommonUnionMember common_liveliness_changed_status; + MemberId member_id_liveliness_changed_status = 0x00000006; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_changed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_changed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_changed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_changed_status = "liveliness_changed_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_changed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_changed_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_changed_status, member_ann_builtin_liveliness_changed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_changed_status = TypeObjectUtils::build_complete_union_member(common_liveliness_changed_status, detail_liveliness_changed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_changed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_deadline_missed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_deadline_missed_status; + TypeObjectUtils::add_union_case_label(label_seq_deadline_missed_status, static_cast(StatusKind::DEADLINE_MISSED)); + CommonUnionMember common_deadline_missed_status; + MemberId member_id_deadline_missed_status = 0x00000007; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_deadline_missed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_deadline_missed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union deadline_missed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadline_missed_status = "deadline_missed_status"; + eprosima::fastcdr::optional member_ann_builtin_deadline_missed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_deadline_missed_status = TypeObjectUtils::build_complete_member_detail(name_deadline_missed_status, member_ann_builtin_deadline_missed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_deadline_missed_status = TypeObjectUtils::build_complete_union_member(common_deadline_missed_status, detail_deadline_missed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_deadline_missed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_SampleLostStatus_s = 0; + QualifiedTypeName type_name_SampleLostStatus_s = "eprosima::fastdds::statistics::SampleLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleLostStatus_s; + eprosima::fastcdr::optional ann_custom_SampleLostStatus_s; + CompleteTypeDetail detail_SampleLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string()); + CompleteAliasHeader header_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_SampleLostStatus_s); + AliasMemberFlag related_flags_SampleLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_SampleLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_SampleLostStatus_s; + ann_custom_SampleLostStatus_s.reset(); + CompleteAliasBody body_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_SampleLostStatus_s, member_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s); + CompleteAliasType alias_type_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_SampleLostStatus_s, header_SampleLostStatus_s, body_SampleLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_sample_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_sample_lost_status, static_cast(StatusKind::SAMPLE_LOST)); + CommonUnionMember common_sample_lost_status; + MemberId member_id_sample_lost_status = 0x00000008; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_sample_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_sample_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_lost_status = "sample_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_sample_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_sample_lost_status = TypeObjectUtils::build_complete_member_detail(name_sample_lost_status, member_ann_builtin_sample_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_sample_lost_status = TypeObjectUtils::build_complete_union_member(common_sample_lost_status, detail_sample_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_sample_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "statuses_size Union member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + UnionMemberFlag member_flags_statuses_size = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_statuses_size; + TypeObjectUtils::add_union_case_label(label_seq_statuses_size, static_cast(StatusKind::STATUSES_SIZE)); + CommonUnionMember common_statuses_size; + MemberId member_id_statuses_size = 0x00000009; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier1(), + label_seq_statuses_size); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier2(), + label_seq_statuses_size); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union statuses_size member TypeIdentifier inconsistent."); + return; + } + MemberName name_statuses_size = "statuses_size"; + eprosima::fastcdr::optional member_ann_builtin_statuses_size; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_statuses_size = TypeObjectUtils::build_complete_member_detail(name_statuses_size, member_ann_builtin_statuses_size, ann_custom_MonitorServiceData); + CompleteUnionMember member_statuses_size = TypeObjectUtils::build_complete_union_member(common_statuses_size, detail_statuses_size); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_statuses_size); + } + CompleteUnionType union_type_MonitorServiceData = TypeObjectUtils::build_complete_union_type(union_flags_MonitorServiceData, header_MonitorServiceData, discriminator_MonitorServiceData, + member_seq_MonitorServiceData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_MonitorServiceData, type_name_MonitorServiceData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_MonitorServiceStatusData.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_value); + } + CompleteStructType struct_type_MonitorServiceStatusData = TypeObjectUtils::build_complete_struct_type(struct_flags_MonitorServiceStatusData, header_MonitorServiceStatusData, member_seq_MonitorServiceStatusData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_MonitorServiceStatusData, type_name_MonitorServiceStatusData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceStatusData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceStatusData", type_ids_MonitorServiceStatusData); + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceStatusData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + diff --git a/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.hpp b/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.hpp new file mode 100644 index 00000000000..7aa680576f0 --- /dev/null +++ b/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.hpp @@ -0,0 +1,127 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ + +#include "typesTypeObjectSupport.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_monitorservice_types_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace eprosima { +namespace fastdds { +namespace statistics { +/** + * @brief Register eprosima_fastdds_statistics_Connection related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Connection_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_QosPolicyCount_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_BaseStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier(); + + +/** + * @brief Register eprosima_fastdds_statistics_IncompatibleQoSStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_LivelinessChangedStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_DeadlineMissedStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier(); + + + + +namespace StatusKind { +} // namespace StatusKind + +/** + * @brief Register eprosima_fastdds_statistics_MonitorServiceData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_MonitorServiceStatusData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier(); + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/src/cpp/statistics/types/monitorservice_typesv1.cxx b/src/cpp/statistics/types/monitorservice_typesv1.cxx deleted file mode 100644 index 89494b4018c..00000000000 --- a/src/cpp/statistics/types/monitorservice_typesv1.cxx +++ /dev/null @@ -1,3011 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file monitorservice_types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "monitorservice_types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; - -#define eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize 8ULL; - - -#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; - - - -#define eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize 24ULL; -#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; -#define eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize 12ULL; -#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; - -#define eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize 565252ULL; -#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; -#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; -#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; -#define eprosima_fastdds_statistics_Connection_max_cdr_typesize 5652ULL; -#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; -#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; -#define eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize 1220ULL; - - -#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; -#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; -#define eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize 28ULL; - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - - - - - -Connection::Connection() -{ - // eprosima::fastdds::statistics::ConnectionMode m_mode - m_mode = eprosima::fastdds::statistics::DATA_SHARING; - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // sequence m_announced_locators - - // sequence m_used_locators - - -} - -Connection::~Connection() -{ -} - -Connection::Connection( - const Connection& x) -{ - m_mode = x.m_mode; - - - m_guid = x.m_guid; - - - m_announced_locators = x.m_announced_locators; - - - m_used_locators = x.m_used_locators; - -} - -Connection::Connection( - Connection&& x) noexcept -{ - m_mode = x.m_mode; - - - m_guid = std::move(x.m_guid); - - - m_announced_locators = std::move(x.m_announced_locators); - - - m_used_locators = std::move(x.m_used_locators); - -} - -Connection& Connection::operator =( - const Connection& x) -{ - m_mode = x.m_mode; - - - m_guid = x.m_guid; - - - m_announced_locators = x.m_announced_locators; - - - m_used_locators = x.m_used_locators; - - return *this; -} - -Connection& Connection::operator =( - Connection&& x) noexcept -{ - m_mode = x.m_mode; - - - m_guid = std::move(x.m_guid); - - - m_announced_locators = std::move(x.m_announced_locators); - - - m_used_locators = std::move(x.m_used_locators); - - return *this; -} - -bool Connection::operator ==( - const Connection& x) const -{ - return (m_mode == x.m_mode && - m_guid == x.m_guid && - m_announced_locators == x.m_announced_locators && - m_used_locators == x.m_used_locators); -} - -bool Connection::operator !=( - const Connection& x) const -{ - return !(*this == x); -} - -size_t Connection::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Connection_max_cdr_typesize; -} - -size_t Connection::getCdrSerializedSize( - const Connection& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.announced_locators().size(); ++a) - { - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.announced_locators().at(a), current_alignment); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.used_locators().size(); ++a) - { - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.used_locators().at(a), current_alignment); - } - - - - return current_alignment - initial_alignment; -} - - -void Connection::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_mode; - - scdr << m_guid; - - scdr << m_announced_locators; - - - scdr << m_used_locators; - - -} - -void Connection::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_mode = (eprosima::fastdds::statistics::ConnectionMode)enum_value; - } - - - - dcdr >> m_guid; - - - - dcdr >> m_announced_locators; - - - - dcdr >> m_used_locators; - - -} - - -bool Connection::isKeyDefined() -{ - return false; -} - -void Connection::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ -void Connection::mode( - eprosima::fastdds::statistics::ConnectionMode _mode) -{ - m_mode = _mode; -} - -/*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ -eprosima::fastdds::statistics::ConnectionMode Connection::mode() const -{ - return m_mode; -} - -/*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ -eprosima::fastdds::statistics::ConnectionMode& Connection::mode() -{ - return m_mode; -} - - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void Connection::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void Connection::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Connection::guid() -{ - return m_guid; -} - - -/*! - * @brief This function copies the value in member announced_locators - * @param _announced_locators New value to be copied in member announced_locators - */ -void Connection::announced_locators( - const std::vector& _announced_locators) -{ - m_announced_locators = _announced_locators; -} - -/*! - * @brief This function moves the value in member announced_locators - * @param _announced_locators New value to be moved in member announced_locators - */ -void Connection::announced_locators( - std::vector&& _announced_locators) -{ - m_announced_locators = std::move(_announced_locators); -} - -/*! - * @brief This function returns a constant reference to member announced_locators - * @return Constant reference to member announced_locators - */ -const std::vector& Connection::announced_locators() const -{ - return m_announced_locators; -} - -/*! - * @brief This function returns a reference to member announced_locators - * @return Reference to member announced_locators - */ -std::vector& Connection::announced_locators() -{ - return m_announced_locators; -} - - -/*! - * @brief This function copies the value in member used_locators - * @param _used_locators New value to be copied in member used_locators - */ -void Connection::used_locators( - const std::vector& _used_locators) -{ - m_used_locators = _used_locators; -} - -/*! - * @brief This function moves the value in member used_locators - * @param _used_locators New value to be moved in member used_locators - */ -void Connection::used_locators( - std::vector&& _used_locators) -{ - m_used_locators = std::move(_used_locators); -} - -/*! - * @brief This function returns a constant reference to member used_locators - * @return Constant reference to member used_locators - */ -const std::vector& Connection::used_locators() const -{ - return m_used_locators; -} - -/*! - * @brief This function returns a reference to member used_locators - * @return Reference to member used_locators - */ -std::vector& Connection::used_locators() -{ - return m_used_locators; -} - - - - - -QosPolicyCount_s::QosPolicyCount_s() -{ - // unsigned long m_policy_id - m_policy_id = 0; - // unsigned long m_count - m_count = 0; - -} - -QosPolicyCount_s::~QosPolicyCount_s() -{ -} - -QosPolicyCount_s::QosPolicyCount_s( - const QosPolicyCount_s& x) -{ - m_policy_id = x.m_policy_id; - - - m_count = x.m_count; - -} - -QosPolicyCount_s::QosPolicyCount_s( - QosPolicyCount_s&& x) noexcept -{ - m_policy_id = x.m_policy_id; - - - m_count = x.m_count; - -} - -QosPolicyCount_s& QosPolicyCount_s::operator =( - const QosPolicyCount_s& x) -{ - m_policy_id = x.m_policy_id; - - - m_count = x.m_count; - - return *this; -} - -QosPolicyCount_s& QosPolicyCount_s::operator =( - QosPolicyCount_s&& x) noexcept -{ - m_policy_id = x.m_policy_id; - - - m_count = x.m_count; - - return *this; -} - -bool QosPolicyCount_s::operator ==( - const QosPolicyCount_s& x) const -{ - return (m_policy_id == x.m_policy_id && - m_count == x.m_count); -} - -bool QosPolicyCount_s::operator !=( - const QosPolicyCount_s& x) const -{ - return !(*this == x); -} - -size_t QosPolicyCount_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize; -} - -size_t QosPolicyCount_s::getCdrSerializedSize( - const QosPolicyCount_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void QosPolicyCount_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_policy_id; - - scdr << m_count; - -} - -void QosPolicyCount_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_policy_id; - - - - dcdr >> m_count; - - -} - - -bool QosPolicyCount_s::isKeyDefined() -{ - return false; -} - -void QosPolicyCount_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member policy_id - * @param _policy_id New value for member policy_id - */ -void QosPolicyCount_s::policy_id( - uint32_t _policy_id) -{ - m_policy_id = _policy_id; -} - -/*! - * @brief This function returns the value of member policy_id - * @return Value of member policy_id - */ -uint32_t QosPolicyCount_s::policy_id() const -{ - return m_policy_id; -} - -/*! - * @brief This function returns a reference to member policy_id - * @return Reference to member policy_id - */ -uint32_t& QosPolicyCount_s::policy_id() -{ - return m_policy_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void QosPolicyCount_s::count( - uint32_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint32_t QosPolicyCount_s::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint32_t& QosPolicyCount_s::count() -{ - return m_count; -} - - - - - -BaseStatus_s::BaseStatus_s() -{ - // unsigned long m_total_count - m_total_count = 0; - -} - -BaseStatus_s::~BaseStatus_s() -{ -} - -BaseStatus_s::BaseStatus_s( - const BaseStatus_s& x) -{ - m_total_count = x.m_total_count; - -} - -BaseStatus_s::BaseStatus_s( - BaseStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - -} - -BaseStatus_s& BaseStatus_s::operator =( - const BaseStatus_s& x) -{ - m_total_count = x.m_total_count; - - return *this; -} - -BaseStatus_s& BaseStatus_s::operator =( - BaseStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - - return *this; -} - -bool BaseStatus_s::operator ==( - const BaseStatus_s& x) const -{ - return (m_total_count == x.m_total_count); -} - -bool BaseStatus_s::operator !=( - const BaseStatus_s& x) const -{ - return !(*this == x); -} - -size_t BaseStatus_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize; -} - -size_t BaseStatus_s::getCdrSerializedSize( - const BaseStatus_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void BaseStatus_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_total_count; - -} - -void BaseStatus_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_total_count; - - -} - - -bool BaseStatus_s::isKeyDefined() -{ - return false; -} - -void BaseStatus_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void BaseStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t BaseStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& BaseStatus_s::total_count() -{ - return m_total_count; -} - - - - - - - - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s() -{ - // unsigned long m_total_count - m_total_count = 0; - // unsigned long m_last_policy_id - m_last_policy_id = 0; - // eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies - - -} - -IncompatibleQoSStatus_s::~IncompatibleQoSStatus_s() -{ -} - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( - const IncompatibleQoSStatus_s& x) -{ - m_total_count = x.m_total_count; - - - m_last_policy_id = x.m_last_policy_id; - - - m_policies = x.m_policies; - -} - -IncompatibleQoSStatus_s::IncompatibleQoSStatus_s( - IncompatibleQoSStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - - - m_last_policy_id = x.m_last_policy_id; - - - m_policies = std::move(x.m_policies); - -} - -IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( - const IncompatibleQoSStatus_s& x) -{ - m_total_count = x.m_total_count; - - - m_last_policy_id = x.m_last_policy_id; - - - m_policies = x.m_policies; - - return *this; -} - -IncompatibleQoSStatus_s& IncompatibleQoSStatus_s::operator =( - IncompatibleQoSStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - - - m_last_policy_id = x.m_last_policy_id; - - - m_policies = std::move(x.m_policies); - - return *this; -} - -bool IncompatibleQoSStatus_s::operator ==( - const IncompatibleQoSStatus_s& x) const -{ - return (m_total_count == x.m_total_count && - m_last_policy_id == x.m_last_policy_id && - m_policies == x.m_policies); -} - -bool IncompatibleQoSStatus_s::operator !=( - const IncompatibleQoSStatus_s& x) const -{ - return !(*this == x); -} - -size_t IncompatibleQoSStatus_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize; -} - -size_t IncompatibleQoSStatus_s::getCdrSerializedSize( - const IncompatibleQoSStatus_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.policies().size(); ++a) - { - current_alignment += eprosima::fastdds::statistics::QosPolicyCount_s::getCdrSerializedSize(data.policies().at(a), current_alignment); - } - - - - return current_alignment - initial_alignment; -} - - -void IncompatibleQoSStatus_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_total_count; - - scdr << m_last_policy_id; - - scdr << m_policies; - - -} - -void IncompatibleQoSStatus_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_total_count; - - - - dcdr >> m_last_policy_id; - - - - dcdr >> m_policies; - - -} - - -bool IncompatibleQoSStatus_s::isKeyDefined() -{ - return false; -} - -void IncompatibleQoSStatus_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void IncompatibleQoSStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t IncompatibleQoSStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& IncompatibleQoSStatus_s::total_count() -{ - return m_total_count; -} - - -/*! - * @brief This function sets a value in member last_policy_id - * @param _last_policy_id New value for member last_policy_id - */ -void IncompatibleQoSStatus_s::last_policy_id( - uint32_t _last_policy_id) -{ - m_last_policy_id = _last_policy_id; -} - -/*! - * @brief This function returns the value of member last_policy_id - * @return Value of member last_policy_id - */ -uint32_t IncompatibleQoSStatus_s::last_policy_id() const -{ - return m_last_policy_id; -} - -/*! - * @brief This function returns a reference to member last_policy_id - * @return Reference to member last_policy_id - */ -uint32_t& IncompatibleQoSStatus_s::last_policy_id() -{ - return m_last_policy_id; -} - - -/*! - * @brief This function copies the value in member policies - * @param _policies New value to be copied in member policies - */ -void IncompatibleQoSStatus_s::policies( - const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies) -{ - m_policies = _policies; -} - -/*! - * @brief This function moves the value in member policies - * @param _policies New value to be moved in member policies - */ -void IncompatibleQoSStatus_s::policies( - eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies) -{ - m_policies = std::move(_policies); -} - -/*! - * @brief This function returns a constant reference to member policies - * @return Constant reference to member policies - */ -const eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() const -{ - return m_policies; -} - -/*! - * @brief This function returns a reference to member policies - * @return Reference to member policies - */ -eprosima::fastdds::statistics::QosPolicyCountSeq_s& IncompatibleQoSStatus_s::policies() -{ - return m_policies; -} - - - - - -LivelinessChangedStatus_s::LivelinessChangedStatus_s() -{ - // unsigned long m_alive_count - m_alive_count = 0; - // unsigned long m_not_alive_count - m_not_alive_count = 0; - // octet m_last_publication_handle - memset(&m_last_publication_handle, 0, ((16)) * 1); - -} - -LivelinessChangedStatus_s::~LivelinessChangedStatus_s() -{ -} - -LivelinessChangedStatus_s::LivelinessChangedStatus_s( - const LivelinessChangedStatus_s& x) -{ - m_alive_count = x.m_alive_count; - - - m_not_alive_count = x.m_not_alive_count; - - - m_last_publication_handle = x.m_last_publication_handle; - -} - -LivelinessChangedStatus_s::LivelinessChangedStatus_s( - LivelinessChangedStatus_s&& x) noexcept -{ - m_alive_count = x.m_alive_count; - - - m_not_alive_count = x.m_not_alive_count; - - - m_last_publication_handle = std::move(x.m_last_publication_handle); - -} - -LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( - const LivelinessChangedStatus_s& x) -{ - m_alive_count = x.m_alive_count; - - - m_not_alive_count = x.m_not_alive_count; - - - m_last_publication_handle = x.m_last_publication_handle; - - return *this; -} - -LivelinessChangedStatus_s& LivelinessChangedStatus_s::operator =( - LivelinessChangedStatus_s&& x) noexcept -{ - m_alive_count = x.m_alive_count; - - - m_not_alive_count = x.m_not_alive_count; - - - m_last_publication_handle = std::move(x.m_last_publication_handle); - - return *this; -} - -bool LivelinessChangedStatus_s::operator ==( - const LivelinessChangedStatus_s& x) const -{ - return (m_alive_count == x.m_alive_count && - m_not_alive_count == x.m_not_alive_count && - m_last_publication_handle == x.m_last_publication_handle); -} - -bool LivelinessChangedStatus_s::operator !=( - const LivelinessChangedStatus_s& x) const -{ - return !(*this == x); -} - -size_t LivelinessChangedStatus_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize; -} - -size_t LivelinessChangedStatus_s::getCdrSerializedSize( - const LivelinessChangedStatus_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void LivelinessChangedStatus_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_alive_count; - - scdr << m_not_alive_count; - - scdr << m_last_publication_handle; - - -} - -void LivelinessChangedStatus_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_alive_count; - - - - dcdr >> m_not_alive_count; - - - - dcdr >> m_last_publication_handle; - - -} - - -bool LivelinessChangedStatus_s::isKeyDefined() -{ - return false; -} - -void LivelinessChangedStatus_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member alive_count - * @param _alive_count New value for member alive_count - */ -void LivelinessChangedStatus_s::alive_count( - uint32_t _alive_count) -{ - m_alive_count = _alive_count; -} - -/*! - * @brief This function returns the value of member alive_count - * @return Value of member alive_count - */ -uint32_t LivelinessChangedStatus_s::alive_count() const -{ - return m_alive_count; -} - -/*! - * @brief This function returns a reference to member alive_count - * @return Reference to member alive_count - */ -uint32_t& LivelinessChangedStatus_s::alive_count() -{ - return m_alive_count; -} - - -/*! - * @brief This function sets a value in member not_alive_count - * @param _not_alive_count New value for member not_alive_count - */ -void LivelinessChangedStatus_s::not_alive_count( - uint32_t _not_alive_count) -{ - m_not_alive_count = _not_alive_count; -} - -/*! - * @brief This function returns the value of member not_alive_count - * @return Value of member not_alive_count - */ -uint32_t LivelinessChangedStatus_s::not_alive_count() const -{ - return m_not_alive_count; -} - -/*! - * @brief This function returns a reference to member not_alive_count - * @return Reference to member not_alive_count - */ -uint32_t& LivelinessChangedStatus_s::not_alive_count() -{ - return m_not_alive_count; -} - - -/*! - * @brief This function copies the value in member last_publication_handle - * @param _last_publication_handle New value to be copied in member last_publication_handle - */ -void LivelinessChangedStatus_s::last_publication_handle( - const std::array& _last_publication_handle) -{ - m_last_publication_handle = _last_publication_handle; -} - -/*! - * @brief This function moves the value in member last_publication_handle - * @param _last_publication_handle New value to be moved in member last_publication_handle - */ -void LivelinessChangedStatus_s::last_publication_handle( - std::array&& _last_publication_handle) -{ - m_last_publication_handle = std::move(_last_publication_handle); -} - -/*! - * @brief This function returns a constant reference to member last_publication_handle - * @return Constant reference to member last_publication_handle - */ -const std::array& LivelinessChangedStatus_s::last_publication_handle() const -{ - return m_last_publication_handle; -} - -/*! - * @brief This function returns a reference to member last_publication_handle - * @return Reference to member last_publication_handle - */ -std::array& LivelinessChangedStatus_s::last_publication_handle() -{ - return m_last_publication_handle; -} - - - - - -DeadlineMissedStatus_s::DeadlineMissedStatus_s() -{ - // unsigned long m_total_count - m_total_count = 0; - // octet m_last_instance_handle - memset(&m_last_instance_handle, 0, ((16)) * 1); - -} - -DeadlineMissedStatus_s::~DeadlineMissedStatus_s() -{ -} - -DeadlineMissedStatus_s::DeadlineMissedStatus_s( - const DeadlineMissedStatus_s& x) -{ - m_total_count = x.m_total_count; - - - m_last_instance_handle = x.m_last_instance_handle; - -} - -DeadlineMissedStatus_s::DeadlineMissedStatus_s( - DeadlineMissedStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - - - m_last_instance_handle = std::move(x.m_last_instance_handle); - -} - -DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( - const DeadlineMissedStatus_s& x) -{ - m_total_count = x.m_total_count; - - - m_last_instance_handle = x.m_last_instance_handle; - - return *this; -} - -DeadlineMissedStatus_s& DeadlineMissedStatus_s::operator =( - DeadlineMissedStatus_s&& x) noexcept -{ - m_total_count = x.m_total_count; - - - m_last_instance_handle = std::move(x.m_last_instance_handle); - - return *this; -} - -bool DeadlineMissedStatus_s::operator ==( - const DeadlineMissedStatus_s& x) const -{ - return (m_total_count == x.m_total_count && - m_last_instance_handle == x.m_last_instance_handle); -} - -bool DeadlineMissedStatus_s::operator !=( - const DeadlineMissedStatus_s& x) const -{ - return !(*this == x); -} - -size_t DeadlineMissedStatus_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize; -} - -size_t DeadlineMissedStatus_s::getCdrSerializedSize( - const DeadlineMissedStatus_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void DeadlineMissedStatus_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_total_count; - - scdr << m_last_instance_handle; - - -} - -void DeadlineMissedStatus_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_total_count; - - - - dcdr >> m_last_instance_handle; - - -} - - -bool DeadlineMissedStatus_s::isKeyDefined() -{ - return false; -} - -void DeadlineMissedStatus_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ -void DeadlineMissedStatus_s::total_count( - uint32_t _total_count) -{ - m_total_count = _total_count; -} - -/*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ -uint32_t DeadlineMissedStatus_s::total_count() const -{ - return m_total_count; -} - -/*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ -uint32_t& DeadlineMissedStatus_s::total_count() -{ - return m_total_count; -} - - -/*! - * @brief This function copies the value in member last_instance_handle - * @param _last_instance_handle New value to be copied in member last_instance_handle - */ -void DeadlineMissedStatus_s::last_instance_handle( - const std::array& _last_instance_handle) -{ - m_last_instance_handle = _last_instance_handle; -} - -/*! - * @brief This function moves the value in member last_instance_handle - * @param _last_instance_handle New value to be moved in member last_instance_handle - */ -void DeadlineMissedStatus_s::last_instance_handle( - std::array&& _last_instance_handle) -{ - m_last_instance_handle = std::move(_last_instance_handle); -} - -/*! - * @brief This function returns a constant reference to member last_instance_handle - * @return Constant reference to member last_instance_handle - */ -const std::array& DeadlineMissedStatus_s::last_instance_handle() const -{ - return m_last_instance_handle; -} - -/*! - * @brief This function returns a reference to member last_instance_handle - * @return Reference to member last_instance_handle - */ -std::array& DeadlineMissedStatus_s::last_instance_handle() -{ - return m_last_instance_handle; -} - - - - - - - - - -MonitorServiceData::MonitorServiceData() -{ - m__d = eprosima::fastdds::statistics::PROXY; - // sequence m_entity_proxy - - // sequence m_connection_list - - // eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status - - // eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status - - // eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status - - // eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status - - // eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status - - // eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status - - // octet m_statuses_size - m_statuses_size = 0; -} - -MonitorServiceData::~MonitorServiceData() -{ -} - -MonitorServiceData::MonitorServiceData( - const MonitorServiceData& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = x.m_entity_proxy; - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = x.m_connection_list; - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = x.m_incompatible_qos_status; - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = x.m_inconsistent_topic_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = x.m_liveliness_lost_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = x.m_liveliness_changed_status; - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = x.m_deadline_missed_status; - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = x.m_sample_lost_status; - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } -} - -MonitorServiceData::MonitorServiceData( - MonitorServiceData&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = std::move(x.m_entity_proxy); - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = std::move(x.m_connection_list); - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = std::move(x.m_deadline_missed_status); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = std::move(x.m_sample_lost_status); - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } -} - -MonitorServiceData& MonitorServiceData::operator =( - const MonitorServiceData& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = x.m_entity_proxy; - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = x.m_connection_list; - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = x.m_incompatible_qos_status; - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = x.m_inconsistent_topic_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = x.m_liveliness_lost_status; - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = x.m_liveliness_changed_status; - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = x.m_deadline_missed_status; - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = x.m_sample_lost_status; - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } - - return *this; -} - -MonitorServiceData& MonitorServiceData::operator =( - MonitorServiceData&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - m_entity_proxy = std::move(x.m_entity_proxy); - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - m_connection_list = std::move(x.m_connection_list); - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - m_incompatible_qos_status = std::move(x.m_incompatible_qos_status); - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - m_inconsistent_topic_status = std::move(x.m_inconsistent_topic_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - m_liveliness_lost_status = std::move(x.m_liveliness_lost_status); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - m_liveliness_changed_status = std::move(x.m_liveliness_changed_status); - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - m_deadline_missed_status = std::move(x.m_deadline_missed_status); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - m_sample_lost_status = std::move(x.m_sample_lost_status); - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - m_statuses_size = x.m_statuses_size; - break; - - default: - break; - } - - return *this; -} - -bool MonitorServiceData::operator ==( - const MonitorServiceData& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - return (m_entity_proxy == x.m_entity_proxy); - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - return (m_connection_list == x.m_connection_list); - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - return (m_incompatible_qos_status == x.m_incompatible_qos_status); - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - return (m_inconsistent_topic_status == x.m_inconsistent_topic_status); - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - return (m_liveliness_lost_status == x.m_liveliness_lost_status); - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - return (m_liveliness_changed_status == x.m_liveliness_changed_status); - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - return (m_deadline_missed_status == x.m_deadline_missed_status); - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - return (m_sample_lost_status == x.m_sample_lost_status); - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - return (m_statuses_size == x.m_statuses_size); - break; - - default: - break; - } - return false; -} - -bool MonitorServiceData::operator !=( - const MonitorServiceData& x) const -{ - return !(*this == x); -} - -void MonitorServiceData::_d( - eprosima::fastdds::statistics::StatusKind __d) -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - switch(__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - switch(__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - switch(__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - switch(__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - switch(__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - switch(__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - switch(__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - switch(__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - switch(__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::StatusKind MonitorServiceData::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::StatusKind& MonitorServiceData::_d() -{ - return m__d; -} - -void MonitorServiceData::entity_proxy( - const std::vector& _entity_proxy) -{ - m_entity_proxy = _entity_proxy; - m__d = eprosima::fastdds::statistics::PROXY; - -} - -void MonitorServiceData::entity_proxy( - std::vector&& _entity_proxy) -{ - m_entity_proxy = std::move(_entity_proxy); - m__d = eprosima::fastdds::statistics::PROXY; - -} - -const std::vector& MonitorServiceData::entity_proxy() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_proxy; -} - -std::vector& MonitorServiceData::entity_proxy() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_proxy; -} - - -void MonitorServiceData::connection_list( - const std::vector& _connection_list) -{ - m_connection_list = _connection_list; - m__d = eprosima::fastdds::statistics::CONNECTION_LIST; - -} - -void MonitorServiceData::connection_list( - std::vector&& _connection_list) -{ - m_connection_list = std::move(_connection_list); - m__d = eprosima::fastdds::statistics::CONNECTION_LIST; - -} - -const std::vector& MonitorServiceData::connection_list() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_connection_list; -} - -std::vector& MonitorServiceData::connection_list() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::CONNECTION_LIST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_connection_list; -} - - -void MonitorServiceData::incompatible_qos_status( - const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status) -{ - m_incompatible_qos_status = _incompatible_qos_status; - m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; - -} - -void MonitorServiceData::incompatible_qos_status( - eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status) -{ - m_incompatible_qos_status = std::move(_incompatible_qos_status); - m__d = eprosima::fastdds::statistics::INCOMPATIBLE_QOS; - -} - -const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_incompatible_qos_status; -} - -eprosima::fastdds::statistics::IncompatibleQoSStatus_s& MonitorServiceData::incompatible_qos_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_incompatible_qos_status; -} - - -void MonitorServiceData::inconsistent_topic_status( - const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status) -{ - m_inconsistent_topic_status = _inconsistent_topic_status; - m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; - -} - -void MonitorServiceData::inconsistent_topic_status( - eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status) -{ - m_inconsistent_topic_status = std::move(_inconsistent_topic_status); - m__d = eprosima::fastdds::statistics::INCONSISTENT_TOPIC; - -} - -const eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_inconsistent_topic_status; -} - -eprosima::fastdds::statistics::InconsistentTopicStatus_s& MonitorServiceData::inconsistent_topic_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_inconsistent_topic_status; -} - - -void MonitorServiceData::liveliness_lost_status( - const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status) -{ - m_liveliness_lost_status = _liveliness_lost_status; - m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; - -} - -void MonitorServiceData::liveliness_lost_status( - eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status) -{ - m_liveliness_lost_status = std::move(_liveliness_lost_status); - m__d = eprosima::fastdds::statistics::LIVELINESS_LOST; - -} - -const eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_lost_status; -} - -eprosima::fastdds::statistics::LivelinessLostStatus_s& MonitorServiceData::liveliness_lost_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_lost_status; -} - - -void MonitorServiceData::liveliness_changed_status( - const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status) -{ - m_liveliness_changed_status = _liveliness_changed_status; - m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; - -} - -void MonitorServiceData::liveliness_changed_status( - eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status) -{ - m_liveliness_changed_status = std::move(_liveliness_changed_status); - m__d = eprosima::fastdds::statistics::LIVELINESS_CHANGED; - -} - -const eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_changed_status; -} - -eprosima::fastdds::statistics::LivelinessChangedStatus_s& MonitorServiceData::liveliness_changed_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_liveliness_changed_status; -} - - -void MonitorServiceData::deadline_missed_status( - const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status) -{ - m_deadline_missed_status = _deadline_missed_status; - m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; - -} - -void MonitorServiceData::deadline_missed_status( - eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status) -{ - m_deadline_missed_status = std::move(_deadline_missed_status); - m__d = eprosima::fastdds::statistics::DEADLINE_MISSED; - -} - -const eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_deadline_missed_status; -} - -eprosima::fastdds::statistics::DeadlineMissedStatus_s& MonitorServiceData::deadline_missed_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DEADLINE_MISSED: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_deadline_missed_status; -} - - -void MonitorServiceData::sample_lost_status( - const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status) -{ - m_sample_lost_status = _sample_lost_status; - m__d = eprosima::fastdds::statistics::SAMPLE_LOST; - -} - -void MonitorServiceData::sample_lost_status( - eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status) -{ - m_sample_lost_status = std::move(_sample_lost_status); - m__d = eprosima::fastdds::statistics::SAMPLE_LOST; - -} - -const eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_lost_status; -} - -eprosima::fastdds::statistics::SampleLostStatus_s& MonitorServiceData::sample_lost_status() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_lost_status; -} - - -void MonitorServiceData::statuses_size( - uint8_t _statuses_size) -{ - m_statuses_size = _statuses_size; - m__d = eprosima::fastdds::statistics::STATUSES_SIZE; - -} - -uint8_t MonitorServiceData::statuses_size() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_statuses_size; -} - -uint8_t& MonitorServiceData::statuses_size() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::STATUSES_SIZE: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_statuses_size; -} - - -// TODO(Ricardo) Review -size_t MonitorServiceData::getCdrSerializedSize( - const MonitorServiceData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case eprosima::fastdds::statistics::PROXY: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.entity_proxy().size() > 0) - { - current_alignment += (data.entity_proxy().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.connection_list().size(); ++a) - { - current_alignment += eprosima::fastdds::statistics::Connection::getCdrSerializedSize(data.connection_list().at(a), current_alignment); - } - - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - current_alignment += eprosima::fastdds::statistics::IncompatibleQoSStatus_s::getCdrSerializedSize(data.incompatible_qos_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - current_alignment += eprosima::fastdds::statistics::InconsistentTopicStatus_s::getCdrSerializedSize(data.inconsistent_topic_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - current_alignment += eprosima::fastdds::statistics::LivelinessLostStatus_s::getCdrSerializedSize(data.liveliness_lost_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - current_alignment += eprosima::fastdds::statistics::LivelinessChangedStatus_s::getCdrSerializedSize(data.liveliness_changed_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - current_alignment += eprosima::fastdds::statistics::DeadlineMissedStatus_s::getCdrSerializedSize(data.deadline_missed_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - current_alignment += eprosima::fastdds::statistics::SampleLostStatus_s::getCdrSerializedSize(data.sample_lost_status(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void MonitorServiceData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - scdr << m_entity_proxy; - - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - scdr << m_connection_list; - - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - scdr << m_incompatible_qos_status; - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - scdr << m_inconsistent_topic_status; - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - scdr << m_liveliness_lost_status; - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - scdr << m_liveliness_changed_status; - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - scdr << m_deadline_missed_status; - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - scdr << m_sample_lost_status; - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - scdr << m_statuses_size; - - break; - - default: - break; - } -} - -void MonitorServiceData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m__d = (eprosima::fastdds::statistics::StatusKind)enum_value; - } - - - switch(m__d) - { - case eprosima::fastdds::statistics::PROXY: - dcdr >> m_entity_proxy; - - - break; - - - case eprosima::fastdds::statistics::CONNECTION_LIST: - dcdr >> m_connection_list; - - - break; - - - case eprosima::fastdds::statistics::INCOMPATIBLE_QOS: - dcdr >> m_incompatible_qos_status; - - - break; - - - case eprosima::fastdds::statistics::INCONSISTENT_TOPIC: - dcdr >> m_inconsistent_topic_status; - - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_LOST: - dcdr >> m_liveliness_lost_status; - - - break; - - - case eprosima::fastdds::statistics::LIVELINESS_CHANGED: - dcdr >> m_liveliness_changed_status; - - - break; - - - case eprosima::fastdds::statistics::DEADLINE_MISSED: - dcdr >> m_deadline_missed_status; - - - break; - - - case eprosima::fastdds::statistics::SAMPLE_LOST: - dcdr >> m_sample_lost_status; - - - break; - - - case eprosima::fastdds::statistics::STATUSES_SIZE: - dcdr >> m_statuses_size; - - - break; - - default: - break; - } -} - - - - - -MonitorServiceStatusData::MonitorServiceStatusData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_local_entity - - // eprosima::fastdds::statistics::StatusKind m_status_kind - m_status_kind = eprosima::fastdds::statistics::PROXY; - // eprosima::fastdds::statistics::MonitorServiceData m_value - - -} - -MonitorServiceStatusData::~MonitorServiceStatusData() -{ -} - -MonitorServiceStatusData::MonitorServiceStatusData( - const MonitorServiceStatusData& x) -{ - m_local_entity = x.m_local_entity; - - - m_status_kind = x.m_status_kind; - - - m_value = x.m_value; - -} - -MonitorServiceStatusData::MonitorServiceStatusData( - MonitorServiceStatusData&& x) noexcept -{ - m_local_entity = std::move(x.m_local_entity); - - - m_status_kind = x.m_status_kind; - - - m_value = std::move(x.m_value); - -} - -MonitorServiceStatusData& MonitorServiceStatusData::operator =( - const MonitorServiceStatusData& x) -{ - m_local_entity = x.m_local_entity; - - - m_status_kind = x.m_status_kind; - - - m_value = x.m_value; - - return *this; -} - -MonitorServiceStatusData& MonitorServiceStatusData::operator =( - MonitorServiceStatusData&& x) noexcept -{ - m_local_entity = std::move(x.m_local_entity); - - - m_status_kind = x.m_status_kind; - - - m_value = std::move(x.m_value); - - return *this; -} - -bool MonitorServiceStatusData::operator ==( - const MonitorServiceStatusData& x) const -{ - return (m_local_entity == x.m_local_entity && - m_status_kind == x.m_status_kind && - m_value == x.m_value); -} - -bool MonitorServiceStatusData::operator !=( - const MonitorServiceStatusData& x) const -{ - return !(*this == x); -} - -size_t MonitorServiceStatusData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize; -} - -size_t MonitorServiceStatusData::getCdrSerializedSize( - const MonitorServiceStatusData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_entity(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += eprosima::fastdds::statistics::MonitorServiceData::getCdrSerializedSize(data.value(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void MonitorServiceStatusData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_local_entity; - - scdr << (uint32_t)m_status_kind; - - scdr << m_value; - -} - -void MonitorServiceStatusData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_local_entity; - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_status_kind = (eprosima::fastdds::statistics::StatusKind)enum_value; - } - - - - dcdr >> m_value; - - -} - - -bool MonitorServiceStatusData::isKeyDefined() -{ - return true; -} - -void MonitorServiceStatusData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_local_entity.serialize(scdr); - - scdr << (uint32_t)m_status_kind; - - -} - -/*! - * @brief This function copies the value in member local_entity - * @param _local_entity New value to be copied in member local_entity - */ -void MonitorServiceStatusData::local_entity( - const eprosima::fastdds::statistics::detail::GUID_s& _local_entity) -{ - m_local_entity = _local_entity; -} - -/*! - * @brief This function moves the value in member local_entity - * @param _local_entity New value to be moved in member local_entity - */ -void MonitorServiceStatusData::local_entity( - eprosima::fastdds::statistics::detail::GUID_s&& _local_entity) -{ - m_local_entity = std::move(_local_entity); -} - -/*! - * @brief This function returns a constant reference to member local_entity - * @return Constant reference to member local_entity - */ -const eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() const -{ - return m_local_entity; -} - -/*! - * @brief This function returns a reference to member local_entity - * @return Reference to member local_entity - */ -eprosima::fastdds::statistics::detail::GUID_s& MonitorServiceStatusData::local_entity() -{ - return m_local_entity; -} - - -/*! - * @brief This function sets a value in member status_kind - * @param _status_kind New value for member status_kind - */ -void MonitorServiceStatusData::status_kind( - eprosima::fastdds::statistics::StatusKind _status_kind) -{ - m_status_kind = _status_kind; -} - -/*! - * @brief This function returns the value of member status_kind - * @return Value of member status_kind - */ -eprosima::fastdds::statistics::StatusKind MonitorServiceStatusData::status_kind() const -{ - return m_status_kind; -} - -/*! - * @brief This function returns a reference to member status_kind - * @return Reference to member status_kind - */ -eprosima::fastdds::statistics::StatusKind& MonitorServiceStatusData::status_kind() -{ - return m_status_kind; -} - - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void MonitorServiceStatusData::value( - const eprosima::fastdds::statistics::MonitorServiceData& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void MonitorServiceStatusData::value( - eprosima::fastdds::statistics::MonitorServiceData&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -eprosima::fastdds::statistics::MonitorServiceData& MonitorServiceStatusData::value() -{ - return m_value; -} - - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/src/cpp/statistics/types/monitorservice_typesv1.h b/src/cpp/statistics/types/monitorservice_typesv1.h deleted file mode 100644 index 21ef65f1cf8..00000000000 --- a/src/cpp/statistics/types/monitorservice_typesv1.h +++ /dev/null @@ -1,1763 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file monitorservice_types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ - -#include "types.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(MONITORSERVICE_TYPES_SOURCE) -#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) -#else -#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) -#endif // MONITORSERVICE_TYPES_SOURCE -#else -#define MONITORSERVICE_TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define MONITORSERVICE_TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - namespace fastdds { - namespace statistics { - /*! - * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - enum ConnectionMode : uint32_t - { - DATA_SHARING, - INTRAPROCESS, - TRANSPORT - }; - - - - - /*! - * @brief This class represents the structure Connection defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class Connection - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Connection(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Connection(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection( - const Connection& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection( - Connection&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection& operator =( - const Connection& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Connection that will be copied. - */ - eProsima_user_DllExport Connection& operator =( - Connection&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Connection object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Connection& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Connection object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Connection& x) const; - - /*! - * @brief This function sets a value in member mode - * @param _mode New value for member mode - */ - eProsima_user_DllExport void mode( - eprosima::fastdds::statistics::ConnectionMode _mode); - - /*! - * @brief This function returns the value of member mode - * @return Value of member mode - */ - eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode mode() const; - - /*! - * @brief This function returns a reference to member mode - * @return Reference to member mode - */ - eProsima_user_DllExport eprosima::fastdds::statistics::ConnectionMode& mode(); - - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function copies the value in member announced_locators - * @param _announced_locators New value to be copied in member announced_locators - */ - eProsima_user_DllExport void announced_locators( - const std::vector& _announced_locators); - - /*! - * @brief This function moves the value in member announced_locators - * @param _announced_locators New value to be moved in member announced_locators - */ - eProsima_user_DllExport void announced_locators( - std::vector&& _announced_locators); - - /*! - * @brief This function returns a constant reference to member announced_locators - * @return Constant reference to member announced_locators - */ - eProsima_user_DllExport const std::vector& announced_locators() const; - - /*! - * @brief This function returns a reference to member announced_locators - * @return Reference to member announced_locators - */ - eProsima_user_DllExport std::vector& announced_locators(); - - - /*! - * @brief This function copies the value in member used_locators - * @param _used_locators New value to be copied in member used_locators - */ - eProsima_user_DllExport void used_locators( - const std::vector& _used_locators); - - /*! - * @brief This function moves the value in member used_locators - * @param _used_locators New value to be moved in member used_locators - */ - eProsima_user_DllExport void used_locators( - std::vector&& _used_locators); - - /*! - * @brief This function returns a constant reference to member used_locators - * @return Constant reference to member used_locators - */ - eProsima_user_DllExport const std::vector& used_locators() const; - - /*! - * @brief This function returns a reference to member used_locators - * @return Reference to member used_locators - */ - eProsima_user_DllExport std::vector& used_locators(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Connection& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::ConnectionMode m_mode; - eprosima::fastdds::statistics::detail::GUID_s m_guid; - std::vector m_announced_locators; - std::vector m_used_locators; - - }; - - - - /*! - * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class QosPolicyCount_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport QosPolicyCount_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~QosPolicyCount_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s( - const QosPolicyCount_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s( - QosPolicyCount_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s& operator =( - const QosPolicyCount_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::QosPolicyCount_s that will be copied. - */ - eProsima_user_DllExport QosPolicyCount_s& operator =( - QosPolicyCount_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const QosPolicyCount_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::QosPolicyCount_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const QosPolicyCount_s& x) const; - - /*! - * @brief This function sets a value in member policy_id - * @param _policy_id New value for member policy_id - */ - eProsima_user_DllExport void policy_id( - uint32_t _policy_id); - - /*! - * @brief This function returns the value of member policy_id - * @return Value of member policy_id - */ - eProsima_user_DllExport uint32_t policy_id() const; - - /*! - * @brief This function returns a reference to member policy_id - * @return Reference to member policy_id - */ - eProsima_user_DllExport uint32_t& policy_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint32_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint32_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint32_t& count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::QosPolicyCount_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint32_t m_policy_id; - uint32_t m_count; - - }; - - - - /*! - * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class BaseStatus_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BaseStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BaseStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s( - const BaseStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s( - BaseStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s& operator =( - const BaseStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::BaseStatus_s that will be copied. - */ - eProsima_user_DllExport BaseStatus_s& operator =( - BaseStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BaseStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::BaseStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BaseStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::BaseStatus_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint32_t m_total_count; - - }; - - - - typedef std::vector QosPolicyCountSeq_s; - - - - /*! - * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class IncompatibleQoSStatus_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~IncompatibleQoSStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s( - const IncompatibleQoSStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s( - IncompatibleQoSStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( - const IncompatibleQoSStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::IncompatibleQoSStatus_s that will be copied. - */ - eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( - IncompatibleQoSStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const IncompatibleQoSStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::IncompatibleQoSStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const IncompatibleQoSStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - - - /*! - * @brief This function sets a value in member last_policy_id - * @param _last_policy_id New value for member last_policy_id - */ - eProsima_user_DllExport void last_policy_id( - uint32_t _last_policy_id); - - /*! - * @brief This function returns the value of member last_policy_id - * @return Value of member last_policy_id - */ - eProsima_user_DllExport uint32_t last_policy_id() const; - - /*! - * @brief This function returns a reference to member last_policy_id - * @return Reference to member last_policy_id - */ - eProsima_user_DllExport uint32_t& last_policy_id(); - - - /*! - * @brief This function copies the value in member policies - * @param _policies New value to be copied in member policies - */ - eProsima_user_DllExport void policies( - const eprosima::fastdds::statistics::QosPolicyCountSeq_s& _policies); - - /*! - * @brief This function moves the value in member policies - * @param _policies New value to be moved in member policies - */ - eProsima_user_DllExport void policies( - eprosima::fastdds::statistics::QosPolicyCountSeq_s&& _policies); - - /*! - * @brief This function returns a constant reference to member policies - * @return Constant reference to member policies - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies() const; - - /*! - * @brief This function returns a reference to member policies - * @return Reference to member policies - */ - eProsima_user_DllExport eprosima::fastdds::statistics::QosPolicyCountSeq_s& policies(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint32_t m_total_count; - uint32_t m_last_policy_id; - eprosima::fastdds::statistics::QosPolicyCountSeq_s m_policies; - - }; - - - - /*! - * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class LivelinessChangedStatus_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LivelinessChangedStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LivelinessChangedStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s( - const LivelinessChangedStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s( - LivelinessChangedStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s& operator =( - const LivelinessChangedStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::LivelinessChangedStatus_s that will be copied. - */ - eProsima_user_DllExport LivelinessChangedStatus_s& operator =( - LivelinessChangedStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LivelinessChangedStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::LivelinessChangedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LivelinessChangedStatus_s& x) const; - - /*! - * @brief This function sets a value in member alive_count - * @param _alive_count New value for member alive_count - */ - eProsima_user_DllExport void alive_count( - uint32_t _alive_count); - - /*! - * @brief This function returns the value of member alive_count - * @return Value of member alive_count - */ - eProsima_user_DllExport uint32_t alive_count() const; - - /*! - * @brief This function returns a reference to member alive_count - * @return Reference to member alive_count - */ - eProsima_user_DllExport uint32_t& alive_count(); - - - /*! - * @brief This function sets a value in member not_alive_count - * @param _not_alive_count New value for member not_alive_count - */ - eProsima_user_DllExport void not_alive_count( - uint32_t _not_alive_count); - - /*! - * @brief This function returns the value of member not_alive_count - * @return Value of member not_alive_count - */ - eProsima_user_DllExport uint32_t not_alive_count() const; - - /*! - * @brief This function returns a reference to member not_alive_count - * @return Reference to member not_alive_count - */ - eProsima_user_DllExport uint32_t& not_alive_count(); - - - /*! - * @brief This function copies the value in member last_publication_handle - * @param _last_publication_handle New value to be copied in member last_publication_handle - */ - eProsima_user_DllExport void last_publication_handle( - const std::array& _last_publication_handle); - - /*! - * @brief This function moves the value in member last_publication_handle - * @param _last_publication_handle New value to be moved in member last_publication_handle - */ - eProsima_user_DllExport void last_publication_handle( - std::array&& _last_publication_handle); - - /*! - * @brief This function returns a constant reference to member last_publication_handle - * @return Constant reference to member last_publication_handle - */ - eProsima_user_DllExport const std::array& last_publication_handle() const; - - /*! - * @brief This function returns a reference to member last_publication_handle - * @return Reference to member last_publication_handle - */ - eProsima_user_DllExport std::array& last_publication_handle(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint32_t m_alive_count; - uint32_t m_not_alive_count; - std::array m_last_publication_handle; - - }; - - - - /*! - * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class DeadlineMissedStatus_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DeadlineMissedStatus_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DeadlineMissedStatus_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s( - const DeadlineMissedStatus_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s( - DeadlineMissedStatus_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s& operator =( - const DeadlineMissedStatus_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DeadlineMissedStatus_s that will be copied. - */ - eProsima_user_DllExport DeadlineMissedStatus_s& operator =( - DeadlineMissedStatus_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DeadlineMissedStatus_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DeadlineMissedStatus_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DeadlineMissedStatus_s& x) const; - - /*! - * @brief This function sets a value in member total_count - * @param _total_count New value for member total_count - */ - eProsima_user_DllExport void total_count( - uint32_t _total_count); - - /*! - * @brief This function returns the value of member total_count - * @return Value of member total_count - */ - eProsima_user_DllExport uint32_t total_count() const; - - /*! - * @brief This function returns a reference to member total_count - * @return Reference to member total_count - */ - eProsima_user_DllExport uint32_t& total_count(); - - - /*! - * @brief This function copies the value in member last_instance_handle - * @param _last_instance_handle New value to be copied in member last_instance_handle - */ - eProsima_user_DllExport void last_instance_handle( - const std::array& _last_instance_handle); - - /*! - * @brief This function moves the value in member last_instance_handle - * @param _last_instance_handle New value to be moved in member last_instance_handle - */ - eProsima_user_DllExport void last_instance_handle( - std::array&& _last_instance_handle); - - /*! - * @brief This function returns a constant reference to member last_instance_handle - * @return Constant reference to member last_instance_handle - */ - eProsima_user_DllExport const std::array& last_instance_handle() const; - - /*! - * @brief This function returns a reference to member last_instance_handle - * @return Reference to member last_instance_handle - */ - eProsima_user_DllExport std::array& last_instance_handle(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - uint32_t m_total_count; - std::array m_last_instance_handle; - - }; - - typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; - - typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; - - typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; - - /*! - * @brief This class represents the enumeration StatusKind defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - enum StatusKind : uint32_t - { - PROXY, - CONNECTION_LIST, - INCOMPATIBLE_QOS, - INCONSISTENT_TOPIC, - LIVELINESS_LOST, - LIVELINESS_CHANGED, - DEADLINE_MISSED, - SAMPLE_LOST, - STATUSES_SIZE - }; - - - /*! - * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class MonitorServiceData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MonitorServiceData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MonitorServiceData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData( - const MonitorServiceData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData( - MonitorServiceData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData& operator =( - const MonitorServiceData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceData that will be copied. - */ - eProsima_user_DllExport MonitorServiceData& operator =( - MonitorServiceData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MonitorServiceData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MonitorServiceData& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::StatusKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& _d(); - - /*! - * @brief This function copies the value in member entity_proxy - * @param _entity_proxy New value to be copied in member entity_proxy - */ - eProsima_user_DllExport void entity_proxy( - const std::vector& _entity_proxy); - - /*! - * @brief This function moves the value in member entity_proxy - * @param _entity_proxy New value to be moved in member entity_proxy - */ - eProsima_user_DllExport void entity_proxy( - std::vector&& _entity_proxy); - - /*! - * @brief This function returns a constant reference to member entity_proxy - * @return Constant reference to member entity_proxy - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::vector& entity_proxy() const; - - /*! - * @brief This function returns a reference to member entity_proxy - * @return Reference to member entity_proxy - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::vector& entity_proxy(); - - - /*! - * @brief This function copies the value in member connection_list - * @param _connection_list New value to be copied in member connection_list - */ - eProsima_user_DllExport void connection_list( - const std::vector& _connection_list); - - /*! - * @brief This function moves the value in member connection_list - * @param _connection_list New value to be moved in member connection_list - */ - eProsima_user_DllExport void connection_list( - std::vector&& _connection_list); - - /*! - * @brief This function returns a constant reference to member connection_list - * @return Constant reference to member connection_list - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::vector& connection_list() const; - - /*! - * @brief This function returns a reference to member connection_list - * @return Reference to member connection_list - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::vector& connection_list(); - - - /*! - * @brief This function copies the value in member incompatible_qos_status - * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status - */ - eProsima_user_DllExport void incompatible_qos_status( - const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& _incompatible_qos_status); - - /*! - * @brief This function moves the value in member incompatible_qos_status - * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status - */ - eProsima_user_DllExport void incompatible_qos_status( - eprosima::fastdds::statistics::IncompatibleQoSStatus_s&& _incompatible_qos_status); - - /*! - * @brief This function returns a constant reference to member incompatible_qos_status - * @return Constant reference to member incompatible_qos_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status() const; - - /*! - * @brief This function returns a reference to member incompatible_qos_status - * @return Reference to member incompatible_qos_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::IncompatibleQoSStatus_s& incompatible_qos_status(); - - - /*! - * @brief This function copies the value in member inconsistent_topic_status - * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status - */ - eProsima_user_DllExport void inconsistent_topic_status( - const eprosima::fastdds::statistics::InconsistentTopicStatus_s& _inconsistent_topic_status); - - /*! - * @brief This function moves the value in member inconsistent_topic_status - * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status - */ - eProsima_user_DllExport void inconsistent_topic_status( - eprosima::fastdds::statistics::InconsistentTopicStatus_s&& _inconsistent_topic_status); - - /*! - * @brief This function returns a constant reference to member inconsistent_topic_status - * @return Constant reference to member inconsistent_topic_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status() const; - - /*! - * @brief This function returns a reference to member inconsistent_topic_status - * @return Reference to member inconsistent_topic_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::InconsistentTopicStatus_s& inconsistent_topic_status(); - - - /*! - * @brief This function copies the value in member liveliness_lost_status - * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status - */ - eProsima_user_DllExport void liveliness_lost_status( - const eprosima::fastdds::statistics::LivelinessLostStatus_s& _liveliness_lost_status); - - /*! - * @brief This function moves the value in member liveliness_lost_status - * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status - */ - eProsima_user_DllExport void liveliness_lost_status( - eprosima::fastdds::statistics::LivelinessLostStatus_s&& _liveliness_lost_status); - - /*! - * @brief This function returns a constant reference to member liveliness_lost_status - * @return Constant reference to member liveliness_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status() const; - - /*! - * @brief This function returns a reference to member liveliness_lost_status - * @return Reference to member liveliness_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessLostStatus_s& liveliness_lost_status(); - - - /*! - * @brief This function copies the value in member liveliness_changed_status - * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status - */ - eProsima_user_DllExport void liveliness_changed_status( - const eprosima::fastdds::statistics::LivelinessChangedStatus_s& _liveliness_changed_status); - - /*! - * @brief This function moves the value in member liveliness_changed_status - * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status - */ - eProsima_user_DllExport void liveliness_changed_status( - eprosima::fastdds::statistics::LivelinessChangedStatus_s&& _liveliness_changed_status); - - /*! - * @brief This function returns a constant reference to member liveliness_changed_status - * @return Constant reference to member liveliness_changed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status() const; - - /*! - * @brief This function returns a reference to member liveliness_changed_status - * @return Reference to member liveliness_changed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::LivelinessChangedStatus_s& liveliness_changed_status(); - - - /*! - * @brief This function copies the value in member deadline_missed_status - * @param _deadline_missed_status New value to be copied in member deadline_missed_status - */ - eProsima_user_DllExport void deadline_missed_status( - const eprosima::fastdds::statistics::DeadlineMissedStatus_s& _deadline_missed_status); - - /*! - * @brief This function moves the value in member deadline_missed_status - * @param _deadline_missed_status New value to be moved in member deadline_missed_status - */ - eProsima_user_DllExport void deadline_missed_status( - eprosima::fastdds::statistics::DeadlineMissedStatus_s&& _deadline_missed_status); - - /*! - * @brief This function returns a constant reference to member deadline_missed_status - * @return Constant reference to member deadline_missed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status() const; - - /*! - * @brief This function returns a reference to member deadline_missed_status - * @return Reference to member deadline_missed_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DeadlineMissedStatus_s& deadline_missed_status(); - - - /*! - * @brief This function copies the value in member sample_lost_status - * @param _sample_lost_status New value to be copied in member sample_lost_status - */ - eProsima_user_DllExport void sample_lost_status( - const eprosima::fastdds::statistics::SampleLostStatus_s& _sample_lost_status); - - /*! - * @brief This function moves the value in member sample_lost_status - * @param _sample_lost_status New value to be moved in member sample_lost_status - */ - eProsima_user_DllExport void sample_lost_status( - eprosima::fastdds::statistics::SampleLostStatus_s&& _sample_lost_status); - - /*! - * @brief This function returns a constant reference to member sample_lost_status - * @return Constant reference to member sample_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status() const; - - /*! - * @brief This function returns a reference to member sample_lost_status - * @return Reference to member sample_lost_status - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleLostStatus_s& sample_lost_status(); - - - /*! - * @brief This function sets a value in member statuses_size - * @param _statuses_size New value for member statuses_size - */ - eProsima_user_DllExport void statuses_size( - uint8_t _statuses_size); - - /*! - * @brief This function returns the value of member statuses_size - * @return Value of member statuses_size - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t statuses_size() const; - - /*! - * @brief This function returns a reference to member statuses_size - * @return Reference to member statuses_size - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& statuses_size(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::MonitorServiceData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - - private: - - eprosima::fastdds::statistics::StatusKind m__d; - - std::vector m_entity_proxy; - std::vector m_connection_list; - eprosima::fastdds::statistics::IncompatibleQoSStatus_s m_incompatible_qos_status; - eprosima::fastdds::statistics::InconsistentTopicStatus_s m_inconsistent_topic_status; - eprosima::fastdds::statistics::LivelinessLostStatus_s m_liveliness_lost_status; - eprosima::fastdds::statistics::LivelinessChangedStatus_s m_liveliness_changed_status; - eprosima::fastdds::statistics::DeadlineMissedStatus_s m_deadline_missed_status; - eprosima::fastdds::statistics::SampleLostStatus_s m_sample_lost_status; - uint8_t m_statuses_size; - }; - - - - /*! - * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. - * @ingroup monitorservice_types - */ - class MonitorServiceStatusData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MonitorServiceStatusData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MonitorServiceStatusData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData( - const MonitorServiceStatusData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData( - MonitorServiceStatusData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData& operator =( - const MonitorServiceStatusData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::MonitorServiceStatusData that will be copied. - */ - eProsima_user_DllExport MonitorServiceStatusData& operator =( - MonitorServiceStatusData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MonitorServiceStatusData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::MonitorServiceStatusData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MonitorServiceStatusData& x) const; - - /*! - * @brief This function copies the value in member local_entity - * @param _local_entity New value to be copied in member local_entity - */ - eProsima_user_DllExport void local_entity( - const eprosima::fastdds::statistics::detail::GUID_s& _local_entity); - - /*! - * @brief This function moves the value in member local_entity - * @param _local_entity New value to be moved in member local_entity - */ - eProsima_user_DllExport void local_entity( - eprosima::fastdds::statistics::detail::GUID_s&& _local_entity); - - /*! - * @brief This function returns a constant reference to member local_entity - * @return Constant reference to member local_entity - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_entity() const; - - /*! - * @brief This function returns a reference to member local_entity - * @return Reference to member local_entity - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_entity(); - - - /*! - * @brief This function sets a value in member status_kind - * @param _status_kind New value for member status_kind - */ - eProsima_user_DllExport void status_kind( - eprosima::fastdds::statistics::StatusKind _status_kind); - - /*! - * @brief This function returns the value of member status_kind - * @return Value of member status_kind - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind status_kind() const; - - /*! - * @brief This function returns a reference to member status_kind - * @return Reference to member status_kind - */ - eProsima_user_DllExport eprosima::fastdds::statistics::StatusKind& status_kind(); - - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const eprosima::fastdds::statistics::MonitorServiceData& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - eprosima::fastdds::statistics::MonitorServiceData&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::MonitorServiceData& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport eprosima::fastdds::statistics::MonitorServiceData& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::MonitorServiceStatusData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_entity; - eprosima::fastdds::statistics::StatusKind m_status_kind; - eprosima::fastdds::statistics::MonitorServiceData m_value; - - }; - - } // namespace statistics - } // namespace fastdds -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/src/cpp/statistics/types/types.cxx b/src/cpp/statistics/types/types.cxx deleted file mode 100644 index 9dcb86ef67b..00000000000 --- a/src/cpp/statistics/types/types.cxx +++ /dev/null @@ -1,3211 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -EntityId_s::EntityId_s() -{ -} - -EntityId_s::~EntityId_s() -{ -} - -EntityId_s::EntityId_s( - const EntityId_s& x) -{ - m_value = x.m_value; -} - -EntityId_s::EntityId_s( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); -} - -EntityId_s& EntityId_s::operator =( - const EntityId_s& x) -{ - - m_value = x.m_value; - return *this; -} - -EntityId_s& EntityId_s::operator =( - EntityId_s&& x) noexcept -{ - - m_value = std::move(x.m_value); - return *this; -} - -bool EntityId_s::operator ==( - const EntityId_s& x) const -{ - return (m_value == x.m_value); -} - -bool EntityId_s::operator !=( - const EntityId_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void EntityId_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void EntityId_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& EntityId_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& EntityId_s::value() -{ - return m_value; -} - - - - -GuidPrefix_s::GuidPrefix_s() -{ -} - -GuidPrefix_s::~GuidPrefix_s() -{ -} - -GuidPrefix_s::GuidPrefix_s( - const GuidPrefix_s& x) -{ - m_value = x.m_value; -} - -GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); -} - -GuidPrefix_s& GuidPrefix_s::operator =( - const GuidPrefix_s& x) -{ - - m_value = x.m_value; - return *this; -} - -GuidPrefix_s& GuidPrefix_s::operator =( - GuidPrefix_s&& x) noexcept -{ - - m_value = std::move(x.m_value); - return *this; -} - -bool GuidPrefix_s::operator ==( - const GuidPrefix_s& x) const -{ - return (m_value == x.m_value); -} - -bool GuidPrefix_s::operator !=( - const GuidPrefix_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void GuidPrefix_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void GuidPrefix_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& GuidPrefix_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& GuidPrefix_s::value() -{ - return m_value; -} - - - - -GUID_s::GUID_s() -{ -} - -GUID_s::~GUID_s() -{ -} - -GUID_s::GUID_s( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - m_entityId = x.m_entityId; -} - -GUID_s::GUID_s( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - m_entityId = std::move(x.m_entityId); -} - -GUID_s& GUID_s::operator =( - const GUID_s& x) -{ - - m_guidPrefix = x.m_guidPrefix; - m_entityId = x.m_entityId; - return *this; -} - -GUID_s& GUID_s::operator =( - GUID_s&& x) noexcept -{ - - m_guidPrefix = std::move(x.m_guidPrefix); - m_entityId = std::move(x.m_entityId); - return *this; -} - -bool GUID_s::operator ==( - const GUID_s& x) const -{ - return (m_guidPrefix == x.m_guidPrefix && - m_entityId == x.m_entityId); -} - -bool GUID_s::operator !=( - const GUID_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ -void GUID_s::guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) -{ - m_guidPrefix = _guidPrefix; -} - -/*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ -void GUID_s::guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) -{ - m_guidPrefix = std::move(_guidPrefix); -} - -/*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const -{ - return m_guidPrefix; -} - -/*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() -{ - return m_guidPrefix; -} - - -/*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ -void GUID_s::entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) -{ - m_entityId = _entityId; -} - -/*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ -void GUID_s::entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) -{ - m_entityId = std::move(_entityId); -} - -/*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ -const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const -{ - return m_entityId; -} - -/*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ -eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() -{ - return m_entityId; -} - - - - -SequenceNumber_s::SequenceNumber_s() -{ -} - -SequenceNumber_s::~SequenceNumber_s() -{ -} - -SequenceNumber_s::SequenceNumber_s( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - m_low = x.m_low; -} - -SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - m_low = x.m_low; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - const SequenceNumber_s& x) -{ - - m_high = x.m_high; - m_low = x.m_low; - return *this; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - SequenceNumber_s&& x) noexcept -{ - - m_high = x.m_high; - m_low = x.m_low; - return *this; -} - -bool SequenceNumber_s::operator ==( - const SequenceNumber_s& x) const -{ - return (m_high == x.m_high && - m_low == x.m_low); -} - -bool SequenceNumber_s::operator !=( - const SequenceNumber_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ -void SequenceNumber_s::high( - int32_t _high) -{ - m_high = _high; -} - -/*! - * @brief This function returns the value of member high - * @return Value of member high - */ -int32_t SequenceNumber_s::high() const -{ - return m_high; -} - -/*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ -int32_t& SequenceNumber_s::high() -{ - return m_high; -} - - -/*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ -void SequenceNumber_s::low( - uint32_t _low) -{ - m_low = _low; -} - -/*! - * @brief This function returns the value of member low - * @return Value of member low - */ -uint32_t SequenceNumber_s::low() const -{ - return m_low; -} - -/*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ -uint32_t& SequenceNumber_s::low() -{ - return m_low; -} - - - - -SampleIdentity_s::SampleIdentity_s() -{ -} - -SampleIdentity_s::~SampleIdentity_s() -{ -} - -SampleIdentity_s::SampleIdentity_s( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - m_sequence_number = x.m_sequence_number; -} - -SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - m_sequence_number = std::move(x.m_sequence_number); -} - -SampleIdentity_s& SampleIdentity_s::operator =( - const SampleIdentity_s& x) -{ - - m_writer_guid = x.m_writer_guid; - m_sequence_number = x.m_sequence_number; - return *this; -} - -SampleIdentity_s& SampleIdentity_s::operator =( - SampleIdentity_s&& x) noexcept -{ - - m_writer_guid = std::move(x.m_writer_guid); - m_sequence_number = std::move(x.m_sequence_number); - return *this; -} - -bool SampleIdentity_s::operator ==( - const SampleIdentity_s& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_sequence_number == x.m_sequence_number); -} - -bool SampleIdentity_s::operator !=( - const SampleIdentity_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void SampleIdentity_s::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void SampleIdentity_s::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ -void SampleIdentity_s::sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) -{ - m_sequence_number = _sequence_number; -} - -/*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ -void SampleIdentity_s::sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) -{ - m_sequence_number = std::move(_sequence_number); -} - -/*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const -{ - return m_sequence_number; -} - -/*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() -{ - return m_sequence_number; -} - - - - -Locator_s::Locator_s() -{ -} - -Locator_s::~Locator_s() -{ -} - -Locator_s::Locator_s( - const Locator_s& x) -{ - m_kind = x.m_kind; - m_port = x.m_port; - m_address = x.m_address; -} - -Locator_s::Locator_s( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - m_port = x.m_port; - m_address = std::move(x.m_address); -} - -Locator_s& Locator_s::operator =( - const Locator_s& x) -{ - - m_kind = x.m_kind; - m_port = x.m_port; - m_address = x.m_address; - return *this; -} - -Locator_s& Locator_s::operator =( - Locator_s&& x) noexcept -{ - - m_kind = x.m_kind; - m_port = x.m_port; - m_address = std::move(x.m_address); - return *this; -} - -bool Locator_s::operator ==( - const Locator_s& x) const -{ - return (m_kind == x.m_kind && - m_port == x.m_port && - m_address == x.m_address); -} - -bool Locator_s::operator !=( - const Locator_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ -void Locator_s::kind( - int32_t _kind) -{ - m_kind = _kind; -} - -/*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ -int32_t Locator_s::kind() const -{ - return m_kind; -} - -/*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ -int32_t& Locator_s::kind() -{ - return m_kind; -} - - -/*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ -void Locator_s::port( - uint32_t _port) -{ - m_port = _port; -} - -/*! - * @brief This function returns the value of member port - * @return Value of member port - */ -uint32_t Locator_s::port() const -{ - return m_port; -} - -/*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ -uint32_t& Locator_s::port() -{ - return m_port; -} - - -/*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ -void Locator_s::address( - const std::array& _address) -{ - m_address = _address; -} - -/*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ -void Locator_s::address( - std::array&& _address) -{ - m_address = std::move(_address); -} - -/*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ -const std::array& Locator_s::address() const -{ - return m_address; -} - -/*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ -std::array& Locator_s::address() -{ - return m_address; -} - - - - -} // namespace detail - - -DiscoveryTime::DiscoveryTime() -{ -} - -DiscoveryTime::~DiscoveryTime() -{ -} - -DiscoveryTime::DiscoveryTime( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - m_remote_entity_guid = x.m_remote_entity_guid; - m_time = x.m_time; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; -} - -DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - m_time = x.m_time; - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); -} - -DiscoveryTime& DiscoveryTime::operator =( - const DiscoveryTime& x) -{ - - m_local_participant_guid = x.m_local_participant_guid; - m_remote_entity_guid = x.m_remote_entity_guid; - m_time = x.m_time; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; - return *this; -} - -DiscoveryTime& DiscoveryTime::operator =( - DiscoveryTime&& x) noexcept -{ - - m_local_participant_guid = std::move(x.m_local_participant_guid); - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - m_time = x.m_time; - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); - return *this; -} - -bool DiscoveryTime::operator ==( - const DiscoveryTime& x) const -{ - return (m_local_participant_guid == x.m_local_participant_guid && - m_remote_entity_guid == x.m_remote_entity_guid && - m_time == x.m_time && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool DiscoveryTime::operator !=( - const DiscoveryTime& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) -{ - m_local_participant_guid = _local_participant_guid; -} - -/*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) -{ - m_local_participant_guid = std::move(_local_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const -{ - return m_local_participant_guid; -} - -/*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() -{ - return m_local_participant_guid; -} - - -/*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) -{ - m_remote_entity_guid = _remote_entity_guid; -} - -/*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) -{ - m_remote_entity_guid = std::move(_remote_entity_guid); -} - -/*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const -{ - return m_remote_entity_guid; -} - -/*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() -{ - return m_remote_entity_guid; -} - - -/*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ -void DiscoveryTime::time( - uint64_t _time) -{ - m_time = _time; -} - -/*! - * @brief This function returns the value of member time - * @return Value of member time - */ -uint64_t DiscoveryTime::time() const -{ - return m_time; -} - -/*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ -uint64_t& DiscoveryTime::time() -{ - return m_time; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void DiscoveryTime::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void DiscoveryTime::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& DiscoveryTime::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& DiscoveryTime::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void DiscoveryTime::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void DiscoveryTime::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& DiscoveryTime::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& DiscoveryTime::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void DiscoveryTime::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void DiscoveryTime::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& DiscoveryTime::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& DiscoveryTime::process() -{ - return m_process; -} - - - - -EntityCount::EntityCount() -{ -} - -EntityCount::~EntityCount() -{ -} - -EntityCount::EntityCount( - const EntityCount& x) -{ - m_guid = x.m_guid; - m_count = x.m_count; -} - -EntityCount::EntityCount( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - m_count = x.m_count; -} - -EntityCount& EntityCount::operator =( - const EntityCount& x) -{ - - m_guid = x.m_guid; - m_count = x.m_count; - return *this; -} - -EntityCount& EntityCount::operator =( - EntityCount&& x) noexcept -{ - - m_guid = std::move(x.m_guid); - m_count = x.m_count; - return *this; -} - -bool EntityCount::operator ==( - const EntityCount& x) const -{ - return (m_guid == x.m_guid && - m_count == x.m_count); -} - -bool EntityCount::operator !=( - const EntityCount& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityCount::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityCount::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void EntityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t EntityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& EntityCount::count() -{ - return m_count; -} - - - - -SampleIdentityCount::SampleIdentityCount() -{ -} - -SampleIdentityCount::~SampleIdentityCount() -{ -} - -SampleIdentityCount::SampleIdentityCount( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - m_count = x.m_count; -} - -SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - m_count = x.m_count; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - const SampleIdentityCount& x) -{ - - m_sample_id = x.m_sample_id; - m_count = x.m_count; - return *this; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - SampleIdentityCount&& x) noexcept -{ - - m_sample_id = std::move(x.m_sample_id); - m_count = x.m_count; - return *this; -} - -bool SampleIdentityCount::operator ==( - const SampleIdentityCount& x) const -{ - return (m_sample_id == x.m_sample_id && - m_count == x.m_count); -} - -bool SampleIdentityCount::operator !=( - const SampleIdentityCount& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ -void SampleIdentityCount::sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) -{ - m_sample_id = _sample_id; -} - -/*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ -void SampleIdentityCount::sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) -{ - m_sample_id = std::move(_sample_id); -} - -/*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const -{ - return m_sample_id; -} - -/*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() -{ - return m_sample_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void SampleIdentityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t SampleIdentityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& SampleIdentityCount::count() -{ - return m_count; -} - - - - -Entity2LocatorTraffic::Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::~Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - m_dst_locator = x.m_dst_locator; - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - m_dst_locator = std::move(x.m_dst_locator); - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - const Entity2LocatorTraffic& x) -{ - - m_src_guid = x.m_src_guid; - m_dst_locator = x.m_dst_locator; - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - Entity2LocatorTraffic&& x) noexcept -{ - - m_src_guid = std::move(x.m_src_guid); - m_dst_locator = std::move(x.m_dst_locator); - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; -} - -bool Entity2LocatorTraffic::operator ==( - const Entity2LocatorTraffic& x) const -{ - return (m_src_guid == x.m_src_guid && - m_dst_locator == x.m_dst_locator && - m_packet_count == x.m_packet_count && - m_byte_count == x.m_byte_count && - m_byte_magnitude_order == x.m_byte_magnitude_order); -} - -bool Entity2LocatorTraffic::operator !=( - const Entity2LocatorTraffic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) -{ - m_src_guid = _src_guid; -} - -/*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) -{ - m_src_guid = std::move(_src_guid); -} - -/*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const -{ - return m_src_guid; -} - -/*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() -{ - return m_src_guid; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ -void Entity2LocatorTraffic::packet_count( - uint64_t _packet_count) -{ - m_packet_count = _packet_count; -} - -/*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ -uint64_t Entity2LocatorTraffic::packet_count() const -{ - return m_packet_count; -} - -/*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ -uint64_t& Entity2LocatorTraffic::packet_count() -{ - return m_packet_count; -} - - -/*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ -void Entity2LocatorTraffic::byte_count( - uint64_t _byte_count) -{ - m_byte_count = _byte_count; -} - -/*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ -uint64_t Entity2LocatorTraffic::byte_count() const -{ - return m_byte_count; -} - -/*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ -uint64_t& Entity2LocatorTraffic::byte_count() -{ - return m_byte_count; -} - - -/*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ -void Entity2LocatorTraffic::byte_magnitude_order( - int16_t _byte_magnitude_order) -{ - m_byte_magnitude_order = _byte_magnitude_order; -} - -/*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ -int16_t Entity2LocatorTraffic::byte_magnitude_order() const -{ - return m_byte_magnitude_order; -} - -/*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ -int16_t& Entity2LocatorTraffic::byte_magnitude_order() -{ - return m_byte_magnitude_order; -} - - - - -WriterReaderData::WriterReaderData() -{ -} - -WriterReaderData::~WriterReaderData() -{ -} - -WriterReaderData::WriterReaderData( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - m_reader_guid = x.m_reader_guid; - m_data = x.m_data; -} - -WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - m_reader_guid = std::move(x.m_reader_guid); - m_data = x.m_data; -} - -WriterReaderData& WriterReaderData::operator =( - const WriterReaderData& x) -{ - - m_writer_guid = x.m_writer_guid; - m_reader_guid = x.m_reader_guid; - m_data = x.m_data; - return *this; -} - -WriterReaderData& WriterReaderData::operator =( - WriterReaderData&& x) noexcept -{ - - m_writer_guid = std::move(x.m_writer_guid); - m_reader_guid = std::move(x.m_reader_guid); - m_data = x.m_data; - return *this; -} - -bool WriterReaderData::operator ==( - const WriterReaderData& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_reader_guid == x.m_reader_guid && - m_data == x.m_data); -} - -bool WriterReaderData::operator !=( - const WriterReaderData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void WriterReaderData::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void WriterReaderData::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ -void WriterReaderData::reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) -{ - m_reader_guid = _reader_guid; -} - -/*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ -void WriterReaderData::reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) -{ - m_reader_guid = std::move(_reader_guid); -} - -/*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const -{ - return m_reader_guid; -} - -/*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() -{ - return m_reader_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void WriterReaderData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float WriterReaderData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& WriterReaderData::data() -{ - return m_data; -} - - - - -Locator2LocatorData::Locator2LocatorData() -{ -} - -Locator2LocatorData::~Locator2LocatorData() -{ -} - -Locator2LocatorData::Locator2LocatorData( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - m_dst_locator = x.m_dst_locator; - m_data = x.m_data; -} - -Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - m_dst_locator = std::move(x.m_dst_locator); - m_data = x.m_data; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - const Locator2LocatorData& x) -{ - - m_src_locator = x.m_src_locator; - m_dst_locator = x.m_dst_locator; - m_data = x.m_data; - return *this; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - Locator2LocatorData&& x) noexcept -{ - - m_src_locator = std::move(x.m_src_locator); - m_dst_locator = std::move(x.m_dst_locator); - m_data = x.m_data; - return *this; -} - -bool Locator2LocatorData::operator ==( - const Locator2LocatorData& x) const -{ - return (m_src_locator == x.m_src_locator && - m_dst_locator == x.m_dst_locator && - m_data == x.m_data); -} - -bool Locator2LocatorData::operator !=( - const Locator2LocatorData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ -void Locator2LocatorData::src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) -{ - m_src_locator = _src_locator; -} - -/*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ -void Locator2LocatorData::src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) -{ - m_src_locator = std::move(_src_locator); -} - -/*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const -{ - return m_src_locator; -} - -/*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() -{ - return m_src_locator; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Locator2LocatorData::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Locator2LocatorData::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void Locator2LocatorData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float Locator2LocatorData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& Locator2LocatorData::data() -{ - return m_data; -} - - - - -EntityData::EntityData() -{ -} - -EntityData::~EntityData() -{ -} - -EntityData::EntityData( - const EntityData& x) -{ - m_guid = x.m_guid; - m_data = x.m_data; -} - -EntityData::EntityData( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - m_data = x.m_data; -} - -EntityData& EntityData::operator =( - const EntityData& x) -{ - - m_guid = x.m_guid; - m_data = x.m_data; - return *this; -} - -EntityData& EntityData::operator =( - EntityData&& x) noexcept -{ - - m_guid = std::move(x.m_guid); - m_data = x.m_data; - return *this; -} - -bool EntityData::operator ==( - const EntityData& x) const -{ - return (m_guid == x.m_guid && - m_data == x.m_data); -} - -bool EntityData::operator !=( - const EntityData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityData::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityData::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void EntityData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float EntityData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& EntityData::data() -{ - return m_data; -} - - - - -PhysicalData::PhysicalData() -{ -} - -PhysicalData::~PhysicalData() -{ -} - -PhysicalData::PhysicalData( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; -} - -PhysicalData::PhysicalData( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); -} - -PhysicalData& PhysicalData::operator =( - const PhysicalData& x) -{ - - m_participant_guid = x.m_participant_guid; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; - return *this; -} - -PhysicalData& PhysicalData::operator =( - PhysicalData&& x) noexcept -{ - - m_participant_guid = std::move(x.m_participant_guid); - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); - return *this; -} - -bool PhysicalData::operator ==( - const PhysicalData& x) const -{ - return (m_participant_guid == x.m_participant_guid && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool PhysicalData::operator !=( - const PhysicalData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ -void PhysicalData::participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) -{ - m_participant_guid = _participant_guid; -} - -/*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ -void PhysicalData::participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) -{ - m_participant_guid = std::move(_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const -{ - return m_participant_guid; -} - -/*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() -{ - return m_participant_guid; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void PhysicalData::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void PhysicalData::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& PhysicalData::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& PhysicalData::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void PhysicalData::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void PhysicalData::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& PhysicalData::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& PhysicalData::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void PhysicalData::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void PhysicalData::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& PhysicalData::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& PhysicalData::process() -{ - return m_process; -} - - - - - -Data::Data() -{ - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; -} - -Data::~Data() -{ -} - -Data::Data( - const Data& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } -} - -Data::Data( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } -} - -Data& Data::operator =( - const Data& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } - - return *this; -} - -Data& Data::operator =( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } - - return *this; -} - -bool Data::operator ==( - const Data& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - return (m_writer_reader_data == x.m_writer_reader_data); - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - return (m_locator2locator_data == x.m_locator2locator_data); - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - return (m_entity_data == x.m_entity_data); - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - return (m_entity2locator_traffic == x.m_entity2locator_traffic); - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - return (m_entity_count == x.m_entity_count); - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - return (m_discovery_time == x.m_discovery_time); - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - return (m_sample_identity_count == x.m_sample_identity_count); - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - return (m_physical_data == x.m_physical_data); - break; - - default: - break; - } - return false; -} - -bool Data::operator !=( - const Data& x) const -{ - return !(*this == x); -} - -void Data::_d( - eprosima::fastdds::statistics::EventKind __d) -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - switch (__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - switch (__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - switch (__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - switch (__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - switch (__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - switch (__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - switch (__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - switch (__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::EventKind Data::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::EventKind& Data::_d() -{ - return m__d; -} - -void Data::writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) -{ - m_writer_reader_data = _writer_reader_data; - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -void Data::writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) -{ - m_writer_reader_data = std::move(_writer_reader_data); - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - -eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - - -void Data::locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) -{ - m_locator2locator_data = _locator2locator_data; - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -void Data::locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) -{ - m_locator2locator_data = std::move(_locator2locator_data); - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - -eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - - -void Data::entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data) -{ - m_entity_data = _entity_data; - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -void Data::entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data) -{ - m_entity_data = std::move(_entity_data); - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -const eprosima::fastdds::statistics::EntityData& Data::entity_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - -eprosima::fastdds::statistics::EntityData& Data::entity_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - - -void Data::entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) -{ - m_entity2locator_traffic = _entity2locator_traffic; - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -void Data::entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) -{ - m_entity2locator_traffic = std::move(_entity2locator_traffic); - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - -eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - - -void Data::entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count) -{ - m_entity_count = _entity_count; - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -void Data::entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count) -{ - m_entity_count = std::move(_entity_count); - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - -eprosima::fastdds::statistics::EntityCount& Data::entity_count() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - - -void Data::discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) -{ - m_discovery_time = _discovery_time; - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -void Data::discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) -{ - m_discovery_time = std::move(_discovery_time); - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - -eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - - -void Data::sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) -{ - m_sample_identity_count = _sample_identity_count; - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -void Data::sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) -{ - m_sample_identity_count = std::move(_sample_identity_count); - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - -eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - - -void Data::physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data) -{ - m_physical_data = _physical_data; - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -void Data::physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data) -{ - m_physical_data = std::move(_physical_data); - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - -eprosima::fastdds::statistics::PhysicalData& Data::physical_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima -// Include auxiliary functions like for serializing/deserializing. -#include "typesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/types.h b/src/cpp/statistics/types/types.h deleted file mode 100644 index c51a79f2044..00000000000 --- a/src/cpp/statistics/types/types.h +++ /dev/null @@ -1,2331 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -/*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ -class EntityId_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - -private: - - std::array m_value{0}; - -}; - - -/*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ -class GuidPrefix_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - -private: - - std::array m_value{0}; - -}; - - -/*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ -class GUID_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - -private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - -}; - - -/*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ -class SequenceNumber_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - -private: - - int32_t m_high{0}; - uint32_t m_low{0}; - -}; - - -/*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ -class SampleIdentity_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - -}; - - -/*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ -class Locator_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - -private: - - int32_t m_kind{0}; - uint32_t m_port{0}; - std::array m_address{0}; - -}; - -} // namespace detail - - -/*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ -class DiscoveryTime -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time{0}; - std::string m_host; - std::string m_user; - std::string m_process; - -}; - - -/*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ -class EntityCount -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count{0}; - -}; - - -/*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ -class SampleIdentityCount -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - -private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count{0}; - -}; - - -/*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ -class Entity2LocatorTraffic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count{0}; - uint64_t m_byte_count{0}; - int16_t m_byte_magnitude_order{0}; - -}; - - -/*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ -class WriterReaderData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ -class Locator2LocatorData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ -class EntityData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ -class PhysicalData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - -}; -/*! - * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. - * @ingroup types - */ -enum EventKindBits : uint32_t -{ - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 -}; -typedef uint32_t EventKind; - - -/*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ -class Data -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - -private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; -}; - -} // namespace statistics - -} // namespace fastdds - -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/types.hpp b/src/cpp/statistics/types/types.hpp new file mode 100644 index 00000000000..308a3dae3d7 --- /dev/null +++ b/src/cpp/statistics/types/types.hpp @@ -0,0 +1,3930 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ + +#include +#include +#include +#include +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + +/*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ +class EntityId_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ +class GuidPrefix_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ +class GUID_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x) + { + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept + { + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x) + { + + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept + { + + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const + { + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); + } + + /*! + * @brief Comparison operator. + * @param x GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const GuidPrefix_s& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + GuidPrefix_s&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const GuidPrefix_s& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport GuidPrefix_s& guidPrefix() + { + return m_guidPrefix; + } + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const EntityId_s& _entityId) + { + m_entityId = _entityId; + } + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + EntityId_s&& _entityId) + { + m_entityId = std::move(_entityId); + } + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const EntityId_s& entityId() const + { + return m_entityId; + } + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport EntityId_s& entityId() + { + return m_entityId; + } + + + +private: + + GuidPrefix_s m_guidPrefix; + EntityId_s m_entityId; + +}; +/*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ +class SequenceNumber_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x) + { + m_high = x.m_high; + + m_low = x.m_low; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept + { + m_high = x.m_high; + m_low = x.m_low; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x) + { + + m_high = x.m_high; + + m_low = x.m_low; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept + { + + m_high = x.m_high; + m_low = x.m_low; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const + { + return (m_high == x.m_high && + m_low == x.m_low); + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high) + { + m_high = _high; + } + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const + { + return m_high; + } + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high() + { + return m_high; + } + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low) + { + m_low = _low; + } + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const + { + return m_low; + } + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low() + { + return m_low; + } + + + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; +/*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentity_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x) + { + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept + { + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x) + { + + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept + { + + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const + { + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const GUID_s& _writer_guid) + { + m_writer_guid = _writer_guid; + } + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + GUID_s&& _writer_guid) + { + m_writer_guid = std::move(_writer_guid); + } + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const GUID_s& writer_guid() const + { + return m_writer_guid; + } + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport GUID_s& writer_guid() + { + return m_writer_guid; + } + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const SequenceNumber_s& _sequence_number) + { + m_sequence_number = _sequence_number; + } + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + SequenceNumber_s&& _sequence_number) + { + m_sequence_number = std::move(_sequence_number); + } + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const SequenceNumber_s& sequence_number() const + { + return m_sequence_number; + } + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport SequenceNumber_s& sequence_number() + { + return m_sequence_number; + } + + + +private: + + GUID_s m_writer_guid; + SequenceNumber_s m_sequence_number; + +}; +/*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ +class Locator_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x) + { + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept + { + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x) + { + + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept + { + + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const + { + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); + } + + /*! + * @brief Comparison operator. + * @param x Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind) + { + m_kind = _kind; + } + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const + { + return m_kind; + } + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind() + { + return m_kind; + } + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port) + { + m_port = _port; + } + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const + { + return m_port; + } + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port() + { + return m_port; + } + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address) + { + m_address = _address; + } + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address) + { + m_address = std::move(_address); + } + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const + { + return m_address; + } + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address() + { + return m_address; + } + + + +private: + + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; + +}; + +} // namespace detail +/*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ +class DiscoveryTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x) + { + m_local_participant_guid = x.m_local_participant_guid; + + m_remote_entity_guid = x.m_remote_entity_guid; + + m_time = x.m_time; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept + { + m_local_participant_guid = std::move(x.m_local_participant_guid); + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + m_time = x.m_time; + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x) + { + + m_local_participant_guid = x.m_local_participant_guid; + + m_remote_entity_guid = x.m_remote_entity_guid; + + m_time = x.m_time; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept + { + + m_local_participant_guid = std::move(x.m_local_participant_guid); + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + m_time = x.m_time; + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const + { + return (m_local_participant_guid == x.m_local_participant_guid && + m_remote_entity_guid == x.m_remote_entity_guid && + m_time == x.m_time && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); + } + + /*! + * @brief Comparison operator. + * @param x DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const detail::GUID_s& _local_participant_guid) + { + m_local_participant_guid = _local_participant_guid; + } + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + detail::GUID_s&& _local_participant_guid) + { + m_local_participant_guid = std::move(_local_participant_guid); + } + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const detail::GUID_s& local_participant_guid() const + { + return m_local_participant_guid; + } + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport detail::GUID_s& local_participant_guid() + { + return m_local_participant_guid; + } + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const detail::GUID_s& _remote_entity_guid) + { + m_remote_entity_guid = _remote_entity_guid; + } + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + detail::GUID_s&& _remote_entity_guid) + { + m_remote_entity_guid = std::move(_remote_entity_guid); + } + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const detail::GUID_s& remote_entity_guid() const + { + return m_remote_entity_guid; + } + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport detail::GUID_s& remote_entity_guid() + { + return m_remote_entity_guid; + } + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time) + { + m_time = _time; + } + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const + { + return m_time; + } + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time() + { + return m_time; + } + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host) + { + m_host = _host; + } + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host) + { + m_host = std::move(_host); + } + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const + { + return m_host; + } + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host() + { + return m_host; + } + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user) + { + m_user = _user; + } + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user) + { + m_user = std::move(_user); + } + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const + { + return m_user; + } + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user() + { + return m_user; + } + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process) + { + m_process = _process; + } + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process) + { + m_process = std::move(_process); + } + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const + { + return m_process; + } + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process() + { + return m_process; + } + + + +private: + + detail::GUID_s m_local_participant_guid; + detail::GUID_s m_remote_entity_guid; + uint64_t m_time{0}; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +/*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ +class EntityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x) + { + m_guid = x.m_guid; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept + { + m_guid = std::move(x.m_guid); + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x) + { + + m_guid = x.m_guid; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept + { + + m_guid = std::move(x.m_guid); + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const + { + return (m_guid == x.m_guid && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count() + { + return m_count; + } + + + +private: + + detail::GUID_s m_guid; + uint64_t m_count{0}; + +}; +/*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x) + { + m_sample_id = x.m_sample_id; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept + { + m_sample_id = std::move(x.m_sample_id); + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x) + { + + m_sample_id = x.m_sample_id; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept + { + + m_sample_id = std::move(x.m_sample_id); + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const + { + return (m_sample_id == x.m_sample_id && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const detail::SampleIdentity_s& _sample_id) + { + m_sample_id = _sample_id; + } + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + detail::SampleIdentity_s&& _sample_id) + { + m_sample_id = std::move(_sample_id); + } + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const detail::SampleIdentity_s& sample_id() const + { + return m_sample_id; + } + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport detail::SampleIdentity_s& sample_id() + { + return m_sample_id; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count() + { + return m_count; + } + + + +private: + + detail::SampleIdentity_s m_sample_id; + uint64_t m_count{0}; + +}; +/*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ +class Entity2LocatorTraffic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x) + { + m_src_guid = x.m_src_guid; + + m_dst_locator = x.m_dst_locator; + + m_packet_count = x.m_packet_count; + + m_byte_count = x.m_byte_count; + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept + { + m_src_guid = std::move(x.m_src_guid); + m_dst_locator = std::move(x.m_dst_locator); + m_packet_count = x.m_packet_count; + m_byte_count = x.m_byte_count; + m_byte_magnitude_order = x.m_byte_magnitude_order; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x) + { + + m_src_guid = x.m_src_guid; + + m_dst_locator = x.m_dst_locator; + + m_packet_count = x.m_packet_count; + + m_byte_count = x.m_byte_count; + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept + { + + m_src_guid = std::move(x.m_src_guid); + m_dst_locator = std::move(x.m_dst_locator); + m_packet_count = x.m_packet_count; + m_byte_count = x.m_byte_count; + m_byte_magnitude_order = x.m_byte_magnitude_order; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const + { + return (m_src_guid == x.m_src_guid && + m_dst_locator == x.m_dst_locator && + m_packet_count == x.m_packet_count && + m_byte_count == x.m_byte_count && + m_byte_magnitude_order == x.m_byte_magnitude_order); + } + + /*! + * @brief Comparison operator. + * @param x Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const detail::GUID_s& _src_guid) + { + m_src_guid = _src_guid; + } + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + detail::GUID_s&& _src_guid) + { + m_src_guid = std::move(_src_guid); + } + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const detail::GUID_s& src_guid() const + { + return m_src_guid; + } + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport detail::GUID_s& src_guid() + { + return m_src_guid; + } + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const detail::Locator_s& _dst_locator) + { + m_dst_locator = _dst_locator; + } + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + detail::Locator_s&& _dst_locator) + { + m_dst_locator = std::move(_dst_locator); + } + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const detail::Locator_s& dst_locator() const + { + return m_dst_locator; + } + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport detail::Locator_s& dst_locator() + { + return m_dst_locator; + } + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count) + { + m_packet_count = _packet_count; + } + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const + { + return m_packet_count; + } + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count() + { + return m_packet_count; + } + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count) + { + m_byte_count = _byte_count; + } + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const + { + return m_byte_count; + } + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count() + { + return m_byte_count; + } + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order) + { + m_byte_magnitude_order = _byte_magnitude_order; + } + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const + { + return m_byte_magnitude_order; + } + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order() + { + return m_byte_magnitude_order; + } + + + +private: + + detail::GUID_s m_src_guid; + detail::Locator_s m_dst_locator; + uint64_t m_packet_count{0}; + uint64_t m_byte_count{0}; + int16_t m_byte_magnitude_order{0}; + +}; +/*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ +class WriterReaderData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x) + { + m_writer_guid = x.m_writer_guid; + + m_reader_guid = x.m_reader_guid; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept + { + m_writer_guid = std::move(x.m_writer_guid); + m_reader_guid = std::move(x.m_reader_guid); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x) + { + + m_writer_guid = x.m_writer_guid; + + m_reader_guid = x.m_reader_guid; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept + { + + m_writer_guid = std::move(x.m_writer_guid); + m_reader_guid = std::move(x.m_reader_guid); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const + { + return (m_writer_guid == x.m_writer_guid && + m_reader_guid == x.m_reader_guid && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const detail::GUID_s& _writer_guid) + { + m_writer_guid = _writer_guid; + } + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + detail::GUID_s&& _writer_guid) + { + m_writer_guid = std::move(_writer_guid); + } + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const detail::GUID_s& writer_guid() const + { + return m_writer_guid; + } + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport detail::GUID_s& writer_guid() + { + return m_writer_guid; + } + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const detail::GUID_s& _reader_guid) + { + m_reader_guid = _reader_guid; + } + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + detail::GUID_s&& _reader_guid) + { + m_reader_guid = std::move(_reader_guid); + } + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const detail::GUID_s& reader_guid() const + { + return m_reader_guid; + } + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport detail::GUID_s& reader_guid() + { + return m_reader_guid; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::GUID_s m_writer_guid; + detail::GUID_s m_reader_guid; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ +class Locator2LocatorData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x) + { + m_src_locator = x.m_src_locator; + + m_dst_locator = x.m_dst_locator; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept + { + m_src_locator = std::move(x.m_src_locator); + m_dst_locator = std::move(x.m_dst_locator); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x) + { + + m_src_locator = x.m_src_locator; + + m_dst_locator = x.m_dst_locator; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept + { + + m_src_locator = std::move(x.m_src_locator); + m_dst_locator = std::move(x.m_dst_locator); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const + { + return (m_src_locator == x.m_src_locator && + m_dst_locator == x.m_dst_locator && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const detail::Locator_s& _src_locator) + { + m_src_locator = _src_locator; + } + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + detail::Locator_s&& _src_locator) + { + m_src_locator = std::move(_src_locator); + } + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const detail::Locator_s& src_locator() const + { + return m_src_locator; + } + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport detail::Locator_s& src_locator() + { + return m_src_locator; + } + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const detail::Locator_s& _dst_locator) + { + m_dst_locator = _dst_locator; + } + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + detail::Locator_s&& _dst_locator) + { + m_dst_locator = std::move(_dst_locator); + } + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const detail::Locator_s& dst_locator() const + { + return m_dst_locator; + } + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport detail::Locator_s& dst_locator() + { + return m_dst_locator; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::Locator_s m_src_locator; + detail::Locator_s m_dst_locator; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ +class EntityData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x) + { + m_guid = x.m_guid; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept + { + m_guid = std::move(x.m_guid); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x) + { + + m_guid = x.m_guid; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept + { + + m_guid = std::move(x.m_guid); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const + { + return (m_guid == x.m_guid && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::GUID_s m_guid; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ +class PhysicalData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x) + { + m_participant_guid = x.m_participant_guid; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept + { + m_participant_guid = std::move(x.m_participant_guid); + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x) + { + + m_participant_guid = x.m_participant_guid; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept + { + + m_participant_guid = std::move(x.m_participant_guid); + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const + { + return (m_participant_guid == x.m_participant_guid && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); + } + + /*! + * @brief Comparison operator. + * @param x PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const detail::GUID_s& _participant_guid) + { + m_participant_guid = _participant_guid; + } + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + detail::GUID_s&& _participant_guid) + { + m_participant_guid = std::move(_participant_guid); + } + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const detail::GUID_s& participant_guid() const + { + return m_participant_guid; + } + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport detail::GUID_s& participant_guid() + { + return m_participant_guid; + } + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host) + { + m_host = _host; + } + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host) + { + m_host = std::move(_host); + } + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const + { + return m_host; + } + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host() + { + return m_host; + } + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user) + { + m_user = _user; + } + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user) + { + m_user = std::move(_user); + } + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const + { + return m_user; + } + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user() + { + return m_user; + } + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process) + { + m_process = _process; + } + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process) + { + m_process = std::move(_process); + } + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const + { + return m_process; + } + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process() + { + return m_process; + } + + + +private: + + detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +namespace EventKind { + +const uint32_t HISTORY2HISTORY_LATENCY = 0x1; +const uint32_t NETWORK_LATENCY = 0x2; +const uint32_t PUBLICATION_THROUGHPUT = 0x4; +const uint32_t SUBSCRIPTION_THROUGHPUT = 0x8; +const uint32_t RTPS_SENT = 0x10; +const uint32_t RTPS_LOST = 0x20; +const uint32_t RESENT_DATAS = 0x40; +const uint32_t HEARTBEAT_COUNT = 0x80; +const uint32_t ACKNACK_COUNT = 0x100; +const uint32_t NACKFRAG_COUNT = 0x200; +const uint32_t GAP_COUNT = 0x400; +const uint32_t DATA_COUNT = 0x800; +const uint32_t PDP_PACKETS = 0x1000; +const uint32_t EDP_PACKETS = 0x2000; +const uint32_t DISCOVERED_ENTITY = 0x4000; +const uint32_t SAMPLE_DATAS = 0x8000; +const uint32_t PHYSICAL_DATA = 0x10000; + +} // namespace EventKind +/*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ +class Data +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = x.m_writer_reader_data; + break; + + case 0x00000002: + locator2locator_data_() = x.m_locator2locator_data; + break; + + case 0x00000003: + entity_data_() = x.m_entity_data; + break; + + case 0x00000004: + entity2locator_traffic_() = x.m_entity2locator_traffic; + break; + + case 0x00000005: + entity_count_() = x.m_entity_count; + break; + + case 0x00000006: + discovery_time_() = x.m_discovery_time; + break; + + case 0x00000007: + sample_identity_count_() = x.m_sample_identity_count; + break; + + case 0x00000008: + physical_data_() = x.m_physical_data; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = std::move(x.m_writer_reader_data); + break; + + case 0x00000002: + locator2locator_data_() = std::move(x.m_locator2locator_data); + break; + + case 0x00000003: + entity_data_() = std::move(x.m_entity_data); + break; + + case 0x00000004: + entity2locator_traffic_() = std::move(x.m_entity2locator_traffic); + break; + + case 0x00000005: + entity_count_() = std::move(x.m_entity_count); + break; + + case 0x00000006: + discovery_time_() = std::move(x.m_discovery_time); + break; + + case 0x00000007: + sample_identity_count_() = std::move(x.m_sample_identity_count); + break; + + case 0x00000008: + physical_data_() = std::move(x.m_physical_data); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = x.m_writer_reader_data; + break; + + case 0x00000002: + locator2locator_data_() = x.m_locator2locator_data; + break; + + case 0x00000003: + entity_data_() = x.m_entity_data; + break; + + case 0x00000004: + entity2locator_traffic_() = x.m_entity2locator_traffic; + break; + + case 0x00000005: + entity_count_() = x.m_entity_count; + break; + + case 0x00000006: + discovery_time_() = x.m_discovery_time; + break; + + case 0x00000007: + sample_identity_count_() = x.m_sample_identity_count; + break; + + case 0x00000008: + physical_data_() = x.m_physical_data; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = std::move(x.m_writer_reader_data); + break; + + case 0x00000002: + locator2locator_data_() = std::move(x.m_locator2locator_data); + break; + + case 0x00000003: + entity_data_() = std::move(x.m_entity_data); + break; + + case 0x00000004: + entity2locator_traffic_() = std::move(x.m_entity2locator_traffic); + break; + + case 0x00000005: + entity_count_() = std::move(x.m_entity_count); + break; + + case 0x00000006: + discovery_time_() = std::move(x.m_discovery_time); + break; + + case 0x00000007: + sample_identity_count_() = std::move(x.m_sample_identity_count); + break; + + case 0x00000008: + physical_data_() = std::move(x.m_physical_data); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_writer_reader_data == x.m_writer_reader_data); + break; + + case 0x00000002: + ret_value = (m_locator2locator_data == x.m_locator2locator_data); + break; + + case 0x00000003: + ret_value = (m_entity_data == x.m_entity_data); + break; + + case 0x00000004: + ret_value = (m_entity2locator_traffic == x.m_entity2locator_traffic); + break; + + case 0x00000005: + ret_value = (m_entity_count == x.m_entity_count); + break; + + case 0x00000006: + ret_value = (m_discovery_time == x.m_discovery_time); + break; + + case 0x00000007: + ret_value = (m_sample_identity_count == x.m_sample_identity_count); + break; + + case 0x00000008: + ret_value = (m_physical_data == x.m_physical_data); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EventKind::HISTORY2HISTORY_LATENCY: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::NETWORK_LATENCY: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::DISCOVERED_ENTITY: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::SAMPLE_DATAS: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::PHYSICAL_DATA: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const WriterReaderData& _writer_reader_data) + { + writer_reader_data_() = _writer_reader_data; + m__d = EventKind::HISTORY2HISTORY_LATENCY; + } + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + WriterReaderData&& _writer_reader_data) + { + writer_reader_data_() = _writer_reader_data; + m__d = EventKind::HISTORY2HISTORY_LATENCY; + } + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const WriterReaderData& writer_reader_data() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; + } + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport WriterReaderData& writer_reader_data() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; + } + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const Locator2LocatorData& _locator2locator_data) + { + locator2locator_data_() = _locator2locator_data; + m__d = EventKind::NETWORK_LATENCY; + } + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + Locator2LocatorData&& _locator2locator_data) + { + locator2locator_data_() = _locator2locator_data; + m__d = EventKind::NETWORK_LATENCY; + } + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const Locator2LocatorData& locator2locator_data() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; + } + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport Locator2LocatorData& locator2locator_data() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; + } + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const EntityData& _entity_data) + { + entity_data_() = _entity_data; + m__d = EventKind::PUBLICATION_THROUGHPUT; + } + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + EntityData&& _entity_data) + { + entity_data_() = _entity_data; + m__d = EventKind::PUBLICATION_THROUGHPUT; + } + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EntityData& entity_data() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_data; + } + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EntityData& entity_data() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_data; + } + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const Entity2LocatorTraffic& _entity2locator_traffic) + { + entity2locator_traffic_() = _entity2locator_traffic; + m__d = EventKind::RTPS_SENT; + } + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + Entity2LocatorTraffic&& _entity2locator_traffic) + { + entity2locator_traffic_() = _entity2locator_traffic; + m__d = EventKind::RTPS_SENT; + } + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const Entity2LocatorTraffic& entity2locator_traffic() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; + } + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport Entity2LocatorTraffic& entity2locator_traffic() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; + } + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const EntityCount& _entity_count) + { + entity_count_() = _entity_count; + m__d = EventKind::RESENT_DATAS; + } + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + EntityCount&& _entity_count) + { + entity_count_() = _entity_count; + m__d = EventKind::RESENT_DATAS; + } + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EntityCount& entity_count() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_count; + } + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EntityCount& entity_count() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_count; + } + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const DiscoveryTime& _discovery_time) + { + discovery_time_() = _discovery_time; + m__d = EventKind::DISCOVERED_ENTITY; + } + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + DiscoveryTime&& _discovery_time) + { + discovery_time_() = _discovery_time; + m__d = EventKind::DISCOVERED_ENTITY; + } + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const DiscoveryTime& discovery_time() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_discovery_time; + } + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport DiscoveryTime& discovery_time() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_discovery_time; + } + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const SampleIdentityCount& _sample_identity_count) + { + sample_identity_count_() = _sample_identity_count; + m__d = EventKind::SAMPLE_DATAS; + } + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + SampleIdentityCount&& _sample_identity_count) + { + sample_identity_count_() = _sample_identity_count; + m__d = EventKind::SAMPLE_DATAS; + } + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SampleIdentityCount& sample_identity_count() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; + } + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SampleIdentityCount& sample_identity_count() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; + } + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const PhysicalData& _physical_data) + { + physical_data_() = _physical_data; + m__d = EventKind::PHYSICAL_DATA; + } + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + PhysicalData&& _physical_data) + { + physical_data_() = _physical_data; + m__d = EventKind::PHYSICAL_DATA; + } + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PhysicalData& physical_data() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_physical_data; + } + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PhysicalData& physical_data() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_physical_data; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + WriterReaderData& writer_reader_data_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_writer_reader_data.~WriterReaderData();}; + new(&m_writer_reader_data) WriterReaderData(); + ; + } + + return m_writer_reader_data; + } + + Locator2LocatorData& locator2locator_data_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_locator2locator_data.~Locator2LocatorData();}; + new(&m_locator2locator_data) Locator2LocatorData(); + ; + } + + return m_locator2locator_data; + } + + EntityData& entity_data_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_entity_data.~EntityData();}; + new(&m_entity_data) EntityData(); + ; + } + + return m_entity_data; + } + + Entity2LocatorTraffic& entity2locator_traffic_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_entity2locator_traffic.~Entity2LocatorTraffic();}; + new(&m_entity2locator_traffic) Entity2LocatorTraffic(); + ; + } + + return m_entity2locator_traffic; + } + + EntityCount& entity_count_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_entity_count.~EntityCount();}; + new(&m_entity_count) EntityCount(); + ; + } + + return m_entity_count; + } + + DiscoveryTime& discovery_time_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_discovery_time.~DiscoveryTime();}; + new(&m_discovery_time) DiscoveryTime(); + ; + } + + return m_discovery_time; + } + + SampleIdentityCount& sample_identity_count_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_sample_identity_count.~SampleIdentityCount();}; + new(&m_sample_identity_count) SampleIdentityCount(); + ; + } + + return m_sample_identity_count; + } + + PhysicalData& physical_data_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_physical_data.~PhysicalData();}; + new(&m_physical_data) PhysicalData(); + ; + } + + return m_physical_data; + } + + + uint32_t m__d {1}; + + union + { + WriterReaderData m_writer_reader_data; + Locator2LocatorData m_locator2locator_data; + EntityData m_entity_data; + Entity2LocatorTraffic m_entity2locator_traffic; + EntityCount m_entity_count; + DiscoveryTime m_discovery_time; + SampleIdentityCount m_sample_identity_count; + PhysicalData m_physical_data; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ + + diff --git a/src/cpp/statistics/types/typesCdrAux.hpp b/src/cpp/statistics/types/typesCdrAux.hpp index 92b36ffa689..d331c557176 100644 --- a/src/cpp/statistics/types/typesCdrAux.hpp +++ b/src/cpp/statistics/types/typesCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ -#include "types.h" +#include "types.hpp" constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize {852UL}; constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize {56UL}; @@ -30,7 +30,6 @@ constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesiz constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize {812UL}; constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize {28UL}; - constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize {28UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize {0UL}; @@ -75,87 +74,58 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data); - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data); @@ -163,12 +133,6 @@ eProsima_user_DllExport void serialize_key( - - - - - - } // namespace fastcdr } // namespace eprosima diff --git a/src/cpp/statistics/types/typesCdrAux.ipp b/src/cpp/statistics/types/typesCdrAux.ipp index 28b168d672d..b8d5a1d7f81 100644 --- a/src/cpp/statistics/types/typesCdrAux.ipp +++ b/src/cpp/statistics/types/typesCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -120,8 +118,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -206,8 +202,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -300,8 +294,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -394,8 +386,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -488,8 +478,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -590,9 +578,6 @@ void serialize_key( } - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -725,8 +710,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -822,8 +805,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -919,8 +900,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1044,8 +1023,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1151,8 +1128,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1258,8 +1233,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1355,8 +1328,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1471,8 +1442,6 @@ void serialize_key( - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1495,51 +1464,51 @@ eProsima_user_DllExport size_t calculate_serialized_size( switch (data._d()) { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), data.writer_reader_data(), current_alignment); break; - case eprosima::fastdds::statistics::NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), data.locator2locator_data(), current_alignment); break; - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), data.entity_data(), current_alignment); break; - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), data.entity2locator_traffic(), current_alignment); break; - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), data.entity_count(), current_alignment); break; - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), data.discovery_time(), current_alignment); break; - case eprosima::fastdds::statistics::SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), data.sample_identity_count(), current_alignment); break; - case eprosima::fastdds::statistics::PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), data.physical_data(), current_alignment); break; @@ -1571,44 +1540,44 @@ eProsima_user_DllExport void serialize( switch (data._d()) { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: scdr << eprosima::fastcdr::MemberId(1) << data.writer_reader_data(); break; - case eprosima::fastdds::statistics::NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: scdr << eprosima::fastcdr::MemberId(2) << data.locator2locator_data(); break; - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: scdr << eprosima::fastcdr::MemberId(3) << data.entity_data(); break; - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: scdr << eprosima::fastcdr::MemberId(4) << data.entity2locator_traffic(); break; - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: scdr << eprosima::fastcdr::MemberId(5) << data.entity_count(); break; - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: scdr << eprosima::fastcdr::MemberId(6) << data.discovery_time(); break; - case eprosima::fastdds::statistics::SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: scdr << eprosima::fastcdr::MemberId(7) << data.sample_identity_count(); break; - case eprosima::fastdds::statistics::PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: scdr << eprosima::fastcdr::MemberId(8) << data.physical_data(); break; @@ -1632,69 +1601,146 @@ eProsima_user_DllExport void deserialize( [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { bool ret_value = true; - switch (mid.id) + if (0 == mid.id) { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - dcdr >> data.writer_reader_data(); - break; - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - dcdr >> data.locator2locator_data(); - break; - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - dcdr >> data.entity_data(); - break; - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - dcdr >> data.entity2locator_traffic(); - break; - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - dcdr >> data.entity_count(); - break; - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - dcdr >> data.discovery_time(); - break; - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - dcdr >> data.sample_identity_count(); - break; - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - dcdr >> data.physical_data(); - break; - - default: - break; - } - ret_value = false; - break; + uint32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case EventKind::HISTORY2HISTORY_LATENCY: + { + eprosima::fastdds::statistics::WriterReaderData writer_reader_data_value; + data.writer_reader_data(std::move(writer_reader_data_value)); + data._d(discriminator); + break; + } + + case EventKind::NETWORK_LATENCY: + { + eprosima::fastdds::statistics::Locator2LocatorData locator2locator_data_value; + data.locator2locator_data(std::move(locator2locator_data_value)); + data._d(discriminator); + break; + } + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + { + eprosima::fastdds::statistics::EntityData entity_data_value; + data.entity_data(std::move(entity_data_value)); + data._d(discriminator); + break; + } + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + { + eprosima::fastdds::statistics::Entity2LocatorTraffic entity2locator_traffic_value; + data.entity2locator_traffic(std::move(entity2locator_traffic_value)); + data._d(discriminator); + break; + } + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + { + eprosima::fastdds::statistics::EntityCount entity_count_value; + data.entity_count(std::move(entity_count_value)); + data._d(discriminator); + break; + } + + case EventKind::DISCOVERED_ENTITY: + { + eprosima::fastdds::statistics::DiscoveryTime discovery_time_value; + data.discovery_time(std::move(discovery_time_value)); + data._d(discriminator); + break; + } + + case EventKind::SAMPLE_DATAS: + { + eprosima::fastdds::statistics::SampleIdentityCount sample_identity_count_value; + data.sample_identity_count(std::move(sample_identity_count_value)); + data._d(discriminator); + break; + } + + case EventKind::PHYSICAL_DATA: + { + eprosima::fastdds::statistics::PhysicalData physical_data_value; + data.physical_data(std::move(physical_data_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case EventKind::HISTORY2HISTORY_LATENCY: + dcdr >> data.writer_reader_data(); + break; + + case EventKind::NETWORK_LATENCY: + dcdr >> data.locator2locator_data(); + break; + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + dcdr >> data.entity_data(); + break; + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + dcdr >> data.entity2locator_traffic(); + break; + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + dcdr >> data.entity_count(); + break; + + case EventKind::DISCOVERED_ENTITY: + dcdr >> data.discovery_time(); + break; + + case EventKind::SAMPLE_DATAS: + dcdr >> data.sample_identity_count(); + break; + + case EventKind::PHYSICAL_DATA: + dcdr >> data.physical_data(); + break; + + default: + break; + } + ret_value = false; } return ret_value; }); } - - - } // namespace fastcdr } // namespace eprosima diff --git a/src/cpp/statistics/types/typesPubSubTypes.cxx b/src/cpp/statistics/types/typesPubSubTypes.cxx index 5d92b732491..582e4152f52 100644 --- a/src/cpp/statistics/types/typesPubSubTypes.cxx +++ b/src/cpp/statistics/types/typesPubSubTypes.cxx @@ -19,11 +19,13 @@ * This file was generated by the tool fastddsgen. */ +#include "typesPubSubTypes.h" +#include #include -#include "typesPubSubTypes.h" #include "typesCdrAux.hpp" +#include "typesTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -33,8 +35,6 @@ namespace eprosima { namespace fastdds { namespace statistics { namespace detail { - - EntityId_sPubSubType::EntityId_sPubSubType() { setName("eprosima::fastdds::statistics::detail::EntityId_s"); @@ -223,7 +223,10 @@ namespace eprosima { return true; } - + void EntityId_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } GuidPrefix_sPubSubType::GuidPrefix_sPubSubType() { @@ -413,7 +416,10 @@ namespace eprosima { return true; } - + void GuidPrefix_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } GUID_sPubSubType::GUID_sPubSubType() { @@ -603,7 +609,10 @@ namespace eprosima { return true; } - + void GUID_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SequenceNumber_sPubSubType::SequenceNumber_sPubSubType() { @@ -793,7 +802,10 @@ namespace eprosima { return true; } - + void SequenceNumber_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SampleIdentity_sPubSubType::SampleIdentity_sPubSubType() { @@ -983,7 +995,10 @@ namespace eprosima { return true; } - + void SampleIdentity_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Locator_sPubSubType::Locator_sPubSubType() { @@ -1173,10 +1188,12 @@ namespace eprosima { return true; } + void Locator_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } - } //End of namespace detail - - + } // namespace detail DiscoveryTimePubSubType::DiscoveryTimePubSubType() { @@ -1366,7 +1383,10 @@ namespace eprosima { return true; } - + void DiscoveryTimePubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } EntityCountPubSubType::EntityCountPubSubType() { @@ -1556,7 +1576,10 @@ namespace eprosima { return true; } - + void EntityCountPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SampleIdentityCountPubSubType::SampleIdentityCountPubSubType() { @@ -1746,7 +1769,10 @@ namespace eprosima { return true; } - + void SampleIdentityCountPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Entity2LocatorTrafficPubSubType::Entity2LocatorTrafficPubSubType() { @@ -1936,7 +1962,10 @@ namespace eprosima { return true; } - + void Entity2LocatorTrafficPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } WriterReaderDataPubSubType::WriterReaderDataPubSubType() { @@ -2126,7 +2155,10 @@ namespace eprosima { return true; } - + void WriterReaderDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Locator2LocatorDataPubSubType::Locator2LocatorDataPubSubType() { @@ -2316,7 +2348,10 @@ namespace eprosima { return true; } - + void Locator2LocatorDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } EntityDataPubSubType::EntityDataPubSubType() { @@ -2506,7 +2541,10 @@ namespace eprosima { return true; } - + void EntityDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } PhysicalDataPubSubType::PhysicalDataPubSubType() { @@ -2696,17 +2734,21 @@ namespace eprosima { return true; } + void PhysicalDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } + namespace EventKind { + } // namespace EventKind + } // namespace statistics + } // namespace fastdds +} // namespace eprosima - } //End of namespace statistics - - - } //End of namespace fastdds - - -} //End of namespace eprosima +// Include auxiliary functions like for serializing/deserializing. +#include "typesCdrAux.ipp" diff --git a/src/cpp/statistics/types/typesPubSubTypes.h b/src/cpp/statistics/types/typesPubSubTypes.h index 33e545416c8..a235ad9169c 100644 --- a/src/cpp/statistics/types/typesPubSubTypes.h +++ b/src/cpp/statistics/types/typesPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "types.h" +#include "types.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -46,8 +46,6 @@ namespace eprosima namespace detail { - - /*! * @brief This class represents the TopicDataType of the type EntityId_s defined by the user in the IDL file. * @ingroup types @@ -98,6 +96,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -136,8 +137,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type GuidPrefix_s defined by the user in the IDL file. * @ingroup types @@ -188,6 +187,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -226,8 +228,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type GUID_s defined by the user in the IDL file. * @ingroup types @@ -278,6 +278,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -316,8 +319,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SequenceNumber_s defined by the user in the IDL file. * @ingroup types @@ -368,6 +369,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -406,8 +410,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SampleIdentity_s defined by the user in the IDL file. * @ingroup types @@ -458,6 +460,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -496,8 +501,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Locator_s defined by the user in the IDL file. * @ingroup types @@ -548,6 +551,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -585,9 +591,7 @@ namespace eprosima unsigned char* m_keyBuffer; }; - } - - + } // namespace detail /*! * @brief This class represents the TopicDataType of the type DiscoveryTime defined by the user in the IDL file. @@ -639,6 +643,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -677,8 +684,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type EntityCount defined by the user in the IDL file. * @ingroup types @@ -729,6 +734,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -767,8 +775,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SampleIdentityCount defined by the user in the IDL file. * @ingroup types @@ -819,6 +825,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -857,8 +866,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Entity2LocatorTraffic defined by the user in the IDL file. * @ingroup types @@ -909,6 +916,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -947,8 +957,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type WriterReaderData defined by the user in the IDL file. * @ingroup types @@ -999,6 +1007,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1037,8 +1048,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Locator2LocatorData defined by the user in the IDL file. * @ingroup types @@ -1089,6 +1098,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1127,8 +1139,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type EntityData defined by the user in the IDL file. * @ingroup types @@ -1179,6 +1189,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1217,8 +1230,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type PhysicalData defined by the user in the IDL file. * @ingroup types @@ -1269,6 +1280,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1306,14 +1320,13 @@ namespace eprosima unsigned char* m_keyBuffer; }; + namespace EventKind + { + } // namespace EventKind - - - - - } - } -} + } // namespace statistics + } // namespace fastdds +} // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_PUBSUBTYPES_H_ diff --git a/src/cpp/statistics/types/typesTypeObjectSupport.cxx b/src/cpp/statistics/types/typesTypeObjectSupport.cxx new file mode 100644 index 00000000000..94c1288292e --- /dev/null +++ b/src/cpp/statistics/types/typesTypeObjectSupport.cxx @@ -0,0 +1,19540 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file typesTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "typesTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "types.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_types_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Data_type_identifier(); + + }); +} + +namespace eprosima { +namespace fastdds { +namespace statistics { +namespace detail { +void register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier() +{ + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier() +{ + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier() +{ + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier() +{ + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier() +{ + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace detail +void register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier() +{ + { + StructTypeFlag struct_flags_DiscoveryTime = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DiscoveryTime; + TypeIdentifierPair type_ids_DiscoveryTime; + QualifiedTypeName type_name_DiscoveryTime = "eprosima::fastdds::statistics::DiscoveryTime"; + eprosima::fastcdr::optional type_ann_builtin_DiscoveryTime; + eprosima::fastcdr::optional ann_custom_DiscoveryTime; + CompleteTypeDetail detail_DiscoveryTime = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DiscoveryTime, ann_custom_DiscoveryTime, type_name_DiscoveryTime.to_string()); + CompleteStructHeader header_DiscoveryTime; + header_DiscoveryTime = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DiscoveryTime); + CompleteStructMemberSeq member_seq_DiscoveryTime; + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_participant_guid; + MemberId member_id_local_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_participant_guid = "local_participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_local_participant_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_participant_guid; + eprosima::fastcdr::optional unit_local_participant_guid; + eprosima::fastcdr::optional min_local_participant_guid; + eprosima::fastcdr::optional max_local_participant_guid; + eprosima::fastcdr::optional hash_id_local_participant_guid; + if (unit_local_participant_guid.has_value() || min_local_participant_guid.has_value() || max_local_participant_guid.has_value() || hash_id_local_participant_guid.has_value()) + { + member_ann_builtin_local_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_participant_guid, min_local_participant_guid, max_local_participant_guid, hash_id_local_participant_guid); + } + if (!tmp_ann_custom_local_participant_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_local_participant_guid; + } + CompleteMemberDetail detail_local_participant_guid = TypeObjectUtils::build_complete_member_detail(name_local_participant_guid, member_ann_builtin_local_participant_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_local_participant_guid = TypeObjectUtils::build_complete_struct_member(common_local_participant_guid, detail_local_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_local_participant_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_remote_entity_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_remote_entity_guid; + MemberId member_id_remote_entity_guid = 0x00000001; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure remote_entity_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_remote_entity_guid = "remote_entity_guid"; + eprosima::fastcdr::optional member_ann_builtin_remote_entity_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_remote_entity_guid; + eprosima::fastcdr::optional unit_remote_entity_guid; + eprosima::fastcdr::optional min_remote_entity_guid; + eprosima::fastcdr::optional max_remote_entity_guid; + eprosima::fastcdr::optional hash_id_remote_entity_guid; + if (unit_remote_entity_guid.has_value() || min_remote_entity_guid.has_value() || max_remote_entity_guid.has_value() || hash_id_remote_entity_guid.has_value()) + { + member_ann_builtin_remote_entity_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_remote_entity_guid, min_remote_entity_guid, max_remote_entity_guid, hash_id_remote_entity_guid); + } + if (!tmp_ann_custom_remote_entity_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_remote_entity_guid; + } + CompleteMemberDetail detail_remote_entity_guid = TypeObjectUtils::build_complete_member_detail(name_remote_entity_guid, member_ann_builtin_remote_entity_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_remote_entity_guid = TypeObjectUtils::build_complete_struct_member(common_remote_entity_guid, detail_remote_entity_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_remote_entity_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "time Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_time = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_time; + MemberId member_id_time = 0x00000002; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure time member TypeIdentifier inconsistent."); + return; + } + MemberName name_time = "time"; + eprosima::fastcdr::optional member_ann_builtin_time; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_time = TypeObjectUtils::build_complete_member_detail(name_time, member_ann_builtin_time, ann_custom_DiscoveryTime); + CompleteStructMember member_time = TypeObjectUtils::build_complete_struct_member(common_time, detail_time); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_time); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000003; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_DiscoveryTime); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_host); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000004; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_DiscoveryTime); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_user); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000005; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_DiscoveryTime); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_process); + } + CompleteStructType struct_type_DiscoveryTime = TypeObjectUtils::build_complete_struct_type(struct_flags_DiscoveryTime, header_DiscoveryTime, member_seq_DiscoveryTime); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DiscoveryTime, type_name_DiscoveryTime.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime already registered in TypeObjectRegistry for a different type."); + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_EntityCount_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityCount; + TypeIdentifierPair type_ids_EntityCount; + QualifiedTypeName type_name_EntityCount = "eprosima::fastdds::statistics::EntityCount"; + eprosima::fastcdr::optional type_ann_builtin_EntityCount; + eprosima::fastcdr::optional ann_custom_EntityCount; + CompleteTypeDetail detail_EntityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityCount, ann_custom_EntityCount, type_name_EntityCount.to_string()); + CompleteStructHeader header_EntityCount; + header_EntityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityCount); + CompleteStructMemberSeq member_seq_EntityCount; + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityCount = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityCount); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_guid); + } + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_EntityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_EntityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_count); + } + CompleteStructType struct_type_EntityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityCount, header_EntityCount, member_seq_EntityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityCount, type_name_EntityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_EntityCount); + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier() +{ + { + StructTypeFlag struct_flags_SampleIdentityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentityCount; + TypeIdentifierPair type_ids_SampleIdentityCount; + QualifiedTypeName type_name_SampleIdentityCount = "eprosima::fastdds::statistics::SampleIdentityCount"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentityCount; + eprosima::fastcdr::optional ann_custom_SampleIdentityCount; + CompleteTypeDetail detail_SampleIdentityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentityCount, ann_custom_SampleIdentityCount, type_name_SampleIdentityCount.to_string()); + CompleteStructHeader header_SampleIdentityCount; + header_SampleIdentityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentityCount); + CompleteStructMemberSeq member_seq_SampleIdentityCount; + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sample_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_sample_id; + MemberId member_id_sample_id = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sample_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_id = "sample_id"; + eprosima::fastcdr::optional member_ann_builtin_sample_id; + ann_custom_SampleIdentityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_sample_id; + eprosima::fastcdr::optional unit_sample_id; + eprosima::fastcdr::optional min_sample_id; + eprosima::fastcdr::optional max_sample_id; + eprosima::fastcdr::optional hash_id_sample_id; + if (unit_sample_id.has_value() || min_sample_id.has_value() || max_sample_id.has_value() || hash_id_sample_id.has_value()) + { + member_ann_builtin_sample_id = TypeObjectUtils::build_applied_builtin_member_annotations(unit_sample_id, min_sample_id, max_sample_id, hash_id_sample_id); + } + if (!tmp_ann_custom_sample_id.empty()) + { + ann_custom_SampleIdentityCount = tmp_ann_custom_sample_id; + } + CompleteMemberDetail detail_sample_id = TypeObjectUtils::build_complete_member_detail(name_sample_id, member_ann_builtin_sample_id, ann_custom_SampleIdentityCount); + CompleteStructMember member_sample_id = TypeObjectUtils::build_complete_struct_member(common_sample_id, detail_sample_id); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_sample_id); + } + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_SampleIdentityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_SampleIdentityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_count); + } + CompleteStructType struct_type_SampleIdentityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentityCount, header_SampleIdentityCount, member_seq_SampleIdentityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentityCount, type_name_SampleIdentityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_SampleIdentityCount); + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier() +{ + { + StructTypeFlag struct_flags_Entity2LocatorTraffic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Entity2LocatorTraffic; + TypeIdentifierPair type_ids_Entity2LocatorTraffic; + QualifiedTypeName type_name_Entity2LocatorTraffic = "eprosima::fastdds::statistics::Entity2LocatorTraffic"; + eprosima::fastcdr::optional type_ann_builtin_Entity2LocatorTraffic; + eprosima::fastcdr::optional ann_custom_Entity2LocatorTraffic; + CompleteTypeDetail detail_Entity2LocatorTraffic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Entity2LocatorTraffic, ann_custom_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string()); + CompleteStructHeader header_Entity2LocatorTraffic; + header_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Entity2LocatorTraffic); + CompleteStructMemberSeq member_seq_Entity2LocatorTraffic; + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_guid; + MemberId member_id_src_guid = 0x00000000; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_guid = "src_guid"; + eprosima::fastcdr::optional member_ann_builtin_src_guid; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_guid; + eprosima::fastcdr::optional unit_src_guid; + eprosima::fastcdr::optional min_src_guid; + eprosima::fastcdr::optional max_src_guid; + eprosima::fastcdr::optional hash_id_src_guid; + if (unit_src_guid.has_value() || min_src_guid.has_value() || max_src_guid.has_value() || hash_id_src_guid.has_value()) + { + member_ann_builtin_src_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_guid, min_src_guid, max_src_guid, hash_id_src_guid); + } + if (!tmp_ann_custom_src_guid.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_src_guid; + } + CompleteMemberDetail detail_src_guid = TypeObjectUtils::build_complete_member_detail(name_src_guid, member_ann_builtin_src_guid, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_src_guid = TypeObjectUtils::build_complete_struct_member(common_src_guid, detail_src_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_src_guid); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_dst_locator); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "packet_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_packet_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_packet_count; + MemberId member_id_packet_count = 0x00000002; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure packet_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_packet_count = "packet_count"; + eprosima::fastcdr::optional member_ann_builtin_packet_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_packet_count = TypeObjectUtils::build_complete_member_detail(name_packet_count, member_ann_builtin_packet_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_packet_count = TypeObjectUtils::build_complete_struct_member(common_packet_count, detail_packet_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_packet_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_count; + MemberId member_id_byte_count = 0x00000003; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_count = "byte_count"; + eprosima::fastcdr::optional member_ann_builtin_byte_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_count = TypeObjectUtils::build_complete_member_detail(name_byte_count, member_ann_builtin_byte_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_count = TypeObjectUtils::build_complete_struct_member(common_byte_count, detail_byte_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_magnitude_order Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_magnitude_order = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_magnitude_order; + MemberId member_id_byte_magnitude_order = 0x00000004; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_magnitude_order member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_magnitude_order = "byte_magnitude_order"; + eprosima::fastcdr::optional member_ann_builtin_byte_magnitude_order; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_magnitude_order = TypeObjectUtils::build_complete_member_detail(name_byte_magnitude_order, member_ann_builtin_byte_magnitude_order, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_magnitude_order = TypeObjectUtils::build_complete_struct_member(common_byte_magnitude_order, detail_byte_magnitude_order); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_magnitude_order); + } + CompleteStructType struct_type_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_type(struct_flags_Entity2LocatorTraffic, header_Entity2LocatorTraffic, member_seq_Entity2LocatorTraffic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic already registered in TypeObjectRegistry for a different type."); + } + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Entity2LocatorTraffic); + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_WriterReaderData_type_identifier() +{ + { + StructTypeFlag struct_flags_WriterReaderData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_WriterReaderData; + TypeIdentifierPair type_ids_WriterReaderData; + QualifiedTypeName type_name_WriterReaderData = "eprosima::fastdds::statistics::WriterReaderData"; + eprosima::fastcdr::optional type_ann_builtin_WriterReaderData; + eprosima::fastcdr::optional ann_custom_WriterReaderData; + CompleteTypeDetail detail_WriterReaderData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WriterReaderData, ann_custom_WriterReaderData, type_name_WriterReaderData.to_string()); + CompleteStructHeader header_WriterReaderData; + header_WriterReaderData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WriterReaderData); + CompleteStructMemberSeq member_seq_WriterReaderData; + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_writer_guid; + eprosima::fastcdr::optional unit_writer_guid; + eprosima::fastcdr::optional min_writer_guid; + eprosima::fastcdr::optional max_writer_guid; + eprosima::fastcdr::optional hash_id_writer_guid; + if (unit_writer_guid.has_value() || min_writer_guid.has_value() || max_writer_guid.has_value() || hash_id_writer_guid.has_value()) + { + member_ann_builtin_writer_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_writer_guid, min_writer_guid, max_writer_guid, hash_id_writer_guid); + } + if (!tmp_ann_custom_writer_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_writer_guid; + } + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_WriterReaderData); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_writer_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_reader_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_reader_guid; + MemberId member_id_reader_guid = 0x00000001; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure reader_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_reader_guid = "reader_guid"; + eprosima::fastcdr::optional member_ann_builtin_reader_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_reader_guid; + eprosima::fastcdr::optional unit_reader_guid; + eprosima::fastcdr::optional min_reader_guid; + eprosima::fastcdr::optional max_reader_guid; + eprosima::fastcdr::optional hash_id_reader_guid; + if (unit_reader_guid.has_value() || min_reader_guid.has_value() || max_reader_guid.has_value() || hash_id_reader_guid.has_value()) + { + member_ann_builtin_reader_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_reader_guid, min_reader_guid, max_reader_guid, hash_id_reader_guid); + } + if (!tmp_ann_custom_reader_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_reader_guid; + } + CompleteMemberDetail detail_reader_guid = TypeObjectUtils::build_complete_member_detail(name_reader_guid, member_ann_builtin_reader_guid, ann_custom_WriterReaderData); + CompleteStructMember member_reader_guid = TypeObjectUtils::build_complete_struct_member(common_reader_guid, detail_reader_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_reader_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_WriterReaderData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_WriterReaderData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_data); + } + CompleteStructType struct_type_WriterReaderData = TypeObjectUtils::build_complete_struct_type(struct_flags_WriterReaderData, header_WriterReaderData, member_seq_WriterReaderData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WriterReaderData, type_name_WriterReaderData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData already registered in TypeObjectRegistry for a different type."); + } + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_WriterReaderData); + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier() +{ + { + StructTypeFlag struct_flags_Locator2LocatorData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator2LocatorData; + TypeIdentifierPair type_ids_Locator2LocatorData; + QualifiedTypeName type_name_Locator2LocatorData = "eprosima::fastdds::statistics::Locator2LocatorData"; + eprosima::fastcdr::optional type_ann_builtin_Locator2LocatorData; + eprosima::fastcdr::optional ann_custom_Locator2LocatorData; + CompleteTypeDetail detail_Locator2LocatorData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator2LocatorData, ann_custom_Locator2LocatorData, type_name_Locator2LocatorData.to_string()); + CompleteStructHeader header_Locator2LocatorData; + header_Locator2LocatorData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator2LocatorData); + CompleteStructMemberSeq member_seq_Locator2LocatorData; + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_locator; + MemberId member_id_src_locator = 0x00000000; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_locator = "src_locator"; + eprosima::fastcdr::optional member_ann_builtin_src_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_locator; + eprosima::fastcdr::optional unit_src_locator; + eprosima::fastcdr::optional min_src_locator; + eprosima::fastcdr::optional max_src_locator; + eprosima::fastcdr::optional hash_id_src_locator; + if (unit_src_locator.has_value() || min_src_locator.has_value() || max_src_locator.has_value() || hash_id_src_locator.has_value()) + { + member_ann_builtin_src_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_locator, min_src_locator, max_src_locator, hash_id_src_locator); + } + if (!tmp_ann_custom_src_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_src_locator; + } + CompleteMemberDetail detail_src_locator = TypeObjectUtils::build_complete_member_detail(name_src_locator, member_ann_builtin_src_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_src_locator = TypeObjectUtils::build_complete_struct_member(common_src_locator, detail_src_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_src_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_dst_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Locator2LocatorData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Locator2LocatorData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_data); + } + CompleteStructType struct_type_Locator2LocatorData = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator2LocatorData, header_Locator2LocatorData, member_seq_Locator2LocatorData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator2LocatorData, type_name_Locator2LocatorData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Locator2LocatorData); + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_EntityData_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityData; + TypeIdentifierPair type_ids_EntityData; + QualifiedTypeName type_name_EntityData = "eprosima::fastdds::statistics::EntityData"; + eprosima::fastcdr::optional type_ann_builtin_EntityData; + eprosima::fastcdr::optional ann_custom_EntityData; + CompleteTypeDetail detail_EntityData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityData, ann_custom_EntityData, type_name_EntityData.to_string()); + CompleteStructHeader header_EntityData; + header_EntityData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityData); + CompleteStructMemberSeq member_seq_EntityData; + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityData.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityData = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityData); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_guid); + } + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000001; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_EntityData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_EntityData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_data); + } + CompleteStructType struct_type_EntityData = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityData, header_EntityData, member_seq_EntityData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityData, type_name_EntityData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_EntityData); + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_PhysicalData_type_identifier() +{ + { + StructTypeFlag struct_flags_PhysicalData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_PhysicalData; + TypeIdentifierPair type_ids_PhysicalData; + QualifiedTypeName type_name_PhysicalData = "eprosima::fastdds::statistics::PhysicalData"; + eprosima::fastcdr::optional type_ann_builtin_PhysicalData; + eprosima::fastcdr::optional ann_custom_PhysicalData; + CompleteTypeDetail detail_PhysicalData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PhysicalData, ann_custom_PhysicalData, type_name_PhysicalData.to_string()); + CompleteStructHeader header_PhysicalData; + header_PhysicalData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_PhysicalData); + CompleteStructMemberSeq member_seq_PhysicalData; + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_participant_guid; + MemberId member_id_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_participant_guid = "participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_participant_guid; + ann_custom_PhysicalData.reset(); + AppliedAnnotationSeq tmp_ann_custom_participant_guid; + eprosima::fastcdr::optional unit_participant_guid; + eprosima::fastcdr::optional min_participant_guid; + eprosima::fastcdr::optional max_participant_guid; + eprosima::fastcdr::optional hash_id_participant_guid; + if (unit_participant_guid.has_value() || min_participant_guid.has_value() || max_participant_guid.has_value() || hash_id_participant_guid.has_value()) + { + member_ann_builtin_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_participant_guid, min_participant_guid, max_participant_guid, hash_id_participant_guid); + } + if (!tmp_ann_custom_participant_guid.empty()) + { + ann_custom_PhysicalData = tmp_ann_custom_participant_guid; + } + CompleteMemberDetail detail_participant_guid = TypeObjectUtils::build_complete_member_detail(name_participant_guid, member_ann_builtin_participant_guid, ann_custom_PhysicalData); + CompleteStructMember member_participant_guid = TypeObjectUtils::build_complete_struct_member(common_participant_guid, detail_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_participant_guid); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000001; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_PhysicalData); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_host); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000002; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_PhysicalData); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_user); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000003; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_PhysicalData); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_process); + } + CompleteStructType struct_type_PhysicalData = TypeObjectUtils::build_complete_struct_type(struct_flags_PhysicalData, header_PhysicalData, member_seq_PhysicalData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_PhysicalData, type_name_PhysicalData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData already registered in TypeObjectRegistry for a different type."); + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +namespace EventKind { +} // namespace EventKind +void register_eprosima_fastdds_statistics_Data_type_identifier() +{ + { + ReturnCode_t return_code_Data; + TypeIdentifierPair type_ids_Data; + UnionTypeFlag union_flags_Data = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_Data = "eprosima::fastdds::statistics::Data"; + eprosima::fastcdr::optional type_ann_builtin_Data; + eprosima::fastcdr::optional ann_custom_Data; + CompleteTypeDetail detail_Data = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Data, ann_custom_Data, type_name_Data.to_string()); + CompleteUnionHeader header_Data = TypeObjectUtils::build_complete_union_header(detail_Data); + UnionDiscriminatorFlag member_flags_Data = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonDiscriminatorMember common_Data; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d()) + { + common_Data = TypeObjectUtils::build_common_discriminator_member(member_flags_Data, type_ids_Data.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d()) + { + common_Data = TypeObjectUtils::build_common_discriminator_member(member_flags_Data, type_ids_Data.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_Data.reset(); + ann_custom_Data.reset(); + CompleteDiscriminatorMember discriminator_Data = TypeObjectUtils::build_complete_discriminator_member(common_Data, + type_ann_builtin_Data, ann_custom_Data); + CompleteUnionMemberSeq member_seq_Data; + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_WriterReaderData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_WriterReaderData; + TypeIdentifierPair type_ids_WriterReaderData; + QualifiedTypeName type_name_WriterReaderData = "eprosima::fastdds::statistics::WriterReaderData"; + eprosima::fastcdr::optional type_ann_builtin_WriterReaderData; + eprosima::fastcdr::optional ann_custom_WriterReaderData; + CompleteTypeDetail detail_WriterReaderData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WriterReaderData, ann_custom_WriterReaderData, type_name_WriterReaderData.to_string()); + CompleteStructHeader header_WriterReaderData; + header_WriterReaderData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WriterReaderData); + CompleteStructMemberSeq member_seq_WriterReaderData; + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_writer_guid; + eprosima::fastcdr::optional unit_writer_guid; + eprosima::fastcdr::optional min_writer_guid; + eprosima::fastcdr::optional max_writer_guid; + eprosima::fastcdr::optional hash_id_writer_guid; + if (unit_writer_guid.has_value() || min_writer_guid.has_value() || max_writer_guid.has_value() || hash_id_writer_guid.has_value()) + { + member_ann_builtin_writer_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_writer_guid, min_writer_guid, max_writer_guid, hash_id_writer_guid); + } + if (!tmp_ann_custom_writer_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_writer_guid; + } + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_WriterReaderData); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_writer_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_reader_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_reader_guid; + MemberId member_id_reader_guid = 0x00000001; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure reader_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_reader_guid = "reader_guid"; + eprosima::fastcdr::optional member_ann_builtin_reader_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_reader_guid; + eprosima::fastcdr::optional unit_reader_guid; + eprosima::fastcdr::optional min_reader_guid; + eprosima::fastcdr::optional max_reader_guid; + eprosima::fastcdr::optional hash_id_reader_guid; + if (unit_reader_guid.has_value() || min_reader_guid.has_value() || max_reader_guid.has_value() || hash_id_reader_guid.has_value()) + { + member_ann_builtin_reader_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_reader_guid, min_reader_guid, max_reader_guid, hash_id_reader_guid); + } + if (!tmp_ann_custom_reader_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_reader_guid; + } + CompleteMemberDetail detail_reader_guid = TypeObjectUtils::build_complete_member_detail(name_reader_guid, member_ann_builtin_reader_guid, ann_custom_WriterReaderData); + CompleteStructMember member_reader_guid = TypeObjectUtils::build_complete_struct_member(common_reader_guid, detail_reader_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_reader_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_WriterReaderData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_WriterReaderData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_data); + } + CompleteStructType struct_type_WriterReaderData = TypeObjectUtils::build_complete_struct_type(struct_flags_WriterReaderData, header_WriterReaderData, member_seq_WriterReaderData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WriterReaderData, type_name_WriterReaderData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData already registered in TypeObjectRegistry for a different type."); + } + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_WriterReaderData); + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_writer_reader_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_writer_reader_data; + TypeObjectUtils::add_union_case_label(label_seq_writer_reader_data, static_cast(EventKind::HISTORY2HISTORY_LATENCY)); + CommonUnionMember common_writer_reader_data; + MemberId member_id_writer_reader_data = 0x00000001; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_reader_data = TypeObjectUtils::build_common_union_member(member_id_writer_reader_data, member_flags_writer_reader_data, type_ids_Data.type_identifier1(), + label_seq_writer_reader_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_reader_data = TypeObjectUtils::build_common_union_member(member_id_writer_reader_data, member_flags_writer_reader_data, type_ids_Data.type_identifier2(), + label_seq_writer_reader_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union writer_reader_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_reader_data = "writer_reader_data"; + eprosima::fastcdr::optional member_ann_builtin_writer_reader_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_writer_reader_data = TypeObjectUtils::build_complete_member_detail(name_writer_reader_data, member_ann_builtin_writer_reader_data, ann_custom_Data); + CompleteUnionMember member_writer_reader_data = TypeObjectUtils::build_complete_union_member(common_writer_reader_data, detail_writer_reader_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_writer_reader_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator2LocatorData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator2LocatorData; + TypeIdentifierPair type_ids_Locator2LocatorData; + QualifiedTypeName type_name_Locator2LocatorData = "eprosima::fastdds::statistics::Locator2LocatorData"; + eprosima::fastcdr::optional type_ann_builtin_Locator2LocatorData; + eprosima::fastcdr::optional ann_custom_Locator2LocatorData; + CompleteTypeDetail detail_Locator2LocatorData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator2LocatorData, ann_custom_Locator2LocatorData, type_name_Locator2LocatorData.to_string()); + CompleteStructHeader header_Locator2LocatorData; + header_Locator2LocatorData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator2LocatorData); + CompleteStructMemberSeq member_seq_Locator2LocatorData; + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_locator; + MemberId member_id_src_locator = 0x00000000; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_locator = "src_locator"; + eprosima::fastcdr::optional member_ann_builtin_src_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_locator; + eprosima::fastcdr::optional unit_src_locator; + eprosima::fastcdr::optional min_src_locator; + eprosima::fastcdr::optional max_src_locator; + eprosima::fastcdr::optional hash_id_src_locator; + if (unit_src_locator.has_value() || min_src_locator.has_value() || max_src_locator.has_value() || hash_id_src_locator.has_value()) + { + member_ann_builtin_src_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_locator, min_src_locator, max_src_locator, hash_id_src_locator); + } + if (!tmp_ann_custom_src_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_src_locator; + } + CompleteMemberDetail detail_src_locator = TypeObjectUtils::build_complete_member_detail(name_src_locator, member_ann_builtin_src_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_src_locator = TypeObjectUtils::build_complete_struct_member(common_src_locator, detail_src_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_src_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_dst_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Locator2LocatorData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Locator2LocatorData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_data); + } + CompleteStructType struct_type_Locator2LocatorData = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator2LocatorData, header_Locator2LocatorData, member_seq_Locator2LocatorData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator2LocatorData, type_name_Locator2LocatorData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Locator2LocatorData); + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_locator2locator_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_locator2locator_data; + TypeObjectUtils::add_union_case_label(label_seq_locator2locator_data, static_cast(EventKind::NETWORK_LATENCY)); + CommonUnionMember common_locator2locator_data; + MemberId member_id_locator2locator_data = 0x00000002; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_locator2locator_data = TypeObjectUtils::build_common_union_member(member_id_locator2locator_data, member_flags_locator2locator_data, type_ids_Data.type_identifier1(), + label_seq_locator2locator_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_locator2locator_data = TypeObjectUtils::build_common_union_member(member_id_locator2locator_data, member_flags_locator2locator_data, type_ids_Data.type_identifier2(), + label_seq_locator2locator_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union locator2locator_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_locator2locator_data = "locator2locator_data"; + eprosima::fastcdr::optional member_ann_builtin_locator2locator_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_locator2locator_data = TypeObjectUtils::build_complete_member_detail(name_locator2locator_data, member_ann_builtin_locator2locator_data, ann_custom_Data); + CompleteUnionMember member_locator2locator_data = TypeObjectUtils::build_complete_union_member(common_locator2locator_data, detail_locator2locator_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_locator2locator_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityData; + TypeIdentifierPair type_ids_EntityData; + QualifiedTypeName type_name_EntityData = "eprosima::fastdds::statistics::EntityData"; + eprosima::fastcdr::optional type_ann_builtin_EntityData; + eprosima::fastcdr::optional ann_custom_EntityData; + CompleteTypeDetail detail_EntityData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityData, ann_custom_EntityData, type_name_EntityData.to_string()); + CompleteStructHeader header_EntityData; + header_EntityData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityData); + CompleteStructMemberSeq member_seq_EntityData; + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityData.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityData = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityData); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_guid); + } + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000001; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_EntityData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_EntityData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_data); + } + CompleteStructType struct_type_EntityData = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityData, header_EntityData, member_seq_EntityData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityData, type_name_EntityData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_EntityData); + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_data; + TypeObjectUtils::add_union_case_label(label_seq_entity_data, static_cast(EventKind::PUBLICATION_THROUGHPUT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_data, static_cast(EventKind::SUBSCRIPTION_THROUGHPUT)); + CommonUnionMember common_entity_data; + MemberId member_id_entity_data = 0x00000003; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_data = TypeObjectUtils::build_common_union_member(member_id_entity_data, member_flags_entity_data, type_ids_Data.type_identifier1(), + label_seq_entity_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_data = TypeObjectUtils::build_common_union_member(member_id_entity_data, member_flags_entity_data, type_ids_Data.type_identifier2(), + label_seq_entity_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_data = "entity_data"; + eprosima::fastcdr::optional member_ann_builtin_entity_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity_data = TypeObjectUtils::build_complete_member_detail(name_entity_data, member_ann_builtin_entity_data, ann_custom_Data); + CompleteUnionMember member_entity_data = TypeObjectUtils::build_complete_union_member(common_entity_data, detail_entity_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Entity2LocatorTraffic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Entity2LocatorTraffic; + TypeIdentifierPair type_ids_Entity2LocatorTraffic; + QualifiedTypeName type_name_Entity2LocatorTraffic = "eprosima::fastdds::statistics::Entity2LocatorTraffic"; + eprosima::fastcdr::optional type_ann_builtin_Entity2LocatorTraffic; + eprosima::fastcdr::optional ann_custom_Entity2LocatorTraffic; + CompleteTypeDetail detail_Entity2LocatorTraffic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Entity2LocatorTraffic, ann_custom_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string()); + CompleteStructHeader header_Entity2LocatorTraffic; + header_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Entity2LocatorTraffic); + CompleteStructMemberSeq member_seq_Entity2LocatorTraffic; + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_guid; + MemberId member_id_src_guid = 0x00000000; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_guid = "src_guid"; + eprosima::fastcdr::optional member_ann_builtin_src_guid; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_guid; + eprosima::fastcdr::optional unit_src_guid; + eprosima::fastcdr::optional min_src_guid; + eprosima::fastcdr::optional max_src_guid; + eprosima::fastcdr::optional hash_id_src_guid; + if (unit_src_guid.has_value() || min_src_guid.has_value() || max_src_guid.has_value() || hash_id_src_guid.has_value()) + { + member_ann_builtin_src_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_guid, min_src_guid, max_src_guid, hash_id_src_guid); + } + if (!tmp_ann_custom_src_guid.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_src_guid; + } + CompleteMemberDetail detail_src_guid = TypeObjectUtils::build_complete_member_detail(name_src_guid, member_ann_builtin_src_guid, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_src_guid = TypeObjectUtils::build_complete_struct_member(common_src_guid, detail_src_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_src_guid); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_dst_locator); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "packet_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_packet_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_packet_count; + MemberId member_id_packet_count = 0x00000002; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure packet_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_packet_count = "packet_count"; + eprosima::fastcdr::optional member_ann_builtin_packet_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_packet_count = TypeObjectUtils::build_complete_member_detail(name_packet_count, member_ann_builtin_packet_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_packet_count = TypeObjectUtils::build_complete_struct_member(common_packet_count, detail_packet_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_packet_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_count; + MemberId member_id_byte_count = 0x00000003; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_count = "byte_count"; + eprosima::fastcdr::optional member_ann_builtin_byte_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_count = TypeObjectUtils::build_complete_member_detail(name_byte_count, member_ann_builtin_byte_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_count = TypeObjectUtils::build_complete_struct_member(common_byte_count, detail_byte_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_magnitude_order Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_magnitude_order = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_magnitude_order; + MemberId member_id_byte_magnitude_order = 0x00000004; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_magnitude_order member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_magnitude_order = "byte_magnitude_order"; + eprosima::fastcdr::optional member_ann_builtin_byte_magnitude_order; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_magnitude_order = TypeObjectUtils::build_complete_member_detail(name_byte_magnitude_order, member_ann_builtin_byte_magnitude_order, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_magnitude_order = TypeObjectUtils::build_complete_struct_member(common_byte_magnitude_order, detail_byte_magnitude_order); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_magnitude_order); + } + CompleteStructType struct_type_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_type(struct_flags_Entity2LocatorTraffic, header_Entity2LocatorTraffic, member_seq_Entity2LocatorTraffic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic already registered in TypeObjectRegistry for a different type."); + } + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Entity2LocatorTraffic); + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity2locator_traffic = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity2locator_traffic; + TypeObjectUtils::add_union_case_label(label_seq_entity2locator_traffic, static_cast(EventKind::RTPS_SENT)); + TypeObjectUtils::add_union_case_label(label_seq_entity2locator_traffic, static_cast(EventKind::RTPS_LOST)); + CommonUnionMember common_entity2locator_traffic; + MemberId member_id_entity2locator_traffic = 0x00000004; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity2locator_traffic = TypeObjectUtils::build_common_union_member(member_id_entity2locator_traffic, member_flags_entity2locator_traffic, type_ids_Data.type_identifier1(), + label_seq_entity2locator_traffic); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity2locator_traffic = TypeObjectUtils::build_common_union_member(member_id_entity2locator_traffic, member_flags_entity2locator_traffic, type_ids_Data.type_identifier2(), + label_seq_entity2locator_traffic); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity2locator_traffic member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity2locator_traffic = "entity2locator_traffic"; + eprosima::fastcdr::optional member_ann_builtin_entity2locator_traffic; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity2locator_traffic = TypeObjectUtils::build_complete_member_detail(name_entity2locator_traffic, member_ann_builtin_entity2locator_traffic, ann_custom_Data); + CompleteUnionMember member_entity2locator_traffic = TypeObjectUtils::build_complete_union_member(common_entity2locator_traffic, detail_entity2locator_traffic); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity2locator_traffic); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityCount; + TypeIdentifierPair type_ids_EntityCount; + QualifiedTypeName type_name_EntityCount = "eprosima::fastdds::statistics::EntityCount"; + eprosima::fastcdr::optional type_ann_builtin_EntityCount; + eprosima::fastcdr::optional ann_custom_EntityCount; + CompleteTypeDetail detail_EntityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityCount, ann_custom_EntityCount, type_name_EntityCount.to_string()); + CompleteStructHeader header_EntityCount; + header_EntityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityCount); + CompleteStructMemberSeq member_seq_EntityCount; + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityCount = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityCount); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_guid); + } + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_EntityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_EntityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_count); + } + CompleteStructType struct_type_EntityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityCount, header_EntityCount, member_seq_EntityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityCount, type_name_EntityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_EntityCount); + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity_count = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_count; + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::RESENT_DATAS)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::HEARTBEAT_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::ACKNACK_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::NACKFRAG_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::GAP_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::DATA_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::PDP_PACKETS)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::EDP_PACKETS)); + CommonUnionMember common_entity_count; + MemberId member_id_entity_count = 0x00000005; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_count = TypeObjectUtils::build_common_union_member(member_id_entity_count, member_flags_entity_count, type_ids_Data.type_identifier1(), + label_seq_entity_count); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_count = TypeObjectUtils::build_common_union_member(member_id_entity_count, member_flags_entity_count, type_ids_Data.type_identifier2(), + label_seq_entity_count); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_count = "entity_count"; + eprosima::fastcdr::optional member_ann_builtin_entity_count; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity_count = TypeObjectUtils::build_complete_member_detail(name_entity_count, member_ann_builtin_entity_count, ann_custom_Data); + CompleteUnionMember member_entity_count = TypeObjectUtils::build_complete_union_member(common_entity_count, detail_entity_count); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity_count); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DiscoveryTime = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DiscoveryTime; + TypeIdentifierPair type_ids_DiscoveryTime; + QualifiedTypeName type_name_DiscoveryTime = "eprosima::fastdds::statistics::DiscoveryTime"; + eprosima::fastcdr::optional type_ann_builtin_DiscoveryTime; + eprosima::fastcdr::optional ann_custom_DiscoveryTime; + CompleteTypeDetail detail_DiscoveryTime = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DiscoveryTime, ann_custom_DiscoveryTime, type_name_DiscoveryTime.to_string()); + CompleteStructHeader header_DiscoveryTime; + header_DiscoveryTime = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DiscoveryTime); + CompleteStructMemberSeq member_seq_DiscoveryTime; + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_participant_guid; + MemberId member_id_local_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_participant_guid = "local_participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_local_participant_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_participant_guid; + eprosima::fastcdr::optional unit_local_participant_guid; + eprosima::fastcdr::optional min_local_participant_guid; + eprosima::fastcdr::optional max_local_participant_guid; + eprosima::fastcdr::optional hash_id_local_participant_guid; + if (unit_local_participant_guid.has_value() || min_local_participant_guid.has_value() || max_local_participant_guid.has_value() || hash_id_local_participant_guid.has_value()) + { + member_ann_builtin_local_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_participant_guid, min_local_participant_guid, max_local_participant_guid, hash_id_local_participant_guid); + } + if (!tmp_ann_custom_local_participant_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_local_participant_guid; + } + CompleteMemberDetail detail_local_participant_guid = TypeObjectUtils::build_complete_member_detail(name_local_participant_guid, member_ann_builtin_local_participant_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_local_participant_guid = TypeObjectUtils::build_complete_struct_member(common_local_participant_guid, detail_local_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_local_participant_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_remote_entity_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_remote_entity_guid; + MemberId member_id_remote_entity_guid = 0x00000001; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure remote_entity_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_remote_entity_guid = "remote_entity_guid"; + eprosima::fastcdr::optional member_ann_builtin_remote_entity_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_remote_entity_guid; + eprosima::fastcdr::optional unit_remote_entity_guid; + eprosima::fastcdr::optional min_remote_entity_guid; + eprosima::fastcdr::optional max_remote_entity_guid; + eprosima::fastcdr::optional hash_id_remote_entity_guid; + if (unit_remote_entity_guid.has_value() || min_remote_entity_guid.has_value() || max_remote_entity_guid.has_value() || hash_id_remote_entity_guid.has_value()) + { + member_ann_builtin_remote_entity_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_remote_entity_guid, min_remote_entity_guid, max_remote_entity_guid, hash_id_remote_entity_guid); + } + if (!tmp_ann_custom_remote_entity_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_remote_entity_guid; + } + CompleteMemberDetail detail_remote_entity_guid = TypeObjectUtils::build_complete_member_detail(name_remote_entity_guid, member_ann_builtin_remote_entity_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_remote_entity_guid = TypeObjectUtils::build_complete_struct_member(common_remote_entity_guid, detail_remote_entity_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_remote_entity_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "time Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_time = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_time; + MemberId member_id_time = 0x00000002; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure time member TypeIdentifier inconsistent."); + return; + } + MemberName name_time = "time"; + eprosima::fastcdr::optional member_ann_builtin_time; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_time = TypeObjectUtils::build_complete_member_detail(name_time, member_ann_builtin_time, ann_custom_DiscoveryTime); + CompleteStructMember member_time = TypeObjectUtils::build_complete_struct_member(common_time, detail_time); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_time); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000003; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_DiscoveryTime); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_host); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000004; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_DiscoveryTime); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_user); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000005; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_DiscoveryTime); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_process); + } + CompleteStructType struct_type_DiscoveryTime = TypeObjectUtils::build_complete_struct_type(struct_flags_DiscoveryTime, header_DiscoveryTime, member_seq_DiscoveryTime); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DiscoveryTime, type_name_DiscoveryTime.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime already registered in TypeObjectRegistry for a different type."); + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_discovery_time = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_discovery_time; + TypeObjectUtils::add_union_case_label(label_seq_discovery_time, static_cast(EventKind::DISCOVERED_ENTITY)); + CommonUnionMember common_discovery_time; + MemberId member_id_discovery_time = 0x00000006; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_discovery_time = TypeObjectUtils::build_common_union_member(member_id_discovery_time, member_flags_discovery_time, type_ids_Data.type_identifier1(), + label_seq_discovery_time); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_discovery_time = TypeObjectUtils::build_common_union_member(member_id_discovery_time, member_flags_discovery_time, type_ids_Data.type_identifier2(), + label_seq_discovery_time); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union discovery_time member TypeIdentifier inconsistent."); + return; + } + MemberName name_discovery_time = "discovery_time"; + eprosima::fastcdr::optional member_ann_builtin_discovery_time; + ann_custom_Data.reset(); + CompleteMemberDetail detail_discovery_time = TypeObjectUtils::build_complete_member_detail(name_discovery_time, member_ann_builtin_discovery_time, ann_custom_Data); + CompleteUnionMember member_discovery_time = TypeObjectUtils::build_complete_union_member(common_discovery_time, detail_discovery_time); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_discovery_time); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentityCount; + TypeIdentifierPair type_ids_SampleIdentityCount; + QualifiedTypeName type_name_SampleIdentityCount = "eprosima::fastdds::statistics::SampleIdentityCount"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentityCount; + eprosima::fastcdr::optional ann_custom_SampleIdentityCount; + CompleteTypeDetail detail_SampleIdentityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentityCount, ann_custom_SampleIdentityCount, type_name_SampleIdentityCount.to_string()); + CompleteStructHeader header_SampleIdentityCount; + header_SampleIdentityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentityCount); + CompleteStructMemberSeq member_seq_SampleIdentityCount; + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sample_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_sample_id; + MemberId member_id_sample_id = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sample_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_id = "sample_id"; + eprosima::fastcdr::optional member_ann_builtin_sample_id; + ann_custom_SampleIdentityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_sample_id; + eprosima::fastcdr::optional unit_sample_id; + eprosima::fastcdr::optional min_sample_id; + eprosima::fastcdr::optional max_sample_id; + eprosima::fastcdr::optional hash_id_sample_id; + if (unit_sample_id.has_value() || min_sample_id.has_value() || max_sample_id.has_value() || hash_id_sample_id.has_value()) + { + member_ann_builtin_sample_id = TypeObjectUtils::build_applied_builtin_member_annotations(unit_sample_id, min_sample_id, max_sample_id, hash_id_sample_id); + } + if (!tmp_ann_custom_sample_id.empty()) + { + ann_custom_SampleIdentityCount = tmp_ann_custom_sample_id; + } + CompleteMemberDetail detail_sample_id = TypeObjectUtils::build_complete_member_detail(name_sample_id, member_ann_builtin_sample_id, ann_custom_SampleIdentityCount); + CompleteStructMember member_sample_id = TypeObjectUtils::build_complete_struct_member(common_sample_id, detail_sample_id); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_sample_id); + } + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_SampleIdentityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_SampleIdentityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_count); + } + CompleteStructType struct_type_SampleIdentityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentityCount, header_SampleIdentityCount, member_seq_SampleIdentityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentityCount, type_name_SampleIdentityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_SampleIdentityCount); + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_sample_identity_count = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_identity_count; + TypeObjectUtils::add_union_case_label(label_seq_sample_identity_count, static_cast(EventKind::SAMPLE_DATAS)); + CommonUnionMember common_sample_identity_count; + MemberId member_id_sample_identity_count = 0x00000007; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_identity_count = TypeObjectUtils::build_common_union_member(member_id_sample_identity_count, member_flags_sample_identity_count, type_ids_Data.type_identifier1(), + label_seq_sample_identity_count); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_identity_count = TypeObjectUtils::build_common_union_member(member_id_sample_identity_count, member_flags_sample_identity_count, type_ids_Data.type_identifier2(), + label_seq_sample_identity_count); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_identity_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_identity_count = "sample_identity_count"; + eprosima::fastcdr::optional member_ann_builtin_sample_identity_count; + ann_custom_Data.reset(); + CompleteMemberDetail detail_sample_identity_count = TypeObjectUtils::build_complete_member_detail(name_sample_identity_count, member_ann_builtin_sample_identity_count, ann_custom_Data); + CompleteUnionMember member_sample_identity_count = TypeObjectUtils::build_complete_union_member(common_sample_identity_count, detail_sample_identity_count); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_sample_identity_count); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_PhysicalData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_PhysicalData; + TypeIdentifierPair type_ids_PhysicalData; + QualifiedTypeName type_name_PhysicalData = "eprosima::fastdds::statistics::PhysicalData"; + eprosima::fastcdr::optional type_ann_builtin_PhysicalData; + eprosima::fastcdr::optional ann_custom_PhysicalData; + CompleteTypeDetail detail_PhysicalData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PhysicalData, ann_custom_PhysicalData, type_name_PhysicalData.to_string()); + CompleteStructHeader header_PhysicalData; + header_PhysicalData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_PhysicalData); + CompleteStructMemberSeq member_seq_PhysicalData; + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_participant_guid; + MemberId member_id_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_participant_guid = "participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_participant_guid; + ann_custom_PhysicalData.reset(); + AppliedAnnotationSeq tmp_ann_custom_participant_guid; + eprosima::fastcdr::optional unit_participant_guid; + eprosima::fastcdr::optional min_participant_guid; + eprosima::fastcdr::optional max_participant_guid; + eprosima::fastcdr::optional hash_id_participant_guid; + if (unit_participant_guid.has_value() || min_participant_guid.has_value() || max_participant_guid.has_value() || hash_id_participant_guid.has_value()) + { + member_ann_builtin_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_participant_guid, min_participant_guid, max_participant_guid, hash_id_participant_guid); + } + if (!tmp_ann_custom_participant_guid.empty()) + { + ann_custom_PhysicalData = tmp_ann_custom_participant_guid; + } + CompleteMemberDetail detail_participant_guid = TypeObjectUtils::build_complete_member_detail(name_participant_guid, member_ann_builtin_participant_guid, ann_custom_PhysicalData); + CompleteStructMember member_participant_guid = TypeObjectUtils::build_complete_struct_member(common_participant_guid, detail_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_participant_guid); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000001; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_PhysicalData); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_host); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000002; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_PhysicalData); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_user); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000003; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_PhysicalData); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_process); + } + CompleteStructType struct_type_PhysicalData = TypeObjectUtils::build_complete_struct_type(struct_flags_PhysicalData, header_PhysicalData, member_seq_PhysicalData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_PhysicalData, type_name_PhysicalData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData already registered in TypeObjectRegistry for a different type."); + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_physical_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_physical_data; + TypeObjectUtils::add_union_case_label(label_seq_physical_data, static_cast(EventKind::PHYSICAL_DATA)); + CommonUnionMember common_physical_data; + MemberId member_id_physical_data = 0x00000008; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_physical_data = TypeObjectUtils::build_common_union_member(member_id_physical_data, member_flags_physical_data, type_ids_Data.type_identifier1(), + label_seq_physical_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_physical_data = TypeObjectUtils::build_common_union_member(member_id_physical_data, member_flags_physical_data, type_ids_Data.type_identifier2(), + label_seq_physical_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union physical_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_physical_data = "physical_data"; + eprosima::fastcdr::optional member_ann_builtin_physical_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_physical_data = TypeObjectUtils::build_complete_member_detail(name_physical_data, member_ann_builtin_physical_data, ann_custom_Data); + CompleteUnionMember member_physical_data = TypeObjectUtils::build_complete_union_member(common_physical_data, detail_physical_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_physical_data); + } + CompleteUnionType union_type_Data = TypeObjectUtils::build_complete_union_type(union_flags_Data, header_Data, discriminator_Data, + member_seq_Data); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_Data, type_name_Data.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data already registered in TypeObjectRegistry for a different type."); + } + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Data", type_ids_Data); + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + diff --git a/src/cpp/statistics/types/typesTypeObjectSupport.hpp b/src/cpp/statistics/types/typesTypeObjectSupport.hpp new file mode 100644 index 00000000000..172f8ea496c --- /dev/null +++ b/src/cpp/statistics/types/typesTypeObjectSupport.hpp @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file typesTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_types_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace eprosima { +namespace fastdds { +namespace statistics { +namespace detail { +/** + * @brief Register eprosima_fastdds_statistics_detail_EntityId_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_GuidPrefix_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_GUID_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_SequenceNumber_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_SampleIdentity_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_Locator_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + +} // namespace detail + +/** + * @brief Register eprosima_fastdds_statistics_DiscoveryTime related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_EntityCount related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_SampleIdentityCount related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_Entity2LocatorTraffic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_WriterReaderData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_Locator2LocatorData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_EntityData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_EntityData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_PhysicalData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + +namespace EventKind { +} // namespace EventKind + +/** + * @brief Register eprosima_fastdds_statistics_Data related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Data_type_identifier(); + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/src/cpp/statistics/types/typesv1.cxx b/src/cpp/statistics/types/typesv1.cxx deleted file mode 100644 index 80c55edc2e6..00000000000 --- a/src/cpp/statistics/types/typesv1.cxx +++ /dev/null @@ -1,4757 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; -#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; - -#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; - -#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; -#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; -#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; -#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; -#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; -#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; -#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; -#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -EntityId_s::EntityId_s() -{ - // octet m_value - memset(&m_value, 0, ((4)) * 1); - -} - -EntityId_s::~EntityId_s() -{ -} - -EntityId_s::EntityId_s( - const EntityId_s& x) -{ - m_value = x.m_value; - -} - -EntityId_s::EntityId_s( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); - -} - -EntityId_s& EntityId_s::operator =( - const EntityId_s& x) -{ - m_value = x.m_value; - - return *this; -} - -EntityId_s& EntityId_s::operator =( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); - - return *this; -} - -bool EntityId_s::operator ==( - const EntityId_s& x) const -{ - return (m_value == x.m_value); -} - -bool EntityId_s::operator !=( - const EntityId_s& x) const -{ - return !(*this == x); -} - -size_t EntityId_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; -} - -size_t EntityId_s::getCdrSerializedSize( - const EntityId_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void EntityId_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_value; - - -} - -void EntityId_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_value; - - -} - - -bool EntityId_s::isKeyDefined() -{ - return false; -} - -void EntityId_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void EntityId_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void EntityId_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& EntityId_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& EntityId_s::value() -{ - return m_value; -} - - - - - -GuidPrefix_s::GuidPrefix_s() -{ - // octet m_value - memset(&m_value, 0, ((12)) * 1); - -} - -GuidPrefix_s::~GuidPrefix_s() -{ -} - -GuidPrefix_s::GuidPrefix_s( - const GuidPrefix_s& x) -{ - m_value = x.m_value; - -} - -GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); - -} - -GuidPrefix_s& GuidPrefix_s::operator =( - const GuidPrefix_s& x) -{ - m_value = x.m_value; - - return *this; -} - -GuidPrefix_s& GuidPrefix_s::operator =( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); - - return *this; -} - -bool GuidPrefix_s::operator ==( - const GuidPrefix_s& x) const -{ - return (m_value == x.m_value); -} - -bool GuidPrefix_s::operator !=( - const GuidPrefix_s& x) const -{ - return !(*this == x); -} - -size_t GuidPrefix_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; -} - -size_t GuidPrefix_s::getCdrSerializedSize( - const GuidPrefix_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((12)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void GuidPrefix_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_value; - - -} - -void GuidPrefix_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_value; - - -} - - -bool GuidPrefix_s::isKeyDefined() -{ - return false; -} - -void GuidPrefix_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void GuidPrefix_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void GuidPrefix_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& GuidPrefix_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& GuidPrefix_s::value() -{ - return m_value; -} - - - - - -GUID_s::GUID_s() -{ - // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix - - // eprosima::fastdds::statistics::detail::EntityId_s m_entityId - - -} - -GUID_s::~GUID_s() -{ -} - -GUID_s::GUID_s( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - - - m_entityId = x.m_entityId; - -} - -GUID_s::GUID_s( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - - - m_entityId = std::move(x.m_entityId); - -} - -GUID_s& GUID_s::operator =( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - - - m_entityId = x.m_entityId; - - return *this; -} - -GUID_s& GUID_s::operator =( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - - - m_entityId = std::move(x.m_entityId); - - return *this; -} - -bool GUID_s::operator ==( - const GUID_s& x) const -{ - return (m_guidPrefix == x.m_guidPrefix && - m_entityId == x.m_entityId); -} - -bool GUID_s::operator !=( - const GUID_s& x) const -{ - return !(*this == x); -} - -size_t GUID_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; -} - -size_t GUID_s::getCdrSerializedSize( - const GUID_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize(data.guidPrefix(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize(data.entityId(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void GUID_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guidPrefix; - - scdr << m_entityId; - -} - -void GUID_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guidPrefix; - - - - dcdr >> m_entityId; - - -} - - -bool GUID_s::isKeyDefined() -{ - return false; -} - -void GUID_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ -void GUID_s::guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) -{ - m_guidPrefix = _guidPrefix; -} - -/*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ -void GUID_s::guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) -{ - m_guidPrefix = std::move(_guidPrefix); -} - -/*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const -{ - return m_guidPrefix; -} - -/*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() -{ - return m_guidPrefix; -} - - -/*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ -void GUID_s::entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) -{ - m_entityId = _entityId; -} - -/*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ -void GUID_s::entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) -{ - m_entityId = std::move(_entityId); -} - -/*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ -const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const -{ - return m_entityId; -} - -/*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ -eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() -{ - return m_entityId; -} - - - - - -SequenceNumber_s::SequenceNumber_s() -{ - // long m_high - m_high = 0; - // unsigned long m_low - m_low = 0; - -} - -SequenceNumber_s::~SequenceNumber_s() -{ -} - -SequenceNumber_s::SequenceNumber_s( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - - - m_low = x.m_low; - -} - -SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - - - m_low = x.m_low; - -} - -SequenceNumber_s& SequenceNumber_s::operator =( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - - - m_low = x.m_low; - - return *this; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - - - m_low = x.m_low; - - return *this; -} - -bool SequenceNumber_s::operator ==( - const SequenceNumber_s& x) const -{ - return (m_high == x.m_high && - m_low == x.m_low); -} - -bool SequenceNumber_s::operator !=( - const SequenceNumber_s& x) const -{ - return !(*this == x); -} - -size_t SequenceNumber_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; -} - -size_t SequenceNumber_s::getCdrSerializedSize( - const SequenceNumber_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void SequenceNumber_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_high; - - scdr << m_low; - -} - -void SequenceNumber_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_high; - - - - dcdr >> m_low; - - -} - - -bool SequenceNumber_s::isKeyDefined() -{ - return false; -} - -void SequenceNumber_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ -void SequenceNumber_s::high( - int32_t _high) -{ - m_high = _high; -} - -/*! - * @brief This function returns the value of member high - * @return Value of member high - */ -int32_t SequenceNumber_s::high() const -{ - return m_high; -} - -/*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ -int32_t& SequenceNumber_s::high() -{ - return m_high; -} - - -/*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ -void SequenceNumber_s::low( - uint32_t _low) -{ - m_low = _low; -} - -/*! - * @brief This function returns the value of member low - * @return Value of member low - */ -uint32_t SequenceNumber_s::low() const -{ - return m_low; -} - -/*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ -uint32_t& SequenceNumber_s::low() -{ - return m_low; -} - - - - - -SampleIdentity_s::SampleIdentity_s() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number - - -} - -SampleIdentity_s::~SampleIdentity_s() -{ -} - -SampleIdentity_s::SampleIdentity_s( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_sequence_number = x.m_sequence_number; - -} - -SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_sequence_number = std::move(x.m_sequence_number); - -} - -SampleIdentity_s& SampleIdentity_s::operator =( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_sequence_number = x.m_sequence_number; - - return *this; -} - -SampleIdentity_s& SampleIdentity_s::operator =( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_sequence_number = std::move(x.m_sequence_number); - - return *this; -} - -bool SampleIdentity_s::operator ==( - const SampleIdentity_s& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_sequence_number == x.m_sequence_number); -} - -bool SampleIdentity_s::operator !=( - const SampleIdentity_s& x) const -{ - return !(*this == x); -} - -size_t SampleIdentity_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; -} - -size_t SampleIdentity_s::getCdrSerializedSize( - const SampleIdentity_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize(data.sequence_number(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SampleIdentity_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_writer_guid; - - scdr << m_sequence_number; - -} - -void SampleIdentity_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_writer_guid; - - - - dcdr >> m_sequence_number; - - -} - - -bool SampleIdentity_s::isKeyDefined() -{ - return false; -} - -void SampleIdentity_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void SampleIdentity_s::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void SampleIdentity_s::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ -void SampleIdentity_s::sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) -{ - m_sequence_number = _sequence_number; -} - -/*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ -void SampleIdentity_s::sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) -{ - m_sequence_number = std::move(_sequence_number); -} - -/*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const -{ - return m_sequence_number; -} - -/*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() -{ - return m_sequence_number; -} - - - - - -Locator_s::Locator_s() -{ - // long m_kind - m_kind = 0; - // unsigned long m_port - m_port = 0; - // octet m_address - memset(&m_address, 0, ((16)) * 1); - -} - -Locator_s::~Locator_s() -{ -} - -Locator_s::Locator_s( - const Locator_s& x) -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = x.m_address; - -} - -Locator_s::Locator_s( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = std::move(x.m_address); - -} - -Locator_s& Locator_s::operator =( - const Locator_s& x) -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = x.m_address; - - return *this; -} - -Locator_s& Locator_s::operator =( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = std::move(x.m_address); - - return *this; -} - -bool Locator_s::operator ==( - const Locator_s& x) const -{ - return (m_kind == x.m_kind && - m_port == x.m_port && - m_address == x.m_address); -} - -bool Locator_s::operator !=( - const Locator_s& x) const -{ - return !(*this == x); -} - -size_t Locator_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; -} - -size_t Locator_s::getCdrSerializedSize( - const Locator_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void Locator_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_kind; - - scdr << m_port; - - scdr << m_address; - - -} - -void Locator_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_kind; - - - - dcdr >> m_port; - - - - dcdr >> m_address; - - -} - - -bool Locator_s::isKeyDefined() -{ - return false; -} - -void Locator_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ -void Locator_s::kind( - int32_t _kind) -{ - m_kind = _kind; -} - -/*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ -int32_t Locator_s::kind() const -{ - return m_kind; -} - -/*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ -int32_t& Locator_s::kind() -{ - return m_kind; -} - - -/*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ -void Locator_s::port( - uint32_t _port) -{ - m_port = _port; -} - -/*! - * @brief This function returns the value of member port - * @return Value of member port - */ -uint32_t Locator_s::port() const -{ - return m_port; -} - -/*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ -uint32_t& Locator_s::port() -{ - return m_port; -} - - -/*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ -void Locator_s::address( - const std::array& _address) -{ - m_address = _address; -} - -/*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ -void Locator_s::address( - std::array&& _address) -{ - m_address = std::move(_address); -} - -/*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ -const std::array& Locator_s::address() const -{ - return m_address; -} - -/*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ -std::array& Locator_s::address() -{ - return m_address; -} - - - - - -} // namespace detail - - -DiscoveryTime::DiscoveryTime() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid - - // unsigned long long m_time - m_time = 0; - // /type_d() m_host - - // /type_d() m_user - - // /type_d() m_process - - -} - -DiscoveryTime::~DiscoveryTime() -{ -} - -DiscoveryTime::DiscoveryTime( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - - - m_remote_entity_guid = x.m_remote_entity_guid; - - - m_time = x.m_time; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - -} - -DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - - - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - - - m_time = x.m_time; - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - -} - -DiscoveryTime& DiscoveryTime::operator =( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - - - m_remote_entity_guid = x.m_remote_entity_guid; - - - m_time = x.m_time; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - - return *this; -} - -DiscoveryTime& DiscoveryTime::operator =( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - - - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - - - m_time = x.m_time; - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - - return *this; -} - -bool DiscoveryTime::operator ==( - const DiscoveryTime& x) const -{ - return (m_local_participant_guid == x.m_local_participant_guid && - m_remote_entity_guid == x.m_remote_entity_guid && - m_time == x.m_time && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool DiscoveryTime::operator !=( - const DiscoveryTime& x) const -{ - return !(*this == x); -} - -size_t DiscoveryTime::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; -} - -size_t DiscoveryTime::getCdrSerializedSize( - const DiscoveryTime& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_participant_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.remote_entity_guid(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void DiscoveryTime::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_local_participant_guid; - - scdr << m_remote_entity_guid; - - scdr << m_time; - - scdr << m_host.c_str(); - - scdr << m_user.c_str(); - - scdr << m_process.c_str(); - -} - -void DiscoveryTime::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_local_participant_guid; - - - - dcdr >> m_remote_entity_guid; - - - - dcdr >> m_time; - - - - dcdr >> m_host; - - - - dcdr >> m_user; - - - - dcdr >> m_process; - - -} - - -bool DiscoveryTime::isKeyDefined() -{ - return true; -} - -void DiscoveryTime::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_local_participant_guid.serialize(scdr); - m_remote_entity_guid.serialize(scdr); - - - - -} - -/*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) -{ - m_local_participant_guid = _local_participant_guid; -} - -/*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) -{ - m_local_participant_guid = std::move(_local_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const -{ - return m_local_participant_guid; -} - -/*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() -{ - return m_local_participant_guid; -} - - -/*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) -{ - m_remote_entity_guid = _remote_entity_guid; -} - -/*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) -{ - m_remote_entity_guid = std::move(_remote_entity_guid); -} - -/*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const -{ - return m_remote_entity_guid; -} - -/*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() -{ - return m_remote_entity_guid; -} - - -/*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ -void DiscoveryTime::time( - uint64_t _time) -{ - m_time = _time; -} - -/*! - * @brief This function returns the value of member time - * @return Value of member time - */ -uint64_t DiscoveryTime::time() const -{ - return m_time; -} - -/*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ -uint64_t& DiscoveryTime::time() -{ - return m_time; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void DiscoveryTime::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void DiscoveryTime::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& DiscoveryTime::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& DiscoveryTime::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void DiscoveryTime::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void DiscoveryTime::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& DiscoveryTime::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& DiscoveryTime::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void DiscoveryTime::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void DiscoveryTime::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& DiscoveryTime::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& DiscoveryTime::process() -{ - return m_process; -} - - - - - -EntityCount::EntityCount() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // unsigned long long m_count - m_count = 0; - -} - -EntityCount::~EntityCount() -{ -} - -EntityCount::EntityCount( - const EntityCount& x) -{ - m_guid = x.m_guid; - - - m_count = x.m_count; - -} - -EntityCount::EntityCount( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_count = x.m_count; - -} - -EntityCount& EntityCount::operator =( - const EntityCount& x) -{ - m_guid = x.m_guid; - - - m_count = x.m_count; - - return *this; -} - -EntityCount& EntityCount::operator =( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_count = x.m_count; - - return *this; -} - -bool EntityCount::operator ==( - const EntityCount& x) const -{ - return (m_guid == x.m_guid && - m_count == x.m_count); -} - -bool EntityCount::operator !=( - const EntityCount& x) const -{ - return !(*this == x); -} - -size_t EntityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; -} - -size_t EntityCount::getCdrSerializedSize( - const EntityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void EntityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guid; - - scdr << m_count; - -} - -void EntityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guid; - - - - dcdr >> m_count; - - -} - - -bool EntityCount::isKeyDefined() -{ - return true; -} - -void EntityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityCount::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityCount::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void EntityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t EntityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& EntityCount::count() -{ - return m_count; -} - - - - - -SampleIdentityCount::SampleIdentityCount() -{ - // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id - - // unsigned long long m_count - m_count = 0; - -} - -SampleIdentityCount::~SampleIdentityCount() -{ -} - -SampleIdentityCount::SampleIdentityCount( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - - - m_count = x.m_count; - -} - -SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - - - m_count = x.m_count; - -} - -SampleIdentityCount& SampleIdentityCount::operator =( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - - - m_count = x.m_count; - - return *this; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - - - m_count = x.m_count; - - return *this; -} - -bool SampleIdentityCount::operator ==( - const SampleIdentityCount& x) const -{ - return (m_sample_id == x.m_sample_id && - m_count == x.m_count); -} - -bool SampleIdentityCount::operator !=( - const SampleIdentityCount& x) const -{ - return !(*this == x); -} - -size_t SampleIdentityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; -} - -size_t SampleIdentityCount::getCdrSerializedSize( - const SampleIdentityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize(data.sample_id(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void SampleIdentityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sample_id; - - scdr << m_count; - -} - -void SampleIdentityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sample_id; - - - - dcdr >> m_count; - - -} - - -bool SampleIdentityCount::isKeyDefined() -{ - return true; -} - -void SampleIdentityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_sample_id.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ -void SampleIdentityCount::sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) -{ - m_sample_id = _sample_id; -} - -/*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ -void SampleIdentityCount::sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) -{ - m_sample_id = std::move(_sample_id); -} - -/*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const -{ - return m_sample_id; -} - -/*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() -{ - return m_sample_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void SampleIdentityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t SampleIdentityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& SampleIdentityCount::count() -{ - return m_count; -} - - - - - -Entity2LocatorTraffic::Entity2LocatorTraffic() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_src_guid - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // unsigned long long m_packet_count - m_packet_count = 0; - // unsigned long long m_byte_count - m_byte_count = 0; - // short m_byte_magnitude_order - m_byte_magnitude_order = 0; - -} - -Entity2LocatorTraffic::~Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - - - m_dst_locator = x.m_dst_locator; - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - - - m_dst_locator = x.m_dst_locator; - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - - return *this; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - - return *this; -} - -bool Entity2LocatorTraffic::operator ==( - const Entity2LocatorTraffic& x) const -{ - return (m_src_guid == x.m_src_guid && - m_dst_locator == x.m_dst_locator && - m_packet_count == x.m_packet_count && - m_byte_count == x.m_byte_count && - m_byte_magnitude_order == x.m_byte_magnitude_order); -} - -bool Entity2LocatorTraffic::operator !=( - const Entity2LocatorTraffic& x) const -{ - return !(*this == x); -} - -size_t Entity2LocatorTraffic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; -} - -size_t Entity2LocatorTraffic::getCdrSerializedSize( - const Entity2LocatorTraffic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.src_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - - -void Entity2LocatorTraffic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_src_guid; - - scdr << m_dst_locator; - - scdr << m_packet_count; - - scdr << m_byte_count; - - scdr << m_byte_magnitude_order; - -} - -void Entity2LocatorTraffic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_src_guid; - - - - dcdr >> m_dst_locator; - - - - dcdr >> m_packet_count; - - - - dcdr >> m_byte_count; - - - - dcdr >> m_byte_magnitude_order; - - -} - - -bool Entity2LocatorTraffic::isKeyDefined() -{ - return true; -} - -void Entity2LocatorTraffic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_guid.serialize(scdr); - m_dst_locator.serialize(scdr); - - - -} - -/*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) -{ - m_src_guid = _src_guid; -} - -/*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) -{ - m_src_guid = std::move(_src_guid); -} - -/*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const -{ - return m_src_guid; -} - -/*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() -{ - return m_src_guid; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ -void Entity2LocatorTraffic::packet_count( - uint64_t _packet_count) -{ - m_packet_count = _packet_count; -} - -/*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ -uint64_t Entity2LocatorTraffic::packet_count() const -{ - return m_packet_count; -} - -/*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ -uint64_t& Entity2LocatorTraffic::packet_count() -{ - return m_packet_count; -} - - -/*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ -void Entity2LocatorTraffic::byte_count( - uint64_t _byte_count) -{ - m_byte_count = _byte_count; -} - -/*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ -uint64_t Entity2LocatorTraffic::byte_count() const -{ - return m_byte_count; -} - -/*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ -uint64_t& Entity2LocatorTraffic::byte_count() -{ - return m_byte_count; -} - - -/*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ -void Entity2LocatorTraffic::byte_magnitude_order( - int16_t _byte_magnitude_order) -{ - m_byte_magnitude_order = _byte_magnitude_order; -} - -/*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ -int16_t Entity2LocatorTraffic::byte_magnitude_order() const -{ - return m_byte_magnitude_order; -} - -/*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ -int16_t& Entity2LocatorTraffic::byte_magnitude_order() -{ - return m_byte_magnitude_order; -} - - - - - -WriterReaderData::WriterReaderData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid - - // float m_data - m_data = 0.0; - -} - -WriterReaderData::~WriterReaderData() -{ -} - -WriterReaderData::WriterReaderData( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_reader_guid = x.m_reader_guid; - - - m_data = x.m_data; - -} - -WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_reader_guid = std::move(x.m_reader_guid); - - - m_data = x.m_data; - -} - -WriterReaderData& WriterReaderData::operator =( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_reader_guid = x.m_reader_guid; - - - m_data = x.m_data; - - return *this; -} - -WriterReaderData& WriterReaderData::operator =( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_reader_guid = std::move(x.m_reader_guid); - - - m_data = x.m_data; - - return *this; -} - -bool WriterReaderData::operator ==( - const WriterReaderData& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_reader_guid == x.m_reader_guid && - m_data == x.m_data); -} - -bool WriterReaderData::operator !=( - const WriterReaderData& x) const -{ - return !(*this == x); -} - -size_t WriterReaderData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; -} - -size_t WriterReaderData::getCdrSerializedSize( - const WriterReaderData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.reader_guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void WriterReaderData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_writer_guid; - - scdr << m_reader_guid; - - scdr << m_data; - -} - -void WriterReaderData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_writer_guid; - - - - dcdr >> m_reader_guid; - - - - dcdr >> m_data; - - -} - - -bool WriterReaderData::isKeyDefined() -{ - return true; -} - -void WriterReaderData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_writer_guid.serialize(scdr); - m_reader_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void WriterReaderData::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void WriterReaderData::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ -void WriterReaderData::reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) -{ - m_reader_guid = _reader_guid; -} - -/*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ -void WriterReaderData::reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) -{ - m_reader_guid = std::move(_reader_guid); -} - -/*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const -{ - return m_reader_guid; -} - -/*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() -{ - return m_reader_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void WriterReaderData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float WriterReaderData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& WriterReaderData::data() -{ - return m_data; -} - - - - - -Locator2LocatorData::Locator2LocatorData() -{ - // eprosima::fastdds::statistics::detail::Locator_s m_src_locator - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // float m_data - m_data = 0.0; - -} - -Locator2LocatorData::~Locator2LocatorData() -{ -} - -Locator2LocatorData::Locator2LocatorData( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - - - m_dst_locator = x.m_dst_locator; - - - m_data = x.m_data; - -} - -Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_data = x.m_data; - -} - -Locator2LocatorData& Locator2LocatorData::operator =( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - - - m_dst_locator = x.m_dst_locator; - - - m_data = x.m_data; - - return *this; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_data = x.m_data; - - return *this; -} - -bool Locator2LocatorData::operator ==( - const Locator2LocatorData& x) const -{ - return (m_src_locator == x.m_src_locator && - m_dst_locator == x.m_dst_locator && - m_data == x.m_data); -} - -bool Locator2LocatorData::operator !=( - const Locator2LocatorData& x) const -{ - return !(*this == x); -} - -size_t Locator2LocatorData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; -} - -size_t Locator2LocatorData::getCdrSerializedSize( - const Locator2LocatorData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.src_locator(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Locator2LocatorData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_src_locator; - - scdr << m_dst_locator; - - scdr << m_data; - -} - -void Locator2LocatorData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_src_locator; - - - - dcdr >> m_dst_locator; - - - - dcdr >> m_data; - - -} - - -bool Locator2LocatorData::isKeyDefined() -{ - return true; -} - -void Locator2LocatorData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_locator.serialize(scdr); - m_dst_locator.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ -void Locator2LocatorData::src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) -{ - m_src_locator = _src_locator; -} - -/*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ -void Locator2LocatorData::src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) -{ - m_src_locator = std::move(_src_locator); -} - -/*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const -{ - return m_src_locator; -} - -/*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() -{ - return m_src_locator; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Locator2LocatorData::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Locator2LocatorData::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void Locator2LocatorData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float Locator2LocatorData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& Locator2LocatorData::data() -{ - return m_data; -} - - - - - -EntityData::EntityData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // float m_data - m_data = 0.0; - -} - -EntityData::~EntityData() -{ -} - -EntityData::EntityData( - const EntityData& x) -{ - m_guid = x.m_guid; - - - m_data = x.m_data; - -} - -EntityData::EntityData( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_data = x.m_data; - -} - -EntityData& EntityData::operator =( - const EntityData& x) -{ - m_guid = x.m_guid; - - - m_data = x.m_data; - - return *this; -} - -EntityData& EntityData::operator =( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_data = x.m_data; - - return *this; -} - -bool EntityData::operator ==( - const EntityData& x) const -{ - return (m_guid == x.m_guid && - m_data == x.m_data); -} - -bool EntityData::operator !=( - const EntityData& x) const -{ - return !(*this == x); -} - -size_t EntityData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; -} - -size_t EntityData::getCdrSerializedSize( - const EntityData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void EntityData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guid; - - scdr << m_data; - -} - -void EntityData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guid; - - - - dcdr >> m_data; - - -} - - -bool EntityData::isKeyDefined() -{ - return true; -} - -void EntityData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityData::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityData::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void EntityData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float EntityData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& EntityData::data() -{ - return m_data; -} - - - - - -PhysicalData::PhysicalData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid - - // /type_d() m_host - - // /type_d() m_user - - // /type_d() m_process - - -} - -PhysicalData::~PhysicalData() -{ -} - -PhysicalData::PhysicalData( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - -} - -PhysicalData::PhysicalData( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - -} - -PhysicalData& PhysicalData::operator =( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - - return *this; -} - -PhysicalData& PhysicalData::operator =( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - - return *this; -} - -bool PhysicalData::operator ==( - const PhysicalData& x) const -{ - return (m_participant_guid == x.m_participant_guid && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool PhysicalData::operator !=( - const PhysicalData& x) const -{ - return !(*this == x); -} - -size_t PhysicalData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; -} - -size_t PhysicalData::getCdrSerializedSize( - const PhysicalData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.participant_guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void PhysicalData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_participant_guid; - - scdr << m_host.c_str(); - - scdr << m_user.c_str(); - - scdr << m_process.c_str(); - -} - -void PhysicalData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_participant_guid; - - - - dcdr >> m_host; - - - - dcdr >> m_user; - - - - dcdr >> m_process; - - -} - - -bool PhysicalData::isKeyDefined() -{ - return true; -} - -void PhysicalData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_participant_guid.serialize(scdr); - - - -} - -/*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ -void PhysicalData::participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) -{ - m_participant_guid = _participant_guid; -} - -/*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ -void PhysicalData::participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) -{ - m_participant_guid = std::move(_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const -{ - return m_participant_guid; -} - -/*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() -{ - return m_participant_guid; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void PhysicalData::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void PhysicalData::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& PhysicalData::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& PhysicalData::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void PhysicalData::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void PhysicalData::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& PhysicalData::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& PhysicalData::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void PhysicalData::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void PhysicalData::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& PhysicalData::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& PhysicalData::process() -{ - return m_process; -} - - - - - - -Data::Data() -{ - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data - - // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data - - // eprosima::fastdds::statistics::EntityData m_entity_data - - // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic - - // eprosima::fastdds::statistics::EntityCount m_entity_count - - // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time - - // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count - - // eprosima::fastdds::statistics::PhysicalData m_physical_data - -} - -Data::~Data() -{ -} - -Data::Data( - const Data& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } -} - -Data::Data( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } -} - -Data& Data::operator =( - const Data& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } - - return *this; -} - -Data& Data::operator =( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } - - return *this; -} - -bool Data::operator ==( - const Data& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - return (m_writer_reader_data == x.m_writer_reader_data); - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - return (m_locator2locator_data == x.m_locator2locator_data); - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - return (m_entity_data == x.m_entity_data); - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - return (m_entity2locator_traffic == x.m_entity2locator_traffic); - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - return (m_entity_count == x.m_entity_count); - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - return (m_discovery_time == x.m_discovery_time); - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - return (m_sample_identity_count == x.m_sample_identity_count); - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - return (m_physical_data == x.m_physical_data); - break; - - default: - break; - } - return false; -} - -bool Data::operator !=( - const Data& x) const -{ - return !(*this == x); -} - -void Data::_d( - eprosima::fastdds::statistics::EventKind __d) -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - switch(__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - switch(__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - switch(__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - switch(__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - switch(__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - switch(__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - switch(__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - switch(__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::EventKind Data::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::EventKind& Data::_d() -{ - return m__d; -} - -void Data::writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) -{ - m_writer_reader_data = _writer_reader_data; - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -void Data::writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) -{ - m_writer_reader_data = std::move(_writer_reader_data); - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - -eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - - -void Data::locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) -{ - m_locator2locator_data = _locator2locator_data; - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -void Data::locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) -{ - m_locator2locator_data = std::move(_locator2locator_data); - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - -eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - - -void Data::entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data) -{ - m_entity_data = _entity_data; - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -void Data::entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data) -{ - m_entity_data = std::move(_entity_data); - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -const eprosima::fastdds::statistics::EntityData& Data::entity_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - -eprosima::fastdds::statistics::EntityData& Data::entity_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - - -void Data::entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) -{ - m_entity2locator_traffic = _entity2locator_traffic; - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -void Data::entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) -{ - m_entity2locator_traffic = std::move(_entity2locator_traffic); - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - -eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - - -void Data::entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count) -{ - m_entity_count = _entity_count; - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -void Data::entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count) -{ - m_entity_count = std::move(_entity_count); - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - -eprosima::fastdds::statistics::EntityCount& Data::entity_count() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - - -void Data::discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) -{ - m_discovery_time = _discovery_time; - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -void Data::discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) -{ - m_discovery_time = std::move(_discovery_time); - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - -eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - - -void Data::sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) -{ - m_sample_identity_count = _sample_identity_count; - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -void Data::sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) -{ - m_sample_identity_count = std::move(_sample_identity_count); - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - -eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - - -void Data::physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data) -{ - m_physical_data = _physical_data; - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -void Data::physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data) -{ - m_physical_data = std::move(_physical_data); - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - -eprosima::fastdds::statistics::PhysicalData& Data::physical_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - - -// TODO(Ricardo) Review -size_t Data::getCdrSerializedSize( - const Data& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - switch(data.m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - current_alignment += eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize(data.writer_reader_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - current_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize(data.locator2locator_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - current_alignment += eprosima::fastdds::statistics::EntityData::getCdrSerializedSize(data.entity_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - current_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize(data.entity2locator_traffic(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - current_alignment += eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize(data.entity_count(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - current_alignment += eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize(data.discovery_time(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - current_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize(data.sample_identity_count(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - current_alignment += eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize(data.physical_data(), current_alignment); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void Data::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - scdr << m_writer_reader_data; - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - scdr << m_locator2locator_data; - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - scdr << m_entity_data; - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - scdr << m_entity2locator_traffic; - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - scdr << m_entity_count; - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - scdr << m_discovery_time; - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - scdr << m_sample_identity_count; - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - scdr << m_physical_data; - - break; - - default: - break; - } -} - -void Data::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t bitmask_value = 0; - dcdr >> bitmask_value; - m__d = (eprosima::fastdds::statistics::EventKind)bitmask_value; - } - - - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - dcdr >> m_writer_reader_data; - - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - dcdr >> m_locator2locator_data; - - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - dcdr >> m_entity_data; - - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - dcdr >> m_entity2locator_traffic; - - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - dcdr >> m_entity_count; - - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - dcdr >> m_discovery_time; - - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - dcdr >> m_sample_identity_count; - - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - dcdr >> m_physical_data; - - - break; - - default: - break; - } -} - - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/src/cpp/statistics/types/typesv1.h b/src/cpp/statistics/types/typesv1.h deleted file mode 100644 index 4790ebcb43c..00000000000 --- a/src/cpp/statistics/types/typesv1.h +++ /dev/null @@ -1,3093 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - namespace fastdds { - namespace statistics { - namespace detail { - - - /*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ - class EntityId_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::EntityId_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::array m_value; - - }; - - - - /*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ - class GuidPrefix_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::array m_value; - - }; - - - - /*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ - class GUID_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GUID_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - - }; - - - - /*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ - class SequenceNumber_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_high; - uint32_t m_low; - - }; - - - - /*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentity_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - - }; - - - - /*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ - class Locator_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::Locator_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_kind; - uint32_t m_port; - std::array m_address; - - }; - - } // namespace detail - - - /*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ - class DiscoveryTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::DiscoveryTime& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - - - - /*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ - class EntityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityCount& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count; - - }; - - - - /*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::SampleIdentityCount& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count; - - }; - - - - /*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ - class Entity2LocatorTraffic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count; - uint64_t m_byte_count; - int16_t m_byte_magnitude_order; - - }; - - - - /*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ - class WriterReaderData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::WriterReaderData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ - class Locator2LocatorData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Locator2LocatorData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ - class EntityData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ - class PhysicalData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::PhysicalData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - - /*! - * @brief This class represents the bitmask EventKind defined by the user in the IDL file. - * @ingroup types - */ - enum EventKindBits : uint32_t - { - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 - }; - typedef uint32_t EventKind; - - - /*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ - class Data - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Data& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - - private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; - }; - - } // namespace statistics - } // namespace fastdds -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/src/cpp/utils/DBQueue.hpp b/src/cpp/utils/DBQueue.hpp new file mode 100644 index 00000000000..5e74ca5e1b6 --- /dev/null +++ b/src/cpp/utils/DBQueue.hpp @@ -0,0 +1,157 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef _FASTDDS_DBQUEUE_HPP +#define _FASTDDS_DBQUEUE_HPP + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { + +/** + * Double buffered, threadsafe queue for MPSC (multi-producer, single-consumer) comms. + */ +template +class DBQueue +{ + +public: + + DBQueue() + : mForegroundQueue(&mQueueAlpha) + , mBackgroundQueue(&mQueueBeta) + { + } + + //! Clears foreground queue and swaps queues. + void Swap() + { + std::unique_lock fgGuard(mForegroundMutex); + std::unique_lock bgGuard(mBackgroundMutex); + + // Clear the foreground queue. + std::queue().swap(*mForegroundQueue); + + auto* swap = mBackgroundQueue; + mBackgroundQueue = mForegroundQueue; + mForegroundQueue = swap; + } + + //! Pushes to the background queue. Copy constructor. + void Push( + const T& item) + { + std::unique_lock guard(mBackgroundMutex); + mBackgroundQueue->push(item); + } + + //! Pushes to the background queue. Move constructor. + void Push( + T&& item) + { + std::unique_lock guard(mBackgroundMutex); + mBackgroundQueue->push(std::move(item)); + } + + //! Returns a reference to the front element + //! in the foregrund queue. + T& Front() + { + std::unique_lock guard(mForegroundMutex); + return mForegroundQueue->front(); + } + + const T& Front() const + { + std::unique_lock guard(mForegroundMutex); + return mForegroundQueue->front(); + } + + //! Pops from the foreground queue. + void Pop() + { + std::unique_lock guard(mForegroundMutex); + mForegroundQueue->pop(); + } + + //! Return the front element in the foreground queue by moving it and erase it from the queue. + T FrontAndPop() + { + std::unique_lock guard(mForegroundMutex); + + // Get value by moving the internal queue reference to a new value + T value = std::move(mForegroundQueue->front()); + // At this point mForegroundQueue contains a non valid element, but mutex is taken and next instruction erase it + + // Pop value from queue + mForegroundQueue->pop(); + + // Return value (as it has been created in this scope, it will not be copied but moved or directly forwarded) + return value; + } + + //! Reports whether the foreground queue is empty. + bool Empty() const + { + std::unique_lock guard(mForegroundMutex); + return mForegroundQueue->empty(); + } + + //! Reports whether the both queues are empty. + bool BothEmpty() const + { + std::unique_lock guard(mForegroundMutex); + std::unique_lock bgGuard(mBackgroundMutex); + return mForegroundQueue->empty() && mBackgroundQueue->empty(); + } + + //! Reports the size of the foreground queue. + size_t Size() const + { + std::unique_lock guard(mForegroundMutex); + return mForegroundQueue->size(); + } + + //! Clears foreground and background. + void Clear() + { + std::unique_lock fgGuard(mForegroundMutex); + std::unique_lock bgGuard(mBackgroundMutex); + std::queue().swap(*mForegroundQueue); + std::queue().swap(*mBackgroundQueue); + } + +private: + + // Underlying queues + std::queue mQueueAlpha; + std::queue mQueueBeta; + + // Front and background queue references (double buffering) + std::queue* mForegroundQueue; + std::queue* mBackgroundQueue; + + mutable std::mutex mForegroundMutex; + mutable std::mutex mBackgroundMutex; +}; + + +} // namespace fastdds +} // namespace eprosima + +#endif // ifndef DBQUEUE_H diff --git a/src/cpp/utils/Host.hpp b/src/cpp/utils/Host.hpp index 3feb9139920..427e0ea14af 100644 --- a/src/cpp/utils/Host.hpp +++ b/src/cpp/utils/Host.hpp @@ -15,12 +15,10 @@ #ifndef UTILS_HOST_HPP_ #define UTILS_HOST_HPP_ -#include - -#include -#include - #include +#include +#include +#include namespace eprosima { diff --git a/src/cpp/utils/IPFinder.cpp b/src/cpp/utils/IPFinder.cpp index 231173cf000..b2b345a86bb 100644 --- a/src/cpp/utils/IPFinder.cpp +++ b/src/cpp/utils/IPFinder.cpp @@ -17,8 +17,8 @@ * */ -#include -#include +#include +#include #include diff --git a/src/cpp/utils/IPLocator.cpp b/src/cpp/utils/IPLocator.cpp index d624612a883..3127bd5d4db 100644 --- a/src/cpp/utils/IPLocator.cpp +++ b/src/cpp/utils/IPLocator.cpp @@ -22,8 +22,8 @@ #include -#include -#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/include/fastrtps/utils/ProxyPool.hpp b/src/cpp/utils/ProxyPool.hpp similarity index 97% rename from include/fastrtps/utils/ProxyPool.hpp rename to src/cpp/utils/ProxyPool.hpp index 6d812623d6e..84a2a7923c0 100644 --- a/include/fastrtps/utils/ProxyPool.hpp +++ b/src/cpp/utils/ProxyPool.hpp @@ -16,8 +16,8 @@ * @file ProxyPool.hpp */ -#ifndef FASTRTPS_UTILS_PROXY_POOL_HPP_ -#define FASTRTPS_UTILS_PROXY_POOL_HPP_ +#ifndef _FASTDDS_UTILS_PROXY_POOL_HPP_ +#define _FASTDDS_UTILS_PROXY_POOL_HPP_ #include #include @@ -240,4 +240,4 @@ class ProxyPool } // eprosima namespace -#endif /* FASTRTPS_UTILS_PROXY_POOL_HPP_ */ +#endif /* _FASTDDS_UTILS_PROXY_POOL_HPP_ */ diff --git a/src/cpp/utils/Semaphore.hpp b/src/cpp/utils/Semaphore.hpp new file mode 100644 index 00000000000..8e09f265bb3 --- /dev/null +++ b/src/cpp/utils/Semaphore.hpp @@ -0,0 +1,122 @@ +// Copyright 2016 Esteve Fernandez +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_SEMAPHORE_H_ +#define _FASTDDS_SEMAPHORE_H_ + +#include +#include + +namespace eprosima { +namespace fastdds { + +class Semaphore +{ +public: + + explicit Semaphore( + size_t count = 0); + Semaphore( + const Semaphore&) = delete; + Semaphore& operator =( + const Semaphore&) = delete; + + void post(); + void wait(); + void disable(); + void enable(); + void post( + int n); + +private: + + size_t count_; + std::mutex mutex_; + std::condition_variable cv_; + bool disable_; +}; + +inline Semaphore::Semaphore( + size_t count) + : count_(count) + , disable_(false) +{ +} + +inline void Semaphore::post() +{ + std::lock_guard lock(mutex_); + if (!disable_) + { + ++count_; + cv_.notify_one(); + } +} + +inline void Semaphore::post( + int n) +{ + std::lock_guard lock(mutex_); + if (!disable_) + { + count_ += n; + for (int i = 0; i < n; ++i) + { + cv_.notify_one(); + } + } +} + +inline void Semaphore::disable() +{ + std::lock_guard lock(mutex_); + if (!disable_) + { + count_ = (size_t)-1L; + cv_.notify_all(); + disable_ = true; + } +} + +inline void Semaphore::enable() +{ + std::lock_guard lock(mutex_); + if (disable_) + { + count_ = 0; + disable_ = false; + } +} + +inline void Semaphore::wait() +{ + std::unique_lock lock(mutex_); + if (!disable_) + { + cv_.wait(lock, [&] + { + if (disable_) + { + return true; + } + return count_ > 0; + }); + --count_; + } +} + +} // fastdds +} // eprosima + +#endif // _FASTDDS_SEMAPHORE_H_ diff --git a/src/cpp/utils/StringMatching.cpp b/src/cpp/utils/StringMatching.cpp index 4e254a9297a..cb8cd28ecc2 100644 --- a/src/cpp/utils/StringMatching.cpp +++ b/src/cpp/utils/StringMatching.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include @@ -31,7 +31,7 @@ #endif // if defined(__cplusplus_winrt) namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { StringMatching::StringMatching() @@ -152,6 +152,6 @@ bool StringMatching::matchString( #endif // if defined(__cplusplus_winrt) -} // namespace rtps } /* namespace rtps */ +} /* namespace fastdds */ } /* namespace eprosima */ diff --git a/src/cpp/utils/StringMatching.hpp b/src/cpp/utils/StringMatching.hpp new file mode 100644 index 00000000000..d21f96ccdd1 --- /dev/null +++ b/src/cpp/utils/StringMatching.hpp @@ -0,0 +1,66 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StringMatching.hpp + * + */ + +#ifndef _FASTDDS_STRINGMATCHING_H_ +#define _FASTDDS_STRINGMATCHING_H_ + +#include + +#include +#include +#include + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +namespace eprosima { +namespace fastdds { +namespace rtps { +/** + * Class StringMatching used to match different strings against each other as defined by the POSIX fnmatch API (1003.2-1992 + section B.6). + @ingroup UTILITIES_MODULE + */ +class FASTDDS_EXPORTED_API StringMatching +{ +public: + + StringMatching(); + + virtual ~StringMatching(); + + /** Static method to match two strings. + * It checks if the input strings match. Any of the strings or both can be a pattern. + */ + static bool matchString( + const char* input1, + const char* input2); + + /** Static method to match a string to a pattern. + * It checks the string specified by the input argument to see if it matches the pattern specified by the pattern argument. + */ + static bool matchPattern( + const char* pattern, + const char* input); +}; + +} /*/ namespace rtps */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif // _FASTDDS_STRINGMATCHING_H_ diff --git a/src/cpp/utils/System.cpp b/src/cpp/utils/System.cpp deleted file mode 100644 index 955bf618e11..00000000000 --- a/src/cpp/utils/System.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file System.cpp - */ - -#include - -#include - -namespace eprosima { -namespace fastrtps { - -int System::GetPID() -{ - return SystemInfo::instance().process_id(); -} - -} // namespace fastrtps -} // namespace eprosima diff --git a/src/cpp/utils/SystemInfo.cpp b/src/cpp/utils/SystemInfo.cpp index 8aab32dbb9d..a825f43633f 100644 --- a/src/cpp/utils/SystemInfo.cpp +++ b/src/cpp/utils/SystemInfo.cpp @@ -36,14 +36,13 @@ #include -#include -#include +#include +#include #include namespace eprosima { using IPFinder = fastrtps::rtps::IPFinder; -using ReturnCode_t = fastrtps::types::ReturnCode_t; SystemInfo::SystemInfo() { @@ -60,19 +59,19 @@ SystemInfo::SystemInfo() update_interfaces(); } -ReturnCode_t SystemInfo::get_env( +fastdds::dds::ReturnCode_t SystemInfo::get_env( const std::string& env_name, std::string& env_value) { if (env_name.empty()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return fastdds::dds::RETCODE_BAD_PARAMETER; } // Try to read environment variable from file - if (!environment_file_.empty() && ReturnCode_t::RETCODE_OK == get_env(environment_file_, env_name, env_value)) + if (!environment_file_.empty() && fastdds::dds::RETCODE_OK == get_env(environment_file_, env_name, env_value)) { - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } char* data; @@ -84,13 +83,13 @@ ReturnCode_t SystemInfo::get_env( } else { - return ReturnCode_t::RETCODE_NO_DATA; + return fastdds::dds::RETCODE_NO_DATA; } - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } -ReturnCode_t SystemInfo::get_env( +fastdds::dds::ReturnCode_t SystemInfo::get_env( const std::string& filename, const std::string& env_name, std::string& env_value) @@ -98,7 +97,7 @@ ReturnCode_t SystemInfo::get_env( // Check that the file exists if (!SystemInfo::file_exists(filename)) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return fastdds::dds::RETCODE_BAD_PARAMETER; } // Read json file @@ -111,7 +110,7 @@ ReturnCode_t SystemInfo::get_env( } catch (const nlohmann::json::exception&) { - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; } try @@ -120,12 +119,12 @@ ReturnCode_t SystemInfo::get_env( } catch (const nlohmann::json::exception&) { - return ReturnCode_t::RETCODE_NO_DATA; + return fastdds::dds::RETCODE_NO_DATA; } - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } -ReturnCode_t SystemInfo::get_username( +fastdds::dds::ReturnCode_t SystemInfo::get_username( std::string& username) { #ifdef _WIN32 @@ -134,10 +133,10 @@ ReturnCode_t SystemInfo::get_username( DWORD bufCharCount = INFO_BUFFER_SIZE; if (!GetUserNameA(user, &bufCharCount)) { - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; } username = user; - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; #else uid_t user_id = geteuid(); struct passwd* pwd = getpwuid(user_id); @@ -146,10 +145,10 @@ ReturnCode_t SystemInfo::get_username( username = pwd->pw_name; if (!username.empty()) { - return ReturnCode_t::RETCODE_OK; + return fastdds::dds::RETCODE_OK; } } - return ReturnCode_t::RETCODE_ERROR; + return fastdds::dds::RETCODE_ERROR; #endif // _WIN32 } @@ -208,7 +207,7 @@ bool SystemInfo::wait_for_file_closure( return std::chrono::system_clock::now() - start < timeout; } -ReturnCode_t SystemInfo::set_environment_file() +fastdds::dds::ReturnCode_t SystemInfo::set_environment_file() { return SystemInfo::get_env(FASTDDS_ENVIRONMENT_FILE_ENV_VAR, SystemInfo::environment_file_); } diff --git a/src/cpp/utils/SystemInfo.hpp b/src/cpp/utils/SystemInfo.hpp index 51f7a5fa5ab..99974006b86 100644 --- a/src/cpp/utils/SystemInfo.hpp +++ b/src/cpp/utils/SystemInfo.hpp @@ -27,9 +27,8 @@ #include #include - -#include -#include +#include +#include #include #if defined(_WIN32) || defined(__unix__) @@ -38,7 +37,7 @@ namespace eprosima { -using ReturnCode_t = fastrtps::types::ReturnCode_t; +using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; #if defined(_WIN32) || defined(__unix__) using FileWatchHandle = std::unique_ptr>; #else diff --git a/src/cpp/utils/TimeConversion.hpp b/src/cpp/utils/TimeConversion.hpp new file mode 100644 index 00000000000..845649305c0 --- /dev/null +++ b/src/cpp/utils/TimeConversion.hpp @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file TimeConversion.h + * + */ + +#ifndef _FASTDDS_TIMECONVERSION_H_ +#define _FASTDDS_TIMECONVERSION_H_ + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + + +namespace TimeConv { + +using namespace eprosima::fastrtps::rtps; + +/** + * Convert Time_t to seconds as a double + */ +inline double Time_t2SecondsDouble( + const Time_t& t) +{ + return (double)t.seconds() + (double)(t.fraction() / pow(2.0, 32)); +} + +/** + * Convert Time_t to seconds as an int64 + */ +inline int64_t Time_t2MicroSecondsInt64( + const Time_t& t) +{ + return (int64_t)(t.fraction() / pow(2.0, 32) * pow(10.0, 6)) + t.seconds() * (int64_t)pow(10.0, 6); +} + +/** + * Convert Duration_t to seconds as an int64 + */ +inline int64_t Duration_t2MicroSecondsInt64( + const fastrtps::Duration_t& t) +{ + return (int64_t)(t.nanosec / 1000.0) + t.seconds * (int64_t)pow(10.0, 6); +} + +/** + * Convert Time_t to microseconds as a double + */ +inline double Time_t2MicroSecondsDouble( + const Time_t& t) +{ + return ((double)t.fraction() / pow(2.0, 32) * pow(10.0, 6)) + (double)t.seconds() * pow(10.0, 6); +} + +/** + * Convert Time_t to milliseconds as an int64 + */ +inline int64_t Time_t2MilliSecondsInt64( + const Time_t& t) +{ + return (int64_t)(t.fraction() / pow(2.0, 32) * pow(10.0, 3)) + t.seconds() * (int64_t)pow(10.0, 3); +} + +/** + * Convert Time_t to milliseconds as a double + */ +inline double Time_t2MilliSecondsDouble( + const Time_t& t) +{ + return ((double)t.fraction() / pow(2.0, 32) * pow(10.0, 3)) + (double)t.seconds() * pow(10.0, 3); +} + +/** + * Convert Duration_t to milliseconds as a double + */ +inline double Duration_t2MilliSecondsDouble( + const fastrtps::Duration_t& t) +{ + return ((double)t.nanosec / 1000000.0) + (double)t.seconds * pow(10.0, 3); +} + +/** + * Convert milliseconds to Time_t + */ +inline Time_t MilliSeconds2Time_t( + double millisec) +{ + Time_t t; + t.seconds((int32_t)(millisec / pow(10.0, 3))); + t.fraction((uint32_t)((millisec - (double)t.seconds() * pow(10.0, 3)) / pow(10.0, 3) * pow(2.0, 32))); + return t; +} + +/** + * Convert microseconds to Time_t + */ +inline Time_t MicroSeconds2Time_t( + double microsec) +{ + Time_t t; + t.seconds((int32_t)(microsec / pow(10.0, 6))); + t.fraction((uint32_t)((microsec - (double)t.seconds() * pow(10.0, 6)) / pow(10.0, 6) * pow(2.0, 32))); + return t; +} + +/** + * Convert seconds to Time_t + */ +inline Time_t Seconds2Time_t( + double seconds) +{ + Time_t t; + t.seconds((int32_t)seconds); + t.fraction((uint32_t)((seconds - (double)t.seconds()) * pow(2.0, 32))); + return t; +} + +/** + * Get the absolute difference between two Time_t in milliseconds as double + */ +inline double Time_tAbsDiff2DoubleMillisec( + const Time_t& t1, + const Time_t& t2) +{ + double result = 0; + result += (double)abs((t2.seconds() - t1.seconds()) * 1000); + result += (double)std::abs((t2.fraction() - t1.fraction()) / pow(2.0, 32) * 1000); + return result; +} + +//! Create a random Time_t that is millisec + [-randoff,randoff] +inline Time_t MilliSecondsWithRandOffset2Time_t( + double millisec, + double randoff) +{ + randoff = std::abs(randoff); + millisec = millisec + (-randoff) + static_cast (rand()) / + ( static_cast (RAND_MAX / (2 * randoff))); + return MilliSeconds2Time_t(millisec); +} + +//! Create a random Time_t that is microsec + [-randoff,randoff] +inline Time_t MicroSecondsWithRandOffset2Time_t( + double microsec, + double randoff) +{ + randoff = std::abs(randoff); + microsec = microsec + (-randoff) + static_cast (rand()) / + ( static_cast (RAND_MAX / (2 * randoff))); + return MicroSeconds2Time_t(microsec); +} + +//! Create a random Time_t that is sec + [-randoff,randoff] +inline Time_t SecondsWithRandOffset2Time_t( + double sec, + double randoff) +{ + randoff = std::abs(randoff); + sec = sec + (-randoff) + static_cast (rand()) / ( static_cast (RAND_MAX / (2 * randoff))); + return Seconds2Time_t(sec); +} + +} // namespace TimeConv +} /* namespace rtps */ +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_TIMECONVERSION_H_ */ diff --git a/src/cpp/utils/TimedConditionVariable.cpp b/src/cpp/utils/TimedConditionVariable.cpp index b9aae00039d..f51eb382bbd 100644 --- a/src/cpp/utils/TimedConditionVariable.cpp +++ b/src/cpp/utils/TimedConditionVariable.cpp @@ -16,22 +16,22 @@ * @file TimedConditionVariable.cpp */ -#include +#include #if defined(_WIN32) #include /* -#define MS_PER_SEC 1000ULL // MS = milliseconds -#define US_PER_MS 1000ULL // US = microseconds -#define HNS_PER_US 10ULL // HNS = hundred-nanoseconds (e.g., 1 hns = 100 ns) -#define NS_PER_US 1000ULL + #define MS_PER_SEC 1000ULL // MS = milliseconds + #define US_PER_MS 1000ULL // US = microseconds + #define HNS_PER_US 10ULL // HNS = hundred-nanoseconds (e.g., 1 hns = 100 ns) + #define NS_PER_US 1000ULL -#define HNS_PER_SEC (MS_PER_SEC * US_PER_MS * HNS_PER_US) -#define NS_PER_HNS (100ULL) // NS = nanoseconds -#define NS_PER_SEC (MS_PER_SEC * US_PER_MS * NS_PER_US) + #define HNS_PER_SEC (MS_PER_SEC * US_PER_MS * HNS_PER_US) + #define NS_PER_HNS (100ULL) // NS = nanoseconds + #define NS_PER_SEC (MS_PER_SEC * US_PER_MS * NS_PER_US) -int clock_gettime(int, struct timespec* tv) -{ + int clock_gettime(int, struct timespec* tv) + { FILETIME ft; ULARGE_INTEGER hnsTime; @@ -48,32 +48,40 @@ int clock_gettime(int, struct timespec* tv) tv->tv_sec = (long)(hnsTime.QuadPart / HNS_PER_SEC); return 0; -} -*/ + } + */ #define exp7 10000000i64 //1E+7 //C-file part #define exp9 1000000000i64 //1E+9 #define w2ux 116444736000000000i64 //1.jan1601 to 1.jan1970 -void unix_time(struct timespec* spec) +void unix_time( + struct timespec* spec) { - __int64 wintime; GetSystemTimeAsFileTime((FILETIME*)& wintime); + __int64 wintime; GetSystemTimeAsFileTime((FILETIME*)&wintime); wintime -= w2ux; spec->tv_sec = wintime / exp7; spec->tv_nsec = wintime % exp7 * 100; } -int clock_gettime(int, timespec* spec) + +int clock_gettime( + int, + timespec* spec) { - static struct timespec startspec; static double ticks2nano; + static struct timespec startspec; static double ticks2nano; static __int64 startticks, tps = 0; __int64 tmp, curticks; - QueryPerformanceFrequency((LARGE_INTEGER*)& tmp); //some strange system can - if (tps != tmp) { + QueryPerformanceFrequency((LARGE_INTEGER*)&tmp); //some strange system can + if (tps != tmp) + { tps = tmp; //init ~~ONCE //possibly change freq ? - QueryPerformanceCounter((LARGE_INTEGER*)& startticks); + QueryPerformanceCounter((LARGE_INTEGER*)&startticks); unix_time(&startspec); ticks2nano = (double)exp9 / tps; } - QueryPerformanceCounter((LARGE_INTEGER*)& curticks); curticks -= startticks; + QueryPerformanceCounter((LARGE_INTEGER*)&curticks); curticks -= startticks; spec->tv_sec = startspec.tv_sec + (curticks / tps); spec->tv_nsec = (long)(startspec.tv_nsec + (double)(curticks % tps) * ticks2nano); - if (!(spec->tv_nsec < exp9)) { spec->tv_sec++; spec->tv_nsec -= exp9; } + if (!(spec->tv_nsec < exp9)) + { + spec->tv_sec++; spec->tv_nsec -= exp9; + } return 0; } -#endif \ No newline at end of file +#endif // if defined(_WIN32) \ No newline at end of file diff --git a/src/cpp/utils/collections/FixedSizeQueue.hpp b/src/cpp/utils/collections/FixedSizeQueue.hpp index 80ed453364c..295a2f75774 100644 --- a/src/cpp/utils/collections/FixedSizeQueue.hpp +++ b/src/cpp/utils/collections/FixedSizeQueue.hpp @@ -17,8 +17,8 @@ * */ -#ifndef FASTRTPS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ -#define FASTRTPS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ +#ifndef FASTDDS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ +#define FASTDDS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ #include #include @@ -687,4 +687,4 @@ class FixedSizeQueue } // namespace fastrtps } // namespace eprosima -#endif /* FASTRTPS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ */ +#endif /* FASTDDS_UTILS_COLLECTIONS_FIXEDSIZEQUEUE_HPP_ */ diff --git a/src/cpp/utils/collections/ObjectPool.hpp b/src/cpp/utils/collections/ObjectPool.hpp index 44b36784f5d..72b14ce84fc 100644 --- a/src/cpp/utils/collections/ObjectPool.hpp +++ b/src/cpp/utils/collections/ObjectPool.hpp @@ -17,8 +17,8 @@ * */ -#ifndef FASTRTPS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ -#define FASTRTPS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ +#ifndef FASTDDS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ +#define FASTDDS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ #include #include @@ -97,4 +97,4 @@ struct ObjectPool final } // namespace fastdds } // namespace eprosima -#endif /* FASTRTPS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ */ +#endif /* FASTDDS_UTILS_COLLECTIONS_OBJECTPOOL_HPP_ */ diff --git a/src/cpp/utils/collections/concurrent_queue.h b/src/cpp/utils/collections/concurrent_queue.h index c9ab42de654..43394070825 100644 --- a/src/cpp/utils/collections/concurrent_queue.h +++ b/src/cpp/utils/collections/concurrent_queue.h @@ -13,8 +13,8 @@ // limitations under the License. -#ifndef _FASTRTPS_UTILS_CONCURRENT_QUEUE_H_ -#define _FASTRTPS_UTILS_CONCURRENT_QUEUE_H_ +#ifndef _FASTDDS_UTILS_CONCURRENT_QUEUE_H_ +#define _FASTDDS_UTILS_CONCURRENT_QUEUE_H_ #include #include @@ -31,7 +31,7 @@ namespace fastrtps { * * Based on std::queue. */ -template > +template> class ConcurrentQueue final { using Queue = std::queue; @@ -113,7 +113,8 @@ class ConcurrentQueue final { std::unique_lock lock(mutex_); - has_data_.wait(lock, [&](){ + has_data_.wait(lock, [&]() + { return !queue_.empty(); }); @@ -153,4 +154,4 @@ class ConcurrentQueue final } // namespace fastrtps } // namespace eprosima -#endif // _FASTRTPS_UTILS_CONCURRENT_QUEUE_H_ +#endif // _FASTDDS_UTILS_CONCURRENT_QUEUE_H_ diff --git a/src/cpp/utils/collections/unordered_vector.hpp b/src/cpp/utils/collections/unordered_vector.hpp index f9d96d88a58..df08c54a83f 100644 --- a/src/cpp/utils/collections/unordered_vector.hpp +++ b/src/cpp/utils/collections/unordered_vector.hpp @@ -19,7 +19,7 @@ #ifndef SRC_CPP_UTILS_COLLECTIONS_UNORDERED_VECTOR_HPP_ #define SRC_CPP_UTILS_COLLECTIONS_UNORDERED_VECTOR_HPP_ -#include +#include namespace eprosima { namespace utilities { diff --git a/src/cpp/utils/md5.cpp b/src/cpp/utils/md5.cpp index 85aa4eff3cf..c80ac4cb11a 100644 --- a/src/cpp/utils/md5.cpp +++ b/src/cpp/utils/md5.cpp @@ -32,7 +32,7 @@ */ /* interface header */ -#include +#include /* system implementation headers */ #include diff --git a/include/fastrtps/utils/shared_mutex.hpp b/src/cpp/utils/shared_mutex.hpp similarity index 99% rename from include/fastrtps/utils/shared_mutex.hpp rename to src/cpp/utils/shared_mutex.hpp index d6924144eb7..86e1be5efab 100644 --- a/include/fastrtps/utils/shared_mutex.hpp +++ b/src/cpp/utils/shared_mutex.hpp @@ -588,7 +588,7 @@ using std::swap; !(defined(HAVE_CXX17) && HAVE_CXX17) && __cplusplus < 201703 ) /* - Fast-DDS defaults to PTHREAD_RWLOCK_PREFER_READER_NP for two main reasons: + Fast DDS defaults to PTHREAD_RWLOCK_PREFER_READER_NP for two main reasons: - It allows reader side recursiveness. If we have two threads (T1, T2) and called S a shared lock and E and exclusive one. diff --git a/src/cpp/xmlparser/XMLDynamicParser.cpp b/src/cpp/xmlparser/XMLDynamicParser.cpp new file mode 100644 index 00000000000..494102e0c52 --- /dev/null +++ b/src/cpp/xmlparser/XMLDynamicParser.cpp @@ -0,0 +1,1706 @@ +// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "../fastdds/xtypes/dynamic_types/AnnotationDescriptorImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/DynamicTypeImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/MemberDescriptorImpl.hpp" +#include "../fastdds/xtypes/dynamic_types/TypeDescriptorImpl.hpp" + +using namespace eprosima::fastdds::dds; +using namespace eprosima::fastrtps; +using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastrtps::xmlparser; + +//{{{ Auxiliary constexpr function to get the length of a const char* in C++11. +constexpr size_t constexpr_strlen_rec( + const char* const str, + size_t length) +{ + return '\0' == str[length] ? length : constexpr_strlen_rec(str, length + 1); +} + +constexpr size_t constexpr_strlen( + const char* const str) +{ + return constexpr_strlen_rec(str, 0) + 1; +} + +//}}} + +// TYPES parser +constexpr const char* const BOOLEAN = "boolean"; +constexpr size_t BOOLEAN_len = constexpr_strlen(BOOLEAN); +constexpr const char* const CHAR = "char8"; +constexpr size_t CHAR_len = constexpr_strlen(CHAR); +constexpr const char* const WCHAR = "char16"; +constexpr size_t WCHAR_len = constexpr_strlen(WCHAR); +constexpr const char* const TBYTE = "byte"; +constexpr size_t TBYTE_len = constexpr_strlen(TBYTE); +constexpr const char* const OCTET = "octet"; +constexpr size_t OCTET_len = constexpr_strlen(OCTET); +constexpr const char* const UINT8 = "uint8"; +constexpr size_t UINT8_len = constexpr_strlen(UINT8); +constexpr const char* const INT8 = "int8"; +constexpr size_t INT8_len = constexpr_strlen(INT8); +constexpr const char* const SHORT = "int16"; +constexpr size_t SHORT_len = constexpr_strlen(SHORT); +constexpr const char* const LONG = "int32"; +constexpr size_t LONG_len = constexpr_strlen(LONG); +constexpr const char* const USHORT = "uint16"; +constexpr size_t USHORT_len = constexpr_strlen(USHORT); +constexpr const char* const ULONG = "uint32"; +constexpr size_t ULONG_len = constexpr_strlen(ULONG); +constexpr const char* const LONGLONG = "int64"; +constexpr size_t LONGLONG_len = constexpr_strlen(LONGLONG); +constexpr const char* const ULONGLONG = "uint64"; +constexpr size_t ULONGLONG_len = constexpr_strlen(ULONGLONG); +constexpr const char* const FLOAT = "float32"; +constexpr size_t FLOAT_len = constexpr_strlen(FLOAT); +constexpr const char* const DOUBLE = "float64"; +constexpr size_t DOUBLE_len = constexpr_strlen(DOUBLE); +constexpr const char* const LONGDOUBLE = "float128"; +constexpr size_t LONGDOUBLE_len = constexpr_strlen(LONGDOUBLE); +constexpr const char* const STRING = "string"; +constexpr size_t STRING_len = constexpr_strlen(STRING); +constexpr const char* const WSTRING = "wstring"; +constexpr size_t WSTRING_len = constexpr_strlen(WSTRING); +constexpr const char* const STRUCT = "struct"; +constexpr const char* const UNION = "union"; +constexpr const char* const TYPEDEF = "typedef"; +constexpr const char* const BITSET = "bitset"; +constexpr const char* const BITMASK = "bitmask"; +constexpr const char* const ENUM = "enum"; +constexpr const char* const CASE = "case"; +constexpr const char* const DEFAULT = "default"; +constexpr const char* const DISCRIMINATOR = "discriminator"; +constexpr const char* const CASE_DISCRIMINATOR = "caseDiscriminator"; +constexpr size_t CASE_DISCRIMINATOR_len = constexpr_strlen(CASE_DISCRIMINATOR); +constexpr const char* const ARRAY_DIMENSIONS = "arrayDimensions"; +constexpr const char* const STR_MAXLENGTH = "stringMaxLength"; +constexpr const char* const SEQ_MAXLENGTH = "sequenceMaxLength"; +constexpr const char* const MAP_MAXLENGTH = "mapMaxLength"; +constexpr const char* const MAP_KEY_TYPE = "key_type"; +constexpr const char* const ENUMERATOR = "enumerator"; +constexpr const char* const NON_BASIC_TYPE = "nonBasic"; +constexpr const char* const NON_BASIC_TYPE_NAME = "nonBasicTypeName"; +constexpr const char* const KEY = "key"; +constexpr const char* const MEMBER = "member"; +constexpr const char* const BITFIELD = "bitfield"; +constexpr const char* const BIT_VALUE = "bit_value"; +constexpr const char* const POSITION = "position"; +constexpr const char* const BIT_BOUND = "bit_bound"; +constexpr const char* const BASE_TYPE = "baseType"; + +XMLP_ret XMLParser::parseXMLDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + */ + XMLP_ret ret = XMLP_ret::XML_OK; + tinyxml2::XMLElement* p_aux0 = nullptr; + for (p_aux0 = p_root->FirstChildElement(); p_aux0 != nullptr; p_aux0 = p_aux0->NextSiblingElement()) + { + const std::string type = p_aux0->Value(); + if (type.compare(STRUCT) == 0) + { + ret = parseXMLStructDynamicType(p_aux0); + } + else if (type.compare(UNION) == 0) + { + ret = parseXMLUnionDynamicType(p_aux0); + } + else if (type.compare(ENUM) == 0) + { + ret = parseXMLEnumDynamicType(p_aux0); + } + else if (type.compare(TYPEDEF) == 0) + { + ret = parseXMLAliasDynamicType(p_aux0); + } + else if (type.compare(BITSET) == 0) + { + ret = parseXMLBitsetDynamicType(p_aux0); + } + else if (type.compare(BITMASK) == 0) + { + ret = parseXMLBitmaskDynamicType(p_aux0); + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing type: Type " << type << " not recognized."); + ret = XMLP_ret::XML_ERROR; + } + + if (ret != XMLP_ret::XML_OK) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing type " << type << "."); + break; + } + } + return ret; +} + +XMLP_ret XMLParser::parseXMLTypes( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + */ + + XMLP_ret ret = XMLP_ret::XML_OK; + tinyxml2::XMLElement* p_aux0 = nullptr, * p_aux1 = nullptr; + p_aux0 = p_root->FirstChildElement(TYPES); + if (p_aux0 != nullptr) + { + const char* name = nullptr; + for (p_aux1 = p_aux0->FirstChildElement(); p_aux1 != nullptr; p_aux1 = p_aux1->NextSiblingElement()) + { + name = p_aux1->Name(); + if (strcmp(name, TYPE) == 0) + { + if (XMLP_ret::XML_OK != parseXMLDynamicType(p_aux1)) + { + return XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'types'. Name: " << name); + return XMLP_ret::XML_ERROR; + } + } + } + else // Directly root is TYPES? + { + const char* name = nullptr; + for (p_aux0 = p_root->FirstChildElement(); p_aux0 != nullptr; p_aux0 = p_aux0->NextSiblingElement()) + { + name = p_aux0->Name(); + if (strcmp(name, TYPE) == 0) + { + if (XMLP_ret::XML_OK != parseXMLDynamicType(p_aux0)) + { + return XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'types'. Name: " << name); + return XMLP_ret::XML_ERROR; + } + } + } + return ret; +} + +XMLP_ret XMLParser::parseXMLBitvalueDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type builder, + uint16_t& field_position) +{ + /* + + + + + */ + if (p_root == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitmask: Node not found."); + return XMLP_ret::XML_ERROR; + } + + if (!builder) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitmask: builder is nil."); + return XMLP_ret::XML_ERROR; + } + + const char* memberName = p_root->Attribute(NAME); + const char* position = p_root->Attribute(POSITION); + + if (position != nullptr) + { + try + { + field_position = static_cast(std::stoul(position)); + } + catch (const std::exception&) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bit_value position: Invalid (must be an unsigned short)."); + return XMLP_ret::XML_ERROR; + } + } + + if (memberName == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bit_value name: Not found."); + return XMLP_ret::XML_ERROR; + } + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(field_position); + md->name(memberName); + md->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_BOOLEAN)); + builder->add_member(md); + ++field_position; + + return XMLP_ret::XML_OK; +} + +static DynamicType::_ref_type getDiscriminatorTypeBuilder( + const std::string& disc, + uint32_t bound = 0) +{ + /* + mKind == TK_BOOLEAN || mKind == TK_BYTE || mKind == TK_INT16 || mKind == TK_INT32 || + mKind == TK_INT64 || mKind == TK_UINT16 || mKind == TK_UINT32 || mKind == TK_UINT64 || + mKind == TK_FLOAT32 || mKind == TK_FLOAT64 || mKind == TK_FLOAT128 || mKind == TK_CHAR8 || + mKind == TK_CHAR16 || mKind == TK_STRING8 || mKind == TK_STRING16 || mKind == TK_ENUM || mKind == TK_BITMASK + */ + auto factory = DynamicTypeBuilderFactory::get_instance(); + if (0 == disc.compare(BOOLEAN)) + { + return factory->get_primitive_type(TK_BOOLEAN); + } + else if (0 == disc.compare(TBYTE) || + 0 == disc.compare(OCTET)) + { + return factory->get_primitive_type(TK_BYTE); + } + else if (0 == disc.compare(INT8)) + { + return factory->get_primitive_type(TK_INT8); + } + else if (0 == disc.compare(UINT8)) + { + return factory->get_primitive_type(TK_UINT8); + } + else if (0 == disc.compare(SHORT)) + { + return factory->get_primitive_type(TK_INT16); + } + else if (0 == disc.compare(LONG)) + { + return factory->get_primitive_type(TK_INT32); + } + else if (0 == disc.compare(LONGLONG)) + { + return factory->get_primitive_type(TK_INT64); + } + else if (0 == disc.compare(USHORT)) + { + return factory->get_primitive_type(TK_UINT16); + } + else if (0 == disc.compare(ULONG)) + { + return factory->get_primitive_type(TK_UINT32); + } + else if (0 == disc.compare(ULONGLONG)) + { + return factory->get_primitive_type(TK_UINT64); + } + else if (0 == disc.compare(FLOAT)) + { + return factory->get_primitive_type(TK_FLOAT32); + } + else if (0 == disc.compare(DOUBLE)) + { + return factory->get_primitive_type(TK_FLOAT64); + } + else if (0 == disc.compare(LONGDOUBLE)) + { + return factory->get_primitive_type(TK_FLOAT128); + } + else if (0 == disc.compare(CHAR)) + { + return factory->get_primitive_type(TK_CHAR8); + } + else if (0 == disc.compare(WCHAR)) + { + return factory->get_primitive_type(TK_CHAR16); + } + else if (0 == disc.compare(STRING)) + { + return factory->create_string_type(0 == bound ? static_cast(LENGTH_UNLIMITED) : bound)->build(); + } + else if (0 == disc.compare(WSTRING)) + { + return factory->create_wstring_type(0 == bound ? static_cast(LENGTH_UNLIMITED) : bound)->build(); + } + + DynamicType::_ref_type ret; + XMLProfileManager::getDynamicTypeByName(ret, disc); + return ret; +} + +XMLP_ret XMLParser::parseXMLAliasDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + + */ + XMLP_ret ret = XMLP_ret::XML_OK; + + const char* type = p_root->Attribute(TYPE); + if (type != nullptr) + { + if (strcmp(type, NON_BASIC_TYPE) == 0) + { + const char* typeNonBasicName = p_root->Attribute(NON_BASIC_TYPE_NAME); + if (typeNonBasicName != nullptr) + { + type = typeNonBasicName; + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); + ret = XMLP_ret::XML_ERROR; + } + } + + DynamicType::_ref_type value_type; + if ((p_root->Attribute(ARRAY_DIMENSIONS) != nullptr) || + (p_root->Attribute(SEQ_MAXLENGTH) != nullptr) || + (p_root->Attribute(MAP_MAXLENGTH) != nullptr)) + { + value_type = parseXMLMemberDynamicType(p_root); + } + else + { + uint32_t bound = 0; + const char* boundStr = p_root->Attribute(STR_MAXLENGTH); + if (boundStr != nullptr) + { + bound = static_cast(std::stoul(boundStr)); + } + value_type = getDiscriminatorTypeBuilder(type, bound); + } + + if (value_type) + { + const char* name = p_root->Attribute(NAME); + if (name != nullptr && name[0] != '\0') + { + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, name); + if (!aux_type) + { + TypeDescriptor::_ref_type alias_descriptor {traits::make_shared()}; + alias_descriptor->kind(TK_ALIAS); + alias_descriptor->name(name); + alias_descriptor->base_type(value_type); + DynamicTypeBuilder::_ref_type builder {DynamicTypeBuilderFactory::get_instance()->create_type( + alias_descriptor)}; + if (false == XMLProfileManager::insertDynamicTypeByName(name, builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Type '" << name << "' already defined."); + ret = XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: No name attribute given."); + ret = XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Value not recognized."); + ret = XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing alias type: Type not defined."); + ret = XMLP_ret::XML_ERROR; + } + return ret; +} + +XMLP_ret XMLParser::parseXMLBitsetDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + + + + + + */ + XMLP_ret ret = XMLP_ret::XML_OK; + + const char* name = p_root->Attribute(NAME); + if (nullptr == name || name[0] == '\0') + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitsetDcl' type. No name attribute given."); + return XMLP_ret::XML_ERROR; + } + + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, name); + if (aux_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitsetDcl' type: Type '" << name << "' already defined."); + return XMLP_ret::XML_ERROR; + } + + TypeDescriptor::_ref_type bitset_descriptor {traits::make_shared()}; + bitset_descriptor->kind(TK_BITSET); + bitset_descriptor->name(name); + + //{{{ Retrieve bounds + for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); + p_element != nullptr; p_element = p_element->NextSiblingElement()) + { + const char* member_name = p_element->Attribute(NAME); + const char* bit_bound = p_element->Attribute(BIT_BOUND); + + if (bit_bound == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield bit_bound: Not found."); + return XMLP_ret::XML_ERROR; + } + + if (nullptr != member_name) + { + bitset_descriptor->bound().push_back(static_cast(std::stoul(bit_bound))); + } + } + //}}} + + const char* baseType = p_root->Attribute(BASE_TYPE); + if (baseType != nullptr) + { + DynamicType::_ref_type parent_type; + XMLProfileManager::getDynamicTypeByName(parent_type, baseType); + if (parent_type && (TK_BITSET == parent_type->get_kind() || + TK_BITSET == + traits::narrow(parent_type)->resolve_alias_enclosed_type()->get_kind())) + { + bitset_descriptor->base_type(parent_type); + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid baseType found into 'bitsetDcl'. Name: " << baseType); + return XMLP_ret::XML_ERROR; + } + } + + DynamicTypeBuilder::_ref_type type_builder = + DynamicTypeBuilderFactory::get_instance()->create_type(bitset_descriptor); + + const char* element_name {nullptr}; + MemberId position {0}; + for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); + p_element != nullptr; p_element = p_element->NextSiblingElement()) + { + element_name = p_element->Name(); + if (strcmp(element_name, BITFIELD) == 0) + { + ret = parseXMLBitfieldDynamicType(p_element, type_builder, position); + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'bitsetDcl'. Name: " << element_name); + return XMLP_ret::XML_ERROR; + } + } + + if (XMLP_ret::XML_OK == ret) + { + if (false == XMLProfileManager::insertDynamicTypeByName(name, type_builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + } + + return ret; +} + +XMLP_ret XMLParser::parseXMLBitfieldDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type builder, + MemberId& position) +{ + /* + + + + + + */ + if (p_root == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield: Node not found."); + return XMLP_ret::XML_ERROR; + } + + if (!builder) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield: builder is nil."); + return XMLP_ret::XML_ERROR; + } + + const char* memberType = p_root->Attribute(TYPE); + const char* memberName = p_root->Attribute(NAME); + const char* bit_bound = p_root->Attribute(BIT_BOUND); + + if (bit_bound == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing bitfield bit_bound: Not found."); + return XMLP_ret::XML_ERROR; + } + + DynamicType::_ref_type member_type; + DynamicTypeBuilderFactory::_ref_type factory = DynamicTypeBuilderFactory::get_instance(); + uint32_t size {0}; + + try + { + size = static_cast(std::stoul(bit_bound)); + } + catch (...) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, invalid bit_bound (must be an unsigned short): " + << bit_bound); + return XMLP_ret::XML_ERROR; + } + + if (memberType == nullptr) + { + if (1 == size) + { + memberType = BOOLEAN; + } + else if (9 > size) + { + memberType = UINT8; + } + else if (17 > size) + { + memberType = USHORT; + } + else if (33 > size) + { + memberType = ULONG; + } + else if (65 > size) + { + memberType = ULONGLONG; + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating bitfield, size too big: " << bit_bound); + return XMLP_ret::XML_ERROR; + } + } + + if (nullptr != memberName) + { + + if (0 == strncmp(memberType, BOOLEAN, BOOLEAN_len)) + { + member_type = factory->get_primitive_type(TK_BOOLEAN); + } + else if (0 == strncmp(memberType, TBYTE, TBYTE_len) + || 0 == strncmp(memberType, OCTET, 6)) + { + member_type = factory->get_primitive_type(TK_BYTE); + } + else if (0 == strncmp(memberType, INT8, INT8_len)) + { + member_type = factory->get_primitive_type(TK_INT8); + } + else if (0 == strncmp(memberType, UINT8, UINT8_len)) + { + member_type = factory->get_primitive_type(TK_UINT8); + } + else if (0 == strncmp(memberType, SHORT, SHORT_len)) + { + member_type = factory->get_primitive_type(TK_INT16); + } + else if (0 == strncmp(memberType, LONG, LONG_len)) + { + member_type = factory->get_primitive_type(TK_INT32); + } + else if (0 == strncmp(memberType, ULONG, ULONG_len)) + { + member_type = factory->get_primitive_type(TK_UINT32); + } + else if (0 == strncmp(memberType, USHORT, USHORT_len)) + { + member_type = factory->get_primitive_type(TK_UINT16); + } + else if (0 == strncmp(memberType, LONGLONG, LONGLONG_len)) + { + member_type = factory->get_primitive_type(TK_INT64); + } + else if (0 == strncmp(memberType, ULONGLONG, ULONGLONG_len)) + { + member_type = factory->get_primitive_type(TK_UINT64); + } + else // Unsupported type + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Failed creating bitfield " << memberName << ": Type " << memberType << " unsupported."); + return XMLP_ret::XML_ERROR; + } + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(position); + md->name(memberName); + md->type(member_type); + builder->add_member(md); + } + + position += size; + + return XMLP_ret::XML_OK; +} + +XMLP_ret XMLParser::parseXMLBitmaskDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + + + */ + XMLP_ret ret = XMLP_ret::XML_OK; + uint16_t bit_bound = 32; + const char* anno_bit_bound = p_root->Attribute(BIT_BOUND); + if (anno_bit_bound != nullptr) + { + auto input_bit_bound = std::atoi(anno_bit_bound); + if (input_bit_bound < 1 || input_bit_bound > 64) + { + return XMLP_ret::XML_ERROR; + } + bit_bound = static_cast(input_bit_bound); + } + + const char* name = p_root->Attribute(NAME); + if (nullptr == name || name[0] == '\0') + { + return XMLP_ret::XML_ERROR; + } + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, name); + if (aux_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'bitmaskDcl' type: Type '" << name << "' already defined."); + return XMLP_ret::XML_ERROR; + } + + TypeDescriptor::_ref_type bitmask_descriptor {traits::make_shared()}; + bitmask_descriptor->kind(TK_BITMASK); + bitmask_descriptor->name(name); + bitmask_descriptor->element_type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_BOOLEAN)); + bitmask_descriptor->bound().push_back(bit_bound); + DynamicTypeBuilder::_ref_type type_builder { + DynamicTypeBuilderFactory::get_instance()->create_type(bitmask_descriptor)}; + uint16_t position = 0; + + const char* element_name = nullptr; + for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); + p_element != nullptr; p_element = p_element->NextSiblingElement()) + { + element_name = p_element->Name(); + if (strcmp(element_name, BIT_VALUE) == 0) + { + if (parseXMLBitvalueDynamicType(p_element, type_builder, position) != XMLP_ret::XML_OK) + { + return XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'bitmaskDcl'. Name: " << element_name); + return XMLP_ret::XML_ERROR; + } + } + + if (false == XMLProfileManager::insertDynamicTypeByName(name, type_builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + + return ret; +} + +XMLP_ret XMLParser::parseXMLEnumDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + //TODO: Enum bitbound to set the internal field + */ + XMLP_ret ret = XMLP_ret::XML_OK; + const char* enumName = p_root->Attribute(NAME); + + if (enumName == nullptr || enumName[0] == '\0') + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'enum' type. No name attribute given."); + return XMLP_ret::XML_ERROR; + } + + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, enumName); + if (aux_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'enum' type: Type '" << enumName << "' already defined."); + return XMLP_ret::XML_ERROR; + } + + + TypeDescriptor::_ref_type enum_descriptor {traits::make_shared()}; + enum_descriptor->kind(TK_ENUM); + enum_descriptor->name(enumName); + DynamicTypeBuilder::_ref_type type_builder {DynamicTypeBuilderFactory::get_instance()->create_type( + enum_descriptor)}; + + for (tinyxml2::XMLElement* literal = p_root->FirstChildElement(ENUMERATOR); + literal != nullptr; literal = literal->NextSiblingElement(ENUMERATOR)) + { + const char* name = literal->Attribute(NAME); + if (name == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing enum type: Literals must have name."); + return XMLP_ret::XML_ERROR; + } + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_UINT32)); + md->name(name); + + const char* value = literal->Attribute(VALUE); + if (value != nullptr) + { + md->default_value(value); + } + + type_builder->add_member(md); + } + + if (false == XMLProfileManager::insertDynamicTypeByName(enumName, type_builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + + return ret; +} + +XMLP_ret XMLParser::parseXMLStructDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + */ + XMLP_ret ret = XMLP_ret::XML_OK; + MemberId mId{0}; + const char* name = p_root->Attribute(NAME); + + if (nullptr == name || name[0] == '\0') + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Missing required attribute 'name' in 'structDcl'."); + return XMLP_ret::XML_ERROR; + } + + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, name); + if (aux_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'structDcl' type: Type '" << name << "' already defined."); + return XMLP_ret::XML_ERROR; + } + + TypeDescriptor::_ref_type structure_descriptor {traits::make_shared()}; + structure_descriptor->kind(TK_STRUCTURE); + structure_descriptor->name(name); + + const char* baseType = p_root->Attribute(BASE_TYPE); + if (baseType != nullptr) + { + DynamicType::_ref_type parent_type; + XMLProfileManager::getDynamicTypeByName(parent_type, baseType); + + if (parent_type && (TK_STRUCTURE == parent_type->get_kind() || + TK_STRUCTURE == + traits::narrow(parent_type)->resolve_alias_enclosed_type()->get_kind())) + { + structure_descriptor->base_type(parent_type); + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid baseType found into 'structDcl'. Name: " << baseType); + return XMLP_ret::XML_ERROR; + } + } + + DynamicTypeBuilder::_ref_type type_builder = DynamicTypeBuilderFactory::get_instance()->create_type( + structure_descriptor); + + const char* element_name = nullptr; + for (tinyxml2::XMLElement* p_element = p_root->FirstChildElement(); + p_element != nullptr; p_element = p_element->NextSiblingElement()) + { + element_name = p_element->Name(); + if (strcmp(element_name, MEMBER) == 0) + { + if (!parseXMLMemberDynamicType(p_element, type_builder, mId++)) + { + return XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'structDcl'. Name: " << element_name); + return XMLP_ret::XML_ERROR; + } + } + + if (false == XMLProfileManager::insertDynamicTypeByName(name, type_builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + + return ret; +} + +XMLP_ret XMLParser::parseXMLUnionDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + + + + + + + + */ + + XMLP_ret ret = XMLP_ret::XML_OK; + const char* name = p_root->Attribute(NAME); + if (nullptr == name || name[0] == '\0') + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Missing required attribute 'name' in 'unionDcl'."); + return XMLP_ret::XML_ERROR; + } + + DynamicType::_ref_type aux_type; + XMLProfileManager::getDynamicTypeByName(aux_type, name); + if (aux_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing 'unionDcl' type: Type '" << name << "' already defined."); + return XMLP_ret::XML_ERROR; + } + + tinyxml2::XMLElement* p_element = p_root->FirstChildElement(DISCRIMINATOR); + if (p_element != nullptr) + { + const char* disc = p_element->Attribute(TYPE); + DynamicType::_ref_type disc_type = getDiscriminatorTypeBuilder(disc); + if (!disc_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Error parsing union discriminator: Only primitive types allowed (found type " << disc << ")."); + ret = XMLP_ret::XML_ERROR; + } + else + { + TypeDescriptor::_ref_type union_descriptor {traits::make_shared()}; + union_descriptor->kind(TK_UNION); + union_descriptor->name(name); + union_descriptor->discriminator_type(disc_type); + DynamicTypeBuilder::_ref_type type_builder {DynamicTypeBuilderFactory::get_instance()-> + create_type(union_descriptor)}; + + MemberId mId{1}; + for (p_element = p_root->FirstChildElement(CASE); + p_element != nullptr; p_element = p_element->NextSiblingElement(CASE)) + { + std::string valuesStr = ""; + for (tinyxml2::XMLElement* caseValue = p_element->FirstChildElement(CASE_DISCRIMINATOR); + caseValue != nullptr; caseValue = caseValue->NextSiblingElement(CASE_DISCRIMINATOR)) + { + const char* values = caseValue->Attribute(VALUE); + if (values == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union case value: Not found."); + return XMLP_ret::XML_ERROR; + } + + if (valuesStr.empty()) + { + valuesStr = values; + } + else + { + valuesStr += std::string(",") + values; + } + } + + tinyxml2::XMLElement* caseElement = p_element->FirstChildElement(); + while (caseElement != nullptr && + strncmp(caseElement->Value(), CASE_DISCRIMINATOR, CASE_DISCRIMINATOR_len) == 0) + { + caseElement = caseElement->NextSiblingElement(); + } + if (caseElement != nullptr) + { + if (!parseXMLMemberDynamicType(caseElement, type_builder, mId++, valuesStr)) + { + return XMLP_ret::XML_ERROR; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union case member: Not found."); + return XMLP_ret::XML_ERROR; + } + } + + if (false == XMLProfileManager::insertDynamicTypeByName(name, type_builder->build())) + { + ret = XMLP_ret::XML_ERROR; + } + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing union discriminator: Not found."); + ret = XMLP_ret::XML_ERROR; + } + + return ret; +} + +static void dimensionsToArrayBounds( + const std::string& dimensions, + std::vector& bounds) +{ + std::stringstream ss(dimensions); + std::string item; + + bounds.clear(); + + while (std::getline(ss, item, ',')) + { + bounds.push_back(static_cast(std::atoi(item.c_str()))); + } +} + +static bool dimensionsToLabels( + const std::string& labelStr, + UnionCaseLabelSeq& labels) +{ + std::stringstream ss(labelStr); + std::string item; + bool def = false; + + labels.clear(); + while (std::getline(ss, item, ',')) + { + if (item == DEFAULT) + { + def = true; + } + else + { + labels.push_back(static_cast(std::stol(item.c_str()))); + } + } + + return def; +} + +DynamicType::_ref_type XMLParser:: parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root) +{ + /* + + + + + + + + + + + + */ + if (p_root == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member: Node not found."); + return {}; + } + + const char* memberType = p_root->Attribute(TYPE); + const char* memberName = p_root->Attribute(NAME); + bool isArray = false; + + if (memberName == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member name: Not found."); + return {}; + } + + if (memberType == nullptr) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); + return {}; + } + + const char* memberArray = p_root->Attribute(ARRAY_DIMENSIONS); + if (memberArray != nullptr) + { + isArray = true; + } + + if (strcmp(memberType, NON_BASIC_TYPE) == 0) + { + const char* memberNonBasicTypeName = p_root->Attribute(NON_BASIC_TYPE_NAME); + if (memberNonBasicTypeName != nullptr) + { + memberType = memberNonBasicTypeName; + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member type: Not found."); + return {}; + } + } + + DynamicType::_ref_type member; + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; + + const char* memberSequence = p_root->Attribute(SEQ_MAXLENGTH); + if (memberSequence != nullptr) + { + /* + In sequences allowed formats are (complex format includes the basic): + sequence,2> + + + + In this example, inner sequence's name is ignored and can be omited. + */ + DynamicType::_ref_type content_type {getDiscriminatorTypeBuilder(memberType)}; + if (!content_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing sequence element type: Cannot be recognized: " << memberType); + return {}; + } + + uint32_t length {0}; + try + { + length = static_cast(std::stoul(memberSequence)); + } + catch (const std::exception&) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing member sequence length in line " << p_root->GetLineNum()); + return {}; + } + + if (!isArray) + { + member = factory->create_sequence_type(content_type, length)->build(); + } + else + { + DynamicTypeBuilder::_ref_type inner_builder {factory->create_sequence_type(content_type, length)}; + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type(inner_builder->build(), bounds)->build(); + } + } + else if (p_root->Attribute(MAP_MAXLENGTH) != nullptr) + { + /* + In maps allowed formats are (complex format includes the basic): + map, map,2> + + + + + + + + + + + + + In this example, inner maps names are ignored and can be omited. + */ + // Parse key + + //const char* keyType = p_root->Attribute(KEY); + DynamicType::_ref_type key_type; + const char* memberMapKeyType = p_root->Attribute(MAP_KEY_TYPE); + if (memberMapKeyType != nullptr) + { + key_type = getDiscriminatorTypeBuilder(memberMapKeyType); + if (!key_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's key element type: Cannot be recognized."); + return {}; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing key_type element: Not found."); + return {}; + } + + // Parse value + DynamicType::_ref_type value_type; + if (memberType != nullptr) + { + value_type = getDiscriminatorTypeBuilder(memberType); + if (!value_type) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing map's value element type: Cannot be recognized."); + return {}; + } + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing value_value element: Not found."); + return {}; + } + + const char* lengthStr = p_root->Attribute(MAP_MAXLENGTH); + uint32_t length {0}; + try + { + length = static_cast(std::stoul(lengthStr)); + } + catch (const std::exception&) + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Error parsing map member sequence length in line " << p_root->GetLineNum()); + return {}; + } + + if (!isArray) + { + member = factory->create_map_type(key_type, value_type, length)->build(); + } + else + { + DynamicTypeBuilder::_ref_type inner_builder {factory->create_map_type(key_type, value_type, + length)}; + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + inner_builder->build(), + bounds)->build(); + } + } + else if (strncmp(memberType, BOOLEAN, BOOLEAN_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_BOOLEAN); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_BOOLEAN), + bounds)->build(); + } + } + else if (strncmp(memberType, CHAR, CHAR_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_CHAR8); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_CHAR8), + bounds)->build(); + } + } + else if (strncmp(memberType, WCHAR, WCHAR_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_CHAR16); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_CHAR16), + bounds)->build(); + } + } + else if (strncmp(memberType, TBYTE, TBYTE_len) == 0 + || strncmp(memberType, OCTET, OCTET_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_BYTE); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_BYTE), + bounds)->build(); + } + } + else if (strncmp(memberType, UINT8, UINT8_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_UINT8); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT8), + bounds)->build(); + } + } + else if (strncmp(memberType, INT8, INT8_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_INT8); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT8), + bounds)->build(); + } + } + else if (strncmp(memberType, SHORT, SHORT_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_INT16); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT16), + bounds)->build(); + } + } + else if (strncmp(memberType, LONG, LONG_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_INT32); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT32), + bounds)->build(); + } + } + else if (strncmp(memberType, ULONG, ULONG_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_UINT32); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT32), + bounds)->build(); + } + } + else if (strncmp(memberType, USHORT, USHORT_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_UINT16); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT16), + bounds)->build(); + } + } + else if (strncmp(memberType, LONGLONG, LONGLONG_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_INT64); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_INT64), + bounds)->build(); + } + } + else if (strncmp(memberType, ULONGLONG, ULONGLONG_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_UINT64); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_UINT64), + bounds)->build(); + } + } + else if (strncmp(memberType, FLOAT, FLOAT_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_FLOAT32); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT32), + bounds)->build(); + } + } + else if (strncmp(memberType, DOUBLE, DOUBLE_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_FLOAT64); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT64), + bounds)->build(); + } + } + else if (strncmp(memberType, LONGDOUBLE, LONGDOUBLE_len) == 0) + { + if (!isArray) + { + member = factory->get_primitive_type(TK_FLOAT128); + } + else + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + factory->get_primitive_type(TK_FLOAT128), + bounds)->build(); + } + } + else if (strncmp(memberType, STRING, STRING_len) == 0) + { + const char* boundStr = p_root->Attribute(STR_MAXLENGTH); + uint32_t bound = static_cast(LENGTH_UNLIMITED); + + if (nullptr != boundStr) + { + bound = static_cast(std::stoul(boundStr)); + } + + DynamicTypeBuilder::_ref_type string_builder = factory->create_string_type(bound); + + if (!isArray) + { + member = string_builder->build(); + } + else + { + std::vector boundsArray; + dimensionsToArrayBounds(memberArray, boundsArray); + member = factory->create_array_type( + string_builder->build(), + boundsArray)->build(); + } + } + else if (strncmp(memberType, WSTRING, WSTRING_len) == 0) + { + const char* boundStr = p_root->Attribute(STR_MAXLENGTH); + uint32_t bound = static_cast(LENGTH_UNLIMITED); + + if (nullptr != boundStr) + { + bound = static_cast(std::stoul(boundStr)); + } + + DynamicTypeBuilder::_ref_type wstring_builder = factory->create_wstring_type(bound); + + if (!isArray) + { + member = wstring_builder->build(); + } + else + { + std::vector boundsArray; + dimensionsToArrayBounds(memberArray, boundsArray); + member = factory->create_array_type( + wstring_builder->build(), + boundsArray)->build(); + } + } + else // Complex type? + { + DynamicType::_ref_type type; + XMLProfileManager::getDynamicTypeByName(type, memberType); + if (!isArray) + { + member = type; + } + else if (type) + { + std::vector bounds; + dimensionsToArrayBounds(memberArray, bounds); + member = factory->create_array_type( + type, + bounds)->build(); + } + } + + if (!member) + { + if (!isArray) + { + EPROSIMA_LOG_ERROR(XMLPARSER, "Failed creating " << memberType << ": " << (memberName ? memberName : "")); + } + else + { + EPROSIMA_LOG_ERROR(XMLPARSER, + "Failed creating " << memberType << " array: " << (memberName ? memberName : "")); + } + return {}; + } + + return member; +} + +DynamicType::_ref_type XMLParser::parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type& builder, + MemberId mId) +{ + return parseXMLMemberDynamicType(p_root, builder, mId, ""); +} + +DynamicType::_ref_type XMLParser::parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + DynamicTypeBuilder::_ref_type& builder, + MemberId mId, + const std::string& values) +{ + DynamicType::_ref_type member {parseXMLMemberDynamicType(p_root)}; + + if (!member) + { + return {}; + } + + const char* memberName = p_root->Attribute(NAME); + + MemberDescriptor::_ref_type md {traits::make_shared()}; + md->id(mId); + md->name(memberName); + md->type(member); + + if (memberName != nullptr && !values.empty()) + { + UnionCaseLabelSeq labels; + bool defaultLabel = dimensionsToLabels(values, labels); + + md->label(labels); + md->is_default_label(defaultLabel); + } + + //{{{ Check @key annotation + const char* memberTopicKey = p_root->Attribute(KEY); + + if (memberTopicKey != nullptr && strncmp(memberTopicKey, "true", 5) == 0) + { + md->is_key(true); + } + //}}} + + + builder->add_member(md); + + return member; +} + +XMLP_ret XMLParser::parseXMLDynamicTypes( + tinyxml2::XMLElement& types) +{ + XMLP_ret ret = XMLP_ret::XML_OK; + ret = parseDynamicTypes(&types); + return ret; +} + +XMLP_ret XMLParser::parseDynamicTypes( + tinyxml2::XMLElement* p_root) +{ + return parseXMLTypes(p_root); +} + +XMLP_ret XMLParser::loadXMLDynamicTypes( + tinyxml2::XMLElement& xmlDoc) +{ + return parseXMLDynamicTypes(xmlDoc); +} diff --git a/src/cpp/rtps/xmlparser/XMLElementParser.cpp b/src/cpp/xmlparser/XMLElementParser.cpp similarity index 98% rename from src/cpp/rtps/xmlparser/XMLElementParser.cpp rename to src/cpp/xmlparser/XMLElementParser.cpp index 1dcdd03c6b3..cf6849a2d5c 100644 --- a/src/cpp/rtps/xmlparser/XMLElementParser.cpp +++ b/src/cpp/xmlparser/XMLElementParser.cpp @@ -26,15 +26,15 @@ #include #include -#include -#include -#include -#include +#include +#include -#include -#include #include -#include +#include +#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -76,7 +76,7 @@ static std::string process_environment( // Silently ignore ${_} since it might expose sensitive information (full path to executable). EPROSIMA_LOG_WARNING(XMLPARSER, "Ignoring environment variable ${_}"); } - else if (ReturnCode_t::RETCODE_OK != SystemInfo::get_env(var_name, value)) + else if (dds::RETCODE_OK != SystemInfo::get_env(var_name, value)) { EPROSIMA_LOG_ERROR(XMLPARSER, "Could not find a value for environment variable " << var_name); } @@ -136,8 +136,9 @@ namespace eprosima { namespace fastrtps { namespace xmlparser { -using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::rtps; using namespace eprosima::fastdds::xml::detail; +using namespace eprosima::fastrtps::rtps; static XMLP_ret parseXMLOctetVector( tinyxml2::XMLElement* elem, @@ -567,51 +568,6 @@ XMLP_ret XMLParser::getXMLDiscoverySettings( } -XMLP_ret XMLParser::getXMLTypeLookupSettings( - tinyxml2::XMLElement* elem, - rtps::TypeLookupSettings& settings, - uint8_t ident) -{ - /* - - - - - - - */ - - tinyxml2::XMLElement* p_aux0 = nullptr; - const char* name = nullptr; - for (p_aux0 = elem->FirstChildElement(); p_aux0 != NULL; p_aux0 = p_aux0->NextSiblingElement()) - { - name = p_aux0->Name(); - if (strcmp(name, TYPELOOKUP_USE_SERVER) == 0) - { - // - if (XMLP_ret::XML_OK != getXMLBool(p_aux0, &settings.use_server, ident)) - { - return XMLP_ret::XML_ERROR; - } - } - else if (strcmp(name, TYPELOOKUP_USE_CLIENT) == 0) - { - // - if (XMLP_ret::XML_OK != getXMLBool(p_aux0, &settings.use_client, ident)) - { - return XMLP_ret::XML_ERROR; - } - } - else - { - EPROSIMA_LOG_ERROR(XMLPARSER, "Invalid element found into 'typelookupSettingsType'. Name: " << name); - return XMLP_ret::XML_ERROR; - } - } - - return XMLP_ret::XML_OK; -} - XMLP_ret XMLParser::getXMLBuiltinAttributes( tinyxml2::XMLElement* elem, BuiltinAttributes& builtin, @@ -656,14 +612,6 @@ XMLP_ret XMLParser::getXMLBuiltinAttributes( return XMLP_ret::XML_ERROR; } } - else if (strcmp(name, TYPELOOKUP_CONFIG) == 0) - { - // typelookup_config - boolType - if (XMLP_ret::XML_OK != getXMLTypeLookupSettings(p_aux0, builtin.typelookup_config, ident)) - { - return XMLP_ret::XML_ERROR; - } - } else if (strcmp(name, WRITER_LVESS_PROTOCOL) == 0) { // use_WriterLivelinessProtocol - boolType @@ -3823,7 +3771,7 @@ XMLP_ret XMLParser::getXMLBool( XMLP_ret XMLParser::getXMLEnum( tinyxml2::XMLElement* elem, - IntraprocessDeliveryType* e, + fastdds::IntraprocessDeliveryType* e, uint8_t /*ident*/) { // @@ -3848,9 +3796,9 @@ XMLP_ret XMLParser::getXMLEnum( } if (!get_element_enum_value(text.c_str(), *e, - OFF, IntraprocessDeliveryType::INTRAPROCESS_OFF, - USER_DATA_ONLY, IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, - FULL, IntraprocessDeliveryType::INTRAPROCESS_FULL)) + OFF, fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF, + USER_DATA_ONLY, fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, + FULL, fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL)) { EPROSIMA_LOG_ERROR(XMLPARSER, "Node '" << INTRAPROCESS_DELIVERY << "' with bad content"); return XMLP_ret::XML_ERROR; @@ -4177,7 +4125,7 @@ XMLP_ret XMLParser::getXMLDomainParticipantFactoryQos( XMLP_ret XMLParser::getXMLPublisherAttributes( tinyxml2::XMLElement* elem, - PublisherAttributes& publisher, + fastdds::PublisherAttributes& publisher, uint8_t ident) { /* @@ -4344,7 +4292,7 @@ XMLP_ret XMLParser::getXMLPublisherAttributes( XMLP_ret XMLParser::getXMLSubscriberAttributes( tinyxml2::XMLElement* elem, - SubscriberAttributes& subscriber, + fastdds::SubscriberAttributes& subscriber, uint8_t ident) { /* diff --git a/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp b/src/cpp/xmlparser/XMLEndpointParser.cpp similarity index 98% rename from src/cpp/rtps/xmlparser/XMLEndpointParser.cpp rename to src/cpp/xmlparser/XMLEndpointParser.cpp index 5be0f9f8e85..6521ca18979 100644 --- a/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp +++ b/src/cpp/xmlparser/XMLEndpointParser.cpp @@ -17,7 +17,7 @@ * */ -#include +#include #include #include @@ -27,10 +27,10 @@ #include #include #include -#include -#include +#include -#include +#include +#include namespace eprosima { namespace fastrtps { @@ -449,7 +449,7 @@ XMLP_ret XMLEndpointParser::loadXMLReaderEndpoint( { uint32_t milliseclease = std::strtoul(auxstring.c_str(), nullptr, 10); rdata->m_qos.m_liveliness.lease_duration = - TimeConv::MilliSeconds2Time_t((double)milliseclease).to_duration_t(); + fastdds::rtps::TimeConv::MilliSeconds2Time_t((double)milliseclease).to_duration_t(); if (milliseclease == 0) { EPROSIMA_LOG_WARNING(RTPS_EDP, "BAD XML:livelinessQos leaseDuration is 0"); @@ -741,7 +741,7 @@ XMLP_ret XMLEndpointParser::loadXMLWriterEndpoint( { uint32_t milliseclease = std::strtoul(auxstring.c_str(), nullptr, 10); wdata->m_qos.m_liveliness.lease_duration = - TimeConv::MilliSeconds2Time_t((double)milliseclease).to_duration_t(); + fastdds::rtps::TimeConv::MilliSeconds2Time_t((double)milliseclease).to_duration_t(); if (milliseclease == 0) { EPROSIMA_LOG_WARNING(RTPS_EDP, "BAD XML:livelinessQos leaseDuration is 0"); diff --git a/src/cpp/xmlparser/XMLEndpointParser.h b/src/cpp/xmlparser/XMLEndpointParser.h new file mode 100644 index 00000000000..adaa26ce67b --- /dev/null +++ b/src/cpp/xmlparser/XMLEndpointParser.h @@ -0,0 +1,166 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file XMLEndpointParser.h + * + */ + +#ifndef XMLENDPOINTPARSER_H_ +#define XMLENDPOINTPARSER_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +namespace tinyxml2 { +class XMLElement; +class XMLDocument; +} // namespace tinyxml2 + + + +namespace eprosima { +namespace fastrtps { +namespace rtps { +class ReaderProxyData; +class WriterProxyData; +} // namespace rtps + +namespace xmlparser { + +/** + * Class StaticRTPSParticipantInfo, contains the information of writers and readers loaded from the XML file. + *@ingroup DISCOVERY_MODULE + */ +class StaticRTPSParticipantInfo +{ +public: + + StaticRTPSParticipantInfo() + { + } + + virtual ~StaticRTPSParticipantInfo() + { + } + + //!RTPS PArticipant name + std::string m_RTPSParticipantName; + //!Vector of ReaderProxyData pointer + std::vector m_readers; + //!Vector of ReaderProxyData pointer + std::vector m_writers; +}; + +/** + * Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints. + * @ingroup DISCOVERY_MODULE + */ +class XMLEndpointParser : XMLParser +{ +public: + + XMLEndpointParser(); + virtual ~XMLEndpointParser(); + /** + * Load the XML file + * @param filename Name or data of the file to load and parse. + * The string could contain a filename (file://) or the XML content directly (data://), filename assumed if neither + * @return True if correct. + */ + XMLP_ret loadXMLFile( + std::string& filename); + /** + * Load the XML node + * @param doc Node to parse. + * @return True if correct. + */ + XMLP_ret loadXMLNode( + tinyxml2::XMLDocument& doc); + + void loadXMLParticipantEndpoint( + tinyxml2::XMLElement* xml_endpoint, + StaticRTPSParticipantInfo* pdata); + + /** + * Load a Reader endpoint. + * @param xml_endpoint Reference of a tree child for a reader. + * @param pdata Pointer to the RTPSParticipantInfo where the reader must be added. + * @return True if correctly added. + */ + XMLP_ret loadXMLReaderEndpoint( + tinyxml2::XMLElement* xml_endpoint, + StaticRTPSParticipantInfo* pdata); + /** + * Load a Writer endpoint. + * @param xml_endpoint Reference of a tree child for a writer. + * @param pdata Pointer to the RTPSParticipantInfo where the reader must be added. + * @return True if correctly added. + */ + XMLP_ret loadXMLWriterEndpoint( + tinyxml2::XMLElement* xml_endpoint, + StaticRTPSParticipantInfo* pdata); + /** + * Look for a reader in the previously loaded endpoints. + * @param[in] partname RTPSParticipant name + * @param[in] id Id of the reader + * @param[out] rdataptr Pointer to pointer to return the information. + * @return True if found. + */ + XMLP_ret lookforReader( + const char* partname, + uint16_t id, + rtps::ReaderProxyData** rdataptr); + /** + * Look for a writer in the previously loaded endpoints. + * @param[in] partname RTPSParticipant name + * @param[in] id Id of the writer + * @param[out] wdataptr Pointer to pointer to return the information. + * @return True if found + */ + XMLP_ret lookforWriter( + const char* partname, + uint16_t id, + rtps::WriterProxyData** wdataptr); + +private: + + XMLP_ret get_disable_positive_acks_qos( + tinyxml2::XMLElement* elem, + DisablePositiveACKsQosPolicy& disable_positive_acks_qos); + + std::set m_endpointIds; + std::set m_entityIds; + + std::vector m_RTPSParticipants; +}; + + +} /* xmlparser */ +} /* namespace */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* XMLENDPOINTPARSER_H_ */ diff --git a/src/cpp/rtps/xmlparser/XMLParser.cpp b/src/cpp/xmlparser/XMLParser.cpp similarity index 95% rename from src/cpp/rtps/xmlparser/XMLParser.cpp rename to src/cpp/xmlparser/XMLParser.cpp index 5eb211d12d3..e394a63349b 100644 --- a/src/cpp/rtps/xmlparser/XMLParser.cpp +++ b/src/cpp/xmlparser/XMLParser.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include #include #include @@ -24,19 +24,21 @@ #include #include #include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include namespace eprosima { namespace fastrtps { @@ -47,7 +49,7 @@ using namespace eprosima::fastdds::xml::detail; XMLP_ret XMLParser::loadDefaultXMLFile( up_base_node_t& root) { - return loadXML(DEFAULT_FASTRTPS_PROFILES, root); + return loadXML(DEFAULT_FASTDDS_PROFILES, root); } XMLP_ret XMLParser::parseXML( @@ -296,14 +298,14 @@ XMLP_ret XMLParser::parseXMLTransportData( if (sType == UDPv4 || sType == UDPv6) { - std::shared_ptr pUDPDesc; + std::shared_ptr pUDPDesc; if (sType == UDPv4) { - pDescriptor = pUDPDesc = std::make_shared(); + pDescriptor = pUDPDesc = std::make_shared(); } else { - pDescriptor = pUDPDesc = std::make_shared(); + pDescriptor = pUDPDesc = std::make_shared(); } // Output UDP Socket @@ -327,7 +329,7 @@ XMLP_ret XMLParser::parseXMLTransportData( } else if (sType == TCPv4) { - pDescriptor = std::make_shared(); + pDescriptor = std::make_shared(); ret = parseXMLCommonTCPTransportData(p_root, pDescriptor); if (ret != XMLP_ret::XML_OK) { @@ -335,8 +337,8 @@ XMLP_ret XMLParser::parseXMLTransportData( } else { - std::shared_ptr pTCPv4Desc = - std::dynamic_pointer_cast(pDescriptor); + std::shared_ptr pTCPv4Desc = + std::dynamic_pointer_cast(pDescriptor); // Wan Address if (nullptr != (p_aux0 = p_root->FirstChildElement(TCP_WAN_ADDR))) @@ -352,7 +354,7 @@ XMLP_ret XMLParser::parseXMLTransportData( } else if (sType == TCPv6) { - pDescriptor = std::make_shared(); + pDescriptor = std::make_shared(); ret = parseXMLCommonTCPTransportData(p_root, pDescriptor); if (ret != XMLP_ret::XML_OK) { @@ -853,8 +855,8 @@ XMLP_ret XMLParser::parseXMLCommonTCPTransportData( */ XMLP_ret ret = XMLP_ret::XML_OK; - std::shared_ptr pTCPDesc = - std::dynamic_pointer_cast(p_transport); + std::shared_ptr pTCPDesc = + std::dynamic_pointer_cast(p_transport); if (pTCPDesc != nullptr) { tinyxml2::XMLElement* p_aux0 = nullptr; @@ -1160,14 +1162,14 @@ XMLP_ret XMLParser::parse_tls_config( */ using namespace rtps; - using TCPDescriptor = std::shared_ptr; - using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - using TLSOption = TCPTransportDescriptor::TLSConfig::TLSOptions; - using TLSHandShakeMode = TCPTransportDescriptor::TLSConfig::TLSHandShakeRole; + using TCPDescriptor = std::shared_ptr; + using TLSVerifyMode = fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode; + using TLSOption = fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions; + using TLSHandShakeMode = fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSHandShakeRole; XMLP_ret ret = XMLP_ret::XML_OK; - TCPDescriptor pTCPDesc = std::dynamic_pointer_cast(tcp_transport); + TCPDescriptor pTCPDesc = std::dynamic_pointer_cast(tcp_transport); pTCPDesc->apply_security = true; tinyxml2::XMLElement* p_aux0 = nullptr; @@ -1518,7 +1520,7 @@ XMLP_ret XMLParser::parseXMLLibrarySettings( } else { - LibrarySettingsAttributes library_settings; + fastdds::LibrarySettings library_settings; if (XMLP_ret::XML_OK != getXMLEnum(p_aux0, &library_settings.intraprocess_delivery, ident)) { return XMLP_ret::XML_ERROR; @@ -1556,7 +1558,7 @@ XMLP_ret XMLParser::parseXMLParticipantProf( BaseNode& rootNode) { XMLP_ret ret = XMLP_ret::XML_OK; - up_participant_t participant_atts{new ParticipantAttributes}; + up_participant_t participant_atts{new fastdds::ParticipantAttributes}; up_node_participant_t participant_node{new node_participant_t{NodeType::PARTICIPANT, std::move(participant_atts)}}; if (XMLP_ret::XML_OK == fillDataNode(p_root, *participant_node)) { @@ -1576,7 +1578,7 @@ XMLP_ret XMLParser::parseXMLPublisherProf( BaseNode& rootNode) { XMLP_ret ret = XMLP_ret::XML_OK; - up_publisher_t publisher_atts{new PublisherAttributes}; + up_publisher_t publisher_atts{new fastdds::PublisherAttributes}; up_node_publisher_t publisher_node{new node_publisher_t{NodeType::PUBLISHER, std::move(publisher_atts)}}; if (XMLP_ret::XML_OK == fillDataNode(p_root, *publisher_node)) { @@ -1595,7 +1597,7 @@ XMLP_ret XMLParser::parseXMLSubscriberProf( BaseNode& rootNode) { XMLP_ret ret = XMLP_ret::XML_OK; - up_subscriber_t subscriber_atts{new SubscriberAttributes}; + up_subscriber_t subscriber_atts{new fastdds::SubscriberAttributes}; up_node_subscriber_t subscriber_node{new node_subscriber_t{NodeType::SUBSCRIBER, std::move(subscriber_atts)}}; if (XMLP_ret::XML_OK == fillDataNode(p_root, *subscriber_node)) { @@ -1633,7 +1635,7 @@ XMLP_ret XMLParser::parseXMLRequesterProf( BaseNode& rootNode) { XMLP_ret ret = XMLP_ret::XML_OK; - up_requester_t requester_atts{new RequesterAttributes}; + up_requester_t requester_atts{new fastdds::RequesterAttributes}; up_node_requester_t requester_node{new node_requester_t{NodeType::REQUESTER, std::move(requester_atts)}}; if (XMLP_ret::XML_OK == fillDataNode(p_root, *requester_node)) { @@ -1652,7 +1654,7 @@ XMLP_ret XMLParser::parseXMLReplierProf( BaseNode& rootNode) { XMLP_ret ret = XMLP_ret::XML_OK; - up_replier_t replier_atts{new ReplierAttributes}; + up_replier_t replier_atts{new fastdds::ReplierAttributes}; up_node_replier_t replier_node{new node_replier_t{NodeType::REPLIER, std::move(replier_atts)}}; if (XMLP_ret::XML_OK == fillDataNode(p_root, *replier_node)) { @@ -2065,7 +2067,7 @@ XMLP_ret XMLParser::loadXML( tinyxml2::XMLDocument xmlDoc; if (tinyxml2::XMLError::XML_SUCCESS != xmlDoc.LoadFile(filename.c_str())) { - if (filename != std::string(DEFAULT_FASTRTPS_PROFILES)) + if (filename != std::string(DEFAULT_FASTDDS_PROFILES)) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error opening '" << filename << "'"); } @@ -2187,7 +2189,7 @@ XMLP_ret XMLParser::fillDataNode( XMLP_ret XMLParser::fillDataNode( tinyxml2::XMLElement* p_profile, - DataNode& participant_node) + DataNode& participant_node) { /* @@ -2484,6 +2486,14 @@ XMLP_ret XMLParser::fillDataNode( return XMLP_ret::XML_ERROR; } } + else if (strcmp(name, TYPELOOKUP_SERVICE_THREAD) == 0) + { + if (XMLP_ret::XML_OK != + getXMLThreadSettings(*p_aux0, participant_node.get()->rtps.typelookup_service_thread)) + { + return XMLP_ret::XML_ERROR; + } + } else if (strcmp(name, BUILTIN_TRANSPORTS_RECEPTION_THREADS) == 0) { if (XMLP_ret::XML_OK != @@ -2515,7 +2525,7 @@ XMLP_ret XMLParser::fillDataNode( XMLP_ret XMLParser::fillDataNode( tinyxml2::XMLElement* p_profile, - DataNode& publisher_node) + DataNode& publisher_node) { if (nullptr == p_profile) { @@ -2536,7 +2546,7 @@ XMLP_ret XMLParser::fillDataNode( XMLP_ret XMLParser::fillDataNode( tinyxml2::XMLElement* p_profile, - DataNode& subscriber_node) + DataNode& subscriber_node) { if (nullptr == p_profile) { @@ -2557,20 +2567,20 @@ XMLP_ret XMLParser::fillDataNode( XMLP_ret XMLParser::fillDataNode( tinyxml2::XMLElement* p_profile, - DataNode& requester_node) + DataNode& requester_node) { /* - - - - - - + + + + + + - - - - + + + + */ @@ -2639,14 +2649,14 @@ XMLP_ret XMLParser::fillDataNode( return XMLP_ret::XML_ERROR; } } - else if (strcmp(name, PUBLISHER) == 0) + else if (strcmp(name, PUBLISHER) == 0 || strcmp(name, DATA_WRITER) == 0) { if (XMLP_ret::XML_OK != getXMLPublisherAttributes(p_aux0, requester_node.get()->publisher, ident)) { return XMLP_ret::XML_ERROR; } } - else if (strcmp(name, SUBSCRIBER) == 0) + else if (strcmp(name, SUBSCRIBER) == 0 || strcmp(name, DATA_READER) == 0) { if (XMLP_ret::XML_OK != getXMLSubscriberAttributes(p_aux0, requester_node.get()->subscriber, ident)) { @@ -2672,20 +2682,20 @@ XMLP_ret XMLParser::fillDataNode( XMLP_ret XMLParser::fillDataNode( tinyxml2::XMLElement* p_profile, - DataNode& replier_node) + DataNode& replier_node) { /* - - - - - - + + + + + + - - - - + + + + */ @@ -2754,14 +2764,14 @@ XMLP_ret XMLParser::fillDataNode( return XMLP_ret::XML_ERROR; } } - else if (strcmp(name, PUBLISHER) == 0) + else if (strcmp(name, PUBLISHER) == 0 || strcmp(name, DATA_WRITER) == 0) { if (XMLP_ret::XML_OK != getXMLPublisherAttributes(p_aux0, replier_node.get()->publisher, ident)) { return XMLP_ret::XML_ERROR; } } - else if (strcmp(name, SUBSCRIBER) == 0) + else if (strcmp(name, SUBSCRIBER) == 0 || strcmp(name, DATA_READER) == 0) { if (XMLP_ret::XML_OK != getXMLSubscriberAttributes(p_aux0, replier_node.get()->subscriber, ident)) { diff --git a/src/cpp/xmlparser/XMLParser.h b/src/cpp/xmlparser/XMLParser.h new file mode 100644 index 00000000000..fc1b5c00fe3 --- /dev/null +++ b/src/cpp/xmlparser/XMLParser.h @@ -0,0 +1,694 @@ +// Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef XML_PARSER_H_ +#define XML_PARSER_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace tinyxml2 { +class XMLElement; +class XMLDocument; +} // namespace tinyxml2 + +namespace eprosima { +namespace fastrtps { +namespace xmlparser { + +class BaseNode; +template class DataNode; + +typedef std::unique_ptr up_base_node_t; +typedef std::vector up_base_node_vector_t; +typedef std::map node_att_map_t; +typedef node_att_map_t::iterator node_att_map_it_t; +typedef node_att_map_t::const_iterator node_att_map_cit_t; + +typedef std::shared_ptr sp_transport_t; +typedef std::map sp_transport_map_t; +typedef std::map p_dynamictype_map_t; + +typedef std::unique_ptr up_participantfactory_t; +typedef DataNode node_participantfactory_t; +typedef node_participantfactory_t* p_node_participantfactory_t; +typedef std::unique_ptr up_node_participantfactory_t; + +typedef std::unique_ptr up_participant_t; +typedef DataNode node_participant_t; +typedef node_participant_t* p_node_participant_t; +typedef std::unique_ptr up_node_participant_t; + +typedef std::unique_ptr up_publisher_t; +typedef DataNode node_publisher_t; +typedef node_publisher_t* p_node_publisher_t; +typedef std::unique_ptr up_node_publisher_t; + +typedef std::unique_ptr up_subscriber_t; +typedef DataNode node_subscriber_t; +typedef node_subscriber_t* p_node_subscriber_t; +typedef std::unique_ptr up_node_subscriber_t; + +typedef std::unique_ptr up_topic_t; +typedef DataNode node_topic_t; +typedef node_topic_t* p_node_topic_t; +typedef std::unique_ptr up_node_topic_t; + +typedef std::unique_ptr up_requester_t; +typedef DataNode node_requester_t; +typedef node_requester_t* p_node_requester_t; +typedef std::unique_ptr up_node_requester_t; + +typedef std::unique_ptr up_replier_t; +typedef DataNode node_replier_t; +typedef node_replier_t* p_node_replier_t; +typedef std::unique_ptr up_node_replier_t; + +/** + * Class XMLParser, used to load XML data. + * @ingroup XMLPARSER_MODULE + */ +class XMLParser +{ + +public: + + /** + * Load the default XML file. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadDefaultXMLFile( + up_base_node_t& root); + + /** + * Load a XML file. + * @param filename Name for the file to be loaded. + * @param root Root node. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXML( + const std::string& filename, + up_base_node_t& root); + + /** + * Load a XML data from buffer. + * @param data XML data to load. + * @param length Length of the XML data. + * @param root Root node. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXML( + const char* data, + size_t length, + up_base_node_t& root); + + /** + * Load a XML node. + * @param xmlDoc Node to be loaded. + * @param root Root node. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXML( + tinyxml2::XMLDocument& xmlDoc, + up_base_node_t& root); + + /** + * Load a XML node. + * @param profiles Node to be loaded. + * @param root Root node. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLProfiles( + tinyxml2::XMLElement& profiles, + up_base_node_t& root); + + /** + * Load a XML node. + * @param types Node to be loaded. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLDynamicTypes( + tinyxml2::XMLElement& types); + +protected: + + static XMLP_ret parseXML( + tinyxml2::XMLDocument& xmlDoc, + up_base_node_t& root); + + static XMLP_ret parseXMLProfiles( + tinyxml2::XMLElement& profiles, + up_base_node_t& root); + + static XMLP_ret parseProfiles( + tinyxml2::XMLElement* p_root, + BaseNode& profilesNode); + + + /** + * Load a XML log node and parses it. It applies the configuration of the node directly. + * @param p_root Node to be loaded. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret parseLogConfig( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLLibrarySettings( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLTransportsProf( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLDomainParticipantFactoryProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLParticipantProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLPublisherProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLSubscriberProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLTopicData( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLRequesterProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLReplierProf( + tinyxml2::XMLElement* p_root, + BaseNode& rootNode); + + static XMLP_ret parseXMLTransportData( + tinyxml2::XMLElement* p_root); + + static XMLP_ret validateXMLTransportElements( + tinyxml2::XMLElement& p_root); + + static XMLP_ret parseXMLCommonTransportData( + tinyxml2::XMLElement* p_root, + sp_transport_t p_transport); + + static XMLP_ret parseXMLPortBasedTransportData( + tinyxml2::XMLElement* p_root, + std::shared_ptr p_transport); + + static XMLP_ret parseXMLSocketTransportData( + tinyxml2::XMLElement* p_root, + std::shared_ptr p_transport); + + static XMLP_ret parseXMLInterfaces( + tinyxml2::XMLElement* p_root, + std::shared_ptr p_transport); + + static XMLP_ret parseXMLAllowlist( + tinyxml2::XMLElement* p_root, + std::shared_ptr p_transport); + + static XMLP_ret parseXMLBlocklist( + tinyxml2::XMLElement* p_root, + std::shared_ptr p_transport); + + static XMLP_ret parseXMLCommonTCPTransportData( + tinyxml2::XMLElement* p_root, + sp_transport_t p_transport); + + static XMLP_ret parseXMLCommonSharedMemTransportData( + tinyxml2::XMLElement* p_root, + sp_transport_t p_transport); + + static XMLP_ret parse_tls_config( + tinyxml2::XMLElement* p_root, + sp_transport_t tcp_transport); + + static XMLP_ret parseXMLReceptionThreads( + tinyxml2::XMLElement& p_root, + fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap& reception_threads); + + /** + * Load a XML consumer node and parses it. Adds the parsed consumer to Log directly. + * @param consumer Node to be loaded. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret parseXMLConsumer( + tinyxml2::XMLElement& consumer); + + static XMLP_ret parseXMLDynamicTypes( + tinyxml2::XMLElement& types); + + static XMLP_ret parseDynamicTypes( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLTypes( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLStructDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLUnionDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLEnumDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLAliasDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLBitsetDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLBitmaskDynamicType( + tinyxml2::XMLElement* p_root); + + static XMLP_ret parseXMLBitfieldDynamicType( + tinyxml2::XMLElement* p_root, + fastdds::dds::DynamicTypeBuilder::_ref_type builder, + fastdds::dds::MemberId& position); + + static XMLP_ret parseXMLBitvalueDynamicType( + tinyxml2::XMLElement* p_root, + fastdds::dds::DynamicTypeBuilder::_ref_type builder, + uint16_t& position); + + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root); + + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + fastdds::dds::DynamicTypeBuilder::_ref_type& builder, + fastdds::dds::MemberId mId); + + static fastdds::dds::DynamicType::_ref_type parseXMLMemberDynamicType( + tinyxml2::XMLElement* p_root, + fastdds::dds::DynamicTypeBuilder::_ref_type& builder, + fastdds::dds::MemberId mId, + const std::string& values); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* p_profile, + DataNode& factory_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* p_profile, + DataNode& participant_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* p_profile, + DataNode& publisher_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* p_profile, + DataNode& subscriber_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* node, + DataNode& topic_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* node, + DataNode& requester_node); + + static XMLP_ret fillDataNode( + tinyxml2::XMLElement* node, + DataNode& replier_node); + + template + static void addAllAttributes( + tinyxml2::XMLElement* p_profile, + DataNode& node); + + static XMLP_ret getXMLEnum( + tinyxml2::XMLElement* elem, + fastdds::IntraprocessDeliveryType* e, + uint8_t ident); + + static XMLP_ret getXMLPropertiesPolicy( + tinyxml2::XMLElement* elem, + rtps::PropertyPolicy& propertiesPolicy, + uint8_t ident); + + static XMLP_ret getXMLHistoryMemoryPolicy( + tinyxml2::XMLElement* elem, + rtps::MemoryManagementPolicy_t& historyMemoryPolicy, + uint8_t ident); + + static XMLP_ret getXMLExternalLocatorList( + tinyxml2::XMLElement* elem, + fastdds::rtps::ExternalLocators& external_locators, + uint8_t ident); + + static XMLP_ret getXMLLocatorList( + tinyxml2::XMLElement* elem, + rtps::LocatorList_t& locatorList, + uint8_t ident); + + static XMLP_ret getXMLLocatorUDPv4( + tinyxml2::XMLElement* elem, + rtps::Locator_t& locator, + uint8_t ident); + + static XMLP_ret getXMLLocatorUDPv6( + tinyxml2::XMLElement* elem, + rtps::Locator_t& locator, + uint8_t ident); + + static XMLP_ret getXMLLocatorTCPv4( + tinyxml2::XMLElement* elem, + rtps::Locator_t& locator, + uint8_t ident); + + static XMLP_ret getXMLLocatorTCPv6( + tinyxml2::XMLElement* elem, + rtps::Locator_t& locator, + uint8_t ident); + + static XMLP_ret getXMLWriterTimes( + tinyxml2::XMLElement* elem, + rtps::WriterTimes& times, + uint8_t ident); + + static XMLP_ret getXMLReaderTimes( + tinyxml2::XMLElement* elem, + rtps::ReaderTimes& times, + uint8_t ident); + + static XMLP_ret getXMLDuration( + tinyxml2::XMLElement* elem, + Duration_t& duration, + uint8_t ident); + + static XMLP_ret getXMLWriterQosPolicies( + tinyxml2::XMLElement* elem, + WriterQos& qos, + uint8_t ident); + + static XMLP_ret getXMLReaderQosPolicies( + tinyxml2::XMLElement* elem, + ReaderQos& qos, + uint8_t ident); + + static XMLP_ret getXMLPublishModeQos( + tinyxml2::XMLElement* elem, + PublishModeQosPolicy& publishMode, + uint8_t ident); + + static XMLP_ret getXMLGroupDataQos( + tinyxml2::XMLElement* elem, + GroupDataQosPolicy& groupData, + uint8_t ident); + + static XMLP_ret getXMLTopicDataQos( + tinyxml2::XMLElement* elem, + TopicDataQosPolicy& topicData, + uint8_t ident); + + static XMLP_ret getXMLPartitionQos( + tinyxml2::XMLElement* elem, + PartitionQosPolicy& partition, + uint8_t ident); + + static XMLP_ret getXMLPresentationQos( + tinyxml2::XMLElement* elem, + PresentationQosPolicy& presentation, + uint8_t ident); + + static XMLP_ret getXMLDestinationOrderQos( + tinyxml2::XMLElement* elem, + DestinationOrderQosPolicy& destinationOrder, + uint8_t ident); + + static XMLP_ret getXMLOwnershipStrengthQos( + tinyxml2::XMLElement* elem, + OwnershipStrengthQosPolicy& ownershipStrength, + uint8_t ident); + + static XMLP_ret getXMLOwnershipQos( + tinyxml2::XMLElement* elem, + OwnershipQosPolicy& ownership, + uint8_t ident); + + static XMLP_ret getXMLTimeBasedFilterQos( + tinyxml2::XMLElement* elem, + TimeBasedFilterQosPolicy& timeBasedFilter, + uint8_t ident); + + static XMLP_ret getXMLUserDataQos( + tinyxml2::XMLElement* elem, + UserDataQosPolicy& userData, + uint8_t ident); + + static XMLP_ret getXMLLifespanQos( + tinyxml2::XMLElement* elem, + LifespanQosPolicy& lifespan, + uint8_t ident); + + static XMLP_ret getXMLReliabilityQos( + tinyxml2::XMLElement* elem, + ReliabilityQosPolicy& reliability, + uint8_t ident); + + static XMLP_ret getXMLLivelinessQos( + tinyxml2::XMLElement* elem, + LivelinessQosPolicy& liveliness, + uint8_t ident); + + static XMLP_ret getXMLLatencyBudgetQos( + tinyxml2::XMLElement* elem, + LatencyBudgetQosPolicy& latencyBudget, + uint8_t ident); + + static XMLP_ret getXMLDeadlineQos( + tinyxml2::XMLElement* elem, + DeadlineQosPolicy& deadline, + uint8_t ident); + + static XMLP_ret getXMLDurabilityServiceQos( + tinyxml2::XMLElement* elem, + DurabilityServiceQosPolicy& durabilityService, + uint8_t ident); + + static XMLP_ret getXMLDurabilityQos( + tinyxml2::XMLElement* elem, + DurabilityQosPolicy& durability, + uint8_t ident); + + static XMLP_ret getXMLTopicAttributes( + tinyxml2::XMLElement* elem, + TopicAttributes& topic, + uint8_t ident); + + static XMLP_ret getXMLHistoryQosPolicy( + tinyxml2::XMLElement* elem, + HistoryQosPolicy& historyQos, + uint8_t ident); + + static XMLP_ret getXMLResourceLimitsQos( + tinyxml2::XMLElement* elem, + ResourceLimitsQosPolicy& resourceLimitsQos, + uint8_t ident); + + static XMLP_ret getXMLContainerAllocationConfig( + tinyxml2::XMLElement* elem, + ResourceLimitedContainerConfig& resourceLimitsQos, + uint8_t ident); + + static XMLP_ret getXMLThroughputController( + tinyxml2::XMLElement* elem, + rtps::ThroughputControllerDescriptor& throughputController, + uint8_t ident); + + static XMLP_ret getXMLPortParameters( + tinyxml2::XMLElement* elem, + rtps::PortParameters& port, + uint8_t ident); + + static XMLP_ret getXMLParticipantAllocationAttributes( + tinyxml2::XMLElement* elem, + rtps::RTPSParticipantAllocationAttributes& allocation, + uint8_t ident); + + static XMLP_ret getXMLRemoteLocatorsAllocationAttributes( + tinyxml2::XMLElement* elem, + rtps::RemoteLocatorsAllocationAttributes& allocation, + uint8_t ident); + + static XMLP_ret getXMLSendBuffersAllocationAttributes( + tinyxml2::XMLElement* elem, + rtps::SendBuffersAllocationAttributes& allocation, + uint8_t ident); + + static XMLP_ret getXMLDiscoverySettings( + tinyxml2::XMLElement* elem, + rtps::DiscoverySettings& settings, + uint8_t ident); + + static XMLP_ret getXMLInitialAnnouncementsConfig( + tinyxml2::XMLElement* elem, + rtps::InitialAnnouncementConfig& config, + uint8_t ident); + + static XMLP_ret getXMLBuiltinAttributes( + tinyxml2::XMLElement* elem, + rtps::BuiltinAttributes& builtin, + uint8_t ident); + + static XMLP_ret getXMLOctetVector( + tinyxml2::XMLElement* elem, + std::vector& octet_vector, + uint8_t ident); + + static XMLP_ret getXMLInt( + tinyxml2::XMLElement* elem, + int* i, + uint8_t ident); + + static XMLP_ret getXMLUint( + tinyxml2::XMLElement* elem, + unsigned int* ui, + uint8_t ident); + + static XMLP_ret getXMLUint( + tinyxml2::XMLElement* elem, + uint16_t* ui16, + uint8_t ident); + + static XMLP_ret getXMLUint( + tinyxml2::XMLElement* elem, + uint64_t* ui64, + uint8_t ident); + + static XMLP_ret getXMLBool( + tinyxml2::XMLElement* elem, + bool* b, + uint8_t ident); + + static XMLP_ret getXMLEnum( + tinyxml2::XMLElement* elem, + rtps::DiscoveryProtocol_t* e, + uint8_t ident); + + static XMLP_ret getXMLList( + tinyxml2::XMLElement* elem, + eprosima::fastdds::rtps::RemoteServerList_t& list, + uint8_t ident); + + static XMLP_ret getXMLEnum( + tinyxml2::XMLElement* elem, + rtps::ParticipantFilteringFlags_t* e, + uint8_t ident); + + static XMLP_ret getXMLRemoteServer( + tinyxml2::XMLElement* elem, + eprosima::fastdds::rtps::RemoteServerAttributes& server, + uint8_t ident); + + static XMLP_ret getXMLString( + tinyxml2::XMLElement* elem, + std::string* s, + uint8_t ident); + + static XMLP_ret getXMLTransports( + tinyxml2::XMLElement* elem, + std::vector>& transports, + uint8_t ident); + + static XMLP_ret getXMLDisablePositiveAcksQos( + tinyxml2::XMLElement* elem, + DisablePositiveACKsQosPolicy& disablePositiveAcks, + uint8_t ident); + + static XMLP_ret getXMLDataSharingQos( + tinyxml2::XMLElement* elem, + DataSharingQosPolicy& data_sharing, + uint8_t ident); + + static XMLP_ret getXMLguidPrefix( + tinyxml2::XMLElement* elem, + rtps::GuidPrefix_t& prefix, + uint8_t ident); + + static XMLP_ret getXMLDomainParticipantFactoryQos( + tinyxml2::XMLElement& elem, + fastdds::dds::DomainParticipantFactoryQos& qos); + + static XMLP_ret getXMLPublisherAttributes( + tinyxml2::XMLElement* elem, + fastdds::PublisherAttributes& publisher, + uint8_t ident); + + static XMLP_ret getXMLSubscriberAttributes( + tinyxml2::XMLElement* elem, + fastdds::SubscriberAttributes& subscriber, + uint8_t ident); + + static XMLP_ret getXMLThreadSettings( + tinyxml2::XMLElement& elem, + fastdds::rtps::ThreadSettings& thread_setting); + + /* + Return XMLP_ret::XML_OK when OK, XMLP_ret::XML_NOK when port attribute is not present, and + XMLP_ret::XML_ERROR if error + */ + static XMLP_ret getXMLThreadSettingsWithPort( + tinyxml2::XMLElement& elem, + fastdds::rtps::ThreadSettings& thread_setting, + uint32_t& port); + + static XMLP_ret getXMLEntityFactoryQos( + tinyxml2::XMLElement& elem, + fastdds::dds::EntityFactoryQosPolicy& entity_factory); + + static XMLP_ret getXMLBuiltinTransports( + tinyxml2::XMLElement* elem, + eprosima::fastdds::rtps::BuiltinTransports* bt, + eprosima::fastdds::rtps::BuiltinTransportsOptions* bt_opts, + uint8_t ident); +}; + +} // namespace xmlparser +} // namespace fastrtps +} // namespace eprosima + +#endif // ifndef XML_PARSER_H_ diff --git a/src/cpp/rtps/xmlparser/XMLParserCommon.cpp b/src/cpp/xmlparser/XMLParserCommon.cpp similarity index 90% rename from src/cpp/rtps/xmlparser/XMLParserCommon.cpp rename to src/cpp/xmlparser/XMLParserCommon.cpp index ef0364dd3ae..11b01382b21 100644 --- a/src/cpp/rtps/xmlparser/XMLParserCommon.cpp +++ b/src/cpp/xmlparser/XMLParserCommon.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include namespace eprosima { namespace fastrtps { namespace xmlparser { -const char* DEFAULT_FASTRTPS_ENV_VARIABLE = "FASTRTPS_DEFAULT_PROFILES_FILE"; -const char* DEFAULT_FASTRTPS_PROFILES = "DEFAULT_FASTRTPS_PROFILES.xml"; +const char* DEFAULT_FASTDDS_ENV_VARIABLE = "FASTDDS_DEFAULT_PROFILES_FILE"; +const char* DEFAULT_FASTDDS_PROFILES = "DEFAULT_FASTDDS_PROFILES.xml"; const char* DEFAULT_STATISTICS_DATAWRITER_PROFILE = "GENERIC_STATISTICS_PROFILE"; const char* SKIP_DEFAULT_XML_FILE = "SKIP_DEFAULT_XML_FILE"; @@ -146,6 +146,7 @@ const char* MAX_USER_DATA = "max_user_data"; const char* MAX_PARTITIONS = "max_partitions"; const char* TIMED_EVENTS_THREAD = "timed_events_thread"; const char* DISCOVERY_SERVER_THREAD = "discovery_server_thread"; +const char* TYPELOOKUP_SERVICE_THREAD = "typelookup_service_thread"; const char* SECURITY_LOG_THREAD = "security_log_thread"; const char* BUILTIN_TRANSPORTS_RECEPTION_THREADS = "builtin_transports_reception_threads"; const char* BUILTIN_CONTROLLERS_SENDER_THREAD = "builtin_controllers_sender_thread"; @@ -299,9 +300,6 @@ const char* IGNORE_PARTICIPANT_FLAGS = "ignoreParticipantFlags"; const char* FILTER_DIFFERENT_HOST = "FILTER_DIFFERENT_HOST"; const char* FILTER_DIFFERENT_PROCESS = "FILTER_DIFFERENT_PROCESS"; const char* FILTER_SAME_PROCESS = "FILTER_SAME_PROCESS"; -const char* TYPELOOKUP_CONFIG = "typelookup_config"; -const char* TYPELOOKUP_USE_SERVER = "use_server"; -const char* TYPELOOKUP_USE_CLIENT = "use_client"; const char* WRITER_LVESS_PROTOCOL = "use_WriterLivelinessProtocol"; const char* DISCOVERY_SETTINGS = "discovery_config"; const char* _EDP = "EDP"; @@ -370,54 +368,6 @@ const char* EPROSIMA_UNKNOWN_STRING = "EPROSIMA_UNKNOWN_STRING"; const char* _OWNERSHIP_KIND_NOT_PRESENT = "OWNERSHIP_KIND_NOT_PRESENT"; const char* STRENGTH = "strength"; -// TYPES parser -const char* BOOLEAN = "boolean"; -const char* CHAR = "char8"; -const char* WCHAR = "char16"; -const char* TBYTE = "byte"; -const char* OCTET = "octet"; -const char* UINT8 = "uint8"; -const char* INT8 = "int8"; -const char* SHORT = "int16"; -const char* LONG = "int32"; -const char* USHORT = "uint16"; -const char* ULONG = "uint32"; -const char* LONGLONG = "int64"; -const char* ULONGLONG = "uint64"; -const char* FLOAT = "float32"; -const char* DOUBLE = "float64"; -const char* LONGDOUBLE = "float128"; -const char* STRING = "string"; -const char* WSTRING = "wstring"; -const char* LITERAL = "literal"; -const char* STRUCT = "struct"; -const char* UNION = "union"; -const char* SEQUENCE = "sequence"; -const char* MAP = "map"; -const char* TYPEDEF = "typedef"; -const char* BITSET = "bitset"; -const char* BITMASK = "bitmask"; -const char* ENUM = "enum"; -const char* CASE = "case"; -const char* DEFAULT = "default"; -const char* DISCRIMINATOR = "discriminator"; -const char* CASE_DISCRIMINATOR = "caseDiscriminator"; -const char* ARRAY_DIMENSIONS = "arrayDimensions"; -const char* STR_MAXLENGTH = "stringMaxLength"; -const char* SEQ_MAXLENGTH = "sequenceMaxLength"; -const char* MAP_MAXLENGTH = "mapMaxLength"; -const char* MAP_KEY_TYPE = "key_type"; -const char* ENUMERATOR = "enumerator"; -const char* NON_BASIC_TYPE = "nonBasic"; -const char* NON_BASIC_TYPE_NAME = "nonBasicTypeName"; -const char* KEY = "key"; -const char* MEMBER = "member"; -const char* BITFIELD = "bitfield"; -const char* BIT_VALUE = "bit_value"; -const char* POSITION = "position"; -const char* BIT_BOUND = "bit_bound"; -const char* BASE_TYPE = "baseType"; - // LOG const char* USE_DEFAULT = "use_default"; const char* CONSUMER = "consumer"; diff --git a/include/fastrtps/xmlparser/XMLParserCommon.h b/src/cpp/xmlparser/XMLParserCommon.h similarity index 90% rename from include/fastrtps/xmlparser/XMLParserCommon.h rename to src/cpp/xmlparser/XMLParserCommon.h index 972c863dfef..d157facebb2 100644 --- a/include/fastrtps/xmlparser/XMLParserCommon.h +++ b/src/cpp/xmlparser/XMLParserCommon.h @@ -31,8 +31,8 @@ enum class XMLP_ret }; -extern const char* DEFAULT_FASTRTPS_ENV_VARIABLE; -extern const char* DEFAULT_FASTRTPS_PROFILES; +extern const char* DEFAULT_FASTDDS_ENV_VARIABLE; +extern const char* DEFAULT_FASTDDS_PROFILES; extern const char* DEFAULT_STATISTICS_DATAWRITER_PROFILE; extern const char* SKIP_DEFAULT_XML_FILE; @@ -162,6 +162,7 @@ extern const char* MAX_USER_DATA; extern const char* MAX_PARTITIONS; extern const char* TIMED_EVENTS_THREAD; extern const char* DISCOVERY_SERVER_THREAD; +extern const char* TYPELOOKUP_SERVICE_THREAD; extern const char* SECURITY_LOG_THREAD; extern const char* BUILTIN_TRANSPORTS_RECEPTION_THREADS; extern const char* BUILTIN_CONTROLLERS_SENDER_THREAD; @@ -311,9 +312,6 @@ extern const char* IGNORE_PARTICIPANT_FLAGS; extern const char* FILTER_DIFFERENT_HOST; extern const char* FILTER_DIFFERENT_PROCESS; extern const char* FILTER_SAME_PROCESS; -extern const char* TYPELOOKUP_CONFIG; -extern const char* TYPELOOKUP_USE_SERVER; -extern const char* TYPELOOKUP_USE_CLIENT; extern const char* WRITER_LVESS_PROTOCOL; extern const char* DISCOVERY_SETTINGS; extern const char* _EDP; @@ -383,54 +381,6 @@ extern const char* _TRANSIENT_LOCAL_DURABILITY_QOS; extern const char* _VOLATILE_DURABILITY_QOS; extern const char* STRENGTH; -// TYPES parser -extern const char* BOOLEAN; -extern const char* CHAR; -extern const char* WCHAR; -extern const char* TBYTE; -extern const char* OCTET; -extern const char* UINT8; -extern const char* INT8; -extern const char* SHORT; -extern const char* LONG; -extern const char* USHORT; -extern const char* ULONG; -extern const char* LONGLONG; -extern const char* ULONGLONG; -extern const char* FLOAT; -extern const char* DOUBLE; -extern const char* LONGDOUBLE; -extern const char* STRING; -extern const char* WSTRING; -extern const char* LITERAL; -extern const char* STRUCT; -extern const char* UNION; -extern const char* SEQUENCE; -extern const char* MAP; -extern const char* TYPEDEF; -extern const char* BITSET; -extern const char* BITMASK; -extern const char* ENUM; -extern const char* CASE; -extern const char* DEFAULT; -extern const char* DISCRIMINATOR; -extern const char* CASE_DISCRIMINATOR; -extern const char* ARRAY_DIMENSIONS; -extern const char* STR_MAXLENGTH; -extern const char* SEQ_MAXLENGTH; -extern const char* MAP_MAXLENGTH; -extern const char* MAP_KEY_TYPE; -extern const char* ENUMERATOR; -extern const char* NON_BASIC_TYPE; -extern const char* NON_BASIC_TYPE_NAME; -extern const char* KEY; -extern const char* MEMBER; -extern const char* BITFIELD; -extern const char* BIT_VALUE; -extern const char* POSITION; -extern const char* BIT_BOUND; -extern const char* BASE_TYPE; - // LOG extern const char* USE_DEFAULT; extern const char* CONSUMER; diff --git a/src/cpp/rtps/xmlparser/XMLParserUtils.hpp b/src/cpp/xmlparser/XMLParserUtils.hpp similarity index 100% rename from src/cpp/rtps/xmlparser/XMLParserUtils.hpp rename to src/cpp/xmlparser/XMLParserUtils.hpp diff --git a/src/cpp/rtps/xmlparser/XMLProfileManager.cpp b/src/cpp/xmlparser/XMLProfileManager.cpp similarity index 93% rename from src/cpp/rtps/xmlparser/XMLProfileManager.cpp rename to src/cpp/xmlparser/XMLProfileManager.cpp index 5d2870f78f9..8b8a671d124 100644 --- a/src/cpp/rtps/xmlparser/XMLProfileManager.cpp +++ b/src/cpp/xmlparser/XMLProfileManager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include +#include #include #ifdef _WIN32 @@ -23,13 +23,14 @@ #include #include -#include + +#include using namespace eprosima::fastrtps; using namespace eprosima::fastdds; using namespace ::xmlparser; -LibrarySettingsAttributes XMLProfileManager::library_settings_; +LibrarySettings XMLProfileManager::library_settings_; std::map XMLProfileManager::participant_factory_profiles_; dds::DomainParticipantFactoryQos default_participant_factory_qos; std::map XMLProfileManager::participant_profiles_; @@ -197,7 +198,7 @@ void XMLProfileManager::loadDefaultXMLFile() #ifdef _WIN32 char file_path[MAX_PATH]; size_t size = MAX_PATH; - if (getenv_s(&size, file_path, size, DEFAULT_FASTRTPS_ENV_VARIABLE) == 0 && size > 0) + if (getenv_s(&size, file_path, size, DEFAULT_FASTDDS_ENV_VARIABLE) == 0 && size > 0) { loadXMLFile(file_path); } @@ -209,11 +210,11 @@ void XMLProfileManager::loadDefaultXMLFile() // Try to load the default XML file if variable does not exist or is not set to '1' if (!(getenv_s(&size, skip_xml, size, SKIP_DEFAULT_XML_FILE) == 0 && skip_xml[0] == '1')) { - loadXMLFile(DEFAULT_FASTRTPS_PROFILES); + loadXMLFile(DEFAULT_FASTDDS_PROFILES); } #else - if (const char* file_path = std::getenv(DEFAULT_FASTRTPS_ENV_VARIABLE)) + if (const char* file_path = std::getenv(DEFAULT_FASTDDS_ENV_VARIABLE)) { loadXMLFile(file_path); } @@ -223,7 +224,7 @@ void XMLProfileManager::loadDefaultXMLFile() // Try to load the default XML file if variable does not exist or is not set to '1' if (!(skip_xml != nullptr && skip_xml[0] == '1')) { - loadXMLFile(DEFAULT_FASTRTPS_PROFILES); + loadXMLFile(DEFAULT_FASTDDS_PROFILES); } #endif // ifdef _WIN32 @@ -327,7 +328,7 @@ XMLP_ret XMLProfileManager::loadXMLFile( XMLP_ret loaded_ret = XMLParser::loadXML(filename, root_node); if (!root_node || loaded_ret != XMLP_ret::XML_OK) { - if (filename != std::string(DEFAULT_FASTRTPS_PROFILES)) + if (filename != std::string(DEFAULT_FASTDDS_PROFILES)) { EPROSIMA_LOG_ERROR(XMLPARSER, "Error parsing '" << filename << "'"); } @@ -387,22 +388,6 @@ XMLP_ret XMLProfileManager::loadXMLString( return loaded_ret; } -types::DynamicPubSubType* XMLProfileManager::CreateDynamicPubSubType( - const std::string& type_name) -{ - if (dynamic_types_.find(type_name) != dynamic_types_.end()) - { - return new types::DynamicPubSubType(dynamic_types_[type_name]->build()); - } - return nullptr; -} - -void XMLProfileManager::DeleteDynamicPubSubType( - types::DynamicPubSubType* type) -{ - delete type; -} - XMLP_ret XMLProfileManager::extractProfiles( up_base_node_t profiles, const std::string& filename) @@ -652,13 +637,13 @@ bool XMLProfileManager::insertTransportById( return false; } -const LibrarySettingsAttributes& XMLProfileManager::library_settings() +const LibrarySettings& XMLProfileManager::library_settings() { return library_settings_; } void XMLProfileManager::library_settings( - const LibrarySettingsAttributes& library_settings) + const LibrarySettings& library_settings) { library_settings_ = library_settings; } @@ -675,25 +660,28 @@ sp_transport_t XMLProfileManager::getTransportById( bool XMLProfileManager::insertDynamicTypeByName( const std::string& type_name, - p_dynamictypebuilder_t type) + const eprosima::fastdds::dds::DynamicType::_ref_type& type) { if (dynamic_types_.find(type_name) == dynamic_types_.end()) { - dynamic_types_[type_name] = type; + dynamic_types_.emplace(std::make_pair(type_name, type)); return true; } EPROSIMA_LOG_ERROR(XMLPARSER, "Error adding the type " << type_name << ". There is other type with the same name."); return false; } -p_dynamictypebuilder_t XMLProfileManager::getDynamicTypeByName( +XMLP_ret XMLProfileManager::getDynamicTypeByName( + eprosima::fastdds::dds::DynamicType::_ref_type& dynamic_type, const std::string& type_name) { if (dynamic_types_.find(type_name) != dynamic_types_.end()) { - return dynamic_types_[type_name]; + dynamic_type = dynamic_types_[type_name]; + return XMLP_ret::XML_OK; } - return nullptr; + + return XMLP_ret::XML_ERROR; } XMLP_ret XMLProfileManager::extractTopicProfile( @@ -795,15 +783,5 @@ void XMLProfileManager::DeleteInstance() topic_profiles_.clear(); xml_files_.clear(); transport_profiles_.clear(); - - // Delete the registered dynamic types builders - { - namespace dyn_types = eprosima::fastrtps::types; - auto factory = dyn_types::DynamicTypeBuilderFactory::get_instance(); - for (auto&& type : dynamic_types_) - { - factory->delete_builder(type.second); - } - dynamic_types_.clear(); - } + dynamic_types_.clear(); } diff --git a/src/cpp/xmlparser/XMLProfileManager.h b/src/cpp/xmlparser/XMLProfileManager.h new file mode 100644 index 00000000000..fb1c449d092 --- /dev/null +++ b/src/cpp/xmlparser/XMLProfileManager.h @@ -0,0 +1,315 @@ +// Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef XML_PROFILE_MANAGER_H_ +#define XML_PROFILE_MANAGER_H_ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace xmlparser { + +using participant_factory_map_t = std::map; +using part_factory_map_iterator_t = participant_factory_map_t::iterator; +using participant_map_t = std::map; +using part_map_iterator_t = participant_map_t::iterator; +using publisher_map_t = std::map; +using publ_map_iterator_t = publisher_map_t::iterator; +using subscriber_map_t = std::map; +using subs_map_iterator_t = subscriber_map_t::iterator; +using topic_map_t = std::map; +using topic_map_iterator_t = topic_map_t::iterator; +using requester_map_t = std::map; +using requester_map_iterator_t = requester_map_t::iterator; +using replier_map_t = std::map; +using replier_map_iterator_t = replier_map_t::iterator; +using xmlfiles_map_t = std::map; +using xmlfile_map_iterator_t = xmlfiles_map_t::iterator; + +/** + * Class XMLProfileManager, used to make available profiles from XML file. + * @ingroup XMLPARSER_MODULE + */ +class XMLProfileManager +{ +public: + + /** + * Load the default profiles XML file. + */ + static void loadDefaultXMLFile(); + + /** + * Load a profiles XML file. + * @param filename Name for the file to be loaded. + * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, + * XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLFile( + const std::string& filename); + + /** + * Load a profiles XML string. + * @param data Buffer containing the data. + * @param length Length of data. + * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, + * XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLString( + const char* data, + size_t length); + + /** + * Load a profiles XML node. + * @param doc Node to be loaded. + * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, + * XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLNode( + tinyxml2::XMLDocument& doc); + + /** + * Load a profiles XML node. + * @param profiles Node to be loaded. + * @return XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, + * XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLProfiles( + tinyxml2::XMLElement& profiles); + + /** + * Load a dynamic types XML node. + * @param types Node to be loaded. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret loadXMLDynamicTypes( + tinyxml2::XMLElement& types); + + /** + * Library settings setter. + * @param library_settings New value for library settings. + */ + static void library_settings( + const fastdds::LibrarySettings& library_settings); + + /** + * Library settings getter. + * @return const ref to current library settings. + */ + static const fastdds::LibrarySettings& library_settings(); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @param log_error Flag to log an error if the profile_name is not found. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. + */ + static XMLP_ret fillParticipantAttributes( + const std::string& profile_name, + fastdds::ParticipantAttributes& atts, + bool log_error = true); + + //!Fills participant_attributes with the default values. + static void getDefaultParticipantAttributes( + fastdds::ParticipantAttributes& participant_attributes); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param qos Structure to be filled. + * @param log_error Flag to log an error if the profile_name is not found. Defaults true. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret fillDomainParticipantFactoryQos( + const std::string& profile_name, + fastdds::dds::DomainParticipantFactoryQos& qos, + bool log_error = true); + + /** + * Fills input domain participant factory qos with the default values. + * @param qos Structure to be filled. + */ + static void getDefaultDomainParticipantFactoryQos( + fastdds::dds::DomainParticipantFactoryQos& qos); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @param log_error Flag to log an error if the profile_name is not found. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. + */ + static XMLP_ret fillPublisherAttributes( + const std::string& profile_name, + fastdds::PublisherAttributes& atts, + bool log_error = true); + + //!Fills publisher_attributes with the default values. + static void getDefaultPublisherAttributes( + fastdds::PublisherAttributes& publisher_attributes); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @param log_error Flag to log an error if the profile_name is not found. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true. + */ + static XMLP_ret fillSubscriberAttributes( + const std::string& profile_name, + fastdds::SubscriberAttributes& atts, + bool log_error = true); + + //!Fills subscriber_attributes with the default values. + static void getDefaultSubscriberAttributes( + fastdds::SubscriberAttributes& subscriber_attributes); + + //!Add a new transport instance along with its id. + static bool insertTransportById( + const std::string& transport_id, + sp_transport_t transport); + + //!Retrieves a transport instance by its id. + static sp_transport_t getTransportById( + const std::string& transport_id); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret fillTopicAttributes( + const std::string& profile_name, + TopicAttributes& atts); + + //!Fills topic_attributes with the default values. + static void getDefaultTopicAttributes( + TopicAttributes& topic_attributes); + + //!Add a new dynamic type instance along with its name. + static bool insertDynamicTypeByName( + const std::string& type_name, + const fastdds::dds::DynamicType::_ref_type& type); + + static XMLP_ret getDynamicTypeByName( + fastdds::dds::DynamicType::_ref_type& dynamic_type, + const std::string& type_name); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret fillRequesterAttributes( + const std::string& profile_name, + fastdds::RequesterAttributes& atts); + + /** + * Search for the profile specified and fill the structure. + * @param profile_name Name for the profile to be used to fill the structure. + * @param atts Structure to be filled. + * @return XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. + */ + static XMLP_ret fillReplierAttributes( + const std::string& profile_name, + fastdds::ReplierAttributes& atts); + + /** + * Deletes the XMLProfileManager instance. + * FastDDS's Domain calls this method automatically on its destructor, but + * if using XMLProfileManager outside of FastDDS, it should be called manually. + */ + FASTDDS_EXPORTED_API static void DeleteInstance(); + +private: + + static XMLP_ret extractProfiles( + up_base_node_t properties, + const std::string& filename); + + static XMLP_ret extractDomainParticipantFactoryProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractParticipantProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractPublisherProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractSubscriberProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractTopicProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractRequesterProfile( + up_base_node_t& profile, + const std::string& filename); + + static XMLP_ret extractReplierProfile( + up_base_node_t& profile, + const std::string& filename); + + static BaseNode* root; + + static fastdds::LibrarySettings library_settings_; + + static participant_factory_map_t participant_factory_profiles_; + + static participant_map_t participant_profiles_; + + static publisher_map_t publisher_profiles_; + + static subscriber_map_t subscriber_profiles_; + + static topic_map_t topic_profiles_; + + static requester_map_t requester_profiles_; + + static replier_map_t replier_profiles_; + + static xmlfiles_map_t xml_files_; + + static sp_transport_map_t transport_profiles_; + + static p_dynamictype_map_t dynamic_types_; +}; + +} /* xmlparser */ +} /* namespace */ +} /* namespace eprosima */ + +#endif // ifndef XML_PROFILE_MANAGER_H_ diff --git a/include/fastrtps/xmlparser/XMLTree.h b/src/cpp/xmlparser/XMLTree.h similarity index 100% rename from include/fastrtps/xmlparser/XMLTree.h rename to src/cpp/xmlparser/XMLTree.h diff --git a/src/cpp/xmlparser/attributes/ParticipantAttributes.hpp b/src/cpp/xmlparser/attributes/ParticipantAttributes.hpp new file mode 100644 index 00000000000..4d46726d05c --- /dev/null +++ b/src/cpp/xmlparser/attributes/ParticipantAttributes.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file ParticipantAttributes.h + * + */ + +#ifndef _FASTDDS_PARTICIPANTATTRIBUTES_H_ +#define _FASTDDS_PARTICIPANTATTRIBUTES_H_ + +#include + +namespace eprosima { +namespace fastdds { + +/** + * Class ParticipantAttributes, used by the user to define the attributes of a Participant. + * The Participants in the Publisher-Subscriber layer are only a container to a RTPSParticipant, so their attributes are the same. + * Still to maintain the equivalence this class is used to define them. + * @ingroup FASTRTPS_ATTRIBUTES_MODULE + */ +class ParticipantAttributes +{ +public: + + //! DomainId to be used by the associated RTPSParticipant (default: 0) + uint32_t domainId = 0; + + //!Attributes of the associated RTPSParticipant. + fastrtps::rtps::RTPSParticipantAttributes rtps; + + ParticipantAttributes() + { + } + + virtual ~ParticipantAttributes() + { + } + + bool operator ==( + const ParticipantAttributes& b) const + { + return (this->domainId == b.domainId && this->rtps == b.rtps); + } + +}; + +} // namespace fastdds +} // namespace eprosima + +#endif /* _FASTDDS_PARTICIPANTATTRIBUTES_H_ */ diff --git a/src/cpp/xmlparser/attributes/PublisherAttributes.hpp b/src/cpp/xmlparser/attributes/PublisherAttributes.hpp new file mode 100644 index 00000000000..d379a0ce8a4 --- /dev/null +++ b/src/cpp/xmlparser/attributes/PublisherAttributes.hpp @@ -0,0 +1,149 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file PublisherAttributes.hpp + */ + +#ifndef _FASTDDS_PUBLISHERATTRIBUTES_H_ +#define _FASTDDS_PUBLISHERATTRIBUTES_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { + +/** + * Class PublisherAttributes, used by the user to define the attributes of a Publisher. + * @ingroup FASTRTPS_ATTRIBUTES_MODULE + */ +class PublisherAttributes +{ +public: + + PublisherAttributes() = default; + + virtual ~PublisherAttributes() = default; + + bool operator ==( + const PublisherAttributes& b) const + { + return (this->m_userDefinedID == b.m_userDefinedID) && + (this->m_entityID == b.m_entityID) && + (this->topic == b.topic) && + (this->qos == b.qos) && + (this->times == b.times) && + (this->unicastLocatorList == b.unicastLocatorList) && + (this->multicastLocatorList == b.multicastLocatorList) && + (this->remoteLocatorList == b.remoteLocatorList) && + (this->historyMemoryPolicy == b.historyMemoryPolicy) && + (this->properties == b.properties); + } + + //! Topic Attributes for the Publisher + fastrtps::TopicAttributes topic; + + //! QOS for the Publisher + fastrtps::WriterQos qos; + + //! Writer Attributes + fastrtps::rtps::WriterTimes times; + + //! Unicast locator list + fastrtps::rtps::LocatorList_t unicastLocatorList; + + //! Multicast locator list + fastrtps::rtps::LocatorList_t multicastLocatorList; + + //! Remote locator list + fastrtps::rtps::LocatorList_t remoteLocatorList; + + //! The collection of external locators to use for communication. + rtps::ExternalLocators external_unicast_locators; + + //! Whether locators that don't match with the announced locators should be kept. + bool ignore_non_matching_locators = false; + + //! Throughput controller + fastrtps::rtps::ThroughputControllerDescriptor throughputController; + + //! Underlying History memory policy + fastrtps::rtps::MemoryManagementPolicy_t historyMemoryPolicy = + fastrtps::rtps::MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + + //! Properties + fastrtps::rtps::PropertyPolicy properties; + + //! Allocation limits on the matched subscribers collections + fastrtps::ResourceLimitedContainerConfig matched_subscriber_allocation; + + /** + * Get the user defined ID + * @return User defined ID + */ + inline int16_t getUserDefinedID() const + { + return m_userDefinedID; + } + + /** + * Get the entity defined ID + * @return Entity ID + */ + inline int16_t getEntityID() const + { + return m_entityID; + } + + /** + * Set the user defined ID + * @param id User defined ID to be set + */ + inline void setUserDefinedID( + uint8_t id) + { + m_userDefinedID = id; + } + + /** + * Set the entity ID + * @param id Entity ID to be set + */ + inline void setEntityID( + uint8_t id) + { + m_entityID = id; + } + +private: + + //! User Defined ID, used for StaticEndpointDiscovery, default value -1. + int16_t m_userDefinedID = -1; + //! Entity ID, if the user want to specify the EntityID of the enpoint, default value -1. + int16_t m_entityID = -1; +}; + +} // namespace fastdds +} // namespace eprosima + +#endif /* _FASTDDS_PUBLISHERATTRIBUTES_H_ */ diff --git a/include/fastrtps/attributes/ReplierAttributes.hpp b/src/cpp/xmlparser/attributes/ReplierAttributes.hpp similarity index 79% rename from include/fastrtps/attributes/ReplierAttributes.hpp rename to src/cpp/xmlparser/attributes/ReplierAttributes.hpp index 8fb20c97a71..76953ef8004 100644 --- a/include/fastrtps/attributes/ReplierAttributes.hpp +++ b/src/cpp/xmlparser/attributes/ReplierAttributes.hpp @@ -16,21 +16,23 @@ * @file ReplierAttributes.hpp */ -#ifndef REPLIERATTRIBUTES_HPP_ -#define REPLIERATTRIBUTES_HPP_ +#ifndef _FASTDDS_REPLIERATTRIBUTES_HPP_ +#define _FASTDDS_REPLIERATTRIBUTES_HPP_ -#include "PublisherAttributes.h" -#include "SubscriberAttributes.h" +#include +#include namespace eprosima { -namespace fastrtps { +namespace fastdds { class ReplierAttributes { public: + ReplierAttributes() = default; - bool operator==(const ReplierAttributes& b) const + bool operator ==( + const ReplierAttributes& b) const { return (this->service_name == b.service_name) && (this->request_topic_name == b.request_topic_name) && @@ -48,7 +50,7 @@ class ReplierAttributes SubscriberAttributes subscriber; }; -} /* namespace fastrtps */ +} /* namespace fastdds */ } /* namespace eprosima */ -#endif /* REPLIERATTRIBUTES_HPP_ */ \ No newline at end of file +#endif /* _FASTDDS_REPLIERATTRIBUTES_HPP_ */ diff --git a/include/fastrtps/attributes/RequesterAttributes.hpp b/src/cpp/xmlparser/attributes/RequesterAttributes.hpp similarity index 78% rename from include/fastrtps/attributes/RequesterAttributes.hpp rename to src/cpp/xmlparser/attributes/RequesterAttributes.hpp index ed042340538..57ef4629d88 100644 --- a/include/fastrtps/attributes/RequesterAttributes.hpp +++ b/src/cpp/xmlparser/attributes/RequesterAttributes.hpp @@ -16,21 +16,23 @@ * @file RequesterAttributes.hpp */ -#ifndef REQUESTERATTRIBUTES_HPP_ -#define REQUESTERATTRIBUTES_HPP_ +#ifndef _FASTDDS_REQUESTERATTRIBUTES_HPP_ +#define _FASTDDS_REQUESTERATTRIBUTES_HPP_ -#include "PublisherAttributes.h" -#include "SubscriberAttributes.h" +#include +#include namespace eprosima { -namespace fastrtps { +namespace fastdds { class RequesterAttributes { public: + RequesterAttributes() = default; - bool operator==(const RequesterAttributes& b) const + bool operator ==( + const RequesterAttributes& b) const { return (this->service_name == b.service_name) && (this->request_topic_name == b.request_topic_name) && @@ -49,7 +51,7 @@ class RequesterAttributes }; -} /* namespace fastrtps */ +} /* namespace fastdds */ } /* namespace eprosima */ -#endif /* REQUESTERATTRIBUTES_HPP_ */ \ No newline at end of file +#endif /* _FASTDDS_REQUESTERATTRIBUTES_HPP_ */ diff --git a/src/cpp/xmlparser/attributes/SubscriberAttributes.hpp b/src/cpp/xmlparser/attributes/SubscriberAttributes.hpp new file mode 100644 index 00000000000..ce3f3732156 --- /dev/null +++ b/src/cpp/xmlparser/attributes/SubscriberAttributes.hpp @@ -0,0 +1,152 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file + */ + +#ifndef _FASTDDS_SUBSCRIBERATTRIBUTES_H_ +#define _FASTDDS_SUBSCRIBERATTRIBUTES_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { + +/** + * Class SubscriberAttributes, used by the user to define the attributes of a Subscriber. + * @ingroup FASTRTPS_ATTRIBUTES_MODULE + */ +class SubscriberAttributes +{ +public: + + //! Topic Attributes + fastrtps::TopicAttributes topic; + + //! Reader QOs. + fastrtps::ReaderQos qos; + + //! Times for a RELIABLE Reader + fastrtps::rtps::ReaderTimes times; + + //! Unicast locator list + fastrtps::rtps::LocatorList_t unicastLocatorList; + + //! Multicast locator list + fastrtps::rtps::LocatorList_t multicastLocatorList; + + //! Remote locator list + fastrtps::rtps::LocatorList_t remoteLocatorList; + + //! The collection of external locators to use for communication. + fastdds::rtps::ExternalLocators external_unicast_locators; + + //! Whether locators that don't match with the announced locators should be kept. + bool ignore_non_matching_locators = false; + + //! Expects Inline QOS + bool expectsInlineQos = false; + + //! Underlying History memory policy + fastrtps::rtps::MemoryManagementPolicy_t historyMemoryPolicy = + fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + + //! Properties + fastrtps::rtps::PropertyPolicy properties; + + //! Matched publishers allocation limits + fastrtps::ResourceLimitedContainerConfig matched_publisher_allocation; + + SubscriberAttributes() = default; + + virtual ~SubscriberAttributes() = default; + + bool operator ==( + const SubscriberAttributes& b) const + { + return (this->topic == b.topic) && + (this->qos == b.qos) && + (this->times == b.times) && + (this->unicastLocatorList == b.unicastLocatorList) && + (this->multicastLocatorList == b.multicastLocatorList) && + (this->remoteLocatorList == b.remoteLocatorList) && + (this->historyMemoryPolicy == b.historyMemoryPolicy) && + (this->properties == b.properties); + } + + bool operator !=( + const SubscriberAttributes& b) const + { + return !(*this == b); + } + + /** + * Get the user defined ID + * @return User defined ID + */ + inline int16_t getUserDefinedID() const + { + return m_userDefinedID; + } + + /** + * Get the entity defined ID + * @return Entity ID + */ + inline int16_t getEntityID() const + { + return m_entityID; + } + + /** + * Set the user defined ID + * @param id User defined ID to be set + */ + inline void setUserDefinedID( + uint8_t id) + { + m_userDefinedID = id; + } + + /** + * Set the entity ID + * @param id Entity ID to be set + */ + inline void setEntityID( + uint8_t id) + { + m_entityID = id; + } + +private: + + //! User Defined ID, used for StaticEndpointDiscovery, default value -1. + int16_t m_userDefinedID = -1; + + //! Entity ID, if the user want to specify the EntityID of the enpoint, default value -1. + int16_t m_entityID = -1; +}; + +} /* namespace fastdds */ +} /* namespace eprosima */ + +#endif /* SUBSCRIBERPARAMS_H_ */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fdc9e4158c8..10771d180fd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -51,12 +51,13 @@ message(STATUS "EPROSIMA_TEST_DNS_NOT_SET_UP: '${EPROSIMA_TEST_DNS_NOT_SET_UP}'" # Testing ############################################################################### if(EPROSIMA_BUILD_TESTS) + find_package(GTest CONFIG REQUIRED) include(${PROJECT_SOURCE_DIR}/cmake/testing/GoogleTest.cmake) add_subdirectory(blackbox) + add_subdirectory(feature) add_subdirectory(unittest) - add_subdirectory(xtypes) add_subdirectory(dds/communication) add_subdirectory(dds/communication/security) add_subdirectory(dds/discovery) diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index ac40b155408..63b9c6dc4e0 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -13,7 +13,6 @@ # limitations under the License. option(RTPS_API_TESTS "Enable tests using RTPS API" ON) -option(FASTRTPS_API_TESTS "Enable tests using FastRTPS API" OFF) option(FASTDDS_PIM_API_TESTS "Enable tests using FastDDS API" ON) if(WIN32) @@ -63,31 +62,22 @@ message(STATUS "BLACKBOX_HIGH_LEVEL_IGNORED_TESTS set to '${BLACKBOX_HIGH_LEVEL_ file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} - types/Data1mb.cxx - types/Data1mbPubSubTypes.cxx - types/Data1mbv1.cxx - types/Data64kb.cxx - types/Data64kbPubSubTypes.cxx - types/Data64kbv1.cxx - types/FixedSized.cxx - types/FixedSizedPubSubTypes.cxx - types/FixedSizedv1.cxx - types/HelloWorld.cxx types/HelloWorldPubSubTypes.cxx - types/HelloWorldTypeObject.cxx - types/HelloWorldv1.cxx - types/KeyedData1mb.cxx - types/KeyedData1mbPubSubTypes.cxx - types/KeyedData1mbv1.cxx - types/KeyedHelloWorld.cxx + types/HelloWorldTypeObjectSupport.cxx types/KeyedHelloWorldPubSubTypes.cxx - types/KeyedHelloWorldv1.cxx - types/StringTest.cxx + types/KeyedHelloWorldTypeObjectSupport.cxx types/StringTestPubSubTypes.cxx - types/StringTestv1.cxx - types/UnboundedHelloWorld.cxx + types/StringTestTypeObjectSupport.cxx + types/Data64kbPubSubTypes.cxx + types/Data64kbTypeObjectSupport.cxx + types/Data1mbPubSubTypes.cxx + types/Data1mbTypeObjectSupport.cxx + types/KeyedData1mbPubSubTypes.cxx + types/KeyedData1mbTypeObjectSupport.cxx + types/FixedSizedPubSubTypes.cxx + types/FixedSizedTypeObjectSupport.cxx types/UnboundedHelloWorldPubSubTypes.cxx - types/UnboundedHelloWorldv1.cxx + types/UnboundedHelloWorldTypeObjectSupport.cxx utils/data_generators.cpp utils/lambda_functions.cpp @@ -104,7 +94,7 @@ target_compile_definitions(BlackboxTests_RTPS PRIVATE ) target_include_directories(BlackboxTests_RTPS PRIVATE ${Asio_INCLUDE_DIR}) -target_link_libraries(BlackboxTests_RTPS fastrtps fastcdr foonathan_memory GTest::gtest) +target_link_libraries(BlackboxTests_RTPS fastdds fastcdr foonathan_memory GTest::gtest) gtest_discover_tests(BlackboxTests_RTPS TEST_PREFIX "BlackboxTests_RTPS." TEST_FILTER ${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS} @@ -113,38 +103,25 @@ gtest_discover_tests(BlackboxTests_RTPS file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} - types/Data1mb.cxx - types/Data1mbPubSubTypes.cxx - types/Data1mbv1.cxx - types/Data64kb.cxx - types/Data64kbPubSubTypes.cxx - types/Data64kbv1.cxx - types/FixedSized.cxx - types/FixedSizedPubSubTypes.cxx - types/FixedSizedv1.cxx - types/HelloWorld.cxx types/HelloWorldPubSubTypes.cxx - types/HelloWorldTypeObject.cxx - types/HelloWorldv1.cxx - types/KeyedData1mb.cxx - types/KeyedData1mbPubSubTypes.cxx - types/KeyedData1mbv1.cxx - types/KeyedHelloWorld.cxx + types/HelloWorldTypeObjectSupport.cxx types/KeyedHelloWorldPubSubTypes.cxx - types/KeyedHelloWorldv1.cxx - types/StringTest.cxx + types/KeyedHelloWorldTypeObjectSupport.cxx types/StringTestPubSubTypes.cxx - types/StringTestv1.cxx - types/TestIncludeRegression3361.cxx - types/TestIncludeRegression3361TypeObject.cxx - types/TestIncludeRegression3361v1.cxx - types/TestRegression3361.cxx + types/StringTestTypeObjectSupport.cxx + types/Data64kbPubSubTypes.cxx + types/Data64kbTypeObjectSupport.cxx + types/Data1mbPubSubTypes.cxx + types/Data1mbTypeObjectSupport.cxx + types/KeyedData1mbPubSubTypes.cxx + types/KeyedData1mbTypeObjectSupport.cxx + types/FixedSizedPubSubTypes.cxx + types/FixedSizedTypeObjectSupport.cxx + types/TestIncludeRegression3361TypeObjectSupport.cxx types/TestRegression3361PubSubTypes.cxx - types/TestRegression3361TypeObject.cxx - types/TestRegression3361v1.cxx - types/UnboundedHelloWorld.cxx + types/TestRegression3361TypeObjectSupport.cxx types/UnboundedHelloWorldPubSubTypes.cxx - types/UnboundedHelloWorldv1.cxx + types/UnboundedHelloWorldTypeObjectSupport.cxx utils/data_generators.cpp utils/lambda_functions.cpp @@ -197,47 +174,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/auth_handshake_props_profile.xml ${CMAKE_CURRENT_BINARY_DIR}/auth_handshake_props_profile.xml COPYONLY) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/datagrams" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") -if(FASTRTPS_API_TESTS) - set(BLACKBOXTESTS_FASTRTPS_SOURCE - ${BLACKBOXTESTS_SOURCE} - api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp - api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp - ) - - add_executable(BlackboxTests_FastRTPS ${BLACKBOXTESTS_FASTRTPS_SOURCE}) - target_compile_definitions(BlackboxTests_FastRTPS PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - $<$:_ENABLE_ATOMIC_ALIGNMENT_FIX> - ) - target_include_directories(BlackboxTests_FastRTPS PRIVATE - ${Asio_INCLUDE_DIR} - api/fastrtps_deprecated) - target_link_libraries(BlackboxTests_FastRTPS - fastrtps - fastcdr - foonathan_memory - GTest::gtest - $<$:eProsima_p11> # $ - ) - - gtest_discover_tests(BlackboxTests_FastRTPS - PROPERTIES - ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs" - ENVIRONMENT "TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}" - ENVIRONMENT "W_UNICAST_PORT_RANDOM_NUMBER=${W_UNICAST_PORT_RANDOM_NUMBER}" - ENVIRONMENT "R_UNICAST_PORT_RANDOM_NUMBER=${R_UNICAST_PORT_RANDOM_NUMBER}" - ENVIRONMENT "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" - ENVIRONMENT $,OPENSSL_CONF=${OPENSSL_CONF},> - TEST_PREFIX "BlackboxTests_FastRTPS." - TEST_FILTER ${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS} - NO_PRETTY_VALUES - ) -endif(FASTRTPS_API_TESTS) - if(FASTDDS_PIM_API_TESTS) set(BLACKBOXTESTS_FASTDDS_PIM_SOURCE ${DDS_BLACKBOXTESTS_SOURCE} @@ -248,12 +184,10 @@ if(FASTDDS_PIM_API_TESTS) if (FASTDDS_STATISTICS) set(statistics_sources - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ) list(APPEND BLACKBOXTESTS_FASTDDS_PIM_SOURCE ${statistics_sources}) @@ -273,7 +207,7 @@ if(FASTDDS_PIM_API_TESTS) ${Asio_INCLUDE_DIR} api/dds-pim) target_link_libraries(BlackboxTests_DDS_PIM - fastrtps + fastdds fastcdr foonathan_memory GTest::gtest diff --git a/test/blackbox/MonitorServiceConnectionList_profile.xml b/test/blackbox/MonitorServiceConnectionList_profile.xml index 89f5688d028..d16ef008d02 100644 --- a/test/blackbox/MonitorServiceConnectionList_profile.xml +++ b/test/blackbox/MonitorServiceConnectionList_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/MonitorServiceDomainParticipant_profile.xml b/test/blackbox/MonitorServiceDomainParticipant_profile.xml index ae7eb69f9b2..5c0dd49436d 100644 --- a/test/blackbox/MonitorServiceDomainParticipant_profile.xml +++ b/test/blackbox/MonitorServiceDomainParticipant_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/StatisticsDomainParticipant_profile.xml b/test/blackbox/StatisticsDomainParticipant_profile.xml index 2275e69b017..437aa492172 100644 --- a/test/blackbox/StatisticsDomainParticipant_profile.xml +++ b/test/blackbox/StatisticsDomainParticipant_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/api/dds-pim/PubSubParticipant.hpp b/test/blackbox/api/dds-pim/PubSubParticipant.hpp index ceee9578df4..6181e685e3f 100644 --- a/test/blackbox/api/dds-pim/PubSubParticipant.hpp +++ b/test/blackbox/api/dds-pim/PubSubParticipant.hpp @@ -132,7 +132,7 @@ class PubSubParticipant type data; eprosima::fastdds::dds::SampleInfo info; - while (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&data, &info)) + while (eprosima::fastdds::dds::RETCODE_OK == reader->take_next_sample(&data, &info)) { participant_->data_received(); } @@ -162,8 +162,10 @@ class PubSubParticipant void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); bool expected = false; if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { @@ -662,7 +664,7 @@ class PubSubParticipant // Update QoS before updating user data as statistics properties might have changed internally participant_qos_ = participant_->get_qos(); participant_qos_.user_data().data_vec(user_data); - return ReturnCode_t::RETCODE_OK == participant_->set_qos(participant_qos_); + return eprosima::fastdds::dds::RETCODE_OK == participant_->set_qos(participant_qos_); } PubSubParticipant& wire_protocol( @@ -677,7 +679,7 @@ class PubSubParticipant { eprosima::fastdds::dds::DomainParticipantQos participant_qos = participant_qos_; participant_qos.wire_protocol() = wire_protocol; - if (ReturnCode_t::RETCODE_OK == participant_->set_qos(participant_qos)) + if (eprosima::fastdds::dds::RETCODE_OK == participant_->set_qos(participant_qos)) { participant_qos_ = participant_qos; return true; @@ -793,7 +795,7 @@ class PubSubParticipant qos = std::get<2>(subscribers_[index])->get_qos(); qos.deadline().period = deadline_period; - return ReturnCode_t::RETCODE_OK == std::get<2>(subscribers_[index])->set_qos(qos); + return eprosima::fastdds::dds::RETCODE_OK == std::get<2>(subscribers_[index])->set_qos(qos); } void pub_liveliness_lost() diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp index 5cee7b633fb..00df6c72cd0 100644 --- a/test/blackbox/api/dds-pim/PubSubReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubReader.hpp @@ -31,35 +31,35 @@ #if _MSC_VER #include #endif // _MSC_VER -#include #include +#include #include -#include #include +#include +#include #include #include #include #include #include #include +#include #include #include -#include #include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include -using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; -using eprosima::fastrtps::rtps::IPLocator; +using eprosima::fastdds::dds::DomainParticipantFactory; +using eprosima::fastdds::dds::ReturnCode_t; using eprosima::fastdds::rtps::UDPTransportDescriptor; using eprosima::fastdds::rtps::UDPv4TransportDescriptor; using eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using eprosima::fastrtps::rtps::IPLocator; using SampleLostStatusFunctor = std::function; using SampleRejectedStatusFunctor = std::function; @@ -90,8 +90,10 @@ class PubSubReader void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override { + static_cast(should_be_ignored); if (reader_.onDiscovery_ != nullptr) { std::unique_lock lock(reader_.mutexDiscovery_); @@ -111,9 +113,10 @@ class PubSubReader } } - void on_publisher_discovery( + void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (reader_.onEndpointDiscovery_ != nullptr) { @@ -143,7 +146,7 @@ class PubSubReader private: using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery; - using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery; + using eprosima::fastdds::dds::DomainParticipantListener::on_data_writer_discovery; ParticipantListener& operator =( const ParticipantListener&) = delete; @@ -205,7 +208,7 @@ class PubSubReader void on_requested_deadline_missed( eprosima::fastdds::dds::DataReader* datareader, - const eprosima::fastrtps::RequestedDeadlineMissedStatus& status) override + const eprosima::fastdds::dds::RequestedDeadlineMissedStatus& status) override { (void)datareader; @@ -222,7 +225,7 @@ class PubSubReader void on_liveliness_changed( eprosima::fastdds::dds::DataReader* datareader, - const eprosima::fastrtps::LivelinessChangedStatus& status) override + const eprosima::fastdds::dds::LivelinessChangedStatus& status) override { (void)datareader; @@ -401,7 +404,7 @@ class PubSubReader type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); // Create topic topic_ = @@ -456,7 +459,7 @@ class PubSubReader bool delete_datareader() { - ReturnCode_t ret(ReturnCode_t::RETCODE_ERROR); + ReturnCode_t ret(eprosima::fastdds::dds::RETCODE_ERROR); if (subscriber_ && datareader_) { @@ -464,7 +467,7 @@ class PubSubReader datareader_ = nullptr; } - return (ReturnCode_t::RETCODE_OK == ret); + return (eprosima::fastdds::dds::RETCODE_OK == ret); } virtual void destroy() @@ -617,7 +620,7 @@ class PubSubReader eprosima::fastdds::dds::ANY_VIEW_STATE, eprosima::fastdds::dds::ANY_INSTANCE_STATE); - if (ReturnCode_t::RETCODE_OK == success) + if (eprosima::fastdds::dds::RETCODE_OK == success) { for (eprosima::fastdds::dds::LoanableCollection::size_type n = 0; n < info_seq.length(); ++n) { @@ -878,7 +881,7 @@ class PubSubReader /*** Function to change QoS ***/ PubSubReader& reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) + const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind) { datareader_qos_.reliability().kind = kind; return *this; @@ -905,11 +908,11 @@ class PubSubReader datareader_->get_qos(datareader_qos); datareader_qos.deadline().period = deadline_period; - return (datareader_->set_qos(datareader_qos) == ReturnCode_t::RETCODE_OK); + return (datareader_->set_qos(datareader_qos) == eprosima::fastdds::dds::RETCODE_OK); } PubSubReader& liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind& kind) + const eprosima::fastdds::dds::LivelinessQosPolicyKind& kind) { datareader_qos_.liveliness().kind = kind; return *this; @@ -950,7 +953,7 @@ class PubSubReader } PubSubReader& history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) + const eprosima::fastdds::dds::HistoryQosPolicyKind kind) { datareader_qos_.history().kind = kind; return *this; @@ -1314,7 +1317,7 @@ class PubSubReader } PubSubReader& durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) + const eprosima::fastdds::dds::DurabilityQosPolicyKind kind) { datareader_qos_.durability().kind = kind; return *this; @@ -1471,7 +1474,7 @@ class PubSubReader if (profile->getType() == eprosima::fastrtps::xmlparser::NodeType::PARTICIPANT) { participant_attr_ = - *(dynamic_cast + *(dynamic_cast *>( profile.get())->get()); } @@ -1572,7 +1575,7 @@ class PubSubReader { participant_qos_.properties().properties().emplace_back("dds.persistence.plugin", "builtin.SQLITE3"); participant_qos_.properties().properties().emplace_back("dds.persistence.sqlite3.filename", filename); - datareader_qos_.durability().kind = eprosima::fastrtps::TRANSIENT_DURABILITY_QOS; + datareader_qos_.durability().kind = eprosima::fastdds::dds::TRANSIENT_DURABILITY_QOS; datareader_qos_.properties().properties().emplace_back("dds.persistence.guid", persistence_guid); return *this; @@ -1599,13 +1602,13 @@ class PubSubReader { subscriber_qos_.partition().clear(); subscriber_qos_.partition().push_back(partition.c_str()); - return (ReturnCode_t::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); } bool clear_partitions() { subscriber_qos_.partition().clear(); - return (ReturnCode_t::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == subscriber_->set_qos(subscriber_qos_)); } /*** Function for discovery callback ***/ @@ -1646,7 +1649,7 @@ class PubSubReader collection data_seq(buf, 1); info_seq_type info_seq(1); - if (ReturnCode_t::RETCODE_OK == datareader_->take(data_seq, info_seq)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader_->take(data_seq, info_seq)) { current_processed_count_++; return true; @@ -1658,7 +1661,7 @@ class PubSubReader void* data) { eprosima::fastdds::dds::SampleInfo dds_info; - if (datareader_->take_next_sample(data, &dds_info) == ReturnCode_t::RETCODE_OK) + if (datareader_->take_next_sample(data, &dds_info) == eprosima::fastdds::dds::RETCODE_OK) { current_processed_count_++; return true; @@ -1686,7 +1689,7 @@ class PubSubReader } void set_liveliness_changed_status( - const eprosima::fastrtps::LivelinessChangedStatus& status) + const eprosima::fastdds::dds::LivelinessChangedStatus& status) { std::unique_lock lock(liveliness_mutex_); @@ -1728,7 +1731,7 @@ class PubSubReader return status; } - const eprosima::fastrtps::LivelinessChangedStatus& liveliness_changed_status() + const eprosima::fastdds::dds::LivelinessChangedStatus& liveliness_changed_status() { std::unique_lock lock(liveliness_mutex_); @@ -1860,7 +1863,7 @@ class PubSubReader ReturnCode_t success = take_ ? datareader->take_next_sample((void*)&data, &info) : datareader->read_next_sample((void*)&data, &info); - if (ReturnCode_t::RETCODE_OK == success) + if (eprosima::fastdds::dds::RETCODE_OK == success) { returnedValue = true; @@ -1896,7 +1899,7 @@ class PubSubReader datareader->take(datas, infos) : datareader->read(datas, infos); - if (!success) + if (eprosima::fastdds::dds::RETCODE_OK != success) { returnedValue = false; return; @@ -2058,7 +2061,7 @@ class PubSubReader //! Number of times liveliness was recovered unsigned int times_liveliness_recovered_; //! The liveliness changed status - eprosima::fastrtps::LivelinessChangedStatus liveliness_changed_status_; + eprosima::fastdds::dds::LivelinessChangedStatus liveliness_changed_status_; //! A mutex for incompatible_qos status std::mutex incompatible_qos_mutex_; @@ -2148,7 +2151,7 @@ class PubSubReaderWithWaitsets : public PubSubReader { lock.unlock(); auto wait_result = waitset_.wait(active_conditions_, timeout_); - if (wait_result == ReturnCode_t::RETCODE_TIMEOUT) + if (wait_result == eprosima::fastdds::dds::RETCODE_TIMEOUT) { reader_.on_waitset_timeout(); } @@ -2240,14 +2243,14 @@ class PubSubReaderWithWaitsets : public PubSubReader if (triggered_statuses.is_active(eprosima::fastdds::dds::StatusMask::sample_lost())) { eprosima::fastdds::dds::SampleLostStatus status; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, reader_.datareader_->get_sample_lost_status(status)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader_.datareader_->get_sample_lost_status(status)); reader_.set_sample_lost_status(status); } if (triggered_statuses.is_active(eprosima::fastdds::dds::StatusMask::sample_rejected())) { eprosima::fastdds::dds::SampleRejectedStatus status; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, reader_.datareader_->get_sample_rejected_status(status)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader_.datareader_->get_sample_rejected_status(status)); reader_.set_sample_rejected_status(status); } diff --git a/test/blackbox/api/dds-pim/PubSubWriter.hpp b/test/blackbox/api/dds-pim/PubSubWriter.hpp index d4c51199c1b..9a9ad818fae 100644 --- a/test/blackbox/api/dds-pim/PubSubWriter.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriter.hpp @@ -29,11 +29,9 @@ #include #include - #if _MSC_VER #include #endif // _MSC_VER - #include #include #include @@ -53,15 +51,13 @@ #include #include #include -#include -#include -#include +#include -using DomainParticipantFactory = eprosima::fastdds::dds::DomainParticipantFactory; -using eprosima::fastrtps::rtps::IPLocator; +using eprosima::fastdds::dds::DomainParticipantFactory; using eprosima::fastdds::rtps::UDPTransportDescriptor; using eprosima::fastdds::rtps::UDPv4TransportDescriptor; using eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using eprosima::fastrtps::rtps::IPLocator; template class PubSubWriter @@ -82,8 +78,10 @@ class PubSubWriter void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override { + static_cast(should_be_ignored); if (writer_.onDiscovery_ != nullptr) { writer_.discovery_result_ = writer_.onDiscovery_(info); @@ -117,9 +115,10 @@ class PubSubWriter #endif // if HAVE_SECURITY - void on_subscriber_discovery( + void on_data_reader_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER) { @@ -136,9 +135,10 @@ class PubSubWriter } } - void on_publisher_discovery( + void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER) { @@ -157,8 +157,8 @@ class PubSubWriter private: using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery; - using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery; - using eprosima::fastdds::dds::DomainParticipantListener::on_subscriber_discovery; + using eprosima::fastdds::dds::DomainParticipantListener::on_data_writer_discovery; + using eprosima::fastdds::dds::DomainParticipantListener::on_data_reader_discovery; ParticipantListener& operator =( const ParticipantListener&) = delete; @@ -203,7 +203,7 @@ class PubSubWriter void on_offered_deadline_missed( eprosima::fastdds::dds::DataWriter* datawriter, - const eprosima::fastrtps::OfferedDeadlineMissedStatus& status) override + const eprosima::fastdds::dds::OfferedDeadlineMissedStatus& status) override { static_cast(datawriter); times_deadline_missed_ = status.total_count; @@ -219,7 +219,7 @@ class PubSubWriter void on_liveliness_lost( eprosima::fastdds::dds::DataWriter* datawriter, - const eprosima::fastrtps::LivelinessLostStatus& status) override + const eprosima::fastdds::dds::LivelinessLostStatus& status) override { static_cast(datawriter); times_liveliness_lost_ = status.total_count; @@ -387,7 +387,7 @@ class PubSubWriter type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); // Create topic topic_ = participant_->create_topic(topic_name_, type_->getName(), @@ -525,14 +525,14 @@ class PubSubWriter type& msg, const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) { - return ReturnCode_t::RETCODE_OK == datawriter_->unregister_instance((void*)&msg, instance_handle); + return eprosima::fastdds::dds::RETCODE_OK == datawriter_->unregister_instance((void*)&msg, instance_handle); } bool dispose( type& msg, const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) { - return ReturnCode_t::RETCODE_OK == datawriter_->dispose((void*)&msg, instance_handle); + return eprosima::fastdds::dds::RETCODE_OK == datawriter_->dispose((void*)&msg, instance_handle); } bool send_sample( @@ -758,7 +758,7 @@ class PubSubWriter nsecs -= secs; eprosima::fastrtps::Duration_t timeout {static_cast(secs.count()), static_cast(nsecs.count())}; - return (ReturnCode_t::RETCODE_OK == + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->wait_for_acknowledgments(timeout)); } @@ -775,7 +775,7 @@ class PubSubWriter nsecs -= secs; eprosima::fastrtps::Duration_t timeout {static_cast(secs.count()), static_cast(nsecs.count())}; - return (ReturnCode_t::RETCODE_OK == + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->wait_for_acknowledgments(data, instance_handle, timeout)); } @@ -832,7 +832,7 @@ class PubSubWriter /*** Function to change QoS ***/ PubSubWriter& reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) + const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind) { datawriter_qos_.reliability().kind = kind; return *this; @@ -853,7 +853,7 @@ class PubSubWriter } PubSubWriter& liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) + const eprosima::fastdds::dds::LivelinessQosPolicyKind kind) { datawriter_qos_.liveliness().kind = kind; return *this; @@ -932,14 +932,14 @@ class PubSubWriter } PubSubWriter& asynchronously( - const eprosima::fastrtps::PublishModeQosPolicyKind kind) + const eprosima::fastdds::dds::PublishModeQosPolicyKind kind) { datawriter_qos_.publish_mode().kind = kind; return *this; } PubSubWriter& history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) + const eprosima::fastdds::dds::HistoryQosPolicyKind kind) { datawriter_qos_.history().kind = kind; return *this; @@ -1062,7 +1062,7 @@ class PubSubWriter } PubSubWriter& durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) + const eprosima::fastdds::dds::DurabilityQosPolicyKind kind) { datawriter_qos_.durability().kind = kind; return *this; @@ -1571,18 +1571,18 @@ class PubSubWriter { publisher_qos_.partition().clear(); publisher_qos_.partition().push_back(partition.c_str()); - return (ReturnCode_t::RETCODE_OK == publisher_->set_qos(publisher_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == publisher_->set_qos(publisher_qos_)); } bool set_qos() { - return (ReturnCode_t::RETCODE_OK == datawriter_->set_qos(datawriter_qos_)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->set_qos(datawriter_qos_)); } bool set_qos( const eprosima::fastdds::dds::DataWriterQos& att) { - return (ReturnCode_t::RETCODE_OK == datawriter_->set_qos(att)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->set_qos(att)); } eprosima::fastdds::dds::DataWriterQos get_qos() @@ -1593,7 +1593,7 @@ class PubSubWriter bool remove_all_changes( size_t* number_of_changes_removed) { - return (ReturnCode_t::RETCODE_OK == datawriter_->clear_history(number_of_changes_removed)); + return (eprosima::fastdds::dds::RETCODE_OK == datawriter_->clear_history(number_of_changes_removed)); } bool is_matched() const @@ -1680,7 +1680,7 @@ class PubSubWriter { participant_qos_.properties().properties().emplace_back("dds.persistence.plugin", "builtin.SQLITE3"); participant_qos_.properties().properties().emplace_back("dds.persistence.sqlite3.filename", filename); - datawriter_qos_.durability().kind = eprosima::fastrtps::TRANSIENT_DURABILITY_QOS; + datawriter_qos_.durability().kind = eprosima::fastdds::dds::TRANSIENT_DURABILITY_QOS; datawriter_qos_.properties().properties().emplace_back("dds.persistence.guid", persistence_guid); return *this; @@ -2077,7 +2077,7 @@ class PubSubWriterWithWaitsets : public PubSubWriter { lock.unlock(); auto wait_result = waitset_.wait(active_conditions_, timeout_); - if (wait_result == ReturnCode_t::RETCODE_TIMEOUT) + if (wait_result == eprosima::fastdds::dds::RETCODE_TIMEOUT) { writer_.on_waitset_timeout(); } diff --git a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp index c81ba1a0701..96348c98e96 100644 --- a/test/blackbox/api/dds-pim/PubSubWriterReader.hpp +++ b/test/blackbox/api/dds-pim/PubSubWriterReader.hpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -82,9 +82,11 @@ class PubSubWriterReader #endif // if HAVE_SECURITY void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override { - (void)participant; + static_cast(should_be_ignored); + static_cast(participant); switch (info.status) { @@ -106,9 +108,10 @@ class PubSubWriterReader } } - void on_subscriber_discovery( + void on_data_reader_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { (void)participant; @@ -127,9 +130,10 @@ class PubSubWriterReader } } - void on_publisher_discovery( + void on_data_writer_discovery( eprosima::fastdds::dds::DomainParticipant* participant, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { (void)participant; @@ -169,8 +173,8 @@ class PubSubWriterReader private: using eprosima::fastdds::dds::DomainParticipantListener::on_participant_discovery; - using eprosima::fastdds::dds::DomainParticipantListener::on_publisher_discovery; - using eprosima::fastdds::dds::DomainParticipantListener::on_subscriber_discovery; + using eprosima::fastdds::dds::DomainParticipantListener::on_data_writer_discovery; + using eprosima::fastdds::dds::DomainParticipantListener::on_data_reader_discovery; //! Mutex guarding all info collections mutable std::mutex info_mutex_; @@ -393,7 +397,7 @@ class PubSubWriterReader type_.reset(new type_support()); // Register type - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); //Create publisher publisher_ = participant_->create_publisher(eprosima::fastdds::dds::PUBLISHER_QOS_DEFAULT); @@ -529,7 +533,7 @@ class PubSubWriterReader topic_ = nullptr; } ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_), ReturnCode_t::RETCODE_OK); + participant_), eprosima::fastdds::dds::RETCODE_OK); participant_ = nullptr; } @@ -713,42 +717,42 @@ class PubSubWriterReader #endif // if HAVE_SECURITY PubSubWriterReader& pub_durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) + const eprosima::fastdds::dds::DurabilityQosPolicyKind kind) { datawriter_qos_.durability().kind = kind; return *this; } PubSubWriterReader& sub_durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) + const eprosima::fastdds::dds::DurabilityQosPolicyKind kind) { datareader_qos_.durability().kind = kind; return *this; } PubSubWriterReader& pub_reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) + const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind) { datawriter_qos_.reliability().kind = kind; return *this; } PubSubWriterReader& sub_reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) + const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind) { datareader_qos_.reliability().kind = kind; return *this; } PubSubWriterReader& pub_history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) + const eprosima::fastdds::dds::HistoryQosPolicyKind kind) { datawriter_qos_.history().kind = kind; return *this; } PubSubWriterReader& sub_history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) + const eprosima::fastdds::dds::HistoryQosPolicyKind kind) { datareader_qos_.history().kind = kind; return *this; @@ -775,7 +779,7 @@ class PubSubWriterReader } PubSubWriterReader& add_user_transport_to_pparams( - std::shared_ptr userTransportDescriptor) + std::shared_ptr userTransportDescriptor) { participant_qos_.transport().user_transports.push_back(userTransportDescriptor); return *this; @@ -803,14 +807,14 @@ class PubSubWriterReader } PubSubWriterReader& pub_liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) + const eprosima::fastdds::dds::LivelinessQosPolicyKind kind) { datawriter_qos_.liveliness().kind = kind; return *this; } PubSubWriterReader& sub_liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) + const eprosima::fastdds::dds::LivelinessQosPolicyKind kind) { datareader_qos_.liveliness().kind = kind; return *this; @@ -894,7 +898,7 @@ class PubSubWriterReader } PubSubWriterReader& asynchronously( - const eprosima::fastrtps::PublishModeQosPolicyKind kind) + const eprosima::fastdds::dds::PublishModeQosPolicyKind kind) { datawriter_qos_.publish_mode().kind = kind; return *this; @@ -910,7 +914,7 @@ class PubSubWriterReader type data; eprosima::fastdds::dds::SampleInfo info; - if ((ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&data, &info))) + if ((eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&data, &info))) { returnedValue = true; diff --git a/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldReplier.hpp b/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldReplier.hpp index 7a33f678b8d..a873b8802b4 100644 --- a/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldReplier.hpp +++ b/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldReplier.hpp @@ -30,7 +30,7 @@ class ReqRepAsReliableHelloWorldReplier : public ReqRepHelloWorldReplier void configDatareader( const std::string& suffix) override { - datareader_qos_.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + datareader_qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; std::ostringstream t; @@ -42,7 +42,7 @@ class ReqRepAsReliableHelloWorldReplier : public ReqRepHelloWorldReplier void configDatawriter( const std::string& suffix) override { - datawriter_qos_.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + datawriter_qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some // big CPU overhead sometimes diff --git a/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldRequester.hpp b/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldRequester.hpp index 5ac6ff5505a..9dd7302dcbd 100644 --- a/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldRequester.hpp +++ b/test/blackbox/api/dds-pim/ReqRepAsReliableHelloWorldRequester.hpp @@ -28,7 +28,7 @@ #define GET_PID _getpid #else #define GET_PID getpid -#endif +#endif // if defined(_WIN32) class ReqRepAsReliableHelloWorldRequester : public ReqRepHelloWorldRequester { @@ -37,7 +37,7 @@ class ReqRepAsReliableHelloWorldRequester : public ReqRepHelloWorldRequester void configDatareader( const std::string& suffix) override { - datareader_qos_.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + datareader_qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; std::ostringstream t; @@ -49,7 +49,7 @@ class ReqRepAsReliableHelloWorldRequester : public ReqRepHelloWorldRequester void configDatawriter( const std::string& suffix) override { - datawriter_qos_.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + datawriter_qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some // big CPU overhead sometimes @@ -64,7 +64,7 @@ class ReqRepAsReliableHelloWorldRequester : public ReqRepHelloWorldRequester } ReqRepAsReliableHelloWorldRequester& durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) + const eprosima::fastdds::dds::DurabilityQosPolicyKind kind) { datawriter_qos_.durability().kind = kind; datareader_qos_.durability().kind = kind; diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp index 6aa9b77f5e4..fd4e40d97ee 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldReplier.cpp @@ -97,7 +97,7 @@ void ReqRepHelloWorldReplier::init() // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); configDatareader("Request"); request_topic_ = participant_->create_topic(datareader_topicname_, @@ -193,7 +193,7 @@ void ReqRepHelloWorldReplier::ReplyListener::on_data_available( HelloWorld hello; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp index 67120847944..59488b21a26 100644 --- a/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp +++ b/test/blackbox/api/dds-pim/ReqRepHelloWorldRequester.cpp @@ -95,7 +95,7 @@ void ReqRepHelloWorldRequester::init() // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), eprosima::fastdds::dds::RETCODE_OK); reply_subscriber_ = participant_->create_subscriber(eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(reply_subscriber_, nullptr); @@ -217,7 +217,7 @@ void ReqRepHelloWorldRequester::ReplyListener::on_data_available( HelloWorld hello; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp index 67e3c66dccc..a86f33ac70e 100644 --- a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp +++ b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldReplier.cpp @@ -24,18 +24,14 @@ #include #include #include - #include #include - #include - #include #include - #include #include -#include +#include #include @@ -106,11 +102,11 @@ void TCPReqRepHelloWorldReplier::init( std::shared_ptr descriptor; if (use_ipv6) { - descriptor = std::make_shared(); + descriptor = std::make_shared(); } else { - descriptor = std::make_shared(); + descriptor = std::make_shared(); } descriptor->sendBufferSize = 0; @@ -123,8 +119,8 @@ void TCPReqRepHelloWorldReplier::init( if (certs_folder != nullptr) { - using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; - using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; + using TLSOptions = eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions; + using TLSVerifyMode = eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode; descriptor->apply_security = true; descriptor->tls_config.password = "testkey"; descriptor->tls_config.cert_chain_file = std::string(certs_folder) + "/mainsubcert.pem"; @@ -145,7 +141,7 @@ void TCPReqRepHelloWorldReplier::init( // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), RETCODE_OK); configDatareader("Request"); request_topic_ = participant_->create_topic(datareader_topicname_, @@ -283,7 +279,7 @@ void TCPReqRepHelloWorldReplier::ReplyListener::on_data_available( HelloWorld hello; SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp index 7cf5a84f4e1..f3674828620 100644 --- a/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp +++ b/test/blackbox/api/dds-pim/TCPReqRepHelloWorldRequester.cpp @@ -23,19 +23,15 @@ #include #include #include - #include #include - #include - #include #include - #include #include -#include -#include +#include +#include #include @@ -150,11 +146,11 @@ void TCPReqRepHelloWorldRequester::init( std::shared_ptr descriptor; if (use_ipv6) { - descriptor = std::make_shared(); + descriptor = std::make_shared(); } else { - descriptor = std::make_shared(); + descriptor = std::make_shared(); } if (maxInitialPeer > 0) @@ -164,8 +160,8 @@ void TCPReqRepHelloWorldRequester::init( if (certs_folder != nullptr) { - using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; - using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; + using TLSOptions = eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions; + using TLSVerifyMode = eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode; descriptor->apply_security = true; //descriptor->tls_config.password = "testkey"; descriptor->tls_config.verify_file = std::string(certs_folder) + "/maincacert.pem"; @@ -189,7 +185,7 @@ void TCPReqRepHelloWorldRequester::init( // Register type type_.reset(new HelloWorldPubSubType()); - ASSERT_EQ(participant_->register_type(type_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->register_type(type_), RETCODE_OK); //Create subscriber reply_subscriber_ = participant_->create_subscriber(eprosima::fastdds::dds::SUBSCRIBER_QOS_DEFAULT); @@ -311,7 +307,7 @@ void TCPReqRepHelloWorldRequester::ReplyListener::on_data_available( HelloWorld hello; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) + if (RETCODE_OK == datareader->take_next_sample((void*)&hello, &info)) { if (info.valid_data) { diff --git a/test/blackbox/api/fastrtps_deprecated/PubSubParticipant.hpp b/test/blackbox/api/fastrtps_deprecated/PubSubParticipant.hpp deleted file mode 100644 index 3131dc4efd5..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/PubSubParticipant.hpp +++ /dev/null @@ -1,678 +0,0 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PubSubParticipant.hpp - * - */ - -#ifndef _TEST_BLACKBOX_PUBSUBPARTICIPANT_HPP_ -#define _TEST_BLACKBOX_PUBSUBPARTICIPANT_HPP_ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -/** - * @brief A class with one participant that can have multiple publishers and subscribers - */ -template -class PubSubParticipant -{ - class PubListener : public PublisherListener - { - friend class PubSubParticipant; - - public: - - PubListener( - PubSubParticipant* participant) - : participant_(participant) - { - } - - ~PubListener() - { - } - - void onPublicationMatched( - Publisher* pub, - rtps::MatchingInfo& info) override - { - (void)pub; - (info.status == rtps::MATCHED_MATCHING) ? participant_->pub_matched() : participant_->pub_unmatched(); - } - - void on_liveliness_lost( - Publisher* pub, - const LivelinessLostStatus& status) override - { - (void)pub; - (void)status; - participant_->pub_liveliness_lost(); - } - - private: - - PubListener& operator =( - const PubListener&) = delete; - //! A pointer to the participant - PubSubParticipant* participant_; - }; - - class SubListener : public SubscriberListener - { - friend class PubSubParticipant; - - public: - - SubListener( - PubSubParticipant* participant) - : participant_(participant) - { - } - - ~SubListener() - { - } - - void onSubscriptionMatched( - Subscriber* sub, - rtps::MatchingInfo& info) override - { - (void)sub; - (info.status == rtps::MATCHED_MATCHING) ? participant_->sub_matched() : participant_->sub_unmatched(); - } - - void on_liveliness_changed( - Subscriber* sub, - const LivelinessChangedStatus& status) override - { - (void)sub; - (status.alive_count_change == - 1) ? participant_->sub_liveliness_recovered() : participant_->sub_liveliness_lost(); - - } - - private: - - SubListener& operator =( - const SubListener&) = delete; - //! A pointer to the participant - PubSubParticipant* participant_; - }; - -public: - - typedef TypeSupport type_support; - typedef typename type_support::type type; - - PubSubParticipant( - unsigned int num_publishers, - unsigned int num_subscribers, - unsigned int num_expected_publishers, - unsigned int num_expected_subscribers) - : participant_(nullptr) - , participant_attr_() - , num_publishers_(num_publishers) - , num_subscribers_(num_subscribers) - , num_expected_subscribers_(num_expected_subscribers) - , num_expected_publishers_(num_expected_publishers) - , publishers_(num_publishers) - , subscribers_(num_subscribers) - , publisher_attr_() - , pub_listener_(this) - , sub_listener_(this) - , pub_matched_(0) - , sub_matched_(0) - , pub_times_liveliness_lost_(0) - , sub_times_liveliness_lost_(0) - , sub_times_liveliness_recovered_(0) - { - -#if defined(PREALLOCATED_MEMORY_MODE_TEST) - publisher_attr_.historyMemoryPolicy = rtps::PREALLOCATED_MEMORY_MODE; -#elif defined(DYNAMIC_RESERVE_MEMORY_MODE_TEST) - publisher_attr_.historyMemoryPolicy = rtps::DYNAMIC_RESERVE_MEMORY_MODE; -#else - publisher_attr_.historyMemoryPolicy = rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; -#endif // if defined(PREALLOCATED_WITH_REALLOC_MEMORY_MODE_TEST) - - // By default, heartbeat period and nack response delay are 100 milliseconds. - publisher_attr_.times.heartbeatPeriod.seconds = 0; - publisher_attr_.times.heartbeatPeriod.nanosec = 100000000; - publisher_attr_.times.nackResponseDelay.seconds = 0; - publisher_attr_.times.nackResponseDelay.nanosec = 100000000; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - publisher_attr_.qos.m_reliability.max_blocking_time.seconds = 1; - publisher_attr_.qos.m_reliability.max_blocking_time.nanosec = 0; - - // By default, heartbeat period delay is 100 milliseconds. - subscriber_attr_.times.heartbeatResponseDelay = 0.1; - } - - ~PubSubParticipant() - { - if (participant_ != nullptr) - { - Domain::removeParticipant(participant_); - participant_ = nullptr; - } - } - - bool init_participant() - { - participant_attr_.domainId = (uint32_t)GET_PID() % 230; - participant_ = Domain::createParticipant(participant_attr_); - if (participant_ != nullptr) - { - Domain::registerType(participant_, &type_); - return true; - } - return false; - } - - bool init_publisher( - unsigned int index) - { - if (participant_ == nullptr) - { - return false; - } - if (index >= num_publishers_) - { - return false; - } - - auto pub = Domain::createPublisher(participant_, publisher_attr_, &pub_listener_); - if (pub != nullptr) - { - publishers_[index] = pub; - return true; - } - return false; - } - - bool init_subscriber( - unsigned int index) - { - if (index >= num_subscribers_) - { - return false; - } - auto subscriber = Domain::createSubscriber(participant_, subscriber_attr_, &sub_listener_); - if (subscriber != nullptr) - { - subscribers_[index] = subscriber; - return true; - } - return false; - } - - eprosima::fastrtps::Publisher& get_native_writer( - unsigned int index) - { - return *(publishers_[index]); - } - - eprosima::fastrtps::Subscriber& get_native_reader( - unsigned int index) - { - return *(subscribers_[index]); - } - - bool send_sample( - type& msg, - unsigned int index = 0) - { - return publishers_[index]->write((void*)&msg); - } - - void assert_liveliness_participant() - { - participant_->assert_liveliness(); - } - - void assert_liveliness( - unsigned int index = 0) - { - publishers_[index]->assert_liveliness(); - } - - void pub_wait_discovery( - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(pub_mutex_); - - std::cout << "Publisher is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - pub_cv_.wait(lock, [&]() - { - return pub_matched_ == num_expected_publishers_; - }); - } - else - { - pub_cv_.wait_for(lock, timeout, [&]() - { - return pub_matched_ == num_expected_publishers_; - }); - } - - std::cout << "Publisher discovery finished " << std::endl; - } - - void pub_wait_discovery( - unsigned int expected_match, - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(pub_mutex_); - - std::cout << "Publisher is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - pub_cv_.wait(lock, [&]() - { - return pub_matched_ == expected_match; - }); - } - else - { - pub_cv_.wait_for(lock, timeout, [&]() - { - return pub_matched_ == expected_match; - }); - } - - std::cout << "Publisher discovery finished " << std::endl; - } - - void sub_wait_discovery( - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(sub_mutex_); - - std::cout << "Subscriber is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - sub_cv_.wait(lock, [&]() - { - return sub_matched_ == num_expected_subscribers_; - }); - } - else - { - sub_cv_.wait_for(lock, timeout, [&]() - { - return sub_matched_ == num_expected_subscribers_; - }); - } - - std::cout << "Subscriber discovery finished " << std::endl; - } - - void sub_wait_discovery( - unsigned int expected_match, - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(sub_mutex_); - - std::cout << "Subscriber is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - sub_cv_.wait(lock, [&]() - { - return sub_matched_ == expected_match; - }); - } - else - { - sub_cv_.wait_for(lock, timeout, [&]() - { - return sub_matched_ == expected_match; - }); - } - - std::cout << "Subscriber discovery finished " << std::endl; - } - - void pub_wait_liveliness_lost( - unsigned int times = 1) - { - std::unique_lock lock(pub_liveliness_mutex_); - pub_liveliness_cv_.wait(lock, [&]() - { - return pub_times_liveliness_lost_ >= times; - }); - } - - void sub_wait_liveliness_recovered( - unsigned int num_recovered) - { - std::unique_lock lock(sub_liveliness_mutex_); - sub_liveliness_cv_.wait(lock, [&]() - { - return sub_times_liveliness_recovered_ >= num_recovered; - }); - } - - void sub_wait_liveliness_lost( - unsigned int num_lost) - { - std::unique_lock lock(sub_liveliness_mutex_); - sub_liveliness_cv_.wait(lock, [&]() - { - return sub_times_liveliness_lost_ >= num_lost; - }); - } - - template - size_t sub_wait_liveliness_lost_for( - unsigned int expected_num_lost, - const std::chrono::duration<_Rep, _Period>& max_wait) - { - std::unique_lock lock(sub_liveliness_mutex_); - sub_liveliness_cv_.wait_for(lock, max_wait, [this, &expected_num_lost]() -> bool - { - return sub_times_liveliness_lost_ >= expected_num_lost; - }); - - return sub_times_liveliness_lost_; - } - - PubSubParticipant& property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - participant_attr_.rtps.properties = property_policy; - return *this; - } - - PubSubParticipant& disable_builtin_transport() - { - participant_attr_.rtps.useBuiltinTransports = false; - return *this; - } - - PubSubParticipant& add_user_transport_to_pparams( - std::shared_ptr userTransportDescriptor) - { - participant_attr_.rtps.userTransports.push_back(userTransportDescriptor); - return *this; - } - - PubSubParticipant& pub_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - publisher_attr_.properties = property_policy; - return *this; - } - - PubSubParticipant& sub_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - subscriber_attr_.properties = property_policy; - return *this; - } - - PubSubParticipant& pub_topic_name( - std::string topicName) - { - // Generate topic name - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << GET_PID(); - publisher_attr_.topic.topicName = t.str(); - publisher_attr_.topic.topicDataType = type_.getName(); - return *this; - } - - PubSubParticipant& sub_topic_name( - std::string topicName) - { - // Generate topic name - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << GET_PID(); - subscriber_attr_.topic.topicName = t.str(); - subscriber_attr_.topic.topicDataType = type_.getName(); - return *this; - } - - PubSubParticipant& reliability( - const ReliabilityQosPolicyKind kind) - { - publisher_attr_.qos.m_reliability.kind = kind; - subscriber_attr_.qos.m_reliability.kind = kind; - return *this; - } - - PubSubParticipant& pub_liveliness_kind( - const LivelinessQosPolicyKind kind) - { - publisher_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubParticipant& pub_liveliness_lease_duration( - const Duration_t lease_duration) - { - publisher_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - PubSubParticipant& pub_liveliness_announcement_period( - const Duration_t announcement_period) - { - publisher_attr_.qos.m_liveliness.announcement_period = announcement_period; - return *this; - } - - PubSubParticipant& sub_liveliness_kind( - const LivelinessQosPolicyKind& kind) - { - subscriber_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubParticipant& sub_liveliness_lease_duration( - const Duration_t lease_duration) - { - subscriber_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - PubSubParticipant& pub_deadline_period( - const Duration_t& deadline_period) - { - publisher_attr_.qos.m_deadline.period = deadline_period; - return *this; - } - - PubSubParticipant& sub_deadline_period( - const Duration_t& deadline_period) - { - subscriber_attr_.qos.m_deadline.period = deadline_period; - return *this; - } - - bool sub_update_deadline_period( - const Duration_t& deadline_period, - unsigned int index) - { - if (index >= num_subscribers_) - { - return false; - } - if (subscribers_[index] == nullptr) - { - return false; - } - - SubscriberAttributes attr; - attr = subscriber_attr_; - attr.qos.m_deadline.period = deadline_period; - - return subscribers_[index]->updateAttributes(attr); - } - - void pub_liveliness_lost() - { - std::unique_lock lock(pub_liveliness_mutex_); - pub_times_liveliness_lost_++; - pub_liveliness_cv_.notify_one(); - } - - void sub_liveliness_lost() - { - std::unique_lock lock(sub_liveliness_mutex_); - sub_times_liveliness_lost_++; - sub_liveliness_cv_.notify_one(); - } - - void sub_liveliness_recovered() - { - std::unique_lock lock(sub_liveliness_mutex_); - sub_times_liveliness_recovered_++; - sub_liveliness_cv_.notify_one(); - } - - unsigned int pub_times_liveliness_lost() - { - std::unique_lock lock(pub_liveliness_mutex_); - return pub_times_liveliness_lost_; - } - - unsigned int sub_times_liveliness_lost() - { - std::unique_lock lock(sub_liveliness_mutex_); - return sub_times_liveliness_lost_; - } - - unsigned int sub_times_liveliness_recovered() - { - std::unique_lock lock(sub_liveliness_mutex_); - return sub_times_liveliness_recovered_; - } - -private: - - PubSubParticipant& operator =( - const PubSubParticipant&) = delete; - - void pub_matched() - { - std::unique_lock lock(pub_mutex_); - ++pub_matched_; - pub_cv_.notify_one(); - } - - void pub_unmatched() - { - std::unique_lock lock(pub_mutex_); - --pub_matched_; - pub_cv_.notify_one(); - } - - void sub_matched() - { - std::unique_lock lock(sub_mutex_); - ++sub_matched_; - sub_cv_.notify_one(); - } - - void sub_unmatched() - { - std::unique_lock lock(sub_mutex_); - --sub_matched_; - sub_cv_.notify_one(); - } - - //! The participant - Participant* participant_; - //! Participant attributes - ParticipantAttributes participant_attr_; - //! Number of publishers in this participant - unsigned int num_publishers_; - //! Number of subscribers in this participant - unsigned int num_subscribers_; - //! Number of expected subscribers to match - unsigned int num_expected_subscribers_; - //! Number of expected subscribers to match - unsigned int num_expected_publishers_; - //! A vector of publishers - std::vector publishers_; - //! A vector of subscribers - std::vector subscribers_; - //! Publisher attributes - PublisherAttributes publisher_attr_; - //! Subscriber attributes - SubscriberAttributes subscriber_attr_; - //! A listener for publishers - PubListener pub_listener_; - //! A listener for subscribers - SubListener sub_listener_; - - std::mutex pub_mutex_; - std::mutex sub_mutex_; - std::condition_variable pub_cv_; - std::condition_variable sub_cv_; - std::atomic pub_matched_; - std::atomic sub_matched_; - - //! Number of times liveliness was lost on the publishing side - unsigned int pub_times_liveliness_lost_; - //! The number of times liveliness was lost on the subscribing side - unsigned int sub_times_liveliness_lost_; - //! The number of times liveliness was recovered on the subscribing side - unsigned int sub_times_liveliness_recovered_; - //! A mutex protecting liveliness data - std::mutex sub_liveliness_mutex_; - //! A condition variable for liveliness data - std::condition_variable sub_liveliness_cv_; - //! A mutex protecting liveliness of publisher - std::mutex pub_liveliness_mutex_; - //! A condition variable for liveliness of publisher - std::condition_variable pub_liveliness_cv_; - - type_support type_; -}; - -} // namespace fastrtps -} // namespace eprosima - -#endif // _TEST_BLACKBOX_PUBSUBPARTICIPANT_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/PubSubReader.hpp b/test/blackbox/api/fastrtps_deprecated/PubSubReader.hpp deleted file mode 100644 index 2297ab359a0..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/PubSubReader.hpp +++ /dev/null @@ -1,1584 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PubSubReader.hpp - * - */ - -#ifndef _TEST_BLACKBOX_PUBSUBREADER_HPP_ -#define _TEST_BLACKBOX_PUBSUBREADER_HPP_ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using eprosima::fastrtps::rtps::IPLocator; -using eprosima::fastrtps::rtps::UDPTransportDescriptor; -using eprosima::fastrtps::rtps::UDPv4TransportDescriptor; -using eprosima::fastrtps::rtps::UDPv6TransportDescriptor; - -template -class PubSubReader -{ -public: - - typedef TypeSupport type_support; - typedef typename type_support::type type; - -private: - - class ParticipantListener : public eprosima::fastrtps::ParticipantListener - { - public: - - ParticipantListener( - PubSubReader& reader) - : reader_(reader) - { - } - - ~ParticipantListener() - { - } - - void onParticipantDiscovery( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override - { - if (reader_.onDiscovery_ != nullptr) - { - std::unique_lock lock(reader_.mutexDiscovery_); - reader_.discovery_result_ |= reader_.onDiscovery_(info); - reader_.cvDiscovery_.notify_one(); - } - - if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) - { - reader_.participant_matched(); - - } - else if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT || - info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) - { - reader_.participant_unmatched(); - } - } - - void onPublisherDiscovery( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override - { - if (reader_.onEndpointDiscovery_ != nullptr) - { - std::unique_lock lock(reader_.mutexDiscovery_); - reader_.discovery_result_ |= reader_.onEndpointDiscovery_(info); - reader_.cvDiscovery_.notify_one(); - } - } - -#if HAVE_SECURITY - void onParticipantAuthentication( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ParticipantAuthenticationInfo&& info) override - { - if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::AUTHORIZED_PARTICIPANT) - { - reader_.authorized(); - } - else if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::UNAUTHORIZED_PARTICIPANT) - { - reader_.unauthorized(); - } - } - -#endif // if HAVE_SECURITY - - private: - - ParticipantListener& operator =( - const ParticipantListener&) = delete; - PubSubReader& reader_; - - } - participant_listener_; - - class Listener : public eprosima::fastrtps::SubscriberListener - { - public: - - Listener( - PubSubReader& reader) - : reader_(reader) - , times_deadline_missed_(0) - { - } - - ~Listener() - { - } - - void onNewDataMessage( - eprosima::fastrtps::Subscriber* sub) override - { - ASSERT_NE(sub, nullptr); - reader_.message_receive_count_.fetch_add(1); - reader_.message_receive_cv_.notify_one(); - - if (reader_.receiving_.load()) - { - bool ret = false; - do - { - reader_.receive_one(sub, ret); - } while (ret); - } - } - - void onSubscriptionMatched( - eprosima::fastrtps::Subscriber* /*sub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) override - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - std::cout << "Subscriber matched publisher " << info.remoteEndpointGuid << std::endl; - reader_.matched(); - } - else - { - std::cout << "Subscriber unmatched publisher " << info.remoteEndpointGuid << std::endl; - reader_.unmatched(); - } - } - - void on_requested_deadline_missed( - eprosima::fastrtps::Subscriber* sub, - const eprosima::fastrtps::RequestedDeadlineMissedStatus& status) override - { - (void)sub; - - times_deadline_missed_ = status.total_count; - } - - void on_liveliness_changed( - eprosima::fastrtps::Subscriber* sub, - const eprosima::fastrtps::LivelinessChangedStatus& status) override - { - (void)sub; - - reader_.set_liveliness_changed_status(status); - - if (status.alive_count_change == 1) - { - reader_.liveliness_recovered(); - - } - else if (status.not_alive_count_change == 1) - { - reader_.liveliness_lost(); - - } - } - - unsigned int missed_deadlines() const - { - return times_deadline_missed_; - } - - private: - - Listener& operator =( - const Listener&) = delete; - - PubSubReader& reader_; - - //! Number of times deadline was missed - unsigned int times_deadline_missed_; - - } - listener_; - - friend class Listener; - -public: - - PubSubReader( - const std::string& topic_name, - bool take = true) - : participant_listener_(*this) - , listener_(*this) - , participant_(nullptr) - , subscriber_(nullptr) - , topic_name_(topic_name) - , initialized_(false) - , matched_(0) - , participant_matched_(0) - , receiving_(false) - , current_processed_count_(0) - , number_samples_expected_(0) - , discovery_result_(false) - , onDiscovery_(nullptr) - , onEndpointDiscovery_(nullptr) - , take_(take) -#if HAVE_SECURITY - , authorized_(0) - , unauthorized_(0) -#endif // if HAVE_SECURITY - , liveliness_mutex_() - , liveliness_cv_() - , times_liveliness_lost_(0) - , times_liveliness_recovered_(0) - , message_receive_count_(0) - { - subscriber_attr_.topic.topicDataType = type_.getName(); - // Generate topic name - std::ostringstream t; - t << topic_name_ << "_" << asio::ip::host_name() << "_" << GET_PID(); - subscriber_attr_.topic.topicName = t.str(); - subscriber_attr_.topic.topicKind = - type_.m_isGetKeyDefined ? ::eprosima::fastrtps::rtps::WITH_KEY : ::eprosima::fastrtps::rtps::NO_KEY; - - // By default, memory mode is PREALLOCATED_WITH_REALLOC_MEMORY_MODE - subscriber_attr_.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - - // By default, heartbeat period delay is 100 milliseconds. - subscriber_attr_.times.heartbeatResponseDelay.seconds = 0; - subscriber_attr_.times.heartbeatResponseDelay.nanosec = 100000000; - } - - ~PubSubReader() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - } - } - - eprosima::fastrtps::Subscriber& get_native_reader() const - { - return *subscriber_; - } - - void init() - { - //Create participant - // Use local copies of attributes to catch #6507 issues with valgrind - eprosima::fastrtps::ParticipantAttributes participant_attr; - eprosima::fastrtps::SubscriberAttributes subscriber_attr; - - if (!xml_file_.empty()) - { - eprosima::fastrtps::Domain::loadXMLProfilesFile(xml_file_); - if (!participant_profile_.empty()) - { - // Need to specify ID in XML - participant_ = eprosima::fastrtps::Domain::createParticipant(participant_profile_, - &participant_listener_); - ASSERT_NE(participant_, nullptr); - participant_attr = participant_->getAttributes(); - subscriber_attr = subscriber_attr_; - } - } - if (participant_ == nullptr) - { - participant_attr_.domainId = (uint32_t)GET_PID() % 230; - - participant_attr = participant_attr_; - subscriber_attr = subscriber_attr_; - - participant_ = eprosima::fastrtps::Domain::createParticipant(participant_attr, &participant_listener_); - } - - if (participant_ != nullptr) - { - participant_guid_ = participant_->getGuid(); - - // Register type - ASSERT_EQ(eprosima::fastrtps::Domain::registerType(participant_, &type_), true); - - //Create subscribe r - subscriber_ = eprosima::fastrtps::Domain::createSubscriber(participant_, subscriber_attr, &listener_); - - if (subscriber_ != nullptr) - { - subscriber_guid_ = subscriber_->getGuid(); - std::cout << "Created subscriber " << subscriber_guid_ << " for topic " << - subscriber_attr_.topic.topicName << std::endl; - - initialized_ = true; - } - } - } - - bool isInitialized() const - { - return initialized_; - } - - void destroy() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - participant_ = nullptr; - } - - initialized_ = false; - } - - std::list data_not_received() - { - std::unique_lock lock(mutex_); - return total_msgs_; - } - - void startReception( - const std::list& msgs) - { - mutex_.lock(); - total_msgs_ = msgs; - number_samples_expected_ = total_msgs_.size(); - current_processed_count_ = 0; - last_seq.clear(); - mutex_.unlock(); - - bool ret = false; - do - { - receive_one(subscriber_, ret); - } - while (ret); - - receiving_.store(true); - } - - void stopReception() - { - receiving_.store(false); - } - - template - bool wait_for_all_received( - const std::chrono::duration<_Rep, _Period>& max_wait, - size_t num_messages = 0) - { - if (num_messages == 0) - { - num_messages = number_samples_expected_; - } - std::unique_lock lock(message_receive_mutex_); - return message_receive_cv_.wait_for(lock, max_wait, [this, num_messages]() -> bool - { - return num_messages == message_receive_count_; - }); - } - - void block_for_all() - { - block([this]() -> bool - { - return number_samples_expected_ == current_processed_count_; - }); - } - - void block_for_seq( - eprosima::fastrtps::rtps::SequenceNumber_t seq) - { - block([this, seq]() -> bool - { - return get_last_sequence_received() == seq; - }); - } - - size_t block_for_at_least( - size_t at_least) - { - size_t read_count_locked; // solves TSan data race - block([this, &read_count_locked, at_least]() -> bool - { - read_count_locked = current_processed_count_; - return current_processed_count_ >= at_least; - }); - return read_count_locked; - } - - void block( - std::function checker) - { - std::unique_lock lock(mutex_); - cv_.wait(lock, checker); - } - - template - size_t block_for_all( - const std::chrono::duration<_Rep, _Period>& max_wait) - { - std::unique_lock lock(mutex_); - cv_.wait_for(lock, max_wait, [this]() -> bool - { - return number_samples_expected_ == current_processed_count_; - }); - - return current_processed_count_; - } - - void wait_discovery( - std::chrono::seconds timeout = std::chrono::seconds::zero(), - unsigned int min_writers = 1) - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Reader is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cvDiscovery_.wait(lock, [&]() - { - return matched_ >= min_writers; - }); - } - else - { - cvDiscovery_.wait_for(lock, timeout, [&]() - { - return matched_ >= min_writers; - }); - } - - std::cout << "Reader discovery finished..." << std::endl; - } - - bool wait_participant_discovery( - unsigned int min_participants = 1, - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - bool ret_value = true; - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Reader is waiting discovery of at least " << min_participants << " participants..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cvDiscovery_.wait(lock, [&]() - { - return participant_matched_ >= min_participants; - }); - } - else - { - if (!cvDiscovery_.wait_for(lock, timeout, [&]() - { - return participant_matched_ >= min_participants; - })) - { - ret_value = false; - } - } - - if (ret_value) - { - std::cout << "Reader participant discovery finished successfully..." << std::endl; - } - else - { - std::cout << "Reader participant discovery finished unsuccessfully..." << std::endl; - } - - return ret_value; - } - - bool wait_participant_undiscovery( - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - bool ret_value = true; - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Reader is waiting undiscovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cvDiscovery_.wait(lock, [&]() - { - return participant_matched_ == 0; - }); - } - else - { - if (!cvDiscovery_.wait_for(lock, timeout, [&]() - { - return participant_matched_ == 0; - })) - { - ret_value = false; - } - } - - if (ret_value) - { - std::cout << "Reader undiscovery finished successfully..." << std::endl; - } - else - { - std::cout << "Reader undiscovery finished unsuccessfully..." << std::endl; - } - - return ret_value; - } - - void wait_writer_undiscovery( - unsigned int matched = 0) - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Reader is waiting removal..." << std::endl; - - cvDiscovery_.wait(lock, [&]() - { - return matched_ <= matched; - }); - - std::cout << "Reader removal finished..." << std::endl; - } - - void wait_liveliness_recovered( - unsigned int times = 1) - { - std::unique_lock lock(liveliness_mutex_); - - liveliness_cv_.wait(lock, [&]() - { - return times_liveliness_recovered_ >= times; - }); - } - - void wait_liveliness_lost( - unsigned int times = 1) - { - std::unique_lock lock(liveliness_mutex_); - - liveliness_cv_.wait(lock, [&]() - { - return times_liveliness_lost_ >= times; - }); - } - -#if HAVE_SECURITY - void waitAuthorized() - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "Reader is waiting authorization..." << std::endl; - - cvAuthentication_.wait(lock, [&]() -> bool - { - return authorized_ > 0; - }); - - std::cout << "Reader authorization finished..." << std::endl; - } - - void waitUnauthorized() - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "Reader is waiting unauthorization..." << std::endl; - - cvAuthentication_.wait(lock, [&]() -> bool - { - return unauthorized_ > 0; - }); - - std::cout << "Reader unauthorization finished..." << std::endl; - } - -#endif // if HAVE_SECURITY - - size_t getReceivedCount() const - { - return current_processed_count_; - } - - eprosima::fastrtps::rtps::SequenceNumber_t get_last_sequence_received() - { - if (last_seq.empty()) - { - return eprosima::fastrtps::rtps::SequenceNumber_t(); - } - - using pair_type = typename decltype(last_seq)::value_type; - auto seq_comp = [](const pair_type& v1, const pair_type& v2) -> bool - { - return v1.second < v2.second; - }; - return std::max_element(last_seq.cbegin(), last_seq.cend(), seq_comp)->second; - } - - /*** Function to change QoS ***/ - PubSubReader& reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) - { - subscriber_attr_.qos.m_reliability.kind = kind; - return *this; - } - - PubSubReader& mem_policy( - const eprosima::fastrtps::rtps::MemoryManagementPolicy mem_policy) - { - subscriber_attr_.historyMemoryPolicy = mem_policy; - return *this; - } - - PubSubReader& deadline_period( - const eprosima::fastrtps::Duration_t deadline_period) - { - subscriber_attr_.qos.m_deadline.period = deadline_period; - return *this; - } - - bool update_deadline_period( - const eprosima::fastrtps::Duration_t& deadline_period) - { - eprosima::fastrtps::SubscriberAttributes attr; - attr = subscriber_attr_; - attr.qos.m_deadline.period = deadline_period; - - return subscriber_->updateAttributes(attr); - } - - PubSubReader& liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind& kind) - { - subscriber_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubReader& liveliness_lease_duration( - const eprosima::fastrtps::Duration_t lease_duration) - { - subscriber_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - PubSubReader& latency_budget_duration( - const eprosima::fastrtps::Duration_t& latency_duration) - { - subscriber_attr_.qos.m_latencyBudget.duration = latency_duration; - return *this; - } - - eprosima::fastrtps::Duration_t get_latency_budget_duration() - { - return subscriber_attr_.qos.m_latencyBudget.duration; - } - - PubSubReader& lifespan_period( - const eprosima::fastrtps::Duration_t lifespan_period) - { - subscriber_attr_.qos.m_lifespan.duration = lifespan_period; - return *this; - } - - PubSubReader& keep_duration( - const eprosima::fastrtps::Duration_t duration) - { - subscriber_attr_.qos.m_disablePositiveACKs.enabled = true; - subscriber_attr_.qos.m_disablePositiveACKs.duration = duration; - return *this; - } - - PubSubReader& history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) - { - subscriber_attr_.topic.historyQos.kind = kind; - return *this; - } - - PubSubReader& history_depth( - const int32_t depth) - { - subscriber_attr_.topic.historyQos.depth = depth; - return *this; - } - - PubSubReader& setup_transports( - eprosima::fastdds::rtps::BuiltinTransports transports) - { - participant_attr_.rtps.setup_transports(transports); - return *this; - } - - PubSubReader& setup_transports( - eprosima::fastdds::rtps::BuiltinTransports transports, - const eprosima::fastdds::rtps::BuiltinTransportsOptions& options) - { - participant_attr_.rtps.setup_transports(transports, options); - return *this; - } - - PubSubReader& setup_large_data_tcp( - bool v6 = false, - const uint16_t& port = 0, - const uint32_t& tcp_negotiation_timeout = 0) - { - participant_attr_.rtps.useBuiltinTransports = false; - - /* Transports configuration */ - // UDP transport for PDP over multicast - // TCP transport for EDP and application data (The listening port must to be unique for - // each participant in the same host) - uint16_t tcp_listening_port = port; - if (v6) - { - auto pdp_transport = std::make_shared(); - participant_attr_.rtps.userTransports.push_back(pdp_transport); - - auto data_transport = std::make_shared(); - data_transport->add_listener_port(tcp_listening_port); - data_transport->calculate_crc = false; - data_transport->check_crc = false; - data_transport->apply_security = false; - data_transport->enable_tcp_nodelay = true; - data_transport->tcp_negotiation_timeout = tcp_negotiation_timeout; - participant_attr_.rtps.userTransports.push_back(data_transport); - } - else - { - auto pdp_transport = std::make_shared(); - participant_attr_.rtps.userTransports.push_back(pdp_transport); - - auto data_transport = std::make_shared(); - data_transport->add_listener_port(tcp_listening_port); - data_transport->calculate_crc = false; - data_transport->check_crc = false; - data_transport->apply_security = false; - data_transport->enable_tcp_nodelay = true; - data_transport->tcp_negotiation_timeout = tcp_negotiation_timeout; - participant_attr_.rtps.userTransports.push_back(data_transport); - } - - /* Locators */ - eprosima::fastrtps::rtps::Locator_t pdp_locator; - eprosima::fastrtps::rtps::Locator_t tcp_locator; - if (v6) - { - // Define locator for PDP over multicast - pdp_locator.kind = LOCATOR_KIND_UDPv6; - eprosima::fastrtps::rtps::IPLocator::setIPv6(pdp_locator, "ff1e::ffff:efff:1"); - // Define locator for EDP and user data - tcp_locator.kind = LOCATOR_KIND_TCPv6; - eprosima::fastrtps::rtps::IPLocator::setIPv6(tcp_locator, "::"); - eprosima::fastrtps::rtps::IPLocator::setPhysicalPort(tcp_locator, tcp_listening_port); - eprosima::fastrtps::rtps::IPLocator::setLogicalPort(tcp_locator, 0); - } - else - { - // Define locator for PDP over multicast - pdp_locator.kind = LOCATOR_KIND_UDPv4; - eprosima::fastrtps::rtps::IPLocator::setIPv4(pdp_locator, "239.255.0.1"); - // Define locator for EDP and user data - tcp_locator.kind = LOCATOR_KIND_TCPv4; - eprosima::fastrtps::rtps::IPLocator::setIPv4(tcp_locator, "0.0.0.0"); - eprosima::fastrtps::rtps::IPLocator::setPhysicalPort(tcp_locator, tcp_listening_port); - eprosima::fastrtps::rtps::IPLocator::setLogicalPort(tcp_locator, 0); - } - - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList.push_back(pdp_locator); - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList.push_back(tcp_locator); - participant_attr_.rtps.defaultUnicastLocatorList.push_back(tcp_locator); - - return *this; - } - - PubSubReader& disable_builtin_transport() - { - participant_attr_.rtps.useBuiltinTransports = false; - return *this; - } - - PubSubReader& add_user_transport_to_pparams( - std::shared_ptr userTransportDescriptor) - { - participant_attr_.rtps.userTransports.push_back(userTransportDescriptor); - return *this; - } - - PubSubReader& resource_limits_allocated_samples( - const int32_t initial) - { - subscriber_attr_.topic.resourceLimitsQos.allocated_samples = initial; - return *this; - } - - PubSubReader& resource_limits_max_samples( - const int32_t max) - { - subscriber_attr_.topic.resourceLimitsQos.max_samples = max; - return *this; - } - - PubSubReader& resource_limits_max_instances( - const int32_t max) - { - subscriber_attr_.topic.resourceLimitsQos.max_instances = max; - return *this; - } - - PubSubReader& resource_limits_max_samples_per_instance( - const int32_t max) - { - subscriber_attr_.topic.resourceLimitsQos.max_samples_per_instance = max; - return *this; - } - - PubSubReader& matched_writers_allocation( - size_t initial, - size_t maximum) - { - subscriber_attr_.matched_publisher_allocation.initial = initial; - subscriber_attr_.matched_publisher_allocation.maximum = maximum; - return *this; - } - - PubSubReader& expect_no_allocs() - { - // TODO(Mcc): Add no allocations check code when feature is completely ready - return *this; - } - - PubSubReader& expect_inline_qos( - bool expect) - { - subscriber_attr_.expectsInlineQos = expect; - return *this; - } - - PubSubReader& heartbeatResponseDelay( - const int32_t secs, - const int32_t frac) - { - subscriber_attr_.times.heartbeatResponseDelay.seconds = secs; - subscriber_attr_.times.heartbeatResponseDelay.fraction(frac); - return *this; - } - - PubSubReader& unicastLocatorList( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - subscriber_attr_.unicastLocatorList = unicastLocators; - return *this; - } - - PubSubReader& add_to_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - subscriber_attr_.unicastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& multicastLocatorList( - eprosima::fastrtps::rtps::LocatorList_t multicastLocators) - { - subscriber_attr_.multicastLocatorList = multicastLocators; - return *this; - } - - PubSubReader& add_to_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - subscriber_attr_.multicastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& metatraffic_unicast_locator_list( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList = unicastLocators; - return *this; - } - - PubSubReader& add_to_metatraffic_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& metatraffic_multicast_locator_list( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList = unicastLocators; - return *this; - } - - PubSubReader& add_to_metatraffic_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& set_default_unicast_locators( - const eprosima::fastrtps::rtps::LocatorList_t& locators) - { - participant_attr_.rtps.defaultUnicastLocatorList = locators; - return *this; - } - - PubSubReader& add_to_default_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.defaultUnicastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& set_default_multicast_locators( - const eprosima::fastrtps::rtps::LocatorList_t& locators) - { - participant_attr_.rtps.defaultMulticastLocatorList = locators; - return *this; - } - - PubSubReader& add_to_default_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.defaultMulticastLocatorList.push_back(loc); - - return *this; - } - - PubSubReader& initial_peers( - eprosima::fastrtps::rtps::LocatorList_t initial_peers) - { - participant_attr_.rtps.builtin.initialPeersList = initial_peers; - return *this; - } - - PubSubReader& ignore_participant_flags( - eprosima::fastrtps::rtps::ParticipantFilteringFlags_t flags) - { - participant_attr_.rtps.builtin.discovery_config.ignoreParticipantFlags = flags; - return *this; - } - - PubSubReader& socket_buffer_size( - uint32_t sockerBufferSize) - { - participant_attr_.rtps.listenSocketBufferSize = sockerBufferSize; - return *this; - } - - PubSubReader& durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) - { - subscriber_attr_.qos.m_durability.kind = kind; - return *this; - } - - PubSubReader& static_discovery( - const char* filename) - { - participant_attr_.rtps.builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = false; - participant_attr_.rtps.builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol = true; - participant_attr_.rtps.builtin.discovery_config.static_edp_xml_config(filename); - return *this; - } - - PubSubReader& use_writer_liveliness_protocol( - bool use_wlp) - { - participant_attr_.rtps.builtin.use_WriterLivelinessProtocol = use_wlp; - return *this; - } - - PubSubReader& setSubscriberIDs( - uint8_t UserID, - uint8_t EntityID) - { - subscriber_attr_.setUserDefinedID(UserID); - subscriber_attr_.setEntityID(EntityID); - return *this; - - } - - PubSubReader& setManualTopicName( - std::string topicName) - { - subscriber_attr_.topic.topicName = topicName; - return *this; - } - - PubSubReader& disable_multicast( - int32_t participantId) - { - participant_attr_.rtps.participantID = participantId; - - eprosima::fastrtps::rtps::LocatorList_t default_unicast_locators; - eprosima::fastrtps::rtps::Locator_t default_unicast_locator; - eprosima::fastrtps::rtps::Locator_t loopback_locator; - if (!use_udpv4) - { - default_unicast_locator.kind = LOCATOR_KIND_UDPv6; - loopback_locator.kind = LOCATOR_KIND_UDPv6; - } - - default_unicast_locators.push_back(default_unicast_locator); - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList = default_unicast_locators; - - if (!IPLocator::setIPv4(loopback_locator, 127, 0, 0, 1)) - { - IPLocator::setIPv6(loopback_locator, "::1"); - } - participant_attr_.rtps.builtin.initialPeersList.push_back(loopback_locator); - return *this; - } - - PubSubReader& avoid_builtin_multicast( - bool value) - { - participant_attr_.rtps.builtin.avoid_builtin_multicast = value; - return *this; - } - - PubSubReader& property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - participant_attr_.rtps.properties = property_policy; - return *this; - } - - PubSubReader& entity_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - subscriber_attr_.properties = property_policy; - return *this; - } - - PubSubReader& partition( - const std::string& partition) - { - subscriber_attr_.qos.m_partition.push_back(partition.c_str()); - return *this; - } - - PubSubReader& userData( - std::vector user_data) - { - participant_attr_.rtps.userData = user_data; - return *this; - } - - PubSubReader& lease_duration( - eprosima::fastrtps::Duration_t lease_duration, - eprosima::fastrtps::Duration_t announce_period) - { - participant_attr_.rtps.builtin.discovery_config.leaseDuration = lease_duration; - participant_attr_.rtps.builtin.discovery_config.leaseDuration_announcementperiod = announce_period; - return *this; - } - - PubSubReader& initial_announcements( - uint32_t count, - const eprosima::fastrtps::Duration_t& period) - { - participant_attr_.rtps.builtin.discovery_config.initial_announcements.count = count; - participant_attr_.rtps.builtin.discovery_config.initial_announcements.period = period; - return *this; - } - - PubSubReader& ownership_exclusive() - { - subscriber_attr_.qos.m_ownership.kind = eprosima::fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS; - return *this; - } - - PubSubReader& load_participant_attr( - const std::string& xml) - { - std::unique_ptr root; - if (eprosima::fastrtps::xmlparser::XMLParser::loadXML(xml.data(), xml.size(), - root) == eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK) - { - for (const auto& profile : root->getChildren()) - { - if (profile->getType() == eprosima::fastrtps::xmlparser::NodeType::PARTICIPANT) - { - participant_attr_ = - *(dynamic_cast - *>( - profile.get())->get()); - } - } - } - return *this; - } - - PubSubReader& load_subscriber_attr( - const std::string& xml) - { - std::unique_ptr root; - if (eprosima::fastrtps::xmlparser::XMLParser::loadXML(xml.data(), xml.size(), - root) == eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK) - { - for (const auto& profile : root->getChildren()) - { - if (profile->getType() == eprosima::fastrtps::xmlparser::NodeType::SUBSCRIBER) - { - subscriber_attr_ = - *(dynamic_cast - *>( - profile.get())->get()); - } - } - } - return *this; - } - - PubSubReader& max_initial_peers_range( - uint32_t maxInitialPeerRange) - { - participant_attr_.rtps.useBuiltinTransports = false; - std::shared_ptr descriptor; - if (use_udpv4) - { - descriptor = std::make_shared(); - } - else - { - descriptor = std::make_shared(); - } - descriptor->maxInitialPeersRange = maxInitialPeerRange; - participant_attr_.rtps.userTransports.push_back(descriptor); - return *this; - } - - PubSubReader& guid_prefix( - const eprosima::fastrtps::rtps::GuidPrefix_t& prefix) - { - participant_attr_.rtps.prefix = prefix; - return *this; - } - - PubSubReader& participant_id( - int32_t participantId) - { - participant_attr_.rtps.participantID = participantId; - return *this; - } - - PubSubReader& user_data_max_size( - size_t size) - { - participant_attr_.rtps.allocation.data_limits.max_user_data = size; - return *this; - } - - PubSubReader& properties_max_size( - size_t max_properties) - { - participant_attr_.rtps.allocation.data_limits.max_properties = max_properties; - return *this; - } - - PubSubReader& partitions_max_size( - size_t max_partitions) - { - participant_attr_.rtps.allocation.data_limits.max_partitions = max_partitions; - return *this; - } - - bool update_partition( - const std::string& partition) - { - subscriber_attr_.qos.m_partition.clear(); - subscriber_attr_.qos.m_partition.push_back(partition.c_str()); - return subscriber_->updateAttributes(subscriber_attr_); - } - - bool clear_partitions() - { - subscriber_attr_.qos.m_partition.clear(); - return subscriber_->updateAttributes(subscriber_attr_); - } - - /*** Function for discovery callback ***/ - - void wait_discovery_result() - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Reader is waiting discovery result..." << std::endl; - - cvDiscovery_.wait(lock, [&]() - { - return discovery_result_; - }); - - std::cout << "Reader gets discovery result..." << std::endl; - } - - void setOnDiscoveryFunction( - std::function f) - { - onDiscovery_ = f; - } - - void setOnEndpointDiscoveryFunction( - std::function f) - { - onEndpointDiscovery_ = f; - } - - bool take_first_data( - void* data) - { - return takeNextData(data); - } - - bool takeNextData( - void* data) - { - eprosima::fastrtps::SampleInfo_t info; - if (subscriber_->takeNextData(data, &info)) - { - current_processed_count_++; - return true; - } - return false; - } - - unsigned int missed_deadlines() const - { - return listener_.missed_deadlines(); - } - - void liveliness_lost() - { - std::unique_lock lock(liveliness_mutex_); - times_liveliness_lost_++; - liveliness_cv_.notify_one(); - } - - void liveliness_recovered() - { - std::unique_lock lock(liveliness_mutex_); - times_liveliness_recovered_++; - liveliness_cv_.notify_one(); - } - - void set_liveliness_changed_status( - const eprosima::fastrtps::LivelinessChangedStatus& status) - { - std::unique_lock lock(liveliness_mutex_); - - liveliness_changed_status_ = status; - } - - unsigned int times_liveliness_lost() - { - std::unique_lock lock(liveliness_mutex_); - - return times_liveliness_lost_; - } - - unsigned int times_liveliness_recovered() - { - std::unique_lock lock(liveliness_mutex_); - - return times_liveliness_recovered_; - } - - const eprosima::fastrtps::LivelinessChangedStatus& liveliness_changed_status() - { - std::unique_lock lock(liveliness_mutex_); - - return liveliness_changed_status_; - } - - bool is_matched() const - { - return matched_ > 0; - } - - unsigned int get_matched() const - { - return matched_; - } - - void set_xml_filename( - const std::string& name) - { - xml_file_ = name; - } - - void set_participant_profile( - const std::string& profile) - { - participant_profile_ = profile; - } - - const eprosima::fastrtps::rtps::GUID_t& participant_guid() const - { - return participant_guid_; - } - - const eprosima::fastrtps::rtps::GUID_t& datareader_guid() const - { - return subscriber_guid_; - } - -private: - - void receive_one( - eprosima::fastrtps::Subscriber* subscriber, - bool& returnedValue) - { - returnedValue = false; - type data; - eprosima::fastrtps::SampleInfo_t info; - - bool success = take_ ? - subscriber->takeNextData((void*)&data, &info) : - subscriber->readNextData((void*)&data, &info); - if (success) - { - returnedValue = true; - - std::unique_lock lock(mutex_); - - // Check order of changes. - ASSERT_LT(last_seq[info.iHandle], info.sample_identity.sequence_number()); - last_seq[info.iHandle] = info.sample_identity.sequence_number(); - - if (info.sampleKind == eprosima::fastrtps::rtps::ALIVE) - { - auto it = std::find(total_msgs_.begin(), total_msgs_.end(), data); - ASSERT_NE(it, total_msgs_.end()); - total_msgs_.erase(it); - ++current_processed_count_; - default_receive_print(data); - cv_.notify_one(); - } - } - } - - void participant_matched() - { - std::unique_lock lock(mutexDiscovery_); - ++participant_matched_; - cvDiscovery_.notify_one(); - } - - void participant_unmatched() - { - std::unique_lock lock(mutexDiscovery_); - --participant_matched_; - cvDiscovery_.notify_one(); - } - - void matched() - { - std::unique_lock lock(mutexDiscovery_); - ++matched_; - cvDiscovery_.notify_one(); - } - - void unmatched() - { - std::unique_lock lock(mutexDiscovery_); - --matched_; - cvDiscovery_.notify_one(); - } - -#if HAVE_SECURITY - void authorized() - { - mutexAuthentication_.lock(); - ++authorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - - void unauthorized() - { - mutexAuthentication_.lock(); - ++unauthorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - -#endif // if HAVE_SECURITY - - PubSubReader& operator =( - const PubSubReader&) = delete; - - eprosima::fastrtps::Participant* participant_; - eprosima::fastrtps::ParticipantAttributes participant_attr_; - eprosima::fastrtps::Subscriber* subscriber_; - eprosima::fastrtps::SubscriberAttributes subscriber_attr_; - std::string topic_name_; - eprosima::fastrtps::rtps::GUID_t participant_guid_; - eprosima::fastrtps::rtps::GUID_t subscriber_guid_; - bool initialized_; - std::list total_msgs_; - std::mutex mutex_; - std::condition_variable cv_; - std::mutex mutexDiscovery_; - std::condition_variable cvDiscovery_; - std::atomic matched_; - unsigned int participant_matched_; - std::atomic receiving_; - type_support type_; - std::map last_seq; - std::atomic current_processed_count_; - std::atomic number_samples_expected_; - bool discovery_result_; - - std::string xml_file_ = ""; - std::string participant_profile_ = ""; - - std::function onDiscovery_; - std::function onEndpointDiscovery_; - - //! True to take data from history. False to read - bool take_; - -#if HAVE_SECURITY - std::mutex mutexAuthentication_; - std::condition_variable cvAuthentication_; - unsigned int authorized_; - unsigned int unauthorized_; -#endif // if HAVE_SECURITY - - //! A mutex for liveliness status - std::mutex liveliness_mutex_; - //! A condition variable to notify when liveliness was recovered - std::condition_variable liveliness_cv_; - //! Number of times liveliness was lost - unsigned int times_liveliness_lost_; - //! Number of times liveliness was recovered - unsigned int times_liveliness_recovered_; - //! The liveliness changed status - eprosima::fastrtps::LivelinessChangedStatus liveliness_changed_status_; - - //! A mutex for messages received but not yet processed by the application - std::mutex message_receive_mutex_; - //! A condition variable for messages received but not yet processed by the application - std::condition_variable message_receive_cv_; - //! Number of messages received but not yet processed by the application - std::atomic message_receive_count_; -}; - -#endif // _TEST_BLACKBOX_PUBSUBREADER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/PubSubWriter.hpp b/test/blackbox/api/fastrtps_deprecated/PubSubWriter.hpp deleted file mode 100644 index 0dafd624326..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/PubSubWriter.hpp +++ /dev/null @@ -1,1640 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PubSubWriter.hpp - * - */ - -#ifndef _TEST_BLACKBOX_PUBSUBWRITER_HPP_ -#define _TEST_BLACKBOX_PUBSUBWRITER_HPP_ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using eprosima::fastrtps::rtps::IPLocator; -using eprosima::fastrtps::rtps::UDPTransportDescriptor; -using eprosima::fastrtps::rtps::UDPv4TransportDescriptor; -using eprosima::fastrtps::rtps::UDPv6TransportDescriptor; - -template -class PubSubWriter -{ - class ParticipantListener : public eprosima::fastrtps::ParticipantListener - { - public: - - ParticipantListener( - PubSubWriter& writer) - : writer_(writer) - { - } - - ~ParticipantListener() - { - } - - void onParticipantDiscovery( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override - { - if (writer_.onDiscovery_ != nullptr) - { - writer_.discovery_result_ = writer_.onDiscovery_(info); - } - - if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) - { - writer_.participant_matched(); - } - else if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT || - info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) - { - writer_.participant_unmatched(); - } - } - -#if HAVE_SECURITY - void onParticipantAuthentication( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ParticipantAuthenticationInfo&& info) override - { - if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::AUTHORIZED_PARTICIPANT) - { - writer_.authorized(); - } - else if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::UNAUTHORIZED_PARTICIPANT) - { - writer_.unauthorized(); - } - } - -#endif // if HAVE_SECURITY - - void onSubscriberDiscovery( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override - { - if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER) - { - writer_.add_reader_info(info.info); - - } - else if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::CHANGED_QOS_READER) - { - writer_.change_reader_info(info.info); - } - else if (info.status == eprosima::fastrtps::rtps::ReaderDiscoveryInfo::REMOVED_READER) - { - writer_.remove_reader_info(info.info); - } - } - - void onPublisherDiscovery( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override - { - if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER) - { - writer_.add_writer_info(info.info); - } - else if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::CHANGED_QOS_WRITER) - { - writer_.change_writer_info(info.info); - } - else if (info.status == eprosima::fastrtps::rtps::WriterDiscoveryInfo::REMOVED_WRITER) - { - writer_.remove_writer_info(info.info); - } - } - - private: - - ParticipantListener& operator =( - const ParticipantListener&) = delete; - - PubSubWriter& writer_; - - } - participant_listener_; - - class Listener : public eprosima::fastrtps::PublisherListener - { - public: - - Listener( - PubSubWriter& writer) - : writer_(writer) - , times_deadline_missed_(0) - , times_liveliness_lost_(0) - { - } - - ~Listener() - { - } - - void onPublicationMatched( - eprosima::fastrtps::Publisher* /*pub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) override - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - std::cout << "Publisher matched subscriber " << info.remoteEndpointGuid << std::endl; - writer_.matched(); - } - else - { - std::cout << "Publisher unmatched subscriber " << info.remoteEndpointGuid << std::endl; - writer_.unmatched(); - } - } - - void on_offered_deadline_missed( - eprosima::fastrtps::Publisher* pub, - const eprosima::fastrtps::OfferedDeadlineMissedStatus& status) override - { - (void)pub; - times_deadline_missed_ = status.total_count; - } - - void on_liveliness_lost( - eprosima::fastrtps::Publisher* pub, - const eprosima::fastrtps::LivelinessLostStatus& status) override - { - (void)pub; - times_liveliness_lost_ = status.total_count; - writer_.liveliness_lost(); - } - - unsigned int missed_deadlines() const - { - return times_deadline_missed_; - } - - unsigned int times_liveliness_lost() const - { - return times_liveliness_lost_; - } - - private: - - Listener& operator =( - const Listener&) = delete; - - PubSubWriter& writer_; - - //! The number of times deadline was missed - unsigned int times_deadline_missed_; - //! The number of times liveliness was lost - unsigned int times_liveliness_lost_; - - } - listener_; - -public: - - typedef TypeSupport type_support; - typedef typename type_support::type type; - - PubSubWriter( - const std::string& topic_name) - : participant_listener_(*this) - , listener_(*this) - , participant_(nullptr) - , publisher_(nullptr) - , initialized_(false) - , matched_(0) - , participant_matched_(0) - , discovery_result_(false) - , onDiscovery_(nullptr) - , times_liveliness_lost_(0) -#if HAVE_SECURITY - , authorized_(0) - , unauthorized_(0) -#endif // if HAVE_SECURITY - { - publisher_attr_.topic.topicDataType = type_.getName(); - // Generate topic name - std::ostringstream t; - t << topic_name << "_" << asio::ip::host_name() << "_" << GET_PID(); - publisher_attr_.topic.topicName = t.str(); - topic_name_ = t.str(); - publisher_attr_.topic.topicKind = - type_.m_isGetKeyDefined ? ::eprosima::fastrtps::rtps::WITH_KEY : ::eprosima::fastrtps::rtps::NO_KEY; - - // By default, memory mode is PREALLOCATED_WITH_REALLOC_MEMORY_MODE - publisher_attr_.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - - // By default, heartbeat period and nack response delay are 100 milliseconds. - publisher_attr_.times.heartbeatPeriod.seconds = 0; - publisher_attr_.times.heartbeatPeriod.nanosec = 100000000; - publisher_attr_.times.nackResponseDelay.seconds = 0; - publisher_attr_.times.nackResponseDelay.nanosec = 100000000; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - publisher_attr_.qos.m_reliability.max_blocking_time.seconds = 1; - publisher_attr_.qos.m_reliability.max_blocking_time.nanosec = 0; - } - - ~PubSubWriter() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - } - } - - eprosima::fastrtps::Publisher& get_native_writer() const - { - return *publisher_; - } - - void init() - { - //Create participant - // Use local copies of attributes to catch #6507 issues with valgrind - eprosima::fastrtps::ParticipantAttributes participant_attr; - eprosima::fastrtps::PublisherAttributes publisher_attr; - - if (!xml_file_.empty()) - { - eprosima::fastrtps::Domain::loadXMLProfilesFile(xml_file_); - if (!participant_profile_.empty()) - { - // Need to specify ID in XML - participant_ = eprosima::fastrtps::Domain::createParticipant(participant_profile_, - &participant_listener_); - ASSERT_NE(participant_, nullptr); - participant_attr = participant_->getAttributes(); - publisher_attr = publisher_attr_; - } - } - if (participant_ == nullptr) - { - participant_attr_.domainId = (uint32_t)GET_PID() % 230; - - participant_attr = participant_attr_; - publisher_attr = publisher_attr_; - - participant_ = eprosima::fastrtps::Domain::createParticipant(participant_attr, &participant_listener_); - } - - if (participant_ != nullptr) - { - participant_guid_ = participant_->getGuid(); - - // Register type - eprosima::fastrtps::Domain::registerType(participant_, &type_); - - //Create publisher - publisher_ = eprosima::fastrtps::Domain::createPublisher(participant_, publisher_attr, &listener_); - - if (publisher_ != nullptr) - { - publisher_guid_ = publisher_->getGuid(); - std::cout << "Created publisher " << publisher_guid_ << " for topic " << - publisher_attr_.topic.topicName << std::endl; - initialized_ = true; - } - } - } - - void createPublisher() - { - if (participant_ != nullptr) - { - //Create publisher - publisher_ = eprosima::fastrtps::Domain::createPublisher(participant_, publisher_attr_, &listener_); - - if (publisher_ != nullptr) - { - publisher_guid_ = publisher_->getGuid(); - std::cout << "Created publisher " << publisher_guid_ << " for topic " << - publisher_attr_.topic.topicName << std::endl; - initialized_ = true; - return; - } - } - return; - } - - void removePublisher() - { - initialized_ = false; - eprosima::fastrtps::Domain::removePublisher(publisher_); - return; - } - - bool isInitialized() const - { - return initialized_; - } - - eprosima::fastrtps::Participant* getParticipant() - { - return participant_; - } - - void destroy() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - participant_ = nullptr; - } - - initialized_ = false; - } - - void send( - std::list& msgs, - uint32_t milliseconds = 0) - { - auto it = msgs.begin(); - - while (it != msgs.end()) - { - if (publisher_->write((void*)&(*it))) - { - default_send_print(*it); - it = msgs.erase(it); - if (milliseconds > 0) - { - std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)); - } - } - else - { - break; - } - } - } - - eprosima::fastrtps::rtps::InstanceHandle_t register_instance( - type& msg) - { - return publisher_->register_instance((void*)&msg); - } - - bool unregister_instance( - type& msg, - const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) - { - return publisher_->unregister_instance((void*)&msg, instance_handle); - } - - bool dispose( - type& msg, - const eprosima::fastrtps::rtps::InstanceHandle_t& instance_handle) - { - return publisher_->dispose((void*)&msg, instance_handle); - } - - bool send_sample( - type& msg) - { - return publisher_->write((void*)&msg); - } - - void assert_liveliness() - { - publisher_->assert_liveliness(); - } - - void wait_discovery( - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Writer is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cv_.wait(lock, [&]() - { - return matched_ != 0; - }); - } - else - { - cv_.wait_for(lock, timeout, [&]() - { - return matched_ != 0; - }); - } - - std::cout << "Writer discovery finished..." << std::endl; - } - - void wait_discovery( - unsigned int expected_match, - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Writer is waiting discovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cv_.wait(lock, [&]() - { - return matched_ == expected_match; - }); - } - else - { - cv_.wait_for(lock, timeout, [&]() - { - return matched_ == expected_match; - }); - } - - std::cout << "Writer discovery finished..." << std::endl; - } - - bool wait_participant_undiscovery( - std::chrono::seconds timeout = std::chrono::seconds::zero()) - { - bool ret_value = true; - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Writer is waiting undiscovery..." << std::endl; - - if (timeout == std::chrono::seconds::zero()) - { - cv_.wait(lock, [&]() - { - return participant_matched_ == 0; - }); - } - else - { - if (!cv_.wait_for(lock, timeout, [&]() - { - return participant_matched_ == 0; - })) - { - ret_value = false; - } - } - - if (ret_value) - { - std::cout << "Writer undiscovery finished successfully..." << std::endl; - } - else - { - std::cout << "Writer undiscovery finished unsuccessfully..." << std::endl; - } - - return ret_value; - } - - void wait_reader_undiscovery() - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Writer is waiting removal..." << std::endl; - - cv_.wait(lock, [&]() - { - return matched_ == 0; - }); - - std::cout << "Writer removal finished..." << std::endl; - } - - void wait_liveliness_lost( - unsigned int times = 1) - { - std::unique_lock lock(liveliness_mutex_); - liveliness_cv_.wait(lock, [&]() - { - return times_liveliness_lost_ >= times; - }); - } - - void liveliness_lost() - { - std::unique_lock lock(liveliness_mutex_); - times_liveliness_lost_++; - liveliness_cv_.notify_one(); - } - -#if HAVE_SECURITY - void waitAuthorized() - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "Writer is waiting authorization..." << std::endl; - - cvAuthentication_.wait(lock, [&]() -> bool - { - return authorized_ > 0; - }); - - std::cout << "Writer authorization finished..." << std::endl; - } - - void waitUnauthorized() - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "Writer is waiting unauthorization..." << std::endl; - - cvAuthentication_.wait(lock, [&]() -> bool - { - return unauthorized_ > 0; - }); - - std::cout << "Writer unauthorization finished..." << std::endl; - } - -#endif // if HAVE_SECURITY - - template - bool waitForAllAcked( - const std::chrono::duration<_Rep, _Period>& max_wait) - { - auto nsecs = std::chrono::duration_cast(max_wait); - auto secs = std::chrono::duration_cast(nsecs); - nsecs -= secs; - eprosima::fastrtps::Duration_t timeout {static_cast(secs.count()), - static_cast(nsecs.count())}; - return publisher_->wait_for_all_acked(timeout); - } - - void block_until_discover_topic( - const std::string& topicName, - int repeatedTimes) - { - std::unique_lock lock(mutexEntitiesInfoList_); - - cvEntitiesInfoList_.wait(lock, [&]() - { - int times = mapTopicCountList_.count(topicName) == 0 ? 0 : mapTopicCountList_[topicName]; - return times == repeatedTimes; - }); - } - - void block_until_discover_partition( - const std::string& partition, - int repeatedTimes) - { - std::unique_lock lock(mutexEntitiesInfoList_); - - cvEntitiesInfoList_.wait(lock, [&]() - { - int times = mapPartitionCountList_.count(partition) == 0 ? 0 : mapPartitionCountList_[partition]; - return times == repeatedTimes; - }); - } - - /*** Function to change QoS ***/ - PubSubWriter& reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) - { - publisher_attr_.qos.m_reliability.kind = kind; - return *this; - } - - PubSubWriter& mem_policy( - const eprosima::fastrtps::rtps::MemoryManagementPolicy mem_policy) - { - publisher_attr_.historyMemoryPolicy = mem_policy; - return *this; - } - - PubSubWriter& deadline_period( - const eprosima::fastrtps::Duration_t deadline_period) - { - publisher_attr_.qos.m_deadline.period = deadline_period; - return *this; - } - - PubSubWriter& liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) - { - publisher_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubWriter& liveliness_lease_duration( - const eprosima::fastrtps::Duration_t lease_duration) - { - publisher_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - PubSubWriter& latency_budget_duration( - const eprosima::fastrtps::Duration_t& latency_duration) - { - publisher_attr_.qos.m_latencyBudget.duration = latency_duration; - return *this; - } - - eprosima::fastrtps::Duration_t get_latency_budget_duration() - { - return publisher_attr_.qos.m_latencyBudget.duration; - } - - PubSubWriter& liveliness_announcement_period( - const eprosima::fastrtps::Duration_t announcement_period) - { - publisher_attr_.qos.m_liveliness.announcement_period = announcement_period; - return *this; - } - - PubSubWriter& lifespan_period( - const eprosima::fastrtps::Duration_t lifespan_period) - { - publisher_attr_.qos.m_lifespan.duration = lifespan_period; - return *this; - } - - PubSubWriter& keep_duration( - const eprosima::fastrtps::Duration_t duration) - { - publisher_attr_.qos.m_disablePositiveACKs.enabled = true; - publisher_attr_.qos.m_disablePositiveACKs.duration = duration; - return *this; - } - - PubSubWriter& disable_heartbeat_piggyback( - bool value) - { - publisher_attr_.qos.disable_heartbeat_piggyback = value; - return *this; - } - - PubSubWriter& max_blocking_time( - const eprosima::fastrtps::Duration_t time) - { - publisher_attr_.qos.m_reliability.max_blocking_time = time; - return *this; - } - - PubSubWriter& add_throughput_controller_descriptor_to_pparams( - eprosima::fastdds::rtps::FlowControllerSchedulerPolicy, - uint32_t bytesPerPeriod, - uint32_t periodInMs) - { - eprosima::fastrtps::rtps::ThroughputControllerDescriptor descriptor {bytesPerPeriod, periodInMs}; - publisher_attr_.throughputController = descriptor; - - return *this; - } - - PubSubWriter& asynchronously( - const eprosima::fastrtps::PublishModeQosPolicyKind kind) - { - publisher_attr_.qos.m_publishMode.kind = kind; - return *this; - } - - PubSubWriter& history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) - { - publisher_attr_.topic.historyQos.kind = kind; - return *this; - } - - PubSubWriter& history_depth( - const int32_t depth) - { - publisher_attr_.topic.historyQos.depth = depth; - return *this; - } - - PubSubWriter& setup_transports( - eprosima::fastdds::rtps::BuiltinTransports transports) - { - participant_attr_.rtps.setup_transports(transports); - return *this; - } - - PubSubWriter& setup_transports( - eprosima::fastdds::rtps::BuiltinTransports transports, - const eprosima::fastdds::rtps::BuiltinTransportsOptions& options) - { - participant_attr_.rtps.setup_transports(transports, options); - return *this; - } - - PubSubWriter& setup_large_data_tcp( - bool v6 = false, - const uint16_t& port = 0, - const uint32_t& tcp_negotiation_timeout = 0) - { - participant_attr_.rtps.useBuiltinTransports = false; - - /* Transports configuration */ - // UDP transport for PDP over multicast - // TCP transport for EDP and application data (The listening port must to be unique for - // each participant in the same host) - uint16_t tcp_listening_port = port; - if (v6) - { - auto pdp_transport = std::make_shared(); - participant_attr_.rtps.userTransports.push_back(pdp_transport); - - auto data_transport = std::make_shared(); - data_transport->add_listener_port(tcp_listening_port); - data_transport->calculate_crc = false; - data_transport->check_crc = false; - data_transport->apply_security = false; - data_transport->enable_tcp_nodelay = true; - data_transport->tcp_negotiation_timeout = tcp_negotiation_timeout; - participant_attr_.rtps.userTransports.push_back(data_transport); - } - else - { - auto pdp_transport = std::make_shared(); - participant_attr_.rtps.userTransports.push_back(pdp_transport); - - auto data_transport = std::make_shared(); - data_transport->add_listener_port(tcp_listening_port); - data_transport->calculate_crc = false; - data_transport->check_crc = false; - data_transport->apply_security = false; - data_transport->enable_tcp_nodelay = true; - data_transport->tcp_negotiation_timeout = tcp_negotiation_timeout; - participant_attr_.rtps.userTransports.push_back(data_transport); - } - - /* Locators */ - eprosima::fastrtps::rtps::Locator_t pdp_locator; - eprosima::fastrtps::rtps::Locator_t tcp_locator; - if (v6) - { - // Define locator for PDP over multicast - pdp_locator.kind = LOCATOR_KIND_UDPv6; - eprosima::fastrtps::rtps::IPLocator::setIPv6(pdp_locator, "ff1e::ffff:efff:1"); - // Define locator for EDP and user data - tcp_locator.kind = LOCATOR_KIND_TCPv6; - eprosima::fastrtps::rtps::IPLocator::setIPv6(tcp_locator, "::"); - eprosima::fastrtps::rtps::IPLocator::setPhysicalPort(tcp_locator, tcp_listening_port); - eprosima::fastrtps::rtps::IPLocator::setLogicalPort(tcp_locator, 0); - } - else - { - // Define locator for PDP over multicast - pdp_locator.kind = LOCATOR_KIND_UDPv4; - eprosima::fastrtps::rtps::IPLocator::setIPv4(pdp_locator, "239.255.0.1"); - // Define locator for EDP and user data - tcp_locator.kind = LOCATOR_KIND_TCPv4; - eprosima::fastrtps::rtps::IPLocator::setIPv4(tcp_locator, "0.0.0.0"); - eprosima::fastrtps::rtps::IPLocator::setPhysicalPort(tcp_locator, tcp_listening_port); - eprosima::fastrtps::rtps::IPLocator::setLogicalPort(tcp_locator, 0); - } - - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList.push_back(pdp_locator); - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList.push_back(tcp_locator); - participant_attr_.rtps.defaultUnicastLocatorList.push_back(tcp_locator); - - return *this; - } - - PubSubWriter& disable_builtin_transport() - { - participant_attr_.rtps.useBuiltinTransports = false; - return *this; - } - - PubSubWriter& add_user_transport_to_pparams( - std::shared_ptr userTransportDescriptor) - { - participant_attr_.rtps.userTransports.push_back(userTransportDescriptor); - return *this; - } - - PubSubWriter& durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) - { - publisher_attr_.qos.m_durability.kind = kind; - return *this; - } - - PubSubWriter& resource_limits_allocated_samples( - const int32_t initial) - { - publisher_attr_.topic.resourceLimitsQos.allocated_samples = initial; - return *this; - } - - PubSubWriter& resource_limits_max_samples( - const int32_t max) - { - publisher_attr_.topic.resourceLimitsQos.max_samples = max; - return *this; - } - - PubSubWriter& resource_limits_max_instances( - const int32_t max) - { - publisher_attr_.topic.resourceLimitsQos.max_instances = max; - return *this; - } - - PubSubWriter& resource_limits_max_samples_per_instance( - const int32_t max) - { - publisher_attr_.topic.resourceLimitsQos.max_samples_per_instance = max; - return *this; - } - - PubSubWriter& resource_limits_extra_samples( - const int32_t extra) - { - publisher_attr_.topic.resourceLimitsQos.extra_samples = extra; - return *this; - } - - PubSubWriter& matched_readers_allocation( - size_t initial, - size_t maximum) - { - publisher_attr_.matched_subscriber_allocation.initial = initial; - publisher_attr_.matched_subscriber_allocation.maximum = maximum; - return *this; - } - - PubSubWriter& expect_no_allocs() - { - // TODO(Mcc): Add no allocations check code when feature is completely ready - return *this; - } - - PubSubWriter& heartbeat_period_seconds( - int32_t sec) - { - publisher_attr_.times.heartbeatPeriod.seconds = sec; - return *this; - } - - PubSubWriter& heartbeat_period_nanosec( - uint32_t nanosec) - { - publisher_attr_.times.heartbeatPeriod.nanosec = nanosec; - return *this; - } - - PubSubWriter& unicastLocatorList( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - publisher_attr_.unicastLocatorList = unicastLocators; - return *this; - } - - PubSubWriter& add_to_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - publisher_attr_.unicastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& multicastLocatorList( - eprosima::fastrtps::rtps::LocatorList_t multicastLocators) - { - publisher_attr_.multicastLocatorList = multicastLocators; - return *this; - } - - PubSubWriter& add_to_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - publisher_attr_.multicastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& metatraffic_unicast_locator_list( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList = unicastLocators; - return *this; - } - - PubSubWriter& add_to_metatraffic_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& metatraffic_multicast_locator_list( - eprosima::fastrtps::rtps::LocatorList_t unicastLocators) - { - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList = unicastLocators; - return *this; - } - - PubSubWriter& add_to_metatraffic_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.builtin.metatrafficMulticastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& set_default_unicast_locators( - const eprosima::fastrtps::rtps::LocatorList_t& locators) - { - participant_attr_.rtps.defaultUnicastLocatorList = locators; - return *this; - } - - PubSubWriter& add_to_default_unicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.defaultUnicastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& set_default_multicast_locators( - const eprosima::fastrtps::rtps::LocatorList_t& locators) - { - participant_attr_.rtps.defaultMulticastLocatorList = locators; - return *this; - } - - PubSubWriter& add_to_default_multicast_locator_list( - const std::string& ip, - uint32_t port) - { - eprosima::fastrtps::rtps::Locator_t loc; - if (!IPLocator::setIPv4(loc, ip)) - { - loc.kind = LOCATOR_KIND_UDPv6; - if (!IPLocator::setIPv6(loc, ip)) - { - return *this; - } - } - - loc.port = port; - participant_attr_.rtps.defaultMulticastLocatorList.push_back(loc); - - return *this; - } - - PubSubWriter& initial_peers( - eprosima::fastrtps::rtps::LocatorList_t initial_peers) - { - participant_attr_.rtps.builtin.initialPeersList = initial_peers; - return *this; - } - - PubSubWriter& static_discovery( - const char* filename) - { - participant_attr_.rtps.builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = false; - participant_attr_.rtps.builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol = true; - participant_attr_.rtps.builtin.discovery_config.static_edp_xml_config(filename); - return *this; - } - - PubSubWriter& use_writer_liveliness_protocol( - bool use_wlp) - { - participant_attr_.rtps.builtin.use_WriterLivelinessProtocol = use_wlp; - return *this; - } - - PubSubWriter& avoid_builtin_multicast( - bool value) - { - participant_attr_.rtps.builtin.avoid_builtin_multicast = value; - return *this; - } - - PubSubWriter& property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy) - { - participant_attr_.rtps.properties = property_policy; - return *this; - } - - PubSubWriter& entity_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy) - { - publisher_attr_.properties = property_policy; - return *this; - } - - PubSubWriter& setPublisherIDs( - uint8_t UserID, - uint8_t EntityID) - { - publisher_attr_.setUserDefinedID(UserID); - publisher_attr_.setEntityID(EntityID); - return *this; - } - - PubSubWriter& setManualTopicName( - std::string topicName) - { - publisher_attr_.topic.topicName = topicName; - return *this; - } - - PubSubWriter& disable_multicast( - int32_t participantId) - { - participant_attr_.rtps.participantID = participantId; - - eprosima::fastrtps::rtps::LocatorList_t default_unicast_locators; - eprosima::fastrtps::rtps::Locator_t default_unicast_locator; - eprosima::fastrtps::rtps::Locator_t loopback_locator; - if (!use_udpv4) - { - default_unicast_locator.kind = LOCATOR_KIND_UDPv6; - loopback_locator.kind = LOCATOR_KIND_UDPv6; - } - - default_unicast_locators.push_back(default_unicast_locator); - participant_attr_.rtps.builtin.metatrafficUnicastLocatorList = default_unicast_locators; - - if (!IPLocator::setIPv4(loopback_locator, 127, 0, 0, 1)) - { - IPLocator::setIPv6(loopback_locator, "::1"); - } - participant_attr_.rtps.builtin.initialPeersList.push_back(loopback_locator); - return *this; - } - - PubSubWriter& partition( - const std::string& partition) - { - publisher_attr_.qos.m_partition.push_back(partition.c_str()); - return *this; - } - - PubSubWriter& userData( - std::vector user_data) - { - participant_attr_.rtps.userData = user_data; - return *this; - } - - PubSubWriter& endpoint_userData( - std::vector user_data) - { - publisher_attr_.qos.m_userData = user_data; - return *this; - } - - PubSubWriter& lease_duration( - eprosima::fastrtps::Duration_t lease_duration, - eprosima::fastrtps::Duration_t announce_period) - { - participant_attr_.rtps.builtin.discovery_config.leaseDuration = lease_duration; - participant_attr_.rtps.builtin.discovery_config.leaseDuration_announcementperiod = announce_period; - return *this; - } - - PubSubWriter& initial_announcements( - uint32_t count, - const eprosima::fastrtps::Duration_t& period) - { - participant_attr_.rtps.builtin.discovery_config.initial_announcements.count = count; - participant_attr_.rtps.builtin.discovery_config.initial_announcements.period = period; - return *this; - } - - PubSubWriter& ownership_strength( - uint32_t strength) - { - publisher_attr_.qos.m_ownership.kind = eprosima::fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS; - publisher_attr_.qos.m_ownershipStrength.value = strength; - return *this; - } - - PubSubWriter& load_publisher_attr( - const std::string& xml) - { - std::unique_ptr root; - if (eprosima::fastrtps::xmlparser::XMLParser::loadXML(xml.data(), xml.size(), - root) == eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK) - { - for (const auto& profile : root->getChildren()) - { - if (profile->getType() == eprosima::fastrtps::xmlparser::NodeType::PUBLISHER) - { - publisher_attr_ = - *(dynamic_cast - *>( - profile.get())->get()); - } - } - } - return *this; - } - - PubSubWriter& max_initial_peers_range( - uint32_t maxInitialPeerRange) - { - participant_attr_.rtps.useBuiltinTransports = false; - std::shared_ptr descriptor; - if (use_udpv4) - { - descriptor = std::make_shared(); - } - else - { - descriptor = std::make_shared(); - } - descriptor->maxInitialPeersRange = maxInitialPeerRange; - participant_attr_.rtps.userTransports.push_back(descriptor); - return *this; - } - - PubSubWriter& socket_buffer_size( - uint32_t sockerBufferSize) - { - participant_attr_.rtps.listenSocketBufferSize = sockerBufferSize; - return *this; - } - - PubSubWriter& guid_prefix( - const eprosima::fastrtps::rtps::GuidPrefix_t& prefix) - { - participant_attr_.rtps.prefix = prefix; - return *this; - } - - PubSubWriter& participant_id( - int32_t participantId) - { - participant_attr_.rtps.participantID = participantId; - return *this; - } - - PubSubWriter& set_events_thread_settings( - const eprosima::fastdds::rtps::ThreadSettings& settings) - { - participant_attr_.rtps.timed_events_thread = settings; - return *this; - } - - const std::string& topic_name() const - { - return topic_name_; - } - - eprosima::fastrtps::rtps::GUID_t participant_guid() - { - return participant_guid_; - } - - eprosima::fastrtps::rtps::GUID_t datawriter_guid() - { - return publisher_guid_; - } - - bool update_partition( - const std::string& partition) - { - publisher_attr_.qos.m_partition.clear(); - publisher_attr_.qos.m_partition.push_back(partition.c_str()); - return publisher_->updateAttributes(publisher_attr_); - } - - bool set_qos() - { - return publisher_->updateAttributes(publisher_attr_); - } - - bool remove_all_changes( - size_t* number_of_changes_removed) - { - return publisher_->removeAllChange(number_of_changes_removed); - } - - bool is_matched() const - { - return matched_ > 0; - } - - unsigned int get_matched() const - { - return matched_; - } - - void set_xml_filename( - const std::string& name) - { - xml_file_ = name; - } - - void set_participant_profile( - const std::string& profile) - { - participant_profile_ = profile; - } - - unsigned int missed_deadlines() const - { - return listener_.missed_deadlines(); - } - - unsigned int times_liveliness_lost() const - { - return listener_.times_liveliness_lost(); - } - -private: - - void participant_matched() - { - std::unique_lock lock(mutexDiscovery_); - ++participant_matched_; - cv_.notify_one(); - } - - void participant_unmatched() - { - std::unique_lock lock(mutexDiscovery_); - --participant_matched_; - cv_.notify_one(); - } - - void matched() - { - std::unique_lock lock(mutexDiscovery_); - ++matched_; - cv_.notify_one(); - } - - void unmatched() - { - std::unique_lock lock(mutexDiscovery_); - --matched_; - cv_.notify_one(); - } - -#if HAVE_SECURITY - void authorized() - { - mutexAuthentication_.lock(); - ++authorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - - void unauthorized() - { - mutexAuthentication_.lock(); - ++unauthorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - -#endif // if HAVE_SECURITY - - void add_writer_info( - const eprosima::fastrtps::rtps::WriterProxyData& writer_data) - { - mutexEntitiesInfoList_.lock(); - auto ret = mapWriterInfoList_.insert(std::make_pair(writer_data.guid(), writer_data)); - - if (!ret.second) - { - ret.first->second = writer_data; - } - - auto ret_topic = mapTopicCountList_.insert(std::make_pair(writer_data.topicName().to_string(), 1)); - - if (!ret_topic.second) - { - ++ret_topic.first->second; - } - - for (auto partition : writer_data.m_qos.m_partition.names()) - { - auto ret_partition = mapPartitionCountList_.insert(std::make_pair(partition, 1)); - - if (!ret_partition.second) - { - ++ret_partition.first->second; - } - } - - mutexEntitiesInfoList_.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - void change_writer_info( - const eprosima::fastrtps::rtps::WriterProxyData& writer_data) - { - mutexEntitiesInfoList_.lock(); - auto ret = mapWriterInfoList_.insert(std::make_pair(writer_data.guid(), writer_data)); - - ASSERT_FALSE(ret.second); - eprosima::fastrtps::rtps::WriterProxyData old_writer_data = ret.first->second; - ret.first->second = writer_data; - - ASSERT_GT(mapTopicCountList_.count(writer_data.topicName().to_string()), 0ul); - - // Remove previous partitions - for (auto partition : old_writer_data.m_qos.m_partition.names()) - { - auto partition_it = mapPartitionCountList_.find(partition); - ASSERT_TRUE(partition_it != mapPartitionCountList_.end()); - --(*partition_it).second; - if ((*partition_it).second == 0) - { - mapPartitionCountList_.erase(partition); - } - } - - // Add new partitions - for (auto partition : writer_data.m_qos.m_partition.names()) - { - auto ret_partition = mapPartitionCountList_.insert(std::make_pair(partition, 1)); - - if (!ret_partition.second) - { - ++ret_partition.first->second; - } - } - - mutexEntitiesInfoList_.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - void add_reader_info( - const eprosima::fastrtps::rtps::ReaderProxyData& reader_data) - { - mutexEntitiesInfoList_.lock(); - auto ret = mapReaderInfoList_.insert(std::make_pair(reader_data.guid(), reader_data)); - - if (!ret.second) - { - ret.first->second = reader_data; - } - - auto ret_topic = mapTopicCountList_.insert(std::make_pair(reader_data.topicName().to_string(), 1)); - - if (!ret_topic.second) - { - ++ret_topic.first->second; - } - - for (auto partition : reader_data.m_qos.m_partition.names()) - { - auto ret_partition = mapPartitionCountList_.insert(std::make_pair(partition, 1)); - - if (!ret_partition.second) - { - ++ret_partition.first->second; - } - } - - mutexEntitiesInfoList_.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - void change_reader_info( - const eprosima::fastrtps::rtps::ReaderProxyData& reader_data) - { - mutexEntitiesInfoList_.lock(); - auto ret = mapReaderInfoList_.insert(std::make_pair(reader_data.guid(), reader_data)); - - ASSERT_FALSE(ret.second); - eprosima::fastrtps::rtps::ReaderProxyData old_reader_data = ret.first->second; - ret.first->second = reader_data; - - ASSERT_GT(mapTopicCountList_.count(reader_data.topicName().to_string()), 0ul); - - // Remove previous partitions - for (auto partition : old_reader_data.m_qos.m_partition.names()) - { - auto partition_it = mapPartitionCountList_.find(partition); - ASSERT_TRUE(partition_it != mapPartitionCountList_.end()); - --(*partition_it).second; - if ((*partition_it).second == 0) - { - mapPartitionCountList_.erase(partition); - } - } - - for (auto partition : reader_data.m_qos.m_partition.names()) - { - auto ret_partition = mapPartitionCountList_.insert(std::make_pair(partition, 1)); - - if (!ret_partition.second) - { - ++ret_partition.first->second; - } - } - - mutexEntitiesInfoList_.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - void remove_writer_info( - const eprosima::fastrtps::rtps::WriterProxyData& writer_data) - { - std::unique_lock lock(mutexEntitiesInfoList_); - - ASSERT_GT(mapWriterInfoList_.count(writer_data.guid()), 0ul); - - mapWriterInfoList_.erase(writer_data.guid()); - - ASSERT_GT(mapTopicCountList_.count(writer_data.topicName().to_string()), 0ul); - - --mapTopicCountList_[writer_data.topicName().to_string()]; - - for (auto partition : writer_data.m_qos.m_partition.names()) - { - auto partition_it = mapPartitionCountList_.find(partition); - ASSERT_TRUE(partition_it != mapPartitionCountList_.end()); - --(*partition_it).second; - if ((*partition_it).second == 0) - { - mapPartitionCountList_.erase(partition); - } - } - - lock.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - void remove_reader_info( - const eprosima::fastrtps::rtps::ReaderProxyData& reader_data) - { - std::unique_lock lock(mutexEntitiesInfoList_); - - ASSERT_GT(mapReaderInfoList_.count(reader_data.guid()), 0ul); - - mapReaderInfoList_.erase(reader_data.guid()); - - ASSERT_GT(mapTopicCountList_.count(reader_data.topicName().to_string()), 0ul); - - --mapTopicCountList_[reader_data.topicName().to_string()]; - - for (auto partition : reader_data.m_qos.m_partition.names()) - { - auto partition_it = mapPartitionCountList_.find(partition); - ASSERT_TRUE(partition_it != mapPartitionCountList_.end()); - --(*partition_it).second; - if ((*partition_it).second == 0) - { - mapPartitionCountList_.erase(partition); - } - } - - lock.unlock(); - cvEntitiesInfoList_.notify_all(); - } - - PubSubWriter& operator =( - const PubSubWriter&) = delete; - - eprosima::fastrtps::Participant* participant_; - eprosima::fastrtps::ParticipantAttributes participant_attr_; - eprosima::fastrtps::Publisher* publisher_; - eprosima::fastrtps::PublisherAttributes publisher_attr_; - std::string topic_name_; - eprosima::fastrtps::rtps::GUID_t participant_guid_; - eprosima::fastrtps::rtps::GUID_t publisher_guid_; - bool initialized_; - std::mutex mutexDiscovery_; - std::condition_variable cv_; - std::atomic matched_; - unsigned int participant_matched_; - type_support type_; - std::mutex mutexEntitiesInfoList_; - std::condition_variable cvEntitiesInfoList_; - std::map mapWriterInfoList_; - std::map mapReaderInfoList_; - std::map mapTopicCountList_; - std::map mapPartitionCountList_; - bool discovery_result_; - - std::string xml_file_ = ""; - std::string participant_profile_ = ""; - - std::function onDiscovery_; - - //! A mutex for liveliness - std::mutex liveliness_mutex_; - //! A condition variable for liveliness - std::condition_variable liveliness_cv_; - //! The number of times liveliness was lost - unsigned int times_liveliness_lost_; - -#if HAVE_SECURITY - std::mutex mutexAuthentication_; - std::condition_variable cvAuthentication_; - unsigned int authorized_; - unsigned int unauthorized_; -#endif // if HAVE_SECURITY -}; - -#endif // _TEST_BLACKBOX_PUBSUBWRITER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/PubSubWriterReader.hpp b/test/blackbox/api/fastrtps_deprecated/PubSubWriterReader.hpp deleted file mode 100644 index 11621ee7e76..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/PubSubWriterReader.hpp +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PubSubWriterReader.hpp - * - */ - -#ifndef _TEST_BLACKBOX_PUBSUBWRITERREADER_HPP_ -#define _TEST_BLACKBOX_PUBSUBWRITERREADER_HPP_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -template -class PubSubWriterReader -{ - class ParticipantListener : public eprosima::fastrtps::ParticipantListener - { - public: - - ParticipantListener( - PubSubWriterReader& wreader) - : wreader_(wreader) - { - } - - ~ParticipantListener() - { - } - -#if HAVE_SECURITY - void onParticipantAuthentication( - eprosima::fastrtps::Participant*, - eprosima::fastrtps::rtps::ParticipantAuthenticationInfo&& info) override - { - if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::AUTHORIZED_PARTICIPANT) - { - wreader_.authorized(); - } - else if (info.status == eprosima::fastrtps::rtps::ParticipantAuthenticationInfo::UNAUTHORIZED_PARTICIPANT) - { - wreader_.unauthorized(); - } - } - -#endif // if HAVE_SECURITY - void onParticipantDiscovery( - eprosima::fastrtps::Participant* participant, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override - { - (void)participant; - - switch (info.status) - { - case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT: - info_add(discovered_participants_, info.info.m_guid); - break; - - case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT: - info_remove(discovered_participants_, info.info.m_guid); - break; - - case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT: - std::cout << "Participant " << info.info.m_guid << " has been dropped"; - info_remove(discovered_participants_, info.info.m_guid); - break; - - default: - break; - } - } - - void onSubscriberDiscovery( - eprosima::fastrtps::Participant* participant, - eprosima::fastrtps::rtps::ReaderDiscoveryInfo&& info) override - { - (void)participant; - - switch (info.status) - { - case eprosima::fastrtps::rtps::ReaderDiscoveryInfo::DISCOVERED_READER: - info_add(discovered_subscribers_, info.info.guid()); - break; - - case eprosima::fastrtps::rtps::ReaderDiscoveryInfo::REMOVED_READER: - info_remove(discovered_subscribers_, info.info.guid()); - break; - - default: - break; - } - } - - void onPublisherDiscovery( - eprosima::fastrtps::Participant* participant, - eprosima::fastrtps::rtps::WriterDiscoveryInfo&& info) override - { - (void)participant; - - switch (info.status) - { - case eprosima::fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER: - info_add(discovered_publishers_, info.info.guid()); - break; - - case eprosima::fastrtps::rtps::WriterDiscoveryInfo::REMOVED_WRITER: - info_remove(discovered_publishers_, info.info.guid()); - break; - - default: - break; - } - } - - size_t get_num_discovered_participants() const - { - std::lock_guard guard(info_mutex_); - return discovered_participants_.size(); - } - - size_t get_num_discovered_publishers() const - { - std::lock_guard guard(info_mutex_); - return discovered_publishers_.size(); - } - - size_t get_num_discovered_subscribers() const - { - std::lock_guard guard(info_mutex_); - return discovered_subscribers_.size(); - } - - private: - - //! Mutex guarding all info collections - mutable std::mutex info_mutex_; - //! The discovered participants excluding the participant this listener is listening to - std::set discovered_participants_; - //! Number of subscribers discovered - std::set discovered_subscribers_; - //! Number of publishers discovered - std::set discovered_publishers_; - - void info_add( - std::set& collection, - const eprosima::fastrtps::rtps::GUID_t& item) - { - std::lock_guard guard(info_mutex_); - collection.insert(item); - } - - void info_remove( - std::set& collection, - const eprosima::fastrtps::rtps::GUID_t& item) - { - std::lock_guard guard(info_mutex_); - collection.erase(item); - } - - //! Deleted assignment operator - ParticipantListener& operator =( - const ParticipantListener&) = delete; - //! Pointer to the pub sub writer reader - PubSubWriterReader& wreader_; - - } - participant_listener_; - - class PubListener : public eprosima::fastrtps::PublisherListener - { - public: - - PubListener( - PubSubWriterReader& wreader) - : wreader_(wreader) - { - } - - ~PubListener() - { - } - - void onPublicationMatched( - eprosima::fastrtps::Publisher* /*pub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - wreader_.publication_matched(info); - } - else - { - wreader_.publication_unmatched(info); - } - } - - private: - - PubListener& operator =( - const PubListener&) = delete; - - PubSubWriterReader& wreader_; - - } - pub_listener_; - - class SubListener : public eprosima::fastrtps::SubscriberListener - { - public: - - SubListener( - PubSubWriterReader& wreader) - : wreader_(wreader) - { - } - - ~SubListener() - { - } - - void onNewDataMessage( - eprosima::fastrtps::Subscriber* sub) - { - ASSERT_NE(sub, nullptr); - - if (wreader_.receiving_.load()) - { - bool ret = false; - do - { - wreader_.receive_one(sub, ret); - } while (ret); - } - } - - void onSubscriptionMatched( - eprosima::fastrtps::Subscriber* /*sub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - wreader_.subscription_matched(info); - } - else - { - wreader_.subscription_unmatched(info); - } - } - - private: - - SubListener& operator =( - const SubListener&) = delete; - - PubSubWriterReader& wreader_; - } - sub_listener_; - - friend class PubListener; - friend class SubListener; - -public: - - typedef TypeSupport type_support; - typedef typename type_support::type type; - - PubSubWriterReader( - const std::string& topic_name) - : participant_listener_(*this) - , pub_listener_(*this) - , sub_listener_(*this) - , participant_(nullptr) - , publisher_(nullptr) - , subscriber_(nullptr) - , initialized_(false) - , receiving_(false) - , current_received_count_(0) - , number_samples_expected_(0) -#if HAVE_SECURITY - , authorized_(0) - , unauthorized_(0) -#endif // if HAVE_SECURITY - { - publisher_attr_.topic.topicDataType = type_.getName(); - subscriber_attr_.topic.topicDataType = type_.getName(); - // Generate topic name - std::ostringstream t; - t << topic_name << "_" << asio::ip::host_name() << "_" << GET_PID(); - - publisher_attr_.topic.topicName = t.str(); - subscriber_attr_.topic.topicName = t.str(); - topic_name_ = t.str(); - publisher_attr_.topic.topicKind = - type_.m_isGetKeyDefined ? ::eprosima::fastrtps::rtps::WITH_KEY : ::eprosima::fastrtps::rtps::NO_KEY; - subscriber_attr_.topic.topicKind = - type_.m_isGetKeyDefined ? ::eprosima::fastrtps::rtps::WITH_KEY : ::eprosima::fastrtps::rtps::NO_KEY; - - // By default, memory mode is PREALLOCATED_WITH_REALLOC_MEMORY_MODE - publisher_attr_.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - subscriber_attr_.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - - // By default, heartbeat period and nack response delay are 100 milliseconds. - publisher_attr_.times.heartbeatPeriod.seconds = 0; - publisher_attr_.times.heartbeatPeriod.nanosec = 100000000; - publisher_attr_.times.nackResponseDelay.seconds = 0; - publisher_attr_.times.nackResponseDelay.nanosec = 100000000; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - publisher_attr_.qos.m_reliability.max_blocking_time.seconds = 1; - publisher_attr_.qos.m_reliability.max_blocking_time.nanosec = 0; - - // By default, heartbeat period delay is 100 milliseconds. - subscriber_attr_.times.heartbeatResponseDelay.seconds = 0; - subscriber_attr_.times.heartbeatResponseDelay.nanosec = 100000000; - } - - ~PubSubWriterReader() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - } - } - - void init( - bool avoid_multicast = true, - uint32_t initial_pdp_count = 5) - { - //Create participant - participant_attr_.rtps.builtin.avoid_builtin_multicast = avoid_multicast; - participant_attr_.rtps.builtin.discovery_config.initial_announcements.count = initial_pdp_count; - participant_attr_.domainId = (uint32_t)GET_PID() % 230; - participant_ = eprosima::fastrtps::Domain::createParticipant(participant_attr_, &participant_listener_); - - if (participant_ != nullptr) - { - // Register type - eprosima::fastrtps::Domain::registerType(participant_, &type_); - - //Create publisher - publisher_ = eprosima::fastrtps::Domain::createPublisher(participant_, publisher_attr_, &pub_listener_); - - if (publisher_ != nullptr) - { - //Create subscribe r - subscriber_ = eprosima::fastrtps::Domain::createSubscriber(participant_, subscriber_attr_, - &sub_listener_); - - if (subscriber_ != nullptr) - { - initialized_ = true; - return; - } - } - - eprosima::fastrtps::Domain::removeParticipant(participant_); - } - } - - bool create_additional_topics( - size_t num_topics, - const char* suffix, - const eprosima::fastrtps::rtps::PropertySeq& writer_properties = eprosima::fastrtps::rtps::PropertySeq()) - { - (void)writer_properties; - - bool ret_val = initialized_; - if (ret_val) - { - std::string topic_name = publisher_attr_.topic.topicName.c_str(); - - for (size_t i = 0; ret_val && (i < num_topics); i++) - { - topic_name += suffix; - publisher_attr_.topic.topicName = topic_name; - ret_val &= - nullptr != eprosima::fastrtps::Domain::createPublisher(participant_, publisher_attr_, - &pub_listener_); - } - - topic_name = subscriber_attr_.topic.topicName.c_str(); - - for (size_t i = 0; ret_val && (i < num_topics); i++) - { - topic_name += suffix; - subscriber_attr_.topic.topicName = topic_name; - ret_val &= - nullptr != eprosima::fastrtps::Domain::createSubscriber(participant_, subscriber_attr_, - &sub_listener_); - } - } - - return ret_val; - } - - bool isInitialized() const - { - return initialized_; - } - - void destroy() - { - if (participant_ != nullptr) - { - eprosima::fastrtps::Domain::removeParticipant(participant_); - participant_ = nullptr; - } - } - - void send( - std::list& msgs) - { - auto it = msgs.begin(); - - while (it != msgs.end()) - { - if (publisher_->write((void*)&(*it))) - { - default_send_print(*it); - it = msgs.erase(it); - } - else - { - break; - } - } - } - - std::list data_not_received() - { - std::unique_lock lock(mutex_); - return total_msgs_; - } - - void startReception( - std::list& msgs) - { - mutex_.lock(); - total_msgs_ = msgs; - number_samples_expected_ = total_msgs_.size(); - current_received_count_ = 0; - mutex_.unlock(); - - bool ret = false; - do - { - receive_one(subscriber_, ret); - } - while (ret); - - receiving_.store(true); - } - - void stopReception() - { - receiving_.store(false); - } - - void block_for_all() - { - block([this]() -> bool - { - return number_samples_expected_ == current_received_count_; - }); - } - - void block( - std::function checker) - { - std::unique_lock lock(mutex_); - cv_.wait(lock, checker); - } - - void wait_discovery() - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Waiting discovery..." << std::endl; - - if (matched_readers_.size() < 1 || matched_writers_.size() < 1) - { - cvDiscovery_.wait(lock); - } - - ASSERT_GE(matched_readers_.size() + matched_writers_.size(), 2u); - std::cout << "Discovery finished..." << std::endl; - } - - void waitRemoval() - { - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Waiting removal..." << std::endl; - - if (matched_writers_.size() != 0 || matched_readers_.size() != 0) - { - cvDiscovery_.wait(lock); - } - - ASSERT_EQ(matched_readers_.size() + matched_writers_.size(), 0u); - std::cout << "Removal finished..." << std::endl; - } - -#if HAVE_SECURITY - void waitAuthorized( - unsigned int how_many = 1) - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "WReader is waiting authorization..." << std::endl; - - while (authorized_ != how_many) - { - cvAuthentication_.wait(lock); - } - - ASSERT_EQ(authorized_, how_many); - std::cout << "WReader authorization finished..." << std::endl; - } - - void waitUnauthorized( - unsigned int how_many = 1) - { - std::unique_lock lock(mutexAuthentication_); - - std::cout << "WReader is waiting unauthorization..." << std::endl; - - while (unauthorized_ != how_many) - { - cvAuthentication_.wait(lock); - } - - ASSERT_EQ(unauthorized_, how_many); - std::cout << "WReader unauthorization finished..." << std::endl; - } - -#endif // if HAVE_SECURITY - - PubSubWriterReader& pub_durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) - { - publisher_attr_.qos.m_durability.kind = kind; - return *this; - } - - PubSubWriterReader& sub_durability_kind( - const eprosima::fastrtps::DurabilityQosPolicyKind kind) - { - subscriber_attr_.qos.m_durability.kind = kind; - return *this; - } - - PubSubWriterReader& pub_reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) - { - publisher_attr_.qos.m_reliability.kind = kind; - return *this; - } - - PubSubWriterReader& sub_reliability( - const eprosima::fastrtps::ReliabilityQosPolicyKind kind) - { - subscriber_attr_.qos.m_reliability.kind = kind; - return *this; - } - - PubSubWriterReader& pub_history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) - { - publisher_attr_.topic.historyQos.kind = kind; - return *this; - } - - PubSubWriterReader& sub_history_kind( - const eprosima::fastrtps::HistoryQosPolicyKind kind) - { - subscriber_attr_.topic.historyQos.kind = kind; - return *this; - } - - PubSubWriterReader& pub_history_depth( - const int32_t depth) - { - publisher_attr_.topic.historyQos.depth = depth; - return *this; - } - - PubSubWriterReader& sub_history_depth( - const int32_t depth) - { - subscriber_attr_.topic.historyQos.depth = depth; - return *this; - } - - PubSubWriterReader& disable_builtin_transport() - { - participant_attr_.rtps.useBuiltinTransports = false; - return *this; - } - - PubSubWriterReader& add_user_transport_to_pparams( - std::shared_ptr userTransportDescriptor) - { - participant_attr_.rtps.userTransports.push_back(userTransportDescriptor); - return *this; - } - - PubSubWriterReader& property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - participant_attr_.rtps.properties = property_policy; - return *this; - } - - PubSubWriterReader& pub_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - publisher_attr_.properties = property_policy; - return *this; - } - - PubSubWriterReader& sub_property_policy( - const eprosima::fastrtps::rtps::PropertyPolicy property_policy) - { - subscriber_attr_.properties = property_policy; - return *this; - } - - PubSubWriterReader& pub_liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) - { - publisher_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubWriterReader& sub_liveliness_kind( - const eprosima::fastrtps::LivelinessQosPolicyKind kind) - { - subscriber_attr_.qos.m_liveliness.kind = kind; - return *this; - } - - PubSubWriterReader& pub_liveliness_announcement_period( - const eprosima::fastrtps::Duration_t announcement_period) - { - publisher_attr_.qos.m_liveliness.announcement_period = announcement_period; - return *this; - } - - PubSubWriterReader& sub_liveliness_announcement_period( - const eprosima::fastrtps::Duration_t announcement_period) - { - subscriber_attr_.qos.m_liveliness.announcement_period = announcement_period; - return *this; - } - - PubSubWriterReader& pub_liveliness_lease_duration( - const eprosima::fastrtps::Duration_t lease_duration) - { - publisher_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - PubSubWriterReader& sub_liveliness_lease_duration( - const eprosima::fastrtps::Duration_t lease_duration) - { - subscriber_attr_.qos.m_liveliness.lease_duration = lease_duration; - return *this; - } - - void assert_liveliness() - { - publisher_->assert_liveliness(); - } - - size_t get_num_discovered_participants() const - { - return participant_listener_.get_num_discovered_participants(); - } - - size_t get_num_discovered_publishers() const - { - return participant_listener_.get_num_discovered_publishers(); - } - - size_t get_num_discovered_subscribers() const - { - return participant_listener_.get_num_discovered_subscribers(); - } - - size_t get_publication_matched() - { - std::lock_guard guard(mutexDiscovery_); - return matched_writers_.size(); - } - - size_t get_subscription_matched() - { - std::lock_guard guard(mutexDiscovery_); - return matched_readers_.size(); - } - - PubSubWriterReader& add_throughput_controller_descriptor_to_pparams( - eprosima::fastdds::rtps::FlowControllerSchedulerPolicy, - uint32_t bytesPerPeriod, - uint32_t periodInMs) - { - eprosima::fastrtps::rtps::ThroughputControllerDescriptor descriptor {bytesPerPeriod, periodInMs}; - publisher_attr_.throughputController = descriptor; - - return *this; - } - - PubSubWriterReader& asynchronously( - const eprosima::fastrtps::PublishModeQosPolicyKind kind) - { - publisher_attr_.qos.m_publishMode.kind = kind; - return *this; - } - -private: - - void receive_one( - eprosima::fastrtps::Subscriber* subscriber, - bool& returnedValue) - { - returnedValue = false; - type data; - eprosima::fastrtps::SampleInfo_t info; - - if (subscriber->takeNextData((void*)&data, &info)) - { - returnedValue = true; - - std::unique_lock lock(mutex_); - - // Check order of changes. - ASSERT_LT(last_seq, info.sample_identity.sequence_number()); - last_seq = info.sample_identity.sequence_number(); - - if (info.sampleKind == eprosima::fastrtps::rtps::ALIVE) - { - auto it = std::find(total_msgs_.begin(), total_msgs_.end(), data); - ASSERT_NE(it, total_msgs_.end()); - total_msgs_.erase(it); - ++current_received_count_; - default_receive_print(data); - cv_.notify_one(); - } - } - } - - void publication_matched( - eprosima::fastrtps::rtps::MatchingInfo& info) - { - std::lock_guard guard(mutexDiscovery_); - matched_writers_.insert(info.remoteEndpointGuid); - cvDiscovery_.notify_one(); - } - - void publication_unmatched( - eprosima::fastrtps::rtps::MatchingInfo& info) - { - std::lock_guard guard(mutexDiscovery_); - matched_writers_.erase(info.remoteEndpointGuid); - cvDiscovery_.notify_one(); - } - - void subscription_matched( - eprosima::fastrtps::rtps::MatchingInfo& info) - { - std::lock_guard guard(mutexDiscovery_); - matched_readers_.insert(info.remoteEndpointGuid); - cvDiscovery_.notify_one(); - } - - void subscription_unmatched( - eprosima::fastrtps::rtps::MatchingInfo& info) - { - std::lock_guard guard(mutexDiscovery_); - matched_readers_.erase(info.remoteEndpointGuid); - cvDiscovery_.notify_one(); - } - -#if HAVE_SECURITY - void authorized() - { - mutexAuthentication_.lock(); - ++authorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - - void unauthorized() - { - mutexAuthentication_.lock(); - ++unauthorized_; - mutexAuthentication_.unlock(); - cvAuthentication_.notify_all(); - } - -#endif // if HAVE_SECURITY - - PubSubWriterReader& operator =( - const PubSubWriterReader&) = delete; - - eprosima::fastrtps::Participant* participant_; - eprosima::fastrtps::ParticipantAttributes participant_attr_; - - eprosima::fastrtps::Publisher* publisher_; - eprosima::fastrtps::PublisherAttributes publisher_attr_; - - eprosima::fastrtps::Subscriber* subscriber_; - eprosima::fastrtps::SubscriberAttributes subscriber_attr_; - - std::string topic_name_; - bool initialized_; - std::list total_msgs_; - std::mutex mutex_; - std::condition_variable cv_; - std::mutex mutexDiscovery_; - std::condition_variable cvDiscovery_; - std::set matched_writers_; - std::set matched_readers_; - std::atomic receiving_; - type_support type_; - eprosima::fastrtps::rtps::SequenceNumber_t last_seq; - size_t current_received_count_; - size_t number_samples_expected_; -#if HAVE_SECURITY - std::mutex mutexAuthentication_; - std::condition_variable cvAuthentication_; - unsigned int authorized_; - unsigned int unauthorized_; -#endif // if HAVE_SECURITY -}; - -#endif // _TEST_BLACKBOX_PUBSUBWRITER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldReplier.hpp b/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldReplier.hpp deleted file mode 100644 index fcd3f46a4b9..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldReplier.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepAsReliableHelloWorldReplier.hpp - * - */ - -#ifndef _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREPLIER_HPP_ -#define _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREPLIER_HPP_ - -#include "ReqRepHelloWorldReplier.hpp" -#include - -class ReqRepAsReliableHelloWorldReplier : public ReqRepHelloWorldReplier -{ - public: - void configSubscriber(const std::string& suffix) - { - sattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - std::ostringstream t; - - t << "ReqRepAsReliableHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - sattr.topic.topicName = t.str(); - }; - - void configPublisher(const std::string& suffix) - { - puattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - puattr.qos.m_reliability.max_blocking_time.seconds = 1; - puattr.qos.m_reliability.max_blocking_time.nanosec = 0; - - std::ostringstream t; - - t << "ReqRepAsReliableHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - puattr.topic.topicName = t.str(); - } -}; - -#endif // _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREPLIER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldRequester.hpp b/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldRequester.hpp deleted file mode 100644 index d31bd8d207b..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepAsReliableHelloWorldRequester.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepAsReliableHelloWorldRequester.hpp - * - */ - -#ifndef _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREQUESTER_HPP_ -#define _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREQUESTER_HPP_ - -#include "ReqRepHelloWorldRequester.hpp" -#include - - -#if defined(_WIN32) -#define GET_PID _getpid -#else -#define GET_PID getpid -#endif - -class ReqRepAsReliableHelloWorldRequester : public ReqRepHelloWorldRequester -{ - public: - void configSubscriber(const std::string& suffix) - { - sattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - std::ostringstream t; - - t << "ReqRepAsReliableHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - sattr.topic.topicName = t.str(); - }; - - void configPublisher(const std::string& suffix) - { - puattr.qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; - - // Increase default max_blocking_time to 1 second, as our CI infrastructure shows some - // big CPU overhead sometimes - puattr.qos.m_reliability.max_blocking_time.seconds = 1; - puattr.qos.m_reliability.max_blocking_time.nanosec = 0; - - std::ostringstream t; - - t << "ReqRepAsReliableHelloworld_" << asio::ip::host_name() << "_" << GET_PID() << "_" << suffix; - - puattr.topic.topicName = t.str(); - } - - ReqRepAsReliableHelloWorldRequester& durability_kind(const eprosima::fastrtps::DurabilityQosPolicyKind kind) - { - puattr.qos.m_durability.kind = kind; - sattr.qos.m_durability.kind = kind; - return *this; - } -}; - -#endif // _TEST_BLACKBOX_REQREPASRELIABLEHELLOWORLDREQUESTER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp b/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp deleted file mode 100644 index 80fbfbde013..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepHelloWorldReplier.cpp - * - */ - -#include "ReqRepHelloWorldReplier.hpp" - -#include -#include -#include - -#include -#include - -#include - -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -ReqRepHelloWorldReplier::ReqRepHelloWorldReplier() - : request_listener_(*this) - , reply_listener_(*this) - , participant_(nullptr) - , request_subscriber_(nullptr) - , reply_publisher_(nullptr) - , initialized_(false) - , matched_(0) -{ - // By default, memory mode is PREALLOCATED_WITH_REALLOC_MEMORY_MODE - sattr.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - puattr.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE; -} - -ReqRepHelloWorldReplier::~ReqRepHelloWorldReplier() -{ - if (participant_ != nullptr) - { - Domain::removeParticipant(participant_); - } -} - -void ReqRepHelloWorldReplier::init() -{ - ParticipantAttributes pattr; - pattr.domainId = (uint32_t)GET_PID() % 230; - participant_ = Domain::createParticipant(pattr); - ASSERT_NE(participant_, nullptr); - - // Register type - ASSERT_EQ(Domain::registerType(participant_, &type_), true); - - //Create subscriber - sattr.topic.topicKind = NO_KEY; - sattr.topic.topicDataType = type_.getName(); - configSubscriber("Request"); - request_subscriber_ = Domain::createSubscriber(participant_, sattr, &request_listener_); - ASSERT_NE(request_subscriber_, nullptr); - - //Create publisher - puattr.topic.topicKind = NO_KEY; - puattr.topic.topicDataType = type_.getName(); - puattr.topic.topicName = "HelloWorldTopicReply"; - configPublisher("Reply"); - reply_publisher_ = Domain::createPublisher(participant_, puattr, &reply_listener_); - ASSERT_NE(reply_publisher_, nullptr); - - initialized_ = true; -} - -void ReqRepHelloWorldReplier::newNumber( - SampleIdentity sample_identity, - uint16_t number) -{ - WriteParams wparams; - HelloWorld hello; - hello.index(number); - hello.message("GoodBye"); - wparams.related_sample_identity(sample_identity); - ASSERT_EQ(reply_publisher_->write((void*)&hello, wparams), true); -} - -void ReqRepHelloWorldReplier::wait_discovery() -{ - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Replier is waiting discovery..." << std::endl; - - cvDiscovery_.wait(lock, [&]() - { - return matched_ > 1; - }); - - std::cout << "Replier discovery finished..." << std::endl; -} - -void ReqRepHelloWorldReplier::matched() -{ - std::unique_lock lock(mutexDiscovery_); - ++matched_; - if (matched_ > 1) - { - cvDiscovery_.notify_one(); - } -} - -void ReqRepHelloWorldReplier::ReplyListener::onNewDataMessage( - Subscriber* sub) -{ - ASSERT_NE(sub, nullptr); - - HelloWorld hello; - SampleInfo_t info; - - if (sub->takeNextData((void*)&hello, &info)) - { - if (info.sampleKind == ALIVE) - { - ASSERT_EQ(hello.message().compare("HelloWorld"), 0); - replier_.newNumber(info.sample_identity, hello.index()); - } - } -} diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.hpp b/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.hpp deleted file mode 100644 index ca4cd43998b..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldReplier.hpp +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepHelloWorldReplier.hpp - * - */ - -#ifndef _TEST_BLACKBOX_REQREPHELLOWORLDREPLIER_HPP_ -#define _TEST_BLACKBOX_REQREPHELLOWORLDREPLIER_HPP_ - -#include "../../types/HelloWorldPubSubTypes.h" - -#include -#include -#include -#include -#include - -#include -#include - -#if defined(_WIN32) -#define GET_PID _getpid -#include -#else -#define GET_PID getpid -#endif // if defined(_WIN32) - - - -class ReqRepHelloWorldReplier -{ -public: - - class ReplyListener : public eprosima::fastrtps::SubscriberListener - { - public: - - ReplyListener( - ReqRepHelloWorldReplier& replier) - : replier_(replier) - { - } - - ~ReplyListener() - { - } - - void onNewDataMessage( - eprosima::fastrtps::Subscriber* sub); - void onSubscriptionMatched( - eprosima::fastrtps::Subscriber* /*sub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - replier_.matched(); - } - } - - private: - - ReplyListener& operator =( - const ReplyListener&) = delete; - - ReqRepHelloWorldReplier& replier_; - } - request_listener_; - - class RequestListener : public eprosima::fastrtps::PublisherListener - { - public: - - RequestListener( - ReqRepHelloWorldReplier& replier) - : replier_(replier) - { - } - - ~RequestListener() - { - } - - void onPublicationMatched( - eprosima::fastrtps::Publisher* /*pub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - replier_.matched(); - } - } - - private: - - RequestListener& operator =( - const RequestListener&) = delete; - - ReqRepHelloWorldReplier& replier_; - - } - reply_listener_; - - ReqRepHelloWorldReplier(); - virtual ~ReqRepHelloWorldReplier(); - void init(); - bool isInitialized() const - { - return initialized_; - } - - void newNumber( - eprosima::fastrtps::rtps::SampleIdentity sample_identity, - uint16_t number); - void wait_discovery(); - void matched(); - virtual void configSubscriber( - const std::string& suffix) = 0; - virtual void configPublisher( - const std::string& suffix) = 0; - -protected: - - eprosima::fastrtps::SubscriberAttributes sattr; - eprosima::fastrtps::PublisherAttributes puattr; - -private: - - ReqRepHelloWorldReplier& operator =( - const ReqRepHelloWorldReplier&) = delete; - - eprosima::fastrtps::Participant* participant_; - eprosima::fastrtps::Subscriber* request_subscriber_; - eprosima::fastrtps::Publisher* reply_publisher_; - bool initialized_; - std::mutex mutexDiscovery_; - std::condition_variable cvDiscovery_; - unsigned int matched_; - HelloWorldPubSubType type_; -}; - -#endif // _TEST_BLACKBOX_REQREPHELLOWORLDREPLIER_HPP_ diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp b/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp deleted file mode 100644 index 1186a444197..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepHelloWorldRequester.cpp - * - */ - -#include "ReqRepHelloWorldRequester.hpp" - -#include -#include -#include - -#include -#include - -#include - -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -ReqRepHelloWorldRequester::ReqRepHelloWorldRequester() - : reply_listener_(*this) - , request_listener_(*this) - , current_number_(std::numeric_limits::max()) - , number_received_(std::numeric_limits::max()) - , participant_(nullptr) - , reply_subscriber_(nullptr) - , request_publisher_(nullptr) - , initialized_(false) - , matched_(0) -{ - // By default, memory mode is PREALLOCATED_WITH_REALLOC_MEMORY_MODE - sattr.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - puattr.historyMemoryPolicy = PREALLOCATED_WITH_REALLOC_MEMORY_MODE; -} - -ReqRepHelloWorldRequester::~ReqRepHelloWorldRequester() -{ - if (participant_ != nullptr) - { - Domain::removeParticipant(participant_); - } -} - -void ReqRepHelloWorldRequester::init() -{ - ParticipantAttributes pattr; - pattr.domainId = (uint32_t)GET_PID() % 230; - participant_ = Domain::createParticipant(pattr); - ASSERT_NE(participant_, nullptr); - - // Register type - ASSERT_EQ(Domain::registerType(participant_, &type_), true); - - //Create subscriber - sattr.topic.topicKind = NO_KEY; - sattr.topic.topicDataType = type_.getName(); - configSubscriber("Reply"); - reply_subscriber_ = Domain::createSubscriber(participant_, sattr, &reply_listener_); - ASSERT_NE(reply_subscriber_, nullptr); - - //Create publisher - puattr.topic.topicKind = NO_KEY; - puattr.topic.topicDataType = type_.getName(); - configPublisher("Request"); - request_publisher_ = Domain::createPublisher(participant_, puattr, &request_listener_); - ASSERT_NE(request_publisher_, nullptr); - - initialized_ = true; -} - -void ReqRepHelloWorldRequester::init_with_latency( - const eprosima::fastrtps::Duration_t& latency_budget_duration_pub, - const eprosima::fastrtps::Duration_t& latency_budget_duration_sub) -{ - ParticipantAttributes pattr; - participant_ = Domain::createParticipant(pattr); - ASSERT_NE(participant_, nullptr); - - // Register type - ASSERT_EQ(Domain::registerType(participant_, &type_), true); - - //Create subscriber - sattr.topic.topicKind = NO_KEY; - sattr.topic.topicDataType = type_.getName(); - sattr.qos.m_latencyBudget.duration = latency_budget_duration_sub; - reply_subscriber_ = Domain::createSubscriber(participant_, sattr, &reply_listener_); - ASSERT_NE(reply_subscriber_, nullptr); - - //Create publisher - puattr.topic.topicKind = NO_KEY; - puattr.topic.topicDataType = type_.getName(); - puattr.qos.m_latencyBudget.duration = latency_budget_duration_pub; - request_publisher_ = Domain::createPublisher(participant_, puattr, &request_listener_); - ASSERT_NE(request_publisher_, nullptr); - - initialized_ = true; -} - -void ReqRepHelloWorldRequester::newNumber( - SampleIdentity related_sample_identity, - uint16_t number) -{ - std::unique_lock lock(mutex_); - received_sample_identity_ = related_sample_identity; - number_received_ = number; - ASSERT_EQ(current_number_, number_received_); - if (current_number_ == number_received_) - { - cv_.notify_one(); - } -} - -void ReqRepHelloWorldRequester::block( - const std::chrono::seconds& seconds) -{ - std::unique_lock lock(mutex_); - - bool timeout = cv_.wait_for(lock, seconds, [&]() -> bool - { - return current_number_ == number_received_; - }); - - ASSERT_TRUE(timeout); - ASSERT_EQ(current_number_, number_received_); - ASSERT_EQ(related_sample_identity_, received_sample_identity_); -} - -void ReqRepHelloWorldRequester::wait_discovery() -{ - std::unique_lock lock(mutexDiscovery_); - - std::cout << "Requester is waiting discovery..." << std::endl; - - cvDiscovery_.wait(lock, [&]() - { - return matched_ > 1; - }); - - std::cout << "Requester discovery finished..." << std::endl; -} - -void ReqRepHelloWorldRequester::matched() -{ - std::unique_lock lock(mutexDiscovery_); - ++matched_; - if (matched_ > 1) - { - cvDiscovery_.notify_one(); - } -} - -void ReqRepHelloWorldRequester::ReplyListener::onNewDataMessage( - Subscriber* sub) -{ - ASSERT_NE(sub, nullptr); - - HelloWorld hello; - SampleInfo_t info; - - if (sub->takeNextData((void*)&hello, &info)) - { - if (info.sampleKind == ALIVE) - { - ASSERT_EQ(hello.message().compare("GoodBye"), 0); - requester_.newNumber(info.related_sample_identity, hello.index()); - } - } -} - -void ReqRepHelloWorldRequester::send( - const uint16_t number) -{ - WriteParams wparams; - HelloWorld hello; - hello.index(number); - hello.message("HelloWorld"); - - { - std::unique_lock lock(mutex_); - current_number_ = number; - } - - ASSERT_EQ(request_publisher_->write((void*)&hello, wparams), true); - related_sample_identity_ = wparams.sample_identity(); - ASSERT_NE(related_sample_identity_.sequence_number(), SequenceNumber_t()); -} diff --git a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.hpp b/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.hpp deleted file mode 100644 index 54969d83e75..00000000000 --- a/test/blackbox/api/fastrtps_deprecated/ReqRepHelloWorldRequester.hpp +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file ReqRepHelloWorldRequester.hpp - * - */ - -#ifndef _TEST_BLACKBOX_REQREPHELLOWORLDREQUESTER_HPP_ -#define _TEST_BLACKBOX_REQREPHELLOWORLDREQUESTER_HPP_ - -#include "../../types/HelloWorldPubSubTypes.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -#if defined(_WIN32) -#include -#define GET_PID _getpid -#else -#define GET_PID getpid -#endif // if defined(_WIN32) - - - -class ReqRepHelloWorldRequester -{ -public: - - class ReplyListener : public eprosima::fastrtps::SubscriberListener - { - public: - - ReplyListener( - ReqRepHelloWorldRequester& requester) - : requester_(requester) - { - } - - ~ReplyListener() - { - } - - void onNewDataMessage( - eprosima::fastrtps::Subscriber* sub); - void onSubscriptionMatched( - eprosima::fastrtps::Subscriber* /*sub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - requester_.matched(); - } - } - - private: - - ReplyListener& operator =( - const ReplyListener&) = delete; - - ReqRepHelloWorldRequester& requester_; - } - reply_listener_; - - class RequestListener : public eprosima::fastrtps::PublisherListener - { - public: - - RequestListener( - ReqRepHelloWorldRequester& requester) - : requester_(requester) - { - } - - ~RequestListener() - { - } - - void onPublicationMatched( - eprosima::fastrtps::Publisher* /*pub*/, - eprosima::fastrtps::rtps::MatchingInfo& info) - { - if (info.status == eprosima::fastrtps::rtps::MATCHED_MATCHING) - { - requester_.matched(); - } - } - - private: - - RequestListener& operator =( - const RequestListener&) = delete; - - ReqRepHelloWorldRequester& requester_; - - } - request_listener_; - - ReqRepHelloWorldRequester(); - virtual ~ReqRepHelloWorldRequester(); - void init(); - void init_with_latency( - const eprosima::fastrtps::Duration_t& latency_budget_duration_pub, - const eprosima::fastrtps::Duration_t& latency_budget_duration_sub); - bool isInitialized() const - { - return initialized_; - } - - void newNumber( - eprosima::fastrtps::rtps::SampleIdentity related_sample_identity, - uint16_t number); - void block( - const std::chrono::seconds& seconds); - void wait_discovery(); - void matched(); - void send( - const uint16_t number); - - const eprosima::fastrtps::Duration_t datawriter_latency_budget_duration() const - { - return request_publisher_->getAttributes().qos.m_latencyBudget.duration; - } - - const eprosima::fastrtps::Duration_t datareader_latency_budget_duration() const - { - return reply_subscriber_->getAttributes().qos.m_latencyBudget.duration; - } - - virtual void configSubscriber( - const std::string& suffix) - { - (void) suffix; - } - - virtual void configPublisher( - const std::string& suffix) - { - (void) suffix; - } - -protected: - - eprosima::fastrtps::PublisherAttributes puattr; - eprosima::fastrtps::SubscriberAttributes sattr; - -private: - - ReqRepHelloWorldRequester& operator =( - const ReqRepHelloWorldRequester&) = delete; - - uint16_t current_number_; - uint16_t number_received_; - eprosima::fastrtps::Participant* participant_; - eprosima::fastrtps::Subscriber* reply_subscriber_; - eprosima::fastrtps::Publisher* request_publisher_; - bool initialized_; - std::mutex mutex_; - std::condition_variable cv_; - std::mutex mutexDiscovery_; - std::condition_variable cvDiscovery_; - unsigned int matched_; - HelloWorldPubSubType type_; - eprosima::fastrtps::rtps::SampleIdentity related_sample_identity_; - eprosima::fastrtps::rtps::SampleIdentity received_sample_identity_; -}; - -#endif // _TEST_BLACKBOX_REQREPHELLOWORLDREQUESTER_HPP_ diff --git a/test/blackbox/auth_handshake_props_profile.xml b/test/blackbox/auth_handshake_props_profile.xml index 7cb8d4b1421..a79746b46b7 100644 --- a/test/blackbox/auth_handshake_props_profile.xml +++ b/test/blackbox/auth_handshake_props_profile.xml @@ -1,5 +1,5 @@ - + 0 diff --git a/test/blackbox/builtin_transports_profile.xml b/test/blackbox/builtin_transports_profile.xml index 750e4391f5e..6ee611b4b9f 100644 --- a/test/blackbox/builtin_transports_profile.xml +++ b/test/blackbox/builtin_transports_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/common/BlackboxTests.cpp b/test/blackbox/common/BlackboxTests.cpp index 55eee5beb5a..784693520e8 100644 --- a/test/blackbox/common/BlackboxTests.cpp +++ b/test/blackbox/common/BlackboxTests.cpp @@ -14,16 +14,17 @@ #include "BlackboxTests.hpp" +#include +#include +#include +#include + #include -#include -#include +#include #include - -#include -#include -#include -#include +#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -64,9 +65,9 @@ class BlackboxEnvironment : public ::testing::Environment // conditions related to network packets being lost should not use intraprocess // nor datasharing. Setting it off here ensures that intraprocess and // datasharing are only tested when required. - LibrarySettingsAttributes att; - att.intraprocess_delivery = INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(att); enable_datasharing = false; use_pull_mode = false; use_udpv4 = true; diff --git a/test/blackbox/common/BlackboxTestsDeadlineQos.cpp b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp index b97bd366859..c891c387feb 100644 --- a/test/blackbox/common/BlackboxTestsDeadlineQos.cpp +++ b/test/blackbox/common/BlackboxTestsDeadlineQos.cpp @@ -14,11 +14,10 @@ #include +#include +#include #include -#include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -41,12 +40,12 @@ class DeadlineQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -59,12 +58,12 @@ class DeadlineQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/BlackboxTestsDiscovery.cpp b/test/blackbox/common/BlackboxTestsDiscovery.cpp index 6894fe523e5..9b1dde81a14 100644 --- a/test/blackbox/common/BlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/BlackboxTestsDiscovery.cpp @@ -26,13 +26,12 @@ #include #include #include +// #include #include #include #include -#include #include -#include #include "BlackboxTests.hpp" #include "DatagramInjectionTransport.hpp" @@ -58,12 +57,12 @@ class Discovery : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -76,12 +75,12 @@ class Discovery : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -99,7 +98,7 @@ TEST_P(Discovery, ParticipantRemoval) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -195,11 +194,11 @@ void static_discovery_test( LocatorBuffer.port = static_cast(MULTICAST_PORT_RANDOM_NUMBER); WriterMulticastLocators.push_back(LocatorBuffer); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .property_policy(writer_property_policy); writer.static_discovery("file://PubSubWriter_static_disc.xml").reliability( - eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). unicastLocatorList(WriterUnicastLocators).multicastLocatorList(WriterMulticastLocators). setPublisherIDs(1, 2).setManualTopicName(std::string("BlackBox_StaticDiscovery_") + TOPIC_RANDOM_NUMBER).init(); @@ -230,9 +229,9 @@ void static_discovery_test( ReaderMulticastLocators.push_back(LocatorBuffer); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .property_policy(reader_property_policy); reader.static_discovery("file://PubSubReader_static_disc.xml"). unicastLocatorList(ReaderUnicastLocators).multicastLocatorList(ReaderMulticastLocators). @@ -325,9 +324,9 @@ TEST(Discovery, StaticDiscoveryFromString) PubSubWriter writer(TEST_TOPIC_NAME); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS); std::string writer_xml = "data://" \ "" \ "" \ @@ -354,9 +353,9 @@ TEST(Discovery, StaticDiscoveryFromString) PubSubReader reader(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS); std::string reader_xml = "data://" \ "" \ "" \ @@ -438,7 +437,7 @@ TEST(Discovery, EndpointRediscovery) reader.disable_builtin_transport(); reader.add_user_transport_to_pparams(testTransport); - reader.lease_duration({ 3, 0 }, { 1, 0 }).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reader.lease_duration({ 3, 0 }, { 1, 0 }).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -475,7 +474,7 @@ TEST(Discovery, EndpointRediscovery_2) auto testTransport = std::make_shared(); - reader.lease_duration({ 120, 0 }, { 1, 0 }).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reader.lease_duration({ 120, 0 }, { 1, 0 }).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -509,8 +508,8 @@ TEST(Discovery, EndpointRediscoveryWithTransientLocalData) reader .lease_duration({ 120, 0 }, { 1, 0 }) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -521,8 +520,8 @@ TEST(Discovery, EndpointRediscoveryWithTransientLocalData) writer .lease_duration({ 2, 0 }, { 1, 0 }) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(writer.isInitialized()); @@ -573,7 +572,7 @@ TEST(Discovery, ParticipantLivelinessAssertion) reader.disable_builtin_transport().add_user_transport_to_pparams(test_transport). lease_duration({ 0, 800000000 }, - { 0, 500000000 }).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + { 0, 500000000 }).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -658,7 +657,7 @@ TEST(Discovery, LocalInitialPeers) reader.metatraffic_unicast_locator_list(reader_default_unicast_locator). initial_peers(reader_initial_peers). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -700,7 +699,7 @@ TEST_P(Discovery, PubSubAsReliableHelloworldPartitions) reader.history_depth(10). partition("PartitionTests"). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -827,7 +826,7 @@ TEST(Discovery, LocalInitialPeersDiferrentLocators) metatraffic_unicast_locator_list(writer_metatraffic_unicast). lease_duration(c_TimeInfinite, { 3600, 0 }). initial_announcements(0, {}). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS); + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS); } // Configure reader participants: @@ -855,7 +854,7 @@ TEST(Discovery, LocalInitialPeersDiferrentLocators) initial_announcements(1, {0, 100 * 1000 * 1000}). metatraffic_unicast_locator_list(reader_metatraffic_unicast). initial_peers(reader_initial_peers). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS); + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS); } // Start writer and first reader, and wait for them to discover @@ -914,7 +913,7 @@ TEST_P(Discovery, PubSubAsReliableHelloworldParticipantDiscovery) }); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -954,7 +953,7 @@ TEST_P(Discovery, PubSubAsReliableHelloworldUserData) }); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -992,7 +991,7 @@ TEST_P(Discovery, PubSubAsReliableHelloworldEndpointUserData) }); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -1190,16 +1189,16 @@ TEST_P(Discovery, RepeatPubGuid) PubSubWriter writer2(TEST_TOPIC_NAME); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .participant_id(2) .init(); writer - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .participant_id(1) .init(); @@ -1225,9 +1224,9 @@ TEST_P(Discovery, RepeatPubGuid) reader.wait_participant_undiscovery(); writer2 - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .participant_id(1) .init(); @@ -2155,8 +2154,10 @@ TEST(Discovery, discovery_cyclone_participant_with_custom_pid) void on_participant_discovery( DomainParticipant*, - ParticipantDiscoveryInfo&& info) override + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override { + should_be_ignored = false; if (ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT == info.status) { discovered_participants_++; diff --git a/test/blackbox/common/BlackboxTestsKeys.cpp b/test/blackbox/common/BlackboxTestsKeys.cpp index 5e58a978b7b..7a55e9891e9 100644 --- a/test/blackbox/common/BlackboxTestsKeys.cpp +++ b/test/blackbox/common/BlackboxTestsKeys.cpp @@ -162,7 +162,7 @@ TEST(KeyedTopic, UnregisterWhenHistoryKeepAll) PubSubWriter writer(TEST_TOPIC_NAME); writer. - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). init(); ASSERT_TRUE(writer.isInitialized()); @@ -290,14 +290,14 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) writer. resource_limits_max_instances(1). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). init(); ASSERT_TRUE(writer.isInitialized()); reader. resource_limits_max_instances(1). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -341,14 +341,14 @@ TEST(KeyedTopic, DataWriterAlwaysSendTheSerializedKeyViaInlineQoS) writer. resource_limits_max_instances(1). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). init(); ASSERT_TRUE(writer.isInitialized()); reader. resource_limits_max_instances(1). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); diff --git a/test/blackbox/common/BlackboxTestsLifespanQoS.cpp b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp index d27f72a2656..d4656d832d2 100644 --- a/test/blackbox/common/BlackboxTestsLifespanQoS.cpp +++ b/test/blackbox/common/BlackboxTestsLifespanQoS.cpp @@ -12,17 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include - -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -40,12 +38,12 @@ class LifespanQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -58,12 +56,12 @@ class LifespanQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -93,11 +91,11 @@ TEST_P(LifespanQos, LongLifespan) // Lifespan period in milliseconds uint32_t lifespan_ms = 10000; - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .lifespan_period(lifespan_ms * 1e-3) .init(); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -146,10 +144,10 @@ TEST_P(LifespanQos, ShortLifespan) // Lifespan period in milliseconds uint32_t lifespan_ms = 1; - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .lifespan_period(lifespan_ms * 1e-3) .init(); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .lifespan_period(lifespan_ms * 1e-3) .init(); diff --git a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp index 662cf66ec4e..10c012dbbe3 100644 --- a/test/blackbox/common/BlackboxTestsLivelinessQos.cpp +++ b/test/blackbox/common/BlackboxTestsLivelinessQos.cpp @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #include +#include +#include +#include + +#include "BlackboxTests.hpp" +#include "PubSubParticipant.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "PubSubWriterReader.hpp" -#include "PubSubParticipant.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" #include @@ -44,12 +44,12 @@ class LivelinessQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -62,12 +62,12 @@ class LivelinessQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -1719,7 +1719,7 @@ TEST_P(LivelinessQos, LivelinessChangedStatus_Alive_NotAlive) writer.wait_discovery(); reader.wait_discovery(); - LivelinessChangedStatus status = reader.liveliness_changed_status(); + eprosima::fastdds::dds::LivelinessChangedStatus status = reader.liveliness_changed_status(); EXPECT_EQ(status.alive_count, 0); EXPECT_EQ(status.alive_count_change, 0); EXPECT_EQ(status.not_alive_count, 0); @@ -1782,7 +1782,7 @@ TEST_P(LivelinessQos, LivelinessChangedStatus_Alive_Unmatched) writer.assert_liveliness(); reader.wait_liveliness_recovered(); - LivelinessChangedStatus status = reader.liveliness_changed_status(); + eprosima::fastdds::dds::LivelinessChangedStatus status = reader.liveliness_changed_status(); EXPECT_EQ(status.alive_count, 1); EXPECT_EQ(status.alive_count_change, 1); EXPECT_EQ(status.not_alive_count, 0); @@ -1835,7 +1835,7 @@ TEST_P(LivelinessQos, LivelinessChangedStatus_NotAlive_Unmatched) writer.assert_liveliness(); reader.wait_liveliness_recovered(); - LivelinessChangedStatus status = reader.liveliness_changed_status(); + eprosima::fastdds::dds::LivelinessChangedStatus status = reader.liveliness_changed_status(); EXPECT_EQ(status.alive_count, 1); EXPECT_EQ(status.alive_count_change, 1); EXPECT_EQ(status.not_alive_count, 0); @@ -1904,9 +1904,9 @@ TEST_P(LivelinessQos, AssertLivelinessParticipant) TEST(LivelinessTests, Detect_Deadlock_ManualByParticipant_Intraprocess) { // Set up intraprocess - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); // Create two participants PubSubWriterReader participantA(TEST_TOPIC_NAME), participantB(TEST_TOPIC_NAME); diff --git a/test/blackbox/common/BlackboxTestsNetworkConf.cpp b/test/blackbox/common/BlackboxTestsNetworkConf.cpp index 07746f416be..bfd907d04e6 100644 --- a/test/blackbox/common/BlackboxTestsNetworkConf.cpp +++ b/test/blackbox/common/BlackboxTestsNetworkConf.cpp @@ -16,14 +16,14 @@ #include #include +#include +#include + #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "PubSubParticipant.hpp" -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -186,8 +186,8 @@ TEST_P(NetworkConfig, PubSubOutLocatorSelection) reader.disable_builtin_transport().add_user_transport_to_pparams(descriptor_); } - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). resource_limits_allocated_samples(2). resource_limits_max_samples(2).init(); @@ -195,9 +195,9 @@ TEST_P(NetworkConfig, PubSubOutLocatorSelection) descriptor_->m_output_udp_socket = static_cast(locator.port); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_kind( - eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).history_kind( + eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS). resource_limits_allocated_samples(20). disable_builtin_transport(). add_user_transport_to_pparams(descriptor_). @@ -229,14 +229,14 @@ TEST_P(NetworkConfig, PubSubInterfaceWhitelistLocalhost) descriptor_->interfaceWhiteList.push_back(ip); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).history_depth(10). disable_multicast(0). disable_builtin_transport(). add_user_transport_to_pparams(descriptor_).init(); ASSERT_TRUE(reader.isInitialized()); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).history_depth(10). disable_multicast(1). disable_builtin_transport(). add_user_transport_to_pparams(descriptor_).init(); @@ -278,20 +278,20 @@ void interface_whitelist_test( } // include the interfaces in the transport descriptor - for (const auto& interface : pub_interfaces) + for (const auto& network_interface : pub_interfaces) { if (!interface_name) { - pub_udp_descriptor->interfaceWhiteList.push_back(interface.name); + pub_udp_descriptor->interfaceWhiteList.push_back(network_interface.name); } else { - pub_udp_descriptor->interfaceWhiteList.push_back(interface.dev); + pub_udp_descriptor->interfaceWhiteList.push_back(network_interface.dev); } } // Set the transport descriptor WITH interfaces in the writer - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).history_depth(10). disable_builtin_transport(). add_user_transport_to_pparams(pub_udp_descriptor).init(); @@ -309,20 +309,20 @@ void interface_whitelist_test( } // include the interfaces in the transport descriptor - for (const auto& interface : sub_interfaces) + for (const auto& network_interface : sub_interfaces) { if (!interface_name) { - sub_udp_descriptor->interfaceWhiteList.push_back(interface.name); + sub_udp_descriptor->interfaceWhiteList.push_back(network_interface.name); } else { - sub_udp_descriptor->interfaceWhiteList.push_back(interface.dev); + sub_udp_descriptor->interfaceWhiteList.push_back(network_interface.dev); } } // Set the transport descriptor WITH interfaces in the reader - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).history_depth(10). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).history_depth(10). disable_builtin_transport(). add_user_transport_to_pparams(sub_udp_descriptor).init(); @@ -588,10 +588,11 @@ TEST_P(NetworkConfig, PubGetSendingLocatorsWhitelist) constexpr uint32_t port = 31337u; descriptor_->m_output_udp_socket = static_cast(port); - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - std::cout << "Adding interface '" << interface.name << "' (" << interface.name.size() << ")" << std::endl; - descriptor_->interfaceWhiteList.push_back(interface.name); + std::cout << "Adding interface '" << network_interface.name << "' (" << network_interface.name.size() << ")" << + std::endl; + descriptor_->interfaceWhiteList.push_back(network_interface.name); } writer.disable_builtin_transport(). diff --git a/test/blackbox/common/BlackboxTestsPubSubBasic.cpp b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp index 913991e1b53..029e80c573e 100644 --- a/test/blackbox/common/BlackboxTestsPubSubBasic.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubBasic.cpp @@ -12,8 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "BlackboxTests.hpp" #include "mock/BlackboxMockConsumer.h" #include "PubSubParticipant.hpp" #include "PubSubReader.hpp" @@ -21,17 +31,6 @@ #include "ReqRepAsReliableHelloWorldReplier.hpp" #include "ReqRepAsReliableHelloWorldRequester.hpp" -#include -#include -#include - -#include - -#include -#include -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -48,12 +47,12 @@ class PubSubBasic : public testing::TestWithParam(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -68,12 +67,12 @@ class PubSubBasic : public testing::TestWithParam(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -149,7 +148,7 @@ TEST_P(PubSubBasic, PubSubAsNonReliableHelloworld) ASSERT_TRUE(reader.isInitialized()); - writer.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS).init(); + writer.reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS).init(); ASSERT_TRUE(writer.isInitialized()); @@ -178,8 +177,8 @@ TEST_P(PubSubBasic, AsyncPubSubAsNonReliableHelloworld) ASSERT_TRUE(reader.isInitialized()); writer.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -204,7 +203,7 @@ TEST_P(PubSubBasic, PubSubAsReliableHelloworld) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -235,12 +234,12 @@ TEST_P(PubSubBasic, AsyncPubSubAsReliableHelloworld) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); writer.history_depth(100). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -291,7 +290,7 @@ TEST_P(PubSubBasic, PubSubAsReliableData64kb) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -320,8 +319,8 @@ TEST_P(PubSubBasic, PubSubMoreThan256Unacknowledged) { PubSubWriter writer(TEST_TOPIC_NAME); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS).init(); + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS).init(); ASSERT_TRUE(writer.isInitialized()); @@ -333,9 +332,9 @@ TEST_P(PubSubBasic, PubSubMoreThan256Unacknowledged) PubSubReader reader(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS).init(); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -350,7 +349,7 @@ TEST_P(PubSubBasic, PubSubAsReliableHelloworldMulticastDisabled) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). disable_multicast(0).init(); ASSERT_TRUE(reader.isInitialized()); @@ -392,7 +391,7 @@ TEST_P(PubSubBasic, ReceivedDynamicDataWithNoSizeLimit) reader.history_depth(100) .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -427,7 +426,7 @@ TEST_P(PubSubBasic, ReceivedDynamicDataWithinSizeLimit) .partitions_max_size(28) .history_depth(100) .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -458,7 +457,7 @@ TEST_P(PubSubBasic, ReceivedUserDataExceedsSizeLimit) reader.user_data_max_size(4) .history_depth(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -483,7 +482,7 @@ TEST_P(PubSubBasic, ReceivedPartitionDataExceedsSizeLimit) reader.partitions_max_size(20) .history_depth(100) .partition("A") - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -880,8 +879,8 @@ TEST_P(PubSubBasic, ReliableHelloworldLateJoinersStress) readers.emplace_back(new PubSubReader(TEST_TOPIC_NAME)); const auto& new_reader = readers.back(); - new_reader->reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + new_reader->reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .history_depth(10) .init(); ASSERT_TRUE(new_reader->isInitialized()) << " on iteration " << i; diff --git a/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp index 439ad1c548e..3c742ba5fa8 100644 --- a/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFlowControllers.cpp @@ -16,8 +16,6 @@ #include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -50,7 +48,7 @@ TEST_P(PubSubFlowControllers, AsyncPubSubAsReliableData64kbWithParticipantFlowCo PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(3). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -59,7 +57,7 @@ TEST_P(PubSubFlowControllers, AsyncPubSubAsReliableData64kbWithParticipantFlowCo writer.add_throughput_controller_descriptor_to_pparams(scheduler_policy_, bytesPerPeriod, periodInMs); writer.history_depth(3). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -86,7 +84,7 @@ TEST_P(PubSubFlowControllers, AsyncPubSubAsReliableData64kbWithParticipantFlowCo PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(3). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -99,7 +97,7 @@ TEST_P(PubSubFlowControllers, AsyncPubSubAsReliableData64kbWithParticipantFlowCo writer.add_user_transport_to_pparams(testTransport); writer.history_depth(3). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -126,14 +124,14 @@ TEST_P(PubSubFlowControllers, AsyncPubSubWithFlowController64kb) PubSubWriter slowWriter(TEST_TOPIC_NAME); reader.history_depth(2). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); uint32_t sizeToClear = 68000; //68kb uint32_t periodInMs = 1000; //1sec slowWriter.history_depth(2). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams(scheduler_policy_, sizeToClear, periodInMs).init(); ASSERT_TRUE(slowWriter.isInitialized()); @@ -165,17 +163,17 @@ TEST_P(PubSubFlowControllers, AsyncMultipleWritersFlowController64kb) // Readers configuration entities.sub_history_depth(3). - sub_durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). - sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + sub_durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS). + sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); // Writers configuration. uint32_t bytesPerPeriod = 68000; uint32_t periodInMs = 500; entities.add_throughput_controller_descriptor_to_pparams(scheduler_policy_, bytesPerPeriod, periodInMs). pub_history_depth(3). - pub_durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). - pub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); + pub_durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS). + pub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE); // Creation. entities.init(); diff --git a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp index 4200871f920..0442eac6fc0 100644 --- a/test/blackbox/common/BlackboxTestsPubSubFragments.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubFragments.cpp @@ -14,13 +14,16 @@ #include +#include #include -#include +#include + +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -42,12 +45,12 @@ class PubSubFragments : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -62,12 +65,12 @@ class PubSubFragments : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -98,11 +101,11 @@ class PubSubFragments : public testing::TestWithParam .socket_buffer_size(1048576) // accomodate large and fast fragments .history_depth(static_cast(data.size())) .reliability(reliable ? - eprosima::fastrtps::RELIABLE_RELIABILITY_QOS : - eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS : + eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .durability_kind(volatile_reader ? - eprosima::fastrtps::VOLATILE_DURABILITY_QOS : - eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS : + eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -140,18 +143,18 @@ class PubSubFragments : public testing::TestWithParam if (asynchronous) { - writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + writer.asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams(scheduler_policy_, 0, 0); } writer .history_depth(static_cast(data.size())) .reliability(reliable ? - eprosima::fastrtps::RELIABLE_RELIABILITY_QOS : - eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS : + eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .durability_kind(volatile_writer ? - eprosima::fastrtps::VOLATILE_DURABILITY_QOS : - eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS : + eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(writer.isInitialized()); @@ -369,8 +372,8 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsNonReliableData300kbWithFlowControl) uint32_t periodInMs = 50; writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams(scheduler_policy_, bytesPerPeriod, periodInMs).init(); ASSERT_TRUE(writer.isInitialized()); @@ -397,7 +400,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbWithFlowControl) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -407,7 +410,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbWithFlowControl) uint32_t periodInMs = 50; writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams(scheduler_policy_, bytesPerPeriod, periodInMs).init(); ASSERT_TRUE(writer.isInitialized()); @@ -435,7 +438,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditions) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -457,7 +460,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditions) writer.add_user_transport_to_pparams(testTransport); writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -489,7 +492,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -511,8 +514,8 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond writer.add_user_transport_to_pparams(testTransport); writer.history_depth(5). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -544,7 +547,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditionsSm PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -568,7 +571,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableData300kbInLossyConditionsSm writer.add_user_transport_to_pparams(testTransport); writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -600,7 +603,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableKeyedData300kbKeepLast1InLos PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(2) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -623,7 +626,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableKeyedData300kbKeepLast1InLos .heartbeat_period_seconds(0) .heartbeat_period_nanosec(1000000) .history_depth(1) - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -715,7 +718,7 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -739,8 +742,8 @@ TEST_P(PubSubFragmentsLimited, AsyncPubSubAsReliableVolatileData300kbInLossyCond writer.add_user_transport_to_pparams(testTransport); writer.history_depth(5). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -774,7 +777,7 @@ TEST_P(PubSubFragmentsLimited, AsyncFragmentSizeTest) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -790,7 +793,7 @@ TEST_P(PubSubFragmentsLimited, AsyncFragmentSizeTest) testTransport->receiveBufferSize = 65536; writer.disable_builtin_transport(); writer.add_user_transport_to_pparams(testTransport); - writer.history_depth(10).asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + writer.history_depth(10).asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -820,7 +823,7 @@ TEST_P(PubSubFragmentsLimited, AsyncFragmentSizeTest) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -837,7 +840,7 @@ TEST_P(PubSubFragmentsLimited, AsyncFragmentSizeTest) writer.disable_builtin_transport(); writer.add_user_transport_to_pparams(testTransport); writer.history_depth(10). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); diff --git a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp index b0f047e95dc..f8c894e1ac5 100644 --- a/test/blackbox/common/BlackboxTestsPubSubHistory.cpp +++ b/test/blackbox/common/BlackboxTestsPubSubHistory.cpp @@ -16,14 +16,16 @@ #include #include +#include +#include #include -#include +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastdds::rtps; @@ -43,12 +45,12 @@ class PubSubHistory : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -73,12 +75,12 @@ class PubSubHistory : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (std::get<0>(GetParam())) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -103,7 +105,7 @@ TEST_P(PubSubHistory, PubSubAsNonReliableKeepLastReaderSmallDepth) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(2). resource_limits_allocated_samples(2). resource_limits_max_samples(2).mem_policy(mem_policy_).init(); @@ -112,7 +114,7 @@ TEST_P(PubSubHistory, PubSubAsNonReliableKeepLastReaderSmallDepth) // Needs a deeper pool for datasharing // because reader does not process anything until everything is sent - writer.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + writer.reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .resource_limits_extra_samples(10).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -150,8 +152,8 @@ TEST_P(PubSubHistory, CacheChangeReleaseTest) PubSubWriter writer(TEST_TOPIC_NAME); //Reader Config - reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS); - reader.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS); + reader.reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS); + reader.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); reader.history_depth(1); reader.resource_limits_allocated_samples(1); reader.resource_limits_max_samples(1); @@ -190,7 +192,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastReaderSmallDepth) PubSubWriter writer(TEST_TOPIC_NAME); reader.reliability(RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(2). resource_limits_allocated_samples(2). resource_limits_max_samples(2).mem_policy(mem_policy_).init(); @@ -251,7 +253,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWriterSmallDepth) ASSERT_TRUE(reader.isInitialized()); writer. - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(2).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -279,14 +281,14 @@ TEST(PubSubHistory, PubSubKeepAll) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). resource_limits_allocated_samples(2). resource_limits_max_samples(2).init(); ASSERT_TRUE(reader.isInitialized()); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). max_blocking_time({0, 0}). resource_limits_allocated_samples(2). resource_limits_max_samples(2).init(); @@ -337,15 +339,15 @@ TEST(PubSubHistory, PubSubKeepAllTransient) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). resource_limits_allocated_samples(2). resource_limits_max_samples(2).init(); ASSERT_TRUE(reader.isInitialized()); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS). max_blocking_time({0, 0}). resource_limits_allocated_samples(2). resource_limits_max_samples(2).init(); @@ -399,8 +401,8 @@ TEST_P(PubSubHistory, PubReliableKeepAllSubNonReliable) ASSERT_TRUE(reader.isInitialized()); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). resource_limits_allocated_samples(1). resource_limits_max_samples(1).mem_policy(mem_policy_).init(); @@ -428,10 +430,10 @@ TEST_P(PubSubHistory, StatefulReaderCacheChangeRelease) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(2). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.history_depth(2). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); writer.wait_discovery(); @@ -474,7 +476,7 @@ TEST_P(PubSubHistory, PubSubAsReliableMultithreadKeepLast1) PubSubWriter writer(TEST_TOPIC_NAME); reader.history_depth(1). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); @@ -522,7 +524,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastReaderSmallDepthTwoPublishers) reader .reliability(RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(1) .resource_limits_allocated_samples(1) .resource_limits_max_samples(1); @@ -591,13 +593,13 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWithKey) uint32_t keys = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -624,15 +626,15 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstance) uint32_t keys = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.resource_limits_max_instances(keys) .resource_limits_max_samples_per_instance(1) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -670,8 +672,8 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif constexpr uint32_t samples_per_instance = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -682,8 +684,8 @@ TEST(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamplesPerInstanceAndLif writer.resource_limits_max_instances(keys) .resource_limits_max_samples_per_instance(samples_per_instance) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .max_blocking_time(max_block_time_ms * 1e-3) .lifespan_period(lifespan_ms * 1e-3) .disable_builtin_transport() @@ -730,16 +732,16 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndInfiniteMaxSamplesPerInst uint32_t keys = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.resource_limits_max_instances(keys) .resource_limits_max_samples(0) .resource_limits_max_samples_per_instance(0) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -776,15 +778,15 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndInfiniteMaxInstances) uint32_t keys = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.resource_limits_max_samples(0) .resource_limits_max_instances(0) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -821,8 +823,8 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamples) uint32_t keys = 2; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); @@ -830,8 +832,8 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithKeyAndMaxSamples) .resource_limits_max_samples(4) .resource_limits_allocated_samples(2) .resource_limits_max_samples_per_instance(2) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -865,15 +867,15 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepAllWithoutKeyAndMaxSamples) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); writer.resource_limits_max_samples(2) .resource_limits_allocated_samples(2) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -915,8 +917,8 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastReaderSmallDepthWithKey) resource_limits_allocated_samples(keys * depth). resource_limits_max_instances(keys). resource_limits_max_samples_per_instance(depth). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); @@ -925,7 +927,7 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastReaderSmallDepthWithKey) resource_limits_allocated_samples(keys * depth). resource_limits_max_instances(keys). resource_limits_max_samples_per_instance(depth). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); @@ -964,8 +966,8 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWithKeyUnorderedReception) uint32_t depth = 10; reader.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(depth).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); @@ -974,8 +976,8 @@ TEST_P(PubSubHistory, PubSubAsReliableKeepLastWithKeyUnorderedReception) testTransport->dropDataMessagesPercentage = 25; writer.resource_limits_max_instances(keys). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS). history_depth(depth).mem_policy(mem_policy_). disable_builtin_transport().add_user_transport_to_pparams(testTransport). init(); @@ -1026,9 +1028,9 @@ TEST_P(PubSubHistory, ReliableTransientLocalKeepLast1) PubSubWriter writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) .resource_limits_allocated_samples(10) .resource_limits_max_samples(10).mem_policy(mem_policy_).init(); @@ -1039,9 +1041,9 @@ TEST_P(PubSubHistory, ReliableTransientLocalKeepLast1) auto expected_data = data; writer.send(data); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(1).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); @@ -1071,8 +1073,8 @@ TEST_P(PubSubHistory, ReliableTransientLocalKeepLast1Data300Kb) writer .history_depth(static_cast(data.size())) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .disable_builtin_transport().add_user_transport_to_pparams(transport) .mem_policy(mem_policy_).init(); @@ -1084,10 +1086,10 @@ TEST_P(PubSubHistory, ReliableTransientLocalKeepLast1Data300Kb) ASSERT_FALSE(reader_data.empty()); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(1) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .disable_builtin_transport().add_user_transport_to_pparams(transport) .mem_policy(mem_policy_).init(); @@ -1180,7 +1182,7 @@ TEST_P(PubSubHistory, WriterUnmatchClearsHistory) reader.history_depth(2).reliability(RELIABLE_RELIABILITY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(reader.isInitialized()); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS).mem_policy(mem_policy_).init(); + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer.isInitialized()); // Wait for discovery. @@ -1201,7 +1203,7 @@ TEST_P(PubSubHistory, WriterUnmatchClearsHistory) // Create another writer and send more data // Reader should be able to get the new data - writer2.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS).mem_policy(mem_policy_).init(); + writer2.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS).mem_policy(mem_policy_).init(); ASSERT_TRUE(writer2.isInitialized()); writer2.wait_discovery(); reader.wait_discovery(); @@ -1236,7 +1238,7 @@ TEST_P(PubSubHistory, KeepAllWriterContinueSendingAfterReaderMatched) reader.reliability(RELIABLE_RELIABILITY_QOS); writer.reliability(RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .resource_limits_allocated_samples(1) .resource_limits_max_samples(1); @@ -1317,9 +1319,9 @@ TEST(PubSubHistory, ReliableUnmatchWithFutureChanges) const uint32_t depth = 10; - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).history_depth(depth). + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).history_depth(depth). init(); ASSERT_TRUE(reader.isInitialized()); @@ -1355,8 +1357,8 @@ TEST(PubSubHistory, ReliableUnmatchWithFutureChanges) return drop_heartbeat && !writer_guid.is_builtin(); }; - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS).history_depth(depth). + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS).history_depth(depth). disable_builtin_transport().add_user_transport_to_pparams(testTransport). init(); diff --git a/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp index 1ccebb749a6..1c19d1bfb2d 100644 --- a/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp +++ b/test/blackbox/common/BlackboxTestsRealtimeAllocations.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -36,12 +36,12 @@ class RealtimeAllocations : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -54,12 +54,12 @@ class RealtimeAllocations : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -81,7 +81,7 @@ TEST_P(RealtimeAllocations, PubSubReliableWithLimitedSubscribers) reader .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -103,7 +103,7 @@ TEST_P(RealtimeAllocations, PubSubReliableWithLimitedSubscribers) reader2 .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader2.isInitialized()); reader2.wait_discovery(); @@ -133,13 +133,13 @@ TEST_P(RealtimeAllocations, AsyncPubSubReliableWithLimitedSubscribers) reader .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); writer - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .matched_readers_allocation(1u, 1u) @@ -156,7 +156,7 @@ TEST_P(RealtimeAllocations, AsyncPubSubReliableWithLimitedSubscribers) reader2 .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader2.isInitialized()); reader2.wait_discovery(); @@ -193,7 +193,7 @@ TEST_P(RealtimeAllocations, PubSubBestEffortWithLimitedSubscribers) writer .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .matched_readers_allocation(1u, 1u) .expect_no_allocs() .init(); @@ -242,10 +242,10 @@ TEST_P(RealtimeAllocations, AsyncPubSubBestEffortWithLimitedSubscribers) ASSERT_TRUE(reader.isInitialized()); writer - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .matched_readers_allocation(1u, 1u) .expect_no_allocs() .init(); @@ -291,7 +291,7 @@ TEST_P(RealtimeAllocations, PubSubReliableWithLimitedPublishers) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .matched_writers_allocation(1u, 1u) .expect_no_allocs() - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -348,13 +348,13 @@ TEST_P(RealtimeAllocations, AsyncPubSubReliableWithLimitedPublishers) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .matched_writers_allocation(1u, 1u) .expect_no_allocs() - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); writer - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); @@ -367,7 +367,7 @@ TEST_P(RealtimeAllocations, AsyncPubSubReliableWithLimitedPublishers) // Initialize second writer and wait until it discovers the reader writer2 - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); @@ -412,7 +412,7 @@ TEST_P(RealtimeAllocations, PubSubBestEffortWithLimitedPublishers) ASSERT_TRUE(reader.isInitialized()); writer - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); @@ -425,7 +425,7 @@ TEST_P(RealtimeAllocations, PubSubBestEffortWithLimitedPublishers) // Initialize second writer and wait until it discovers the reader writer2 - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); @@ -470,8 +470,8 @@ TEST_P(RealtimeAllocations, AsyncPubSubBestEffortWithLimitedPublishers) ASSERT_TRUE(reader.isInitialized()); writer - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); @@ -484,8 +484,8 @@ TEST_P(RealtimeAllocations, AsyncPubSubBestEffortWithLimitedPublishers) // Initialize second writer and wait until it discovers the reader writer2 - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .history_depth(10) .resource_limits_max_samples(10).resource_limits_allocated_samples(10) .init(); diff --git a/test/blackbox/common/BlackboxTestsReliability.cpp b/test/blackbox/common/BlackboxTestsReliability.cpp index 50e37c33f42..871a4f18e4e 100644 --- a/test/blackbox/common/BlackboxTestsReliability.cpp +++ b/test/blackbox/common/BlackboxTestsReliability.cpp @@ -16,12 +16,12 @@ #include -#include +// TODO(jlbueno): remove private header +#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -57,8 +57,8 @@ void reliability_disable_heartbeat_piggyback( return false; }; - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(1) .heartbeat_period_seconds(180000) .disable_heartbeat_piggyback(disable_heartbeat_piggyback) @@ -67,8 +67,8 @@ void reliability_disable_heartbeat_piggyback( .init(); writer_id = writer.datawriter_guid().entityId; - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); diff --git a/test/blackbox/common/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp index a4f9afc5a65..05a9bf8292b 100644 --- a/test/blackbox/common/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -16,26 +16,27 @@ #if HAVE_SECURITY -#include #include +#include #include #include +#include +#include +#include +#include +#include #include +// TODO(jlbueno): remove private header +#include + +#include "PubSubParticipant.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "PubSubWriterReader.hpp" -#include "PubSubParticipant.hpp" #include "UDPMessageSender.hpp" -#include -#include -#include -#include - -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; @@ -54,12 +55,12 @@ class Security : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -72,12 +73,12 @@ class Security : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -251,7 +252,7 @@ TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_validation_ok) "file://" + std::string(certs_path) + "/mainsubkey.pem")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -306,7 +307,7 @@ TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_validation_ok_same_participan property_policy.properties().emplace_back(Property("dds.sec.auth.builtin.PKI-DH.private_key", "file://" + std::string(certs_path) + "/mainpubkey.pem")); - wreader.sub_history_depth(10).sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + wreader.sub_history_depth(10).sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); wreader.pub_history_depth(10); wreader.property_policy(property_policy).init(); @@ -336,7 +337,7 @@ TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_validation_fail) PropertyPolicy pub_property_policy; reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); @@ -373,7 +374,7 @@ TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_validation_fail) "file://" + std::string(certs_path) + "/mainsubkey.pem")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -404,7 +405,7 @@ TEST_P(Security, BuiltinAuthenticationPlugin_PKIDH_lossy_conditions) "file://" + std::string(certs_path) + "/mainsubkey.pem")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); // To simulate lossy conditions, we are going to remove the default @@ -695,7 +696,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_rtps_ok) pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -767,7 +768,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_shm_transport_ok) pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -841,7 +842,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_shm_udp_transport_ok) pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -886,7 +887,7 @@ TEST(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_rtps_ok) sub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -948,7 +949,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_rtps_ok_same_participant) "builtin.AES-GCM-GMAC")); property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); - wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .sub_durability_kind(eprosima::fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS); wreader.property_policy(property_policy).init(); @@ -1006,7 +1007,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_large_string) pub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -1051,7 +1052,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_rtps_large_string sub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -1135,8 +1136,8 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_rtps_data300kb) uint32_t periodInMs = 500; writer.history_depth(5). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_property_policy).init(); @@ -1183,7 +1184,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_rtps_data300kb) sub_property_policy.properties().emplace_back("rtps.participant.rtps_protection_kind", "ENCRYPT"); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -1206,7 +1207,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_rtps_data300kb) uint32_t periodInMs = 50; writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_property_policy).init(); @@ -1272,7 +1273,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_submessage_ok) pub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -1319,7 +1320,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_submessage_ok) sub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -1384,7 +1385,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_submessage_ok_same_partici pub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); sub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); - wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .sub_durability_kind(eprosima::fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS); wreader.property_policy(property_policy). pub_property_policy(pub_property_policy). @@ -1446,7 +1447,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_submessage_larg pub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -1493,7 +1494,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_submessage_large_ sub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -1581,8 +1582,8 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_submessage_data uint32_t periodInMs = 500; writer.history_depth(5). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -1631,7 +1632,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_submessage_data30 sub_property_policy.properties().emplace_back("rtps.endpoint.submessage_protection_kind", "ENCRYPT"); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -1655,7 +1656,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_submessage_data30 uint32_t periodInMs = 50; writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -1722,7 +1723,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_payload_ok) pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -1769,7 +1770,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_payload_ok) sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -1834,7 +1835,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_payload_ok_same_participan pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); - wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .sub_durability_kind(eprosima::fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS); wreader.property_policy(property_policy). pub_property_policy(pub_property_policy). @@ -1875,7 +1876,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_payload_ok_same_participan pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); - wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + wreader.pub_history_depth(10).sub_history_depth(10).sub_reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .sub_durability_kind(eprosima::fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS); wreader.property_policy(property_policy). pub_property_policy(pub_property_policy). @@ -1937,7 +1938,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_payload_large_s pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -1984,7 +1985,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_payload_large_str sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2072,8 +2073,8 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_payload_data300 uint32_t periodInMs = 500; writer.history_depth(5). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -2122,7 +2123,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_payload_data300kb sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2146,7 +2147,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_payload_data300kb uint32_t periodInMs = 50; writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -2217,7 +2218,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_all_ok) pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -2266,7 +2267,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_ok) sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2355,7 +2356,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_all_large_strin pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); writer.history_depth(10). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -2404,7 +2405,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_large_string) sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2498,8 +2499,8 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_besteffort_all_data300kb) uint32_t periodInMs = 1000; writer.history_depth(5). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -2550,7 +2551,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_data300kb) sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2576,7 +2577,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_data300kb) uint32_t periodInMs = 50; writer.history_depth(5). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). property_policy(pub_part_property_policy). @@ -2628,7 +2629,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_data300kb_mix sub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); reader.history_depth(5). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2649,7 +2650,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_reliable_all_data300kb_mix pub_property_policy.properties().emplace_back("rtps.endpoint.payload_protection_kind", "ENCRYPT"); writer.history_depth(2).resource_limits_max_samples(2).resource_limits_allocated_samples(2). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). property_policy(pub_part_property_policy). entity_property_policy(pub_property_policy).init(); @@ -2741,7 +2742,7 @@ TEST_P(Security, BuiltinAuthenticationAndCryptoPlugin_user_data) }); reader.history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_part_property_policy). entity_property_policy(sub_property_policy).init(); @@ -2791,7 +2792,7 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_governance_rule_o "file://" + std::string(certs_path) + "/permissions.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -3072,7 +3073,7 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_valid "file://" + std::string(certs_path) + "/permissions_helloworld.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -3213,7 +3214,7 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_valid "file://" + std::string(certs_path) + "/permissions_helloworld_partitions.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy). partition("Partition1").init(); @@ -3413,7 +3414,7 @@ void prepare_pkcs11_nodes( "file://" + std::string(certs_path) + "/permissions_helloworld.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); pub_property_policy.properties().emplace_back(Property("dds.sec.auth.plugin", @@ -3583,7 +3584,7 @@ static void BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation { CommonPermissionsConfigure(reader, writer, governance_file, "permissions.smime"); - reader.history_depth(10).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reader.history_depth(10).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); writer.history_depth(10).init(); @@ -3618,10 +3619,10 @@ TEST_P(Security, RemoveParticipantProxyDataonSecurityManagerLeaseExpired_validat //!Lambda for configuring publisher participant qos and security properties auto secure_participant_pub_configurator = [&governance_file, &permissions_file](const std::shared_ptr>& part, - const std::shared_ptr& interface) + const std::shared_ptr& transport_interface) { part->lease_duration(3, 1); - part->disable_builtin_transport().add_user_transport_to_pparams(interface); + part->disable_builtin_transport().add_user_transport_to_pparams(transport_interface); PropertyPolicy property_policy; @@ -3655,10 +3656,10 @@ TEST_P(Security, RemoveParticipantProxyDataonSecurityManagerLeaseExpired_validat //!Lambda for configuring subscriber participant qos and security properties auto secure_participant_sub_configurator = [&governance_file, &permissions_file](const std::shared_ptr>& part, - const std::shared_ptr& interface) + const std::shared_ptr& transport_interface) { part->lease_duration(3, 1); - part->disable_builtin_transport().add_user_transport_to_pparams(interface); + part->disable_builtin_transport().add_user_transport_to_pparams(transport_interface); PropertyPolicy property_policy; @@ -3811,7 +3812,7 @@ TEST(Security, AllowUnauthenticatedParticipants_TwoSecureParticipantsWithDiffere "file://" + std::string(certs_path) + "/permissions_helloworld_securehelloworld_other_ca.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -3836,7 +3837,7 @@ TEST(Security, AllowUnauthenticatedParticipants_TwoSecureParticipantsWithDiffere "file://" + std::string(certs_path) + "/permissions_helloworld_securehelloworld.smime")); writer.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -3894,7 +3895,7 @@ TEST(Security, AllowUnauthenticatedParticipants_TwoParticipantsDifferentCertific "file://" + std::string(certs_path) + "/permissions_helloworld_securehelloworld_other_ca.smime")); reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(sub_property_policy).init(); ASSERT_TRUE(reader.isInitialized()); @@ -3919,7 +3920,7 @@ TEST(Security, AllowUnauthenticatedParticipants_TwoParticipantsDifferentCertific "file://" + std::string(certs_path) + "/permissions_helloworld_securehelloworld.smime")); writer.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). property_policy(pub_property_policy).init(); ASSERT_TRUE(writer.isInitialized()); @@ -3950,17 +3951,17 @@ TEST(Security, InANonSecureParticipantWithTwoSecureParticipantScenario_TheTwoSec CommonPermissionsConfigure(secure_reader, secure_writer, governance_file, permissions_file); secure_writer.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(secure_writer.isInitialized()); non_secure_reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(non_secure_reader.isInitialized()); secure_reader.history_depth(10). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(secure_reader.isInitialized()); @@ -4738,8 +4739,8 @@ TEST(Security, MaliciousHeartbeatIgnore) reader.add_to_unicast_locator_list("127.0.0.1", 7000); // Set common QoS - reader.history_depth(10).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); - writer.history_depth(10).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.history_depth(10).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); + writer.history_depth(10).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); // Configure security const std::string governance_file("governance_helloworld_all_enable.smime"); @@ -4851,8 +4852,8 @@ TEST_P(Security, MaliciousParticipantRemovalIgnore) }; // Set common QoS - reader.history_depth(10).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); - writer.history_depth(10).reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.history_depth(10).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); + writer.history_depth(10).reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); // Configure security const std::string governance_file("governance_helloworld_all_enable.smime"); diff --git a/test/blackbox/common/BlackboxTestsTransportCustom.cpp b/test/blackbox/common/BlackboxTestsTransportCustom.cpp index 6c65d2a3f8d..f0ebca33fcf 100644 --- a/test/blackbox/common/BlackboxTestsTransportCustom.cpp +++ b/test/blackbox/common/BlackboxTestsTransportCustom.cpp @@ -231,11 +231,11 @@ class BuiltinTransportsTest PubSubReader reader(TEST_TOPIC_NAME); // Reliable keep all to wait of all acked as end condition - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); // Builtin transport configuration according to test_case switch (test_case) @@ -360,7 +360,7 @@ TEST(ChainingTransportTests, basic_test) reader.disable_builtin_transport() .add_user_transport_to_pparams(reader_transport) .property_policy(test_property_policy) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -469,7 +469,7 @@ TEST(ChainingTransportTests, tcp_client_server_with_wan_correct_sender_resources reader.disable_builtin_transport() .add_user_transport_to_pparams(reader_transport) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .property_policy(test_property_policy) .metatraffic_unicast_locator_list(reader_locators) .set_default_unicast_locators(reader_locators) diff --git a/test/blackbox/common/BlackboxTestsTransportSHM.cpp b/test/blackbox/common/BlackboxTestsTransportSHM.cpp index ae971bd35d3..71bc97a30c4 100644 --- a/test/blackbox/common/BlackboxTestsTransportSHM.cpp +++ b/test/blackbox/common/BlackboxTestsTransportSHM.cpp @@ -46,11 +46,11 @@ TEST(SHM, TransportPubSub) auto testTransport = std::make_shared(); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); writer.disable_builtin_transport(). add_user_transport_to_pparams(testTransport).init(); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); reader.disable_builtin_transport(). add_user_transport_to_pparams(testTransport).init(); @@ -151,19 +151,19 @@ TEST(SHM, IgnoreNonExistentSegment) PubSubWriter writer(TEST_TOPIC_NAME); writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(std::make_shared()) .init(); ASSERT_TRUE(writer.isInitialized()); reader - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(std::make_shared()) .init(); @@ -192,8 +192,8 @@ TEST(SHM, IgnoreNonExistentSegment) { PubSubWriter late_writer(TEST_TOPIC_NAME); late_writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(std::make_shared()) .init(); @@ -240,14 +240,14 @@ TEST(SHM, Test300KFragmentation) shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .init(); reader - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .init(); @@ -292,14 +292,14 @@ TEST(SHM, Test300KNoFragmentation) shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; writer - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .init(); reader - .reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS) .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .init(); @@ -351,15 +351,15 @@ TEST(SHM, SHM_UDP_300KFragmentation) shm_transport->big_buffer_size_send_count_ = &big_buffers_send_count; shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; - writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); writer .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .add_user_transport_to_pparams(udp_transport) .init(); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); reader .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) @@ -415,14 +415,14 @@ TEST(SHM, UDPvsSHM_UDP) shm_transport->big_buffer_size_send_count_ = &big_buffers_send_count; shm_transport->big_buffer_size_recv_count_ = &big_buffers_recv_count; - writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); writer .disable_builtin_transport() .add_user_transport_to_pparams(udp_transport) .init(); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); reader .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) @@ -471,15 +471,15 @@ TEST(SHM, SHM_UDPvsUDP) auto udp_transport = std::make_shared(); - writer.asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); writer .disable_builtin_transport() .add_user_transport_to_pparams(shm_transport) .add_user_transport_to_pparams(udp_transport) .init(); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); reader .disable_builtin_transport() .add_user_transport_to_pparams(udp_transport) diff --git a/test/blackbox/common/BlackboxTestsTransportTCP.cpp b/test/blackbox/common/BlackboxTestsTransportTCP.cpp index 80897508aec..538e65898a8 100644 --- a/test/blackbox/common/BlackboxTestsTransportTCP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportTCP.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include "../api/dds-pim/TCPReqRepHelloWorldRequester.hpp" #include "../api/dds-pim/TCPReqRepHelloWorldReplier.hpp" @@ -51,11 +51,11 @@ class TransportTCP : public testing::TestWithParam(); + test_transport_ = std::make_shared(); } else { - test_transport_ = std::make_shared(); + test_transport_ = std::make_shared(); } } @@ -64,7 +64,7 @@ class TransportTCP : public testing::TestWithParam test_transport_; + std::shared_ptr test_transport_; }; // TCP and Domain management with logical ports tests @@ -528,8 +528,8 @@ TEST_P(TransportTCP, TCPLocalhost) TEST_P(TransportTCP, TCPv4_equal_operator) { // TCPv4TransportDescriptor - TCPv4TransportDescriptor tcpv4_transport_1; - TCPv4TransportDescriptor tcpv4_transport_2; + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport_1; + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport_2; // Compare equal in defult values ASSERT_EQ(tcpv4_transport_1, tcpv4_transport_2); @@ -548,15 +548,15 @@ TEST_P(TransportTCP, TCPv4_equal_operator) // Test copy constructor and copy assignment for TCPv4 TEST_P(TransportTCP, TCPv4_copy) { - TCPv4TransportDescriptor tcpv4_transport; + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport; tcpv4_transport.set_WAN_address("80.80.99.45"); // Copy constructor - TCPv4TransportDescriptor tcpv4_transport_copy_constructor(tcpv4_transport); + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport_copy_constructor(tcpv4_transport); EXPECT_EQ(tcpv4_transport, tcpv4_transport_copy_constructor); // Copy assignment - TCPv4TransportDescriptor tcpv4_transport_copy = tcpv4_transport; + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport_copy = tcpv4_transport; EXPECT_EQ(tcpv4_transport_copy, tcpv4_transport); } @@ -564,7 +564,7 @@ TEST_P(TransportTCP, TCPv4_copy) TEST_P(TransportTCP, TCPv4_get_WAN_address) { // TCPv4TransportDescriptor - TCPv4TransportDescriptor tcpv4_transport; + eprosima::fastdds::rtps::TCPv4TransportDescriptor tcpv4_transport; tcpv4_transport.set_WAN_address("80.80.99.45"); ASSERT_EQ(tcpv4_transport.get_WAN_address(), "80.80.99.45"); } @@ -573,8 +573,8 @@ TEST_P(TransportTCP, TCPv4_get_WAN_address) TEST_P(TransportTCP, TCPv6_equal_operator) { // TCPv6TransportDescriptor - TCPv6TransportDescriptor tcpv6_transport_1; - TCPv6TransportDescriptor tcpv6_transport_2; + eprosima::fastdds::rtps::TCPv6TransportDescriptor tcpv6_transport_1; + eprosima::fastdds::rtps::TCPv6TransportDescriptor tcpv6_transport_2; // Compare equal in defult values ASSERT_EQ(tcpv6_transport_1, tcpv6_transport_2); @@ -599,17 +599,17 @@ TEST_P(TransportTCP, TCPv6_equal_operator) TEST_P(TransportTCP, TCPv6_copy) { // Change some varibles in order to check the non default creation - TCPv6TransportDescriptor tcpv6_transport; + eprosima::fastdds::rtps::TCPv6TransportDescriptor tcpv6_transport; tcpv6_transport.enable_tcp_nodelay = !tcpv6_transport.enable_tcp_nodelay; // change default value tcpv6_transport.max_logical_port = tcpv6_transport.max_logical_port + 10; // change default value tcpv6_transport.add_listener_port(123u * 98u); // Copy constructor - TCPv6TransportDescriptor tcpv6_transport_copy_constructor(tcpv6_transport); + eprosima::fastdds::rtps::TCPv6TransportDescriptor tcpv6_transport_copy_constructor(tcpv6_transport); EXPECT_EQ(tcpv6_transport, tcpv6_transport_copy_constructor); // Copy assignment - TCPv6TransportDescriptor tcpv6_transport_copy = tcpv6_transport; + eprosima::fastdds::rtps::TCPv6TransportDescriptor tcpv6_transport_copy = tcpv6_transport; EXPECT_EQ(tcpv6_transport_copy, tcpv6_transport); } @@ -681,7 +681,7 @@ TEST_P(TransportTCP, TCPv4_autofill_port) PubSubReader p2(TEST_TOPIC_NAME); // Add TCP Transport with listening port 0 - auto p1_transport = std::make_shared(); + auto p1_transport = std::make_shared(); p1_transport->add_listener_port(0); p1.disable_builtin_transport().add_user_transport_to_pparams(p1_transport); p1.init(); @@ -689,7 +689,7 @@ TEST_P(TransportTCP, TCPv4_autofill_port) // Add TCP Transport with listening port different from 0 uint16_t port = 12345; - auto p2_transport = std::make_shared(); + auto p2_transport = std::make_shared(); p2_transport->add_listener_port(port); p2.disable_builtin_transport().add_user_transport_to_pparams(p2_transport); p2.init(); @@ -711,7 +711,7 @@ TEST_P(TransportTCP, TCPv6_autofill_port) PubSubReader p2(TEST_TOPIC_NAME); // Add TCP Transport with listening port 0 - auto p1_transport = std::make_shared(); + auto p1_transport = std::make_shared(); p1_transport->add_listener_port(0); p1.disable_builtin_transport().add_user_transport_to_pparams(p1_transport); p1.init(); @@ -719,7 +719,7 @@ TEST_P(TransportTCP, TCPv6_autofill_port) // Add TCP Transport with listening port different from 0 uint16_t port = 12345; - auto p2_transport = std::make_shared(); + auto p2_transport = std::make_shared(); p2_transport->add_listener_port(port); p2.disable_builtin_transport().add_user_transport_to_pparams(p2_transport); p2.init(); @@ -851,14 +851,14 @@ TEST_P(TransportTCP, multiple_listening_ports) uint16_t server_port_1 = 10000; uint16_t server_port_2 = 10001; - std::shared_ptr server_transport; + std::shared_ptr server_transport; if (use_ipv6) { - server_transport = std::make_shared(); + server_transport = std::make_shared(); } else { - server_transport = std::make_shared(); + server_transport = std::make_shared(); } server_transport->add_listener_port(server_port_1); server_transport->add_listener_port(server_port_2); @@ -868,14 +868,14 @@ TEST_P(TransportTCP, multiple_listening_ports) // Create two clients each one connecting to a different port PubSubWriter* client_1 = new PubSubWriter(TEST_TOPIC_NAME); PubSubWriter* client_2 = new PubSubWriter(TEST_TOPIC_NAME); - std::shared_ptr client_transport_1; - std::shared_ptr client_transport_2; + std::shared_ptr client_transport_1; + std::shared_ptr client_transport_2; Locator_t initialPeerLocator_1; Locator_t initialPeerLocator_2; if (use_ipv6) { - client_transport_1 = std::make_shared(); - client_transport_2 = std::make_shared(); + client_transport_1 = std::make_shared(); + client_transport_2 = std::make_shared(); initialPeerLocator_1.kind = LOCATOR_KIND_TCPv6; initialPeerLocator_2.kind = LOCATOR_KIND_TCPv6; IPLocator::setIPv6(initialPeerLocator_1, "::1"); @@ -883,8 +883,8 @@ TEST_P(TransportTCP, multiple_listening_ports) } else { - client_transport_1 = std::make_shared(); - client_transport_2 = std::make_shared(); + client_transport_1 = std::make_shared(); + client_transport_2 = std::make_shared(); initialPeerLocator_1.kind = LOCATOR_KIND_TCPv4; initialPeerLocator_2.kind = LOCATOR_KIND_TCPv4; IPLocator::setIPv4(initialPeerLocator_1, 127, 0, 0, 1); @@ -989,17 +989,17 @@ TEST_P(TransportTCP, send_resource_cleanup) // Client auto initialize_client = [&](PubSubWriter* client) { - std::shared_ptr client_transport; + std::shared_ptr client_transport; Locator_t initialPeerLocator; if (use_ipv6) { - client_transport = std::make_shared(); + client_transport = std::make_shared(); initialPeerLocator.kind = LOCATOR_KIND_TCPv6; IPLocator::setIPv6(initialPeerLocator, "::1"); } else { - client_transport = std::make_shared(); + client_transport = std::make_shared(); initialPeerLocator.kind = LOCATOR_KIND_TCPv4; IPLocator::setIPv4(initialPeerLocator, 127, 0, 0, 1); } @@ -1012,7 +1012,7 @@ TEST_P(TransportTCP, send_resource_cleanup) }; auto initialize_udp_participant = [&](PubSubWriter* udp_participant) { - auto udp_participant_transport = std::make_shared(); + auto udp_participant_transport = std::make_shared(); udp_participant->disable_builtin_transport().add_user_transport_to_pparams(udp_participant_transport); udp_participant->init(); }; @@ -1132,7 +1132,7 @@ TEST_P(TransportTCP, send_resource_cleanup_initial_peer) initial_peer_list.push_back(initialPeerLocator); client->initial_peers(initial_peer_list); - auto low_level_transport = std::make_shared(); + auto low_level_transport = std::make_shared(); auto client_chaining_transport = std::make_shared(low_level_transport); client->disable_builtin_transport().add_user_transport_to_pparams(test_transport_).add_user_transport_to_pparams( client_chaining_transport).init(); @@ -1141,14 +1141,14 @@ TEST_P(TransportTCP, send_resource_cleanup_initial_peer) // Server auto initialize_server = [&](PubSubReader* server) { - std::shared_ptr server_transport; + std::shared_ptr server_transport; if (use_ipv6) { - server_transport = std::make_shared(); + server_transport = std::make_shared(); } else { - server_transport = std::make_shared(); + server_transport = std::make_shared(); } server_transport->add_listener_port(server_port); server->disable_builtin_transport().add_user_transport_to_pparams(server_transport); @@ -1156,7 +1156,7 @@ TEST_P(TransportTCP, send_resource_cleanup_initial_peer) }; auto initialize_udp_participant = [&](PubSubReader* udp_participant) { - auto udp_participant_transport = std::make_shared(); + auto udp_participant_transport = std::make_shared(); udp_participant->disable_builtin_transport().add_user_transport_to_pparams(udp_participant_transport); udp_participant->init(); }; @@ -1233,8 +1233,8 @@ TEST_P(TransportTCP, large_message_send_receive) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - std::shared_ptr writer_transport; - std::shared_ptr reader_transport; + std::shared_ptr writer_transport; + std::shared_ptr reader_transport; Locator_t initialPeerLocator; if (use_ipv6) { diff --git a/test/blackbox/common/BlackboxTestsTransportUDP.cpp b/test/blackbox/common/BlackboxTestsTransportUDP.cpp index fd9c8e66355..3cf325e7566 100644 --- a/test/blackbox/common/BlackboxTestsTransportUDP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportUDP.cpp @@ -18,10 +18,10 @@ #include +#include #include #include -#include -#include +#include #include "BlackboxTests.hpp" #include "DatagramInjectionTransport.hpp" @@ -388,7 +388,7 @@ TEST_P(TransportUDP, DefaultMulticastLocatorsParticipant) // Checking correct copying of participant metatraffic locators to the datawriters/datatreaders TEST_P(TransportUDP, MetatrafficMulticastLocatorsParticipant) { - Log::SetVerbosity(Log::Kind::Warning); + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Warning); size_t writer_samples = 5; @@ -465,7 +465,7 @@ TEST_P(TransportUDP, DefaultMulticastLocatorsParticipantZeroPort) // Checking correct copying of participant metatraffic locators to the datawriters/datatreaders TEST_P(TransportUDP, MetatrafficMulticastLocatorsParticipantZeroPort) { - Log::SetVerbosity(Log::Kind::Warning); + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Warning); size_t writer_samples = 5; diff --git a/test/blackbox/common/BlackboxTestsVolatile.cpp b/test/blackbox/common/BlackboxTestsVolatile.cpp index 6351d0baea1..4a9b03d0878 100644 --- a/test/blackbox/common/BlackboxTestsVolatile.cpp +++ b/test/blackbox/common/BlackboxTestsVolatile.cpp @@ -12,17 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +// TODO(jlbueno): remove private header +#include + +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include "ReqRepAsReliableHelloWorldRequester.hpp" #include "ReqRepAsReliableHelloWorldReplier.hpp" - -#include -#include -#include -#include +#include "ReqRepAsReliableHelloWorldRequester.hpp" using namespace eprosima::fastrtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; @@ -41,12 +43,12 @@ class Volatile : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -59,12 +61,12 @@ class Volatile : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -83,7 +85,7 @@ TEST_P(Volatile, PubSubAsReliableVolatilePubRemoveWithoutSubs) PubSubWriter writer(TEST_TOPIC_NAME); writer.history_depth(10). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init(); + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS).init(); ASSERT_TRUE(writer.isInitialized()); @@ -109,9 +111,9 @@ TEST_P(Volatile, AsyncPubSubAsNonReliableVolatileHelloworld) ASSERT_TRUE(reader.isInitialized()); writer.history_depth(100). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE).init(); + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE).init(); ASSERT_TRUE(writer.isInitialized()); @@ -136,8 +138,8 @@ TEST_P(Volatile, AsyncVolatileKeepAllPubReliableSubNonReliable300Kb) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -147,12 +149,12 @@ TEST_P(Volatile, AsyncVolatileKeepAllPubReliableSubNonReliable300Kb) uint32_t bytesPerPeriod = 65536; uint32_t periodInMs = 50; - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). add_throughput_controller_descriptor_to_pparams( eprosima::fastdds::rtps::FlowControllerSchedulerPolicy::FIFO, bytesPerPeriod, periodInMs). init(); @@ -180,15 +182,15 @@ TEST_P(Volatile, VolatileKeepAllPubReliableSubNonReliableHelloWorld) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). init(); @@ -216,18 +218,18 @@ TEST_P(Volatile, AsyncVolatileKeepAllPubReliableSubNonReliableHelloWorld) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). init(); ASSERT_TRUE(writer.isInitialized()); @@ -252,7 +254,7 @@ TEST_P(Volatile, ReqRepVolatileHelloworldRequesterCheckWriteParams) { ReqRepAsReliableHelloWorldRequester requester; - requester.durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS).init(); + requester.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS).init(); ASSERT_TRUE(requester.isInitialized()); @@ -265,12 +267,12 @@ TEST_P(Volatile, AsyncVolatileSubBetweenPubs) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). - asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE). heartbeat_period_seconds(3600). init(); @@ -282,9 +284,9 @@ TEST_P(Volatile, AsyncVolatileSubBetweenPubs) writer.send_sample(hello); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -307,12 +309,12 @@ TEST_P(Volatile, VolatileSubBetweenPubs) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). - asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE). heartbeat_period_seconds(3600). init(); @@ -324,9 +326,9 @@ TEST_P(Volatile, VolatileSubBetweenPubs) writer.send_sample(hello); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -350,12 +352,12 @@ TEST_P(Volatile, AsyncVolatileSubBetweenTransientPubs) PubSubWriter writer(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .resource_limits_allocated_samples(9) .resource_limits_max_samples(9) - .asynchronously(eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::ASYNCHRONOUS_PUBLISH_MODE) .heartbeat_period_seconds(3600) .init(); @@ -367,9 +369,9 @@ TEST_P(Volatile, AsyncVolatileSubBetweenTransientPubs) writer.send_sample(hello); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -393,12 +395,12 @@ TEST_P(Volatile, VolatileSubBetweenTransientPubs) PubSubWriter writer(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .resource_limits_allocated_samples(9) .resource_limits_max_samples(9) - .asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE) + .asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE) .heartbeat_period_seconds(3600) .init(); @@ -410,9 +412,9 @@ TEST_P(Volatile, VolatileSubBetweenTransientPubs) writer.send_sample(hello); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). init(); ASSERT_TRUE(reader.isInitialized()); @@ -437,9 +439,9 @@ TEST_P(Volatile, VolatileLateJoinerSubGapLost) PubSubWriter writer(TEST_TOPIC_NAME); - reader1.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader1.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). //heartbeatResponseDelay(5,0). init(); @@ -459,14 +461,14 @@ TEST_P(Volatile, VolatileLateJoinerSubGapLost) }; testTransport->dropLogLength = 1; - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(9). resource_limits_max_samples(9). disable_builtin_transport(). add_user_transport_to_pparams(testTransport). - asynchronously(eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE). + asynchronously(eprosima::fastdds::dds::SYNCHRONOUS_PUBLISH_MODE). init(); ASSERT_TRUE(writer.isInitialized()); @@ -482,9 +484,9 @@ TEST_P(Volatile, VolatileLateJoinerSubGapLost) writer.send_sample(data.front()); data.pop_front(); - reader2.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader2.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). init(); ASSERT_TRUE(reader2.isInitialized()); @@ -509,9 +511,9 @@ TEST_P(Volatile, VolatileWithLostAcks) PubSubReader reader(TEST_TOPIC_NAME); PubSubWriter writer(TEST_TOPIC_NAME); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(10). resource_limits_max_samples(10). init(); @@ -531,9 +533,9 @@ TEST_P(Volatile, VolatileWithLostAcks) return false; }; - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS). - durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS). + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS). + durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS). resource_limits_allocated_samples(10). resource_limits_max_samples(10). disable_builtin_transport(). diff --git a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp index 72b6473a7cb..b7422fc2854 100644 --- a/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp +++ b/test/blackbox/common/DDSBlackboxTestsAckPositive.cpp @@ -36,10 +36,10 @@ #include #include #include -#include -#include +#include + +// TODO(jlbueno): remove private headers #include -#include #include "BlackboxTests.hpp" #include "../api/dds-pim/CustomPayloadPool.hpp" @@ -47,7 +47,7 @@ #include "../api/dds-pim/PubSubWriter.hpp" #include "../api/dds-pim/ReqRepAsReliableHelloWorldRequester.hpp" #include "../api/dds-pim/ReqRepAsReliableHelloWorldReplier.hpp" -#include "../types/FixedSized.h" +#include "../types/FixedSized.hpp" #include "../types/FixedSizedPubSubTypes.h" #include "../types/HelloWorldPubSubTypes.h" @@ -68,15 +68,15 @@ TEST(AcknackQos, DDSEnableUpdatabilityOfPositiveAcksPeriodDDSLayer) // Configure datapublisher_qos writer.keep_duration({1, 0}); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); - writer.durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); + writer.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS); writer.init(); ASSERT_TRUE(writer.isInitialized()); // Configure datasubscriber_qos reader.keep_duration({1, 0}); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); reader.init(); ASSERT_TRUE(reader.isInitialized()); @@ -160,20 +160,20 @@ TEST(AcknackQos, RecoverAfterLosingCommunicationWithDisablePositiveAck) auto testTransport = std::make_shared(); writer.keep_duration({2, 0}); - //writer.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); //writer.history_depth(15); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); writer.add_user_transport_to_pparams(testTransport); writer.init(); reader.keep_duration({1, 0}); - //reader.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + //reader.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); //reader.history_depth(15); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //reader.lifespan_period(lifespan_s); reader.init(); @@ -226,20 +226,20 @@ TEST(AcknackQos, NotRecoverAfterLosingCommunicationWithDisablePositiveAck) auto testTransport = std::make_shared(); writer.keep_duration({1, 0}); - //writer.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS); - writer.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + //writer.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); + writer.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); //writer.history_depth(15); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //writer.lifespan_period(lifespan_s); writer.disable_builtin_transport(); writer.add_user_transport_to_pparams(testTransport); writer.init(); reader.keep_duration({1, 0}); - //reader.history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS); - reader.history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS); + //reader.history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS); + reader.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS); //reader.history_depth(15); - reader.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); //reader.lifespan_period(lifespan_s); reader.init(); @@ -285,12 +285,12 @@ TEST(AcknackQos, DisablePositiveAcksWithBestEffortReader) PubSubWriter writer(TEST_TOPIC_NAME); writer.keep_duration({2, 0}); - writer.reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS); - writer.durability_kind(eprosima::fastrtps::VOLATILE_DURABILITY_QOS); + writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS); + writer.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS); writer.init(); reader.keep_duration({1, 0}); - reader.reliability(eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS); + reader.reliability(eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS); reader.init(); ASSERT_TRUE(reader.isInitialized()); diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 518c6c3a9d9..63739d662a5 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -38,15 +38,14 @@ #include #include #include -#include -#include +#include #include "BlackboxTests.hpp" #include "../api/dds-pim/CustomPayloadPool.hpp" #include "../api/dds-pim/PubSubReader.hpp" #include "../api/dds-pim/PubSubWriter.hpp" #include "../api/dds-pim/PubSubWriterReader.hpp" -#include "../types/FixedSized.h" +#include "../types/FixedSized.hpp" #include "../types/FixedSizedPubSubTypes.h" #include "../types/HelloWorldPubSubTypes.h" @@ -54,8 +53,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - /** * This test checks whether it is safe to delete not enabled DDS entities * */ @@ -68,7 +65,7 @@ TEST(DDSBasic, DeleteDisabledEntities) ASSERT_NE(nullptr, factory); factory->set_qos(factory_qos); DomainParticipantFactoryQos factory_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->get_qos(factory_qos_check)); + ASSERT_EQ(RETCODE_OK, factory->get_qos(factory_qos_check)); ASSERT_EQ(false, factory_qos_check.entity_factory().autoenable_created_entities); // Create a disabled DomainParticipant, setting it to in turn create disable entities @@ -77,7 +74,7 @@ TEST(DDSBasic, DeleteDisabledEntities) DomainParticipant* participant = factory->create_participant((uint32_t)GET_PID() % 230, participant_qos); ASSERT_NE(nullptr, participant); DomainParticipantQos participant_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->get_qos(participant_qos_check)); + ASSERT_EQ(RETCODE_OK, participant->get_qos(participant_qos_check)); ASSERT_EQ(false, participant_qos_check.entity_factory().autoenable_created_entities); // Create a disabled Publisher, setting it to in turn create disable entities @@ -86,7 +83,7 @@ TEST(DDSBasic, DeleteDisabledEntities) Publisher* publisher = participant->create_publisher(publisher_qos); ASSERT_NE(nullptr, publisher); PublisherQos publisher_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, publisher->get_qos(publisher_qos_check)); + ASSERT_EQ(RETCODE_OK, publisher->get_qos(publisher_qos_check)); ASSERT_EQ(false, publisher_qos_check.entity_factory().autoenable_created_entities); // Create a disabled Subscriber, setting it to in turn create disable entities @@ -95,7 +92,7 @@ TEST(DDSBasic, DeleteDisabledEntities) Subscriber* subscriber = participant->create_subscriber(subscriber_qos); ASSERT_NE(nullptr, subscriber); SubscriberQos subscriber_qos_check; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->get_qos(subscriber_qos_check)); + ASSERT_EQ(RETCODE_OK, subscriber->get_qos(subscriber_qos_check)); ASSERT_EQ(false, subscriber_qos_check.entity_factory().autoenable_created_entities); // Register type @@ -167,7 +164,7 @@ TEST(DDSBasic, MultithreadedPublisherCreation) } /* Delete publisher */ - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(publisher)); + ASSERT_EQ(RETCODE_OK, participant->delete_publisher(publisher)); }; { @@ -193,7 +190,7 @@ TEST(DDSBasic, MultithreadedPublisherCreation) } /* Clean up */ - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->delete_participant(participant)); + ASSERT_EQ(RETCODE_OK, factory->delete_participant(participant)); } TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) @@ -254,7 +251,7 @@ TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) return should_finish; }); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(reader)); + ASSERT_EQ(RETCODE_OK, subscriber->delete_datareader(reader)); }; { @@ -276,11 +273,11 @@ TEST(DDSBasic, MultithreadedReaderCreationDoesNotDeadlock) } } - ASSERT_EQ(ReturnCode_t::RETCODE_OK, publisher->delete_datawriter(writer)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(publisher)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(subscriber)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(topic)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, factory->delete_participant(participant)); + ASSERT_EQ(RETCODE_OK, publisher->delete_datawriter(writer)); + ASSERT_EQ(RETCODE_OK, participant->delete_publisher(publisher)); + ASSERT_EQ(RETCODE_OK, participant->delete_subscriber(subscriber)); + ASSERT_EQ(RETCODE_OK, participant->delete_topic(topic)); + ASSERT_EQ(RETCODE_OK, factory->delete_participant(participant)); } /** @@ -399,7 +396,7 @@ TEST(DDSBasic, PidRelatedSampleIdentity) PubSubReader reliable_reader(TEST_TOPIC_NAME); // Test transport will be used in order to filter inlineQoS - auto test_transport = std::make_shared(); + auto test_transport = std::make_shared(); bool exists_pid_related_sample_identity = false; bool exists_pid_custom_related_sample_identity = false; @@ -457,7 +454,7 @@ TEST(DDSBasic, PidRelatedSampleIdentity) { } - ASSERT_EQ(eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK, + ASSERT_EQ(RETCODE_OK, native_reader.take_next_sample((void*)&read_data, &info)); ASSERT_TRUE(exists_pid_related_sample_identity); diff --git a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp index 53e46e925db..dc72f1e5479 100644 --- a/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsContentFilter.cpp @@ -15,18 +15,18 @@ #include #include -#include - +#include +#include #include #include #include +#include #include -#include -#include +#include -#include "../types/HelloWorldTypeObject.h" +#include "../types/HelloWorldTypeObjectSupport.hpp" #include "../types/TestRegression3361PubSubTypes.h" -#include "../types/TestRegression3361TypeObject.h" +#include "../types/TestRegression3361TypeObjectSupport.hpp" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -35,8 +35,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - struct ContentFilterInfoCounter { std::atomic_size_t user_data_count; @@ -144,12 +142,12 @@ class DDSContentFilter : public testing::TestWithParam enable_datasharing = false; - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case communication_type::INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case communication_type::DATASHARING: enable_datasharing = true; @@ -160,19 +158,18 @@ class DDSContentFilter : public testing::TestWithParam } using_transport_communication_ = (communication_type::TRANSPORT == GetParam()); - registerHelloWorldTypes(); } void TearDown() override { using namespace eprosima::fastrtps; - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case communication_type::INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case communication_type::DATASHARING: break; @@ -201,13 +198,13 @@ class DDSContentFilter : public testing::TestWithParam { if (participant_ && subscriber_) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber_->delete_contained_entities()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_subscriber(subscriber_)); + EXPECT_EQ(RETCODE_OK, subscriber_->delete_contained_entities()); + EXPECT_EQ(RETCODE_OK, participant_->delete_subscriber(subscriber_)); } if (participant_ && filtered_topic_) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_contentfilteredtopic(filtered_topic_)); + EXPECT_EQ(RETCODE_OK, participant_->delete_contentfilteredtopic(filtered_topic_)); } } @@ -281,14 +278,14 @@ class DDSContentFilter : public testing::TestWithParam void delete_reader( DataReader* reader) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber_->delete_datareader(reader)); + EXPECT_EQ(RETCODE_OK, subscriber_->delete_datareader(reader)); } void set_filter_expression( const std::string& filter_expression, const std::vector& expression_parameters) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, filtered_topic_->set_filter_expression(filter_expression, expression_parameters)); // Avoid discovery race condition std::this_thread::sleep_for(std::chrono::milliseconds(250)); @@ -297,7 +294,7 @@ class DDSContentFilter : public testing::TestWithParam void set_expression_parameters( const std::vector& expression_parameters) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, filtered_topic_->set_expression_parameters(expression_parameters)); + EXPECT_EQ(RETCODE_OK, filtered_topic_->set_expression_parameters(expression_parameters)); // Avoid discovery race condition std::this_thread::sleep_for(std::chrono::milliseconds(250)); } @@ -347,7 +344,7 @@ class DDSContentFilter : public testing::TestWithParam SampleInfoSeq recv_info; ReturnCode_t expected_ret; - expected_ret = expected_samples == 0 ? ReturnCode_t::RETCODE_NO_DATA : ReturnCode_t::RETCODE_OK; + expected_ret = expected_samples == 0 ? RETCODE_NO_DATA : RETCODE_OK; EXPECT_EQ(expected_ret, reader->take(recv_data, recv_info)); EXPECT_EQ(recv_data.length(), expected_samples); for (HelloWorldSeq::size_type i = 0; @@ -358,7 +355,7 @@ class DDSContentFilter : public testing::TestWithParam } if (expected_samples > 0) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader->return_loan(recv_data, recv_info)); + EXPECT_EQ(RETCODE_OK, reader->return_loan(recv_data, recv_info)); } // Ensure writer ends in clean state @@ -404,7 +401,7 @@ class DDSContentFilter : public testing::TestWithParam HelloWorldSeq recv_data; SampleInfoSeq recv_info; - while (ReturnCode_t::RETCODE_OK == reader.take(recv_data, recv_info)) + while (RETCODE_OK == reader.take(recv_data, recv_info)) { reader.return_loan(recv_data, recv_info); } @@ -579,8 +576,6 @@ TEST_P(DDSContentFilter, WithLimitsDynamicReaders) //! Correctly resolve an alias defined in another header TEST(DDSContentFilter, CorrectlyHandleAliasOtherHeader) { - registerTestRegression3361Types(); - auto dpf = DomainParticipantFactory::get_instance(); auto participant = dpf->create_participant(0, PARTICIPANT_QOS_DEFAULT); @@ -589,7 +584,7 @@ TEST(DDSContentFilter, CorrectlyHandleAliasOtherHeader) auto ret = type.register_type(participant); - if (ret != ReturnCode_t::RETCODE_OK) + if (ret != RETCODE_OK) { throw std::runtime_error("Failed to register type"); } diff --git a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp index c45a2dd5db1..a8d70bea285 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataReader.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataReader.cpp @@ -27,9 +27,8 @@ #include #include #include +#include #include -#include -#include #include "BlackboxTests.hpp" #include "PubSubParticipant.hpp" @@ -56,12 +55,12 @@ class DDSDataReader : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -74,12 +73,12 @@ class DDSDataReader : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -210,7 +209,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) eprosima::fastdds::dds::DataReader& reader = pubsub_reader.get_native_reader(); eprosima::fastdds::dds::SampleInfo info; - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, reader.get_first_untaken_info(&info)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, reader.get_first_untaken_info(&info)); // Wait for discovery. pubsub_reader.wait_discovery(); @@ -231,7 +230,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) //! Checks whether total_unread_ is consistent with //! the number of unread changes in history //! This API call should NOT modify the history - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader.get_first_untaken_info(&info)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader.get_first_untaken_info(&info)); HelloWorld msg; eprosima::fastdds::dds::SampleInfo sinfo; @@ -240,7 +239,7 @@ TEST_P(DDSDataReader, ConsistentTotalUnreadAfterGetFirstUntakenInfo) auto result = reader.take_next_sample((void*)&msg, &sinfo); //! Assert last operation - ASSERT_EQ(result, ReturnCode_t::RETCODE_OK) << "Reader's unread count is: " << reader.get_unread_count(); + ASSERT_EQ(result, eprosima::fastdds::dds::RETCODE_OK) << "Reader's unread count is: " << reader.get_unread_count(); } //! Regression test for #20706 @@ -256,7 +255,7 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) // The reader should not take nor read any sample in this test PubSubReader reader(TEST_TOPIC_NAME, false, false, false); - auto testTransport_1 = std::make_shared(); + auto testTransport_1 = std::make_shared(); EntityId_t writer1_id; EntityId_t reader_id; @@ -327,7 +326,7 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) eprosima::fastdds::dds::SampleInfo info; for (size_t i = 0; i < 3; i++) { - ASSERT_NE(eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK, reader.get_native_reader().get_first_untaken_info( + ASSERT_NE(eprosima::fastdds::dds::RETCODE_OK, reader.get_native_reader().get_first_untaken_info( &info)); std::this_thread::sleep_for(std::chrono::milliseconds(500)); } @@ -338,12 +337,12 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) reader.block_for_unread_count_of(3); // get_first_untaken_info() must return OK now - ASSERT_EQ(eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader.get_native_reader().get_first_untaken_info(&info)); eprosima::fastdds::dds::StackAllocatedSequence data_values; eprosima::fastdds::dds::SampleInfoSeq sample_infos{1}; // As get_first_untaken_info() returns OK, take() must return OK too - ASSERT_EQ(eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, reader.get_native_reader().take(data_values, sample_infos)); } @@ -355,9 +354,9 @@ TEST(DDSDataReader, GetFirstUntakenInfoReturnsTheFirstValidChange) TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) { //! Manually set intraprocess - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); auto participant = DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, @@ -365,7 +364,7 @@ TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) eprosima::fastdds::dds::StatusMask::none()); eprosima::fastdds::dds::TypeSupport t_type{ new HelloWorldPubSubType() }; - ASSERT_TRUE(t_type.register_type( participant ) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(t_type.register_type( participant ) == eprosima::fastdds::dds::RETCODE_OK); auto topic = participant->create_topic( TEST_TOPIC_NAME, t_type.get_type_name(), participant->get_default_topic_qos()); @@ -410,8 +409,8 @@ TEST(DDSDataReader, ConsistentReliabilityWhenIntraprocess) ASSERT_TRUE(unread_count > 0); //! Reset back to INTRAPROCESS_OFF - library_settings.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } /** diff --git a/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp b/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp index 6181f8c465d..d4fb54a8abc 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataRepresentationQos.cpp @@ -12,20 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - -#include #include - -#include +#include #include +#include +#include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" -#include - using namespace eprosima::fastdds::dds; #if FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp b/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp index 919954d8648..38379c2f560 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataSharing.cpp @@ -16,12 +16,12 @@ #include #include +#include +#include +#include +#include #include -#include -#include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -55,9 +55,9 @@ class DDSDataSharing : public testing::TestWithParam { if (GetParam()) { - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } } @@ -65,9 +65,9 @@ class DDSDataSharing : public testing::TestWithParam { if (GetParam()) { - LibrarySettingsAttributes library_settings; - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::LibrarySettings library_settings; + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); } } @@ -79,7 +79,7 @@ TEST_P(DDSDataSharing, BasicCommunication) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; reader.history_depth(100) @@ -133,7 +133,7 @@ TEST(DDSDataSharing, TransientReader) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; constexpr int writer_history_depth = 2; @@ -198,7 +198,7 @@ TEST_P(DDSDataSharing, BestEffortDirtyPayloads) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; constexpr int writer_history_depth = 2; @@ -260,7 +260,7 @@ TEST_P(DDSDataSharing, ReliableDirtyPayloads) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; constexpr int writer_history_depth = 2; @@ -321,7 +321,7 @@ TEST(DDSDataSharing, DataSharingWriter_DifferentDomainReaders) PubSubReader non_datasharing_reader(TEST_TOPIC_NAME); PubSubReader auto_reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; std::vector reader_ids; @@ -394,7 +394,7 @@ TEST(DDSDataSharing, DataSharingWriter_CommonDomainReaders) PubSubReader non_datasharing_reader(TEST_TOPIC_NAME); PubSubReader auto_reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; std::vector reader_ids; @@ -469,7 +469,7 @@ TEST(DDSDataSharing, DataSharingReader_DifferentDomainWriters) PubSubWriter auto_writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; std::vector reader_ids; @@ -552,7 +552,7 @@ TEST(DDSDataSharing, DataSharingReader_CommonDomainWriters) PubSubWriter auto_writer(TEST_TOPIC_NAME); PubSubReader reader(TEST_TOPIC_NAME); - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; std::vector reader_ids; @@ -638,20 +638,20 @@ TEST_P(DDSDataSharing, DataSharingPoolError) PubSubReader reader(TEST_TOPIC_NAME); writer_datasharing.resource_limits_max_samples(100000) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .datasharing_on(".").init(); ASSERT_FALSE(writer_datasharing.isInitialized()); writer_auto.resource_limits_max_samples(100000) - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .datasharing_auto(".").init(); ASSERT_TRUE(writer_auto.isInitialized()); reader.datasharing_on(".") .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(reader.isInitialized()); // Check that the shared files are created on the correct directory @@ -690,7 +690,7 @@ TEST_P(DDSDataSharing, DataSharingDefaultDirectory) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; reader.history_depth(100) @@ -734,7 +734,7 @@ TEST(DDSDataSharing, acknack_reception_when_change_removed_by_history) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; writer.history_depth(100) @@ -796,7 +796,7 @@ TEST(DDSDataSharing, acknack_reception_when_get_unread_count_and_change_removed_ PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; writer.history_depth(100) @@ -870,7 +870,7 @@ TEST(DDSDataSharing, acknack_reception_when_get_unread_count) PubSubWriter writer(TEST_TOPIC_NAME); // Disable transports to ensure we are using datasharing - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->dropDataMessagesPercentage = 100; writer.history_depth(100) diff --git a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp index 14444fe20fe..add1ef8597b 100644 --- a/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDataWriter.cpp @@ -29,8 +29,9 @@ #include #include #include -#include -#include +#include + +// TODO(jlbueno): remove private header #include #include "BlackboxTests.hpp" @@ -54,12 +55,12 @@ class DDSDataWriter : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -72,12 +73,12 @@ class DDSDataWriter : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -174,40 +175,40 @@ TEST_P(DDSDataWriter, GetKeyValue) DataWriter* instance_datawriter = &keyed_writer.get_native_writer(); // 1. Check nullptr on key_holder - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); // 2. Check HANDLE_NIL - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); // 3. Check type should have keys - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); - // 4. Calling get_key_value with a key not yet registered returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); + // 4. Calling get_key_value with a key not yet registered returns eprosima::fastdds::dds::RETCODE_BAD_PARAMETER + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); // 5. Calling get_key_value on a registered instance should work. valid_handle = instance_datawriter->register_instance(&valid_data); EXPECT_NE(HANDLE_NIL, valid_handle); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); - // 6. Calling get_key_value on an unregistered instance should return RETCODE_BAD_PARAMETER. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); + // 6. Calling get_key_value on an unregistered instance should return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER. + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); // 7. Calling get_key_value with a valid instance should work - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); // 8. Calling get_key_value on a disposed instance should work. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); data.key(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); EXPECT_EQ(valid_data.key(), data.key()); } @@ -225,8 +226,8 @@ TEST_P(DDSDataWriter, WithTimestampOperations) // Create and initialize reader PubSubReader reader(TEST_TOPIC_NAME); - reader.durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + reader.durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .history_depth(10) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -234,15 +235,15 @@ TEST_P(DDSDataWriter, WithTimestampOperations) // Create and initialize writer PubSubWriter writer(TEST_TOPIC_NAME); - writer.durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + writer.durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .history_depth(10) .init(); ASSERT_TRUE(writer.isInitialized()); DataWriter& datawriter = writer.get_native_writer(); DataWriterQos qos = datawriter.get_qos(); qos.writer_data_lifecycle().autodispose_unregistered_instances = false; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.set_qos(qos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.set_qos(qos)); // Wait discovery, since we are going to unregister an instance reader.wait_discovery(); @@ -257,16 +258,17 @@ TEST_P(DDSDataWriter, WithTimestampOperations) ts.nanosec--; // Write with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Dispose with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.dispose_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.dispose_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Write with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.write_w_timestamp(&valid_data, HANDLE_NIL, ts)); // Unregister with custom timestamp ts.nanosec++; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter.unregister_instance_w_timestamp(&valid_data, HANDLE_NIL, ts)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datawriter.unregister_instance_w_timestamp(&valid_data, HANDLE_NIL, + ts)); // Wait and take all data auto num_samples = ts.nanosec; @@ -278,7 +280,7 @@ TEST_P(DDSDataWriter, WithTimestampOperations) FASTDDS_CONST_SEQUENCE(DataSeq, KeyedHelloWorld); SampleInfoSeq infos; DataSeq datas; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datareader.take(datas, infos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datareader.take(datas, infos)); // Check received timestamps ts.seconds = 0; @@ -290,7 +292,7 @@ TEST_P(DDSDataWriter, WithTimestampOperations) ts.nanosec++; } - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datareader.return_loan(datas, infos)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, datareader.return_loan(datas, infos)); } /** diff --git a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp index 4ce5fabfdce..d3685f3531b 100644 --- a/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/DDSBlackboxTestsDiscovery.cpp @@ -12,25 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include #include #include +#include +#include #include #include #include #include #include -#include - -#include "BlackboxTests.hpp" -#include "PubSubParticipant.hpp" -#include "PubSubReader.hpp" -#include "PubSubWriter.hpp" - #include #include #include @@ -41,9 +33,16 @@ #include #include #include -#include +#include + +// TODO(jlbueno): remove private header #include -#include + +#include "BlackboxTests.hpp" +#include "PubSubParticipant.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" + // Regression test for redmine issue 11857 TEST(DDSDiscovery, IgnoreParticipantFlags) @@ -351,8 +350,8 @@ TEST(DDSDiscovery, DDSNetworkInterfaceChangesAtRunTime) PubSubReader datareader(TEST_TOPIC_NAME); // datareader is initialized with all the network interfaces - datareader.durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS).history_depth(100). - reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS).init(); + datareader.durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS).history_depth(100). + reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS).init(); ASSERT_TRUE(datareader.isInitialized()); // datawriter: launch without interfaces @@ -568,8 +567,10 @@ TEST(DDSDiscovery, ParticipantProxyPhysicalData) void on_participant_discovery( DomainParticipant* participant, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); std::unique_lock lck(*mtx_); if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DISCOVERED_PARTICIPANT) @@ -747,8 +748,10 @@ TEST(DDSDiscovery, DDSDiscoveryDoesNotDropUDPLocator) void on_participant_discovery( DomainParticipant* /*participant*/, - ParticipantDiscoveryInfo&& info) override + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override { + static_cast(should_be_ignored); if (info.status == info.DISCOVERED_PARTICIPANT) { std::lock_guard guard(mtx); @@ -848,18 +851,18 @@ TEST(DDSDiscovery, WriterAndReaderMatchUsingDynamicReusableMemoryMode) /** * This test checks the missing file case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckMissingFileXmlStaticDiscoveryFile) { std::string file = "MissingFile.xml"; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the correct data case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_OK + * method and checks it returns eprosima::fastdds::dds::RETCODE_OK */ TEST(DDSDiscovery, CheckCorrectXmlStaticDiscoveryFile) { @@ -892,12 +895,12 @@ TEST(DDSDiscovery, CheckCorrectXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_OK); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectStaticdiscoveryXmlStaticDiscoveryFile) { @@ -930,12 +933,12 @@ TEST(DDSDiscovery, CheckIncorrectStaticdiscoveryXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectParticipantXmlStaticDiscoveryFile) { @@ -968,12 +971,12 @@ TEST(DDSDiscovery, CheckIncorrectParticipantXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderXmlStaticDiscoveryFile) { @@ -1006,12 +1009,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderUserIDXmlStaticDiscoveryFile) { @@ -1044,11 +1047,11 @@ TEST(DDSDiscovery, CheckIncorrectReaderUserIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderEntityIDXmlStaticDiscoveryFile) { @@ -1081,12 +1084,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderEntityIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicNameXmlStaticDiscoveryFile) { @@ -1119,12 +1122,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicNameXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect data case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicDataTypeXmlStaticDiscoveryFile) { @@ -1157,12 +1160,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicDataTypeXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderTopicKindXmlStaticDiscoveryFile) { @@ -1195,12 +1198,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderTopicKindXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderPartitionQosXmlStaticDiscoveryFile) { @@ -1233,12 +1236,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderPartitionQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderReliabilityQosXmlStaticDiscoveryFile) { @@ -1271,12 +1274,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderReliabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderDurabilityQosXmlStaticDiscoveryFile) { @@ -1309,12 +1312,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderDurabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect reader case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectReaderMulticastLocatorXmlStaticDiscoveryFile) { @@ -1347,12 +1350,12 @@ TEST(DDSDiscovery, CheckIncorrectReaderMulticastLocatorXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterXmlStaticDiscoveryFile) { @@ -1385,12 +1388,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterUserIDXmlStaticDiscoveryFile) { @@ -1423,12 +1426,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterUserIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterEntityIDXmlStaticDiscoveryFile) { @@ -1461,12 +1464,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterEntityIDXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicNameXmlStaticDiscoveryFile) { @@ -1499,12 +1502,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicNameXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicDataTypeXmlStaticDiscoveryFile) { @@ -1537,12 +1540,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicDataTypeXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterTopicKindXmlStaticDiscoveryFile) { @@ -1575,12 +1578,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterTopicKindXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterPartitionQosXmlStaticDiscoveryFile) { @@ -1613,12 +1616,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterPartitionQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterReliabilityQosXmlStaticDiscoveryFile) { @@ -1651,12 +1654,12 @@ TEST(DDSDiscovery, CheckIncorrectWriterReliabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** * This test checks the incorrect writer case of DomainParticipantFactory->check_xml_static_discovery - * method and checks it returns RETCODE_ERROR + * method and checks it returns eprosima::fastdds::dds::RETCODE_ERROR */ TEST(DDSDiscovery, CheckIncorrectWriterDurabilityQosXmlStaticDiscoveryFile) { @@ -1689,7 +1692,7 @@ TEST(DDSDiscovery, CheckIncorrectWriterDurabilityQosXmlStaticDiscoveryFile) ""; DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->check_xml_static_discovery(file), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(factory->check_xml_static_discovery(file), eprosima::fastdds::dds::RETCODE_ERROR); } /** @@ -1716,7 +1719,7 @@ static void test_DDSDiscovery_WaitSetMatchedStatus( ASSERT_NE(participant, nullptr); fastdds::dds::TypeSupport type(new HelloWorldPubSubType()); - EXPECT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(type.register_type(participant), eprosima::fastdds::dds::RETCODE_OK); auto topic = participant->create_topic(TEST_TOPIC_NAME, type->getName(), fastdds::dds::TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -1740,7 +1743,7 @@ static void test_DDSDiscovery_WaitSetMatchedStatus( while (1 > matched_status.current_count) { ReturnCode_t ret_code = wait_set.wait(triggered_conditions, fastrtps::c_TimeInfinite); - if (ReturnCode_t::RETCODE_OK != ret_code) + if (eprosima::fastdds::dds::RETCODE_OK != ret_code) { continue; } @@ -1788,6 +1791,7 @@ TEST(DDSDiscovery, WaitSetMatchedStatus) TEST(DDSDiscovery, DataracePDP) { using namespace eprosima; + using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -1807,7 +1811,8 @@ TEST(DDSDiscovery, DataracePDP) void on_participant_discovery( DomainParticipant* /*participant*/, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info) override + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { @@ -1846,10 +1851,11 @@ TEST(DDSDiscovery, DataracePDP) }; // Disable intraprocess - auto settings = fastrtps::xmlparser::XMLProfileManager::library_settings(); + LibrarySettings settings; + DomainParticipantFactory::get_instance()->get_library_settings(settings); auto prev_intraprocess_delivery = settings.intraprocess_delivery; - settings.intraprocess_delivery = fastrtps::INTRAPROCESS_OFF; - fastrtps::xmlparser::XMLProfileManager::library_settings(settings); + settings.intraprocess_delivery = INTRAPROCESS_OFF; + DomainParticipantFactory::get_instance()->set_library_settings(settings); // DDS Domain Id const unsigned int DOMAIN_ID = (uint32_t)GET_PID() % 230; @@ -1917,5 +1923,5 @@ TEST(DDSDiscovery, DataracePDP) // Reestablish previous intraprocess configuration settings.intraprocess_delivery = prev_intraprocess_delivery; - fastrtps::xmlparser::XMLProfileManager::library_settings(settings); + DomainParticipantFactory::get_instance()->set_library_settings(settings); } diff --git a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp index ce274a7aab7..3cf0d5a3f22 100644 --- a/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsFindTopic.cpp @@ -13,7 +13,6 @@ // limitations under the License. - #include #include #include @@ -42,8 +41,6 @@ namespace eprosima { namespace fastdds { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class DDSFindTopicTest : public testing::Test { /** @@ -369,27 +366,27 @@ TEST_F(DDSFindTopicTest, find_topic_delete_topic) // Steps 1-4. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); EXPECT_EQ(nullptr, create_test_topic()); } // Steps 5-9. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, publisher->delete_datawriter(data_writer)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, publisher->delete_datawriter(data_writer)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_1)); EXPECT_EQ(nullptr, create_test_topic()); } // Steps 10-14. { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(data_reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_->delete_topic(topic_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); + EXPECT_EQ(RETCODE_OK, subscriber->delete_datareader(data_reader)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_3)); + EXPECT_EQ(RETCODE_OK, participant_->delete_topic(topic_2)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant_->delete_topic(topic_1)); EXPECT_NE(nullptr, create_test_topic()); } } diff --git a/test/blackbox/common/DDSBlackboxTestsListeners.cpp b/test/blackbox/common/DDSBlackboxTestsListeners.cpp index 5926bb01ef5..185e0965c0f 100644 --- a/test/blackbox/common/DDSBlackboxTestsListeners.cpp +++ b/test/blackbox/common/DDSBlackboxTestsListeners.cpp @@ -19,15 +19,15 @@ #include #include #include +#include +#include #include -#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::xmlparser; using test_UDPv4TransportDescriptor = eprosima::fastdds::rtps::test_UDPv4TransportDescriptor; @@ -48,13 +48,13 @@ class DDSStatus : public testing::TestWithParam void SetUp() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: library_settings.intraprocess_delivery = - eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_FULL; - XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -67,12 +67,12 @@ class DDSStatus : public testing::TestWithParam void TearDown() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_OFF; - XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp index 8a6ba057e39..e43657e1ba2 100644 --- a/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp +++ b/test/blackbox/common/DDSBlackboxTestsMonitorService.cpp @@ -12,20 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - -#include "BlackboxTests.hpp" -#include "../dds-pim/PubSubReader.hpp" -#include "PubSubWriter.hpp" - +#include #include #include -#include -#include +#include -#include +// TODO(jlbueno): remove private header #include -#include + +#include "../types/statistics/monitorservice_typesPubSubTypes.h" +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; @@ -51,7 +49,7 @@ struct SampleValidator; void validator_selector( statistics::dds::DomainParticipant* participant, SampleValidator*& validator, - const statistics::StatusKind status_kind, + const statistics::StatusKind::StatusKind status_kind, SampleInfo& info, MonitorServiceType::type& data, std::list& total_msgs, @@ -229,7 +227,7 @@ class MonitorServiceParticipant { if (!writers_.empty()) { - return (ReturnCode_t::RETCODE_OK == publisher_->delete_datawriter(writers_.back())); + return (eprosima::fastdds::dds::RETCODE_OK == publisher_->delete_datawriter(writers_.back())); } return false; @@ -239,7 +237,7 @@ class MonitorServiceParticipant { if (!readers_.empty()) { - return (ReturnCode_t::RETCODE_OK == subscriber_->delete_datareader(readers_.back())); + return (eprosima::fastdds::dds::RETCODE_OK == subscriber_->delete_datareader(readers_.back())); } return false; @@ -287,8 +285,8 @@ class MonitorServiceParticipant void reset() { - ASSERT_EQ(ReturnCode_t::RETCODE_OK, statistics_part_->delete_contained_entities()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, statistics_part_->delete_contained_entities()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(statistics_part_)); statistics_part_ = nullptr; } @@ -476,14 +474,14 @@ struct SampleValidator } SampleValidator( - std::bitset& val_mask) + std::bitset& val_mask) : validation_mask(val_mask) , assert_on_non_expected_msgs_(true) { } SampleValidator( - std::bitset& val_mask, + std::bitset& val_mask, bool assert_on_non_expected_msgs) : validation_mask(val_mask) , assert_on_non_expected_msgs_(assert_on_non_expected_msgs) @@ -502,7 +500,7 @@ struct SampleValidator { } - std::bitset validation_mask; + std::bitset validation_mask; bool assert_on_non_expected_msgs_; }; @@ -521,7 +519,7 @@ class MonitorServiceConsumer : protected PubSubReader } MonitorServiceConsumer( - std::bitset& val_mask) + std::bitset& val_mask) : PubSubReader(statistics::MONITOR_SERVICE_TOPIC, true, true) , sample_validator_( new SampleValidator(val_mask)) , reader_history_kind_(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) @@ -530,7 +528,7 @@ class MonitorServiceConsumer : protected PubSubReader } MonitorServiceConsumer( - std::bitset& val_mask, + std::bitset& val_mask, bool assert_on_non_expected_msgs) : PubSubReader(statistics::MONITOR_SERVICE_TOPIC, true, true) , sample_validator_( new SampleValidator(val_mask, assert_on_non_expected_msgs)) @@ -635,7 +633,7 @@ class MonitorServiceConsumer : protected PubSubReader ReturnCode_t success = datareader->take_next_sample((void*)&data, &info); - if (ReturnCode_t::RETCODE_OK == success) + if (eprosima::fastdds::dds::RETCODE_OK == success) { returnedValue = true; @@ -676,7 +674,7 @@ struct ProxySampleValidator : public SampleValidator std::condition_variable& cv, statistics::dds::DomainParticipant* participant = nullptr) { - if (validation_mask[statistics::PROXY] + if (validation_mask[statistics::StatusKind::PROXY] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -708,7 +706,9 @@ struct ProxySampleValidator : public SampleValidator RTPSParticipantAllocationAttributes att; ParticipantProxyData pdata(att); - ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(pdata, data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(pdata, + data), + eprosima::fastdds::dds::RETCODE_OK); auto part_names = participant->get_participant_names(); auto it_names = @@ -719,14 +719,18 @@ struct ProxySampleValidator : public SampleValidator { ReaderProxyData rdata(4, 4); - ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(rdata, data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(rdata, + data), + eprosima::fastdds::dds::RETCODE_OK); } else if (guid.entityId.is_writer()) { WriterProxyData wdata(4, 4); - ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(wdata, data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(wdata, + data), + eprosima::fastdds::dds::RETCODE_OK); } else { @@ -747,7 +751,7 @@ struct ProxySampleValidator : public SampleValidator cv.notify_one(); } } - else if (validation_mask[statistics::PROXY]) + else if (validation_mask[statistics::StatusKind::PROXY]) { auto it = std::find_if(total_msgs.begin(), total_msgs.end(), [&](const MonitorServiceType::type& elem) @@ -780,7 +784,7 @@ struct ConnectionListSampleValidator : public SampleValidator std::atomic& processed_count, std::condition_variable& cv) { - if (validation_mask[statistics::CONNECTION_LIST] + if (validation_mask[statistics::StatusKind::CONNECTION_LIST] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -789,7 +793,7 @@ struct ConnectionListSampleValidator : public SampleValidator for (auto& connection : data.value().connection_list()) { - std::cout << "Received Connection: \n\tMode: " << connection.mode() << + std::cout << "Received Connection: \n\tMode: " << static_cast(connection.mode()) << "\n\tGuid " << statistics::to_fastdds_type(connection.guid()) << "\n\t" << "Announced Locators: "; for (auto& locator : connection.used_locators()) @@ -892,7 +896,7 @@ struct IncompatibleQoSSampleValidator : public SampleValidator std::atomic& processed_count, std::condition_variable& cv) { - if (validation_mask[statistics::INCOMPATIBLE_QOS] + if (validation_mask[statistics::StatusKind::INCOMPATIBLE_QOS] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -931,7 +935,7 @@ struct LivelinessLostSampleValidator : public SampleValidator std::atomic& processed_count, std::condition_variable& cv) { - if (validation_mask[statistics::LIVELINESS_LOST] + if (validation_mask[statistics::StatusKind::LIVELINESS_LOST] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -970,7 +974,7 @@ struct LivelinessChangedSampleValidator : public SampleValidator std::atomic& processed_count, std::condition_variable& cv) { - if (validation_mask[statistics::LIVELINESS_CHANGED] + if (validation_mask[statistics::StatusKind::LIVELINESS_CHANGED] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -1014,7 +1018,7 @@ struct DeadlineMissedSampleValidator : public SampleValidator << "\n\tTotal Count: " << data.value().deadline_missed_status().total_count() << std::endl; - if (validation_mask[statistics::DEADLINE_MISSED] + if (validation_mask[statistics::StatusKind::DEADLINE_MISSED] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -1053,7 +1057,7 @@ struct SampleLostSampleValidator : public SampleValidator std::atomic& processed_count, std::condition_variable& cv) { - if (validation_mask[statistics::SAMPLE_LOST] + if (validation_mask[statistics::StatusKind::SAMPLE_LOST] && info.valid_data && info.instance_state == eprosima::fastdds::dds::ALIVE_INSTANCE_STATE) { @@ -1086,7 +1090,7 @@ struct SampleLostSampleValidator : public SampleValidator void validator_selector( statistics::dds::DomainParticipant* participant, SampleValidator*& validator, - const statistics::StatusKind status_kind, + const statistics::StatusKind::StatusKind status_kind, SampleInfo& info, MonitorServiceType::type& data, std::list& total_msgs, @@ -1178,10 +1182,10 @@ TEST(DDSMonitorServiceTest, monitor_service_enable_disable_api) MSP.setup(); //! Assertions - ASSERT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, MSP.disable_monitor_service()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.enable_monitor_service()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.disable_monitor_service()); - ASSERT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_NOT_ENABLED, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.enable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_NOT_ENABLED, MSP.disable_monitor_service()); #endif //FASTDDS_STATISTICS } @@ -1202,13 +1206,13 @@ TEST(DDSMonitorServiceTest, monitor_service_property) //! Procedure MSP.setup(xml_file, participant_profile_names.first); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.disable_monitor_service()); MSP.reset(); MSP.setup(xml_file, participant_profile_names.second); //! Assertions - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.disable_monitor_service()); #endif //FASTDDS_STATISTICS } @@ -1226,9 +1230,9 @@ TEST(DDSMonitorServiceTest, monitor_service_environment_variable) const char* value = "NETWORK_LATENCY_TOPIC;MONITOR_SERVICE_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 //! Setup @@ -1238,7 +1242,7 @@ TEST(DDSMonitorServiceTest, monitor_service_environment_variable) MSP.setup(); //! Assertions - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.disable_monitor_service()); #endif //FASTDDS_STATISTICS } @@ -1260,7 +1264,7 @@ TEST(DDSMonitorServiceTest, monitor_service_properties_cpp_api) MSP.setup(pqos); //! Assertions - ASSERT_EQ(ReturnCode_t::RETCODE_OK, MSP.disable_monitor_service()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, MSP.disable_monitor_service()); #endif //FASTDDS_STATISTICS } @@ -1275,8 +1279,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_proxy) #ifdef FASTDDS_STATISTICS //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; //! Setup MonitorServiceParticipant MSP; @@ -1292,14 +1296,14 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_proxy) MonitorServiceType::type participant_proxy_msg, writer_proxy_msg; - participant_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + participant_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); participant_proxy_msg.local_entity(MSP.get_participant_guid()); expected_msgs.push_back(participant_proxy_msg); MSP.create_and_add_writer(); - writer_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + writer_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); StatisticsGUIDList guids = MSP.get_writer_guids(); ASSERT_EQ(guids.size(), 1u); @@ -1330,8 +1334,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_connection_list) { #ifdef FASTDDS_STATISTICS //! Validate CONNECTION_LIST samples only - std::bitset validation_mask; - validation_mask[statistics::CONNECTION_LIST] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::CONNECTION_LIST] = true; //! Setup MonitorServiceParticipant MSP1, MSP2; @@ -1356,7 +1360,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_connection_list) MonitorServiceType::type participant_connection_msg, endpoint_connections_msg; - participant_connection_msg.status_kind(eprosima::fastdds::statistics::CONNECTION_LIST); + participant_connection_msg.status_kind(eprosima::fastdds::statistics::StatusKind::CONNECTION_LIST); participant_connection_msg.local_entity(MSP1.get_participant_guid()); std::vector locators; @@ -1400,7 +1404,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_connection_list) expected_msgs.push_back(participant_connection_msg); - participant_connection_msg.status_kind(eprosima::fastdds::statistics::CONNECTION_LIST); + participant_connection_msg.status_kind(eprosima::fastdds::statistics::StatusKind::CONNECTION_LIST); participant_connection_msg.local_entity(MSP2.get_participant_guid()); ASSERT_FALSE(participant_connection_msg.value().connection_list().empty()); @@ -1419,7 +1423,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_connection_list) MSP2.create_and_add_reader(dr_qos); StatisticsGUIDList w_guids, r_guids; - endpoint_connections_msg.status_kind(eprosima::fastdds::statistics::CONNECTION_LIST); + endpoint_connections_msg.status_kind(eprosima::fastdds::statistics::StatusKind::CONNECTION_LIST); w_guids = MSP1.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); r_guids = MSP2.get_reader_guids(); @@ -1465,8 +1469,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_qos_incompatibility_status) { #ifdef FASTDDS_STATISTICS //! Validate INCOMPATIBLE_QOS samples only - std::bitset validation_mask; - validation_mask[statistics::INCOMPATIBLE_QOS] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::INCOMPATIBLE_QOS] = true; //! Setup MonitorServiceParticipant MSP; @@ -1492,7 +1496,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_qos_incompatibility_status) MonitorServiceType::type endpoint_qos_msg; StatisticsGUIDList w_guids, r_guids; - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); w_guids = MSP.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); endpoint_qos_msg.local_entity(w_guids.back()); @@ -1505,7 +1509,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_qos_incompatibility_status) endpoint_qos_msg.value().incompatible_qos_status().last_policy_id() = RELIABILITY_QOS_POLICY_ID; expected_msgs.push_back(endpoint_qos_msg); - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_qos_msg.local_entity(r_guids.back()); @@ -1539,8 +1543,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_liveliness_lost_status) { #ifdef FASTDDS_STATISTICS //! Validate LIVELINESS_LOST samples only - std::bitset validation_mask; - validation_mask[statistics::LIVELINESS_LOST] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::LIVELINESS_LOST] = true; //! Setup MonitorServiceParticipant MSP; @@ -1565,7 +1569,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_liveliness_lost_status) MonitorServiceType::type endpoint_liveliness_msg; StatisticsGUIDList w_guids; - endpoint_liveliness_msg.status_kind(eprosima::fastdds::statistics::LIVELINESS_LOST); + endpoint_liveliness_msg.status_kind(eprosima::fastdds::statistics::StatusKind::LIVELINESS_LOST); w_guids = MSP.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); endpoint_liveliness_msg.local_entity(w_guids.back()); @@ -1595,8 +1599,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_liveliness_changed_status) { #ifdef FASTDDS_STATISTICS //! Validate LIVELINESS_CHANGED samples only - std::bitset validation_mask; - validation_mask[statistics::LIVELINESS_CHANGED] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::LIVELINESS_CHANGED] = true; //! Setup MonitorServiceParticipant MSP; @@ -1629,7 +1633,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_liveliness_changed_status) MonitorServiceType::type endpoint_liveliness_msg; StatisticsGUIDList r_guids; - endpoint_liveliness_msg.status_kind(eprosima::fastdds::statistics::LIVELINESS_CHANGED); + endpoint_liveliness_msg.status_kind(eprosima::fastdds::statistics::StatusKind::LIVELINESS_CHANGED); r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_liveliness_msg.local_entity(r_guids.back()); @@ -1659,8 +1663,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_deadline_missed_status) #ifdef FASTDDS_STATISTICS //! Validate DEADLINE_MISSED samples only - std::bitset validation_mask; - validation_mask[statistics::DEADLINE_MISSED] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::DEADLINE_MISSED] = true; //! Setup MonitorServiceParticipant MSP; @@ -1685,7 +1689,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_deadline_missed_status) MonitorServiceType::type endpoint_deadline_msg; StatisticsGUIDList r_guids, w_guids; - endpoint_deadline_msg.status_kind(eprosima::fastdds::statistics::DEADLINE_MISSED); + endpoint_deadline_msg.status_kind(eprosima::fastdds::statistics::StatusKind::DEADLINE_MISSED); r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_deadline_msg.local_entity(r_guids.back()); @@ -1727,8 +1731,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_sample_lost_status) #ifdef FASTDDS_STATISTICS //! Validate SAMPLE_LOST samples only - std::bitset validation_mask; - validation_mask[statistics::SAMPLE_LOST] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::SAMPLE_LOST] = true; //! Setup MonitorServiceParticipant MSP1, MSP2; @@ -1737,7 +1741,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_sample_lost_status) //! Procedure DomainParticipantQos dqos; - auto testTransport = std::make_shared(); + auto testTransport = std::make_shared(); testTransport->drop_data_messages_filter_ = [](eprosima::fastrtps::rtps::CDRMessage_t& msg)-> bool { uint32_t old_pos = msg.pos; @@ -1792,7 +1796,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_sample_lost_status) MonitorServiceType::type endpoint_sample_lost_msg; StatisticsGUIDList r_guids; - endpoint_sample_lost_msg.status_kind(eprosima::fastdds::statistics::SAMPLE_LOST); + endpoint_sample_lost_msg.status_kind(eprosima::fastdds::statistics::StatusKind::SAMPLE_LOST); r_guids = MSP2.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_sample_lost_msg.local_entity(r_guids.back()); @@ -1823,8 +1827,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_instance_disposals) #ifdef FASTDDS_STATISTICS //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; //! Setup MonitorServiceParticipant MSP; @@ -1853,7 +1857,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_instance_disposals) expected_msgs.push_back(proxy_msg); //! Expect one unregister for each of the statuses - for (uint32_t i = 0; i < statistics::STATUSES_SIZE; i++) + for (uint32_t i = 0; i < statistics::StatusKind::STATUSES_SIZE; i++) { proxy_msg.local_entity() = statistics::to_statistics_type(c_Guid_Unknown); expected_msgs.push_back(proxy_msg); @@ -1885,8 +1889,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_late_joiner) #ifdef FASTDDS_STATISTICS //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; //! Setup MonitorServiceParticipant MSP; @@ -1901,7 +1905,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_late_joiner) MonitorServiceType::type participant_proxy_msg, entity_proxy_msg; - participant_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + participant_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); participant_proxy_msg.local_entity(MSP.get_participant_guid()); expected_msgs.push_back(participant_proxy_msg); @@ -1909,7 +1913,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_late_joiner) MSP.create_and_add_writer(); MSP.create_and_add_reader(); - entity_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + entity_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); StatisticsGUIDList w_guids = MSP.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); @@ -1917,7 +1921,7 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_late_joiner) expected_msgs.push_back(entity_proxy_msg); - entity_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + entity_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); StatisticsGUIDList r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); @@ -1948,8 +1952,8 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_enable_disable_enable) #ifdef FASTDDS_STATISTICS //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; //! Setup MonitorServiceParticipant MSP; @@ -1971,12 +1975,12 @@ TEST(DDSMonitorServiceTest, monitor_service_simple_enable_disable_enable) MonitorServiceType::type participant_proxy_msg, entity_proxy_msg; - participant_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + participant_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); participant_proxy_msg.local_entity(MSP.get_participant_guid()); expected_msgs.push_back(participant_proxy_msg); - entity_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + entity_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); StatisticsGUIDList w_guids = MSP.get_writer_guids(); StatisticsGUIDList r_guids = MSP.get_reader_guids(); @@ -2012,8 +2016,8 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_proxy) { #ifdef FASTDDS_STATISTICS //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; //! Setup size_t n_participants = 3; @@ -2041,12 +2045,12 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_proxy) MonitorServiceType::type participant_proxy_msg, entity_proxy_msg; - participant_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + participant_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); participant_proxy_msg.local_entity(MSP.get_participant_guid()); expected_msgs.push_back(participant_proxy_msg); - entity_proxy_msg.status_kind(eprosima::fastdds::statistics::PROXY); + entity_proxy_msg.status_kind(eprosima::fastdds::statistics::StatusKind::PROXY); StatisticsGUIDList w_guids = MSP.get_writer_guids(); StatisticsGUIDList r_guids = MSP.get_reader_guids(); @@ -2083,8 +2087,8 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_instance_disposals) MSPs.resize(n_participants); //! Validate PROXY samples only - std::bitset validation_mask; - validation_mask[statistics::PROXY] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::PROXY] = true; MonitorServiceConsumer MSC (validation_mask); @@ -2129,7 +2133,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_instance_disposals) } //! Plus 48 instance disposals (8 per instance) - for (uint32_t i = 0; i < 6 * statistics::STATUSES_SIZE; i++) + for (uint32_t i = 0; i < 6 * statistics::StatusKind::STATUSES_SIZE; i++) { expected_msgs.push_back(MonitorServiceType::type()); } @@ -2164,8 +2168,8 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_single_late_joiner) #ifdef FASTDDS_STATISTICS //! Validate INCOMPATIBLE_QOS samples only - std::bitset validation_mask; - validation_mask[statistics::INCOMPATIBLE_QOS] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::INCOMPATIBLE_QOS] = true; //! Setup size_t n_participants = 3; @@ -2197,7 +2201,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_single_late_joiner) MonitorServiceType::type endpoint_qos_msg; StatisticsGUIDList w_guids, r_guids; - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); w_guids = MSP.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); endpoint_qos_msg.local_entity(w_guids.back()); @@ -2208,7 +2212,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_single_late_joiner) expected_msgs.push_back(endpoint_qos_msg); - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_qos_msg.local_entity(r_guids.back()); @@ -2256,7 +2260,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_multiple_late_joiners) MonitorServiceType::type endpoint_qos_msg; StatisticsGUIDList w_guids, r_guids; - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); w_guids = MSP.get_writer_guids(); ASSERT_EQ(w_guids.size(), 1); endpoint_qos_msg.local_entity(w_guids.back()); @@ -2267,7 +2271,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_multiple_late_joiners) expected_msgs.push_back(endpoint_qos_msg); - endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::INCOMPATIBLE_QOS); + endpoint_qos_msg.status_kind(eprosima::fastdds::statistics::StatusKind::INCOMPATIBLE_QOS); r_guids = MSP.get_reader_guids(); ASSERT_EQ(r_guids.size(), 1); endpoint_qos_msg.local_entity(r_guids.back()); @@ -2279,8 +2283,8 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_multiple_late_joiners) for (size_t i = 0; i < n_participants; i++) { //! Validate INCOMPATIBLE_QOS samples only - std::bitset validation_mask; - validation_mask[statistics::INCOMPATIBLE_QOS] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::INCOMPATIBLE_QOS] = true; MonitorServiceConsumer MSC(validation_mask); @@ -2306,7 +2310,7 @@ TEST(DDSMonitorServiceTest, monitor_service_properly_handles_topic_instances) #ifdef FASTDDS_STATISTICS // In this test we do not need to enforce the validation of samples - std::bitset validation_mask; + std::bitset validation_mask; // Setup consumer participant MonitorServiceConsumer MSC(validation_mask); @@ -2315,7 +2319,7 @@ TEST(DDSMonitorServiceTest, monitor_service_properly_handles_topic_instances) // Setup participant with monitor service enabled MonitorServiceParticipant MSP; - auto test_transport = std::make_shared(); + auto test_transport = std::make_shared(); std::atomic n_gap_messages{0}; @@ -2376,8 +2380,8 @@ TEST(DDSMonitorServiceTest, monitor_service_late_joiner_consumer_receives_only_ #ifdef FASTDDS_STATISTICS // In this test we enforce validating DeadlineMissed samples only - std::bitset validation_mask; - validation_mask[statistics::DEADLINE_MISSED] = true; + std::bitset validation_mask; + validation_mask[statistics::StatusKind::DEADLINE_MISSED] = true; // Setup MonitorServiceConsumer MSC(validation_mask, false); diff --git a/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp b/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp index cbe1676f95c..a371067b9ab 100644 --- a/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsOwnershipQos.cpp @@ -14,11 +14,11 @@ #include +#include +#include +#include #include -#include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -39,12 +39,12 @@ class OwnershipQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -57,12 +57,12 @@ class OwnershipQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -1255,13 +1255,13 @@ void exclusive_kind_non_keyed_lost_liveliness( PubSubWriter writer3(TEST_TOPIC_NAME); std::atomic drop_messages1(false); - auto testTransport1 = std::make_shared(); + auto testTransport1 = std::make_shared(); testTransport1->messages_filter_ = [&drop_messages1](eprosima::fastrtps::rtps::CDRMessage_t&) { return drop_messages1.load(); }; std::atomic drop_messages3(false); - auto testTransport3 = std::make_shared(); + auto testTransport3 = std::make_shared(); testTransport3->messages_filter_ = [&drop_messages3](eprosima::fastrtps::rtps::CDRMessage_t&) { return drop_messages3.load(); @@ -1413,19 +1413,19 @@ void exclusive_kind_keyed_lost_liveliness( PubSubWriter writer4(TEST_TOPIC_NAME); std::atomic drop_messages2(false); - auto testTransport2 = std::make_shared(); + auto testTransport2 = std::make_shared(); testTransport2->messages_filter_ = [&drop_messages2](eprosima::fastrtps::rtps::CDRMessage_t&) { return drop_messages2.load(); }; std::atomic drop_messages3(false); - auto testTransport3 = std::make_shared(); + auto testTransport3 = std::make_shared(); testTransport3->messages_filter_ = [&drop_messages3](eprosima::fastrtps::rtps::CDRMessage_t&) { return drop_messages3.load(); }; std::atomic drop_messages4(false); - auto testTransport4 = std::make_shared(); + auto testTransport4 = std::make_shared(); testTransport4->messages_filter_ = [&drop_messages4](eprosima::fastrtps::rtps::CDRMessage_t&) { return drop_messages4.load(); diff --git a/test/blackbox/common/DDSBlackboxTestsPersistence.cpp b/test/blackbox/common/DDSBlackboxTestsPersistence.cpp index ba702e05d3b..78be1c59d7e 100644 --- a/test/blackbox/common/DDSBlackboxTestsPersistence.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPersistence.cpp @@ -14,11 +14,11 @@ #include +#include +#include +#include #include -#include -#include - #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" @@ -50,12 +50,12 @@ class PersistenceLargeData : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -81,12 +81,12 @@ class PersistenceLargeData : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -110,9 +110,9 @@ class PersistenceLargeData : public testing::TestWithParam testTransport->receiveBufferSize = 32768; writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .resource_limits_max_samples(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "77.72.69.74.65.72.5f.70.65.72.73.5f|67.75.69.64") .disable_builtin_transport() .add_user_transport_to_pparams(testTransport) @@ -139,10 +139,10 @@ class PersistenceLargeData : public testing::TestWithParam ASSERT_TRUE(writer.isInitialized()); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .socket_buffer_size(1048576) .init(); @@ -176,9 +176,9 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanBefore) PubSubReader reader(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .resource_limits_max_samples(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "77.72.69.74.65.72.5f.70.65.72.73.5f|67.75.69.64") .lifespan_period({1, 0}) .init(); @@ -203,10 +203,10 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanBefore) std::this_thread::sleep_for(std::chrono::seconds(2)); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -227,9 +227,9 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanSendingBef PubSubReader reader(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .resource_limits_max_samples(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "77.72.69.74.65.72.5f.70.65.72.73.5f|67.75.69.64") .lifespan_period({0, 100}) .init(); @@ -262,10 +262,10 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanSendingBef std::this_thread::sleep_for(std::chrono::seconds(2)); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -286,9 +286,9 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanAfter) PubSubReader reader(TEST_TOPIC_NAME); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) .resource_limits_max_samples(100) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "77.72.69.74.65.72.5f.70.65.72.73.5f|67.75.69.64") .lifespan_period({1, 0}) .init(); @@ -306,10 +306,10 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithLifespanAfter) writer.destroy(); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) - .durability_kind(eprosima::fastrtps::TRANSIENT_LOCAL_DURABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) + .durability_kind(eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS) .init(); ASSERT_TRUE(reader.isInitialized()); @@ -396,8 +396,8 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithStaticDiscovery) WriterMulticastLocators.push_back(LocatorBuffer); writer - .history_kind(eprosima::fastrtps::KEEP_ALL_HISTORY_QOS) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "78.73.69.74.65.72.5f.70.65.72.73.5f|67.75.69.1") .static_discovery("file://PubSubWriterPersistence_static_disc.xml") .unicastLocatorList(WriterUnicastLocators) @@ -423,9 +423,9 @@ TEST_P(PersistenceLargeData, PubSubAsReliablePubPersistentWithStaticDiscovery) ReaderMulticastLocators.push_back(LocatorBuffer); reader - .history_kind(eprosima::fastrtps::KEEP_LAST_HISTORY_QOS) + .history_kind(eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS) .history_depth(10) - .reliability(eprosima::fastrtps::RELIABLE_RELIABILITY_QOS) + .reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS) .make_persistent(db_file_name(), "78.73.69.74.65.72.5f.70.65.72.73.5f|67.75.69.3") .static_discovery("file://PubSubReaderPersistence_static_disc.xml") .unicastLocatorList(ReaderUnicastLocators) diff --git a/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp b/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp index 7a4cfac6029..090b9c840fe 100644 --- a/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPersistenceGuid.cpp @@ -12,13 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 - -#include "PubSubReader.hpp" -#include "PubSubWriter.hpp" - #include #include #include @@ -26,8 +20,13 @@ #include #include +#include +#include #include -#include + +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds::dds; @@ -45,13 +44,13 @@ class PersistenceGuid : public ::testing::TestWithParam void SetUp() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: library_settings.intraprocess_delivery = - eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_FULL; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(library_settings); + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -76,12 +75,12 @@ class PersistenceGuid : public ::testing::TestWithParam void TearDown() override { - eprosima::fastrtps::LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = eprosima::fastrtps::IntraprocessDeliveryType::INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp b/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp index 832b8ef1eba..beb06dc37b7 100644 --- a/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsPropertyQos.cpp @@ -12,17 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include +#include #include #include "BlackboxTests.hpp" - #include "PubSubParticipant.hpp" -#include -#include -#include -#include - namespace test { const std::string EXTERNAL_PROPERTY_NAME = "CustomExternalProperty"; const std::string EXTERNAL_PROPERTY_VALUE = "My Value"; @@ -46,12 +44,12 @@ class PropertyQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -64,12 +62,12 @@ class PropertyQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/DDSBlackboxTestsSecurity.cpp b/test/blackbox/common/DDSBlackboxTestsSecurity.cpp index 32d325c0421..d067862750b 100644 --- a/test/blackbox/common/DDSBlackboxTestsSecurity.cpp +++ b/test/blackbox/common/DDSBlackboxTestsSecurity.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -27,16 +28,14 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace fastdds = ::eprosima::fastdds::dds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; void set_authentication_config( rtps::PropertySeq& props) @@ -98,24 +97,34 @@ void test_big_message_corner_case( auto qos{ fastdds::PARTICIPANT_QOS_DEFAULT }; set_authentication_config(qos.properties().properties()); set_participant_crypto_config(qos.properties().properties()); - auto transport = std::make_shared(); + auto transport = std::make_shared(); transport->interfaceWhiteList.push_back("127.0.0.1"); qos.transport().use_builtin_transports = false; qos.transport().user_transports.push_back(transport); auto participant = fastdds::DomainParticipantFactory::get_instance()->create_participant(0, qos); ASSERT_NE(nullptr, participant); - std::vector lengths = { array_length }; - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_char8_type(); - DynamicTypeBuilder_ptr builder = - DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type, lengths); - builder->set_name(name); - DynamicType_ptr array_type = builder->build(); + fastdds::TypeDescriptor::_ref_type type_descriptor {fastdds::traits::make_shared()}; + type_descriptor->name(name); + type_descriptor->kind(fastdds::TK_STRUCTURE); + fastdds::DynamicTypeBuilder::_ref_type builder = fastdds::DynamicTypeBuilderFactory::get_instance()->create_type( + type_descriptor); - fastdds::TypeSupport type_support(new eprosima::fastrtps::types::DynamicPubSubType(array_type)); + fastdds::BoundSeq lengths = { array_length }; + fastdds::MemberDescriptor::_ref_type array_descriptor {fastdds::traits::make_shared()}; + array_descriptor->name("secure_array"); + array_descriptor->type( + fastdds::DynamicTypeBuilderFactory::get_instance()->create_array_type( + fastdds::DynamicTypeBuilderFactory::get_instance()->get_primitive_type(fastdds::TK_CHAR8), + lengths)->build()); + + builder->add_member(array_descriptor); + fastdds::DynamicType::_ref_type array_type = builder->build(); + + + fastdds::TypeSupport type_support(new fastdds::DynamicPubSubType(array_type)); type_support.get()->auto_fill_type_information(false); - type_support.get()->auto_fill_type_object(false); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->register_type(type_support)); + EXPECT_EQ(fastdds::RETCODE_OK, participant->register_type(type_support)); auto topic = participant->create_topic(name, name, fastdds::TOPIC_QOS_DEFAULT); ASSERT_NE(nullptr, topic); @@ -138,14 +147,14 @@ void test_big_message_corner_case( std::this_thread::sleep_for(std::chrono::milliseconds(100)); } - auto data = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(array_type); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, writer->write(data, fastdds::HANDLE_NIL)); + auto data = fastdds::DynamicDataFactory::get_instance()->create_data(array_type); + EXPECT_EQ(fastdds::RETCODE_OK, writer->write(&data, fastdds::HANDLE_NIL)); fastdds::SampleInfo info{}; bool taken = false; for (size_t n_tries = 0; n_tries < 6u; ++n_tries) { - if (ReturnCode_t::RETCODE_OK == reader->take_next_sample(data, &info)) + if (fastdds::RETCODE_OK == reader->take_next_sample(&data, &info)) { taken = true; break; @@ -154,7 +163,7 @@ void test_big_message_corner_case( } EXPECT_TRUE(taken); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_contained_entities()); + EXPECT_EQ(fastdds::RETCODE_OK, participant->delete_contained_entities()); fastdds::DomainParticipantFactory::get_instance()->delete_participant(participant); } diff --git a/test/blackbox/common/DDSBlackboxTestsStatistics.cpp b/test/blackbox/common/DDSBlackboxTestsStatistics.cpp index a9dcd8ebcbb..879d5760653 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatistics.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatistics.cpp @@ -51,11 +51,10 @@ #include #include #include -#include -#include "../types/HelloWorld.h" +#include "../types/HelloWorld.hpp" #include "../types/HelloWorldPubSubTypes.h" -#include "../types/statistics/types.h" +#include "../types/statistics/types.hpp" #include "../types/statistics/typesPubSubTypes.h" #include "BlackboxTests.hpp" #include "PubSubReader.hpp" @@ -65,7 +64,6 @@ using namespace eprosima::fastdds; using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps::types; struct GenericType { @@ -79,7 +77,7 @@ static DataReader* enable_statistics( { auto qos = statistics::dds::STATISTICS_DATAWRITER_QOS; qos.history().depth = 10; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable_statistics_datawriter( + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, participant->enable_statistics_datawriter( topic_name, qos)); auto topic_desc = participant->lookup_topicdescription(topic_name); @@ -94,8 +92,8 @@ static void disable_statistics( DataReader* reader, const std::string& topic_name) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->disable_statistics_datawriter(topic_name)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, subscriber->delete_datareader(reader)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, participant->disable_statistics_datawriter(topic_name)); } static void wait_statistics( @@ -120,7 +118,7 @@ static void wait_statistics( LoanableSequence data_seq; SampleInfoSeq info_seq; - if (ReturnCode_t::RETCODE_OK == reader->take(data_seq, info_seq)) + if (eprosima::fastdds::dds::RETCODE_OK == reader->take(data_seq, info_seq)) { total_samples += info_seq.length(); reader->return_loan(data_seq, info_seq); @@ -154,7 +152,7 @@ void test_discovery_topic_physical_data( std::string xml_profile = "\ \ - \ + \ \ \ \ @@ -226,7 +224,7 @@ void test_discovery_topic_physical_data( ASSERT_NE(nullptr, statistics_p1); Publisher* publisher_p1 = p1->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(nullptr, publisher_p1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, statistics_p1->enable_statistics_datawriter(statistics::DISCOVERY_TOPIC, statistics::dds::STATISTICS_DATAWRITER_QOS)); @@ -301,7 +299,7 @@ void test_discovery_topic_physical_data( /* Create waitset for the DataReader */ WaitSet waitset; StatusCondition& condition = discovery_data_reader->get_statuscondition(); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, condition.set_enabled_statuses(StatusMask::data_available())); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, condition.set_enabled_statuses(StatusMask::data_available())); ASSERT_EQ(false, condition.get_trigger_value()); waitset.attach_condition(condition); @@ -331,7 +329,7 @@ void test_discovery_topic_physical_data( LoanableSequence discovery_time_seq; SampleInfoSeq info_seq; - while (ReturnCode_t::RETCODE_OK == discovery_data_reader->take(discovery_time_seq, info_seq)) + while (eprosima::fastdds::dds::RETCODE_OK == discovery_data_reader->take(discovery_time_seq, info_seq)) { for (LoanableSequence::size_type n = 0; n < info_seq.length(); n++) { @@ -612,8 +610,8 @@ TEST(DDSStatistics, statistics_with_partition_on_user) auto user_pub_1 = p1->create_publisher(pub_qos); // We enable the participants - ASSERT_EQ(ReturnCode_t::RETCODE_OK, p1->enable()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, p2->enable()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, p1->enable()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, p2->enable()); auto statistics_p1 = statistics::dds::DomainParticipant::narrow(p1); auto statistics_p2 = statistics::dds::DomainParticipant::narrow(p2); diff --git a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp index 4be3ef5f5f1..81a80a88ff3 100644 --- a/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp +++ b/test/blackbox/common/DDSBlackboxTestsStatisticsDomainParticipant.cpp @@ -14,21 +14,18 @@ #include -#include - -#include "BlackboxTests.hpp" -#include "PubSubReader.hpp" - #include #include #include #include #include #include -#include -#include -#include -#include +#include + +#include "../types/statistics/types.hpp" +#include "../types/statistics/typesPubSubTypes.h" +#include "BlackboxTests.hpp" +#include "PubSubReader.hpp" class WriterReaderDataTest : public eprosima::fastdds::statistics::WriterReaderData { @@ -302,9 +299,9 @@ TEST(StatisticsDomainParticipant, CreateParticipant) // 1. Set environment variable and create participant using Qos set by code const char* value = "HISTORY_LATENCY_TOPIC;NETWORK_LATENCY_TOPIC;RTPS_LOST_TOPIC;RTPS_SENT_TOPIC;GAP_COUNT_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 // There is no problem if some topic name is repeated. @@ -352,9 +349,9 @@ TEST(StatisticsDomainParticipant, CreateParticipant) // Otherwise each domainParticipant (each DataReader is launched in its own domainParticipant) will also enable // the statistics DataWriters set with the environment variable. #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, "")); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", "")); #else - ASSERT_EQ(0, unsetenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE)); + ASSERT_EQ(0, unsetenv("FASTDDS_STATISTICS")); #endif // ifdef _WIN32 // Check that the statistics DataWriters has been created by matching a corresponding DataReader on those topics @@ -416,7 +413,7 @@ TEST(StatisticsDomainParticipant, CreateParticipant) physical_data_reader.destroy(); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -476,9 +473,9 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) // 1. Set environment variable and create participant using Qos set by code const char* value = "PUBLICATION_THROUGHPUT_TOPIC;HEARTBEAT_COUNT_TOPIC;RESENT_DATAS_TOPIC;ACKNACK_COUNT_TOPIC"; #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value)); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", value)); #else - ASSERT_EQ(0, setenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, value, 1)); + ASSERT_EQ(0, setenv("FASTDDS_STATISTICS", value, 1)); #endif // ifdef _WIN32 // Load XML profiles @@ -523,9 +520,9 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) // Otherwise each domainParticipant (each DataReader is launched in its own domainParticipant) will also enable // the statistics DataWriters set with the environment variable. #ifdef _WIN32 - ASSERT_EQ(0, _putenv_s(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE, "")); + ASSERT_EQ(0, _putenv_s("FASTDDS_STATISTICS", "")); #else - ASSERT_EQ(0, unsetenv(eprosima::fastdds::statistics::dds::FASTDDS_STATISTICS_ENVIRONMENT_VARIABLE)); + ASSERT_EQ(0, unsetenv("FASTDDS_STATISTICS")); #endif // ifdef _WIN32 // Check that the statistics DataWriters has been created by matching a corresponding DataReader on those topics @@ -585,6 +582,6 @@ TEST(StatisticsDomainParticipant, CreateParticipantUsingXML) sample_datas_reader.destroy(); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + eprosima::fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/blackbox/common/DDSBlackboxTestsThreadSettingsQos.cpp b/test/blackbox/common/DDSBlackboxTestsThreadSettingsQos.cpp index d0b9d8072e1..1b487f9edda 100644 --- a/test/blackbox/common/DDSBlackboxTestsThreadSettingsQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsThreadSettingsQos.cpp @@ -15,8 +15,6 @@ #include #include -#include -#include #include "BlackboxTests.hpp" #include "PubSubReader.hpp" diff --git a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp index 20cc3129778..212d03ce0bf 100644 --- a/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp +++ b/test/blackbox/common/DDSBlackboxTestsTransportSHMUDP.cpp @@ -12,26 +12,27 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" -#include "mock/BlackboxMockConsumer.h" - #include #include #include #include #include -#include - +#include +#include +#include #include #include -#include -#include +#include -#include "../api/dds-pim/PubSubReader.hpp" -#include "../api/dds-pim/PubSubWriter.hpp" +// TODO(jlbueno): remove private header #include +#include "BlackboxTests.hpp" +#include "mock/BlackboxMockConsumer.h" +#include "PubSubReader.hpp" +#include "PubSubWriter.hpp" + using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using test_UDPv4Transport = eprosima::fastdds::rtps::test_UDPv4Transport; @@ -49,12 +50,12 @@ class SHMUDP : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -67,12 +68,12 @@ class SHMUDP : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; @@ -244,22 +245,22 @@ TEST(SHMUDP, SHM_metatraffic_wrong_config) /* Set up log */ BlackboxMockConsumer* helper_consumer = new BlackboxMockConsumer(); - Log::ClearConsumers(); // Remove default consumers - Log::RegisterConsumer(std::unique_ptr(helper_consumer)); // Registering a consumer transfer ownership + eprosima::fastdds::dds::Log::ClearConsumers(); // Remove default consumers + eprosima::fastdds::dds::Log::RegisterConsumer(std::unique_ptr(helper_consumer)); // Registering a consumer transfer ownership // Filter specific message - Log::SetVerbosity(Log::Kind::Warning); - Log::SetCategoryFilter(std::regex("RTPS_NETWORK")); - Log::SetErrorStringFilter(std::regex(".*__WRONG_VALUE__.*")); + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Warning); + eprosima::fastdds::dds::Log::SetCategoryFilter(std::regex("RTPS_NETWORK")); + eprosima::fastdds::dds::Log::SetErrorStringFilter(std::regex(".*__WRONG_VALUE__.*")); // Perform test shm_metatraffic_test(TEST_TOPIC_NAME, "__WRONG_VALUE__", false, false); /* Check logs */ - Log::Flush(); + eprosima::fastdds::dds::Log::Flush(); EXPECT_EQ(helper_consumer->ConsumedEntries().size(), 1u); /* Clean-up */ - Log::Reset(); // This calls to ClearConsumers, which deletes the registered consumer + eprosima::fastdds::dds::Log::Reset(); // This calls to ClearConsumers, which deletes the registered consumer } #ifdef INSTANTIATE_TEST_SUITE_P diff --git a/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp b/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp index 34ea870eda6..7c11834b750 100644 --- a/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp +++ b/test/blackbox/common/DDSBlackboxTestsUserDataQos.cpp @@ -12,17 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include +#include +#include #include #include "BlackboxTests.hpp" - #include "PubSubParticipant.hpp" -#include -#include -#include -#include - using namespace eprosima::fastrtps; enum communication_type @@ -38,12 +36,12 @@ class UserDataQos : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = true; @@ -56,12 +54,12 @@ class UserDataQos : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->set_library_settings(library_settings); break; case DATASHARING: enable_datasharing = false; diff --git a/test/blackbox/common/RTPSAsSocketReader.hpp b/test/blackbox/common/RTPSAsSocketReader.hpp index dd79222108c..f50a89b0a44 100644 --- a/test/blackbox/common/RTPSAsSocketReader.hpp +++ b/test/blackbox/common/RTPSAsSocketReader.hpp @@ -20,29 +20,9 @@ #ifndef _TEST_BLACKBOX_RTPSASSOCKETREADER_HPP_ #define _TEST_BLACKBOX_RTPSASSOCKETREADER_HPP_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include #include -#include -#include - +#include +#include #if defined(_WIN32) #include @@ -51,6 +31,24 @@ #define GET_PID getpid #endif // if defined(_WIN32) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + using eprosima::fastrtps::rtps::IPLocator; template @@ -299,7 +297,7 @@ class RTPSAsSocketReader IPLocator::setIPv4(loc, ip_); loc.port = static_cast(port_); wattr.add_multicast_locator(loc); - wattr.m_qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + wattr.m_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; wattr.guid().guidPrefix.value[0] = guid.guidPrefix.value[0]; wattr.guid().guidPrefix.value[1] = guid.guidPrefix.value[1]; wattr.guid().guidPrefix.value[2] = guid.guidPrefix.value[2]; diff --git a/test/blackbox/common/RTPSAsSocketWriter.hpp b/test/blackbox/common/RTPSAsSocketWriter.hpp index 64a5ce63f84..f19a284256d 100644 --- a/test/blackbox/common/RTPSAsSocketWriter.hpp +++ b/test/blackbox/common/RTPSAsSocketWriter.hpp @@ -20,25 +20,24 @@ #ifndef _TEST_BLACKBOX_RTPSASSOCKETWRITER_HPP_ #define _TEST_BLACKBOX_RTPSASSOCKETWRITER_HPP_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include #include #include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using eprosima::fastrtps::rtps::IPLocator; @@ -237,7 +236,7 @@ class RTPSAsSocketWriter : public eprosima::fastrtps::rtps::WriterListener if (writer_attr_.endpoint.reliabilityKind == eprosima::fastrtps::rtps::RELIABLE) { - rattr.m_qos.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + rattr.m_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; } // Check disable_positive_acks_ attribute diff --git a/test/blackbox/common/RTPSBlackboxTests.cpp b/test/blackbox/common/RTPSBlackboxTests.cpp index b8f5ce212a1..c4eba1e7cdf 100644 --- a/test/blackbox/common/RTPSBlackboxTests.cpp +++ b/test/blackbox/common/RTPSBlackboxTests.cpp @@ -12,24 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" -#include - -#include -#include -#include - -#include -#include -#include -#include - using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -65,9 +63,9 @@ class BlackboxEnvironment : public ::testing::Environment // conditions related to network packets being lost should not use intraprocessr // nor datasharing. Setting it off here ensures that intraprocess and // datasharing are only tested when required. - LibrarySettingsAttributes att; - att.intraprocess_delivery = INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); //enable_datasharing = false; //Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); diff --git a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp index 35e8a45b554..13e42bc553e 100644 --- a/test/blackbox/common/RTPSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsBasic.cpp @@ -12,29 +12,30 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" #include #include #include #include -#include - +#include +#include #include #include #include #include #include #include -#include -#include +#include +// TODO(jlbueno): remove private headers +#include + +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -52,12 +53,12 @@ class RTPS : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -67,12 +68,12 @@ class RTPS : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -820,7 +821,7 @@ TEST(RTPS, MultithreadedWriterCreation) rtps_participant, writer_attr, history, nullptr); /* Register writer in participant */ - eprosima::fastrtps::WriterQos writer_qos; + eprosima::fastdds::dds::WriterQos writer_qos; ASSERT_EQ(rtps_participant->registerWriter(writer, topic_attr, writer_qos), true); { @@ -1020,12 +1021,12 @@ TEST(RTPS, reliable_has_been_fully_delivered) */ TEST(RTPS, participant_ignore_local_endpoints) { - class CustomLogConsumer : public LogConsumer + class CustomLogConsumer : public eprosima::fastdds::dds::LogConsumer { public: void Consume( - const Log::Entry&) override + const eprosima::fastdds::dds::Log::Entry&) override { logs_consumed_++; cv_.notify_all(); @@ -1074,11 +1075,11 @@ TEST(RTPS, participant_ignore_local_endpoints) std::cout << "---------------------------------------" << std::endl; /* Set up */ - Log::Reset(); - Log::SetVerbosity(Log::Error); + eprosima::fastdds::dds::Log::Reset(); + eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Error); CustomLogConsumer* log_consumer = new CustomLogConsumer(); std::unique_ptr log_consumer_unique_ptr(log_consumer); - Log::RegisterConsumer(std::move(log_consumer_unique_ptr)); + eprosima::fastdds::dds::Log::RegisterConsumer(std::move(log_consumer_unique_ptr)); // Create the RTPSParticipant with the appropriate value for the property eprosima::fastrtps::rtps::RTPSParticipantAttributes patt; @@ -1121,7 +1122,7 @@ TEST(RTPS, participant_ignore_local_endpoints) /* Tear-down */ eprosima::fastrtps::rtps::RTPSDomain::removeRTPSParticipant(participant); - Log::Reset(); + eprosima::fastdds::dds::Log::Reset(); } } diff --git a/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp b/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp index 84befaae27a..8d21db1a268 100644 --- a/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsDiscovery.cpp @@ -14,10 +14,10 @@ #include "BlackboxTests.hpp" +#include +#include #include -#include - #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" @@ -36,12 +36,12 @@ class RTPSDiscovery : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -51,12 +51,12 @@ class RTPSDiscovery : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp index eaa9ce59e64..81c728dcc8b 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPersistence.cpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 #include #include +#include +#include +#include + +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" #include "RTPSWithRegistrationReader.hpp" #include "RTPSWithRegistrationWriter.hpp" -#include - -#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -115,12 +115,12 @@ class Persistence : public ::testing::TestWithParam virtual void SetUp() { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: @@ -163,12 +163,12 @@ class Persistence : public ::testing::TestWithParam virtual void TearDown() { std::remove(db_file_name_.c_str()); - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp b/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp index 43c8b63fddb..1f385e5517a 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPersistenceGuid.cpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #if HAVE_SQLITE3 #include -#include -#include #include +#include +#include -#include "RTPSWithRegistrationWriter.hpp" -#include "RTPSWithRegistrationReader.hpp" - +#include +#include #include -#include + +#include "BlackboxTests.hpp" +#include "RTPSWithRegistrationReader.hpp" +#include "RTPSWithRegistrationWriter.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -42,12 +42,12 @@ class PersistenceGuid : public ::testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: @@ -57,12 +57,12 @@ class PersistenceGuid : public ::testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(att); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsPools.cpp b/test/blackbox/common/RTPSBlackboxTestsPools.cpp index d1a5d130dc3..9d8cc4766b9 100644 --- a/test/blackbox/common/RTPSBlackboxTestsPools.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsPools.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - -#include "RTPSWithRegistrationReader.hpp" -#include "RTPSWithRegistrationWriter.hpp" +#include +#include +#include +#include #include -#include -#include -#include +#include "BlackboxTests.hpp" +#include "RTPSWithRegistrationReader.hpp" +#include "RTPSWithRegistrationWriter.hpp" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -38,12 +38,12 @@ class RTPSCustomPools : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -53,12 +53,12 @@ class RTPSCustomPools : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp index d3981ab4575..8d92d9d3b3c 100644 --- a/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp +++ b/test/blackbox/common/RTPSBlackboxTestsVolatile.cpp @@ -12,15 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "BlackboxTests.hpp" - #include #include +#include +#include #include -#include - +#include "BlackboxTests.hpp" #include "RTPSAsSocketReader.hpp" #include "RTPSAsSocketWriter.hpp" @@ -38,12 +37,12 @@ class Volatile : public testing::TestWithParam void SetUp() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_FULL; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: @@ -53,12 +52,12 @@ class Volatile : public testing::TestWithParam void TearDown() override { - LibrarySettingsAttributes library_settings; + eprosima::fastdds::LibrarySettings library_settings; switch (GetParam()) { case INTRAPROCESS: - library_settings.intraprocess_delivery = IntraprocessDeliveryType::INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(library_settings); + library_settings.intraprocess_delivery = eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF; + eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings); break; case TRANSPORT: default: diff --git a/test/blackbox/common/RTPSWithRegistrationReader.hpp b/test/blackbox/common/RTPSWithRegistrationReader.hpp index d48300ca830..a62fb3af558 100644 --- a/test/blackbox/common/RTPSWithRegistrationReader.hpp +++ b/test/blackbox/common/RTPSWithRegistrationReader.hpp @@ -20,27 +20,26 @@ #ifndef _TEST_BLACKBOX_RTPSWITHREGISTRATIONREADER_HPP_ #define _TEST_BLACKBOX_RTPSWITHREGISTRATIONREADER_HPP_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include #include +#include + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include using eprosima::fastrtps::rtps::IPLocator; @@ -441,11 +440,11 @@ class RTPSWithRegistrationReader if (kind == eprosima::fastrtps::rtps::ReliabilityKind_t::RELIABLE) { - reader_qos_.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + reader_qos_.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; } else { - reader_qos_.m_reliability.kind = eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + reader_qos_.m_reliability.kind = eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; } return *this; @@ -632,7 +631,7 @@ class RTPSWithRegistrationReader eprosima::fastrtps::rtps::RTPSReader* reader_; eprosima::fastrtps::rtps::ReaderAttributes reader_attr_; eprosima::fastrtps::TopicAttributes topic_attr_; - eprosima::fastrtps::ReaderQos reader_qos_; + eprosima::fastdds::dds::ReaderQos reader_qos_; eprosima::fastrtps::rtps::ReaderHistory* history_; eprosima::fastrtps::rtps::HistoryAttributes hattr_; std::atomic initialized_; diff --git a/test/blackbox/common/RTPSWithRegistrationWriter.hpp b/test/blackbox/common/RTPSWithRegistrationWriter.hpp index 0b35f07cd9e..9287842cbff 100644 --- a/test/blackbox/common/RTPSWithRegistrationWriter.hpp +++ b/test/blackbox/common/RTPSWithRegistrationWriter.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include template class RTPSWithRegistrationWriter @@ -389,11 +389,11 @@ class RTPSWithRegistrationWriter if (kind == eprosima::fastrtps::rtps::ReliabilityKind_t::BEST_EFFORT) { - writer_qos_.m_reliability.kind = eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + writer_qos_.m_reliability.kind = eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; } else { - writer_qos_.m_reliability.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + writer_qos_.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; } return *this; @@ -597,7 +597,7 @@ class RTPSWithRegistrationWriter bool destroy_participant_{false}; eprosima::fastrtps::rtps::RTPSWriter* writer_; eprosima::fastrtps::rtps::WriterAttributes writer_attr_; - eprosima::fastrtps::WriterQos writer_qos_; + eprosima::fastdds::dds::WriterQos writer_qos_; eprosima::fastrtps::TopicAttributes topic_attr_; eprosima::fastrtps::rtps::WriterHistory* history_; eprosima::fastrtps::rtps::HistoryAttributes hattr_; diff --git a/test/blackbox/common/UDPMessageSender.hpp b/test/blackbox/common/UDPMessageSender.hpp index 26c340c8d5d..123e46b1873 100644 --- a/test/blackbox/common/UDPMessageSender.hpp +++ b/test/blackbox/common/UDPMessageSender.hpp @@ -2,7 +2,7 @@ #include #include -#include +#include using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/test/blackbox/discovery_participant_flags_profile.xml b/test/blackbox/discovery_participant_flags_profile.xml index ff4d216972c..a56c9a4546f 100644 --- a/test/blackbox/discovery_participant_flags_profile.xml +++ b/test/blackbox/discovery_participant_flags_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/partitions_profile.xml b/test/blackbox/partitions_profile.xml index aa418cea056..ed18a4925f5 100644 --- a/test/blackbox/partitions_profile.xml +++ b/test/blackbox/partitions_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/blackbox/types/Data1mb.cxx b/test/blackbox/types/Data1mb.cxx deleted file mode 100644 index 52b9748fed0..00000000000 --- a/test/blackbox/types/Data1mb.cxx +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data1mb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Data1mb.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - - - -Data1mb::Data1mb() -{ -} - -Data1mb::~Data1mb() -{ -} - -Data1mb::Data1mb( - const Data1mb& x) -{ - m_data = x.m_data; -} - -Data1mb::Data1mb( - Data1mb&& x) noexcept -{ - m_data = std::move(x.m_data); -} - -Data1mb& Data1mb::operator =( - const Data1mb& x) -{ - - m_data = x.m_data; - return *this; -} - -Data1mb& Data1mb::operator =( - Data1mb&& x) noexcept -{ - - m_data = std::move(x.m_data); - return *this; -} - -bool Data1mb::operator ==( - const Data1mb& x) const -{ - return (m_data == x.m_data); -} - -bool Data1mb::operator !=( - const Data1mb& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void Data1mb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void Data1mb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& Data1mb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& Data1mb::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "Data1mbCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data1mb.h b/test/blackbox/types/Data1mb.h deleted file mode 100644 index 98f2d058f3f..00000000000 --- a/test/blackbox/types/Data1mb.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data1mb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Data1mbv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_DATA1MB_H_ -#define _FAST_DDS_GENERATED_DATA1MB_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DATA1MB_SOURCE) -#define DATA1MB_DllAPI __declspec( dllexport ) -#else -#define DATA1MB_DllAPI __declspec( dllimport ) -#endif // DATA1MB_SOURCE -#else -#define DATA1MB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DATA1MB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure Data1mb defined by the user in the IDL file. - * @ingroup Data1mb - */ -class Data1mb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data1mb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data1mb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb( - const Data1mb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb( - Data1mb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb& operator =( - const Data1mb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb& operator =( - Data1mb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Data1mb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data1mb& x) const; - - /*! - * @brief Comparison operator. - * @param x Data1mb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data1mb& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - -private: - - std::vector m_data; - -}; - -#endif // _FAST_DDS_GENERATED_DATA1MB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data1mb.hpp b/test/blackbox/types/Data1mb.hpp new file mode 100644 index 00000000000..2bd35a24a42 --- /dev/null +++ b/test/blackbox/types/Data1mb.hpp @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data1mb.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DATA1MB_HPP_ +#define _FAST_DDS_GENERATED_DATA1MB_HPP_ + +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DATA1MB_SOURCE) +#define DATA1MB_DllAPI __declspec( dllexport ) +#else +#define DATA1MB_DllAPI __declspec( dllimport ) +#endif // DATA1MB_SOURCE +#else +#define DATA1MB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DATA1MB_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Data1mb defined by the user in the IDL file. + * @ingroup Data1mb + */ +class Data1mb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data1mb() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data1mb() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb( + const Data1mb& x) + { + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb( + Data1mb&& x) noexcept + { + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb& operator =( + const Data1mb& x) + { + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb& operator =( + Data1mb&& x) noexcept + { + + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Data1mb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data1mb& x) const + { + return (m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x Data1mb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data1mb& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data() + { + return m_data; + } + + + +private: + + std::vector m_data; + +}; + +#endif // _FAST_DDS_GENERATED_DATA1MB_HPP_ + + diff --git a/test/blackbox/types/Data1mbCdrAux.hpp b/test/blackbox/types/Data1mbCdrAux.hpp index 63df7fdd02d..4de75dd113b 100644 --- a/test/blackbox/types/Data1mbCdrAux.hpp +++ b/test/blackbox/types/Data1mbCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_DATA1MBCDRAUX_HPP_ #define _FAST_DDS_GENERATED_DATA1MBCDRAUX_HPP_ -#include "Data1mb.h" +#include "Data1mb.hpp" constexpr uint32_t Data1mb_max_cdr_typesize {1024008UL}; constexpr uint32_t Data1mb_max_key_cdr_typesize {0UL}; @@ -34,10 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Data1mb& data); diff --git a/test/blackbox/types/Data1mbCdrAux.ipp b/test/blackbox/types/Data1mbCdrAux.ipp index 13316beffae..2aef77347df 100644 --- a/test/blackbox/types/Data1mbCdrAux.ipp +++ b/test/blackbox/types/Data1mbCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/Data1mbPubSubTypes.cxx b/test/blackbox/types/Data1mbPubSubTypes.cxx index 0cbf598d813..69545e46c94 100644 --- a/test/blackbox/types/Data1mbPubSubTypes.cxx +++ b/test/blackbox/types/Data1mbPubSubTypes.cxx @@ -19,20 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "Data1mbPubSubTypes.h" +#include #include -#include "Data1mbPubSubTypes.h" #include "Data1mbCdrAux.hpp" +#include "Data1mbTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - Data1mbPubSubType::Data1mbPubSubType() { setName("Data1mb"); @@ -221,3 +219,11 @@ bool Data1mbPubSubType::getKey( return true; } +void Data1mbPubSubType::register_type_object_representation() const +{ + register_Data1mb_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "Data1mbCdrAux.ipp" diff --git a/test/blackbox/types/Data1mbPubSubTypes.h b/test/blackbox/types/Data1mbPubSubTypes.h index a6ec2e9f983..6751701454f 100644 --- a/test/blackbox/types/Data1mbPubSubTypes.h +++ b/test/blackbox/types/Data1mbPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Data1mb.h" +#include "Data1mb.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,10 +38,6 @@ #endif // GEN_API_VER - - - - /*! * @brief This class represents the TopicDataType of the type Data1mb defined by the user in the IDL file. * @ingroup Data1mb @@ -92,6 +88,9 @@ class Data1mbPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/Data1mbTypeObjectSupport.cxx b/test/blackbox/types/Data1mbTypeObjectSupport.cxx new file mode 100644 index 00000000000..8d7d47b584b --- /dev/null +++ b/test/blackbox/types/Data1mbTypeObjectSupport.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data1mbTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "Data1mbTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Data1mb.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Data1mb_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Data1mb_type_identifier(); + + }); +} + +void register_Data1mb_type_identifier() +{ + { + StructTypeFlag struct_flags_Data1mb = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Data1mb; + TypeIdentifierPair type_ids_Data1mb; + QualifiedTypeName type_name_Data1mb = "Data1mb"; + eprosima::fastcdr::optional type_ann_builtin_Data1mb; + eprosima::fastcdr::optional ann_custom_Data1mb; + CompleteTypeDetail detail_Data1mb = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Data1mb, ann_custom_Data1mb, type_name_Data1mb.to_string()); + CompleteStructHeader header_Data1mb; + header_Data1mb = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Data1mb); + CompleteStructMemberSeq member_seq_Data1mb; + { + return_code_Data1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_1024000", type_ids_Data1mb); + + if (return_code_Data1mb != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Data1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Data1mb); + + if (return_code_Data1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_1024000 {nullptr}; + if (EK_COMPLETE == type_ids_Data1mb.type_identifier1()._d() || TK_NONE == type_ids_Data1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_1024000 = new TypeIdentifier(type_ids_Data1mb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_1024000 = new TypeIdentifier(type_ids_Data1mb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_1024000 = EK_COMPLETE; + if (TK_NONE == type_ids_Data1mb.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_1024000 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_1024000 = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_1024000 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_1024000, element_flags_anonymous_sequence_uint8_t_1024000); + std::string type_id_kind_anonymous_sequence_uint8_t_1024000("TI_PLAIN_SEQUENCE_LARGE"); + if (type_id_kind_anonymous_sequence_uint8_t_1024000 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(1024000); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_1024000, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_1024000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_1024000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1024000 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 1024000; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_1024000, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_1024000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_1024000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1024000 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Data1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_1024000", type_ids_Data1mb); + if (return_code_Data1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1024000: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000000; + if (EK_COMPLETE == type_ids_Data1mb.type_identifier1()._d() || TK_NONE == type_ids_Data1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Data1mb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data1mb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data1mb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Data1mb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Data1mb.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Data1mb); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Data1mb, member_data); + } + CompleteStructType struct_type_Data1mb = TypeObjectUtils::build_complete_struct_type(struct_flags_Data1mb, header_Data1mb, member_seq_Data1mb); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Data1mb, type_name_Data1mb.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Data1mb already registered in TypeObjectRegistry for a different type."); + } + return_code_Data1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Data1mb", type_ids_Data1mb); + if (return_code_Data1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Data1mb: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/Data1mbTypeObjectSupport.hpp b/test/blackbox/types/Data1mbTypeObjectSupport.hpp new file mode 100644 index 00000000000..04eca279a05 --- /dev/null +++ b/test/blackbox/types/Data1mbTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data1mbTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DATA1MB_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_DATA1MB_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Data1mb_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Data1mb related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Data1mb_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_DATA1MB_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/Data1mbv1.cxx b/test/blackbox/types/Data1mbv1.cxx deleted file mode 100644 index c5a195c6f61..00000000000 --- a/test/blackbox/types/Data1mbv1.cxx +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data1mb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Data1mb.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Data1mb_max_cdr_typesize 1024008ULL; - - - - - - -Data1mb::Data1mb() -{ - // sequence m_data - - -} - -Data1mb::~Data1mb() -{ -} - -Data1mb::Data1mb( - const Data1mb& x) -{ - m_data = x.m_data; - -} - -Data1mb::Data1mb( - Data1mb&& x) noexcept -{ - m_data = std::move(x.m_data); - -} - -Data1mb& Data1mb::operator =( - const Data1mb& x) -{ - m_data = x.m_data; - - return *this; -} - -Data1mb& Data1mb::operator =( - Data1mb&& x) noexcept -{ - m_data = std::move(x.m_data); - - return *this; -} - -bool Data1mb::operator ==( - const Data1mb& x) const -{ - return (m_data == x.m_data); -} - -bool Data1mb::operator !=( - const Data1mb& x) const -{ - return !(*this == x); -} - -size_t Data1mb::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Data1mb_max_cdr_typesize; -} - -size_t Data1mb::getCdrSerializedSize( - const Data1mb& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void Data1mb::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_data; - - -} - -void Data1mb::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_data; - - -} - - -bool Data1mb::isKeyDefined() -{ - return false; -} - -void Data1mb::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void Data1mb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void Data1mb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& Data1mb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& Data1mb::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data1mbv1.h b/test/blackbox/types/Data1mbv1.h deleted file mode 100644 index ca5ad1566e9..00000000000 --- a/test/blackbox/types/Data1mbv1.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data1mb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_DATA1MB_H_ -#define _FAST_DDS_GENERATED_DATA1MB_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DATA1MB_SOURCE) -#define DATA1MB_DllAPI __declspec( dllexport ) -#else -#define DATA1MB_DllAPI __declspec( dllimport ) -#endif // DATA1MB_SOURCE -#else -#define DATA1MB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DATA1MB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure Data1mb defined by the user in the IDL file. - * @ingroup Data1mb - */ -class Data1mb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data1mb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data1mb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb( - const Data1mb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb( - Data1mb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb& operator =( - const Data1mb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Data1mb that will be copied. - */ - eProsima_user_DllExport Data1mb& operator =( - Data1mb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Data1mb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data1mb& x) const; - - /*! - * @brief Comparison operator. - * @param x Data1mb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data1mb& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Data1mb& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_DATA1MB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data64kb.cxx b/test/blackbox/types/Data64kb.cxx deleted file mode 100644 index 83b6759be62..00000000000 --- a/test/blackbox/types/Data64kb.cxx +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data64kb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Data64kb.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - - - -Data64kb::Data64kb() -{ -} - -Data64kb::~Data64kb() -{ -} - -Data64kb::Data64kb( - const Data64kb& x) -{ - m_data = x.m_data; -} - -Data64kb::Data64kb( - Data64kb&& x) noexcept -{ - m_data = std::move(x.m_data); -} - -Data64kb& Data64kb::operator =( - const Data64kb& x) -{ - - m_data = x.m_data; - return *this; -} - -Data64kb& Data64kb::operator =( - Data64kb&& x) noexcept -{ - - m_data = std::move(x.m_data); - return *this; -} - -bool Data64kb::operator ==( - const Data64kb& x) const -{ - return (m_data == x.m_data); -} - -bool Data64kb::operator !=( - const Data64kb& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void Data64kb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void Data64kb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& Data64kb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& Data64kb::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "Data64kbCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data64kb.h b/test/blackbox/types/Data64kb.h deleted file mode 100644 index 0599f7e7f85..00000000000 --- a/test/blackbox/types/Data64kb.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data64kb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Data64kbv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_DATA64KB_H_ -#define _FAST_DDS_GENERATED_DATA64KB_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DATA64KB_SOURCE) -#define DATA64KB_DllAPI __declspec( dllexport ) -#else -#define DATA64KB_DllAPI __declspec( dllimport ) -#endif // DATA64KB_SOURCE -#else -#define DATA64KB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DATA64KB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure Data64kb defined by the user in the IDL file. - * @ingroup Data64kb - */ -class Data64kb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data64kb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data64kb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb( - const Data64kb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb( - Data64kb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb& operator =( - const Data64kb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb& operator =( - Data64kb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Data64kb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data64kb& x) const; - - /*! - * @brief Comparison operator. - * @param x Data64kb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data64kb& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - -private: - - std::vector m_data; - -}; - -#endif // _FAST_DDS_GENERATED_DATA64KB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data64kb.hpp b/test/blackbox/types/Data64kb.hpp new file mode 100644 index 00000000000..56f9865b0f7 --- /dev/null +++ b/test/blackbox/types/Data64kb.hpp @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data64kb.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DATA64KB_HPP_ +#define _FAST_DDS_GENERATED_DATA64KB_HPP_ + +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DATA64KB_SOURCE) +#define DATA64KB_DllAPI __declspec( dllexport ) +#else +#define DATA64KB_DllAPI __declspec( dllimport ) +#endif // DATA64KB_SOURCE +#else +#define DATA64KB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DATA64KB_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure Data64kb defined by the user in the IDL file. + * @ingroup Data64kb + */ +class Data64kb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data64kb() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data64kb() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb( + const Data64kb& x) + { + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb( + Data64kb&& x) noexcept + { + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb& operator =( + const Data64kb& x) + { + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb& operator =( + Data64kb&& x) noexcept + { + + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Data64kb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data64kb& x) const + { + return (m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x Data64kb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data64kb& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data() + { + return m_data; + } + + + +private: + + std::vector m_data; + +}; + +#endif // _FAST_DDS_GENERATED_DATA64KB_HPP_ + + diff --git a/test/blackbox/types/Data64kbCdrAux.hpp b/test/blackbox/types/Data64kbCdrAux.hpp index 0b4ebbaab11..84f01b0a3e3 100644 --- a/test/blackbox/types/Data64kbCdrAux.hpp +++ b/test/blackbox/types/Data64kbCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_DATA64KBCDRAUX_HPP_ #define _FAST_DDS_GENERATED_DATA64KBCDRAUX_HPP_ -#include "Data64kb.h" +#include "Data64kb.hpp" constexpr uint32_t Data64kb_max_cdr_typesize {64004UL}; constexpr uint32_t Data64kb_max_key_cdr_typesize {0UL}; @@ -34,10 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Data64kb& data); diff --git a/test/blackbox/types/Data64kbCdrAux.ipp b/test/blackbox/types/Data64kbCdrAux.ipp index 0d0bc58843a..63ceb81b374 100644 --- a/test/blackbox/types/Data64kbCdrAux.ipp +++ b/test/blackbox/types/Data64kbCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/Data64kbPubSubTypes.cxx b/test/blackbox/types/Data64kbPubSubTypes.cxx index 0b8d5772498..5a511b1e409 100644 --- a/test/blackbox/types/Data64kbPubSubTypes.cxx +++ b/test/blackbox/types/Data64kbPubSubTypes.cxx @@ -19,20 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "Data64kbPubSubTypes.h" +#include #include -#include "Data64kbPubSubTypes.h" #include "Data64kbCdrAux.hpp" +#include "Data64kbTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - Data64kbPubSubType::Data64kbPubSubType() { setName("Data64kb"); @@ -221,3 +219,11 @@ bool Data64kbPubSubType::getKey( return true; } +void Data64kbPubSubType::register_type_object_representation() const +{ + register_Data64kb_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "Data64kbCdrAux.ipp" diff --git a/test/blackbox/types/Data64kbPubSubTypes.h b/test/blackbox/types/Data64kbPubSubTypes.h index 18364f202c6..c24c71ba6fd 100644 --- a/test/blackbox/types/Data64kbPubSubTypes.h +++ b/test/blackbox/types/Data64kbPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "Data64kb.h" +#include "Data64kb.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,10 +38,6 @@ #endif // GEN_API_VER - - - - /*! * @brief This class represents the TopicDataType of the type Data64kb defined by the user in the IDL file. * @ingroup Data64kb @@ -92,6 +88,9 @@ class Data64kbPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/Data64kbTypeObjectSupport.cxx b/test/blackbox/types/Data64kbTypeObjectSupport.cxx new file mode 100644 index 00000000000..7fdb7d039e1 --- /dev/null +++ b/test/blackbox/types/Data64kbTypeObjectSupport.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data64kbTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "Data64kbTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Data64kb.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Data64kb_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Data64kb_type_identifier(); + + }); +} + +void register_Data64kb_type_identifier() +{ + { + StructTypeFlag struct_flags_Data64kb = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Data64kb; + TypeIdentifierPair type_ids_Data64kb; + QualifiedTypeName type_name_Data64kb = "Data64kb"; + eprosima::fastcdr::optional type_ann_builtin_Data64kb; + eprosima::fastcdr::optional ann_custom_Data64kb; + CompleteTypeDetail detail_Data64kb = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Data64kb, ann_custom_Data64kb, type_name_Data64kb.to_string()); + CompleteStructHeader header_Data64kb; + header_Data64kb = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Data64kb); + CompleteStructMemberSeq member_seq_Data64kb; + { + return_code_Data64kb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_63996", type_ids_Data64kb); + + if (return_code_Data64kb != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Data64kb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Data64kb); + + if (return_code_Data64kb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_63996 {nullptr}; + if (EK_COMPLETE == type_ids_Data64kb.type_identifier1()._d() || TK_NONE == type_ids_Data64kb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data64kb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data64kb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_63996 = new TypeIdentifier(type_ids_Data64kb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data64kb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data64kb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data64kb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_63996 = new TypeIdentifier(type_ids_Data64kb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_63996 = EK_COMPLETE; + if (TK_NONE == type_ids_Data64kb.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_63996 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_63996 = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_63996 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_63996, element_flags_anonymous_sequence_uint8_t_63996); + std::string type_id_kind_anonymous_sequence_uint8_t_63996("TI_PLAIN_SEQUENCE_LARGE"); + if (type_id_kind_anonymous_sequence_uint8_t_63996 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(63996); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_63996, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_63996)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_63996")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_63996 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 63996; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_63996, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_63996)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_63996")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_63996 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Data64kb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_63996", type_ids_Data64kb); + if (return_code_Data64kb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_63996: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000000; + if (EK_COMPLETE == type_ids_Data64kb.type_identifier1()._d() || TK_NONE == type_ids_Data64kb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data64kb.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data64kb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data64kb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Data64kb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data64kb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data64kb.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data64kb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data64kb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data64kb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data64kb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Data64kb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Data64kb.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Data64kb); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Data64kb, member_data); + } + CompleteStructType struct_type_Data64kb = TypeObjectUtils::build_complete_struct_type(struct_flags_Data64kb, header_Data64kb, member_seq_Data64kb); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Data64kb, type_name_Data64kb.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Data64kb already registered in TypeObjectRegistry for a different type."); + } + return_code_Data64kb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Data64kb", type_ids_Data64kb); + if (return_code_Data64kb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Data64kb: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/Data64kbTypeObjectSupport.hpp b/test/blackbox/types/Data64kbTypeObjectSupport.hpp new file mode 100644 index 00000000000..1ad46136398 --- /dev/null +++ b/test/blackbox/types/Data64kbTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file Data64kbTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DATA64KB_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_DATA64KB_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Data64kb_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Data64kb related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Data64kb_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_DATA64KB_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/Data64kbv1.cxx b/test/blackbox/types/Data64kbv1.cxx deleted file mode 100644 index ee73e714a24..00000000000 --- a/test/blackbox/types/Data64kbv1.cxx +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data64kb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Data64kb.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Data64kb_max_cdr_typesize 64004ULL; - - - - - - -Data64kb::Data64kb() -{ - // sequence m_data - - -} - -Data64kb::~Data64kb() -{ -} - -Data64kb::Data64kb( - const Data64kb& x) -{ - m_data = x.m_data; - -} - -Data64kb::Data64kb( - Data64kb&& x) noexcept -{ - m_data = std::move(x.m_data); - -} - -Data64kb& Data64kb::operator =( - const Data64kb& x) -{ - m_data = x.m_data; - - return *this; -} - -Data64kb& Data64kb::operator =( - Data64kb&& x) noexcept -{ - m_data = std::move(x.m_data); - - return *this; -} - -bool Data64kb::operator ==( - const Data64kb& x) const -{ - return (m_data == x.m_data); -} - -bool Data64kb::operator !=( - const Data64kb& x) const -{ - return !(*this == x); -} - -size_t Data64kb::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Data64kb_max_cdr_typesize; -} - -size_t Data64kb::getCdrSerializedSize( - const Data64kb& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void Data64kb::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_data; - - -} - -void Data64kb::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_data; - - -} - - -bool Data64kb::isKeyDefined() -{ - return false; -} - -void Data64kb::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void Data64kb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void Data64kb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& Data64kb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& Data64kb::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data64kbv1.h b/test/blackbox/types/Data64kbv1.h deleted file mode 100644 index 773c0b07328..00000000000 --- a/test/blackbox/types/Data64kbv1.h +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Data64kb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_DATA64KB_H_ -#define _FAST_DDS_GENERATED_DATA64KB_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DATA64KB_SOURCE) -#define DATA64KB_DllAPI __declspec( dllexport ) -#else -#define DATA64KB_DllAPI __declspec( dllimport ) -#endif // DATA64KB_SOURCE -#else -#define DATA64KB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DATA64KB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure Data64kb defined by the user in the IDL file. - * @ingroup Data64kb - */ -class Data64kb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data64kb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data64kb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb( - const Data64kb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb( - Data64kb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb& operator =( - const Data64kb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Data64kb that will be copied. - */ - eProsima_user_DllExport Data64kb& operator =( - Data64kb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Data64kb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data64kb& x) const; - - /*! - * @brief Comparison operator. - * @param x Data64kb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data64kb& x) const; - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Data64kb& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_DATA64KB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/FixedSized.cxx b/test/blackbox/types/FixedSized.cxx deleted file mode 100644 index 14f4255a658..00000000000 --- a/test/blackbox/types/FixedSized.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FixedSized.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FixedSized.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -FixedSized::FixedSized() -{ -} - -FixedSized::~FixedSized() -{ -} - -FixedSized::FixedSized( - const FixedSized& x) -{ - m_index = x.m_index; -} - -FixedSized::FixedSized( - FixedSized&& x) noexcept -{ - m_index = x.m_index; -} - -FixedSized& FixedSized::operator =( - const FixedSized& x) -{ - - m_index = x.m_index; - return *this; -} - -FixedSized& FixedSized::operator =( - FixedSized&& x) noexcept -{ - - m_index = x.m_index; - return *this; -} - -bool FixedSized::operator ==( - const FixedSized& x) const -{ - return (m_index == x.m_index); -} - -bool FixedSized::operator !=( - const FixedSized& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void FixedSized::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t FixedSized::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& FixedSized::index() -{ - return m_index; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "FixedSizedCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/FixedSized.h b/test/blackbox/types/FixedSized.h deleted file mode 100644 index d4671fd3790..00000000000 --- a/test/blackbox/types/FixedSized.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FixedSized.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "FixedSizedv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_FIXEDSIZED_H_ -#define _FAST_DDS_GENERATED_FIXEDSIZED_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FIXEDSIZED_SOURCE) -#define FIXEDSIZED_DllAPI __declspec( dllexport ) -#else -#define FIXEDSIZED_DllAPI __declspec( dllimport ) -#endif // FIXEDSIZED_SOURCE -#else -#define FIXEDSIZED_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FIXEDSIZED_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FixedSized defined by the user in the IDL file. - * @ingroup FixedSized - */ -class FixedSized -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FixedSized(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FixedSized(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized( - const FixedSized& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized( - FixedSized&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized& operator =( - const FixedSized& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized& operator =( - FixedSized&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FixedSized object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FixedSized& x) const; - - /*! - * @brief Comparison operator. - * @param x FixedSized object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FixedSized& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - -private: - - uint16_t m_index{0}; - -}; - -#endif // _FAST_DDS_GENERATED_FIXEDSIZED_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/FixedSized.hpp b/test/blackbox/types/FixedSized.hpp new file mode 100644 index 00000000000..ad4a97e8f5f --- /dev/null +++ b/test/blackbox/types/FixedSized.hpp @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FixedSized.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FIXEDSIZED_HPP_ +#define _FAST_DDS_GENERATED_FIXEDSIZED_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FIXEDSIZED_SOURCE) +#define FIXEDSIZED_DllAPI __declspec( dllexport ) +#else +#define FIXEDSIZED_DllAPI __declspec( dllimport ) +#endif // FIXEDSIZED_SOURCE +#else +#define FIXEDSIZED_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FIXEDSIZED_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure FixedSized defined by the user in the IDL file. + * @ingroup FixedSized + */ +class FixedSized +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FixedSized() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FixedSized() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized( + const FixedSized& x) + { + m_index = x.m_index; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized( + FixedSized&& x) noexcept + { + m_index = x.m_index; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized& operator =( + const FixedSized& x) + { + + m_index = x.m_index; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized& operator =( + FixedSized&& x) noexcept + { + + m_index = x.m_index; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x FixedSized object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FixedSized& x) const + { + return (m_index == x.m_index); + } + + /*! + * @brief Comparison operator. + * @param x FixedSized object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FixedSized& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index() + { + return m_index; + } + + + +private: + + uint16_t m_index{0}; + +}; + +#endif // _FAST_DDS_GENERATED_FIXEDSIZED_HPP_ + + diff --git a/test/blackbox/types/FixedSizedCdrAux.hpp b/test/blackbox/types/FixedSizedCdrAux.hpp index b5a1996ed42..2179f7b93d3 100644 --- a/test/blackbox/types/FixedSizedCdrAux.hpp +++ b/test/blackbox/types/FixedSizedCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_HPP_ -#include "FixedSized.h" +#include "FixedSized.hpp" constexpr uint32_t FixedSized_max_cdr_typesize {2UL}; constexpr uint32_t FixedSized_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FixedSized& data); diff --git a/test/blackbox/types/FixedSizedCdrAux.ipp b/test/blackbox/types/FixedSizedCdrAux.ipp index fb2c91ea5ab..fa78fd735e9 100644 --- a/test/blackbox/types/FixedSizedCdrAux.ipp +++ b/test/blackbox/types/FixedSizedCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/FixedSizedPubSubTypes.cxx b/test/blackbox/types/FixedSizedPubSubTypes.cxx index 8a418964086..7b2cd9108ce 100644 --- a/test/blackbox/types/FixedSizedPubSubTypes.cxx +++ b/test/blackbox/types/FixedSizedPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "FixedSizedPubSubTypes.h" +#include #include -#include "FixedSizedPubSubTypes.h" #include "FixedSizedCdrAux.hpp" +#include "FixedSizedTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - FixedSizedPubSubType::FixedSizedPubSubType() { setName("FixedSized"); @@ -219,3 +219,11 @@ bool FixedSizedPubSubType::getKey( return true; } +void FixedSizedPubSubType::register_type_object_representation() const +{ + register_FixedSized_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "FixedSizedCdrAux.ipp" diff --git a/test/blackbox/types/FixedSizedPubSubTypes.h b/test/blackbox/types/FixedSizedPubSubTypes.h index ce899fe78d5..fa83c8bc097 100644 --- a/test/blackbox/types/FixedSizedPubSubTypes.h +++ b/test/blackbox/types/FixedSizedPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "FixedSized.h" +#include "FixedSized.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - #ifndef SWIG namespace detail { @@ -123,6 +121,9 @@ class FixedSizedPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/FixedSizedTypeObjectSupport.cxx b/test/blackbox/types/FixedSizedTypeObjectSupport.cxx new file mode 100644 index 00000000000..17f777756f4 --- /dev/null +++ b/test/blackbox/types/FixedSizedTypeObjectSupport.cxx @@ -0,0 +1,154 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FixedSizedTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "FixedSizedTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FixedSized.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_FixedSized_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_FixedSized_type_identifier(); + + }); +} + +void register_FixedSized_type_identifier() +{ + { + StructTypeFlag struct_flags_FixedSized = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_FixedSized; + TypeIdentifierPair type_ids_FixedSized; + QualifiedTypeName type_name_FixedSized = "FixedSized"; + eprosima::fastcdr::optional type_ann_builtin_FixedSized; + eprosima::fastcdr::optional ann_custom_FixedSized; + AppliedAnnotationSeq tmp_ann_custom_FixedSized; + eprosima::fastcdr::optional verbatim_FixedSized; + if (!tmp_ann_custom_FixedSized.empty()) + { + ann_custom_FixedSized = tmp_ann_custom_FixedSized; + } + + CompleteTypeDetail detail_FixedSized = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FixedSized, ann_custom_FixedSized, type_name_FixedSized.to_string()); + CompleteStructHeader header_FixedSized; + header_FixedSized = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FixedSized); + CompleteStructMemberSeq member_seq_FixedSized; + { + return_code_FixedSized = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_FixedSized); + + if (return_code_FixedSized != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_FixedSized.type_identifier1()._d() || TK_NONE == type_ids_FixedSized.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FixedSized.type_identifier1()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FixedSized.type_identifier1()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FixedSized.type_identifier1()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FixedSized.type_identifier1()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FixedSized.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FixedSized.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FixedSized.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FixedSized.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FixedSized.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FixedSized.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_FixedSized.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FixedSized.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FixedSized.type_identifier2()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FixedSized.type_identifier2()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FixedSized.type_identifier2()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FixedSized.type_identifier2()._d() && + EK_COMPLETE == type_ids_FixedSized.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FixedSized.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FixedSized.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FixedSized.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FixedSized.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FixedSized.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FixedSized.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_FixedSized.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_FixedSized.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_FixedSized); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_FixedSized, member_index); + } + CompleteStructType struct_type_FixedSized = TypeObjectUtils::build_complete_struct_type(struct_flags_FixedSized, header_FixedSized, member_seq_FixedSized); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_FixedSized, type_name_FixedSized.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FixedSized already registered in TypeObjectRegistry for a different type."); + } + return_code_FixedSized = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "FixedSized", type_ids_FixedSized); + if (return_code_FixedSized != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FixedSized: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/FixedSizedTypeObjectSupport.hpp b/test/blackbox/types/FixedSizedTypeObjectSupport.hpp new file mode 100644 index 00000000000..c08a1c7464e --- /dev/null +++ b/test/blackbox/types/FixedSizedTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file FixedSizedTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FIXEDSIZED_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_FIXEDSIZED_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_FixedSized_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register FixedSized related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_FixedSized_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_FIXEDSIZED_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/FixedSizedv1.cxx b/test/blackbox/types/FixedSizedv1.cxx deleted file mode 100644 index 1d28156bce2..00000000000 --- a/test/blackbox/types/FixedSizedv1.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FixedSized.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FixedSized.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define FixedSized_max_cdr_typesize 2ULL; - - - - -FixedSized::FixedSized() -{ - // unsigned short m_index - m_index = 0; - -} - -FixedSized::~FixedSized() -{ -} - -FixedSized::FixedSized( - const FixedSized& x) -{ - m_index = x.m_index; - -} - -FixedSized::FixedSized( - FixedSized&& x) noexcept -{ - m_index = x.m_index; - -} - -FixedSized& FixedSized::operator =( - const FixedSized& x) -{ - m_index = x.m_index; - - return *this; -} - -FixedSized& FixedSized::operator =( - FixedSized&& x) noexcept -{ - m_index = x.m_index; - - return *this; -} - -bool FixedSized::operator ==( - const FixedSized& x) const -{ - return (m_index == x.m_index); -} - -bool FixedSized::operator !=( - const FixedSized& x) const -{ - return !(*this == x); -} - -size_t FixedSized::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FixedSized_max_cdr_typesize; -} - -size_t FixedSized::getCdrSerializedSize( - const FixedSized& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - - -void FixedSized::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - -} - -void FixedSized::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - -} - - -bool FixedSized::isKeyDefined() -{ - return false; -} - -void FixedSized::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void FixedSized::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t FixedSized::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& FixedSized::index() -{ - return m_index; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/FixedSizedv1.h b/test/blackbox/types/FixedSizedv1.h deleted file mode 100644 index 26a4e500d0f..00000000000 --- a/test/blackbox/types/FixedSizedv1.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file FixedSized.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_FIXEDSIZED_H_ -#define _FAST_DDS_GENERATED_FIXEDSIZED_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FIXEDSIZED_SOURCE) -#define FIXEDSIZED_DllAPI __declspec( dllexport ) -#else -#define FIXEDSIZED_DllAPI __declspec( dllimport ) -#endif // FIXEDSIZED_SOURCE -#else -#define FIXEDSIZED_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FIXEDSIZED_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FixedSized defined by the user in the IDL file. - * @ingroup FixedSized - */ -class FixedSized -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FixedSized(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FixedSized(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized( - const FixedSized& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized( - FixedSized&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized& operator =( - const FixedSized& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FixedSized that will be copied. - */ - eProsima_user_DllExport FixedSized& operator =( - FixedSized&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FixedSized object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FixedSized& x) const; - - /*! - * @brief Comparison operator. - * @param x FixedSized object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FixedSized& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const FixedSized& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_index; - -}; - - -#endif // _FAST_DDS_GENERATED_FIXEDSIZED_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/HelloWorld.cxx b/test/blackbox/types/HelloWorld.cxx deleted file mode 100644 index 92746fad458..00000000000 --- a/test/blackbox/types/HelloWorld.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const eprosima::fastcdr::fixed_string<128>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastcdr::fixed_string<128>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<128>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<128>& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/HelloWorld.h b/test/blackbox/types/HelloWorld.h deleted file mode 100644 index 45a7a1ae125..00000000000 --- a/test/blackbox/types/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<128>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<128>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& message(); - -private: - - uint16_t m_index{0}; - eprosima::fastcdr::fixed_string<128> m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/HelloWorld.hpp b/test/blackbox/types/HelloWorld.hpp new file mode 100644 index 00000000000..aa7cc5c9a96 --- /dev/null +++ b/test/blackbox/types/HelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastcdr::fixed_string<128>& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastcdr::fixed_string<128>&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& message() + { + return m_message; + } + + + +private: + + uint16_t m_index{0}; + eprosima::fastcdr::fixed_string<128> m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/test/blackbox/types/HelloWorldCdrAux.hpp b/test/blackbox/types/HelloWorldCdrAux.hpp index aef0a2b856f..616b77d8dd3 100644 --- a/test/blackbox/types/HelloWorldCdrAux.hpp +++ b/test/blackbox/types/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {137UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/test/blackbox/types/HelloWorldCdrAux.ipp b/test/blackbox/types/HelloWorldCdrAux.ipp index b46c646b5fb..8894ea4edfb 100644 --- a/test/blackbox/types/HelloWorldCdrAux.ipp +++ b/test/blackbox/types/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/HelloWorldPubSubTypes.cxx b/test/blackbox/types/HelloWorldPubSubTypes.cxx index 050724b99a7..870332377b7 100644 --- a/test/blackbox/types/HelloWorldPubSubTypes.cxx +++ b/test/blackbox/types/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/test/blackbox/types/HelloWorldPubSubTypes.h b/test/blackbox/types/HelloWorldPubSubTypes.h index ddbfbab5db6..52736f6dad8 100644 --- a/test/blackbox/types/HelloWorldPubSubTypes.h +++ b/test/blackbox/types/HelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/HelloWorldTypeObject.cxx b/test/blackbox/types/HelloWorldTypeObject.cxx deleted file mode 100644 index 665051b534a..00000000000 --- a/test/blackbox/types/HelloWorldTypeObject.cxx +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorldTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "HelloWorld.h" -#include "HelloWorldTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerHelloWorldTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(true), - GetHelloWorldObject(true)); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(false), - GetHelloWorldObject(false)); - - }); -} - - - -const TypeIdentifier* GetHelloWorldIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetHelloWorldObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); -} - -const TypeObject* GetHelloWorldObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteHelloWorldObject(); - } - //else - return GetMinimalHelloWorldObject(); -} - -const TypeObject* GetMinimalHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_index; - mst_index.common().member_id(memberId++); - mst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_index.common().member_flags().IS_OPTIONAL(false); - mst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_index.common().member_flags().IS_KEY(false); - mst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 index_hash("index"); - for(int i = 0; i < 4; ++i) - { - mst_index.detail().name_hash()[i] = index_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_index); - - MinimalStructMember mst_message; - mst_message.common().member_id(memberId++); - mst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_message.common().member_flags().IS_OPTIONAL(false); - mst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_message.common().member_flags().IS_KEY(false); - mst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(128, false)); - - MD5 message_hash("message"); - for(int i = 0; i < 4; ++i) - { - mst_message.detail().name_hash()[i] = message_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_message); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); -} - -const TypeObject* GetCompleteHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_index; - cst_index.common().member_id(memberId++); - cst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_index.common().member_flags().IS_OPTIONAL(false); - cst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_index.common().member_flags().IS_KEY(false); - cst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_index.detail().name("index"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_index); - - CompleteStructMember cst_message; - cst_message.common().member_id(memberId++); - cst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_message.common().member_flags().IS_OPTIONAL(false); - cst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_message.common().member_flags().IS_KEY(false); - cst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(128, false)); - - cst_message.detail().name("message"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_message); - - - // Header - type_object->complete().struct_type().header().detail().type_name("HelloWorld"); - // TODO inheritance - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetfinalIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("final")); - type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); - } - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); -} diff --git a/test/blackbox/types/HelloWorldTypeObject.h b/test/blackbox/types/HelloWorldTypeObject.h deleted file mode 100644 index 76b2a621eb7..00000000000 --- a/test/blackbox/types/HelloWorldTypeObject.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorldTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HelloWorld_SOURCE) -#define HelloWorld_DllAPI __declspec( dllexport ) -#else -#define HelloWorld_DllAPI __declspec( dllimport ) -#endif // HelloWorld_SOURCE -#else -#define HelloWorld_DllAPI -#endif -#else -#define HelloWorld_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerHelloWorldTypes(); - - - -eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); -eProsima_user_DllExport const TypeObject* GetCompleteHelloWorldObject(); - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/blackbox/types/HelloWorldTypeObjectSupport.cxx b/test/blackbox/types/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..e7910987dc5 --- /dev/null +++ b/test/blackbox/types/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,255 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + AppliedAnnotationSeq tmp_ann_custom_HelloWorld; + eprosima::fastcdr::optional verbatim_HelloWorld; + if (!tmp_ann_custom_HelloWorld.empty()) + { + ann_custom_HelloWorld = tmp_ann_custom_HelloWorld; + } + + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_128", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_128("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_128 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(128); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_128")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_128 == "TI_STRING8_LARGE") + { + LBound bound = 128; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_128")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_128", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/HelloWorldTypeObjectSupport.hpp b/test/blackbox/types/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/test/blackbox/types/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/HelloWorldv1.cxx b/test/blackbox/types/HelloWorldv1.cxx deleted file mode 100644 index c22a6977683..00000000000 --- a/test/blackbox/types/HelloWorldv1.cxx +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 137ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned short m_index - m_index = 0; - // /type_d() m_message - - - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -size_t HelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloWorld_max_cdr_typesize; -} - -size_t HelloWorld::getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - { - std::string aux; - dcdr >> aux; - m_message = aux.c_str(); - } - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& HelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void HelloWorld::message( - const eprosima::fastrtps::fixed_string<128>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastrtps::fixed_string<128>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastrtps::fixed_string<128>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastrtps::fixed_string<128>& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/HelloWorldv1.h b/test/blackbox/types/HelloWorldv1.h deleted file mode 100644 index aac19514259..00000000000 --- a/test/blackbox/types/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastrtps::fixed_string<128>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastrtps::fixed_string<128>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const HelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_index; - eprosima::fastrtps::fixed_string<128> m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedData1mb.cxx b/test/blackbox/types/KeyedData1mb.cxx deleted file mode 100644 index 80f10319227..00000000000 --- a/test/blackbox/types/KeyedData1mb.cxx +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedData1mb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "KeyedData1mb.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - - - -KeyedData1mb::KeyedData1mb() -{ -} - -KeyedData1mb::~KeyedData1mb() -{ -} - -KeyedData1mb::KeyedData1mb( - const KeyedData1mb& x) -{ - m_key = x.m_key; - m_data = x.m_data; -} - -KeyedData1mb::KeyedData1mb( - KeyedData1mb&& x) noexcept -{ - m_key = x.m_key; - m_data = std::move(x.m_data); -} - -KeyedData1mb& KeyedData1mb::operator =( - const KeyedData1mb& x) -{ - - m_key = x.m_key; - m_data = x.m_data; - return *this; -} - -KeyedData1mb& KeyedData1mb::operator =( - KeyedData1mb&& x) noexcept -{ - - m_key = x.m_key; - m_data = std::move(x.m_data); - return *this; -} - -bool KeyedData1mb::operator ==( - const KeyedData1mb& x) const -{ - return (m_key == x.m_key && - m_data == x.m_data); -} - -bool KeyedData1mb::operator !=( - const KeyedData1mb& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedData1mb::key( - uint16_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint16_t KeyedData1mb::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint16_t& KeyedData1mb::key() -{ - return m_key; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void KeyedData1mb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void KeyedData1mb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& KeyedData1mb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& KeyedData1mb::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "KeyedData1mbCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedData1mb.h b/test/blackbox/types/KeyedData1mb.h deleted file mode 100644 index 6437b546685..00000000000 --- a/test/blackbox/types/KeyedData1mb.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedData1mb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "KeyedData1mbv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ -#define _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KEYEDDATA1MB_SOURCE) -#define KEYEDDATA1MB_DllAPI __declspec( dllexport ) -#else -#define KEYEDDATA1MB_DllAPI __declspec( dllimport ) -#endif // KEYEDDATA1MB_SOURCE -#else -#define KEYEDDATA1MB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define KEYEDDATA1MB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure KeyedData1mb defined by the user in the IDL file. - * @ingroup KeyedData1mb - */ -class KeyedData1mb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedData1mb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedData1mb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb( - const KeyedData1mb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb( - KeyedData1mb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb& operator =( - const KeyedData1mb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb& operator =( - KeyedData1mb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedData1mb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedData1mb& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedData1mb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedData1mb& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint16_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint16_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint16_t& key(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - -private: - - uint16_t m_key{0}; - std::vector m_data; - -}; - -#endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedData1mb.hpp b/test/blackbox/types/KeyedData1mb.hpp new file mode 100644 index 00000000000..e8b7a343214 --- /dev/null +++ b/test/blackbox/types/KeyedData1mb.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedData1mb.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_HPP_ +#define _FAST_DDS_GENERATED_KEYEDDATA1MB_HPP_ + +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(KEYEDDATA1MB_SOURCE) +#define KEYEDDATA1MB_DllAPI __declspec( dllexport ) +#else +#define KEYEDDATA1MB_DllAPI __declspec( dllimport ) +#endif // KEYEDDATA1MB_SOURCE +#else +#define KEYEDDATA1MB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define KEYEDDATA1MB_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure KeyedData1mb defined by the user in the IDL file. + * @ingroup KeyedData1mb + */ +class KeyedData1mb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyedData1mb() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyedData1mb() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb( + const KeyedData1mb& x) + { + m_key = x.m_key; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb( + KeyedData1mb&& x) noexcept + { + m_key = x.m_key; + m_data = std::move(x.m_data); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb& operator =( + const KeyedData1mb& x) + { + + m_key = x.m_key; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb& operator =( + KeyedData1mb&& x) noexcept + { + + m_key = x.m_key; + m_data = std::move(x.m_data); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x KeyedData1mb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyedData1mb& x) const + { + return (m_key == x.m_key && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x KeyedData1mb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyedData1mb& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ + eProsima_user_DllExport void key( + uint16_t _key) + { + m_key = _key; + } + + /*! + * @brief This function returns the value of member key + * @return Value of member key + */ + eProsima_user_DllExport uint16_t key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport uint16_t& key() + { + return m_key; + } + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data) + { + m_data = _data; + } + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data) + { + m_data = std::move(_data); + } + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data() + { + return m_data; + } + + + +private: + + uint16_t m_key{0}; + std::vector m_data; + +}; + +#endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_HPP_ + + diff --git a/test/blackbox/types/KeyedData1mbCdrAux.hpp b/test/blackbox/types/KeyedData1mbCdrAux.hpp index ad9b32b1c7c..1a5493d44aa 100644 --- a/test/blackbox/types/KeyedData1mbCdrAux.hpp +++ b/test/blackbox/types/KeyedData1mbCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_HPP_ #define _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_HPP_ -#include "KeyedData1mb.h" +#include "KeyedData1mb.hpp" constexpr uint32_t KeyedData1mb_max_cdr_typesize {1024008UL}; constexpr uint32_t KeyedData1mb_max_key_cdr_typesize {2UL}; @@ -34,10 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const KeyedData1mb& data); diff --git a/test/blackbox/types/KeyedData1mbCdrAux.ipp b/test/blackbox/types/KeyedData1mbCdrAux.ipp index d27be4015f7..4b2c78fb324 100644 --- a/test/blackbox/types/KeyedData1mbCdrAux.ipp +++ b/test/blackbox/types/KeyedData1mbCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/KeyedData1mbPubSubTypes.cxx b/test/blackbox/types/KeyedData1mbPubSubTypes.cxx index ba528f396c1..6e9e352882a 100644 --- a/test/blackbox/types/KeyedData1mbPubSubTypes.cxx +++ b/test/blackbox/types/KeyedData1mbPubSubTypes.cxx @@ -19,20 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "KeyedData1mbPubSubTypes.h" +#include #include -#include "KeyedData1mbPubSubTypes.h" #include "KeyedData1mbCdrAux.hpp" +#include "KeyedData1mbTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - KeyedData1mbPubSubType::KeyedData1mbPubSubType() { setName("KeyedData1mb"); @@ -221,3 +219,11 @@ bool KeyedData1mbPubSubType::getKey( return true; } +void KeyedData1mbPubSubType::register_type_object_representation() const +{ + register_KeyedData1mb_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "KeyedData1mbCdrAux.ipp" diff --git a/test/blackbox/types/KeyedData1mbPubSubTypes.h b/test/blackbox/types/KeyedData1mbPubSubTypes.h index caf92fbbfad..bad607dd6a1 100644 --- a/test/blackbox/types/KeyedData1mbPubSubTypes.h +++ b/test/blackbox/types/KeyedData1mbPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "KeyedData1mb.h" +#include "KeyedData1mb.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,10 +38,6 @@ #endif // GEN_API_VER - - - - /*! * @brief This class represents the TopicDataType of the type KeyedData1mb defined by the user in the IDL file. * @ingroup KeyedData1mb @@ -92,6 +88,9 @@ class KeyedData1mbPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/KeyedData1mbTypeObjectSupport.cxx b/test/blackbox/types/KeyedData1mbTypeObjectSupport.cxx new file mode 100644 index 00000000000..ffee8239c31 --- /dev/null +++ b/test/blackbox/types/KeyedData1mbTypeObjectSupport.cxx @@ -0,0 +1,315 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedData1mbTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "KeyedData1mbTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "KeyedData1mb.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_KeyedData1mb_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_KeyedData1mb_type_identifier(); + + }); +} + +void register_KeyedData1mb_type_identifier() +{ + { + StructTypeFlag struct_flags_KeyedData1mb = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_KeyedData1mb; + TypeIdentifierPair type_ids_KeyedData1mb; + QualifiedTypeName type_name_KeyedData1mb = "KeyedData1mb"; + eprosima::fastcdr::optional type_ann_builtin_KeyedData1mb; + eprosima::fastcdr::optional ann_custom_KeyedData1mb; + CompleteTypeDetail detail_KeyedData1mb = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_KeyedData1mb, ann_custom_KeyedData1mb, type_name_KeyedData1mb.to_string()); + CompleteStructHeader header_KeyedData1mb; + header_KeyedData1mb = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_KeyedData1mb); + CompleteStructMemberSeq member_seq_KeyedData1mb; + { + return_code_KeyedData1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_KeyedData1mb); + + if (return_code_KeyedData1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key; + MemberId member_id_key = 0x00000000; + if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1()._d() || TK_NONE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedData1mb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedData1mb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key member TypeIdentifier inconsistent."); + return; + } + MemberName name_key = "key"; + eprosima::fastcdr::optional member_ann_builtin_key; + ann_custom_KeyedData1mb.reset(); + AppliedAnnotationSeq tmp_ann_custom_key; + eprosima::fastcdr::optional unit_key; + eprosima::fastcdr::optional min_key; + eprosima::fastcdr::optional max_key; + eprosima::fastcdr::optional hash_id_key; + if (unit_key.has_value() || min_key.has_value() || max_key.has_value() || hash_id_key.has_value()) + { + member_ann_builtin_key = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key, min_key, max_key, hash_id_key); + } + if (!tmp_ann_custom_key.empty()) + { + ann_custom_KeyedData1mb = tmp_ann_custom_key; + } + CompleteMemberDetail detail_key = TypeObjectUtils::build_complete_member_detail(name_key, member_ann_builtin_key, ann_custom_KeyedData1mb); + CompleteStructMember member_key = TypeObjectUtils::build_complete_struct_member(common_key, detail_key); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyedData1mb, member_key); + } + { + return_code_KeyedData1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_1023996", type_ids_KeyedData1mb); + + if (return_code_KeyedData1mb != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_KeyedData1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_KeyedData1mb); + + if (return_code_KeyedData1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_1023996 {nullptr}; + if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1()._d() || TK_NONE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_1023996 = new TypeIdentifier(type_ids_KeyedData1mb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_1023996 = new TypeIdentifier(type_ids_KeyedData1mb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_1023996 = EK_COMPLETE; + if (TK_NONE == type_ids_KeyedData1mb.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_1023996 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_1023996 = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_1023996 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_1023996, element_flags_anonymous_sequence_uint8_t_1023996); + std::string type_id_kind_anonymous_sequence_uint8_t_1023996("TI_PLAIN_SEQUENCE_LARGE"); + if (type_id_kind_anonymous_sequence_uint8_t_1023996 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(1023996); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_1023996, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_1023996)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_1023996")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1023996 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 1023996; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_1023996, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_1023996)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_1023996")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1023996 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_KeyedData1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_1023996", type_ids_KeyedData1mb); + if (return_code_KeyedData1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_1023996: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000001; + if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1()._d() || TK_NONE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_KeyedData1mb.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedData1mb.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedData1mb.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_KeyedData1mb.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_KeyedData1mb.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_KeyedData1mb); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyedData1mb, member_data); + } + CompleteStructType struct_type_KeyedData1mb = TypeObjectUtils::build_complete_struct_type(struct_flags_KeyedData1mb, header_KeyedData1mb, member_seq_KeyedData1mb); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_KeyedData1mb, type_name_KeyedData1mb.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "KeyedData1mb already registered in TypeObjectRegistry for a different type."); + } + return_code_KeyedData1mb = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "KeyedData1mb", type_ids_KeyedData1mb); + if (return_code_KeyedData1mb != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "KeyedData1mb: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/KeyedData1mbTypeObjectSupport.hpp b/test/blackbox/types/KeyedData1mbTypeObjectSupport.hpp new file mode 100644 index 00000000000..1bbfe8307b0 --- /dev/null +++ b/test/blackbox/types/KeyedData1mbTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedData1mbTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_KEYEDDATA1MB_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_KeyedData1mb_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register KeyedData1mb related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_KeyedData1mb_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/KeyedData1mbv1.cxx b/test/blackbox/types/KeyedData1mbv1.cxx deleted file mode 100644 index f7793295217..00000000000 --- a/test/blackbox/types/KeyedData1mbv1.cxx +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedData1mb.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "KeyedData1mb.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define KeyedData1mb_max_cdr_typesize 1024008ULL; - - - - - - -KeyedData1mb::KeyedData1mb() -{ - // unsigned short m_key - m_key = 0; - // sequence m_data - - -} - -KeyedData1mb::~KeyedData1mb() -{ -} - -KeyedData1mb::KeyedData1mb( - const KeyedData1mb& x) -{ - m_key = x.m_key; - - - m_data = x.m_data; - -} - -KeyedData1mb::KeyedData1mb( - KeyedData1mb&& x) noexcept -{ - m_key = x.m_key; - - - m_data = std::move(x.m_data); - -} - -KeyedData1mb& KeyedData1mb::operator =( - const KeyedData1mb& x) -{ - m_key = x.m_key; - - - m_data = x.m_data; - - return *this; -} - -KeyedData1mb& KeyedData1mb::operator =( - KeyedData1mb&& x) noexcept -{ - m_key = x.m_key; - - - m_data = std::move(x.m_data); - - return *this; -} - -bool KeyedData1mb::operator ==( - const KeyedData1mb& x) const -{ - return (m_key == x.m_key && - m_data == x.m_data); -} - -bool KeyedData1mb::operator !=( - const KeyedData1mb& x) const -{ - return !(*this == x); -} - -size_t KeyedData1mb::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return KeyedData1mb_max_cdr_typesize; -} - -size_t KeyedData1mb::getCdrSerializedSize( - const KeyedData1mb& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void KeyedData1mb::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_key; - - scdr << m_data; - - -} - -void KeyedData1mb::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_key; - - - - dcdr >> m_data; - - -} - - -bool KeyedData1mb::isKeyDefined() -{ - return true; -} - -void KeyedData1mb::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - scdr << m_key; - - -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedData1mb::key( - uint16_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint16_t KeyedData1mb::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint16_t& KeyedData1mb::key() -{ - return m_key; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void KeyedData1mb::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void KeyedData1mb::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& KeyedData1mb::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& KeyedData1mb::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedData1mbv1.h b/test/blackbox/types/KeyedData1mbv1.h deleted file mode 100644 index 402a33291af..00000000000 --- a/test/blackbox/types/KeyedData1mbv1.h +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedData1mb.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ -#define _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KEYEDDATA1MB_SOURCE) -#define KEYEDDATA1MB_DllAPI __declspec( dllexport ) -#else -#define KEYEDDATA1MB_DllAPI __declspec( dllimport ) -#endif // KEYEDDATA1MB_SOURCE -#else -#define KEYEDDATA1MB_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define KEYEDDATA1MB_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure KeyedData1mb defined by the user in the IDL file. - * @ingroup KeyedData1mb - */ -class KeyedData1mb -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedData1mb(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedData1mb(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb( - const KeyedData1mb& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb( - KeyedData1mb&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb& operator =( - const KeyedData1mb& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedData1mb that will be copied. - */ - eProsima_user_DllExport KeyedData1mb& operator =( - KeyedData1mb&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedData1mb object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedData1mb& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedData1mb object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedData1mb& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint16_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint16_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint16_t& key(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const KeyedData1mb& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_key; - std::vector m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedHelloWorld.cxx b/test/blackbox/types/KeyedHelloWorld.cxx deleted file mode 100644 index ed5211c6be4..00000000000 --- a/test/blackbox/types/KeyedHelloWorld.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "KeyedHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -KeyedHelloWorld::KeyedHelloWorld() -{ -} - -KeyedHelloWorld::~KeyedHelloWorld() -{ -} - -KeyedHelloWorld::KeyedHelloWorld( - const KeyedHelloWorld& x) -{ - m_key = x.m_key; - m_index = x.m_index; - m_message = x.m_message; -} - -KeyedHelloWorld::KeyedHelloWorld( - KeyedHelloWorld&& x) noexcept -{ - m_key = x.m_key; - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -KeyedHelloWorld& KeyedHelloWorld::operator =( - const KeyedHelloWorld& x) -{ - - m_key = x.m_key; - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -KeyedHelloWorld& KeyedHelloWorld::operator =( - KeyedHelloWorld&& x) noexcept -{ - - m_key = x.m_key; - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool KeyedHelloWorld::operator ==( - const KeyedHelloWorld& x) const -{ - return (m_key == x.m_key && - m_index == x.m_index && - m_message == x.m_message); -} - -bool KeyedHelloWorld::operator !=( - const KeyedHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedHelloWorld::key( - uint16_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint16_t KeyedHelloWorld::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint16_t& KeyedHelloWorld::key() -{ - return m_key; -} - - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void KeyedHelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t KeyedHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& KeyedHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void KeyedHelloWorld::message( - const eprosima::fastcdr::fixed_string<128>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void KeyedHelloWorld::message( - eprosima::fastcdr::fixed_string<128>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<128>& KeyedHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<128>& KeyedHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "KeyedHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedHelloWorld.h b/test/blackbox/types/KeyedHelloWorld.h deleted file mode 100644 index 0ec54f057b8..00000000000 --- a/test/blackbox/types/KeyedHelloWorld.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "KeyedHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KEYEDHELLOWORLD_SOURCE) -#define KEYEDHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define KEYEDHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // KEYEDHELLOWORLD_SOURCE -#else -#define KEYEDHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define KEYEDHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure KeyedHelloWorld defined by the user in the IDL file. - * @ingroup KeyedHelloWorld - */ -class KeyedHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld( - const KeyedHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld( - KeyedHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld& operator =( - const KeyedHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld& operator =( - KeyedHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedHelloWorld& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint16_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint16_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint16_t& key(); - - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<128>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<128>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& message(); - -private: - - uint16_t m_key{0}; - uint16_t m_index{0}; - eprosima::fastcdr::fixed_string<128> m_message; - -}; - -#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedHelloWorld.hpp b/test/blackbox/types/KeyedHelloWorld.hpp new file mode 100644 index 00000000000..fcff19a6304 --- /dev/null +++ b/test/blackbox/types/KeyedHelloWorld.hpp @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedHelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(KEYEDHELLOWORLD_SOURCE) +#define KEYEDHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define KEYEDHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // KEYEDHELLOWORLD_SOURCE +#else +#define KEYEDHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define KEYEDHELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure KeyedHelloWorld defined by the user in the IDL file. + * @ingroup KeyedHelloWorld + */ +class KeyedHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyedHelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyedHelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld( + const KeyedHelloWorld& x) + { + m_key = x.m_key; + + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld( + KeyedHelloWorld&& x) noexcept + { + m_key = x.m_key; + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld& operator =( + const KeyedHelloWorld& x) + { + + m_key = x.m_key; + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld& operator =( + KeyedHelloWorld&& x) noexcept + { + + m_key = x.m_key; + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x KeyedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyedHelloWorld& x) const + { + return (m_key == x.m_key && + m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x KeyedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyedHelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ + eProsima_user_DllExport void key( + uint16_t _key) + { + m_key = _key; + } + + /*! + * @brief This function returns the value of member key + * @return Value of member key + */ + eProsima_user_DllExport uint16_t key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport uint16_t& key() + { + return m_key; + } + + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastcdr::fixed_string<128>& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastcdr::fixed_string<128>&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& message() + { + return m_message; + } + + + +private: + + uint16_t m_key{0}; + uint16_t m_index{0}; + eprosima::fastcdr::fixed_string<128> m_message; + +}; + +#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_HPP_ + + diff --git a/test/blackbox/types/KeyedHelloWorldCdrAux.hpp b/test/blackbox/types/KeyedHelloWorldCdrAux.hpp index d25e9dc8485..294bc5672a0 100644 --- a/test/blackbox/types/KeyedHelloWorldCdrAux.hpp +++ b/test/blackbox/types/KeyedHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_HPP_ -#include "KeyedHelloWorld.h" +#include "KeyedHelloWorld.hpp" constexpr uint32_t KeyedHelloWorld_max_cdr_typesize {141UL}; constexpr uint32_t KeyedHelloWorld_max_key_cdr_typesize {2UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const KeyedHelloWorld& data); diff --git a/test/blackbox/types/KeyedHelloWorldCdrAux.ipp b/test/blackbox/types/KeyedHelloWorldCdrAux.ipp index de20692e2cb..8fb6dcf3801 100644 --- a/test/blackbox/types/KeyedHelloWorldCdrAux.ipp +++ b/test/blackbox/types/KeyedHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx b/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx index f5714a42c75..30a96eb36c8 100644 --- a/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx +++ b/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "KeyedHelloWorldPubSubTypes.h" +#include #include -#include "KeyedHelloWorldPubSubTypes.h" #include "KeyedHelloWorldCdrAux.hpp" +#include "KeyedHelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - KeyedHelloWorldPubSubType::KeyedHelloWorldPubSubType() { setName("KeyedHelloWorld"); @@ -219,3 +219,11 @@ bool KeyedHelloWorldPubSubType::getKey( return true; } +void KeyedHelloWorldPubSubType::register_type_object_representation() const +{ + register_KeyedHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "KeyedHelloWorldCdrAux.ipp" diff --git a/test/blackbox/types/KeyedHelloWorldPubSubTypes.h b/test/blackbox/types/KeyedHelloWorldPubSubTypes.h index 827c99ed420..72888c8dc18 100644 --- a/test/blackbox/types/KeyedHelloWorldPubSubTypes.h +++ b/test/blackbox/types/KeyedHelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "KeyedHelloWorld.h" +#include "KeyedHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type KeyedHelloWorld defined by the user in the IDL file. * @ingroup KeyedHelloWorld @@ -90,6 +88,9 @@ class KeyedHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.cxx b/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..9bf8b68d2c6 --- /dev/null +++ b/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,325 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "KeyedHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "KeyedHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_KeyedHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_KeyedHelloWorld_type_identifier(); + + }); +} + +void register_KeyedHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_KeyedHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_KeyedHelloWorld; + TypeIdentifierPair type_ids_KeyedHelloWorld; + QualifiedTypeName type_name_KeyedHelloWorld = "KeyedHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_KeyedHelloWorld; + eprosima::fastcdr::optional ann_custom_KeyedHelloWorld; + CompleteTypeDetail detail_KeyedHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_KeyedHelloWorld, ann_custom_KeyedHelloWorld, type_name_KeyedHelloWorld.to_string()); + CompleteStructHeader header_KeyedHelloWorld; + header_KeyedHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_KeyedHelloWorld); + CompleteStructMemberSeq member_seq_KeyedHelloWorld; + { + return_code_KeyedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_KeyedHelloWorld); + + if (return_code_KeyedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key; + MemberId member_id_key = 0x00000000; + if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key = TypeObjectUtils::build_common_struct_member(member_id_key, member_flags_key, type_ids_KeyedHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key member TypeIdentifier inconsistent."); + return; + } + MemberName name_key = "key"; + eprosima::fastcdr::optional member_ann_builtin_key; + ann_custom_KeyedHelloWorld.reset(); + AppliedAnnotationSeq tmp_ann_custom_key; + eprosima::fastcdr::optional unit_key; + eprosima::fastcdr::optional min_key; + eprosima::fastcdr::optional max_key; + eprosima::fastcdr::optional hash_id_key; + if (unit_key.has_value() || min_key.has_value() || max_key.has_value() || hash_id_key.has_value()) + { + member_ann_builtin_key = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key, min_key, max_key, hash_id_key); + } + if (!tmp_ann_custom_key.empty()) + { + ann_custom_KeyedHelloWorld = tmp_ann_custom_key; + } + CompleteMemberDetail detail_key = TypeObjectUtils::build_complete_member_detail(name_key, member_ann_builtin_key, ann_custom_KeyedHelloWorld); + CompleteStructMember member_key = TypeObjectUtils::build_complete_struct_member(common_key, detail_key); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyedHelloWorld, member_key); + } + { + return_code_KeyedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_KeyedHelloWorld); + + if (return_code_KeyedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000001; + if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_KeyedHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_KeyedHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_KeyedHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_KeyedHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyedHelloWorld, member_index); + } + { + return_code_KeyedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_128", type_ids_KeyedHelloWorld); + + if (return_code_KeyedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_128("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_128 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(128); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_128")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_128 == "TI_STRING8_LARGE") + { + LBound bound = 128; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_128")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128: Unknown String kind."); + return; + } + return_code_KeyedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_128", type_ids_KeyedHelloWorld); + if (return_code_KeyedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_128: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000002; + if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_KeyedHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_KeyedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_KeyedHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_KeyedHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_KeyedHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_KeyedHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_KeyedHelloWorld, member_message); + } + CompleteStructType struct_type_KeyedHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_KeyedHelloWorld, header_KeyedHelloWorld, member_seq_KeyedHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_KeyedHelloWorld, type_name_KeyedHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "KeyedHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_KeyedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "KeyedHelloWorld", type_ids_KeyedHelloWorld); + if (return_code_KeyedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "KeyedHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.hpp b/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..448b5addc97 --- /dev/null +++ b/test/blackbox/types/KeyedHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file KeyedHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_KeyedHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register KeyedHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_KeyedHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/KeyedHelloWorldv1.cxx b/test/blackbox/types/KeyedHelloWorldv1.cxx deleted file mode 100644 index 3391af9cd87..00000000000 --- a/test/blackbox/types/KeyedHelloWorldv1.cxx +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "KeyedHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define KeyedHelloWorld_max_cdr_typesize 141ULL; - - - - -KeyedHelloWorld::KeyedHelloWorld() -{ - // unsigned short m_key - m_key = 0; - // unsigned short m_index - m_index = 0; - // /type_d() m_message - - -} - -KeyedHelloWorld::~KeyedHelloWorld() -{ -} - -KeyedHelloWorld::KeyedHelloWorld( - const KeyedHelloWorld& x) -{ - m_key = x.m_key; - - - m_index = x.m_index; - - - m_message = x.m_message; - -} - -KeyedHelloWorld::KeyedHelloWorld( - KeyedHelloWorld&& x) noexcept -{ - m_key = x.m_key; - - - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -KeyedHelloWorld& KeyedHelloWorld::operator =( - const KeyedHelloWorld& x) -{ - m_key = x.m_key; - - - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -KeyedHelloWorld& KeyedHelloWorld::operator =( - KeyedHelloWorld&& x) noexcept -{ - m_key = x.m_key; - - - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool KeyedHelloWorld::operator ==( - const KeyedHelloWorld& x) const -{ - return (m_key == x.m_key && - m_index == x.m_index && - m_message == x.m_message); -} - -bool KeyedHelloWorld::operator !=( - const KeyedHelloWorld& x) const -{ - return !(*this == x); -} - -size_t KeyedHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return KeyedHelloWorld_max_cdr_typesize; -} - -size_t KeyedHelloWorld::getCdrSerializedSize( - const KeyedHelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void KeyedHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_key; - - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void KeyedHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_key; - - - - dcdr >> m_index; - - - - { - std::string aux; - dcdr >> aux; - m_message = aux.c_str(); - } - - -} - - -bool KeyedHelloWorld::isKeyDefined() -{ - return true; -} - -void KeyedHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - scdr << m_key; - - - -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedHelloWorld::key( - uint16_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint16_t KeyedHelloWorld::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint16_t& KeyedHelloWorld::key() -{ - return m_key; -} - - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void KeyedHelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t KeyedHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& KeyedHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void KeyedHelloWorld::message( - const eprosima::fastrtps::fixed_string<128>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void KeyedHelloWorld::message( - eprosima::fastrtps::fixed_string<128>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastrtps::fixed_string<128>& KeyedHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastrtps::fixed_string<128>& KeyedHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedHelloWorldv1.h b/test/blackbox/types/KeyedHelloWorldv1.h deleted file mode 100644 index 6c236fe258f..00000000000 --- a/test/blackbox/types/KeyedHelloWorldv1.h +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file KeyedHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KEYEDHELLOWORLD_SOURCE) -#define KEYEDHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define KEYEDHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // KEYEDHELLOWORLD_SOURCE -#else -#define KEYEDHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define KEYEDHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure KeyedHelloWorld defined by the user in the IDL file. - * @ingroup KeyedHelloWorld - */ -class KeyedHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld( - const KeyedHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld( - KeyedHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld& operator =( - const KeyedHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedHelloWorld that will be copied. - */ - eProsima_user_DllExport KeyedHelloWorld& operator =( - KeyedHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedHelloWorld& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint16_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint16_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint16_t& key(); - - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastrtps::fixed_string<128>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastrtps::fixed_string<128>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const KeyedHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_key; - uint16_t m_index; - eprosima::fastrtps::fixed_string<128> m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/StringTest.cxx b/test/blackbox/types/StringTest.cxx deleted file mode 100644 index 6da9dd7d32e..00000000000 --- a/test/blackbox/types/StringTest.cxx +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringTest.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "StringTest.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -StringTest::StringTest() -{ -} - -StringTest::~StringTest() -{ -} - -StringTest::StringTest( - const StringTest& x) -{ - m_message = x.m_message; -} - -StringTest::StringTest( - StringTest&& x) noexcept -{ - m_message = std::move(x.m_message); -} - -StringTest& StringTest::operator =( - const StringTest& x) -{ - - m_message = x.m_message; - return *this; -} - -StringTest& StringTest::operator =( - StringTest&& x) noexcept -{ - - m_message = std::move(x.m_message); - return *this; -} - -bool StringTest::operator ==( - const StringTest& x) const -{ - return (m_message == x.m_message); -} - -bool StringTest::operator !=( - const StringTest& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void StringTest::message( - const eprosima::fastcdr::fixed_string<10000>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void StringTest::message( - eprosima::fastcdr::fixed_string<10000>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<10000>& StringTest::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<10000>& StringTest::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "StringTestCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/StringTest.h b/test/blackbox/types/StringTest.h deleted file mode 100644 index 6065acb5f13..00000000000 --- a/test/blackbox/types/StringTest.h +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringTest.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "StringTestv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_STRINGTEST_H_ -#define _FAST_DDS_GENERATED_STRINGTEST_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(STRINGTEST_SOURCE) -#define STRINGTEST_DllAPI __declspec( dllexport ) -#else -#define STRINGTEST_DllAPI __declspec( dllimport ) -#endif // STRINGTEST_SOURCE -#else -#define STRINGTEST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define STRINGTEST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure StringTest defined by the user in the IDL file. - * @ingroup StringTest - */ -class StringTest -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringTest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringTest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest( - const StringTest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest( - StringTest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest& operator =( - const StringTest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest& operator =( - StringTest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringTest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringTest& x) const; - - /*! - * @brief Comparison operator. - * @param x StringTest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringTest& x) const; - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<10000>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<10000>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<10000>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<10000>& message(); - -private: - - eprosima::fastcdr::fixed_string<10000> m_message; - -}; - -#endif // _FAST_DDS_GENERATED_STRINGTEST_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/StringTest.hpp b/test/blackbox/types/StringTest.hpp new file mode 100644 index 00000000000..822d4697392 --- /dev/null +++ b/test/blackbox/types/StringTest.hpp @@ -0,0 +1,190 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StringTest.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STRINGTEST_HPP_ +#define _FAST_DDS_GENERATED_STRINGTEST_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(STRINGTEST_SOURCE) +#define STRINGTEST_DllAPI __declspec( dllexport ) +#else +#define STRINGTEST_DllAPI __declspec( dllimport ) +#endif // STRINGTEST_SOURCE +#else +#define STRINGTEST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define STRINGTEST_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure StringTest defined by the user in the IDL file. + * @ingroup StringTest + */ +class StringTest +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringTest() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringTest() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest( + const StringTest& x) + { + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest( + StringTest&& x) noexcept + { + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest& operator =( + const StringTest& x) + { + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest& operator =( + StringTest&& x) noexcept + { + + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StringTest object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringTest& x) const + { + return (m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x StringTest object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringTest& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastcdr::fixed_string<10000>& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastcdr::fixed_string<10000>&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<10000>& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<10000>& message() + { + return m_message; + } + + + +private: + + eprosima::fastcdr::fixed_string<10000> m_message; + +}; + +#endif // _FAST_DDS_GENERATED_STRINGTEST_HPP_ + + diff --git a/test/blackbox/types/StringTestCdrAux.hpp b/test/blackbox/types/StringTestCdrAux.hpp index e823e199e62..5e7710437f9 100644 --- a/test/blackbox/types/StringTestCdrAux.hpp +++ b/test/blackbox/types/StringTestCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_STRINGTESTCDRAUX_HPP_ #define _FAST_DDS_GENERATED_STRINGTESTCDRAUX_HPP_ -#include "StringTest.h" +#include "StringTest.hpp" constexpr uint32_t StringTest_max_cdr_typesize {10009UL}; constexpr uint32_t StringTest_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StringTest& data); diff --git a/test/blackbox/types/StringTestCdrAux.ipp b/test/blackbox/types/StringTestCdrAux.ipp index 21ab156e2e3..f4c94087886 100644 --- a/test/blackbox/types/StringTestCdrAux.ipp +++ b/test/blackbox/types/StringTestCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/StringTestPubSubTypes.cxx b/test/blackbox/types/StringTestPubSubTypes.cxx index a030d2a9d40..c4df624df9b 100644 --- a/test/blackbox/types/StringTestPubSubTypes.cxx +++ b/test/blackbox/types/StringTestPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "StringTestPubSubTypes.h" +#include #include -#include "StringTestPubSubTypes.h" #include "StringTestCdrAux.hpp" +#include "StringTestTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - StringTestPubSubType::StringTestPubSubType() { setName("StringTest"); @@ -219,3 +219,11 @@ bool StringTestPubSubType::getKey( return true; } +void StringTestPubSubType::register_type_object_representation() const +{ + register_StringTest_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "StringTestCdrAux.ipp" diff --git a/test/blackbox/types/StringTestPubSubTypes.h b/test/blackbox/types/StringTestPubSubTypes.h index 51a448b7f62..2444a0ae7ba 100644 --- a/test/blackbox/types/StringTestPubSubTypes.h +++ b/test/blackbox/types/StringTestPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "StringTest.h" +#include "StringTest.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type StringTest defined by the user in the IDL file. * @ingroup StringTest @@ -90,6 +88,9 @@ class StringTestPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/StringTestTypeObjectSupport.cxx b/test/blackbox/types/StringTestTypeObjectSupport.cxx new file mode 100644 index 00000000000..27ca1d150f8 --- /dev/null +++ b/test/blackbox/types/StringTestTypeObjectSupport.cxx @@ -0,0 +1,184 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StringTestTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "StringTestTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "StringTest.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_StringTest_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_StringTest_type_identifier(); + + }); +} + +void register_StringTest_type_identifier() +{ + { + StructTypeFlag struct_flags_StringTest = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_StringTest; + TypeIdentifierPair type_ids_StringTest; + QualifiedTypeName type_name_StringTest = "StringTest"; + eprosima::fastcdr::optional type_ann_builtin_StringTest; + eprosima::fastcdr::optional ann_custom_StringTest; + CompleteTypeDetail detail_StringTest = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StringTest, ann_custom_StringTest, type_name_StringTest.to_string()); + CompleteStructHeader header_StringTest; + header_StringTest = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StringTest); + CompleteStructMemberSeq member_seq_StringTest; + { + return_code_StringTest = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_10000", type_ids_StringTest); + + if (return_code_StringTest != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_10000("TI_STRING8_LARGE"); + if (type_id_kind_anonymous_string_10000 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(10000); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_10000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_10000 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_10000 == "TI_STRING8_LARGE") + { + LBound bound = 10000; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_10000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_10000 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_10000: Unknown String kind."); + return; + } + return_code_StringTest = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_10000", type_ids_StringTest); + if (return_code_StringTest != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_10000: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000000; + if (EK_COMPLETE == type_ids_StringTest.type_identifier1()._d() || TK_NONE == type_ids_StringTest.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringTest.type_identifier1()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringTest.type_identifier1()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StringTest.type_identifier1()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StringTest.type_identifier1()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StringTest.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StringTest.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StringTest.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StringTest.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StringTest.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StringTest.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_StringTest.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StringTest.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StringTest.type_identifier2()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StringTest.type_identifier2()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StringTest.type_identifier2()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StringTest.type_identifier2()._d() && + EK_COMPLETE == type_ids_StringTest.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StringTest.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StringTest.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StringTest.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StringTest.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StringTest.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StringTest.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_StringTest.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_StringTest.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_StringTest); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_StringTest, member_message); + } + CompleteStructType struct_type_StringTest = TypeObjectUtils::build_complete_struct_type(struct_flags_StringTest, header_StringTest, member_seq_StringTest); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StringTest, type_name_StringTest.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StringTest already registered in TypeObjectRegistry for a different type."); + } + return_code_StringTest = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StringTest", type_ids_StringTest); + if (return_code_StringTest != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StringTest: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/StringTestTypeObjectSupport.hpp b/test/blackbox/types/StringTestTypeObjectSupport.hpp new file mode 100644 index 00000000000..2171ee41f2b --- /dev/null +++ b/test/blackbox/types/StringTestTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file StringTestTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_STRINGTEST_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_STRINGTEST_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_StringTest_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register StringTest related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_StringTest_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_STRINGTEST_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/StringTestv1.cxx b/test/blackbox/types/StringTestv1.cxx deleted file mode 100644 index b5c46f9ae1c..00000000000 --- a/test/blackbox/types/StringTestv1.cxx +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringTest.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "StringTest.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define StringTest_max_cdr_typesize 10009ULL; - - - - -StringTest::StringTest() -{ - // /type_d() m_message - - -} - -StringTest::~StringTest() -{ -} - -StringTest::StringTest( - const StringTest& x) -{ - m_message = x.m_message; - -} - -StringTest::StringTest( - StringTest&& x) noexcept -{ - m_message = std::move(x.m_message); - -} - -StringTest& StringTest::operator =( - const StringTest& x) -{ - m_message = x.m_message; - - return *this; -} - -StringTest& StringTest::operator =( - StringTest&& x) noexcept -{ - m_message = std::move(x.m_message); - - return *this; -} - -bool StringTest::operator ==( - const StringTest& x) const -{ - return (m_message == x.m_message); -} - -bool StringTest::operator !=( - const StringTest& x) const -{ - return !(*this == x); -} - -size_t StringTest::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringTest_max_cdr_typesize; -} - -size_t StringTest::getCdrSerializedSize( - const StringTest& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringTest::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_message.c_str(); - -} - -void StringTest::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_message = aux.c_str(); - } - - -} - - -bool StringTest::isKeyDefined() -{ - return false; -} - -void StringTest::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void StringTest::message( - const eprosima::fastrtps::fixed_string<10000>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void StringTest::message( - eprosima::fastrtps::fixed_string<10000>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastrtps::fixed_string<10000>& StringTest::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastrtps::fixed_string<10000>& StringTest::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/StringTestv1.h b/test/blackbox/types/StringTestv1.h deleted file mode 100644 index 6d7121196e7..00000000000 --- a/test/blackbox/types/StringTestv1.h +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file StringTest.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_STRINGTEST_H_ -#define _FAST_DDS_GENERATED_STRINGTEST_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(STRINGTEST_SOURCE) -#define STRINGTEST_DllAPI __declspec( dllexport ) -#else -#define STRINGTEST_DllAPI __declspec( dllimport ) -#endif // STRINGTEST_SOURCE -#else -#define STRINGTEST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define STRINGTEST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure StringTest defined by the user in the IDL file. - * @ingroup StringTest - */ -class StringTest -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringTest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringTest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest( - const StringTest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest( - StringTest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest& operator =( - const StringTest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringTest that will be copied. - */ - eProsima_user_DllExport StringTest& operator =( - StringTest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringTest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringTest& x) const; - - /*! - * @brief Comparison operator. - * @param x StringTest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringTest& x) const; - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const eprosima::fastrtps::fixed_string<10000>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastrtps::fixed_string<10000>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<10000>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<10000>& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StringTest& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastrtps::fixed_string<10000> m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_STRINGTEST_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestIncludeRegression3361.cxx b/test/blackbox/types/TestIncludeRegression3361.cxx deleted file mode 100644 index bd999acb638..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361.cxx +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TestIncludeRegression3361.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TestIncludeRegression3361TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - -namespace TestModule { - - -} // namespace TestModule -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestIncludeRegression3361.h b/test/blackbox/types/TestIncludeRegression3361.h deleted file mode 100644 index 9f0c54030ed..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "TestIncludeRegression3361v1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ -#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TESTINCLUDEREGRESSION3361_SOURCE) -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllexport ) -#else -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllimport ) -#endif // TESTINCLUDEREGRESSION3361_SOURCE -#else -#define TESTINCLUDEREGRESSION3361_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TESTINCLUDEREGRESSION3361_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -namespace TestModule { - -typedef std::string MACHINEID; - - -} // namespace TestModule - -#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestIncludeRegression3361.hpp b/test/blackbox/types/TestIncludeRegression3361.hpp new file mode 100644 index 00000000000..16a7933db21 --- /dev/null +++ b/test/blackbox/types/TestIncludeRegression3361.hpp @@ -0,0 +1,63 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestIncludeRegression3361.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_HPP_ +#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TESTINCLUDEREGRESSION3361_SOURCE) +#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllexport ) +#else +#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllimport ) +#endif // TESTINCLUDEREGRESSION3361_SOURCE +#else +#define TESTINCLUDEREGRESSION3361_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TESTINCLUDEREGRESSION3361_DllAPI +#endif // _WIN32 + +namespace TestModule { + +typedef std::string MACHINEID; + + +} // namespace TestModule + +#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_HPP_ + + diff --git a/test/blackbox/types/TestIncludeRegression3361PubSubTypes.h b/test/blackbox/types/TestIncludeRegression3361PubSubTypes.h index 816d55fe4a4..161a4f404e5 100644 --- a/test/blackbox/types/TestIncludeRegression3361PubSubTypes.h +++ b/test/blackbox/types/TestIncludeRegression3361PubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "TestIncludeRegression3361.h" +#include "TestIncludeRegression3361.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -40,7 +40,7 @@ namespace TestModule { typedef std::string MACHINEID; -} +} // namespace TestModule #endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_PUBSUBTYPES_H_ diff --git a/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx b/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx deleted file mode 100644 index 9fa90fe1008..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361TypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "TestIncludeRegression3361.h" -#include "TestIncludeRegression3361TypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTestIncludeRegression3361Types() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("TestModule::MACHINEID", TestModule::GetMACHINEIDIdentifier(true), - TestModule::GetMACHINEIDObject(true)); - factory->add_type_object("TestModule::MACHINEID", TestModule::GetMACHINEIDIdentifier(false), - TestModule::GetMACHINEIDObject(false)); - - - }); -} - -namespace TestModule { - const TypeIdentifier* GetMACHINEIDIdentifier(bool complete) - { - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MACHINEID", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMACHINEIDObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MACHINEID", complete); - } - - const TypeObject* GetMACHINEIDObject(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MACHINEID", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMACHINEIDObject(); - } - else - { - return GetMinimalMACHINEIDObject(); - } - } - - const TypeObject* GetMinimalMACHINEIDObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MACHINEID", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_string_type_name(255, false), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MACHINEID", TypeNamesGenerator::get_string_type_name(255, false)); - - TypeObjectFactory::get_instance()->add_type_object("MACHINEID", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MACHINEID", false); - } - - const TypeObject* GetCompleteMACHINEIDObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MACHINEID", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MACHINEID"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_string_type_name(255, false)); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MACHINEID", TypeNamesGenerator::get_string_type_name(255, false)); - - TypeObjectFactory::get_instance()->add_type_object("MACHINEID", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MACHINEID", true); - } - -} // namespace TestModule \ No newline at end of file diff --git a/test/blackbox/types/TestIncludeRegression3361TypeObject.h b/test/blackbox/types/TestIncludeRegression3361TypeObject.h deleted file mode 100644 index 3c6a193efd7..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361TypeObject.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361TypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TestIncludeRegression3361_SOURCE) -#define TestIncludeRegression3361_DllAPI __declspec( dllexport ) -#else -#define TestIncludeRegression3361_DllAPI __declspec( dllimport ) -#endif // TestIncludeRegression3361_SOURCE -#else -#define TestIncludeRegression3361_DllAPI -#endif -#else -#define TestIncludeRegression3361_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTestIncludeRegression3361Types(); - -namespace TestModule { - eProsima_user_DllExport const TypeIdentifier* GetMACHINEIDIdentifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMACHINEIDObject(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalMACHINEIDObject(); - eProsima_user_DllExport const TypeObject* GetCompleteMACHINEIDObject(); - -} // namespace TestModule - -#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.cxx b/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.cxx new file mode 100644 index 00000000000..fe59f3cf746 --- /dev/null +++ b/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.cxx @@ -0,0 +1,51 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestIncludeRegression3361TypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TestIncludeRegression3361TypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TestIncludeRegression3361.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_TestIncludeRegression3361_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + }); +} + +namespace TestModule { +} // namespace TestModule + diff --git a/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.hpp b/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.hpp new file mode 100644 index 00000000000..f231c58affa --- /dev/null +++ b/test/blackbox/types/TestIncludeRegression3361TypeObjectSupport.hpp @@ -0,0 +1,49 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestIncludeRegression3361TypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_TestIncludeRegression3361_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace TestModule { +} // namespace TestModule + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/TestIncludeRegression3361v1.cxx b/test/blackbox/types/TestIncludeRegression3361v1.cxx deleted file mode 100644 index abc875d3a33..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361v1.cxx +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TestIncludeRegression3361.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TestIncludeRegression3361TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - - - -namespace TestModule { - - -} // namespace TestModule - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestIncludeRegression3361v1.h b/test/blackbox/types/TestIncludeRegression3361v1.h deleted file mode 100644 index 76a77158c44..00000000000 --- a/test/blackbox/types/TestIncludeRegression3361v1.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestIncludeRegression3361.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ -#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TESTINCLUDEREGRESSION3361_SOURCE) -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllexport ) -#else -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllimport ) -#endif // TESTINCLUDEREGRESSION3361_SOURCE -#else -#define TESTINCLUDEREGRESSION3361_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TESTINCLUDEREGRESSION3361_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace TestModule { - typedef std::string MACHINEID; - -} // namespace TestModule - -#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestRegression3361.cxx b/test/blackbox/types/TestRegression3361.cxx deleted file mode 100644 index ecf625300da..00000000000 --- a/test/blackbox/types/TestRegression3361.cxx +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TestRegression3361.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TestRegression3361TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -TestRegression3361::TestRegression3361() -{ - // Just to register all known types - registerTestRegression3361Types(); -} - -TestRegression3361::~TestRegression3361() -{ -} - -TestRegression3361::TestRegression3361( - const TestRegression3361& x) -{ - m_uuid = x.m_uuid; -} - -TestRegression3361::TestRegression3361( - TestRegression3361&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); -} - -TestRegression3361& TestRegression3361::operator =( - const TestRegression3361& x) -{ - - m_uuid = x.m_uuid; - return *this; -} - -TestRegression3361& TestRegression3361::operator =( - TestRegression3361&& x) noexcept -{ - - m_uuid = std::move(x.m_uuid); - return *this; -} - -bool TestRegression3361::operator ==( - const TestRegression3361& x) const -{ - return (m_uuid == x.m_uuid); -} - -bool TestRegression3361::operator !=( - const TestRegression3361& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ -void TestRegression3361::uuid( - const TestModule::MACHINEID& _uuid) -{ - m_uuid = _uuid; -} - -/*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ -void TestRegression3361::uuid( - TestModule::MACHINEID&& _uuid) -{ - m_uuid = std::move(_uuid); -} - -/*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ -const TestModule::MACHINEID& TestRegression3361::uuid() const -{ - return m_uuid; -} - -/*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ -TestModule::MACHINEID& TestRegression3361::uuid() -{ - return m_uuid; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TestRegression3361CdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestRegression3361.h b/test/blackbox/types/TestRegression3361.h deleted file mode 100644 index fd1ff797e05..00000000000 --- a/test/blackbox/types/TestRegression3361.h +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "TestRegression3361v1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ -#define _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "TestIncludeRegression3361.h" - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TESTREGRESSION3361_SOURCE) -#define TESTREGRESSION3361_DllAPI __declspec( dllexport ) -#else -#define TESTREGRESSION3361_DllAPI __declspec( dllimport ) -#endif // TESTREGRESSION3361_SOURCE -#else -#define TESTREGRESSION3361_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TESTREGRESSION3361_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure TestRegression3361 defined by the user in the IDL file. - * @ingroup TestRegression3361 - */ -class TestRegression3361 -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TestRegression3361(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TestRegression3361(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361( - const TestRegression3361& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361( - TestRegression3361&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361& operator =( - const TestRegression3361& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361& operator =( - TestRegression3361&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x TestRegression3361 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TestRegression3361& x) const; - - /*! - * @brief Comparison operator. - * @param x TestRegression3361 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TestRegression3361& x) const; - - /*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ - eProsima_user_DllExport void uuid( - const TestModule::MACHINEID& _uuid); - - /*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ - eProsima_user_DllExport void uuid( - TestModule::MACHINEID&& _uuid); - - /*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ - eProsima_user_DllExport const TestModule::MACHINEID& uuid() const; - - /*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ - eProsima_user_DllExport TestModule::MACHINEID& uuid(); - -private: - - TestModule::MACHINEID m_uuid; - -}; - -#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestRegression3361.hpp b/test/blackbox/types/TestRegression3361.hpp new file mode 100644 index 00000000000..b2aa588d59f --- /dev/null +++ b/test/blackbox/types/TestRegression3361.hpp @@ -0,0 +1,189 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestRegression3361.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_HPP_ +#define _FAST_DDS_GENERATED_TESTREGRESSION3361_HPP_ + +#include +#include +#include "TestIncludeRegression3361.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TESTREGRESSION3361_SOURCE) +#define TESTREGRESSION3361_DllAPI __declspec( dllexport ) +#else +#define TESTREGRESSION3361_DllAPI __declspec( dllimport ) +#endif // TESTREGRESSION3361_SOURCE +#else +#define TESTREGRESSION3361_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TESTREGRESSION3361_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure TestRegression3361 defined by the user in the IDL file. + * @ingroup TestRegression3361 + */ +class TestRegression3361 +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TestRegression3361() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TestRegression3361() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361( + const TestRegression3361& x) + { + m_uuid = x.m_uuid; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361( + TestRegression3361&& x) noexcept + { + m_uuid = std::move(x.m_uuid); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361& operator =( + const TestRegression3361& x) + { + + m_uuid = x.m_uuid; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361& operator =( + TestRegression3361&& x) noexcept + { + + m_uuid = std::move(x.m_uuid); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TestRegression3361 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TestRegression3361& x) const + { + return (m_uuid == x.m_uuid); + } + + /*! + * @brief Comparison operator. + * @param x TestRegression3361 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TestRegression3361& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member uuid + * @param _uuid New value to be copied in member uuid + */ + eProsima_user_DllExport void uuid( + const TestModule::MACHINEID& _uuid) + { + m_uuid = _uuid; + } + + /*! + * @brief This function moves the value in member uuid + * @param _uuid New value to be moved in member uuid + */ + eProsima_user_DllExport void uuid( + TestModule::MACHINEID&& _uuid) + { + m_uuid = std::move(_uuid); + } + + /*! + * @brief This function returns a constant reference to member uuid + * @return Constant reference to member uuid + */ + eProsima_user_DllExport const TestModule::MACHINEID& uuid() const + { + return m_uuid; + } + + /*! + * @brief This function returns a reference to member uuid + * @return Reference to member uuid + */ + eProsima_user_DllExport TestModule::MACHINEID& uuid() + { + return m_uuid; + } + + + +private: + + TestModule::MACHINEID m_uuid; + +}; + +#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_HPP_ + + diff --git a/test/blackbox/types/TestRegression3361CdrAux.hpp b/test/blackbox/types/TestRegression3361CdrAux.hpp index 2f61ec53c58..e83d1d32fc8 100644 --- a/test/blackbox/types/TestRegression3361CdrAux.hpp +++ b/test/blackbox/types/TestRegression3361CdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_HPP_ #define _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_HPP_ -#include "TestRegression3361.h" +#include "TestRegression3361.hpp" constexpr uint32_t TestRegression3361_max_cdr_typesize {264UL}; constexpr uint32_t TestRegression3361_max_key_cdr_typesize {0UL}; @@ -35,8 +35,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const TestRegression3361& data); diff --git a/test/blackbox/types/TestRegression3361CdrAux.ipp b/test/blackbox/types/TestRegression3361CdrAux.ipp index 95b1afdaf99..f451babf688 100644 --- a/test/blackbox/types/TestRegression3361CdrAux.ipp +++ b/test/blackbox/types/TestRegression3361CdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/TestRegression3361PubSubTypes.cxx b/test/blackbox/types/TestRegression3361PubSubTypes.cxx index b43c12a14b5..8673d746298 100644 --- a/test/blackbox/types/TestRegression3361PubSubTypes.cxx +++ b/test/blackbox/types/TestRegression3361PubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TestRegression3361PubSubTypes.h" +#include #include -#include "TestRegression3361PubSubTypes.h" #include "TestRegression3361CdrAux.hpp" +#include "TestRegression3361TypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - TestRegression3361PubSubType::TestRegression3361PubSubType() { setName("TestRegression3361"); @@ -219,3 +219,11 @@ bool TestRegression3361PubSubType::getKey( return true; } +void TestRegression3361PubSubType::register_type_object_representation() const +{ + register_TestRegression3361_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TestRegression3361CdrAux.ipp" diff --git a/test/blackbox/types/TestRegression3361PubSubTypes.h b/test/blackbox/types/TestRegression3361PubSubTypes.h index a6c5be91dc5..4e8fb12c468 100644 --- a/test/blackbox/types/TestRegression3361PubSubTypes.h +++ b/test/blackbox/types/TestRegression3361PubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "TestRegression3361.h" +#include "TestRegression3361.hpp" #include "TestIncludeRegression3361PubSubTypes.h" @@ -39,8 +39,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type TestRegression3361 defined by the user in the IDL file. * @ingroup TestRegression3361 @@ -91,6 +89,9 @@ class TestRegression3361PubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/TestRegression3361TypeObject.cxx b/test/blackbox/types/TestRegression3361TypeObject.cxx deleted file mode 100644 index 39450c3c9fd..00000000000 --- a/test/blackbox/types/TestRegression3361TypeObject.cxx +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361TypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "TestRegression3361.h" -#include "TestRegression3361TypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTestRegression3361Types() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("TestModule::MACHINEID", TestModule::GetMACHINEIDIdentifier(true), - TestModule::GetMACHINEIDObject(true)); - factory->add_type_object("TestModule::MACHINEID", TestModule::GetMACHINEIDIdentifier(false), - TestModule::GetMACHINEIDObject(false)); - - - - factory->add_type_object("TestRegression3361", GetTestRegression3361Identifier(true), - GetTestRegression3361Object(true)); - factory->add_type_object("TestRegression3361", GetTestRegression3361Identifier(false), - GetTestRegression3361Object(false)); - - }); -} - - - -const TypeIdentifier* GetTestRegression3361Identifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("TestRegression3361", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetTestRegression3361Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("TestRegression3361", complete); -} - -const TypeObject* GetTestRegression3361Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("TestRegression3361", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteTestRegression3361Object(); - } - //else - return GetMinimalTestRegression3361Object(); -} - -const TypeObject* GetMinimalTestRegression3361Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("TestRegression3361", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_uuid; - mst_uuid.common().member_id(memberId++); - mst_uuid.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uuid.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uuid.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uuid.common().member_flags().IS_OPTIONAL(false); - mst_uuid.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uuid.common().member_flags().IS_KEY(false); - mst_uuid.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uuid.common().member_type_id(*TestModule::GetMACHINEIDIdentifier(false)); - - MD5 uuid_hash("uuid"); - for(int i = 0; i < 4; ++i) - { - mst_uuid.detail().name_hash()[i] = uuid_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uuid); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("TestRegression3361", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("TestRegression3361", false); -} - -const TypeObject* GetCompleteTestRegression3361Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("TestRegression3361", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_uuid; - cst_uuid.common().member_id(memberId++); - cst_uuid.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uuid.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uuid.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uuid.common().member_flags().IS_OPTIONAL(false); - cst_uuid.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uuid.common().member_flags().IS_KEY(false); - cst_uuid.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uuid.common().member_type_id(*TestModule::GetMACHINEIDIdentifier(true)); - - cst_uuid.detail().name("uuid"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uuid); - - - // Header - type_object->complete().struct_type().header().detail().type_name("TestRegression3361"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("TestRegression3361", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("TestRegression3361", true); -} diff --git a/test/blackbox/types/TestRegression3361TypeObject.h b/test/blackbox/types/TestRegression3361TypeObject.h deleted file mode 100644 index 1f366454d99..00000000000 --- a/test/blackbox/types/TestRegression3361TypeObject.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361TypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_H_ - -#include "TestIncludeRegression3361TypeObject.h" - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TestRegression3361_SOURCE) -#define TestRegression3361_DllAPI __declspec( dllexport ) -#else -#define TestRegression3361_DllAPI __declspec( dllimport ) -#endif // TestRegression3361_SOURCE -#else -#define TestRegression3361_DllAPI -#endif -#else -#define TestRegression3361_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTestRegression3361Types(); - - - -eProsima_user_DllExport const TypeIdentifier* GetTestRegression3361Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetTestRegression3361Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalTestRegression3361Object(); -eProsima_user_DllExport const TypeObject* GetCompleteTestRegression3361Object(); - - -#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/blackbox/types/TestRegression3361TypeObjectSupport.cxx b/test/blackbox/types/TestRegression3361TypeObjectSupport.cxx new file mode 100644 index 00000000000..47ab441ea50 --- /dev/null +++ b/test/blackbox/types/TestRegression3361TypeObjectSupport.cxx @@ -0,0 +1,261 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestRegression3361TypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TestRegression3361TypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TestRegression3361.hpp" + +#include "TestIncludeRegression3361.hpp" + +using namespace eprosima::fastdds::dds::xtypes; + +void register_TestRegression3361_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_TestRegression3361_type_identifier(); + + }); +} + +void register_TestRegression3361_type_identifier() +{ + { + StructTypeFlag struct_flags_TestRegression3361 = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_TestRegression3361; + TypeIdentifierPair type_ids_TestRegression3361; + QualifiedTypeName type_name_TestRegression3361 = "TestRegression3361"; + eprosima::fastcdr::optional type_ann_builtin_TestRegression3361; + eprosima::fastcdr::optional ann_custom_TestRegression3361; + CompleteTypeDetail detail_TestRegression3361 = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_TestRegression3361, ann_custom_TestRegression3361, type_name_TestRegression3361.to_string()); + CompleteStructHeader header_TestRegression3361; + header_TestRegression3361 = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_TestRegression3361); + CompleteStructMemberSeq member_seq_TestRegression3361; + { + return_code_TestRegression3361 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "TestModule::MACHINEID", type_ids_TestRegression3361); + + if (return_code_TestRegression3361 != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_MACHINEID = 0; + QualifiedTypeName type_name_MACHINEID = "TestModule::MACHINEID"; + eprosima::fastcdr::optional type_ann_builtin_MACHINEID; + eprosima::fastcdr::optional ann_custom_MACHINEID; + CompleteTypeDetail detail_MACHINEID = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MACHINEID, ann_custom_MACHINEID, type_name_MACHINEID.to_string()); + CompleteAliasHeader header_MACHINEID = TypeObjectUtils::build_complete_alias_header(detail_MACHINEID); + AliasMemberFlag related_flags_MACHINEID = 0; + return_code_TestRegression3361 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_TestRegression3361); + + if (return_code_TestRegression3361 != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_TestRegression3361 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_TestRegression3361); + if (return_code_TestRegression3361 != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_MACHINEID; + if (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1()._d() || TK_NONE == type_ids_TestRegression3361.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_MACHINEID = TypeObjectUtils::build_common_alias_body(related_flags_MACHINEID, type_ids_TestRegression3361.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_MACHINEID = TypeObjectUtils::build_common_alias_body(related_flags_MACHINEID, type_ids_TestRegression3361.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "TestModule::MACHINEID related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_MACHINEID; + ann_custom_MACHINEID.reset(); + CompleteAliasBody body_MACHINEID = TypeObjectUtils::build_complete_alias_body(common_MACHINEID, member_ann_builtin_MACHINEID, ann_custom_MACHINEID); + CompleteAliasType alias_type_MACHINEID = TypeObjectUtils::build_complete_alias_type(alias_flags_MACHINEID, header_MACHINEID, body_MACHINEID); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_MACHINEID, type_name_MACHINEID.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "TestModule::MACHINEID already registered in TypeObjectRegistry for a different type."); + } + return_code_TestRegression3361 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "TestModule::MACHINEID", type_ids_TestRegression3361); + if (return_code_TestRegression3361 != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "TestModule::MACHINEID: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_uuid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uuid; + MemberId member_id_uuid = 0x00000000; + if (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1()._d() || TK_NONE == type_ids_TestRegression3361.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_TestRegression3361.type_identifier1()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_TestRegression3361.type_identifier1()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uuid = TypeObjectUtils::build_common_struct_member(member_id_uuid, member_flags_uuid, type_ids_TestRegression3361.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_TestRegression3361.type_identifier2()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_TestRegression3361.type_identifier2()._d() && + (EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_TestRegression3361.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uuid = TypeObjectUtils::build_common_struct_member(member_id_uuid, member_flags_uuid, type_ids_TestRegression3361.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uuid member TypeIdentifier inconsistent."); + return; + } + MemberName name_uuid = "uuid"; + eprosima::fastcdr::optional member_ann_builtin_uuid; + ann_custom_TestRegression3361.reset(); + CompleteMemberDetail detail_uuid = TypeObjectUtils::build_complete_member_detail(name_uuid, member_ann_builtin_uuid, ann_custom_TestRegression3361); + CompleteStructMember member_uuid = TypeObjectUtils::build_complete_struct_member(common_uuid, detail_uuid); + TypeObjectUtils::add_complete_struct_member(member_seq_TestRegression3361, member_uuid); + } + CompleteStructType struct_type_TestRegression3361 = TypeObjectUtils::build_complete_struct_type(struct_flags_TestRegression3361, header_TestRegression3361, member_seq_TestRegression3361); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_TestRegression3361, type_name_TestRegression3361.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "TestRegression3361 already registered in TypeObjectRegistry for a different type."); + } + return_code_TestRegression3361 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "TestRegression3361", type_ids_TestRegression3361); + if (return_code_TestRegression3361 != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "TestRegression3361: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/TestRegression3361TypeObjectSupport.hpp b/test/blackbox/types/TestRegression3361TypeObjectSupport.hpp new file mode 100644 index 00000000000..de2cfb1bda0 --- /dev/null +++ b/test/blackbox/types/TestRegression3361TypeObjectSupport.hpp @@ -0,0 +1,55 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file TestRegression3361TypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ + +#include "TestIncludeRegression3361TypeObjectSupport.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_TestRegression3361_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register TestRegression3361 related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_TestRegression3361_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/TestRegression3361v1.cxx b/test/blackbox/types/TestRegression3361v1.cxx deleted file mode 100644 index 9ac400e6abb..00000000000 --- a/test/blackbox/types/TestRegression3361v1.cxx +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "TestRegression3361.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TestRegression3361TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define TestRegression3361_max_cdr_typesize 264ULL; - - - - - -TestRegression3361::TestRegression3361() -{ - // TestModule::MACHINEID m_uuid - - - // Just to register all known types - registerTestRegression3361Types(); -} - -TestRegression3361::~TestRegression3361() -{ -} - -TestRegression3361::TestRegression3361( - const TestRegression3361& x) -{ - m_uuid = x.m_uuid; - -} - -TestRegression3361::TestRegression3361( - TestRegression3361&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - -} - -TestRegression3361& TestRegression3361::operator =( - const TestRegression3361& x) -{ - m_uuid = x.m_uuid; - - return *this; -} - -TestRegression3361& TestRegression3361::operator =( - TestRegression3361&& x) noexcept -{ - m_uuid = std::move(x.m_uuid); - - return *this; -} - -bool TestRegression3361::operator ==( - const TestRegression3361& x) const -{ - return (m_uuid == x.m_uuid); -} - -bool TestRegression3361::operator !=( - const TestRegression3361& x) const -{ - return !(*this == x); -} - -size_t TestRegression3361::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return TestRegression3361_max_cdr_typesize; -} - -size_t TestRegression3361::getCdrSerializedSize( - const TestRegression3361& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.uuid().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void TestRegression3361::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_uuid.c_str(); - -} - -void TestRegression3361::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_uuid; - - -} - - -bool TestRegression3361::isKeyDefined() -{ - return false; -} - -void TestRegression3361::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ -void TestRegression3361::uuid( - const TestModule::MACHINEID& _uuid) -{ - m_uuid = _uuid; -} - -/*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ -void TestRegression3361::uuid( - TestModule::MACHINEID&& _uuid) -{ - m_uuid = std::move(_uuid); -} - -/*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ -const TestModule::MACHINEID& TestRegression3361::uuid() const -{ - return m_uuid; -} - -/*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ -TestModule::MACHINEID& TestRegression3361::uuid() -{ - return m_uuid; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestRegression3361v1.h b/test/blackbox/types/TestRegression3361v1.h deleted file mode 100644 index 3a2b587a2fc..00000000000 --- a/test/blackbox/types/TestRegression3361v1.h +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestRegression3361.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ -#define _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ - -#include "TestIncludeRegression3361.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TESTREGRESSION3361_SOURCE) -#define TESTREGRESSION3361_DllAPI __declspec( dllexport ) -#else -#define TESTREGRESSION3361_DllAPI __declspec( dllimport ) -#endif // TESTREGRESSION3361_SOURCE -#else -#define TESTREGRESSION3361_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TESTREGRESSION3361_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure TestRegression3361 defined by the user in the IDL file. - * @ingroup TestRegression3361 - */ -class TestRegression3361 -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport TestRegression3361(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~TestRegression3361(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361( - const TestRegression3361& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361( - TestRegression3361&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361& operator =( - const TestRegression3361& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TestRegression3361 that will be copied. - */ - eProsima_user_DllExport TestRegression3361& operator =( - TestRegression3361&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x TestRegression3361 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const TestRegression3361& x) const; - - /*! - * @brief Comparison operator. - * @param x TestRegression3361 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const TestRegression3361& x) const; - - /*! - * @brief This function copies the value in member uuid - * @param _uuid New value to be copied in member uuid - */ - eProsima_user_DllExport void uuid( - const TestModule::MACHINEID& _uuid); - - /*! - * @brief This function moves the value in member uuid - * @param _uuid New value to be moved in member uuid - */ - eProsima_user_DllExport void uuid( - TestModule::MACHINEID&& _uuid); - - /*! - * @brief This function returns a constant reference to member uuid - * @return Constant reference to member uuid - */ - eProsima_user_DllExport const TestModule::MACHINEID& uuid() const; - - /*! - * @brief This function returns a reference to member uuid - * @return Reference to member uuid - */ - eProsima_user_DllExport TestModule::MACHINEID& uuid(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const TestRegression3361& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - TestModule::MACHINEID m_uuid; - -}; - - -#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/UnboundedHelloWorld.cxx b/test/blackbox/types/UnboundedHelloWorld.cxx deleted file mode 100644 index ce25da81c8c..00000000000 --- a/test/blackbox/types/UnboundedHelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file UnboundedHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "UnboundedHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -UnboundedHelloWorld::UnboundedHelloWorld() -{ -} - -UnboundedHelloWorld::~UnboundedHelloWorld() -{ -} - -UnboundedHelloWorld::UnboundedHelloWorld( - const UnboundedHelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -UnboundedHelloWorld::UnboundedHelloWorld( - UnboundedHelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -UnboundedHelloWorld& UnboundedHelloWorld::operator =( - const UnboundedHelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -UnboundedHelloWorld& UnboundedHelloWorld::operator =( - UnboundedHelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool UnboundedHelloWorld::operator ==( - const UnboundedHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool UnboundedHelloWorld::operator !=( - const UnboundedHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void UnboundedHelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t UnboundedHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& UnboundedHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void UnboundedHelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void UnboundedHelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& UnboundedHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& UnboundedHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "UnboundedHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/UnboundedHelloWorld.h b/test/blackbox/types/UnboundedHelloWorld.h deleted file mode 100644 index 1624eb1c4bd..00000000000 --- a/test/blackbox/types/UnboundedHelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file UnboundedHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "UnboundedHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(UNBOUNDEDHELLOWORLD_SOURCE) -#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // UNBOUNDEDHELLOWORLD_SOURCE -#else -#define UNBOUNDEDHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define UNBOUNDEDHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure UnboundedHelloWorld defined by the user in the IDL file. - * @ingroup UnboundedHelloWorld - */ -class UnboundedHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnboundedHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnboundedHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld( - const UnboundedHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld( - UnboundedHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld& operator =( - const UnboundedHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld& operator =( - UnboundedHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnboundedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnboundedHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x UnboundedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnboundedHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint16_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/UnboundedHelloWorld.hpp b/test/blackbox/types/UnboundedHelloWorld.hpp new file mode 100644 index 00000000000..431ecef78dc --- /dev/null +++ b/test/blackbox/types/UnboundedHelloWorld.hpp @@ -0,0 +1,227 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file UnboundedHelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(UNBOUNDEDHELLOWORLD_SOURCE) +#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // UNBOUNDEDHELLOWORLD_SOURCE +#else +#define UNBOUNDEDHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define UNBOUNDEDHELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure UnboundedHelloWorld defined by the user in the IDL file. + * @ingroup UnboundedHelloWorld + */ +class UnboundedHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport UnboundedHelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~UnboundedHelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object UnboundedHelloWorld that will be copied. + */ + eProsima_user_DllExport UnboundedHelloWorld( + const UnboundedHelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object UnboundedHelloWorld that will be copied. + */ + eProsima_user_DllExport UnboundedHelloWorld( + UnboundedHelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object UnboundedHelloWorld that will be copied. + */ + eProsima_user_DllExport UnboundedHelloWorld& operator =( + const UnboundedHelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object UnboundedHelloWorld that will be copied. + */ + eProsima_user_DllExport UnboundedHelloWorld& operator =( + UnboundedHelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x UnboundedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const UnboundedHelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x UnboundedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const UnboundedHelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint16_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_HPP_ + + diff --git a/test/blackbox/types/UnboundedHelloWorldCdrAux.hpp b/test/blackbox/types/UnboundedHelloWorldCdrAux.hpp index 3f315c13c01..8a7a496130f 100644 --- a/test/blackbox/types/UnboundedHelloWorldCdrAux.hpp +++ b/test/blackbox/types/UnboundedHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLDCDRAUX_HPP_ -#include "UnboundedHelloWorld.h" +#include "UnboundedHelloWorld.hpp" constexpr uint32_t UnboundedHelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t UnboundedHelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const UnboundedHelloWorld& data); diff --git a/test/blackbox/types/UnboundedHelloWorldCdrAux.ipp b/test/blackbox/types/UnboundedHelloWorldCdrAux.ipp index cb0e198f1d3..af8513070cd 100644 --- a/test/blackbox/types/UnboundedHelloWorldCdrAux.ipp +++ b/test/blackbox/types/UnboundedHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/blackbox/types/UnboundedHelloWorldPubSubTypes.cxx b/test/blackbox/types/UnboundedHelloWorldPubSubTypes.cxx index 4751dfef5d0..b19574ae8f4 100644 --- a/test/blackbox/types/UnboundedHelloWorldPubSubTypes.cxx +++ b/test/blackbox/types/UnboundedHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "UnboundedHelloWorldPubSubTypes.h" +#include #include -#include "UnboundedHelloWorldPubSubTypes.h" #include "UnboundedHelloWorldCdrAux.hpp" +#include "UnboundedHelloWorldTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - UnboundedHelloWorldPubSubType::UnboundedHelloWorldPubSubType() { setName("UnboundedHelloWorld"); @@ -219,3 +219,11 @@ bool UnboundedHelloWorldPubSubType::getKey( return true; } +void UnboundedHelloWorldPubSubType::register_type_object_representation() const +{ + register_UnboundedHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "UnboundedHelloWorldCdrAux.ipp" diff --git a/test/blackbox/types/UnboundedHelloWorldPubSubTypes.h b/test/blackbox/types/UnboundedHelloWorldPubSubTypes.h index 92026849a7a..f779152248b 100644 --- a/test/blackbox/types/UnboundedHelloWorldPubSubTypes.h +++ b/test/blackbox/types/UnboundedHelloWorldPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "UnboundedHelloWorld.h" +#include "UnboundedHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type UnboundedHelloWorld defined by the user in the IDL file. * @ingroup UnboundedHelloWorld @@ -90,6 +88,9 @@ class UnboundedHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataTy eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.cxx b/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..325f00d32e3 --- /dev/null +++ b/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file UnboundedHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "UnboundedHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "UnboundedHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_UnboundedHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_UnboundedHelloWorld_type_identifier(); + + }); +} + +void register_UnboundedHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_UnboundedHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_UnboundedHelloWorld; + TypeIdentifierPair type_ids_UnboundedHelloWorld; + QualifiedTypeName type_name_UnboundedHelloWorld = "UnboundedHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_UnboundedHelloWorld; + eprosima::fastcdr::optional ann_custom_UnboundedHelloWorld; + CompleteTypeDetail detail_UnboundedHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_UnboundedHelloWorld, ann_custom_UnboundedHelloWorld, type_name_UnboundedHelloWorld.to_string()); + CompleteStructHeader header_UnboundedHelloWorld; + header_UnboundedHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_UnboundedHelloWorld); + CompleteStructMemberSeq member_seq_UnboundedHelloWorld; + { + return_code_UnboundedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_UnboundedHelloWorld); + + if (return_code_UnboundedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_UnboundedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_UnboundedHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_UnboundedHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_UnboundedHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_UnboundedHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_UnboundedHelloWorld, member_index); + } + { + return_code_UnboundedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_UnboundedHelloWorld); + + if (return_code_UnboundedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_UnboundedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_UnboundedHelloWorld); + if (return_code_UnboundedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_UnboundedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_UnboundedHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_UnboundedHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_UnboundedHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_UnboundedHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_UnboundedHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_UnboundedHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_UnboundedHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_UnboundedHelloWorld, member_message); + } + CompleteStructType struct_type_UnboundedHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_UnboundedHelloWorld, header_UnboundedHelloWorld, member_seq_UnboundedHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_UnboundedHelloWorld, type_name_UnboundedHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "UnboundedHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_UnboundedHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "UnboundedHelloWorld", type_ids_UnboundedHelloWorld); + if (return_code_UnboundedHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "UnboundedHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.hpp b/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..4bd0dcd83af --- /dev/null +++ b/test/blackbox/types/UnboundedHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file UnboundedHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_UnboundedHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register UnboundedHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_UnboundedHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/UnboundedHelloWorldv1.cxx b/test/blackbox/types/UnboundedHelloWorldv1.cxx deleted file mode 100644 index 20f4eb18c68..00000000000 --- a/test/blackbox/types/UnboundedHelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file UnboundedHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "UnboundedHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define UnboundedHelloWorld_max_cdr_typesize 268ULL; - - - - -UnboundedHelloWorld::UnboundedHelloWorld() -{ - // unsigned short m_index - m_index = 0; - // /type_d() m_message - - -} - -UnboundedHelloWorld::~UnboundedHelloWorld() -{ -} - -UnboundedHelloWorld::UnboundedHelloWorld( - const UnboundedHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -UnboundedHelloWorld::UnboundedHelloWorld( - UnboundedHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -UnboundedHelloWorld& UnboundedHelloWorld::operator =( - const UnboundedHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -UnboundedHelloWorld& UnboundedHelloWorld::operator =( - UnboundedHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool UnboundedHelloWorld::operator ==( - const UnboundedHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool UnboundedHelloWorld::operator !=( - const UnboundedHelloWorld& x) const -{ - return !(*this == x); -} - -size_t UnboundedHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return UnboundedHelloWorld_max_cdr_typesize; -} - -size_t UnboundedHelloWorld::getCdrSerializedSize( - const UnboundedHelloWorld& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void UnboundedHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void UnboundedHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool UnboundedHelloWorld::isKeyDefined() -{ - return false; -} - -void UnboundedHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void UnboundedHelloWorld::index( - uint16_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint16_t UnboundedHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint16_t& UnboundedHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void UnboundedHelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void UnboundedHelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& UnboundedHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& UnboundedHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/UnboundedHelloWorldv1.h b/test/blackbox/types/UnboundedHelloWorldv1.h deleted file mode 100644 index c9841d4b711..00000000000 --- a/test/blackbox/types/UnboundedHelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file UnboundedHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(UNBOUNDEDHELLOWORLD_SOURCE) -#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define UNBOUNDEDHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // UNBOUNDEDHELLOWORLD_SOURCE -#else -#define UNBOUNDEDHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define UNBOUNDEDHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure UnboundedHelloWorld defined by the user in the IDL file. - * @ingroup UnboundedHelloWorld - */ -class UnboundedHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnboundedHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnboundedHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld( - const UnboundedHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld( - UnboundedHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld& operator =( - const UnboundedHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnboundedHelloWorld that will be copied. - */ - eProsima_user_DllExport UnboundedHelloWorld& operator =( - UnboundedHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnboundedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnboundedHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x UnboundedHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnboundedHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint16_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint16_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint16_t& index(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const UnboundedHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_UNBOUNDEDHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/statistics/monitorservice_types.hpp b/test/blackbox/types/statistics/monitorservice_types.hpp new file mode 100644 index 00000000000..71846357224 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_types.hpp @@ -0,0 +1,2506 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ + +#include +#include +#include +#include +#include + +#include + +#include "types.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(MONITORSERVICE_TYPES_SOURCE) +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllexport ) +#else +#define MONITORSERVICE_TYPES_DllAPI __declspec( dllimport ) +#endif // MONITORSERVICE_TYPES_SOURCE +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define MONITORSERVICE_TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +/*! + * @brief This class represents the enumeration ConnectionMode defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +enum class ConnectionMode : uint32_t +{ + DATA_SHARING, + INTRAPROCESS, + TRANSPORT +}; +/*! + * @brief This class represents the structure Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class Connection +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Connection() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Connection() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection( + const Connection& x) + { + m_mode = x.m_mode; + + m_guid = x.m_guid; + + m_announced_locators = x.m_announced_locators; + + m_used_locators = x.m_used_locators; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection( + Connection&& x) noexcept + { + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + const Connection& x) + { + + m_mode = x.m_mode; + + m_guid = x.m_guid; + + m_announced_locators = x.m_announced_locators; + + m_used_locators = x.m_used_locators; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Connection that will be copied. + */ + eProsima_user_DllExport Connection& operator =( + Connection&& x) noexcept + { + + m_mode = x.m_mode; + m_guid = std::move(x.m_guid); + m_announced_locators = std::move(x.m_announced_locators); + m_used_locators = std::move(x.m_used_locators); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Connection object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Connection& x) const + { + return (m_mode == x.m_mode && + m_guid == x.m_guid && + m_announced_locators == x.m_announced_locators && + m_used_locators == x.m_used_locators); + } + + /*! + * @brief Comparison operator. + * @param x Connection object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Connection& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member mode + * @param _mode New value for member mode + */ + eProsima_user_DllExport void mode( + ConnectionMode _mode) + { + m_mode = _mode; + } + + /*! + * @brief This function returns the value of member mode + * @return Value of member mode + */ + eProsima_user_DllExport ConnectionMode mode() const + { + return m_mode; + } + + /*! + * @brief This function returns a reference to member mode + * @return Reference to member mode + */ + eProsima_user_DllExport ConnectionMode& mode() + { + return m_mode; + } + + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function copies the value in member announced_locators + * @param _announced_locators New value to be copied in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + const std::vector& _announced_locators) + { + m_announced_locators = _announced_locators; + } + + /*! + * @brief This function moves the value in member announced_locators + * @param _announced_locators New value to be moved in member announced_locators + */ + eProsima_user_DllExport void announced_locators( + std::vector&& _announced_locators) + { + m_announced_locators = std::move(_announced_locators); + } + + /*! + * @brief This function returns a constant reference to member announced_locators + * @return Constant reference to member announced_locators + */ + eProsima_user_DllExport const std::vector& announced_locators() const + { + return m_announced_locators; + } + + /*! + * @brief This function returns a reference to member announced_locators + * @return Reference to member announced_locators + */ + eProsima_user_DllExport std::vector& announced_locators() + { + return m_announced_locators; + } + + + /*! + * @brief This function copies the value in member used_locators + * @param _used_locators New value to be copied in member used_locators + */ + eProsima_user_DllExport void used_locators( + const std::vector& _used_locators) + { + m_used_locators = _used_locators; + } + + /*! + * @brief This function moves the value in member used_locators + * @param _used_locators New value to be moved in member used_locators + */ + eProsima_user_DllExport void used_locators( + std::vector&& _used_locators) + { + m_used_locators = std::move(_used_locators); + } + + /*! + * @brief This function returns a constant reference to member used_locators + * @return Constant reference to member used_locators + */ + eProsima_user_DllExport const std::vector& used_locators() const + { + return m_used_locators; + } + + /*! + * @brief This function returns a reference to member used_locators + * @return Reference to member used_locators + */ + eProsima_user_DllExport std::vector& used_locators() + { + return m_used_locators; + } + + + +private: + + ConnectionMode m_mode{ConnectionMode::DATA_SHARING}; + detail::GUID_s m_guid; + std::vector m_announced_locators; + std::vector m_used_locators; + +}; +/*! + * @brief This class represents the structure QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class QosPolicyCount_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport QosPolicyCount_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~QosPolicyCount_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + const QosPolicyCount_s& x) + { + m_policy_id = x.m_policy_id; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s( + QosPolicyCount_s&& x) noexcept + { + m_policy_id = x.m_policy_id; + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + const QosPolicyCount_s& x) + { + + m_policy_id = x.m_policy_id; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object QosPolicyCount_s that will be copied. + */ + eProsima_user_DllExport QosPolicyCount_s& operator =( + QosPolicyCount_s&& x) noexcept + { + + m_policy_id = x.m_policy_id; + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const QosPolicyCount_s& x) const + { + return (m_policy_id == x.m_policy_id && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x QosPolicyCount_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const QosPolicyCount_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member policy_id + * @param _policy_id New value for member policy_id + */ + eProsima_user_DllExport void policy_id( + uint32_t _policy_id) + { + m_policy_id = _policy_id; + } + + /*! + * @brief This function returns the value of member policy_id + * @return Value of member policy_id + */ + eProsima_user_DllExport uint32_t policy_id() const + { + return m_policy_id; + } + + /*! + * @brief This function returns a reference to member policy_id + * @return Reference to member policy_id + */ + eProsima_user_DllExport uint32_t& policy_id() + { + return m_policy_id; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint32_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint32_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint32_t& count() + { + return m_count; + } + + + +private: + + uint32_t m_policy_id{0}; + uint32_t m_count{0}; + +}; +/*! + * @brief This class represents the structure BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class BaseStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BaseStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BaseStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + const BaseStatus_s& x) + { + m_total_count = x.m_total_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s( + BaseStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + const BaseStatus_s& x) + { + + m_total_count = x.m_total_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object BaseStatus_s that will be copied. + */ + eProsima_user_DllExport BaseStatus_s& operator =( + BaseStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BaseStatus_s& x) const + { + return (m_total_count == x.m_total_count); + } + + /*! + * @brief Comparison operator. + * @param x BaseStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BaseStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + +private: + + uint32_t m_total_count{0}; + +}; +typedef std::vector QosPolicyCountSeq_s; + +/*! + * @brief This class represents the structure IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class IncompatibleQoSStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~IncompatibleQoSStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + const IncompatibleQoSStatus_s& x) + { + m_total_count = x.m_total_count; + + m_last_policy_id = x.m_last_policy_id; + + m_policies = x.m_policies; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s( + IncompatibleQoSStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + const IncompatibleQoSStatus_s& x) + { + + m_total_count = x.m_total_count; + + m_last_policy_id = x.m_last_policy_id; + + m_policies = x.m_policies; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object IncompatibleQoSStatus_s that will be copied. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& operator =( + IncompatibleQoSStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + m_last_policy_id = x.m_last_policy_id; + m_policies = std::move(x.m_policies); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const IncompatibleQoSStatus_s& x) const + { + return (m_total_count == x.m_total_count && + m_last_policy_id == x.m_last_policy_id && + m_policies == x.m_policies); + } + + /*! + * @brief Comparison operator. + * @param x IncompatibleQoSStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const IncompatibleQoSStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + /*! + * @brief This function sets a value in member last_policy_id + * @param _last_policy_id New value for member last_policy_id + */ + eProsima_user_DllExport void last_policy_id( + uint32_t _last_policy_id) + { + m_last_policy_id = _last_policy_id; + } + + /*! + * @brief This function returns the value of member last_policy_id + * @return Value of member last_policy_id + */ + eProsima_user_DllExport uint32_t last_policy_id() const + { + return m_last_policy_id; + } + + /*! + * @brief This function returns a reference to member last_policy_id + * @return Reference to member last_policy_id + */ + eProsima_user_DllExport uint32_t& last_policy_id() + { + return m_last_policy_id; + } + + + /*! + * @brief This function copies the value in member policies + * @param _policies New value to be copied in member policies + */ + eProsima_user_DllExport void policies( + const QosPolicyCountSeq_s& _policies) + { + m_policies = _policies; + } + + /*! + * @brief This function moves the value in member policies + * @param _policies New value to be moved in member policies + */ + eProsima_user_DllExport void policies( + QosPolicyCountSeq_s&& _policies) + { + m_policies = std::move(_policies); + } + + /*! + * @brief This function returns a constant reference to member policies + * @return Constant reference to member policies + */ + eProsima_user_DllExport const QosPolicyCountSeq_s& policies() const + { + return m_policies; + } + + /*! + * @brief This function returns a reference to member policies + * @return Reference to member policies + */ + eProsima_user_DllExport QosPolicyCountSeq_s& policies() + { + return m_policies; + } + + + +private: + + uint32_t m_total_count{0}; + uint32_t m_last_policy_id{0}; + QosPolicyCountSeq_s m_policies; + +}; +/*! + * @brief This class represents the structure LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class LivelinessChangedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LivelinessChangedStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LivelinessChangedStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + const LivelinessChangedStatus_s& x) + { + m_alive_count = x.m_alive_count; + + m_not_alive_count = x.m_not_alive_count; + + m_last_publication_handle = x.m_last_publication_handle; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s( + LivelinessChangedStatus_s&& x) noexcept + { + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + const LivelinessChangedStatus_s& x) + { + + m_alive_count = x.m_alive_count; + + m_not_alive_count = x.m_not_alive_count; + + m_last_publication_handle = x.m_last_publication_handle; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LivelinessChangedStatus_s that will be copied. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& operator =( + LivelinessChangedStatus_s&& x) noexcept + { + + m_alive_count = x.m_alive_count; + m_not_alive_count = x.m_not_alive_count; + m_last_publication_handle = std::move(x.m_last_publication_handle); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LivelinessChangedStatus_s& x) const + { + return (m_alive_count == x.m_alive_count && + m_not_alive_count == x.m_not_alive_count && + m_last_publication_handle == x.m_last_publication_handle); + } + + /*! + * @brief Comparison operator. + * @param x LivelinessChangedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LivelinessChangedStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member alive_count + * @param _alive_count New value for member alive_count + */ + eProsima_user_DllExport void alive_count( + uint32_t _alive_count) + { + m_alive_count = _alive_count; + } + + /*! + * @brief This function returns the value of member alive_count + * @return Value of member alive_count + */ + eProsima_user_DllExport uint32_t alive_count() const + { + return m_alive_count; + } + + /*! + * @brief This function returns a reference to member alive_count + * @return Reference to member alive_count + */ + eProsima_user_DllExport uint32_t& alive_count() + { + return m_alive_count; + } + + + /*! + * @brief This function sets a value in member not_alive_count + * @param _not_alive_count New value for member not_alive_count + */ + eProsima_user_DllExport void not_alive_count( + uint32_t _not_alive_count) + { + m_not_alive_count = _not_alive_count; + } + + /*! + * @brief This function returns the value of member not_alive_count + * @return Value of member not_alive_count + */ + eProsima_user_DllExport uint32_t not_alive_count() const + { + return m_not_alive_count; + } + + /*! + * @brief This function returns a reference to member not_alive_count + * @return Reference to member not_alive_count + */ + eProsima_user_DllExport uint32_t& not_alive_count() + { + return m_not_alive_count; + } + + + /*! + * @brief This function copies the value in member last_publication_handle + * @param _last_publication_handle New value to be copied in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + const std::array& _last_publication_handle) + { + m_last_publication_handle = _last_publication_handle; + } + + /*! + * @brief This function moves the value in member last_publication_handle + * @param _last_publication_handle New value to be moved in member last_publication_handle + */ + eProsima_user_DllExport void last_publication_handle( + std::array&& _last_publication_handle) + { + m_last_publication_handle = std::move(_last_publication_handle); + } + + /*! + * @brief This function returns a constant reference to member last_publication_handle + * @return Constant reference to member last_publication_handle + */ + eProsima_user_DllExport const std::array& last_publication_handle() const + { + return m_last_publication_handle; + } + + /*! + * @brief This function returns a reference to member last_publication_handle + * @return Reference to member last_publication_handle + */ + eProsima_user_DllExport std::array& last_publication_handle() + { + return m_last_publication_handle; + } + + + +private: + + uint32_t m_alive_count{0}; + uint32_t m_not_alive_count{0}; + std::array m_last_publication_handle{0}; + +}; +/*! + * @brief This class represents the structure DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class DeadlineMissedStatus_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DeadlineMissedStatus_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DeadlineMissedStatus_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + const DeadlineMissedStatus_s& x) + { + m_total_count = x.m_total_count; + + m_last_instance_handle = x.m_last_instance_handle; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s( + DeadlineMissedStatus_s&& x) noexcept + { + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + const DeadlineMissedStatus_s& x) + { + + m_total_count = x.m_total_count; + + m_last_instance_handle = x.m_last_instance_handle; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object DeadlineMissedStatus_s that will be copied. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& operator =( + DeadlineMissedStatus_s&& x) noexcept + { + + m_total_count = x.m_total_count; + m_last_instance_handle = std::move(x.m_last_instance_handle); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DeadlineMissedStatus_s& x) const + { + return (m_total_count == x.m_total_count && + m_last_instance_handle == x.m_last_instance_handle); + } + + /*! + * @brief Comparison operator. + * @param x DeadlineMissedStatus_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DeadlineMissedStatus_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member total_count + * @param _total_count New value for member total_count + */ + eProsima_user_DllExport void total_count( + uint32_t _total_count) + { + m_total_count = _total_count; + } + + /*! + * @brief This function returns the value of member total_count + * @return Value of member total_count + */ + eProsima_user_DllExport uint32_t total_count() const + { + return m_total_count; + } + + /*! + * @brief This function returns a reference to member total_count + * @return Reference to member total_count + */ + eProsima_user_DllExport uint32_t& total_count() + { + return m_total_count; + } + + + /*! + * @brief This function copies the value in member last_instance_handle + * @param _last_instance_handle New value to be copied in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + const std::array& _last_instance_handle) + { + m_last_instance_handle = _last_instance_handle; + } + + /*! + * @brief This function moves the value in member last_instance_handle + * @param _last_instance_handle New value to be moved in member last_instance_handle + */ + eProsima_user_DllExport void last_instance_handle( + std::array&& _last_instance_handle) + { + m_last_instance_handle = std::move(_last_instance_handle); + } + + /*! + * @brief This function returns a constant reference to member last_instance_handle + * @return Constant reference to member last_instance_handle + */ + eProsima_user_DllExport const std::array& last_instance_handle() const + { + return m_last_instance_handle; + } + + /*! + * @brief This function returns a reference to member last_instance_handle + * @return Reference to member last_instance_handle + */ + eProsima_user_DllExport std::array& last_instance_handle() + { + return m_last_instance_handle; + } + + + +private: + + uint32_t m_total_count{0}; + std::array m_last_instance_handle{0}; + +}; +typedef BaseStatus_s LivelinessLostStatus_s; + +typedef BaseStatus_s InconsistentTopicStatus_s; + +typedef BaseStatus_s SampleLostStatus_s; + +namespace StatusKind { + +typedef uint32_t StatusKind; + +const StatusKind PROXY = 0; +const StatusKind CONNECTION_LIST = 1; +const StatusKind INCOMPATIBLE_QOS = 2; +const StatusKind INCONSISTENT_TOPIC = 3; +const StatusKind LIVELINESS_LOST = 4; +const StatusKind LIVELINESS_CHANGED = 5; +const StatusKind DEADLINE_MISSED = 6; +const StatusKind SAMPLE_LOST = 7; +const StatusKind STATUSES_SIZE = 8; + +} // namespace StatusKind +/*! + * @brief This class represents the union MonitorServiceData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceData() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + const MonitorServiceData& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = x.m_entity_proxy; + break; + + case 0x00000002: + connection_list_() = x.m_connection_list; + break; + + case 0x00000003: + incompatible_qos_status_() = x.m_incompatible_qos_status; + break; + + case 0x00000004: + inconsistent_topic_status_() = x.m_inconsistent_topic_status; + break; + + case 0x00000005: + liveliness_lost_status_() = x.m_liveliness_lost_status; + break; + + case 0x00000006: + liveliness_changed_status_() = x.m_liveliness_changed_status; + break; + + case 0x00000007: + deadline_missed_status_() = x.m_deadline_missed_status; + break; + + case 0x00000008: + sample_lost_status_() = x.m_sample_lost_status; + break; + + case 0x00000009: + statuses_size_() = x.m_statuses_size; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData( + MonitorServiceData&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = std::move(x.m_entity_proxy); + break; + + case 0x00000002: + connection_list_() = std::move(x.m_connection_list); + break; + + case 0x00000003: + incompatible_qos_status_() = std::move(x.m_incompatible_qos_status); + break; + + case 0x00000004: + inconsistent_topic_status_() = std::move(x.m_inconsistent_topic_status); + break; + + case 0x00000005: + liveliness_lost_status_() = std::move(x.m_liveliness_lost_status); + break; + + case 0x00000006: + liveliness_changed_status_() = std::move(x.m_liveliness_changed_status); + break; + + case 0x00000007: + deadline_missed_status_() = std::move(x.m_deadline_missed_status); + break; + + case 0x00000008: + sample_lost_status_() = std::move(x.m_sample_lost_status); + break; + + case 0x00000009: + statuses_size_() = std::move(x.m_statuses_size); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + const MonitorServiceData& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = x.m_entity_proxy; + break; + + case 0x00000002: + connection_list_() = x.m_connection_list; + break; + + case 0x00000003: + incompatible_qos_status_() = x.m_incompatible_qos_status; + break; + + case 0x00000004: + inconsistent_topic_status_() = x.m_inconsistent_topic_status; + break; + + case 0x00000005: + liveliness_lost_status_() = x.m_liveliness_lost_status; + break; + + case 0x00000006: + liveliness_changed_status_() = x.m_liveliness_changed_status; + break; + + case 0x00000007: + deadline_missed_status_() = x.m_deadline_missed_status; + break; + + case 0x00000008: + sample_lost_status_() = x.m_sample_lost_status; + break; + + case 0x00000009: + statuses_size_() = x.m_statuses_size; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MonitorServiceData that will be copied. + */ + eProsima_user_DllExport MonitorServiceData& operator =( + MonitorServiceData&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + entity_proxy_() = std::move(x.m_entity_proxy); + break; + + case 0x00000002: + connection_list_() = std::move(x.m_connection_list); + break; + + case 0x00000003: + incompatible_qos_status_() = std::move(x.m_incompatible_qos_status); + break; + + case 0x00000004: + inconsistent_topic_status_() = std::move(x.m_inconsistent_topic_status); + break; + + case 0x00000005: + liveliness_lost_status_() = std::move(x.m_liveliness_lost_status); + break; + + case 0x00000006: + liveliness_changed_status_() = std::move(x.m_liveliness_changed_status); + break; + + case 0x00000007: + deadline_missed_status_() = std::move(x.m_deadline_missed_status); + break; + + case 0x00000008: + sample_lost_status_() = std::move(x.m_sample_lost_status); + break; + + case 0x00000009: + statuses_size_() = std::move(x.m_statuses_size); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceData& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_entity_proxy == x.m_entity_proxy); + break; + + case 0x00000002: + ret_value = (m_connection_list == x.m_connection_list); + break; + + case 0x00000003: + ret_value = (m_incompatible_qos_status == x.m_incompatible_qos_status); + break; + + case 0x00000004: + ret_value = (m_inconsistent_topic_status == x.m_inconsistent_topic_status); + break; + + case 0x00000005: + ret_value = (m_liveliness_lost_status == x.m_liveliness_lost_status); + break; + + case 0x00000006: + ret_value = (m_liveliness_changed_status == x.m_liveliness_changed_status); + break; + + case 0x00000007: + ret_value = (m_deadline_missed_status == x.m_deadline_missed_status); + break; + + case 0x00000008: + ret_value = (m_sample_lost_status == x.m_sample_lost_status); + break; + + case 0x00000009: + ret_value = (m_statuses_size == x.m_statuses_size); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + StatusKind::StatusKind __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case StatusKind::PROXY: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::CONNECTION_LIST: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::INCOMPATIBLE_QOS: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::INCONSISTENT_TOPIC: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::LIVELINESS_LOST: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::LIVELINESS_CHANGED: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::DEADLINE_MISSED: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::SAMPLE_LOST: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case StatusKind::STATUSES_SIZE: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport StatusKind::StatusKind _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member entity_proxy + * @param _entity_proxy New value to be copied in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + const std::vector& _entity_proxy) + { + entity_proxy_() = _entity_proxy; + m__d = StatusKind::PROXY; + } + + /*! + * @brief This function moves the value in member entity_proxy + * @param _entity_proxy New value to be moved in member entity_proxy + */ + eProsima_user_DllExport void entity_proxy( + std::vector&& _entity_proxy) + { + entity_proxy_() = _entity_proxy; + m__d = StatusKind::PROXY; + } + + /*! + * @brief This function returns a constant reference to member entity_proxy + * @return Constant reference to member entity_proxy + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& entity_proxy() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_proxy; + } + + /*! + * @brief This function returns a reference to member entity_proxy + * @return Reference to member entity_proxy + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& entity_proxy() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_proxy; + } + + + /*! + * @brief This function copies the value in member connection_list + * @param _connection_list New value to be copied in member connection_list + */ + eProsima_user_DllExport void connection_list( + const std::vector& _connection_list) + { + connection_list_() = _connection_list; + m__d = StatusKind::CONNECTION_LIST; + } + + /*! + * @brief This function moves the value in member connection_list + * @param _connection_list New value to be moved in member connection_list + */ + eProsima_user_DllExport void connection_list( + std::vector&& _connection_list) + { + connection_list_() = _connection_list; + m__d = StatusKind::CONNECTION_LIST; + } + + /*! + * @brief This function returns a constant reference to member connection_list + * @return Constant reference to member connection_list + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::vector& connection_list() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_connection_list; + } + + /*! + * @brief This function returns a reference to member connection_list + * @return Reference to member connection_list + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::vector& connection_list() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_connection_list; + } + + + /*! + * @brief This function copies the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be copied in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + const IncompatibleQoSStatus_s& _incompatible_qos_status) + { + incompatible_qos_status_() = _incompatible_qos_status; + m__d = StatusKind::INCOMPATIBLE_QOS; + } + + /*! + * @brief This function moves the value in member incompatible_qos_status + * @param _incompatible_qos_status New value to be moved in member incompatible_qos_status + */ + eProsima_user_DllExport void incompatible_qos_status( + IncompatibleQoSStatus_s&& _incompatible_qos_status) + { + incompatible_qos_status_() = _incompatible_qos_status; + m__d = StatusKind::INCOMPATIBLE_QOS; + } + + /*! + * @brief This function returns a constant reference to member incompatible_qos_status + * @return Constant reference to member incompatible_qos_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const IncompatibleQoSStatus_s& incompatible_qos_status() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; + } + + /*! + * @brief This function returns a reference to member incompatible_qos_status + * @return Reference to member incompatible_qos_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport IncompatibleQoSStatus_s& incompatible_qos_status() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_incompatible_qos_status; + } + + + /*! + * @brief This function copies the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be copied in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + const InconsistentTopicStatus_s& _inconsistent_topic_status) + { + inconsistent_topic_status_() = _inconsistent_topic_status; + m__d = StatusKind::INCONSISTENT_TOPIC; + } + + /*! + * @brief This function moves the value in member inconsistent_topic_status + * @param _inconsistent_topic_status New value to be moved in member inconsistent_topic_status + */ + eProsima_user_DllExport void inconsistent_topic_status( + InconsistentTopicStatus_s&& _inconsistent_topic_status) + { + inconsistent_topic_status_() = _inconsistent_topic_status; + m__d = StatusKind::INCONSISTENT_TOPIC; + } + + /*! + * @brief This function returns a constant reference to member inconsistent_topic_status + * @return Constant reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const InconsistentTopicStatus_s& inconsistent_topic_status() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; + } + + /*! + * @brief This function returns a reference to member inconsistent_topic_status + * @return Reference to member inconsistent_topic_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport InconsistentTopicStatus_s& inconsistent_topic_status() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_inconsistent_topic_status; + } + + + /*! + * @brief This function copies the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be copied in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + const LivelinessLostStatus_s& _liveliness_lost_status) + { + liveliness_lost_status_() = _liveliness_lost_status; + m__d = StatusKind::LIVELINESS_LOST; + } + + /*! + * @brief This function moves the value in member liveliness_lost_status + * @param _liveliness_lost_status New value to be moved in member liveliness_lost_status + */ + eProsima_user_DllExport void liveliness_lost_status( + LivelinessLostStatus_s&& _liveliness_lost_status) + { + liveliness_lost_status_() = _liveliness_lost_status; + m__d = StatusKind::LIVELINESS_LOST; + } + + /*! + * @brief This function returns a constant reference to member liveliness_lost_status + * @return Constant reference to member liveliness_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const LivelinessLostStatus_s& liveliness_lost_status() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; + } + + /*! + * @brief This function returns a reference to member liveliness_lost_status + * @return Reference to member liveliness_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport LivelinessLostStatus_s& liveliness_lost_status() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_lost_status; + } + + + /*! + * @brief This function copies the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be copied in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + const LivelinessChangedStatus_s& _liveliness_changed_status) + { + liveliness_changed_status_() = _liveliness_changed_status; + m__d = StatusKind::LIVELINESS_CHANGED; + } + + /*! + * @brief This function moves the value in member liveliness_changed_status + * @param _liveliness_changed_status New value to be moved in member liveliness_changed_status + */ + eProsima_user_DllExport void liveliness_changed_status( + LivelinessChangedStatus_s&& _liveliness_changed_status) + { + liveliness_changed_status_() = _liveliness_changed_status; + m__d = StatusKind::LIVELINESS_CHANGED; + } + + /*! + * @brief This function returns a constant reference to member liveliness_changed_status + * @return Constant reference to member liveliness_changed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const LivelinessChangedStatus_s& liveliness_changed_status() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; + } + + /*! + * @brief This function returns a reference to member liveliness_changed_status + * @return Reference to member liveliness_changed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport LivelinessChangedStatus_s& liveliness_changed_status() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_liveliness_changed_status; + } + + + /*! + * @brief This function copies the value in member deadline_missed_status + * @param _deadline_missed_status New value to be copied in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + const DeadlineMissedStatus_s& _deadline_missed_status) + { + deadline_missed_status_() = _deadline_missed_status; + m__d = StatusKind::DEADLINE_MISSED; + } + + /*! + * @brief This function moves the value in member deadline_missed_status + * @param _deadline_missed_status New value to be moved in member deadline_missed_status + */ + eProsima_user_DllExport void deadline_missed_status( + DeadlineMissedStatus_s&& _deadline_missed_status) + { + deadline_missed_status_() = _deadline_missed_status; + m__d = StatusKind::DEADLINE_MISSED; + } + + /*! + * @brief This function returns a constant reference to member deadline_missed_status + * @return Constant reference to member deadline_missed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const DeadlineMissedStatus_s& deadline_missed_status() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; + } + + /*! + * @brief This function returns a reference to member deadline_missed_status + * @return Reference to member deadline_missed_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport DeadlineMissedStatus_s& deadline_missed_status() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_deadline_missed_status; + } + + + /*! + * @brief This function copies the value in member sample_lost_status + * @param _sample_lost_status New value to be copied in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + const SampleLostStatus_s& _sample_lost_status) + { + sample_lost_status_() = _sample_lost_status; + m__d = StatusKind::SAMPLE_LOST; + } + + /*! + * @brief This function moves the value in member sample_lost_status + * @param _sample_lost_status New value to be moved in member sample_lost_status + */ + eProsima_user_DllExport void sample_lost_status( + SampleLostStatus_s&& _sample_lost_status) + { + sample_lost_status_() = _sample_lost_status; + m__d = StatusKind::SAMPLE_LOST; + } + + /*! + * @brief This function returns a constant reference to member sample_lost_status + * @return Constant reference to member sample_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SampleLostStatus_s& sample_lost_status() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; + } + + /*! + * @brief This function returns a reference to member sample_lost_status + * @return Reference to member sample_lost_status + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SampleLostStatus_s& sample_lost_status() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_lost_status; + } + + + /*! + * @brief This function sets a value in member statuses_size + * @param _statuses_size New value for member statuses_size + */ + eProsima_user_DllExport void statuses_size( + uint8_t _statuses_size) + { + statuses_size_() = _statuses_size; + m__d = StatusKind::STATUSES_SIZE; + } + + /*! + * @brief This function returns the value of member statuses_size + * @return Value of member statuses_size + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t statuses_size() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_statuses_size; + } + + /*! + * @brief This function returns a reference to member statuses_size + * @return Reference to member statuses_size + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& statuses_size() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_statuses_size; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + std::vector& entity_proxy_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_entity_proxy.~vector();}; + new(&m_entity_proxy) std::vector(); + ; + } + + return m_entity_proxy; + } + + std::vector& connection_list_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_connection_list.~vector();}; + new(&m_connection_list) std::vector(); + ; + } + + return m_connection_list; + } + + IncompatibleQoSStatus_s& incompatible_qos_status_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_incompatible_qos_status.~IncompatibleQoSStatus_s();}; + new(&m_incompatible_qos_status) IncompatibleQoSStatus_s(); + ; + } + + return m_incompatible_qos_status; + } + + InconsistentTopicStatus_s& inconsistent_topic_status_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_inconsistent_topic_status.~InconsistentTopicStatus_s();}; + new(&m_inconsistent_topic_status) InconsistentTopicStatus_s(); + ; + } + + return m_inconsistent_topic_status; + } + + LivelinessLostStatus_s& liveliness_lost_status_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_liveliness_lost_status.~LivelinessLostStatus_s();}; + new(&m_liveliness_lost_status) LivelinessLostStatus_s(); + ; + } + + return m_liveliness_lost_status; + } + + LivelinessChangedStatus_s& liveliness_changed_status_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_liveliness_changed_status.~LivelinessChangedStatus_s();}; + new(&m_liveliness_changed_status) LivelinessChangedStatus_s(); + ; + } + + return m_liveliness_changed_status; + } + + DeadlineMissedStatus_s& deadline_missed_status_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_deadline_missed_status.~DeadlineMissedStatus_s();}; + new(&m_deadline_missed_status) DeadlineMissedStatus_s(); + ; + } + + return m_deadline_missed_status; + } + + SampleLostStatus_s& sample_lost_status_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_sample_lost_status.~SampleLostStatus_s();}; + new(&m_sample_lost_status) SampleLostStatus_s(); + ; + } + + return m_sample_lost_status; + } + + uint8_t& statuses_size_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = nullptr; + m_statuses_size = {0}; + ; + } + + return m_statuses_size; + } + + + StatusKind::StatusKind m__d {1}; + + union + { + std::vector m_entity_proxy; + std::vector m_connection_list; + IncompatibleQoSStatus_s m_incompatible_qos_status; + InconsistentTopicStatus_s m_inconsistent_topic_status; + LivelinessLostStatus_s m_liveliness_lost_status; + LivelinessChangedStatus_s m_liveliness_changed_status; + DeadlineMissedStatus_s m_deadline_missed_status; + SampleLostStatus_s m_sample_lost_status; + uint8_t m_statuses_size; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ +class MonitorServiceStatusData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MonitorServiceStatusData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MonitorServiceStatusData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + const MonitorServiceStatusData& x) + { + m_local_entity = x.m_local_entity; + + m_status_kind = x.m_status_kind; + + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData( + MonitorServiceStatusData&& x) noexcept + { + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + const MonitorServiceStatusData& x) + { + + m_local_entity = x.m_local_entity; + + m_status_kind = x.m_status_kind; + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MonitorServiceStatusData that will be copied. + */ + eProsima_user_DllExport MonitorServiceStatusData& operator =( + MonitorServiceStatusData&& x) noexcept + { + + m_local_entity = std::move(x.m_local_entity); + m_status_kind = x.m_status_kind; + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MonitorServiceStatusData& x) const + { + return (m_local_entity == x.m_local_entity && + m_status_kind == x.m_status_kind && + m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x MonitorServiceStatusData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MonitorServiceStatusData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member local_entity + * @param _local_entity New value to be copied in member local_entity + */ + eProsima_user_DllExport void local_entity( + const detail::GUID_s& _local_entity) + { + m_local_entity = _local_entity; + } + + /*! + * @brief This function moves the value in member local_entity + * @param _local_entity New value to be moved in member local_entity + */ + eProsima_user_DllExport void local_entity( + detail::GUID_s&& _local_entity) + { + m_local_entity = std::move(_local_entity); + } + + /*! + * @brief This function returns a constant reference to member local_entity + * @return Constant reference to member local_entity + */ + eProsima_user_DllExport const detail::GUID_s& local_entity() const + { + return m_local_entity; + } + + /*! + * @brief This function returns a reference to member local_entity + * @return Reference to member local_entity + */ + eProsima_user_DllExport detail::GUID_s& local_entity() + { + return m_local_entity; + } + + + /*! + * @brief This function sets a value in member status_kind + * @param _status_kind New value for member status_kind + */ + eProsima_user_DllExport void status_kind( + StatusKind::StatusKind _status_kind) + { + m_status_kind = _status_kind; + } + + /*! + * @brief This function returns the value of member status_kind + * @return Value of member status_kind + */ + eProsima_user_DllExport StatusKind::StatusKind status_kind() const + { + return m_status_kind; + } + + /*! + * @brief This function returns a reference to member status_kind + * @return Reference to member status_kind + */ + eProsima_user_DllExport StatusKind::StatusKind& status_kind() + { + return m_status_kind; + } + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const MonitorServiceData& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + MonitorServiceData&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const MonitorServiceData& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport MonitorServiceData& value() + { + return m_value; + } + + + +private: + + detail::GUID_s m_local_entity; + StatusKind::StatusKind m_status_kind{0}; + MonitorServiceData m_value; + +}; + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_HPP_ + + diff --git a/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp b/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp new file mode 100644 index 00000000000..ee5fff198a7 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesCdrAux.hpp @@ -0,0 +1,115 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesCdrAux.hpp + * This source file contains some definitions of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ + +#include "monitorservice_types.hpp" + +constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize {0UL}; + + + + + + + +constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_cdr_typesize {72UL}; +constexpr uint32_t eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize {32UL}; + + + + + +constexpr uint32_t eprosima_fastdds_statistics_Connection_max_cdr_typesize {52UL}; +constexpr uint32_t eprosima_fastdds_statistics_Connection_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize {0UL}; + + + + + + + +constexpr uint32_t eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize {0UL}; + + +namespace eprosima { +namespace fastcdr { + +class Cdr; +class CdrSizeCalculator; + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data); + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data); + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_HPP_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp b/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp new file mode 100644 index 00000000000..cf0924ab80b --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesCdrAux.ipp @@ -0,0 +1,1011 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesCdrAux.ipp + * This source file contains some declarations of CDR related functions. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ + +#include "monitorservice_typesCdrAux.hpp" + +#include +#include + + +#include +using namespace eprosima::fastcdr::exception; + +namespace eprosima { +namespace fastcdr { + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::Connection& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.mode(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.guid(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.announced_locators(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.used_locators(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.mode() + << eprosima::fastcdr::MemberId(1) << data.guid() + << eprosima::fastcdr::MemberId(2) << data.announced_locators() + << eprosima::fastcdr::MemberId(3) << data.used_locators() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.mode(); + break; + + case 1: + dcdr >> data.guid(); + break; + + case 2: + dcdr >> data.announced_locators(); + break; + + case 3: + dcdr >> data.used_locators(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::Connection& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::QosPolicyCount_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.policy_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.policy_id() + << eprosima::fastcdr::MemberId(1) << data.count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.policy_id(); + break; + + case 1: + dcdr >> data.count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::QosPolicyCount_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::BaseStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::BaseStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.last_policy_id(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.policies(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() + << eprosima::fastcdr::MemberId(1) << data.last_policy_id() + << eprosima::fastcdr::MemberId(2) << data.policies() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + case 1: + dcdr >> data.last_policy_id(); + break; + + case 2: + dcdr >> data.policies(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::IncompatibleQoSStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.alive_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.not_alive_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.last_publication_handle(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.alive_count() + << eprosima::fastcdr::MemberId(1) << data.not_alive_count() + << eprosima::fastcdr::MemberId(2) << data.last_publication_handle() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.alive_count(); + break; + + case 1: + dcdr >> data.not_alive_count(); + break; + + case 2: + dcdr >> data.last_publication_handle(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::LivelinessChangedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.total_count(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.last_instance_handle(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.total_count() + << eprosima::fastcdr::MemberId(1) << data.last_instance_handle() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.total_count(); + break; + + case 1: + dcdr >> data.last_instance_handle(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::DeadlineMissedStatus_s& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); +} + + + + + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::MonitorServiceData& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), + current_alignment); + + switch (data._d()) + { + case StatusKind::PROXY: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.entity_proxy(), current_alignment); + break; + + case StatusKind::CONNECTION_LIST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.connection_list(), current_alignment); + break; + + case StatusKind::INCOMPATIBLE_QOS: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.incompatible_qos_status(), current_alignment); + break; + + case StatusKind::INCONSISTENT_TOPIC: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.inconsistent_topic_status(), current_alignment); + break; + + case StatusKind::LIVELINESS_LOST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.liveliness_lost_status(), current_alignment); + break; + + case StatusKind::LIVELINESS_CHANGED: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.liveliness_changed_status(), current_alignment); + break; + + case StatusKind::DEADLINE_MISSED: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.deadline_missed_status(), current_alignment); + break; + + case StatusKind::SAMPLE_LOST: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.sample_lost_status(), current_alignment); + break; + + case StatusKind::STATUSES_SIZE: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.statuses_size(), current_alignment); + break; + + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceData& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr << eprosima::fastcdr::MemberId(0) << data._d(); + + switch (data._d()) + { + case StatusKind::PROXY: + scdr << eprosima::fastcdr::MemberId(1) << data.entity_proxy(); + break; + + case StatusKind::CONNECTION_LIST: + scdr << eprosima::fastcdr::MemberId(2) << data.connection_list(); + break; + + case StatusKind::INCOMPATIBLE_QOS: + scdr << eprosima::fastcdr::MemberId(3) << data.incompatible_qos_status(); + break; + + case StatusKind::INCONSISTENT_TOPIC: + scdr << eprosima::fastcdr::MemberId(4) << data.inconsistent_topic_status(); + break; + + case StatusKind::LIVELINESS_LOST: + scdr << eprosima::fastcdr::MemberId(5) << data.liveliness_lost_status(); + break; + + case StatusKind::LIVELINESS_CHANGED: + scdr << eprosima::fastcdr::MemberId(6) << data.liveliness_changed_status(); + break; + + case StatusKind::DEADLINE_MISSED: + scdr << eprosima::fastcdr::MemberId(7) << data.deadline_missed_status(); + break; + + case StatusKind::SAMPLE_LOST: + scdr << eprosima::fastcdr::MemberId(8) << data.sample_lost_status(); + break; + + case StatusKind::STATUSES_SIZE: + scdr << eprosima::fastcdr::MemberId(9) << data.statuses_size(); + break; + + default: + break; + } + + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::MonitorServiceData& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + if (0 == mid.id) + { + eprosima::fastdds::statistics::StatusKind::StatusKind discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case StatusKind::PROXY: + { + std::vector entity_proxy_value; + data.entity_proxy(std::move(entity_proxy_value)); + data._d(discriminator); + break; + } + + case StatusKind::CONNECTION_LIST: + { + std::vector connection_list_value; + data.connection_list(std::move(connection_list_value)); + data._d(discriminator); + break; + } + + case StatusKind::INCOMPATIBLE_QOS: + { + eprosima::fastdds::statistics::IncompatibleQoSStatus_s incompatible_qos_status_value; + data.incompatible_qos_status(std::move(incompatible_qos_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::INCONSISTENT_TOPIC: + { + eprosima::fastdds::statistics::InconsistentTopicStatus_s inconsistent_topic_status_value; + data.inconsistent_topic_status(std::move(inconsistent_topic_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::LIVELINESS_LOST: + { + eprosima::fastdds::statistics::LivelinessLostStatus_s liveliness_lost_status_value; + data.liveliness_lost_status(std::move(liveliness_lost_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::LIVELINESS_CHANGED: + { + eprosima::fastdds::statistics::LivelinessChangedStatus_s liveliness_changed_status_value; + data.liveliness_changed_status(std::move(liveliness_changed_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::DEADLINE_MISSED: + { + eprosima::fastdds::statistics::DeadlineMissedStatus_s deadline_missed_status_value; + data.deadline_missed_status(std::move(deadline_missed_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::SAMPLE_LOST: + { + eprosima::fastdds::statistics::SampleLostStatus_s sample_lost_status_value; + data.sample_lost_status(std::move(sample_lost_status_value)); + data._d(discriminator); + break; + } + + case StatusKind::STATUSES_SIZE: + { + uint8_t statuses_size_value{0}; + data.statuses_size(std::move(statuses_size_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case StatusKind::PROXY: + dcdr >> data.entity_proxy(); + break; + + case StatusKind::CONNECTION_LIST: + dcdr >> data.connection_list(); + break; + + case StatusKind::INCOMPATIBLE_QOS: + dcdr >> data.incompatible_qos_status(); + break; + + case StatusKind::INCONSISTENT_TOPIC: + dcdr >> data.inconsistent_topic_status(); + break; + + case StatusKind::LIVELINESS_LOST: + dcdr >> data.liveliness_lost_status(); + break; + + case StatusKind::LIVELINESS_CHANGED: + dcdr >> data.liveliness_changed_status(); + break; + + case StatusKind::DEADLINE_MISSED: + dcdr >> data.deadline_missed_status(); + break; + + case StatusKind::SAMPLE_LOST: + dcdr >> data.sample_lost_status(); + break; + + case StatusKind::STATUSES_SIZE: + dcdr >> data.statuses_size(); + break; + + default: + break; + } + ret_value = false; + } + return ret_value; + }); +} + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data, + size_t& current_alignment) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.local_entity(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.status_kind(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.value(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.local_entity() + << eprosima::fastcdr::MemberId(1) << data.status_kind() + << eprosima::fastcdr::MemberId(2) << data.value() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.local_entity(); + break; + + case 1: + dcdr >> data.status_kind(); + break; + + case 2: + dcdr >> data.value(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::statistics::MonitorServiceStatusData& data) +{ + using namespace eprosima::fastdds::statistics; + + static_cast(scdr); + static_cast(data); + scdr << data.local_entity(); + + scdr << data.status_kind(); + + +} + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPESCDRAUX_IPP_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx new file mode 100644 index 00000000000..4fb6eeb1156 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.cxx @@ -0,0 +1,1404 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesPubSubTypes.cpp + * This header file contains the implementation of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + +#include "monitorservice_typesPubSubTypes.h" + +#include +#include + +#include "monitorservice_typesCdrAux.hpp" +#include "monitorservice_typesTypeObjectSupport.hpp" + +using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; +using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; +using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + +namespace eprosima { + namespace fastdds { + namespace statistics { + ConnectionPubSubType::ConnectionPubSubType() + { + setName("eprosima::fastdds::statistics::Connection"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Connection::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Connection_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_fastdds_statistics_Connection_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_Connection_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + ConnectionPubSubType::~ConnectionPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool ConnectionPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + Connection* 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; + } + 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 ConnectionPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Connection* 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 ConnectionPubSubType::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* ConnectionPubSubType::createData() + { + return reinterpret_cast(new Connection()); + } + + void ConnectionPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ConnectionPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + Connection* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_Connection_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_fastdds_statistics_Connection_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; + } + + void ConnectionPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + QosPolicyCount_sPubSubType::QosPolicyCount_sPubSubType() + { + setName("eprosima::fastdds::statistics::QosPolicyCount_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(QosPolicyCount_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_QosPolicyCount_s_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_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_QosPolicyCount_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + QosPolicyCount_sPubSubType::~QosPolicyCount_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool QosPolicyCount_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + QosPolicyCount_s* 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; + } + 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 QosPolicyCount_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + QosPolicyCount_s* 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 QosPolicyCount_sPubSubType::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* QosPolicyCount_sPubSubType::createData() + { + return reinterpret_cast(new QosPolicyCount_s()); + } + + void QosPolicyCount_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool QosPolicyCount_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + QosPolicyCount_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_QosPolicyCount_s_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_fastdds_statistics_QosPolicyCount_s_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; + } + + void QosPolicyCount_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + BaseStatus_sPubSubType::BaseStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::BaseStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(BaseStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_BaseStatus_s_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_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_BaseStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + BaseStatus_sPubSubType::~BaseStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool BaseStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + BaseStatus_s* 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; + } + 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 BaseStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + BaseStatus_s* 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 BaseStatus_sPubSubType::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* BaseStatus_sPubSubType::createData() + { + return reinterpret_cast(new BaseStatus_s()); + } + + void BaseStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BaseStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + BaseStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_BaseStatus_s_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_fastdds_statistics_BaseStatus_s_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; + } + + void BaseStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + + IncompatibleQoSStatus_sPubSubType::IncompatibleQoSStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::IncompatibleQoSStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(IncompatibleQoSStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_IncompatibleQoSStatus_s_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_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_IncompatibleQoSStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + IncompatibleQoSStatus_sPubSubType::~IncompatibleQoSStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool IncompatibleQoSStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + IncompatibleQoSStatus_s* 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; + } + 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 IncompatibleQoSStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + IncompatibleQoSStatus_s* 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 IncompatibleQoSStatus_sPubSubType::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* IncompatibleQoSStatus_sPubSubType::createData() + { + return reinterpret_cast(new IncompatibleQoSStatus_s()); + } + + void IncompatibleQoSStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool IncompatibleQoSStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + IncompatibleQoSStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_IncompatibleQoSStatus_s_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_fastdds_statistics_IncompatibleQoSStatus_s_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; + } + + void IncompatibleQoSStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + LivelinessChangedStatus_sPubSubType::LivelinessChangedStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::LivelinessChangedStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(LivelinessChangedStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_LivelinessChangedStatus_s_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_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_LivelinessChangedStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + LivelinessChangedStatus_sPubSubType::~LivelinessChangedStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool LivelinessChangedStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + LivelinessChangedStatus_s* 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; + } + 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 LivelinessChangedStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + LivelinessChangedStatus_s* 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 LivelinessChangedStatus_sPubSubType::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* LivelinessChangedStatus_sPubSubType::createData() + { + return reinterpret_cast(new LivelinessChangedStatus_s()); + } + + void LivelinessChangedStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LivelinessChangedStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + LivelinessChangedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_LivelinessChangedStatus_s_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_fastdds_statistics_LivelinessChangedStatus_s_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; + } + + void LivelinessChangedStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + DeadlineMissedStatus_sPubSubType::DeadlineMissedStatus_sPubSubType() + { + setName("eprosima::fastdds::statistics::DeadlineMissedStatus_s"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(DeadlineMissedStatus_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_DeadlineMissedStatus_s_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_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_DeadlineMissedStatus_s_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + DeadlineMissedStatus_sPubSubType::~DeadlineMissedStatus_sPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool DeadlineMissedStatus_sPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + DeadlineMissedStatus_s* 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; + } + 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 DeadlineMissedStatus_sPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + DeadlineMissedStatus_s* 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 DeadlineMissedStatus_sPubSubType::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* DeadlineMissedStatus_sPubSubType::createData() + { + return reinterpret_cast(new DeadlineMissedStatus_s()); + } + + void DeadlineMissedStatus_sPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool DeadlineMissedStatus_sPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + DeadlineMissedStatus_s* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_DeadlineMissedStatus_s_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_fastdds_statistics_DeadlineMissedStatus_s_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; + } + + void DeadlineMissedStatus_sPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + + + + namespace StatusKind { + } // namespace StatusKind + + + MonitorServiceStatusDataPubSubType::MonitorServiceStatusDataPubSubType() + { + setName("eprosima::fastdds::statistics::MonitorServiceStatusData"); + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(MonitorServiceStatusData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_MonitorServiceStatusData_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_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize > 16 ? eprosima_fastdds_statistics_MonitorServiceStatusData_max_key_cdr_typesize : 16; + m_keyBuffer = reinterpret_cast(malloc(keyLength)); + memset(m_keyBuffer, 0, keyLength); + } + + MonitorServiceStatusDataPubSubType::~MonitorServiceStatusDataPubSubType() + { + if (m_keyBuffer != nullptr) + { + free(m_keyBuffer); + } + } + + bool MonitorServiceStatusDataPubSubType::serialize( + void* data, + SerializedPayload_t* payload, + DataRepresentationId_t data_representation) + { + MonitorServiceStatusData* 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; + } + 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 MonitorServiceStatusDataPubSubType::deserialize( + SerializedPayload_t* payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + MonitorServiceStatusData* 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 MonitorServiceStatusDataPubSubType::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* MonitorServiceStatusDataPubSubType::createData() + { + return reinterpret_cast(new MonitorServiceStatusData()); + } + + void MonitorServiceStatusDataPubSubType::deleteData( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool MonitorServiceStatusDataPubSubType::getKey( + void* data, + InstanceHandle_t* handle, + bool force_md5) + { + if (!m_isGetKeyDefined) + { + return false; + } + + MonitorServiceStatusData* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), + eprosima_fastdds_statistics_MonitorServiceStatusData_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_fastdds_statistics_MonitorServiceStatusData_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; + } + + void MonitorServiceStatusDataPubSubType::register_type_object_representation() const + { + register_monitorservice_types_type_objects(); + } + + } // namespace statistics + + } // namespace fastdds + +} // namespace eprosima + + +// Include auxiliary functions like for serializing/deserializing. +#include "monitorservice_typesCdrAux.ipp" diff --git a/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h new file mode 100644 index 00000000000..cc0d28dffc7 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesPubSubTypes.h @@ -0,0 +1,707 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "monitorservice_types.hpp" + +#include "typesPubSubTypes.h" + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated monitorservice_types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima +{ + namespace fastdds + { + namespace statistics + { + + /*! + * @brief This class represents the TopicDataType of the type Connection defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class ConnectionPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Connection type; + + eProsima_user_DllExport ConnectionPubSubType(); + + eProsima_user_DllExport ~ConnectionPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type QosPolicyCount_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class QosPolicyCount_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef QosPolicyCount_s type; + + eProsima_user_DllExport QosPolicyCount_sPubSubType(); + + eProsima_user_DllExport ~QosPolicyCount_sPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type BaseStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class BaseStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BaseStatus_s type; + + eProsima_user_DllExport BaseStatus_sPubSubType(); + + eProsima_user_DllExport ~BaseStatus_sPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + typedef std::vector QosPolicyCountSeq_s; + + /*! + * @brief This class represents the TopicDataType of the type IncompatibleQoSStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class IncompatibleQoSStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef IncompatibleQoSStatus_s type; + + eProsima_user_DllExport IncompatibleQoSStatus_sPubSubType(); + + eProsima_user_DllExport ~IncompatibleQoSStatus_sPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type LivelinessChangedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class LivelinessChangedStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LivelinessChangedStatus_s type; + + eProsima_user_DllExport LivelinessChangedStatus_sPubSubType(); + + eProsima_user_DllExport ~LivelinessChangedStatus_sPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + + /*! + * @brief This class represents the TopicDataType of the type DeadlineMissedStatus_s defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class DeadlineMissedStatus_sPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef DeadlineMissedStatus_s type; + + eProsima_user_DllExport DeadlineMissedStatus_sPubSubType(); + + eProsima_user_DllExport ~DeadlineMissedStatus_sPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + typedef eprosima::fastdds::statistics::BaseStatus_s LivelinessLostStatus_s; + typedef eprosima::fastdds::statistics::BaseStatus_s InconsistentTopicStatus_s; + typedef eprosima::fastdds::statistics::BaseStatus_s SampleLostStatus_s; + namespace StatusKind + { + typedef uint32_t StatusKind; + + + + + + + + + + } // namespace StatusKind + + + /*! + * @brief This class represents the TopicDataType of the type MonitorServiceStatusData defined by the user in the IDL file. + * @ingroup monitorservice_types + */ + class MonitorServiceStatusDataPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef MonitorServiceStatusData type; + + eProsima_user_DllExport MonitorServiceStatusDataPubSubType(); + + eProsima_user_DllExport ~MonitorServiceStatusDataPubSubType() 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, + 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 std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + + #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 + + #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; + } + + #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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + + }; + } // namespace statistics + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_PUBSUBTYPES_H_ + diff --git a/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.cxx b/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.cxx new file mode 100644 index 00000000000..6d8d94198ce --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.cxx @@ -0,0 +1,12397 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "monitorservice_typesTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "monitorservice_types.hpp" + +#include "types.hpp" + +using namespace eprosima::fastdds::dds::xtypes; + +void register_monitorservice_types_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Data_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Connection_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier(); + + }); +} + +namespace eprosima { +namespace fastdds { +namespace statistics { +void register_eprosima_fastdds_statistics_Connection_type_identifier() +{ + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier() +{ + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier() +{ + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +namespace StatusKind { +} // namespace StatusKind +void register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier() +{ + { + ReturnCode_t return_code_MonitorServiceData; + TypeIdentifierPair type_ids_MonitorServiceData; + UnionTypeFlag union_flags_MonitorServiceData = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_MonitorServiceData = "eprosima::fastdds::statistics::MonitorServiceData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceData; + eprosima::fastcdr::optional ann_custom_MonitorServiceData; + CompleteTypeDetail detail_MonitorServiceData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData, type_name_MonitorServiceData.to_string()); + CompleteUnionHeader header_MonitorServiceData = TypeObjectUtils::build_complete_union_header(detail_MonitorServiceData); + UnionDiscriminatorFlag member_flags_MonitorServiceData = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonDiscriminatorMember common_MonitorServiceData; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_MonitorServiceData.reset(); + ann_custom_MonitorServiceData.reset(); + CompleteDiscriminatorMember discriminator_MonitorServiceData = TypeObjectUtils::build_complete_discriminator_member(common_MonitorServiceData, + type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData); + CompleteUnionMemberSeq member_seq_MonitorServiceData; + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_entity_proxy = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_proxy; + TypeObjectUtils::add_union_case_label(label_seq_entity_proxy, static_cast(StatusKind::PROXY)); + CommonUnionMember common_entity_proxy; + MemberId member_id_entity_proxy = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier1(), + label_seq_entity_proxy); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier2(), + label_seq_entity_proxy); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_proxy member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_proxy = "entity_proxy"; + eprosima::fastcdr::optional member_ann_builtin_entity_proxy; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_entity_proxy = TypeObjectUtils::build_complete_member_detail(name_entity_proxy, member_ann_builtin_entity_proxy, ann_custom_MonitorServiceData); + CompleteUnionMember member_entity_proxy = TypeObjectUtils::build_complete_union_member(common_entity_proxy, detail_entity_proxy); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_entity_proxy); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_connection_list = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_connection_list; + TypeObjectUtils::add_union_case_label(label_seq_connection_list, static_cast(StatusKind::CONNECTION_LIST)); + CommonUnionMember common_connection_list; + MemberId member_id_connection_list = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier1(), + label_seq_connection_list); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier2(), + label_seq_connection_list); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union connection_list member TypeIdentifier inconsistent."); + return; + } + MemberName name_connection_list = "connection_list"; + eprosima::fastcdr::optional member_ann_builtin_connection_list; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_connection_list = TypeObjectUtils::build_complete_member_detail(name_connection_list, member_ann_builtin_connection_list, ann_custom_MonitorServiceData); + CompleteUnionMember member_connection_list = TypeObjectUtils::build_complete_union_member(common_connection_list, detail_connection_list); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_connection_list); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_incompatible_qos_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_incompatible_qos_status; + TypeObjectUtils::add_union_case_label(label_seq_incompatible_qos_status, static_cast(StatusKind::INCOMPATIBLE_QOS)); + CommonUnionMember common_incompatible_qos_status; + MemberId member_id_incompatible_qos_status = 0x00000003; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_incompatible_qos_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_incompatible_qos_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union incompatible_qos_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_incompatible_qos_status = "incompatible_qos_status"; + eprosima::fastcdr::optional member_ann_builtin_incompatible_qos_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_incompatible_qos_status = TypeObjectUtils::build_complete_member_detail(name_incompatible_qos_status, member_ann_builtin_incompatible_qos_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_incompatible_qos_status = TypeObjectUtils::build_complete_union_member(common_incompatible_qos_status, detail_incompatible_qos_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_incompatible_qos_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_InconsistentTopicStatus_s = 0; + QualifiedTypeName type_name_InconsistentTopicStatus_s = "eprosima::fastdds::statistics::InconsistentTopicStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_InconsistentTopicStatus_s; + eprosima::fastcdr::optional ann_custom_InconsistentTopicStatus_s; + CompleteTypeDetail detail_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string()); + CompleteAliasHeader header_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_header(detail_InconsistentTopicStatus_s); + AliasMemberFlag related_flags_InconsistentTopicStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_InconsistentTopicStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_InconsistentTopicStatus_s; + ann_custom_InconsistentTopicStatus_s.reset(); + CompleteAliasBody body_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_body(common_InconsistentTopicStatus_s, member_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s); + CompleteAliasType alias_type_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_InconsistentTopicStatus_s, header_InconsistentTopicStatus_s, body_InconsistentTopicStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_inconsistent_topic_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_inconsistent_topic_status; + TypeObjectUtils::add_union_case_label(label_seq_inconsistent_topic_status, static_cast(StatusKind::INCONSISTENT_TOPIC)); + CommonUnionMember common_inconsistent_topic_status; + MemberId member_id_inconsistent_topic_status = 0x00000004; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_inconsistent_topic_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_inconsistent_topic_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union inconsistent_topic_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_inconsistent_topic_status = "inconsistent_topic_status"; + eprosima::fastcdr::optional member_ann_builtin_inconsistent_topic_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_inconsistent_topic_status = TypeObjectUtils::build_complete_member_detail(name_inconsistent_topic_status, member_ann_builtin_inconsistent_topic_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_inconsistent_topic_status = TypeObjectUtils::build_complete_union_member(common_inconsistent_topic_status, detail_inconsistent_topic_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_inconsistent_topic_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_LivelinessLostStatus_s = 0; + QualifiedTypeName type_name_LivelinessLostStatus_s = "eprosima::fastdds::statistics::LivelinessLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessLostStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessLostStatus_s; + CompleteTypeDetail detail_LivelinessLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string()); + CompleteAliasHeader header_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_LivelinessLostStatus_s); + AliasMemberFlag related_flags_LivelinessLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_LivelinessLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_LivelinessLostStatus_s; + ann_custom_LivelinessLostStatus_s.reset(); + CompleteAliasBody body_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_LivelinessLostStatus_s, member_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s); + CompleteAliasType alias_type_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_LivelinessLostStatus_s, header_LivelinessLostStatus_s, body_LivelinessLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_liveliness_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_lost_status, static_cast(StatusKind::LIVELINESS_LOST)); + CommonUnionMember common_liveliness_lost_status; + MemberId member_id_liveliness_lost_status = 0x00000005; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_lost_status = "liveliness_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_lost_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_lost_status, member_ann_builtin_liveliness_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_lost_status = TypeObjectUtils::build_complete_union_member(common_liveliness_lost_status, detail_liveliness_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_liveliness_changed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_changed_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_changed_status, static_cast(StatusKind::LIVELINESS_CHANGED)); + CommonUnionMember common_liveliness_changed_status; + MemberId member_id_liveliness_changed_status = 0x00000006; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_changed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_changed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_changed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_changed_status = "liveliness_changed_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_changed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_changed_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_changed_status, member_ann_builtin_liveliness_changed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_changed_status = TypeObjectUtils::build_complete_union_member(common_liveliness_changed_status, detail_liveliness_changed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_changed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_deadline_missed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_deadline_missed_status; + TypeObjectUtils::add_union_case_label(label_seq_deadline_missed_status, static_cast(StatusKind::DEADLINE_MISSED)); + CommonUnionMember common_deadline_missed_status; + MemberId member_id_deadline_missed_status = 0x00000007; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_deadline_missed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_deadline_missed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union deadline_missed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadline_missed_status = "deadline_missed_status"; + eprosima::fastcdr::optional member_ann_builtin_deadline_missed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_deadline_missed_status = TypeObjectUtils::build_complete_member_detail(name_deadline_missed_status, member_ann_builtin_deadline_missed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_deadline_missed_status = TypeObjectUtils::build_complete_union_member(common_deadline_missed_status, detail_deadline_missed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_deadline_missed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_SampleLostStatus_s = 0; + QualifiedTypeName type_name_SampleLostStatus_s = "eprosima::fastdds::statistics::SampleLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleLostStatus_s; + eprosima::fastcdr::optional ann_custom_SampleLostStatus_s; + CompleteTypeDetail detail_SampleLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string()); + CompleteAliasHeader header_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_SampleLostStatus_s); + AliasMemberFlag related_flags_SampleLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_SampleLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_SampleLostStatus_s; + ann_custom_SampleLostStatus_s.reset(); + CompleteAliasBody body_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_SampleLostStatus_s, member_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s); + CompleteAliasType alias_type_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_SampleLostStatus_s, header_SampleLostStatus_s, body_SampleLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_sample_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_sample_lost_status, static_cast(StatusKind::SAMPLE_LOST)); + CommonUnionMember common_sample_lost_status; + MemberId member_id_sample_lost_status = 0x00000008; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_sample_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_sample_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_lost_status = "sample_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_sample_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_sample_lost_status = TypeObjectUtils::build_complete_member_detail(name_sample_lost_status, member_ann_builtin_sample_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_sample_lost_status = TypeObjectUtils::build_complete_union_member(common_sample_lost_status, detail_sample_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_sample_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "statuses_size Union member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + UnionMemberFlag member_flags_statuses_size = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_statuses_size; + TypeObjectUtils::add_union_case_label(label_seq_statuses_size, static_cast(StatusKind::STATUSES_SIZE)); + CommonUnionMember common_statuses_size; + MemberId member_id_statuses_size = 0x00000009; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier1(), + label_seq_statuses_size); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier2(), + label_seq_statuses_size); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union statuses_size member TypeIdentifier inconsistent."); + return; + } + MemberName name_statuses_size = "statuses_size"; + eprosima::fastcdr::optional member_ann_builtin_statuses_size; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_statuses_size = TypeObjectUtils::build_complete_member_detail(name_statuses_size, member_ann_builtin_statuses_size, ann_custom_MonitorServiceData); + CompleteUnionMember member_statuses_size = TypeObjectUtils::build_complete_union_member(common_statuses_size, detail_statuses_size); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_statuses_size); + } + CompleteUnionType union_type_MonitorServiceData = TypeObjectUtils::build_complete_union_type(union_flags_MonitorServiceData, header_MonitorServiceData, discriminator_MonitorServiceData, + member_seq_MonitorServiceData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_MonitorServiceData, type_name_MonitorServiceData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier() +{ + { + StructTypeFlag struct_flags_MonitorServiceStatusData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_MonitorServiceStatusData; + TypeIdentifierPair type_ids_MonitorServiceStatusData; + QualifiedTypeName type_name_MonitorServiceStatusData = "eprosima::fastdds::statistics::MonitorServiceStatusData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceStatusData; + eprosima::fastcdr::optional ann_custom_MonitorServiceStatusData; + CompleteTypeDetail detail_MonitorServiceStatusData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceStatusData, ann_custom_MonitorServiceStatusData, type_name_MonitorServiceStatusData.to_string()); + CompleteStructHeader header_MonitorServiceStatusData; + header_MonitorServiceStatusData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_MonitorServiceStatusData); + CompleteStructMemberSeq member_seq_MonitorServiceStatusData; + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_entity = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_entity; + MemberId member_id_local_entity = 0x00000000; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_entity = TypeObjectUtils::build_common_struct_member(member_id_local_entity, member_flags_local_entity, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_entity = TypeObjectUtils::build_common_struct_member(member_id_local_entity, member_flags_local_entity, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_entity member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_entity = "local_entity"; + eprosima::fastcdr::optional member_ann_builtin_local_entity; + ann_custom_MonitorServiceStatusData.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_entity; + eprosima::fastcdr::optional unit_local_entity; + eprosima::fastcdr::optional min_local_entity; + eprosima::fastcdr::optional max_local_entity; + eprosima::fastcdr::optional hash_id_local_entity; + if (unit_local_entity.has_value() || min_local_entity.has_value() || max_local_entity.has_value() || hash_id_local_entity.has_value()) + { + member_ann_builtin_local_entity = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_entity, min_local_entity, max_local_entity, hash_id_local_entity); + } + if (!tmp_ann_custom_local_entity.empty()) + { + ann_custom_MonitorServiceStatusData = tmp_ann_custom_local_entity; + } + CompleteMemberDetail detail_local_entity = TypeObjectUtils::build_complete_member_detail(name_local_entity, member_ann_builtin_local_entity, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_local_entity = TypeObjectUtils::build_complete_struct_member(common_local_entity, detail_local_entity); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_local_entity); + } + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceStatusData); + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_status_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_status_kind; + MemberId member_id_status_kind = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_status_kind = TypeObjectUtils::build_common_struct_member(member_id_status_kind, member_flags_status_kind, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_status_kind = TypeObjectUtils::build_common_struct_member(member_id_status_kind, member_flags_status_kind, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure status_kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_status_kind = "status_kind"; + eprosima::fastcdr::optional member_ann_builtin_status_kind; + ann_custom_MonitorServiceStatusData.reset(); + AppliedAnnotationSeq tmp_ann_custom_status_kind; + eprosima::fastcdr::optional unit_status_kind; + eprosima::fastcdr::optional min_status_kind; + eprosima::fastcdr::optional max_status_kind; + eprosima::fastcdr::optional hash_id_status_kind; + if (unit_status_kind.has_value() || min_status_kind.has_value() || max_status_kind.has_value() || hash_id_status_kind.has_value()) + { + member_ann_builtin_status_kind = TypeObjectUtils::build_applied_builtin_member_annotations(unit_status_kind, min_status_kind, max_status_kind, hash_id_status_kind); + } + if (!tmp_ann_custom_status_kind.empty()) + { + ann_custom_MonitorServiceStatusData = tmp_ann_custom_status_kind; + } + CompleteMemberDetail detail_status_kind = TypeObjectUtils::build_complete_member_detail(name_status_kind, member_ann_builtin_status_kind, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_status_kind = TypeObjectUtils::build_complete_struct_member(common_status_kind, detail_status_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_status_kind); + } + { + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceStatusData); + + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + { + ReturnCode_t return_code_MonitorServiceData; + TypeIdentifierPair type_ids_MonitorServiceData; + UnionTypeFlag union_flags_MonitorServiceData = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_MonitorServiceData = "eprosima::fastdds::statistics::MonitorServiceData"; + eprosima::fastcdr::optional type_ann_builtin_MonitorServiceData; + eprosima::fastcdr::optional ann_custom_MonitorServiceData; + CompleteTypeDetail detail_MonitorServiceData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData, type_name_MonitorServiceData.to_string()); + CompleteUnionHeader header_MonitorServiceData = TypeObjectUtils::build_complete_union_header(detail_MonitorServiceData); + UnionDiscriminatorFlag member_flags_MonitorServiceData = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_StatusKind = 0; + QualifiedTypeName type_name_StatusKind = "eprosima::fastdds::statistics::StatusKind::StatusKind"; + eprosima::fastcdr::optional type_ann_builtin_StatusKind; + eprosima::fastcdr::optional ann_custom_StatusKind; + CompleteTypeDetail detail_StatusKind = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StatusKind, ann_custom_StatusKind, type_name_StatusKind.to_string()); + CompleteAliasHeader header_StatusKind = TypeObjectUtils::build_complete_alias_header(detail_StatusKind); + AliasMemberFlag related_flags_StatusKind = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonAliasBody common_StatusKind; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_StatusKind = TypeObjectUtils::build_common_alias_body(related_flags_StatusKind, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_StatusKind; + ann_custom_StatusKind.reset(); + CompleteAliasBody body_StatusKind = TypeObjectUtils::build_complete_alias_body(common_StatusKind, member_ann_builtin_StatusKind, ann_custom_StatusKind); + CompleteAliasType alias_type_StatusKind = TypeObjectUtils::build_complete_alias_type(alias_flags_StatusKind, header_StatusKind, body_StatusKind); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_StatusKind, type_name_StatusKind.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::StatusKind::StatusKind", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::StatusKind::StatusKind: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonDiscriminatorMember common_MonitorServiceData; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + common_MonitorServiceData = TypeObjectUtils::build_common_discriminator_member(member_flags_MonitorServiceData, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_MonitorServiceData.reset(); + ann_custom_MonitorServiceData.reset(); + CompleteDiscriminatorMember discriminator_MonitorServiceData = TypeObjectUtils::build_complete_discriminator_member(common_MonitorServiceData, + type_ann_builtin_MonitorServiceData, ann_custom_MonitorServiceData); + CompleteUnionMemberSeq member_seq_MonitorServiceData; + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_entity_proxy = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_proxy; + TypeObjectUtils::add_union_case_label(label_seq_entity_proxy, static_cast(StatusKind::PROXY)); + CommonUnionMember common_entity_proxy; + MemberId member_id_entity_proxy = 0x00000001; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier1(), + label_seq_entity_proxy); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_proxy = TypeObjectUtils::build_common_union_member(member_id_entity_proxy, member_flags_entity_proxy, type_ids_MonitorServiceData.type_identifier2(), + label_seq_entity_proxy); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_proxy member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_proxy = "entity_proxy"; + eprosima::fastcdr::optional member_ann_builtin_entity_proxy; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_entity_proxy = TypeObjectUtils::build_complete_member_detail(name_entity_proxy, member_ann_builtin_entity_proxy, ann_custom_MonitorServiceData); + CompleteUnionMember member_entity_proxy = TypeObjectUtils::build_complete_union_member(common_entity_proxy, detail_entity_proxy); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_entity_proxy); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Connection = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Connection; + TypeIdentifierPair type_ids_Connection; + QualifiedTypeName type_name_Connection = "eprosima::fastdds::statistics::Connection"; + eprosima::fastcdr::optional type_ann_builtin_Connection; + eprosima::fastcdr::optional ann_custom_Connection; + CompleteTypeDetail detail_Connection = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Connection, ann_custom_Connection, type_name_Connection.to_string()); + CompleteStructHeader header_Connection; + header_Connection = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Connection); + CompleteStructMemberSeq member_seq_Connection; + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_ConnectionMode = 0; + BitBound bit_bound_ConnectionMode = 32; + CommonEnumeratedHeader common_ConnectionMode = TypeObjectUtils::build_common_enumerated_header(bit_bound_ConnectionMode); + QualifiedTypeName type_name_ConnectionMode = "eprosima::fastdds::statistics::ConnectionMode"; + eprosima::fastcdr::optional type_ann_builtin_ConnectionMode; + eprosima::fastcdr::optional ann_custom_ConnectionMode; + CompleteTypeDetail detail_ConnectionMode = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ConnectionMode, ann_custom_ConnectionMode, type_name_ConnectionMode.to_string()); + CompleteEnumeratedHeader header_ConnectionMode = TypeObjectUtils::build_complete_enumerated_header(common_ConnectionMode, detail_ConnectionMode); + CompleteEnumeratedLiteralSeq literal_seq_ConnectionMode; + { + EnumeratedLiteralFlag flags_DATA_SHARING = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DATA_SHARING = TypeObjectUtils::build_common_enumerated_literal(0, flags_DATA_SHARING); + eprosima::fastcdr::optional member_ann_builtin_DATA_SHARING; + ann_custom_ConnectionMode.reset(); + MemberName name_DATA_SHARING = "DATA_SHARING"; + CompleteMemberDetail detail_DATA_SHARING = TypeObjectUtils::build_complete_member_detail(name_DATA_SHARING, member_ann_builtin_DATA_SHARING, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_DATA_SHARING = TypeObjectUtils::build_complete_enumerated_literal(common_DATA_SHARING, detail_DATA_SHARING); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_DATA_SHARING); + } + { + EnumeratedLiteralFlag flags_INTRAPROCESS = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_INTRAPROCESS = TypeObjectUtils::build_common_enumerated_literal(1, flags_INTRAPROCESS); + eprosima::fastcdr::optional member_ann_builtin_INTRAPROCESS; + ann_custom_ConnectionMode.reset(); + MemberName name_INTRAPROCESS = "INTRAPROCESS"; + CompleteMemberDetail detail_INTRAPROCESS = TypeObjectUtils::build_complete_member_detail(name_INTRAPROCESS, member_ann_builtin_INTRAPROCESS, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_INTRAPROCESS = TypeObjectUtils::build_complete_enumerated_literal(common_INTRAPROCESS, detail_INTRAPROCESS); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_INTRAPROCESS); + } + { + EnumeratedLiteralFlag flags_TRANSPORT = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_TRANSPORT = TypeObjectUtils::build_common_enumerated_literal(2, flags_TRANSPORT); + eprosima::fastcdr::optional member_ann_builtin_TRANSPORT; + ann_custom_ConnectionMode.reset(); + MemberName name_TRANSPORT = "TRANSPORT"; + CompleteMemberDetail detail_TRANSPORT = TypeObjectUtils::build_complete_member_detail(name_TRANSPORT, member_ann_builtin_TRANSPORT, ann_custom_ConnectionMode); + CompleteEnumeratedLiteral literal_TRANSPORT = TypeObjectUtils::build_complete_enumerated_literal(common_TRANSPORT, detail_TRANSPORT); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_ConnectionMode, literal_TRANSPORT); + } + CompleteEnumeratedType enumerated_type_ConnectionMode = TypeObjectUtils::build_complete_enumerated_type(enum_flags_ConnectionMode, header_ConnectionMode, + literal_seq_ConnectionMode); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_ConnectionMode, type_name_ConnectionMode.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::ConnectionMode", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::ConnectionMode: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_mode = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_mode; + MemberId member_id_mode = 0x00000000; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_mode = TypeObjectUtils::build_common_struct_member(member_id_mode, member_flags_mode, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure mode member TypeIdentifier inconsistent."); + return; + } + MemberName name_mode = "mode"; + eprosima::fastcdr::optional member_ann_builtin_mode; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_mode = TypeObjectUtils::build_complete_member_detail(name_mode, member_ann_builtin_mode, ann_custom_Connection); + CompleteStructMember member_mode = TypeObjectUtils::build_complete_struct_member(common_mode, detail_mode); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_mode); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000001; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_Connection); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_guid); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_announced_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_announced_locators; + MemberId member_id_announced_locators = 0x00000002; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_announced_locators = TypeObjectUtils::build_common_struct_member(member_id_announced_locators, member_flags_announced_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure announced_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_announced_locators = "announced_locators"; + eprosima::fastcdr::optional member_ann_builtin_announced_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_announced_locators = TypeObjectUtils::build_complete_member_detail(name_announced_locators, member_ann_builtin_announced_locators, ann_custom_Connection); + CompleteStructMember member_announced_locators = TypeObjectUtils::build_complete_struct_member(common_announced_locators, detail_announced_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_announced_locators); + } + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Connection); + + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = new TypeIdentifier(type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_Connection.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_detail_Locator_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_used_locators = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_used_locators; + MemberId member_id_used_locators = 0x00000003; + if (EK_COMPLETE == type_ids_Connection.type_identifier1()._d() || TK_NONE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier1()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Connection.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Connection.type_identifier2()._d() && + EK_COMPLETE == type_ids_Connection.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Connection.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Connection.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_used_locators = TypeObjectUtils::build_common_struct_member(member_id_used_locators, member_flags_used_locators, type_ids_Connection.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure used_locators member TypeIdentifier inconsistent."); + return; + } + MemberName name_used_locators = "used_locators"; + eprosima::fastcdr::optional member_ann_builtin_used_locators; + ann_custom_Connection.reset(); + CompleteMemberDetail detail_used_locators = TypeObjectUtils::build_complete_member_detail(name_used_locators, member_ann_builtin_used_locators, ann_custom_Connection); + CompleteStructMember member_used_locators = TypeObjectUtils::build_complete_struct_member(common_used_locators, detail_used_locators); + TypeObjectUtils::add_complete_struct_member(member_seq_Connection, member_used_locators); + } + CompleteStructType struct_type_Connection = TypeObjectUtils::build_complete_struct_type(struct_flags_Connection, header_Connection, member_seq_Connection); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Connection, type_name_Connection.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection already registered in TypeObjectRegistry for a different type."); + } + return_code_Connection = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Connection", type_ids_Connection); + if (return_code_Connection != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Connection: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = new TypeIdentifier(type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_Connection_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_connection_list = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_connection_list; + TypeObjectUtils::add_union_case_label(label_seq_connection_list, static_cast(StatusKind::CONNECTION_LIST)); + CommonUnionMember common_connection_list; + MemberId member_id_connection_list = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier1(), + label_seq_connection_list); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_connection_list = TypeObjectUtils::build_common_union_member(member_id_connection_list, member_flags_connection_list, type_ids_MonitorServiceData.type_identifier2(), + label_seq_connection_list); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union connection_list member TypeIdentifier inconsistent."); + return; + } + MemberName name_connection_list = "connection_list"; + eprosima::fastcdr::optional member_ann_builtin_connection_list; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_connection_list = TypeObjectUtils::build_complete_member_detail(name_connection_list, member_ann_builtin_connection_list, ann_custom_MonitorServiceData); + CompleteUnionMember member_connection_list = TypeObjectUtils::build_complete_union_member(common_connection_list, detail_connection_list); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_connection_list); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_IncompatibleQoSStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_IncompatibleQoSStatus_s; + TypeIdentifierPair type_ids_IncompatibleQoSStatus_s; + QualifiedTypeName type_name_IncompatibleQoSStatus_s = "eprosima::fastdds::statistics::IncompatibleQoSStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_IncompatibleQoSStatus_s; + eprosima::fastcdr::optional ann_custom_IncompatibleQoSStatus_s; + CompleteTypeDetail detail_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IncompatibleQoSStatus_s, ann_custom_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string()); + CompleteStructHeader header_IncompatibleQoSStatus_s; + header_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_IncompatibleQoSStatus_s); + CompleteStructMemberSeq member_seq_IncompatibleQoSStatus_s; + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_total_count); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "last_policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_last_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_policy_id; + MemberId member_id_last_policy_id = 0x00000001; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_policy_id = TypeObjectUtils::build_common_struct_member(member_id_last_policy_id, member_flags_last_policy_id, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_policy_id = "last_policy_id"; + eprosima::fastcdr::optional member_ann_builtin_last_policy_id; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_last_policy_id = TypeObjectUtils::build_complete_member_detail(name_last_policy_id, member_ann_builtin_last_policy_id, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_last_policy_id = TypeObjectUtils::build_complete_struct_member(common_last_policy_id, detail_last_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_last_policy_id); + } + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_QosPolicyCountSeq_s = 0; + QualifiedTypeName type_name_QosPolicyCountSeq_s = "eprosima::fastdds::statistics::QosPolicyCountSeq_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCountSeq_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCountSeq_s; + CompleteTypeDetail detail_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string()); + CompleteAliasHeader header_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_header(detail_QosPolicyCountSeq_s); + AliasMemberFlag related_flags_QosPolicyCountSeq_s = 0; + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_IncompatibleQoSStatus_s); + + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_QosPolicyCount_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_QosPolicyCount_s; + TypeIdentifierPair type_ids_QosPolicyCount_s; + QualifiedTypeName type_name_QosPolicyCount_s = "eprosima::fastdds::statistics::QosPolicyCount_s"; + eprosima::fastcdr::optional type_ann_builtin_QosPolicyCount_s; + eprosima::fastcdr::optional ann_custom_QosPolicyCount_s; + CompleteTypeDetail detail_QosPolicyCount_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_QosPolicyCount_s, ann_custom_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string()); + CompleteStructHeader header_QosPolicyCount_s; + header_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_QosPolicyCount_s); + CompleteStructMemberSeq member_seq_QosPolicyCount_s; + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "policy_id Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_policy_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policy_id; + MemberId member_id_policy_id = 0x00000000; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policy_id = TypeObjectUtils::build_common_struct_member(member_id_policy_id, member_flags_policy_id, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policy_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_policy_id = "policy_id"; + eprosima::fastcdr::optional member_ann_builtin_policy_id; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_policy_id = TypeObjectUtils::build_complete_member_detail(name_policy_id, member_ann_builtin_policy_id, ann_custom_QosPolicyCount_s); + CompleteStructMember member_policy_id = TypeObjectUtils::build_complete_struct_member(common_policy_id, detail_policy_id); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_policy_id); + } + { + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_QosPolicyCount_s); + + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1()._d() || TK_NONE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_QosPolicyCount_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_QosPolicyCount_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_QosPolicyCount_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_QosPolicyCount_s.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_QosPolicyCount_s); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_QosPolicyCount_s, member_count); + } + CompleteStructType struct_type_QosPolicyCount_s = TypeObjectUtils::build_complete_struct_type(struct_flags_QosPolicyCount_s, header_QosPolicyCount_s, member_seq_QosPolicyCount_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_QosPolicyCount_s, type_name_QosPolicyCount_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s already registered in TypeObjectRegistry for a different type."); + } + return_code_QosPolicyCount_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCount_s", type_ids_QosPolicyCount_s); + if (return_code_QosPolicyCount_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCount_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = new TypeIdentifier(type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, element_flags_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded); + std::string type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_eprosima_fastdds_statistics_QosPolicyCount_s_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + CommonAliasBody common_QosPolicyCountSeq_s; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_QosPolicyCountSeq_s = TypeObjectUtils::build_common_alias_body(related_flags_QosPolicyCountSeq_s, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_QosPolicyCountSeq_s; + ann_custom_QosPolicyCountSeq_s.reset(); + CompleteAliasBody body_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_body(common_QosPolicyCountSeq_s, member_ann_builtin_QosPolicyCountSeq_s, ann_custom_QosPolicyCountSeq_s); + CompleteAliasType alias_type_QosPolicyCountSeq_s = TypeObjectUtils::build_complete_alias_type(alias_flags_QosPolicyCountSeq_s, header_QosPolicyCountSeq_s, body_QosPolicyCountSeq_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_QosPolicyCountSeq_s, type_name_QosPolicyCountSeq_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::QosPolicyCountSeq_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::QosPolicyCountSeq_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_policies = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_policies; + MemberId member_id_policies = 0x00000002; + if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() || TK_NONE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_IncompatibleQoSStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_IncompatibleQoSStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_policies = TypeObjectUtils::build_common_struct_member(member_id_policies, member_flags_policies, type_ids_IncompatibleQoSStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure policies member TypeIdentifier inconsistent."); + return; + } + MemberName name_policies = "policies"; + eprosima::fastcdr::optional member_ann_builtin_policies; + ann_custom_IncompatibleQoSStatus_s.reset(); + CompleteMemberDetail detail_policies = TypeObjectUtils::build_complete_member_detail(name_policies, member_ann_builtin_policies, ann_custom_IncompatibleQoSStatus_s); + CompleteStructMember member_policies = TypeObjectUtils::build_complete_struct_member(common_policies, detail_policies); + TypeObjectUtils::add_complete_struct_member(member_seq_IncompatibleQoSStatus_s, member_policies); + } + CompleteStructType struct_type_IncompatibleQoSStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_IncompatibleQoSStatus_s, header_IncompatibleQoSStatus_s, member_seq_IncompatibleQoSStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_IncompatibleQoSStatus_s, type_name_IncompatibleQoSStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_IncompatibleQoSStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s", type_ids_IncompatibleQoSStatus_s); + if (return_code_IncompatibleQoSStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::IncompatibleQoSStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_incompatible_qos_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_incompatible_qos_status; + TypeObjectUtils::add_union_case_label(label_seq_incompatible_qos_status, static_cast(StatusKind::INCOMPATIBLE_QOS)); + CommonUnionMember common_incompatible_qos_status; + MemberId member_id_incompatible_qos_status = 0x00000003; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_incompatible_qos_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_incompatible_qos_status = TypeObjectUtils::build_common_union_member(member_id_incompatible_qos_status, member_flags_incompatible_qos_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_incompatible_qos_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union incompatible_qos_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_incompatible_qos_status = "incompatible_qos_status"; + eprosima::fastcdr::optional member_ann_builtin_incompatible_qos_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_incompatible_qos_status = TypeObjectUtils::build_complete_member_detail(name_incompatible_qos_status, member_ann_builtin_incompatible_qos_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_incompatible_qos_status = TypeObjectUtils::build_complete_union_member(common_incompatible_qos_status, detail_incompatible_qos_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_incompatible_qos_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_InconsistentTopicStatus_s = 0; + QualifiedTypeName type_name_InconsistentTopicStatus_s = "eprosima::fastdds::statistics::InconsistentTopicStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_InconsistentTopicStatus_s; + eprosima::fastcdr::optional ann_custom_InconsistentTopicStatus_s; + CompleteTypeDetail detail_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string()); + CompleteAliasHeader header_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_header(detail_InconsistentTopicStatus_s); + AliasMemberFlag related_flags_InconsistentTopicStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_InconsistentTopicStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_InconsistentTopicStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_InconsistentTopicStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_InconsistentTopicStatus_s; + ann_custom_InconsistentTopicStatus_s.reset(); + CompleteAliasBody body_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_body(common_InconsistentTopicStatus_s, member_ann_builtin_InconsistentTopicStatus_s, ann_custom_InconsistentTopicStatus_s); + CompleteAliasType alias_type_InconsistentTopicStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_InconsistentTopicStatus_s, header_InconsistentTopicStatus_s, body_InconsistentTopicStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_InconsistentTopicStatus_s, type_name_InconsistentTopicStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::InconsistentTopicStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::InconsistentTopicStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_inconsistent_topic_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_inconsistent_topic_status; + TypeObjectUtils::add_union_case_label(label_seq_inconsistent_topic_status, static_cast(StatusKind::INCONSISTENT_TOPIC)); + CommonUnionMember common_inconsistent_topic_status; + MemberId member_id_inconsistent_topic_status = 0x00000004; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_inconsistent_topic_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_inconsistent_topic_status = TypeObjectUtils::build_common_union_member(member_id_inconsistent_topic_status, member_flags_inconsistent_topic_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_inconsistent_topic_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union inconsistent_topic_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_inconsistent_topic_status = "inconsistent_topic_status"; + eprosima::fastcdr::optional member_ann_builtin_inconsistent_topic_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_inconsistent_topic_status = TypeObjectUtils::build_complete_member_detail(name_inconsistent_topic_status, member_ann_builtin_inconsistent_topic_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_inconsistent_topic_status = TypeObjectUtils::build_complete_union_member(common_inconsistent_topic_status, detail_inconsistent_topic_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_inconsistent_topic_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_LivelinessLostStatus_s = 0; + QualifiedTypeName type_name_LivelinessLostStatus_s = "eprosima::fastdds::statistics::LivelinessLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessLostStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessLostStatus_s; + CompleteTypeDetail detail_LivelinessLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string()); + CompleteAliasHeader header_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_LivelinessLostStatus_s); + AliasMemberFlag related_flags_LivelinessLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_LivelinessLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_LivelinessLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_LivelinessLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_LivelinessLostStatus_s; + ann_custom_LivelinessLostStatus_s.reset(); + CompleteAliasBody body_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_LivelinessLostStatus_s, member_ann_builtin_LivelinessLostStatus_s, ann_custom_LivelinessLostStatus_s); + CompleteAliasType alias_type_LivelinessLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_LivelinessLostStatus_s, header_LivelinessLostStatus_s, body_LivelinessLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_LivelinessLostStatus_s, type_name_LivelinessLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_liveliness_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_lost_status, static_cast(StatusKind::LIVELINESS_LOST)); + CommonUnionMember common_liveliness_lost_status; + MemberId member_id_liveliness_lost_status = 0x00000005; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_lost_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_lost_status, member_flags_liveliness_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_lost_status = "liveliness_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_lost_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_lost_status, member_ann_builtin_liveliness_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_lost_status = TypeObjectUtils::build_complete_union_member(common_liveliness_lost_status, detail_liveliness_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_LivelinessChangedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_LivelinessChangedStatus_s; + TypeIdentifierPair type_ids_LivelinessChangedStatus_s; + QualifiedTypeName type_name_LivelinessChangedStatus_s = "eprosima::fastdds::statistics::LivelinessChangedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_LivelinessChangedStatus_s; + eprosima::fastcdr::optional ann_custom_LivelinessChangedStatus_s; + CompleteTypeDetail detail_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LivelinessChangedStatus_s, ann_custom_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string()); + CompleteStructHeader header_LivelinessChangedStatus_s; + header_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LivelinessChangedStatus_s); + CompleteStructMemberSeq member_seq_LivelinessChangedStatus_s; + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_alive_count; + MemberId member_id_alive_count = 0x00000000; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_alive_count = TypeObjectUtils::build_common_struct_member(member_id_alive_count, member_flags_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_alive_count = "alive_count"; + eprosima::fastcdr::optional member_ann_builtin_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_alive_count = TypeObjectUtils::build_complete_member_detail(name_alive_count, member_ann_builtin_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_alive_count = TypeObjectUtils::build_complete_struct_member(common_alive_count, detail_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "not_alive_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_not_alive_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_not_alive_count; + MemberId member_id_not_alive_count = 0x00000001; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_not_alive_count = TypeObjectUtils::build_common_struct_member(member_id_not_alive_count, member_flags_not_alive_count, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure not_alive_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_not_alive_count = "not_alive_count"; + eprosima::fastcdr::optional member_ann_builtin_not_alive_count; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_not_alive_count = TypeObjectUtils::build_complete_member_detail(name_not_alive_count, member_ann_builtin_not_alive_count, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_not_alive_count = TypeObjectUtils::build_complete_struct_member(common_not_alive_count, detail_not_alive_count); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_not_alive_count); + } + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_LivelinessChangedStatus_s); + + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_publication_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_publication_handle; + MemberId member_id_last_publication_handle = 0x00000002; + if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LivelinessChangedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LivelinessChangedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_publication_handle = TypeObjectUtils::build_common_struct_member(member_id_last_publication_handle, member_flags_last_publication_handle, type_ids_LivelinessChangedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_publication_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_publication_handle = "last_publication_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_publication_handle; + ann_custom_LivelinessChangedStatus_s.reset(); + CompleteMemberDetail detail_last_publication_handle = TypeObjectUtils::build_complete_member_detail(name_last_publication_handle, member_ann_builtin_last_publication_handle, ann_custom_LivelinessChangedStatus_s); + CompleteStructMember member_last_publication_handle = TypeObjectUtils::build_complete_struct_member(common_last_publication_handle, detail_last_publication_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_LivelinessChangedStatus_s, member_last_publication_handle); + } + CompleteStructType struct_type_LivelinessChangedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_LivelinessChangedStatus_s, header_LivelinessChangedStatus_s, member_seq_LivelinessChangedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LivelinessChangedStatus_s, type_name_LivelinessChangedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_LivelinessChangedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::LivelinessChangedStatus_s", type_ids_LivelinessChangedStatus_s); + if (return_code_LivelinessChangedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::LivelinessChangedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_liveliness_changed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_liveliness_changed_status; + TypeObjectUtils::add_union_case_label(label_seq_liveliness_changed_status, static_cast(StatusKind::LIVELINESS_CHANGED)); + CommonUnionMember common_liveliness_changed_status; + MemberId member_id_liveliness_changed_status = 0x00000006; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_liveliness_changed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_liveliness_changed_status = TypeObjectUtils::build_common_union_member(member_id_liveliness_changed_status, member_flags_liveliness_changed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_liveliness_changed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union liveliness_changed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_liveliness_changed_status = "liveliness_changed_status"; + eprosima::fastcdr::optional member_ann_builtin_liveliness_changed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_liveliness_changed_status = TypeObjectUtils::build_complete_member_detail(name_liveliness_changed_status, member_ann_builtin_liveliness_changed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_liveliness_changed_status = TypeObjectUtils::build_complete_union_member(common_liveliness_changed_status, detail_liveliness_changed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_liveliness_changed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DeadlineMissedStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DeadlineMissedStatus_s; + TypeIdentifierPair type_ids_DeadlineMissedStatus_s; + QualifiedTypeName type_name_DeadlineMissedStatus_s = "eprosima::fastdds::statistics::DeadlineMissedStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_DeadlineMissedStatus_s; + eprosima::fastcdr::optional ann_custom_DeadlineMissedStatus_s; + CompleteTypeDetail detail_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DeadlineMissedStatus_s, ann_custom_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string()); + CompleteStructHeader header_DeadlineMissedStatus_s; + header_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DeadlineMissedStatus_s); + CompleteStructMemberSeq member_seq_DeadlineMissedStatus_s; + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_total_count); + } + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_DeadlineMissedStatus_s); + + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_last_instance_handle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_last_instance_handle; + MemberId member_id_last_instance_handle = 0x00000001; + if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() || TK_NONE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DeadlineMissedStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DeadlineMissedStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_last_instance_handle = TypeObjectUtils::build_common_struct_member(member_id_last_instance_handle, member_flags_last_instance_handle, type_ids_DeadlineMissedStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure last_instance_handle member TypeIdentifier inconsistent."); + return; + } + MemberName name_last_instance_handle = "last_instance_handle"; + eprosima::fastcdr::optional member_ann_builtin_last_instance_handle; + ann_custom_DeadlineMissedStatus_s.reset(); + CompleteMemberDetail detail_last_instance_handle = TypeObjectUtils::build_complete_member_detail(name_last_instance_handle, member_ann_builtin_last_instance_handle, ann_custom_DeadlineMissedStatus_s); + CompleteStructMember member_last_instance_handle = TypeObjectUtils::build_complete_struct_member(common_last_instance_handle, detail_last_instance_handle); + TypeObjectUtils::add_complete_struct_member(member_seq_DeadlineMissedStatus_s, member_last_instance_handle); + } + CompleteStructType struct_type_DeadlineMissedStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_DeadlineMissedStatus_s, header_DeadlineMissedStatus_s, member_seq_DeadlineMissedStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DeadlineMissedStatus_s, type_name_DeadlineMissedStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_DeadlineMissedStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DeadlineMissedStatus_s", type_ids_DeadlineMissedStatus_s); + if (return_code_DeadlineMissedStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DeadlineMissedStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_deadline_missed_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_deadline_missed_status; + TypeObjectUtils::add_union_case_label(label_seq_deadline_missed_status, static_cast(StatusKind::DEADLINE_MISSED)); + CommonUnionMember common_deadline_missed_status; + MemberId member_id_deadline_missed_status = 0x00000007; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_deadline_missed_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadline_missed_status = TypeObjectUtils::build_common_union_member(member_id_deadline_missed_status, member_flags_deadline_missed_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_deadline_missed_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union deadline_missed_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadline_missed_status = "deadline_missed_status"; + eprosima::fastcdr::optional member_ann_builtin_deadline_missed_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_deadline_missed_status = TypeObjectUtils::build_complete_member_detail(name_deadline_missed_status, member_ann_builtin_deadline_missed_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_deadline_missed_status = TypeObjectUtils::build_complete_union_member(common_deadline_missed_status, detail_deadline_missed_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_deadline_missed_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + AliasTypeFlag alias_flags_SampleLostStatus_s = 0; + QualifiedTypeName type_name_SampleLostStatus_s = "eprosima::fastdds::statistics::SampleLostStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleLostStatus_s; + eprosima::fastcdr::optional ann_custom_SampleLostStatus_s; + CompleteTypeDetail detail_SampleLostStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string()); + CompleteAliasHeader header_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_header(detail_SampleLostStatus_s); + AliasMemberFlag related_flags_SampleLostStatus_s = 0; + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_BaseStatus_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_BaseStatus_s; + TypeIdentifierPair type_ids_BaseStatus_s; + QualifiedTypeName type_name_BaseStatus_s = "eprosima::fastdds::statistics::BaseStatus_s"; + eprosima::fastcdr::optional type_ann_builtin_BaseStatus_s; + eprosima::fastcdr::optional ann_custom_BaseStatus_s; + CompleteTypeDetail detail_BaseStatus_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BaseStatus_s, ann_custom_BaseStatus_s, type_name_BaseStatus_s.to_string()); + CompleteStructHeader header_BaseStatus_s; + header_BaseStatus_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BaseStatus_s); + CompleteStructMemberSeq member_seq_BaseStatus_s; + { + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_BaseStatus_s); + + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "total_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_total_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_total_count; + MemberId member_id_total_count = 0x00000000; + if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1()._d() || TK_NONE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_BaseStatus_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_BaseStatus_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_total_count = TypeObjectUtils::build_common_struct_member(member_id_total_count, member_flags_total_count, type_ids_BaseStatus_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure total_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_total_count = "total_count"; + eprosima::fastcdr::optional member_ann_builtin_total_count; + ann_custom_BaseStatus_s.reset(); + CompleteMemberDetail detail_total_count = TypeObjectUtils::build_complete_member_detail(name_total_count, member_ann_builtin_total_count, ann_custom_BaseStatus_s); + CompleteStructMember member_total_count = TypeObjectUtils::build_complete_struct_member(common_total_count, detail_total_count); + TypeObjectUtils::add_complete_struct_member(member_seq_BaseStatus_s, member_total_count); + } + CompleteStructType struct_type_BaseStatus_s = TypeObjectUtils::build_complete_struct_type(struct_flags_BaseStatus_s, header_BaseStatus_s, member_seq_BaseStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BaseStatus_s, type_name_BaseStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_BaseStatus_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::BaseStatus_s", type_ids_BaseStatus_s); + if (return_code_BaseStatus_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::BaseStatus_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + CommonAliasBody common_SampleLostStatus_s; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_SampleLostStatus_s = TypeObjectUtils::build_common_alias_body(related_flags_SampleLostStatus_s, type_ids_MonitorServiceData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s related TypeIdentifier inconsistent."); + return; + } + eprosima::fastcdr::optional member_ann_builtin_SampleLostStatus_s; + ann_custom_SampleLostStatus_s.reset(); + CompleteAliasBody body_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_body(common_SampleLostStatus_s, member_ann_builtin_SampleLostStatus_s, ann_custom_SampleLostStatus_s); + CompleteAliasType alias_type_SampleLostStatus_s = TypeObjectUtils::build_complete_alias_type(alias_flags_SampleLostStatus_s, header_SampleLostStatus_s, body_SampleLostStatus_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_alias_type_object(alias_type_SampleLostStatus_s, type_name_SampleLostStatus_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleLostStatus_s", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleLostStatus_s: Given Alias TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + UnionMemberFlag member_flags_sample_lost_status = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_lost_status; + TypeObjectUtils::add_union_case_label(label_seq_sample_lost_status, static_cast(StatusKind::SAMPLE_LOST)); + CommonUnionMember common_sample_lost_status; + MemberId member_id_sample_lost_status = 0x00000008; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier1(), + label_seq_sample_lost_status); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_lost_status = TypeObjectUtils::build_common_union_member(member_id_sample_lost_status, member_flags_sample_lost_status, type_ids_MonitorServiceData.type_identifier2(), + label_seq_sample_lost_status); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_lost_status member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_lost_status = "sample_lost_status"; + eprosima::fastcdr::optional member_ann_builtin_sample_lost_status; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_sample_lost_status = TypeObjectUtils::build_complete_member_detail(name_sample_lost_status, member_ann_builtin_sample_lost_status, ann_custom_MonitorServiceData); + CompleteUnionMember member_sample_lost_status = TypeObjectUtils::build_complete_union_member(common_sample_lost_status, detail_sample_lost_status); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_sample_lost_status); + } + { + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_MonitorServiceData); + + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "statuses_size Union member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + UnionMemberFlag member_flags_statuses_size = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_statuses_size; + TypeObjectUtils::add_union_case_label(label_seq_statuses_size, static_cast(StatusKind::STATUSES_SIZE)); + CommonUnionMember common_statuses_size; + MemberId member_id_statuses_size = 0x00000009; + if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier1(), + label_seq_statuses_size); + } + else if (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_statuses_size = TypeObjectUtils::build_common_union_member(member_id_statuses_size, member_flags_statuses_size, type_ids_MonitorServiceData.type_identifier2(), + label_seq_statuses_size); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union statuses_size member TypeIdentifier inconsistent."); + return; + } + MemberName name_statuses_size = "statuses_size"; + eprosima::fastcdr::optional member_ann_builtin_statuses_size; + ann_custom_MonitorServiceData.reset(); + CompleteMemberDetail detail_statuses_size = TypeObjectUtils::build_complete_member_detail(name_statuses_size, member_ann_builtin_statuses_size, ann_custom_MonitorServiceData); + CompleteUnionMember member_statuses_size = TypeObjectUtils::build_complete_union_member(common_statuses_size, detail_statuses_size); + TypeObjectUtils::add_complete_union_member(member_seq_MonitorServiceData, member_statuses_size); + } + CompleteUnionType union_type_MonitorServiceData = TypeObjectUtils::build_complete_union_type(union_flags_MonitorServiceData, header_MonitorServiceData, discriminator_MonitorServiceData, + member_seq_MonitorServiceData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_MonitorServiceData, type_name_MonitorServiceData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceData", type_ids_MonitorServiceData); + if (return_code_MonitorServiceData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceData: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000002; + if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1()._d() || TK_NONE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_MonitorServiceStatusData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_MonitorServiceStatusData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_MonitorServiceStatusData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_MonitorServiceStatusData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_MonitorServiceStatusData.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_MonitorServiceStatusData); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_MonitorServiceStatusData, member_value); + } + CompleteStructType struct_type_MonitorServiceStatusData = TypeObjectUtils::build_complete_struct_type(struct_flags_MonitorServiceStatusData, header_MonitorServiceStatusData, member_seq_MonitorServiceStatusData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_MonitorServiceStatusData, type_name_MonitorServiceStatusData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceStatusData already registered in TypeObjectRegistry for a different type."); + } + return_code_MonitorServiceStatusData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::MonitorServiceStatusData", type_ids_MonitorServiceStatusData); + if (return_code_MonitorServiceStatusData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::MonitorServiceStatusData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + diff --git a/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.hpp b/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.hpp new file mode 100644 index 00000000000..7aa680576f0 --- /dev/null +++ b/test/blackbox/types/statistics/monitorservice_typesTypeObjectSupport.hpp @@ -0,0 +1,127 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file monitorservice_typesTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ + +#include "typesTypeObjectSupport.hpp" + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_monitorservice_types_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace eprosima { +namespace fastdds { +namespace statistics { +/** + * @brief Register eprosima_fastdds_statistics_Connection related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Connection_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_QosPolicyCount_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_QosPolicyCount_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_BaseStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_BaseStatus_s_type_identifier(); + + +/** + * @brief Register eprosima_fastdds_statistics_IncompatibleQoSStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_IncompatibleQoSStatus_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_LivelinessChangedStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_LivelinessChangedStatus_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_DeadlineMissedStatus_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_DeadlineMissedStatus_s_type_identifier(); + + + + +namespace StatusKind { +} // namespace StatusKind + +/** + * @brief Register eprosima_fastdds_statistics_MonitorServiceData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_MonitorServiceData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_MonitorServiceStatusData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_MonitorServiceStatusData_type_identifier(); + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_MONITORSERVICE_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/statistics/types.cxx b/test/blackbox/types/statistics/types.cxx deleted file mode 100644 index 9dcb86ef67b..00000000000 --- a/test/blackbox/types/statistics/types.cxx +++ /dev/null @@ -1,3211 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -EntityId_s::EntityId_s() -{ -} - -EntityId_s::~EntityId_s() -{ -} - -EntityId_s::EntityId_s( - const EntityId_s& x) -{ - m_value = x.m_value; -} - -EntityId_s::EntityId_s( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); -} - -EntityId_s& EntityId_s::operator =( - const EntityId_s& x) -{ - - m_value = x.m_value; - return *this; -} - -EntityId_s& EntityId_s::operator =( - EntityId_s&& x) noexcept -{ - - m_value = std::move(x.m_value); - return *this; -} - -bool EntityId_s::operator ==( - const EntityId_s& x) const -{ - return (m_value == x.m_value); -} - -bool EntityId_s::operator !=( - const EntityId_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void EntityId_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void EntityId_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& EntityId_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& EntityId_s::value() -{ - return m_value; -} - - - - -GuidPrefix_s::GuidPrefix_s() -{ -} - -GuidPrefix_s::~GuidPrefix_s() -{ -} - -GuidPrefix_s::GuidPrefix_s( - const GuidPrefix_s& x) -{ - m_value = x.m_value; -} - -GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); -} - -GuidPrefix_s& GuidPrefix_s::operator =( - const GuidPrefix_s& x) -{ - - m_value = x.m_value; - return *this; -} - -GuidPrefix_s& GuidPrefix_s::operator =( - GuidPrefix_s&& x) noexcept -{ - - m_value = std::move(x.m_value); - return *this; -} - -bool GuidPrefix_s::operator ==( - const GuidPrefix_s& x) const -{ - return (m_value == x.m_value); -} - -bool GuidPrefix_s::operator !=( - const GuidPrefix_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void GuidPrefix_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void GuidPrefix_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& GuidPrefix_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& GuidPrefix_s::value() -{ - return m_value; -} - - - - -GUID_s::GUID_s() -{ -} - -GUID_s::~GUID_s() -{ -} - -GUID_s::GUID_s( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - m_entityId = x.m_entityId; -} - -GUID_s::GUID_s( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - m_entityId = std::move(x.m_entityId); -} - -GUID_s& GUID_s::operator =( - const GUID_s& x) -{ - - m_guidPrefix = x.m_guidPrefix; - m_entityId = x.m_entityId; - return *this; -} - -GUID_s& GUID_s::operator =( - GUID_s&& x) noexcept -{ - - m_guidPrefix = std::move(x.m_guidPrefix); - m_entityId = std::move(x.m_entityId); - return *this; -} - -bool GUID_s::operator ==( - const GUID_s& x) const -{ - return (m_guidPrefix == x.m_guidPrefix && - m_entityId == x.m_entityId); -} - -bool GUID_s::operator !=( - const GUID_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ -void GUID_s::guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) -{ - m_guidPrefix = _guidPrefix; -} - -/*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ -void GUID_s::guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) -{ - m_guidPrefix = std::move(_guidPrefix); -} - -/*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const -{ - return m_guidPrefix; -} - -/*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() -{ - return m_guidPrefix; -} - - -/*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ -void GUID_s::entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) -{ - m_entityId = _entityId; -} - -/*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ -void GUID_s::entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) -{ - m_entityId = std::move(_entityId); -} - -/*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ -const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const -{ - return m_entityId; -} - -/*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ -eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() -{ - return m_entityId; -} - - - - -SequenceNumber_s::SequenceNumber_s() -{ -} - -SequenceNumber_s::~SequenceNumber_s() -{ -} - -SequenceNumber_s::SequenceNumber_s( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - m_low = x.m_low; -} - -SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - m_low = x.m_low; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - const SequenceNumber_s& x) -{ - - m_high = x.m_high; - m_low = x.m_low; - return *this; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - SequenceNumber_s&& x) noexcept -{ - - m_high = x.m_high; - m_low = x.m_low; - return *this; -} - -bool SequenceNumber_s::operator ==( - const SequenceNumber_s& x) const -{ - return (m_high == x.m_high && - m_low == x.m_low); -} - -bool SequenceNumber_s::operator !=( - const SequenceNumber_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ -void SequenceNumber_s::high( - int32_t _high) -{ - m_high = _high; -} - -/*! - * @brief This function returns the value of member high - * @return Value of member high - */ -int32_t SequenceNumber_s::high() const -{ - return m_high; -} - -/*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ -int32_t& SequenceNumber_s::high() -{ - return m_high; -} - - -/*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ -void SequenceNumber_s::low( - uint32_t _low) -{ - m_low = _low; -} - -/*! - * @brief This function returns the value of member low - * @return Value of member low - */ -uint32_t SequenceNumber_s::low() const -{ - return m_low; -} - -/*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ -uint32_t& SequenceNumber_s::low() -{ - return m_low; -} - - - - -SampleIdentity_s::SampleIdentity_s() -{ -} - -SampleIdentity_s::~SampleIdentity_s() -{ -} - -SampleIdentity_s::SampleIdentity_s( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - m_sequence_number = x.m_sequence_number; -} - -SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - m_sequence_number = std::move(x.m_sequence_number); -} - -SampleIdentity_s& SampleIdentity_s::operator =( - const SampleIdentity_s& x) -{ - - m_writer_guid = x.m_writer_guid; - m_sequence_number = x.m_sequence_number; - return *this; -} - -SampleIdentity_s& SampleIdentity_s::operator =( - SampleIdentity_s&& x) noexcept -{ - - m_writer_guid = std::move(x.m_writer_guid); - m_sequence_number = std::move(x.m_sequence_number); - return *this; -} - -bool SampleIdentity_s::operator ==( - const SampleIdentity_s& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_sequence_number == x.m_sequence_number); -} - -bool SampleIdentity_s::operator !=( - const SampleIdentity_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void SampleIdentity_s::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void SampleIdentity_s::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ -void SampleIdentity_s::sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) -{ - m_sequence_number = _sequence_number; -} - -/*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ -void SampleIdentity_s::sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) -{ - m_sequence_number = std::move(_sequence_number); -} - -/*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const -{ - return m_sequence_number; -} - -/*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() -{ - return m_sequence_number; -} - - - - -Locator_s::Locator_s() -{ -} - -Locator_s::~Locator_s() -{ -} - -Locator_s::Locator_s( - const Locator_s& x) -{ - m_kind = x.m_kind; - m_port = x.m_port; - m_address = x.m_address; -} - -Locator_s::Locator_s( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - m_port = x.m_port; - m_address = std::move(x.m_address); -} - -Locator_s& Locator_s::operator =( - const Locator_s& x) -{ - - m_kind = x.m_kind; - m_port = x.m_port; - m_address = x.m_address; - return *this; -} - -Locator_s& Locator_s::operator =( - Locator_s&& x) noexcept -{ - - m_kind = x.m_kind; - m_port = x.m_port; - m_address = std::move(x.m_address); - return *this; -} - -bool Locator_s::operator ==( - const Locator_s& x) const -{ - return (m_kind == x.m_kind && - m_port == x.m_port && - m_address == x.m_address); -} - -bool Locator_s::operator !=( - const Locator_s& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ -void Locator_s::kind( - int32_t _kind) -{ - m_kind = _kind; -} - -/*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ -int32_t Locator_s::kind() const -{ - return m_kind; -} - -/*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ -int32_t& Locator_s::kind() -{ - return m_kind; -} - - -/*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ -void Locator_s::port( - uint32_t _port) -{ - m_port = _port; -} - -/*! - * @brief This function returns the value of member port - * @return Value of member port - */ -uint32_t Locator_s::port() const -{ - return m_port; -} - -/*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ -uint32_t& Locator_s::port() -{ - return m_port; -} - - -/*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ -void Locator_s::address( - const std::array& _address) -{ - m_address = _address; -} - -/*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ -void Locator_s::address( - std::array&& _address) -{ - m_address = std::move(_address); -} - -/*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ -const std::array& Locator_s::address() const -{ - return m_address; -} - -/*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ -std::array& Locator_s::address() -{ - return m_address; -} - - - - -} // namespace detail - - -DiscoveryTime::DiscoveryTime() -{ -} - -DiscoveryTime::~DiscoveryTime() -{ -} - -DiscoveryTime::DiscoveryTime( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - m_remote_entity_guid = x.m_remote_entity_guid; - m_time = x.m_time; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; -} - -DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - m_time = x.m_time; - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); -} - -DiscoveryTime& DiscoveryTime::operator =( - const DiscoveryTime& x) -{ - - m_local_participant_guid = x.m_local_participant_guid; - m_remote_entity_guid = x.m_remote_entity_guid; - m_time = x.m_time; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; - return *this; -} - -DiscoveryTime& DiscoveryTime::operator =( - DiscoveryTime&& x) noexcept -{ - - m_local_participant_guid = std::move(x.m_local_participant_guid); - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - m_time = x.m_time; - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); - return *this; -} - -bool DiscoveryTime::operator ==( - const DiscoveryTime& x) const -{ - return (m_local_participant_guid == x.m_local_participant_guid && - m_remote_entity_guid == x.m_remote_entity_guid && - m_time == x.m_time && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool DiscoveryTime::operator !=( - const DiscoveryTime& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) -{ - m_local_participant_guid = _local_participant_guid; -} - -/*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) -{ - m_local_participant_guid = std::move(_local_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const -{ - return m_local_participant_guid; -} - -/*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() -{ - return m_local_participant_guid; -} - - -/*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) -{ - m_remote_entity_guid = _remote_entity_guid; -} - -/*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) -{ - m_remote_entity_guid = std::move(_remote_entity_guid); -} - -/*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const -{ - return m_remote_entity_guid; -} - -/*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() -{ - return m_remote_entity_guid; -} - - -/*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ -void DiscoveryTime::time( - uint64_t _time) -{ - m_time = _time; -} - -/*! - * @brief This function returns the value of member time - * @return Value of member time - */ -uint64_t DiscoveryTime::time() const -{ - return m_time; -} - -/*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ -uint64_t& DiscoveryTime::time() -{ - return m_time; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void DiscoveryTime::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void DiscoveryTime::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& DiscoveryTime::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& DiscoveryTime::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void DiscoveryTime::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void DiscoveryTime::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& DiscoveryTime::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& DiscoveryTime::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void DiscoveryTime::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void DiscoveryTime::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& DiscoveryTime::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& DiscoveryTime::process() -{ - return m_process; -} - - - - -EntityCount::EntityCount() -{ -} - -EntityCount::~EntityCount() -{ -} - -EntityCount::EntityCount( - const EntityCount& x) -{ - m_guid = x.m_guid; - m_count = x.m_count; -} - -EntityCount::EntityCount( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - m_count = x.m_count; -} - -EntityCount& EntityCount::operator =( - const EntityCount& x) -{ - - m_guid = x.m_guid; - m_count = x.m_count; - return *this; -} - -EntityCount& EntityCount::operator =( - EntityCount&& x) noexcept -{ - - m_guid = std::move(x.m_guid); - m_count = x.m_count; - return *this; -} - -bool EntityCount::operator ==( - const EntityCount& x) const -{ - return (m_guid == x.m_guid && - m_count == x.m_count); -} - -bool EntityCount::operator !=( - const EntityCount& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityCount::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityCount::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void EntityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t EntityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& EntityCount::count() -{ - return m_count; -} - - - - -SampleIdentityCount::SampleIdentityCount() -{ -} - -SampleIdentityCount::~SampleIdentityCount() -{ -} - -SampleIdentityCount::SampleIdentityCount( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - m_count = x.m_count; -} - -SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - m_count = x.m_count; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - const SampleIdentityCount& x) -{ - - m_sample_id = x.m_sample_id; - m_count = x.m_count; - return *this; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - SampleIdentityCount&& x) noexcept -{ - - m_sample_id = std::move(x.m_sample_id); - m_count = x.m_count; - return *this; -} - -bool SampleIdentityCount::operator ==( - const SampleIdentityCount& x) const -{ - return (m_sample_id == x.m_sample_id && - m_count == x.m_count); -} - -bool SampleIdentityCount::operator !=( - const SampleIdentityCount& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ -void SampleIdentityCount::sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) -{ - m_sample_id = _sample_id; -} - -/*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ -void SampleIdentityCount::sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) -{ - m_sample_id = std::move(_sample_id); -} - -/*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const -{ - return m_sample_id; -} - -/*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() -{ - return m_sample_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void SampleIdentityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t SampleIdentityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& SampleIdentityCount::count() -{ - return m_count; -} - - - - -Entity2LocatorTraffic::Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::~Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - m_dst_locator = x.m_dst_locator; - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - m_dst_locator = std::move(x.m_dst_locator); - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - const Entity2LocatorTraffic& x) -{ - - m_src_guid = x.m_src_guid; - m_dst_locator = x.m_dst_locator; - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - Entity2LocatorTraffic&& x) noexcept -{ - - m_src_guid = std::move(x.m_src_guid); - m_dst_locator = std::move(x.m_dst_locator); - m_packet_count = x.m_packet_count; - m_byte_count = x.m_byte_count; - m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; -} - -bool Entity2LocatorTraffic::operator ==( - const Entity2LocatorTraffic& x) const -{ - return (m_src_guid == x.m_src_guid && - m_dst_locator == x.m_dst_locator && - m_packet_count == x.m_packet_count && - m_byte_count == x.m_byte_count && - m_byte_magnitude_order == x.m_byte_magnitude_order); -} - -bool Entity2LocatorTraffic::operator !=( - const Entity2LocatorTraffic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) -{ - m_src_guid = _src_guid; -} - -/*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) -{ - m_src_guid = std::move(_src_guid); -} - -/*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const -{ - return m_src_guid; -} - -/*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() -{ - return m_src_guid; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ -void Entity2LocatorTraffic::packet_count( - uint64_t _packet_count) -{ - m_packet_count = _packet_count; -} - -/*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ -uint64_t Entity2LocatorTraffic::packet_count() const -{ - return m_packet_count; -} - -/*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ -uint64_t& Entity2LocatorTraffic::packet_count() -{ - return m_packet_count; -} - - -/*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ -void Entity2LocatorTraffic::byte_count( - uint64_t _byte_count) -{ - m_byte_count = _byte_count; -} - -/*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ -uint64_t Entity2LocatorTraffic::byte_count() const -{ - return m_byte_count; -} - -/*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ -uint64_t& Entity2LocatorTraffic::byte_count() -{ - return m_byte_count; -} - - -/*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ -void Entity2LocatorTraffic::byte_magnitude_order( - int16_t _byte_magnitude_order) -{ - m_byte_magnitude_order = _byte_magnitude_order; -} - -/*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ -int16_t Entity2LocatorTraffic::byte_magnitude_order() const -{ - return m_byte_magnitude_order; -} - -/*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ -int16_t& Entity2LocatorTraffic::byte_magnitude_order() -{ - return m_byte_magnitude_order; -} - - - - -WriterReaderData::WriterReaderData() -{ -} - -WriterReaderData::~WriterReaderData() -{ -} - -WriterReaderData::WriterReaderData( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - m_reader_guid = x.m_reader_guid; - m_data = x.m_data; -} - -WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - m_reader_guid = std::move(x.m_reader_guid); - m_data = x.m_data; -} - -WriterReaderData& WriterReaderData::operator =( - const WriterReaderData& x) -{ - - m_writer_guid = x.m_writer_guid; - m_reader_guid = x.m_reader_guid; - m_data = x.m_data; - return *this; -} - -WriterReaderData& WriterReaderData::operator =( - WriterReaderData&& x) noexcept -{ - - m_writer_guid = std::move(x.m_writer_guid); - m_reader_guid = std::move(x.m_reader_guid); - m_data = x.m_data; - return *this; -} - -bool WriterReaderData::operator ==( - const WriterReaderData& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_reader_guid == x.m_reader_guid && - m_data == x.m_data); -} - -bool WriterReaderData::operator !=( - const WriterReaderData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void WriterReaderData::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void WriterReaderData::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ -void WriterReaderData::reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) -{ - m_reader_guid = _reader_guid; -} - -/*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ -void WriterReaderData::reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) -{ - m_reader_guid = std::move(_reader_guid); -} - -/*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const -{ - return m_reader_guid; -} - -/*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() -{ - return m_reader_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void WriterReaderData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float WriterReaderData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& WriterReaderData::data() -{ - return m_data; -} - - - - -Locator2LocatorData::Locator2LocatorData() -{ -} - -Locator2LocatorData::~Locator2LocatorData() -{ -} - -Locator2LocatorData::Locator2LocatorData( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - m_dst_locator = x.m_dst_locator; - m_data = x.m_data; -} - -Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - m_dst_locator = std::move(x.m_dst_locator); - m_data = x.m_data; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - const Locator2LocatorData& x) -{ - - m_src_locator = x.m_src_locator; - m_dst_locator = x.m_dst_locator; - m_data = x.m_data; - return *this; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - Locator2LocatorData&& x) noexcept -{ - - m_src_locator = std::move(x.m_src_locator); - m_dst_locator = std::move(x.m_dst_locator); - m_data = x.m_data; - return *this; -} - -bool Locator2LocatorData::operator ==( - const Locator2LocatorData& x) const -{ - return (m_src_locator == x.m_src_locator && - m_dst_locator == x.m_dst_locator && - m_data == x.m_data); -} - -bool Locator2LocatorData::operator !=( - const Locator2LocatorData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ -void Locator2LocatorData::src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) -{ - m_src_locator = _src_locator; -} - -/*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ -void Locator2LocatorData::src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) -{ - m_src_locator = std::move(_src_locator); -} - -/*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const -{ - return m_src_locator; -} - -/*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() -{ - return m_src_locator; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Locator2LocatorData::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Locator2LocatorData::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void Locator2LocatorData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float Locator2LocatorData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& Locator2LocatorData::data() -{ - return m_data; -} - - - - -EntityData::EntityData() -{ -} - -EntityData::~EntityData() -{ -} - -EntityData::EntityData( - const EntityData& x) -{ - m_guid = x.m_guid; - m_data = x.m_data; -} - -EntityData::EntityData( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - m_data = x.m_data; -} - -EntityData& EntityData::operator =( - const EntityData& x) -{ - - m_guid = x.m_guid; - m_data = x.m_data; - return *this; -} - -EntityData& EntityData::operator =( - EntityData&& x) noexcept -{ - - m_guid = std::move(x.m_guid); - m_data = x.m_data; - return *this; -} - -bool EntityData::operator ==( - const EntityData& x) const -{ - return (m_guid == x.m_guid && - m_data == x.m_data); -} - -bool EntityData::operator !=( - const EntityData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityData::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityData::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void EntityData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float EntityData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& EntityData::data() -{ - return m_data; -} - - - - -PhysicalData::PhysicalData() -{ -} - -PhysicalData::~PhysicalData() -{ -} - -PhysicalData::PhysicalData( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; -} - -PhysicalData::PhysicalData( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); -} - -PhysicalData& PhysicalData::operator =( - const PhysicalData& x) -{ - - m_participant_guid = x.m_participant_guid; - m_host = x.m_host; - m_user = x.m_user; - m_process = x.m_process; - return *this; -} - -PhysicalData& PhysicalData::operator =( - PhysicalData&& x) noexcept -{ - - m_participant_guid = std::move(x.m_participant_guid); - m_host = std::move(x.m_host); - m_user = std::move(x.m_user); - m_process = std::move(x.m_process); - return *this; -} - -bool PhysicalData::operator ==( - const PhysicalData& x) const -{ - return (m_participant_guid == x.m_participant_guid && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool PhysicalData::operator !=( - const PhysicalData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ -void PhysicalData::participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) -{ - m_participant_guid = _participant_guid; -} - -/*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ -void PhysicalData::participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) -{ - m_participant_guid = std::move(_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const -{ - return m_participant_guid; -} - -/*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() -{ - return m_participant_guid; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void PhysicalData::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void PhysicalData::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& PhysicalData::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& PhysicalData::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void PhysicalData::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void PhysicalData::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& PhysicalData::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& PhysicalData::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void PhysicalData::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void PhysicalData::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& PhysicalData::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& PhysicalData::process() -{ - return m_process; -} - - - - - -Data::Data() -{ - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; -} - -Data::~Data() -{ -} - -Data::Data( - const Data& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } -} - -Data::Data( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } -} - -Data& Data::operator =( - const Data& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } - - return *this; -} - -Data& Data::operator =( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } - - return *this; -} - -bool Data::operator ==( - const Data& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - return (m_writer_reader_data == x.m_writer_reader_data); - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - return (m_locator2locator_data == x.m_locator2locator_data); - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - return (m_entity_data == x.m_entity_data); - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - return (m_entity2locator_traffic == x.m_entity2locator_traffic); - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - return (m_entity_count == x.m_entity_count); - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - return (m_discovery_time == x.m_discovery_time); - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - return (m_sample_identity_count == x.m_sample_identity_count); - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - return (m_physical_data == x.m_physical_data); - break; - - default: - break; - } - return false; -} - -bool Data::operator !=( - const Data& x) const -{ - return !(*this == x); -} - -void Data::_d( - eprosima::fastdds::statistics::EventKind __d) -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - switch (__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - switch (__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - switch (__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - switch (__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - switch (__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - switch (__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - switch (__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - switch (__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::EventKind Data::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::EventKind& Data::_d() -{ - return m__d; -} - -void Data::writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) -{ - m_writer_reader_data = _writer_reader_data; - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -void Data::writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) -{ - m_writer_reader_data = std::move(_writer_reader_data); - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - -eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - - -void Data::locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) -{ - m_locator2locator_data = _locator2locator_data; - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -void Data::locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) -{ - m_locator2locator_data = std::move(_locator2locator_data); - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - -eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - - -void Data::entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data) -{ - m_entity_data = _entity_data; - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -void Data::entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data) -{ - m_entity_data = std::move(_entity_data); - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -const eprosima::fastdds::statistics::EntityData& Data::entity_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - -eprosima::fastdds::statistics::EntityData& Data::entity_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - - -void Data::entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) -{ - m_entity2locator_traffic = _entity2locator_traffic; - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -void Data::entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) -{ - m_entity2locator_traffic = std::move(_entity2locator_traffic); - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - -eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - - -void Data::entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count) -{ - m_entity_count = _entity_count; - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -void Data::entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count) -{ - m_entity_count = std::move(_entity_count); - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - -eprosima::fastdds::statistics::EntityCount& Data::entity_count() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - - -void Data::discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) -{ - m_discovery_time = _discovery_time; - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -void Data::discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) -{ - m_discovery_time = std::move(_discovery_time); - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - -eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - - -void Data::sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) -{ - m_sample_identity_count = _sample_identity_count; - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -void Data::sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) -{ - m_sample_identity_count = std::move(_sample_identity_count); - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - -eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - - -void Data::physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data) -{ - m_physical_data = _physical_data; - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -void Data::physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data) -{ - m_physical_data = std::move(_physical_data); - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - -eprosima::fastdds::statistics::PhysicalData& Data::physical_data() -{ - bool b = false; - - switch (m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima -// Include auxiliary functions like for serializing/deserializing. -#include "typesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/types.h b/test/blackbox/types/statistics/types.h deleted file mode 100644 index c51a79f2044..00000000000 --- a/test/blackbox/types/statistics/types.h +++ /dev/null @@ -1,2331 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -/*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ -class EntityId_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - -private: - - std::array m_value{0}; - -}; - - -/*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ -class GuidPrefix_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - -private: - - std::array m_value{0}; - -}; - - -/*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ -class GUID_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - -private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - -}; - - -/*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ -class SequenceNumber_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - -private: - - int32_t m_high{0}; - uint32_t m_low{0}; - -}; - - -/*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ -class SampleIdentity_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - -}; - - -/*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ -class Locator_s -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - -private: - - int32_t m_kind{0}; - uint32_t m_port{0}; - std::array m_address{0}; - -}; - -} // namespace detail - - -/*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ -class DiscoveryTime -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time{0}; - std::string m_host; - std::string m_user; - std::string m_process; - -}; - - -/*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ -class EntityCount -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count{0}; - -}; - - -/*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ -class SampleIdentityCount -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - -private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count{0}; - -}; - - -/*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ -class Entity2LocatorTraffic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count{0}; - uint64_t m_byte_count{0}; - int16_t m_byte_magnitude_order{0}; - -}; - - -/*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ -class WriterReaderData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ -class Locator2LocatorData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ -class EntityData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data{0.0}; - -}; - - -/*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ -class PhysicalData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - -private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - -}; -/*! - * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. - * @ingroup types - */ -enum EventKindBits : uint32_t -{ - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 -}; -typedef uint32_t EventKind; - - -/*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ -class Data -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - -private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; -}; - -} // namespace statistics - -} // namespace fastdds - -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/types.hpp b/test/blackbox/types/statistics/types.hpp new file mode 100644 index 00000000000..308a3dae3d7 --- /dev/null +++ b/test/blackbox/types/statistics/types.hpp @@ -0,0 +1,3930 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file types.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ + +#include +#include +#include +#include +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + +/*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ +class EntityId_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ +class GuidPrefix_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x) + { + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept + { + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x) + { + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept + { + + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const + { + return (m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value() + { + return m_value; + } + + + +private: + + std::array m_value{0}; + +}; +/*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ +class GUID_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x) + { + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept + { + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x) + { + + m_guidPrefix = x.m_guidPrefix; + + m_entityId = x.m_entityId; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept + { + + m_guidPrefix = std::move(x.m_guidPrefix); + m_entityId = std::move(x.m_entityId); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const + { + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); + } + + /*! + * @brief Comparison operator. + * @param x GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const GuidPrefix_s& _guidPrefix) + { + m_guidPrefix = _guidPrefix; + } + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + GuidPrefix_s&& _guidPrefix) + { + m_guidPrefix = std::move(_guidPrefix); + } + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const GuidPrefix_s& guidPrefix() const + { + return m_guidPrefix; + } + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport GuidPrefix_s& guidPrefix() + { + return m_guidPrefix; + } + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const EntityId_s& _entityId) + { + m_entityId = _entityId; + } + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + EntityId_s&& _entityId) + { + m_entityId = std::move(_entityId); + } + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const EntityId_s& entityId() const + { + return m_entityId; + } + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport EntityId_s& entityId() + { + return m_entityId; + } + + + +private: + + GuidPrefix_s m_guidPrefix; + EntityId_s m_entityId; + +}; +/*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ +class SequenceNumber_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x) + { + m_high = x.m_high; + + m_low = x.m_low; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept + { + m_high = x.m_high; + m_low = x.m_low; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x) + { + + m_high = x.m_high; + + m_low = x.m_low; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept + { + + m_high = x.m_high; + m_low = x.m_low; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const + { + return (m_high == x.m_high && + m_low == x.m_low); + } + + /*! + * @brief Comparison operator. + * @param x SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high) + { + m_high = _high; + } + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const + { + return m_high; + } + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high() + { + return m_high; + } + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low) + { + m_low = _low; + } + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const + { + return m_low; + } + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low() + { + return m_low; + } + + + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; +/*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentity_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x) + { + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept + { + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x) + { + + m_writer_guid = x.m_writer_guid; + + m_sequence_number = x.m_sequence_number; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept + { + + m_writer_guid = std::move(x.m_writer_guid); + m_sequence_number = std::move(x.m_sequence_number); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const + { + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const GUID_s& _writer_guid) + { + m_writer_guid = _writer_guid; + } + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + GUID_s&& _writer_guid) + { + m_writer_guid = std::move(_writer_guid); + } + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const GUID_s& writer_guid() const + { + return m_writer_guid; + } + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport GUID_s& writer_guid() + { + return m_writer_guid; + } + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const SequenceNumber_s& _sequence_number) + { + m_sequence_number = _sequence_number; + } + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + SequenceNumber_s&& _sequence_number) + { + m_sequence_number = std::move(_sequence_number); + } + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const SequenceNumber_s& sequence_number() const + { + return m_sequence_number; + } + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport SequenceNumber_s& sequence_number() + { + return m_sequence_number; + } + + + +private: + + GUID_s m_writer_guid; + SequenceNumber_s m_sequence_number; + +}; +/*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ +class Locator_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x) + { + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept + { + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x) + { + + m_kind = x.m_kind; + + m_port = x.m_port; + + m_address = x.m_address; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept + { + + m_kind = x.m_kind; + m_port = x.m_port; + m_address = std::move(x.m_address); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const + { + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); + } + + /*! + * @brief Comparison operator. + * @param x Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind) + { + m_kind = _kind; + } + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const + { + return m_kind; + } + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind() + { + return m_kind; + } + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port) + { + m_port = _port; + } + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const + { + return m_port; + } + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port() + { + return m_port; + } + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address) + { + m_address = _address; + } + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address) + { + m_address = std::move(_address); + } + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const + { + return m_address; + } + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address() + { + return m_address; + } + + + +private: + + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; + +}; + +} // namespace detail +/*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ +class DiscoveryTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x) + { + m_local_participant_guid = x.m_local_participant_guid; + + m_remote_entity_guid = x.m_remote_entity_guid; + + m_time = x.m_time; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept + { + m_local_participant_guid = std::move(x.m_local_participant_guid); + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + m_time = x.m_time; + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x) + { + + m_local_participant_guid = x.m_local_participant_guid; + + m_remote_entity_guid = x.m_remote_entity_guid; + + m_time = x.m_time; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept + { + + m_local_participant_guid = std::move(x.m_local_participant_guid); + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + m_time = x.m_time; + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const + { + return (m_local_participant_guid == x.m_local_participant_guid && + m_remote_entity_guid == x.m_remote_entity_guid && + m_time == x.m_time && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); + } + + /*! + * @brief Comparison operator. + * @param x DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const detail::GUID_s& _local_participant_guid) + { + m_local_participant_guid = _local_participant_guid; + } + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + detail::GUID_s&& _local_participant_guid) + { + m_local_participant_guid = std::move(_local_participant_guid); + } + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const detail::GUID_s& local_participant_guid() const + { + return m_local_participant_guid; + } + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport detail::GUID_s& local_participant_guid() + { + return m_local_participant_guid; + } + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const detail::GUID_s& _remote_entity_guid) + { + m_remote_entity_guid = _remote_entity_guid; + } + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + detail::GUID_s&& _remote_entity_guid) + { + m_remote_entity_guid = std::move(_remote_entity_guid); + } + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const detail::GUID_s& remote_entity_guid() const + { + return m_remote_entity_guid; + } + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport detail::GUID_s& remote_entity_guid() + { + return m_remote_entity_guid; + } + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time) + { + m_time = _time; + } + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const + { + return m_time; + } + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time() + { + return m_time; + } + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host) + { + m_host = _host; + } + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host) + { + m_host = std::move(_host); + } + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const + { + return m_host; + } + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host() + { + return m_host; + } + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user) + { + m_user = _user; + } + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user) + { + m_user = std::move(_user); + } + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const + { + return m_user; + } + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user() + { + return m_user; + } + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process) + { + m_process = _process; + } + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process) + { + m_process = std::move(_process); + } + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const + { + return m_process; + } + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process() + { + return m_process; + } + + + +private: + + detail::GUID_s m_local_participant_guid; + detail::GUID_s m_remote_entity_guid; + uint64_t m_time{0}; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +/*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ +class EntityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x) + { + m_guid = x.m_guid; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept + { + m_guid = std::move(x.m_guid); + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x) + { + + m_guid = x.m_guid; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept + { + + m_guid = std::move(x.m_guid); + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const + { + return (m_guid == x.m_guid && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count() + { + return m_count; + } + + + +private: + + detail::GUID_s m_guid; + uint64_t m_count{0}; + +}; +/*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x) + { + m_sample_id = x.m_sample_id; + + m_count = x.m_count; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept + { + m_sample_id = std::move(x.m_sample_id); + m_count = x.m_count; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x) + { + + m_sample_id = x.m_sample_id; + + m_count = x.m_count; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept + { + + m_sample_id = std::move(x.m_sample_id); + m_count = x.m_count; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const + { + return (m_sample_id == x.m_sample_id && + m_count == x.m_count); + } + + /*! + * @brief Comparison operator. + * @param x SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const detail::SampleIdentity_s& _sample_id) + { + m_sample_id = _sample_id; + } + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + detail::SampleIdentity_s&& _sample_id) + { + m_sample_id = std::move(_sample_id); + } + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const detail::SampleIdentity_s& sample_id() const + { + return m_sample_id; + } + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport detail::SampleIdentity_s& sample_id() + { + return m_sample_id; + } + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count) + { + m_count = _count; + } + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const + { + return m_count; + } + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count() + { + return m_count; + } + + + +private: + + detail::SampleIdentity_s m_sample_id; + uint64_t m_count{0}; + +}; +/*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ +class Entity2LocatorTraffic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x) + { + m_src_guid = x.m_src_guid; + + m_dst_locator = x.m_dst_locator; + + m_packet_count = x.m_packet_count; + + m_byte_count = x.m_byte_count; + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept + { + m_src_guid = std::move(x.m_src_guid); + m_dst_locator = std::move(x.m_dst_locator); + m_packet_count = x.m_packet_count; + m_byte_count = x.m_byte_count; + m_byte_magnitude_order = x.m_byte_magnitude_order; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x) + { + + m_src_guid = x.m_src_guid; + + m_dst_locator = x.m_dst_locator; + + m_packet_count = x.m_packet_count; + + m_byte_count = x.m_byte_count; + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept + { + + m_src_guid = std::move(x.m_src_guid); + m_dst_locator = std::move(x.m_dst_locator); + m_packet_count = x.m_packet_count; + m_byte_count = x.m_byte_count; + m_byte_magnitude_order = x.m_byte_magnitude_order; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const + { + return (m_src_guid == x.m_src_guid && + m_dst_locator == x.m_dst_locator && + m_packet_count == x.m_packet_count && + m_byte_count == x.m_byte_count && + m_byte_magnitude_order == x.m_byte_magnitude_order); + } + + /*! + * @brief Comparison operator. + * @param x Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const detail::GUID_s& _src_guid) + { + m_src_guid = _src_guid; + } + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + detail::GUID_s&& _src_guid) + { + m_src_guid = std::move(_src_guid); + } + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const detail::GUID_s& src_guid() const + { + return m_src_guid; + } + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport detail::GUID_s& src_guid() + { + return m_src_guid; + } + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const detail::Locator_s& _dst_locator) + { + m_dst_locator = _dst_locator; + } + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + detail::Locator_s&& _dst_locator) + { + m_dst_locator = std::move(_dst_locator); + } + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const detail::Locator_s& dst_locator() const + { + return m_dst_locator; + } + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport detail::Locator_s& dst_locator() + { + return m_dst_locator; + } + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count) + { + m_packet_count = _packet_count; + } + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const + { + return m_packet_count; + } + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count() + { + return m_packet_count; + } + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count) + { + m_byte_count = _byte_count; + } + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const + { + return m_byte_count; + } + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count() + { + return m_byte_count; + } + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order) + { + m_byte_magnitude_order = _byte_magnitude_order; + } + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const + { + return m_byte_magnitude_order; + } + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order() + { + return m_byte_magnitude_order; + } + + + +private: + + detail::GUID_s m_src_guid; + detail::Locator_s m_dst_locator; + uint64_t m_packet_count{0}; + uint64_t m_byte_count{0}; + int16_t m_byte_magnitude_order{0}; + +}; +/*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ +class WriterReaderData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x) + { + m_writer_guid = x.m_writer_guid; + + m_reader_guid = x.m_reader_guid; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept + { + m_writer_guid = std::move(x.m_writer_guid); + m_reader_guid = std::move(x.m_reader_guid); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x) + { + + m_writer_guid = x.m_writer_guid; + + m_reader_guid = x.m_reader_guid; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept + { + + m_writer_guid = std::move(x.m_writer_guid); + m_reader_guid = std::move(x.m_reader_guid); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const + { + return (m_writer_guid == x.m_writer_guid && + m_reader_guid == x.m_reader_guid && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const detail::GUID_s& _writer_guid) + { + m_writer_guid = _writer_guid; + } + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + detail::GUID_s&& _writer_guid) + { + m_writer_guid = std::move(_writer_guid); + } + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const detail::GUID_s& writer_guid() const + { + return m_writer_guid; + } + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport detail::GUID_s& writer_guid() + { + return m_writer_guid; + } + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const detail::GUID_s& _reader_guid) + { + m_reader_guid = _reader_guid; + } + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + detail::GUID_s&& _reader_guid) + { + m_reader_guid = std::move(_reader_guid); + } + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const detail::GUID_s& reader_guid() const + { + return m_reader_guid; + } + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport detail::GUID_s& reader_guid() + { + return m_reader_guid; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::GUID_s m_writer_guid; + detail::GUID_s m_reader_guid; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ +class Locator2LocatorData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x) + { + m_src_locator = x.m_src_locator; + + m_dst_locator = x.m_dst_locator; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept + { + m_src_locator = std::move(x.m_src_locator); + m_dst_locator = std::move(x.m_dst_locator); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x) + { + + m_src_locator = x.m_src_locator; + + m_dst_locator = x.m_dst_locator; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept + { + + m_src_locator = std::move(x.m_src_locator); + m_dst_locator = std::move(x.m_dst_locator); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const + { + return (m_src_locator == x.m_src_locator && + m_dst_locator == x.m_dst_locator && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const detail::Locator_s& _src_locator) + { + m_src_locator = _src_locator; + } + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + detail::Locator_s&& _src_locator) + { + m_src_locator = std::move(_src_locator); + } + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const detail::Locator_s& src_locator() const + { + return m_src_locator; + } + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport detail::Locator_s& src_locator() + { + return m_src_locator; + } + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const detail::Locator_s& _dst_locator) + { + m_dst_locator = _dst_locator; + } + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + detail::Locator_s&& _dst_locator) + { + m_dst_locator = std::move(_dst_locator); + } + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const detail::Locator_s& dst_locator() const + { + return m_dst_locator; + } + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport detail::Locator_s& dst_locator() + { + return m_dst_locator; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::Locator_s m_src_locator; + detail::Locator_s m_dst_locator; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ +class EntityData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x) + { + m_guid = x.m_guid; + + m_data = x.m_data; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept + { + m_guid = std::move(x.m_guid); + m_data = x.m_data; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x) + { + + m_guid = x.m_guid; + + m_data = x.m_data; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept + { + + m_guid = std::move(x.m_guid); + m_data = x.m_data; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const + { + return (m_guid == x.m_guid && + m_data == x.m_data); + } + + /*! + * @brief Comparison operator. + * @param x EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const detail::GUID_s& _guid) + { + m_guid = _guid; + } + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + detail::GUID_s&& _guid) + { + m_guid = std::move(_guid); + } + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const detail::GUID_s& guid() const + { + return m_guid; + } + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport detail::GUID_s& guid() + { + return m_guid; + } + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data) + { + m_data = _data; + } + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const + { + return m_data; + } + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data() + { + return m_data; + } + + + +private: + + detail::GUID_s m_guid; + float m_data{0.0}; + +}; +/*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ +class PhysicalData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x) + { + m_participant_guid = x.m_participant_guid; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept + { + m_participant_guid = std::move(x.m_participant_guid); + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x) + { + + m_participant_guid = x.m_participant_guid; + + m_host = x.m_host; + + m_user = x.m_user; + + m_process = x.m_process; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept + { + + m_participant_guid = std::move(x.m_participant_guid); + m_host = std::move(x.m_host); + m_user = std::move(x.m_user); + m_process = std::move(x.m_process); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const + { + return (m_participant_guid == x.m_participant_guid && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); + } + + /*! + * @brief Comparison operator. + * @param x PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const detail::GUID_s& _participant_guid) + { + m_participant_guid = _participant_guid; + } + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + detail::GUID_s&& _participant_guid) + { + m_participant_guid = std::move(_participant_guid); + } + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const detail::GUID_s& participant_guid() const + { + return m_participant_guid; + } + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport detail::GUID_s& participant_guid() + { + return m_participant_guid; + } + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host) + { + m_host = _host; + } + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host) + { + m_host = std::move(_host); + } + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const + { + return m_host; + } + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host() + { + return m_host; + } + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user) + { + m_user = _user; + } + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user) + { + m_user = std::move(_user); + } + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const + { + return m_user; + } + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user() + { + return m_user; + } + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process) + { + m_process = _process; + } + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process) + { + m_process = std::move(_process); + } + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const + { + return m_process; + } + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process() + { + return m_process; + } + + + +private: + + detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +namespace EventKind { + +const uint32_t HISTORY2HISTORY_LATENCY = 0x1; +const uint32_t NETWORK_LATENCY = 0x2; +const uint32_t PUBLICATION_THROUGHPUT = 0x4; +const uint32_t SUBSCRIPTION_THROUGHPUT = 0x8; +const uint32_t RTPS_SENT = 0x10; +const uint32_t RTPS_LOST = 0x20; +const uint32_t RESENT_DATAS = 0x40; +const uint32_t HEARTBEAT_COUNT = 0x80; +const uint32_t ACKNACK_COUNT = 0x100; +const uint32_t NACKFRAG_COUNT = 0x200; +const uint32_t GAP_COUNT = 0x400; +const uint32_t DATA_COUNT = 0x800; +const uint32_t PDP_PACKETS = 0x1000; +const uint32_t EDP_PACKETS = 0x2000; +const uint32_t DISCOVERED_ENTITY = 0x4000; +const uint32_t SAMPLE_DATAS = 0x8000; +const uint32_t PHYSICAL_DATA = 0x10000; + +} // namespace EventKind +/*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ +class Data +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = x.m_writer_reader_data; + break; + + case 0x00000002: + locator2locator_data_() = x.m_locator2locator_data; + break; + + case 0x00000003: + entity_data_() = x.m_entity_data; + break; + + case 0x00000004: + entity2locator_traffic_() = x.m_entity2locator_traffic; + break; + + case 0x00000005: + entity_count_() = x.m_entity_count; + break; + + case 0x00000006: + discovery_time_() = x.m_discovery_time; + break; + + case 0x00000007: + sample_identity_count_() = x.m_sample_identity_count; + break; + + case 0x00000008: + physical_data_() = x.m_physical_data; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = std::move(x.m_writer_reader_data); + break; + + case 0x00000002: + locator2locator_data_() = std::move(x.m_locator2locator_data); + break; + + case 0x00000003: + entity_data_() = std::move(x.m_entity_data); + break; + + case 0x00000004: + entity2locator_traffic_() = std::move(x.m_entity2locator_traffic); + break; + + case 0x00000005: + entity_count_() = std::move(x.m_entity_count); + break; + + case 0x00000006: + discovery_time_() = std::move(x.m_discovery_time); + break; + + case 0x00000007: + sample_identity_count_() = std::move(x.m_sample_identity_count); + break; + + case 0x00000008: + physical_data_() = std::move(x.m_physical_data); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = x.m_writer_reader_data; + break; + + case 0x00000002: + locator2locator_data_() = x.m_locator2locator_data; + break; + + case 0x00000003: + entity_data_() = x.m_entity_data; + break; + + case 0x00000004: + entity2locator_traffic_() = x.m_entity2locator_traffic; + break; + + case 0x00000005: + entity_count_() = x.m_entity_count; + break; + + case 0x00000006: + discovery_time_() = x.m_discovery_time; + break; + + case 0x00000007: + sample_identity_count_() = x.m_sample_identity_count; + break; + + case 0x00000008: + physical_data_() = x.m_physical_data; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + writer_reader_data_() = std::move(x.m_writer_reader_data); + break; + + case 0x00000002: + locator2locator_data_() = std::move(x.m_locator2locator_data); + break; + + case 0x00000003: + entity_data_() = std::move(x.m_entity_data); + break; + + case 0x00000004: + entity2locator_traffic_() = std::move(x.m_entity2locator_traffic); + break; + + case 0x00000005: + entity_count_() = std::move(x.m_entity_count); + break; + + case 0x00000006: + discovery_time_() = std::move(x.m_discovery_time); + break; + + case 0x00000007: + sample_identity_count_() = std::move(x.m_sample_identity_count); + break; + + case 0x00000008: + physical_data_() = std::move(x.m_physical_data); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_writer_reader_data == x.m_writer_reader_data); + break; + + case 0x00000002: + ret_value = (m_locator2locator_data == x.m_locator2locator_data); + break; + + case 0x00000003: + ret_value = (m_entity_data == x.m_entity_data); + break; + + case 0x00000004: + ret_value = (m_entity2locator_traffic == x.m_entity2locator_traffic); + break; + + case 0x00000005: + ret_value = (m_entity_count == x.m_entity_count); + break; + + case 0x00000006: + ret_value = (m_discovery_time == x.m_discovery_time); + break; + + case 0x00000007: + ret_value = (m_sample_identity_count == x.m_sample_identity_count); + break; + + case 0x00000008: + ret_value = (m_physical_data == x.m_physical_data); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint32_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EventKind::HISTORY2HISTORY_LATENCY: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::NETWORK_LATENCY: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::DISCOVERED_ENTITY: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::SAMPLE_DATAS: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EventKind::PHYSICAL_DATA: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint32_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const WriterReaderData& _writer_reader_data) + { + writer_reader_data_() = _writer_reader_data; + m__d = EventKind::HISTORY2HISTORY_LATENCY; + } + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + WriterReaderData&& _writer_reader_data) + { + writer_reader_data_() = _writer_reader_data; + m__d = EventKind::HISTORY2HISTORY_LATENCY; + } + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const WriterReaderData& writer_reader_data() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; + } + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport WriterReaderData& writer_reader_data() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; + } + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const Locator2LocatorData& _locator2locator_data) + { + locator2locator_data_() = _locator2locator_data; + m__d = EventKind::NETWORK_LATENCY; + } + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + Locator2LocatorData&& _locator2locator_data) + { + locator2locator_data_() = _locator2locator_data; + m__d = EventKind::NETWORK_LATENCY; + } + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const Locator2LocatorData& locator2locator_data() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; + } + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport Locator2LocatorData& locator2locator_data() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; + } + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const EntityData& _entity_data) + { + entity_data_() = _entity_data; + m__d = EventKind::PUBLICATION_THROUGHPUT; + } + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + EntityData&& _entity_data) + { + entity_data_() = _entity_data; + m__d = EventKind::PUBLICATION_THROUGHPUT; + } + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EntityData& entity_data() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_data; + } + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EntityData& entity_data() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_data; + } + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const Entity2LocatorTraffic& _entity2locator_traffic) + { + entity2locator_traffic_() = _entity2locator_traffic; + m__d = EventKind::RTPS_SENT; + } + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + Entity2LocatorTraffic&& _entity2locator_traffic) + { + entity2locator_traffic_() = _entity2locator_traffic; + m__d = EventKind::RTPS_SENT; + } + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const Entity2LocatorTraffic& entity2locator_traffic() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; + } + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport Entity2LocatorTraffic& entity2locator_traffic() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; + } + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const EntityCount& _entity_count) + { + entity_count_() = _entity_count; + m__d = EventKind::RESENT_DATAS; + } + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + EntityCount&& _entity_count) + { + entity_count_() = _entity_count; + m__d = EventKind::RESENT_DATAS; + } + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EntityCount& entity_count() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_count; + } + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EntityCount& entity_count() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_entity_count; + } + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const DiscoveryTime& _discovery_time) + { + discovery_time_() = _discovery_time; + m__d = EventKind::DISCOVERED_ENTITY; + } + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + DiscoveryTime&& _discovery_time) + { + discovery_time_() = _discovery_time; + m__d = EventKind::DISCOVERED_ENTITY; + } + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const DiscoveryTime& discovery_time() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_discovery_time; + } + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport DiscoveryTime& discovery_time() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_discovery_time; + } + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const SampleIdentityCount& _sample_identity_count) + { + sample_identity_count_() = _sample_identity_count; + m__d = EventKind::SAMPLE_DATAS; + } + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + SampleIdentityCount&& _sample_identity_count) + { + sample_identity_count_() = _sample_identity_count; + m__d = EventKind::SAMPLE_DATAS; + } + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SampleIdentityCount& sample_identity_count() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; + } + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SampleIdentityCount& sample_identity_count() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; + } + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const PhysicalData& _physical_data) + { + physical_data_() = _physical_data; + m__d = EventKind::PHYSICAL_DATA; + } + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + PhysicalData&& _physical_data) + { + physical_data_() = _physical_data; + m__d = EventKind::PHYSICAL_DATA; + } + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PhysicalData& physical_data() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_physical_data; + } + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PhysicalData& physical_data() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_physical_data; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + WriterReaderData& writer_reader_data_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_writer_reader_data.~WriterReaderData();}; + new(&m_writer_reader_data) WriterReaderData(); + ; + } + + return m_writer_reader_data; + } + + Locator2LocatorData& locator2locator_data_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_locator2locator_data.~Locator2LocatorData();}; + new(&m_locator2locator_data) Locator2LocatorData(); + ; + } + + return m_locator2locator_data; + } + + EntityData& entity_data_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_entity_data.~EntityData();}; + new(&m_entity_data) EntityData(); + ; + } + + return m_entity_data; + } + + Entity2LocatorTraffic& entity2locator_traffic_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_entity2locator_traffic.~Entity2LocatorTraffic();}; + new(&m_entity2locator_traffic) Entity2LocatorTraffic(); + ; + } + + return m_entity2locator_traffic; + } + + EntityCount& entity_count_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_entity_count.~EntityCount();}; + new(&m_entity_count) EntityCount(); + ; + } + + return m_entity_count; + } + + DiscoveryTime& discovery_time_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_discovery_time.~DiscoveryTime();}; + new(&m_discovery_time) DiscoveryTime(); + ; + } + + return m_discovery_time; + } + + SampleIdentityCount& sample_identity_count_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_sample_identity_count.~SampleIdentityCount();}; + new(&m_sample_identity_count) SampleIdentityCount(); + ; + } + + return m_sample_identity_count; + } + + PhysicalData& physical_data_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_physical_data.~PhysicalData();}; + new(&m_physical_data) PhysicalData(); + ; + } + + return m_physical_data; + } + + + uint32_t m__d {1}; + + union + { + WriterReaderData m_writer_reader_data; + Locator2LocatorData m_locator2locator_data; + EntityData m_entity_data; + Entity2LocatorTraffic m_entity2locator_traffic; + EntityCount m_entity_count; + DiscoveryTime m_discovery_time; + SampleIdentityCount m_sample_identity_count; + PhysicalData m_physical_data; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_HPP_ + + diff --git a/test/blackbox/types/statistics/typesCdrAux.hpp b/test/blackbox/types/statistics/typesCdrAux.hpp index 92b36ffa689..d331c557176 100644 --- a/test/blackbox/types/statistics/typesCdrAux.hpp +++ b/test/blackbox/types/statistics/typesCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ -#include "types.h" +#include "types.hpp" constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize {852UL}; constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize {56UL}; @@ -30,7 +30,6 @@ constexpr uint32_t eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesiz constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize {812UL}; constexpr uint32_t eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize {28UL}; - constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize {28UL}; constexpr uint32_t eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize {0UL}; @@ -75,87 +74,58 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data); - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data); @@ -163,12 +133,6 @@ eProsima_user_DllExport void serialize_key( - - - - - - } // namespace fastcdr } // namespace eprosima diff --git a/test/blackbox/types/statistics/typesCdrAux.ipp b/test/blackbox/types/statistics/typesCdrAux.ipp index 28b168d672d..b8d5a1d7f81 100644 --- a/test/blackbox/types/statistics/typesCdrAux.ipp +++ b/test/blackbox/types/statistics/typesCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -120,8 +118,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -206,8 +202,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -300,8 +294,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -394,8 +386,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -488,8 +478,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -590,9 +578,6 @@ void serialize_key( } - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -725,8 +710,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -822,8 +805,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -919,8 +900,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1044,8 +1023,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1151,8 +1128,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1258,8 +1233,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1355,8 +1328,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1471,8 +1442,6 @@ void serialize_key( - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1495,51 +1464,51 @@ eProsima_user_DllExport size_t calculate_serialized_size( switch (data._d()) { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), data.writer_reader_data(), current_alignment); break; - case eprosima::fastdds::statistics::NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), data.locator2locator_data(), current_alignment); break; - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), data.entity_data(), current_alignment); break; - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), data.entity2locator_traffic(), current_alignment); break; - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), data.entity_count(), current_alignment); break; - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), data.discovery_time(), current_alignment); break; - case eprosima::fastdds::statistics::SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), data.sample_identity_count(), current_alignment); break; - case eprosima::fastdds::statistics::PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), data.physical_data(), current_alignment); break; @@ -1571,44 +1540,44 @@ eProsima_user_DllExport void serialize( switch (data._d()) { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: scdr << eprosima::fastcdr::MemberId(1) << data.writer_reader_data(); break; - case eprosima::fastdds::statistics::NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: scdr << eprosima::fastcdr::MemberId(2) << data.locator2locator_data(); break; - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: scdr << eprosima::fastcdr::MemberId(3) << data.entity_data(); break; - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: scdr << eprosima::fastcdr::MemberId(4) << data.entity2locator_traffic(); break; - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: scdr << eprosima::fastcdr::MemberId(5) << data.entity_count(); break; - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: scdr << eprosima::fastcdr::MemberId(6) << data.discovery_time(); break; - case eprosima::fastdds::statistics::SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: scdr << eprosima::fastcdr::MemberId(7) << data.sample_identity_count(); break; - case eprosima::fastdds::statistics::PHYSICAL_DATA: + case EventKind::PHYSICAL_DATA: scdr << eprosima::fastcdr::MemberId(8) << data.physical_data(); break; @@ -1632,69 +1601,146 @@ eProsima_user_DllExport void deserialize( [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool { bool ret_value = true; - switch (mid.id) + if (0 == mid.id) { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - dcdr >> data.writer_reader_data(); - break; - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - dcdr >> data.locator2locator_data(); - break; - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - dcdr >> data.entity_data(); - break; - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - dcdr >> data.entity2locator_traffic(); - break; - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - dcdr >> data.entity_count(); - break; - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - dcdr >> data.discovery_time(); - break; - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - dcdr >> data.sample_identity_count(); - break; - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - dcdr >> data.physical_data(); - break; - - default: - break; - } - ret_value = false; - break; + uint32_t discriminator; + dcdr >> discriminator; + + switch (discriminator) + { + case EventKind::HISTORY2HISTORY_LATENCY: + { + eprosima::fastdds::statistics::WriterReaderData writer_reader_data_value; + data.writer_reader_data(std::move(writer_reader_data_value)); + data._d(discriminator); + break; + } + + case EventKind::NETWORK_LATENCY: + { + eprosima::fastdds::statistics::Locator2LocatorData locator2locator_data_value; + data.locator2locator_data(std::move(locator2locator_data_value)); + data._d(discriminator); + break; + } + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + { + eprosima::fastdds::statistics::EntityData entity_data_value; + data.entity_data(std::move(entity_data_value)); + data._d(discriminator); + break; + } + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + { + eprosima::fastdds::statistics::Entity2LocatorTraffic entity2locator_traffic_value; + data.entity2locator_traffic(std::move(entity2locator_traffic_value)); + data._d(discriminator); + break; + } + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + { + eprosima::fastdds::statistics::EntityCount entity_count_value; + data.entity_count(std::move(entity_count_value)); + data._d(discriminator); + break; + } + + case EventKind::DISCOVERED_ENTITY: + { + eprosima::fastdds::statistics::DiscoveryTime discovery_time_value; + data.discovery_time(std::move(discovery_time_value)); + data._d(discriminator); + break; + } + + case EventKind::SAMPLE_DATAS: + { + eprosima::fastdds::statistics::SampleIdentityCount sample_identity_count_value; + data.sample_identity_count(std::move(sample_identity_count_value)); + data._d(discriminator); + break; + } + + case EventKind::PHYSICAL_DATA: + { + eprosima::fastdds::statistics::PhysicalData physical_data_value; + data.physical_data(std::move(physical_data_value)); + data._d(discriminator); + break; + } + + default: + data._default(); + break; + } + } + else + { + switch (data._d()) + { + case EventKind::HISTORY2HISTORY_LATENCY: + dcdr >> data.writer_reader_data(); + break; + + case EventKind::NETWORK_LATENCY: + dcdr >> data.locator2locator_data(); + break; + + case EventKind::PUBLICATION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: + dcdr >> data.entity_data(); + break; + + case EventKind::RTPS_SENT: + case EventKind::RTPS_LOST: + dcdr >> data.entity2locator_traffic(); + break; + + case EventKind::RESENT_DATAS: + case EventKind::HEARTBEAT_COUNT: + case EventKind::ACKNACK_COUNT: + case EventKind::NACKFRAG_COUNT: + case EventKind::GAP_COUNT: + case EventKind::DATA_COUNT: + case EventKind::PDP_PACKETS: + case EventKind::EDP_PACKETS: + dcdr >> data.entity_count(); + break; + + case EventKind::DISCOVERED_ENTITY: + dcdr >> data.discovery_time(); + break; + + case EventKind::SAMPLE_DATAS: + dcdr >> data.sample_identity_count(); + break; + + case EventKind::PHYSICAL_DATA: + dcdr >> data.physical_data(); + break; + + default: + break; + } + ret_value = false; } return ret_value; }); } - - - } // namespace fastcdr } // namespace eprosima diff --git a/test/blackbox/types/statistics/typesPubSubTypes.cxx b/test/blackbox/types/statistics/typesPubSubTypes.cxx index 5d92b732491..582e4152f52 100644 --- a/test/blackbox/types/statistics/typesPubSubTypes.cxx +++ b/test/blackbox/types/statistics/typesPubSubTypes.cxx @@ -19,11 +19,13 @@ * This file was generated by the tool fastddsgen. */ +#include "typesPubSubTypes.h" +#include #include -#include "typesPubSubTypes.h" #include "typesCdrAux.hpp" +#include "typesTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -33,8 +35,6 @@ namespace eprosima { namespace fastdds { namespace statistics { namespace detail { - - EntityId_sPubSubType::EntityId_sPubSubType() { setName("eprosima::fastdds::statistics::detail::EntityId_s"); @@ -223,7 +223,10 @@ namespace eprosima { return true; } - + void EntityId_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } GuidPrefix_sPubSubType::GuidPrefix_sPubSubType() { @@ -413,7 +416,10 @@ namespace eprosima { return true; } - + void GuidPrefix_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } GUID_sPubSubType::GUID_sPubSubType() { @@ -603,7 +609,10 @@ namespace eprosima { return true; } - + void GUID_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SequenceNumber_sPubSubType::SequenceNumber_sPubSubType() { @@ -793,7 +802,10 @@ namespace eprosima { return true; } - + void SequenceNumber_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SampleIdentity_sPubSubType::SampleIdentity_sPubSubType() { @@ -983,7 +995,10 @@ namespace eprosima { return true; } - + void SampleIdentity_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Locator_sPubSubType::Locator_sPubSubType() { @@ -1173,10 +1188,12 @@ namespace eprosima { return true; } + void Locator_sPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } - } //End of namespace detail - - + } // namespace detail DiscoveryTimePubSubType::DiscoveryTimePubSubType() { @@ -1366,7 +1383,10 @@ namespace eprosima { return true; } - + void DiscoveryTimePubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } EntityCountPubSubType::EntityCountPubSubType() { @@ -1556,7 +1576,10 @@ namespace eprosima { return true; } - + void EntityCountPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } SampleIdentityCountPubSubType::SampleIdentityCountPubSubType() { @@ -1746,7 +1769,10 @@ namespace eprosima { return true; } - + void SampleIdentityCountPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Entity2LocatorTrafficPubSubType::Entity2LocatorTrafficPubSubType() { @@ -1936,7 +1962,10 @@ namespace eprosima { return true; } - + void Entity2LocatorTrafficPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } WriterReaderDataPubSubType::WriterReaderDataPubSubType() { @@ -2126,7 +2155,10 @@ namespace eprosima { return true; } - + void WriterReaderDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } Locator2LocatorDataPubSubType::Locator2LocatorDataPubSubType() { @@ -2316,7 +2348,10 @@ namespace eprosima { return true; } - + void Locator2LocatorDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } EntityDataPubSubType::EntityDataPubSubType() { @@ -2506,7 +2541,10 @@ namespace eprosima { return true; } - + void EntityDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } PhysicalDataPubSubType::PhysicalDataPubSubType() { @@ -2696,17 +2734,21 @@ namespace eprosima { return true; } + void PhysicalDataPubSubType::register_type_object_representation() const + { + register_types_type_objects(); + } + namespace EventKind { + } // namespace EventKind + } // namespace statistics + } // namespace fastdds +} // namespace eprosima - } //End of namespace statistics - - - } //End of namespace fastdds - - -} //End of namespace eprosima +// Include auxiliary functions like for serializing/deserializing. +#include "typesCdrAux.ipp" diff --git a/test/blackbox/types/statistics/typesPubSubTypes.h b/test/blackbox/types/statistics/typesPubSubTypes.h index 33e545416c8..a235ad9169c 100644 --- a/test/blackbox/types/statistics/typesPubSubTypes.h +++ b/test/blackbox/types/statistics/typesPubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "types.h" +#include "types.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -46,8 +46,6 @@ namespace eprosima namespace detail { - - /*! * @brief This class represents the TopicDataType of the type EntityId_s defined by the user in the IDL file. * @ingroup types @@ -98,6 +96,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -136,8 +137,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type GuidPrefix_s defined by the user in the IDL file. * @ingroup types @@ -188,6 +187,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -226,8 +228,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type GUID_s defined by the user in the IDL file. * @ingroup types @@ -278,6 +278,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -316,8 +319,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SequenceNumber_s defined by the user in the IDL file. * @ingroup types @@ -368,6 +369,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -406,8 +410,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SampleIdentity_s defined by the user in the IDL file. * @ingroup types @@ -458,6 +460,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -496,8 +501,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Locator_s defined by the user in the IDL file. * @ingroup types @@ -548,6 +551,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -585,9 +591,7 @@ namespace eprosima unsigned char* m_keyBuffer; }; - } - - + } // namespace detail /*! * @brief This class represents the TopicDataType of the type DiscoveryTime defined by the user in the IDL file. @@ -639,6 +643,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -677,8 +684,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type EntityCount defined by the user in the IDL file. * @ingroup types @@ -729,6 +734,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -767,8 +775,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type SampleIdentityCount defined by the user in the IDL file. * @ingroup types @@ -819,6 +825,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -857,8 +866,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Entity2LocatorTraffic defined by the user in the IDL file. * @ingroup types @@ -909,6 +916,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -947,8 +957,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type WriterReaderData defined by the user in the IDL file. * @ingroup types @@ -999,6 +1007,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1037,8 +1048,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type Locator2LocatorData defined by the user in the IDL file. * @ingroup types @@ -1089,6 +1098,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1127,8 +1139,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type EntityData defined by the user in the IDL file. * @ingroup types @@ -1179,6 +1189,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1217,8 +1230,6 @@ namespace eprosima }; - - /*! * @brief This class represents the TopicDataType of the type PhysicalData defined by the user in the IDL file. * @ingroup types @@ -1269,6 +1280,9 @@ namespace eprosima eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -1306,14 +1320,13 @@ namespace eprosima unsigned char* m_keyBuffer; }; + namespace EventKind + { + } // namespace EventKind - - - - - } - } -} + } // namespace statistics + } // namespace fastdds +} // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_PUBSUBTYPES_H_ diff --git a/test/blackbox/types/statistics/typesTypeObjectSupport.cxx b/test/blackbox/types/statistics/typesTypeObjectSupport.cxx new file mode 100644 index 00000000000..94c1288292e --- /dev/null +++ b/test/blackbox/types/statistics/typesTypeObjectSupport.cxx @@ -0,0 +1,19540 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file typesTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "typesTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "types.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_types_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + + eprosima::fastdds::statistics::detail::register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_EntityData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + + eprosima::fastdds::statistics::register_eprosima_fastdds_statistics_Data_type_identifier(); + + }); +} + +namespace eprosima { +namespace fastdds { +namespace statistics { +namespace detail { +void register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier() +{ + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier() +{ + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier() +{ + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier() +{ + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier() +{ + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace detail +void register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier() +{ + { + StructTypeFlag struct_flags_DiscoveryTime = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DiscoveryTime; + TypeIdentifierPair type_ids_DiscoveryTime; + QualifiedTypeName type_name_DiscoveryTime = "eprosima::fastdds::statistics::DiscoveryTime"; + eprosima::fastcdr::optional type_ann_builtin_DiscoveryTime; + eprosima::fastcdr::optional ann_custom_DiscoveryTime; + CompleteTypeDetail detail_DiscoveryTime = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DiscoveryTime, ann_custom_DiscoveryTime, type_name_DiscoveryTime.to_string()); + CompleteStructHeader header_DiscoveryTime; + header_DiscoveryTime = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DiscoveryTime); + CompleteStructMemberSeq member_seq_DiscoveryTime; + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_participant_guid; + MemberId member_id_local_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_participant_guid = "local_participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_local_participant_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_participant_guid; + eprosima::fastcdr::optional unit_local_participant_guid; + eprosima::fastcdr::optional min_local_participant_guid; + eprosima::fastcdr::optional max_local_participant_guid; + eprosima::fastcdr::optional hash_id_local_participant_guid; + if (unit_local_participant_guid.has_value() || min_local_participant_guid.has_value() || max_local_participant_guid.has_value() || hash_id_local_participant_guid.has_value()) + { + member_ann_builtin_local_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_participant_guid, min_local_participant_guid, max_local_participant_guid, hash_id_local_participant_guid); + } + if (!tmp_ann_custom_local_participant_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_local_participant_guid; + } + CompleteMemberDetail detail_local_participant_guid = TypeObjectUtils::build_complete_member_detail(name_local_participant_guid, member_ann_builtin_local_participant_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_local_participant_guid = TypeObjectUtils::build_complete_struct_member(common_local_participant_guid, detail_local_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_local_participant_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_remote_entity_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_remote_entity_guid; + MemberId member_id_remote_entity_guid = 0x00000001; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure remote_entity_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_remote_entity_guid = "remote_entity_guid"; + eprosima::fastcdr::optional member_ann_builtin_remote_entity_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_remote_entity_guid; + eprosima::fastcdr::optional unit_remote_entity_guid; + eprosima::fastcdr::optional min_remote_entity_guid; + eprosima::fastcdr::optional max_remote_entity_guid; + eprosima::fastcdr::optional hash_id_remote_entity_guid; + if (unit_remote_entity_guid.has_value() || min_remote_entity_guid.has_value() || max_remote_entity_guid.has_value() || hash_id_remote_entity_guid.has_value()) + { + member_ann_builtin_remote_entity_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_remote_entity_guid, min_remote_entity_guid, max_remote_entity_guid, hash_id_remote_entity_guid); + } + if (!tmp_ann_custom_remote_entity_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_remote_entity_guid; + } + CompleteMemberDetail detail_remote_entity_guid = TypeObjectUtils::build_complete_member_detail(name_remote_entity_guid, member_ann_builtin_remote_entity_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_remote_entity_guid = TypeObjectUtils::build_complete_struct_member(common_remote_entity_guid, detail_remote_entity_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_remote_entity_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "time Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_time = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_time; + MemberId member_id_time = 0x00000002; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure time member TypeIdentifier inconsistent."); + return; + } + MemberName name_time = "time"; + eprosima::fastcdr::optional member_ann_builtin_time; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_time = TypeObjectUtils::build_complete_member_detail(name_time, member_ann_builtin_time, ann_custom_DiscoveryTime); + CompleteStructMember member_time = TypeObjectUtils::build_complete_struct_member(common_time, detail_time); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_time); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000003; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_DiscoveryTime); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_host); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000004; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_DiscoveryTime); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_user); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000005; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_DiscoveryTime); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_process); + } + CompleteStructType struct_type_DiscoveryTime = TypeObjectUtils::build_complete_struct_type(struct_flags_DiscoveryTime, header_DiscoveryTime, member_seq_DiscoveryTime); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DiscoveryTime, type_name_DiscoveryTime.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime already registered in TypeObjectRegistry for a different type."); + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_EntityCount_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityCount; + TypeIdentifierPair type_ids_EntityCount; + QualifiedTypeName type_name_EntityCount = "eprosima::fastdds::statistics::EntityCount"; + eprosima::fastcdr::optional type_ann_builtin_EntityCount; + eprosima::fastcdr::optional ann_custom_EntityCount; + CompleteTypeDetail detail_EntityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityCount, ann_custom_EntityCount, type_name_EntityCount.to_string()); + CompleteStructHeader header_EntityCount; + header_EntityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityCount); + CompleteStructMemberSeq member_seq_EntityCount; + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityCount = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityCount); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_guid); + } + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_EntityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_EntityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_count); + } + CompleteStructType struct_type_EntityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityCount, header_EntityCount, member_seq_EntityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityCount, type_name_EntityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_EntityCount); + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier() +{ + { + StructTypeFlag struct_flags_SampleIdentityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentityCount; + TypeIdentifierPair type_ids_SampleIdentityCount; + QualifiedTypeName type_name_SampleIdentityCount = "eprosima::fastdds::statistics::SampleIdentityCount"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentityCount; + eprosima::fastcdr::optional ann_custom_SampleIdentityCount; + CompleteTypeDetail detail_SampleIdentityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentityCount, ann_custom_SampleIdentityCount, type_name_SampleIdentityCount.to_string()); + CompleteStructHeader header_SampleIdentityCount; + header_SampleIdentityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentityCount); + CompleteStructMemberSeq member_seq_SampleIdentityCount; + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sample_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_sample_id; + MemberId member_id_sample_id = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sample_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_id = "sample_id"; + eprosima::fastcdr::optional member_ann_builtin_sample_id; + ann_custom_SampleIdentityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_sample_id; + eprosima::fastcdr::optional unit_sample_id; + eprosima::fastcdr::optional min_sample_id; + eprosima::fastcdr::optional max_sample_id; + eprosima::fastcdr::optional hash_id_sample_id; + if (unit_sample_id.has_value() || min_sample_id.has_value() || max_sample_id.has_value() || hash_id_sample_id.has_value()) + { + member_ann_builtin_sample_id = TypeObjectUtils::build_applied_builtin_member_annotations(unit_sample_id, min_sample_id, max_sample_id, hash_id_sample_id); + } + if (!tmp_ann_custom_sample_id.empty()) + { + ann_custom_SampleIdentityCount = tmp_ann_custom_sample_id; + } + CompleteMemberDetail detail_sample_id = TypeObjectUtils::build_complete_member_detail(name_sample_id, member_ann_builtin_sample_id, ann_custom_SampleIdentityCount); + CompleteStructMember member_sample_id = TypeObjectUtils::build_complete_struct_member(common_sample_id, detail_sample_id); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_sample_id); + } + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_SampleIdentityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_SampleIdentityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_count); + } + CompleteStructType struct_type_SampleIdentityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentityCount, header_SampleIdentityCount, member_seq_SampleIdentityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentityCount, type_name_SampleIdentityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_SampleIdentityCount); + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier() +{ + { + StructTypeFlag struct_flags_Entity2LocatorTraffic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Entity2LocatorTraffic; + TypeIdentifierPair type_ids_Entity2LocatorTraffic; + QualifiedTypeName type_name_Entity2LocatorTraffic = "eprosima::fastdds::statistics::Entity2LocatorTraffic"; + eprosima::fastcdr::optional type_ann_builtin_Entity2LocatorTraffic; + eprosima::fastcdr::optional ann_custom_Entity2LocatorTraffic; + CompleteTypeDetail detail_Entity2LocatorTraffic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Entity2LocatorTraffic, ann_custom_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string()); + CompleteStructHeader header_Entity2LocatorTraffic; + header_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Entity2LocatorTraffic); + CompleteStructMemberSeq member_seq_Entity2LocatorTraffic; + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_guid; + MemberId member_id_src_guid = 0x00000000; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_guid = "src_guid"; + eprosima::fastcdr::optional member_ann_builtin_src_guid; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_guid; + eprosima::fastcdr::optional unit_src_guid; + eprosima::fastcdr::optional min_src_guid; + eprosima::fastcdr::optional max_src_guid; + eprosima::fastcdr::optional hash_id_src_guid; + if (unit_src_guid.has_value() || min_src_guid.has_value() || max_src_guid.has_value() || hash_id_src_guid.has_value()) + { + member_ann_builtin_src_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_guid, min_src_guid, max_src_guid, hash_id_src_guid); + } + if (!tmp_ann_custom_src_guid.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_src_guid; + } + CompleteMemberDetail detail_src_guid = TypeObjectUtils::build_complete_member_detail(name_src_guid, member_ann_builtin_src_guid, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_src_guid = TypeObjectUtils::build_complete_struct_member(common_src_guid, detail_src_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_src_guid); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_dst_locator); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "packet_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_packet_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_packet_count; + MemberId member_id_packet_count = 0x00000002; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure packet_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_packet_count = "packet_count"; + eprosima::fastcdr::optional member_ann_builtin_packet_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_packet_count = TypeObjectUtils::build_complete_member_detail(name_packet_count, member_ann_builtin_packet_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_packet_count = TypeObjectUtils::build_complete_struct_member(common_packet_count, detail_packet_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_packet_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_count; + MemberId member_id_byte_count = 0x00000003; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_count = "byte_count"; + eprosima::fastcdr::optional member_ann_builtin_byte_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_count = TypeObjectUtils::build_complete_member_detail(name_byte_count, member_ann_builtin_byte_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_count = TypeObjectUtils::build_complete_struct_member(common_byte_count, detail_byte_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_magnitude_order Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_magnitude_order = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_magnitude_order; + MemberId member_id_byte_magnitude_order = 0x00000004; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_magnitude_order member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_magnitude_order = "byte_magnitude_order"; + eprosima::fastcdr::optional member_ann_builtin_byte_magnitude_order; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_magnitude_order = TypeObjectUtils::build_complete_member_detail(name_byte_magnitude_order, member_ann_builtin_byte_magnitude_order, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_magnitude_order = TypeObjectUtils::build_complete_struct_member(common_byte_magnitude_order, detail_byte_magnitude_order); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_magnitude_order); + } + CompleteStructType struct_type_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_type(struct_flags_Entity2LocatorTraffic, header_Entity2LocatorTraffic, member_seq_Entity2LocatorTraffic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic already registered in TypeObjectRegistry for a different type."); + } + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Entity2LocatorTraffic); + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_WriterReaderData_type_identifier() +{ + { + StructTypeFlag struct_flags_WriterReaderData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_WriterReaderData; + TypeIdentifierPair type_ids_WriterReaderData; + QualifiedTypeName type_name_WriterReaderData = "eprosima::fastdds::statistics::WriterReaderData"; + eprosima::fastcdr::optional type_ann_builtin_WriterReaderData; + eprosima::fastcdr::optional ann_custom_WriterReaderData; + CompleteTypeDetail detail_WriterReaderData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WriterReaderData, ann_custom_WriterReaderData, type_name_WriterReaderData.to_string()); + CompleteStructHeader header_WriterReaderData; + header_WriterReaderData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WriterReaderData); + CompleteStructMemberSeq member_seq_WriterReaderData; + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_writer_guid; + eprosima::fastcdr::optional unit_writer_guid; + eprosima::fastcdr::optional min_writer_guid; + eprosima::fastcdr::optional max_writer_guid; + eprosima::fastcdr::optional hash_id_writer_guid; + if (unit_writer_guid.has_value() || min_writer_guid.has_value() || max_writer_guid.has_value() || hash_id_writer_guid.has_value()) + { + member_ann_builtin_writer_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_writer_guid, min_writer_guid, max_writer_guid, hash_id_writer_guid); + } + if (!tmp_ann_custom_writer_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_writer_guid; + } + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_WriterReaderData); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_writer_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_reader_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_reader_guid; + MemberId member_id_reader_guid = 0x00000001; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure reader_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_reader_guid = "reader_guid"; + eprosima::fastcdr::optional member_ann_builtin_reader_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_reader_guid; + eprosima::fastcdr::optional unit_reader_guid; + eprosima::fastcdr::optional min_reader_guid; + eprosima::fastcdr::optional max_reader_guid; + eprosima::fastcdr::optional hash_id_reader_guid; + if (unit_reader_guid.has_value() || min_reader_guid.has_value() || max_reader_guid.has_value() || hash_id_reader_guid.has_value()) + { + member_ann_builtin_reader_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_reader_guid, min_reader_guid, max_reader_guid, hash_id_reader_guid); + } + if (!tmp_ann_custom_reader_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_reader_guid; + } + CompleteMemberDetail detail_reader_guid = TypeObjectUtils::build_complete_member_detail(name_reader_guid, member_ann_builtin_reader_guid, ann_custom_WriterReaderData); + CompleteStructMember member_reader_guid = TypeObjectUtils::build_complete_struct_member(common_reader_guid, detail_reader_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_reader_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_WriterReaderData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_WriterReaderData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_data); + } + CompleteStructType struct_type_WriterReaderData = TypeObjectUtils::build_complete_struct_type(struct_flags_WriterReaderData, header_WriterReaderData, member_seq_WriterReaderData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WriterReaderData, type_name_WriterReaderData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData already registered in TypeObjectRegistry for a different type."); + } + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_WriterReaderData); + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier() +{ + { + StructTypeFlag struct_flags_Locator2LocatorData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator2LocatorData; + TypeIdentifierPair type_ids_Locator2LocatorData; + QualifiedTypeName type_name_Locator2LocatorData = "eprosima::fastdds::statistics::Locator2LocatorData"; + eprosima::fastcdr::optional type_ann_builtin_Locator2LocatorData; + eprosima::fastcdr::optional ann_custom_Locator2LocatorData; + CompleteTypeDetail detail_Locator2LocatorData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator2LocatorData, ann_custom_Locator2LocatorData, type_name_Locator2LocatorData.to_string()); + CompleteStructHeader header_Locator2LocatorData; + header_Locator2LocatorData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator2LocatorData); + CompleteStructMemberSeq member_seq_Locator2LocatorData; + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_locator; + MemberId member_id_src_locator = 0x00000000; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_locator = "src_locator"; + eprosima::fastcdr::optional member_ann_builtin_src_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_locator; + eprosima::fastcdr::optional unit_src_locator; + eprosima::fastcdr::optional min_src_locator; + eprosima::fastcdr::optional max_src_locator; + eprosima::fastcdr::optional hash_id_src_locator; + if (unit_src_locator.has_value() || min_src_locator.has_value() || max_src_locator.has_value() || hash_id_src_locator.has_value()) + { + member_ann_builtin_src_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_locator, min_src_locator, max_src_locator, hash_id_src_locator); + } + if (!tmp_ann_custom_src_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_src_locator; + } + CompleteMemberDetail detail_src_locator = TypeObjectUtils::build_complete_member_detail(name_src_locator, member_ann_builtin_src_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_src_locator = TypeObjectUtils::build_complete_struct_member(common_src_locator, detail_src_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_src_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_dst_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Locator2LocatorData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Locator2LocatorData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_data); + } + CompleteStructType struct_type_Locator2LocatorData = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator2LocatorData, header_Locator2LocatorData, member_seq_Locator2LocatorData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator2LocatorData, type_name_Locator2LocatorData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Locator2LocatorData); + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_EntityData_type_identifier() +{ + { + StructTypeFlag struct_flags_EntityData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityData; + TypeIdentifierPair type_ids_EntityData; + QualifiedTypeName type_name_EntityData = "eprosima::fastdds::statistics::EntityData"; + eprosima::fastcdr::optional type_ann_builtin_EntityData; + eprosima::fastcdr::optional ann_custom_EntityData; + CompleteTypeDetail detail_EntityData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityData, ann_custom_EntityData, type_name_EntityData.to_string()); + CompleteStructHeader header_EntityData; + header_EntityData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityData); + CompleteStructMemberSeq member_seq_EntityData; + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityData.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityData = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityData); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_guid); + } + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000001; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_EntityData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_EntityData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_data); + } + CompleteStructType struct_type_EntityData = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityData, header_EntityData, member_seq_EntityData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityData, type_name_EntityData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_EntityData); + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_eprosima_fastdds_statistics_PhysicalData_type_identifier() +{ + { + StructTypeFlag struct_flags_PhysicalData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_PhysicalData; + TypeIdentifierPair type_ids_PhysicalData; + QualifiedTypeName type_name_PhysicalData = "eprosima::fastdds::statistics::PhysicalData"; + eprosima::fastcdr::optional type_ann_builtin_PhysicalData; + eprosima::fastcdr::optional ann_custom_PhysicalData; + CompleteTypeDetail detail_PhysicalData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PhysicalData, ann_custom_PhysicalData, type_name_PhysicalData.to_string()); + CompleteStructHeader header_PhysicalData; + header_PhysicalData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_PhysicalData); + CompleteStructMemberSeq member_seq_PhysicalData; + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_participant_guid; + MemberId member_id_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_participant_guid = "participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_participant_guid; + ann_custom_PhysicalData.reset(); + AppliedAnnotationSeq tmp_ann_custom_participant_guid; + eprosima::fastcdr::optional unit_participant_guid; + eprosima::fastcdr::optional min_participant_guid; + eprosima::fastcdr::optional max_participant_guid; + eprosima::fastcdr::optional hash_id_participant_guid; + if (unit_participant_guid.has_value() || min_participant_guid.has_value() || max_participant_guid.has_value() || hash_id_participant_guid.has_value()) + { + member_ann_builtin_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_participant_guid, min_participant_guid, max_participant_guid, hash_id_participant_guid); + } + if (!tmp_ann_custom_participant_guid.empty()) + { + ann_custom_PhysicalData = tmp_ann_custom_participant_guid; + } + CompleteMemberDetail detail_participant_guid = TypeObjectUtils::build_complete_member_detail(name_participant_guid, member_ann_builtin_participant_guid, ann_custom_PhysicalData); + CompleteStructMember member_participant_guid = TypeObjectUtils::build_complete_struct_member(common_participant_guid, detail_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_participant_guid); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000001; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_PhysicalData); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_host); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000002; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_PhysicalData); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_user); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000003; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_PhysicalData); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_process); + } + CompleteStructType struct_type_PhysicalData = TypeObjectUtils::build_complete_struct_type(struct_flags_PhysicalData, header_PhysicalData, member_seq_PhysicalData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_PhysicalData, type_name_PhysicalData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData already registered in TypeObjectRegistry for a different type."); + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +namespace EventKind { +} // namespace EventKind +void register_eprosima_fastdds_statistics_Data_type_identifier() +{ + { + ReturnCode_t return_code_Data; + TypeIdentifierPair type_ids_Data; + UnionTypeFlag union_flags_Data = TypeObjectUtils::build_union_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + QualifiedTypeName type_name_Data = "eprosima::fastdds::statistics::Data"; + eprosima::fastcdr::optional type_ann_builtin_Data; + eprosima::fastcdr::optional ann_custom_Data; + CompleteTypeDetail detail_Data = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Data, ann_custom_Data, type_name_Data.to_string()); + CompleteUnionHeader header_Data = TypeObjectUtils::build_complete_union_header(detail_Data); + UnionDiscriminatorFlag member_flags_Data = TypeObjectUtils::build_union_discriminator_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false); + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union discriminator TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + CommonDiscriminatorMember common_Data; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d()) + { + common_Data = TypeObjectUtils::build_common_discriminator_member(member_flags_Data, type_ids_Data.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d()) + { + common_Data = TypeObjectUtils::build_common_discriminator_member(member_flags_Data, type_ids_Data.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data discriminator TypeIdentifier inconsistent."); + return; + } + type_ann_builtin_Data.reset(); + ann_custom_Data.reset(); + CompleteDiscriminatorMember discriminator_Data = TypeObjectUtils::build_complete_discriminator_member(common_Data, + type_ann_builtin_Data, ann_custom_Data); + CompleteUnionMemberSeq member_seq_Data; + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_WriterReaderData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_WriterReaderData; + TypeIdentifierPair type_ids_WriterReaderData; + QualifiedTypeName type_name_WriterReaderData = "eprosima::fastdds::statistics::WriterReaderData"; + eprosima::fastcdr::optional type_ann_builtin_WriterReaderData; + eprosima::fastcdr::optional ann_custom_WriterReaderData; + CompleteTypeDetail detail_WriterReaderData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WriterReaderData, ann_custom_WriterReaderData, type_name_WriterReaderData.to_string()); + CompleteStructHeader header_WriterReaderData; + header_WriterReaderData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WriterReaderData); + CompleteStructMemberSeq member_seq_WriterReaderData; + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_writer_guid; + eprosima::fastcdr::optional unit_writer_guid; + eprosima::fastcdr::optional min_writer_guid; + eprosima::fastcdr::optional max_writer_guid; + eprosima::fastcdr::optional hash_id_writer_guid; + if (unit_writer_guid.has_value() || min_writer_guid.has_value() || max_writer_guid.has_value() || hash_id_writer_guid.has_value()) + { + member_ann_builtin_writer_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_writer_guid, min_writer_guid, max_writer_guid, hash_id_writer_guid); + } + if (!tmp_ann_custom_writer_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_writer_guid; + } + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_WriterReaderData); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_writer_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_reader_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_reader_guid; + MemberId member_id_reader_guid = 0x00000001; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_reader_guid = TypeObjectUtils::build_common_struct_member(member_id_reader_guid, member_flags_reader_guid, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure reader_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_reader_guid = "reader_guid"; + eprosima::fastcdr::optional member_ann_builtin_reader_guid; + ann_custom_WriterReaderData.reset(); + AppliedAnnotationSeq tmp_ann_custom_reader_guid; + eprosima::fastcdr::optional unit_reader_guid; + eprosima::fastcdr::optional min_reader_guid; + eprosima::fastcdr::optional max_reader_guid; + eprosima::fastcdr::optional hash_id_reader_guid; + if (unit_reader_guid.has_value() || min_reader_guid.has_value() || max_reader_guid.has_value() || hash_id_reader_guid.has_value()) + { + member_ann_builtin_reader_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_reader_guid, min_reader_guid, max_reader_guid, hash_id_reader_guid); + } + if (!tmp_ann_custom_reader_guid.empty()) + { + ann_custom_WriterReaderData = tmp_ann_custom_reader_guid; + } + CompleteMemberDetail detail_reader_guid = TypeObjectUtils::build_complete_member_detail(name_reader_guid, member_ann_builtin_reader_guid, ann_custom_WriterReaderData); + CompleteStructMember member_reader_guid = TypeObjectUtils::build_complete_struct_member(common_reader_guid, detail_reader_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_reader_guid); + } + { + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_WriterReaderData); + + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1()._d() || TK_NONE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_WriterReaderData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_WriterReaderData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_WriterReaderData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_WriterReaderData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_WriterReaderData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_WriterReaderData, member_data); + } + CompleteStructType struct_type_WriterReaderData = TypeObjectUtils::build_complete_struct_type(struct_flags_WriterReaderData, header_WriterReaderData, member_seq_WriterReaderData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WriterReaderData, type_name_WriterReaderData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData already registered in TypeObjectRegistry for a different type."); + } + return_code_WriterReaderData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::WriterReaderData", type_ids_WriterReaderData); + if (return_code_WriterReaderData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::WriterReaderData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_writer_reader_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_writer_reader_data; + TypeObjectUtils::add_union_case_label(label_seq_writer_reader_data, static_cast(EventKind::HISTORY2HISTORY_LATENCY)); + CommonUnionMember common_writer_reader_data; + MemberId member_id_writer_reader_data = 0x00000001; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_reader_data = TypeObjectUtils::build_common_union_member(member_id_writer_reader_data, member_flags_writer_reader_data, type_ids_Data.type_identifier1(), + label_seq_writer_reader_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_reader_data = TypeObjectUtils::build_common_union_member(member_id_writer_reader_data, member_flags_writer_reader_data, type_ids_Data.type_identifier2(), + label_seq_writer_reader_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union writer_reader_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_reader_data = "writer_reader_data"; + eprosima::fastcdr::optional member_ann_builtin_writer_reader_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_writer_reader_data = TypeObjectUtils::build_complete_member_detail(name_writer_reader_data, member_ann_builtin_writer_reader_data, ann_custom_Data); + CompleteUnionMember member_writer_reader_data = TypeObjectUtils::build_complete_union_member(common_writer_reader_data, detail_writer_reader_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_writer_reader_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator2LocatorData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator2LocatorData; + TypeIdentifierPair type_ids_Locator2LocatorData; + QualifiedTypeName type_name_Locator2LocatorData = "eprosima::fastdds::statistics::Locator2LocatorData"; + eprosima::fastcdr::optional type_ann_builtin_Locator2LocatorData; + eprosima::fastcdr::optional ann_custom_Locator2LocatorData; + CompleteTypeDetail detail_Locator2LocatorData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator2LocatorData, ann_custom_Locator2LocatorData, type_name_Locator2LocatorData.to_string()); + CompleteStructHeader header_Locator2LocatorData; + header_Locator2LocatorData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator2LocatorData); + CompleteStructMemberSeq member_seq_Locator2LocatorData; + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_locator; + MemberId member_id_src_locator = 0x00000000; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_locator = TypeObjectUtils::build_common_struct_member(member_id_src_locator, member_flags_src_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_locator = "src_locator"; + eprosima::fastcdr::optional member_ann_builtin_src_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_locator; + eprosima::fastcdr::optional unit_src_locator; + eprosima::fastcdr::optional min_src_locator; + eprosima::fastcdr::optional max_src_locator; + eprosima::fastcdr::optional hash_id_src_locator; + if (unit_src_locator.has_value() || min_src_locator.has_value() || max_src_locator.has_value() || hash_id_src_locator.has_value()) + { + member_ann_builtin_src_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_locator, min_src_locator, max_src_locator, hash_id_src_locator); + } + if (!tmp_ann_custom_src_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_src_locator; + } + CompleteMemberDetail detail_src_locator = TypeObjectUtils::build_complete_member_detail(name_src_locator, member_ann_builtin_src_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_src_locator = TypeObjectUtils::build_complete_struct_member(common_src_locator, detail_src_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_src_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Locator2LocatorData.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Locator2LocatorData = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Locator2LocatorData); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_dst_locator); + } + { + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Locator2LocatorData); + + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1()._d() || TK_NONE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator2LocatorData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator2LocatorData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_Locator2LocatorData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_Locator2LocatorData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_Locator2LocatorData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator2LocatorData, member_data); + } + CompleteStructType struct_type_Locator2LocatorData = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator2LocatorData, header_Locator2LocatorData, member_seq_Locator2LocatorData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator2LocatorData, type_name_Locator2LocatorData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator2LocatorData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Locator2LocatorData", type_ids_Locator2LocatorData); + if (return_code_Locator2LocatorData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Locator2LocatorData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_locator2locator_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_locator2locator_data; + TypeObjectUtils::add_union_case_label(label_seq_locator2locator_data, static_cast(EventKind::NETWORK_LATENCY)); + CommonUnionMember common_locator2locator_data; + MemberId member_id_locator2locator_data = 0x00000002; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_locator2locator_data = TypeObjectUtils::build_common_union_member(member_id_locator2locator_data, member_flags_locator2locator_data, type_ids_Data.type_identifier1(), + label_seq_locator2locator_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_locator2locator_data = TypeObjectUtils::build_common_union_member(member_id_locator2locator_data, member_flags_locator2locator_data, type_ids_Data.type_identifier2(), + label_seq_locator2locator_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union locator2locator_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_locator2locator_data = "locator2locator_data"; + eprosima::fastcdr::optional member_ann_builtin_locator2locator_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_locator2locator_data = TypeObjectUtils::build_complete_member_detail(name_locator2locator_data, member_ann_builtin_locator2locator_data, ann_custom_Data); + CompleteUnionMember member_locator2locator_data = TypeObjectUtils::build_complete_union_member(common_locator2locator_data, detail_locator2locator_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_locator2locator_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityData; + TypeIdentifierPair type_ids_EntityData; + QualifiedTypeName type_name_EntityData = "eprosima::fastdds::statistics::EntityData"; + eprosima::fastcdr::optional type_ann_builtin_EntityData; + eprosima::fastcdr::optional ann_custom_EntityData; + CompleteTypeDetail detail_EntityData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityData, ann_custom_EntityData, type_name_EntityData.to_string()); + CompleteStructHeader header_EntityData; + header_EntityData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityData); + CompleteStructMemberSeq member_seq_EntityData; + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityData.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityData = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityData); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_guid); + } + { + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_EntityData); + + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "data Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000001; + if (EK_COMPLETE == type_ids_EntityData.type_identifier1()._d() || TK_NONE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityData.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_EntityData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_EntityData.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_EntityData); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityData, member_data); + } + CompleteStructType struct_type_EntityData = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityData, header_EntityData, member_seq_EntityData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityData, type_name_EntityData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityData", type_ids_EntityData); + if (return_code_EntityData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_data; + TypeObjectUtils::add_union_case_label(label_seq_entity_data, static_cast(EventKind::PUBLICATION_THROUGHPUT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_data, static_cast(EventKind::SUBSCRIPTION_THROUGHPUT)); + CommonUnionMember common_entity_data; + MemberId member_id_entity_data = 0x00000003; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_data = TypeObjectUtils::build_common_union_member(member_id_entity_data, member_flags_entity_data, type_ids_Data.type_identifier1(), + label_seq_entity_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_data = TypeObjectUtils::build_common_union_member(member_id_entity_data, member_flags_entity_data, type_ids_Data.type_identifier2(), + label_seq_entity_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_data = "entity_data"; + eprosima::fastcdr::optional member_ann_builtin_entity_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity_data = TypeObjectUtils::build_complete_member_detail(name_entity_data, member_ann_builtin_entity_data, ann_custom_Data); + CompleteUnionMember member_entity_data = TypeObjectUtils::build_complete_union_member(common_entity_data, detail_entity_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity_data); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Entity2LocatorTraffic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Entity2LocatorTraffic; + TypeIdentifierPair type_ids_Entity2LocatorTraffic; + QualifiedTypeName type_name_Entity2LocatorTraffic = "eprosima::fastdds::statistics::Entity2LocatorTraffic"; + eprosima::fastcdr::optional type_ann_builtin_Entity2LocatorTraffic; + eprosima::fastcdr::optional ann_custom_Entity2LocatorTraffic; + CompleteTypeDetail detail_Entity2LocatorTraffic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Entity2LocatorTraffic, ann_custom_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string()); + CompleteStructHeader header_Entity2LocatorTraffic; + header_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Entity2LocatorTraffic); + CompleteStructMemberSeq member_seq_Entity2LocatorTraffic; + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_src_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_src_guid; + MemberId member_id_src_guid = 0x00000000; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_src_guid = TypeObjectUtils::build_common_struct_member(member_id_src_guid, member_flags_src_guid, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure src_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_src_guid = "src_guid"; + eprosima::fastcdr::optional member_ann_builtin_src_guid; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_src_guid; + eprosima::fastcdr::optional unit_src_guid; + eprosima::fastcdr::optional min_src_guid; + eprosima::fastcdr::optional max_src_guid; + eprosima::fastcdr::optional hash_id_src_guid; + if (unit_src_guid.has_value() || min_src_guid.has_value() || max_src_guid.has_value() || hash_id_src_guid.has_value()) + { + member_ann_builtin_src_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_src_guid, min_src_guid, max_src_guid, hash_id_src_guid); + } + if (!tmp_ann_custom_src_guid.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_src_guid; + } + CompleteMemberDetail detail_src_guid = TypeObjectUtils::build_complete_member_detail(name_src_guid, member_ann_builtin_src_guid, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_src_guid = TypeObjectUtils::build_complete_struct_member(common_src_guid, detail_src_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_src_guid); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_Locator_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Locator_s; + TypeIdentifierPair type_ids_Locator_s; + QualifiedTypeName type_name_Locator_s = "eprosima::fastdds::statistics::detail::Locator_s"; + eprosima::fastcdr::optional type_ann_builtin_Locator_s; + eprosima::fastcdr::optional ann_custom_Locator_s; + CompleteTypeDetail detail_Locator_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Locator_s, ann_custom_Locator_s, type_name_Locator_s.to_string()); + CompleteStructHeader header_Locator_s; + header_Locator_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Locator_s); + CompleteStructMemberSeq member_seq_Locator_s; + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "kind Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_kind = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_kind; + MemberId member_id_kind = 0x00000000; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_kind = TypeObjectUtils::build_common_struct_member(member_id_kind, member_flags_kind, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure kind member TypeIdentifier inconsistent."); + return; + } + MemberName name_kind = "kind"; + eprosima::fastcdr::optional member_ann_builtin_kind; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_kind = TypeObjectUtils::build_complete_member_detail(name_kind, member_ann_builtin_kind, ann_custom_Locator_s); + CompleteStructMember member_kind = TypeObjectUtils::build_complete_struct_member(common_kind, detail_kind); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_kind); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "port Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_port = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_port; + MemberId member_id_port = 0x00000001; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_port = TypeObjectUtils::build_common_struct_member(member_id_port, member_flags_port, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure port member TypeIdentifier inconsistent."); + return; + } + MemberName name_port = "port"; + eprosima::fastcdr::optional member_ann_builtin_port; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_port = TypeObjectUtils::build_complete_member_detail(name_port, member_ann_builtin_port, ann_custom_Locator_s); + CompleteStructMember member_port = TypeObjectUtils::build_complete_struct_member(common_port, detail_port); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_port); + } + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_Locator_s); + + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_16 {nullptr}; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_16 = new TypeIdentifier(type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_16 = EK_COMPLETE; + if (TK_NONE == type_ids_Locator_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_16 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_16 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_16 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_16, element_flags_anonymous_array_uint8_t_16); + std::string type_id_kind_anonymous_array_uint8_t_16("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_16 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(16)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_16, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_16)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_16")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_16", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_16: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_address = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_address; + MemberId member_id_address = 0x00000002; + if (EK_COMPLETE == type_ids_Locator_s.type_identifier1()._d() || TK_NONE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Locator_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Locator_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_Locator_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Locator_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Locator_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_address = TypeObjectUtils::build_common_struct_member(member_id_address, member_flags_address, type_ids_Locator_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure address member TypeIdentifier inconsistent."); + return; + } + MemberName name_address = "address"; + eprosima::fastcdr::optional member_ann_builtin_address; + ann_custom_Locator_s.reset(); + CompleteMemberDetail detail_address = TypeObjectUtils::build_complete_member_detail(name_address, member_ann_builtin_address, ann_custom_Locator_s); + CompleteStructMember member_address = TypeObjectUtils::build_complete_struct_member(common_address, detail_address); + TypeObjectUtils::add_complete_struct_member(member_seq_Locator_s, member_address); + } + CompleteStructType struct_type_Locator_s = TypeObjectUtils::build_complete_struct_type(struct_flags_Locator_s, header_Locator_s, member_seq_Locator_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Locator_s, type_name_Locator_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s already registered in TypeObjectRegistry for a different type."); + } + return_code_Locator_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::Locator_s", type_ids_Locator_s); + if (return_code_Locator_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::Locator_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_dst_locator = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_dst_locator; + MemberId member_id_dst_locator = 0x00000001; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_dst_locator = TypeObjectUtils::build_common_struct_member(member_id_dst_locator, member_flags_dst_locator, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure dst_locator member TypeIdentifier inconsistent."); + return; + } + MemberName name_dst_locator = "dst_locator"; + eprosima::fastcdr::optional member_ann_builtin_dst_locator; + ann_custom_Entity2LocatorTraffic.reset(); + AppliedAnnotationSeq tmp_ann_custom_dst_locator; + eprosima::fastcdr::optional unit_dst_locator; + eprosima::fastcdr::optional min_dst_locator; + eprosima::fastcdr::optional max_dst_locator; + eprosima::fastcdr::optional hash_id_dst_locator; + if (unit_dst_locator.has_value() || min_dst_locator.has_value() || max_dst_locator.has_value() || hash_id_dst_locator.has_value()) + { + member_ann_builtin_dst_locator = TypeObjectUtils::build_applied_builtin_member_annotations(unit_dst_locator, min_dst_locator, max_dst_locator, hash_id_dst_locator); + } + if (!tmp_ann_custom_dst_locator.empty()) + { + ann_custom_Entity2LocatorTraffic = tmp_ann_custom_dst_locator; + } + CompleteMemberDetail detail_dst_locator = TypeObjectUtils::build_complete_member_detail(name_dst_locator, member_ann_builtin_dst_locator, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_dst_locator = TypeObjectUtils::build_complete_struct_member(common_dst_locator, detail_dst_locator); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_dst_locator); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "packet_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_packet_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_packet_count; + MemberId member_id_packet_count = 0x00000002; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_packet_count = TypeObjectUtils::build_common_struct_member(member_id_packet_count, member_flags_packet_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure packet_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_packet_count = "packet_count"; + eprosima::fastcdr::optional member_ann_builtin_packet_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_packet_count = TypeObjectUtils::build_complete_member_detail(name_packet_count, member_ann_builtin_packet_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_packet_count = TypeObjectUtils::build_complete_struct_member(common_packet_count, detail_packet_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_packet_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_count; + MemberId member_id_byte_count = 0x00000003; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_count = TypeObjectUtils::build_common_struct_member(member_id_byte_count, member_flags_byte_count, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_count = "byte_count"; + eprosima::fastcdr::optional member_ann_builtin_byte_count; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_count = TypeObjectUtils::build_complete_member_detail(name_byte_count, member_ann_builtin_byte_count, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_count = TypeObjectUtils::build_complete_struct_member(common_byte_count, detail_byte_count); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_count); + } + { + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_Entity2LocatorTraffic); + + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "byte_magnitude_order Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_byte_magnitude_order = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_byte_magnitude_order; + MemberId member_id_byte_magnitude_order = 0x00000004; + if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() || TK_NONE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Entity2LocatorTraffic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Entity2LocatorTraffic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_byte_magnitude_order = TypeObjectUtils::build_common_struct_member(member_id_byte_magnitude_order, member_flags_byte_magnitude_order, type_ids_Entity2LocatorTraffic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure byte_magnitude_order member TypeIdentifier inconsistent."); + return; + } + MemberName name_byte_magnitude_order = "byte_magnitude_order"; + eprosima::fastcdr::optional member_ann_builtin_byte_magnitude_order; + ann_custom_Entity2LocatorTraffic.reset(); + CompleteMemberDetail detail_byte_magnitude_order = TypeObjectUtils::build_complete_member_detail(name_byte_magnitude_order, member_ann_builtin_byte_magnitude_order, ann_custom_Entity2LocatorTraffic); + CompleteStructMember member_byte_magnitude_order = TypeObjectUtils::build_complete_struct_member(common_byte_magnitude_order, detail_byte_magnitude_order); + TypeObjectUtils::add_complete_struct_member(member_seq_Entity2LocatorTraffic, member_byte_magnitude_order); + } + CompleteStructType struct_type_Entity2LocatorTraffic = TypeObjectUtils::build_complete_struct_type(struct_flags_Entity2LocatorTraffic, header_Entity2LocatorTraffic, member_seq_Entity2LocatorTraffic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Entity2LocatorTraffic, type_name_Entity2LocatorTraffic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic already registered in TypeObjectRegistry for a different type."); + } + return_code_Entity2LocatorTraffic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Entity2LocatorTraffic", type_ids_Entity2LocatorTraffic); + if (return_code_Entity2LocatorTraffic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Entity2LocatorTraffic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity2locator_traffic = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity2locator_traffic; + TypeObjectUtils::add_union_case_label(label_seq_entity2locator_traffic, static_cast(EventKind::RTPS_SENT)); + TypeObjectUtils::add_union_case_label(label_seq_entity2locator_traffic, static_cast(EventKind::RTPS_LOST)); + CommonUnionMember common_entity2locator_traffic; + MemberId member_id_entity2locator_traffic = 0x00000004; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity2locator_traffic = TypeObjectUtils::build_common_union_member(member_id_entity2locator_traffic, member_flags_entity2locator_traffic, type_ids_Data.type_identifier1(), + label_seq_entity2locator_traffic); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity2locator_traffic = TypeObjectUtils::build_common_union_member(member_id_entity2locator_traffic, member_flags_entity2locator_traffic, type_ids_Data.type_identifier2(), + label_seq_entity2locator_traffic); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity2locator_traffic member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity2locator_traffic = "entity2locator_traffic"; + eprosima::fastcdr::optional member_ann_builtin_entity2locator_traffic; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity2locator_traffic = TypeObjectUtils::build_complete_member_detail(name_entity2locator_traffic, member_ann_builtin_entity2locator_traffic, ann_custom_Data); + CompleteUnionMember member_entity2locator_traffic = TypeObjectUtils::build_complete_union_member(common_entity2locator_traffic, detail_entity2locator_traffic); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity2locator_traffic); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityCount; + TypeIdentifierPair type_ids_EntityCount; + QualifiedTypeName type_name_EntityCount = "eprosima::fastdds::statistics::EntityCount"; + eprosima::fastcdr::optional type_ann_builtin_EntityCount; + eprosima::fastcdr::optional ann_custom_EntityCount; + CompleteTypeDetail detail_EntityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityCount, ann_custom_EntityCount, type_name_EntityCount.to_string()); + CompleteStructHeader header_EntityCount; + header_EntityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityCount); + CompleteStructMemberSeq member_seq_EntityCount; + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_guid; + MemberId member_id_guid = 0x00000000; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guid = TypeObjectUtils::build_common_struct_member(member_id_guid, member_flags_guid, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_guid = "guid"; + eprosima::fastcdr::optional member_ann_builtin_guid; + ann_custom_EntityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_guid; + eprosima::fastcdr::optional unit_guid; + eprosima::fastcdr::optional min_guid; + eprosima::fastcdr::optional max_guid; + eprosima::fastcdr::optional hash_id_guid; + if (unit_guid.has_value() || min_guid.has_value() || max_guid.has_value() || hash_id_guid.has_value()) + { + member_ann_builtin_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_guid, min_guid, max_guid, hash_id_guid); + } + if (!tmp_ann_custom_guid.empty()) + { + ann_custom_EntityCount = tmp_ann_custom_guid; + } + CompleteMemberDetail detail_guid = TypeObjectUtils::build_complete_member_detail(name_guid, member_ann_builtin_guid, ann_custom_EntityCount); + CompleteStructMember member_guid = TypeObjectUtils::build_complete_struct_member(common_guid, detail_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_guid); + } + { + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_EntityCount); + + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_EntityCount.type_identifier1()._d() || TK_NONE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_EntityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_EntityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_EntityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityCount, member_count); + } + CompleteStructType struct_type_EntityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityCount, header_EntityCount, member_seq_EntityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityCount, type_name_EntityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::EntityCount", type_ids_EntityCount); + if (return_code_EntityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::EntityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_entity_count = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_entity_count; + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::RESENT_DATAS)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::HEARTBEAT_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::ACKNACK_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::NACKFRAG_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::GAP_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::DATA_COUNT)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::PDP_PACKETS)); + TypeObjectUtils::add_union_case_label(label_seq_entity_count, static_cast(EventKind::EDP_PACKETS)); + CommonUnionMember common_entity_count; + MemberId member_id_entity_count = 0x00000005; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entity_count = TypeObjectUtils::build_common_union_member(member_id_entity_count, member_flags_entity_count, type_ids_Data.type_identifier1(), + label_seq_entity_count); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entity_count = TypeObjectUtils::build_common_union_member(member_id_entity_count, member_flags_entity_count, type_ids_Data.type_identifier2(), + label_seq_entity_count); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union entity_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_entity_count = "entity_count"; + eprosima::fastcdr::optional member_ann_builtin_entity_count; + ann_custom_Data.reset(); + CompleteMemberDetail detail_entity_count = TypeObjectUtils::build_complete_member_detail(name_entity_count, member_ann_builtin_entity_count, ann_custom_Data); + CompleteUnionMember member_entity_count = TypeObjectUtils::build_complete_union_member(common_entity_count, detail_entity_count); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_entity_count); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_DiscoveryTime = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_DiscoveryTime; + TypeIdentifierPair type_ids_DiscoveryTime; + QualifiedTypeName type_name_DiscoveryTime = "eprosima::fastdds::statistics::DiscoveryTime"; + eprosima::fastcdr::optional type_ann_builtin_DiscoveryTime; + eprosima::fastcdr::optional ann_custom_DiscoveryTime; + CompleteTypeDetail detail_DiscoveryTime = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_DiscoveryTime, ann_custom_DiscoveryTime, type_name_DiscoveryTime.to_string()); + CompleteStructHeader header_DiscoveryTime; + header_DiscoveryTime = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_DiscoveryTime); + CompleteStructMemberSeq member_seq_DiscoveryTime; + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_local_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_local_participant_guid; + MemberId member_id_local_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_local_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_local_participant_guid, member_flags_local_participant_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure local_participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_local_participant_guid = "local_participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_local_participant_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_local_participant_guid; + eprosima::fastcdr::optional unit_local_participant_guid; + eprosima::fastcdr::optional min_local_participant_guid; + eprosima::fastcdr::optional max_local_participant_guid; + eprosima::fastcdr::optional hash_id_local_participant_guid; + if (unit_local_participant_guid.has_value() || min_local_participant_guid.has_value() || max_local_participant_guid.has_value() || hash_id_local_participant_guid.has_value()) + { + member_ann_builtin_local_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_local_participant_guid, min_local_participant_guid, max_local_participant_guid, hash_id_local_participant_guid); + } + if (!tmp_ann_custom_local_participant_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_local_participant_guid; + } + CompleteMemberDetail detail_local_participant_guid = TypeObjectUtils::build_complete_member_detail(name_local_participant_guid, member_ann_builtin_local_participant_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_local_participant_guid = TypeObjectUtils::build_complete_struct_member(common_local_participant_guid, detail_local_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_local_participant_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_remote_entity_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_remote_entity_guid; + MemberId member_id_remote_entity_guid = 0x00000001; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_remote_entity_guid = TypeObjectUtils::build_common_struct_member(member_id_remote_entity_guid, member_flags_remote_entity_guid, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure remote_entity_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_remote_entity_guid = "remote_entity_guid"; + eprosima::fastcdr::optional member_ann_builtin_remote_entity_guid; + ann_custom_DiscoveryTime.reset(); + AppliedAnnotationSeq tmp_ann_custom_remote_entity_guid; + eprosima::fastcdr::optional unit_remote_entity_guid; + eprosima::fastcdr::optional min_remote_entity_guid; + eprosima::fastcdr::optional max_remote_entity_guid; + eprosima::fastcdr::optional hash_id_remote_entity_guid; + if (unit_remote_entity_guid.has_value() || min_remote_entity_guid.has_value() || max_remote_entity_guid.has_value() || hash_id_remote_entity_guid.has_value()) + { + member_ann_builtin_remote_entity_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_remote_entity_guid, min_remote_entity_guid, max_remote_entity_guid, hash_id_remote_entity_guid); + } + if (!tmp_ann_custom_remote_entity_guid.empty()) + { + ann_custom_DiscoveryTime = tmp_ann_custom_remote_entity_guid; + } + CompleteMemberDetail detail_remote_entity_guid = TypeObjectUtils::build_complete_member_detail(name_remote_entity_guid, member_ann_builtin_remote_entity_guid, ann_custom_DiscoveryTime); + CompleteStructMember member_remote_entity_guid = TypeObjectUtils::build_complete_struct_member(common_remote_entity_guid, detail_remote_entity_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_remote_entity_guid); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "time Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_time = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_time; + MemberId member_id_time = 0x00000002; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_time = TypeObjectUtils::build_common_struct_member(member_id_time, member_flags_time, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure time member TypeIdentifier inconsistent."); + return; + } + MemberName name_time = "time"; + eprosima::fastcdr::optional member_ann_builtin_time; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_time = TypeObjectUtils::build_complete_member_detail(name_time, member_ann_builtin_time, ann_custom_DiscoveryTime); + CompleteStructMember member_time = TypeObjectUtils::build_complete_struct_member(common_time, detail_time); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_time); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000003; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_DiscoveryTime); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_host); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000004; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_DiscoveryTime); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_user); + } + { + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000005; + if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1()._d() || TK_NONE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier1()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_DiscoveryTime.type_identifier2()._d() && + (EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_DiscoveryTime.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_DiscoveryTime.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_DiscoveryTime.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_DiscoveryTime); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_DiscoveryTime, member_process); + } + CompleteStructType struct_type_DiscoveryTime = TypeObjectUtils::build_complete_struct_type(struct_flags_DiscoveryTime, header_DiscoveryTime, member_seq_DiscoveryTime); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_DiscoveryTime, type_name_DiscoveryTime.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime already registered in TypeObjectRegistry for a different type."); + } + return_code_DiscoveryTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::DiscoveryTime", type_ids_DiscoveryTime); + if (return_code_DiscoveryTime != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::DiscoveryTime: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_discovery_time = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_discovery_time; + TypeObjectUtils::add_union_case_label(label_seq_discovery_time, static_cast(EventKind::DISCOVERED_ENTITY)); + CommonUnionMember common_discovery_time; + MemberId member_id_discovery_time = 0x00000006; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_discovery_time = TypeObjectUtils::build_common_union_member(member_id_discovery_time, member_flags_discovery_time, type_ids_Data.type_identifier1(), + label_seq_discovery_time); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_discovery_time = TypeObjectUtils::build_common_union_member(member_id_discovery_time, member_flags_discovery_time, type_ids_Data.type_identifier2(), + label_seq_discovery_time); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union discovery_time member TypeIdentifier inconsistent."); + return; + } + MemberName name_discovery_time = "discovery_time"; + eprosima::fastcdr::optional member_ann_builtin_discovery_time; + ann_custom_Data.reset(); + CompleteMemberDetail detail_discovery_time = TypeObjectUtils::build_complete_member_detail(name_discovery_time, member_ann_builtin_discovery_time, ann_custom_Data); + CompleteUnionMember member_discovery_time = TypeObjectUtils::build_complete_union_member(common_discovery_time, detail_discovery_time); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_discovery_time); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentityCount = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentityCount; + TypeIdentifierPair type_ids_SampleIdentityCount; + QualifiedTypeName type_name_SampleIdentityCount = "eprosima::fastdds::statistics::SampleIdentityCount"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentityCount; + eprosima::fastcdr::optional ann_custom_SampleIdentityCount; + CompleteTypeDetail detail_SampleIdentityCount = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentityCount, ann_custom_SampleIdentityCount, type_name_SampleIdentityCount.to_string()); + CompleteStructHeader header_SampleIdentityCount; + header_SampleIdentityCount = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentityCount); + CompleteStructMemberSeq member_seq_SampleIdentityCount; + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SampleIdentity_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SampleIdentity_s; + TypeIdentifierPair type_ids_SampleIdentity_s; + QualifiedTypeName type_name_SampleIdentity_s = "eprosima::fastdds::statistics::detail::SampleIdentity_s"; + eprosima::fastcdr::optional type_ann_builtin_SampleIdentity_s; + eprosima::fastcdr::optional ann_custom_SampleIdentity_s; + CompleteTypeDetail detail_SampleIdentity_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SampleIdentity_s, ann_custom_SampleIdentity_s, type_name_SampleIdentity_s.to_string()); + CompleteStructHeader header_SampleIdentity_s; + header_SampleIdentity_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SampleIdentity_s); + CompleteStructMemberSeq member_seq_SampleIdentity_s; + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_writer_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_writer_guid; + MemberId member_id_writer_guid = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_writer_guid = TypeObjectUtils::build_common_struct_member(member_id_writer_guid, member_flags_writer_guid, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure writer_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_writer_guid = "writer_guid"; + eprosima::fastcdr::optional member_ann_builtin_writer_guid; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_writer_guid = TypeObjectUtils::build_complete_member_detail(name_writer_guid, member_ann_builtin_writer_guid, ann_custom_SampleIdentity_s); + CompleteStructMember member_writer_guid = TypeObjectUtils::build_complete_struct_member(common_writer_guid, detail_writer_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_writer_guid); + } + { + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SampleIdentity_s); + + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_SequenceNumber_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_SequenceNumber_s; + TypeIdentifierPair type_ids_SequenceNumber_s; + QualifiedTypeName type_name_SequenceNumber_s = "eprosima::fastdds::statistics::detail::SequenceNumber_s"; + eprosima::fastcdr::optional type_ann_builtin_SequenceNumber_s; + eprosima::fastcdr::optional ann_custom_SequenceNumber_s; + CompleteTypeDetail detail_SequenceNumber_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_SequenceNumber_s, ann_custom_SequenceNumber_s, type_name_SequenceNumber_s.to_string()); + CompleteStructHeader header_SequenceNumber_s; + header_SequenceNumber_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_SequenceNumber_s); + CompleteStructMemberSeq member_seq_SequenceNumber_s; + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "high Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_high = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_high; + MemberId member_id_high = 0x00000000; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_high = TypeObjectUtils::build_common_struct_member(member_id_high, member_flags_high, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure high member TypeIdentifier inconsistent."); + return; + } + MemberName name_high = "high"; + eprosima::fastcdr::optional member_ann_builtin_high; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_high = TypeObjectUtils::build_complete_member_detail(name_high, member_ann_builtin_high, ann_custom_SequenceNumber_s); + CompleteStructMember member_high = TypeObjectUtils::build_complete_struct_member(common_high, detail_high); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_high); + } + { + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_SequenceNumber_s); + + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "low Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_low = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_low; + MemberId member_id_low = 0x00000001; + if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1()._d() || TK_NONE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SequenceNumber_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SequenceNumber_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_low = TypeObjectUtils::build_common_struct_member(member_id_low, member_flags_low, type_ids_SequenceNumber_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure low member TypeIdentifier inconsistent."); + return; + } + MemberName name_low = "low"; + eprosima::fastcdr::optional member_ann_builtin_low; + ann_custom_SequenceNumber_s.reset(); + CompleteMemberDetail detail_low = TypeObjectUtils::build_complete_member_detail(name_low, member_ann_builtin_low, ann_custom_SequenceNumber_s); + CompleteStructMember member_low = TypeObjectUtils::build_complete_struct_member(common_low, detail_low); + TypeObjectUtils::add_complete_struct_member(member_seq_SequenceNumber_s, member_low); + } + CompleteStructType struct_type_SequenceNumber_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SequenceNumber_s, header_SequenceNumber_s, member_seq_SequenceNumber_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SequenceNumber_s, type_name_SequenceNumber_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SequenceNumber_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SequenceNumber_s", type_ids_SequenceNumber_s); + if (return_code_SequenceNumber_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SequenceNumber_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sequence_number = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sequence_number; + MemberId member_id_sequence_number = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentity_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentity_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sequence_number = TypeObjectUtils::build_common_struct_member(member_id_sequence_number, member_flags_sequence_number, type_ids_SampleIdentity_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sequence_number member TypeIdentifier inconsistent."); + return; + } + MemberName name_sequence_number = "sequence_number"; + eprosima::fastcdr::optional member_ann_builtin_sequence_number; + ann_custom_SampleIdentity_s.reset(); + CompleteMemberDetail detail_sequence_number = TypeObjectUtils::build_complete_member_detail(name_sequence_number, member_ann_builtin_sequence_number, ann_custom_SampleIdentity_s); + CompleteStructMember member_sequence_number = TypeObjectUtils::build_complete_struct_member(common_sequence_number, detail_sequence_number); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentity_s, member_sequence_number); + } + CompleteStructType struct_type_SampleIdentity_s = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentity_s, header_SampleIdentity_s, member_seq_SampleIdentity_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentity_s, type_name_SampleIdentity_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentity_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::SampleIdentity_s", type_ids_SampleIdentity_s); + if (return_code_SampleIdentity_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::SampleIdentity_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_sample_id = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_sample_id; + MemberId member_id_sample_id = 0x00000000; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_id = TypeObjectUtils::build_common_struct_member(member_id_sample_id, member_flags_sample_id, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sample_id member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_id = "sample_id"; + eprosima::fastcdr::optional member_ann_builtin_sample_id; + ann_custom_SampleIdentityCount.reset(); + AppliedAnnotationSeq tmp_ann_custom_sample_id; + eprosima::fastcdr::optional unit_sample_id; + eprosima::fastcdr::optional min_sample_id; + eprosima::fastcdr::optional max_sample_id; + eprosima::fastcdr::optional hash_id_sample_id; + if (unit_sample_id.has_value() || min_sample_id.has_value() || max_sample_id.has_value() || hash_id_sample_id.has_value()) + { + member_ann_builtin_sample_id = TypeObjectUtils::build_applied_builtin_member_annotations(unit_sample_id, min_sample_id, max_sample_id, hash_id_sample_id); + } + if (!tmp_ann_custom_sample_id.empty()) + { + ann_custom_SampleIdentityCount = tmp_ann_custom_sample_id; + } + CompleteMemberDetail detail_sample_id = TypeObjectUtils::build_complete_member_detail(name_sample_id, member_ann_builtin_sample_id, ann_custom_SampleIdentityCount); + CompleteStructMember member_sample_id = TypeObjectUtils::build_complete_struct_member(common_sample_id, detail_sample_id); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_sample_id); + } + { + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_SampleIdentityCount); + + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "count Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_count = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_count; + MemberId member_id_count = 0x00000001; + if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1()._d() || TK_NONE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier1()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_SampleIdentityCount.type_identifier2()._d() && + (EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_SampleIdentityCount.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_count = TypeObjectUtils::build_common_struct_member(member_id_count, member_flags_count, type_ids_SampleIdentityCount.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure count member TypeIdentifier inconsistent."); + return; + } + MemberName name_count = "count"; + eprosima::fastcdr::optional member_ann_builtin_count; + ann_custom_SampleIdentityCount.reset(); + CompleteMemberDetail detail_count = TypeObjectUtils::build_complete_member_detail(name_count, member_ann_builtin_count, ann_custom_SampleIdentityCount); + CompleteStructMember member_count = TypeObjectUtils::build_complete_struct_member(common_count, detail_count); + TypeObjectUtils::add_complete_struct_member(member_seq_SampleIdentityCount, member_count); + } + CompleteStructType struct_type_SampleIdentityCount = TypeObjectUtils::build_complete_struct_type(struct_flags_SampleIdentityCount, header_SampleIdentityCount, member_seq_SampleIdentityCount); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_SampleIdentityCount, type_name_SampleIdentityCount.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount already registered in TypeObjectRegistry for a different type."); + } + return_code_SampleIdentityCount = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::SampleIdentityCount", type_ids_SampleIdentityCount); + if (return_code_SampleIdentityCount != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::SampleIdentityCount: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_sample_identity_count = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_sample_identity_count; + TypeObjectUtils::add_union_case_label(label_seq_sample_identity_count, static_cast(EventKind::SAMPLE_DATAS)); + CommonUnionMember common_sample_identity_count; + MemberId member_id_sample_identity_count = 0x00000007; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sample_identity_count = TypeObjectUtils::build_common_union_member(member_id_sample_identity_count, member_flags_sample_identity_count, type_ids_Data.type_identifier1(), + label_seq_sample_identity_count); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sample_identity_count = TypeObjectUtils::build_common_union_member(member_id_sample_identity_count, member_flags_sample_identity_count, type_ids_Data.type_identifier2(), + label_seq_sample_identity_count); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union sample_identity_count member TypeIdentifier inconsistent."); + return; + } + MemberName name_sample_identity_count = "sample_identity_count"; + eprosima::fastcdr::optional member_ann_builtin_sample_identity_count; + ann_custom_Data.reset(); + CompleteMemberDetail detail_sample_identity_count = TypeObjectUtils::build_complete_member_detail(name_sample_identity_count, member_ann_builtin_sample_identity_count, ann_custom_Data); + CompleteUnionMember member_sample_identity_count = TypeObjectUtils::build_complete_union_member(common_sample_identity_count, detail_sample_identity_count); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_sample_identity_count); + } + { + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_Data); + + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_PhysicalData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_PhysicalData; + TypeIdentifierPair type_ids_PhysicalData; + QualifiedTypeName type_name_PhysicalData = "eprosima::fastdds::statistics::PhysicalData"; + eprosima::fastcdr::optional type_ann_builtin_PhysicalData; + eprosima::fastcdr::optional ann_custom_PhysicalData; + CompleteTypeDetail detail_PhysicalData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PhysicalData, ann_custom_PhysicalData, type_name_PhysicalData.to_string()); + CompleteStructHeader header_PhysicalData; + header_PhysicalData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_PhysicalData); + CompleteStructMemberSeq member_seq_PhysicalData; + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GUID_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GUID_s; + TypeIdentifierPair type_ids_GUID_s; + QualifiedTypeName type_name_GUID_s = "eprosima::fastdds::statistics::detail::GUID_s"; + eprosima::fastcdr::optional type_ann_builtin_GUID_s; + eprosima::fastcdr::optional ann_custom_GUID_s; + CompleteTypeDetail detail_GUID_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GUID_s, ann_custom_GUID_s, type_name_GUID_s.to_string()); + CompleteStructHeader header_GUID_s; + header_GUID_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GUID_s); + CompleteStructMemberSeq member_seq_GUID_s; + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_GuidPrefix_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_GuidPrefix_s; + TypeIdentifierPair type_ids_GuidPrefix_s; + QualifiedTypeName type_name_GuidPrefix_s = "eprosima::fastdds::statistics::detail::GuidPrefix_s"; + eprosima::fastcdr::optional type_ann_builtin_GuidPrefix_s; + eprosima::fastcdr::optional ann_custom_GuidPrefix_s; + CompleteTypeDetail detail_GuidPrefix_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GuidPrefix_s, ann_custom_GuidPrefix_s, type_name_GuidPrefix_s.to_string()); + CompleteStructHeader header_GuidPrefix_s; + header_GuidPrefix_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GuidPrefix_s); + CompleteStructMemberSeq member_seq_GuidPrefix_s; + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_GuidPrefix_s); + + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_12 {nullptr}; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_12 = new TypeIdentifier(type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_12 = EK_COMPLETE; + if (TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_12 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_12 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_12 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_12, element_flags_anonymous_array_uint8_t_12); + std::string type_id_kind_anonymous_array_uint8_t_12("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_12 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(12)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_12, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_12)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_12")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_12", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_12: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1()._d() || TK_NONE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GuidPrefix_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GuidPrefix_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_GuidPrefix_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_GuidPrefix_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_GuidPrefix_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_GuidPrefix_s, member_value); + } + CompleteStructType struct_type_GuidPrefix_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GuidPrefix_s, header_GuidPrefix_s, member_seq_GuidPrefix_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GuidPrefix_s, type_name_GuidPrefix_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GuidPrefix_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GuidPrefix_s", type_ids_GuidPrefix_s); + if (return_code_GuidPrefix_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GuidPrefix_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_guidPrefix = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_guidPrefix; + MemberId member_id_guidPrefix = 0x00000000; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_guidPrefix = TypeObjectUtils::build_common_struct_member(member_id_guidPrefix, member_flags_guidPrefix, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure guidPrefix member TypeIdentifier inconsistent."); + return; + } + MemberName name_guidPrefix = "guidPrefix"; + eprosima::fastcdr::optional member_ann_builtin_guidPrefix; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_guidPrefix = TypeObjectUtils::build_complete_member_detail(name_guidPrefix, member_ann_builtin_guidPrefix, ann_custom_GUID_s); + CompleteStructMember member_guidPrefix = TypeObjectUtils::build_complete_struct_member(common_guidPrefix, detail_guidPrefix); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_guidPrefix); + } + { + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_GUID_s); + + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_EntityId_s = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_EntityId_s; + TypeIdentifierPair type_ids_EntityId_s; + QualifiedTypeName type_name_EntityId_s = "eprosima::fastdds::statistics::detail::EntityId_s"; + eprosima::fastcdr::optional type_ann_builtin_EntityId_s; + eprosima::fastcdr::optional ann_custom_EntityId_s; + CompleteTypeDetail detail_EntityId_s = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_EntityId_s, ann_custom_EntityId_s, type_name_EntityId_s.to_string()); + CompleteStructHeader header_EntityId_s; + header_EntityId_s = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_EntityId_s); + CompleteStructMemberSeq member_seq_EntityId_s; + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_EntityId_s); + + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_4 {nullptr}; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_4 = new TypeIdentifier(type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_4 = EK_COMPLETE; + if (TK_NONE == type_ids_EntityId_s.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_4 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_4 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_4 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_4, element_flags_anonymous_array_uint8_t_4); + std::string type_id_kind_anonymous_array_uint8_t_4("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_4 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(4)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_4, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_4)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_4")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_4", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_4: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_value; + MemberId member_id_value = 0x00000000; + if (EK_COMPLETE == type_ids_EntityId_s.type_identifier1()._d() || TK_NONE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_EntityId_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_EntityId_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_EntityId_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_value = TypeObjectUtils::build_common_struct_member(member_id_value, member_flags_value, type_ids_EntityId_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure value member TypeIdentifier inconsistent."); + return; + } + MemberName name_value = "value"; + eprosima::fastcdr::optional member_ann_builtin_value; + ann_custom_EntityId_s.reset(); + CompleteMemberDetail detail_value = TypeObjectUtils::build_complete_member_detail(name_value, member_ann_builtin_value, ann_custom_EntityId_s); + CompleteStructMember member_value = TypeObjectUtils::build_complete_struct_member(common_value, detail_value); + TypeObjectUtils::add_complete_struct_member(member_seq_EntityId_s, member_value); + } + CompleteStructType struct_type_EntityId_s = TypeObjectUtils::build_complete_struct_type(struct_flags_EntityId_s, header_EntityId_s, member_seq_EntityId_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_EntityId_s, type_name_EntityId_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s already registered in TypeObjectRegistry for a different type."); + } + return_code_EntityId_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::EntityId_s", type_ids_EntityId_s); + if (return_code_EntityId_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::EntityId_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_entityId = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_entityId; + MemberId member_id_entityId = 0x00000001; + if (EK_COMPLETE == type_ids_GUID_s.type_identifier1()._d() || TK_NONE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier1()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier1()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_GUID_s.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_GUID_s.type_identifier2()._d() && + EK_COMPLETE == type_ids_GUID_s.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_GUID_s.type_identifier2()._d() && + (EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_GUID_s.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_entityId = TypeObjectUtils::build_common_struct_member(member_id_entityId, member_flags_entityId, type_ids_GUID_s.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure entityId member TypeIdentifier inconsistent."); + return; + } + MemberName name_entityId = "entityId"; + eprosima::fastcdr::optional member_ann_builtin_entityId; + ann_custom_GUID_s.reset(); + CompleteMemberDetail detail_entityId = TypeObjectUtils::build_complete_member_detail(name_entityId, member_ann_builtin_entityId, ann_custom_GUID_s); + CompleteStructMember member_entityId = TypeObjectUtils::build_complete_struct_member(common_entityId, detail_entityId); + TypeObjectUtils::add_complete_struct_member(member_seq_GUID_s, member_entityId); + } + CompleteStructType struct_type_GUID_s = TypeObjectUtils::build_complete_struct_type(struct_flags_GUID_s, header_GUID_s, member_seq_GUID_s); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_GUID_s, type_name_GUID_s.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s already registered in TypeObjectRegistry for a different type."); + } + return_code_GUID_s = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::detail::GUID_s", type_ids_GUID_s); + if (return_code_GUID_s != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::detail::GUID_s: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_participant_guid = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_participant_guid; + MemberId member_id_participant_guid = 0x00000000; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_participant_guid = TypeObjectUtils::build_common_struct_member(member_id_participant_guid, member_flags_participant_guid, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure participant_guid member TypeIdentifier inconsistent."); + return; + } + MemberName name_participant_guid = "participant_guid"; + eprosima::fastcdr::optional member_ann_builtin_participant_guid; + ann_custom_PhysicalData.reset(); + AppliedAnnotationSeq tmp_ann_custom_participant_guid; + eprosima::fastcdr::optional unit_participant_guid; + eprosima::fastcdr::optional min_participant_guid; + eprosima::fastcdr::optional max_participant_guid; + eprosima::fastcdr::optional hash_id_participant_guid; + if (unit_participant_guid.has_value() || min_participant_guid.has_value() || max_participant_guid.has_value() || hash_id_participant_guid.has_value()) + { + member_ann_builtin_participant_guid = TypeObjectUtils::build_applied_builtin_member_annotations(unit_participant_guid, min_participant_guid, max_participant_guid, hash_id_participant_guid); + } + if (!tmp_ann_custom_participant_guid.empty()) + { + ann_custom_PhysicalData = tmp_ann_custom_participant_guid; + } + CompleteMemberDetail detail_participant_guid = TypeObjectUtils::build_complete_member_detail(name_participant_guid, member_ann_builtin_participant_guid, ann_custom_PhysicalData); + CompleteStructMember member_participant_guid = TypeObjectUtils::build_complete_struct_member(common_participant_guid, detail_participant_guid); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_participant_guid); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_host = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_host; + MemberId member_id_host = 0x00000001; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_host = TypeObjectUtils::build_common_struct_member(member_id_host, member_flags_host, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure host member TypeIdentifier inconsistent."); + return; + } + MemberName name_host = "host"; + eprosima::fastcdr::optional member_ann_builtin_host; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_host = TypeObjectUtils::build_complete_member_detail(name_host, member_ann_builtin_host, ann_custom_PhysicalData); + CompleteStructMember member_host = TypeObjectUtils::build_complete_struct_member(common_host, detail_host); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_host); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_user = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_user; + MemberId member_id_user = 0x00000002; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_user = TypeObjectUtils::build_common_struct_member(member_id_user, member_flags_user, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure user member TypeIdentifier inconsistent."); + return; + } + MemberName name_user = "user"; + eprosima::fastcdr::optional member_ann_builtin_user; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_user = TypeObjectUtils::build_complete_member_detail(name_user, member_ann_builtin_user, ann_custom_PhysicalData); + CompleteStructMember member_user = TypeObjectUtils::build_complete_struct_member(common_user, detail_user); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_user); + } + { + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_process = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_process; + MemberId member_id_process = 0x00000003; + if (EK_COMPLETE == type_ids_PhysicalData.type_identifier1()._d() || TK_NONE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_PhysicalData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_PhysicalData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_PhysicalData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_process = TypeObjectUtils::build_common_struct_member(member_id_process, member_flags_process, type_ids_PhysicalData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure process member TypeIdentifier inconsistent."); + return; + } + MemberName name_process = "process"; + eprosima::fastcdr::optional member_ann_builtin_process; + ann_custom_PhysicalData.reset(); + CompleteMemberDetail detail_process = TypeObjectUtils::build_complete_member_detail(name_process, member_ann_builtin_process, ann_custom_PhysicalData); + CompleteStructMember member_process = TypeObjectUtils::build_complete_struct_member(common_process, detail_process); + TypeObjectUtils::add_complete_struct_member(member_seq_PhysicalData, member_process); + } + CompleteStructType struct_type_PhysicalData = TypeObjectUtils::build_complete_struct_type(struct_flags_PhysicalData, header_PhysicalData, member_seq_PhysicalData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_PhysicalData, type_name_PhysicalData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData already registered in TypeObjectRegistry for a different type."); + } + return_code_PhysicalData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::PhysicalData", type_ids_PhysicalData); + if (return_code_PhysicalData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::PhysicalData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + UnionMemberFlag member_flags_physical_data = TypeObjectUtils::build_union_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false); + UnionCaseLabelSeq label_seq_physical_data; + TypeObjectUtils::add_union_case_label(label_seq_physical_data, static_cast(EventKind::PHYSICAL_DATA)); + CommonUnionMember common_physical_data; + MemberId member_id_physical_data = 0x00000008; + if (EK_COMPLETE == type_ids_Data.type_identifier1()._d() || TK_NONE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier1()._d() && + EK_COMPLETE == type_ids_Data.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_physical_data = TypeObjectUtils::build_common_union_member(member_id_physical_data, member_flags_physical_data, type_ids_Data.type_identifier1(), + label_seq_physical_data); + } + else if (EK_COMPLETE == type_ids_Data.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Data.type_identifier2()._d() && + EK_COMPLETE == type_ids_Data.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Data.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Data.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_physical_data = TypeObjectUtils::build_common_union_member(member_id_physical_data, member_flags_physical_data, type_ids_Data.type_identifier2(), + label_seq_physical_data); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Union physical_data member TypeIdentifier inconsistent."); + return; + } + MemberName name_physical_data = "physical_data"; + eprosima::fastcdr::optional member_ann_builtin_physical_data; + ann_custom_Data.reset(); + CompleteMemberDetail detail_physical_data = TypeObjectUtils::build_complete_member_detail(name_physical_data, member_ann_builtin_physical_data, ann_custom_Data); + CompleteUnionMember member_physical_data = TypeObjectUtils::build_complete_union_member(common_physical_data, detail_physical_data); + TypeObjectUtils::add_complete_union_member(member_seq_Data, member_physical_data); + } + CompleteUnionType union_type_Data = TypeObjectUtils::build_complete_union_type(union_flags_Data, header_Data, discriminator_Data, + member_seq_Data); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_union_type_object(union_type_Data, type_name_Data.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data already registered in TypeObjectRegistry for a different type."); + } + return_code_Data = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "eprosima::fastdds::statistics::Data", type_ids_Data); + if (return_code_Data != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "eprosima::fastdds::statistics::Data: Given Union TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + diff --git a/test/blackbox/types/statistics/typesTypeObjectSupport.hpp b/test/blackbox/types/statistics/typesTypeObjectSupport.hpp new file mode 100644 index 00000000000..172f8ea496c --- /dev/null +++ b/test/blackbox/types/statistics/typesTypeObjectSupport.hpp @@ -0,0 +1,181 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file typesTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_types_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +namespace eprosima { +namespace fastdds { +namespace statistics { +namespace detail { +/** + * @brief Register eprosima_fastdds_statistics_detail_EntityId_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_EntityId_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_GuidPrefix_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_GuidPrefix_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_GUID_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_GUID_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_SequenceNumber_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_SequenceNumber_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_SampleIdentity_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_SampleIdentity_s_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_detail_Locator_s related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_detail_Locator_s_type_identifier(); + +} // namespace detail + +/** + * @brief Register eprosima_fastdds_statistics_DiscoveryTime related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_DiscoveryTime_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_EntityCount related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_EntityCount_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_SampleIdentityCount related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_SampleIdentityCount_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_Entity2LocatorTraffic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Entity2LocatorTraffic_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_WriterReaderData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_WriterReaderData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_Locator2LocatorData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Locator2LocatorData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_EntityData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_EntityData_type_identifier(); + +/** + * @brief Register eprosima_fastdds_statistics_PhysicalData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_PhysicalData_type_identifier(); + +namespace EventKind { +} // namespace EventKind + +/** + * @brief Register eprosima_fastdds_statistics_Data related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_eprosima_fastdds_statistics_Data_type_identifier(); + +} // namespace statistics + +} // namespace fastdds + +} // namespace eprosima + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/blackbox/types/statistics/typesv1.cxx b/test/blackbox/types/statistics/typesv1.cxx deleted file mode 100644 index 80c55edc2e6..00000000000 --- a/test/blackbox/types/statistics/typesv1.cxx +++ /dev/null @@ -1,4757 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; -#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; - -#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; - -#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; -#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; -#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; -#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; -#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; -#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; -#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; -#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; -#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; -#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; - - -namespace eprosima { - -namespace fastdds { - -namespace statistics { - -namespace detail { - - - -EntityId_s::EntityId_s() -{ - // octet m_value - memset(&m_value, 0, ((4)) * 1); - -} - -EntityId_s::~EntityId_s() -{ -} - -EntityId_s::EntityId_s( - const EntityId_s& x) -{ - m_value = x.m_value; - -} - -EntityId_s::EntityId_s( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); - -} - -EntityId_s& EntityId_s::operator =( - const EntityId_s& x) -{ - m_value = x.m_value; - - return *this; -} - -EntityId_s& EntityId_s::operator =( - EntityId_s&& x) noexcept -{ - m_value = std::move(x.m_value); - - return *this; -} - -bool EntityId_s::operator ==( - const EntityId_s& x) const -{ - return (m_value == x.m_value); -} - -bool EntityId_s::operator !=( - const EntityId_s& x) const -{ - return !(*this == x); -} - -size_t EntityId_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; -} - -size_t EntityId_s::getCdrSerializedSize( - const EntityId_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void EntityId_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_value; - - -} - -void EntityId_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_value; - - -} - - -bool EntityId_s::isKeyDefined() -{ - return false; -} - -void EntityId_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void EntityId_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void EntityId_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& EntityId_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& EntityId_s::value() -{ - return m_value; -} - - - - - -GuidPrefix_s::GuidPrefix_s() -{ - // octet m_value - memset(&m_value, 0, ((12)) * 1); - -} - -GuidPrefix_s::~GuidPrefix_s() -{ -} - -GuidPrefix_s::GuidPrefix_s( - const GuidPrefix_s& x) -{ - m_value = x.m_value; - -} - -GuidPrefix_s::GuidPrefix_s( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); - -} - -GuidPrefix_s& GuidPrefix_s::operator =( - const GuidPrefix_s& x) -{ - m_value = x.m_value; - - return *this; -} - -GuidPrefix_s& GuidPrefix_s::operator =( - GuidPrefix_s&& x) noexcept -{ - m_value = std::move(x.m_value); - - return *this; -} - -bool GuidPrefix_s::operator ==( - const GuidPrefix_s& x) const -{ - return (m_value == x.m_value); -} - -bool GuidPrefix_s::operator !=( - const GuidPrefix_s& x) const -{ - return !(*this == x); -} - -size_t GuidPrefix_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; -} - -size_t GuidPrefix_s::getCdrSerializedSize( - const GuidPrefix_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((12)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void GuidPrefix_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_value; - - -} - -void GuidPrefix_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_value; - - -} - - -bool GuidPrefix_s::isKeyDefined() -{ - return false; -} - -void GuidPrefix_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ -void GuidPrefix_s::value( - const std::array& _value) -{ - m_value = _value; -} - -/*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ -void GuidPrefix_s::value( - std::array&& _value) -{ - m_value = std::move(_value); -} - -/*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ -const std::array& GuidPrefix_s::value() const -{ - return m_value; -} - -/*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ -std::array& GuidPrefix_s::value() -{ - return m_value; -} - - - - - -GUID_s::GUID_s() -{ - // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix - - // eprosima::fastdds::statistics::detail::EntityId_s m_entityId - - -} - -GUID_s::~GUID_s() -{ -} - -GUID_s::GUID_s( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - - - m_entityId = x.m_entityId; - -} - -GUID_s::GUID_s( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - - - m_entityId = std::move(x.m_entityId); - -} - -GUID_s& GUID_s::operator =( - const GUID_s& x) -{ - m_guidPrefix = x.m_guidPrefix; - - - m_entityId = x.m_entityId; - - return *this; -} - -GUID_s& GUID_s::operator =( - GUID_s&& x) noexcept -{ - m_guidPrefix = std::move(x.m_guidPrefix); - - - m_entityId = std::move(x.m_entityId); - - return *this; -} - -bool GUID_s::operator ==( - const GUID_s& x) const -{ - return (m_guidPrefix == x.m_guidPrefix && - m_entityId == x.m_entityId); -} - -bool GUID_s::operator !=( - const GUID_s& x) const -{ - return !(*this == x); -} - -size_t GUID_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; -} - -size_t GUID_s::getCdrSerializedSize( - const GUID_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize(data.guidPrefix(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize(data.entityId(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void GUID_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guidPrefix; - - scdr << m_entityId; - -} - -void GUID_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guidPrefix; - - - - dcdr >> m_entityId; - - -} - - -bool GUID_s::isKeyDefined() -{ - return false; -} - -void GUID_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ -void GUID_s::guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) -{ - m_guidPrefix = _guidPrefix; -} - -/*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ -void GUID_s::guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) -{ - m_guidPrefix = std::move(_guidPrefix); -} - -/*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const -{ - return m_guidPrefix; -} - -/*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() -{ - return m_guidPrefix; -} - - -/*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ -void GUID_s::entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) -{ - m_entityId = _entityId; -} - -/*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ -void GUID_s::entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) -{ - m_entityId = std::move(_entityId); -} - -/*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ -const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const -{ - return m_entityId; -} - -/*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ -eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() -{ - return m_entityId; -} - - - - - -SequenceNumber_s::SequenceNumber_s() -{ - // long m_high - m_high = 0; - // unsigned long m_low - m_low = 0; - -} - -SequenceNumber_s::~SequenceNumber_s() -{ -} - -SequenceNumber_s::SequenceNumber_s( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - - - m_low = x.m_low; - -} - -SequenceNumber_s::SequenceNumber_s( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - - - m_low = x.m_low; - -} - -SequenceNumber_s& SequenceNumber_s::operator =( - const SequenceNumber_s& x) -{ - m_high = x.m_high; - - - m_low = x.m_low; - - return *this; -} - -SequenceNumber_s& SequenceNumber_s::operator =( - SequenceNumber_s&& x) noexcept -{ - m_high = x.m_high; - - - m_low = x.m_low; - - return *this; -} - -bool SequenceNumber_s::operator ==( - const SequenceNumber_s& x) const -{ - return (m_high == x.m_high && - m_low == x.m_low); -} - -bool SequenceNumber_s::operator !=( - const SequenceNumber_s& x) const -{ - return !(*this == x); -} - -size_t SequenceNumber_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; -} - -size_t SequenceNumber_s::getCdrSerializedSize( - const SequenceNumber_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void SequenceNumber_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_high; - - scdr << m_low; - -} - -void SequenceNumber_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_high; - - - - dcdr >> m_low; - - -} - - -bool SequenceNumber_s::isKeyDefined() -{ - return false; -} - -void SequenceNumber_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ -void SequenceNumber_s::high( - int32_t _high) -{ - m_high = _high; -} - -/*! - * @brief This function returns the value of member high - * @return Value of member high - */ -int32_t SequenceNumber_s::high() const -{ - return m_high; -} - -/*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ -int32_t& SequenceNumber_s::high() -{ - return m_high; -} - - -/*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ -void SequenceNumber_s::low( - uint32_t _low) -{ - m_low = _low; -} - -/*! - * @brief This function returns the value of member low - * @return Value of member low - */ -uint32_t SequenceNumber_s::low() const -{ - return m_low; -} - -/*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ -uint32_t& SequenceNumber_s::low() -{ - return m_low; -} - - - - - -SampleIdentity_s::SampleIdentity_s() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number - - -} - -SampleIdentity_s::~SampleIdentity_s() -{ -} - -SampleIdentity_s::SampleIdentity_s( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_sequence_number = x.m_sequence_number; - -} - -SampleIdentity_s::SampleIdentity_s( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_sequence_number = std::move(x.m_sequence_number); - -} - -SampleIdentity_s& SampleIdentity_s::operator =( - const SampleIdentity_s& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_sequence_number = x.m_sequence_number; - - return *this; -} - -SampleIdentity_s& SampleIdentity_s::operator =( - SampleIdentity_s&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_sequence_number = std::move(x.m_sequence_number); - - return *this; -} - -bool SampleIdentity_s::operator ==( - const SampleIdentity_s& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_sequence_number == x.m_sequence_number); -} - -bool SampleIdentity_s::operator !=( - const SampleIdentity_s& x) const -{ - return !(*this == x); -} - -size_t SampleIdentity_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; -} - -size_t SampleIdentity_s::getCdrSerializedSize( - const SampleIdentity_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize(data.sequence_number(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SampleIdentity_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_writer_guid; - - scdr << m_sequence_number; - -} - -void SampleIdentity_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_writer_guid; - - - - dcdr >> m_sequence_number; - - -} - - -bool SampleIdentity_s::isKeyDefined() -{ - return false; -} - -void SampleIdentity_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void SampleIdentity_s::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void SampleIdentity_s::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ -void SampleIdentity_s::sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) -{ - m_sequence_number = _sequence_number; -} - -/*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ -void SampleIdentity_s::sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) -{ - m_sequence_number = std::move(_sequence_number); -} - -/*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const -{ - return m_sequence_number; -} - -/*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() -{ - return m_sequence_number; -} - - - - - -Locator_s::Locator_s() -{ - // long m_kind - m_kind = 0; - // unsigned long m_port - m_port = 0; - // octet m_address - memset(&m_address, 0, ((16)) * 1); - -} - -Locator_s::~Locator_s() -{ -} - -Locator_s::Locator_s( - const Locator_s& x) -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = x.m_address; - -} - -Locator_s::Locator_s( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = std::move(x.m_address); - -} - -Locator_s& Locator_s::operator =( - const Locator_s& x) -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = x.m_address; - - return *this; -} - -Locator_s& Locator_s::operator =( - Locator_s&& x) noexcept -{ - m_kind = x.m_kind; - - - m_port = x.m_port; - - - m_address = std::move(x.m_address); - - return *this; -} - -bool Locator_s::operator ==( - const Locator_s& x) const -{ - return (m_kind == x.m_kind && - m_port == x.m_port && - m_address == x.m_address); -} - -bool Locator_s::operator !=( - const Locator_s& x) const -{ - return !(*this == x); -} - -size_t Locator_s::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; -} - -size_t Locator_s::getCdrSerializedSize( - const Locator_s& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void Locator_s::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_kind; - - scdr << m_port; - - scdr << m_address; - - -} - -void Locator_s::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_kind; - - - - dcdr >> m_port; - - - - dcdr >> m_address; - - -} - - -bool Locator_s::isKeyDefined() -{ - return false; -} - -void Locator_s::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ -void Locator_s::kind( - int32_t _kind) -{ - m_kind = _kind; -} - -/*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ -int32_t Locator_s::kind() const -{ - return m_kind; -} - -/*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ -int32_t& Locator_s::kind() -{ - return m_kind; -} - - -/*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ -void Locator_s::port( - uint32_t _port) -{ - m_port = _port; -} - -/*! - * @brief This function returns the value of member port - * @return Value of member port - */ -uint32_t Locator_s::port() const -{ - return m_port; -} - -/*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ -uint32_t& Locator_s::port() -{ - return m_port; -} - - -/*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ -void Locator_s::address( - const std::array& _address) -{ - m_address = _address; -} - -/*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ -void Locator_s::address( - std::array&& _address) -{ - m_address = std::move(_address); -} - -/*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ -const std::array& Locator_s::address() const -{ - return m_address; -} - -/*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ -std::array& Locator_s::address() -{ - return m_address; -} - - - - - -} // namespace detail - - -DiscoveryTime::DiscoveryTime() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid - - // unsigned long long m_time - m_time = 0; - // /type_d() m_host - - // /type_d() m_user - - // /type_d() m_process - - -} - -DiscoveryTime::~DiscoveryTime() -{ -} - -DiscoveryTime::DiscoveryTime( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - - - m_remote_entity_guid = x.m_remote_entity_guid; - - - m_time = x.m_time; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - -} - -DiscoveryTime::DiscoveryTime( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - - - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - - - m_time = x.m_time; - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - -} - -DiscoveryTime& DiscoveryTime::operator =( - const DiscoveryTime& x) -{ - m_local_participant_guid = x.m_local_participant_guid; - - - m_remote_entity_guid = x.m_remote_entity_guid; - - - m_time = x.m_time; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - - return *this; -} - -DiscoveryTime& DiscoveryTime::operator =( - DiscoveryTime&& x) noexcept -{ - m_local_participant_guid = std::move(x.m_local_participant_guid); - - - m_remote_entity_guid = std::move(x.m_remote_entity_guid); - - - m_time = x.m_time; - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - - return *this; -} - -bool DiscoveryTime::operator ==( - const DiscoveryTime& x) const -{ - return (m_local_participant_guid == x.m_local_participant_guid && - m_remote_entity_guid == x.m_remote_entity_guid && - m_time == x.m_time && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool DiscoveryTime::operator !=( - const DiscoveryTime& x) const -{ - return !(*this == x); -} - -size_t DiscoveryTime::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; -} - -size_t DiscoveryTime::getCdrSerializedSize( - const DiscoveryTime& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_participant_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.remote_entity_guid(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void DiscoveryTime::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_local_participant_guid; - - scdr << m_remote_entity_guid; - - scdr << m_time; - - scdr << m_host.c_str(); - - scdr << m_user.c_str(); - - scdr << m_process.c_str(); - -} - -void DiscoveryTime::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_local_participant_guid; - - - - dcdr >> m_remote_entity_guid; - - - - dcdr >> m_time; - - - - dcdr >> m_host; - - - - dcdr >> m_user; - - - - dcdr >> m_process; - - -} - - -bool DiscoveryTime::isKeyDefined() -{ - return true; -} - -void DiscoveryTime::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_local_participant_guid.serialize(scdr); - m_remote_entity_guid.serialize(scdr); - - - - -} - -/*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) -{ - m_local_participant_guid = _local_participant_guid; -} - -/*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ -void DiscoveryTime::local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) -{ - m_local_participant_guid = std::move(_local_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const -{ - return m_local_participant_guid; -} - -/*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() -{ - return m_local_participant_guid; -} - - -/*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) -{ - m_remote_entity_guid = _remote_entity_guid; -} - -/*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ -void DiscoveryTime::remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) -{ - m_remote_entity_guid = std::move(_remote_entity_guid); -} - -/*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const -{ - return m_remote_entity_guid; -} - -/*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() -{ - return m_remote_entity_guid; -} - - -/*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ -void DiscoveryTime::time( - uint64_t _time) -{ - m_time = _time; -} - -/*! - * @brief This function returns the value of member time - * @return Value of member time - */ -uint64_t DiscoveryTime::time() const -{ - return m_time; -} - -/*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ -uint64_t& DiscoveryTime::time() -{ - return m_time; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void DiscoveryTime::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void DiscoveryTime::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& DiscoveryTime::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& DiscoveryTime::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void DiscoveryTime::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void DiscoveryTime::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& DiscoveryTime::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& DiscoveryTime::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void DiscoveryTime::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void DiscoveryTime::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& DiscoveryTime::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& DiscoveryTime::process() -{ - return m_process; -} - - - - - -EntityCount::EntityCount() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // unsigned long long m_count - m_count = 0; - -} - -EntityCount::~EntityCount() -{ -} - -EntityCount::EntityCount( - const EntityCount& x) -{ - m_guid = x.m_guid; - - - m_count = x.m_count; - -} - -EntityCount::EntityCount( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_count = x.m_count; - -} - -EntityCount& EntityCount::operator =( - const EntityCount& x) -{ - m_guid = x.m_guid; - - - m_count = x.m_count; - - return *this; -} - -EntityCount& EntityCount::operator =( - EntityCount&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_count = x.m_count; - - return *this; -} - -bool EntityCount::operator ==( - const EntityCount& x) const -{ - return (m_guid == x.m_guid && - m_count == x.m_count); -} - -bool EntityCount::operator !=( - const EntityCount& x) const -{ - return !(*this == x); -} - -size_t EntityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; -} - -size_t EntityCount::getCdrSerializedSize( - const EntityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void EntityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guid; - - scdr << m_count; - -} - -void EntityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guid; - - - - dcdr >> m_count; - - -} - - -bool EntityCount::isKeyDefined() -{ - return true; -} - -void EntityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityCount::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityCount::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void EntityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t EntityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& EntityCount::count() -{ - return m_count; -} - - - - - -SampleIdentityCount::SampleIdentityCount() -{ - // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id - - // unsigned long long m_count - m_count = 0; - -} - -SampleIdentityCount::~SampleIdentityCount() -{ -} - -SampleIdentityCount::SampleIdentityCount( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - - - m_count = x.m_count; - -} - -SampleIdentityCount::SampleIdentityCount( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - - - m_count = x.m_count; - -} - -SampleIdentityCount& SampleIdentityCount::operator =( - const SampleIdentityCount& x) -{ - m_sample_id = x.m_sample_id; - - - m_count = x.m_count; - - return *this; -} - -SampleIdentityCount& SampleIdentityCount::operator =( - SampleIdentityCount&& x) noexcept -{ - m_sample_id = std::move(x.m_sample_id); - - - m_count = x.m_count; - - return *this; -} - -bool SampleIdentityCount::operator ==( - const SampleIdentityCount& x) const -{ - return (m_sample_id == x.m_sample_id && - m_count == x.m_count); -} - -bool SampleIdentityCount::operator !=( - const SampleIdentityCount& x) const -{ - return !(*this == x); -} - -size_t SampleIdentityCount::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; -} - -size_t SampleIdentityCount::getCdrSerializedSize( - const SampleIdentityCount& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize(data.sample_id(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void SampleIdentityCount::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sample_id; - - scdr << m_count; - -} - -void SampleIdentityCount::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sample_id; - - - - dcdr >> m_count; - - -} - - -bool SampleIdentityCount::isKeyDefined() -{ - return true; -} - -void SampleIdentityCount::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_sample_id.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ -void SampleIdentityCount::sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) -{ - m_sample_id = _sample_id; -} - -/*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ -void SampleIdentityCount::sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) -{ - m_sample_id = std::move(_sample_id); -} - -/*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const -{ - return m_sample_id; -} - -/*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() -{ - return m_sample_id; -} - - -/*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ -void SampleIdentityCount::count( - uint64_t _count) -{ - m_count = _count; -} - -/*! - * @brief This function returns the value of member count - * @return Value of member count - */ -uint64_t SampleIdentityCount::count() const -{ - return m_count; -} - -/*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ -uint64_t& SampleIdentityCount::count() -{ - return m_count; -} - - - - - -Entity2LocatorTraffic::Entity2LocatorTraffic() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_src_guid - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // unsigned long long m_packet_count - m_packet_count = 0; - // unsigned long long m_byte_count - m_byte_count = 0; - // short m_byte_magnitude_order - m_byte_magnitude_order = 0; - -} - -Entity2LocatorTraffic::~Entity2LocatorTraffic() -{ -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - - - m_dst_locator = x.m_dst_locator; - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - -} - -Entity2LocatorTraffic::Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - const Entity2LocatorTraffic& x) -{ - m_src_guid = x.m_src_guid; - - - m_dst_locator = x.m_dst_locator; - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - - return *this; -} - -Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( - Entity2LocatorTraffic&& x) noexcept -{ - m_src_guid = std::move(x.m_src_guid); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_packet_count = x.m_packet_count; - - - m_byte_count = x.m_byte_count; - - - m_byte_magnitude_order = x.m_byte_magnitude_order; - - return *this; -} - -bool Entity2LocatorTraffic::operator ==( - const Entity2LocatorTraffic& x) const -{ - return (m_src_guid == x.m_src_guid && - m_dst_locator == x.m_dst_locator && - m_packet_count == x.m_packet_count && - m_byte_count == x.m_byte_count && - m_byte_magnitude_order == x.m_byte_magnitude_order); -} - -bool Entity2LocatorTraffic::operator !=( - const Entity2LocatorTraffic& x) const -{ - return !(*this == x); -} - -size_t Entity2LocatorTraffic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; -} - -size_t Entity2LocatorTraffic::getCdrSerializedSize( - const Entity2LocatorTraffic& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.src_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - - -void Entity2LocatorTraffic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_src_guid; - - scdr << m_dst_locator; - - scdr << m_packet_count; - - scdr << m_byte_count; - - scdr << m_byte_magnitude_order; - -} - -void Entity2LocatorTraffic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_src_guid; - - - - dcdr >> m_dst_locator; - - - - dcdr >> m_packet_count; - - - - dcdr >> m_byte_count; - - - - dcdr >> m_byte_magnitude_order; - - -} - - -bool Entity2LocatorTraffic::isKeyDefined() -{ - return true; -} - -void Entity2LocatorTraffic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_guid.serialize(scdr); - m_dst_locator.serialize(scdr); - - - -} - -/*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) -{ - m_src_guid = _src_guid; -} - -/*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ -void Entity2LocatorTraffic::src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) -{ - m_src_guid = std::move(_src_guid); -} - -/*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const -{ - return m_src_guid; -} - -/*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() -{ - return m_src_guid; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Entity2LocatorTraffic::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ -void Entity2LocatorTraffic::packet_count( - uint64_t _packet_count) -{ - m_packet_count = _packet_count; -} - -/*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ -uint64_t Entity2LocatorTraffic::packet_count() const -{ - return m_packet_count; -} - -/*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ -uint64_t& Entity2LocatorTraffic::packet_count() -{ - return m_packet_count; -} - - -/*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ -void Entity2LocatorTraffic::byte_count( - uint64_t _byte_count) -{ - m_byte_count = _byte_count; -} - -/*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ -uint64_t Entity2LocatorTraffic::byte_count() const -{ - return m_byte_count; -} - -/*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ -uint64_t& Entity2LocatorTraffic::byte_count() -{ - return m_byte_count; -} - - -/*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ -void Entity2LocatorTraffic::byte_magnitude_order( - int16_t _byte_magnitude_order) -{ - m_byte_magnitude_order = _byte_magnitude_order; -} - -/*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ -int16_t Entity2LocatorTraffic::byte_magnitude_order() const -{ - return m_byte_magnitude_order; -} - -/*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ -int16_t& Entity2LocatorTraffic::byte_magnitude_order() -{ - return m_byte_magnitude_order; -} - - - - - -WriterReaderData::WriterReaderData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid - - // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid - - // float m_data - m_data = 0.0; - -} - -WriterReaderData::~WriterReaderData() -{ -} - -WriterReaderData::WriterReaderData( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_reader_guid = x.m_reader_guid; - - - m_data = x.m_data; - -} - -WriterReaderData::WriterReaderData( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_reader_guid = std::move(x.m_reader_guid); - - - m_data = x.m_data; - -} - -WriterReaderData& WriterReaderData::operator =( - const WriterReaderData& x) -{ - m_writer_guid = x.m_writer_guid; - - - m_reader_guid = x.m_reader_guid; - - - m_data = x.m_data; - - return *this; -} - -WriterReaderData& WriterReaderData::operator =( - WriterReaderData&& x) noexcept -{ - m_writer_guid = std::move(x.m_writer_guid); - - - m_reader_guid = std::move(x.m_reader_guid); - - - m_data = x.m_data; - - return *this; -} - -bool WriterReaderData::operator ==( - const WriterReaderData& x) const -{ - return (m_writer_guid == x.m_writer_guid && - m_reader_guid == x.m_reader_guid && - m_data == x.m_data); -} - -bool WriterReaderData::operator !=( - const WriterReaderData& x) const -{ - return !(*this == x); -} - -size_t WriterReaderData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; -} - -size_t WriterReaderData::getCdrSerializedSize( - const WriterReaderData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.reader_guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void WriterReaderData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_writer_guid; - - scdr << m_reader_guid; - - scdr << m_data; - -} - -void WriterReaderData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_writer_guid; - - - - dcdr >> m_reader_guid; - - - - dcdr >> m_data; - - -} - - -bool WriterReaderData::isKeyDefined() -{ - return true; -} - -void WriterReaderData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_writer_guid.serialize(scdr); - m_reader_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ -void WriterReaderData::writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) -{ - m_writer_guid = _writer_guid; -} - -/*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ -void WriterReaderData::writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) -{ - m_writer_guid = std::move(_writer_guid); -} - -/*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const -{ - return m_writer_guid; -} - -/*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() -{ - return m_writer_guid; -} - - -/*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ -void WriterReaderData::reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) -{ - m_reader_guid = _reader_guid; -} - -/*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ -void WriterReaderData::reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) -{ - m_reader_guid = std::move(_reader_guid); -} - -/*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const -{ - return m_reader_guid; -} - -/*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() -{ - return m_reader_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void WriterReaderData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float WriterReaderData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& WriterReaderData::data() -{ - return m_data; -} - - - - - -Locator2LocatorData::Locator2LocatorData() -{ - // eprosima::fastdds::statistics::detail::Locator_s m_src_locator - - // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator - - // float m_data - m_data = 0.0; - -} - -Locator2LocatorData::~Locator2LocatorData() -{ -} - -Locator2LocatorData::Locator2LocatorData( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - - - m_dst_locator = x.m_dst_locator; - - - m_data = x.m_data; - -} - -Locator2LocatorData::Locator2LocatorData( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_data = x.m_data; - -} - -Locator2LocatorData& Locator2LocatorData::operator =( - const Locator2LocatorData& x) -{ - m_src_locator = x.m_src_locator; - - - m_dst_locator = x.m_dst_locator; - - - m_data = x.m_data; - - return *this; -} - -Locator2LocatorData& Locator2LocatorData::operator =( - Locator2LocatorData&& x) noexcept -{ - m_src_locator = std::move(x.m_src_locator); - - - m_dst_locator = std::move(x.m_dst_locator); - - - m_data = x.m_data; - - return *this; -} - -bool Locator2LocatorData::operator ==( - const Locator2LocatorData& x) const -{ - return (m_src_locator == x.m_src_locator && - m_dst_locator == x.m_dst_locator && - m_data == x.m_data); -} - -bool Locator2LocatorData::operator !=( - const Locator2LocatorData& x) const -{ - return !(*this == x); -} - -size_t Locator2LocatorData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; -} - -size_t Locator2LocatorData::getCdrSerializedSize( - const Locator2LocatorData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.src_locator(), current_alignment); - - - current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void Locator2LocatorData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_src_locator; - - scdr << m_dst_locator; - - scdr << m_data; - -} - -void Locator2LocatorData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_src_locator; - - - - dcdr >> m_dst_locator; - - - - dcdr >> m_data; - - -} - - -bool Locator2LocatorData::isKeyDefined() -{ - return true; -} - -void Locator2LocatorData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_src_locator.serialize(scdr); - m_dst_locator.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ -void Locator2LocatorData::src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) -{ - m_src_locator = _src_locator; -} - -/*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ -void Locator2LocatorData::src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) -{ - m_src_locator = std::move(_src_locator); -} - -/*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const -{ - return m_src_locator; -} - -/*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() -{ - return m_src_locator; -} - - -/*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ -void Locator2LocatorData::dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) -{ - m_dst_locator = _dst_locator; -} - -/*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ -void Locator2LocatorData::dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) -{ - m_dst_locator = std::move(_dst_locator); -} - -/*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ -const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const -{ - return m_dst_locator; -} - -/*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ -eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() -{ - return m_dst_locator; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void Locator2LocatorData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float Locator2LocatorData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& Locator2LocatorData::data() -{ - return m_data; -} - - - - - -EntityData::EntityData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_guid - - // float m_data - m_data = 0.0; - -} - -EntityData::~EntityData() -{ -} - -EntityData::EntityData( - const EntityData& x) -{ - m_guid = x.m_guid; - - - m_data = x.m_data; - -} - -EntityData::EntityData( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_data = x.m_data; - -} - -EntityData& EntityData::operator =( - const EntityData& x) -{ - m_guid = x.m_guid; - - - m_data = x.m_data; - - return *this; -} - -EntityData& EntityData::operator =( - EntityData&& x) noexcept -{ - m_guid = std::move(x.m_guid); - - - m_data = x.m_data; - - return *this; -} - -bool EntityData::operator ==( - const EntityData& x) const -{ - return (m_guid == x.m_guid && - m_data == x.m_data); -} - -bool EntityData::operator !=( - const EntityData& x) const -{ - return !(*this == x); -} - -size_t EntityData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; -} - -size_t EntityData::getCdrSerializedSize( - const EntityData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void EntityData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_guid; - - scdr << m_data; - -} - -void EntityData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_guid; - - - - dcdr >> m_data; - - -} - - -bool EntityData::isKeyDefined() -{ - return true; -} - -void EntityData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_guid.serialize(scdr); - -} - -/*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ -void EntityData::guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid) -{ - m_guid = _guid; -} - -/*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ -void EntityData::guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid) -{ - m_guid = std::move(_guid); -} - -/*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const -{ - return m_guid; -} - -/*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ -eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() -{ - return m_guid; -} - - -/*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ -void EntityData::data( - float _data) -{ - m_data = _data; -} - -/*! - * @brief This function returns the value of member data - * @return Value of member data - */ -float EntityData::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -float& EntityData::data() -{ - return m_data; -} - - - - - -PhysicalData::PhysicalData() -{ - // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid - - // /type_d() m_host - - // /type_d() m_user - - // /type_d() m_process - - -} - -PhysicalData::~PhysicalData() -{ -} - -PhysicalData::PhysicalData( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - -} - -PhysicalData::PhysicalData( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - -} - -PhysicalData& PhysicalData::operator =( - const PhysicalData& x) -{ - m_participant_guid = x.m_participant_guid; - - - m_host = x.m_host; - - - m_user = x.m_user; - - - m_process = x.m_process; - - return *this; -} - -PhysicalData& PhysicalData::operator =( - PhysicalData&& x) noexcept -{ - m_participant_guid = std::move(x.m_participant_guid); - - - m_host = std::move(x.m_host); - - - m_user = std::move(x.m_user); - - - m_process = std::move(x.m_process); - - return *this; -} - -bool PhysicalData::operator ==( - const PhysicalData& x) const -{ - return (m_participant_guid == x.m_participant_guid && - m_host == x.m_host && - m_user == x.m_user && - m_process == x.m_process); -} - -bool PhysicalData::operator !=( - const PhysicalData& x) const -{ - return !(*this == x); -} - -size_t PhysicalData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; -} - -size_t PhysicalData::getCdrSerializedSize( - const PhysicalData& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.participant_guid(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void PhysicalData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_participant_guid; - - scdr << m_host.c_str(); - - scdr << m_user.c_str(); - - scdr << m_process.c_str(); - -} - -void PhysicalData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_participant_guid; - - - - dcdr >> m_host; - - - - dcdr >> m_user; - - - - dcdr >> m_process; - - -} - - -bool PhysicalData::isKeyDefined() -{ - return true; -} - -void PhysicalData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - m_participant_guid.serialize(scdr); - - - -} - -/*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ -void PhysicalData::participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) -{ - m_participant_guid = _participant_guid; -} - -/*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ -void PhysicalData::participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) -{ - m_participant_guid = std::move(_participant_guid); -} - -/*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ -const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const -{ - return m_participant_guid; -} - -/*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ -eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() -{ - return m_participant_guid; -} - - -/*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ -void PhysicalData::host( - const std::string& _host) -{ - m_host = _host; -} - -/*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ -void PhysicalData::host( - std::string&& _host) -{ - m_host = std::move(_host); -} - -/*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ -const std::string& PhysicalData::host() const -{ - return m_host; -} - -/*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ -std::string& PhysicalData::host() -{ - return m_host; -} - - -/*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ -void PhysicalData::user( - const std::string& _user) -{ - m_user = _user; -} - -/*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ -void PhysicalData::user( - std::string&& _user) -{ - m_user = std::move(_user); -} - -/*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ -const std::string& PhysicalData::user() const -{ - return m_user; -} - -/*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ -std::string& PhysicalData::user() -{ - return m_user; -} - - -/*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ -void PhysicalData::process( - const std::string& _process) -{ - m_process = _process; -} - -/*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ -void PhysicalData::process( - std::string&& _process) -{ - m_process = std::move(_process); -} - -/*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ -const std::string& PhysicalData::process() const -{ - return m_process; -} - -/*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ -std::string& PhysicalData::process() -{ - return m_process; -} - - - - - - -Data::Data() -{ - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data - - // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data - - // eprosima::fastdds::statistics::EntityData m_entity_data - - // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic - - // eprosima::fastdds::statistics::EntityCount m_entity_count - - // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time - - // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count - - // eprosima::fastdds::statistics::PhysicalData m_physical_data - -} - -Data::~Data() -{ -} - -Data::Data( - const Data& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } -} - -Data::Data( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } -} - -Data& Data::operator =( - const Data& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = x.m_writer_reader_data; - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = x.m_locator2locator_data; - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = x.m_entity_data; - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = x.m_entity2locator_traffic; - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = x.m_entity_count; - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = x.m_discovery_time; - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = x.m_sample_identity_count; - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = x.m_physical_data; - break; - - default: - break; - } - - return *this; -} - -Data& Data::operator =( - Data&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - m_writer_reader_data = std::move(x.m_writer_reader_data); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - m_locator2locator_data = std::move(x.m_locator2locator_data); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - m_entity_data = std::move(x.m_entity_data); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - m_entity_count = std::move(x.m_entity_count); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - m_discovery_time = std::move(x.m_discovery_time); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - m_sample_identity_count = std::move(x.m_sample_identity_count); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - m_physical_data = std::move(x.m_physical_data); - - break; - - default: - break; - } - - return *this; -} - -bool Data::operator ==( - const Data& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - return (m_writer_reader_data == x.m_writer_reader_data); - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - return (m_locator2locator_data == x.m_locator2locator_data); - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - return (m_entity_data == x.m_entity_data); - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - return (m_entity2locator_traffic == x.m_entity2locator_traffic); - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - return (m_entity_count == x.m_entity_count); - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - return (m_discovery_time == x.m_discovery_time); - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - return (m_sample_identity_count == x.m_sample_identity_count); - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - return (m_physical_data == x.m_physical_data); - break; - - default: - break; - } - return false; -} - -bool Data::operator !=( - const Data& x) const -{ - return !(*this == x); -} - -void Data::_d( - eprosima::fastdds::statistics::EventKind __d) -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - switch(__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - switch(__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - switch(__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - switch(__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - switch(__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - switch(__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - switch(__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - switch(__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -eprosima::fastdds::statistics::EventKind Data::_d() const -{ - return m__d; -} - -eprosima::fastdds::statistics::EventKind& Data::_d() -{ - return m__d; -} - -void Data::writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) -{ - m_writer_reader_data = _writer_reader_data; - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -void Data::writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) -{ - m_writer_reader_data = std::move(_writer_reader_data); - m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; - -} - -const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - -eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_writer_reader_data; -} - - -void Data::locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) -{ - m_locator2locator_data = _locator2locator_data; - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -void Data::locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) -{ - m_locator2locator_data = std::move(_locator2locator_data); - m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; - -} - -const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - -eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::NETWORK_LATENCY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_locator2locator_data; -} - - -void Data::entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data) -{ - m_entity_data = _entity_data; - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -void Data::entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data) -{ - m_entity_data = std::move(_entity_data); - m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; - -} - -const eprosima::fastdds::statistics::EntityData& Data::entity_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - -eprosima::fastdds::statistics::EntityData& Data::entity_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_data; -} - - -void Data::entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) -{ - m_entity2locator_traffic = _entity2locator_traffic; - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -void Data::entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) -{ - m_entity2locator_traffic = std::move(_entity2locator_traffic); - m__d = eprosima::fastdds::statistics::RTPS_SENT; - -} - -const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - -eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity2locator_traffic; -} - - -void Data::entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count) -{ - m_entity_count = _entity_count; - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -void Data::entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count) -{ - m_entity_count = std::move(_entity_count); - m__d = eprosima::fastdds::statistics::RESENT_DATAS; - -} - -const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - -eprosima::fastdds::statistics::EntityCount& Data::entity_count() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_entity_count; -} - - -void Data::discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) -{ - m_discovery_time = _discovery_time; - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -void Data::discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) -{ - m_discovery_time = std::move(_discovery_time); - m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; - -} - -const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - -eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_discovery_time; -} - - -void Data::sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) -{ - m_sample_identity_count = _sample_identity_count; - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -void Data::sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) -{ - m_sample_identity_count = std::move(_sample_identity_count); - m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; - -} - -const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - -eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::SAMPLE_DATAS: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_sample_identity_count; -} - - -void Data::physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data) -{ - m_physical_data = _physical_data; - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -void Data::physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data) -{ - m_physical_data = std::move(_physical_data); - m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; - -} - -const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - -eprosima::fastdds::statistics::PhysicalData& Data::physical_data() -{ - bool b = false; - - switch(m__d) - { - case eprosima::fastdds::statistics::PHYSICAL_DATA: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_physical_data; -} - - -// TODO(Ricardo) Review -size_t Data::getCdrSerializedSize( - const Data& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - switch(data.m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - current_alignment += eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize(data.writer_reader_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - current_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize(data.locator2locator_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - current_alignment += eprosima::fastdds::statistics::EntityData::getCdrSerializedSize(data.entity_data(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - current_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize(data.entity2locator_traffic(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - current_alignment += eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize(data.entity_count(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - current_alignment += eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize(data.discovery_time(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - current_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize(data.sample_identity_count(), current_alignment); - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - current_alignment += eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize(data.physical_data(), current_alignment); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void Data::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m__d; - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - scdr << m_writer_reader_data; - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - scdr << m_locator2locator_data; - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - scdr << m_entity_data; - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - scdr << m_entity2locator_traffic; - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - scdr << m_entity_count; - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - scdr << m_discovery_time; - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - scdr << m_sample_identity_count; - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - scdr << m_physical_data; - - break; - - default: - break; - } -} - -void Data::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t bitmask_value = 0; - dcdr >> bitmask_value; - m__d = (eprosima::fastdds::statistics::EventKind)bitmask_value; - } - - - - switch(m__d) - { - case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: - dcdr >> m_writer_reader_data; - - - break; - - - case eprosima::fastdds::statistics::NETWORK_LATENCY: - dcdr >> m_locator2locator_data; - - - break; - - - case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: - case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: - dcdr >> m_entity_data; - - - break; - - - case eprosima::fastdds::statistics::RTPS_SENT: - case eprosima::fastdds::statistics::RTPS_LOST: - dcdr >> m_entity2locator_traffic; - - - break; - - - case eprosima::fastdds::statistics::RESENT_DATAS: - case eprosima::fastdds::statistics::HEARTBEAT_COUNT: - case eprosima::fastdds::statistics::ACKNACK_COUNT: - case eprosima::fastdds::statistics::NACKFRAG_COUNT: - case eprosima::fastdds::statistics::GAP_COUNT: - case eprosima::fastdds::statistics::DATA_COUNT: - case eprosima::fastdds::statistics::PDP_PACKETS: - case eprosima::fastdds::statistics::EDP_PACKETS: - dcdr >> m_entity_count; - - - break; - - - case eprosima::fastdds::statistics::DISCOVERED_ENTITY: - dcdr >> m_discovery_time; - - - break; - - - case eprosima::fastdds::statistics::SAMPLE_DATAS: - dcdr >> m_sample_identity_count; - - - break; - - - case eprosima::fastdds::statistics::PHYSICAL_DATA: - dcdr >> m_physical_data; - - - break; - - default: - break; - } -} - - - - - -} // namespace statistics - - -} // namespace fastdds - - -} // namespace eprosima - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/statistics/typesv1.h b/test/blackbox/types/statistics/typesv1.h deleted file mode 100644 index 4790ebcb43c..00000000000 --- a/test/blackbox/types/statistics/typesv1.h +++ /dev/null @@ -1,3093 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ -#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -namespace eprosima { - namespace fastdds { - namespace statistics { - namespace detail { - - - /*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ - class EntityId_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::EntityId_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::array m_value; - - }; - - - - /*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ - class GuidPrefix_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - std::array m_value; - - }; - - - - /*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ - class GUID_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::GUID_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - - }; - - - - /*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ - class SequenceNumber_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_high; - uint32_t m_low; - - }; - - - - /*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentity_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - - }; - - - - /*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ - class Locator_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::detail::Locator_s& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - int32_t m_kind; - uint32_t m_port; - std::array m_address; - - }; - - } // namespace detail - - - /*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ - class DiscoveryTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::DiscoveryTime& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - - - - /*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ - class EntityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityCount& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count; - - }; - - - - /*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::SampleIdentityCount& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count; - - }; - - - - /*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ - class Entity2LocatorTraffic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count; - uint64_t m_byte_count; - int16_t m_byte_magnitude_order; - - }; - - - - /*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ - class WriterReaderData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::WriterReaderData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ - class Locator2LocatorData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Locator2LocatorData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ - class EntityData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::EntityData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data; - - }; - - - - /*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ - class PhysicalData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::PhysicalData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - - /*! - * @brief This class represents the bitmask EventKind defined by the user in the IDL file. - * @ingroup types - */ - enum EventKindBits : uint32_t - { - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 - }; - typedef uint32_t EventKind; - - - /*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ - class Data - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const eprosima::fastdds::statistics::Data& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - - private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; - }; - - } // namespace statistics - } // namespace fastdds -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/dds/communication/CMakeLists.txt b/test/dds/communication/CMakeLists.txt index d2696757422..ee6ec3d8312 100644 --- a/test/dds/communication/CMakeLists.txt +++ b/test/dds/communication/CMakeLists.txt @@ -25,36 +25,34 @@ include_directories(${Asio_INCLUDE_DIR}) # Binaries ############################################################################### -# Dynamic types test -set(DDS_PUBLISHER_DYNAMIC_SOURCE - PublisherDynamic.cpp - ) -add_executable(DDSSimpleCommunicationDynamicPublisher ${DDS_PUBLISHER_DYNAMIC_SOURCE}) -target_compile_definitions(DDSSimpleCommunicationDynamicPublisher PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_link_libraries(DDSSimpleCommunicationDynamicPublisher fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) - -set(DDS_SUBSCRIBER_DYNAMIC_SOURCE - SubscriberDynamic.cpp - ) -add_executable(DDSSimpleCommunicationDynamicSubscriber ${DDS_SUBSCRIBER_DYNAMIC_SOURCE}) -target_compile_definitions(DDSSimpleCommunicationDynamicSubscriber PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_link_libraries(DDSSimpleCommunicationDynamicSubscriber fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +# TODO Restore when Dynamic types are registered in TypeObjectRegistry +# # Dynamic types test +# set(DDS_PUBLISHER_DYNAMIC_SOURCE +# PublisherDynamic.cpp +# ) +# add_executable(DDSSimpleCommunicationDynamicPublisher ${DDS_PUBLISHER_DYNAMIC_SOURCE}) +# target_compile_definitions(DDSSimpleCommunicationDynamicPublisher PRIVATE +# $<$>,$>:__DEBUG> +# $<$:__INTERNALDEBUG> # Internal debug activated. +# ) +# target_link_libraries(DDSSimpleCommunicationDynamicPublisher fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) + +# set(DDS_SUBSCRIBER_DYNAMIC_SOURCE +# SubscriberDynamic.cpp +# ) +# add_executable(DDSSimpleCommunicationDynamicSubscriber ${DDS_SUBSCRIBER_DYNAMIC_SOURCE}) +# target_compile_definitions(DDSSimpleCommunicationDynamicSubscriber PRIVATE +# $<$>,$>:__DEBUG> +# $<$:__INTERNALDEBUG> # Internal debug activated. +# ) +# target_link_libraries(DDSSimpleCommunicationDynamicSubscriber fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) # Standard tests set(COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldv1.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObject.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSized.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObjectSupport.cxx ) set(DDS_PUBLISHER_SOURCE ${COMMON_SOURCE} @@ -67,7 +65,7 @@ target_compile_definitions(DDSCommunicationPublisher PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(DDSCommunicationPublisher PRIVATE ${PROJECT_SOURCE_DIR}/test/blackbox) -target_link_libraries(DDSCommunicationPublisher fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +target_link_libraries(DDSCommunicationPublisher fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) set(DDS_SUBSCRIBER_SOURCE ${COMMON_SOURCE} SubscriberModule.cpp @@ -79,7 +77,7 @@ target_compile_definitions(DDSCommunicationSubscriber PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(DDSCommunicationSubscriber PRIVATE ${PROJECT_SOURCE_DIR}/test/blackbox) -target_link_libraries(DDSCommunicationSubscriber fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +target_link_libraries(DDSCommunicationSubscriber fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) set(DDS_PUBSUB_SOURCE ${COMMON_SOURCE} PublisherModule.cpp @@ -92,14 +90,15 @@ target_compile_definitions(DDSCommunicationPubSub PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(DDSCommunicationPubSub PRIVATE ${PROJECT_SOURCE_DIR}/test/blackbox) -target_link_libraries(DDSCommunicationPubSub fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +target_link_libraries(DDSCommunicationPubSub fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) ############################################################################### # Necessary files ############################################################################### -# Dynamic types test -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/simple_communication_dynamic.py - ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py COPYONLY) +# TODO Restore when Dynamic types are registered in TypeObjectRegistry +# # Dynamic types test +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/simple_communication_dynamic.py +# ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_type_profile.xml ${CMAKE_CURRENT_BINARY_DIR}/example_type_profile.xml COPYONLY) @@ -183,22 +182,24 @@ endif() # Tests specification ############################################################################### if(Python3_Interpreter_FOUND) - # Dynamic types test - add_test(NAME DDSSimpleCommunicationTypeDiscovery - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py) - - # Set test with label NoMemoryCheck - set_property(TEST DDSSimpleCommunicationTypeDiscovery PROPERTY LABELS "NoMemoryCheck") - set_property(TEST DDSSimpleCommunicationTypeDiscovery PROPERTY ENVIRONMENT - "DDS_SIMPLE_COMMUNICATION_PUBLISHER_BIN=$") - set_property(TEST DDSSimpleCommunicationTypeDiscovery APPEND PROPERTY ENVIRONMENT - "DDS_SIMPLE_COMMUNICATION_SUBSCRIBER_BIN=$") - if(WIN32) - string(REPLACE ";" "\\;" WIN_PATH "$ENV{PATH}") - set_property(TEST DDSSimpleCommunicationTypeDiscovery APPEND PROPERTY ENVIRONMENT - "PATH=$\\;$\\;${WIN_PATH}") - endif() + # TODO Restore when Dynamic types are registered in TypeObjectRegistry + # # Dynamic types test + # add_test(NAME DDSSimpleCommunicationTypeDiscovery + # COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py) + + # # Set test with label NoMemoryCheck + # set_property(TEST DDSSimpleCommunicationTypeDiscovery PROPERTY LABELS "NoMemoryCheck") + + # set_property(TEST DDSSimpleCommunicationTypeDiscovery PROPERTY ENVIRONMENT + # "DDS_SIMPLE_COMMUNICATION_PUBLISHER_BIN=$") + # set_property(TEST DDSSimpleCommunicationTypeDiscovery APPEND PROPERTY ENVIRONMENT + # "DDS_SIMPLE_COMMUNICATION_SUBSCRIBER_BIN=$") + # if(WIN32) + # string(REPLACE ";" "\\;" WIN_PATH "$ENV{PATH}") + # set_property(TEST DDSSimpleCommunicationTypeDiscovery APPEND PROPERTY ENVIRONMENT + # "PATH=$\\;$\\;${WIN_PATH}") + # endif() # Standard types test set(TEST_BUILDER ${BINARY_TEST_DIR}test_build.py) diff --git a/test/dds/communication/PubSubMain.cpp b/test/dds/communication/PubSubMain.cpp index 46553c9f64b..e81c2a379c2 100644 --- a/test/dds/communication/PubSubMain.cpp +++ b/test/dds/communication/PubSubMain.cpp @@ -15,13 +15,12 @@ /** * @file PubSubMain.cpp */ -#include "SubscriberModule.hpp" -#include "PublisherModule.hpp" +#include #include -#include -#include +#include "PublisherModule.hpp" +#include "SubscriberModule.hpp" using namespace eprosima::fastdds::dds; diff --git a/test/dds/communication/PublisherDynamic.cpp b/test/dds/communication/PublisherDynamic.cpp index 753325adba2..b2a2e0e878e 100644 --- a/test/dds/communication/PublisherDynamic.cpp +++ b/test/dds/communication/PublisherDynamic.cpp @@ -24,7 +24,6 @@ #include #include - #include #include #include @@ -33,10 +32,9 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps; @@ -66,7 +64,8 @@ class ParListener : public DomainParticipantListener */ void on_participant_discovery( DomainParticipant* /*participant*/, - rtps::ParticipantDiscoveryInfo&& info) override + rtps::ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { @@ -168,7 +167,6 @@ int main( int arg_count = 1; bool exit_on_lost_liveliness = false; uint32_t seed = 7800, wait = 0; - //char* xml_file = nullptr; uint32_t samples = 4; std::string magic; @@ -227,23 +225,14 @@ int main( return -1; } - //xml_file = argv[arg_count]; } ++arg_count; } - /* TODO - XMLProfileManager doesn't support DDS yet - if (xml_file) - { - DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_file); - } - */ - - xmlparser::XMLProfileManager::loadXMLFile("example_type_profile.xml"); + DomainParticipantFactory::get_instance()->load_XML_profiles_file("example_type_profile.xml"); DomainParticipantQos participant_qos; - participant_qos.wire_protocol().builtin.typelookup_config.use_server = true; ParListener participant_listener(exit_on_lost_liveliness); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant(seed % 230, participant_qos, @@ -255,8 +244,15 @@ int main( return 1; } - types::DynamicType_ptr dyn_type = xmlparser::XMLProfileManager::getDynamicTypeByName("TypeLookup")->build(); - TypeSupport type(new types::DynamicPubSubType(dyn_type)); + DynamicType::_ref_type dyn_type; + if (RETCODE_OK != DomainParticipantFactory::get_instance()-> + get_dynamic_type_builder_from_xml_by_name("TypeLookup", dyn_type)) + { + std::cout << "Error getting dynamic type from XML file" << std::endl; + return 1; + } + + TypeSupport type(new DynamicPubSubType(dyn_type)); type.register_type(participant); PubListener listener; @@ -306,16 +302,16 @@ int main( }); } - types::DynamicData_ptr data(types::DynamicDataFactory::get_instance()->create_data(dyn_type)); - data->set_string_value("Hello DDS Dynamic World", 0); + DynamicData::_ref_type data {DynamicDataFactory::get_instance()->create_data(dyn_type)}; + data->set_string_value(0, "Hello DDS Dynamic World"); data->set_uint32_value(1, 1); - types::DynamicData* inner = data->loan_value(2); - inner->set_byte_value(10, 0); + DynamicData::_ref_type inner {data->loan_value(2)}; + inner->set_byte_value(0, 10); data->return_loaned_value(inner); while (run) { - writer->write(data.get()); + writer->write(&data); uint32_t index; data->get_uint32_value(index, 1); @@ -326,13 +322,13 @@ int main( } else { - data->set_uint32_value(index + 1, 1); + data->set_uint32_value(1, index + 1); } inner = data->loan_value(2); octet inner_count; inner->get_byte_value(inner_count, 0); - inner->set_byte_value(inner_count + 1, 0); + inner->set_byte_value(0, inner_count + 1); data->return_loaned_value(inner); std::this_thread::sleep_for(std::chrono::milliseconds(250)); diff --git a/test/dds/communication/PublisherMain.cpp b/test/dds/communication/PublisherMain.cpp index 0d72b20ae5b..bc9a2600d6e 100644 --- a/test/dds/communication/PublisherMain.cpp +++ b/test/dds/communication/PublisherMain.cpp @@ -15,10 +15,10 @@ /** * @file PublisherMain.cpp */ -#include "PublisherModule.hpp" #include -#include + +#include "PublisherModule.hpp" using namespace eprosima::fastdds::dds; diff --git a/test/dds/communication/PublisherModule.cpp b/test/dds/communication/PublisherModule.cpp index d798a5c8434..0187e4848a6 100644 --- a/test/dds/communication/PublisherModule.cpp +++ b/test/dds/communication/PublisherModule.cpp @@ -145,7 +145,7 @@ void PublisherModule::run( { if (zero_copy_) { - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { FixedSized* data = static_cast(sample); data->index(index); @@ -214,7 +214,8 @@ void PublisherModule::on_publication_matched( void PublisherModule::on_participant_discovery( DomainParticipant* /*participant*/, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) { if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { diff --git a/test/dds/communication/PublisherModule.hpp b/test/dds/communication/PublisherModule.hpp index fb144821a0a..85b7c1ad155 100644 --- a/test/dds/communication/PublisherModule.hpp +++ b/test/dds/communication/PublisherModule.hpp @@ -63,7 +63,8 @@ class PublisherModule */ void on_participant_discovery( DomainParticipant* /*participant*/, - fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; #if HAVE_SECURITY void onParticipantAuthentication( diff --git a/test/dds/communication/SubscriberDynamic.cpp b/test/dds/communication/SubscriberDynamic.cpp index dae0f6cd866..9b0030ebd5a 100644 --- a/test/dds/communication/SubscriberDynamic.cpp +++ b/test/dds/communication/SubscriberDynamic.cpp @@ -24,22 +24,25 @@ #include -#include +#include #include +#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; +using namespace eprosima::fastdds::dds::xtypes; using namespace eprosima::fastrtps::rtps; class ParListener : public DomainParticipantListener @@ -58,79 +61,37 @@ class ParListener : public DomainParticipantListener */ void on_participant_discovery( DomainParticipant* /*participant*/, - rtps::ParticipantDiscoveryInfo&& info) override + ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { - if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) + if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Subscriber participant " << //participant->getGuid() << " discovered participant " << info.info.m_guid << std::endl; } - else if (info.status == rtps::ParticipantDiscoveryInfo::CHANGED_QOS_PARTICIPANT) + else if (info.status == ParticipantDiscoveryInfo::CHANGED_QOS_PARTICIPANT) { std::cout << "Subscriber participant " << //participant->getGuid() << " detected changes on participant " << info.info.m_guid << std::endl; } - else if (info.status == rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT) + else if (info.status == ParticipantDiscoveryInfo::REMOVED_PARTICIPANT) { std::cout << "Subscriber participant " << //participant->getGuid() << " removed participant " << info.info.m_guid << std::endl; } - else if (info.status == rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) + else if (info.status == ParticipantDiscoveryInfo::DROPPED_PARTICIPANT) { std::cout << "Subscriber participant " << //participant->getGuid() << " dropped participant " << info.info.m_guid << std::endl; } } - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override - { - using callback_type = std::function; - - // once it is registered do ... - callback_type callback = [this, topic_name, type_name]( - const std::string&, - const types::DynamicType_ptr) - { - try - { - is_worth_a_type_.set_value(std::make_pair(topic_name.to_string(), type_name.to_string())); - } - catch (std::future_error&) - { - // Ignore if multiple callbacks are done for the same type - } - }; - - // Check if the type is already registered - auto name = type_name.to_string(); - types::DynamicType_ptr dummy; - - if (participant->find_type(name)) - { - // signal now - callback(name, dummy); - } - else - { - // signal on reception - participant->register_remote_type( - type_information, - type_name.to_string(), - callback); - } - } - #if HAVE_SECURITY void onParticipantAuthentication( DomainParticipant* /*participant*/, - rtps::ParticipantAuthenticationInfo&& info) override + ParticipantAuthenticationInfo&& info) override { - if (rtps::ParticipantAuthenticationInfo::AUTHORIZED_PARTICIPANT == info.status) + if (ParticipantAuthenticationInfo::AUTHORIZED_PARTICIPANT == info.status) { std::cout << "Subscriber participant " << //participant->guid() << " authorized participant " << info.guid << std::endl; @@ -252,19 +213,11 @@ int main( return -1; } - //xml_file = argv[arg_count]; } ++arg_count; } - /* TODO - XMLProfileManager doesn't support DDS yet - if(xml_file) - { - DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_file); - } - */ - ParListener participant_listener; DomainParticipant* participant = nullptr; @@ -278,7 +231,6 @@ int main( { DomainParticipantQos participant_qos; - participant_qos.wire_protocol().builtin.typelookup_config.use_client = true; StatusMask participant_mask = StatusMask::none(); participant = DomainParticipantFactory::get_instance()->create_participant(seed % 230, participant_qos, @@ -307,25 +259,23 @@ int main( auto& topic_name = remote_names.first; auto& type_name = remote_names.second; - types::DynamicType_ptr type; + DynamicType::_ref_type type; { - const types::TypeIdentifier* ident = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(type_name); + TypeObjectPair type_objects; + if (RETCODE_OK != DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects( + type_name, type_objects)) - if (ident == nullptr) { - std::cout << "ERROR: TypeIdentifier cannot be retrieved for type: " + std::cout << "ERROR: TypeObject cannot be retrieved for type: " << type_name << std::endl; throw 1; } - const types::TypeObject* obj = - types::TypeObjectFactory::get_instance()->get_type_object(ident); - - type = types::TypeObjectFactory::get_instance()->build_dynamic_type(type_name, ident, obj); + type = DynamicTypeBuilderFactory::get_instance()->create_type_w_type_object( + type_objects.complete_type_object)->build(); - if (type == nullptr) + if (!type) { std::cout << "ERROR: DynamicType cannot be created for type: " << type_name << std::endl; throw 1; @@ -364,11 +314,11 @@ int main( while ((notexit || number_samples < samples ) && listener.run_) { // loop taking samples - types::DynamicPubSubType pst(type); - types::DynamicData_ptr sample(static_cast(pst.createData())); + DynamicPubSubType pst(type); + DynamicData* sample {static_cast(pst.createData())}; eprosima::fastdds::dds::SampleInfo info; - if (!!reader->take_next_sample(sample.get(), &info)) + if (RETCODE_OK == reader->take_next_sample(sample, &info)) { if (info.valid_data) { @@ -381,7 +331,7 @@ int main( sample->get_string_value(message, 0); sample->get_uint32_value(index, 1); - types::DynamicData* inner = sample->loan_value(2); + DynamicData::_ref_type inner {sample->loan_value(2)}; inner->get_byte_value(count, 0); sample->return_loaned_value(inner); @@ -398,7 +348,7 @@ int main( if (participant != nullptr) { - if (!participant->delete_contained_entities() && !result) + if (RETCODE_OK != participant->delete_contained_entities() && !result) { std::cout << "ERROR: precondition not met on participant entities removal" << std::endl; result = 1; diff --git a/test/dds/communication/SubscriberMain.cpp b/test/dds/communication/SubscriberMain.cpp index cb96f16ffb8..7e07441f7fd 100644 --- a/test/dds/communication/SubscriberMain.cpp +++ b/test/dds/communication/SubscriberMain.cpp @@ -15,10 +15,10 @@ /** * @file SubscriberMain.cpp */ -#include "SubscriberModule.hpp" #include -#include + +#include "SubscriberModule.hpp" using namespace eprosima::fastdds::dds; diff --git a/test/dds/communication/SubscriberModule.cpp b/test/dds/communication/SubscriberModule.cpp index 77992bbd823..a4f83d510fd 100644 --- a/test/dds/communication/SubscriberModule.cpp +++ b/test/dds/communication/SubscriberModule.cpp @@ -197,7 +197,8 @@ bool SubscriberModule::run_for( void SubscriberModule::on_participant_discovery( DomainParticipant* /*participant*/, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) { if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { @@ -274,7 +275,7 @@ void SubscriberModule::on_data_available( LoanableSequence l_sample; LoanableSequence l_info; - if (ReturnCode_t::RETCODE_OK == reader->take_next_instance(l_sample, l_info)) + if (RETCODE_OK == reader->take_next_instance(l_sample, l_info)) { SampleInfo info = l_info[0]; @@ -302,7 +303,7 @@ void SubscriberModule::on_data_available( if (fixed_type_) { FixedSized sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -320,7 +321,7 @@ void SubscriberModule::on_data_available( else { HelloWorld sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/test/dds/communication/SubscriberModule.hpp b/test/dds/communication/SubscriberModule.hpp index 901e3137dc7..62071c141c6 100644 --- a/test/dds/communication/SubscriberModule.hpp +++ b/test/dds/communication/SubscriberModule.hpp @@ -61,7 +61,8 @@ class SubscriberModule void on_participant_discovery( DomainParticipant* /*participant*/, - fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; #if HAVE_SECURITY void onParticipantAuthentication( diff --git a/test/dds/communication/TCP_client_profile.xml b/test/dds/communication/TCP_client_profile.xml index 9e9e019fcde..6fa0ac87ba9 100644 --- a/test/dds/communication/TCP_client_profile.xml +++ b/test/dds/communication/TCP_client_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/TCP_server_profile.xml b/test/dds/communication/TCP_server_profile.xml index 93ab3f6d767..737169cc623 100644 --- a/test/dds/communication/TCP_server_profile.xml +++ b/test/dds/communication/TCP_server_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/example_type_profile.xml b/test/dds/communication/example_type_profile.xml index d11369f1e39..331b0c63290 100644 --- a/test/dds/communication/example_type_profile.xml +++ b/test/dds/communication/example_type_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/liveliness_assertion.120_profile.xml b/test/dds/communication/liveliness_assertion.120_profile.xml index e6bcbc6e43c..1a88211c572 100644 --- a/test/dds/communication/liveliness_assertion.120_profile.xml +++ b/test/dds/communication/liveliness_assertion.120_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/liveliness_assertion.360_profile.xml b/test/dds/communication/liveliness_assertion.360_profile.xml index 78e3069d5ce..da540f7481d 100644 --- a/test/dds/communication/liveliness_assertion.360_profile.xml +++ b/test/dds/communication/liveliness_assertion.360_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/liveliness_assertion_profile.xml b/test/dds/communication/liveliness_assertion_profile.xml index 075a96b8a28..5c7799ab740 100644 --- a/test/dds/communication/liveliness_assertion_profile.xml +++ b/test/dds/communication/liveliness_assertion_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/security/CMakeLists.txt b/test/dds/communication/security/CMakeLists.txt index 699de565668..2a9a68bfda2 100644 --- a/test/dds/communication/security/CMakeLists.txt +++ b/test/dds/communication/security/CMakeLists.txt @@ -18,20 +18,17 @@ add_definitions( -DBOOST_ASIO_STANDALONE -DASIO_STANDALONE ) - + include_directories(${Asio_INCLUDE_DIR}) ############################################################################### # Binaries ############################################################################### set(COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObject.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSized.cxx - ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedv1.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedTypeObjectSupport.cxx ) set(DDS_PUBLISHER_SOURCE ${COMMON_SOURCE} @@ -44,7 +41,7 @@ target_compile_definitions(CommunicationPublisher PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(CommunicationPublisher PRIVATE ${PROJECT_SOURCE_DIR}/test/blackbox) -target_link_libraries(CommunicationPublisher fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +target_link_libraries(CommunicationPublisher fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) set(DDS_SUBSCRIBER_SOURCE ${COMMON_SOURCE} SubscriberModule.cpp @@ -56,7 +53,7 @@ target_compile_definitions(CommunicationSubscriber PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(CommunicationSubscriber PRIVATE ${PROJECT_SOURCE_DIR}/test/blackbox) -target_link_libraries(CommunicationSubscriber fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) +target_link_libraries(CommunicationSubscriber fastdds fastcdr foonathan_memory ${CMAKE_DL_LIBS}) ############################################################################### # Necessary files @@ -395,4 +392,4 @@ if(SECURITY) endif() -endif() \ No newline at end of file +endif() diff --git a/test/dds/communication/security/PublisherMain.cpp b/test/dds/communication/security/PublisherMain.cpp index 0d72b20ae5b..8db6dee6f19 100644 --- a/test/dds/communication/security/PublisherMain.cpp +++ b/test/dds/communication/security/PublisherMain.cpp @@ -18,7 +18,6 @@ #include "PublisherModule.hpp" #include -#include using namespace eprosima::fastdds::dds; diff --git a/test/dds/communication/security/PublisherModule.cpp b/test/dds/communication/security/PublisherModule.cpp index 3d9477ede9b..1afe2f5b94e 100644 --- a/test/dds/communication/security/PublisherModule.cpp +++ b/test/dds/communication/security/PublisherModule.cpp @@ -145,7 +145,7 @@ void PublisherModule::run( { if (zero_copy_) { - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { FixedSized* data = static_cast(sample); data->index(index); @@ -214,7 +214,8 @@ void PublisherModule::on_publication_matched( void PublisherModule::on_participant_discovery( DomainParticipant* /*participant*/, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) { if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { diff --git a/test/dds/communication/security/PublisherModule.hpp b/test/dds/communication/security/PublisherModule.hpp index fb144821a0a..c007af7fb9e 100644 --- a/test/dds/communication/security/PublisherModule.hpp +++ b/test/dds/communication/security/PublisherModule.hpp @@ -58,12 +58,14 @@ class PublisherModule /** * This method is called when a new Participant is discovered, or a previously discovered participant * changes its QOS or is removed. - * @param p Pointer to the Participant + * @param participant Pointer to the Participant * @param info DiscoveryInfo. + * @param should_be_ignored Flag to indicate the library to automatically ignore the discovered Participant. */ void on_participant_discovery( - DomainParticipant* /*participant*/, - fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + DomainParticipant* participant, + fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; #if HAVE_SECURITY void onParticipantAuthentication( diff --git a/test/dds/communication/security/SubscriberMain.cpp b/test/dds/communication/security/SubscriberMain.cpp index f1f0d513ee6..f917d594c92 100644 --- a/test/dds/communication/security/SubscriberMain.cpp +++ b/test/dds/communication/security/SubscriberMain.cpp @@ -18,7 +18,6 @@ #include "SubscriberModule.hpp" #include -#include using namespace eprosima::fastdds::dds; diff --git a/test/dds/communication/security/SubscriberModule.cpp b/test/dds/communication/security/SubscriberModule.cpp index 4160e127297..bbf54e1e837 100644 --- a/test/dds/communication/security/SubscriberModule.cpp +++ b/test/dds/communication/security/SubscriberModule.cpp @@ -189,7 +189,8 @@ bool SubscriberModule::run_for( void SubscriberModule::on_participant_discovery( DomainParticipant* /*participant*/, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& /*should_be_ignored*/) { if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { @@ -265,7 +266,7 @@ void SubscriberModule::on_data_available( LoanableSequence l_sample; LoanableSequence l_info; - if (ReturnCode_t::RETCODE_OK == reader->take_next_instance(l_sample, l_info)) + if (RETCODE_OK == reader->take_next_instance(l_sample, l_info)) { SampleInfo info = l_info[0]; @@ -292,7 +293,7 @@ void SubscriberModule::on_data_available( if (fixed_type_) { FixedSized sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -309,7 +310,7 @@ void SubscriberModule::on_data_available( else { HelloWorld sample; - if (reader->take_next_sample((void*)&sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample((void*)&sample, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/test/dds/communication/security/SubscriberModule.hpp b/test/dds/communication/security/SubscriberModule.hpp index 980c6c5acc6..39d8dc6472c 100644 --- a/test/dds/communication/security/SubscriberModule.hpp +++ b/test/dds/communication/security/SubscriberModule.hpp @@ -59,7 +59,8 @@ class SubscriberModule void on_participant_discovery( DomainParticipant* /*participant*/, - fastrtps::rtps::ParticipantDiscoveryInfo&& info) override; + fastrtps::rtps::ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; #if HAVE_SECURITY void onParticipantAuthentication( diff --git a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_ds_1_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_ds_1_sub_profile.xml index f811d5d8391..e67e32c0fcc 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_ds_1_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_ds_1_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_pub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_pub_profile.xml index 854cf1a6e59..b5f7ec9d1d4 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_pub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_sub_profile.xml index 115ae3ddaa5..6c5d3a197d5 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_msg_crypto_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_ds_1_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_ds_1_sub_profile.xml index 4c435d1c602..e037e744c51 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_ds_1_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_ds_1_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml index 3eed28cb516..d5b84f3c0d5 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_sub_profile.xml index 66ca99f44f4..086b0a06969 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_no_rtps_protection_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_ds_1_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_ds_1_sub_profile.xml index 76a64d593e6..10223bc36fb 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_ds_1_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_ds_1_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_pub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_pub_profile.xml index 439436120bc..4af859998c4 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_pub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_sub_profile.xml index 9a07929b8da..a40f5f4d40e 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_discovery_protection_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_ds_1_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_ds_1_sub_profile.xml index fb765a64624..1d4d62f4ca2 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_ds_1_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_ds_1_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_pub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_pub_profile.xml index c9355612c18..21a901955ef 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_pub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_sub_profile.xml b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_sub_profile.xml index 8172523e19c..b2eb6faca6a 100644 --- a/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_sub_profile.xml +++ b/test/dds/communication/security/secure_ds_simple_secure_no_rtps_protection_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_msg_crypto_besteffort_pub_profile.xml b/test/dds/communication/security/secure_msg_crypto_besteffort_pub_profile.xml index a8b0da4aa21..f022141dbbc 100644 --- a/test/dds/communication/security/secure_msg_crypto_besteffort_pub_profile.xml +++ b/test/dds/communication/security/secure_msg_crypto_besteffort_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_msg_crypto_besteffort_sub_profile.xml b/test/dds/communication/security/secure_msg_crypto_besteffort_sub_profile.xml index 11f7ad221e0..5be687ec398 100644 --- a/test/dds/communication/security/secure_msg_crypto_besteffort_sub_profile.xml +++ b/test/dds/communication/security/secure_msg_crypto_besteffort_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_pub_profile.xml b/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_pub_profile.xml index 9ef1dc299b2..52893db85ad 100644 --- a/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_pub_profile.xml +++ b/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_sub_profile.xml b/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_sub_profile.xml index b5e48af3d92..aa75b05141b 100644 --- a/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_sub_profile.xml +++ b/test/dds/communication/security/secure_msg_submsg_crypto_besteffort_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_idx_1_profile.xml b/test/dds/communication/security/secure_simple_ds_server_idx_1_profile.xml index ee92d2bc6a9..404383ebbe5 100644 --- a/test/dds/communication/security/secure_simple_ds_server_idx_1_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_idx_1_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_idx_1_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_idx_1_profile.xml index 18739cc8481..243f66392cb 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_idx_1_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_idx_1_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_profile.xml index 57adffd2844..e1c4a06da34 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_discovery_no_rtps_protection_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_idx_1_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_idx_1_profile.xml index 5d7010121d3..2426ff96639 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_idx_1_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_idx_1_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_profile.xml index 82175b9b68f..08a295625e3 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_discovery_protection_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_idx_1_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_idx_1_profile.xml index c57ae82d530..e8eaf50aeed 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_idx_1_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_idx_1_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_profile.xml b/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_profile.xml index 1d548ccf6e2..a024b72dea7 100644 --- a/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_no_rtps_protection_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_simple_ds_server_profile.xml b/test/dds/communication/security/secure_simple_ds_server_profile.xml index d741049a584..2bc227f8104 100644 --- a/test/dds/communication/security/secure_simple_ds_server_profile.xml +++ b/test/dds/communication/security/secure_simple_ds_server_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_submsg_crypto_besteffort_pub_profile.xml b/test/dds/communication/security/secure_submsg_crypto_besteffort_pub_profile.xml index 0c31e5217d8..980504e7765 100644 --- a/test/dds/communication/security/secure_submsg_crypto_besteffort_pub_profile.xml +++ b/test/dds/communication/security/secure_submsg_crypto_besteffort_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/secure_submsg_crypto_besteffort_sub_profile.xml b/test/dds/communication/security/secure_submsg_crypto_besteffort_sub_profile.xml index 3a51a3a1012..1620727e044 100644 --- a/test/dds/communication/security/secure_submsg_crypto_besteffort_sub_profile.xml +++ b/test/dds/communication/security/secure_submsg_crypto_besteffort_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/simple_allow_unauthenticated_sub_profile.xml b/test/dds/communication/security/simple_allow_unauthenticated_sub_profile.xml index 88300420d49..b0ce55d62bd 100644 --- a/test/dds/communication/security/simple_allow_unauthenticated_sub_profile.xml +++ b/test/dds/communication/security/simple_allow_unauthenticated_sub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/simple_secure_allow_unauthenticated_pub_profile.xml b/test/dds/communication/security/simple_secure_allow_unauthenticated_pub_profile.xml index dcd0b5a37b6..1bd3d1b73b2 100644 --- a/test/dds/communication/security/simple_secure_allow_unauthenticated_pub_profile.xml +++ b/test/dds/communication/security/simple_secure_allow_unauthenticated_pub_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/dds/communication/security/simple_secure_besteffort_pub_profile.xml b/test/dds/communication/security/simple_secure_besteffort_pub_profile.xml index da5820e56f0..22cc6eb66f4 100644 --- a/test/dds/communication/security/simple_secure_besteffort_pub_profile.xml +++ b/test/dds/communication/security/simple_secure_besteffort_pub_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/security/simple_secure_besteffort_sub_profile.xml b/test/dds/communication/security/simple_secure_besteffort_sub_profile.xml index 9fff7930fe8..f3ab9d334d3 100644 --- a/test/dds/communication/security/simple_secure_besteffort_sub_profile.xml +++ b/test/dds/communication/security/simple_secure_besteffort_sub_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/shm_communication_subscriber_dies_while_processing_message_profile.xml b/test/dds/communication/shm_communication_subscriber_dies_while_processing_message_profile.xml index e76ad1ca6f6..9e43402a7fb 100644 --- a/test/dds/communication/shm_communication_subscriber_dies_while_processing_message_profile.xml +++ b/test/dds/communication/shm_communication_subscriber_dies_while_processing_message_profile.xml @@ -1,5 +1,5 @@ - + OFF diff --git a/test/dds/communication/simple_besteffort_profile.xml b/test/dds/communication/simple_besteffort_profile.xml index af72629ec6d..72c84aad1ff 100644 --- a/test/dds/communication/simple_besteffort_profile.xml +++ b/test/dds/communication/simple_besteffort_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/simple_besteffort_zerocopy_profile.xml b/test/dds/communication/simple_besteffort_zerocopy_profile.xml index 75b0f71455c..37b1c29bfd3 100644 --- a/test/dds/communication/simple_besteffort_zerocopy_profile.xml +++ b/test/dds/communication/simple_besteffort_zerocopy_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/simple_reliable_profile.xml b/test/dds/communication/simple_reliable_profile.xml index 51e7cc3d96e..df69fc4e609 100644 --- a/test/dds/communication/simple_reliable_profile.xml +++ b/test/dds/communication/simple_reliable_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/communication/simple_reliable_zerocopy_profile.xml b/test/dds/communication/simple_reliable_zerocopy_profile.xml index 00ce9ad4efa..a024c4eddd9 100644 --- a/test/dds/communication/simple_reliable_zerocopy_profile.xml +++ b/test/dds/communication/simple_reliable_zerocopy_profile.xml @@ -1,5 +1,5 @@ - + FULL diff --git a/test/dds/discovery/CMakeLists.txt b/test/dds/discovery/CMakeLists.txt index fd4ec7eaed1..7927a77f91e 100644 --- a/test/dds/discovery/CMakeLists.txt +++ b/test/dds/discovery/CMakeLists.txt @@ -30,7 +30,7 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) ) target_link_libraries(DDSParticipantDiscovery fastcdr - fastrtps + fastdds ${CMAKE_DL_LIBS} ) diff --git a/test/dds/discovery/ParticipantModule.cpp b/test/dds/discovery/ParticipantModule.cpp index 80fb953cb8f..f6224a85af3 100644 --- a/test/dds/discovery/ParticipantModule.cpp +++ b/test/dds/discovery/ParticipantModule.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; @@ -87,8 +87,10 @@ bool ParticipantModule::init() void ParticipantModule::on_participant_discovery( DomainParticipant* participant, - ParticipantDiscoveryInfo&& info) + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) { + static_cast(should_be_ignored); if (info.status == ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { std::cout << "Participant " << participant->guid() << " discovered participant " << info.info.m_guid << ": " diff --git a/test/dds/discovery/ParticipantModule.hpp b/test/dds/discovery/ParticipantModule.hpp index 53073911104..4e80b4232ad 100644 --- a/test/dds/discovery/ParticipantModule.hpp +++ b/test/dds/discovery/ParticipantModule.hpp @@ -46,7 +46,8 @@ class ParticipantModule : public DomainParticipantListener void on_participant_discovery( DomainParticipant* participant, - ParticipantDiscoveryInfo&& info) override; + ParticipantDiscoveryInfo&& info, + bool& should_be_ignored) override; bool init(); diff --git a/test/feature/CMakeLists.txt b/test/feature/CMakeLists.txt new file mode 100644 index 00000000000..4f3a784ba97 --- /dev/null +++ b/test/feature/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/test/mock/rtps/PublisherHistory/fastdds/publisher/DataWriterHistory.hpp b/test/mock/dds/DataWriterHistory/fastdds/publisher/DataWriterHistory.hpp similarity index 99% rename from test/mock/rtps/PublisherHistory/fastdds/publisher/DataWriterHistory.hpp rename to test/mock/dds/DataWriterHistory/fastdds/publisher/DataWriterHistory.hpp index f8de9591e5b..7b85e347e54 100644 --- a/test/mock/rtps/PublisherHistory/fastdds/publisher/DataWriterHistory.hpp +++ b/test/mock/dds/DataWriterHistory/fastdds/publisher/DataWriterHistory.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -29,8 +30,7 @@ #include #include #include -#include -#include +#include #include diff --git a/test/mock/dds/DomainParticipantFactory/fastdds/dds/domain/DomainParticipantFactory.hpp b/test/mock/dds/DomainParticipantFactory/fastdds/dds/domain/DomainParticipantFactory.hpp new file mode 100644 index 00000000000..5f7ea28879c --- /dev/null +++ b/test/mock/dds/DomainParticipantFactory/fastdds/dds/domain/DomainParticipantFactory.hpp @@ -0,0 +1,69 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file DomainParticipantFactory.hpp + * + */ + +#ifndef _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ +#define _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DomainParticipantImpl; + +class DomainParticipantFactory +{ +public: + + static DomainParticipantFactory* get_instance() + { + static std::shared_ptr instance(new DomainParticipantFactory()); + return instance.get(); + } + + xtypes::ITypeObjectRegistry& type_object_registry() + { + return rtps_domain_->type_object_registry(); + } + + DomainParticipantFactory() + : rtps_domain_(fastrtps::rtps::RTPSDomainImpl::get_instance()) + { + } + + void participant_has_been_deleted( + DomainParticipantImpl* part) + { + static_cast(part); + } + +private: + + std::shared_ptr rtps_domain_; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif /* _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_*/ diff --git a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp index 65bab00e4d2..0a8053e1a9c 100644 --- a/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp +++ b/test/mock/dds/DomainParticipantImpl/fastdds/domain/DomainParticipantImpl.hpp @@ -16,16 +16,18 @@ #define _FASTDDS_PARTICIPANTIMPL_HPP_ #include -#include #include #include #include #include #include -#include + +#include #include #include +#include +#include #include #include #include @@ -33,22 +35,21 @@ #include #include #include +#include +#include #include +#include #include -#include #include #include #include -#include -#include -#include - -#include +#include #include #include #include -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; +#include +#include namespace eprosima { namespace fastdds { @@ -118,13 +119,13 @@ class DomainParticipantImpl rtps_participant_ = eprosima::fastrtps::rtps::RTPSDomain::createParticipant( domain_id_, false, rtps_attr, &rtps_listener_); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_qos( DomainParticipantQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantQos& get_qos() const @@ -135,20 +136,20 @@ class DomainParticipantImpl ReturnCode_t set_qos( const DomainParticipantQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_listener( DomainParticipantListener* /*listener*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_listener( DomainParticipantListener* /*listener*/, const std::chrono::seconds /*timeout*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DomainParticipantListener* get_listener() const @@ -199,7 +200,7 @@ class DomainParticipantImpl { if (participant_ != pub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_pubs_); auto pit = publishers_.find(const_cast(pub)); @@ -207,13 +208,13 @@ class DomainParticipantImpl { if (pub->has_datawriters()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete pit->second; publishers_.erase(pit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Subscriber* create_subscriber( @@ -244,7 +245,7 @@ class DomainParticipantImpl { if (participant_ != sub->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_subs_); auto sit = subscribers_.find(const_cast(sub)); @@ -252,13 +253,13 @@ class DomainParticipantImpl { if (sub->has_datareaders()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete sit->second; subscribers_.erase(sit); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } Topic* create_topic( @@ -273,7 +274,7 @@ class DomainParticipantImpl { return nullptr; } - if (!TopicImpl::check_qos(qos)) + if (RETCODE_OK != TopicImpl::check_qos(qos)) { return nullptr; } @@ -323,15 +324,15 @@ class DomainParticipantImpl if (delete_topic_mock()) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } if (nullptr == topic) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } if (participant_ != topic->get_participant()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_topics_); @@ -340,7 +341,7 @@ class DomainParticipantImpl { if (it->second->is_referenced()) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } delete it->second; topics_.erase(it); @@ -349,9 +350,9 @@ class DomainParticipantImpl delete topics_impl_[topic_name]; topics_impl_.erase(topic_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } MOCK_METHOD5(create_contentfilteredtopic, ContentFilteredTopic * ( @@ -398,20 +399,20 @@ class DomainParticipantImpl { if (type_name.size() <= 0) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (!t.empty()) { if (t == type) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } std::lock_guard lock(mtx_types_); types_.insert(std::make_pair(type_name, type)); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t unregister_type( @@ -419,12 +420,12 @@ class DomainParticipantImpl { if (type_name.size() <= 0) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } TypeSupport t = find_type(type_name); if (t.empty()) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } { std::lock_guard lock(mtx_subs_); @@ -432,7 +433,7 @@ class DomainParticipantImpl { if (sit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } @@ -442,13 +443,13 @@ class DomainParticipantImpl { if (pit.second->type_in_use(type_name)) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } } std::lock_guard lock(mtx_types_); types_.erase(type_name); - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainId_t get_domain_id() const @@ -458,13 +459,13 @@ class DomainParticipantImpl ReturnCode_t assert_liveliness() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_publisher_qos( const PublisherQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherQos& get_default_publisher_qos() const @@ -472,17 +473,17 @@ class DomainParticipantImpl return default_pub_qos_; } - const ReturnCode_t get_publisher_qos_from_profile( + ReturnCode_t get_publisher_qos_from_profile( const std::string& /*profile_name*/, PublisherQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_subscriber_qos( const SubscriberQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const SubscriberQos& get_default_subscriber_qos() const @@ -490,17 +491,17 @@ class DomainParticipantImpl return default_sub_qos_; } - const ReturnCode_t get_subscriber_qos_from_profile( + ReturnCode_t get_subscriber_qos_from_profile( const std::string& /*profile_name*/, SubscriberQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_default_topic_qos( const TopicQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const TopicQos& get_default_topic_qos() const @@ -508,11 +509,25 @@ class DomainParticipantImpl return default_topic_qos_; } - const ReturnCode_t get_topic_qos_from_profile( + ReturnCode_t get_topic_qos_from_profile( const std::string& /*profile_name*/, TopicQos& /*qos*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; + } + + ReturnCode_t get_replier_qos_from_profile( + const std::string& /*profile_name*/, + ReplierQos& /*qos*/) const + { + return RETCODE_OK; + } + + ReturnCode_t get_requester_qos_from_profile( + const std::string& /*profile_name*/, + RequesterQos& /*qos*/) const + { + return RETCODE_OK; } bool contains_entity( @@ -525,7 +540,7 @@ class DomainParticipantImpl ReturnCode_t get_current_time( fastrtps::Time_t& /*current_time*/) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipant* get_participant() const @@ -578,26 +593,6 @@ class DomainParticipantImpl return rtps_participant_->get_resource_event(); } - fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const - { - return rtps_participant_->typelookup_manager()->get_type_dependencies(in); - } - - fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const - { - return rtps_participant_->typelookup_manager()->get_types(in); - } - - ReturnCode_t register_remote_type( - const fastrtps::types::TypeInformation& /*type_information*/, - const std::string& /*type_name*/, - std::function& /*callback*/) - { - return ReturnCode_t::RETCODE_OK; - } - virtual void disable() { rtps_listener_.participant_ = nullptr; @@ -622,12 +617,12 @@ class DomainParticipantImpl ReturnCode_t enable_monitor_service() const { - return ReturnCode_t{ReturnCode_t::RETCODE_OK}; + return RETCODE_OK; } ReturnCode_t disable_monitor_service() const { - return ReturnCode_t{ReturnCode_t::RETCODE_OK}; + return RETCODE_OK; } virtual ReturnCode_t delete_contained_entities() @@ -641,7 +636,7 @@ class DomainParticipantImpl can_be_deleted = subscriber.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } @@ -654,18 +649,18 @@ class DomainParticipantImpl can_be_deleted = publisher.second->can_be_deleted(); if (!can_be_deleted) { - return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + return RETCODE_PRECONDITION_NOT_MET; } } - ReturnCode_t ret_code = ReturnCode_t::RETCODE_OK; + ReturnCode_t ret_code = RETCODE_OK; for (auto& subscriber : subscribers_) { ret_code = subscriber.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -680,9 +675,9 @@ class DomainParticipantImpl for (auto& publisher : publishers_) { ret_code = publisher.first->delete_contained_entities(); - if (!ret_code) + if (RETCODE_OK != ret_code) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } } @@ -704,7 +699,7 @@ class DomainParticipantImpl it_topics = topics_.erase(it_topics); } - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DomainParticipantListener* get_listener_for( @@ -782,7 +777,7 @@ class DomainParticipantImpl static ReturnCode_t check_qos( const DomainParticipantQos& /*qos*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } }; diff --git a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp index 7fe3b490627..208b1d9fdb8 100644 --- a/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp +++ b/test/mock/dds/Publisher/fastdds/dds/publisher/Publisher.hpp @@ -20,17 +20,15 @@ #include #include +#include #include #include #include #include #include -#include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { @@ -76,7 +74,7 @@ class Publisher : public Entity ReturnCode_t enable() override { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const PublisherQos& get_qos() const @@ -87,7 +85,7 @@ class Publisher : public Entity ReturnCode_t set_listener( PublisherListener* /*listener*/) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } DataWriter* create_datawriter( @@ -108,7 +106,7 @@ class Publisher : public Entity { if (delete_datawriter_mock()) { - return ReturnCode_t::RETCODE_ERROR; + return RETCODE_ERROR; } return impl_->delete_datawriter(writer); } diff --git a/test/mock/dds/QosPolicies/fastdds/dds/core/policy/QosPolicies.hpp b/test/mock/dds/QosPolicies/fastdds/dds/core/policy/QosPolicies.hpp index 926399187d2..f12a7b1d7e2 100644 --- a/test/mock/dds/QosPolicies/fastdds/dds/core/policy/QosPolicies.hpp +++ b/test/mock/dds/QosPolicies/fastdds/dds/core/policy/QosPolicies.hpp @@ -20,12 +20,13 @@ #ifndef _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ #define _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ -#include #include -#include -#include -#include -#include +#include + +#include +#include +#include +#include namespace eprosima { @@ -170,14 +171,14 @@ class DurabilityQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI DurabilityQosPolicy() + FASTDDS_EXPORTED_API DurabilityQosPolicy() : Parameter_t(PID_DURABILITY, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(VOLATILE_DURABILITY_QOS) { } - virtual RTPS_DllAPI ~DurabilityQosPolicy() + virtual FASTDDS_EXPORTED_API ~DurabilityQosPolicy() { } @@ -234,14 +235,14 @@ class DeadlineQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI DeadlineQosPolicy() + FASTDDS_EXPORTED_API DeadlineQosPolicy() : Parameter_t(PID_DEADLINE, PARAMETER_TIME_LENGTH) , QosPolicy(true) , period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS) { } - virtual RTPS_DllAPI ~DeadlineQosPolicy() + virtual FASTDDS_EXPORTED_API ~DeadlineQosPolicy() { } @@ -265,14 +266,14 @@ class LatencyBudgetQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI LatencyBudgetQosPolicy() + FASTDDS_EXPORTED_API LatencyBudgetQosPolicy() : Parameter_t(PID_LATENCY_BUDGET, PARAMETER_TIME_LENGTH) , QosPolicy(true) , duration(0, 0) { } - virtual RTPS_DllAPI ~LatencyBudgetQosPolicy() + virtual FASTDDS_EXPORTED_API ~LatencyBudgetQosPolicy() { } @@ -311,7 +312,7 @@ class LivelinessQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI LivelinessQosPolicy() + FASTDDS_EXPORTED_API LivelinessQosPolicy() : Parameter_t(PID_LIVELINESS, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH) , QosPolicy(true) , kind(AUTOMATIC_LIVELINESS_QOS) @@ -320,7 +321,7 @@ class LivelinessQosPolicy : public Parameter_t, public QosPolicy announcement_period = fastrtps::c_TimeInfinite; } - virtual RTPS_DllAPI ~LivelinessQosPolicy() + virtual FASTDDS_EXPORTED_API ~LivelinessQosPolicy() { } @@ -355,7 +356,7 @@ class ReliabilityQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI ReliabilityQosPolicy() + FASTDDS_EXPORTED_API ReliabilityQosPolicy() : Parameter_t(PID_RELIABILITY, PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH) , QosPolicy(true) , //indicate send always @@ -365,7 +366,7 @@ class ReliabilityQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~ReliabilityQosPolicy() + virtual FASTDDS_EXPORTED_API ~ReliabilityQosPolicy() { } @@ -400,14 +401,14 @@ class OwnershipQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI OwnershipQosPolicy() + FASTDDS_EXPORTED_API OwnershipQosPolicy() : Parameter_t(PID_OWNERSHIP, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(SHARED_OWNERSHIP_QOS) { } - virtual RTPS_DllAPI ~OwnershipQosPolicy() + virtual FASTDDS_EXPORTED_API ~OwnershipQosPolicy() { } @@ -443,14 +444,14 @@ class DestinationOrderQosPolicy : public Parameter_t, public QosPolicy public: DestinationOrderQosPolicyKind kind; - RTPS_DllAPI DestinationOrderQosPolicy() + FASTDDS_EXPORTED_API DestinationOrderQosPolicy() : Parameter_t(PID_DESTINATION_ORDER, PARAMETER_KIND_LENGTH) , QosPolicy(true) , kind(BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS) { } - virtual RTPS_DllAPI ~DestinationOrderQosPolicy() + virtual FASTDDS_EXPORTED_API ~DestinationOrderQosPolicy() { } @@ -472,7 +473,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, public: - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid) : Parameter_t(pid, 0) , QosPolicy(false) @@ -480,7 +481,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, { } - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid, uint16_t in_length) : Parameter_t(pid, in_length) @@ -497,7 +498,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * * @param data data to copy in the newly created object */ - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( const GenericDataQosPolicy& data) : Parameter_t(data.Pid, data.length) , QosPolicy(false) @@ -514,7 +515,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * @param pid Id of the parameter * @param data data to copy in the newly created object */ - RTPS_DllAPI GenericDataQosPolicy( + FASTDDS_EXPORTED_API GenericDataQosPolicy( ParameterId_t pid, const collection_type& data) : Parameter_t(pid, 0) @@ -525,7 +526,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, length = static_cast((size() + 7u) & ~3u); } - virtual RTPS_DllAPI ~GenericDataQosPolicy() + virtual FASTDDS_EXPORTED_API ~GenericDataQosPolicy() { } @@ -624,7 +625,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * Returns raw data vector. * @return raw data as vector of octets. * */ - RTPS_DllAPI inline const collection_type& data_vec() const + FASTDDS_EXPORTED_API inline const collection_type& data_vec() const { return collection_; } @@ -633,7 +634,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * Sets raw data vector. * @param vec raw data to set. * */ - RTPS_DllAPI inline void data_vec( + FASTDDS_EXPORTED_API inline void data_vec( const collection_type& vec) { assign(vec.begin(), vec.end()); @@ -643,7 +644,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * Returns raw data vector. * @return raw data as vector of octets. * */ - RTPS_DllAPI inline const collection_type& getValue() const + FASTDDS_EXPORTED_API inline const collection_type& getValue() const { return collection_; } @@ -652,7 +653,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * Sets raw data vector. * @param vec raw data to set. * */ - RTPS_DllAPI inline void setValue( + FASTDDS_EXPORTED_API inline void setValue( const collection_type& vec) { assign(vec.begin(), vec.end()); @@ -668,12 +669,12 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, { \ public: \ \ - RTPS_DllAPI TClassName() \ + FASTDDS_EXPORTED_API TClassName() \ : GenericDataQosPolicy(TPid) \ { \ } \ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ uint16_t in_length) \ : GenericDataQosPolicy(TPid, in_length) \ { \ @@ -687,7 +688,7 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * \ * @param data data to copy in the newly created object \ */ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ const TClassName& data) = default; \ \ /** \ @@ -698,13 +699,13 @@ class GenericDataQosPolicy : public Parameter_t, public QosPolicy, * \ * @param data data to copy in the newly created object \ */ \ - RTPS_DllAPI TClassName( \ + FASTDDS_EXPORTED_API TClassName( \ const collection_type& data) \ : GenericDataQosPolicy(TPid, data) \ { \ } \ \ - virtual RTPS_DllAPI ~TClassName() = default; \ + virtual FASTDDS_EXPORTED_API ~TClassName() = default; \ \ /** \ * Copies another TClassName. \ @@ -735,14 +736,14 @@ class TimeBasedFilterQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI TimeBasedFilterQosPolicy() + FASTDDS_EXPORTED_API TimeBasedFilterQosPolicy() : Parameter_t(PID_TIME_BASED_FILTER, PARAMETER_TIME_LENGTH) , QosPolicy(false) , minimum_separation(0, 0) { } - virtual RTPS_DllAPI ~TimeBasedFilterQosPolicy() + virtual FASTDDS_EXPORTED_API ~TimeBasedFilterQosPolicy() { } @@ -783,7 +784,7 @@ class PresentationQosPolicy : public Parameter_t, public QosPolicy PresentationQosPolicyAccessScopeKind access_scope; bool coherent_access; bool ordered_access; - RTPS_DllAPI PresentationQosPolicy() + FASTDDS_EXPORTED_API PresentationQosPolicy() : Parameter_t(PID_PRESENTATION, PARAMETER_PRESENTATION_LENGTH) , QosPolicy(false) , access_scope(INSTANCE_PRESENTATION_QOS) @@ -792,7 +793,7 @@ class PresentationQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~PresentationQosPolicy() + virtual FASTDDS_EXPORTED_API ~PresentationQosPolicy() { } @@ -815,13 +816,13 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI PartitionQosPolicy() + FASTDDS_EXPORTED_API PartitionQosPolicy() : Parameter_t(PID_PARTITION, 0) , QosPolicy(false) { } - RTPS_DllAPI PartitionQosPolicy( + FASTDDS_EXPORTED_API PartitionQosPolicy( uint16_t in_length) : Parameter_t(PID_PARTITION, in_length) , QosPolicy(false) @@ -829,7 +830,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~PartitionQosPolicy() + virtual FASTDDS_EXPORTED_API ~PartitionQosPolicy() { } @@ -848,7 +849,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * Appends a name to the list of partition names. * @param name Name to append. */ - RTPS_DllAPI inline void push_back( + FASTDDS_EXPORTED_API inline void push_back( const char* name) { names_.push_back(std::string(name)); hasChanged = true; @@ -857,7 +858,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy /** * Clears list of partition names */ - RTPS_DllAPI inline void clear() override + FASTDDS_EXPORTED_API inline void clear() override { names_.clear(); } @@ -866,7 +867,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * Returns partition names. * @return Vector of partition name strings. */ - RTPS_DllAPI inline std::vector names() const + FASTDDS_EXPORTED_API inline std::vector names() const { return names_; } @@ -875,7 +876,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * Overrides partition names * @param nam Vector of partition name strings. */ - RTPS_DllAPI inline void names( + FASTDDS_EXPORTED_API inline void names( std::vector& nam) { names_ = nam; hasChanged = true; @@ -885,7 +886,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * Returns partition names. * @return Vector of partition name strings. */ - RTPS_DllAPI inline const std::vector getNames() const + FASTDDS_EXPORTED_API inline const std::vector getNames() const { return names(); } @@ -894,7 +895,7 @@ class PartitionQosPolicy : public Parameter_t, public QosPolicy * Overrides partition names * @param nam Vector of partition name strings. */ - RTPS_DllAPI inline void setNames( + FASTDDS_EXPORTED_API inline void setNames( std::vector& nam) { names(nam); @@ -928,7 +929,7 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy HistoryQosPolicyKind kind; int32_t depth; - RTPS_DllAPI HistoryQosPolicy() + FASTDDS_EXPORTED_API HistoryQosPolicy() : Parameter_t(PID_HISTORY, PARAMETER_KIND_LENGTH + 4) , QosPolicy(true) , kind(KEEP_LAST_HISTORY_QOS) @@ -936,7 +937,7 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~HistoryQosPolicy() + virtual FASTDDS_EXPORTED_API ~HistoryQosPolicy() { } @@ -965,7 +966,7 @@ class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy int32_t max_instances; int32_t max_samples_per_instance; int32_t allocated_samples; - RTPS_DllAPI ResourceLimitsQosPolicy() + FASTDDS_EXPORTED_API ResourceLimitsQosPolicy() : Parameter_t(PID_RESOURCE_LIMITS, 4 + 4 + 4) , QosPolicy(false) , max_samples(5000) @@ -975,7 +976,7 @@ class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~ResourceLimitsQosPolicy() + virtual FASTDDS_EXPORTED_API ~ResourceLimitsQosPolicy() { } @@ -1011,7 +1012,7 @@ class DurabilityServiceQosPolicy : public Parameter_t, public QosPolicy int32_t max_samples; int32_t max_instances; int32_t max_samples_per_instance; - RTPS_DllAPI DurabilityServiceQosPolicy() + FASTDDS_EXPORTED_API DurabilityServiceQosPolicy() : Parameter_t(PID_DURABILITY_SERVICE, PARAMETER_TIME_LENGTH + PARAMETER_KIND_LENGTH + 4 + 4 + 4 + 4) , QosPolicy(false) , history_kind(KEEP_LAST_HISTORY_QOS) @@ -1022,7 +1023,7 @@ class DurabilityServiceQosPolicy : public Parameter_t, public QosPolicy { } - virtual RTPS_DllAPI ~DurabilityServiceQosPolicy() + virtual FASTDDS_EXPORTED_API ~DurabilityServiceQosPolicy() { } @@ -1045,14 +1046,14 @@ class LifespanQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI LifespanQosPolicy() + FASTDDS_EXPORTED_API LifespanQosPolicy() : Parameter_t(PID_LIFESPAN, PARAMETER_TIME_LENGTH) , QosPolicy(true) , duration(fastrtps::c_TimeInfinite) { } - virtual RTPS_DllAPI ~LifespanQosPolicy() + virtual FASTDDS_EXPORTED_API ~LifespanQosPolicy() { } @@ -1076,14 +1077,14 @@ class OwnershipStrengthQosPolicy : public Parameter_t, public QosPolicy public: uint32_t value; - RTPS_DllAPI OwnershipStrengthQosPolicy() + FASTDDS_EXPORTED_API OwnershipStrengthQosPolicy() : Parameter_t(PID_OWNERSHIP_STRENGTH, 4) , QosPolicy(false) , value(0) { } - virtual RTPS_DllAPI ~OwnershipStrengthQosPolicy() + virtual FASTDDS_EXPORTED_API ~OwnershipStrengthQosPolicy() { } @@ -1109,14 +1110,14 @@ class TransportPriorityQosPolicy : public Parameter_t, public QosPolicy public: uint32_t value; - RTPS_DllAPI TransportPriorityQosPolicy() + FASTDDS_EXPORTED_API TransportPriorityQosPolicy() : Parameter_t(PID_TRANSPORT_PRIORITY, 4) , QosPolicy(false) , value(0) { } - virtual RTPS_DllAPI ~TransportPriorityQosPolicy() + virtual FASTDDS_EXPORTED_API ~TransportPriorityQosPolicy() { } @@ -1146,12 +1147,12 @@ class PublishModeQosPolicy : public QosPolicy public: PublishModeQosPolicyKind kind; - RTPS_DllAPI PublishModeQosPolicy() + FASTDDS_EXPORTED_API PublishModeQosPolicy() : kind(SYNCHRONOUS_PUBLISH_MODE) { } - virtual RTPS_DllAPI ~PublishModeQosPolicy() + virtual FASTDDS_EXPORTED_API ~PublishModeQosPolicy() { } @@ -1179,6 +1180,9 @@ typedef enum DataRepresentationId : int16_t XCDR2_DATA_REPRESENTATION //!< } DataRepresentationId_t; +//! Default @ref DataRepresentationId used in Fast DDS. +constexpr DataRepresentationId_t DEFAULT_DATA_REPRESENTATION {DataRepresentationId_t::XCDR_DATA_REPRESENTATION}; + /** * Class DataRepresentationQosPolicy, */ @@ -1189,11 +1193,11 @@ class DataRepresentationQosPolicy : public Parameter_t, public QosPolicy public: std::vector m_value; - RTPS_DllAPI DataRepresentationQosPolicy() + FASTDDS_EXPORTED_API DataRepresentationQosPolicy() { } - virtual RTPS_DllAPI ~DataRepresentationQosPolicy() + virtual FASTDDS_EXPORTED_API ~DataRepresentationQosPolicy() { } @@ -1227,7 +1231,7 @@ class TypeConsistencyEnforcementQosPolicy : public Parameter_t, public QosPolicy bool m_prevent_type_widening; bool m_force_type_validation; - RTPS_DllAPI TypeConsistencyEnforcementQosPolicy() + FASTDDS_EXPORTED_API TypeConsistencyEnforcementQosPolicy() { m_kind = ALLOW_TYPE_COERCION; m_ignore_sequence_bounds = true; @@ -1237,7 +1241,7 @@ class TypeConsistencyEnforcementQosPolicy : public Parameter_t, public QosPolicy m_force_type_validation = false; } - virtual RTPS_DllAPI ~TypeConsistencyEnforcementQosPolicy() + virtual FASTDDS_EXPORTED_API ~TypeConsistencyEnforcementQosPolicy() { } @@ -1259,11 +1263,11 @@ class DisablePositiveACKsQosPolicy : public Parameter_t, public QosPolicy public: - RTPS_DllAPI DisablePositiveACKsQosPolicy() + FASTDDS_EXPORTED_API DisablePositiveACKsQosPolicy() { } - virtual RTPS_DllAPI ~DisablePositiveACKsQosPolicy() + virtual FASTDDS_EXPORTED_API ~DisablePositiveACKsQosPolicy() { } @@ -1303,19 +1307,19 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy { public: - RTPS_DllAPI DataSharingQosPolicy() + FASTDDS_EXPORTED_API DataSharingQosPolicy() : Parameter_t(PID_DATASHARING, 0) , QosPolicy(true) { domain_ids_.push_back(1); } - virtual RTPS_DllAPI ~DataSharingQosPolicy() = default; + virtual FASTDDS_EXPORTED_API ~DataSharingQosPolicy() = default; - RTPS_DllAPI DataSharingQosPolicy( + FASTDDS_EXPORTED_API DataSharingQosPolicy( const DataSharingQosPolicy& b) = default; - RTPS_DllAPI DataSharingQosPolicy& operator =( + FASTDDS_EXPORTED_API DataSharingQosPolicy& operator =( const DataSharingQosPolicy& b) = default; bool operator ==( @@ -1399,7 +1403,7 @@ class DataSharingQosPolicy : public Parameter_t, public QosPolicy /** * @brief Configures the DataSharing in disabled mode */ - RTPS_DllAPI void off() + FASTDDS_EXPORTED_API void off() { kind_ = OFF; shm_directory_ = "directory"; @@ -1423,28 +1427,28 @@ class TypeIdV1 : public Parameter_t, public QosPolicy public: - RTPS_DllAPI TypeIdV1() + FASTDDS_EXPORTED_API TypeIdV1() : Parameter_t(PID_TYPE_IDV1, 0) , QosPolicy(false) { //m_type_identifier->_d(EK_MINIMAL); } - RTPS_DllAPI TypeIdV1( + FASTDDS_EXPORTED_API TypeIdV1( const TypeIdV1& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeIdV1( + FASTDDS_EXPORTED_API TypeIdV1( TypeIdV1&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeIdV1& operator =( + FASTDDS_EXPORTED_API TypeIdV1& operator =( const TypeIdV1& type) { Pid = type.Pid; @@ -1454,7 +1458,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy return *this; } - RTPS_DllAPI TypeIdV1& operator =( + FASTDDS_EXPORTED_API TypeIdV1& operator =( TypeIdV1&& type) { Pid = type.Pid; @@ -1464,7 +1468,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy return *this; } - virtual RTPS_DllAPI ~TypeIdV1() + virtual FASTDDS_EXPORTED_API ~TypeIdV1() { } @@ -1485,27 +1489,27 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy public: - RTPS_DllAPI TypeObjectV1() + FASTDDS_EXPORTED_API TypeObjectV1() : Parameter_t(PID_TYPE_OBJECTV1, 0) , QosPolicy(false) { } - RTPS_DllAPI TypeObjectV1( + FASTDDS_EXPORTED_API TypeObjectV1( const TypeObjectV1& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeObjectV1( + FASTDDS_EXPORTED_API TypeObjectV1( TypeObjectV1&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeObjectV1& operator =( + FASTDDS_EXPORTED_API TypeObjectV1& operator =( const TypeObjectV1& type) { Pid = type.Pid; @@ -1515,7 +1519,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy return *this; } - RTPS_DllAPI TypeObjectV1& operator =( + FASTDDS_EXPORTED_API TypeObjectV1& operator =( TypeObjectV1&& type) { Pid = type.Pid; @@ -1525,7 +1529,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy return *this; } - virtual RTPS_DllAPI ~TypeObjectV1() + virtual FASTDDS_EXPORTED_API ~TypeObjectV1() { } @@ -1537,70 +1541,70 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy }; -namespace types { +namespace xtypes { class TypeInformation; } // namespace types namespace xtypes { -class TypeInformation : public Parameter_t, public QosPolicy +class TypeInformationParameter : public Parameter_t, public QosPolicy { public: - RTPS_DllAPI TypeInformation() + FASTDDS_EXPORTED_API TypeInformationParameter() : Parameter_t(PID_TYPE_INFORMATION, 0) , QosPolicy(false) { } - RTPS_DllAPI TypeInformation( - const TypeInformation& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + const TypeInformationParameter& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeInformation( - TypeInformation&& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + TypeInformationParameter&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.m_sendAlways) { } - RTPS_DllAPI TypeInformation& operator =( - const TypeInformation&) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const TypeInformationParameter&) { return *this; } - RTPS_DllAPI TypeInformation& operator =( - TypeInformation&&) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + TypeInformationParameter&&) { return *this; } - virtual RTPS_DllAPI ~TypeInformation() override + virtual FASTDDS_EXPORTED_API ~TypeInformationParameter() override { } inline void clear() override { - TypeInformation reset = TypeInformation(); + TypeInformationParameter reset = TypeInformationParameter(); std::swap(*this, reset); } - RTPS_DllAPI bool isAssigned() const + FASTDDS_EXPORTED_API bool isAssigned() const { return true; } - RTPS_DllAPI TypeInformation& operator =( - const types::TypeInformation&) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const xtypes::TypeInformation&) { return *this; } - RTPS_DllAPI const types::TypeInformation* get() const + FASTDDS_EXPORTED_API const xtypes::TypeInformation* get() const { return nullptr; } diff --git a/test/mock/dds/TypeObjectRegistry/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp b/test/mock/dds/TypeObjectRegistry/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp new file mode 100644 index 00000000000..61ff65c7a64 --- /dev/null +++ b/test/mock/dds/TypeObjectRegistry/fastdds/xtypes/type_representation/TypeObjectRegistry.hpp @@ -0,0 +1,53 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file contains the required classes to keep a TypeObject/TypeIdentifier registry. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +class ITypeObjectRegistry +{ +}; + +class TypeObjectRegistry : public ITypeObjectRegistry +{ +public: + + ReturnCode_t get_type_object( + const TypeIdentifier&, + TypeObject&) + { + return fastdds::dds::RETCODE_OK; + } + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTREGISTRY_HPP_ diff --git a/test/mock/dds/TypeObjectUtils/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp b/test/mock/dds/TypeObjectUtils/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp new file mode 100644 index 00000000000..2b40626c61d --- /dev/null +++ b/test/mock/dds/TypeObjectUtils/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp @@ -0,0 +1,52 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file + * This file contains static functions to help build a TypeObject. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +class TypeObjectUtils +{ +public: + + static void type_object_consistency( + const TypeObject&) + { + } + + static bool is_direct_hash_type_identifier( + const TypeIdentifier&) + { + return false; + } + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ diff --git a/test/mock/rtps/BuiltinProtocols/fastdds/rtps/builtin/BuiltinProtocols.h b/test/mock/rtps/BuiltinProtocols/fastdds/rtps/builtin/BuiltinProtocols.h deleted file mode 100644 index 55c09e287ea..00000000000 --- a/test/mock/rtps/BuiltinProtocols/fastdds/rtps/builtin/BuiltinProtocols.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file BiultinProtocols.h - */ - -#ifndef _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ -#define _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ - -#include -#include - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace builtin { - -class TypeLookupManager; - -} // namespace builtin -} // namespace dds -} // namespace fastdds -namespace fastrtps { -namespace rtps { - -class RTPSParticipantImpl; -class WLP; - -class BuiltinProtocols -{ -public: - - BuiltinProtocols() - : mp_participantImpl(nullptr) - , mp_PDP(nullptr) - , mp_WLP(nullptr) - , tlm_(nullptr) - { - } - - virtual ~BuiltinProtocols() - { - } - - //!Locator list for metatraffic - LocatorList_t m_metatrafficMulticastLocatorList; - //!Locator List for metatraffic unicast - LocatorList_t m_metatrafficUnicastLocatorList; - - LocatorList_t m_initialPeersList; - - //!BuiltinAttributes of the builtin protocols. - BuiltinAttributes m_att; - - //! Known discovery and backup server container - std::list m_DiscoveryServers; - - //!Pointer to the RTPSParticipantImpl. - RTPSParticipantImpl* mp_participantImpl; - - //!Pointer to the PDPSimple. - PDP* mp_PDP; - - //!Pointer to the WLP - WLP* mp_WLP; - - //!Pointer to the TypeLookupManager - fastdds::dds::builtin::TypeLookupManager* tlm_; - -}; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif // _FASTDDS_RTPS_ENDPOINT_H_ diff --git a/test/mock/rtps/BuiltinProtocols/rtps/builtin/BuiltinProtocols.h b/test/mock/rtps/BuiltinProtocols/rtps/builtin/BuiltinProtocols.h new file mode 100644 index 00000000000..d02b3ad8b72 --- /dev/null +++ b/test/mock/rtps/BuiltinProtocols/rtps/builtin/BuiltinProtocols.h @@ -0,0 +1,73 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file BiultinProtocols.h + */ + +#ifndef _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ +#define _FASTDDS_RTPS_BUILTINPROTOCOLS_H_ + +#include +#include + +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class RTPSParticipantImpl; +class WLP; + +class BuiltinProtocols +{ +public: + + BuiltinProtocols() = default; + + virtual ~BuiltinProtocols() = default; + + //!Locator list for metatraffic + LocatorList_t m_metatrafficMulticastLocatorList; + //!Locator List for metatraffic unicast + LocatorList_t m_metatrafficUnicastLocatorList; + + LocatorList_t m_initialPeersList; + + //!BuiltinAttributes of the builtin protocols. + BuiltinAttributes m_att; + + //! Known discovery and backup server container + std::list m_DiscoveryServers; + + //!Pointer to the RTPSParticipantImpl. + RTPSParticipantImpl* mp_participantImpl {nullptr}; + + //!Pointer to the PDPSimple. + PDP* mp_PDP {nullptr}; + + //!Pointer to the WLP + WLP* mp_WLP {nullptr}; + + //!Pointer to the TypeLookupManager + fastdds::dds::builtin::TypeLookupManager* typelookup_manager_ {nullptr}; + +}; + +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima + +#endif // _FASTDDS_RTPS_ENDPOINT_H_ diff --git a/test/mock/rtps/EDP/fastdds/rtps/builtin/discovery/endpoint/EDP.h b/test/mock/rtps/EDP/fastdds/rtps/builtin/discovery/endpoint/EDP.h deleted file mode 100644 index 86096f0ebe5..00000000000 --- a/test/mock/rtps/EDP/fastdds/rtps/builtin/discovery/endpoint/EDP.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file EDP.h - */ - -#ifndef _FASTDDS_RTPS_EDP_H_ -#define _FASTDDS_RTPS_EDP_H_ - -#include -#include -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class EDP -{ -public: - - virtual ~EDP() - { - - } - - virtual bool initEDP( - eprosima::fastrtps::rtps::BuiltinAttributes&) - { - return true; - } - - virtual void removeRemoteEndpoints( - eprosima::fastrtps::rtps::ParticipantProxyData*) - { - - } - - virtual bool areRemoteEndpointsMatched( - const eprosima::fastrtps::rtps::ParticipantProxyData*) - { - return true; - } - - virtual bool removeLocalReader( - eprosima::fastrtps::rtps::RTPSReader*) - { - return true; - } - - virtual bool removeLocalWriter( - eprosima::fastrtps::rtps::RTPSWriter*) - { - return true; - } - - virtual void assignRemoteEndpoints( - const eprosima::fastrtps::rtps::ParticipantProxyData&, - bool) - { - - } - - virtual bool processLocalReaderProxyData( - eprosima::fastrtps::rtps::RTPSReader*, - eprosima::fastrtps::rtps::ReaderProxyData*) - { - return true; - } - - virtual bool processLocalWriterProxyData( - eprosima::fastrtps::rtps::RTPSWriter*, - eprosima::fastrtps::rtps::WriterProxyData*) - { - return true; - } - - MOCK_METHOD3(unpairWriterProxy, bool( - const GUID_t& participant_guid, - const GUID_t& writer_guid, - bool removed_by_lease)); - - MOCK_METHOD2(unpairReaderProxy, bool( - const GUID_t& participant_guid, - const GUID_t& reader_guid)); - -#if HAVE_SECURITY - MOCK_METHOD3(pairing_reader_proxy_with_local_writer, bool(const GUID_t& local_writer, - const GUID_t& remote_participant_guid, ReaderProxyData & rdata)); - - MOCK_METHOD2(pairing_remote_reader_with_local_writer_after_security, bool(const GUID_t& local_writer, - const ReaderProxyData& remote_reader_data)); - - MOCK_METHOD3(pairing_writer_proxy_with_local_reader, bool(const GUID_t& local_reader, - const GUID_t& remote_participant_guid, WriterProxyData & wdata)); - - MOCK_METHOD2(pairing_remote_writer_with_local_reader_after_security, bool(const GUID_t& local_reader, - const WriterProxyData& remote_writer_data)); - - virtual bool pairing_remote_writer_with_local_builtin_reader_after_security( - const eprosima::fastrtps::rtps::GUID_t&, - const eprosima::fastrtps::rtps::WriterProxyData&) - { - return true; - } - - virtual bool pairing_remote_reader_with_local_builtin_writer_after_security( - const eprosima::fastrtps::rtps::GUID_t&, - const eprosima::fastrtps::rtps::ReaderProxyData&) - { - return true; - } - -#endif // if HAVE_SECURITY -}; - -} //namespace rtps -} //namespace fastrtps -} //namespace eprosima - -#endif // _FASTDDS_RTPS_EDP_H_ - diff --git a/test/mock/rtps/EDP/rtps/builtin/discovery/endpoint/EDP.h b/test/mock/rtps/EDP/rtps/builtin/discovery/endpoint/EDP.h new file mode 100644 index 00000000000..1bac39bab51 --- /dev/null +++ b/test/mock/rtps/EDP/rtps/builtin/discovery/endpoint/EDP.h @@ -0,0 +1,137 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file EDP.h + */ + +#ifndef _FASTDDS_RTPS_EDP_H_ +#define _FASTDDS_RTPS_EDP_H_ +#include + +#include +#include +#include +#include + +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class EDP +{ +public: + + virtual ~EDP() + { + + } + + virtual bool initEDP( + eprosima::fastrtps::rtps::BuiltinAttributes&) + { + return true; + } + + virtual void removeRemoteEndpoints( + eprosima::fastrtps::rtps::ParticipantProxyData*) + { + + } + + virtual bool areRemoteEndpointsMatched( + const eprosima::fastrtps::rtps::ParticipantProxyData*) + { + return true; + } + + virtual bool removeLocalReader( + eprosima::fastrtps::rtps::RTPSReader*) + { + return true; + } + + virtual bool removeLocalWriter( + eprosima::fastrtps::rtps::RTPSWriter*) + { + return true; + } + + virtual void assignRemoteEndpoints( + const eprosima::fastrtps::rtps::ParticipantProxyData&, + bool) + { + + } + + virtual bool processLocalReaderProxyData( + eprosima::fastrtps::rtps::RTPSReader*, + eprosima::fastrtps::rtps::ReaderProxyData*) + { + return true; + } + + virtual bool processLocalWriterProxyData( + eprosima::fastrtps::rtps::RTPSWriter*, + eprosima::fastrtps::rtps::WriterProxyData*) + { + return true; + } + + MOCK_METHOD3(unpairWriterProxy, bool( + const GUID_t& participant_guid, + const GUID_t& writer_guid, + bool removed_by_lease)); + + MOCK_METHOD2(unpairReaderProxy, bool( + const GUID_t& participant_guid, + const GUID_t& reader_guid)); + +#if HAVE_SECURITY + MOCK_METHOD3(pairing_reader_proxy_with_local_writer, bool(const GUID_t& local_writer, + const GUID_t& remote_participant_guid, ReaderProxyData & rdata)); + + MOCK_METHOD2(pairing_remote_reader_with_local_writer_after_security, bool(const GUID_t& local_writer, + const ReaderProxyData& remote_reader_data)); + + MOCK_METHOD3(pairing_writer_proxy_with_local_reader, bool(const GUID_t& local_reader, + const GUID_t& remote_participant_guid, WriterProxyData & wdata)); + + MOCK_METHOD2(pairing_remote_writer_with_local_reader_after_security, bool(const GUID_t& local_reader, + const WriterProxyData& remote_writer_data)); + + virtual bool pairing_remote_writer_with_local_builtin_reader_after_security( + const eprosima::fastrtps::rtps::GUID_t&, + const eprosima::fastrtps::rtps::WriterProxyData&) + { + return true; + } + + virtual bool pairing_remote_reader_with_local_builtin_writer_after_security( + const eprosima::fastrtps::rtps::GUID_t&, + const eprosima::fastrtps::rtps::ReaderProxyData&) + { + return true; + } + +#endif // if HAVE_SECURITY +}; + +} //namespace rtps +} //namespace fastrtps +} //namespace eprosima + +#endif // _FASTDDS_RTPS_EDP_H_ diff --git a/test/mock/rtps/Endpoint/fastdds/rtps/Endpoint.h b/test/mock/rtps/Endpoint/fastdds/rtps/Endpoint.h index d18ad45e52f..457a0692d71 100644 --- a/test/mock/rtps/Endpoint/fastdds/rtps/Endpoint.h +++ b/test/mock/rtps/Endpoint/fastdds/rtps/Endpoint.h @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_ENDPOINT_H_ #define _FASTDDS_RTPS_ENDPOINT_H_ -#include +#include #include namespace eprosima { diff --git a/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h b/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h deleted file mode 100644 index 48a175cc5bf..00000000000 --- a/test/mock/rtps/MessageReceiver/fastdds/rtps/messages/MessageReceiver.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file MessageReceiver.h - */ - - - -#ifndef _FASTDDS_RTPS_MESSAGERECEIVER_H_ -#define _FASTDDS_RTPS_MESSAGERECEIVER_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#include -#include -#include - - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class RTPSWriter; -class RTPSReader; -struct SubmessageHeader_t; -class ReceiverResource; - -/** - * Class MessageReceiver, process the received messages. - * @ingroup MANAGEMENT_MODULE - */ -class MessageReceiver -{ -public: - - MessageReceiver( - RTPSParticipantImpl* /*participant*/, - ReceiverResource* /*receiverResource*/) - { - - } - - virtual ~MessageReceiver() - { - } - - void reset() - { - } - - void init( - uint32_t /*rec_buffer_size*/) - { - } - - virtual void processCDRMsg( - const Locator_t& /*loc*/, - CDRMessage_t* /*msg*/) - { - } - - void setReceiverResource( - ReceiverResource* /*receiverResource*/) - { - } - -}; -} // namespace rtps -} /* namespace rtps */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_RTPS_MESSAGERECEIVER_H_*/ diff --git a/test/mock/rtps/MessageReceiver/rtps/messages/MessageReceiver.h b/test/mock/rtps/MessageReceiver/rtps/messages/MessageReceiver.h new file mode 100644 index 00000000000..8c149cb7fdf --- /dev/null +++ b/test/mock/rtps/MessageReceiver/rtps/messages/MessageReceiver.h @@ -0,0 +1,83 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file MessageReceiver.h + */ + + + +#ifndef _FASTDDS_RTPS_MESSAGERECEIVER_H_ +#define _FASTDDS_RTPS_MESSAGERECEIVER_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include +#include +#include + + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class RTPSWriter; +class RTPSReader; +struct SubmessageHeader_t; +class ReceiverResource; + +/** + * Class MessageReceiver, process the received messages. + * @ingroup MANAGEMENT_MODULE + */ +class MessageReceiver +{ +public: + + MessageReceiver( + RTPSParticipantImpl* /*participant*/, + ReceiverResource* /*receiverResource*/) + { + + } + + virtual ~MessageReceiver() + { + } + + void reset() + { + } + + void init( + uint32_t /*rec_buffer_size*/) + { + } + + virtual void processCDRMsg( + const Locator_t& /*loc*/, + CDRMessage_t* /*msg*/) + { + } + + void setReceiverResource( + ReceiverResource* /*receiverResource*/) + { + } + +}; +} // namespace rtps +} /* namespace rtps */ +} /* namespace eprosima */ +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* _FASTDDS_RTPS_MESSAGERECEIVER_H_*/ diff --git a/test/mock/rtps/NetworkFactory/rtps/network/NetworkFactory.h b/test/mock/rtps/NetworkFactory/rtps/network/NetworkFactory.h index 8871da212a1..2ad6a7feb17 100644 --- a/test/mock/rtps/NetworkFactory/rtps/network/NetworkFactory.h +++ b/test/mock/rtps/NetworkFactory/rtps/network/NetworkFactory.h @@ -18,11 +18,11 @@ #include #include +#include #include -#include -#include -#include +#include +#include #include namespace eprosima { @@ -32,7 +32,7 @@ namespace rtps { class RTPSParticipantAttributes; /** - * Provides the FastRTPS library with abstract resources, which + * Provides the Fast DDS library with abstract resources, which * in turn manage the SEND and RECEIVE operations over some transport. * Once a transport is registered, it becomes invisible to the library * and is abstracted away for good. diff --git a/test/mock/rtps/PDP/fastdds/rtps/builtin/discovery/participant/PDP.h b/test/mock/rtps/PDP/fastdds/rtps/builtin/discovery/participant/PDP.h deleted file mode 100644 index c2d3f232f60..00000000000 --- a/test/mock/rtps/PDP/fastdds/rtps/builtin/discovery/participant/PDP.h +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDP.h - */ - -#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ -#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ - -#include -#include -#include -#include -#include - -#include - -namespace eprosima { - -namespace fastdds { -namespace statistics { -namespace rtps { - -struct IProxyObserver; - -} // namespace rtps -} // namespace statistics -} // namespace fastdds - -namespace fastrtps { -namespace rtps { - -class PDP -{ -public: - - inline std::recursive_mutex* getMutex() const - { - return mutex_; - } - - // *INDENT-OFF* Uncrustify makes a mess with MOCK_METHOD macros - MOCK_METHOD1(init, bool( - RTPSParticipantImpl* part)); - - MOCK_METHOD2(createParticipantProxyData, ParticipantProxyData*( - const ParticipantProxyData& p, - const GUID_t& writer_guid)); - - MOCK_METHOD0(createPDPEndpoints, bool()); - - MOCK_METHOD0(getEDP, EDP*()); - -#ifdef FASTDDS_STATISTICS - MOCK_METHOD0(get_proxy_observer, const fastdds::statistics::rtps::IProxyObserver*()); -#endif // FASTDDS_STATISTICS - - MOCK_METHOD1(assignRemoteEndpoints, void( - ParticipantProxyData* pdata)); - - MOCK_METHOD1(removeRemoteEndpoints, void( - const ParticipantProxyData* pdata)); - - MOCK_METHOD1(get_participant_proxy_data_serialized, CDRMessage_t( - Endianness_t endian)); - - MOCK_METHOD3(addReaderProxyData, ReaderProxyData*( - const GUID_t& reader_guid, - GUID_t& participant_guid, - std::function initializer_func)); - - MOCK_METHOD3(addWriterProxyData, WriterProxyData*( - const GUID_t& writer_guid, - GUID_t& participant_guid, - std::function initializer_func)); - - MOCK_METHOD2(lookupReaderProxyData, bool( - const GUID_t& reader, - ReaderProxyData& rdata)); - - MOCK_METHOD2(lookupWriterProxyData, bool( - const GUID_t& writer, - WriterProxyData& wdata)); - - MOCK_METHOD2(notifyAboveRemoteEndpoints, void( - const ParticipantProxyData& pdata, - bool notify_secure_endpoints)); - - MOCK_METHOD0(ParticipantProxiesBegin, ResourceLimitedVector::const_iterator()); - - MOCK_METHOD0(ParticipantProxiesEnd, ResourceLimitedVector::const_iterator()); - - MOCK_METHOD(RTPSParticipantImpl*, getRTPSParticipant, (), (const)); - - ProxyPool& get_temporary_reader_proxies_pool() - { - return temp_proxy_readers; - } - - ProxyPool& get_temporary_writer_proxies_pool() - { - return temp_proxy_writers; - } - - // *INDENT-ON* - - std::recursive_mutex* mutex_; - - // temporary proxies pools - ProxyPool temp_proxy_readers = {{4, 1}}; - ProxyPool temp_proxy_writers = {{4, 1}}; -}; - -} //namespace rtps -} //namespace fastrtps -} //namespace eprosima - -#endif // _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ diff --git a/test/mock/rtps/PDP/rtps/builtin/discovery/participant/PDP.h b/test/mock/rtps/PDP/rtps/builtin/discovery/participant/PDP.h new file mode 100644 index 00000000000..b288545290d --- /dev/null +++ b/test/mock/rtps/PDP/rtps/builtin/discovery/participant/PDP.h @@ -0,0 +1,130 @@ +// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file PDP.h + */ + +#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ +#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ + +#include + +#include +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace statistics { +namespace rtps { + +struct IProxyObserver; + +} // namespace rtps +} // namespace statistics +} // namespace fastdds + +namespace fastrtps { +namespace rtps { + +class PDP +{ +public: + + inline std::recursive_mutex* getMutex() const + { + return mutex_; + } + + // *INDENT-OFF* Uncrustify makes a mess with MOCK_METHOD macros + MOCK_METHOD1(init, bool( + RTPSParticipantImpl* part)); + + MOCK_METHOD2(createParticipantProxyData, ParticipantProxyData*( + const ParticipantProxyData& p, + const GUID_t& writer_guid)); + + MOCK_METHOD0(createPDPEndpoints, bool()); + + MOCK_METHOD0(getEDP, EDP*()); + +#ifdef FASTDDS_STATISTICS + MOCK_METHOD0(get_proxy_observer, const fastdds::statistics::rtps::IProxyObserver*()); +#endif // FASTDDS_STATISTICS + + MOCK_METHOD1(assignRemoteEndpoints, void( + ParticipantProxyData* pdata)); + + MOCK_METHOD1(removeRemoteEndpoints, void( + const ParticipantProxyData* pdata)); + + MOCK_METHOD1(get_participant_proxy_data_serialized, CDRMessage_t( + Endianness_t endian)); + + MOCK_METHOD3(addReaderProxyData, ReaderProxyData*( + const GUID_t& reader_guid, + GUID_t& participant_guid, + std::function initializer_func)); + + MOCK_METHOD3(addWriterProxyData, WriterProxyData*( + const GUID_t& writer_guid, + GUID_t& participant_guid, + std::function initializer_func)); + + MOCK_METHOD2(lookupReaderProxyData, bool( + const GUID_t& reader, + ReaderProxyData& rdata)); + + MOCK_METHOD2(lookupWriterProxyData, bool( + const GUID_t& writer, + WriterProxyData& wdata)); + + MOCK_METHOD2(notifyAboveRemoteEndpoints, void( + const ParticipantProxyData& pdata, + bool notify_secure_endpoints)); + + MOCK_METHOD0(ParticipantProxiesBegin, ResourceLimitedVector::const_iterator()); + + MOCK_METHOD0(ParticipantProxiesEnd, ResourceLimitedVector::const_iterator()); + + MOCK_METHOD(RTPSParticipantImpl*, getRTPSParticipant, (), (const)); + + ProxyPool& get_temporary_reader_proxies_pool() + { + return temp_proxy_readers; + } + + ProxyPool& get_temporary_writer_proxies_pool() + { + return temp_proxy_writers; + } + + // *INDENT-ON* + + std::recursive_mutex* mutex_; + + // temporary proxies pools + ProxyPool temp_proxy_readers = {{4, 1}}; + ProxyPool temp_proxy_writers = {{4, 1}}; +}; + +} //namespace rtps +} //namespace fastrtps +} //namespace eprosima + +#endif // _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDP_H_ diff --git a/test/mock/rtps/PDPSimple/fastdds/rtps/builtin/discovery/participant/PDPSimple.h b/test/mock/rtps/PDPSimple/fastdds/rtps/builtin/discovery/participant/PDPSimple.h deleted file mode 100644 index eb2d4de8a68..00000000000 --- a/test/mock/rtps/PDPSimple/fastdds/rtps/builtin/discovery/participant/PDPSimple.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file PDPSimple.h - */ - -#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ -#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ - -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class PDPSimple -{ -public: - - MOCK_METHOD2(notifyAboveRemoteEndpoints, void(const ParticipantProxyData&, bool)); - - MOCK_METHOD1(get_participant_proxy_data_serialized, CDRMessage_t(Endianness_t)); - - EDP* getEDP() - { - return &edp_; - } - -private: - - EDP edp_; -}; - -} //namespace rtps -} //namespace fastrtps -} //namespace eprosima - -#endif // _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/test/mock/rtps/PDPSimple/rtps/builtin/discovery/participant/PDPSimple.h b/test/mock/rtps/PDPSimple/rtps/builtin/discovery/participant/PDPSimple.h new file mode 100644 index 00000000000..1012f973e76 --- /dev/null +++ b/test/mock/rtps/PDPSimple/rtps/builtin/discovery/participant/PDPSimple.h @@ -0,0 +1,56 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file PDPSimple.h + */ + +#ifndef _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ +#define _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ + +#include + +#include +#include + +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class PDPSimple +{ +public: + + MOCK_METHOD2(notifyAboveRemoteEndpoints, void(const ParticipantProxyData&, bool)); + + MOCK_METHOD1(get_participant_proxy_data_serialized, CDRMessage_t(Endianness_t)); + + EDP* getEDP() + { + return &edp_; + } + +private: + + EDP edp_; +}; + +} //namespace rtps +} //namespace fastrtps +} //namespace eprosima + +#endif // _FASTDDS_RTPS_BUILTIN_DISCOVERY_PARTICIPANT_PDPSIMPLE_H_ diff --git a/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h b/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h index 9c80991e8be..6b2d8a817af 100644 --- a/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h +++ b/test/mock/rtps/ParticipantProxyData/fastdds/rtps/builtin/data/ParticipantProxyData.h @@ -18,15 +18,15 @@ #ifndef _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ #define _FASTDDS_RTPS_BUILTIN_DATA_PARTICIPANTPROXYDATA_H_ +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include #if HAVE_SECURITY -#include +#include #endif // if HAVE_SECURITY namespace eprosima { diff --git a/test/mock/rtps/PublisherHistory/fastrtps/publisher/PublisherHistory.h b/test/mock/rtps/PublisherHistory/fastrtps/publisher/PublisherHistory.h deleted file mode 100644 index 12655721d96..00000000000 --- a/test/mock/rtps/PublisherHistory/fastrtps/publisher/PublisherHistory.h +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissiones and -// limitations under the License. - -#ifndef PUBLISHERHISTORY_H_ -#define PUBLISHERHISTORY_H_ - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { - -using namespace eprosima::fastrtps::rtps; - -static HistoryAttributes to_history_attributes( - const TopicAttributes& topic_att, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) -{ - auto initial_samples = topic_att.resourceLimitsQos.allocated_samples; - auto max_samples = topic_att.resourceLimitsQos.max_samples; - auto extra_samples = topic_att.resourceLimitsQos.extra_samples; - - if (topic_att.historyQos.kind != KEEP_ALL_HISTORY_QOS) - { - max_samples = topic_att.historyQos.depth; - if (topic_att.getTopicKind() != NO_KEY) - { - max_samples *= topic_att.resourceLimitsQos.max_instances; - } - - initial_samples = std::min(initial_samples, max_samples); - } - - return HistoryAttributes(mempolicy, payloadMaxSize, initial_samples, max_samples, extra_samples); -} - -class PublisherHistory : public WriterHistory -{ -public: - - PublisherHistory( - const TopicAttributes& topic_att, - uint32_t payloadMaxSize, - MemoryManagementPolicy_t mempolicy) - : WriterHistory(to_history_attributes(topic_att, payloadMaxSize, mempolicy)) - , history_qos_(topic_att.historyQos) - , resource_limited_qos_(topic_att.resourceLimitsQos) - , topic_att_(topic_att) - { - if (resource_limited_qos_.max_samples <= 0) - { - resource_limited_qos_.max_samples = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_instances <= 0) - { - resource_limited_qos_.max_instances = std::numeric_limits::max(); - } - - if (resource_limited_qos_.max_samples_per_instance <= 0) - { - resource_limited_qos_.max_samples_per_instance = std::numeric_limits::max(); - } - } - - PublisherHistory( - const PublisherHistory&) - : WriterHistory(HistoryAttributes()) - { - } - - ~PublisherHistory() = default; - - MOCK_METHOD3(wait_for_acknowledgement_last_change, bool( - const InstanceHandle_t&, - std::unique_lock& lock, - const std::chrono::time_point& max_blocking_time)); - - void rebuild_instances() - { - } - - bool register_instance( - const InstanceHandle_t& instance_handle, - std::unique_lock&, - const std::chrono::time_point&) - { - /// Preconditions - if (topic_att_.getTopicKind() == NO_KEY) - { - return false; - } - - t_m_Inst_Caches::iterator vit; - return find_or_add_key(instance_handle, &vit); - } - - bool is_key_registered( - const InstanceHandle_t& handle) - { - if (mp_writer == nullptr || mp_mutex == nullptr) - { - EPROSIMA_LOG_ERROR(RTPS_HISTORY, "You need to create a Writer with this History before using it"); - return false; - } - std::lock_guard guard(*this->mp_mutex); - t_m_Inst_Caches::iterator vit; - vit = keyed_changes_.find(handle); - return (vit != keyed_changes_.end() && - (vit->second.cache_changes.empty() || - (NOT_ALIVE_UNREGISTERED != vit->second.cache_changes.back()->kind && - NOT_ALIVE_DISPOSED_UNREGISTERED != vit->second.cache_changes.back()->kind - ) - ) - ); - } - - bool add_pub_change( - CacheChange_t* change, - WriteParams& wparams, - std::unique_lock&, - const std::chrono::time_point&) - { - if (m_isHistoryFull) - { - if (!this->remove_min_change()) - { - return false; - } - } - - bool returnedValue = false; - - // For NO_KEY we can directly add the change - bool add = (topic_att_.getTopicKind() == NO_KEY); - if (topic_att_.getTopicKind() == WITH_KEY) - { - t_m_Inst_Caches::iterator vit; - - if (find_or_add_key(change->instanceHandle, &vit)) - { - vit->second.cache_changes.push_back(change); - add = true; - } - } - - if (add) - { - if (this->add_change_(change, wparams)) - { - returnedValue = true; - } - } - return returnedValue; - } - - bool set_next_deadline( - const InstanceHandle_t&, - const std::chrono::steady_clock::time_point&) - { - return true; - } - - bool removeMinChange() - { - return true; - } - - bool removeAllChange( - size_t*) - { - return true; - } - - bool remove_instance_changes( - const InstanceHandle_t&, - const SequenceNumber_t&) - { - return true; - } - - bool get_next_deadline( - InstanceHandle_t&, - std::chrono::steady_clock::time_point&) - { - return true; - } - - bool remove_change_pub( - CacheChange_t* change) - { - if (mp_writer == nullptr || mp_mutex == nullptr) - { - return false; - } - - std::lock_guard guard(*this->mp_mutex); - if (topic_att_.getTopicKind() == NO_KEY) - { - if (remove_change(change)) - { - m_isHistoryFull = false; - return true; - } - - return false; - } - else - { - t_m_Inst_Caches::iterator vit; - if (!this->find_or_add_key(change->instanceHandle, &vit)) - { - return false; - } - - for (auto chit = vit->second.cache_changes.begin(); chit != vit->second.cache_changes.end(); ++chit) - { - if (((*chit)->sequenceNumber == change->sequenceNumber) && ((*chit)->writerGUID == change->writerGUID)) - { - if (remove_change(change)) - { - vit->second.cache_changes.erase(chit); - m_isHistoryFull = false; - return true; - } - } - } - } - return false; - } - -private: - - typedef std::map t_m_Inst_Caches; - - //!Map where keys are instance handles and values are vectors of cache changes associated - t_m_Inst_Caches keyed_changes_; - //!HistoryQosPolicy values. - HistoryQosPolicy history_qos_; - //!ResourceLimitsQosPolicy values. - ResourceLimitsQosPolicy resource_limited_qos_; - //!Topic Attributes - TopicAttributes topic_att_; - - bool find_or_add_key( - const InstanceHandle_t& instance_handle, - t_m_Inst_Caches::iterator* vit_out) - { - t_m_Inst_Caches::iterator vit; - vit = keyed_changes_.find(instance_handle); - if (vit != keyed_changes_.end()) - { - *vit_out = vit; - } - else - { - *vit_out = keyed_changes_.insert(std::make_pair(instance_handle, KeyedChanges())).first; - } - return true; - } - -}; - -} // fastrtps -} // eprosima - -#endif // PUBLISHERHISTORY_H_ diff --git a/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp b/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp index 3569092bd8b..0d3cc01d841 100644 --- a/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp +++ b/test/mock/rtps/RTPSDomainImpl/rtps/RTPSDomainImpl.hpp @@ -17,14 +17,17 @@ #include +#include #include +#include namespace eprosima { namespace fastrtps { namespace rtps { -class RTPSWriter; class IChangePool; +class RTPSReader; +class RTPSWriter; /** * @brief Class RTPSDomainImpl, contains the private implementation of the RTPSDomain @@ -104,6 +107,37 @@ class RTPSDomainImpl return RTPSDomain::createParticipant(domain_id, enabled, att, listen); } + static bool get_library_settings( + fastdds::LibrarySettings&) + { + return true; + } + + static bool set_library_settings( + const fastdds::LibrarySettings&) + { + return true; + } + + static fastdds::dds::xtypes::ITypeObjectRegistry& type_object_registry() + { + return get_instance()->type_object_registry_; + } + + static fastdds::dds::xtypes::TypeObjectRegistry& type_object_registry_observer() + { + return get_instance()->type_object_registry_; + } + + static RTPSReader* find_local_reader( + const GUID_t& reader_guid) + { + static_cast(reader_guid); + return nullptr; + } + + eprosima::fastdds::dds::xtypes::TypeObjectRegistry type_object_registry_; + }; } // namespace rtps diff --git a/test/mock/rtps/RTPSGapBuilder/rtps/messages/RTPSGapBuilder.hpp b/test/mock/rtps/RTPSGapBuilder/rtps/messages/RTPSGapBuilder.hpp index 1b3c6021408..4b162ac4d13 100644 --- a/test/mock/rtps/RTPSGapBuilder/rtps/messages/RTPSGapBuilder.hpp +++ b/test/mock/rtps/RTPSGapBuilder/rtps/messages/RTPSGapBuilder.hpp @@ -20,7 +20,7 @@ #ifndef RTPSGAPBUILDER_HPP #define RTPSGAPBUILDER_HPP -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h b/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h index 26326c84327..0ea712ba9c5 100644 --- a/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h +++ b/test/mock/rtps/RTPSParticipant/fastdds/rtps/participant/RTPSParticipant.h @@ -19,15 +19,16 @@ #include #include +#include + +#include +#include #include +#include #include #include #include -#include -#include -#include - -#include +#include #include @@ -73,7 +74,7 @@ class WLP; * @brief Class RTPSParticipant, contains the public API for a RTPSParticipant. * @ingroup RTPS_MODULE */ -class RTPS_DllAPI RTPSParticipant +class FASTDDS_EXPORTED_API RTPSParticipant { friend class RTPSParticipantImpl; friend class RTPSDomain; @@ -188,28 +189,28 @@ class RTPS_DllAPI RTPSParticipant MOCK_METHOD3(registerWriter, bool( RTPSWriter * Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos)); + const fastdds::dds::WriterQos& wqos)); MOCK_METHOD3(updateWriter, bool( RTPSWriter * Writer, const TopicAttributes& topicAtt, - const WriterQos& wqos)); + const fastdds::dds::WriterQos& wqos)); MOCK_METHOD3(registerReader, bool( RTPSReader * Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos)); + const fastdds::dds::ReaderQos& rqos)); MOCK_METHOD4(registerReader, bool( RTPSReader * Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter)); MOCK_METHOD3(updateReader, bool( RTPSReader * Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos)); + const fastdds::dds::ReaderQos& rqos)); MOCK_METHOD1(ignore_participant, bool( const GuidPrefix_t& participant_guid)); @@ -217,7 +218,7 @@ class RTPS_DllAPI RTPSParticipant MOCK_METHOD4(updateReader, bool( RTPSReader * Reader, const TopicAttributes& topicAtt, - const ReaderQos& rqos, + const fastdds::dds::ReaderQos& rqos, const fastdds::rtps::ContentFilterProperty* content_filter)); std::vector get_netmask_filter_info() const @@ -251,6 +252,7 @@ class RTPS_DllAPI RTPSParticipant const GUID_t m_guid; mutable ResourceEvent mp_event_thr; RTPSParticipantAttributes attributes_; + RTPSParticipantImpl* mp_impl; }; } /* namespace rtps */ diff --git a/test/mock/rtps/RTPSParticipantAttributes/fastdds/rtps/attributes/RTPSParticipantAttributes.h b/test/mock/rtps/RTPSParticipantAttributes/fastdds/rtps/attributes/RTPSParticipantAttributes.h index 95188a863e0..2ec5e6c784e 100644 --- a/test/mock/rtps/RTPSParticipantAttributes/fastdds/rtps/attributes/RTPSParticipantAttributes.h +++ b/test/mock/rtps/RTPSParticipantAttributes/fastdds/rtps/attributes/RTPSParticipantAttributes.h @@ -22,6 +22,8 @@ #include #include +#include + #include #include #include @@ -37,9 +39,8 @@ #include #include #include -#include -#include -#include +#include +#include namespace eprosima { namespace fastdds { @@ -302,28 +303,6 @@ class DiscoverySettings (this->ignoreParticipantFlags == b.ignoreParticipantFlags); } - /** - * Get the static endpoint XML filename - * @return Static endpoint XML filename - */ - FASTRTPS_DEPRECATED("Use static_edp_xml_config()") - const char* getStaticEndpointXMLFilename() const - { - return static_edp_xml_config(); - } - - /** - * Set the static endpoint XML filename - * @param str Static endpoint XML filename - * @deprecated - */ - FASTRTPS_DEPRECATED("Use static_edp_xml_config()") - void setStaticEndpointXMLFilename( - const char* str) - { - static_edp_xml_config_ = "file://" + std::string(str); - } - /** * Set the static endpoint XML configuration. * @param str URI specifying the static endpoint XML configuration. @@ -485,6 +464,7 @@ class RTPSParticipantAttributes (this->security_log_thread == b.security_log_thread) && #endif // if HAVE_SECURITY (this->discovery_server_thread == b.discovery_server_thread) && + (this->typelookup_service_thread == b.typelookup_service_thread) && (this->builtin_transports_reception_threads == b.builtin_transports_reception_threads); } @@ -526,10 +506,10 @@ class RTPSParticipantAttributes att.userTransports.push_back(descriptor); } - static std::shared_ptr create_udpv4_transport( + static std::shared_ptr create_udpv4_transport( const RTPSParticipantAttributes& att) { - auto descriptor = std::make_shared(); + auto descriptor = std::make_shared(); descriptor->sendBufferSize = att.sendSocketBufferSize; descriptor->receiveBufferSize = att.listenSocketBufferSize; descriptor->default_reception_threads(att.builtin_transports_reception_threads); @@ -576,7 +556,7 @@ class RTPSParticipantAttributes //! Optionally allows user to define the GuidPrefix_t GuidPrefix_t prefix; - RTPS_DllAPI inline bool ReadguidPrefix( + FASTDDS_EXPORTED_API inline bool ReadguidPrefix( const char* pfx) { return bool(std::istringstream(pfx) >> prefix); @@ -638,6 +618,9 @@ class RTPSParticipantAttributes //! Thread settings for the discovery server thread fastdds::rtps::ThreadSettings discovery_server_thread; + //! Thread settings for the builtin TypeLookup service requests and replies threads + fastdds::rtps::ThreadSettings typelookup_service_thread; + //! Thread settings for the builtin transports reception threads fastdds::rtps::ThreadSettings builtin_transports_reception_threads; @@ -655,8 +638,7 @@ class RTPSParticipantAttributes private: //! Name of the participant. - string_255 name{"RTPSParticipant"}; - + fastcdr::string_255 name{"RTPSParticipant"}; }; } // namespace rtps diff --git a/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h b/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h index 0e541a7e2a6..f9ec06ee23a 100644 --- a/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h +++ b/test/mock/rtps/RTPSParticipantImpl/rtps/participant/RTPSParticipantImpl.h @@ -19,24 +19,26 @@ #ifndef _RTPS_PARTICIPANT_RTPSPARTICIPANTIMPL_H_ #define _RTPS_PARTICIPANT_RTPSPARTICIPANTIMPL_H_ +#include +#include +#include + +#include + // Include first possible mocks (depending on include on CMakeLists.txt) -#include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include #if HAVE_SECURITY #include #endif // if HAVE_SECURITY -#include - -#include -#include -#include namespace eprosima { namespace fastrtps { @@ -106,6 +108,27 @@ class RTPSParticipantImpl events_.init_thread(); } + RTPSParticipantImpl( + uint32_t, + const RTPSParticipantAttributes&, + const GuidPrefix_t&, + RTPSParticipant*, + RTPSParticipantListener*) + { + events_.init_thread(); + } + + RTPSParticipantImpl( + uint32_t, + const RTPSParticipantAttributes&, + const GuidPrefix_t&, + const GuidPrefix_t&, + RTPSParticipant*, + RTPSParticipantListener*) + { + events_.init_thread(); + } + MOCK_CONST_METHOD0(get_domain_id, uint32_t()); MOCK_CONST_METHOD0(getGuid, const GUID_t& ()); @@ -334,6 +357,72 @@ class RTPSParticipantImpl MOCK_METHOD(bool, update_removed_participant, (rtps::LocatorList_t&)); + uint32_t getRTPSParticipantID() const + { + return 0; + } + + bool is_initialized() const + { + return true; + } + + bool did_mutation_took_place_on_meta( + const LocatorList_t&, + const LocatorList_t&) const + { + return false; + } + + bool networkFactoryHasRegisteredTransports() const + { + return true; + } + + void environment_file_has_changed() + { + } + + void enable() + { + } + + void disable() + { + } + + bool create_writer( + RTPSWriter**, + WriterAttributes&, + const std::shared_ptr&, + const std::shared_ptr&, + WriterHistory*, + WriterListener*, + const EntityId_t& entityId = c_EntityId_Unknown, + bool isBuiltin = false) + { + static_cast(entityId); + static_cast(isBuiltin); + return true; + } + + void client_override( + bool) + { + } + + RTPSReader* find_local_reader( + const GUID_t&) + { + return nullptr; + } + + RTPSWriter* find_local_writer( + const GUID_t&) + { + return nullptr; + } + private: MockParticipantListener listener_; diff --git a/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h b/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h index 77743ee37d8..9b29ff7b2c7 100644 --- a/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h +++ b/test/mock/rtps/RTPSReader/fastdds/rtps/reader/RTPSReader.h @@ -19,17 +19,16 @@ #ifndef _FASTDDS_RTPS_READER_RTPSREADER_H_ #define _FASTDDS_RTPS_READER_RTPSREADER_H_ -#include - -#include -#include -#include -#include -#include -#include - #include +#include +#include +#include +#include +#include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/mock/rtps/RTPSWriter/fastdds/rtps/writer/RTPSWriter.h b/test/mock/rtps/RTPSWriter/fastdds/rtps/writer/RTPSWriter.h index 9a36a81083c..42ac0cf307b 100644 --- a/test/mock/rtps/RTPSWriter/fastdds/rtps/writer/RTPSWriter.h +++ b/test/mock/rtps/RTPSWriter/fastdds/rtps/writer/RTPSWriter.h @@ -23,15 +23,16 @@ #include +#include +#include +#include #include +#include #include #include #include #include -#include -#include -#include -#include +#include namespace eprosima { namespace fastrtps { @@ -140,7 +141,7 @@ class RTPSWriter : public Endpoint MOCK_METHOD0(getMaxDataSize, uint32_t ()); - MOCK_CONST_METHOD0(get_liveliness_kind, const LivelinessQosPolicyKind& ()); + MOCK_CONST_METHOD0(get_liveliness_kind, const fastdds::dds::LivelinessQosPolicyKind& ()); MOCK_CONST_METHOD0(get_liveliness_lease_duration, const Duration_t& ()); diff --git a/test/mock/rtps/ReaderHistory/fastdds/rtps/history/ReaderHistory.h b/test/mock/rtps/ReaderHistory/fastdds/rtps/history/ReaderHistory.h index 1fd5f344dd0..005c7447f61 100644 --- a/test/mock/rtps/ReaderHistory/fastdds/rtps/history/ReaderHistory.h +++ b/test/mock/rtps/ReaderHistory/fastdds/rtps/history/ReaderHistory.h @@ -19,15 +19,15 @@ #ifndef _FASTDDS_RTPS_READERHISTORY_H_ #define _FASTDDS_RTPS_READERHISTORY_H_ -#include -#include -#include -#include - #include #include +#include +#include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/mock/rtps/ReaderLocator/fastdds/rtps/writer/ReaderLocator.h b/test/mock/rtps/ReaderLocator/fastdds/rtps/writer/ReaderLocator.h index dc3be493e06..1c8c99eb265 100644 --- a/test/mock/rtps/ReaderLocator/fastdds/rtps/writer/ReaderLocator.h +++ b/test/mock/rtps/ReaderLocator/fastdds/rtps/writer/ReaderLocator.h @@ -23,13 +23,13 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/ReaderProxyData/fastdds/rtps/builtin/data/ReaderProxyData.h b/test/mock/rtps/ReaderProxyData/fastdds/rtps/builtin/data/ReaderProxyData.h index 323cfa22540..4500d344520 100644 --- a/test/mock/rtps/ReaderProxyData/fastdds/rtps/builtin/data/ReaderProxyData.h +++ b/test/mock/rtps/ReaderProxyData/fastdds/rtps/builtin/data/ReaderProxyData.h @@ -21,13 +21,16 @@ #include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include #if HAVE_SECURITY -#include +#include #endif // if HAVE_SECURITY namespace eprosima { @@ -47,8 +50,6 @@ class ReaderProxyData , m_expectsInlineQos(false) , topic_kind_(NO_KEY) , is_alive_(true) - , type_id_() - , type_() , type_info_() , m_userDefinedId(0) , content_filter_({}) @@ -64,8 +65,6 @@ class ReaderProxyData , m_expectsInlineQos(false) , topic_kind_(NO_KEY) , is_alive_(true) - , type_id_() - , type_() , type_info_() , m_userDefinedId(0) , content_filter_(filter_allocation) @@ -156,33 +155,33 @@ class ReaderProxyData } void typeName( - const string_255& typeName) + const fastcdr::string_255& typeName) { type_name_ = typeName; } - const string_255& typeName() const + const fastcdr::string_255& typeName() const { return type_name_; } - string_255& typeName() + fastcdr::string_255& typeName() { return type_name_; } void topicName( - const string_255& topicName) + const fastcdr::string_255& topicName) { topic_name_ = topicName; } - const string_255& topicName() const + const fastcdr::string_255& topicName() const { return topic_name_; } - string_255& topicName() + fastcdr::string_255& topicName() { return topic_name_; } @@ -214,65 +213,23 @@ class ReaderProxyData return is_alive_; } - bool has_type_id () const - { - return false; - } - - void type_id( - const TypeIdV1& other_type_id) - { - type_id_ = other_type_id; - } - - const TypeIdV1& type_id() const - { - return type_id_; - } - - TypeIdV1& type_id() - { - return type_id_; - } - - bool has_type () const - { - return false; - } - - void type( - const TypeObjectV1& other_type) - { - type_ = other_type; - } - - const TypeObjectV1& type() const - { - return type_; - } - - TypeObjectV1& type() - { - return type_; - } - bool has_type_information () const { return false; } void type_information( - const xtypes::TypeInformation& other_type_info) + const fastdds::dds::xtypes::TypeInformationParameter& other_type_info) { type_info_ = other_type_info; } - const xtypes::TypeInformation& type_information() const + const fastdds::dds::xtypes::TypeInformationParameter& type_information() const { return type_info_; } - xtypes::TypeInformation& type_information() + fastdds::dds::xtypes::TypeInformationParameter& type_information() { return type_info_; } @@ -343,24 +300,24 @@ class ReaderProxyData return m_userDefinedId; } - RTPS_DllAPI void content_filter( + FASTDDS_EXPORTED_API void content_filter( const fastdds::rtps::ContentFilterProperty& filter) { content_filter_ = filter; } - RTPS_DllAPI void content_filter( + FASTDDS_EXPORTED_API void content_filter( fastdds::rtps::ContentFilterProperty&& filter) { content_filter_ = std::move(filter); } - RTPS_DllAPI const fastdds::rtps::ContentFilterProperty& content_filter() const + FASTDDS_EXPORTED_API const fastdds::rtps::ContentFilterProperty& content_filter() const { return content_filter_; } - RTPS_DllAPI fastdds::rtps::ContentFilterProperty& content_filter() + FASTDDS_EXPORTED_API fastdds::rtps::ContentFilterProperty& content_filter() { return content_filter_; } @@ -378,18 +335,16 @@ class ReaderProxyData RemoteLocatorList remote_locators_; bool m_expectsInlineQos; - ReaderQos m_qos; + fastdds::dds::ReaderQos m_qos; private: GUID_t m_guid; - string_255 topic_name_; - string_255 type_name_; + fastcdr::string_255 topic_name_; + fastcdr::string_255 type_name_; TopicKind_t topic_kind_; bool is_alive_; - TypeIdV1 type_id_; - TypeObjectV1 type_; - xtypes::TypeInformation type_info_; + fastdds::dds::xtypes::TypeInformationParameter type_info_; InstanceHandle_t m_key; InstanceHandle_t m_RTPSParticipantKey; uint16_t m_userDefinedId; diff --git a/test/mock/rtps/ReceiverResource/rtps/network/ReceiverResource.h b/test/mock/rtps/ReceiverResource/rtps/network/ReceiverResource.h index 1f0ce00b56b..7a38c48af2c 100644 --- a/test/mock/rtps/ReceiverResource/rtps/network/ReceiverResource.h +++ b/test/mock/rtps/ReceiverResource/rtps/network/ReceiverResource.h @@ -16,10 +16,11 @@ #define _FASTDDS_RTPS_RECEIVER_RESOURCE_H #include -#include #include -#include -#include +#include + +#include +#include namespace eprosima { namespace fastrtps { @@ -34,7 +35,7 @@ class RTPSParticipantImpl; * Mock ReceiverResource * @ingroup NETWORK_MODULE */ -class ReceiverResource : public TransportReceiverInterface +class ReceiverResource : public fastdds::rtps::TransportReceiverInterface { friend class NetworkFactory; @@ -99,7 +100,7 @@ class ReceiverResource : public TransportReceiverInterface protected: ReceiverResource( - TransportInterface& transport, + fastdds::rtps::TransportInterface& transport, const Locator_t& locator, uint32_t max_recv_buffer_size) : mValid(false) diff --git a/test/mock/rtps/SecurityManager/rtps/security/SecurityManager.h b/test/mock/rtps/SecurityManager/rtps/security/SecurityManager.h index 738c72a8f9e..ef996c4b1ad 100644 --- a/test/mock/rtps/SecurityManager/rtps/security/SecurityManager.h +++ b/test/mock/rtps/SecurityManager/rtps/security/SecurityManager.h @@ -18,11 +18,11 @@ #ifndef _RTPS_SECURITY_SECURITYMANAGER_H_ #define _RTPS_SECURITY_SECURITYMANAGER_H_ -#include -#include - #include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockAuthenticationPlugin.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockAuthenticationPlugin.h index 74462284bce..f5d899962da 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockAuthenticationPlugin.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockAuthenticationPlugin.h @@ -21,11 +21,12 @@ // TODO(Ricardo) Change when GMock supports r-values. -#include -#include - #include +#include + +#include + #pragma warning(push) #pragma warning(disable : 4373) diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyExchange.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyExchange.h index 349b40e26d5..e1458713106 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyExchange.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyExchange.h @@ -13,15 +13,16 @@ // limitations under the License. /*! - * @file MockCryptoKeyExchange.h + * @file MockCryptoKeyExchange.h */ #ifndef _RTPS_SECURITY_MOCKCRYPTOKEYEXCHANGE_H_ #define _RTPS_SECURITY_MOCKCRYPTOKEYEXCHANGE_H_ -#include -#include #include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { @@ -29,49 +30,51 @@ namespace security { class MockCryptoKeyExchange : public CryptoKeyExchange { - public: +public: - virtual ~MockCryptoKeyExchange(){} + virtual ~MockCryptoKeyExchange() + { + } - MOCK_METHOD4(create_local_participant_crypto_tokens, bool ( + MOCK_METHOD4(create_local_participant_crypto_tokens, bool ( ParticipantCryptoTokenSeq&, const ParticipantCryptoHandle&, ParticipantCryptoHandle&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD4(set_remote_participant_crypto_tokens, bool ( + MOCK_METHOD4(set_remote_participant_crypto_tokens, bool ( const ParticipantCryptoHandle&, ParticipantCryptoHandle&, const ParticipantCryptoTokenSeq&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD4(create_local_datawriter_crypto_tokens, bool ( + MOCK_METHOD4(create_local_datawriter_crypto_tokens, bool ( DatawriterCryptoTokenSeq&, DatawriterCryptoHandle&, DatareaderCryptoHandle&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD4(create_local_datareader_crypto_tokens, bool ( + MOCK_METHOD4(create_local_datareader_crypto_tokens, bool ( DatareaderCryptoTokenSeq&, DatareaderCryptoHandle&, DatawriterCryptoHandle&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD4(set_remote_datareader_crypto_tokens, bool ( + MOCK_METHOD4(set_remote_datareader_crypto_tokens, bool ( DatawriterCryptoHandle&, DatareaderCryptoHandle&, const DatareaderCryptoTokenSeq&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD4(set_remote_datawriter_crypto_tokens, bool ( + MOCK_METHOD4(set_remote_datawriter_crypto_tokens, bool ( DatareaderCryptoHandle&, DatawriterCryptoHandle&, const DatawriterCryptoTokenSeq&, - SecurityException&)); + SecurityException &)); - MOCK_METHOD2(return_crypto_tokens, bool ( + MOCK_METHOD2(return_crypto_tokens, bool ( const CryptoTokenSeq&, - SecurityException&)); + SecurityException &)); }; diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyFactory.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyFactory.h index 1de40f6ddfc..29b962c4117 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyFactory.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoKeyFactory.h @@ -18,12 +18,12 @@ #ifndef _RTPS_SECURITY_MOCKCRYPTOKEYFACTORY_H_ #define _RTPS_SECURITY_MOCKCRYPTOKEYFACTORY_H_ -#include -#include +#include -#include +#include +#include -#include +#include #pragma warning(push) #pragma warning(disable : 4373) diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoTransform.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoTransform.h index 5cc6b2d009c..0aa545c1983 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoTransform.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoTransform.h @@ -18,10 +18,11 @@ #ifndef _RTPS_SECURITY_MOCKCRYPTOTRANSFORM_H_ #define _RTPS_SECURITY_MOCKCRYPTOTRANSFORM_H_ -#include -#include #include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptographyPlugin.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptographyPlugin.h index 249490f98b1..f6bec989da7 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptographyPlugin.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptographyPlugin.h @@ -19,10 +19,10 @@ #ifndef _RTPS_SECURITY_MOCKCRYPTOGRAPHYPLUGIN_H_ #define _RTPS_SECURITY_MOCKCRYPTOGRAPHYPLUGIN_H_ -#include +#include -#include #include +#include #include namespace eprosima { diff --git a/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.h b/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.h index 74fe9e1b46d..52a0e4c298f 100644 --- a/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.h +++ b/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.h @@ -18,11 +18,11 @@ #ifndef _RTPS_SECURITY_SECURITYPLUGINFACTORY_H_ #define _RTPS_SECURITY_SECURITYPLUGINFACTORY_H_ -#include -#include -#include +#include +#include +#include +#include #include -#include #include diff --git a/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h new file mode 100644 index 00000000000..0fdcf8598f7 --- /dev/null +++ b/test/mock/rtps/ServerAttributes/fastdds/rtps/attributes/ServerAttributes.h @@ -0,0 +1,91 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file ServerAttributes.h + * + */ + +#ifndef _FASTDDS_SERVERATTRIBUTES_H_ +#define _FASTDDS_SERVERATTRIBUTES_H_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +class RemoteServerAttributes +{ +public: + + bool operator ==( + const RemoteServerAttributes&) const + { + return true; + } + + template bool requires_transport() const + { + return true; + } + + bool ReadguidPrefix( + const char*) + { + return true; + } + + LocatorList metatrafficMulticastLocatorList; + LocatorList metatrafficUnicastLocatorList; + +}; + +typedef std::list RemoteServerList_t; + +static inline bool load_environment_server_info( + RemoteServerList_t&) +{ + return true; +} + +static inline bool ros_super_client_env() +{ + return false; +} + +template +std::basic_ostream& operator <<( + std::basic_ostream& output, + const RemoteServerList_t& /*list*/) +{ + return output; +} + +} // namespace rtps +} // namespace fastdds + +namespace fastrtps { +namespace rtps { + +using fastdds::rtps::RemoteServerList_t; +using fastdds::rtps::ros_super_client_env; + +} // namespace rtps +} // namespace fastrtps +} // namespace eprosima + +#endif /* _FASTDDS_SERVERATTRIBUTES_H_ */ diff --git a/test/mock/rtps/SharedMemTransportDescriptor/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h b/test/mock/rtps/SharedMemTransportDescriptor/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h index 21795787fff..828471ea89f 100644 --- a/test/mock/rtps/SharedMemTransportDescriptor/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h +++ b/test/mock/rtps/SharedMemTransportDescriptor/fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h @@ -39,7 +39,7 @@ typedef struct SharedMemTransportDescriptor : public PortBasedTransportDescripto } - RTPS_DllAPI SharedMemTransportDescriptor() + FASTDDS_EXPORTED_API SharedMemTransportDescriptor() : PortBasedTransportDescriptor(0, 0) { @@ -55,12 +55,12 @@ typedef struct SharedMemTransportDescriptor : public PortBasedTransportDescripto return 0; } - RTPS_DllAPI uint32_t segment_size() const + FASTDDS_EXPORTED_API uint32_t segment_size() const { return segment_size_; } - RTPS_DllAPI void segment_size( + FASTDDS_EXPORTED_API void segment_size( uint32_t segment_size) { segment_size_ = segment_size; @@ -71,53 +71,53 @@ typedef struct SharedMemTransportDescriptor : public PortBasedTransportDescripto return maxMessageSize; } - RTPS_DllAPI void max_message_size( + FASTDDS_EXPORTED_API void max_message_size( uint32_t max_message_size) { maxMessageSize = max_message_size; } - RTPS_DllAPI uint32_t port_queue_capacity() const + FASTDDS_EXPORTED_API uint32_t port_queue_capacity() const { return port_queue_capacity_; } - RTPS_DllAPI void port_queue_capacity( + FASTDDS_EXPORTED_API void port_queue_capacity( uint32_t port_queue_capacity) { port_queue_capacity_ = port_queue_capacity; } - RTPS_DllAPI uint32_t healthy_check_timeout_ms() const + FASTDDS_EXPORTED_API uint32_t healthy_check_timeout_ms() const { return healthy_check_timeout_ms_; } - RTPS_DllAPI void healthy_check_timeout_ms( + FASTDDS_EXPORTED_API void healthy_check_timeout_ms( uint32_t healthy_check_timeout_ms) { healthy_check_timeout_ms_ = healthy_check_timeout_ms; } - RTPS_DllAPI std::string rtps_dump_file() const + FASTDDS_EXPORTED_API std::string rtps_dump_file() const { return rtps_dump_file_; } - RTPS_DllAPI void rtps_dump_file( + FASTDDS_EXPORTED_API void rtps_dump_file( const std::string& rtps_dump_file) { rtps_dump_file_ = rtps_dump_file; } //! Return the thread settings for the transport dump thread - RTPS_DllAPI ThreadSettings dump_thread() const + FASTDDS_EXPORTED_API ThreadSettings dump_thread() const { return dump_thread_; } //! Set the thread settings for the transport dump thread - RTPS_DllAPI void dump_thread( + FASTDDS_EXPORTED_API void dump_thread( const ThreadSettings& dump_thread) { dump_thread_ = dump_thread; diff --git a/test/mock/rtps/StatefulReader/fastdds/rtps/reader/StatefulReader.h b/test/mock/rtps/StatefulReader/fastdds/rtps/reader/StatefulReader.h index 5d75efbde10..20e92cdb030 100644 --- a/test/mock/rtps/StatefulReader/fastdds/rtps/reader/StatefulReader.h +++ b/test/mock/rtps/StatefulReader/fastdds/rtps/reader/StatefulReader.h @@ -15,10 +15,10 @@ #ifndef _FASTDDS_RTPS_READER_STATEFULREADER_H_ #define _FASTDDS_RTPS_READER_STATEFULREADER_H_ +#include +#include +#include #include -#include -#include -#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/StatefulWriter/fastdds/rtps/writer/StatefulWriter.h b/test/mock/rtps/StatefulWriter/fastdds/rtps/writer/StatefulWriter.h index efad06707f9..d4b82eb490f 100644 --- a/test/mock/rtps/StatefulWriter/fastdds/rtps/writer/StatefulWriter.h +++ b/test/mock/rtps/StatefulWriter/fastdds/rtps/writer/StatefulWriter.h @@ -19,9 +19,9 @@ #ifndef _FASTDDS_RTPS_STATEFULWRITER_H_ #define _FASTDDS_RTPS_STATEFULWRITER_H_ -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/StatelessReader/fastdds/rtps/reader/StatelessReader.h b/test/mock/rtps/StatelessReader/fastdds/rtps/reader/StatelessReader.h index 1a851b8d9f0..81af7a71809 100644 --- a/test/mock/rtps/StatelessReader/fastdds/rtps/reader/StatelessReader.h +++ b/test/mock/rtps/StatelessReader/fastdds/rtps/reader/StatelessReader.h @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_READER_STATELESSREADER_H_ #define _FASTDDS_RTPS_READER_STATELESSREADER_H_ -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/StatelessWriter/fastdds/rtps/writer/StatelessWriter.h b/test/mock/rtps/StatelessWriter/fastdds/rtps/writer/StatelessWriter.h index a9701fd272d..d81fb836dd7 100644 --- a/test/mock/rtps/StatelessWriter/fastdds/rtps/writer/StatelessWriter.h +++ b/test/mock/rtps/StatelessWriter/fastdds/rtps/writer/StatelessWriter.h @@ -19,7 +19,7 @@ #ifndef _FASTDDS_RTPS_STATELESSWRITER_H_ #define _FASTDDS_RTPS_STATELESSWRITER_H_ -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/TCPTransportDescriptor/fastrtps/transport/TCPTransportDescriptor.h b/test/mock/rtps/TCPTransportDescriptor/fastdds/rtps/transport/TCPTransportDescriptor.h similarity index 94% rename from test/mock/rtps/TCPTransportDescriptor/fastrtps/transport/TCPTransportDescriptor.h rename to test/mock/rtps/TCPTransportDescriptor/fastdds/rtps/transport/TCPTransportDescriptor.h index a4a4ec26e0f..eec718b334c 100644 --- a/test/mock/rtps/TCPTransportDescriptor/fastrtps/transport/TCPTransportDescriptor.h +++ b/test/mock/rtps/TCPTransportDescriptor/fastdds/rtps/transport/TCPTransportDescriptor.h @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef TCP_TRANSPORT_DESCRIPTOR_H -#define TCP_TRANSPORT_DESCRIPTOR_H +#ifndef _FASTDDS_TCP_TRANSPORT_DESCRIPTOR_H_ +#define _FASTDDS_TCP_TRANSPORT_DESCRIPTOR_H_ -#include +#include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { /** * Transport configuration * @ingroup TRANSPORT_MODULE */ -typedef struct TCPTransportDescriptor : public SocketTransportDescriptor +struct TCPTransportDescriptor : public SocketTransportDescriptor { struct TLSConfig { @@ -187,13 +187,13 @@ typedef struct TCPTransportDescriptor : public SocketTransportDescriptor listening_ports.push_back(port); } - RTPS_DllAPI TCPTransportDescriptor() + FASTDDS_EXPORTED_API TCPTransportDescriptor() : SocketTransportDescriptor(65550, 4) { } - RTPS_DllAPI TCPTransportDescriptor( + FASTDDS_EXPORTED_API TCPTransportDescriptor( const TCPTransportDescriptor& /*t*/) : SocketTransportDescriptor(65550, 4) { @@ -204,10 +204,10 @@ typedef struct TCPTransportDescriptor : public SocketTransportDescriptor { } -} TCPTransportDescriptor; +}; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima -#endif // TCP_TRANSPORT_DESCRIPTOR_H +#endif // _FASTDDS_TCP_TRANSPORT_DESCRIPTOR_H_ diff --git a/test/mock/rtps/TCPv4TransportDescriptor/fastdds/rtps/transport/TCPv4TransportDescriptor.h b/test/mock/rtps/TCPv4TransportDescriptor/fastdds/rtps/transport/TCPv4TransportDescriptor.h new file mode 100644 index 00000000000..ae96df7f789 --- /dev/null +++ b/test/mock/rtps/TCPv4TransportDescriptor/fastdds/rtps/transport/TCPv4TransportDescriptor.h @@ -0,0 +1,86 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_TCPV4_TRANSPORT_DESCRIPTOR_ +#define _FASTDDS_TCPV4_TRANSPORT_DESCRIPTOR_ + +#include +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +class TCPTransportInterface; +/** + * Transport configuration + * @ingroup TRANSPORT_MODULE + */ +typedef struct TCPv4TransportDescriptor : public TCPTransportDescriptor +{ + virtual ~TCPv4TransportDescriptor() + { + } + + virtual TransportInterface* create_transport() const override + { + return nullptr; + } + + eprosima::fastrtps::rtps::octet wan_addr[4]; + + void set_WAN_address( + eprosima::fastrtps::rtps::octet o1, + eprosima::fastrtps::rtps::octet o2, + eprosima::fastrtps::rtps::octet o3, + eprosima::fastrtps::rtps::octet o4) + { + wan_addr[0] = o1; + wan_addr[1] = o2; + wan_addr[2] = o3; + wan_addr[3] = o4; + } + + void set_WAN_address( + const std::string& in_address) + { + std::stringstream ss(in_address); + int a, b, c, d; //to store the 4 ints + char ch; //to temporarily store the '.' + ss >> a >> ch >> b >> ch >> c >> ch >> d; + wan_addr[0] = (eprosima::fastrtps::rtps::octet)a; + wan_addr[1] = (eprosima::fastrtps::rtps::octet)b; + wan_addr[2] = (eprosima::fastrtps::rtps::octet)c; + wan_addr[3] = (eprosima::fastrtps::rtps::octet)d; + } + + FASTDDS_EXPORTED_API TCPv4TransportDescriptor() + { + + } + + FASTDDS_EXPORTED_API TCPv4TransportDescriptor( + const TCPv4TransportDescriptor& /*t*/) + : TCPv4TransportDescriptor() + { + + } + +} TCPv4TransportDescriptor; + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_TCPV4_TRANSPORT_DESCRIPTOR_ diff --git a/test/mock/rtps/TCPv4TransportDescriptor/fastrtps/transport/TCPv4TransportDescriptor.h b/test/mock/rtps/TCPv4TransportDescriptor/fastrtps/transport/TCPv4TransportDescriptor.h deleted file mode 100644 index 9df80685edf..00000000000 --- a/test/mock/rtps/TCPv4TransportDescriptor/fastrtps/transport/TCPv4TransportDescriptor.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TCPV4_TRANSPORT_DESCRIPTOR -#define TCPV4_TRANSPORT_DESCRIPTOR - -#include - -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ - -class TCPTransportInterface; -/** - * Transport configuration - * @ingroup TRANSPORT_MODULE - */ -typedef struct TCPv4TransportDescriptor: public TCPTransportDescriptor { - virtual ~TCPv4TransportDescriptor(){} - - virtual TransportInterface* create_transport() const override { return nullptr; } - - octet wan_addr[4]; - - void set_WAN_address(octet o1,octet o2,octet o3,octet o4){ - wan_addr[0] = o1; - wan_addr[1] = o2; - wan_addr[2] = o3; - wan_addr[3] = o4; - } - - void set_WAN_address(const std::string& in_address) - { - std::stringstream ss(in_address); - int a,b,c,d; //to store the 4 ints - char ch; //to temporarily store the '.' - ss >> a >> ch >> b >> ch >> c >> ch >> d; - wan_addr[0] = (octet)a; - wan_addr[1] = (octet)b; - wan_addr[2] = (octet)c; - wan_addr[3] = (octet)d; - } - - RTPS_DllAPI TCPv4TransportDescriptor() - { - - } - - RTPS_DllAPI TCPv4TransportDescriptor(const TCPv4TransportDescriptor& /*t*/) : TCPv4TransportDescriptor() - { - - } - -} TCPv4TransportDescriptor; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif diff --git a/test/mock/rtps/TCPv6TransportDescriptor/fastdds/rtps/transport/TCPv6TransportDescriptor.h b/test/mock/rtps/TCPv6TransportDescriptor/fastdds/rtps/transport/TCPv6TransportDescriptor.h new file mode 100644 index 00000000000..dc9d8820bf0 --- /dev/null +++ b/test/mock/rtps/TCPv6TransportDescriptor/fastdds/rtps/transport/TCPv6TransportDescriptor.h @@ -0,0 +1,65 @@ +// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_TCPV6_TRANSPORT_DESCRIPTOR_ +#define _FASTDDS_TCPV6_TRANSPORT_DESCRIPTOR_ + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +class TCPTransportInterface; + +/** + * Transport configuration + * + * - bufferSize: length of the buffers used for transmission. Passing + * a buffer of different size will cause transmission to + * fail. + * + * - interfaceWhiteList: Lists the allowed interfaces. + * @ingroup TRANSPORT_MODULE + */ +struct TCPv6TransportDescriptor : public TCPTransportDescriptor +{ + virtual ~TCPv6TransportDescriptor() + { + } + + virtual TransportInterface* create_transport() const override + { + return nullptr; + } + + FASTDDS_EXPORTED_API TCPv6TransportDescriptor() + { + + } + + FASTDDS_EXPORTED_API TCPv6TransportDescriptor( + const TCPv6TransportDescriptor& /*t*/) + : TCPv6TransportDescriptor() + { + + } + +}; + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_TCPV6_TRANSPORT_DESCRIPTOR_ diff --git a/test/mock/rtps/TCPv6TransportDescriptor/fastrtps/transport/TCPv6TransportDescriptor.h b/test/mock/rtps/TCPv6TransportDescriptor/fastrtps/transport/TCPv6TransportDescriptor.h deleted file mode 100644 index cddd881750d..00000000000 --- a/test/mock/rtps/TCPv6TransportDescriptor/fastrtps/transport/TCPv6TransportDescriptor.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef TCPV6_TRANSPORT_DESCRIPTOR -#define TCPV6_TRANSPORT_DESCRIPTOR - -#include - -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ - -class TCPTransportInterface; - -/** - * Transport configuration - * - * - bufferSize: length of the buffers used for transmission. Passing - * a buffer of different size will cause transmission to - * fail. - * - * - interfaceWhiteList: Lists the allowed interfaces. - * @ingroup TRANSPORT_MODULE - */ -typedef struct TCPv6TransportDescriptor: public TCPTransportDescriptor -{ - virtual ~TCPv6TransportDescriptor(){} - - virtual TransportInterface* create_transport() const override { return nullptr; } - - RTPS_DllAPI TCPv6TransportDescriptor() - { - - } - - RTPS_DllAPI TCPv6TransportDescriptor(const TCPv6TransportDescriptor& /*t*/) : TCPv6TransportDescriptor() - { - - } - -} TCPv6TransportDescriptor; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif diff --git a/test/mock/rtps/TimedEvent/fastdds/rtps/resources/TimedEvent.h b/test/mock/rtps/TimedEvent/fastdds/rtps/resources/TimedEvent.h index 29e01813ecb..f13d449b03d 100644 --- a/test/mock/rtps/TimedEvent/fastdds/rtps/resources/TimedEvent.h +++ b/test/mock/rtps/TimedEvent/fastdds/rtps/resources/TimedEvent.h @@ -15,11 +15,11 @@ #ifndef _FASTDDS_RTPS_RESOURCES_TIMEDEVENT_H_ #define _FASTDDS_RTPS_RESOURCES_TIMEDEVENT_H_ -#include +#include -#include +#include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/mock/rtps/TypeLookupManager/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp b/test/mock/rtps/TypeLookupManager/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp new file mode 100644 index 00000000000..a6c6da79944 --- /dev/null +++ b/test/mock/rtps/TypeLookupManager/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp @@ -0,0 +1,87 @@ +// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +#ifndef _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP +#define _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP + +#include + +#include + +#include + +#include + +namespace eprosima { + +namespace fastrtps { +namespace rtps { + +class BuiltinProtocols; +class ReaderHistory; +class RTPSParticipantImpl; +class StatefulReader; +class StatefulWriter; +class ParticipantProxyData; +class WriterHistory; + +} // namespace rtps +} // namespace fastrtps + +namespace fastdds { +namespace dds { +namespace builtin { + +extern const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; + +/** + * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.2 specification. + * @ingroup XTYPES + */ +class TypeLookupManager +{ + +public: + + /** + * Constructor + */ + TypeLookupManager() + { + } + + virtual ~TypeLookupManager() + { + } + + MOCK_CONST_METHOD1(get_type_dependencies, fastrtps::rtps::SampleIdentity( + const fastdds::dds::xtypes::TypeIdentifierSeq&)); + + MOCK_CONST_METHOD1(get_types, fastrtps::rtps::SampleIdentity( + const fastdds::dds::xtypes::TypeIdentifierSeq&)); + + void remove_remote_endpoints( + fastrtps::rtps::ParticipantProxyData* pdata) + { + static_cast(pdata); + } + +}; + +} /* namespace builtin */ +} /* namespace dds */ +} /* namespace fastdds */ +} /* namespace eprosima */ +#endif /* _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP */ diff --git a/test/mock/rtps/TypeLookupManager/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp b/test/mock/rtps/TypeLookupManager/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp deleted file mode 100644 index e4e2caf9060..00000000000 --- a/test/mock/rtps/TypeLookupManager/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#ifndef _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP -#define _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP - -#include -#include - -#include - -namespace eprosima { - -namespace fastrtps { -namespace rtps { - -class BuiltinProtocols; -class ReaderHistory; -class RTPSParticipantImpl; -class StatefulReader; -class StatefulWriter; -class ParticipantProxyData; -class WriterHistory; - -} // namespace rtps -} // namespace fastrtps - -namespace fastdds { -namespace dds { -namespace builtin { - -extern const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -/** - * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.2 specification. - * @ingroup XTYPES - */ -class TypeLookupManager -{ - -public: - - /** - * Constructor - * @param prot Pointer to the BuiltinProtocols object. - */ - TypeLookupManager( - fastrtps::rtps::BuiltinProtocols*) - { - } - - virtual ~TypeLookupManager() - { - } - - MOCK_CONST_METHOD1(get_type_dependencies, fastrtps::rtps::SampleIdentity( - const fastrtps::types::TypeIdentifierSeq&)); - - MOCK_CONST_METHOD1(get_types, fastrtps::rtps::SampleIdentity( - const fastrtps::types::TypeIdentifierSeq&)); - - MOCK_METHOD1(remove_remote_endpoints, void( - fastrtps::rtps::ParticipantProxyData* pdata)); - -}; - -} /* namespace builtin */ -} /* namespace dds */ -} /* namespace fastdds */ -} /* namespace eprosima */ -#endif /* _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP */ diff --git a/test/mock/rtps/UDPTransportDescriptor/fastdds/rtps/transport/UDPTransportDescriptor.h b/test/mock/rtps/UDPTransportDescriptor/fastdds/rtps/transport/UDPTransportDescriptor.h new file mode 100644 index 00000000000..243cf2364f2 --- /dev/null +++ b/test/mock/rtps/UDPTransportDescriptor/fastdds/rtps/transport/UDPTransportDescriptor.h @@ -0,0 +1,69 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_ +#define _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_ + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +using TransportInterface = fastdds::rtps::TransportInterface; + +/** + * Transport configuration + * + * - bufferSize: length of the buffers used for transmission. Passing + * a buffer of different size will cause transmission to + * fail. + * + * - interfaceWhiteList: Lists the allowed interfaces. + * @ingroup TRANSPORT_MODULE + */ +typedef struct UDPTransportDescriptor : public SocketTransportDescriptor +{ + virtual ~UDPTransportDescriptor() + { + } + + virtual TransportInterface* create_transport() const override + { + return nullptr; + } + + FASTDDS_EXPORTED_API UDPTransportDescriptor() + : SocketTransportDescriptor(65550, 4) + { + + } + + FASTDDS_EXPORTED_API UDPTransportDescriptor( + const UDPTransportDescriptor& /*t*/) + : SocketTransportDescriptor(65550, 4) + { + + } + + uint16_t m_output_udp_socket; + + bool non_blocking_send = false; +} UDPTransportDescriptor; + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_UDP_TRANSPORT_DESCRIPTOR_ diff --git a/test/mock/rtps/UDPTransportDescriptor/fastrtps/transport/UDPTransportDescriptor.h b/test/mock/rtps/UDPTransportDescriptor/fastrtps/transport/UDPTransportDescriptor.h deleted file mode 100644 index 0914643beb3..00000000000 --- a/test/mock/rtps/UDPTransportDescriptor/fastrtps/transport/UDPTransportDescriptor.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef UDP_TRANSPORT_DESCRIPTOR -#define UDP_TRANSPORT_DESCRIPTOR - -#include - -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ - -using TransportInterface = fastdds::rtps::TransportInterface; - -/** - * Transport configuration - * - * - bufferSize: length of the buffers used for transmission. Passing - * a buffer of different size will cause transmission to - * fail. - * - * - interfaceWhiteList: Lists the allowed interfaces. - * @ingroup TRANSPORT_MODULE - */ -typedef struct UDPTransportDescriptor: public SocketTransportDescriptor -{ - virtual ~UDPTransportDescriptor(){} - - virtual TransportInterface* create_transport() const override { return nullptr; } - - RTPS_DllAPI UDPTransportDescriptor() - : SocketTransportDescriptor(65550, 4) - { - - } - - RTPS_DllAPI UDPTransportDescriptor(const UDPTransportDescriptor& /*t*/) - : SocketTransportDescriptor(65550, 4) - { - - } - - uint16_t m_output_udp_socket; - - bool non_blocking_send = false; -} UDPTransportDescriptor; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif diff --git a/test/mock/rtps/UDPv4TransportDescriptor/fastdds/rtps/transport/UDPv4TransportDescriptor.h b/test/mock/rtps/UDPv4TransportDescriptor/fastdds/rtps/transport/UDPv4TransportDescriptor.h new file mode 100644 index 00000000000..bff26ea53e3 --- /dev/null +++ b/test/mock/rtps/UDPv4TransportDescriptor/fastdds/rtps/transport/UDPv4TransportDescriptor.h @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_UDPV4_TRANSPORT_DESCRIPTOR +#define _FASTDDS_UDPV4_TRANSPORT_DESCRIPTOR + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +using TransportInterface = fastdds::rtps::TransportInterface; + +/** + * Transport configuration + * + * - bufferSize: length of the buffers used for transmission. Passing + * a buffer of different size will cause transmission to + * fail. + * + * - interfaceWhiteList: Lists the allowed interfaces. + * @ingroup TRANSPORT_MODULE + */ +typedef struct UDPv4TransportDescriptor : public UDPTransportDescriptor +{ + virtual ~UDPv4TransportDescriptor() + { + } + + FASTDDS_EXPORTED_API UDPv4TransportDescriptor() + : UDPTransportDescriptor() + { + + } + + FASTDDS_EXPORTED_API UDPv4TransportDescriptor( + const UDPv4TransportDescriptor& /*t*/) + : UDPTransportDescriptor() + { + + } + +} UDPv4TransportDescriptor; + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_UDPV4_TRANSPORT_DESCRIPTOR diff --git a/test/mock/rtps/UDPv4TransportDescriptor/fastrtps/transport/UDPv4TransportDescriptor.h b/test/mock/rtps/UDPv4TransportDescriptor/fastrtps/transport/UDPv4TransportDescriptor.h deleted file mode 100644 index 111f9c11850..00000000000 --- a/test/mock/rtps/UDPv4TransportDescriptor/fastrtps/transport/UDPv4TransportDescriptor.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef UDPV4_TRANSPORT_DESCRIPTOR -#define UDPV4_TRANSPORT_DESCRIPTOR - -#include - -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ - -using TransportInterface = fastdds::rtps::TransportInterface; - -/** - * Transport configuration - * - * - bufferSize: length of the buffers used for transmission. Passing - * a buffer of different size will cause transmission to - * fail. - * - * - interfaceWhiteList: Lists the allowed interfaces. - * @ingroup TRANSPORT_MODULE - */ -typedef struct UDPv4TransportDescriptor: public UDPTransportDescriptor -{ - virtual ~UDPv4TransportDescriptor(){} - - RTPS_DllAPI UDPv4TransportDescriptor() - : UDPTransportDescriptor() - { - - } - - RTPS_DllAPI UDPv4TransportDescriptor(const UDPv4TransportDescriptor& /*t*/) - : UDPTransportDescriptor() - { - - } -} UDPv4TransportDescriptor; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif diff --git a/test/mock/rtps/UDPv6TransportDescriptor/fastdds/rtps/transport/UDPv6TransportDescriptor.h b/test/mock/rtps/UDPv6TransportDescriptor/fastdds/rtps/transport/UDPv6TransportDescriptor.h new file mode 100644 index 00000000000..d774685e5e0 --- /dev/null +++ b/test/mock/rtps/UDPv6TransportDescriptor/fastdds/rtps/transport/UDPv6TransportDescriptor.h @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef _FASTDDS_UDPV6_TRANSPORT_DESCRIPTOR_ +#define _FASTDDS_UDPV6_TRANSPORT_DESCRIPTOR_ + +#include + +namespace eprosima { +namespace fastdds { +namespace rtps { + +using TransportInterface = fastdds::rtps::TransportInterface; + +/** + * Transport configuration + * + * - bufferSize: length of the buffers used for transmission. Passing + * a buffer of different size will cause transmission to + * fail. + * + * - interfaceWhiteList: Lists the allowed interfaces. + * @ingroup TRANSPORT_MODULE + */ +typedef struct UDPv6TransportDescriptor : public UDPTransportDescriptor +{ + virtual ~UDPv6TransportDescriptor() + { + } + + FASTDDS_EXPORTED_API UDPv6TransportDescriptor() + : UDPTransportDescriptor() + { + + } + + FASTDDS_EXPORTED_API UDPv6TransportDescriptor( + const UDPv6TransportDescriptor& /*t*/) + : UDPTransportDescriptor() + { + + } + +} UDPv6TransportDescriptor; + +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_UDPV6_TRANSPORT_DESCRIPTOR_ diff --git a/test/mock/rtps/UDPv6TransportDescriptor/fastrtps/transport/UDPv6TransportDescriptor.h b/test/mock/rtps/UDPv6TransportDescriptor/fastrtps/transport/UDPv6TransportDescriptor.h deleted file mode 100644 index 8d6104f6fda..00000000000 --- a/test/mock/rtps/UDPv6TransportDescriptor/fastrtps/transport/UDPv6TransportDescriptor.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef UDPV6_TRANSPORT_DESCRIPTOR -#define UDPV6_TRANSPORT_DESCRIPTOR - -#include - -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ - -using TransportInterface = fastdds::rtps::TransportInterface; - -/** - * Transport configuration - * - * - bufferSize: length of the buffers used for transmission. Passing - * a buffer of different size will cause transmission to - * fail. - * - * - interfaceWhiteList: Lists the allowed interfaces. - * @ingroup TRANSPORT_MODULE - */ -typedef struct UDPv6TransportDescriptor: public UDPTransportDescriptor -{ - virtual ~UDPv6TransportDescriptor(){} - - RTPS_DllAPI UDPv6TransportDescriptor() - : UDPTransportDescriptor() - { - - } - - RTPS_DllAPI UDPv6TransportDescriptor(const UDPv6TransportDescriptor& /*t*/) - : UDPTransportDescriptor() - { - - } -} UDPv6TransportDescriptor; - -} // namespace rtps -} // namespace fastrtps -} // namespace eprosima - -#endif diff --git a/test/mock/rtps/WLP/fastdds/rtps/builtin/liveliness/WLP.h b/test/mock/rtps/WLP/fastdds/rtps/builtin/liveliness/WLP.h deleted file mode 100644 index 27cfbf6c2d6..00000000000 --- a/test/mock/rtps/WLP/fastdds/rtps/builtin/liveliness/WLP.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file WLP.h - * - */ - -#ifndef _FASTDDS_RTPS_WLP_H_ -#define _FASTDDS_RTPS_WLP_H_ - -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace rtps { - -class BuiltinProtocols; - -/** - * Class WLP that implements the Writer Liveliness Protocol described in the RTPS specification. - * @ingroup LIVELINESS_MODULE - */ -class WLP -{ - -public: - - /** - * Constructor - * @param prot Pointer to the BuiltinProtocols object. - */ - WLP( - BuiltinProtocols*) - { - } - - virtual ~WLP() - { - } - - MOCK_METHOD0(assert_liveliness_manual_by_participant, bool()); - - MOCK_METHOD1(removeRemoteEndpoints, void(ParticipantProxyData * pdata)); - - MOCK_METHOD3(assert_liveliness, bool( - GUID_t writer, - LivelinessQosPolicyKind kind, - Duration_t lease_duration)); -}; - -} /* namespace rtps */ -} /* namespace fastrtps */ -} /* namespace eprosima */ - -#endif /* _FASTDDS_RTPS_WLP_H_ */ diff --git a/test/mock/rtps/WLP/rtps/builtin/liveliness/WLP.h b/test/mock/rtps/WLP/rtps/builtin/liveliness/WLP.h new file mode 100644 index 00000000000..290d4b5ce57 --- /dev/null +++ b/test/mock/rtps/WLP/rtps/builtin/liveliness/WLP.h @@ -0,0 +1,73 @@ +// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file WLP.h + * + */ + +#ifndef _FASTDDS_RTPS_WLP_H_ +#define _FASTDDS_RTPS_WLP_H_ + +#include +#include + +#include + +#include +#include + +namespace eprosima { +namespace fastrtps { +namespace rtps { + +class BuiltinProtocols; + +/** + * Class WLP that implements the Writer Liveliness Protocol described in the RTPS specification. + * @ingroup LIVELINESS_MODULE + */ +class WLP +{ + +public: + + /** + * Constructor + * @param prot Pointer to the BuiltinProtocols object. + */ + WLP( + BuiltinProtocols*) + { + } + + virtual ~WLP() + { + } + + MOCK_METHOD0(assert_liveliness_manual_by_participant, bool()); + + MOCK_METHOD1(removeRemoteEndpoints, void(ParticipantProxyData * pdata)); + + MOCK_METHOD3(assert_liveliness, bool( + GUID_t writer, + LivelinessQosPolicyKind kind, + Duration_t lease_duration)); +}; + +} /* namespace rtps */ +} /* namespace fastrtps */ +} /* namespace eprosima */ + +#endif /* _FASTDDS_RTPS_WLP_H_ */ diff --git a/test/mock/rtps/WriterHistory/fastdds/rtps/history/WriterHistory.h b/test/mock/rtps/WriterHistory/fastdds/rtps/history/WriterHistory.h index fa0aaecd4b7..a592db24949 100644 --- a/test/mock/rtps/WriterHistory/fastdds/rtps/history/WriterHistory.h +++ b/test/mock/rtps/WriterHistory/fastdds/rtps/history/WriterHistory.h @@ -21,13 +21,13 @@ #include -#include -#include -#include -#include - #include +#include +#include +#include +#include + namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/mock/rtps/WriterProxyData/fastdds/rtps/builtin/data/WriterProxyData.h b/test/mock/rtps/WriterProxyData/fastdds/rtps/builtin/data/WriterProxyData.h index 267f2e2f8e4..ddf21b9b9f6 100644 --- a/test/mock/rtps/WriterProxyData/fastdds/rtps/builtin/data/WriterProxyData.h +++ b/test/mock/rtps/WriterProxyData/fastdds/rtps/builtin/data/WriterProxyData.h @@ -19,17 +19,19 @@ #ifndef _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_ #define _FASTDDS_RTPS_BUILTIN_DATA_WRITERPROXYDATA_H_ -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include #if HAVE_SECURITY -#include +#include #endif // if HAVE_SECURITY -#include - namespace eprosima { namespace fastrtps { namespace rtps { @@ -46,8 +48,6 @@ class WriterProxyData : remote_locators_(max_unicast_locators, max_multicast_locators) , topic_kind_(NO_KEY) , is_alive_(true) - , type_id_() - , type_() , type_info_() , m_typeMaxSerialized(0) , m_userDefinedId(0) @@ -63,8 +63,6 @@ class WriterProxyData : remote_locators_(max_unicast_locators, max_multicast_locators) , topic_kind_(NO_KEY) , is_alive_(true) - , type_id_() - , type_() , type_info_() , m_typeMaxSerialized(0) , m_userDefinedId(0) @@ -151,23 +149,23 @@ class WriterProxyData } void typeName( - const string_255& typeName) + const fastcdr::string_255& typeName) { type_name_ = typeName; } - const string_255& typeName() const + const fastcdr::string_255& typeName() const { return type_name_; } void topicName( - const string_255& topicName) + const fastcdr::string_255& topicName) { topic_name_ = topicName; } - const string_255& topicName() const + const fastcdr::string_255& topicName() const { return topic_name_; } @@ -194,65 +192,23 @@ class WriterProxyData return is_alive_; } - bool has_type_id () const - { - return false; - } - - void type_id( - const TypeIdV1& other_type_id) - { - type_id_ = other_type_id; - } - - const TypeIdV1& type_id() const - { - return type_id_; - } - - TypeIdV1& type_id() - { - return type_id_; - } - - bool has_type () const - { - return false; - } - - void type( - const TypeObjectV1& other_type) - { - type_ = other_type; - } - - const TypeObjectV1& type() const - { - return type_; - } - - TypeObjectV1& type() - { - return type_; - } - bool has_type_information () const { return false; } void type_information( - const xtypes::TypeInformation& other_type_info) + const fastdds::dds::xtypes::TypeInformationParameter& other_type_info) { type_info_ = other_type_info; } - const xtypes::TypeInformation& type_information() const + const fastdds::dds::xtypes::TypeInformationParameter& type_information() const { return type_info_; } - xtypes::TypeInformation& type_information() + fastdds::dds::xtypes::TypeInformationParameter& type_information() { return type_info_; } @@ -350,19 +306,17 @@ class WriterProxyData security::PluginEndpointSecurityAttributesMask plugin_security_attributes_ = 0UL; #endif // if HAVE_SECURITY - WriterQos m_qos; + fastdds::dds::WriterQos m_qos; private: GUID_t m_guid; RemoteLocatorList remote_locators_; - string_255 topic_name_; - string_255 type_name_; + fastcdr::string_255 topic_name_; + fastcdr::string_255 type_name_; TopicKind_t topic_kind_; bool is_alive_; - TypeIdV1 type_id_; - TypeObjectV1 type_; - xtypes::TypeInformation type_info_; + fastdds::dds::xtypes::TypeInformationParameter type_info_; uint32_t m_typeMaxSerialized; InstanceHandle_t m_key; InstanceHandle_t m_RTPSParticipantKey; diff --git a/test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h b/test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h deleted file mode 100644 index b2167de2ef0..00000000000 --- a/test/mock/rtps/XMLEndPointParser/fastrtps/xmlparser/XMLEndpointParser.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file XMLEndpointParser.h - * - */ - -#ifndef XMLENDPOINTPARSER_H_ -#define XMLENDPOINTPARSER_H_ -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include - -namespace eprosima { -namespace fastrtps { -namespace xmlparser { - -/** - * Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints. - * @ingroup DISCVOERYMODULE - */ -class XMLEndpointParser -{ -public: - - XMLEndpointParser() - { - } - - virtual ~XMLEndpointParser() - { - } - - /** - * Load the XML file - * @param filename Name of the file to load and parse. - * @return True if correct. - */ - XMLP_ret loadXMLFile( - std::string&) - { - return XMLP_ret::XML_OK; - } - -private: - -}; - - -} /* xmlparser */ -} /* namespace */ -} /* namespace eprosima */ - -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* XMLENDPOINTPARSER_H_ */ diff --git a/test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h b/test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h new file mode 100644 index 00000000000..f3e698e932b --- /dev/null +++ b/test/mock/rtps/XMLEndPointParser/xmlparser/XMLEndpointParser.h @@ -0,0 +1,67 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file XMLEndpointParser.h + * + */ + +#ifndef XMLENDPOINTPARSER_H_ +#define XMLENDPOINTPARSER_H_ +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#include + +namespace eprosima { +namespace fastrtps { +namespace xmlparser { + +/** + * Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints. + * @ingroup DISCVOERYMODULE + */ +class XMLEndpointParser +{ +public: + + XMLEndpointParser() + { + } + + virtual ~XMLEndpointParser() + { + } + + /** + * Load the XML file + * @param filename Name of the file to load and parse. + * @return True if correct. + */ + XMLP_ret loadXMLFile( + std::string&) + { + return XMLP_ret::XML_OK; + } + +private: + +}; + + +} /* xmlparser */ +} /* namespace */ +} /* namespace eprosima */ + +#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +#endif /* XMLENDPOINTPARSER_H_ */ diff --git a/test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h b/test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h deleted file mode 100644 index e6f495de49f..00000000000 --- a/test/mock/rtps/XMLProfileManager/fastrtps/xmlparser/XMLProfileManager.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#ifndef XML_PROFILE_MANAGER_H_ -#define XML_PROFILE_MANAGER_H_ - -#include - -namespace eprosima { -namespace fastrtps { -namespace xmlparser { - -class XMLProfileManager -{ -public: - - static sp_transport_t getTransportById( - const std::string&) - { - return sp_transport_t(); - } - -}; - -} // namespace xmlparser -} // namespace fastrtps -} // namespace eprosima - -#endif // XML_PROFILE_MANAGER_H_ diff --git a/test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h b/test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h new file mode 100644 index 00000000000..d74348f2dfc --- /dev/null +++ b/test/mock/rtps/XMLProfileManager/xmlparser/XMLProfileManager.h @@ -0,0 +1,40 @@ +// Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef XML_PROFILE_MANAGER_H_ +#define XML_PROFILE_MANAGER_H_ + +#include + +namespace eprosima { +namespace fastrtps { +namespace xmlparser { + +class XMLProfileManager +{ +public: + + static sp_transport_t getTransportById( + const std::string&) + { + return sp_transport_t(); + } + +}; + +} // namespace xmlparser +} // namespace fastrtps +} // namespace eprosima + +#endif // XML_PROFILE_MANAGER_H_ diff --git a/test/mock/rtps/external_locators/rtps/network/utils/external_locators.hpp b/test/mock/rtps/external_locators/rtps/network/utils/external_locators.hpp index 32ba8cbb65e..2b1640e2ed4 100644 --- a/test/mock/rtps/external_locators/rtps/network/utils/external_locators.hpp +++ b/test/mock/rtps/external_locators/rtps/network/utils/external_locators.hpp @@ -89,6 +89,12 @@ void add_external_locators( { } +void add_external_locators( + LocatorList&, + const ExternalLocators&) +{ +} + /** * Filter the locators of a remote participant according to the matching algorithm. * diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index bb6dec1e391..42098999275 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -26,5 +26,6 @@ option(VIDEO_TESTS "Activate the building and execution of performance tests" OF add_subdirectory(latency) add_subdirectory(throughput) if(VIDEO_TESTS) - add_subdirectory(video) +# // TODO(jlbueno): migrate to Fast DDS API +# add_subdirectory(video) endif() diff --git a/test/performance/latency/CMakeLists.txt b/test/performance/latency/CMakeLists.txt index 58108782d3b..fe693371e86 100644 --- a/test/performance/latency/CMakeLists.txt +++ b/test/performance/latency/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories(LatencyTest PRIVATE ${Asio_INCLUDE_DIR}) target_link_libraries( LatencyTest - fastrtps + fastdds fastcdr foonathan_memory fastdds::optionparser diff --git a/test/performance/latency/LatencyTestPublisher.cpp b/test/performance/latency/LatencyTestPublisher.cpp index 45cac09b1eb..ae89e8433a1 100644 --- a/test/performance/latency/LatencyTestPublisher.cpp +++ b/test/performance/latency/LatencyTestPublisher.cpp @@ -19,9 +19,8 @@ #include "LatencyTestPublisher.hpp" -#include - #include +#include #include #include #include @@ -33,17 +32,19 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include -#include - #define TIME_LIMIT_US 10000 using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; LatencyTestPublisher::LatencyTestPublisher() : latency_command_type_(new TestCommandDataType()) @@ -168,7 +169,7 @@ bool LatencyTestPublisher::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -220,7 +221,7 @@ bool LatencyTestPublisher::init( } // Register the command type - if (ReturnCode_t::RETCODE_OK != latency_command_type_.register_type(participant_)) + if (RETCODE_OK != latency_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the COMMAND type"); return false; @@ -250,14 +251,14 @@ bool LatencyTestPublisher::init( std::string pub_profile_name = "pub_publisher_profile"; std::string sub_profile_name = "pub_subscriber_profile"; - if (ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) + if (RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unable to retrive the " << pub_profile_name << "from XML file"); return false; } - if (ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) + if (RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unable to retrive the " << sub_profile_name << "from XML file"); @@ -269,7 +270,7 @@ bool LatencyTestPublisher::init( ReliabilityQosPolicy rp; if (reliable) { - rp.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; RTPSReliableWriterQos rw_qos; rw_qos.times.heartbeatPeriod.seconds = 0; @@ -278,7 +279,7 @@ bool LatencyTestPublisher::init( } else { - rp.kind = eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; } dw_qos_.reliability(rp); @@ -508,7 +509,7 @@ void LatencyTestPublisher::CommandReaderListener::on_data_available( SampleInfo info; if (reader->take_next_sample( - &command, &info) == ReturnCode_t::RETCODE_OK + &command, &info) == RETCODE_OK && info.valid_data) { if (command.m_command == BEGIN @@ -537,7 +538,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( if (pub->data_loans_) { - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos, 1)) + if (RETCODE_OK != reader->take(data_seq, infos, 1)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -552,7 +553,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // Retrieved echoed data if (reader->take_next_sample( - data, &info) != ReturnCode_t::RETCODE_OK + data, &info) != RETCODE_OK || !info.valid_data) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem reading Subscriber echoed test data"); @@ -578,12 +579,16 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( } // Check if is the expected echo message - if ((pub->dynamic_types_ - && (pub->dynamic_data_in_->get_uint32_value(0) - != pub->dynamic_data_out_->get_uint32_value(0))) - || (!pub->dynamic_types_ - && (pub->latency_data_in_->seqnum - != pub->latency_data_out_->seqnum))) + uint32_t dyn_value_in {0}; + uint32_t dyn_value_out {0}; + if (pub->dynamic_types_) + { + (*pub->dynamic_data_in_)->get_uint32_value(dyn_value_in, 0); + (*pub->dynamic_data_out_)->get_uint32_value(dyn_value_out, 0); + } + + if ((pub->dynamic_types_ && dyn_value_in != dyn_value_out) + || (!pub->dynamic_types_ && pub->latency_data_in_->seqnum != pub->latency_data_out_->seqnum)) { EPROSIMA_LOG_INFO(LatencyTest, "Echo message received is not the expected one"); } @@ -608,7 +613,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // Reset seqnum from out data if (pub->dynamic_types_) { - pub->dynamic_data_out_->set_uint32_value(0, 0); + (*pub->dynamic_data_out_)->set_uint32_value(0, 0); } else { @@ -632,7 +637,7 @@ void LatencyTestPublisher::LatencyDataReaderListener::on_data_available( // release the loan if any if (pub->data_loans_ - && ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + && RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem returning loaned test data"); } @@ -703,41 +708,39 @@ bool LatencyTestPublisher::test( if (dynamic_types_) { - dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); - dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_in_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_out_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_in_) { - EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "Iteration failed: Failed to create Dynamic Data In"); + EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, + "Iteration failed: Failed to create Dynamic Data In"); return false; } if (nullptr == dynamic_data_out_) { - EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "Iteration failed: Failed to create Dynamic Data Out"); + EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, + "Iteration failed: Failed to create Dynamic Data Out"); return false; } - MemberId id_in; - MemberId id_out; - DynamicData* data_in = dynamic_data_in_->loan_value( - dynamic_data_in_->get_member_id_at_index(1)); - DynamicData* data_out = dynamic_data_out_->loan_value( - dynamic_data_out_->get_member_id_at_index(1)); + DynamicData::_ref_type data_in = (*dynamic_data_in_)->loan_value( + (*dynamic_data_in_)->get_member_id_at_index(1)); + DynamicData::_ref_type data_out = (*dynamic_data_out_)->loan_value( + (*dynamic_data_out_)->get_member_id_at_index(1)); // fill until complete the desired payload size uint32_t padding = datasize - 4; // sequence number is a DWORD for (uint32_t i = 0; i < padding; ++i) { - data_in->insert_sequence_data(id_in); - data_in->set_byte_value(0, id_in); - data_out->insert_sequence_data(id_out); - data_out->set_byte_value(0, id_out); + data_in->set_byte_value(i, 0); + data_out->set_byte_value(i, 0); } - dynamic_data_in_->return_loaned_value(data_in); - dynamic_data_out_->return_loaned_value(data_out); + (*dynamic_data_in_)->return_loaned_value(data_in); + (*dynamic_data_out_)->return_loaned_value(data_out); } else if (init_static_types(datasize) && create_data_endpoints()) { @@ -786,12 +789,12 @@ bool LatencyTestPublisher::test( // The first measurement it's usually not representative, so we take one more and then drop the first one. for (unsigned int count = 1; count <= samples_ + 1; ++count) { - void* data = nullptr; + void* data {nullptr}; if (dynamic_types_) { - dynamic_data_in_->set_uint32_value(0, 0); - dynamic_data_out_->set_uint32_value(count, 0); + (*dynamic_data_in_)->set_uint32_value(0, 0); + (*dynamic_data_out_)->set_uint32_value(0, count); data = dynamic_data_out_; } else @@ -808,7 +811,7 @@ bool LatencyTestPublisher::test( while (trials-- != 0 && !loaned) { - loaned = (ReturnCode_t::RETCODE_OK + loaned = (RETCODE_OK == data_writer_->loan_sample( data, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)); @@ -892,8 +895,8 @@ bool LatencyTestPublisher::test( // Delete Data Sample if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_in_); - DynamicDataFactory::get_instance()->delete_data(dynamic_data_out_); + dynamic_pub_sub_type_->deleteData(dynamic_data_in_); + dynamic_pub_sub_type_->deleteData(dynamic_data_out_); } else { @@ -1066,18 +1069,27 @@ bool LatencyTestPublisher::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(LatencyDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); - struct_type_builder->set_name(LatencyDataType::type_name_); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the DYNAMIC DATA type"); return false; @@ -1109,7 +1121,7 @@ bool LatencyTestPublisher::init_static_types( // Create the static type latency_data_type_.reset(new LatencyDataType(padding)); // Register the static type - if (ReturnCode_t::RETCODE_OK != latency_data_type_.register_type(participant_)) + if (RETCODE_OK != latency_data_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR registering the STATIC DATA type"); return false; @@ -1218,7 +1230,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() // Delete the endpoints if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DataWriter"); return false; @@ -1227,7 +1239,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() data_writer_listener_.reset(); if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DataReader"); return false; @@ -1237,7 +1249,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() // Delete the Topics if (nullptr == latency_data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DATA PUB topic"); return false; @@ -1245,7 +1257,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_pub_topic_ = nullptr; if (nullptr == latency_data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR destroying the DATA SUB topic"); return false; @@ -1253,7 +1265,7 @@ bool LatencyTestPublisher::destroy_data_endpoints() latency_data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) + if (RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) { EPROSIMA_LOG_ERROR(LATENCYPUBLISHER, "ERROR unregistering the DATA type"); return false; diff --git a/test/performance/latency/LatencyTestPublisher.hpp b/test/performance/latency/LatencyTestPublisher.hpp index 9d68cac2ee0..f9aa04a26b3 100644 --- a/test/performance/latency/LatencyTestPublisher.hpp +++ b/test/performance/latency/LatencyTestPublisher.hpp @@ -28,17 +28,10 @@ #include #include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include "LatencyTestTypes.hpp" #include "../optionarg.hpp" @@ -175,7 +168,7 @@ class LatencyTestPublisher std::vector> times_; /* Data */ - eprosima::fastrtps::SampleInfo_t sampleinfo_; + eprosima::fastdds::dds::SampleInfo sampleinfo_; std::vector stats_; uint64_t raw_sample_count_ = 0; @@ -224,8 +217,8 @@ class LatencyTestPublisher eprosima::fastdds::dds::TypeSupport latency_command_type_; /* Dynamic Types */ - eprosima::fastrtps::types::DynamicData* dynamic_data_in_ = nullptr; - eprosima::fastrtps::types::DynamicData* dynamic_data_out_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_in_ {nullptr}; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_out_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; std::vector data_size_pub_; diff --git a/test/performance/latency/LatencyTestSubscriber.cpp b/test/performance/latency/LatencyTestSubscriber.cpp index f6e34bca42a..dae6900b0a3 100644 --- a/test/performance/latency/LatencyTestSubscriber.cpp +++ b/test/performance/latency/LatencyTestSubscriber.cpp @@ -28,14 +28,17 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include -#include -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; using namespace eprosima::fastdds::dds; +using namespace eprosima::fastrtps::rtps; LatencyTestSubscriber::LatencyTestSubscriber() : latency_command_type_(new TestCommandDataType()) @@ -122,7 +125,7 @@ bool LatencyTestSubscriber::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -172,7 +175,7 @@ bool LatencyTestSubscriber::init( } // Register the command type - if (ReturnCode_t::RETCODE_OK != latency_command_type_.register_type(participant_)) + if (RETCODE_OK != latency_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the COMMAND type"); return false; @@ -201,14 +204,14 @@ bool LatencyTestSubscriber::init( std::string sub_profile_name = "sub_subscriber_profile"; std::string pub_profile_name = "sub_publisher_profile"; - if ( ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) + if ( RETCODE_OK != publisher_->get_datawriter_qos_from_profile(pub_profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unable to retrieve the " << pub_profile_name << "from XML file"); return false; } - if ( ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) + if ( RETCODE_OK != subscriber_->get_datareader_qos_from_profile(sub_profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR unable to retrieve the " << sub_profile_name); return false; @@ -220,7 +223,7 @@ bool LatencyTestSubscriber::init( ReliabilityQosPolicy rp; if (reliable) { - rp.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; RTPSReliableWriterQos rw_qos; rw_qos.times.heartbeatPeriod.seconds = 0; @@ -229,7 +232,7 @@ bool LatencyTestSubscriber::init( } else { - rp.kind = eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; } dr_qos_.reliability(rp); @@ -444,7 +447,7 @@ void LatencyTestSubscriber::CommandReaderListener::on_data_available( bool notify = false; if (reader->take_next_sample( - &command, &info) == ReturnCode_t::RETCODE_OK + &command, &info) == RETCODE_OK && info.valid_data) { std::unique_lock lock(latency_subscriber_->mutex_); @@ -504,7 +507,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( // writer loan buffer void* echoed_loan = nullptr; - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos, 1)) + if (RETCODE_OK != reader->take(data_seq, infos, 1)) { EPROSIMA_LOG_INFO(LatencyTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -528,7 +531,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( data_type->copy_data(*echoed_data, *sub->latency_data_); // release the reader loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(LatencyTest, "Problem returning loaned test data"); return; @@ -539,7 +542,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( bool loaned = false; while (trials-- != 0 && !loaned) { - loaned = (ReturnCode_t::RETCODE_OK + loaned = (RETCODE_OK == sub->data_writer_->loan_sample( echoed_loan, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)); @@ -577,7 +580,7 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( else { // release the loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_ERROR(LatencyTest, "Problem returning loaned test data"); } @@ -591,13 +594,16 @@ void LatencyTestSubscriber::LatencyDataReaderListener::on_data_available( (void*)sub->latency_data_; if (reader->take_next_sample( - data, &info) == ReturnCode_t::RETCODE_OK + data, &info) == RETCODE_OK && info.valid_data) { if (sub->echo_) { // no bounce overload recorded - reinterpret_cast(data)->bounce = 0; + if (!sub->dynamic_types_) + { + reinterpret_cast(data)->bounce = 0; + } if (!sub->data_writer_->write(data)) { @@ -652,28 +658,27 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(LatencyTest, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(LatencyTest, + "Iteration failed: Failed to create Dynamic Data"); return false; } // Modify the data Sample - DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); // fill until complete the desired payload size uint32_t padding = datasize - 4; // sequence number is a DWORD for (uint32_t i = 0; i < padding; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } // Create the static type for the given buffer size and the endpoints else if (init_static_types(datasize) && create_data_endpoints()) @@ -720,7 +725,6 @@ bool LatencyTestSubscriber::test( if (dynamic_types_) { dynamic_pub_sub_type_->deleteData(dynamic_data_); - // DynamicDataFactory::get_instance()->delete_data(dynamic_data_); // // Reset history for the new test size_t removed; @@ -752,7 +756,7 @@ bool LatencyTestSubscriber::test( } // prevent the LatencyTestSubscriber from been destroyed while LatencyTestPublisher is waitin for the END command. - if ( ReturnCode_t::RETCODE_OK != command_writer_->wait_for_acknowledgments(eprosima::fastrtps::c_TimeInfinite)) + if ( RETCODE_OK != command_writer_->wait_for_acknowledgments(eprosima::fastrtps::c_TimeInfinite)) { EPROSIMA_LOG_ERROR(LatencyTest, "Subscriber fail to acknowledge the END command"); return false; @@ -794,18 +798,27 @@ bool LatencyTestSubscriber::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(LatencyDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); - struct_type_builder->set_name(LatencyDataType::type_name_); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the DYNAMIC DATA type"); return false; @@ -837,7 +850,7 @@ bool LatencyTestSubscriber::init_static_types( // Create the static type latency_data_type_.reset(new LatencyDataType(padding)); // Register the static type - if (ReturnCode_t::RETCODE_OK != latency_data_type_.register_type(participant_)) + if (RETCODE_OK != latency_data_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(LATENCYSUBSCRIBER, "ERROR registering the STATIC DATA type"); return false; @@ -941,7 +954,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() // Delete the endpoints if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DataWriter"); return false; @@ -950,7 +963,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() data_writer_listener_.reset(); if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DataReader"); return false; @@ -960,14 +973,14 @@ bool LatencyTestSubscriber::destroy_data_endpoints() // Delete the Topics if (nullptr == latency_data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_pub_topic_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DATA pub topic"); return false; } latency_data_pub_topic_ = nullptr; if (nullptr == latency_data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(latency_data_sub_topic_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR destroying the DATA sub topic"); return false; @@ -975,7 +988,7 @@ bool LatencyTestSubscriber::destroy_data_endpoints() latency_data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(LatencyDataType::type_name_)) { EPROSIMA_LOG_ERROR(LatencyTest, "ERROR unregistering the DATA type"); diff --git a/test/performance/latency/LatencyTestSubscriber.hpp b/test/performance/latency/LatencyTestSubscriber.hpp index 958f7e94cbc..8d1f45d3583 100644 --- a/test/performance/latency/LatencyTestSubscriber.hpp +++ b/test/performance/latency/LatencyTestSubscriber.hpp @@ -29,15 +29,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include "LatencyTestTypes.hpp" #include "../optionarg.hpp" @@ -150,7 +142,7 @@ class LatencyTestSubscriber eprosima::fastdds::dds::TypeSupport latency_command_type_; /* Dynamic Types */ - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; std::vector data_size_sub_; diff --git a/test/performance/latency/LatencyTestTypes.cpp b/test/performance/latency/LatencyTestTypes.cpp index 1812c973d22..350e36c149e 100644 --- a/test/performance/latency/LatencyTestTypes.cpp +++ b/test/performance/latency/LatencyTestTypes.cpp @@ -38,7 +38,7 @@ bool LatencyDataType::compare_data( return false; } - // bouncing time is ignored on comparisson + // bouncing time is ignored on comparison return 0 == memcmp(lt1.data, lt2.data, buffer_size_); } diff --git a/test/performance/latency/LatencyTestTypes.hpp b/test/performance/latency/LatencyTestTypes.hpp index e5a5d51e838..2b4b314c862 100644 --- a/test/performance/latency/LatencyTestTypes.hpp +++ b/test/performance/latency/LatencyTestTypes.hpp @@ -17,13 +17,17 @@ * */ -#include -#include - #ifndef LATENCYTESTTYPES_H_ #define LATENCYTESTTYPES_H_ -#include "fastrtps/fastrtps_all.h" +#include +#include +#include + +#include +#include +#include +#include #define MAX_TYPE_SIZE 10 * 1024 * 1024 @@ -160,7 +164,7 @@ class LatencyDataType : public eprosima::fastdds::dds::TopicDataType private: - using eprosima::fastrtps::TopicDataType::is_plain; + using eprosima::fastdds::dds::TopicDataType::is_plain; }; enum TESTCOMMAND : uint32_t diff --git a/test/performance/latency/README.md b/test/performance/latency/README.md index aa1c23849ec..c8b3a6fef72 100644 --- a/test/performance/latency/README.md +++ b/test/performance/latency/README.md @@ -62,7 +62,7 @@ colcon build --cmake-args -DPERFORMANCE_TESTS=ON The latency test executable can be found in the `build` directory. ``` -build/fastrtps/test/performance/latency +build/fastdds/test/performance/latency β”œβ”€β”€ CMakeFiles β”œβ”€β”€ cmake_install.cmake β”œβ”€β”€ CTestTestfile.cmake @@ -97,9 +97,9 @@ The utility offers several options: | --samples= | Number of samples sent in the test. Default is *10000 samples* | | --domain \ | Set the DDS domain to be used. Default domain is a random one. If testing in separate processes, always set the domain using this argument | | --file= | File to read the payload demands. | -| --data_sharing=[on/off] | Explicitly enable/disable Data Sharing feature. Fast-DDS default is *auto* | +| --data_sharing=[on/off] | Explicitly enable/disable Data Sharing feature. Fast DDS default is *auto* | | --data_load | Enables the use of Data Loans feature | -| --shared_memory | Explicitly enable/disable Shared Memory transport. Fast-DDS default is *on* | +| --shared_memory | Explicitly enable/disable Shared Memory transport. Fast DDS default is *on* | | --security=[true/false] | Enable/disable DDS security | | --certs=\ | Directory with the certificates. Used when security is enable | @@ -153,10 +153,10 @@ The directory also comes with a Python script which automates the execution of t ```batch # Indicate where is the utility executable -export LATENCY_TEST_BIN=build/fastrtps/test/performance/latency/LatencyTest +export LATENCY_TEST_BIN=build/fastdds/test/performance/latency/LatencyTest # Call python script to run tests. -python3 src/fastrtps/test/performance/latency/latency_tests.py +python3 src/fastdds/test/performance/latency/latency_tests.py ``` The python scripts offers several options: @@ -165,7 +165,7 @@ The python scripts offers several options: | - | - | | --reliability | Set the Reliability QoS of the DDS entities to reliable. Default Reliability is best-effort | | --data_loans | Enable the use of the loan sample API. Default is disable | -| --shared_memory [on/off] | Explicitly enable/disable shared memory transport. Fast-DDS default is *on* | +| --shared_memory [on/off] | Explicitly enable/disable shared memory transport. Fast DDS default is *on* | | --interprocess | Publisher and subscriber in separate processes. Default is both in the sample process and using intraprocess communications | | --security | Enable security. Default disable | | -n \ | Number of samples sent in the test. Default is *10000 samples* diff --git a/test/performance/latency/latency_tests.py b/test/performance/latency/latency_tests.py index 1a5e5ac1646..06b906e2f76 100644 --- a/test/performance/latency/latency_tests.py +++ b/test/performance/latency/latency_tests.py @@ -23,7 +23,7 @@ parser.add_argument( '-x', '--xml_file', - help='A Fast-RTPS XML configuration file', + help='A Fast DDS XML configuration file', required=False ) parser.add_argument( @@ -58,7 +58,7 @@ '-d', '--data_sharing', choices=['on', 'off'], - help='Explicitly enable/disable data sharing. (Defaults: Fast-DDS default settings)', + help='Explicitly enable/disable data sharing. (Defaults: Fast DDS default settings)', required=False ) parser.add_argument( @@ -78,7 +78,7 @@ parser.add_argument( '--shared_memory', choices=['on', 'off'], - help='Explicitly enable/disable shared memory transport. (Defaults: Fast-DDS default settings)', + help='Explicitly enable/disable shared memory transport. (Defaults: Fast DDS default settings)', required=False ) diff --git a/test/performance/latency/main_LatencyTest.cpp b/test/performance/latency/main_LatencyTest.cpp index a7131c491c9..93a71039bde 100644 --- a/test/performance/latency/main_LatencyTest.cpp +++ b/test/performance/latency/main_LatencyTest.cpp @@ -12,23 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "LatencyTestPublisher.hpp" -#include "LatencyTestSubscriber.hpp" -#include "../optionarg.hpp" - -#include -#include -#include -#include #include #include +#include #include +#include +#include +#include -#include +#include #include -#include -#include -#include +#include + +#include "../optionarg.hpp" +#include "LatencyTestPublisher.hpp" +#include "LatencyTestSubscriber.hpp" #if defined(_MSC_VER) #pragma warning (push) @@ -188,6 +186,7 @@ int main( char** argv) { + using Log = eprosima::fastdds::dds::Log; Log::SetVerbosity(Log::Kind::Info); Log::SetCategoryFilter(std::regex("LatencyTest")); @@ -482,7 +481,7 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (xml_config_file.length() > 0) { - xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_config_file); } LatencyDataSizes data_sizes; diff --git a/test/performance/latency/xml/latency_interprocess_best_effort_shm_profile.xml b/test/performance/latency/xml/latency_interprocess_best_effort_shm_profile.xml index 77a20c00cab..a4495b3cb50 100644 --- a/test/performance/latency/xml/latency_interprocess_best_effort_shm_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_best_effort_shm_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_interprocess_best_effort_tcp_profile.xml b/test/performance/latency/xml/latency_interprocess_best_effort_tcp_profile.xml index a1c1034ac3f..a5e7c693e05 100644 --- a/test/performance/latency/xml/latency_interprocess_best_effort_tcp_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_best_effort_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_interprocess_best_effort_udp_profile.xml b/test/performance/latency/xml/latency_interprocess_best_effort_udp_profile.xml index a12534f93e9..f5c79a0deed 100644 --- a/test/performance/latency/xml/latency_interprocess_best_effort_udp_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_best_effort_udp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_interprocess_reliable_shm_profile.xml b/test/performance/latency/xml/latency_interprocess_reliable_shm_profile.xml index e69f7eb1b54..a0be5e11182 100644 --- a/test/performance/latency/xml/latency_interprocess_reliable_shm_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_reliable_shm_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_interprocess_reliable_tcp_profile.xml b/test/performance/latency/xml/latency_interprocess_reliable_tcp_profile.xml index dd734a48dfc..e13bd704149 100644 --- a/test/performance/latency/xml/latency_interprocess_reliable_tcp_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_reliable_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_interprocess_reliable_udp_profile.xml b/test/performance/latency/xml/latency_interprocess_reliable_udp_profile.xml index b5446072dfb..c81ed2b82ec 100644 --- a/test/performance/latency/xml/latency_interprocess_reliable_udp_profile.xml +++ b/test/performance/latency/xml/latency_interprocess_reliable_udp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_intraprocess_best_effort_profile.xml b/test/performance/latency/xml/latency_intraprocess_best_effort_profile.xml index 14994632d77..69a2a43b9cf 100644 --- a/test/performance/latency/xml/latency_intraprocess_best_effort_profile.xml +++ b/test/performance/latency/xml/latency_intraprocess_best_effort_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/latency/xml/latency_intraprocess_reliable_profile.xml b/test/performance/latency/xml/latency_intraprocess_reliable_profile.xml index 63dea13e838..322f257c6c4 100644 --- a/test/performance/latency/xml/latency_intraprocess_reliable_profile.xml +++ b/test/performance/latency/xml/latency_intraprocess_reliable_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/CMakeLists.txt b/test/performance/throughput/CMakeLists.txt index 30cb02437d5..1949c2787e9 100644 --- a/test/performance/throughput/CMakeLists.txt +++ b/test/performance/throughput/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories(ThroughputTest PRIVATE ${Asio_INCLUDE_DIR}) target_link_libraries( ThroughputTest - fastrtps + fastdds fastcdr foonathan_memory fastdds::optionparser diff --git a/test/performance/throughput/README.md b/test/performance/throughput/README.md index 1a11f020c30..e4d4c77f418 100644 --- a/test/performance/throughput/README.md +++ b/test/performance/throughput/README.md @@ -56,7 +56,7 @@ The columns show the next information: This utility can be enabled by using the CMake option `PERFORMANCE_TESTS`. Following the Fast DDS [*Installation from sources* guide](https://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_linux.html), - Fast-DDS and this utility can be compiled executing the next command. + Fast DDS and this utility can be compiled executing the next command. ``` colcon build --cmake-args -DPERFORMANCE_TESTS=ON @@ -65,7 +65,7 @@ colcon build --cmake-args -DPERFORMANCE_TESTS=ON The throughput test executable can be found in the `build` directory. ``` -build/fastrtps/test/performance/throughput +build/fastdds/test/performance/throughput β”œβ”€β”€ CMakeFiles β”œβ”€β”€ cmake_install.cmake β”œβ”€β”€ CTestTestfile.cmake @@ -98,9 +98,9 @@ The utility offers several options: | - | - | | --reliability=[reliable/besteffort] | Set the Reliability QoS of the DDS entity | | --domain \ | Set the DDS domain to be used. Default domain is a random one. If testing in separate processes, always set the domain using this argument | -| --data_sharing=[on/off] | Explicitly enable/disable Data Sharing feature. Fast-DDS default is *auto* | +| --data_sharing=[on/off] | Explicitly enable/disable Data Sharing feature. Fast DDS default is *auto* | | --data_load | Enables the use of Data Loans feature | -| --shared_memory | Explicitly enable/disable Shared Memory transport. Fast-DDS default is *on* | +| --shared_memory | Explicitly enable/disable Shared Memory transport. Fast DDS default is *on* | | --security=[true/false] | Enable/disable DDS security | | --certs=\ | Directory with the certificates. Used when security is enable | @@ -167,10 +167,10 @@ The directory also comes with a Python script which automates the execution of t ```batch # Indicate where is the utility executable -export THROUGHPUT_TEST_BIN=build/fastrtps/test/performance/throughtput/ThroughputTest +export THROUGHPUT_TEST_BIN=build/fastdds/test/performance/throughtput/ThroughputTest # Call python script to run tests. -python3 src/fastrtps/test/performance/throughput/throughput_tests.py +python3 src/fastdds/test/performance/throughput/throughput_tests.py ``` The python scripts offers several options: @@ -179,7 +179,7 @@ The python scripts offers several options: | - | - | | --reliability | Set the Reliability QoS of the DDS entities to reliable. Default Reliability is best-effort | | --data_loans | Enable the use of the loan sample API. Default is disable | -| --shared_memory [on/off] | Explicitly enable/disable shared memory transport. Fast-DDS default is *on* | +| --shared_memory [on/off] | Explicitly enable/disable shared memory transport. Fast DDS default is *on* | | --interprocess | Publisher and subscriber in separate processes. Default is both in the sample process and using intraprocess communications | | --security | Enable security. Default disable | | -t \ | Test time in seconds. Default is *1 second* | diff --git a/test/performance/throughput/ThroughputPublisher.cpp b/test/performance/throughput/ThroughputPublisher.cpp index 3e5a668d6cf..1395cf9747d 100644 --- a/test/performance/throughput/ThroughputPublisher.cpp +++ b/test/performance/throughput/ThroughputPublisher.cpp @@ -32,14 +32,16 @@ #include #include #include +#include +#include +#include +#include +#include #include #include -#include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; // ******************************************************************************************* // ********************************* DATA WRITER LISTENER ************************************ @@ -155,7 +157,7 @@ bool ThroughputPublisher::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -212,7 +214,7 @@ bool ThroughputPublisher::init( throughput_command_type_.reset(new ThroughputCommandDataType()); // Register the command data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR registering command type"); @@ -239,7 +241,7 @@ bool ThroughputPublisher::init( std::string profile_name = "publisher_profile"; if (xml_config_file_.length() > 0 - && ReturnCode_t::RETCODE_OK != publisher_->get_datawriter_qos_from_profile(profile_name, dw_qos_)) + && RETCODE_OK != publisher_->get_datawriter_qos_from_profile(profile_name, dw_qos_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR unable to retrieve the " << profile_name); return false; @@ -252,7 +254,7 @@ bool ThroughputPublisher::init( ReliabilityQosPolicy rp; if (reliable_) { - rp.kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; dw_qos_.reliability(rp); RTPSReliableWriterQos rw_qos; @@ -265,7 +267,7 @@ bool ThroughputPublisher::init( } else { - rp.kind = eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + rp.kind = eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS; dw_qos_.reliability(rp); } @@ -426,7 +428,7 @@ void ThroughputPublisher::run( uint32_t test_time, uint32_t recovery_time_ms, int demand, - int msg_size, + uint32_t msg_size, uint32_t subscribers) { subscribers_ = subscribers; @@ -547,26 +549,25 @@ void ThroughputPublisher::run( { assert(nullptr == dynamic_data_); // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, + "Iteration failed: Failed to create Dynamic Data"); return; } // Modify the data Sample - dynamic_data_->set_uint32_value(0, 0); - DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + (*dynamic_data_)->set_uint32_value(0, 0); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); - for (int i = 0; i < msg_size; ++i) + for (uint32_t i = 0; i < msg_size; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } else { @@ -641,7 +642,7 @@ void ThroughputPublisher::run( // Delete the Data Sample if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + dynamic_pub_sub_type_.delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -683,7 +684,7 @@ void ThroughputPublisher::run( return; } - bool all_acked = command_writer_->wait_for_acknowledgments({20, 0}) == ReturnCode_t::RETCODE_OK; + bool all_acked = command_writer_->wait_for_acknowledgments({20, 0}) == RETCODE_OK; print_results(results_); if (!all_acked) @@ -716,7 +717,7 @@ bool ThroughputPublisher::test( // If the subscriber does not acknowledge the TEST_STARTS in time, we consider something went wrong. std::chrono::steady_clock::time_point test_start_sent_tp = std::chrono::steady_clock::now(); - if (ReturnCode_t::RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) + if (RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "Something went wrong: The subscriber has not acknowledged the TEST_STARTS command."); @@ -738,14 +739,14 @@ bool ThroughputPublisher::test( { if (dynamic_types_) { - dynamic_data_->set_uint32_value(++seqnum, 0); + (*dynamic_data_)->set_uint32_value(0, ++seqnum); data_writer_->write(dynamic_data_); } else if (data_loans_) { // Try loan a sample void* data = nullptr; - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK == data_writer_->loan_sample( data, DataWriter::LoanInitializationKind::NO_LOAN_INITIALIZATION)) @@ -797,7 +798,7 @@ bool ThroughputPublisher::test( command_writer_->write(&command_sample); // If the subscriber does not acknowledge the TEST_ENDS in time, we consider something went wrong. - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != command_writer_->wait_for_acknowledgments({20, 0})) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, @@ -811,7 +812,7 @@ bool ThroughputPublisher::test( while ( !results_error && num_results_received < subscribers_ ) { if (command_reader_->wait_for_unread_message({20, 0}) - && ReturnCode_t::RETCODE_OK == command_reader_->take_next_sample(&command_sample, &info) + && RETCODE_OK == command_reader_->take_next_sample(&command_sample, &info) && info.valid_data) { if (command_sample.m_command == TEST_RESULTS) @@ -1041,18 +1042,27 @@ bool ThroughputPublisher::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(ThroughputDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); - struct_type_builder->set_name(ThroughputDataType::type_name_); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR registering the DYNAMIC DATA topic"); @@ -1082,7 +1092,7 @@ bool ThroughputPublisher::init_static_types( // Create the static type throughput_data_type_.reset(new ThroughputDataType(payload)); // Register the static type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_data_type_.register_type(participant_)) { return false; @@ -1146,7 +1156,7 @@ bool ThroughputPublisher::destroy_data_endpoints() // Delete the endpoint if (nullptr == data_writer_ - || ReturnCode_t::RETCODE_OK != publisher_->delete_datawriter(data_writer_)) + || RETCODE_OK != publisher_->delete_datawriter(data_writer_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR destroying the DataWriter"); return false; @@ -1156,7 +1166,7 @@ bool ThroughputPublisher::destroy_data_endpoints() // Delete the Topic if (nullptr == data_pub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(data_pub_topic_)) + || RETCODE_OK != participant_->delete_topic(data_pub_topic_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR destroying the DATA topic"); return false; @@ -1164,7 +1174,7 @@ bool ThroughputPublisher::destroy_data_endpoints() data_pub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(ThroughputDataType::type_name_)) { EPROSIMA_LOG_ERROR(THROUGHPUTPUBLISHER, "ERROR unregistering the DATA type"); diff --git a/test/performance/throughput/ThroughputPublisher.hpp b/test/performance/throughput/ThroughputPublisher.hpp index d9cd89f48b3..8505369a865 100644 --- a/test/performance/throughput/ThroughputPublisher.hpp +++ b/test/performance/throughput/ThroughputPublisher.hpp @@ -34,20 +34,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ThroughputTypes.hpp" +#include +#include #include "../optionarg.hpp" +#include "ThroughputTypes.hpp" class ThroughputPublisher { @@ -79,7 +70,7 @@ class ThroughputPublisher uint32_t test_time, uint32_t recovery_time_ms, int demand, - int msg_size, + uint32_t msg_size, uint32_t subscribers); private: @@ -135,7 +126,7 @@ class ThroughputPublisher ThroughputType* throughput_data_ = nullptr; eprosima::fastdds::dds::TypeSupport throughput_data_type_; // Dynamic Data - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; // QoS Profiles eprosima::fastdds::dds::DataWriterQos dw_qos_; diff --git a/test/performance/throughput/ThroughputSubscriber.cpp b/test/performance/throughput/ThroughputSubscriber.cpp index b0532bee28c..7481da82958 100644 --- a/test/performance/throughput/ThroughputSubscriber.cpp +++ b/test/performance/throughput/ThroughputSubscriber.cpp @@ -30,14 +30,16 @@ #include #include #include +#include +#include +#include +#include +#include #include #include -#include -#include using namespace eprosima::fastdds::dds; using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; // ******************************************************************************************* // ************************************ DATA SUB LISTENER ************************************ @@ -98,7 +100,7 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( SampleInfoSeq infos; LoanableSequence data_seq; - if (ReturnCode_t::RETCODE_OK != reader->take(data_seq, infos)) + if (RETCODE_OK != reader->take(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem reading Subscriber echoed loaned test data"); return; @@ -132,7 +134,7 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( last_seq_num_ = last_seq_num; // release the reader loan - if (ReturnCode_t::RETCODE_OK != reader->return_loan(data_seq, infos)) + if (RETCODE_OK != reader->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem returning loaned test data"); return; @@ -143,13 +145,20 @@ void ThroughputSubscriber::DataReaderListener::on_data_available( void* data = sub.dynamic_types_ ? (void*)sub.dynamic_data_ : (void*)sub.throughput_data_; assert(nullptr != data); - while (ReturnCode_t::RETCODE_OK == reader->take_next_sample(data, &info_)) + while (RETCODE_OK == reader->take_next_sample(data, &info_)) { if (info_.valid_data) { - uint32_t seq_num = sub.dynamic_types_ - ? sub.dynamic_data_->get_uint32_value(0) - : sub.throughput_data_->seqnum; + uint32_t seq_num {0}; + + if (sub.dynamic_types_) + { + (*sub.dynamic_data_)->get_uint32_value(seq_num, 0); + } + else + { + seq_num = sub.throughput_data_->seqnum; + } if ((last_seq_num_ + 1) < seq_num) { @@ -296,7 +305,7 @@ bool ThroughputSubscriber::init( // Load XML configuration if (xml_config_file_.length() > 0) { - if ( ReturnCode_t::RETCODE_OK != + if ( RETCODE_OK != DomainParticipantFactory::get_instance()-> get_participant_qos_from_profile( participant_profile_name, @@ -352,7 +361,7 @@ bool ThroughputSubscriber::init( throughput_command_type_.reset(new ThroughputCommandDataType()); // Register the command data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_command_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR registering command type"); @@ -379,7 +388,7 @@ bool ThroughputSubscriber::init( std::string profile_name = "subscriber_profile"; if (xml_config_file_.length() > 0 - && ReturnCode_t::RETCODE_OK != subscriber_->get_datareader_qos_from_profile(profile_name, dr_qos_)) + && RETCODE_OK != subscriber_->get_datareader_qos_from_profile(profile_name, dr_qos_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR unable to retrieve the " << profile_name); return false; @@ -390,7 +399,9 @@ bool ThroughputSubscriber::init( // Reliability ReliabilityQosPolicy rp; - rp.kind = reliable_ ? eprosima::fastrtps::RELIABLE_RELIABILITY_QOS: eprosima::fastrtps::BEST_EFFORT_RELIABILITY_QOS; + rp.kind = + reliable_ ? eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS: eprosima::fastdds::dds:: + BEST_EFFORT_RELIABILITY_QOS; dr_qos_.reliability(rp); // Set data sharing according with cli. Is disabled by default in all xml profiles @@ -523,7 +534,7 @@ int ThroughputSubscriber::process_message() if (command_reader_->wait_for_unread_message({100, 0})) { - if (ReturnCode_t::RETCODE_OK == command_reader_->take_next_sample( + if (RETCODE_OK == command_reader_->take_next_sample( (void*)&command, &info)) { @@ -546,25 +557,25 @@ int ThroughputSubscriber::process_message() assert(nullptr == dynamic_data_); // Create the data sample - MemberId id; - dynamic_data_ = static_cast(dynamic_pub_sub_type_->createData()); + dynamic_data_ = + static_cast(dynamic_pub_sub_type_->createData()); if (nullptr == dynamic_data_) { - EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "Iteration failed: Failed to create Dynamic Data"); + EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, + "Iteration failed: Failed to create Dynamic Data"); return 2; } // Modify the data Sample - DynamicData* member_data = dynamic_data_->loan_value( - dynamic_data_->get_member_id_at_index(1)); + DynamicData::_ref_type member_data = (*dynamic_data_)->loan_value( + (*dynamic_data_)->get_member_id_at_index(1)); for (uint32_t i = 0; i < command.m_size; ++i) { - member_data->insert_sequence_data(id); - member_data->set_byte_value(0, id); + member_data->set_byte_value(i, 0); } - dynamic_data_->return_loaned_value(member_data); + (*dynamic_data_)->return_loaned_value(member_data); } else { @@ -640,9 +651,9 @@ int ThroughputSubscriber::process_message() // Consume history while (data_reader_->wait_for_unread_message({0, 1000000})) { - while (ReturnCode_t::RETCODE_OK == data_reader_->take(data_seq, infos)) + while (RETCODE_OK == data_reader_->take(data_seq, infos)) { - if (ReturnCode_t::RETCODE_OK != data_reader_->return_loan(data_seq, infos)) + if (RETCODE_OK != data_reader_->return_loan(data_seq, infos)) { EPROSIMA_LOG_INFO(ThroughputTest, "Problem returning loan"); } @@ -673,7 +684,7 @@ int ThroughputSubscriber::process_message() // Remove the dynamic_data_ object, protect form ongoing callbacks if (dynamic_types_) { - DynamicDataFactory::get_instance()->delete_data(dynamic_data_); + dynamic_pub_sub_type_.delete_data(dynamic_data_); dynamic_data_ = nullptr; } else @@ -815,18 +826,27 @@ bool ThroughputSubscriber::init_dynamic_types() } // Dummy type registration + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name(ThroughputDataType::type_name_); + + DynamicTypeBuilder::_ref_type struct_type_builder {factory->create_type(type_descriptor)}; // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), BOUND_UNLIMITED)); - struct_type_builder->set_name(ThroughputDataType::type_name_); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->name("seqnum"); + member_descriptor->type(factory->get_primitive_type(TK_UINT32)); + struct_type_builder->add_member(member_descriptor); + member_descriptor->name("data"); + member_descriptor->type(factory->create_sequence_type( + factory->get_primitive_type(TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + struct_type_builder->add_member(member_descriptor); dynamic_pub_sub_type_.reset(new DynamicPubSubType(struct_type_builder->build())); // Register the data type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != dynamic_pub_sub_type_.register_type(participant_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR registering the DYNAMIC DATA topic"); @@ -856,7 +876,7 @@ bool ThroughputSubscriber::init_static_types( // Create the static type throughput_data_type_.reset(new ThroughputDataType(payload)); // Register the static type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != throughput_data_type_.register_type(participant_)) { return false; @@ -920,7 +940,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() // Delete the endpoint if (nullptr == data_reader_ - || ReturnCode_t::RETCODE_OK != subscriber_->delete_datareader(data_reader_)) + || RETCODE_OK != subscriber_->delete_datareader(data_reader_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR destroying the DataWriter"); return false; @@ -930,7 +950,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() // Delete the Topic if (nullptr == data_sub_topic_ - || ReturnCode_t::RETCODE_OK != participant_->delete_topic(data_sub_topic_)) + || RETCODE_OK != participant_->delete_topic(data_sub_topic_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR destroying the DATA topic"); return false; @@ -938,7 +958,7 @@ bool ThroughputSubscriber::destroy_data_endpoints() data_sub_topic_ = nullptr; // Delete the Type - if (ReturnCode_t::RETCODE_OK + if (RETCODE_OK != participant_->unregister_type(ThroughputDataType::type_name_)) { EPROSIMA_LOG_ERROR(THROUGHPUTSUBSCRIBER, "ERROR unregistering the DATA type"); diff --git a/test/performance/throughput/ThroughputSubscriber.hpp b/test/performance/throughput/ThroughputSubscriber.hpp index 0587873fde3..be2f6b595d6 100644 --- a/test/performance/throughput/ThroughputSubscriber.hpp +++ b/test/performance/throughput/ThroughputSubscriber.hpp @@ -32,19 +32,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include "ThroughputTypes.hpp" #include "../optionarg.hpp" +#include "ThroughputTypes.hpp" class ThroughputSubscriber { @@ -119,7 +112,7 @@ class ThroughputSubscriber ThroughputType* throughput_data_ = nullptr; eprosima::fastdds::dds::TypeSupport throughput_data_type_; // Dynamic Data - eprosima::fastrtps::types::DynamicData* dynamic_data_ = nullptr; + eprosima::fastdds::dds::DynamicData::_ref_type* dynamic_data_ {nullptr}; eprosima::fastdds::dds::TypeSupport dynamic_pub_sub_type_; // QoS Profiles eprosima::fastdds::dds::DataReaderQos dr_qos_; diff --git a/test/performance/throughput/ThroughputTypes.hpp b/test/performance/throughput/ThroughputTypes.hpp index dc5f48efc59..cf4b4b8c48c 100644 --- a/test/performance/throughput/ThroughputTypes.hpp +++ b/test/performance/throughput/ThroughputTypes.hpp @@ -20,12 +20,12 @@ #ifndef THROUGHPUTTYPES_H_ #define THROUGHPUTTYPES_H_ -#include -#include -#include - #include +#include +#include +#include + struct TroughputResults { uint32_t payload_size; @@ -113,7 +113,7 @@ typedef struct alignas(4) ThroughputType } ThroughputType; -class ThroughputDataType : public eprosima::fastrtps::TopicDataType +class ThroughputDataType : public eprosima::fastdds::dds::TopicDataType { // Buffer size for the manage type const uint32_t buffer_size_; @@ -197,7 +197,7 @@ class ThroughputDataType : public eprosima::fastrtps::TopicDataType private: - using eprosima::fastrtps::TopicDataType::is_plain; + using eprosima::fastdds::dds::TopicDataType::is_plain; }; enum e_Command : uint32_t @@ -251,7 +251,7 @@ inline std::ostream& operator <<( return output; } -class ThroughputCommandDataType : public eprosima::fastrtps::TopicDataType +class ThroughputCommandDataType : public eprosima::fastdds::dds::TopicDataType { public: diff --git a/test/performance/throughput/main_ThroughputTest.cpp b/test/performance/throughput/main_ThroughputTest.cpp index 09f299a323a..33b6dd01d1f 100644 --- a/test/performance/throughput/main_ThroughputTest.cpp +++ b/test/performance/throughput/main_ThroughputTest.cpp @@ -12,21 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ThroughputTypes.hpp" -#include "ThroughputPublisher.hpp" -#include "ThroughputSubscriber.hpp" - -#include "../optionarg.hpp" - -#include -#include -#include #include #include +#include +#include +#include +#include #include -#include -#include + +#include "../optionarg.hpp" +#include "ThroughputPublisher.hpp" +#include "ThroughputSubscriber.hpp" +#include "ThroughputTypes.hpp" #if defined(_MSC_VER) #pragma warning (push) @@ -156,7 +154,7 @@ int main( uint32_t test_time_sec = 5; uint32_t recovery_time_ms = 5; int demand = 10000; - int msg_size = 1024; + uint32_t msg_size = 1024; bool reliable = false; uint32_t seed = 80; bool hostname = false; @@ -264,7 +262,7 @@ int main( break; case MSG_SIZE: - msg_size = strtol(opt.arg, nullptr, 10); + msg_size = strtoul(opt.arg, nullptr, 10); break; case FILE_R: @@ -457,7 +455,7 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (xml_config_file.length() > 0) { - xmlparser::XMLProfileManager::loadXMLFile(xml_config_file); + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_file(xml_config_file); } uint8_t return_code = 0; diff --git a/test/performance/throughput/throughput_tests.py b/test/performance/throughput/throughput_tests.py index 57aa556116f..5c7bedbcfdb 100644 --- a/test/performance/throughput/throughput_tests.py +++ b/test/performance/throughput/throughput_tests.py @@ -24,7 +24,7 @@ parser.add_argument( '-x', '--xml_file', - help='A Fast-RTPS XML configuration file', + help='A Fast DDS XML configuration file', required=False ) parser.add_argument( @@ -66,7 +66,7 @@ '-d', '--data_sharing', choices=['on', 'off'], - help='Explicitly enable/disable data sharing. (Defaults: Fast-DDS default settings)', + help='Explicitly enable/disable data sharing. (Defaults: Fast DDS default settings)', required=False ) parser.add_argument( @@ -86,7 +86,7 @@ parser.add_argument( '--shared_memory', choices=['on', 'off'], - help='Explicitly enable/disable shared memory transport. (Defaults: Fast-DDS default settings)', + help='Explicitly enable/disable shared memory transport. (Defaults: Fast DDS default settings)', required=False ) diff --git a/test/performance/throughput/xml/throughput_interprocess_best_effort_shm_profile.xml b/test/performance/throughput/xml/throughput_interprocess_best_effort_shm_profile.xml index 938c11ba62f..c993627a446 100644 --- a/test/performance/throughput/xml/throughput_interprocess_best_effort_shm_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_best_effort_shm_profile.xml @@ -1,5 +1,5 @@ - + OFF diff --git a/test/performance/throughput/xml/throughput_interprocess_best_effort_tcp_profile.xml b/test/performance/throughput/xml/throughput_interprocess_best_effort_tcp_profile.xml index 7308c76a146..8c50c9099e2 100644 --- a/test/performance/throughput/xml/throughput_interprocess_best_effort_tcp_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_best_effort_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/xml/throughput_interprocess_best_effort_udp_profile.xml b/test/performance/throughput/xml/throughput_interprocess_best_effort_udp_profile.xml index e46c159d5d7..b19956384d9 100644 --- a/test/performance/throughput/xml/throughput_interprocess_best_effort_udp_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_best_effort_udp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/xml/throughput_interprocess_reliable_shm_profile.xml b/test/performance/throughput/xml/throughput_interprocess_reliable_shm_profile.xml index 413dffada21..81c077bd6d0 100644 --- a/test/performance/throughput/xml/throughput_interprocess_reliable_shm_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_reliable_shm_profile.xml @@ -1,5 +1,5 @@ - + OFF diff --git a/test/performance/throughput/xml/throughput_interprocess_reliable_tcp_profile.xml b/test/performance/throughput/xml/throughput_interprocess_reliable_tcp_profile.xml index 4b4dbbc5e9e..00d0c59ecdc 100644 --- a/test/performance/throughput/xml/throughput_interprocess_reliable_tcp_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_reliable_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/xml/throughput_interprocess_reliable_udp_profile.xml b/test/performance/throughput/xml/throughput_interprocess_reliable_udp_profile.xml index 64205fa54be..0709c1b2647 100644 --- a/test/performance/throughput/xml/throughput_interprocess_reliable_udp_profile.xml +++ b/test/performance/throughput/xml/throughput_interprocess_reliable_udp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/xml/throughput_intraprocess_best_effort_profile.xml b/test/performance/throughput/xml/throughput_intraprocess_best_effort_profile.xml index 34b75392443..4459532b0c7 100644 --- a/test/performance/throughput/xml/throughput_intraprocess_best_effort_profile.xml +++ b/test/performance/throughput/xml/throughput_intraprocess_best_effort_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/throughput/xml/throughput_intraprocess_reliable_profile.xml b/test/performance/throughput/xml/throughput_intraprocess_reliable_profile.xml index 1b9df41a54d..0e371fde075 100644 --- a/test/performance/throughput/xml/throughput_intraprocess_reliable_profile.xml +++ b/test/performance/throughput/xml/throughput_intraprocess_reliable_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/video/CMakeLists.txt b/test/performance/video/CMakeLists.txt index 186df42e449..b0c54506756 100644 --- a/test/performance/video/CMakeLists.txt +++ b/test/performance/video/CMakeLists.txt @@ -108,7 +108,7 @@ if(GST_FOUND) if (WIN32) target_link_libraries( VideoTest - fastrtps + fastdds fastcdr foonathan_memory fastdds::optionparser @@ -125,7 +125,7 @@ if(GST_FOUND) else() target_link_libraries( VideoTest - fastrtps + fastdds fastcdr foonathan_memory fastdds::optionparser diff --git a/test/performance/video/VideoTestPublisher.cpp b/test/performance/video/VideoTestPublisher.cpp index 7f2456e7252..0cb7f67f516 100644 --- a/test/performance/video/VideoTestPublisher.cpp +++ b/test/performance/video/VideoTestPublisher.cpp @@ -23,11 +23,9 @@ #include #include -#include #include #include -#include -#include +#include #include #define TIME_LIMIT_US 10000 @@ -211,8 +209,8 @@ void VideoTestPublisher::init( TypeSupport type_command; type_video.reset(new VideoDataType()); type_command.reset(new TestCommandDataType()); - ASSERT_EQ(mp_participant->register_type(type_video), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(mp_participant->register_type(type_command), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(mp_participant->register_type(type_video), RETCODE_OK); + ASSERT_EQ(mp_participant->register_type(type_command), RETCODE_OK); // Create Data Publisher std::string profile_name = "publisher_profile"; @@ -415,7 +413,7 @@ void VideoTestPublisher::CommandSubListener::on_data_available( TestCommandType command; eprosima::fastdds::dds::SampleInfo info; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&command, &info)) + if (RETCODE_OK == datareader->take_next_sample((void*)&command, &info)) { if (info.valid_data) { diff --git a/test/performance/video/VideoTestSubscriber.cpp b/test/performance/video/VideoTestSubscriber.cpp index 59762423270..7f68e19589e 100644 --- a/test/performance/video/VideoTestSubscriber.cpp +++ b/test/performance/video/VideoTestSubscriber.cpp @@ -18,14 +18,15 @@ */ #include "VideoTestSubscriber.hpp" +#include "VideoTestSubscriber.hpp" + #include #include #include #include +#include #include -#include -#include #include using namespace eprosima; @@ -187,8 +188,8 @@ void VideoTestSubscriber::init( TypeSupport command_type; video_type.reset(new VideoDataType()); command_type.reset(new TestCommandDataType()); - ASSERT_EQ(mp_participant->register_type(video_type), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(mp_participant->register_type(command_type), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(mp_participant->register_type(video_type), RETCODE_OK); + ASSERT_EQ(mp_participant->register_type(command_type), RETCODE_OK); // Create Data Subscriber std::string profile_name = "subscriber_profile"; @@ -366,7 +367,7 @@ void VideoTestSubscriber::CommandSubListener::on_data_available( { SampleInfo info; TestCommandType command; - if (ReturnCode_t::RETCODE_OK == datareader->take_next_sample((void*)&command, &info)) + if (RETCODE_OK == datareader->take_next_sample((void*)&command, &info)) { if (info.valid_data) { diff --git a/test/performance/video/VideoTestTypes.hpp b/test/performance/video/VideoTestTypes.hpp index 77e6f4f0fbe..e6a2446c583 100644 --- a/test/performance/video/VideoTestTypes.hpp +++ b/test/performance/video/VideoTestTypes.hpp @@ -41,8 +41,7 @@ #include #include -#include -#include +#include diff --git a/test/performance/video/main_VideoTest.cpp b/test/performance/video/main_VideoTest.cpp index b09069dee7b..cf58c754886 100644 --- a/test/performance/video/main_VideoTest.cpp +++ b/test/performance/video/main_VideoTest.cpp @@ -20,15 +20,11 @@ #include #include +#include +#include #include - #include -#include -#include -#include -#include - #include "VideoTestPublisher.hpp" #include "VideoTestSubscriber.hpp" @@ -454,7 +450,6 @@ int main( // Load an XML file with predefined profiles for publisher and subscriber if (sXMLConfigFile.length() > 0) { - // xmlparser::XMLProfileManager::loadXMLFile(sXMLConfigFile); DomainParticipantFactory::get_instance()->load_XML_profiles_file(sXMLConfigFile); } diff --git a/test/performance/video/video_tests.py b/test/performance/video/video_tests.py index 6f49bb1b825..3d650306cb6 100644 --- a/test/performance/video/video_tests.py +++ b/test/performance/video/video_tests.py @@ -46,7 +46,7 @@ def assert_positive_int(str_number, str_name): parser.add_argument( '-x', '--xml_file', - help='A Fast-RTPS XML configuration file', + help='A Fast DDS XML configuration file', required=False ) parser.add_argument( diff --git a/test/performance/video/xml/video_interprocess_best_effort_profile.xml b/test/performance/video/xml/video_interprocess_best_effort_profile.xml index 8226f0e0667..6f9bcdc17b7 100644 --- a/test/performance/video/xml/video_interprocess_best_effort_profile.xml +++ b/test/performance/video/xml/video_interprocess_best_effort_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/video/xml/video_interprocess_best_effort_tcp_profile.xml b/test/performance/video/xml/video_interprocess_best_effort_tcp_profile.xml index ec1afc9dd00..021cf3fd857 100644 --- a/test/performance/video/xml/video_interprocess_best_effort_tcp_profile.xml +++ b/test/performance/video/xml/video_interprocess_best_effort_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/video/xml/video_interprocess_reliable_profile.xml b/test/performance/video/xml/video_interprocess_reliable_profile.xml index 9abaf6b101d..f325680610a 100644 --- a/test/performance/video/xml/video_interprocess_reliable_profile.xml +++ b/test/performance/video/xml/video_interprocess_reliable_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/performance/video/xml/video_interprocess_reliable_tcp_profile.xml b/test/performance/video/xml/video_interprocess_reliable_tcp_profile.xml index bc1e06eaef7..96ea087ca0c 100644 --- a/test/performance/video/xml/video_interprocess_reliable_tcp_profile.xml +++ b/test/performance/video/xml/video_interprocess_reliable_tcp_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/profiling/CMakeLists.txt b/test/profiling/CMakeLists.txt index 71a4092718d..d97b21d043f 100644 --- a/test/profiling/CMakeLists.txt +++ b/test/profiling/CMakeLists.txt @@ -42,7 +42,7 @@ set(MEMORYTEST_SOURCE MemoryTestPublisher.cpp ) add_executable(MemoryTest ${MEMORYTEST_SOURCE}) target_include_directories(MemoryTest PRIVATE ${Asio_INCLUDE_DIR}) -target_link_libraries(MemoryTest fastrtps foonathan_memory fastdds::optionparser ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) +target_link_libraries(MemoryTest fastdds foonathan_memory fastdds::optionparser ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) configure_file("cycles_tests.py" "cycles_tests.py") configure_file("memory_tests.py" "memory_tests.py") diff --git a/test/profiling/MemoryTestPublisher.cpp b/test/profiling/MemoryTestPublisher.cpp index 91b04e6dc60..7c8fa03c446 100644 --- a/test/profiling/MemoryTestPublisher.cpp +++ b/test/profiling/MemoryTestPublisher.cpp @@ -25,9 +25,15 @@ #include #include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include #ifndef _WIN32 #define localtime_s(X, Y) localtime_r(Y, X) @@ -35,42 +41,18 @@ #define TIME_LIMIT_US 10000 -using namespace eprosima; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -using std::cout; -using std::endl; +using namespace eprosima::fastdds::dds; MemoryTestPublisher::MemoryTestPublisher() - : mp_participant(nullptr) - , mp_datapub(nullptr) - , mp_commandpub(nullptr) - , mp_commandsub(nullptr) - , n_subscribers(0) - , n_samples(0) - , disc_count_(0) - , comm_count_(0) - , data_count_(0) - , m_status(0) - , n_received(0) - , m_datapublistener(nullptr) - , m_commandpublistener(nullptr) - , m_commandsublistener(nullptr) - , m_data_size(0) - , dynamic_data(false) - , mp_memory(nullptr) { - m_datapublistener.mp_up = this; - m_commandpublistener.mp_up = this; - m_commandsublistener.mp_up = this; - m_exportPrefix = ""; + m_datapublistener.up_ = this; + m_commandpublistener.up_ = this; + m_commandsublistener.up_ = this; } MemoryTestPublisher::~MemoryTestPublisher() { - Domain::removeParticipant(mp_participant); + participant_->delete_contained_entities(); } bool MemoryTestPublisher::init( @@ -81,8 +63,8 @@ bool MemoryTestPublisher::init( bool hostname, bool export_csv, const std::string& export_prefix, - const PropertyPolicy& part_property_policy, - const PropertyPolicy& property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types) @@ -94,102 +76,127 @@ bool MemoryTestPublisher::init( m_exportPrefix = export_prefix; reliable_ = reliable; m_data_size = data_size; - dynamic_data = dynamic_types; + dynamic_data_ = dynamic_types; - if (dynamic_data) // Dummy type registration + if (dynamic_data_) // Dummy type registration { + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; + // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("MemoryType"); + DynamicTypeBuilder::_ref_type struct_type_builder(factory->create_type(type_descriptor)); // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), ::dds::core::LENGTH_UNLIMITED - )); - struct_type_builder->set_name("MemoryType"); + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->type(factory->get_primitive_type(eprosima::fastdds::dds::TK_UINT32)); + member_descriptor->name("seqnum"); + struct_type_builder->add_member(member_descriptor); + member_descriptor = traits::make_shared(); + member_descriptor->type(factory->create_sequence_type(factory->get_primitive_type(eprosima::fastdds::dds:: + TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + member_descriptor->name("data"); + struct_type_builder->add_member(member_descriptor); m_pDynType = struct_type_builder->build(); - m_DynType.SetDynamicType(m_pDynType); } // Create RTPSParticipant std::string participant_profile_name = "participant_profile"; - ParticipantAttributes PParam; - PParam.domainId = pid % 230; - PParam.rtps.properties = part_property_policy; - PParam.rtps.setName("Participant_pub"); + DomainParticipantQos participant_qos; + participant_qos.name("MemoryTest_Participant_Publisher"); + participant_qos.properties(part_property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_participant = Domain::createParticipant(participant_profile_name); + participant_ = DomainParticipantFactory::get_instance()->create_participant_with_profile(pid % 230, + participant_profile_name); } else { - mp_participant = Domain::createParticipant(PParam); + participant_ = DomainParticipantFactory::get_instance()->create_participant(pid % 230, participant_qos); } - if (mp_participant == nullptr) + if (nullptr == participant_) { return false; } // Register the type - if (dynamic_data) + if (dynamic_data_) { - Domain::registerType(mp_participant, &m_DynType); + dynamic_type_support_ = new DynamicPubSubType(m_pDynType); + data_type_ = TypeSupport{dynamic_type_support_}; } else { - Domain::registerType(mp_participant, (TopicDataType*)&memory_t); + data_type_ = TypeSupport{new MemoryDataType()}; } - Domain::registerType(mp_participant, (TopicDataType*)&command_t); + participant_->register_type(data_type_); + participant_->register_type(command_type_); - // Create Sending Publisher - std::string profile_name = "publisher_profile"; - PublisherAttributes PubDataparam; - PubDataparam.topic.topicDataType = "MemoryType"; - PubDataparam.topic.topicKind = NO_KEY; - std::ostringstream pt; - pt << "MemoryTest_"; + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + + if (nullptr == publisher_) + { + return false; + } + + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + + if (nullptr == subscriber_) + { + return false; + } + + std::ostringstream st; + st << "MemoryTest_"; if (hostname) { - pt << asio::ip::host_name() << "_"; + st << asio::ip::host_name() << "_"; } - pt << pid << "_PUB2SUB"; - PubDataparam.topic.topicName = pt.str(); + st << pid << "_PUB2SUB"; + data_topic_ = participant_->create_topic(st.str(), "MemoryType", TOPIC_QOS_DEFAULT); + + if (nullptr == data_topic_) + { + return false; + } + + // Create Sending Publisher + std::string profile_name = "publisher_profile"; + DataWriterQos writer_qos; if (!reliable) { - PubDataparam.qos.m_reliability.kind = BEST_EFFORT_RELIABILITY_QOS; + writer_qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; } - PubDataparam.properties = property_policy; + writer_qos.properties(property_policy); + if (m_data_size > 60000) { - PubDataparam.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - PubDataparam.qos.m_publishMode.kind = eprosima::fastrtps::ASYNCHRONOUS_PUBLISH_MODE; + writer_qos.endpoint().history_memory_policy = + eprosima::fastrtps::rtps::MemoryManagementPolicy::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + writer_qos.publish_mode().kind = ASYNCHRONOUS_PUBLISH_MODE; } if (m_sXMLConfigFile.length() > 0) { - mp_datapub = - Domain::createPublisher(mp_participant, profile_name, (PublisherListener*)&this->m_datapublistener); + data_writer_ = publisher_->create_datawriter_with_profile(data_topic_, profile_name, &this->m_datapublistener); } else { - mp_datapub = - Domain::createPublisher(mp_participant, PubDataparam, (PublisherListener*)&this->m_datapublistener); + data_writer_ = publisher_->create_datawriter(data_topic_, writer_qos, &this->m_datapublistener); } - if (mp_datapub == nullptr) + if (nullptr == data_writer_) { return false; } + std::cout << "Publisher created" << std::endl; //COMMAND PUBLISHER - PublisherAttributes PubCommandParam; - PubCommandParam.topic.topicDataType = "TestCommandType"; - PubCommandParam.topic.topicKind = NO_KEY; std::ostringstream pct; pct << "MemoryTest_Command_"; if (hostname) @@ -197,22 +204,26 @@ bool MemoryTestPublisher::init( pct << asio::ip::host_name() << "_"; } pct << pid << "_PUB2SUB"; - PubCommandParam.topic.topicName = pct.str(); - PubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - PubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; - PubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - PubCommandParam.qos.m_publishMode.kind = eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE; + command_pub_topic_ = participant_->create_topic(pct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); + + if (nullptr == command_pub_topic_) + { + return false; + } + + DataWriterQos command_writer_qos; + command_writer_qos.history().kind = KEEP_ALL_HISTORY_QOS; + command_writer_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - mp_commandpub = Domain::createPublisher(mp_participant, PubCommandParam, &this->m_commandpublistener); + command_writer_ = publisher_->create_datawriter(command_pub_topic_, command_writer_qos, + &this->m_commandpublistener); - if (mp_commandpub == nullptr) + if (nullptr == command_writer_) { return false; } - SubscriberAttributes SubCommandParam; - SubCommandParam.topic.topicDataType = "TestCommandType"; - SubCommandParam.topic.topicKind = NO_KEY; std::ostringstream sct; sct << "MemoryTest_Command_"; if (hostname) @@ -220,140 +231,132 @@ bool MemoryTestPublisher::init( sct << asio::ip::host_name() << "_"; } sct << pid << "_SUB2PUB"; - SubCommandParam.topic.topicName = sct.str(); - SubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - SubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - SubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_sub_topic_ = participant_->create_topic(sct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandsub = Domain::createSubscriber(mp_participant, SubCommandParam, &this->m_commandsublistener); - - if (mp_commandsub == nullptr) + if (nullptr == command_sub_topic_) { return false; } - if (dynamic_data) + DataReaderQos reader_qos; + reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; + reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_reader_ = subscriber_->create_datareader(command_sub_topic_, reader_qos, &this->m_commandsublistener); + + if (nullptr == command_reader_) { - DynamicTypeBuilderFactory::delete_instance(); - pubAttr = mp_datapub->getAttributes(); - Domain::removePublisher(mp_datapub); - Domain::unregisterType(mp_participant, "MemoryType"); // Unregister as we will register it later with correct size + return false; } return true; } -void MemoryTestPublisher::DataPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestPublisher::DataPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Data Pub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Data Pub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Data Pub Unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Pub Unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestPublisher::CommandPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Pub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Command Pub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestPublisher::CommandSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Sub Matched " << C_DEF << endl; + std::cout << C_MAGENTA << "Command Sub Matched " << C_DEF << std::endl; - n_matched++; - if (n_matched > mp_up->n_subscribers) + n_matched = info.total_count; + if (n_matched > up_->n_subscribers) { std::cout << "More matched subscribers than expected" << std::endl; - mp_up->m_status = -1; + up_->m_status = -1; } - - ++mp_up->disc_count_; } else { - cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestPublisher::CommandSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestPublisher::CommandSubListener::on_data_available( + DataReader* reader) { TestCommandType command; - SampleInfo_t info; - // cout << "COMMAND RECEIVED"<takeNextData((void*)&command, &info)) + SampleInfo info; + + if (RETCODE_OK == reader->take_next_sample((void*)&command, &info)) { - if (info.sampleKind == ALIVE) + if (ALIVE_INSTANCE_STATE == info.instance_state) { - //cout << "ALIVE "<mutex_.lock(); - ++mp_up->comm_count_; - mp_up->mutex_.unlock(); - mp_up->comm_cond_.notify_one(); + up_->mutex_.lock(); + ++up_->comm_count_; + up_->mutex_.unlock(); + up_->comm_cond_.notify_one(); } } } else { - cout << "Problem reading" << endl; + std::cout << "Problem reading" << std::endl; } } @@ -365,62 +368,37 @@ void MemoryTestPublisher::run( std::unique_lock disc_lock(mutex_); disc_cond_.wait(disc_lock, [&]() { + std::cout << "m = " << disc_count_ << " - su = " << n_subscribers << std::endl; return disc_count_ >= (n_subscribers * 3); }); disc_lock.unlock(); test(test_time, m_data_size); std::this_thread::sleep_for(std::chrono::milliseconds(100)); - - cout << "REMOVING PUBLISHER" << endl; - Domain::removePublisher(this->mp_commandpub); - cout << "REMOVING SUBSCRIBER" << endl; - Domain::removeSubscriber(mp_commandsub); } bool MemoryTestPublisher::test( uint32_t test_time, uint32_t datasize) { - //cout << "Beginning test of size: "<create_struct_builder()); - - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), datasize - )); - struct_type_builder->set_name("MemoryType"); - - m_pDynType = struct_type_builder->build(); - m_DynType.CleanDynamicType(); - m_DynType.SetDynamicType(m_pDynType); - - Domain::registerType(mp_participant, &m_DynType); - - mp_datapub = Domain::createPublisher(mp_participant, pubAttr, &m_datapublistener); - m_DynData = DynamicDataFactory::get_instance()->create_data(m_pDynType); - MemberId id; - DynamicData* my_data = m_DynData->loan_value(m_DynData->get_member_id_at_index(1)); + DynamicData::_ref_type my_data = m_DynData->loan_value(m_DynData->get_member_id_at_index(1)); for (uint32_t i = 0; i < datasize; ++i) { - my_data->insert_sequence_data(id); - my_data->set_byte_value(0, id); + my_data->set_byte_value(i, 0); } m_DynData->return_loaned_value(my_data); } else { - mp_memory = new MemoryType(datasize); + memory_ = new MemoryType(datasize); } std::chrono::duration test_time_us = std::chrono::seconds(test_time); auto t_end_ = std::chrono::steady_clock::now(); @@ -432,13 +410,12 @@ bool MemoryTestPublisher::test( return disc_count_ >= (n_subscribers * 3); }); disc_lock.unlock(); - cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << endl; + std::cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << std::endl; TestCommandType command; command.m_command = READY; - mp_commandpub->write(&command); + command_writer_->write(&command); - //cout << "WAITING FOR COMMAND RESPONSES "< lock(mutex_); comm_cond_.wait(lock, [&]() { @@ -446,7 +423,6 @@ bool MemoryTestPublisher::test( }); --comm_count_; lock.unlock(); - //cout << endl; //BEGIN THE TEST: auto t_start_ = std::chrono::steady_clock::now(); @@ -455,44 +431,39 @@ bool MemoryTestPublisher::test( { for (unsigned int count = 1; count <= n_samples; ++count) { - if (dynamic_data) + if (dynamic_data_) { - m_DynData->set_uint32_value(count, 0); - mp_datapub->write((void*)m_DynData); + m_DynData->set_uint32_value(0, count); + data_writer_->write(&m_DynData); } else { - mp_memory->seqnum = count; - mp_datapub->write((void*)mp_memory); + memory_->seqnum = count; + data_writer_->write((void*)memory_); } } t_end_ = std::chrono::steady_clock::now(); } command.m_command = STOP; - mp_commandpub->write(&command); + command_writer_->write(&command); if (m_status != 0) { - cout << "Error in test " << endl; + std::cout << "Error in test " << std::endl; return false; } //TEST FINISHED: - size_t removed = 0; - mp_datapub->removeAllChange(&removed); - //cout << " REMOVED: "<< removed<clear_history(&removed); - if (dynamic_data) + if (dynamic_data_) { - DynamicTypeBuilderFactory::delete_instance(); DynamicDataFactory::get_instance()->delete_data(m_DynData); - pubAttr = mp_datapub->getAttributes(); - Domain::removePublisher(mp_datapub); - Domain::unregisterType(mp_participant, "MemoryType"); } else { - delete(mp_memory); + delete(memory_); } return true; diff --git a/test/profiling/MemoryTestPublisher.h b/test/profiling/MemoryTestPublisher.h index 869937fd9f8..4c33ff54bb3 100644 --- a/test/profiling/MemoryTestPublisher.h +++ b/test/profiling/MemoryTestPublisher.h @@ -20,100 +20,158 @@ #ifndef MEMORYPUBLISHER_H_ #define MEMORYPUBLISHER_H_ +#include +#include + #include -#include "MemoryTestTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include +#include "MemoryTestTypes.h" -class MemoryTestPublisher { +class MemoryTestPublisher +{ public: + MemoryTestPublisher(); virtual ~MemoryTestPublisher(); - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Publisher* mp_datapub; - eprosima::fastrtps::Publisher* mp_commandpub; - eprosima::fastrtps::Subscriber* mp_commandsub; - int n_subscribers; - unsigned int n_samples; - eprosima::fastrtps::SampleInfo_t m_sampleinfo; + eprosima::fastdds::dds::DomainParticipant* participant_ {nullptr}; + eprosima::fastdds::dds::Publisher* publisher_ {nullptr}; + eprosima::fastdds::dds::Subscriber* subscriber_ {nullptr}; + eprosima::fastdds::dds::TypeSupport command_type_ {new TestCommandDataType()}; + eprosima::fastdds::dds::TypeSupport data_type_; + eprosima::fastdds::dds::Topic* command_pub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* command_sub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* data_topic_ {nullptr}; + eprosima::fastdds::dds::DataWriter* command_writer_ {nullptr}; + eprosima::fastdds::dds::DataWriter* data_writer_ {nullptr}; + eprosima::fastdds::dds::DataReader* command_reader_ {nullptr}; + int n_subscribers {0}; + unsigned int n_samples {0}; std::mutex mutex_; - int disc_count_; + int disc_count_ {0}; std::condition_variable disc_cond_; - int comm_count_; + int comm_count_ {0}; std::condition_variable comm_cond_; - int data_count_; + int data_count_ {0}; std::condition_variable data_cond_; - int m_status; - unsigned int n_received; - bool n_export_csv; + int m_status {0}; + unsigned int n_received {0}; + bool n_export_csv {false}; std::string m_exportPrefix; - bool init(int n_sub, int n_sam, bool reliable, uint32_t pid, bool hostname, bool export_csv, - const std::string& export_prefix, - const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, - const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types); - void run(uint32_t test_time); - bool test(uint32_t test_time, uint32_t datasize); - - class DataPubListener : public eprosima::fastrtps::PublisherListener + + bool init( + int n_sub, + int n_sam, + bool reliable, + uint32_t pid, + bool hostname, + bool export_csv, + const std::string& export_prefix, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, + const std::string& sXMLConfigFile, + uint32_t data_size, + bool dynamic_types); + void run( + uint32_t test_time); + bool test( + uint32_t test_time, + uint32_t datasize); + + class DataPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - DataPubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~DataPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestPublisher* mp_up; - int n_matched; - } m_datapublistener; - - class CommandPubListener : public eprosima::fastrtps::PublisherListener + + DataPubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~DataPubListener() = default; + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestPublisher* up_ {nullptr}; + + int n_matched {0}; + } + m_datapublistener {nullptr}; + + class CommandPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - CommandPubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~CommandPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestPublisher* mp_up; - int n_matched; - } m_commandpublistener; - - class CommandSubListener : public eprosima::fastrtps::SubscriberListener + + CommandPubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~CommandPubListener() + { + } + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestPublisher* up_ {nullptr}; + int n_matched {0}; + } + m_commandpublistener {nullptr}; + + class CommandSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - CommandSubListener(MemoryTestPublisher* up) :mp_up(up), n_matched(0) {} - ~CommandSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestPublisher* mp_up; - int n_matched; - } m_commandsublistener; + + CommandSubListener( + MemoryTestPublisher* up) + : up_(up) + { + } + + ~CommandSubListener() + { + } + + void on_data_available( + eprosima::fastdds::dds::DataReader* reader) override; + + void on_subscription_matched( + eprosima::fastdds::dds::DataReader* reader, + const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; + + MemoryTestPublisher* up_ {nullptr}; + int n_matched {0}; + } + m_commandsublistener {nullptr}; TestCommandDataType command_t; std::string m_sXMLConfigFile; bool reliable_; - uint32_t m_data_size; - bool dynamic_data = false; + uint32_t m_data_size {0}; + bool dynamic_data_ {false}; // Static Data - MemoryType* mp_memory; + MemoryType* memory_ {nullptr}; MemoryDataType memory_t; // Dynamic Data - eprosima::fastrtps::types::DynamicData* m_DynData; - eprosima::fastrtps::types::DynamicPubSubType m_DynType; - eprosima::fastrtps::types::DynamicType_ptr m_pDynType; - eprosima::fastrtps::PublisherAttributes pubAttr; + eprosima::fastdds::dds::DynamicData::_ref_type m_DynData; + eprosima::fastdds::dds::DynamicType::_ref_type m_pDynType; + eprosima::fastdds::dds::DynamicPubSubType* dynamic_type_support_ {nullptr}; }; diff --git a/test/profiling/MemoryTestSubscriber.cpp b/test/profiling/MemoryTestSubscriber.cpp index ac533d408f3..100d21842fd 100644 --- a/test/profiling/MemoryTestSubscriber.cpp +++ b/test/profiling/MemoryTestSubscriber.cpp @@ -21,45 +21,28 @@ #include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -using std::cout; -using std::endl; +using namespace eprosima::fastdds::dds; MemoryTestSubscriber::MemoryTestSubscriber() - : mp_participant(nullptr) - , mp_commandpub(nullptr) - , mp_datasub(nullptr) - , mp_commandsub(nullptr) - , disc_count_(0) - , comm_count_(0) - , data_count_(0) - , m_status(0) - , n_received(0) - , n_samples(0) - , m_datasublistener(nullptr) - , m_commandpublistener(nullptr) - , m_commandsublistener(nullptr) - , m_echo(true) - , dynamic_data(false) - , mp_memory(nullptr) { - m_datasublistener.mp_up = this; - m_commandpublistener.mp_up = this; - m_commandsublistener.mp_up = this; - - + m_datasublistener.up_ = this; + m_commandpublistener.up_ = this; + m_commandsublistener.up_ = this; } MemoryTestSubscriber::~MemoryTestSubscriber() { - Domain::removeParticipant(mp_participant); + participant_->delete_contained_entities(); } bool MemoryTestSubscriber::init( @@ -68,8 +51,8 @@ bool MemoryTestSubscriber::init( bool reliable, uint32_t pid, bool hostname, - const PropertyPolicy& part_property_policy, - const PropertyPolicy& property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types) @@ -78,61 +61,79 @@ bool MemoryTestSubscriber::init( m_echo = echo; n_samples = nsam; m_data_size = data_size; - dynamic_data = dynamic_types; + dynamic_data_ = dynamic_types; - if (dynamic_data) // Dummy type registration + if (dynamic_data_) // Dummy type registration { // Create basic builders - DynamicTypeBuilder_ptr struct_type_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); + DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), ::dds::core::LENGTH_UNLIMITED - )); - struct_type_builder->set_name("MemoryType"); + // Create basic builders + TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("MemoryType"); + DynamicTypeBuilder::_ref_type struct_type_builder(factory->create_type(type_descriptor)); + // Add members to the struct. + MemberDescriptor::_ref_type member_descriptor {traits::make_shared()}; + member_descriptor->type(factory->get_primitive_type(eprosima::fastdds::dds::TK_UINT32)); + member_descriptor->name("seqnum"); + struct_type_builder->add_member(member_descriptor); + member_descriptor = traits::make_shared(); + member_descriptor->type(factory->create_sequence_type(factory->get_primitive_type(eprosima::fastdds::dds:: + TK_BYTE), static_cast(LENGTH_UNLIMITED))->build()); + member_descriptor->name("data"); + struct_type_builder->add_member(member_descriptor); m_pDynType = struct_type_builder->build(); - m_DynType.SetDynamicType(m_pDynType); } // Create RTPSParticipant std::string participant_profile_name = "participant_profile"; - ParticipantAttributes PParam; - PParam.domainId = pid % 230; - PParam.rtps.setName("Participant_sub"); - PParam.rtps.properties = part_property_policy; + DomainParticipantQos participant_qos; + participant_qos.name("MemoryTest_Participant_Subscriber"); + participant_qos.properties(part_property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_participant = Domain::createParticipant(participant_profile_name); + participant_ = DomainParticipantFactory::get_instance()->create_participant_with_profile(pid % 230, + participant_profile_name); } else { - mp_participant = Domain::createParticipant(PParam); + participant_ = DomainParticipantFactory::get_instance()->create_participant(pid % 230, participant_qos); } - if (mp_participant == nullptr) + if (nullptr == participant_) { return false; } - if (dynamic_data) + if (dynamic_data_) { - Domain::registerType(mp_participant, &m_DynType); + dynamic_type_support_ = new DynamicPubSubType(m_pDynType); + data_type_ = TypeSupport{dynamic_type_support_}; } else { - Domain::registerType(mp_participant, (TopicDataType*)&memory_t); + data_type_ = TypeSupport{new MemoryDataType()}; + } + participant_->register_type(data_type_); + participant_->register_type(command_type_); + + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + + if (nullptr == publisher_) + { + return false; + } + + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + + if (nullptr == subscriber_) + { + return false; } - Domain::registerType(mp_participant, (TopicDataType*)&command_t); - // Create Data Subscriber - std::string profile_name = "subscriber_profile"; - SubscriberAttributes SubDataparam; - SubDataparam.topic.topicDataType = "MemoryType"; - SubDataparam.topic.topicKind = NO_KEY; std::ostringstream st; st << "MemoryTest_"; if (hostname) @@ -140,35 +141,37 @@ bool MemoryTestSubscriber::init( st << asio::ip::host_name() << "_"; } st << pid << "_PUB2SUB"; - SubDataparam.topic.topicName = st.str(); - if (reliable) + data_topic_ = participant_->create_topic(st.str(), "MemoryType", TOPIC_QOS_DEFAULT); + + if (nullptr == data_topic_) { - SubDataparam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + return false; } - SubDataparam.properties = property_policy; - if (m_data_size > 60000) + + // Create Data Subscriber + std::string profile_name = "subscriber_profile"; + DataReaderQos reader_qos; + if (reliable) { - SubDataparam.historyMemoryPolicy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; } + reader_qos.properties(property_policy); if (m_sXMLConfigFile.length() > 0) { - mp_datasub = Domain::createSubscriber(mp_participant, profile_name, &this->m_datasublistener); + data_reader_ = subscriber_->create_datareader_with_profile(data_topic_, profile_name, &this->m_datasublistener); } else { - mp_datasub = Domain::createSubscriber(mp_participant, SubDataparam, &this->m_datasublistener); + data_reader_ = subscriber_->create_datareader(data_topic_, reader_qos, &this->m_datasublistener); } - if (mp_datasub == nullptr) + if (nullptr == data_reader_) { return false; } //COMMAND PUBLISHER - PublisherAttributes PubCommandParam; - PubCommandParam.topic.topicDataType = "TestCommandType"; - PubCommandParam.topic.topicKind = NO_KEY; std::ostringstream pct; pct << "MemoryTest_Command_"; if (hostname) @@ -176,22 +179,25 @@ bool MemoryTestSubscriber::init( pct << asio::ip::host_name() << "_"; } pct << pid << "_SUB2PUB"; - PubCommandParam.topic.topicName = pct.str(); - PubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - PubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; - PubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - PubCommandParam.qos.m_publishMode.kind = eprosima::fastrtps::SYNCHRONOUS_PUBLISH_MODE; + command_pub_topic_ = participant_->create_topic(pct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandpub = Domain::createPublisher(mp_participant, PubCommandParam, &this->m_commandpublistener); + if (nullptr == command_pub_topic_) + { + return false; + } + + DataWriterQos writer_qos; + writer_qos.history().kind = KEEP_ALL_HISTORY_QOS; + writer_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_writer_ = publisher_->create_datawriter(command_pub_topic_, writer_qos, &this->m_commandpublistener); - if (mp_commandpub == nullptr) + if (nullptr == command_writer_) { return false; } - SubscriberAttributes SubCommandParam; - SubCommandParam.topic.topicDataType = "TestCommandType"; - SubCommandParam.topic.topicKind = NO_KEY; std::ostringstream sct; sct << "MemoryTest_Command_"; if (hostname) @@ -199,123 +205,120 @@ bool MemoryTestSubscriber::init( sct << asio::ip::host_name() << "_"; } sct << pid << "_PUB2SUB"; - SubCommandParam.topic.topicName = sct.str(); - SubCommandParam.topic.historyQos.kind = KEEP_ALL_HISTORY_QOS; - SubCommandParam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; - SubCommandParam.qos.m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_sub_topic_ = participant_->create_topic(sct.str(), "TestCommandType", TOPIC_QOS_DEFAULT); - mp_commandsub = Domain::createSubscriber(mp_participant, SubCommandParam, &this->m_commandsublistener); - - if (mp_commandsub == nullptr) + if (nullptr == command_sub_topic_) { return false; } - if (dynamic_data) + DataReaderQos command_reader_qos; + command_reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; + command_reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; + command_reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; + + command_reader_ = subscriber_->create_datareader(command_sub_topic_, command_reader_qos, + &this->m_commandsublistener); + + if (nullptr == command_reader_) { - DynamicTypeBuilderFactory::delete_instance(); - subAttr = mp_datasub->getAttributes(); - Domain::removeSubscriber(mp_datasub); - Domain::unregisterType(mp_participant, "MemoryType"); // Unregister as we will register it later with correct size + return false; } return true; } -void MemoryTestSubscriber::DataSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestSubscriber::DataSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Data Sub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Sub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Data Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Data Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandPubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void MemoryTestSubscriber::CommandPubListener::on_publication_matched( + DataWriter*, + const PublicationMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Pub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Pub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandSubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) +void MemoryTestSubscriber::CommandSubListener::on_subscription_matched( + DataReader*, + const SubscriptionMatchedStatus& info) { - std::unique_lock lock(mp_up->mutex_); + std::unique_lock lock(up_->mutex_); - if (info.status == MATCHED_MATCHING) + if (0 < info.current_count_change) { - cout << C_MAGENTA << "Command Sub Matched " << C_DEF << endl; - ++mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub Matched " << C_DEF << std::endl; } else { - cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << endl; - --mp_up->disc_count_; + std::cout << C_MAGENTA << "Command Sub unmatched " << C_DEF << std::endl; } + up_->disc_count_ += info.current_count_change; lock.unlock(); - mp_up->disc_cond_.notify_one(); + up_->disc_cond_.notify_one(); } -void MemoryTestSubscriber::CommandSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestSubscriber::CommandSubListener::on_data_available( + DataReader* reader) { TestCommandType command; - if (subscriber->takeNextData(&command, &mp_up->m_sampleinfo)) + if (RETCODE_OK == reader->take_next_sample(&command, &up_->m_sampleinfo)) { - cout << "RCOMMAND: " << command.m_command << endl; + std::cout << "RCOMMAND: " << command.m_command << std::endl; if (command.m_command == READY) { - cout << "Publisher has new test ready..." << endl; - mp_up->mutex_.lock(); - ++mp_up->comm_count_; - mp_up->mutex_.unlock(); - mp_up->comm_cond_.notify_one(); + std::cout << "Publisher has new test ready..." << std::endl; + up_->mutex_.lock(); + ++up_->comm_count_; + up_->mutex_.unlock(); + up_->comm_cond_.notify_one(); } else if (command.m_command == STOP) { - cout << "Publisher has stopped the test" << endl; - mp_up->mutex_.lock(); - ++mp_up->data_count_; - mp_up->mutex_.unlock(); - mp_up->data_cond_.notify_one(); + std::cout << "Publisher has stopped the test" << std::endl; + up_->mutex_.lock(); + ++up_->data_count_; + up_->mutex_.unlock(); + up_->data_cond_.notify_one(); } else if (command.m_command == STOP_ERROR) { - cout << "Publisher has canceled the test" << endl; - mp_up->m_status = -1; - mp_up->mutex_.lock(); - ++mp_up->data_count_; - mp_up->mutex_.unlock(); - mp_up->data_cond_.notify_one(); + std::cout << "Publisher has canceled the test" << std::endl; + up_->m_status = -1; + up_->mutex_.lock(); + ++up_->data_count_; + up_->mutex_.unlock(); + up_->data_cond_.notify_one(); } else if (command.m_command == DEFAULT) { @@ -324,26 +327,27 @@ void MemoryTestSubscriber::CommandSubListener::onNewDataMessage( } } -void MemoryTestSubscriber::DataSubListener::onNewDataMessage( - Subscriber* subscriber) +void MemoryTestSubscriber::DataSubListener::on_data_available( + DataReader* reader) { - if (mp_up->dynamic_data) + if (up_->dynamic_data_) { - subscriber->takeNextData((void*)mp_up->m_DynData, &mp_up->m_sampleinfo); - ++mp_up->n_received; - if (mp_up->m_echo) + reader->take_next_sample(&up_->m_DynData, &up_->m_sampleinfo); + ++up_->n_received; + if (up_->m_echo) { - std::cout << "Received data: " << mp_up->m_DynData->get_uint32_value(0) - << "(" << mp_up->n_received << ")" << std::endl; + uint32_t seq_num {0}; + up_->m_DynData->get_uint32_value(seq_num, 0); + std::cout << "Received data: " << seq_num << "(" << up_->n_received << ")" << std::endl; } } else { - subscriber->takeNextData((void*)mp_up->mp_memory, &mp_up->m_sampleinfo); - ++mp_up->n_received; - if (mp_up->m_echo) + reader->take_next_sample((void*)up_->memory_, &up_->m_sampleinfo); + ++up_->n_received; + if (up_->m_echo) { - std::cout << "Received data: " << mp_up->mp_memory->seqnum << "(" << mp_up->n_received << ")" << std::endl; + std::cout << "Received data: " << up_->memory_->seqnum << "(" << up_->n_received << ")" << std::endl; } } } @@ -365,37 +369,15 @@ void MemoryTestSubscriber::run() bool MemoryTestSubscriber::test( uint32_t datasize) { - cout << "Preparing test with data size: " << datasize + 4 << endl; + std::cout << "Preparing test with data size: " << datasize + 4 << std::endl; - //cout << "Ready to start data size: " << m_datasize << " and demand; "<create_struct_builder()); - - // Add members to the struct. - struct_type_builder->add_member(0, "seqnum", - DynamicTypeBuilderFactory::get_instance()->create_uint32_type()); - struct_type_builder->add_member(1, "data", - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - DynamicTypeBuilderFactory::get_instance()->create_byte_type(), datasize - )); - struct_type_builder->set_name("MemoryType"); - - m_pDynType = struct_type_builder->build(); - m_DynType.CleanDynamicType(); - m_DynType.SetDynamicType(m_pDynType); - - Domain::registerType(mp_participant, &m_DynType); - - mp_datasub = Domain::createSubscriber(mp_participant, subAttr, &m_datasublistener); - m_DynData = DynamicDataFactory::get_instance()->create_data(m_pDynType); } else { - mp_memory = new MemoryType(datasize); + memory_ = new MemoryType(datasize); } // Finally data matching @@ -406,7 +388,7 @@ bool MemoryTestSubscriber::test( }); disc_lock.unlock(); - cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << endl; + std::cout << C_B_MAGENTA << "DISCOVERY COMPLETE " << C_DEF << std::endl; std::unique_lock lock(mutex_); if (comm_count_ == 0) @@ -420,8 +402,8 @@ bool MemoryTestSubscriber::test( n_received = 0; TestCommandType command; command.m_command = BEGIN; - cout << "Testing with data size: " << datasize + 4 << endl; - mp_commandpub->write(&command); + std::cout << "Testing with data size: " << datasize + 4 << std::endl; + command_writer_->write(&command); lock.lock(); data_cond_.wait(lock, [&]() @@ -431,17 +413,15 @@ bool MemoryTestSubscriber::test( --data_count_; lock.unlock(); - cout << "TEST OF SIZE: " << datasize + 4 << " ENDS" << endl; + std::cout << "TEST OF SIZE: " << datasize + 4 << " ENDS" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(50)); - if (dynamic_data) + if (dynamic_data_) { - DynamicTypeBuilderFactory::delete_instance(); DynamicDataFactory::get_instance()->delete_data(m_DynData); - subAttr = mp_datasub->getAttributes(); } else { - delete(mp_memory); + delete(memory_); } if (m_status == -1) { diff --git a/test/profiling/MemoryTestSubscriber.h b/test/profiling/MemoryTestSubscriber.h index 5c44b202f95..98be00dd3da 100644 --- a/test/profiling/MemoryTestSubscriber.h +++ b/test/profiling/MemoryTestSubscriber.h @@ -20,93 +20,150 @@ #ifndef MEMORYTESTSUBSCRIBER_H_ #define MEMORYTESTSUBSCRIBER_H_ -#include #include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "MemoryTestTypes.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include class MemoryTestSubscriber { public: + MemoryTestSubscriber(); virtual ~MemoryTestSubscriber(); - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Publisher* mp_commandpub; - eprosima::fastrtps::Subscriber* mp_datasub; - eprosima::fastrtps::Subscriber* mp_commandsub; - eprosima::fastrtps::SampleInfo_t m_sampleinfo; + eprosima::fastdds::dds::DomainParticipant* participant_ {nullptr}; + eprosima::fastdds::dds::Publisher* publisher_ {nullptr}; + eprosima::fastdds::dds::Subscriber* subscriber_ {nullptr}; + eprosima::fastdds::dds::TypeSupport command_type_ {new TestCommandDataType()}; + eprosima::fastdds::dds::TypeSupport data_type_; + eprosima::fastdds::dds::Topic* command_pub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* command_sub_topic_ {nullptr}; + eprosima::fastdds::dds::Topic* data_topic_ {nullptr}; + eprosima::fastdds::dds::DataWriter* command_writer_ {nullptr}; + eprosima::fastdds::dds::DataReader* data_reader_ {nullptr}; + eprosima::fastdds::dds::DataReader* command_reader_ {nullptr}; + eprosima::fastdds::dds::SampleInfo m_sampleinfo; std::mutex mutex_; - int disc_count_; + int disc_count_ {0}; std::condition_variable disc_cond_; - int comm_count_; + int comm_count_ {0}; std::condition_variable comm_cond_; - int data_count_; + int data_count_ {0}; std::condition_variable data_cond_; - int m_status; - int n_received; - int n_samples; - bool init(bool echo, int nsam, bool reliable, uint32_t pid, bool hostname, - const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, - const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, - const std::string& sXMLConfigFile, uint32_t data_size, bool dynamic_types); + int m_status {0}; + int n_received {0}; + int n_samples {0}; + bool init( + bool echo, + int nsam, + bool reliable, + uint32_t pid, + bool hostname, + const eprosima::fastrtps::rtps::PropertyPolicy& part_property_policy, + const eprosima::fastrtps::rtps::PropertyPolicy& property_policy, + const std::string& sXMLConfigFile, + uint32_t data_size, + bool dynamic_types); void run(); - bool test(uint32_t datasize); + bool test( + uint32_t datasize); - class DataSubListener : public eprosima::fastrtps::SubscriberListener + class DataSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - DataSubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~DataSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestSubscriber* mp_up; - } m_datasublistener; - - class CommandPubListener : public eprosima::fastrtps::PublisherListener + + DataSubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~DataSubListener() + { + } + + void on_data_available( + eprosima::fastdds::dds::DataReader* reader) override; + + void on_subscription_matched( + eprosima::fastdds::dds::DataReader* reader, + const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_datasublistener {nullptr}; + + class CommandPubListener : public eprosima::fastdds::dds::DataWriterListener { public: - CommandPubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~CommandPubListener() {} - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, - eprosima::fastrtps::rtps::MatchingInfo& info); - MemoryTestSubscriber* mp_up; - } m_commandpublistener; - - class CommandSubListener : public eprosima::fastrtps::SubscriberListener + + CommandPubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~CommandPubListener() + { + } + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_commandpublistener {nullptr}; + + class CommandSubListener : public eprosima::fastdds::dds::DataReaderListener { public: - CommandSubListener(MemoryTestSubscriber* up) :mp_up(up) {} - ~CommandSubListener() {} - void onSubscriptionMatched(eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& into); - void onNewDataMessage(eprosima::fastrtps::Subscriber* sub); - MemoryTestSubscriber* mp_up; - } m_commandsublistener; - - bool m_echo; - TestCommandDataType command_t; + + CommandSubListener( + MemoryTestSubscriber* up) + : up_(up) + { + } + + ~CommandSubListener() + { + } + + void on_data_available( + eprosima::fastdds::dds::DataReader* reader) override; + + void on_subscription_matched( + eprosima::fastdds::dds::DataReader* reader, + const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; + + MemoryTestSubscriber* up_ {nullptr}; + } + m_commandsublistener {nullptr}; + + bool m_echo {true}; std::string m_sXMLConfigFile; - uint32_t m_data_size; - bool dynamic_data = false; + uint32_t m_data_size {0}; + bool dynamic_data_ {false}; // Static Data - MemoryType* mp_memory; - MemoryDataType memory_t; + MemoryType* memory_ {nullptr}; // Dynamic Data - eprosima::fastrtps::types::DynamicData* m_DynData; - eprosima::fastrtps::types::DynamicPubSubType m_DynType; - eprosima::fastrtps::types::DynamicType_ptr m_pDynType; - eprosima::fastrtps::SubscriberAttributes subAttr; + eprosima::fastdds::dds::DynamicData::_ref_type m_DynData; + eprosima::fastdds::dds::DynamicType::_ref_type m_pDynType; + eprosima::fastdds::dds::DynamicPubSubType* dynamic_type_support_ {nullptr}; }; #endif /* MEMORYTESTSUBSCRIBER_H_ */ diff --git a/test/profiling/MemoryTestTypes.cpp b/test/profiling/MemoryTestTypes.cpp index 8ebda73cb2a..127c9172c90 100644 --- a/test/profiling/MemoryTestTypes.cpp +++ b/test/profiling/MemoryTestTypes.cpp @@ -22,40 +22,60 @@ using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -bool MemoryDataType::serialize(void*data,SerializedPayload_t* payload) +bool MemoryDataType::serialize( + void* data, + SerializedPayload_t* payload) { MemoryType* lt = (MemoryType*)data; *(uint32_t*)payload->data = lt->seqnum; - *(uint32_t*)(payload->data+4) = (uint32_t)lt->data.size(); + *(uint32_t*)(payload->data + 4) = (uint32_t)lt->data.size(); //std::copy(lt->data.begin(),lt->data.end(),payload->data+8); memcpy(payload->data + 8, lt->data.data(), lt->data.size()); - payload->length = (uint32_t)(8+lt->data.size()); + payload->length = (uint32_t)(8 + lt->data.size()); return true; } -bool MemoryDataType::deserialize(SerializedPayload_t* payload,void * data) +bool MemoryDataType::serialize( + void* data, + SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t) +{ + return serialize(data, payload); +} + +bool MemoryDataType::deserialize( + SerializedPayload_t* payload, + void* data) { MemoryType* lt = (MemoryType*)data; lt->seqnum = *(uint32_t*)payload->data; - uint32_t siz = *(uint32_t*)(payload->data+4); - std::copy(payload->data+8,payload->data+8+siz,lt->data.begin()); + uint32_t siz = *(uint32_t*)(payload->data + 4); + std::copy(payload->data + 8, payload->data + 8 + siz, lt->data.begin()); return true; } -std::function MemoryDataType::getSerializedSizeProvider(void* data) +std::function MemoryDataType::getSerializedSizeProvider( + void* data) { return [data]() -> uint32_t - { - MemoryType *tdata = static_cast(data); - uint32_t size = 0; + { + MemoryType* tdata = static_cast(data); + uint32_t size = 0; + + size = (uint32_t)(sizeof(uint32_t) + sizeof(uint32_t) + tdata->data.size()); - size = (uint32_t)(sizeof(uint32_t) + sizeof(uint32_t) + tdata->data.size()); + return size; + }; +} - return size; - }; +std::function MemoryDataType::getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t) +{ + return getSerializedSizeProvider(data); } void* MemoryDataType::createData() @@ -63,21 +83,35 @@ void* MemoryDataType::createData() return (void*)new MemoryType(); } -void MemoryDataType::deleteData(void* data) + +void MemoryDataType::deleteData( + void* data) { delete((MemoryType*)data); } - -bool TestCommandDataType::serialize(void*data,SerializedPayload_t* payload) +bool TestCommandDataType::serialize( + void* data, + SerializedPayload_t* payload) { TestCommandType* t = (TestCommandType*)data; *(TESTCOMMAND*)payload->data = t->m_command; payload->length = 4; return true; } -bool TestCommandDataType::deserialize(SerializedPayload_t* payload,void * data) + +bool TestCommandDataType::serialize( + void* data, + SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t) +{ + return serialize(data, payload); +} + +bool TestCommandDataType::deserialize( + SerializedPayload_t* payload, + void* data) { TestCommandType* t = (TestCommandType*)data; // cout << "PAYLOAD LENGTH: "<length << endl; @@ -87,16 +121,24 @@ bool TestCommandDataType::deserialize(SerializedPayload_t* payload,void * data) return true; } -std::function TestCommandDataType::getSerializedSizeProvider(void*) +std::function TestCommandDataType::getSerializedSizeProvider( + void*) { return []() -> uint32_t - { - uint32_t size = 0; + { + uint32_t size = 0; - size = (uint32_t)sizeof(uint32_t); + size = (uint32_t)sizeof(uint32_t); - return size; - }; + return size; + }; +} + +std::function TestCommandDataType::getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t) +{ + return getSerializedSizeProvider(data); } void* TestCommandDataType::createData() @@ -104,7 +146,9 @@ void* TestCommandDataType::createData() return (void*)new TestCommandType(); } -void TestCommandDataType::deleteData(void* data) + +void TestCommandDataType::deleteData( + void* data) { delete((TestCommandType*)data); diff --git a/test/profiling/MemoryTestTypes.h b/test/profiling/MemoryTestTypes.h index 6c4155f34fa..6f6ec10fd2c 100644 --- a/test/profiling/MemoryTestTypes.h +++ b/test/profiling/MemoryTestTypes.h @@ -20,60 +20,106 @@ #ifndef MEMORYTESTTYPES_H_ #define MEMORYTESTTYPES_H_ -#include "fastrtps/fastrtps_all.h" +#include +#include +#include + +#include class MemoryType { - public: +public: + + uint32_t seqnum; + std::vector data; - uint32_t seqnum; - std::vector data; + MemoryType() + : seqnum(0) + { + } - MemoryType(): seqnum(0) {} + MemoryType( + uint32_t number) + : seqnum(0) + , data(number, 0) + { + } - MemoryType(uint32_t number) : - seqnum(0), data(number,0) {} + ~MemoryType() + { + } - ~MemoryType() {} }; -inline bool operator==(const MemoryType& lt1, const MemoryType& lt2) +inline bool operator ==( + const MemoryType& lt1, + const MemoryType& lt2) { - if(lt1.seqnum!=lt2.seqnum) + if (lt1.seqnum != lt2.seqnum) + { return false; - if(lt1.data.size()!=lt2.data.size()) + } + if (lt1.data.size() != lt2.data.size()) + { return false; - for(size_t i = 0;i getSerializedSizeProvider(void* data); - void* createData(); - void deleteData(void* data); - bool getKey(void* /*data*/, eprosima::fastrtps::rtps::InstanceHandle_t* /*ihandle*/, bool force_md5 = false) override { - (void)force_md5; - return false; - } +public: + + MemoryDataType() + { + setName("MemoryType"); + m_typeSize = 17000; + m_isGetKeyDefined = false; + } + + ~MemoryDataType() + { + } + + bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + std::function getSerializedSizeProvider( + void* data) override; + std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + void* createData(); + void deleteData( + void* data); + bool getKey( + void* /*data*/, + eprosima::fastrtps::rtps::InstanceHandle_t* /*ihandle*/, + bool force_md5 = false) override + { + (void)force_md5; + return false; + } + }; -enum TESTCOMMAND:uint32_t{ +enum TESTCOMMAND : uint32_t +{ DEFAULT, READY, BEGIN, @@ -84,31 +130,61 @@ enum TESTCOMMAND:uint32_t{ typedef struct TestCommandType { TESTCOMMAND m_command; - TestCommandType(){ + TestCommandType() + { m_command = DEFAULT; } - TestCommandType(TESTCOMMAND com):m_command(com){} + + TestCommandType( + TESTCOMMAND com) + : m_command(com) + { + } + }TestCommandType; -class TestCommandDataType : public eprosima::fastrtps::TopicDataType +class TestCommandDataType : public eprosima::fastdds::dds::TopicDataType { - public: - TestCommandDataType() - { - setName("TestCommandType"); - m_typeSize = 4; - m_isGetKeyDefined = false; - }; - ~TestCommandDataType(){}; - bool serialize(void*data,eprosima::fastrtps::rtps::SerializedPayload_t* payload); - bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t* payload,void * data); - std::function getSerializedSizeProvider(void* data); - void* createData(); - void deleteData(void* data); - bool getKey(void* /*data*/, eprosima::fastrtps::rtps::InstanceHandle_t* /*ihandle*/, bool force_md5 = false) override { - (void)force_md5; - return false; - } +public: + + TestCommandDataType() + { + setName("TestCommandType"); + m_typeSize = 4; + m_isGetKeyDefined = false; + } + + ~TestCommandDataType() + { + } + + bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override; + bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + std::function getSerializedSizeProvider( + void* data) override; + std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + void* createData(); + void deleteData( + void* data); + bool getKey( + void* /*data*/, + eprosima::fastrtps::rtps::InstanceHandle_t* /*ihandle*/, + bool force_md5 = false) override + { + (void)force_md5; + return false; + } + }; diff --git a/test/profiling/RTPSProfilingCommon.h b/test/profiling/RTPSProfilingCommon.h index 6eeeccddc81..5eb7d3f368d 100644 --- a/test/profiling/RTPSProfilingCommon.h +++ b/test/profiling/RTPSProfilingCommon.h @@ -1,11 +1,11 @@ -#ifndef _EPROSIMA_FASTRTPS_PROFILING_COMMON_ -#define _EPROSIMA_FASTRTPS_PROFILING_COMMON_ +#ifndef _EPROSIMA_FASTDDS_PROFILING_COMMON_ +#define _EPROSIMA_FASTDDS_PROFILING_COMMON_ #if defined(_WIN32) #define GET_PID _getpid #else #define GET_PID getpid -#endif +#endif // if defined(_WIN32) -#endif //_EPROSIMA_FASTRTPS_PROFILING_COMMON_ \ No newline at end of file +#endif //_EPROSIMA_FASTDDS_PROFILING_COMMON_ diff --git a/test/profiling/allocations/AllocTestCommon.cpp b/test/profiling/allocations/AllocTestCommon.cpp index be842d7d1c9..4c395124d96 100644 --- a/test/profiling/allocations/AllocTestCommon.cpp +++ b/test/profiling/allocations/AllocTestCommon.cpp @@ -23,12 +23,12 @@ #include #include #include -#include "osrf_testing_tools_cpp/memory_tools/memory_tools.hpp" + +#include using MemoryToolsService = osrf_testing_tools_cpp::memory_tools::MemoryToolsService; -namespace eprosima_profiling -{ +namespace eprosima_profiling { /** * Used to run callgrind with --zero-before=*callgrind_zero_count. @@ -57,28 +57,36 @@ static std::atomic_size_t g_phase(0u); static std::atomic g_allocationsPtr(g_allocations); static std::atomic g_deallocationsPtr(g_deallocations); -const std::regex is_fastrtps("fastrtps"); +const std::regex is_fastdds("fastdds"); -static void allocation_account(MemoryToolsService & service) +static void allocation_account( + MemoryToolsService& service) { // It makes no sense to track allocations if they don't come from our library auto stack = service.get_stack_trace(); - if (stack != nullptr && stack->matches_any_object_function(is_fastrtps)) + if (stack != nullptr && stack->matches_any_object_function(is_fastdds)) { (*g_allocationsPtr.load())++; - if (g_print_alloc_traces) service.print_backtrace(); + if (g_print_alloc_traces) + { + service.print_backtrace(); + } } service.ignore(); } -static void deallocation_account(MemoryToolsService & service) +static void deallocation_account( + MemoryToolsService& service) { // It makes no sense to track allocations if they don't come from our library auto stack = service.get_stack_trace(); - if (stack != nullptr && stack->matches_any_object_function(is_fastrtps)) + if (stack != nullptr && stack->matches_any_object_function(is_fastdds)) { (*g_deallocationsPtr.load())++; - if (g_print_dealloc_traces) service.print_backtrace(); + if (g_print_dealloc_traces) + { + service.print_backtrace(); + } } service.ignore(); } @@ -163,11 +171,11 @@ void print_results( const std::string& entity, const std::string& config) { - if(!g_print_results) + if (!g_print_results) { return; } - + std::string output_filename = file_prefix; if (file_prefix.length() == 0) { @@ -185,10 +193,10 @@ void print_results( if (pos == 0) { output_stream << "\"Discovery allocations\", \"Discovery deallocations\"," - << " \"First sample allocations\", \"First sample deallocations\"," - << " \"Data exchange allocations\", \"Data exchange deallocations\"," - << " \"Undiscovery allocations\", \"Undiscovery deallocations\"" - << std::endl; + << " \"First sample allocations\", \"First sample deallocations\"," + << " \"Data exchange allocations\", \"Data exchange deallocations\"," + << " \"Undiscovery allocations\", \"Undiscovery deallocations\"" + << std::endl; } for (size_t i = 0; i < 4; i++) diff --git a/test/profiling/allocations/AllocTestCommon.h b/test/profiling/allocations/AllocTestCommon.h index 0f321bae02c..85ff2a74557 100644 --- a/test/profiling/allocations/AllocTestCommon.h +++ b/test/profiling/allocations/AllocTestCommon.h @@ -17,13 +17,12 @@ * */ -#ifndef FASTRTPS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ -#define FASTRTPS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ +#ifndef FASTDDS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ +#define FASTDDS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ #include -namespace eprosima_profiling -{ +namespace eprosima_profiling { /** * Used to run callgrind with --zero-before=callgrind_zero_count. @@ -77,4 +76,4 @@ void print_results( } // namespace eprosima_profiling -#endif // FASTRTPS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ +#endif // FASTDDS_TEST_PROFILING_ALLOCATIONS_ALLOCTESTCOMMON_H_ diff --git a/test/profiling/allocations/AllocTestPublisher.cpp b/test/profiling/allocations/AllocTestPublisher.cpp index 21658794645..0bc00fc4340 100644 --- a/test/profiling/allocations/AllocTestPublisher.cpp +++ b/test/profiling/allocations/AllocTestPublisher.cpp @@ -17,129 +17,152 @@ * */ -#include "AllocTestPublisher.h" +#include "AllocTestPublisher.hpp" #include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "AllocTestCommon.h" +#include "AllocTestTypePubSubTypes.h" -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::dds; + +#define CHECK_RETURN_CODE(ret) \ + if (ReturnCode_t::RETCODE_OK != ret) \ + { \ + return false; \ + } + +#define CHECK_ENTITY_CREATION(entity) \ + if (nullptr != entity) \ + { \ + return false; \ + } AllocTestPublisher::AllocTestPublisher() - : mp_participant(nullptr) - , mp_publisher(nullptr) + : type_(new AllocTestTypePubSubType()) + , participant_(nullptr) + , topic_(nullptr) + , publisher_(nullptr) + , writer_(nullptr) + , profile_("") + , output_file_("") + , matched_(0) { +} - +AllocTestPublisher::~AllocTestPublisher() +{ + if (participant_ != nullptr) + { + participant_->delete_contained_entities(); + DomainParticipantFactory::get_shared_instance()->delete_participant(participant_); + participant_ = nullptr; + } } bool AllocTestPublisher::init( const char* profile, - int domainId, - const std::string& outputFile) + uint32_t domain_id, + const std::string& output_file) { - m_data.index(0); + data_.index(0); - m_profile = profile; - m_outputFile = outputFile; - Domain::loadXMLProfilesFile("test_xml_profile.xml"); + profile_ = profile; + output_file_ = output_file; - ParticipantAttributes participant_att; - if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK == - eprosima::fastrtps::xmlparser::XMLProfileManager::fillParticipantAttributes("test_participant_profile", - participant_att)) - { - participant_att.domainId = domainId; - mp_participant = Domain::createParticipant(participant_att); - } + ReturnCode_t ret = ReturnCode_t::RETCODE_OK; - if (mp_participant == nullptr) - { - return false; - } + std::shared_ptr factory = DomainParticipantFactory::get_shared_instance(); + ret = factory->load_XML_profiles_file("test_xml_profile.xml"); + CHECK_RETURN_CODE(ret); - //REGISTER THE TYPE - Domain::registerType(mp_participant, &m_type); + DomainParticipantQos pqos; + ret = factory->get_participant_qos_from_profile("test_participant_profile", pqos); + CHECK_RETURN_CODE(ret); - //CREATE THE PUBLISHER - std::string prof("test_publisher_profile_"); - prof.append(profile); - mp_publisher = Domain::createPublisher(mp_participant, prof, (PublisherListener*)&m_listener); - if (mp_publisher == nullptr) - { - return false; - } + participant_ = factory->create_participant(domain_id, pqos); + CHECK_ENTITY_CREATION(participant_); - bool show_allocation_traces = std::getenv("FASTDDS_PROFILING_PRINT_TRACES") != nullptr; - eprosima_profiling::entities_created(show_allocation_traces); - return true; + ret = type_.register_type(participant_); + CHECK_RETURN_CODE(ret); -} + topic_ = participant_->create_topic("AllocTestTopic", type_.get_type_name(), TOPIC_QOS_DEFAULT); + CHECK_ENTITY_CREATION(topic_); -AllocTestPublisher::~AllocTestPublisher() -{ - Domain::removeParticipant(mp_participant); + publisher_ = participant_->create_publisher(PUBLISHER_QOS_DEFAULT); + CHECK_ENTITY_CREATION(publisher_); + + std::string prof = "test_publisher_profile_" + profile_; + writer_ = publisher_->create_datawriter_with_profile(topic_, prof, this); + CHECK_ENTITY_CREATION(writer_); + + bool show_allocation_traces = std::getenv("FASTDDS_PROFILING_PRINT_TRACES") != nullptr; + eprosima_profiling::entities_created(show_allocation_traces); + return ret == ReturnCode_t::RETCODE_OK; } -void AllocTestPublisher::PubListener::onPublicationMatched( - Publisher* /*pub*/, - MatchingInfo& info) +void AllocTestPublisher::on_publication_matched( + DataWriter* /*writer*/, + const PublicationMatchedStatus& status) { - std::unique_lock lock(mtx); - if (info.status == MATCHED_MATCHING) + if (status.current_count_change == 1) { - n_matched++; + matched_++; std::cout << "Publisher matched" << std::endl; } - else + else if (status.current_count_change == -1) { - n_matched--; + matched_--; std::cout << "Publisher unmatched" << std::endl; } - cv.notify_all(); + else + { + std::cout << status.current_count_change + << " is not a valid value for PublicationMatchedStatus current count change" << std::endl; + } + cv_.notify_all(); } -bool AllocTestPublisher::PubListener::is_matched() +bool AllocTestPublisher::is_matched() { - std::unique_lock lock(mtx); - return n_matched > 0; + return matched_ > 0; } -void AllocTestPublisher::PubListener::wait_match() +void AllocTestPublisher::wait_match() { - std::unique_lock lock(mtx); - cv.wait(lock, [this]() + std::unique_lock lck(mtx_); + cv_.wait(lck, [this]() { - return n_matched > 0; + return matched_ > 0; }); } -void AllocTestPublisher::PubListener::wait_unmatch() +void AllocTestPublisher::wait_unmatch() { - std::unique_lock lock(mtx); - cv.wait(lock, [this]() + std::unique_lock lck(mtx_); + cv_.wait(lck, [this]() { - return n_matched <= 0; + return matched_ <= 0; }); } void AllocTestPublisher::run( uint32_t samples, - bool wait_unmatch) + bool wait_unmatching) { // Restart callgrind graph eprosima_profiling::callgrind_zero_count(); std::cout << "Publisher waiting for subscriber..." << std::endl; - m_listener.wait_match(); + wait_match(); // Flush callgrind graph eprosima_profiling::callgrind_dump(); @@ -156,7 +179,7 @@ void AllocTestPublisher::run( } else { - std::cout << "Message with index: " << m_data.index() << " SENT" << std::endl; + std::cout << "Message with index: " << data_.index() << " SENT" << std::endl; } std::this_thread::sleep_for(std::chrono::milliseconds(500)); @@ -175,10 +198,10 @@ void AllocTestPublisher::run( eprosima_profiling::callgrind_dump(); eprosima_profiling::all_samples_exchanged(); - if (wait_unmatch) + if (wait_unmatching) { std::cout << "All messages have been sent. Waiting for subscriber to stop." << std::endl; - m_listener.wait_unmatch(); + wait_unmatch(); } else { @@ -189,16 +212,16 @@ void AllocTestPublisher::run( // Flush callgrind graph eprosima_profiling::callgrind_dump(); eprosima_profiling::undiscovery_finished(); - eprosima_profiling::print_results(m_outputFile, "publisher", m_profile); + eprosima_profiling::print_results(output_file_, "publisher", profile_); } bool AllocTestPublisher::publish() { - if (m_listener.is_matched()) + bool ret = false; + if (is_matched()) { - m_data.index(m_data.index() + 1); - mp_publisher->write((void*)&m_data); - return true; + data_.index(data_.index() + 1); + ret = writer_->write(&data_); } - return false; + return ret; } diff --git a/test/profiling/allocations/AllocTestPublisher.h b/test/profiling/allocations/AllocTestPublisher.h deleted file mode 100644 index 577c19f0ba5..00000000000 --- a/test/profiling/allocations/AllocTestPublisher.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file AllocTestPublisher.h - * - */ - -#ifndef ALLOCTESTPUBLISHER_H_ -#define ALLOCTESTPUBLISHER_H_ - -#include "AllocTestTypePubSubTypes.h" - -#include -#include -#include -#include -#include -#include -#include "AllocTestType.h" - -class AllocTestPublisher { -public: - AllocTestPublisher(); - virtual ~AllocTestPublisher(); - //!Initialize - bool init(const char* profile, int domainId, const std::string& outputFile); - //!Publish a sample - bool publish(); - //!Run for number samples - void run(uint32_t number, bool wait_unmatch = false); -private: - AllocTestTypePubSubType m_type; - AllocTestType m_data; - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Publisher* mp_publisher; - std::string m_profile; - std::string m_outputFile; - class PubListener:public eprosima::fastrtps::PublisherListener - { - public: - PubListener():n_matched(0){}; - ~PubListener(){}; - void onPublicationMatched(eprosima::fastrtps::Publisher* pub, eprosima::fastrtps::rtps::MatchingInfo& info); - - bool is_matched(); - void wait_match(); - void wait_unmatch(); - - private: - int n_matched; - std::mutex mtx; - std::condition_variable cv; - }m_listener; -}; - - - -#endif /* ALLOCTESTPUBLISHER_H_ */ diff --git a/test/profiling/allocations/AllocTestPublisher.hpp b/test/profiling/allocations/AllocTestPublisher.hpp new file mode 100644 index 00000000000..14d17dfd08e --- /dev/null +++ b/test/profiling/allocations/AllocTestPublisher.hpp @@ -0,0 +1,99 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file AllocTestPublisher.h + * + */ + +#ifndef _FASTDDS_ALLOCTESTPUBLISHER_H_ +#define _FASTDDS_ALLOCTESTPUBLISHER_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "AllocTestType.h" + +class AllocTestPublisher : public eprosima::fastdds::dds::DataWriterListener +{ +public: + + AllocTestPublisher(); + + virtual ~AllocTestPublisher(); + + //! Initialize + bool init( + const char* profile, + uint32_t domain_id, + const std::string& output_file); + + //! Publish a sample + bool publish(); + + //! Run for number samples + void run( + uint32_t number, + bool wait_unmatching); + + void on_publication_matched( + eprosima::fastdds::dds::DataWriter* writer, + const eprosima::fastdds::dds::PublicationMatchedStatus& status) override; + +private: + + bool is_matched(); + + void wait_match(); + + void wait_unmatch(); + + eprosima::fastdds::dds::TypeSupport type_; + + AllocTestType data_; + + eprosima::fastdds::dds::DomainParticipant* participant_; + + eprosima::fastdds::dds::Topic* topic_; + + eprosima::fastdds::dds::Publisher* publisher_; + + eprosima::fastdds::dds::DataWriter* writer_; + + std::string profile_; + + std::string output_file_; + + std::atomic matched_; + + mutable std::mutex mtx_; + + std::condition_variable cv_; + +}; + + + +#endif /* _FASTDDS_ALLOCTESTPUBLISHER_H_ */ diff --git a/test/profiling/allocations/AllocTestSubscriber.cpp b/test/profiling/allocations/AllocTestSubscriber.cpp index f535dab9dc6..9e9887e87e9 100644 --- a/test/profiling/allocations/AllocTestSubscriber.cpp +++ b/test/profiling/allocations/AllocTestSubscriber.cpp @@ -17,134 +17,166 @@ * */ -#include "AllocTestSubscriber.h" - +#include "AllocTestSubscriber.hpp" + +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "AllocTestCommon.h" +#include "AllocTestTypePubSubTypes.h" + +using namespace eprosima::fastdds::dds; + +#define CHECK_RETURN_CODE(ret) \ + if (ReturnCode_t::RETCODE_OK != ret) \ + { \ + return false; \ + } -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; +#define CHECK_ENTITY_CREATION(entity) \ + if (nullptr != entity) \ + { \ + return false; \ + } AllocTestSubscriber::AllocTestSubscriber() - : mp_participant(nullptr) - , mp_subscriber(nullptr) + : type_(new AllocTestTypePubSubType()) + , participant_(nullptr) + , topic_(nullptr) + , subscriber_(nullptr) + , reader_(nullptr) + , profile_("") + , output_file_("") + , matched_(0) + , samples_(0) { } -bool AllocTestSubscriber::init( - const char* profile, - int domainId, - const std::string& outputFile) +AllocTestSubscriber::~AllocTestSubscriber() { - m_profile = profile; - m_outputFile = outputFile; - Domain::loadXMLProfilesFile("test_xml_profile.xml"); - - ParticipantAttributes participant_att; - if (eprosima::fastrtps::xmlparser::XMLP_ret::XML_OK == - eprosima::fastrtps::xmlparser::XMLProfileManager::fillParticipantAttributes("test_participant_profile", - participant_att)) + if (participant_ != nullptr) { - participant_att.domainId = domainId; - mp_participant = Domain::createParticipant(participant_att); + participant_->delete_contained_entities(); + DomainParticipantFactory::get_shared_instance()->delete_participant(participant_); + participant_ = nullptr; } +} - if (mp_participant == nullptr) - { - return false; - } +bool AllocTestSubscriber::init( + const char* profile, + uint32_t domain_id, + const std::string& output_file) +{ + profile_ = profile; + output_file_ = output_file; - //REGISTER THE TYPE - Domain::registerType(mp_participant, &m_type); + ReturnCode_t ret = ReturnCode_t::RETCODE_OK; - //CREATE THE SUBSCRIBER - std::string prof("test_subscriber_profile_"); - prof.append(profile); - mp_subscriber = Domain::createSubscriber(mp_participant, prof, &m_listener); + std::shared_ptr factory = DomainParticipantFactory::get_shared_instance(); + ret = factory->load_XML_profiles_file("test_xml_profile.xml"); + CHECK_RETURN_CODE(ret); - if (mp_subscriber == nullptr) - { - return false; - } + DomainParticipantQos pqos; + ret = factory->get_participant_qos_from_profile("test_participant_profile", pqos); + CHECK_RETURN_CODE(ret); + + participant_ = factory->create_participant(domain_id, pqos); + CHECK_ENTITY_CREATION(participant_); + + ret = type_.register_type(participant_); + CHECK_RETURN_CODE(ret); + + topic_ = participant_->create_topic("AllocTestTopic", type_.get_type_name(), TOPIC_QOS_DEFAULT); + CHECK_ENTITY_CREATION(topic_); + + subscriber_ = participant_->create_subscriber(SUBSCRIBER_QOS_DEFAULT); + CHECK_ENTITY_CREATION(subscriber_); + + std::string prof = "test_subscriber_profile_" + profile_; + reader_ = subscriber_->create_datareader_with_profile(topic_, prof, this); + CHECK_ENTITY_CREATION(reader_); bool show_allocation_traces = std::getenv("FASTDDS_PROFILING_PRINT_TRACES") != nullptr; eprosima_profiling::entities_created(show_allocation_traces); - return true; + return ret == ReturnCode_t::RETCODE_OK; } -AllocTestSubscriber::~AllocTestSubscriber() +void AllocTestSubscriber::on_subscription_matched( + DataReader* /*reader*/, + const SubscriptionMatchedStatus& status) { - Domain::removeParticipant(mp_participant); -} - -void AllocTestSubscriber::SubListener::onSubscriptionMatched( - Subscriber* /*sub*/, - MatchingInfo& info) -{ - std::unique_lock lock(mtx); - if (info.status == MATCHED_MATCHING) + if (status.current_count_change == 1) { - n_matched++; + matched_++; std::cout << "Subscriber matched" << std::endl; } - else + else if (status.current_count_change == -1) { - n_matched--; + matched_--; std::cout << "Subscriber unmatched" << std::endl; } - cv.notify_all(); + else + { + std::cout << status.current_count_change + << " is not a valid value for SubscriptionMatchedStatus current count change" << std::endl; + } + cv_.notify_all(); } -void AllocTestSubscriber::SubListener::onNewDataMessage( - Subscriber* sub) +void AllocTestSubscriber::on_data_available( + DataReader* reader) { - if (sub->takeNextData((void*)&m_Hello, &m_info)) + SampleInfo info; + if (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&data_, &info)) { - if (m_info.sampleKind == ALIVE) + if ((info.instance_state == ALIVE_INSTANCE_STATE) && (info.valid_data) && + (reader->is_sample_valid(&data_, &info))) { - std::unique_lock lock(mtx); - this->n_samples++; - // Print your structure data here. - std::cout << "Message " << m_Hello.index() << " RECEIVED" << std::endl; - cv.notify_all(); + samples_++; + std::cout << "Message " << data_.index() << " RECEIVED" << std::endl; + cv_.notify_all(); } } - } -void AllocTestSubscriber::SubListener::wait_match() +void AllocTestSubscriber::wait_match() { - std::unique_lock lock(mtx); - cv.wait(lock, [this]() + std::unique_lock lck(mtx_); + cv_.wait(lck, [this]() { - return n_matched > 0; + return matched_ > 0; }); } -void AllocTestSubscriber::SubListener::wait_unmatch() +void AllocTestSubscriber::wait_unmatch() { - std::unique_lock lock(mtx); - cv.wait(lock, [this]() + std::unique_lock lck(mtx_); + cv_.wait(lck, [this]() { - return n_matched <= 0; + return matched_ <= 0; }); } -void AllocTestSubscriber::SubListener::wait_until_total_received_at_least( +void AllocTestSubscriber::wait_until_total_received_at_least( uint32_t n) { - std::unique_lock lock(mtx); - cv.wait(lock, [this, n]() + std::unique_lock lock(mtx_); + cv_.wait(lock, [this, n]() { - return n_samples >= n; + return samples_ >= n; }); } @@ -156,36 +188,36 @@ void AllocTestSubscriber::run( void AllocTestSubscriber::run( uint32_t number, - bool wait_unmatch) + bool wait_unmatching) { // Restart callgrind graph eprosima_profiling::callgrind_zero_count(); std::cout << "Subscriber waiting for publisher..." << std::endl; - m_listener.wait_match(); + wait_match(); // Flush callgrind graph eprosima_profiling::callgrind_dump(); eprosima_profiling::discovery_finished(); std::cout << "Subscriber matched. Waiting for first sample..." << std::endl; - m_listener.wait_until_total_received_at_least(1ul); + wait_until_total_received_at_least(1ul); // Flush callgrind graph eprosima_profiling::callgrind_dump(); eprosima_profiling::first_sample_exchanged(); std::cout << "First sample received. Waiting for rest of samples..." << std::endl; - m_listener.wait_until_total_received_at_least(number); + wait_until_total_received_at_least(number); // Flush callgrind graph eprosima_profiling::callgrind_dump(); eprosima_profiling::all_samples_exchanged(); - if (wait_unmatch) + if (wait_unmatching) { std::cout << "All messages received. Waiting for publisher to stop." << std::endl; - m_listener.wait_unmatch(); + wait_unmatch(); } else { @@ -196,5 +228,5 @@ void AllocTestSubscriber::run( // Flush callgrind graph eprosima_profiling::callgrind_dump(); eprosima_profiling::undiscovery_finished(); - eprosima_profiling::print_results(m_outputFile, "subscriber", m_profile); + eprosima_profiling::print_results(output_file_, "subscriber", profile_); } diff --git a/test/profiling/allocations/AllocTestSubscriber.h b/test/profiling/allocations/AllocTestSubscriber.h deleted file mode 100644 index 64a53fa82c7..00000000000 --- a/test/profiling/allocations/AllocTestSubscriber.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file AllocTestSubscriber.h - * - */ - -#ifndef ALLOCTESTSUBSCRIBER_H_ -#define ALLOCTESTSUBSCRIBER_H_ - -#include "AllocTestTypePubSubTypes.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include "AllocTestType.h" - -class AllocTestSubscriber -{ -public: - - AllocTestSubscriber(); - virtual ~AllocTestSubscriber(); - //!Initialize the subscriber - bool init( - const char* profile, - int domainId, - const std::string& outputFile); - //!RUN the subscriber - void run( - bool wait_unmatch = false); - //!Run the subscriber until number samples have been received. - void run( - uint32_t number, - bool wait_unmatch = false); - -private: - - eprosima::fastrtps::Participant* mp_participant; - eprosima::fastrtps::Subscriber* mp_subscriber; - std::string m_profile; - std::string m_outputFile; - -public: - - class SubListener : public eprosima::fastrtps::SubscriberListener - { - public: - - SubListener() - : n_matched(0) - , n_samples(0) - { - } - - ~SubListener() - { - } - - void onSubscriptionMatched( - eprosima::fastrtps::Subscriber* sub, - eprosima::fastrtps::rtps::MatchingInfo& info); - void onNewDataMessage( - eprosima::fastrtps::Subscriber* sub); - - void wait_match(); - void wait_unmatch(); - void wait_until_total_received_at_least( - uint32_t n); - - private: - - AllocTestType m_Hello; - eprosima::fastrtps::SampleInfo_t m_info; - int n_matched; - uint32_t n_samples; - std::mutex mtx; - std::condition_variable cv; - } - m_listener; - -private: - - AllocTestTypePubSubType m_type; -}; - -#endif /* ALLOCTESTSUBSCRIBER_H_ */ diff --git a/test/profiling/allocations/AllocTestSubscriber.hpp b/test/profiling/allocations/AllocTestSubscriber.hpp new file mode 100644 index 00000000000..6473235d630 --- /dev/null +++ b/test/profiling/allocations/AllocTestSubscriber.hpp @@ -0,0 +1,103 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file AllocTestSubscriber.h + * + */ + +#ifndef _FASTDDS_ALLOCTESTSUBSCRIBER_H_ +#define _FASTDDS_ALLOCTESTSUBSCRIBER_H_ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "AllocTestType.h" + +class AllocTestSubscriber : public eprosima::fastdds::dds::DataReaderListener +{ +public: + + AllocTestSubscriber(); + + virtual ~AllocTestSubscriber(); + + //! Initialize the subscriber + bool init( + const char* profile, + uint32_t domain_id, + const std::string& output_file); + + //! RUN the subscriber + void run( + bool wait_unmatch); + + void run( + uint32_t number, + bool wait_unmatching); + + void on_subscription_matched( + eprosima::fastdds::dds::DataReader* reader, + const eprosima::fastdds::dds::SubscriptionMatchedStatus& status) override; + + void on_data_available( + eprosima::fastdds::dds::DataReader* reader) override; + +private: + + void wait_match(); + + void wait_unmatch(); + + void wait_until_total_received_at_least( + uint32_t n); + + eprosima::fastdds::dds::TypeSupport type_; + + AllocTestType data_; + + eprosima::fastdds::dds::DomainParticipant* participant_; + + eprosima::fastdds::dds::Topic* topic_; + + eprosima::fastdds::dds::Subscriber* subscriber_; + + eprosima::fastdds::dds::DataReader* reader_; + + std::string profile_; + + std::string output_file_; + + std::atomic matched_; + + std::atomic samples_; + + mutable std::mutex mtx_; + + std::condition_variable cv_; + +}; + +#endif /* _FASTDDS_ALLOCTESTSUBSCRIBER_H_ */ diff --git a/test/profiling/allocations/AllocTestType.cxx b/test/profiling/allocations/AllocTestType.cxx deleted file mode 100644 index 58cc317296f..00000000000 --- a/test/profiling/allocations/AllocTestType.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AllocTestType.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AllocTestType.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -AllocTestType::AllocTestType() -{ -} - -AllocTestType::~AllocTestType() -{ -} - -AllocTestType::AllocTestType( - const AllocTestType& x) -{ - m_index = x.m_index; -} - -AllocTestType::AllocTestType( - AllocTestType&& x) noexcept -{ - m_index = x.m_index; -} - -AllocTestType& AllocTestType::operator =( - const AllocTestType& x) -{ - - m_index = x.m_index; - return *this; -} - -AllocTestType& AllocTestType::operator =( - AllocTestType&& x) noexcept -{ - - m_index = x.m_index; - return *this; -} - -bool AllocTestType::operator ==( - const AllocTestType& x) const -{ - return (m_index == x.m_index); -} - -bool AllocTestType::operator !=( - const AllocTestType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AllocTestType::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AllocTestType::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AllocTestType::index() -{ - return m_index; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "AllocTestTypeCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/profiling/allocations/AllocTestType.h b/test/profiling/allocations/AllocTestType.h deleted file mode 100644 index e823f9360d1..00000000000 --- a/test/profiling/allocations/AllocTestType.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AllocTestType.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "AllocTestTypev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ -#define _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ALLOCTESTTYPE_SOURCE) -#define ALLOCTESTTYPE_DllAPI __declspec( dllexport ) -#else -#define ALLOCTESTTYPE_DllAPI __declspec( dllimport ) -#endif // ALLOCTESTTYPE_SOURCE -#else -#define ALLOCTESTTYPE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ALLOCTESTTYPE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure AllocTestType defined by the user in the IDL file. - * @ingroup AllocTestType - */ -class AllocTestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AllocTestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AllocTestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType( - const AllocTestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType( - AllocTestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType& operator =( - const AllocTestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType& operator =( - AllocTestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AllocTestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AllocTestType& x) const; - - /*! - * @brief Comparison operator. - * @param x AllocTestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AllocTestType& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - -private: - - uint32_t m_index{0}; - -}; - -#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/profiling/allocations/AllocTestType.hpp b/test/profiling/allocations/AllocTestType.hpp new file mode 100644 index 00000000000..46894facdf9 --- /dev/null +++ b/test/profiling/allocations/AllocTestType.hpp @@ -0,0 +1,178 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AllocTestType.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_HPP_ +#define _FAST_DDS_GENERATED_ALLOCTESTTYPE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ALLOCTESTTYPE_SOURCE) +#define ALLOCTESTTYPE_DllAPI __declspec( dllexport ) +#else +#define ALLOCTESTTYPE_DllAPI __declspec( dllimport ) +#endif // ALLOCTESTTYPE_SOURCE +#else +#define ALLOCTESTTYPE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ALLOCTESTTYPE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure AllocTestType defined by the user in the IDL file. + * @ingroup AllocTestType + */ +class AllocTestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AllocTestType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AllocTestType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType( + const AllocTestType& x) + { + m_index = x.m_index; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType( + AllocTestType&& x) noexcept + { + m_index = x.m_index; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType& operator =( + const AllocTestType& x) + { + + m_index = x.m_index; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType& operator =( + AllocTestType&& x) noexcept + { + + m_index = x.m_index; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AllocTestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AllocTestType& x) const + { + return (m_index == x.m_index); + } + + /*! + * @brief Comparison operator. + * @param x AllocTestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AllocTestType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + +private: + + uint32_t m_index{0}; + +}; + +#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_HPP_ + + diff --git a/test/profiling/allocations/AllocTestTypeCdrAux.hpp b/test/profiling/allocations/AllocTestTypeCdrAux.hpp index 9c9494f96d2..aac0de264cf 100644 --- a/test/profiling/allocations/AllocTestTypeCdrAux.hpp +++ b/test/profiling/allocations/AllocTestTypeCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_HPP_ #define _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_HPP_ -#include "AllocTestType.h" +#include "AllocTestType.hpp" constexpr uint32_t AllocTestType_max_cdr_typesize {8UL}; constexpr uint32_t AllocTestType_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AllocTestType& data); diff --git a/test/profiling/allocations/AllocTestTypeCdrAux.ipp b/test/profiling/allocations/AllocTestTypeCdrAux.ipp index 42e4029739a..81f40a1acdd 100644 --- a/test/profiling/allocations/AllocTestTypeCdrAux.ipp +++ b/test/profiling/allocations/AllocTestTypeCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/profiling/allocations/AllocTestTypePubSubTypes.cxx b/test/profiling/allocations/AllocTestTypePubSubTypes.cxx index 3aa18060dc2..1006b39cad8 100644 --- a/test/profiling/allocations/AllocTestTypePubSubTypes.cxx +++ b/test/profiling/allocations/AllocTestTypePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "AllocTestTypePubSubTypes.h" +#include #include -#include "AllocTestTypePubSubTypes.h" #include "AllocTestTypeCdrAux.hpp" +#include "AllocTestTypeTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - AllocTestTypePubSubType::AllocTestTypePubSubType() { setName("AllocTestType"); @@ -219,3 +219,11 @@ bool AllocTestTypePubSubType::getKey( return true; } +void AllocTestTypePubSubType::register_type_object_representation() const +{ + register_AllocTestType_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "AllocTestTypeCdrAux.ipp" diff --git a/test/profiling/allocations/AllocTestTypePubSubTypes.h b/test/profiling/allocations/AllocTestTypePubSubTypes.h index 80298136ea2..8ac424c490c 100644 --- a/test/profiling/allocations/AllocTestTypePubSubTypes.h +++ b/test/profiling/allocations/AllocTestTypePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "AllocTestType.h" +#include "AllocTestType.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type AllocTestType defined by the user in the IDL file. * @ingroup AllocTestType @@ -90,6 +88,9 @@ class AllocTestTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/profiling/allocations/AllocTestTypeTypeObjectSupport.cxx b/test/profiling/allocations/AllocTestTypeTypeObjectSupport.cxx new file mode 100644 index 00000000000..8c9aada1b31 --- /dev/null +++ b/test/profiling/allocations/AllocTestTypeTypeObjectSupport.cxx @@ -0,0 +1,147 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AllocTestTypeTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "AllocTestTypeTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AllocTestType.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_AllocTestType_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_AllocTestType_type_identifier(); + + }); +} + +void register_AllocTestType_type_identifier() +{ + { + StructTypeFlag struct_flags_AllocTestType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_AllocTestType; + TypeIdentifierPair type_ids_AllocTestType; + QualifiedTypeName type_name_AllocTestType = "AllocTestType"; + eprosima::fastcdr::optional type_ann_builtin_AllocTestType; + eprosima::fastcdr::optional ann_custom_AllocTestType; + CompleteTypeDetail detail_AllocTestType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AllocTestType, ann_custom_AllocTestType, type_name_AllocTestType.to_string()); + CompleteStructHeader header_AllocTestType; + header_AllocTestType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AllocTestType); + CompleteStructMemberSeq member_seq_AllocTestType; + { + return_code_AllocTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_AllocTestType); + + if (return_code_AllocTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_AllocTestType.type_identifier1()._d() || TK_NONE == type_ids_AllocTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AllocTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AllocTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AllocTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AllocTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AllocTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AllocTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AllocTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AllocTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AllocTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AllocTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AllocTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AllocTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AllocTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AllocTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AllocTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AllocTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AllocTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AllocTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AllocTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AllocTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AllocTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_AllocTestType.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_AllocTestType); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_AllocTestType, member_index); + } + CompleteStructType struct_type_AllocTestType = TypeObjectUtils::build_complete_struct_type(struct_flags_AllocTestType, header_AllocTestType, member_seq_AllocTestType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_AllocTestType, type_name_AllocTestType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AllocTestType already registered in TypeObjectRegistry for a different type."); + } + return_code_AllocTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "AllocTestType", type_ids_AllocTestType); + if (return_code_AllocTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AllocTestType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/profiling/allocations/AllocTestTypeTypeObjectSupport.hpp b/test/profiling/allocations/AllocTestTypeTypeObjectSupport.hpp new file mode 100644 index 00000000000..eb7db4ed676 --- /dev/null +++ b/test/profiling/allocations/AllocTestTypeTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file AllocTestTypeTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_ALLOCTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_AllocTestType_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register AllocTestType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_AllocTestType_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/profiling/allocations/AllocTestTypev1.cxx b/test/profiling/allocations/AllocTestTypev1.cxx deleted file mode 100644 index 5d4e51b63a9..00000000000 --- a/test/profiling/allocations/AllocTestTypev1.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AllocTestType.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AllocTestType.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define AllocTestType_max_cdr_typesize 8ULL; - - - - -AllocTestType::AllocTestType() -{ - // unsigned long m_index - m_index = 0; - -} - -AllocTestType::~AllocTestType() -{ -} - -AllocTestType::AllocTestType( - const AllocTestType& x) -{ - m_index = x.m_index; - -} - -AllocTestType::AllocTestType( - AllocTestType&& x) noexcept -{ - m_index = x.m_index; - -} - -AllocTestType& AllocTestType::operator =( - const AllocTestType& x) -{ - m_index = x.m_index; - - return *this; -} - -AllocTestType& AllocTestType::operator =( - AllocTestType&& x) noexcept -{ - m_index = x.m_index; - - return *this; -} - -bool AllocTestType::operator ==( - const AllocTestType& x) const -{ - return (m_index == x.m_index); -} - -bool AllocTestType::operator !=( - const AllocTestType& x) const -{ - return !(*this == x); -} - -size_t AllocTestType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return AllocTestType_max_cdr_typesize; -} - -size_t AllocTestType::getCdrSerializedSize( - const AllocTestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void AllocTestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - -} - -void AllocTestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - -} - - -bool AllocTestType::isKeyDefined() -{ - return false; -} - -void AllocTestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AllocTestType::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AllocTestType::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AllocTestType::index() -{ - return m_index; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/profiling/allocations/AllocTestTypev1.h b/test/profiling/allocations/AllocTestTypev1.h deleted file mode 100644 index 0195e31a222..00000000000 --- a/test/profiling/allocations/AllocTestTypev1.h +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file AllocTestType.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ -#define _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ALLOCTESTTYPE_SOURCE) -#define ALLOCTESTTYPE_DllAPI __declspec( dllexport ) -#else -#define ALLOCTESTTYPE_DllAPI __declspec( dllimport ) -#endif // ALLOCTESTTYPE_SOURCE -#else -#define ALLOCTESTTYPE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ALLOCTESTTYPE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure AllocTestType defined by the user in the IDL file. - * @ingroup AllocTestType - */ -class AllocTestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AllocTestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AllocTestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType( - const AllocTestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType( - AllocTestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType& operator =( - const AllocTestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AllocTestType that will be copied. - */ - eProsima_user_DllExport AllocTestType& operator =( - AllocTestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AllocTestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AllocTestType& x) const; - - /*! - * @brief Comparison operator. - * @param x AllocTestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AllocTestType& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const AllocTestType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - -}; - - -#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/profiling/allocations/AllocTest_main.cpp b/test/profiling/allocations/AllocTest_main.cpp index c014f69c616..933317510d2 100644 --- a/test/profiling/allocations/AllocTest_main.cpp +++ b/test/profiling/allocations/AllocTest_main.cpp @@ -17,30 +17,35 @@ * */ -#include "AllocTestPublisher.h" -#include "AllocTestSubscriber.h" - -#include #include +#include "AllocTestPublisher.hpp" +#include "AllocTestSubscriber.hpp" + using namespace eprosima; using namespace fastrtps; using namespace rtps; -int main(int argc, char** argv) +int main( + int argc, + char** argv) { - std::cout << "Starting "<< std::endl; + std::cout << "Starting " << std::endl; int type = 1; int domain = 1; bool wait_unmatch = false; const char* profile = "tl_be"; std::string outputFile = ""; - if(argc > 2) + if (argc > 2) { - if(strcmp(argv[1],"publisher")==0) + if (strcmp(argv[1], "publisher") == 0) + { type = 1; - else if(strcmp(argv[1],"subscriber")==0) + } + else if (strcmp(argv[1], "subscriber") == 0) + { type = 2; + } profile = argv[2]; @@ -57,7 +62,7 @@ int main(int argc, char** argv) } else { - std::cout + std::cout << "Syntax is AllocationTestExample , where:" << std::endl << " kind:" << std::endl << " publisher OR subscriber" << std::endl @@ -71,29 +76,28 @@ int main(int argc, char** argv) } - switch(type) + switch (type) { case 1: + { + AllocTestPublisher mypub; + if (mypub.init(profile, domain, outputFile)) { - AllocTestPublisher mypub; - if(mypub.init(profile, domain, outputFile)) - { - mypub.run(60, wait_unmatch); - } - break; + mypub.run(60, wait_unmatch); } + break; + } case 2: + { + AllocTestSubscriber mysub; + if (mysub.init(profile, domain, outputFile)) { - AllocTestSubscriber mysub; - if(mysub.init(profile, domain, outputFile)) - { - mysub.run(wait_unmatch); - } - break; + mysub.run(wait_unmatch); } + break; + } } - Domain::stopAll(); eprosima::fastdds::dds::Log::Reset(); return 0; diff --git a/test/profiling/allocations/CMakeLists.txt b/test/profiling/allocations/CMakeLists.txt index 8d67649d86f..b422176e11b 100644 --- a/test/profiling/allocations/CMakeLists.txt +++ b/test/profiling/allocations/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.20) -project(fastrtps_allocation_test VERSION 1 LANGUAGES CXX) +project(fastdds_allocation_test VERSION 1 LANGUAGES CXX) # Default to C++11 if(NOT CMAKE_CXX_STANDARD) @@ -25,7 +25,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic -Werror) endif() -# Find requirements +# Find requirements (Version 1.4 is required, but their CMake does not set the version correctly) find_package(osrf_testing_tools_cpp) if (osrf_testing_tools_cpp_FOUND) @@ -44,7 +44,7 @@ if (osrf_testing_tools_cpp_FOUND) ) add_executable(AllocationTest ${ALLOCTEST_EXAMPLE_SOURCES_CXX} ${ALLOCTEST_EXAMPLE_SOURCES_CPP}) - target_link_libraries(AllocationTest fastrtps fastcdr foonathan_memory osrf_testing_tools_cpp::memory_tools) + target_link_libraries(AllocationTest fastdds fastcdr foonathan_memory osrf_testing_tools_cpp::memory_tools) install(TARGETS AllocationTest RUNTIME DESTINATION test/profiling/allocations/${BIN_INSTALL_DIR}) else(osrf_testing_tools_cpp_FOUND) diff --git a/test/profiling/allocations/test_xml_profile.xml b/test/profiling/allocations/test_xml_profile.xml index 37cf7a98755..7a4c935c265 100644 --- a/test/profiling/allocations/test_xml_profile.xml +++ b/test/profiling/allocations/test_xml_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/system/tools/xmlvalidation/all_profile.xml b/test/system/tools/xmlvalidation/all_profile.xml index eb99327767f..ba9694c7fac 100644 --- a/test/system/tools/xmlvalidation/all_profile.xml +++ b/test/system/tools/xmlvalidation/all_profile.xml @@ -1,5 +1,5 @@ - + 1 @@ -293,10 +293,6 @@ 55 - - true - true - diff --git a/test/system/tools/xmlvalidation/dataReader_profile.xml b/test/system/tools/xmlvalidation/dataReader_profile.xml index c2c8ed17a84..4cbfb3dd8dc 100644 --- a/test/system/tools/xmlvalidation/dataReader_profile.xml +++ b/test/system/tools/xmlvalidation/dataReader_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/system/tools/xmlvalidation/dataWriter_profile.xml b/test/system/tools/xmlvalidation/dataWriter_profile.xml index 718dff28343..b568bc3cc77 100644 --- a/test/system/tools/xmlvalidation/dataWriter_profile.xml +++ b/test/system/tools/xmlvalidation/dataWriter_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/system/tools/xmlvalidation/domainParticipant_profile.xml b/test/system/tools/xmlvalidation/domainParticipant_profile.xml index 592fafb6143..54cca85719c 100644 --- a/test/system/tools/xmlvalidation/domainParticipant_profile.xml +++ b/test/system/tools/xmlvalidation/domainParticipant_profile.xml @@ -1,5 +1,5 @@ - + 11 @@ -292,10 +292,6 @@ 55 - - true - true - diff --git a/test/system/tools/xmlvalidation/librarySettings_profile.xml b/test/system/tools/xmlvalidation/librarySettings_profile.xml index bf2ba8075b6..fb4c8f8d92a 100644 --- a/test/system/tools/xmlvalidation/librarySettings_profile.xml +++ b/test/system/tools/xmlvalidation/librarySettings_profile.xml @@ -1,4 +1,4 @@ - + OFF diff --git a/test/system/tools/xmlvalidation/log_profile.xml b/test/system/tools/xmlvalidation/log_profile.xml index 58a2946c0ef..266a7ebd049 100644 --- a/test/system/tools/xmlvalidation/log_profile.xml +++ b/test/system/tools/xmlvalidation/log_profile.xml @@ -1,5 +1,5 @@ - + false diff --git a/test/system/tools/xmlvalidation/topic_profile.xml b/test/system/tools/xmlvalidation/topic_profile.xml index 07281bdb35f..6ffe6a728f1 100644 --- a/test/system/tools/xmlvalidation/topic_profile.xml +++ b/test/system/tools/xmlvalidation/topic_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/system/tools/xmlvalidation/transportDescriptor_profile.xml b/test/system/tools/xmlvalidation/transportDescriptor_profile.xml index ade6ced192d..b63924ed044 100644 --- a/test/system/tools/xmlvalidation/transportDescriptor_profile.xml +++ b/test/system/tools/xmlvalidation/transportDescriptor_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/system/tools/xmlvalidation/types_profile.xml b/test/system/tools/xmlvalidation/types_profile.xml index 71efc643154..a69160f7bf3 100644 --- a/test/system/tools/xmlvalidation/types_profile.xml +++ b/test/system/tools/xmlvalidation/types_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index 2eca626d922..f0a45665abe 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -12,38 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_compile_definitions(FASTRTPS_NO_LIB) +add_compile_definitions(FASTDDS_NO_LIB) -add_subdirectory(rtps/attributes) -add_subdirectory(rtps/common) -add_subdirectory(rtps/DataSharing) -add_subdirectory(rtps/builtin) -add_subdirectory(rtps/reader) -add_subdirectory(rtps/writer) -add_subdirectory(rtps/history) -add_subdirectory(rtps/resources/timedevent) -add_subdirectory(rtps/network) -if(NOT QNX) - add_subdirectory(rtps/flowcontrol) -endif() -add_subdirectory(rtps/persistence) -add_subdirectory(rtps/discovery) +add_subdirectory(cmake) add_subdirectory(dds/collections) add_subdirectory(dds/core) add_subdirectory(dds/participant) add_subdirectory(dds/publisher) +add_subdirectory(dds/status) add_subdirectory(dds/subscriber) add_subdirectory(dds/topic) add_subdirectory(dds/topic/DDSSQLFilter) -add_subdirectory(dds/status) -add_subdirectory(dynamic_types) -add_subdirectory(transport) +add_subdirectory(dds/xtypes/type_representation) add_subdirectory(logging) +add_subdirectory(rtps/attributes) +add_subdirectory(rtps/builtin) +add_subdirectory(rtps/common) +add_subdirectory(rtps/DataSharing) +add_subdirectory(rtps/discovery) +add_subdirectory(rtps/domain) +if(NOT QNX) + add_subdirectory(rtps/flowcontrol) +endif() +add_subdirectory(rtps/history) +add_subdirectory(rtps/network) +add_subdirectory(rtps/persistence) +add_subdirectory(rtps/reader) +add_subdirectory(rtps/resources/timedevent) +add_subdirectory(rtps/writer) +add_subdirectory(statistics/dds) +add_subdirectory(transport) add_subdirectory(utils) add_subdirectory(xmlparser) -add_subdirectory(xtypes) -add_subdirectory(statistics/dds) -add_subdirectory(cmake) if(SECURITY) add_subdirectory(security/authentication) diff --git a/test/unittest/cmake/CMakeLists.txt b/test/unittest/cmake/CMakeLists.txt index b86c7e8b30b..dddfc476798 100644 --- a/test/unittest/cmake/CMakeLists.txt +++ b/test/unittest/cmake/CMakeLists.txt @@ -16,8 +16,8 @@ # CMake modules tests ############################################################################### -set(build_dir "${fastrtps_BINARY_DIR}/test/force_cxx") -set(module_dir "${fastrtps_SOURCE_DIR}/cmake/common") +set(build_dir "${fastdds_BINARY_DIR}/test/force_cxx") +set(module_dir "${fastdds_SOURCE_DIR}/cmake/common") set(script "${CMAKE_CURRENT_LIST_DIR}/force_cxx/build.cmake") # The C++ sources use fold expressions which were introduced in C++17 diff --git a/test/unittest/common/GTestPrinters.hpp b/test/unittest/common/GTestPrinters.hpp deleted file mode 100644 index 48298803e00..00000000000 --- a/test/unittest/common/GTestPrinters.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file GTestPrinters.hpp - * - */ - -#ifndef GTESTPRINTERS_HPP -#define GTESTPRINTERS_HPP - -#include - -/** - * Workaround for GCC to behave properly and let Google Test know what to do with null_types - * when printing an ASSERT/EXPECT result. Documentation can be found here: - * https://github.com/google/googletest/blob/main/googletest/include/gtest/gtest-printers.h - * - */ -namespace dds { -namespace core { -void PrintTo( - const null_type, - std::ostream* os) -{ - *os << "::dds::core::null_type"; -} - -} // namespace core -} // namespace dds - -#endif // GTESTPRINTERS_HPP diff --git a/test/unittest/dds/collections/CMakeLists.txt b/test/unittest/dds/collections/CMakeLists.txt index 42ba3a0b352..e8f3a9a5617 100644 --- a/test/unittest/dds/collections/CMakeLists.txt +++ b/test/unittest/dds/collections/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(LOANABLE_SEQUENCE_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -44,5 +40,9 @@ target_include_directories(LoanableSequenceTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LoanableSequenceTests GTest::gtest) +target_link_libraries(LoanableSequenceTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(LoanableSequenceTests) diff --git a/test/unittest/dds/core/condition/CMakeLists.txt b/test/unittest/dds/core/condition/CMakeLists.txt index daff3d2a155..6e314e36e2a 100644 --- a/test/unittest/dds/core/condition/CMakeLists.txt +++ b/test/unittest/dds/core/condition/CMakeLists.txt @@ -13,10 +13,6 @@ # limitations under the License. set(LOG_SOURCES - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ) @@ -57,7 +53,11 @@ target_include_directories(ConditionTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ConditionTests GTest::gtest) +target_link_libraries(ConditionTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(ConditionTests) ### ConditionNotifier ### @@ -91,7 +91,12 @@ target_include_directories(ConditionNotifierTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ConditionNotifierTests GTest::gtest GTest::gmock) +target_link_libraries(ConditionNotifierTests + fastcdr + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(ConditionNotifierTests) ### StatusConditionImpl ### @@ -126,7 +131,12 @@ target_include_directories(StatusConditionImplTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(StatusConditionImplTests GTest::gtest GTest::gmock) +target_link_libraries(StatusConditionImplTests + fastcdr + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(StatusConditionImplTests) ### WaitSetImpl ### @@ -160,5 +170,10 @@ target_include_directories(WaitSetImplTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WaitSetImplTests GTest::gtest GTest::gmock) +target_link_libraries(WaitSetImplTests + fastcdr + fastdds::log + GTest::gtest + GTest::gmock + ) gtest_discover_tests(WaitSetImplTests) diff --git a/test/unittest/dds/core/condition/ConditionTests.cpp b/test/unittest/dds/core/condition/ConditionTests.cpp index 61bae7efaad..bd2f9f66e48 100644 --- a/test/unittest/dds/core/condition/ConditionTests.cpp +++ b/test/unittest/dds/core/condition/ConditionTests.cpp @@ -22,14 +22,12 @@ #include #include #include +#include #include #include -#include #include "../../../logging/mock/MockConsumer.h" -using eprosima::fastrtps::types::ReturnCode_t; - using namespace eprosima::fastdds::dds; using namespace std; @@ -98,7 +96,7 @@ TEST_F(ConditionTests, waitset_condition_management) WaitSet wait_set; // WaitSet should be created without conditions - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // This scope allows checking the wait_set behavior when the condition is destroyed @@ -106,36 +104,36 @@ TEST_F(ConditionTests, waitset_condition_management) GuardCondition condition; // Trying to detach without having attached - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); // Adding the same condition several times should always succeed and keep the list with a single condition for (int i = 0; i < 2; ++i) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // Detaching the condition once should succeed - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Detaching a second time should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Attach the condition again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // After the condition is destroyed, the wait_set should be empty - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); } @@ -147,33 +145,33 @@ TEST_F(ConditionTests, waitset_wait) const eprosima::fastrtps::Duration_t timeout{ 1, 0 }; // Waiting on empty wait set should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Attach condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); // Waiting on untriggered condition should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Waiting on already triggered condition should inmediately return condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(true)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); // Adding a non-triggered condition while waiting should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(false)); { GuardCondition non_triggered_condition; std::thread thr_add_non_triggered([&]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(non_triggered_condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(non_triggered_condition)); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); thr_add_non_triggered.join(); } @@ -183,27 +181,27 @@ TEST_F(ConditionTests, waitset_wait) std::thread thr_set_trigger([&]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(true)); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); thr_set_trigger.join(); } // Two threads are not allowed to wait at the same time - EXPECT_EQ(ReturnCode_t::RETCODE_OK, condition.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, condition.set_trigger_value(false)); { std::thread thr_second_wait([&wait_set, &timeout]() { std::this_thread::sleep_for(std::chrono::milliseconds(200)); ConditionSeq conds; - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); EXPECT_TRUE(conds.empty()); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); thr_second_wait.join(); } @@ -211,7 +209,7 @@ TEST_F(ConditionTests, waitset_wait) // Waiting forever and adding a triggered condition should wake and only return the added condition { GuardCondition triggered_condition; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, triggered_condition.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, triggered_condition.set_trigger_value(true)); std::thread thr_add_triggered([&]() { @@ -219,7 +217,7 @@ TEST_F(ConditionTests, waitset_wait) wait_set.attach_condition(triggered_condition); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); @@ -232,9 +230,9 @@ TEST_F(ConditionTests, guard_condition_methods) GuardCondition cond; EXPECT_FALSE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_trigger_value(true)); + EXPECT_EQ(RETCODE_OK, cond.set_trigger_value(true)); EXPECT_TRUE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_trigger_value(false)); + EXPECT_EQ(RETCODE_OK, cond.set_trigger_value(false)); EXPECT_FALSE(cond.get_trigger_value()); } @@ -252,11 +250,11 @@ TEST_F(ConditionTests, status_condition_methods) // According to the DDS standard, StatusCondition should start with all statuses enabled EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_single)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_single)); EXPECT_EQ(mask_single.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_none)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_none)); EXPECT_EQ(mask_none.to_string(), cond.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(mask_all)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(mask_all)); EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); } @@ -275,7 +273,7 @@ TEST_F(ConditionTests, status_condition_trigger) auto wait_for_trigger = [&]() { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(&cond, conditions[0]); EXPECT_TRUE(cond.get_trigger_value()); @@ -284,13 +282,13 @@ TEST_F(ConditionTests, status_condition_trigger) auto expect_no_trigger = [&]() { EXPECT_FALSE(cond.get_trigger_value()); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); }; ASSERT_NE(nullptr, cond.get_impl()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(cond)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(cond)); // Condition should be untriggered upon creation EXPECT_EQ(mask_all.to_string(), cond.get_enabled_statuses().to_string()); @@ -305,7 +303,7 @@ TEST_F(ConditionTests, status_condition_trigger) } // Setting mask to one_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); expect_no_trigger(); @@ -344,7 +342,7 @@ TEST_F(ConditionTests, status_condition_trigger) // Setting mask to other_mask should trigger { std::thread wait_thr(wait_for_trigger); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), cond.get_enabled_statuses().to_string()); wait_thr.join(); } @@ -354,7 +352,7 @@ TEST_F(ConditionTests, status_condition_trigger) wait_for_trigger(); // Setting mask to one_mask should not affect trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); wait_for_trigger(); @@ -363,12 +361,12 @@ TEST_F(ConditionTests, status_condition_trigger) wait_for_trigger(); // Setting mask to other_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), cond.get_enabled_statuses().to_string()); expect_no_trigger(); // Setting mask to one_mask should trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, cond.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, cond.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), cond.get_enabled_statuses().to_string()); EXPECT_TRUE(cond.get_trigger_value()); wait_for_trigger(); diff --git a/test/unittest/dds/core/condition/StatusConditionImplTests.cpp b/test/unittest/dds/core/condition/StatusConditionImplTests.cpp index 90b42f2d149..aa67696ec97 100644 --- a/test/unittest/dds/core/condition/StatusConditionImplTests.cpp +++ b/test/unittest/dds/core/condition/StatusConditionImplTests.cpp @@ -39,11 +39,11 @@ TEST(StatusConditionImplTests, enabled_status_management) // According to the DDS standard, StatusCondition should start with all statuses enabled EXPECT_EQ(mask_all.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_single)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_single)); EXPECT_EQ(mask_single.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_none)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_none)); EXPECT_EQ(mask_none.to_string(), uut.get_enabled_statuses().to_string()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(mask_all)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(mask_all)); EXPECT_EQ(mask_all.to_string(), uut.get_enabled_statuses().to_string()); } @@ -71,7 +71,7 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to one_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_FALSE(uut.get_trigger_value()); @@ -113,7 +113,7 @@ TEST(StatusConditionImplTests, notify_trigger) // Setting mask to other_mask should trigger auto& call3 = EXPECT_CALL(notifier, notify()).Times(1).After(call2); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), uut.get_enabled_statuses().to_string()); // Triggering one_mask should not affect trigger @@ -122,7 +122,7 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to one_mask should not affect trigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_TRUE(uut.get_trigger_value()); @@ -132,13 +132,13 @@ TEST(StatusConditionImplTests, notify_trigger) EXPECT_TRUE(uut.get_trigger_value()); // Setting mask to other_mask should untrigger - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(other_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(other_mask)); EXPECT_EQ(other_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_FALSE(uut.get_trigger_value()); // Setting mask to one_mask should trigger EXPECT_CALL(notifier, notify()).Times(1).After(call3); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, uut.set_enabled_statuses(one_mask)); + EXPECT_EQ(RETCODE_OK, uut.set_enabled_statuses(one_mask)); EXPECT_EQ(one_mask.to_string(), uut.get_enabled_statuses().to_string()); EXPECT_TRUE(uut.get_trigger_value()); } diff --git a/test/unittest/dds/core/condition/WaitSetImplTests.cpp b/test/unittest/dds/core/condition/WaitSetImplTests.cpp index 798a6355103..a9e23ddcf66 100644 --- a/test/unittest/dds/core/condition/WaitSetImplTests.cpp +++ b/test/unittest/dds/core/condition/WaitSetImplTests.cpp @@ -58,40 +58,40 @@ TEST(WaitSetImplTests, condition_management) EXPECT_CALL(*notifier, will_be_deleted(_)).Times(1); // WaitSetImpl should be created without conditions - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Trying to detach without having attached - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); // Adding the same condition several times should always succeed and keep the list with a single condition for (int i = 0; i < 2; ++i) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); } // Detaching the condition once should succeed - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Detaching a second time should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.detach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); // Attach the condition again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); // Calling will_be_deleted should detach the condition wait_set.will_be_deleted(condition); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.get_conditions(conditions)); + EXPECT_EQ(RETCODE_OK, wait_set.get_conditions(conditions)); EXPECT_TRUE(conditions.empty()); } @@ -111,19 +111,19 @@ TEST(WaitSetImplTests, wait) EXPECT_CALL(*notifier, will_be_deleted(_)).Times(1); // Waiting on empty wait set should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Attach condition - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.attach_condition(condition)); + EXPECT_EQ(RETCODE_OK, wait_set.attach_condition(condition)); // Waiting on untriggered condition should timeout - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); // Waiting on already triggered condition should inmediately return condition condition.trigger_value = true; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); @@ -135,7 +135,7 @@ TEST(WaitSetImplTests, wait) std::this_thread::sleep_for(std::chrono::milliseconds(200)); wait_set.wake_up(); }); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); notify_without_trigger.join(); } @@ -148,7 +148,7 @@ TEST(WaitSetImplTests, wait) condition.trigger_value = true; wait_set.wake_up(); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, timeout)); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); trigger_and_notify.join(); @@ -160,12 +160,12 @@ TEST(WaitSetImplTests, wait) { std::this_thread::sleep_for(std::chrono::milliseconds(200)); ConditionSeq conds; - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, wait_set.wait(conds, timeout)); EXPECT_TRUE(conds.empty()); }); condition.trigger_value = false; - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); + EXPECT_EQ(RETCODE_TIMEOUT, wait_set.wait(conditions, timeout)); EXPECT_TRUE(conditions.empty()); second_wait_thread.join(); } @@ -186,7 +186,7 @@ TEST(WaitSetImplTests, wait) wait_set.attach_condition(triggered_condition); }); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); + EXPECT_EQ(RETCODE_OK, wait_set.wait(conditions, eprosima::fastrtps::c_TimeInfinite)); EXPECT_EQ(1u, conditions.size()); EXPECT_EQ(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &condition)); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); @@ -237,7 +237,7 @@ TEST(WaitSetImplTests, fix_wait_notification_lost) std::promise promise; std::future future = promise.get_future(); - ReturnCode_t ret = ReturnCode_t::RETCODE_ERROR; + ReturnCode_t ret = RETCODE_ERROR; std::thread wait_conditions([&]() { // Not to use `WaitSetImpl::wait` with a timeout value, because the @@ -253,7 +253,7 @@ TEST(WaitSetImplTests, fix_wait_notification_lost) // Expecting get notification after wake_up, otherwise output error within 5 seconds. future.wait_for(std::chrono::seconds(5)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret); + EXPECT_EQ(RETCODE_OK, ret); EXPECT_EQ(1u, conditions.size()); EXPECT_NE(conditions.cend(), std::find(conditions.cbegin(), conditions.cend(), &triggered_condition)); diff --git a/test/unittest/dds/core/entity/CMakeLists.txt b/test/unittest/dds/core/entity/CMakeLists.txt index f3b201f7f99..6d3142e6d37 100644 --- a/test/unittest/dds/core/entity/CMakeLists.txt +++ b/test/unittest/dds/core/entity/CMakeLists.txt @@ -17,17 +17,12 @@ if(WIN32) endif() set(ENTITY_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusConditionImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/WaitSetImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/Entity.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -61,5 +56,8 @@ target_include_directories(EntityTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(EntityTests GTest::gtest fastcdr) +target_link_libraries(EntityTests + fastcdr + fastdds::log + GTest::gtest) gtest_discover_tests(EntityTests) diff --git a/test/unittest/dds/core/entity/EntityTests.cpp b/test/unittest/dds/core/entity/EntityTests.cpp index 79a425dcaf8..ffe24fba0d6 100644 --- a/test/unittest/dds/core/entity/EntityTests.cpp +++ b/test/unittest/dds/core/entity/EntityTests.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include "../../../logging/mock/MockConsumer.h" #include "mock/MockEntity.hpp" @@ -106,7 +105,7 @@ TEST_F(EntityTests, entity_enable) Entity entity; ASSERT_FALSE(entity.is_enabled()); - ASSERT_EQ(entity.enable(), eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + ASSERT_EQ(entity.enable(), RETCODE_OK); ASSERT_TRUE(entity.is_enabled()); entity.close(); ASSERT_FALSE(entity.is_enabled()); diff --git a/test/unittest/dds/core/entity/mock/MockEntity.hpp b/test/unittest/dds/core/entity/mock/MockEntity.hpp index 13fd3d98daf..15b80bf3f94 100644 --- a/test/unittest/dds/core/entity/mock/MockEntity.hpp +++ b/test/unittest/dds/core/entity/mock/MockEntity.hpp @@ -34,7 +34,7 @@ class MockEntity : public Entity }; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif //MOCK_ENTITY_H diff --git a/test/unittest/dds/core/policy/CMakeLists.txt b/test/unittest/dds/core/policy/CMakeLists.txt index e638a4dcf0b..56dfe44bff1 100644 --- a/test/unittest/dds/core/policy/CMakeLists.txt +++ b/test/unittest/dds/core/policy/CMakeLists.txt @@ -20,7 +20,7 @@ set(PARAMETER_PROPERTY_LIST_TESTS ParameterPropertyList.cpp) add_executable(ParameterPropertyListTests ${PARAMETER_PROPERTY_LIST_TESTS}) -target_compile_definitions(ParameterPropertyListTests PRIVATE FASTRTPS_NO_LIB +target_compile_definitions(ParameterPropertyListTests PRIVATE FASTDDS_NO_LIB $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) @@ -29,6 +29,6 @@ target_include_directories(ParameterPropertyListTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ParameterPropertyListTests GTest::gtest fastcdr fastrtps) +target_link_libraries(ParameterPropertyListTests GTest::gtest fastcdr fastdds) gtest_discover_tests(ParameterPropertyListTests) diff --git a/test/unittest/dds/participant/CMakeLists.txt b/test/unittest/dds/participant/CMakeLists.txt index 9982d19b89b..d8644da7ea3 100644 --- a/test/unittest/dds/participant/CMakeLists.txt +++ b/test/unittest/dds/participant/CMakeLists.txt @@ -42,7 +42,7 @@ target_include_directories(ParticipantTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ParticipantTests fastrtps fastcdr foonathan_memory +target_link_libraries(ParticipantTests fastdds fastcdr foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) diff --git a/test/unittest/dds/participant/ParticipantTests.cpp b/test/unittest/dds/participant/ParticipantTests.cpp index 7cf9d76db90..6ad7ede6372 100644 --- a/test/unittest/dds/participant/ParticipantTests.cpp +++ b/test/unittest/dds/participant/ParticipantTests.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include +#include #include #include #include @@ -24,52 +25,49 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include +#include +#include #include #include #include #include #include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include +#include +#include -#include "../../common/GTestPrinters.hpp" +#include "../../common/env_var_utils.hpp" #include "../../logging/mock/MockConsumer.h" -#include "fastdds/dds/domain/DomainParticipant.hpp" #if defined(__cplusplus_winrt) #define GET_PID GetCurrentProcessId @@ -85,17 +83,8 @@ namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::ParticipantAttributes; using fastrtps::PublisherAttributes; using fastrtps::SubscriberAttributes; -using fastrtps::types::DynamicData_ptr; -using fastrtps::types::DynamicDataFactory; -using fastrtps::types::DynamicType_ptr; -using fastrtps::types::DynamicTypeBuilder_ptr; -using fastrtps::types::DynamicTypeBuilderFactory; -using fastrtps::types::TypeDescriptor; -using fastrtps::xmlparser::XMLP_ret; -using fastrtps::xmlparser::XMLProfileManager; // Mocked TopicDataType for Topic creation tests class TopicDataTypeMock : public TopicDataType @@ -366,7 +355,7 @@ TEST(ParticipantTests, ChangeDomainParticipantFactoryQos) entity_factory.autoenable_created_entities = false; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == RETCODE_OK); DomainParticipantFactoryQos fqos; DomainParticipantFactory::get_instance()->get_qos(fqos); @@ -376,13 +365,98 @@ TEST(ParticipantTests, ChangeDomainParticipantFactoryQos) entity_factory.autoenable_created_entities = true; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_qos(qos) == RETCODE_OK); DomainParticipantFactory::get_instance()->get_qos(fqos); ASSERT_EQ(qos, fqos); ASSERT_EQ(fqos.entity_factory().autoenable_created_entities, true); } +TEST(ParticipantTests, DomainParticipantFactoryLibrarySettings) +{ + // Disable entities autoenabling + DomainParticipantFactoryQos qos; + qos.entity_factory().autoenable_created_entities = false; + ASSERT_EQ(DomainParticipantFactory::get_instance()->set_qos(qos), RETCODE_OK); + + eprosima::fastdds::LibrarySettings library_settings; + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + RETCODE_OK); + // Get LibrarySettings default values +#if HAVE_STRICT_REALTIME + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); +#else + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +#endif // if HAVE_STRICT_REALTIME + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY; + // Setting the library settings within an empty DomainParticipantFactory shall return true + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Create DomainParticipant + DomainParticipant* participant = + DomainParticipantFactory::get_instance()->create_participant(0, PARTICIPANT_QOS_DEFAULT); + ASSERT_NE(nullptr, participant); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with any disabled DomainParticipant shall succeed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + // Operation shall fail if there is any enabled DomainParticipant + EXPECT_EQ(participant->enable(), RETCODE_OK); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + // Setting LibrarySettings with any disabled DomainParticipant shall succeed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + // Remove DomainParticipant + EXPECT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), + RETCODE_OK); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_FULL; + // Setting LibrarySettings with no participants shall suceed + EXPECT_EQ(DomainParticipantFactory::get_instance()->set_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_library_settings(library_settings), + RETCODE_OK); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +} + +TEST(ParticipantTests, DomainParticipantFactoryGetDynamicTypeBuilder) +{ + traits::ref_type type; + std::string type_name("MyAloneEnumType"); + // Trying to get a Dynamic Type with empty name returns RETCODE_BAD_PARAMETER + EXPECT_EQ(RETCODE_BAD_PARAMETER, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(std::string(), type)); + // Trying to get an unknown Dynamic Type return RETCODE_NO_DATA + EXPECT_EQ(RETCODE_NO_DATA, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(type_name, type)); + EXPECT_EQ(nullptr, type); + // Load XML file + std::string xml = + "\ + \ + \ + \ + \ + \ + \ + \ + \ + "; + DomainParticipantFactory::get_instance()->load_XML_profiles_string(xml.c_str(), xml.length()); + // Getting a known dynamic type returns RETCODE_OK + EXPECT_EQ(RETCODE_OK, + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name(type_name, type)); + EXPECT_NE(nullptr, type); +} + TEST(ParticipantTests, CreateDomainParticipant) { DomainParticipant* participant = @@ -392,7 +466,7 @@ TEST(ParticipantTests, CreateDomainParticipant) ASSERT_NE(participant, nullptr); EXPECT_EQ(participant->get_listener(), nullptr); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -432,35 +506,10 @@ void check_participant_with_profile ( DomainParticipantQos qos; participant->get_qos(qos); - ParticipantAttributes participant_atts; - XMLProfileManager::fillParticipantAttributes(profile_name, participant_atts); - - /* Values taken from profile */ - ASSERT_TRUE(qos.allocation() == participant_atts.rtps.allocation); - // Check that all the non-binary properties in participant_atts are present (by name) in qos - for (auto property : participant_atts.rtps.properties.properties()) - { - ASSERT_NE(nullptr, fastrtps::rtps::PropertyPolicyHelper::find_property(qos.properties(), property.name())); - } - ASSERT_TRUE(qos.properties().binary_properties() == participant_atts.rtps.properties.binary_properties()); - ASSERT_TRUE(qos.name().to_string() == participant_atts.rtps.getName()); - ASSERT_TRUE(qos.wire_protocol().prefix == participant_atts.rtps.prefix); - ASSERT_TRUE(qos.wire_protocol().participant_id == participant_atts.rtps.participantID); - ASSERT_TRUE(qos.wire_protocol().builtin == participant_atts.rtps.builtin); - ASSERT_TRUE(qos.wire_protocol().port == participant_atts.rtps.port); - ASSERT_TRUE(qos.wire_protocol().throughput_controller == participant_atts.rtps.throughputController); - ASSERT_TRUE(qos.wire_protocol().default_unicast_locator_list == - participant_atts.rtps.defaultUnicastLocatorList); - ASSERT_TRUE(qos.wire_protocol().default_multicast_locator_list == - participant_atts.rtps.defaultMulticastLocatorList); - ASSERT_TRUE(qos.transport().user_transports == participant_atts.rtps.userTransports); - ASSERT_TRUE(qos.transport().use_builtin_transports == participant_atts.rtps.useBuiltinTransports); - ASSERT_TRUE(qos.transport().send_socket_buffer_size == participant_atts.rtps.sendSocketBufferSize); - ASSERT_TRUE(qos.transport().listen_socket_buffer_size == participant_atts.rtps.listenSocketBufferSize); - ASSERT_TRUE(qos.user_data().data_vec() == participant_atts.rtps.userData); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == PARTICIPANT_QOS_DEFAULT.entity_factory()); + DomainParticipantQos profile_qos; + EXPECT_EQ(DomainParticipantFactory::get_instance()->get_participant_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + check_equivalent_qos(qos, profile_qos); } /** @@ -510,7 +559,7 @@ TEST(ParticipantTests, CreateDomainParticipantWithProfile) ASSERT_EQ(default_participant->get_domain_id(), domain_id); //Keep the DID given to the method, not the one on the profile check_participant_with_profile(default_participant, "test_default_participant_profile"); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - default_participant) == ReturnCode_t::RETCODE_OK); + default_participant) == RETCODE_OK); //participant using non-default profile DomainParticipant* participant = @@ -519,7 +568,83 @@ TEST(ParticipantTests, CreateDomainParticipantWithProfile) ASSERT_NE(participant, nullptr); ASSERT_EQ(participant->get_domain_id(), domain_id); //Keep the DID given to the method, not the one on the profile check_participant_with_profile(participant, "test_participant_profile"); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); +} + +TEST(ParticipantTests, CreateDomainParticipantWithDefaultProfile) +{ + uint32_t domain_id = 123u; // This is the domain ID set in the default profile above + + // set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_profile.xml" + eprosima::testing::set_environment_variable("FASTDDS_DEFAULT_PROFILES_FILE", "test_xml_profile.xml"); + + //participant using the given profile + DomainParticipant* default_env_participant = + DomainParticipantFactory::get_instance()->create_participant_with_default_profile(); + + // unset XML profile environment variable + eprosima::testing::clear_environment_variable("FASTDDS_DEFAULT_PROFILES_FILE"); + + ASSERT_NE(default_env_participant, nullptr); + ASSERT_EQ(default_env_participant->get_domain_id(), domain_id); + ASSERT_EQ(default_env_participant->get_listener(), nullptr); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( + default_env_participant) == RETCODE_OK); +} + +TEST(ParticipantTests, CreateDomainParticipantWithDefaultProfileListener) +{ + uint32_t domain_id = 123u; // This is the domain ID set in the default profile above + + // set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_profile.xml" + eprosima::testing::set_environment_variable("FASTDDS_DEFAULT_PROFILES_FILE", "test_xml_profile.xml"); + + DomainParticipantListener listener; + + //participant using the given profile + DomainParticipant* default_env_participant = + DomainParticipantFactory::get_instance()->create_participant_with_default_profile(&listener, + StatusMask::none()); + + // unset XML profile environment variable + eprosima::testing::clear_environment_variable("FASTDDS_DEFAULT_PROFILES_FILE"); + + ASSERT_NE(default_env_participant, nullptr); + ASSERT_EQ(default_env_participant->get_domain_id(), domain_id); + ASSERT_EQ(default_env_participant->get_listener(), &listener); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( + default_env_participant) == RETCODE_OK); +} + +TEST(ParticipantTests, CreateDomainParticipantWithoutDefaultProfile) +{ + uint32_t default_domain_id = 0u; // This is the default domain ID + + //participant using default values + DomainParticipant* default_participant = + DomainParticipantFactory::get_instance()->create_participant_with_default_profile(); + ASSERT_NE(default_participant, nullptr); + ASSERT_EQ(default_participant->get_domain_id(), default_domain_id); + ASSERT_EQ(default_participant->get_listener(), nullptr); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( + default_participant) == RETCODE_OK); +} + +TEST(ParticipantTests, CreateDomainParticipantWithoutDefaultProfileListener) +{ + uint32_t default_domain_id = 0u; // This is the default domain ID + + DomainParticipantListener listener; + + //participant using default values + DomainParticipant* default_participant = + DomainParticipantFactory::get_instance()->create_participant_with_default_profile(&listener, + StatusMask::none()); + ASSERT_NE(default_participant, nullptr); + ASSERT_EQ(default_participant->get_domain_id(), default_domain_id); + ASSERT_EQ(default_participant->get_listener(), &listener); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( + default_participant) == RETCODE_OK); } TEST(ParticipantTests, GetParticipantProfileQos) @@ -528,7 +653,7 @@ TEST(ParticipantTests, GetParticipantProfileQos) DomainParticipantQos qos; EXPECT_EQ( DomainParticipantFactory::get_instance()->get_participant_qos_from_profile("test_participant_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); // Extract ParticipantQos from profile DomainParticipant* participant = @@ -541,28 +666,20 @@ TEST(ParticipantTests, GetParticipantProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( DomainParticipantFactory::get_instance()->get_participant_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } -TEST(ParticipantTests, CreatePSMDomainParticipant) -{ - ::dds::domain::DomainParticipant participant = ::dds::core::null; - participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - - ASSERT_NE(participant, ::dds::core::null); -} - TEST(ParticipantTests, DeleteDomainParticipant) { DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteDomainParticipantWithEntities) @@ -575,9 +692,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(subscriber, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); @@ -585,9 +702,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(publisher, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); participant = DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); @@ -598,9 +715,9 @@ TEST(ParticipantTests, DeleteDomainParticipantWithEntities) ASSERT_NE(topic, nullptr); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + participant), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultParticipantQos) @@ -614,7 +731,7 @@ TEST(ParticipantTests, ChangeDefaultParticipantQos) entity_factory.autoenable_created_entities = false; qos.entity_factory(entity_factory); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos(qos) == RETCODE_OK); DomainParticipantQos pqos; DomainParticipantFactory::get_instance()->get_default_participant_qos(pqos); @@ -622,28 +739,7 @@ TEST(ParticipantTests, ChangeDefaultParticipantQos) ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); ASSERT_TRUE(DomainParticipantFactory::get_instance()->set_default_participant_qos( - PARTICIPANT_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); -} - -TEST(ParticipantTests, ChangePSMDefaultParticipantQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - - ::dds::domain::qos::DomainParticipantQos qos = participant.default_participant_qos(); - - ASSERT_EQ(qos, PARTICIPANT_QOS_DEFAULT); - - EntityFactoryQosPolicy entity_factory = qos.entity_factory(); - entity_factory.autoenable_created_entities = false; - qos.entity_factory(entity_factory); - - ASSERT_NO_THROW(participant.default_participant_qos(qos)); - ::dds::domain::qos::DomainParticipantQos pqos = participant.default_participant_qos(); - - ASSERT_EQ(qos, pqos); - ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - - ASSERT_NO_THROW(participant.default_participant_qos(PARTICIPANT_QOS_DEFAULT)); + PARTICIPANT_QOS_DEFAULT) == RETCODE_OK); } TEST(ParticipantTests, ChangeDomainParticipantQos) @@ -657,7 +753,7 @@ TEST(ParticipantTests, ChangeDomainParticipantQos) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -665,26 +761,7 @@ TEST(ParticipantTests, ChangeDomainParticipantQos) ASSERT_EQ(qos, pqos); ASSERT_EQ(qos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); - -} - -TEST(ParticipantTests, ChangePSMDomainParticipantQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::core::null; - participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::domain::qos::DomainParticipantQos qos = participant.qos(); - - check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); - - qos.entity_factory().autoenable_created_entities = false; - ASSERT_NO_THROW(participant.qos(qos)); - ::dds::domain::qos::DomainParticipantQos pqos; - pqos = participant.qos(); - - ASSERT_FALSE(pqos == PARTICIPANT_QOS_DEFAULT); - ASSERT_EQ(qos, pqos); - ASSERT_EQ(qos.entity_factory().autoenable_created_entities, false); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -913,9 +990,9 @@ TEST(ParticipantTests, SimpleParticipantRemoteServerListConfiguration) DomainParticipantQos result_qos = participant->get_qos(); EXPECT_EQ(result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers, qos_output); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } @@ -981,7 +1058,7 @@ TEST(ParticipantTests, TransformSimpleParticipantToSuperclientByEnvVariable) DomainParticipantQos result_qos = participant->get_qos(); EXPECT_EQ(result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers, qos_output); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); // check UDPv6 transport is there auto udpv6_check_2 = [](fastrtps::rtps::RTPSParticipantAttributes& attributes_2) -> bool @@ -1000,10 +1077,10 @@ TEST(ParticipantTests, TransformSimpleParticipantToSuperclientByEnvVariable) result_qos = participant_2->get_qos(); EXPECT_EQ(result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers, qos_output); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant_2->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant_2->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_2)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_2)); } @@ -1056,7 +1133,7 @@ TEST(ParticipantTests, SimpleParticipantRemoteServerListConfigurationDNS) }; EXPECT_TRUE(udpv6_check(attributes)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1107,8 +1184,8 @@ TEST(ParticipantTests, SimpleParticipantDynamicAdditionRemoteServers) EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1132,8 +1209,8 @@ TEST(ParticipantTests, ClientParticipantRemoteServerListConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::CLIENT); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, qos_output); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1161,8 +1238,8 @@ TEST(ParticipantTests, ServerParticipantEnvironmentConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::SERVER); EXPECT_TRUE(attributes.builtin.discovery_config.m_DiscoveryServers.empty()); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1191,8 +1268,8 @@ TEST(ParticipantTests, ServerParticipantRemoteServerListConfiguration) EXPECT_EQ(attributes.builtin.discovery_config.discoveryProtocol, fastrtps::rtps::DiscoveryProtocol::SERVER); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, qos_output); DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } /** @@ -1244,8 +1321,8 @@ TEST(ParticipantTests, ServerParticipantInconsistentRemoteServerListConfiguratio helper_wait_for_at_least_entries(mockConsumer, 1); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1294,8 +1371,8 @@ TEST(ParticipantTests, ServerParticipantInconsistentLocatorsRemoteServerListConf EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE DomainParticipantQos result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1320,7 +1397,7 @@ TEST(ParticipantTests, RepeatEnvironmentFileConfiguration) set_and_check_with_environment_file(participant, {"172.17.0.5:64863", "192.168.1.133:4321", "192.168.5.15:1234"}, filename); #endif // APPLE - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1388,11 +1465,11 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration) get_rtps_attributes(participant, attributes); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); // Add new server using API result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); // RTPS layer issues a Warning because a server has been removed. However, DDS layer returns OK - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); server.clear(); fastrtps::rtps::IPLocator::setIPv4(locator, "192.168.1.133"); locator.port = 64863; @@ -1405,14 +1482,14 @@ TEST(ParticipantTests, ServerParticipantCorrectRemoteServerListConfiguration) server.metatrafficUnicastLocatorList.push_back(locator); get_server_client_default_guidPrefix(3, server.guidPrefix); result_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); output.push_back(server); get_rtps_attributes(participant, attributes); EXPECT_EQ(attributes.builtin.discovery_config.m_DiscoveryServers, output); #endif // APPLE result_qos = participant->get_qos(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(result_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(result_qos)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); std::remove(filename.c_str()); } @@ -1449,35 +1526,35 @@ TEST(ParticipantTests, ChangeWireProtocolQos) server_2.metatrafficUnicastLocatorList.push_back(locator_2); qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server_2); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); DomainParticipantQos set_qos; participant->get_qos(set_qos); ASSERT_EQ(set_qos, qos); // Check that removing one server is NOT OK qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.pop_front(); - ASSERT_FALSE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_qos(qos) == RETCODE_OK); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check that removing all servers is NOT OK fastdds::rtps::RemoteServerList_t servers; qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers = servers; - ASSERT_FALSE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_qos(qos) == RETCODE_OK); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().prefix is NOT OK participant->get_qos(qos); std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> qos.wire_protocol().prefix; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().participant_id is NOT OK participant->get_qos(qos); qos.wire_protocol().participant_id = 7; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1485,7 +1562,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); fastrtps::rtps::ThroughputControllerDescriptor controller{300000, 1000}; qos.wire_protocol().throughput_controller = controller; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1495,56 +1572,42 @@ TEST(ParticipantTests, ChangeWireProtocolQos) fastrtps::rtps::IPLocator::setIPv4(loc, "192.0.0.0"); loc.port = static_cast(12); qos.wire_protocol().default_unicast_locator_list.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().default_multicast_locator_list is NOT OK participant->get_qos(qos); qos.wire_protocol().default_multicast_locator_list.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.use_WriterLivelinessProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.use_WriterLivelinessProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); - participant->get_qos(set_qos); - ASSERT_FALSE(set_qos == qos); - - // Check changing wire_protocol().builtin.typelookup_config.use_client is NOT OK - participant->get_qos(qos); - qos.wire_protocol().builtin.typelookup_config.use_client ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); - participant->get_qos(set_qos); - ASSERT_FALSE(set_qos == qos); - - // Check changing wire_protocol().builtin.typelookup_config.use_server is NOT OK - participant->get_qos(qos); - qos.wire_protocol().builtin.typelookup_config.use_server ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.metatrafficUnicastLocatorList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.metatrafficMulticastLocatorList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.metatrafficMulticastLocatorList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.initialPeersList is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.initialPeersList.push_back(loc); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1552,14 +1615,14 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.readerHistoryMemoryPolicy = fastrtps::rtps::MemoryManagementPolicy_t::DYNAMIC_RESERVE_MEMORY_MODE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.readerPayloadSize is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.readerPayloadSize = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1567,70 +1630,70 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.writerHistoryMemoryPolicy = fastrtps::rtps::MemoryManagementPolicy_t::DYNAMIC_RESERVE_MEMORY_MODE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.writerPayloadSize is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.writerPayloadSize = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.mutation_tries is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.mutation_tries = 27; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.avoid_builtin_multicast is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.avoid_builtin_multicast ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.discoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.discoveryProtocol = fastrtps::rtps::DiscoveryProtocol_t::NONE; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.use_STATIC_EndpointDiscoveryProtocol ^= true; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.discoveryServer_client_syncperiod is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.discoveryServer_client_syncperiod = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.leaseDuration is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.leaseDuration = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); // Check changing wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod is NOT OK participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = { 27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1638,7 +1701,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.initial_announcements.count = 27; qos.wire_protocol().builtin.discovery_config.initial_announcements.period = {27, 27}; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1652,7 +1715,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) qos.wire_protocol().builtin.discovery_config.m_simpleEDP. enable_builtin_secure_subscriptions_writer_and_publications_reader ^= true; #endif // if HAVE_SECURITY - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1671,7 +1734,7 @@ TEST(ParticipantTests, ChangeWireProtocolQos) "" \ ""; qos.wire_protocol().builtin.discovery_config.static_edp_xml_config(static_xml.c_str()); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); @@ -1679,11 +1742,11 @@ TEST(ParticipantTests, ChangeWireProtocolQos) participant->get_qos(qos); qos.wire_protocol().builtin.discovery_config.ignoreParticipantFlags = fastrtps::rtps::ParticipantFilteringFlags::FILTER_DIFFERENT_HOST; - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); participant->get_qos(set_qos); ASSERT_FALSE(set_qos == qos); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, EntityFactoryBehavior) @@ -1694,7 +1757,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); } // Ensure that participant is created disabled. @@ -1706,7 +1769,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) // Participant is disabled. This means we can change an inmutable qos. DomainParticipantQos qos = PARTICIPANT_QOS_DEFAULT; qos.wire_protocol().builtin.avoid_builtin_multicast = !qos.wire_protocol().builtin.avoid_builtin_multicast; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, participant->set_qos(qos)); // Creating lower entities should create them disabled Publisher* pub = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -1724,13 +1787,13 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_FALSE(topic->is_enabled()); // Enabling should fail on lower entities until participant is enabled - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, pub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, sub->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, pub->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, sub->enable()); // Enable participant and check idempotency of enable - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); // As the participant was created with the default value for ENTITY_FACTORY, // lower entities should have been automatically enabled. @@ -1738,7 +1801,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_TRUE(sub->is_enabled()); // Now that participant is enabled, we should not be able change an inmutable qos. - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, participant->set_qos(PARTICIPANT_QOS_DEFAULT)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, participant->set_qos(PARTICIPANT_QOS_DEFAULT)); // Created entities should now be automatically enabled Subscriber* sub2 = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); @@ -1747,7 +1810,7 @@ TEST(ParticipantTests, EntityFactoryBehavior) // We can change ENTITY_FACTORY on the participant qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->set_qos(qos)); + ASSERT_EQ(RETCODE_OK, participant->set_qos(qos)); // Lower entities should now be created disabled Publisher* pub2 = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -1755,22 +1818,22 @@ TEST(ParticipantTests, EntityFactoryBehavior) EXPECT_FALSE(pub2->is_enabled()); // But could be enabled afterwards - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub2->enable()); + EXPECT_EQ(RETCODE_OK, pub2->enable()); EXPECT_TRUE(pub2->is_enabled()); // Check idempotency of enable on entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, pub2->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, sub->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, sub2->enable()); + EXPECT_EQ(RETCODE_OK, pub->enable()); + EXPECT_EQ(RETCODE_OK, pub2->enable()); + EXPECT_EQ(RETCODE_OK, sub->enable()); + EXPECT_EQ(RETCODE_OK, sub2->enable()); // Delete lower entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(sub2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(pub2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(sub)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_publisher(pub)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(topic)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(sub2)); + EXPECT_EQ(RETCODE_OK, participant->delete_publisher(pub2)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(sub)); + EXPECT_EQ(RETCODE_OK, participant->delete_publisher(pub)); + EXPECT_EQ(RETCODE_OK, participant->delete_topic(topic)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant)); } TEST(ParticipantTests, CreatePublisher) @@ -1782,8 +1845,8 @@ TEST(ParticipantTests, CreatePublisher) ASSERT_NE(publisher, nullptr); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void check_publisher_with_profile ( @@ -1793,16 +1856,10 @@ void check_publisher_with_profile ( PublisherQos qos; publisher->get_qos(qos); - PublisherAttributes publisher_atts; - XMLProfileManager::fillPublisherAttributes(profile_name, publisher_atts); - - //Values taken from profile - ASSERT_TRUE(qos.group_data().dataVec() == publisher_atts.qos.m_groupData.dataVec()); - ASSERT_TRUE(qos.partition() == publisher_atts.qos.m_partition); - ASSERT_TRUE(qos.presentation() == publisher_atts.qos.m_presentation); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == PUBLISHER_QOS_DEFAULT.entity_factory()); + PublisherQos profile_qos; + EXPECT_EQ(publisher->get_participant()->get_publisher_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, CreatePublisherWithProfile) @@ -1816,24 +1873,15 @@ TEST(ParticipantTests, CreatePublisherWithProfile) Publisher* default_publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(default_publisher, nullptr); check_publisher_with_profile(default_publisher, "test_default_publisher_profile"); - ASSERT_TRUE(participant->delete_publisher(default_publisher) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(default_publisher) == RETCODE_OK); //participant using non-default profile Publisher* publisher = participant->create_publisher_with_profile("test_publisher_profile"); ASSERT_NE(publisher, nullptr); check_publisher_with_profile(publisher, "test_publisher_profile"); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(ParticipantTests, CreatePSMPublisher) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::pub::Publisher publisher = ::dds::core::null; - publisher = ::dds::pub::Publisher(participant); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); - ASSERT_NE(publisher, ::dds::core::null); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultPublisherQos) @@ -1842,40 +1890,24 @@ TEST(ParticipantTests, ChangeDefaultPublisherQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(participant->set_default_publisher_qos(PUBLISHER_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_publisher_qos(PUBLISHER_QOS_DEFAULT) == RETCODE_OK); PublisherQos qos; - ASSERT_TRUE(participant->get_default_publisher_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_default_publisher_qos(qos) == RETCODE_OK); ASSERT_EQ(qos, PUBLISHER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(participant->set_default_publisher_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_publisher_qos(qos) == RETCODE_OK); PublisherQos pqos; - ASSERT_TRUE(participant->get_default_publisher_qos(pqos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_default_publisher_qos(pqos) == RETCODE_OK); ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(ParticipantTests, ChangePSMDefaultPublisherQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::pub::qos::PublisherQos qos = participant.default_publisher_qos(); - ASSERT_EQ(qos, PUBLISHER_QOS_DEFAULT); - - qos.entity_factory().autoenable_created_entities = false; - - ASSERT_NO_THROW(participant.default_publisher_qos(qos)); - - ::dds::pub::qos::PublisherQos pqos = participant.default_publisher_qos(); - - ASSERT_TRUE(qos == pqos); - ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, CreateSubscriber) @@ -1887,8 +1919,8 @@ TEST(ParticipantTests, CreateSubscriber) Subscriber* subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(subscriber, nullptr); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void check_subscriber_with_profile ( @@ -1898,16 +1930,10 @@ void check_subscriber_with_profile ( SubscriberQos qos; subscriber->get_qos(qos); - SubscriberAttributes subscriber_atts; - XMLProfileManager::fillSubscriberAttributes(profile_name, subscriber_atts); - - //Values taken from profile - ASSERT_TRUE(qos.group_data().dataVec() == subscriber_atts.qos.m_groupData.dataVec()); - ASSERT_TRUE(qos.partition() == subscriber_atts.qos.m_partition); - ASSERT_TRUE(qos.presentation() == subscriber_atts.qos.m_presentation); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.entity_factory() == SUBSCRIBER_QOS_DEFAULT.entity_factory()); + SubscriberQos profile_qos; + EXPECT_EQ(subscriber->get_participant()->get_subscriber_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, GetSubscriberProfileQos) @@ -1922,7 +1948,7 @@ TEST(ParticipantTests, GetSubscriberProfileQos) SubscriberQos qos; EXPECT_EQ( participant->get_subscriber_qos_from_profile("test_subscriber_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Subscriber* subscriber = participant->create_subscriber(qos); ASSERT_NE(subscriber, nullptr); @@ -1932,11 +1958,11 @@ TEST(ParticipantTests, GetSubscriberProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_subscriber_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, CreateSubscriberWithProfile) @@ -1950,15 +1976,15 @@ TEST(ParticipantTests, CreateSubscriberWithProfile) Subscriber* default_subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(default_subscriber, nullptr); check_subscriber_with_profile(default_subscriber, "test_default_subscriber_profile"); - ASSERT_TRUE(participant->delete_subscriber(default_subscriber) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(default_subscriber) == RETCODE_OK); //participant using non-default profile Subscriber* subscriber = participant->create_subscriber_with_profile("test_subscriber_profile"); ASSERT_NE(subscriber, nullptr); check_subscriber_with_profile(subscriber, "test_subscriber_profile"); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, GetPublisherProfileQos) @@ -1973,7 +1999,7 @@ TEST(ParticipantTests, GetPublisherProfileQos) PublisherQos qos; EXPECT_EQ( participant->get_publisher_qos_from_profile("test_publisher_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Publisher* publisher = participant->create_publisher(qos); ASSERT_NE(publisher, nullptr); @@ -1983,22 +2009,57 @@ TEST(ParticipantTests, GetPublisherProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_publisher_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } +TEST(ParticipantTests, GetReplierProfileQos) +{ + DomainParticipantFactory::get_instance()->load_XML_profiles_file("test_xml_profile.xml"); + DomainParticipant* participant = + DomainParticipantFactory::get_instance()->create_participant( + (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); + ASSERT_NE(participant, nullptr); + + // Extract qos from profile + ReplierQos qos; + EXPECT_EQ( + participant->get_replier_qos_from_profile("test_replier_profile", qos), + RETCODE_OK); + + // Test return when a non-existent profile is used + EXPECT_EQ( + participant->get_replier_qos_from_profile("incorrect_profile_name", qos), + RETCODE_BAD_PARAMETER); -TEST(ParticipantTests, CreatePSMSubscriber) + // Clean up + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); +} + +TEST(ParticipantTests, GetRequesterProfileQos) { - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant( + DomainParticipantFactory::get_instance()->load_XML_profiles_file("test_xml_profile.xml"); + DomainParticipant* participant = + DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ::dds::sub::Subscriber subscriber = ::dds::core::null; - subscriber = ::dds::sub::Subscriber(participant, SUBSCRIBER_QOS_DEFAULT); + ASSERT_NE(participant, nullptr); - ASSERT_NE(subscriber, ::dds::core::null); + // Extract qos from profile + RequesterQos qos; + EXPECT_EQ( + participant->get_requester_qos_from_profile("test_requester_profile", qos), + RETCODE_OK); + + // Test return when a non-existent profile is used + EXPECT_EQ( + participant->get_requester_qos_from_profile("incorrect_profile_name", qos), + RETCODE_BAD_PARAMETER); + + // Clean up + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, DeletePublisher) @@ -2010,8 +2071,8 @@ TEST(ParticipantTests, DeletePublisher) Publisher* publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(publisher, nullptr); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteSubscriber) @@ -2023,8 +2084,8 @@ TEST(ParticipantTests, DeleteSubscriber) Subscriber* subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT); ASSERT_NE(subscriber, nullptr); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultSubscriberQos) @@ -2033,40 +2094,24 @@ TEST(ParticipantTests, ChangeDefaultSubscriberQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_EQ(participant->set_default_subscriber_qos(SUBSCRIBER_QOS_DEFAULT), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_default_subscriber_qos(SUBSCRIBER_QOS_DEFAULT), RETCODE_OK); SubscriberQos qos; - ASSERT_EQ(participant->get_default_subscriber_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_default_subscriber_qos(qos), RETCODE_OK); ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(participant->set_default_subscriber_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_default_subscriber_qos(qos), RETCODE_OK); SubscriberQos pqos; - ASSERT_EQ(participant->get_default_subscriber_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_default_subscriber_qos(pqos), RETCODE_OK); ASSERT_TRUE(pqos == qos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(ParticipantTests, ChangePSMDefaultSubscriberQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::sub::qos::SubscriberQos qos = participant.default_subscriber_qos(); - ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); - - qos.entity_factory().autoenable_created_entities = false; - - ASSERT_NO_THROW(participant.default_subscriber_qos(qos)); - - ::dds::sub::qos::SubscriberQos pqos = participant.default_subscriber_qos(); - - ASSERT_TRUE(qos == pqos); - ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, ChangeDefaultTopicQos) @@ -2075,7 +2120,7 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) DomainParticipantFactory::get_instance()->create_participant( (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - ASSERT_TRUE(participant->set_default_topic_qos(TOPIC_QOS_DEFAULT) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_topic_qos(TOPIC_QOS_DEFAULT) == RETCODE_OK); TopicQos qos; participant->get_default_topic_qos(qos); @@ -2084,7 +2129,7 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; - ASSERT_TRUE(participant->set_default_topic_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_default_topic_qos(qos) == RETCODE_OK); TopicQos tqos; participant->get_default_topic_qos(tqos); @@ -2093,25 +2138,9 @@ TEST(ParticipantTests, ChangeDefaultTopicQos) ASSERT_EQ(tqos.reliability().kind, BEST_EFFORT_RELIABILITY_QOS); qos.durability().kind = PERSISTENT_DURABILITY_QOS; - ASSERT_FALSE(participant->set_default_topic_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(participant->set_default_topic_qos(qos) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(ParticipantTests, ChangePSMDefaultTopicQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::topic::qos::TopicQos qos = participant.default_topic_qos(); - - ASSERT_EQ(qos, TOPIC_QOS_DEFAULT); - - qos.ownership().kind = EXCLUSIVE_OWNERSHIP_QOS; - - ASSERT_NO_THROW(participant.default_topic_qos(qos)); - - ::dds::topic::qos::TopicQos tqos = participant.default_topic_qos(); - ASSERT_EQ(qos, tqos); - ASSERT_EQ(tqos.ownership().kind, EXCLUSIVE_OWNERSHIP_QOS); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void check_topic_with_profile ( @@ -2121,12 +2150,10 @@ void check_topic_with_profile ( TopicQos qos; topic->get_qos(qos); - TopicAttributesQos topic_atts; - XMLProfileManager::fillTopicAttributes(profile_name, topic_atts); - - //Values taken from profile - ASSERT_TRUE(qos.history() == topic_atts.historyQos); - ASSERT_TRUE(qos.resource_limits() == topic_atts.resourceLimitsQos); + TopicQos profile_qos; + EXPECT_EQ(topic->get_participant()->get_topic_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(ParticipantTests, GetTopicProfileQos) @@ -2143,7 +2170,7 @@ TEST(ParticipantTests, GetTopicProfileQos) TopicQos qos; EXPECT_EQ( participant->get_topic_qos_from_profile("test_topic_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); Topic* topic = participant->create_topic("footopic", type.get_type_name(), qos); ASSERT_NE(topic, nullptr); @@ -2154,11 +2181,11 @@ TEST(ParticipantTests, GetTopicProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( participant->get_topic_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(ParticipantTests, CreateTopic) @@ -2179,15 +2206,15 @@ TEST(ParticipantTests, CreateTopic) Topic* topic_duplicated = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); ASSERT_EQ(topic_duplicated, nullptr); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); // Topic using non-default profile Topic* topic_profile = participant->create_topic_with_profile("footopic", "footype", "test_topic_profile"); ASSERT_NE(topic_profile, nullptr); check_topic_with_profile(topic_profile, "test_topic_profile"); - ASSERT_TRUE(participant->delete_topic(topic_profile) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic_profile) == RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } // Test that creating a Topic with a Data Type name different from the Type Support is possible as long @@ -2210,7 +2237,7 @@ TEST(ParticipantTests, CreateTopicWithDifferentTypeName) Topic* topic_duplicated = participant->create_topic("footopic", type_name, TOPIC_QOS_DEFAULT); ASSERT_EQ(topic_duplicated, nullptr); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); } // Test that creating a Topic with a Data Type name different from the data type is not possible @@ -2245,19 +2272,6 @@ TEST(ParticipantTests, CreateTopicWithDifferentTypeName_negative) } } -TEST(ParticipantTests, PSMCreateTopic) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - - TypeSupport type(new TopicDataTypeMock()); - type.register_type(participant.delegate().get(), "footype"); - - ::dds::topic::Topic topic = ::dds::core::null; - topic = ::dds::topic::Topic(participant, "footopic", "footype", TOPIC_QOS_DEFAULT); - - ASSERT_NE(topic, ::dds::core::null); -} - TEST(ParticipantTests, DeleteTopic) { uint32_t domain_id = (uint32_t)GET_PID() % 230; @@ -2271,11 +2285,11 @@ TEST(ParticipantTests, DeleteTopic) Topic* topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); - ASSERT_TRUE(participant->delete_topic(nullptr) == ReturnCode_t::RETCODE_BAD_PARAMETER); - ASSERT_TRUE(participant2->delete_topic(topic) == ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant2) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(nullptr) == RETCODE_BAD_PARAMETER); + ASSERT_TRUE(participant2->delete_topic(topic) == RETCODE_PRECONDITION_NOT_MET); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant2) == RETCODE_OK); } TEST(ParticipantTests, LookupTopicDescription) @@ -2299,10 +2313,10 @@ TEST(ParticipantTests, LookupTopicDescription) ASSERT_EQ(participant->lookup_topicdescription(topic_name), topic); // After topic deletion, should return nil - EXPECT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); + EXPECT_TRUE(participant->delete_topic(topic) == RETCODE_OK); ASSERT_EQ(participant->lookup_topicdescription(topic_name), nullptr); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(ParticipantTests, DeleteTopicInUse) @@ -2326,13 +2340,13 @@ TEST(ParticipantTests, DeleteTopicInUse) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); topic = participant->create_topic("footopic", "footype", TOPIC_QOS_DEFAULT); @@ -2342,13 +2356,13 @@ TEST(ParticipantTests, DeleteTopicInUse) DataWriter* data_writer = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(data_writer, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Check that the constraints on maximum expression parameter size are honored @@ -2383,10 +2397,10 @@ TEST(ParticipantTests, ExpressionParameterLimits) ASSERT_NE(content_filtered_topic_default_valid_parameters, nullptr); ASSERT_EQ(participant_default_max_parameters->delete_contentfilteredtopic( - content_filtered_topic_default_valid_parameters), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_default_max_parameters->delete_topic(topic_default_max_parameters), ReturnCode_t::RETCODE_OK); + content_filtered_topic_default_valid_parameters), RETCODE_OK); + ASSERT_EQ(participant_default_max_parameters->delete_topic(topic_default_max_parameters), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_default_max_parameters), ReturnCode_t::RETCODE_OK); + participant_default_max_parameters), RETCODE_OK); // Test user defined limits pqos.allocation().content_filter.expression_parameters.maximum = 1; @@ -2406,14 +2420,14 @@ TEST(ParticipantTests, ExpressionParameterLimits) topic, "", {"Parameter1"}); ASSERT_NE(content_filtered_topic, nullptr); - ASSERT_EQ(fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER, content_filtered_topic->set_expression_parameters( + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, content_filtered_topic->set_expression_parameters( {"Parameter1", "Parameter2"})); - ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_contentfilteredtopic(content_filtered_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -2422,7 +2436,7 @@ void set_listener_test ( DomainParticipantListener* listener, StatusMask mask) { - ASSERT_EQ(participant->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(participant->get_status_mask(), mask); } @@ -2481,7 +2495,7 @@ TEST(ParticipantTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } class CustomListener2 : public DomainParticipantListener @@ -2502,8 +2516,10 @@ class CustomListener2 : public DomainParticipantListener void on_participant_discovery( eprosima::fastdds::dds::DomainParticipant*, - eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&&) override + eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&&, + bool& should_be_ignored) override { + static_cast(should_be_ignored); try { promise_.set_value(); @@ -2537,10 +2553,10 @@ TEST(ParticipantTests, FailingSetListener) // Wait for callback trigger listener.get_future().wait(); - ASSERT_EQ(participant->set_listener(nullptr, std::chrono::seconds(1)), ReturnCode_t::RETCODE_ERROR); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_listener(nullptr, std::chrono::seconds(1)), RETCODE_ERROR); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant( - participant_to_discover), ReturnCode_t::RETCODE_OK); + participant_to_discover), RETCODE_OK); } /* @@ -2560,7 +2576,7 @@ TEST(ParticipantTests, CheckDomainParticipantQos) DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); } // Create the participant @@ -2570,25 +2586,25 @@ TEST(ParticipantTests, CheckDomainParticipantQos) // Get the participant qos DomainParticipantQos qos; - ASSERT_TRUE(participant->get_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->get_qos(qos) == RETCODE_OK); // Change the user data qos.user_data().set_max_size(5); std::vector my_data {0, 1, 2, 3, 4}; qos.user_data().setValue(my_data); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_OK); // Change the ParticipantResourceLimitsQos to a maximum user data value less than the current user data size // This should return an Inconsistent Policy error code qos.allocation().data_limits.max_user_data = 1; ASSERT_EQ(qos.allocation().data_limits.max_user_data, 1ul); - ASSERT_TRUE(participant->set_qos(qos) == ReturnCode_t::RETCODE_INCONSISTENT_POLICY); + ASSERT_TRUE(participant->set_qos(qos) == RETCODE_INCONSISTENT_POLICY); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); // Remove the participant - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -2601,7 +2617,7 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos pfqos; pfqos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(pfqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(pfqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -2613,7 +2629,7 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.allocation().data_limits.max_properties = 10; - ASSERT_EQ(participant->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(qos), RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -2625,9 +2641,9 @@ TEST(ParticipantTests, ChangeAllocationDomainParticipantQos) ASSERT_TRUE(participant->is_enabled()); participant->get_qos(pqos); pqos.allocation().data_limits.max_properties = 20; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2640,7 +2656,7 @@ TEST(ParticipantTests, ChangeDomainParcipantName) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos pfqos; pfqos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(pfqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(pfqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -2652,7 +2668,7 @@ TEST(ParticipantTests, ChangeDomainParcipantName) check_equivalent_qos(qos, PARTICIPANT_QOS_DEFAULT); qos.name() = "part1"; - ASSERT_EQ(participant->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(qos), RETCODE_OK); DomainParticipantQos pqos; participant->get_qos(pqos); @@ -2664,9 +2680,9 @@ TEST(ParticipantTests, ChangeDomainParcipantName) ASSERT_TRUE(participant->is_enabled()); participant->get_qos(pqos); pqos.name() = "new_part1"; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2686,20 +2702,20 @@ TEST(ParticipantTests, DeleteEntitiesNegativeClauses) ASSERT_NE(subscriber_1, nullptr); // Try to delete this subscriber using the second partipant. This should return a RETCODE_PRECONDITION_NOT_MET // error code as this subscriber does not belong to the second participant - ASSERT_EQ(participant_2->delete_subscriber(subscriber_1), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant_1->delete_subscriber(subscriber_1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_2->delete_subscriber(subscriber_1), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant_1->delete_subscriber(subscriber_1), RETCODE_OK); // Create a publisher in the first participant Publisher* publisher_1 = participant_1->create_publisher(PUBLISHER_QOS_DEFAULT); ASSERT_NE(publisher_1, nullptr); // Try to delete this publisher using the second partipant. This should return a RETCODE_PRECONDITION_NOT_MET // error code as this publisher does not belong to the second participant - ASSERT_EQ(participant_2->delete_publisher(publisher_1), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(participant_1->delete_publisher(publisher_1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_2->delete_publisher(publisher_1), RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant_1->delete_publisher(publisher_1), RETCODE_OK); // Remove both participants - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_1), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_1), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_2), RETCODE_OK); } /* @@ -2725,7 +2741,7 @@ TEST(ParticipantTests, CreateEntitiesWithProfileNegativeClauses) ASSERT_EQ(topic, nullptr); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2745,10 +2761,10 @@ TEST(ParticipantTests, RegisterTypeNegativeClauses) // Create the TypeSupport with the TopicDataType with an empty name TypeSupport type(data_type); // Register the type shoul return a RETCODE_BAD_PARAMETER return code - EXPECT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_BAD_PARAMETER); + EXPECT_EQ(type.register_type(participant), RETCODE_BAD_PARAMETER); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2763,7 +2779,7 @@ TEST(ParticipantTests, AssertLivelinesNegativeClauses) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(qos), RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -2773,23 +2789,23 @@ TEST(ParticipantTests, AssertLivelinesNegativeClauses) ASSERT_FALSE(participant->is_enabled()); // Assert liveliness from a disabled participant should return a RETCODE_NOT_ENABLED return code. - ASSERT_EQ(participant->assert_liveliness(), ReturnCode_t::RETCODE_NOT_ENABLED); + ASSERT_EQ(participant->assert_liveliness(), RETCODE_NOT_ENABLED); // Change the participant QoS to disable the Writer Liveliness Protocol DomainParticipantQos pqos; - ASSERT_EQ(participant->get_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_qos(pqos), RETCODE_OK); pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_OK); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Check that an error is given at trying to assert the livelines from a participant with a disabled // Writer Liveliness Protocol (WLP writer is not defined). - ASSERT_EQ(participant->assert_liveliness(), ReturnCode_t::RETCODE_ERROR); + ASSERT_EQ(participant->assert_liveliness(), RETCODE_ERROR); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2802,8 +2818,8 @@ TEST(ParticipantTests, GetCurrentTime) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); eprosima::fastrtps::Time_t now; - ASSERT_EQ(participant->get_current_time(now), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->get_current_time(now), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2828,8 +2844,8 @@ TEST(ParticipantTests, GetParticipantConst) ASSERT_EQ(participant_pub->guid(), participant->guid()); // Remove the publisher and the participant - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -2844,7 +2860,7 @@ TEST(ParticipantTests, GetParticipantNames) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(factory->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->set_qos(qos), RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -2858,7 +2874,7 @@ TEST(ParticipantTests, GetParticipantNames) ASSERT_TRUE(participant_names.empty()); // Enable the participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + EXPECT_EQ(RETCODE_OK, participant->enable()); EXPECT_TRUE(participant->is_enabled()); // Check that the participant name is filled when the participant is enabled @@ -2866,7 +2882,7 @@ TEST(ParticipantTests, GetParticipantNames) ASSERT_FALSE(participant_names.empty()); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2898,7 +2914,7 @@ TEST(ParticipantTests, CreateTopicNegativeClauses) ASSERT_EQ(topic, nullptr); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2956,16 +2972,16 @@ TEST(ParticipantTests, ContainsEntity) ASSERT_TRUE(participant->contains_entity(data_reader_ihandle, true)); // Remove data_writer, data_reader, publisher, subscriber and topic entities. - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); // Check that the participant does not contains a removed publisher ASSERT_FALSE(participant->contains_entity(pub_ihandle, false)); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -2983,10 +2999,10 @@ TEST(ParticipantTests, UnregisterType) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); // Check that an error is given at trying to unregister a type with an empty name - ASSERT_EQ(participant->unregister_type(""), ReturnCode_t::RETCODE_BAD_PARAMETER); + ASSERT_EQ(participant->unregister_type(""), RETCODE_BAD_PARAMETER); // Check that no error is given at trying to unregister a non registered type - ASSERT_EQ(participant->unregister_type("missing_type"), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->unregister_type("missing_type"), RETCODE_OK); TypeSupport type(new TopicDataTypeMock()); type.register_type(participant); @@ -3000,10 +3016,10 @@ TEST(ParticipantTests, UnregisterType) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); // Check that an error is given at trying to unregister a type that is been used by a data_reader - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); // Create the publisher and a data_writer that use the above topic Publisher* publisher = participant->create_publisher(PUBLISHER_QOS_DEFAULT); @@ -3011,19 +3027,19 @@ TEST(ParticipantTests, UnregisterType) DataWriter* data_writer = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(data_writer, nullptr); // Check that an error is given at trying to unregister a type that is been used by a data_writer - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); // At this point, the type is not been used by any entity. // Check that no errors result when an unused topic is unregistered - ASSERT_EQ(participant->unregister_type(type.get_type_name()), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->unregister_type(type.get_type_name()), RETCODE_OK); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3041,7 +3057,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) DomainParticipantFactory* factory = DomainParticipantFactory::get_instance(); DomainParticipantFactoryQos qos; qos.entity_factory().autoenable_created_entities = false; - ASSERT_TRUE(factory->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(factory->set_qos(qos) == RETCODE_OK); // Create a disabled participant DomainParticipant* participant = @@ -3058,7 +3074,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) remote_endpoint_guid, 1, eprosima::fastrtps::rtps::EndpointKind_t::WRITER)); // Enable the participant - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); + ASSERT_EQ(RETCODE_OK, participant->enable()); ASSERT_TRUE(participant->is_enabled()); // Check that a WRITER remote endpoint is not registered in an enabled participant @@ -3069,7 +3085,7 @@ TEST(ParticipantTests, NewRemoteEndpointDiscovered) remote_endpoint_guid, 1, eprosima::fastrtps::rtps::EndpointKind_t::READER)); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3084,7 +3100,7 @@ TEST(ParticipantTests, SetDomainParticipantQos) // Change in the DomainParticipantQos object the listening socket buffer size setting of the transport qos pqos.transport().listen_socket_buffer_size = 262144; // Set the modified participant qos as the default qos - ASSERT_EQ(DomainParticipantFactory::get_instance()->set_default_participant_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->set_default_participant_qos(pqos), RETCODE_OK); DomainParticipant* participant = DomainParticipantFactory::get_instance()->create_participant( @@ -3109,7 +3125,7 @@ TEST(ParticipantTests, SetDomainParticipantQos) ASSERT_EQ(qos.transport().listen_socket_buffer_size, pqos.transport().listen_socket_buffer_size); // Remove the participant - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -3127,35 +3143,40 @@ TEST(ParticipantTests, UpdatableDomainParticipantQos) // Check that the PropertyPolicyQos can not be changed in an enabled participant participant->get_qos(pqos); pqos.properties().properties().emplace_back("dds.persistence.guid", "72.61.75.6c.5f.73.61.6e.63.68.65.7a"); - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the TransportConfigQos can not be changed in an enabled participant participant->get_qos(pqos); pqos.transport().listen_socket_buffer_size = 262144; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the builtin_controllers_sender_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.builtin_controllers_sender_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the timed_events_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.timed_events_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); // Check that the discovery_server_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.discovery_server_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); + + // Check that the typelookup_service_thread can not be changed in an enabled participant + participant->get_qos(pqos); + pqos.typelookup_service_thread().affinity = 1; + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); #if HAVE_SECURITY // Check that the security_log_thread can not be changed in an enabled participant participant->get_qos(pqos); pqos.security_log_thread().affinity = 1; - ASSERT_EQ(participant->set_qos(pqos), ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_EQ(participant->set_qos(pqos), RETCODE_IMMUTABLE_POLICY); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); #endif // if HAVE_SECURITY } @@ -3176,419 +3197,24 @@ TEST(ParticipantTests, RegisterDynamicTypeToFactories) (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); // Create the dynamic type builder - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - DynamicTypeBuilder_ptr builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - builder->add_member(0, "uint", base_type); + traits::ref_type type_descriptor = traits::make_shared(); + type_descriptor->kind(TK_STRUCTURE); + type_descriptor->name("mystruct"); + traits::ref_type builder {DynamicTypeBuilderFactory::get_instance()->create_type(type_descriptor)}; + traits::ref_type member_descriptor = traits::make_shared(); + member_descriptor->type(DynamicTypeBuilderFactory::get_instance()->get_primitive_type(TK_UINT32)); + member_descriptor->name("myuint"); + builder->add_member(member_descriptor); // Build the complete dynamic type - DynamicType_ptr dyn_type = builder->build(); + traits::ref_type dyn_type {builder->build()}; // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); + traits::ref_type data {DynamicDataFactory::get_instance()->create_data(dyn_type)}; // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - // Activating the auto_fill_type_information or the auto_fill_type_object settings, the participant will try to - // add the type dynamic type factories - type->auto_fill_type_information(true); - type->auto_fill_type_object(true); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + TypeSupport type(new DynamicPubSubType(dyn_type)); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test adds a complete dynamic type to the participant dynamic type factories without enabling the - * auto_fill_type_information setting - */ -TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotFillTypeInfo) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - // Create a disabled participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - - // Create the dynamic type builder - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - DynamicTypeBuilder_ptr builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - builder->add_member(0, "uint", base_type); - - // Build the complete dynamic type - DynamicType_ptr dyn_type = builder->build(); - // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type->auto_fill_type_information(false); - type->auto_fill_type_object(true); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -// Mocked DynamicType for DynamicType creation tests -class DynamicTypeMock : public eprosima::fastrtps::types::DynamicType -{ -public: - - DynamicTypeMock( - const eprosima::fastrtps::types::TypeDescriptor* descriptor) - : eprosima::fastrtps::types::DynamicType(descriptor) - { - } - - DynamicType_ptr get_base_type_wrapper() const - { - return get_base_type(); - } - -}; - -/* - * This test attempts to add a non supported custom dynamic type to the participant dynamic type factories. The type - * should be registered in the participant but not added to the dynamic types factories. - */ -TEST(ParticipantTests, RegisterDynamicTypeToFactoriesNotTypeIdentifier) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - // Create a disabled participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, PARTICIPANT_QOS_DEFAULT); - - // Create a not supported TypeDescriptor - const TypeDescriptor* myDescriptor = new TypeDescriptor("my_descriptor", 0x11); - // Create the base type for the dynamic type - DynamicType_ptr base_type(new DynamicTypeMock(myDescriptor)); - // Create a custom dynamic type builder using the wrong TypeDescriptor - DynamicTypeBuilder_ptr builder = - DynamicTypeBuilderFactory::get_instance()->create_custom_builder(myDescriptor, "my_dynamic_type"); - builder->add_member(0, "uint", base_type); - // Create the dynamic type - DynamicType_ptr dyn_type = builder->build(); - // Create the data instance - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type->auto_fill_type_information(true); - type->auto_fill_type_object(true); - type.register_type(participant); - - TypeSupport ret_type = participant->find_type("my_dynamic_type"); - - // The type is registered in the participant but not in the dynamic types factories - ASSERT_FALSE(ret_type.empty()); - - // Remove TypeDescriptor before closing - delete myDescriptor; - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test create a sequence of TypeIdentifiers to call the get_types() DomainParticipant function. It should return - * the TypeObjects associated with the TypeIdentifiers. Finally, the test checks that the writer guid prefix given by - * the TypeObject is the same as the DomainPartipant guid prefix. - */ -TEST(ParticipantTests, GetTypes) -{ - // Create the participant - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.typelookup_config.use_client = true; - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, pqos); - - // Create the dynamic type builder - DynamicTypeBuilder_ptr builder_string = DynamicTypeBuilderFactory::get_instance()->create_string_builder(100); - // Create the dynamic type - DynamicType_ptr dyn_type_string = builder_string->build(); - TypeSupport type_string(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type_string)); - // Create the data instance - DynamicData_ptr data_string(DynamicDataFactory::get_instance()->create_data(dyn_type_string)); - data_string->set_string_value("Dynamic String"); - - // Register the type - type_string->auto_fill_type_information(true); - type_string->auto_fill_type_object(true); - type_string.register_type(participant); - - // Create the sequence of TypeIdentifiers - const fastrtps::types::TypeIdentifier* indentifier_string = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - type_string.get_type_name()); - - fastrtps::types::TypeIdentifierSeq types; - types.push_back(*indentifier_string); - - // Checks that the writer guid prefix given by the TypeObject is the same as the DomainPartipant guid prefix - ASSERT_EQ(participant->guid().guidPrefix, participant->get_types(types).writer_guid().guidPrefix); - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test create a sequence of TypeIdentifiers to call the get_type_dependencies() DomainParticipant function. - * Finally, the test checks that the writer guid prefix given by the TypeObject is the same as the DomainPartipant - * guid prefix. - */ -TEST(ParticipantTests, GetTypeDependencies) -{ - // Create the participant - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.typelookup_config.use_client = true; - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant( - (uint32_t)GET_PID() % 230, pqos); - - // Create the dynamic type builder - DynamicTypeBuilder_ptr builder_string = DynamicTypeBuilderFactory::get_instance()->create_string_builder(100); - // Create the dynamic type - DynamicType_ptr dyn_type_string = builder_string->build(); - TypeSupport type_string(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type_string)); - // Create the data instance - DynamicData_ptr data_string(DynamicDataFactory::get_instance()->create_data(dyn_type_string)); - data_string->set_string_value("Dynamic String"); - - // Register the type - type_string->auto_fill_type_information(true); - type_string->auto_fill_type_object(true); - type_string.register_type(participant); - - // Create the sequence of TypeIdentifiers - const fastrtps::types::TypeIdentifier* indentifier_string = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - type_string.get_type_name()); - - fastrtps::types::TypeIdentifierSeq types; - types.push_back(*indentifier_string); - - // Checks that the writer guid prefix given by the TypeObject is the same as the DomainPartipant guid prefix - ASSERT_EQ(participant->guid().guidPrefix, participant->get_type_dependencies(types).writer_guid().guidPrefix); - - // Remove the participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test create two participants which will share a complete dynamic type. - * 1. The remote participant registers a dynamic type - * 2. The local participant register the dynamic type of the remote participant using the TypeInformation and the type - * name - * 3. Check that the type is not registered if the local participant is disabled - * 4. Check that the type is registered if the local participant is enabled - */ -TEST(ParticipantTests, RegisterRemoteTypeComplete) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - uint32_t domain_id = (uint32_t)GET_PID() % 230; - - // Create the remote participant and enable it - DomainParticipant* remote_participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, remote_participant->enable()); - EXPECT_TRUE(remote_participant->is_enabled()); - - // Create the local participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - - // Create the complete dynamic type builder - DynamicTypeBuilder_ptr int32_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - DynamicTypeBuilder_ptr seqLong_builder = - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(int32_builder.get()); - DynamicTypeBuilder_ptr mySequenceLong_builder = - DynamicTypeBuilderFactory::get_instance()->create_alias_builder(seqLong_builder.get(), "MySequenceLong"); - // Build the dynamic type - DynamicType_ptr dyn_type = mySequenceLong_builder->build(); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type.register_type(remote_participant); - - // Retrieve the Typeidentifier, the type name and the TypeInformation from the TypeObjectFactory - const fastrtps::types::TypeIdentifier* identifier = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - type.get_type_name()); - - std::string type_name = fastrtps::types::TypeObjectFactory::get_instance()->get_type_name(identifier); - - const fastrtps::types::TypeInformation* type_information = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_information(type_name); - - Topic* topic = remote_participant->create_topic("footopic", type.get_type_name(), TOPIC_QOS_DEFAULT); - ASSERT_NE(topic, nullptr); - - // Create the functor for the remote type registration - std::string topic_name = "footopic"; - std::function callback = - [topic_name](const std::string&, const fastrtps::types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - }; - - // Register the remote type in the disabled local participant. This should return a RETCODE_NOT_ENABLED return code - ASSERT_EQ(participant->register_remote_type(*type_information, type.get_type_name(), callback), - ReturnCode_t::RETCODE_NOT_ENABLED); - - // Enable the local participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); - EXPECT_TRUE(participant->is_enabled()); - - // Register the remote type in the disabled local participant - ASSERT_EQ(participant->register_remote_type(*type_information, type_name, callback), - ReturnCode_t::RETCODE_OK); - - // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test create two participants which will share a minimal dynamic type. - * 1. The remote participant registers a dynamic type - * 2. The local participant register the dynamic type of the remote participant using the TypeInformation and the type - * name - * 3. Check that the type is not registered if the local participant is disabled - * 4. Check that the type is registered if the local participant is enabled - */ -TEST(ParticipantTests, RegisterRemoteTypeMinimal) -{ - // Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - uint32_t domain_id = (uint32_t)GET_PID() % 230; - - // Create the remote participant and enable it - DomainParticipant* remote_participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, remote_participant->enable()); - EXPECT_TRUE(remote_participant->is_enabled()); - - // Create the local participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - - // Create the minimal dynamic type builder - DynamicTypeBuilder_ptr builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); - // Build the dynamic type - DynamicType_ptr dyn_type = DynamicTypeBuilderFactory::get_instance()->create_type(builder.get()); - DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - data->set_string_value("Dynamic Char16"); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type.register_type(remote_participant); - - // Retrieve the Typeidentifier, the type name and the TypeInformation from the TypeObjectFactory - const fastrtps::types::TypeIdentifier* identifier = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete( - type.get_type_name()); - - std::string type_name = fastrtps::types::TypeObjectFactory::get_instance()->get_type_name(identifier); - - const fastrtps::types::TypeInformation* type_information = - fastrtps::types::TypeObjectFactory::get_instance()->get_type_information(type_name); - - Topic* topic = remote_participant->create_topic("footopic", type.get_type_name(), TOPIC_QOS_DEFAULT); - ASSERT_NE(topic, nullptr); - - // Create the functor for the remote type registration - std::string topic_name = "footopic"; - std::function callback = - [topic_name](const std::string&, const fastrtps::types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - }; - - // Register the remote type in the disabled local participant. This should return a RETCODE_NOT_ENABLED return code - ASSERT_EQ(participant->register_remote_type(*type_information, type.get_type_name(), callback), - ReturnCode_t::RETCODE_NOT_ENABLED); - - // Enable the local participant - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->enable()); - EXPECT_TRUE(participant->is_enabled()); - - // Register the remote type in the disabled local participant - ASSERT_EQ(participant->register_remote_type(*type_information, type_name, callback), - ReturnCode_t::RETCODE_OK); - - // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); -} - -/* - * This test checks that a RETCODE_PRECONDITION_NOT_MET error code is returned when registering a dynamic remote type - * with an empty TypeInformation - */ -TEST(ParticipantTests, RegisterRemoteTypePreconditionNotMet) -{ - uint32_t domain_id = (uint32_t)GET_PID() % 230; - - // Create the remote participant - DomainParticipant* remote_participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - - // Create the local participant - DomainParticipant* participant = - DomainParticipantFactory::get_instance()->create_participant(domain_id, PARTICIPANT_QOS_DEFAULT); - - // Create the type builder - DynamicTypeBuilder_ptr int32_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - DynamicTypeBuilder_ptr seqLong_builder = - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(int32_builder.get()); - DynamicTypeBuilder_ptr mySequenceLong_builder = - DynamicTypeBuilderFactory::get_instance()->create_alias_builder(seqLong_builder.get(), "MySequenceLong"); - // Build the dynamic type - DynamicType_ptr dyn_type = mySequenceLong_builder->build(); - - // Register the type - TypeSupport type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - type.register_type(remote_participant); - - Topic* topic = remote_participant->create_topic("footopic", type.get_type_name(), TOPIC_QOS_DEFAULT); - ASSERT_NE(topic, nullptr); - - // Create the functor for the remote type registration - std::string topic_name = "footopic"; - std::function callback = - [topic_name](const std::string&, const fastrtps::types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - }; - - // Create an empty TypeInformation - fastrtps::types::TypeInformation info = fastrtps::types::TypeInformation(); - // Check that register_remote_type() returns RETCODE_PRECONDITION_NOT_MET if the TypeInformation is empty - ASSERT_EQ(participant->register_remote_type(info, type.get_type_name(), callback), - ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); - - // Remove the topic and both participants - ASSERT_EQ(remote_participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(remote_participant), - ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Delete contained entities test @@ -3668,7 +3294,7 @@ TEST(ParticipantTests, DeleteContainedEntities) // Setup done, start the actual testing void* loan_data; - ASSERT_EQ(data_writer_foo->loan_sample(loan_data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_writer_foo->loan_sample(loan_data), RETCODE_OK); // Writer with active loans. Fail and keep everything as is @@ -3679,7 +3305,7 @@ TEST(ParticipantTests, DeleteContainedEntities) EXPECT_EQ(data_writer_list.size(), 2u); subscriber->get_datareaders(data_reader_list); EXPECT_EQ(data_reader_list.size(), 1u); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(retcode, RETCODE_PRECONDITION_NOT_MET); data_writer_list.clear(); data_reader_list.clear(); @@ -3688,11 +3314,11 @@ TEST(ParticipantTests, DeleteContainedEntities) // Reader with active loans. Fail and keep everything as is - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_bar->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_bar->write(&data, HANDLE_NIL)); Duration_t wait_time(1, 0); EXPECT_TRUE(data_reader_bar->wait_for_unread_message(wait_time)); - ASSERT_EQ(data_reader_bar->take(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_bar->take(mock_coll, mock_seq), RETCODE_OK); retcode = participant->delete_contained_entities(); @@ -3702,12 +3328,12 @@ TEST(ParticipantTests, DeleteContainedEntities) subscriber->get_datareaders(data_reader_list); EXPECT_EQ(data_reader_list.size(), 1u); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(retcode, RETCODE_PRECONDITION_NOT_MET); data_writer_list.clear(); data_reader_list.clear(); - ASSERT_EQ(data_reader_bar->return_loan(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_bar->return_loan(mock_coll, mock_seq), RETCODE_OK); QueryCondition* query_condition = data_reader_bar->create_querycondition( mock_sample_state_kind, @@ -3729,7 +3355,7 @@ TEST(ParticipantTests, DeleteContainedEntities) // ContentFilteredTopic is not considered an entity EXPECT_EQ(participant->lookup_topicdescription("contentfilteredtopic"), nullptr); - ASSERT_EQ(retcode, ReturnCode_t::RETCODE_OK); + ASSERT_EQ(retcode, RETCODE_OK); } @@ -3770,11 +3396,11 @@ TEST(ParticipantTests, ContentFilterInterfaces) if (filter_parameters.length() == std::count(s.begin(), s.end(), '%')) { filter_instance = this; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } virtual ReturnCode_t delete_content_filter( @@ -3783,10 +3409,10 @@ TEST(ParticipantTests, ContentFilterInterfaces) { if (this == filter_instance) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return RETCODE_BAD_PARAMETER; } }; @@ -3805,8 +3431,8 @@ TEST(ParticipantTests, ContentFilterInterfaces) // Create a type and a topics TypeSupport type(new TopicDataTypeMock()); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(type.register_type(participant2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); + ASSERT_EQ(type.register_type(participant2), RETCODE_OK); Topic* topic = participant->create_topic("topic", type.get_type_name(), TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -3830,18 +3456,18 @@ TEST(ParticipantTests, ContentFilterInterfaces) EXPECT_EQ(nullptr, participant->create_contentfilteredtopic("contentfilteredtopic", topic, "", {}, nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, participant->delete_contentfilteredtopic(nullptr)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->delete_contentfilteredtopic(nullptr)); } // Negative tests for register_content_filter_factory { - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(nullptr, &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(very_long_name.c_str(), &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->register_content_filter_factory(TEST_FILTER_CLASS, nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->register_content_filter_factory(FASTDDS_SQLFILTER_NAME, &test_filter)); } @@ -3854,32 +3480,32 @@ TEST(ParticipantTests, ContentFilterInterfaces) // Negative tests for unregister_content_filter_factory { - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, participant->unregister_content_filter_factory(nullptr)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_BAD_PARAMETER, participant->unregister_content_filter_factory(nullptr)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(FASTDDS_SQLFILTER_NAME)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); } // Custom filter factory registration { // Register filter factory - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); // Lookup should return same pointer as the one registered EXPECT_EQ(&test_filter, participant->lookup_content_filter_factory(TEST_FILTER_CLASS)); // But not for other filter class name EXPECT_EQ(nullptr, participant->lookup_content_filter_factory(OTHER_FILTER_CLASS)); // Should not be able to register twice - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); // Unregister filter factory - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); // Lookup should now return nullptr EXPECT_EQ(nullptr, participant->lookup_content_filter_factory(TEST_FILTER_CLASS)); // Unregister twice should fail - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); } @@ -3889,9 +3515,9 @@ TEST(ParticipantTests, ContentFilterInterfaces) participant->create_contentfilteredtopic("contentfilteredtopic", topic, "", {}, TEST_FILTER_CLASS)); // Register two filter factories to ensure traversal of collections - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(TEST_FILTER_CLASS, &test_filter)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->register_content_filter_factory(OTHER_FILTER_CLASS, &test_filter)); // Negative tests for custom filtered topic creation @@ -3923,12 +3549,12 @@ TEST(ParticipantTests, ContentFilterInterfaces) EXPECT_EQ(filtered_topic2, participant->lookup_topicdescription("contentfilteredtopic2")); // Should not be able to delete topic, since it is referenced by filtered_topic - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant->delete_topic(topic)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->delete_topic(topic)); // Should not be able to unregister filter factory, since it is referenced by filtered_topic - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->unregister_content_filter_factory(OTHER_FILTER_CLASS)); // Reference filtered_topic by creating a DataReader @@ -3938,31 +3564,31 @@ TEST(ParticipantTests, ContentFilterInterfaces) ASSERT_NE(nullptr, data_reader); // Should not be able to delete filtered_topic, since it is referenced by data_reader - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, participant->delete_contentfilteredtopic(filtered_topic)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(filtered_topic, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, subscriber->delete_datareader(data_reader)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_subscriber(subscriber)); + EXPECT_EQ(RETCODE_OK, subscriber->delete_datareader(data_reader)); + EXPECT_EQ(RETCODE_OK, participant->delete_subscriber(subscriber)); // Should be able to delete filtered_topic, but only on correct participant - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, participant2->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(filtered_topic, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic)); + EXPECT_EQ(RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic)); EXPECT_EQ(nullptr, participant->lookup_topicdescription("contentfilteredtopic")); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic2)); + EXPECT_EQ(RETCODE_OK, participant->delete_contentfilteredtopic(filtered_topic2)); // Unregister filter factories - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(TEST_FILTER_CLASS)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, + EXPECT_EQ(RETCODE_OK, participant->unregister_content_filter_factory(OTHER_FILTER_CLASS)); } - ASSERT_EQ(participant2->delete_topic(topic2), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant2), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant2->delete_topic(topic2), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant2), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -3989,7 +3615,7 @@ TEST(ParticipantTests, UnsupportedMethods) // Create a type and a topic TypeSupport type(new TopicDataTypeMock()); - ASSERT_EQ(type.register_type(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(type.register_type(participant), RETCODE_OK); Topic* topic = participant->create_topic("topic", type.get_type_name(), TOPIC_QOS_DEFAULT); ASSERT_NE(topic, nullptr); @@ -4003,29 +3629,29 @@ TEST(ParticipantTests, UnsupportedMethods) nullptr); // nullptr use as there are not such a class - ASSERT_EQ(participant->delete_multitopic(nullptr), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->delete_multitopic(nullptr), RETCODE_UNSUPPORTED); ASSERT_EQ(participant->get_builtin_subscriber(), nullptr); - ASSERT_EQ(participant->ignore_topic(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->ignore_publication(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->ignore_subscription(InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_topic(InstanceHandle_t()), RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_publication(InstanceHandle_t()), RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->ignore_subscription(InstanceHandle_t()), RETCODE_UNSUPPORTED); // Discovery methods std::vector handle_vector({InstanceHandle_t()}); builtin::ParticipantBuiltinTopicData pbtd; builtin::TopicBuiltinTopicData tbtd; - ASSERT_EQ(participant->get_discovered_participants(handle_vector), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->get_discovered_participants(handle_vector), RETCODE_UNSUPPORTED); ASSERT_EQ( - participant->get_discovered_participant_data(pbtd, InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + participant->get_discovered_participant_data(pbtd, InstanceHandle_t()), RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->get_discovered_topics(handle_vector), ReturnCode_t::RETCODE_UNSUPPORTED); + ASSERT_EQ(participant->get_discovered_topics(handle_vector), RETCODE_UNSUPPORTED); ASSERT_EQ( - participant->get_discovered_topic_data(tbtd, InstanceHandle_t()), ReturnCode_t::RETCODE_UNSUPPORTED); + participant->get_discovered_topic_data(tbtd, InstanceHandle_t()), RETCODE_UNSUPPORTED); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -4051,15 +3677,15 @@ TEST(ParticipantTests, TwoParticipantWithSameFixedId) ASSERT_EQ(participant2, nullptr); // Destroy the first participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), RETCODE_OK); } // Test participants disabled from beginning { DomainParticipantFactoryQos factory_qos; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->get_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->get_qos(factory_qos)); factory_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); DomainParticipantQos participant_qos; participant_qos.wire_protocol().participant_id = 1; @@ -4074,13 +3700,13 @@ TEST(ParticipantTests, TwoParticipantWithSameFixedId) DomainParticipantFactory::get_instance()->create_participant(0, participant_qos); ASSERT_EQ(participant2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, participant1->enable()); + ASSERT_EQ(RETCODE_OK, participant1->enable()); // Destroy the first participant - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant1), RETCODE_OK); factory_qos.entity_factory().autoenable_created_entities = true; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); + ASSERT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->set_qos(factory_qos)); } } @@ -4112,7 +3738,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4140,7 +3766,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4168,7 +3794,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4196,7 +3822,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4224,7 +3850,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4266,7 +3892,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } { @@ -4308,7 +3934,7 @@ TEST(ParticipantTests, ParticipantCreationWithBuiltinTransport) }; EXPECT_TRUE(transport_check(attributes_)); EXPECT_FALSE(attributes_.useBuiltinTransports); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } } @@ -4331,7 +3957,7 @@ class BuiltinTransportsOptionsTest get_rtps_attributes(participant_, attr); EXPECT_TRUE(check_options_attr(attr, options)); EXPECT_EQ(attr.userTransports.size(), 3u); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } static void test_default_correct_participant_with_env( @@ -4365,7 +3991,7 @@ class BuiltinTransportsOptionsTest } EXPECT_TRUE(udp_ok); EXPECT_EQ(attr.userTransports.size(), 2u); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } static void test_wrong_participant_with_env( @@ -4381,7 +4007,7 @@ class BuiltinTransportsOptionsTest fastrtps::rtps::RTPSParticipantAttributes attr; get_rtps_attributes(participant_, attr); EXPECT_TRUE(check_default_participant(attr)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } static void apply_option_to_env( @@ -4535,7 +4161,7 @@ TEST(ParticipantTests, ParticipantCreationWithLargeDataOptionsThroughAPI) EXPECT_TRUE(BuiltinTransportsOptionsTest::check_options_attr(attr, options)); EXPECT_EQ(attr.userTransports.size(), 3u); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); + EXPECT_EQ(RETCODE_OK, DomainParticipantFactory::get_instance()->delete_participant(participant_)); } TEST(ParticipantTests, ParticipantCreationWithLargeDataOptionsThroughEnvVar) diff --git a/test/unittest/dds/profiles/test_xml_for_string_profile.xml b/test/unittest/dds/profiles/test_xml_for_string_profile.xml index 0f25801a726..b82c883fcaa 100644 --- a/test/unittest/dds/profiles/test_xml_for_string_profile.xml +++ b/test/unittest/dds/profiles/test_xml_for_string_profile.xml @@ -1,5 +1,5 @@ - + FULL @@ -138,6 +138,10 @@ 15 1048576 + + 15 + 1048576 + 15 1048576 @@ -283,6 +287,10 @@ 15 1048576 + + 15 + 1048576 + 15 1048576 diff --git a/test/unittest/dds/profiles/test_xml_profile.xml b/test/unittest/dds/profiles/test_xml_profile.xml index 791c89cc146..3d8c3604ed8 100644 --- a/test/unittest/dds/profiles/test_xml_profile.xml +++ b/test/unittest/dds/profiles/test_xml_profile.xml @@ -1,5 +1,5 @@ - + 123 @@ -135,6 +135,10 @@ 15 1048576 + + 15 + 1048576 + 15 1048576 @@ -280,6 +284,10 @@ 15 1048576 + + 15 + 1048576 + 15 1048576 @@ -699,6 +707,50 @@ 50 + + + request_topic_name + reply_topic_name + + + + MANUAL_BY_TOPIC + + + + + + + MANUAL_BY_TOPIC + + + + + + + request_topic_name + reply_topic_name + + + + MANUAL_BY_TOPIC + + + + + + + MANUAL_BY_TOPIC + + + + FULL diff --git a/test/unittest/dds/publisher/CMakeLists.txt b/test/unittest/dds/publisher/CMakeLists.txt index 72e1e505d3f..cd3f207bfb5 100644 --- a/test/unittest/dds/publisher/CMakeLists.txt +++ b/test/unittest/dds/publisher/CMakeLists.txt @@ -32,32 +32,11 @@ set(sqlite3_source_files set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${DDSSQLFILTER_SOURCES} - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -71,11 +50,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/Publisher.cpp @@ -200,12 +174,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -214,6 +182,12 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) if(SQLITE3_SUPPORT) @@ -235,12 +209,10 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ) list(APPEND DATAWRITERTESTS_SOURCE ${statistics_sources}) @@ -307,7 +279,6 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp endif(TINYXML2_INCLUDE_DIR) set(PUBLISHERTESTS_SOURCE PublisherTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dds/pub/DataWriter.cpp ) if(WIN32) @@ -342,7 +313,7 @@ target_include_directories(PublisherTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(PublisherTests fastrtps fastcdr foonathan_memory +target_link_libraries(PublisherTests fastdds fastcdr foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) if(QNX) @@ -369,14 +340,19 @@ target_compile_definitions(DataWriterTests PRIVATE ) target_include_directories(DataWriterTests PRIVATE $<$:${OPENSSL_INCLUDE_DIR}> - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PublisherHistory + ${PROJECT_SOURCE_DIR}/test/mock/dds/DataWriterHistory ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/cpp ${THIRDPARTY_BOOST_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(DataWriterTests fastcdr foonathan_memory +target_link_libraries(DataWriterTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} ${TINYXML2_LIBRARY} diff --git a/test/unittest/dds/publisher/DataWriterTests.cpp b/test/unittest/dds/publisher/DataWriterTests.cpp index 529a46ca80d..04773355cba 100644 --- a/test/unittest/dds/publisher/DataWriterTests.cpp +++ b/test/unittest/dds/publisher/DataWriterTests.cpp @@ -22,10 +22,6 @@ #include #include -#include -#include -#include -#include #include #include #include @@ -40,10 +36,11 @@ #include #include #include -#include #include #include +#include + #include "../../common/CustomPayloadPool.hpp" #include "../../logging/mock/MockConsumer.h" @@ -360,10 +357,10 @@ TEST(DataWriterTests, get_type) ASSERT_EQ(type, datawriter->get_type()); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /*! @@ -375,9 +372,10 @@ TEST(DataWriterTests, get_guid) { public: - void on_publisher_discovery( + void on_data_writer_discovery( DomainParticipant*, - fastrtps::rtps::WriterDiscoveryInfo&& info) + fastrtps::rtps::WriterDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { std::unique_lock lock(mutex); if (fastrtps::rtps::WriterDiscoveryInfo::DISCOVERED_WRITER == info.status) @@ -393,7 +391,7 @@ TEST(DataWriterTests, get_guid) private: - using DomainParticipantListener::on_publisher_discovery; + using DomainParticipantListener::on_data_writer_discovery; } discovery_listener; @@ -444,12 +442,12 @@ TEST(DataWriterTests, get_guid) } ASSERT_EQ(guid, discovery_listener.guid); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - listener_participant) == ReturnCode_t::RETCODE_OK); + listener_participant) == RETCODE_OK); } TEST(DataWriterTests, ChangeDataWriterQos) @@ -476,17 +474,17 @@ TEST(DataWriterTests, ChangeDataWriterQos) qos.deadline().period = 260; - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_OK); DataWriterQos wqos; datawriter->get_qos(wqos); ASSERT_EQ(qos, wqos); ASSERT_EQ(wqos.deadline().period, 260); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, ChangeImmutableDataWriterQos) @@ -517,29 +515,29 @@ TEST(DataWriterTests, ChangeImmutableDataWriterQos) qos.reliable_writer_qos().disable_positive_acks.enabled = true; - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_OK); DataWriterQos wqos; datawriter->get_qos(wqos); ASSERT_EQ(qos, wqos); ASSERT_TRUE(wqos.reliable_writer_qos().disable_positive_acks.enabled); - ASSERT_TRUE(datawriter->enable() == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(datawriter->enable() == RETCODE_OK); ASSERT_TRUE(datawriter->is_enabled()); qos.reliable_writer_qos().disable_positive_acks.enabled = false; ASSERT_FALSE(qos == wqos); - ASSERT_TRUE(datawriter->set_qos(qos) == ReturnCode_t::RETCODE_IMMUTABLE_POLICY); + ASSERT_TRUE(datawriter->set_qos(qos) == RETCODE_IMMUTABLE_POLICY); DataWriterQos wqos2; datawriter->get_qos(wqos2); ASSERT_EQ(wqos, wqos2); ASSERT_TRUE(wqos2.reliable_writer_qos().disable_positive_acks.enabled); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, ForcedDataSharing) @@ -572,12 +570,12 @@ TEST(DataWriterTests, ForcedDataSharing) qos.endpoint().history_memory_policy = fastrtps::rtps::PREALLOCATED_MEMORY_MODE; datawriter = publisher->create_datawriter(topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing automatic, bounded topic data type datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing enabled, unbounded topic data type qos = DATAWRITER_QOS_DEFAULT; @@ -589,7 +587,7 @@ TEST(DataWriterTests, ForcedDataSharing) // DataSharing enabled, bounded topic data type datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); // DataSharing enabled, bounded topic data type, Dynamic memory policy qos = DATAWRITER_QOS_DEFAULT; @@ -598,10 +596,10 @@ TEST(DataWriterTests, ForcedDataSharing) datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_EQ(datawriter, nullptr); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(bounded_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(bounded_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); // DataSharing forced, bounded topic data type, security enabled @@ -650,9 +648,9 @@ TEST(DataWriterTests, ForcedDataSharing) datawriter = publisher->create_datawriter(bounded_topic, qos); ASSERT_EQ(datawriter, nullptr); - ASSERT_EQ(participant->delete_topic(bounded_topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(bounded_topic), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); #endif // HAS_SECURITY } @@ -676,7 +674,7 @@ TEST(DataWriterTests, InvalidQos) ASSERT_NE(datawriter, nullptr); /* Unsupported QoS */ - const ReturnCode_t unsupported_code = ReturnCode_t::RETCODE_UNSUPPORTED; + const ReturnCode_t unsupported_code = RETCODE_UNSUPPORTED; DataWriterQos qos; qos = DATAWRITER_QOS_DEFAULT; @@ -692,7 +690,7 @@ TEST(DataWriterTests, InvalidQos) EXPECT_EQ(unsupported_code, datawriter->set_qos(qos)); /* Inconsistent QoS */ - const ReturnCode_t inconsistent_code = ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + const ReturnCode_t inconsistent_code = RETCODE_INCONSISTENT_POLICY; qos = DATAWRITER_QOS_DEFAULT; qos.properties().properties().emplace_back("fastdds.push_mode", "false"); @@ -721,26 +719,26 @@ TEST(DataWriterTests, InvalidQos) EXPECT_EQ(inconsistent_code, datawriter->set_qos(qos)); qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_MEMORY_MODE; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); qos.endpoint().history_memory_policy = eprosima::fastrtps::rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); qos = DATAWRITER_QOS_DEFAULT; qos.history().kind = KEEP_LAST_HISTORY_QOS; qos.history().depth = 0; EXPECT_EQ(inconsistent_code, datawriter->set_qos(qos)); // KEEP LAST 0 is inconsistent qos.history().depth = 2; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); // KEEP LAST 2 is OK + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); // KEEP LAST 2 is OK // KEEP LAST 2000 but max_samples_per_instance default (400) is inconsistent but right now it only shows a warning // This test will fail whenever we enforce the consistency between depth and max_samples_per_instance. qos.history().depth = 2000; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->set_qos(qos)); + EXPECT_EQ(RETCODE_OK, datawriter->set_qos(qos)); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } //TODO: Activate the test once PSM API for DataWriter is in place @@ -783,15 +781,15 @@ TEST(DataWriterTests, Write) FooType data; data.message("HelloWorld"); - ASSERT_FALSE(datawriter->write(nullptr, HANDLE_NIL) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(datawriter->write(&data, HANDLE_NIL) == ReturnCode_t::RETCODE_OK); + ASSERT_FALSE(datawriter->write(nullptr, HANDLE_NIL) == RETCODE_OK); + ASSERT_TRUE(datawriter->write(&data, HANDLE_NIL) == RETCODE_OK); ASSERT_TRUE(datawriter->write(&data, participant->get_instance_handle()) == - ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + RETCODE_PRECONDITION_NOT_MET); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, WriteWithTimestamp) @@ -818,22 +816,22 @@ TEST(DataWriterTests, WriteWithTimestamp) data.message("HelloWorld"); // 1. Calling write with nullptr data returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(nullptr, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(nullptr, HANDLE_NIL, ts)); // 2. Calling write with an invalid timestamps returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(&data, HANDLE_NIL, fastrtps::c_TimeInfinite)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->write_w_timestamp(&data, HANDLE_NIL, fastrtps::c_TimeInvalid)); // 3. Calling write with a wrong instance handle returns RETCODE_PRECONDITION_NOT_MET - ASSERT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + ASSERT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->write_w_timestamp(&data, participant->get_instance_handle(), ts)); // 4. Correct case - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void set_listener_test ( @@ -841,7 +839,7 @@ void set_listener_test ( DataWriterListener* listener, StatusMask mask) { - ASSERT_EQ(writer->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(writer->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(writer->get_status_mask(), mask); } @@ -894,10 +892,10 @@ TEST(DataWriterTests, SetListener) std::get<2>(testing_case)); } - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(DataWriterTests, TerminateWithoutDestroyingWriter) @@ -985,11 +983,11 @@ TEST(DataWriterTests, RegisterInstance) EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance(&data)); // 2. Calling register_instance in a non keyed topic returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); EXPECT_EQ(HANDLE_NIL, datawriter->register_instance(&data)); // 3. Calling register_instance with an invalid sample returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance(nullptr)); // 4. Calling register_instance with a valid key returns a valid handle @@ -1017,11 +1015,11 @@ TEST(DataWriterTests, RegisterInstanceWithTimestamp) EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance_w_timestamp(&data, ts)); // 2. Calling register_instance_w_timestamp in a non keyed topic returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); EXPECT_EQ(HANDLE_NIL, datawriter->register_instance_w_timestamp(&data, ts)); // 3. Calling register_instance with an invalid sample returns HANDLE_NIL - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); EXPECT_EQ(HANDLE_NIL, instance_datawriter->register_instance_w_timestamp(nullptr, ts)); // 4. Calling register_instance with an invalid timestamps returns HANDLE_NIL @@ -1049,34 +1047,34 @@ TEST(DataWriterTests, UnregisterInstance) create_writers_for_instance_test(datawriter, instance_datawriter, &instance_type); // 1. Calling unregister_instance in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->unregister_instance(&data, handle)); // 2. Calling unregister_instance in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance(&data, handle)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance(&data, handle)); // 3. Calling unregister_instance with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance(nullptr, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance(nullptr, handle)); #if !defined(NDEBUG) // 4. Calling unregister_instance with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, datawriter->get_instance_handle())); #endif // NDEBUG // 5. Calling unregister_instance with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance(&data, handle)); // 6. Calling unregister_instance with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); // 7. Calling unregister_instance with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&data, handle)); // TODO(jlbueno) There are other possible errors sending the unregister message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1101,45 +1099,45 @@ TEST(DataWriterTests, UnregisterInstanceWithTimestamp) eprosima::fastrtps::Time_t ts{ 0, 1 }; // 1. Calling unregister_instance in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 2. Calling unregister_instance in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 3. Calling unregister_instance with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(nullptr, handle, ts)); #if !defined(NDEBUG) // 4. Calling unregister_instance with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, datawriter->get_instance_handle(), ts)); #endif // NDEBUG // 5. Calling unregister_instance with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 6. Calling unregister_instance with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 7. Calling unregister_instance with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // 8. Check invalid timestamps - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); ts = eprosima::fastrtps::c_TimeInfinite; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); ts = eprosima::fastrtps::c_TimeInvalid; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->unregister_instance_w_timestamp(&data, handle, ts)); // TODO(jlbueno) There are other possible errors sending the unregister message: RETCODE_OUT_OF_RESOURCES, @@ -1163,34 +1161,34 @@ TEST(DataWriterTests, Dispose) create_writers_for_instance_test(datawriter, instance_datawriter, &instance_type); // 1. Calling dispose in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->dispose(&data, handle)); // 2. Calling dispose in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->dispose(&data, handle)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->dispose(&data, handle)); // 3. Calling dispose with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose(nullptr, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose(nullptr, handle)); #if !defined(NDEBUG) // 4. Calling dispose with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, datawriter->get_instance_handle())); #endif // NDEBUG // 5. Calling dispose with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose(&data, handle)); // 6. Calling dispose with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&data, handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose(&data, handle)); // 7. Calling dispose with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&data, handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose(&data, handle)); // TODO(jlbueno) There are other possible errors sending the dispose message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1215,41 +1213,41 @@ TEST(DataWriterTests, DisposeWithTimestamp) eprosima::fastrtps::Time_t ts{ 0, 1 }; // 1. Calling dispose in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->dispose_w_timestamp(&data, handle, ts)); // 2. Calling dispose in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->dispose_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->dispose_w_timestamp(&data, handle, ts)); // 3. Calling dispose with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(nullptr, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(nullptr, handle, ts)); #if !defined(NDEBUG) // 4. Calling dispose with an inconsistent handle returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, datawriter->get_instance_handle(), ts)); #endif // NDEBUG // 5. Calling dispose with a key not yet registered returns RETCODE_PRECONDITION_NOT_MET - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 6. Calling dispose with a valid key returns RETCODE_OK - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 7. Calling dispose with a valid InstanceHandle also returns RETCODE_OK data.message("HelloWorld_1"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // 8. Check invalid timestamps - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write_w_timestamp(&data, HANDLE_NIL, ts)); ts = eprosima::fastrtps::c_TimeInfinite; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); ts = eprosima::fastrtps::c_TimeInvalid; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->dispose_w_timestamp(&data, handle, ts)); // TODO(jlbueno) There are other possible errors sending the dispose message: RETCODE_OUT_OF_RESOURCES, // RETCODE_ERROR, and RETCODE_TIMEOUT (only if HAVE_STRICT_REALTIME has been defined). @@ -1274,39 +1272,39 @@ TEST(DataWriterTests, GetKeyValue) create_writers_for_instance_test(datawriter, instance_datawriter); // 1. Check nullptr on key_holder - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->get_key_value(nullptr, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(nullptr, wrong_handle)); // 2. Check HANDLE_NIL - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->get_key_value(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, HANDLE_NIL)); // 3. Check type should have keys, and writer should be enabled - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, instance_datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_NOT_ENABLED, instance_datawriter->get_key_value(&data, wrong_handle)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); // 4. Calling get_key_value with a key not yet registered returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, wrong_handle)); // 5. Calling get_key_value on a registered instance should work. valid_handle = instance_datawriter->register_instance(&valid_data); EXPECT_NE(HANDLE_NIL, valid_handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); // 6. Calling get_key_value on an unregistered instance should return RETCODE_BAD_PARAMETER. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->unregister_instance(&valid_data, valid_handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->get_key_value(&data, valid_handle)); // 7. Calling get_key_value with a valid instance should work - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&valid_data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); // 8. Calling get_key_value on a disposed instance should work. - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); + ASSERT_EQ(RETCODE_OK, instance_datawriter->dispose(&valid_data, valid_handle)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->get_key_value(&data, valid_handle)); } struct LoanableType @@ -1444,61 +1442,61 @@ TEST(DataWriterTests, LoanPositiveTests) void* sample = nullptr; // Loan and discard (check different initialization schemes) - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::NO_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::NO_LOAN_INITIALIZATION)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::ZERO_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::ZERO_LOAN_INITIALIZATION)); ASSERT_NE(nullptr, sample); EXPECT_EQ(0u, static_cast(sample)->index); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); ASSERT_NE(nullptr, sample); EXPECT_EQ(LoanableType::initialization_value(), static_cast(sample)->index); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); // Resource limits: // Depth has been configured to 1, so pool will allow up to depth + 1 loans. // We will check that the 3rd unreturned loan returns OUT_OF_RESOURCES. void* sample_2 = nullptr; void* sample_3 = nullptr; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample_2)); EXPECT_NE(nullptr, sample_2); - EXPECT_EQ(ReturnCode_t::RETCODE_OUT_OF_RESOURCES, datawriter->loan_sample(sample_3)); + EXPECT_EQ(RETCODE_OUT_OF_RESOURCES, datawriter->loan_sample(sample_3)); EXPECT_EQ(nullptr, sample_3); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); // Write samples, both loaned and not LoanableType data; fastrtps::rtps::InstanceHandle_t handle; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample_2)); EXPECT_NE(nullptr, sample_2); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(sample, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(sample_2, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample_2)); + EXPECT_EQ(RETCODE_OK, datawriter->write(sample, handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(sample_2, handle)); + EXPECT_EQ(RETCODE_BAD_PARAMETER, datawriter->discard_loan(sample_2)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); EXPECT_NE(nullptr, sample); - EXPECT_EQ(ReturnCode_t::RETCODE_OUT_OF_RESOURCES, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->write(&data, handle)); - - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + EXPECT_EQ(RETCODE_OUT_OF_RESOURCES, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + EXPECT_EQ(RETCODE_OK, datawriter->write(&data, handle)); + + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } class LoanableTypeSupportTesting : public LoanableTypeSupport @@ -1562,31 +1560,31 @@ TEST(DataWriterTests, LoanNegativeTests) // Check for illegal operation type_support->is_plain_result = false; - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); type_support->is_plain_result = true; type_support->m_typeSize = 0; - EXPECT_EQ(ReturnCode_t::RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_ILLEGAL_OPERATION, datawriter->loan_sample(sample)); type_support->m_typeSize = original_type_size; // Check for not enabled - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->loan_sample(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_OK, datawriter->enable()); // Check for constructor support type_support->construct_sample_result = false; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, + EXPECT_EQ(RETCODE_UNSUPPORTED, datawriter->loan_sample(sample, InitKind::CONSTRUCTED_LOAN_INITIALIZATION)); type_support->construct_sample_result = true; // Check preconditions on delete_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->loan_sample(sample)); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, publisher->delete_datawriter(datawriter)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, datawriter->discard_loan(sample)); - - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + EXPECT_EQ(RETCODE_OK, datawriter->loan_sample(sample)); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, publisher->delete_datawriter(datawriter)); + EXPECT_EQ(RETCODE_OK, datawriter->discard_loan(sample)); + + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } class DataWriterTest : public DataWriter @@ -1653,25 +1651,25 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) ASSERT_NE(nullptr, instance_datawriter); // 1. Calling wait_for_acknowledgments in a disable writer returns RETCODE_NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_NOT_ENABLED, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 2. Calling wait_for_acknowledgments in a non keyed topic returns RETCODE_PRECONDITION_NOT MET - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, datawriter->wait_for_acknowledgments(&data, handle, + ASSERT_EQ(RETCODE_OK, datawriter->enable()); + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 3. Calling wait_for_acknowledgments with an invalid sample returns RETCODE_BAD_PARAMETER - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, instance_datawriter->wait_for_acknowledgments(nullptr, handle, + ASSERT_EQ(RETCODE_OK, instance_datawriter->enable()); + EXPECT_EQ(RETCODE_BAD_PARAMETER, instance_datawriter->wait_for_acknowledgments(nullptr, handle, max_wait)); #if !defined(NDEBUG) // 4. Calling wait_for_acknowledgments with an inconsistent handle returns RETCODE_BAD_PARAMETER - EXPECT_EQ(ReturnCode_t::RETCODE_PRECONDITION_NOT_MET, instance_datawriter->wait_for_acknowledgments(&data, + EXPECT_EQ(RETCODE_PRECONDITION_NOT_MET, instance_datawriter->wait_for_acknowledgments(&data, datawriter->get_instance_handle(), max_wait)); #endif // NDEBUG - // Access PublisherHistory + // Access DataWriterHistory DataWriterTest* instance_datawriter_test = static_cast(instance_datawriter); ASSERT_NE(nullptr, instance_datawriter_test); DataWriterImpl* datawriter_impl = instance_datawriter_test->get_impl(); @@ -1683,8 +1681,8 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) // 5. Calling wait_for_acknowledgments in a keyed topic with HANDLE_NIL returns // RETCODE_OK EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(true)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, + ASSERT_EQ(RETCODE_OK, instance_datawriter->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 6. Calling wait_for_acknowledgments in a keyed topic with a known handle returns RETCODE_OK (no matched readers) @@ -1692,13 +1690,13 @@ TEST(DataWriterTests, InstanceWaitForAcknowledgement) EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(true)); instance_type.get_key(&data, &handle); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_OK, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); // 7. Calling wait_for_acknowledgments in a keyed topic with a known handle timeouts if some reader has not // acknowledged before max_wait time (mock) returns RETCODE_TIMEOUT // Expectations EXPECT_CALL(*history, wait_for_acknowledgement_last_change(_, _, _)).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_TIMEOUT, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); + EXPECT_EQ(RETCODE_TIMEOUT, instance_datawriter->wait_for_acknowledgments(&data, handle, max_wait)); } #endif // __QNXNTO__ @@ -1754,7 +1752,7 @@ class DataWriterUnsupportedTests : public ::testing::Test /* * This test checks that the DataWriter methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. get_matched_subscription_data * 2. get_matched_subscriptions * 3. lookup_instance @@ -1780,21 +1778,21 @@ TEST_F(DataWriterUnsupportedTests, UnsupportedDataWriterMethods) builtin::SubscriptionBuiltinTopicData subscription_data; fastrtps::rtps::InstanceHandle_t subscription_handle; EXPECT_EQ( - ReturnCode_t::RETCODE_UNSUPPORTED, + RETCODE_UNSUPPORTED, data_writer->get_matched_subscription_data(subscription_data, subscription_handle)); std::vector subscription_handles; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_writer->get_matched_subscriptions(subscription_handles)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_writer->get_matched_subscriptions(subscription_handles)); EXPECT_EQ(HANDLE_NIL, data_writer->lookup_instance(nullptr /* instance */)); // Expected logWarnings: lookup_instance HELPER_WaitForEntries(1); - ASSERT_EQ(publisher->delete_datawriter(data_writer), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(data_writer), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* @@ -1872,12 +1870,12 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyNotKeyed) ASSERT_NE(data_writer5, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 DataWriterQos qos2 = DATAWRITER_QOS_DEFAULT; DataWriter* default_data_writer1 = publisher->create_datawriter(topic, qos2); ASSERT_NE(default_data_writer1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -1887,35 +1885,35 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyNotKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); } /* @@ -2002,12 +2000,12 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) ASSERT_NE(data_writer6, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0, as the by default values are already infinite. + // set_qos() should return RETCODE_OK = 0, as the by default values are already infinite. DataWriterQos qos2 = DATAWRITER_QOS_DEFAULT; DataWriter* default_data_writer1 = publisher->create_datawriter(topic, qos2); ASSERT_NE(default_data_writer1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -2016,7 +2014,7 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -2024,32 +2022,32 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_writer1->set_qos(qos2)); } @@ -2154,7 +2152,7 @@ TEST(DataWriterTests, history_depth_max_samples_per_instance_warning) /* Check that the datawriter can send data */ FooType data; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, datawriter_1->write(&data, HANDLE_NIL)); + ASSERT_EQ(RETCODE_OK, datawriter_1->write(&data, HANDLE_NIL)); /* Check that a correctly initialized writer does not produce any warning */ qos.history().depth = 10; diff --git a/test/unittest/dds/publisher/PublisherTests.cpp b/test/unittest/dds/publisher/PublisherTests.cpp index 1b14b36dd1d..6d911c79005 100644 --- a/test/unittest/dds/publisher/PublisherTests.cpp +++ b/test/unittest/dds/publisher/PublisherTests.cpp @@ -17,12 +17,6 @@ #include #include -#include -#include -#include -#include -#include -#include #include #include #include @@ -32,18 +26,12 @@ #include #include #include -#include -#include -#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::PublisherAttributes; using fastrtps::rtps::PropertyPolicyHelper; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; class TopicDataTypeMock : public TopicDataType { @@ -211,17 +199,8 @@ TEST(PublisherTests, GetPublisherParticipant) ASSERT_EQ(publisher->get_participant(), participant); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(PublisherTests, GetPSMPublisherParticipant) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::pub::Publisher publisher = ::dds::pub::Publisher(participant, PUBLISHER_QOS_DEFAULT); - - ASSERT_EQ(publisher.participant().delegate().get(), participant.delegate().get()); - + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(PublisherTests, ChangeDefaultDataWriterQos) @@ -322,7 +301,7 @@ TEST(PublisherTests, ChangeDefaultDataWriterQos) // . data_sharing qos.data_sharing().on("/"); - ASSERT_TRUE(publisher->set_default_datawriter_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->set_default_datawriter_qos(qos) == RETCODE_OK); DataWriterQos wqos; publisher->get_default_datawriter_qos(wqos); @@ -443,28 +422,11 @@ TEST(PublisherTests, ChangeDefaultDataWriterQos) EXPECT_TRUE(qos == wqos); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } -TEST(PublisherTests, ChangePSMDefaultDataWriterQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::pub::Publisher publisher = ::dds::pub::Publisher(participant); - - ::dds::pub::qos::DataWriterQos qos = publisher.default_datawriter_qos(); - ASSERT_EQ(qos, DATAWRITER_QOS_DEFAULT); - - qos.deadline().period = 540; - - ASSERT_NO_THROW(publisher.default_datawriter_qos(qos)); - ::dds::pub::qos::DataWriterQos wqos = publisher.default_datawriter_qos(); - - ASSERT_TRUE(qos == wqos); - ASSERT_EQ(wqos.deadline().period, 540); -} - TEST(PublisherTests, ChangePublisherQos) { DomainParticipant* participant = @@ -487,25 +449,9 @@ TEST(PublisherTests, ChangePublisherQos) ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(participant->delete_publisher(publisher) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); - -} - -TEST(PublisherTests, ChangePSMPublisherQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::pub::Publisher publisher = ::dds::pub::Publisher(participant); - - ::dds::pub::qos::PublisherQos qos = publisher.qos(); - ASSERT_EQ(qos, PUBLISHER_QOS_DEFAULT); - - qos.entity_factory().autoenable_created_entities = false; - publisher.qos(qos); - ::dds::pub::qos::PublisherQos pqos = publisher.qos(); + ASSERT_TRUE(participant->delete_publisher(publisher) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); - ASSERT_TRUE(qos == pqos); - ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); } TEST(PublisherTests, CreateDataWriter) @@ -526,10 +472,10 @@ TEST(PublisherTests, CreateDataWriter) DataWriter* datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } void check_datawriter_with_profile ( @@ -539,54 +485,10 @@ void check_datawriter_with_profile ( DataWriterQos qos; datawriter->get_qos(qos); - PublisherAttributes publisher_atts; - XMLProfileManager::fillPublisherAttributes(profile_name, publisher_atts); - - //Values taken from profile - ASSERT_TRUE( - qos.writer_resource_limits().matched_subscriber_allocation == - publisher_atts.matched_subscriber_allocation); - if (publisher_atts.qos.m_partition.names().empty()) - { - ASSERT_TRUE(qos.properties() == publisher_atts.properties); - } - else - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions"), nullptr); - for (auto partition: publisher_atts.qos.m_partition.names()) - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions")->find( - partition), std::string::npos); - } - } - ASSERT_TRUE(qos.throughput_controller() == publisher_atts.throughputController); - ASSERT_TRUE(qos.endpoint().unicast_locator_list == publisher_atts.unicastLocatorList); - ASSERT_TRUE(qos.endpoint().multicast_locator_list == publisher_atts.multicastLocatorList); - ASSERT_TRUE(qos.endpoint().remote_locator_list == publisher_atts.remoteLocatorList); - ASSERT_TRUE(qos.endpoint().history_memory_policy == publisher_atts.historyMemoryPolicy); - ASSERT_TRUE(qos.endpoint().user_defined_id == publisher_atts.getUserDefinedID()); - ASSERT_TRUE(qos.endpoint().entity_id == publisher_atts.getEntityID()); - ASSERT_TRUE(qos.reliable_writer_qos().times == publisher_atts.times); - ASSERT_TRUE(qos.reliable_writer_qos().disable_positive_acks == publisher_atts.qos.m_disablePositiveACKs); - ASSERT_TRUE(qos.durability() == publisher_atts.qos.m_durability); - ASSERT_TRUE(qos.durability_service() == publisher_atts.qos.m_durabilityService); - ASSERT_TRUE(qos.deadline() == publisher_atts.qos.m_deadline); - ASSERT_TRUE(qos.latency_budget() == publisher_atts.qos.m_latencyBudget); - ASSERT_TRUE(qos.liveliness() == publisher_atts.qos.m_liveliness); - ASSERT_TRUE(qos.reliability() == publisher_atts.qos.m_reliability); - ASSERT_TRUE(qos.lifespan() == publisher_atts.qos.m_lifespan); - ASSERT_TRUE(qos.user_data().data_vec() == publisher_atts.qos.m_userData.data_vec()); - ASSERT_TRUE(qos.ownership() == publisher_atts.qos.m_ownership); - ASSERT_TRUE(qos.ownership_strength() == publisher_atts.qos.m_ownershipStrength); - ASSERT_TRUE(qos.destination_order() == publisher_atts.qos.m_destinationOrder); - ASSERT_TRUE(qos.representation() == publisher_atts.qos.representation); - ASSERT_TRUE(qos.publish_mode() == publisher_atts.qos.m_publishMode); - ASSERT_TRUE(qos.history() == publisher_atts.topic.historyQos); - ASSERT_TRUE(qos.resource_limits() == publisher_atts.topic.resourceLimitsQos); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.transport_priority() == DATAWRITER_QOS_DEFAULT.transport_priority()); - ASSERT_TRUE(qos.writer_data_lifecycle() == DATAWRITER_QOS_DEFAULT.writer_data_lifecycle()); + DataWriterQos profile_qos; + EXPECT_EQ(datawriter->get_publisher()->get_datawriter_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(PublisherTests, CreateDataWriterWithProfile) @@ -603,17 +505,17 @@ TEST(PublisherTests, CreateDataWriterWithProfile) DataWriter* default_datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(default_datawriter, nullptr); check_datawriter_with_profile(default_datawriter, "test_default_publisher_profile"); - ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == RETCODE_OK); //participant using non-default profile DataWriter* datawriter = publisher->create_datawriter_with_profile(topic, "test_publisher_profile"); ASSERT_NE(datawriter, nullptr); check_datawriter_with_profile(datawriter, "test_publisher_profile"); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, CreateDataWriterWithProfileFromString) @@ -635,17 +537,17 @@ TEST(PublisherTests, CreateDataWriterWithProfileFromString) DataWriter* default_datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(default_datawriter, nullptr); check_datawriter_with_profile(default_datawriter, "test_default_publisher_profile_string"); - ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(default_datawriter) == RETCODE_OK); //participant using non-default profile DataWriter* datawriter = publisher->create_datawriter_with_profile(topic, "test_publisher_profile_string"); ASSERT_NE(datawriter, nullptr); check_datawriter_with_profile(datawriter, "test_publisher_profile_string"); - ASSERT_TRUE(publisher->delete_datawriter(datawriter) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(publisher->delete_datawriter(datawriter) == RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, GetDataWriterProfileQos) @@ -665,7 +567,7 @@ TEST(PublisherTests, GetDataWriterProfileQos) DataWriterQos qos; EXPECT_EQ( publisher->get_datawriter_qos_from_profile("test_publisher_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); //Datawriter using the extracted qos DataWriter* datawriter = publisher->create_datawriter(topic, qos); @@ -676,13 +578,13 @@ TEST(PublisherTests, GetDataWriterProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( publisher->get_datawriter_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(PublisherTests, DeletePublisherWithWriters) @@ -703,13 +605,13 @@ TEST(PublisherTests, DeletePublisherWithWriters) DataWriter* datawriter = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT); ASSERT_NE(datawriter, nullptr); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(publisher->delete_datawriter(datawriter), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_datawriter(datawriter), RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } @@ -718,7 +620,7 @@ void set_listener_test ( PublisherListener* listener, StatusMask mask) { - ASSERT_EQ(publisher->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(publisher->get_status_mask(), mask); } @@ -762,8 +664,8 @@ TEST(PublisherTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Delete contained entities test @@ -795,23 +697,23 @@ TEST(Publisher, DeleteContainedEntities) data_writer_list.clear(); void* loan_data; - ASSERT_EQ(data_writer_bar->loan_sample(loan_data), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_writer_bar->loan_sample(loan_data), RETCODE_OK); - ASSERT_EQ(publisher->delete_contained_entities(), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(publisher->delete_contained_entities(), RETCODE_PRECONDITION_NOT_MET); publisher->get_datawriters(data_writer_list); ASSERT_EQ(data_writer_list.size(), 2u); data_writer_list.clear(); data_writer_bar->discard_loan(loan_data); - ASSERT_EQ(publisher->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher->delete_contained_entities(), RETCODE_OK); publisher->get_datawriters(data_writer_list); ASSERT_FALSE(publisher->has_datawriters()); } /* * This test checks that the Publisher methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. suspend_publications * 2. resume_publications * 3. begin_coherent_changes @@ -827,13 +729,13 @@ TEST(PublisherTests, UnsupportedPublisherMethods) fastdds::dds::DataWriterQos writer_qos; fastdds::dds::TopicQos topic_qos; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->suspend_publications()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->resume_publications()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->begin_coherent_changes()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, publisher->end_coherent_changes()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->suspend_publications()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->resume_publications()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->begin_coherent_changes()); + EXPECT_EQ(RETCODE_UNSUPPORTED, publisher->end_coherent_changes()); - ASSERT_EQ(participant->delete_publisher(publisher), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_publisher(publisher), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /** diff --git a/test/unittest/dds/status/CMakeLists.txt b/test/unittest/dds/status/CMakeLists.txt index a3a41587fca..711073a5c04 100644 --- a/test/unittest/dds/status/CMakeLists.txt +++ b/test/unittest/dds/status/CMakeLists.txt @@ -16,28 +16,6 @@ file(GLOB DDSSQLFILTER_SOURCES ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/DDSSQ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${DDSSQLFILTER_SOURCES} - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -51,11 +29,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp @@ -84,7 +57,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/utils/QosConverters.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp @@ -99,11 +71,6 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp @@ -113,6 +80,11 @@ set(LISTENERTESTS_SOURCE ListenerTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) if (FASTDDS_STATISTICS) @@ -120,12 +92,10 @@ if (FASTDDS_STATISTICS) set(statistics_sources ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ) list(APPEND LISTENERTESTS_SOURCE ${statistics_sources}) @@ -205,7 +175,12 @@ target_include_directories(ListenerTests PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(ListenerTests fastcdr foonathan_memory +target_link_libraries(ListenerTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory ${TINYXML2_LIBRARY} GTest::gmock ${CMAKE_DL_LIBS} diff --git a/test/unittest/dds/status/ListenerTests.cpp b/test/unittest/dds/status/ListenerTests.cpp index 61afbb40dcf..8f6937fe9e0 100644 --- a/test/unittest/dds/status/ListenerTests.cpp +++ b/test/unittest/dds/status/ListenerTests.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -60,12 +59,6 @@ RTPSParticipant* RTPSDomain::participant_ = nullptr; namespace fastdds { namespace dds { -namespace builtin { - -const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -} // namespace builtin - class RTPSParticipantMock : public eprosima::fastrtps::rtps::RTPSParticipant { public: @@ -161,7 +154,7 @@ class CustomDataReaderListener : public DataReaderListener void on_requested_deadline_missed( DataReader*, - const fastrtps::RequestedDeadlineMissedStatus&) + const RequestedDeadlineMissedStatus&) { on_requested_deadline_missed_relay(); } @@ -170,7 +163,7 @@ class CustomDataReaderListener : public DataReaderListener void on_liveliness_changed( DataReader*, - const fastrtps::LivelinessChangedStatus&) + const LivelinessChangedStatus&) { on_liveliness_changed_relay(); } @@ -179,7 +172,7 @@ class CustomDataReaderListener : public DataReaderListener void on_sample_rejected( DataReader*, - const fastrtps::SampleRejectedStatus&) + const SampleRejectedStatus&) { on_sample_rejected_relay(); } @@ -236,7 +229,7 @@ class CustomSubscriberListener : public SubscriberListener void on_requested_deadline_missed( DataReader*, - const fastrtps::RequestedDeadlineMissedStatus&) + const RequestedDeadlineMissedStatus&) { on_requested_deadline_missed_relay(); } @@ -245,7 +238,7 @@ class CustomSubscriberListener : public SubscriberListener void on_liveliness_changed( DataReader*, - const fastrtps::LivelinessChangedStatus&) + const LivelinessChangedStatus&) { on_liveliness_changed_relay(); } @@ -254,7 +247,7 @@ class CustomSubscriberListener : public SubscriberListener void on_sample_rejected( DataReader*, - const fastrtps::SampleRejectedStatus&) + const SampleRejectedStatus&) { on_sample_rejected_relay(); } @@ -429,7 +422,7 @@ class CustomParticipantListener : public DomainParticipantListener void on_requested_deadline_missed( DataReader*, - const fastrtps::RequestedDeadlineMissedStatus&) + const RequestedDeadlineMissedStatus&) { on_requested_deadline_missed_relay(); } @@ -438,7 +431,7 @@ class CustomParticipantListener : public DomainParticipantListener void on_liveliness_changed( DataReader*, - const fastrtps::LivelinessChangedStatus&) + const LivelinessChangedStatus&) { on_liveliness_changed_relay(); } @@ -447,7 +440,7 @@ class CustomParticipantListener : public DomainParticipantListener void on_sample_rejected( DataReader*, - const fastrtps::SampleRejectedStatus&) + const SampleRejectedStatus&) { on_sample_rejected_relay(); } @@ -588,15 +581,15 @@ class UserListeners : public ::testing::Test void TearDown() override { - ASSERT_EQ(publisher_->delete_datawriter(datawriter_), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_->delete_publisher(publisher_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(datawriter_), RETCODE_OK); + ASSERT_EQ(participant_->delete_publisher(publisher_), RETCODE_OK); - ASSERT_EQ(subscriber_->delete_datareader(datareader_), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant_->delete_subscriber(subscriber_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber_->delete_datareader(datareader_), RETCODE_OK); + ASSERT_EQ(participant_->delete_subscriber(subscriber_), RETCODE_OK); - ASSERT_EQ(participant_->delete_topic(topic_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_topic(topic_), RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant_), RETCODE_OK); } // RTPS entity mocks are nice, we don't want to track all calls diff --git a/test/unittest/dds/subscriber/CMakeLists.txt b/test/unittest/dds/subscriber/CMakeLists.txt index b77b83e8739..82118c18449 100644 --- a/test/unittest/dds/subscriber/CMakeLists.txt +++ b/test/unittest/dds/subscriber/CMakeLists.txt @@ -24,9 +24,6 @@ set(DATAREADERINSTANCETESTS_SOURCE DataReaderInstanceTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) set(DATAREADERHISTORYTESTS_SOURCE DataReaderHistoryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp @@ -75,7 +72,7 @@ target_include_directories(SubscriberTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(SubscriberTests fastrtps fastcdr foonathan_memory +target_link_libraries(SubscriberTests fastdds fastcdr foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(SubscriberTests) @@ -94,7 +91,7 @@ target_include_directories(DataReaderTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} ) -target_link_libraries(DataReaderTests fastrtps fastcdr foonathan_memory +target_link_libraries(DataReaderTests fastdds fastcdr foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(DataReaderTests) @@ -136,7 +133,10 @@ target_include_directories(DataReaderHistoryTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${THIRDPARTY_BOOST_INCLUDE_DIR} ) -target_link_libraries(DataReaderHistoryTests fastcdr foonathan_memory +target_link_libraries(DataReaderHistoryTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(DataReaderHistoryTests) diff --git a/test/unittest/dds/subscriber/DataReaderHistoryTests.cpp b/test/unittest/dds/subscriber/DataReaderHistoryTests.cpp index 5efd99bf2b6..3fd9fc0c827 100644 --- a/test/unittest/dds/subscriber/DataReaderHistoryTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderHistoryTests.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index d06472baa73..778adb7eb87 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -24,12 +24,11 @@ #include #include - #include #include -#include - +#include "fastdds/dds/common/InstanceHandle.hpp" +#include "fastdds/dds/core/policy/QosPolicies.hpp" #include #include #include @@ -54,15 +53,13 @@ #include #include #include +#include #include #include -#include -#include +#include #include "../../common/CustomPayloadPool.hpp" #include "../../logging/mock/MockConsumer.h" -#include "fastdds/dds/common/InstanceHandle.hpp" -#include "fastdds/dds/core/policy/QosPolicies.hpp" #include "FooBoundedType.hpp" #include "FooBoundedTypeSupport.hpp" #include "FooType.hpp" @@ -111,28 +108,28 @@ class DataReaderTests : public ::testing::Test if (data_writer_) { - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); } if (data_reader_) { - ASSERT_EQ(subscriber_->delete_datareader(data_reader_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber_->delete_datareader(data_reader_), RETCODE_OK); } if (topic_) { - ASSERT_EQ(participant_->delete_topic(topic_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_topic(topic_), RETCODE_OK); } if (publisher_) { - ASSERT_EQ(participant_->delete_publisher(publisher_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_publisher(publisher_), RETCODE_OK); } if (subscriber_) { - ASSERT_EQ(participant_->delete_subscriber(subscriber_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant_->delete_subscriber(subscriber_), RETCODE_OK); } if (participant_) { auto factory = DomainParticipantFactory::get_instance(); - ASSERT_EQ(factory->delete_participant(participant_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(factory->delete_participant(participant_), RETCODE_OK); } } @@ -186,7 +183,7 @@ class DataReaderTests : public ::testing::Test LoanableCollection& data_values, SampleInfoSeq& infos) { - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { data_values.length(0); infos.length(0); @@ -203,7 +200,7 @@ class DataReaderTests : public ::testing::Test { if (infos[i].valid_data) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(buffer[i], HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_->write(buffer[i], HANDLE_NIL)); } } } @@ -218,31 +215,33 @@ class DataReaderTests : public ::testing::Test * The return value to expect from `return_loan` will be calculated from this one as follows: * - NOT_ENABLED => NOT_ENABLED (calling `return_loan` on a not enabled reader). * - OK => OK (successfully returning a loan). - * - Any other => RETCODE_PRECONDITION_NOT_MET (trying to return collections which the reader - * did not loan). + * - Any other => RETCODE_PRECONDITION_NOT_MET (trying to return non-empty collections which + * the reader did not loan). * @param data_reader The reader on which to return the loan. * @param data_values The data collection to return. * @param infos The SampleInfo collection to return. + * @param seq_max The value to expect as `maximum` on the collections after return_loan returns OK. */ void check_return_loan( const ReturnCode_t& code, DataReader* data_reader, LoanableCollection& data_values, - SampleInfoSeq& infos) + SampleInfoSeq& infos, + int32_t seq_max) { - ReturnCode_t expected_return_loan_ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; - if (ReturnCode_t::RETCODE_OK == code || ReturnCode_t::RETCODE_NOT_ENABLED == code) + ReturnCode_t expected_return_loan_ret = RETCODE_PRECONDITION_NOT_MET; + if (RETCODE_OK == code || RETCODE_NOT_ENABLED == code) { expected_return_loan_ret = code; } EXPECT_EQ(expected_return_loan_ret, data_reader->return_loan(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == expected_return_loan_ret) + if (RETCODE_OK == expected_return_loan_ret) { EXPECT_TRUE(data_values.has_ownership()); - EXPECT_EQ(0, data_values.maximum()); + EXPECT_EQ(seq_max, data_values.maximum()); EXPECT_TRUE(infos.has_ownership()); - EXPECT_EQ(0, infos.maximum()); + EXPECT_EQ(seq_max, infos.maximum()); } } @@ -264,19 +263,20 @@ class DataReaderTests : public ::testing::Test DataReader* data_reader, LoanableCollection& data_values, SampleInfoSeq& infos, - int32_t max_samples = LENGTH_UNLIMITED) + int32_t max_samples = LENGTH_UNLIMITED, + int32_t seq_max = 0) { EXPECT_EQ(instance_ok_code, data_reader->read_instance(data_values, infos, max_samples, handle)); - check_return_loan(loan_return_code, data_reader, data_values, infos); + check_return_loan(loan_return_code, data_reader, data_values, infos, seq_max); reset_lengths_if_ok(instance_ok_code, data_values, infos); EXPECT_EQ(instance_ok_code, data_reader->take_instance(data_values, infos, max_samples, handle)); - if (ReturnCode_t::RETCODE_OK == instance_ok_code) + if (RETCODE_OK == instance_ok_code) { // Write received data so it can be taken again send_data(data_values, infos); } - check_return_loan(loan_return_code, data_reader, data_values, infos); + check_return_loan(loan_return_code, data_reader, data_values, infos, seq_max); reset_lengths_if_ok(instance_ok_code, data_values, infos); } @@ -298,12 +298,13 @@ class DataReaderTests : public ::testing::Test DataReader* data_reader, LoanableCollection& data_values, SampleInfoSeq& infos, - int32_t max_samples = LENGTH_UNLIMITED) + int32_t max_samples = LENGTH_UNLIMITED, + int32_t seq_max = 0) { EXPECT_EQ(instance_bad_code, data_reader->read_instance(data_values, infos, max_samples, handle)); - check_return_loan(wrong_loan_code, data_reader, data_values, infos); + check_return_loan(wrong_loan_code, data_reader, data_values, infos, seq_max); EXPECT_EQ(instance_bad_code, data_reader->take_instance(data_values, infos, max_samples, handle)); - check_return_loan(wrong_loan_code, data_reader, data_values, infos); + check_return_loan(wrong_loan_code, data_reader, data_values, infos, seq_max); } /** @@ -317,6 +318,7 @@ class DataReaderTests : public ::testing::Test * @param infos The sample_info collection to use * @param max_samples The value to pass as `max_samples` on calls to `read/take_instance` * @param two_valid_instances Whether `handle_wrong_` is considered a valid instance + * @param seq_max The value to expect as `maximum` on the collections after return_loan returns OK. */ void check_instance_methods( const ReturnCode_t& instance_ok_code, @@ -326,34 +328,39 @@ class DataReaderTests : public ::testing::Test LoanableCollection& data_values, SampleInfoSeq& infos, int32_t max_samples = LENGTH_UNLIMITED, - bool two_valid_instances = false) + bool two_valid_instances = false, + int32_t seq_max = 0) { // Calc expected result of `return_loan` for calls with a wrong instance handle. - ReturnCode_t wrong_loan_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; - if (ReturnCode_t::RETCODE_NOT_ENABLED == instance_bad_code) + ReturnCode_t wrong_loan_code = RETCODE_PRECONDITION_NOT_MET; + if (RETCODE_NOT_ENABLED == instance_bad_code) { wrong_loan_code = instance_bad_code; } + else if (RETCODE_OK == loan_return_code) + { + wrong_loan_code = RETCODE_OK; + } // Trying to get data for HANDLE_NIL should always use instance_bad_code. check_wrong_instance_methods(HANDLE_NIL, instance_bad_code, wrong_loan_code, - data_reader, data_values, infos, max_samples); + data_reader, data_values, infos, max_samples, seq_max); // Trying to get data for handle_wrong_ depends on `two_instances` if (two_valid_instances) { check_correct_instance_methods(handle_wrong_, instance_ok_code, loan_return_code, - data_reader, data_values, infos, max_samples); + data_reader, data_values, infos, max_samples, seq_max); } else { check_wrong_instance_methods(handle_wrong_, instance_bad_code, wrong_loan_code, - data_reader, data_values, infos, max_samples); + data_reader, data_values, infos, max_samples, seq_max); } // Trying to get data for handle_ok_ should always use instance_ok_code check_correct_instance_methods(handle_ok_, instance_ok_code, loan_return_code, - data_reader, data_values, infos, max_samples); + data_reader, data_values, infos, max_samples, seq_max); } /** @@ -388,7 +395,7 @@ class DataReaderTests : public ::testing::Test SampleInfo info; EXPECT_EQ(code, data_reader->take_next_sample(&data, &info)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { // Send taken sample so it can be read again data_writer_->write(&data); @@ -398,15 +405,15 @@ class DataReaderTests : public ::testing::Test } // Return code when requesting a bad instance - ReturnCode_t instance_bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; - if (ReturnCode_t::RETCODE_NOT_ENABLED == code) + ReturnCode_t instance_bad_code = RETCODE_BAD_PARAMETER; + if (RETCODE_NOT_ENABLED == code) { instance_bad_code = code; } // Return code when requesting a correct instance ReturnCode_t instance_ok_code = instance_bad_code; - if (ReturnCode_t::RETCODE_OK == code && type_->m_isGetKeyDefined) + if (RETCODE_OK == code && type_->m_isGetKeyDefined) { instance_ok_code = code; } @@ -416,33 +423,40 @@ class DataReaderTests : public ::testing::Test DataSeq data_values; SampleInfoSeq infos; + ReturnCode_t expected_return_loan_ret = code; + if (RETCODE_NO_DATA == code) + { + // Even when read returns data, no loan will be performed + expected_return_loan_ret = RETCODE_OK; + } + EXPECT_EQ(code, data_reader->read(data_values, infos)); - check_return_loan(code, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, 0); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->read_next_instance(data_values, infos)); - check_return_loan(code, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, 0); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); } - check_return_loan(code, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, 0); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take_next_instance(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); } - check_return_loan(code, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, 0); reset_lengths_if_ok(code, data_values, infos); - check_instance_methods(instance_ok_code, instance_bad_code, instance_ok_code, - data_reader, data_values, infos, LENGTH_UNLIMITED, two_valid_instances); + check_instance_methods(instance_ok_code, instance_bad_code, expected_return_loan_ret, + data_reader, data_values, infos, LENGTH_UNLIMITED, two_valid_instances, 0); } // Check read/take and variants without loan @@ -451,39 +465,38 @@ class DataReaderTests : public ::testing::Test SampleInfoSeq infos(1); ReturnCode_t expected_return_loan_ret = code; - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_NO_DATA == code) { - // Even when read returns data, no loan will be performed - expected_return_loan_ret = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + expected_return_loan_ret = RETCODE_OK; } EXPECT_EQ(code, data_reader->read(data_values, infos)); - check_return_loan(expected_return_loan_ret, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, data_values.maximum()); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->read_next_instance(data_values, infos)); - check_return_loan(expected_return_loan_ret, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, data_values.maximum()); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); } - check_return_loan(expected_return_loan_ret, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, data_values.maximum()); reset_lengths_if_ok(code, data_values, infos); EXPECT_EQ(code, data_reader->take_next_instance(data_values, infos)); - if (ReturnCode_t::RETCODE_OK == code) + if (RETCODE_OK == code) { send_data(data_values, infos); data_reader->wait_for_unread_message(time_to_wait); } - check_return_loan(expected_return_loan_ret, data_reader, data_values, infos); + check_return_loan(expected_return_loan_ret, data_reader, data_values, infos, data_values.maximum()); reset_lengths_if_ok(code, data_values, infos); check_instance_methods(instance_ok_code, instance_bad_code, expected_return_loan_ret, - data_reader, data_values, infos, LENGTH_UNLIMITED, two_valid_instances); + data_reader, data_values, infos, LENGTH_UNLIMITED, two_valid_instances, data_values.maximum()); } } @@ -526,33 +539,33 @@ class DataReaderTests : public ::testing::Test EXPECT_EQ(0ull, data_reader_->get_unread_count()); // Read / take operations should all return NOT_ENABLED - basic_read_apis_check(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_); + basic_read_apis_check(RETCODE_NOT_ENABLED, data_reader_); // Enable the DataReader and check NO_DATA should be returned - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->enable()); + EXPECT_EQ(RETCODE_OK, data_reader_->enable()); EXPECT_TRUE(data_reader_->is_enabled()); - basic_read_apis_check(ReturnCode_t::RETCODE_NO_DATA, data_reader_); + basic_read_apis_check(RETCODE_NO_DATA, data_reader_); // Send data DataType data; data.index(0); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); // Wait for data to arrive and check OK should be returned Duration_t wait_time(1, 0); EXPECT_TRUE(data_reader_->wait_for_unread_message(wait_time)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_); + basic_read_apis_check(RETCODE_OK, data_reader_); // Check with data on second instance data.index(2u); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_, true); + EXPECT_EQ(RETCODE_OK, data_writer_->write(&data, HANDLE_NIL)); + basic_read_apis_check(RETCODE_OK, data_reader_, true); // Check with disposed instance if (type_->m_isGetKeyDefined) { - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_->dispose(&data, handle_wrong_)); - basic_read_apis_check(ReturnCode_t::RETCODE_OK, data_reader_, true); + EXPECT_EQ(RETCODE_OK, data_writer_->dispose(&data, handle_wrong_)); + basic_read_apis_check(RETCODE_OK, data_reader_, true); } } @@ -581,9 +594,10 @@ TEST_F(DataReaderTests, get_guid) { public: - void on_subscriber_discovery( + void on_data_reader_discovery( DomainParticipant*, - ReaderDiscoveryInfo&& info) + ReaderDiscoveryInfo&& info, + bool& /*should_be_ignored*/) override { std::unique_lock lock(mutex); if (ReaderDiscoveryInfo::DISCOVERED_READER == info.status) @@ -599,7 +613,7 @@ TEST_F(DataReaderTests, get_guid) private: - using DomainParticipantListener::on_subscriber_discovery; + using DomainParticipantListener::on_data_reader_discovery; } discovery_listener; @@ -652,12 +666,12 @@ TEST_F(DataReaderTests, get_guid) } ASSERT_EQ(guid, discovery_listener.guid); - ASSERT_TRUE(subscriber->delete_datareader(datareader) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(datareader) == RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant( - listener_participant) == ReturnCode_t::RETCODE_OK); + listener_participant) == RETCODE_OK); } TEST_F(DataReaderTests, InvalidQos) @@ -667,11 +681,11 @@ TEST_F(DataReaderTests, InvalidQos) create_entities(); ASSERT_TRUE(data_reader_->is_enabled()); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_qos(qos)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_qos(qos)); ASSERT_EQ(qos, DATAREADER_QOS_DEFAULT); /* Unsupported QoS */ - const ReturnCode_t unsupported_code = ReturnCode_t::RETCODE_UNSUPPORTED; + const ReturnCode_t unsupported_code = RETCODE_UNSUPPORTED; qos = DATAREADER_QOS_DEFAULT; qos.durability().kind = PERSISTENT_DURABILITY_QOS; @@ -682,7 +696,7 @@ TEST_F(DataReaderTests, InvalidQos) EXPECT_EQ(unsupported_code, data_reader_->set_qos(qos)); /* Inconsistent QoS */ - const ReturnCode_t inconsistent_code = ReturnCode_t::RETCODE_INCONSISTENT_POLICY; + const ReturnCode_t inconsistent_code = RETCODE_INCONSISTENT_POLICY; qos = DATAREADER_QOS_DEFAULT; qos.reader_resource_limits().max_samples_per_read = -1; @@ -714,10 +728,10 @@ TEST_F(DataReaderTests, InvalidQos) // return against RETCODE_INMUTABLE_POLICY we are testing that the setting are not considered inconsistent yet. // This test will fail whenever we enforce the consistency between depth and max_samples_per_instance. qos.history().depth = 2000; - EXPECT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader_->set_qos(qos)); + EXPECT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader_->set_qos(qos)); /* Inmutable QoS */ - const ReturnCode_t inmutable_code = ReturnCode_t::RETCODE_IMMUTABLE_POLICY; + const ReturnCode_t inmutable_code = RETCODE_IMMUTABLE_POLICY; qos = DATAREADER_QOS_DEFAULT; qos.resource_limits().max_samples = 5000; @@ -815,15 +829,16 @@ void check_collection( * take_instance, where no instance would exist and the return will be BAD_PARAMETER. Otherwise, PRECONDITION_NOT_MET * should be returned. * - * As no data will ever be returned, return_loan will always return PRECONDITION_NOT_MET. + * As no data will ever be returned, return_loan will always return OK. */ TEST_F(DataReaderTests, collection_preconditions) { create_entities(); create_instance_handles(); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_NO_DATA; - const ReturnCode_t& wrong_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; + const ReturnCode_t& wrong_code = RETCODE_PRECONDITION_NOT_MET; + const ReturnCode_t& return_loan_code = RETCODE_OK; // Helper buffers to create loaned sequences FooArray arr; @@ -904,35 +919,35 @@ TEST_F(DataReaderTests, collection_preconditions) } // Check compatible combinations - using ok_test_case_t = std::pair; + using ok_test_case_t = std::pair>; std::vector ok_cases { // max == 0. Loaned data will be returned. - { {true_0_0, info_true_0_0}, ok_code}, + { {true_0_0, info_true_0_0}, {no_data_code, return_loan_code}}, // max > 0 && owns == true. Data will be copied. - { {true_10_0, info_true_10_0}, ok_code}, - { {true_10_1, info_true_10_1}, ok_code}, + { {true_10_0, info_true_10_0}, {no_data_code, return_loan_code}}, + { {true_10_1, info_true_10_1}, {no_data_code, return_loan_code}}, // max > 0 && owns == false. Precondition not met. - { {false_10_0, info_false_10_0}, wrong_code}, - { {false_10_1, info_false_10_1}, wrong_code} + { {false_10_0, info_false_10_0}, {wrong_code, wrong_code}}, + { {false_10_1, info_false_10_1}, {wrong_code, wrong_code}} }; - const ReturnCode_t& instance_bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; + const ReturnCode_t& instance_bad_code = RETCODE_BAD_PARAMETER; for (const ok_test_case_t& test : ok_cases) { - EXPECT_EQ(test.second, data_reader_->read(test.first.first, test.first.second)); - EXPECT_EQ(wrong_code, data_reader_->return_loan(test.first.first, test.first.second)); - EXPECT_EQ(test.second, data_reader_->read_next_instance(test.first.first, test.first.second)); - EXPECT_EQ(wrong_code, data_reader_->return_loan(test.first.first, test.first.second)); - EXPECT_EQ(test.second, data_reader_->take(test.first.first, test.first.second)); - EXPECT_EQ(wrong_code, data_reader_->return_loan(test.first.first, test.first.second)); - EXPECT_EQ(test.second, data_reader_->take_next_instance(test.first.first, test.first.second)); - EXPECT_EQ(wrong_code, data_reader_->return_loan(test.first.first, test.first.second)); + EXPECT_EQ(test.second.first, data_reader_->read(test.first.first, test.first.second)); + EXPECT_EQ(test.second.second, data_reader_->return_loan(test.first.first, test.first.second)); + EXPECT_EQ(test.second.first, data_reader_->read_next_instance(test.first.first, test.first.second)); + EXPECT_EQ(test.second.second, data_reader_->return_loan(test.first.first, test.first.second)); + EXPECT_EQ(test.second.first, data_reader_->take(test.first.first, test.first.second)); + EXPECT_EQ(test.second.second, data_reader_->return_loan(test.first.first, test.first.second)); + EXPECT_EQ(test.second.first, data_reader_->take_next_instance(test.first.first, test.first.second)); + EXPECT_EQ(test.second.second, data_reader_->return_loan(test.first.first, test.first.second)); // When collection preconditions are ok, as the reader has no data, BAD_PARAMETER will be returned - const ReturnCode_t& instance_code = (test.second == ok_code) ? instance_bad_code : test.second; - check_instance_methods(instance_code, instance_code, wrong_code, - data_reader_, test.first.first, test.first.second); + const ReturnCode_t& instance_code = (test.second.first == no_data_code) ? instance_bad_code : test.second.first; + check_instance_methods(instance_code, instance_code, test.second.second, + data_reader_, test.first.first, test.first.second, LENGTH_UNLIMITED, false, test.first.first.maximum()); } // Check for max_samples > max_len @@ -942,8 +957,8 @@ TEST_F(DataReaderTests, collection_preconditions) EXPECT_EQ(wrong_code, data_reader_->take(true_10_0, info_true_10_0, 20)); EXPECT_EQ(wrong_code, data_reader_->take_next_instance(true_10_0, info_true_10_0, 20)); - check_instance_methods(wrong_code, wrong_code, wrong_code, - data_reader_, true_10_0, info_true_10_0, 20); + check_instance_methods(wrong_code, wrong_code, return_loan_code, + data_reader_, true_10_0, info_true_10_0, 20, false, true_10_0.maximum()); } @@ -994,16 +1009,19 @@ TEST_F(DataReaderTests, return_loan) FooSeq data_values_2; SampleInfoSeq infos_2; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& precondition_code = ReturnCode_t::RETCODE_PRECONDITION_NOT_MET; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& precondition_code = RETCODE_PRECONDITION_NOT_MET; // Calling return loan on disabled reader should return NOT_ENABLED - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_->return_loan(data_values, infos)); + EXPECT_EQ(RETCODE_NOT_ENABLED, data_reader_->return_loan(data_values, infos)); // Enable both readers EXPECT_EQ(ok_code, data_reader_->enable()); EXPECT_EQ(ok_code, reader2->enable()); + // Calling return loan with empty sequences on an enabled reader should return OK + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data_values, infos)); + FooType data; data.index(0); @@ -1013,9 +1031,6 @@ TEST_F(DataReaderTests, return_loan) EXPECT_EQ(ok_code, data_writer_->write(&data, handle_ok_)); } - // Returning a loan without having called read or take should return PRECONDITION_NOT_MET - EXPECT_EQ(precondition_code, data_reader_->return_loan(data_values, infos)); - // Read with loan from both readers EXPECT_EQ(ok_code, data_reader_->read(data_values, infos)); EXPECT_EQ(ok_code, reader2->read(data_values_2, infos_2)); @@ -1119,9 +1134,9 @@ TEST_F(DataReaderTests, resource_limits) { static constexpr int32_t num_samples = 100; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& resources_code = ReturnCode_t::RETCODE_OUT_OF_RESOURCES; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& resources_code = RETCODE_OUT_OF_RESOURCES; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1334,8 +1349,8 @@ TEST_F(DataReaderTests, read_unread) static constexpr int32_t num_samples = 10; static constexpr uint64_t num_samples_check = static_cast(num_samples); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1598,7 +1613,7 @@ TEST_F(DataReaderTests, get_unread_count) static constexpr int32_t num_samples = 10; static constexpr uint64_t num_samples_check = static_cast(num_samples); - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; + const ReturnCode_t& ok_code = RETCODE_OK; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -1639,7 +1654,7 @@ TEST_F(DataReaderTests, get_unread_count) } SampleInfo sample_info; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::NOT_READ_SAMPLE_STATE, sample_info.sample_state); // Calling get_unread_count(false) several times should always return the same value @@ -1648,13 +1663,13 @@ TEST_F(DataReaderTests, get_unread_count) EXPECT_EQ(num_samples_check, data_reader_->get_unread_count(false)); } - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::NOT_READ_SAMPLE_STATE, sample_info.sample_state); // Calling get_unread_count(true) once will return the correct value EXPECT_EQ(num_samples_check, data_reader_->get_unread_count(true)); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); + ASSERT_EQ(RETCODE_OK, data_reader_->get_first_untaken_info(&sample_info)); ASSERT_EQ(SampleStateKind::READ_SAMPLE_STATE, sample_info.sample_state); // All variants should then return 0 @@ -1826,19 +1841,19 @@ TEST_F(DataReaderTests, sample_info) case TestCmd::DISPOSE: writer = open_writer(cmd.writer_index); ret_code = writer->dispose(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; case TestCmd::UNREGISTER: writer = open_writer(cmd.writer_index); ret_code = writer->unregister_instance(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; case TestCmd::WRITE: writer = open_writer(cmd.writer_index); ret_code = writer->write(&data_[cmd.instance_index], handles_[cmd.instance_index]); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, ret_code); + EXPECT_EQ(RETCODE_OK, ret_code); break; } } @@ -1854,13 +1869,13 @@ TEST_F(DataReaderTests, sample_info) ret_code = reader->read_instance(values, infos, LENGTH_UNLIMITED, handles_[instance_index]); EXPECT_EQ(ret_code, instance_result.ret_code); - if (ReturnCode_t::RETCODE_OK == ret_code) + if (RETCODE_OK == ret_code) { EXPECT_EQ(instance_result.instance_state, infos[0].instance_state); EXPECT_EQ(instance_result.view_state, infos[0].view_state); EXPECT_EQ(instance_result.disposed_generation_count, infos[0].disposed_generation_count); EXPECT_EQ(instance_result.no_writers_generation_count, infos[0].no_writers_generation_count); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, reader->return_loan(values, infos)); + EXPECT_EQ(RETCODE_OK, reader->return_loan(values, infos)); EXPECT_EQ(handles_[instance_index], reader->lookup_instance(&data_[instance_index])); } @@ -1910,32 +1925,32 @@ TEST_F(DataReaderTests, sample_info) // Instances have never been written {}, { - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // One writer writes on first instance => that instance should be NEW and ALIVE { {0, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Same writer writes on first instance => instance becomes NOT_NEW { {0, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Same writer disposes first instance => instance becomes NOT_ALIVE_DISPOSED { {0, TestCmd::DISPOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 0}, - {ReturnCode_t::RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 0}, + {RETCODE_BAD_PARAMETER, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { @@ -1943,48 +1958,48 @@ TEST_F(DataReaderTests, sample_info) // Second writer writes first instance => NEW and ALIVE { {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 0} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Both writers write on second instance => NOT_NEW and ALIVE { {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // Second writer closes => first instance becomes NOT_ALIVE_NO_WRITERS { {1, TestCmd::CLOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 0}, } }, { // First writer unregisters second instance => NOT_ALIVE_NO_WRITERS { {0, TestCmd::UNREGISTER, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 0, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 0}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 0, 0}, } }, { // Both writers write both instances { {0, TestCmd::WRITE, 0}, {1, TestCmd::WRITE, 0}, {0, TestCmd::WRITE, 1}, {1, TestCmd::WRITE, 1} }, { - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, } }, { // Reading twice should return NOT_NEW {}, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 0, 1}, } }, { @@ -1992,8 +2007,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Disposing while having another alive writer is always done { {0, TestCmd::UNREGISTER, 0}, {1, TestCmd::DISPOSE, 1} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, { @@ -2001,8 +2016,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Unregister a disposed instance should not change state { {0, TestCmd::WRITE, 0}, {0, TestCmd::UNREGISTER, 1}, {1, TestCmd::UNREGISTER, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, ALIVE_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, { @@ -2010,8 +2025,8 @@ TEST_F(DataReaderTests, sample_info) // 1 - Closing both writers on a disposed instance should not change state { {0, TestCmd::CLOSE, 0}, {1, TestCmd::CLOSE, 0} }, { - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 1}, - {ReturnCode_t::RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, 1, 1}, + {RETCODE_OK, NOT_NEW_VIEW_STATE, NOT_ALIVE_DISPOSED_INSTANCE_STATE, 0, 1}, } }, }; @@ -2023,8 +2038,8 @@ TEST_F(DataReaderTests, sample_info) // Taking all data should remove instance information FooSeq data; SampleInfoSeq infos; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->take(data, infos)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->take(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); // Run test again state.run_test(data_reader_, steps); @@ -2095,7 +2110,7 @@ TEST_F(DataReaderTests, check_read_take_iteration) oarraystream out(data.message()); out << i; - EXPECT_EQ(data_writer_->write(&data, handles[i]), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_writer_->write(&data, handles[i]), RETCODE_OK); } } @@ -2114,10 +2129,10 @@ TEST_F(DataReaderTests, check_read_take_iteration) NEW_VIEW_STATE, ALIVE_INSTANCE_STATE); - if ( ret == ReturnCode_t::RETCODE_OK) + if ( ret == RETCODE_OK) { received += data.length(); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } else { @@ -2138,11 +2153,11 @@ TEST_F(DataReaderTests, check_read_take_iteration) SampleInfoSeq infos; EXPECT_EQ(data_reader_->take_instance(data, infos, 1, handles[i]), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); EXPECT_EQ(static_cast(i), std::atoi(data[0].message().data())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } // Iterate over available instances with data and check all are retrieved @@ -2161,15 +2176,15 @@ TEST_F(DataReaderTests, check_read_take_iteration) 1, handle); - if (!!ret) + if (RETCODE_OK == ret) { received += data.length(); handle = infos[0].instance_handle; EXPECT_TRUE(std::atoi(data[0].message().data()) % 2 == 1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } } - while (ret == ReturnCode_t::RETCODE_OK); + while (ret == RETCODE_OK); EXPECT_EQ(received, max_handles); @@ -2188,15 +2203,15 @@ TEST_F(DataReaderTests, check_read_take_iteration) 1, handle); - if (!!ret) + if (RETCODE_OK == ret) { received += data.length(); handle = infos[0].instance_handle; EXPECT_TRUE(std::atoi(data[0].message().data()) % 2 == 1); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->return_loan(data, infos)); + EXPECT_EQ(RETCODE_OK, data_reader_->return_loan(data, infos)); } } - while (ret == ReturnCode_t::RETCODE_OK); + while (ret == RETCODE_OK); EXPECT_EQ(received, max_handles); } @@ -2241,8 +2256,8 @@ TEST_F(DataReaderTests, Deserialization_errors) static const Duration_t time_to_wait(0, 100 * 1000 * 1000); static constexpr int32_t num_samples = 10; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t& no_data_code = ReturnCode_t::RETCODE_NO_DATA; + const ReturnCode_t& ok_code = RETCODE_OK; + const ReturnCode_t& no_data_code = RETCODE_NO_DATA; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; writer_qos.history().kind = KEEP_LAST_HISTORY_QOS; @@ -2389,7 +2404,7 @@ void set_listener_test ( DataReaderListener* listener, StatusMask mask) { - ASSERT_EQ(reader->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(reader->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(reader->get_status_mask(), mask); } @@ -2463,11 +2478,11 @@ TEST_F(DataReaderTests, get_listening_locators) // Calling on disabled reader should return NOT_ENABLED LocatorList locator_list; - EXPECT_EQ(ReturnCode_t::RETCODE_NOT_ENABLED, data_reader_->get_listening_locators(locator_list)); + EXPECT_EQ(RETCODE_NOT_ENABLED, data_reader_->get_listening_locators(locator_list)); // Enable and try again - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->enable()); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_reader_->get_listening_locators(locator_list)); + EXPECT_EQ(RETCODE_OK, data_reader_->enable()); + EXPECT_EQ(RETCODE_OK, data_reader_->get_listening_locators(locator_list)); EXPECT_EQ(locator_list.size(), 2u); bool unicast_found = false; @@ -2521,7 +2536,7 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch) ASSERT_TRUE(data_reader_->wait_for_unread_message(Duration_t(3, 0))); // now the writer is removed - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); data_writer_ = nullptr; // here the DataReader History state must be coherent and don't loop endlessly @@ -2535,7 +2550,7 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch) // If the DataWriter is destroyed only the non-notified samples must be removed // this operation MUST succeed - ASSERT_EQ(res, ReturnCode_t::RETCODE_OK); + ASSERT_EQ(res, RETCODE_OK); data_reader_->return_loan(samples, infos); }); @@ -2596,7 +2611,7 @@ class DataReaderUnsupportedTests : public ::testing::Test /* * This test checks that the DataReader methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. get_matched_publication_data * 2. create_querycondition * 3. get_matched_publications @@ -2625,7 +2640,7 @@ TEST_F(DataReaderUnsupportedTests, UnsupportedDataReaderMethods) builtin::PublicationBuiltinTopicData publication_data; InstanceHandle_t publication_handle; EXPECT_EQ( - ReturnCode_t::RETCODE_UNSUPPORTED, + RETCODE_UNSUPPORTED, data_reader->get_matched_publication_data(publication_data, publication_handle)); { @@ -2645,31 +2660,31 @@ TEST_F(DataReaderUnsupportedTests, UnsupportedDataReaderMethods) } std::vector publication_handles; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->get_matched_publications(publication_handles)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->get_matched_publications(publication_handles)); InstanceHandle_t key_handle; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->get_key_value(nullptr, key_handle)); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->get_key_value(nullptr, key_handle)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->wait_for_historical_data({0, 1})); + EXPECT_EQ(RETCODE_UNSUPPORTED, data_reader->wait_for_historical_data({0, 1})); // Expected logWarnings: create_querycondition HELPER_WaitForEntries(1); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } // Regression test for #12133. TEST_F(DataReaderTests, read_samples_with_future_changes) { - eprosima::fastrtps::LibrarySettingsAttributes att; - att.intraprocess_delivery = eprosima::fastrtps::INTRAPROCESS_OFF; - eprosima::fastrtps::xmlparser::XMLProfileManager::library_settings(att); + eprosima::fastdds::LibrarySettings att; + att.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + DomainParticipantFactory::get_instance()->set_library_settings(att); static constexpr int32_t num_samples = 8; static constexpr int32_t expected_samples = 4; - const ReturnCode_t& ok_code = ReturnCode_t::RETCODE_OK; + const ReturnCode_t& ok_code = RETCODE_OK; bool start_dropping_acks = false; bool start_dropping_datas = false; static const Duration_t time_to_wait(0, 100 * 1000 * 1000); @@ -2747,7 +2762,7 @@ TEST_F(DataReaderTests, read_samples_with_future_changes) EXPECT_EQ(ok_code, data_reader_->take(data_seq, info_seq, num_samples, NOT_READ_SAMPLE_STATE)); check_collection(data_seq, true, num_samples, expected_samples); - ASSERT_EQ(publisher_->delete_datawriter(data_writer2), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer2), RETCODE_OK); } // Delete contained entities test @@ -2795,10 +2810,10 @@ TEST_F(DataReaderTests, delete_contained_entities) ASSERT_EQ(query_condition, nullptr); // Should fail with outstanding ReadConditions - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_PRECONDITION_NOT_MET); // Should not fail with outstanding ReadConditions - ASSERT_EQ(data_reader->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader->delete_contained_entities(), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_management) @@ -2822,7 +2837,7 @@ TEST_F(DataReaderTests, read_conditions_management) cond = reader.create_readcondition( sample_states, view_states, instance_states); EXPECT_NE(cond, nullptr); ReturnCode_t res = reader.delete_readcondition(cond); - EXPECT_EQ(res, ReturnCode_t::RETCODE_OK); + EXPECT_EQ(res, RETCODE_OK); // 3- Create several ReadConditions associated to the same masks (share implementation) std::forward_list conds; @@ -2834,7 +2849,7 @@ TEST_F(DataReaderTests, read_conditions_management) for (ReadCondition* c : conds) { - EXPECT_EQ(reader.delete_readcondition(c), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_readcondition(c), RETCODE_OK); } conds.clear(); @@ -2850,7 +2865,7 @@ TEST_F(DataReaderTests, read_conditions_management) for (ReadCondition* c : conds) { - EXPECT_EQ(reader.delete_readcondition(c), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_readcondition(c), RETCODE_OK); } conds.clear(); @@ -2864,7 +2879,7 @@ TEST_F(DataReaderTests, read_conditions_management) conds.push_front(reader.create_readcondition( ++sample_states, ++view_states, ++instance_states)); } - EXPECT_EQ(reader.delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(reader.delete_contained_entities(), RETCODE_OK); conds.clear(); // 6- Check a DataReader only handles its own ReadConditions @@ -2873,23 +2888,23 @@ TEST_F(DataReaderTests, read_conditions_management) cond = another_reader->create_readcondition(sample_states, view_states, instance_states); EXPECT_NE(cond, nullptr); - EXPECT_EQ(reader.delete_readcondition(cond), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(reader.delete_readcondition(cond), RETCODE_PRECONDITION_NOT_MET); // 7- Check the DataReader cannot be deleted with outstanding conditions - EXPECT_EQ(subscriber_->delete_datareader(another_reader), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + EXPECT_EQ(subscriber_->delete_datareader(another_reader), RETCODE_PRECONDITION_NOT_MET); // but delete_contained_entities() succeeds with outstanding ReadConditions - EXPECT_EQ(another_reader->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(another_reader->delete_contained_entities(), RETCODE_OK); // no outstanding conditions (killed above) - EXPECT_EQ(subscriber_->delete_datareader(another_reader), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(subscriber_->delete_datareader(another_reader), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) { DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; - reader_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; - writer_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; create_entities(nullptr, reader_qos, SUBSCRIBER_QOS_DEFAULT, writer_qos); DataReader& data_reader = *data_reader_; @@ -2912,9 +2927,9 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_read_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*read_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*not_read_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_read_cond), RETCODE_OK); // 1- Check NOT_READ_SAMPLE_STATE // Send sample from a background thread @@ -2931,7 +2946,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -2954,16 +2969,16 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) datas, infos, 1, - not_read_cond), ReturnCode_t::RETCODE_OK); + not_read_cond), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_TRUE(read_cond->get_trigger_value()); @@ -2978,30 +2993,30 @@ TEST_F(DataReaderTests, read_conditions_wait_on_SampleStateMask) datas, infos, 1, - read_cond), ReturnCode_t::RETCODE_OK); + read_cond), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(not_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_read_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_read_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(read_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*not_read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(not_read_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_read_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_read_cond), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) { DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; - reader_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; - writer_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; create_entities(nullptr, reader_qos, SUBSCRIBER_QOS_DEFAULT, writer_qos); DataReader& data_reader = *data_reader_; @@ -3024,9 +3039,9 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_view_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*view_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*not_view_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_view_cond), RETCODE_OK); // 1- Check NEW_VIEW_STATE // Send sample from a background thread @@ -3043,7 +3058,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -3066,16 +3081,16 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) datas, infos, 1, - view_cond), ReturnCode_t::RETCODE_OK); + view_cond), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 1u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(view_cond->get_trigger_value()); @@ -3086,21 +3101,21 @@ TEST_F(DataReaderTests, read_conditions_wait_on_ViewStateMask) EXPECT_NE(std::find(triggered.begin(), triggered.end(), any_view_cond), triggered.end()); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(not_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_view_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_view_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(view_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*not_view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(not_view_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_view_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_view_cond), RETCODE_OK); } TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) { DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; - reader_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; - writer_qos.reliability().kind = eprosima::fastrtps::RELIABLE_RELIABILITY_QOS; + writer_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; create_entities(nullptr, reader_qos, SUBSCRIBER_QOS_DEFAULT, writer_qos); DataReader& data_reader = *data_reader_; @@ -3127,10 +3142,10 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) // Create the waitset and associate WaitSet ws; - EXPECT_EQ(ws.attach_condition(*alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.attach_condition(*any_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*alive_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*disposed_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*no_writer_cond), RETCODE_OK); + EXPECT_EQ(ws.attach_condition(*any_cond), RETCODE_OK); // 1- Check ALIVE_INSTANCE_STATE // Send sample from a background thread @@ -3148,7 +3163,7 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) }); ConditionSeq triggered; - EXPECT_EQ(ws.wait(triggered, 2.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 2.0), RETCODE_OK); bw.join(); // Check the data is there @@ -3166,10 +3181,10 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) // 2 - Check NOT_ALIVE_DISPOSED_INSTANCE_STATE // unregister the instance - EXPECT_EQ(data_writer.unregister_instance(&msg, HANDLE_NIL), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_writer.unregister_instance(&msg, HANDLE_NIL), RETCODE_OK); triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(alive_cond->get_trigger_value()); @@ -3190,12 +3205,12 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) infos, 1, HANDLE_NIL, - disposed_cond), ReturnCode_t::RETCODE_OK); + disposed_cond), RETCODE_OK); // Check data is bad because the sample for instance 1 was unregistered ASSERT_FALSE(infos[0].valid_data); InstanceHandle_t prev_handle = infos[0].instance_handle; - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // new instance msg.index(2u); @@ -3206,21 +3221,21 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) infos, 1, prev_handle, - alive_cond), ReturnCode_t::RETCODE_OK); + alive_cond), RETCODE_OK); // Check data is good ASSERT_TRUE(infos[0].valid_data); EXPECT_EQ(datas[0].index(), 2u); EXPECT_EQ(datas[0].message(), test_message); - EXPECT_EQ(data_reader.return_loan(datas, infos), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(data_reader.return_loan(datas, infos), RETCODE_OK); // 5 - Check NOT_ALIVE_NO_WRITERS_INSTANCE_STATE // delete the writer to remove all writers from a new instance - ASSERT_EQ(publisher_->delete_datawriter(data_writer_), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(publisher_->delete_datawriter(data_writer_), RETCODE_OK); data_writer_ = nullptr; triggered.clear(); - EXPECT_EQ(ws.wait(triggered, 1.0), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.wait(triggered, 1.0), RETCODE_OK); // Check the conditions triggered were the expected ones ASSERT_FALSE(alive_cond->get_trigger_value()); @@ -3233,14 +3248,14 @@ TEST_F(DataReaderTests, read_conditions_wait_on_InstanceStateMask) EXPECT_NE(std::find(triggered.begin(), triggered.end(), any_cond), triggered.end()); // Detach conditions & destroy - EXPECT_EQ(ws.detach_condition(*alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(alive_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(disposed_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(no_writer_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(ws.detach_condition(*any_cond), ReturnCode_t::RETCODE_OK); - EXPECT_EQ(data_reader.delete_readcondition(any_cond), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*alive_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(alive_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*disposed_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(disposed_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*no_writer_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(no_writer_cond), RETCODE_OK); + EXPECT_EQ(ws.detach_condition(*any_cond), RETCODE_OK); + EXPECT_EQ(data_reader.delete_readcondition(any_cond), RETCODE_OK); } /* @@ -3324,15 +3339,15 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyNotKeyed) // This allows to change inmutable policies SubscriberQos subscriber_qos = SUBSCRIBER_QOS_DEFAULT; subscriber_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->set_qos(subscriber_qos)); + ASSERT_EQ(RETCODE_OK, subscriber->set_qos(subscriber_qos)); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 DataReaderQos qos2 = DATAREADER_QOS_DEFAULT; DataReader* default_data_reader2 = subscriber->create_datareader(topic, qos2); ASSERT_NE(default_data_reader2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -3342,35 +3357,35 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyNotKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); } /* @@ -3460,15 +3475,15 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) // This allows to change inmutable policies SubscriberQos subscriber_qos = SUBSCRIBER_QOS_DEFAULT; subscriber_qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, subscriber->set_qos(subscriber_qos)); + ASSERT_EQ(RETCODE_OK, subscriber->set_qos(subscriber_qos)); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0, as the by default values are already infinite. + // set_qos() should return RETCODE_OK = 0, as the by default values are already infinite. DataReaderQos qos2 = DATAREADER_QOS_DEFAULT; DataReader* default_data_reader2 = subscriber->create_datareader(topic, qos2); ASSERT_NE(default_data_reader2, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -3477,7 +3492,7 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -3485,32 +3500,32 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_data_reader2->set_qos(qos2)); } /* @@ -3588,78 +3603,78 @@ TEST_F(DataReaderTests, UpdateInmutableQos) // Resource limits DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.resource_limits().max_samples = reader_qos.resource_limits().max_samples - 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // History reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.history().kind = KEEP_ALL_HISTORY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.history().depth = reader_qos.history().depth + 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Durability reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.durability().kind = TRANSIENT_LOCAL_DURABILITY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Liveliness reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().kind = MANUAL_BY_TOPIC_LIVELINESS_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().lease_duration = Duration_t{123, 123}; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.liveliness().announcement_period = Duration_t{123, 123}; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Relibility reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Ownsership reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.ownership().kind = EXCLUSIVE_OWNERSHIP_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Destination order (currently reports unsupported) reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.destination_order().kind = BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS; - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_UNSUPPORTED, data_reader->set_qos(reader_qos)); // Reader resource limits reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.reader_resource_limits().matched_publisher_allocation.maximum = reader_qos.reader_resource_limits().matched_publisher_allocation.maximum - 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Datasharing reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().off(); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().automatic("."); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().add_domain_id(static_cast(12)); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.data_sharing().data_sharing_listener_thread().priority = reader_qos.data_sharing().data_sharing_listener_thread().priority + 1; - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); // Unique network flows reader_qos = DATAREADER_QOS_DEFAULT; reader_qos.properties().properties().push_back({"fastdds.unique_network_flows", "true"}); - ASSERT_EQ(ReturnCode_t::RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); + ASSERT_EQ(RETCODE_IMMUTABLE_POLICY, data_reader->set_qos(reader_qos)); /* Cleanup */ participant->delete_contained_entities(); diff --git a/test/unittest/dds/subscriber/SubscriberTests.cpp b/test/unittest/dds/subscriber/SubscriberTests.cpp index 1c0afb37849..9bf36a56724 100644 --- a/test/unittest/dds/subscriber/SubscriberTests.cpp +++ b/test/unittest/dds/subscriber/SubscriberTests.cpp @@ -12,44 +12,29 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include #include #include #include #include #include +#include #include #include #include #include #include #include -#include -#include -#include -#include +#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::PublisherAttributes; -using fastrtps::SubscriberAttributes; using fastrtps::rtps::PropertyPolicyHelper; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; - class FooType { @@ -235,40 +220,24 @@ TEST(SubscriberTests, ChangeSubscriberQos) ASSERT_NE(subscriber, nullptr); SubscriberQos qos; - ASSERT_EQ(subscriber->get_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->get_qos(qos), RETCODE_OK); ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); qos.entity_factory().autoenable_created_entities = false; - ASSERT_EQ(subscriber->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->set_qos(qos), RETCODE_OK); SubscriberQos pqos; - ASSERT_EQ(subscriber->get_qos(pqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->get_qos(pqos), RETCODE_OK); ASSERT_TRUE(qos == pqos); ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } -TEST(SubscriberTests, ChangePSMSubscriberQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::sub::Subscriber subscriber = ::dds::sub::Subscriber(participant); - - ::dds::sub::qos::SubscriberQos qos = subscriber.qos(); - ASSERT_EQ(qos, SUBSCRIBER_QOS_DEFAULT); - - qos.entity_factory().autoenable_created_entities = false; - ASSERT_NO_THROW(subscriber.qos(qos)); - ::dds::sub::qos::SubscriberQos pqos = subscriber.qos(); - - ASSERT_TRUE(qos == pqos); - ASSERT_EQ(pqos.entity_factory().autoenable_created_entities, false); -} - TEST(SubscriberTests, ChangeDefaultDataReaderQos) { DomainParticipant* participant = @@ -379,7 +348,7 @@ TEST(SubscriberTests, ChangeDefaultDataReaderQos) // .data_sharing qos.data_sharing().on("/"); - ASSERT_TRUE(subscriber->set_default_datareader_qos(qos) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->set_default_datareader_qos(qos) == RETCODE_OK); DataReaderQos wqos; subscriber->get_default_datareader_qos(wqos); @@ -511,26 +480,8 @@ TEST(SubscriberTests, ChangeDefaultDataReaderQos) EXPECT_EQ(qos, wqos); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(SubscriberTests, ChangePSMDefaultDataReaderQos) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::sub::Subscriber subscriber = ::dds::sub::Subscriber(participant, SUBSCRIBER_QOS_DEFAULT); - - ::dds::sub::qos::DataReaderQos qos = subscriber.default_datareader_qos(); - ASSERT_EQ(qos, DATAREADER_QOS_DEFAULT); - - qos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS; - - ASSERT_NO_THROW(subscriber.default_datareader_qos(qos)); - - ::dds::sub::qos::DataReaderQos rqos = subscriber.default_datareader_qos(); - - ASSERT_EQ(qos, rqos); - ASSERT_EQ(rqos.reliability().kind, BEST_EFFORT_RELIABILITY_QOS); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(SubscriberTests, GetSubscriberParticipant) @@ -543,16 +494,8 @@ TEST(SubscriberTests, GetSubscriberParticipant) ASSERT_EQ(subscriber->get_participant(), participant); - ASSERT_TRUE(participant->delete_subscriber(subscriber) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); -} - -TEST(SubscriberTests, GetPSMSubscriberParticipant) -{ - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - ::dds::sub::Subscriber subscriber = ::dds::sub::Subscriber(participant, SUBSCRIBER_QOS_DEFAULT); - - ASSERT_EQ(subscriber.participant().delegate().get(), participant.delegate().get()); + ASSERT_TRUE(participant->delete_subscriber(subscriber) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } TEST(SubscriberTests, CreateDataReader) @@ -573,10 +516,10 @@ TEST(SubscriberTests, CreateDataReader) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } void check_datareader_with_profile ( @@ -586,53 +529,10 @@ void check_datareader_with_profile ( DataReaderQos qos; datareader->get_qos(qos); - SubscriberAttributes subscriber_atts; - XMLProfileManager::fillSubscriberAttributes(profile_name, subscriber_atts); - - //Values taken from profile - ASSERT_TRUE( - qos.reader_resource_limits().matched_publisher_allocation == - subscriber_atts.matched_publisher_allocation); - if (subscriber_atts.qos.m_partition.names().empty()) - { - ASSERT_TRUE(qos.properties() == subscriber_atts.properties); - } - else - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions"), nullptr); - for (auto partition: subscriber_atts.qos.m_partition.names()) - { - ASSERT_NE(PropertyPolicyHelper::find_property(qos.properties(), "partitions")->find( - partition), std::string::npos); - } - } - ASSERT_TRUE(qos.expects_inline_qos() == subscriber_atts.expectsInlineQos); - ASSERT_TRUE(qos.endpoint().unicast_locator_list == subscriber_atts.unicastLocatorList); - ASSERT_TRUE(qos.endpoint().multicast_locator_list == subscriber_atts.multicastLocatorList); - ASSERT_TRUE(qos.endpoint().remote_locator_list == subscriber_atts.remoteLocatorList); - ASSERT_TRUE(qos.endpoint().history_memory_policy == subscriber_atts.historyMemoryPolicy); - ASSERT_TRUE(qos.endpoint().user_defined_id == subscriber_atts.getUserDefinedID()); - ASSERT_TRUE(qos.endpoint().entity_id == subscriber_atts.getEntityID()); - ASSERT_TRUE(qos.reliable_reader_qos().times == subscriber_atts.times); - ASSERT_TRUE(qos.reliable_reader_qos().disable_positive_ACKs == subscriber_atts.qos.m_disablePositiveACKs); - ASSERT_TRUE(qos.durability() == subscriber_atts.qos.m_durability); - ASSERT_TRUE(qos.durability_service() == subscriber_atts.qos.m_durabilityService); - ASSERT_TRUE(qos.deadline() == subscriber_atts.qos.m_deadline); - ASSERT_TRUE(qos.latency_budget() == subscriber_atts.qos.m_latencyBudget); - ASSERT_TRUE(qos.liveliness() == subscriber_atts.qos.m_liveliness); - ASSERT_TRUE(qos.reliability() == subscriber_atts.qos.m_reliability); - ASSERT_TRUE(qos.lifespan() == subscriber_atts.qos.m_lifespan); - ASSERT_TRUE(qos.user_data().data_vec() == subscriber_atts.qos.m_userData.data_vec()); - ASSERT_TRUE(qos.ownership() == subscriber_atts.qos.m_ownership); - ASSERT_TRUE(qos.destination_order() == subscriber_atts.qos.m_destinationOrder); - ASSERT_TRUE(qos.type_consistency().type_consistency == subscriber_atts.qos.type_consistency); - ASSERT_TRUE(qos.type_consistency().representation == subscriber_atts.qos.representation); - ASSERT_TRUE(qos.time_based_filter() == subscriber_atts.qos.m_timeBasedFilter); - ASSERT_TRUE(qos.history() == subscriber_atts.topic.historyQos); - ASSERT_TRUE(qos.resource_limits() == subscriber_atts.topic.resourceLimitsQos); - - //Values not implemented on attributes (taken from default QoS) - ASSERT_TRUE(qos.reader_data_lifecycle() == DATAREADER_QOS_DEFAULT.reader_data_lifecycle()); + DataReaderQos profile_qos; + EXPECT_EQ(datareader->get_subscriber()->get_datareader_qos_from_profile(profile_name, profile_qos), + RETCODE_OK); + EXPECT_EQ(qos, profile_qos); } TEST(SubscriberTests, CreateDataReaderWithProfile) @@ -649,17 +549,17 @@ TEST(SubscriberTests, CreateDataReaderWithProfile) DataReader* default_datareader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(default_datareader, nullptr); check_datareader_with_profile(default_datareader, "test_default_subscriber_profile"); - ASSERT_TRUE(subscriber->delete_datareader(default_datareader) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(default_datareader) == RETCODE_OK); //participant using non-default profile DataReader* datareader = subscriber->create_datareader_with_profile(topic, "test_subscriber_profile"); ASSERT_NE(datareader, nullptr); check_datareader_with_profile(datareader, "test_subscriber_profile"); - ASSERT_TRUE(subscriber->delete_datareader(datareader) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(subscriber->delete_datareader(datareader) == RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(SubscriberTests, GetDataReaderProfileQos) @@ -679,7 +579,7 @@ TEST(SubscriberTests, GetDataReaderProfileQos) DataReaderQos qos; EXPECT_EQ( subscriber->get_datareader_qos_from_profile("test_subscriber_profile", qos), - ReturnCode_t::RETCODE_OK); + RETCODE_OK); //DataReader using the extracted qos DataReader* datareader = subscriber->create_datareader(topic, qos); @@ -690,13 +590,13 @@ TEST(SubscriberTests, GetDataReaderProfileQos) // Test return when a non-existent profile is used EXPECT_EQ( subscriber->get_datareader_qos_from_profile("incorrect_profile_name", qos), - ReturnCode_t::RETCODE_BAD_PARAMETER); + RETCODE_BAD_PARAMETER); // Clean up - ASSERT_EQ(subscriber->delete_datareader(datareader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(datareader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } TEST(SubscriberTests, DeleteSubscriberWithReaders) @@ -717,47 +617,21 @@ TEST(SubscriberTests, DeleteSubscriberWithReaders) DataReader* data_reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT); ASSERT_NE(data_reader, nullptr); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(subscriber->delete_datareader(data_reader), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_datareader(data_reader), RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); - ASSERT_EQ(participant->delete_topic(topic), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_topic(topic), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } -//TODO: [ILG] Activate the test once PSM API for DataReader is in place -/* - TEST(SubscriberTests, CreatePSMDataReader) - { - ::dds::domain::DomainParticipant participant = ::dds::domain::DomainParticipant(0, PARTICIPANT_QOS_DEFAULT); - - ::dds::sub::Subscriber subscriber = ::dds::core::null; - subscriber = ::dds::sub::Subscriber(participant); - - ASSERT_NE(subscriber, ::dds::core::null); - - TypeSupport type(new TopicDataTypeMock()); - type.register_type(participant.delegate().get()); - - ::dds::topic::Topic topic = ::dds::core::null; - topic = ::dds::topic::Topic(participant, "footopic", type_->getName(), TOPIC_QOS_DEFAULT); - - ASSERT_NE(topic, ::dds::core::null); - - ::dds::sub::DataReader data_reader = ::dds::core::null; - data_reader = ::dds::sub::DataReader(subscriber, topic); - - ASSERT_NE(data_reader, ::dds::core::null); - } - */ - void set_listener_test ( Subscriber* subscriber, SubscriberListener* listener, StatusMask mask) { - ASSERT_EQ(subscriber->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(subscriber->get_status_mask(), mask); } @@ -809,13 +683,13 @@ TEST(SubscriberTests, SetListener) std::get<2>(testing_case)); } - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /* * This test checks that the Subscriber methods defined in the standard not yet implemented in FastDDS return - * ReturnCode_t::RETCODE_UNSUPPORTED. The following methods are checked: + * RETCODE_UNSUPPORTED. The following methods are checked: * 1. begin_access * 2. end_access * 3. get_datareaders (all parameters) @@ -835,16 +709,16 @@ TEST(SubscriberTests, UnsupportedPublisherMethods) fastdds::dds::DataReaderQos reader_qos; fastdds::dds::TopicQos topic_qos; - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->begin_access()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->end_access()); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, subscriber->get_datareaders( + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->begin_access()); + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->end_access()); + EXPECT_EQ(RETCODE_UNSUPPORTED, subscriber->get_datareaders( readers, sample_states, view_states, instance_states)); - ASSERT_EQ(participant->delete_subscriber(subscriber), ReturnCode_t::RETCODE_OK); - ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(participant->delete_subscriber(subscriber), RETCODE_OK); + ASSERT_EQ(DomainParticipantFactory::get_instance()->delete_participant(participant), RETCODE_OK); } /** @@ -952,20 +826,20 @@ TEST(SubscriberTests, DeleteContainedEntities) BarType data; data.index(1); type.get_key(&data, &handle_nil); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, data_writer_foo->write(&data, HANDLE_NIL)); + EXPECT_EQ(RETCODE_OK, data_writer_foo->write(&data, HANDLE_NIL)); // Wait for data to arrive and check OK should be returned Duration_t wait_time(1, 0); EXPECT_TRUE(data_reader_foo->wait_for_unread_message(wait_time)); LoanableSequence mock_coll; - SampleInfoSeq mock_seq; + fastdds::dds::SampleInfoSeq mock_seq; - ASSERT_EQ(data_reader_foo->take(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_foo->take(mock_coll, mock_seq), RETCODE_OK); - ASSERT_EQ(subscriber->delete_contained_entities(), ReturnCode_t::RETCODE_PRECONDITION_NOT_MET); + ASSERT_EQ(subscriber->delete_contained_entities(), RETCODE_PRECONDITION_NOT_MET); - ASSERT_EQ(data_reader_foo->return_loan(mock_coll, mock_seq), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(data_reader_foo->return_loan(mock_coll, mock_seq), RETCODE_OK); SampleStateMask mock_sample_state_kind = ANY_SAMPLE_STATE; ViewStateMask mock_view_state_kind = ANY_VIEW_STATE; @@ -989,7 +863,7 @@ TEST(SubscriberTests, DeleteContainedEntities) ASSERT_TRUE(data_reader_list.size() == 2); data_reader_list.clear(); - ASSERT_EQ(subscriber->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(subscriber->delete_contained_entities(), RETCODE_OK); subscriber->get_datareaders(data_reader_list); ASSERT_TRUE(data_reader_list.size() == 0); diff --git a/test/unittest/dds/topic/CMakeLists.txt b/test/unittest/dds/topic/CMakeLists.txt index e647f1048a1..051ee0b586e 100644 --- a/test/unittest/dds/topic/CMakeLists.txt +++ b/test/unittest/dds/topic/CMakeLists.txt @@ -31,7 +31,7 @@ target_include_directories(TopicTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(TopicTests fastrtps fastcdr foonathan_memory +target_link_libraries(TopicTests fastdds fastcdr foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(TopicTests) diff --git a/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt b/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt index f30b03366d9..877f78b1b7c 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt +++ b/test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt @@ -20,7 +20,6 @@ file(GLOB DDSSQLFILTER_SOURCES ) file(GLOB DDSSQLFILTER_LIB_SOURCES - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/*.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/*.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp @@ -55,11 +54,18 @@ target_compile_definitions(DDSSQLFilterTests PRIVATE ) target_include_directories(DDSSQLFilterTests PRIVATE ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/thirdparty/taocpp-pegtl ) -target_link_libraries(DDSSQLFilterTests fastcdr foonathan_memory +target_link_libraries(DDSSQLFilterTests + fastcdr + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock - ${CMAKE_DL_LIBS}) + ${CMAKE_DL_LIBS} + ) gtest_discover_tests(DDSSQLFilterTests) diff --git a/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp b/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp index 1c26f98b22a..693cb30e78c 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp +++ b/test/unittest/dds/topic/DDSSQLFilter/DDSSQLFilterTests.cpp @@ -29,9 +29,9 @@ #include "fastdds/dds/core/StackAllocatedSequence.hpp" #include "fastdds/dds/log/Log.hpp" -#include "data_types/ContentFilterTestType.h" +#include "data_types/ContentFilterTestType.hpp" #include "data_types/ContentFilterTestTypePubSubTypes.h" -#include "data_types/ContentFilterTestTypeTypeObject.h" +#include "data_types/ContentFilterTestTypeTypeObjectSupport.hpp" namespace eprosima { namespace fastdds { @@ -120,7 +120,6 @@ static bool are_types_compatible( } using DDSFilterFactory = DDSSQLFilter::DDSFilterFactory; -using ReturnCode_t = DDSFilterFactory::ReturnCode_t; static ReturnCode_t create_content_filter( DDSFilterFactory& factory, @@ -148,8 +147,14 @@ class DDSSQLFilterTests : public testing::Test protected: - const ReturnCode_t ok_code = ReturnCode_t::RETCODE_OK; - const ReturnCode_t bad_code = ReturnCode_t::RETCODE_BAD_PARAMETER; + void SetUp() override + { + register_ContentFilterTestType_type_objects(); + eprosima::fastdds::dds::Log::ClearConsumers(); + } + + const ReturnCode_t ok_code = RETCODE_OK; + const ReturnCode_t bad_code = RETCODE_BAD_PARAMETER; struct TestCase { @@ -185,7 +190,7 @@ class DDSSQLFilterTests : public testing::Test TEST_F(DDSSQLFilterTests, empty_expression) { - TestCase empty{ "", {}, ReturnCode_t::RETCODE_OK }; + TestCase empty{ "", {}, RETCODE_OK }; run(empty); } @@ -1010,6 +1015,12 @@ class DDSSQLFilterValueTests : public testing::TestWithParam 1 - -#include "ContentFilterTestTypeTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -StructType::StructType() -{ - // Just to register all known types - registerContentFilterTestTypeTypes(); -} - -StructType::~StructType() -{ -} - -StructType::StructType( - const StructType& x) -{ - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = x.m_string_field; - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; -} - -StructType::StructType( - StructType&& x) noexcept -{ - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = std::move(x.m_string_field); - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; -} - -StructType& StructType::operator =( - const StructType& x) -{ - - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = x.m_string_field; - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - return *this; -} - -StructType& StructType::operator =( - StructType&& x) noexcept -{ - - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = std::move(x.m_string_field); - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - return *this; -} - -bool StructType::operator ==( - const StructType& x) const -{ - return (m_char_field == x.m_char_field && - m_uint8_field == x.m_uint8_field && - m_int16_field == x.m_int16_field && - m_uint16_field == x.m_uint16_field && - m_int32_field == x.m_int32_field && - m_uint32_field == x.m_uint32_field && - m_int64_field == x.m_int64_field && - m_uint64_field == x.m_uint64_field && - m_float_field == x.m_float_field && - m_double_field == x.m_double_field && - m_long_double_field == x.m_long_double_field && - m_bool_field == x.m_bool_field && - m_string_field == x.m_string_field && - m_enum_field == x.m_enum_field && - m_enum2_field == x.m_enum2_field); -} - -bool StructType::operator !=( - const StructType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ -void StructType::char_field( - char _char_field) -{ - m_char_field = _char_field; -} - -/*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ -char StructType::char_field() const -{ - return m_char_field; -} - -/*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ -char& StructType::char_field() -{ - return m_char_field; -} - - -/*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ -void StructType::uint8_field( - uint8_t _uint8_field) -{ - m_uint8_field = _uint8_field; -} - -/*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ -uint8_t StructType::uint8_field() const -{ - return m_uint8_field; -} - -/*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ -uint8_t& StructType::uint8_field() -{ - return m_uint8_field; -} - - -/*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ -void StructType::int16_field( - int16_t _int16_field) -{ - m_int16_field = _int16_field; -} - -/*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ -int16_t StructType::int16_field() const -{ - return m_int16_field; -} - -/*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ -int16_t& StructType::int16_field() -{ - return m_int16_field; -} - - -/*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ -void StructType::uint16_field( - uint16_t _uint16_field) -{ - m_uint16_field = _uint16_field; -} - -/*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ -uint16_t StructType::uint16_field() const -{ - return m_uint16_field; -} - -/*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ -uint16_t& StructType::uint16_field() -{ - return m_uint16_field; -} - - -/*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ -void StructType::int32_field( - int32_t _int32_field) -{ - m_int32_field = _int32_field; -} - -/*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ -int32_t StructType::int32_field() const -{ - return m_int32_field; -} - -/*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ -int32_t& StructType::int32_field() -{ - return m_int32_field; -} - - -/*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ -void StructType::uint32_field( - uint32_t _uint32_field) -{ - m_uint32_field = _uint32_field; -} - -/*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ -uint32_t StructType::uint32_field() const -{ - return m_uint32_field; -} - -/*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ -uint32_t& StructType::uint32_field() -{ - return m_uint32_field; -} - - -/*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ -void StructType::int64_field( - int64_t _int64_field) -{ - m_int64_field = _int64_field; -} - -/*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ -int64_t StructType::int64_field() const -{ - return m_int64_field; -} - -/*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ -int64_t& StructType::int64_field() -{ - return m_int64_field; -} - - -/*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ -void StructType::uint64_field( - uint64_t _uint64_field) -{ - m_uint64_field = _uint64_field; -} - -/*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ -uint64_t StructType::uint64_field() const -{ - return m_uint64_field; -} - -/*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ -uint64_t& StructType::uint64_field() -{ - return m_uint64_field; -} - - -/*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ -void StructType::float_field( - float _float_field) -{ - m_float_field = _float_field; -} - -/*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ -float StructType::float_field() const -{ - return m_float_field; -} - -/*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ -float& StructType::float_field() -{ - return m_float_field; -} - - -/*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ -void StructType::double_field( - double _double_field) -{ - m_double_field = _double_field; -} - -/*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ -double StructType::double_field() const -{ - return m_double_field; -} - -/*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ -double& StructType::double_field() -{ - return m_double_field; -} - - -/*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ -void StructType::long_double_field( - long double _long_double_field) -{ - m_long_double_field = _long_double_field; -} - -/*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ -long double StructType::long_double_field() const -{ - return m_long_double_field; -} - -/*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ -long double& StructType::long_double_field() -{ - return m_long_double_field; -} - - -/*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ -void StructType::bool_field( - bool _bool_field) -{ - m_bool_field = _bool_field; -} - -/*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ -bool StructType::bool_field() const -{ - return m_bool_field; -} - -/*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ -bool& StructType::bool_field() -{ - return m_bool_field; -} - - -/*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ -void StructType::string_field( - const std::string& _string_field) -{ - m_string_field = _string_field; -} - -/*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ -void StructType::string_field( - std::string&& _string_field) -{ - m_string_field = std::move(_string_field); -} - -/*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ -const std::string& StructType::string_field() const -{ - return m_string_field; -} - -/*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ -std::string& StructType::string_field() -{ - return m_string_field; -} - - -/*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ -void StructType::enum_field( - Color _enum_field) -{ - m_enum_field = _enum_field; -} - -/*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ -Color StructType::enum_field() const -{ - return m_enum_field; -} - -/*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ -Color& StructType::enum_field() -{ - return m_enum_field; -} - - -/*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ -void StructType::enum2_field( - Material _enum2_field) -{ - m_enum2_field = _enum2_field; -} - -/*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ -Material StructType::enum2_field() const -{ - return m_enum2_field; -} - -/*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ -Material& StructType::enum2_field() -{ - return m_enum2_field; -} - - - - - - - - -ContentFilterTestType::ContentFilterTestType() -{ - // Just to register all known types - registerContentFilterTestTypeTypes(); -} - -ContentFilterTestType::~ContentFilterTestType() -{ -} - -ContentFilterTestType::ContentFilterTestType( - const ContentFilterTestType& x) -{ - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = x.m_string_field; - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = x.m_struct_field; - m_array_char_field = x.m_array_char_field; - m_array_uint8_field = x.m_array_uint8_field; - m_array_int16_field = x.m_array_int16_field; - m_array_uint16_field = x.m_array_uint16_field; - m_array_int32_field = x.m_array_int32_field; - m_array_uint32_field = x.m_array_uint32_field; - m_array_int64_field = x.m_array_int64_field; - m_array_uint64_field = x.m_array_uint64_field; - m_array_float_field = x.m_array_float_field; - m_array_double_field = x.m_array_double_field; - m_array_long_double_field = x.m_array_long_double_field; - m_array_bool_field = x.m_array_bool_field; - m_array_string_field = x.m_array_string_field; - m_array_enum_field = x.m_array_enum_field; - m_array_enum2_field = x.m_array_enum2_field; - m_array_struct_field = x.m_array_struct_field; - m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; - m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; - m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; - m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; - m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; - m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; - m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; - m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; - m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; - m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; - m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; - m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; - m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; - m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; - m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; - m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; - m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; - m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; - m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; - m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; - m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; - m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; - m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; - m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; - m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; - m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; - m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; - m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; - m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; - m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; - m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; - m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; -} - -ContentFilterTestType::ContentFilterTestType( - ContentFilterTestType&& x) noexcept -{ - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = std::move(x.m_string_field); - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = std::move(x.m_struct_field); - m_array_char_field = std::move(x.m_array_char_field); - m_array_uint8_field = std::move(x.m_array_uint8_field); - m_array_int16_field = std::move(x.m_array_int16_field); - m_array_uint16_field = std::move(x.m_array_uint16_field); - m_array_int32_field = std::move(x.m_array_int32_field); - m_array_uint32_field = std::move(x.m_array_uint32_field); - m_array_int64_field = std::move(x.m_array_int64_field); - m_array_uint64_field = std::move(x.m_array_uint64_field); - m_array_float_field = std::move(x.m_array_float_field); - m_array_double_field = std::move(x.m_array_double_field); - m_array_long_double_field = std::move(x.m_array_long_double_field); - m_array_bool_field = std::move(x.m_array_bool_field); - m_array_string_field = std::move(x.m_array_string_field); - m_array_enum_field = std::move(x.m_array_enum_field); - m_array_enum2_field = std::move(x.m_array_enum2_field); - m_array_struct_field = std::move(x.m_array_struct_field); - m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); - m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); - m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); - m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); - m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); - m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); - m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); - m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); - m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); - m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); - m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); - m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); - m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); - m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); - m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); - m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); -} - -ContentFilterTestType& ContentFilterTestType::operator =( - const ContentFilterTestType& x) -{ - - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = x.m_string_field; - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = x.m_struct_field; - m_array_char_field = x.m_array_char_field; - m_array_uint8_field = x.m_array_uint8_field; - m_array_int16_field = x.m_array_int16_field; - m_array_uint16_field = x.m_array_uint16_field; - m_array_int32_field = x.m_array_int32_field; - m_array_uint32_field = x.m_array_uint32_field; - m_array_int64_field = x.m_array_int64_field; - m_array_uint64_field = x.m_array_uint64_field; - m_array_float_field = x.m_array_float_field; - m_array_double_field = x.m_array_double_field; - m_array_long_double_field = x.m_array_long_double_field; - m_array_bool_field = x.m_array_bool_field; - m_array_string_field = x.m_array_string_field; - m_array_enum_field = x.m_array_enum_field; - m_array_enum2_field = x.m_array_enum2_field; - m_array_struct_field = x.m_array_struct_field; - m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; - m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; - m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; - m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; - m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; - m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; - m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; - m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; - m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; - m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; - m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; - m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; - m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; - m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; - m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; - m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; - m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; - m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; - m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; - m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; - m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; - m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; - m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; - m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; - m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; - m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; - m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; - m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; - m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; - m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; - m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; - m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - return *this; -} - -ContentFilterTestType& ContentFilterTestType::operator =( - ContentFilterTestType&& x) noexcept -{ - - m_char_field = x.m_char_field; - m_uint8_field = x.m_uint8_field; - m_int16_field = x.m_int16_field; - m_uint16_field = x.m_uint16_field; - m_int32_field = x.m_int32_field; - m_uint32_field = x.m_uint32_field; - m_int64_field = x.m_int64_field; - m_uint64_field = x.m_uint64_field; - m_float_field = x.m_float_field; - m_double_field = x.m_double_field; - m_long_double_field = x.m_long_double_field; - m_bool_field = x.m_bool_field; - m_string_field = std::move(x.m_string_field); - m_enum_field = x.m_enum_field; - m_enum2_field = x.m_enum2_field; - m_struct_field = std::move(x.m_struct_field); - m_array_char_field = std::move(x.m_array_char_field); - m_array_uint8_field = std::move(x.m_array_uint8_field); - m_array_int16_field = std::move(x.m_array_int16_field); - m_array_uint16_field = std::move(x.m_array_uint16_field); - m_array_int32_field = std::move(x.m_array_int32_field); - m_array_uint32_field = std::move(x.m_array_uint32_field); - m_array_int64_field = std::move(x.m_array_int64_field); - m_array_uint64_field = std::move(x.m_array_uint64_field); - m_array_float_field = std::move(x.m_array_float_field); - m_array_double_field = std::move(x.m_array_double_field); - m_array_long_double_field = std::move(x.m_array_long_double_field); - m_array_bool_field = std::move(x.m_array_bool_field); - m_array_string_field = std::move(x.m_array_string_field); - m_array_enum_field = std::move(x.m_array_enum_field); - m_array_enum2_field = std::move(x.m_array_enum2_field); - m_array_struct_field = std::move(x.m_array_struct_field); - m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); - m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); - m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); - m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); - m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); - m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); - m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); - m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); - m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); - m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); - m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); - m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); - m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); - m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); - m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); - m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - return *this; -} - -bool ContentFilterTestType::operator ==( - const ContentFilterTestType& x) const -{ - return (m_char_field == x.m_char_field && - m_uint8_field == x.m_uint8_field && - m_int16_field == x.m_int16_field && - m_uint16_field == x.m_uint16_field && - m_int32_field == x.m_int32_field && - m_uint32_field == x.m_uint32_field && - m_int64_field == x.m_int64_field && - m_uint64_field == x.m_uint64_field && - m_float_field == x.m_float_field && - m_double_field == x.m_double_field && - m_long_double_field == x.m_long_double_field && - m_bool_field == x.m_bool_field && - m_string_field == x.m_string_field && - m_enum_field == x.m_enum_field && - m_enum2_field == x.m_enum2_field && - m_struct_field == x.m_struct_field && - m_array_char_field == x.m_array_char_field && - m_array_uint8_field == x.m_array_uint8_field && - m_array_int16_field == x.m_array_int16_field && - m_array_uint16_field == x.m_array_uint16_field && - m_array_int32_field == x.m_array_int32_field && - m_array_uint32_field == x.m_array_uint32_field && - m_array_int64_field == x.m_array_int64_field && - m_array_uint64_field == x.m_array_uint64_field && - m_array_float_field == x.m_array_float_field && - m_array_double_field == x.m_array_double_field && - m_array_long_double_field == x.m_array_long_double_field && - m_array_bool_field == x.m_array_bool_field && - m_array_string_field == x.m_array_string_field && - m_array_enum_field == x.m_array_enum_field && - m_array_enum2_field == x.m_array_enum2_field && - m_array_struct_field == x.m_array_struct_field && - m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && - m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && - m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && - m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && - m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && - m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && - m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && - m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && - m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && - m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && - m_bounded_sequence_long_double_field == x.m_bounded_sequence_long_double_field && - m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && - m_bounded_sequence_string_field == x.m_bounded_sequence_string_field && - m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && - m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && - m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && - m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && - m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && - m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && - m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && - m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && - m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && - m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && - m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && - m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && - m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && - m_unbounded_sequence_long_double_field == x.m_unbounded_sequence_long_double_field && - m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && - m_unbounded_sequence_string_field == x.m_unbounded_sequence_string_field && - m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && - m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && - m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); -} - -bool ContentFilterTestType::operator !=( - const ContentFilterTestType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ -void ContentFilterTestType::char_field( - char _char_field) -{ - m_char_field = _char_field; -} - -/*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ -char ContentFilterTestType::char_field() const -{ - return m_char_field; -} - -/*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ -char& ContentFilterTestType::char_field() -{ - return m_char_field; -} - - -/*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ -void ContentFilterTestType::uint8_field( - uint8_t _uint8_field) -{ - m_uint8_field = _uint8_field; -} - -/*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ -uint8_t ContentFilterTestType::uint8_field() const -{ - return m_uint8_field; -} - -/*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ -uint8_t& ContentFilterTestType::uint8_field() -{ - return m_uint8_field; -} - - -/*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ -void ContentFilterTestType::int16_field( - int16_t _int16_field) -{ - m_int16_field = _int16_field; -} - -/*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ -int16_t ContentFilterTestType::int16_field() const -{ - return m_int16_field; -} - -/*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ -int16_t& ContentFilterTestType::int16_field() -{ - return m_int16_field; -} - - -/*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ -void ContentFilterTestType::uint16_field( - uint16_t _uint16_field) -{ - m_uint16_field = _uint16_field; -} - -/*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ -uint16_t ContentFilterTestType::uint16_field() const -{ - return m_uint16_field; -} - -/*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ -uint16_t& ContentFilterTestType::uint16_field() -{ - return m_uint16_field; -} - - -/*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ -void ContentFilterTestType::int32_field( - int32_t _int32_field) -{ - m_int32_field = _int32_field; -} - -/*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ -int32_t ContentFilterTestType::int32_field() const -{ - return m_int32_field; -} - -/*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ -int32_t& ContentFilterTestType::int32_field() -{ - return m_int32_field; -} - - -/*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ -void ContentFilterTestType::uint32_field( - uint32_t _uint32_field) -{ - m_uint32_field = _uint32_field; -} - -/*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ -uint32_t ContentFilterTestType::uint32_field() const -{ - return m_uint32_field; -} - -/*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ -uint32_t& ContentFilterTestType::uint32_field() -{ - return m_uint32_field; -} - - -/*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ -void ContentFilterTestType::int64_field( - int64_t _int64_field) -{ - m_int64_field = _int64_field; -} - -/*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ -int64_t ContentFilterTestType::int64_field() const -{ - return m_int64_field; -} - -/*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ -int64_t& ContentFilterTestType::int64_field() -{ - return m_int64_field; -} - - -/*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ -void ContentFilterTestType::uint64_field( - uint64_t _uint64_field) -{ - m_uint64_field = _uint64_field; -} - -/*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ -uint64_t ContentFilterTestType::uint64_field() const -{ - return m_uint64_field; -} - -/*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ -uint64_t& ContentFilterTestType::uint64_field() -{ - return m_uint64_field; -} - - -/*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ -void ContentFilterTestType::float_field( - float _float_field) -{ - m_float_field = _float_field; -} - -/*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ -float ContentFilterTestType::float_field() const -{ - return m_float_field; -} - -/*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ -float& ContentFilterTestType::float_field() -{ - return m_float_field; -} - - -/*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ -void ContentFilterTestType::double_field( - double _double_field) -{ - m_double_field = _double_field; -} - -/*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ -double ContentFilterTestType::double_field() const -{ - return m_double_field; -} - -/*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ -double& ContentFilterTestType::double_field() -{ - return m_double_field; -} - - -/*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ -void ContentFilterTestType::long_double_field( - long double _long_double_field) -{ - m_long_double_field = _long_double_field; -} - -/*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ -long double ContentFilterTestType::long_double_field() const -{ - return m_long_double_field; -} - -/*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ -long double& ContentFilterTestType::long_double_field() -{ - return m_long_double_field; -} - - -/*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ -void ContentFilterTestType::bool_field( - bool _bool_field) -{ - m_bool_field = _bool_field; -} - -/*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ -bool ContentFilterTestType::bool_field() const -{ - return m_bool_field; -} - -/*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ -bool& ContentFilterTestType::bool_field() -{ - return m_bool_field; -} - - -/*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ -void ContentFilterTestType::string_field( - const std::string& _string_field) -{ - m_string_field = _string_field; -} - -/*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ -void ContentFilterTestType::string_field( - std::string&& _string_field) -{ - m_string_field = std::move(_string_field); -} - -/*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ -const std::string& ContentFilterTestType::string_field() const -{ - return m_string_field; -} - -/*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ -std::string& ContentFilterTestType::string_field() -{ - return m_string_field; -} - - -/*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ -void ContentFilterTestType::enum_field( - Color _enum_field) -{ - m_enum_field = _enum_field; -} - -/*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ -Color ContentFilterTestType::enum_field() const -{ - return m_enum_field; -} - -/*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ -Color& ContentFilterTestType::enum_field() -{ - return m_enum_field; -} - - -/*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ -void ContentFilterTestType::enum2_field( - Material _enum2_field) -{ - m_enum2_field = _enum2_field; -} - -/*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ -Material ContentFilterTestType::enum2_field() const -{ - return m_enum2_field; -} - -/*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ -Material& ContentFilterTestType::enum2_field() -{ - return m_enum2_field; -} - - -/*! - * @brief This function copies the value in member struct_field - * @param _struct_field New value to be copied in member struct_field - */ -void ContentFilterTestType::struct_field( - const StructType& _struct_field) -{ - m_struct_field = _struct_field; -} - -/*! - * @brief This function moves the value in member struct_field - * @param _struct_field New value to be moved in member struct_field - */ -void ContentFilterTestType::struct_field( - StructType&& _struct_field) -{ - m_struct_field = std::move(_struct_field); -} - -/*! - * @brief This function returns a constant reference to member struct_field - * @return Constant reference to member struct_field - */ -const StructType& ContentFilterTestType::struct_field() const -{ - return m_struct_field; -} - -/*! - * @brief This function returns a reference to member struct_field - * @return Reference to member struct_field - */ -StructType& ContentFilterTestType::struct_field() -{ - return m_struct_field; -} - - -/*! - * @brief This function copies the value in member array_char_field - * @param _array_char_field New value to be copied in member array_char_field - */ -void ContentFilterTestType::array_char_field( - const std::array& _array_char_field) -{ - m_array_char_field = _array_char_field; -} - -/*! - * @brief This function moves the value in member array_char_field - * @param _array_char_field New value to be moved in member array_char_field - */ -void ContentFilterTestType::array_char_field( - std::array&& _array_char_field) -{ - m_array_char_field = std::move(_array_char_field); -} - -/*! - * @brief This function returns a constant reference to member array_char_field - * @return Constant reference to member array_char_field - */ -const std::array& ContentFilterTestType::array_char_field() const -{ - return m_array_char_field; -} - -/*! - * @brief This function returns a reference to member array_char_field - * @return Reference to member array_char_field - */ -std::array& ContentFilterTestType::array_char_field() -{ - return m_array_char_field; -} - - -/*! - * @brief This function copies the value in member array_uint8_field - * @param _array_uint8_field New value to be copied in member array_uint8_field - */ -void ContentFilterTestType::array_uint8_field( - const std::array& _array_uint8_field) -{ - m_array_uint8_field = _array_uint8_field; -} - -/*! - * @brief This function moves the value in member array_uint8_field - * @param _array_uint8_field New value to be moved in member array_uint8_field - */ -void ContentFilterTestType::array_uint8_field( - std::array&& _array_uint8_field) -{ - m_array_uint8_field = std::move(_array_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint8_field - * @return Constant reference to member array_uint8_field - */ -const std::array& ContentFilterTestType::array_uint8_field() const -{ - return m_array_uint8_field; -} - -/*! - * @brief This function returns a reference to member array_uint8_field - * @return Reference to member array_uint8_field - */ -std::array& ContentFilterTestType::array_uint8_field() -{ - return m_array_uint8_field; -} - - -/*! - * @brief This function copies the value in member array_int16_field - * @param _array_int16_field New value to be copied in member array_int16_field - */ -void ContentFilterTestType::array_int16_field( - const std::array& _array_int16_field) -{ - m_array_int16_field = _array_int16_field; -} - -/*! - * @brief This function moves the value in member array_int16_field - * @param _array_int16_field New value to be moved in member array_int16_field - */ -void ContentFilterTestType::array_int16_field( - std::array&& _array_int16_field) -{ - m_array_int16_field = std::move(_array_int16_field); -} - -/*! - * @brief This function returns a constant reference to member array_int16_field - * @return Constant reference to member array_int16_field - */ -const std::array& ContentFilterTestType::array_int16_field() const -{ - return m_array_int16_field; -} - -/*! - * @brief This function returns a reference to member array_int16_field - * @return Reference to member array_int16_field - */ -std::array& ContentFilterTestType::array_int16_field() -{ - return m_array_int16_field; -} - - -/*! - * @brief This function copies the value in member array_uint16_field - * @param _array_uint16_field New value to be copied in member array_uint16_field - */ -void ContentFilterTestType::array_uint16_field( - const std::array& _array_uint16_field) -{ - m_array_uint16_field = _array_uint16_field; -} - -/*! - * @brief This function moves the value in member array_uint16_field - * @param _array_uint16_field New value to be moved in member array_uint16_field - */ -void ContentFilterTestType::array_uint16_field( - std::array&& _array_uint16_field) -{ - m_array_uint16_field = std::move(_array_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint16_field - * @return Constant reference to member array_uint16_field - */ -const std::array& ContentFilterTestType::array_uint16_field() const -{ - return m_array_uint16_field; -} - -/*! - * @brief This function returns a reference to member array_uint16_field - * @return Reference to member array_uint16_field - */ -std::array& ContentFilterTestType::array_uint16_field() -{ - return m_array_uint16_field; -} - - -/*! - * @brief This function copies the value in member array_int32_field - * @param _array_int32_field New value to be copied in member array_int32_field - */ -void ContentFilterTestType::array_int32_field( - const std::array& _array_int32_field) -{ - m_array_int32_field = _array_int32_field; -} - -/*! - * @brief This function moves the value in member array_int32_field - * @param _array_int32_field New value to be moved in member array_int32_field - */ -void ContentFilterTestType::array_int32_field( - std::array&& _array_int32_field) -{ - m_array_int32_field = std::move(_array_int32_field); -} - -/*! - * @brief This function returns a constant reference to member array_int32_field - * @return Constant reference to member array_int32_field - */ -const std::array& ContentFilterTestType::array_int32_field() const -{ - return m_array_int32_field; -} - -/*! - * @brief This function returns a reference to member array_int32_field - * @return Reference to member array_int32_field - */ -std::array& ContentFilterTestType::array_int32_field() -{ - return m_array_int32_field; -} - - -/*! - * @brief This function copies the value in member array_uint32_field - * @param _array_uint32_field New value to be copied in member array_uint32_field - */ -void ContentFilterTestType::array_uint32_field( - const std::array& _array_uint32_field) -{ - m_array_uint32_field = _array_uint32_field; -} - -/*! - * @brief This function moves the value in member array_uint32_field - * @param _array_uint32_field New value to be moved in member array_uint32_field - */ -void ContentFilterTestType::array_uint32_field( - std::array&& _array_uint32_field) -{ - m_array_uint32_field = std::move(_array_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint32_field - * @return Constant reference to member array_uint32_field - */ -const std::array& ContentFilterTestType::array_uint32_field() const -{ - return m_array_uint32_field; -} - -/*! - * @brief This function returns a reference to member array_uint32_field - * @return Reference to member array_uint32_field - */ -std::array& ContentFilterTestType::array_uint32_field() -{ - return m_array_uint32_field; -} - - -/*! - * @brief This function copies the value in member array_int64_field - * @param _array_int64_field New value to be copied in member array_int64_field - */ -void ContentFilterTestType::array_int64_field( - const std::array& _array_int64_field) -{ - m_array_int64_field = _array_int64_field; -} - -/*! - * @brief This function moves the value in member array_int64_field - * @param _array_int64_field New value to be moved in member array_int64_field - */ -void ContentFilterTestType::array_int64_field( - std::array&& _array_int64_field) -{ - m_array_int64_field = std::move(_array_int64_field); -} - -/*! - * @brief This function returns a constant reference to member array_int64_field - * @return Constant reference to member array_int64_field - */ -const std::array& ContentFilterTestType::array_int64_field() const -{ - return m_array_int64_field; -} - -/*! - * @brief This function returns a reference to member array_int64_field - * @return Reference to member array_int64_field - */ -std::array& ContentFilterTestType::array_int64_field() -{ - return m_array_int64_field; -} - - -/*! - * @brief This function copies the value in member array_uint64_field - * @param _array_uint64_field New value to be copied in member array_uint64_field - */ -void ContentFilterTestType::array_uint64_field( - const std::array& _array_uint64_field) -{ - m_array_uint64_field = _array_uint64_field; -} - -/*! - * @brief This function moves the value in member array_uint64_field - * @param _array_uint64_field New value to be moved in member array_uint64_field - */ -void ContentFilterTestType::array_uint64_field( - std::array&& _array_uint64_field) -{ - m_array_uint64_field = std::move(_array_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint64_field - * @return Constant reference to member array_uint64_field - */ -const std::array& ContentFilterTestType::array_uint64_field() const -{ - return m_array_uint64_field; -} - -/*! - * @brief This function returns a reference to member array_uint64_field - * @return Reference to member array_uint64_field - */ -std::array& ContentFilterTestType::array_uint64_field() -{ - return m_array_uint64_field; -} - - -/*! - * @brief This function copies the value in member array_float_field - * @param _array_float_field New value to be copied in member array_float_field - */ -void ContentFilterTestType::array_float_field( - const std::array& _array_float_field) -{ - m_array_float_field = _array_float_field; -} - -/*! - * @brief This function moves the value in member array_float_field - * @param _array_float_field New value to be moved in member array_float_field - */ -void ContentFilterTestType::array_float_field( - std::array&& _array_float_field) -{ - m_array_float_field = std::move(_array_float_field); -} - -/*! - * @brief This function returns a constant reference to member array_float_field - * @return Constant reference to member array_float_field - */ -const std::array& ContentFilterTestType::array_float_field() const -{ - return m_array_float_field; -} - -/*! - * @brief This function returns a reference to member array_float_field - * @return Reference to member array_float_field - */ -std::array& ContentFilterTestType::array_float_field() -{ - return m_array_float_field; -} - - -/*! - * @brief This function copies the value in member array_double_field - * @param _array_double_field New value to be copied in member array_double_field - */ -void ContentFilterTestType::array_double_field( - const std::array& _array_double_field) -{ - m_array_double_field = _array_double_field; -} - -/*! - * @brief This function moves the value in member array_double_field - * @param _array_double_field New value to be moved in member array_double_field - */ -void ContentFilterTestType::array_double_field( - std::array&& _array_double_field) -{ - m_array_double_field = std::move(_array_double_field); -} - -/*! - * @brief This function returns a constant reference to member array_double_field - * @return Constant reference to member array_double_field - */ -const std::array& ContentFilterTestType::array_double_field() const -{ - return m_array_double_field; -} - -/*! - * @brief This function returns a reference to member array_double_field - * @return Reference to member array_double_field - */ -std::array& ContentFilterTestType::array_double_field() -{ - return m_array_double_field; -} - - -/*! - * @brief This function copies the value in member array_long_double_field - * @param _array_long_double_field New value to be copied in member array_long_double_field - */ -void ContentFilterTestType::array_long_double_field( - const std::array& _array_long_double_field) -{ - m_array_long_double_field = _array_long_double_field; -} - -/*! - * @brief This function moves the value in member array_long_double_field - * @param _array_long_double_field New value to be moved in member array_long_double_field - */ -void ContentFilterTestType::array_long_double_field( - std::array&& _array_long_double_field) -{ - m_array_long_double_field = std::move(_array_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member array_long_double_field - * @return Constant reference to member array_long_double_field - */ -const std::array& ContentFilterTestType::array_long_double_field() const -{ - return m_array_long_double_field; -} - -/*! - * @brief This function returns a reference to member array_long_double_field - * @return Reference to member array_long_double_field - */ -std::array& ContentFilterTestType::array_long_double_field() -{ - return m_array_long_double_field; -} - - -/*! - * @brief This function copies the value in member array_bool_field - * @param _array_bool_field New value to be copied in member array_bool_field - */ -void ContentFilterTestType::array_bool_field( - const std::array& _array_bool_field) -{ - m_array_bool_field = _array_bool_field; -} - -/*! - * @brief This function moves the value in member array_bool_field - * @param _array_bool_field New value to be moved in member array_bool_field - */ -void ContentFilterTestType::array_bool_field( - std::array&& _array_bool_field) -{ - m_array_bool_field = std::move(_array_bool_field); -} - -/*! - * @brief This function returns a constant reference to member array_bool_field - * @return Constant reference to member array_bool_field - */ -const std::array& ContentFilterTestType::array_bool_field() const -{ - return m_array_bool_field; -} - -/*! - * @brief This function returns a reference to member array_bool_field - * @return Reference to member array_bool_field - */ -std::array& ContentFilterTestType::array_bool_field() -{ - return m_array_bool_field; -} - - -/*! - * @brief This function copies the value in member array_string_field - * @param _array_string_field New value to be copied in member array_string_field - */ -void ContentFilterTestType::array_string_field( - const std::array& _array_string_field) -{ - m_array_string_field = _array_string_field; -} - -/*! - * @brief This function moves the value in member array_string_field - * @param _array_string_field New value to be moved in member array_string_field - */ -void ContentFilterTestType::array_string_field( - std::array&& _array_string_field) -{ - m_array_string_field = std::move(_array_string_field); -} - -/*! - * @brief This function returns a constant reference to member array_string_field - * @return Constant reference to member array_string_field - */ -const std::array& ContentFilterTestType::array_string_field() const -{ - return m_array_string_field; -} - -/*! - * @brief This function returns a reference to member array_string_field - * @return Reference to member array_string_field - */ -std::array& ContentFilterTestType::array_string_field() -{ - return m_array_string_field; -} - - -/*! - * @brief This function copies the value in member array_enum_field - * @param _array_enum_field New value to be copied in member array_enum_field - */ -void ContentFilterTestType::array_enum_field( - const std::array& _array_enum_field) -{ - m_array_enum_field = _array_enum_field; -} - -/*! - * @brief This function moves the value in member array_enum_field - * @param _array_enum_field New value to be moved in member array_enum_field - */ -void ContentFilterTestType::array_enum_field( - std::array&& _array_enum_field) -{ - m_array_enum_field = std::move(_array_enum_field); -} - -/*! - * @brief This function returns a constant reference to member array_enum_field - * @return Constant reference to member array_enum_field - */ -const std::array& ContentFilterTestType::array_enum_field() const -{ - return m_array_enum_field; -} - -/*! - * @brief This function returns a reference to member array_enum_field - * @return Reference to member array_enum_field - */ -std::array& ContentFilterTestType::array_enum_field() -{ - return m_array_enum_field; -} - - -/*! - * @brief This function copies the value in member array_enum2_field - * @param _array_enum2_field New value to be copied in member array_enum2_field - */ -void ContentFilterTestType::array_enum2_field( - const std::array& _array_enum2_field) -{ - m_array_enum2_field = _array_enum2_field; -} - -/*! - * @brief This function moves the value in member array_enum2_field - * @param _array_enum2_field New value to be moved in member array_enum2_field - */ -void ContentFilterTestType::array_enum2_field( - std::array&& _array_enum2_field) -{ - m_array_enum2_field = std::move(_array_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member array_enum2_field - * @return Constant reference to member array_enum2_field - */ -const std::array& ContentFilterTestType::array_enum2_field() const -{ - return m_array_enum2_field; -} - -/*! - * @brief This function returns a reference to member array_enum2_field - * @return Reference to member array_enum2_field - */ -std::array& ContentFilterTestType::array_enum2_field() -{ - return m_array_enum2_field; -} - - -/*! - * @brief This function copies the value in member array_struct_field - * @param _array_struct_field New value to be copied in member array_struct_field - */ -void ContentFilterTestType::array_struct_field( - const std::array& _array_struct_field) -{ - m_array_struct_field = _array_struct_field; -} - -/*! - * @brief This function moves the value in member array_struct_field - * @param _array_struct_field New value to be moved in member array_struct_field - */ -void ContentFilterTestType::array_struct_field( - std::array&& _array_struct_field) -{ - m_array_struct_field = std::move(_array_struct_field); -} - -/*! - * @brief This function returns a constant reference to member array_struct_field - * @return Constant reference to member array_struct_field - */ -const std::array& ContentFilterTestType::array_struct_field() const -{ - return m_array_struct_field; -} - -/*! - * @brief This function returns a reference to member array_struct_field - * @return Reference to member array_struct_field - */ -std::array& ContentFilterTestType::array_struct_field() -{ - return m_array_struct_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field - */ -void ContentFilterTestType::bounded_sequence_char_field( - const std::vector& _bounded_sequence_char_field) -{ - m_bounded_sequence_char_field = _bounded_sequence_char_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field - */ -void ContentFilterTestType::bounded_sequence_char_field( - std::vector&& _bounded_sequence_char_field) -{ - m_bounded_sequence_char_field = std::move(_bounded_sequence_char_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_char_field - * @return Constant reference to member bounded_sequence_char_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_char_field() const -{ - return m_bounded_sequence_char_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_char_field - * @return Reference to member bounded_sequence_char_field - */ -std::vector& ContentFilterTestType::bounded_sequence_char_field() -{ - return m_bounded_sequence_char_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field - */ -void ContentFilterTestType::bounded_sequence_uint8_field( - const std::vector& _bounded_sequence_uint8_field) -{ - m_bounded_sequence_uint8_field = _bounded_sequence_uint8_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field - */ -void ContentFilterTestType::bounded_sequence_uint8_field( - std::vector&& _bounded_sequence_uint8_field) -{ - m_bounded_sequence_uint8_field = std::move(_bounded_sequence_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint8_field - * @return Constant reference to member bounded_sequence_uint8_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint8_field() const -{ - return m_bounded_sequence_uint8_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint8_field - * @return Reference to member bounded_sequence_uint8_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint8_field() -{ - return m_bounded_sequence_uint8_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field - */ -void ContentFilterTestType::bounded_sequence_int16_field( - const std::vector& _bounded_sequence_int16_field) -{ - m_bounded_sequence_int16_field = _bounded_sequence_int16_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field - */ -void ContentFilterTestType::bounded_sequence_int16_field( - std::vector&& _bounded_sequence_int16_field) -{ - m_bounded_sequence_int16_field = std::move(_bounded_sequence_int16_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int16_field - * @return Constant reference to member bounded_sequence_int16_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int16_field() const -{ - return m_bounded_sequence_int16_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int16_field - * @return Reference to member bounded_sequence_int16_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int16_field() -{ - return m_bounded_sequence_int16_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field - */ -void ContentFilterTestType::bounded_sequence_uint16_field( - const std::vector& _bounded_sequence_uint16_field) -{ - m_bounded_sequence_uint16_field = _bounded_sequence_uint16_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field - */ -void ContentFilterTestType::bounded_sequence_uint16_field( - std::vector&& _bounded_sequence_uint16_field) -{ - m_bounded_sequence_uint16_field = std::move(_bounded_sequence_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint16_field - * @return Constant reference to member bounded_sequence_uint16_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint16_field() const -{ - return m_bounded_sequence_uint16_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint16_field - * @return Reference to member bounded_sequence_uint16_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint16_field() -{ - return m_bounded_sequence_uint16_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field - */ -void ContentFilterTestType::bounded_sequence_int32_field( - const std::vector& _bounded_sequence_int32_field) -{ - m_bounded_sequence_int32_field = _bounded_sequence_int32_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field - */ -void ContentFilterTestType::bounded_sequence_int32_field( - std::vector&& _bounded_sequence_int32_field) -{ - m_bounded_sequence_int32_field = std::move(_bounded_sequence_int32_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int32_field - * @return Constant reference to member bounded_sequence_int32_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int32_field() const -{ - return m_bounded_sequence_int32_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int32_field - * @return Reference to member bounded_sequence_int32_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int32_field() -{ - return m_bounded_sequence_int32_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field - */ -void ContentFilterTestType::bounded_sequence_uint32_field( - const std::vector& _bounded_sequence_uint32_field) -{ - m_bounded_sequence_uint32_field = _bounded_sequence_uint32_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field - */ -void ContentFilterTestType::bounded_sequence_uint32_field( - std::vector&& _bounded_sequence_uint32_field) -{ - m_bounded_sequence_uint32_field = std::move(_bounded_sequence_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint32_field - * @return Constant reference to member bounded_sequence_uint32_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint32_field() const -{ - return m_bounded_sequence_uint32_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint32_field - * @return Reference to member bounded_sequence_uint32_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint32_field() -{ - return m_bounded_sequence_uint32_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field - */ -void ContentFilterTestType::bounded_sequence_int64_field( - const std::vector& _bounded_sequence_int64_field) -{ - m_bounded_sequence_int64_field = _bounded_sequence_int64_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field - */ -void ContentFilterTestType::bounded_sequence_int64_field( - std::vector&& _bounded_sequence_int64_field) -{ - m_bounded_sequence_int64_field = std::move(_bounded_sequence_int64_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int64_field - * @return Constant reference to member bounded_sequence_int64_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int64_field() const -{ - return m_bounded_sequence_int64_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int64_field - * @return Reference to member bounded_sequence_int64_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int64_field() -{ - return m_bounded_sequence_int64_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field - */ -void ContentFilterTestType::bounded_sequence_uint64_field( - const std::vector& _bounded_sequence_uint64_field) -{ - m_bounded_sequence_uint64_field = _bounded_sequence_uint64_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field - */ -void ContentFilterTestType::bounded_sequence_uint64_field( - std::vector&& _bounded_sequence_uint64_field) -{ - m_bounded_sequence_uint64_field = std::move(_bounded_sequence_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint64_field - * @return Constant reference to member bounded_sequence_uint64_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint64_field() const -{ - return m_bounded_sequence_uint64_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint64_field - * @return Reference to member bounded_sequence_uint64_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint64_field() -{ - return m_bounded_sequence_uint64_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field - */ -void ContentFilterTestType::bounded_sequence_float_field( - const std::vector& _bounded_sequence_float_field) -{ - m_bounded_sequence_float_field = _bounded_sequence_float_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field - */ -void ContentFilterTestType::bounded_sequence_float_field( - std::vector&& _bounded_sequence_float_field) -{ - m_bounded_sequence_float_field = std::move(_bounded_sequence_float_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_float_field - * @return Constant reference to member bounded_sequence_float_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_float_field() const -{ - return m_bounded_sequence_float_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_float_field - * @return Reference to member bounded_sequence_float_field - */ -std::vector& ContentFilterTestType::bounded_sequence_float_field() -{ - return m_bounded_sequence_float_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field - */ -void ContentFilterTestType::bounded_sequence_double_field( - const std::vector& _bounded_sequence_double_field) -{ - m_bounded_sequence_double_field = _bounded_sequence_double_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field - */ -void ContentFilterTestType::bounded_sequence_double_field( - std::vector&& _bounded_sequence_double_field) -{ - m_bounded_sequence_double_field = std::move(_bounded_sequence_double_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_double_field - * @return Constant reference to member bounded_sequence_double_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_double_field() const -{ - return m_bounded_sequence_double_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_double_field - * @return Reference to member bounded_sequence_double_field - */ -std::vector& ContentFilterTestType::bounded_sequence_double_field() -{ - return m_bounded_sequence_double_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field - */ -void ContentFilterTestType::bounded_sequence_long_double_field( - const std::vector& _bounded_sequence_long_double_field) -{ - m_bounded_sequence_long_double_field = _bounded_sequence_long_double_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field - */ -void ContentFilterTestType::bounded_sequence_long_double_field( - std::vector&& _bounded_sequence_long_double_field) -{ - m_bounded_sequence_long_double_field = std::move(_bounded_sequence_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_long_double_field - * @return Constant reference to member bounded_sequence_long_double_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_long_double_field() const -{ - return m_bounded_sequence_long_double_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_long_double_field - * @return Reference to member bounded_sequence_long_double_field - */ -std::vector& ContentFilterTestType::bounded_sequence_long_double_field() -{ - return m_bounded_sequence_long_double_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field - */ -void ContentFilterTestType::bounded_sequence_bool_field( - const std::vector& _bounded_sequence_bool_field) -{ - m_bounded_sequence_bool_field = _bounded_sequence_bool_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field - */ -void ContentFilterTestType::bounded_sequence_bool_field( - std::vector&& _bounded_sequence_bool_field) -{ - m_bounded_sequence_bool_field = std::move(_bounded_sequence_bool_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_bool_field - * @return Constant reference to member bounded_sequence_bool_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_bool_field() const -{ - return m_bounded_sequence_bool_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_bool_field - * @return Reference to member bounded_sequence_bool_field - */ -std::vector& ContentFilterTestType::bounded_sequence_bool_field() -{ - return m_bounded_sequence_bool_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field - */ -void ContentFilterTestType::bounded_sequence_string_field( - const std::vector& _bounded_sequence_string_field) -{ - m_bounded_sequence_string_field = _bounded_sequence_string_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field - */ -void ContentFilterTestType::bounded_sequence_string_field( - std::vector&& _bounded_sequence_string_field) -{ - m_bounded_sequence_string_field = std::move(_bounded_sequence_string_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_string_field - * @return Constant reference to member bounded_sequence_string_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_string_field() const -{ - return m_bounded_sequence_string_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_string_field - * @return Reference to member bounded_sequence_string_field - */ -std::vector& ContentFilterTestType::bounded_sequence_string_field() -{ - return m_bounded_sequence_string_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field - */ -void ContentFilterTestType::bounded_sequence_enum_field( - const std::vector& _bounded_sequence_enum_field) -{ - m_bounded_sequence_enum_field = _bounded_sequence_enum_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field - */ -void ContentFilterTestType::bounded_sequence_enum_field( - std::vector&& _bounded_sequence_enum_field) -{ - m_bounded_sequence_enum_field = std::move(_bounded_sequence_enum_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_enum_field - * @return Constant reference to member bounded_sequence_enum_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_enum_field() const -{ - return m_bounded_sequence_enum_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_enum_field - * @return Reference to member bounded_sequence_enum_field - */ -std::vector& ContentFilterTestType::bounded_sequence_enum_field() -{ - return m_bounded_sequence_enum_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field - */ -void ContentFilterTestType::bounded_sequence_enum2_field( - const std::vector& _bounded_sequence_enum2_field) -{ - m_bounded_sequence_enum2_field = _bounded_sequence_enum2_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field - */ -void ContentFilterTestType::bounded_sequence_enum2_field( - std::vector&& _bounded_sequence_enum2_field) -{ - m_bounded_sequence_enum2_field = std::move(_bounded_sequence_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_enum2_field - * @return Constant reference to member bounded_sequence_enum2_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_enum2_field() const -{ - return m_bounded_sequence_enum2_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_enum2_field - * @return Reference to member bounded_sequence_enum2_field - */ -std::vector& ContentFilterTestType::bounded_sequence_enum2_field() -{ - return m_bounded_sequence_enum2_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field - */ -void ContentFilterTestType::bounded_sequence_struct_field( - const std::vector& _bounded_sequence_struct_field) -{ - m_bounded_sequence_struct_field = _bounded_sequence_struct_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field - */ -void ContentFilterTestType::bounded_sequence_struct_field( - std::vector&& _bounded_sequence_struct_field) -{ - m_bounded_sequence_struct_field = std::move(_bounded_sequence_struct_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_struct_field - * @return Constant reference to member bounded_sequence_struct_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_struct_field() const -{ - return m_bounded_sequence_struct_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_struct_field - * @return Reference to member bounded_sequence_struct_field - */ -std::vector& ContentFilterTestType::bounded_sequence_struct_field() -{ - return m_bounded_sequence_struct_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field - */ -void ContentFilterTestType::unbounded_sequence_char_field( - const std::vector& _unbounded_sequence_char_field) -{ - m_unbounded_sequence_char_field = _unbounded_sequence_char_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field - */ -void ContentFilterTestType::unbounded_sequence_char_field( - std::vector&& _unbounded_sequence_char_field) -{ - m_unbounded_sequence_char_field = std::move(_unbounded_sequence_char_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_char_field - * @return Constant reference to member unbounded_sequence_char_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_char_field() const -{ - return m_unbounded_sequence_char_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_char_field - * @return Reference to member unbounded_sequence_char_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_char_field() -{ - return m_unbounded_sequence_char_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field - */ -void ContentFilterTestType::unbounded_sequence_uint8_field( - const std::vector& _unbounded_sequence_uint8_field) -{ - m_unbounded_sequence_uint8_field = _unbounded_sequence_uint8_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field - */ -void ContentFilterTestType::unbounded_sequence_uint8_field( - std::vector&& _unbounded_sequence_uint8_field) -{ - m_unbounded_sequence_uint8_field = std::move(_unbounded_sequence_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint8_field - * @return Constant reference to member unbounded_sequence_uint8_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() const -{ - return m_unbounded_sequence_uint8_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint8_field - * @return Reference to member unbounded_sequence_uint8_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() -{ - return m_unbounded_sequence_uint8_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field - */ -void ContentFilterTestType::unbounded_sequence_int16_field( - const std::vector& _unbounded_sequence_int16_field) -{ - m_unbounded_sequence_int16_field = _unbounded_sequence_int16_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field - */ -void ContentFilterTestType::unbounded_sequence_int16_field( - std::vector&& _unbounded_sequence_int16_field) -{ - m_unbounded_sequence_int16_field = std::move(_unbounded_sequence_int16_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int16_field - * @return Constant reference to member unbounded_sequence_int16_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int16_field() const -{ - return m_unbounded_sequence_int16_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int16_field - * @return Reference to member unbounded_sequence_int16_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int16_field() -{ - return m_unbounded_sequence_int16_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field - */ -void ContentFilterTestType::unbounded_sequence_uint16_field( - const std::vector& _unbounded_sequence_uint16_field) -{ - m_unbounded_sequence_uint16_field = _unbounded_sequence_uint16_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field - */ -void ContentFilterTestType::unbounded_sequence_uint16_field( - std::vector&& _unbounded_sequence_uint16_field) -{ - m_unbounded_sequence_uint16_field = std::move(_unbounded_sequence_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint16_field - * @return Constant reference to member unbounded_sequence_uint16_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() const -{ - return m_unbounded_sequence_uint16_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint16_field - * @return Reference to member unbounded_sequence_uint16_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() -{ - return m_unbounded_sequence_uint16_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field - */ -void ContentFilterTestType::unbounded_sequence_int32_field( - const std::vector& _unbounded_sequence_int32_field) -{ - m_unbounded_sequence_int32_field = _unbounded_sequence_int32_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field - */ -void ContentFilterTestType::unbounded_sequence_int32_field( - std::vector&& _unbounded_sequence_int32_field) -{ - m_unbounded_sequence_int32_field = std::move(_unbounded_sequence_int32_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int32_field - * @return Constant reference to member unbounded_sequence_int32_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int32_field() const -{ - return m_unbounded_sequence_int32_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int32_field - * @return Reference to member unbounded_sequence_int32_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int32_field() -{ - return m_unbounded_sequence_int32_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field - */ -void ContentFilterTestType::unbounded_sequence_uint32_field( - const std::vector& _unbounded_sequence_uint32_field) -{ - m_unbounded_sequence_uint32_field = _unbounded_sequence_uint32_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field - */ -void ContentFilterTestType::unbounded_sequence_uint32_field( - std::vector&& _unbounded_sequence_uint32_field) -{ - m_unbounded_sequence_uint32_field = std::move(_unbounded_sequence_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint32_field - * @return Constant reference to member unbounded_sequence_uint32_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() const -{ - return m_unbounded_sequence_uint32_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint32_field - * @return Reference to member unbounded_sequence_uint32_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() -{ - return m_unbounded_sequence_uint32_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field - */ -void ContentFilterTestType::unbounded_sequence_int64_field( - const std::vector& _unbounded_sequence_int64_field) -{ - m_unbounded_sequence_int64_field = _unbounded_sequence_int64_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field - */ -void ContentFilterTestType::unbounded_sequence_int64_field( - std::vector&& _unbounded_sequence_int64_field) -{ - m_unbounded_sequence_int64_field = std::move(_unbounded_sequence_int64_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int64_field - * @return Constant reference to member unbounded_sequence_int64_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int64_field() const -{ - return m_unbounded_sequence_int64_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int64_field - * @return Reference to member unbounded_sequence_int64_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int64_field() -{ - return m_unbounded_sequence_int64_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field - */ -void ContentFilterTestType::unbounded_sequence_uint64_field( - const std::vector& _unbounded_sequence_uint64_field) -{ - m_unbounded_sequence_uint64_field = _unbounded_sequence_uint64_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field - */ -void ContentFilterTestType::unbounded_sequence_uint64_field( - std::vector&& _unbounded_sequence_uint64_field) -{ - m_unbounded_sequence_uint64_field = std::move(_unbounded_sequence_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint64_field - * @return Constant reference to member unbounded_sequence_uint64_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() const -{ - return m_unbounded_sequence_uint64_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint64_field - * @return Reference to member unbounded_sequence_uint64_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() -{ - return m_unbounded_sequence_uint64_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field - */ -void ContentFilterTestType::unbounded_sequence_float_field( - const std::vector& _unbounded_sequence_float_field) -{ - m_unbounded_sequence_float_field = _unbounded_sequence_float_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field - */ -void ContentFilterTestType::unbounded_sequence_float_field( - std::vector&& _unbounded_sequence_float_field) -{ - m_unbounded_sequence_float_field = std::move(_unbounded_sequence_float_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_float_field - * @return Constant reference to member unbounded_sequence_float_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_float_field() const -{ - return m_unbounded_sequence_float_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_float_field - * @return Reference to member unbounded_sequence_float_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_float_field() -{ - return m_unbounded_sequence_float_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field - */ -void ContentFilterTestType::unbounded_sequence_double_field( - const std::vector& _unbounded_sequence_double_field) -{ - m_unbounded_sequence_double_field = _unbounded_sequence_double_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field - */ -void ContentFilterTestType::unbounded_sequence_double_field( - std::vector&& _unbounded_sequence_double_field) -{ - m_unbounded_sequence_double_field = std::move(_unbounded_sequence_double_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_double_field - * @return Constant reference to member unbounded_sequence_double_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_double_field() const -{ - return m_unbounded_sequence_double_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_double_field - * @return Reference to member unbounded_sequence_double_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_double_field() -{ - return m_unbounded_sequence_double_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field - */ -void ContentFilterTestType::unbounded_sequence_long_double_field( - const std::vector& _unbounded_sequence_long_double_field) -{ - m_unbounded_sequence_long_double_field = _unbounded_sequence_long_double_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field - */ -void ContentFilterTestType::unbounded_sequence_long_double_field( - std::vector&& _unbounded_sequence_long_double_field) -{ - m_unbounded_sequence_long_double_field = std::move(_unbounded_sequence_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_long_double_field - * @return Constant reference to member unbounded_sequence_long_double_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() const -{ - return m_unbounded_sequence_long_double_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_long_double_field - * @return Reference to member unbounded_sequence_long_double_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() -{ - return m_unbounded_sequence_long_double_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field - */ -void ContentFilterTestType::unbounded_sequence_bool_field( - const std::vector& _unbounded_sequence_bool_field) -{ - m_unbounded_sequence_bool_field = _unbounded_sequence_bool_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field - */ -void ContentFilterTestType::unbounded_sequence_bool_field( - std::vector&& _unbounded_sequence_bool_field) -{ - m_unbounded_sequence_bool_field = std::move(_unbounded_sequence_bool_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_bool_field - * @return Constant reference to member unbounded_sequence_bool_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_bool_field() const -{ - return m_unbounded_sequence_bool_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_bool_field - * @return Reference to member unbounded_sequence_bool_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_bool_field() -{ - return m_unbounded_sequence_bool_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field - */ -void ContentFilterTestType::unbounded_sequence_string_field( - const std::vector& _unbounded_sequence_string_field) -{ - m_unbounded_sequence_string_field = _unbounded_sequence_string_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field - */ -void ContentFilterTestType::unbounded_sequence_string_field( - std::vector&& _unbounded_sequence_string_field) -{ - m_unbounded_sequence_string_field = std::move(_unbounded_sequence_string_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_string_field - * @return Constant reference to member unbounded_sequence_string_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_string_field() const -{ - return m_unbounded_sequence_string_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_string_field - * @return Reference to member unbounded_sequence_string_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_string_field() -{ - return m_unbounded_sequence_string_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field - */ -void ContentFilterTestType::unbounded_sequence_enum_field( - const std::vector& _unbounded_sequence_enum_field) -{ - m_unbounded_sequence_enum_field = _unbounded_sequence_enum_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field - */ -void ContentFilterTestType::unbounded_sequence_enum_field( - std::vector&& _unbounded_sequence_enum_field) -{ - m_unbounded_sequence_enum_field = std::move(_unbounded_sequence_enum_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_enum_field - * @return Constant reference to member unbounded_sequence_enum_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_enum_field() const -{ - return m_unbounded_sequence_enum_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_enum_field - * @return Reference to member unbounded_sequence_enum_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_enum_field() -{ - return m_unbounded_sequence_enum_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field - */ -void ContentFilterTestType::unbounded_sequence_enum2_field( - const std::vector& _unbounded_sequence_enum2_field) -{ - m_unbounded_sequence_enum2_field = _unbounded_sequence_enum2_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field - */ -void ContentFilterTestType::unbounded_sequence_enum2_field( - std::vector&& _unbounded_sequence_enum2_field) -{ - m_unbounded_sequence_enum2_field = std::move(_unbounded_sequence_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_enum2_field - * @return Constant reference to member unbounded_sequence_enum2_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() const -{ - return m_unbounded_sequence_enum2_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_enum2_field - * @return Reference to member unbounded_sequence_enum2_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() -{ - return m_unbounded_sequence_enum2_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field - */ -void ContentFilterTestType::unbounded_sequence_struct_field( - const std::vector& _unbounded_sequence_struct_field) -{ - m_unbounded_sequence_struct_field = _unbounded_sequence_struct_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field - */ -void ContentFilterTestType::unbounded_sequence_struct_field( - std::vector&& _unbounded_sequence_struct_field) -{ - m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_struct_field - * @return Constant reference to member unbounded_sequence_struct_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_struct_field() const -{ - return m_unbounded_sequence_struct_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_struct_field - * @return Reference to member unbounded_sequence_struct_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_struct_field() -{ - return m_unbounded_sequence_struct_field; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "ContentFilterTestTypeCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h deleted file mode 100644 index 898fe5080b4..00000000000 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h +++ /dev/null @@ -1,2255 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ContentFilterTestType.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "ContentFilterTestTypev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ -#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CONTENTFILTERTESTTYPE_SOURCE) -#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllexport ) -#else -#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllimport ) -#endif // CONTENTFILTERTESTTYPE_SOURCE -#else -#define CONTENTFILTERTESTTYPE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CONTENTFILTERTESTTYPE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration Color defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -enum Color : uint32_t -{ - RED, - GREEN, - BLUE, - YELLOW, - MAGENTA -}; -/*! - * @brief This class represents the enumeration Material defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -enum Material : uint32_t -{ - WOOD, - PLASTIC, - METAL, - CONCRETE, - STONE -}; - - -/*! - * @brief This class represents the structure StructType defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -class StructType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType( - const StructType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType( - StructType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType& operator =( - const StructType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType& operator =( - StructType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructType& x) const; - - /*! - * @brief Comparison operator. - * @param x StructType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructType& x) const; - - /*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ - eProsima_user_DllExport void char_field( - char _char_field); - - /*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ - eProsima_user_DllExport char char_field() const; - - /*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ - eProsima_user_DllExport char& char_field(); - - - /*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ - eProsima_user_DllExport void uint8_field( - uint8_t _uint8_field); - - /*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ - eProsima_user_DllExport uint8_t uint8_field() const; - - /*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ - eProsima_user_DllExport uint8_t& uint8_field(); - - - /*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ - eProsima_user_DllExport void int16_field( - int16_t _int16_field); - - /*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ - eProsima_user_DllExport int16_t int16_field() const; - - /*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ - eProsima_user_DllExport int16_t& int16_field(); - - - /*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ - eProsima_user_DllExport void uint16_field( - uint16_t _uint16_field); - - /*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ - eProsima_user_DllExport uint16_t uint16_field() const; - - /*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ - eProsima_user_DllExport uint16_t& uint16_field(); - - - /*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ - eProsima_user_DllExport void int32_field( - int32_t _int32_field); - - /*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ - eProsima_user_DllExport int32_t int32_field() const; - - /*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ - eProsima_user_DllExport int32_t& int32_field(); - - - /*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ - eProsima_user_DllExport void uint32_field( - uint32_t _uint32_field); - - /*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ - eProsima_user_DllExport uint32_t uint32_field() const; - - /*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ - eProsima_user_DllExport uint32_t& uint32_field(); - - - /*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ - eProsima_user_DllExport void int64_field( - int64_t _int64_field); - - /*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ - eProsima_user_DllExport int64_t int64_field() const; - - /*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ - eProsima_user_DllExport int64_t& int64_field(); - - - /*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ - eProsima_user_DllExport void uint64_field( - uint64_t _uint64_field); - - /*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ - eProsima_user_DllExport uint64_t uint64_field() const; - - /*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ - eProsima_user_DllExport uint64_t& uint64_field(); - - - /*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ - eProsima_user_DllExport void float_field( - float _float_field); - - /*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ - eProsima_user_DllExport float float_field() const; - - /*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ - eProsima_user_DllExport float& float_field(); - - - /*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ - eProsima_user_DllExport void double_field( - double _double_field); - - /*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ - eProsima_user_DllExport double double_field() const; - - /*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ - eProsima_user_DllExport double& double_field(); - - - /*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ - eProsima_user_DllExport void long_double_field( - long double _long_double_field); - - /*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ - eProsima_user_DllExport long double long_double_field() const; - - /*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ - eProsima_user_DllExport long double& long_double_field(); - - - /*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ - eProsima_user_DllExport void bool_field( - bool _bool_field); - - /*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ - eProsima_user_DllExport bool bool_field() const; - - /*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ - eProsima_user_DllExport bool& bool_field(); - - - /*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ - eProsima_user_DllExport void string_field( - const std::string& _string_field); - - /*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ - eProsima_user_DllExport void string_field( - std::string&& _string_field); - - /*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ - eProsima_user_DllExport const std::string& string_field() const; - - /*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ - eProsima_user_DllExport std::string& string_field(); - - - /*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ - eProsima_user_DllExport void enum_field( - Color _enum_field); - - /*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ - eProsima_user_DllExport Color enum_field() const; - - /*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ - eProsima_user_DllExport Color& enum_field(); - - - /*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ - eProsima_user_DllExport void enum2_field( - Material _enum2_field); - - /*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ - eProsima_user_DllExport Material enum2_field() const; - - /*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ - eProsima_user_DllExport Material& enum2_field(); - -private: - - char m_char_field{0}; - uint8_t m_uint8_field{0}; - int16_t m_int16_field{0}; - uint16_t m_uint16_field{0}; - int32_t m_int32_field{0}; - uint32_t m_uint32_field{0}; - int64_t m_int64_field{0}; - uint64_t m_uint64_field{0}; - float m_float_field{0.0}; - double m_double_field{0.0}; - long double m_long_double_field{0.0}; - bool m_bool_field{false}; - std::string m_string_field; - Color m_enum_field{::RED}; - Material m_enum2_field{::WOOD}; - -}; -const uint32_t max_array_size = 3; -const uint32_t max_seq_size = 5; - - - - -/*! - * @brief This class represents the structure ContentFilterTestType defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -class ContentFilterTestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ContentFilterTestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ContentFilterTestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType( - const ContentFilterTestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType( - ContentFilterTestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType& operator =( - const ContentFilterTestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType& operator =( - ContentFilterTestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ContentFilterTestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ContentFilterTestType& x) const; - - /*! - * @brief Comparison operator. - * @param x ContentFilterTestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ContentFilterTestType& x) const; - - /*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ - eProsima_user_DllExport void char_field( - char _char_field); - - /*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ - eProsima_user_DllExport char char_field() const; - - /*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ - eProsima_user_DllExport char& char_field(); - - - /*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ - eProsima_user_DllExport void uint8_field( - uint8_t _uint8_field); - - /*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ - eProsima_user_DllExport uint8_t uint8_field() const; - - /*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ - eProsima_user_DllExport uint8_t& uint8_field(); - - - /*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ - eProsima_user_DllExport void int16_field( - int16_t _int16_field); - - /*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ - eProsima_user_DllExport int16_t int16_field() const; - - /*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ - eProsima_user_DllExport int16_t& int16_field(); - - - /*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ - eProsima_user_DllExport void uint16_field( - uint16_t _uint16_field); - - /*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ - eProsima_user_DllExport uint16_t uint16_field() const; - - /*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ - eProsima_user_DllExport uint16_t& uint16_field(); - - - /*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ - eProsima_user_DllExport void int32_field( - int32_t _int32_field); - - /*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ - eProsima_user_DllExport int32_t int32_field() const; - - /*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ - eProsima_user_DllExport int32_t& int32_field(); - - - /*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ - eProsima_user_DllExport void uint32_field( - uint32_t _uint32_field); - - /*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ - eProsima_user_DllExport uint32_t uint32_field() const; - - /*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ - eProsima_user_DllExport uint32_t& uint32_field(); - - - /*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ - eProsima_user_DllExport void int64_field( - int64_t _int64_field); - - /*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ - eProsima_user_DllExport int64_t int64_field() const; - - /*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ - eProsima_user_DllExport int64_t& int64_field(); - - - /*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ - eProsima_user_DllExport void uint64_field( - uint64_t _uint64_field); - - /*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ - eProsima_user_DllExport uint64_t uint64_field() const; - - /*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ - eProsima_user_DllExport uint64_t& uint64_field(); - - - /*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ - eProsima_user_DllExport void float_field( - float _float_field); - - /*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ - eProsima_user_DllExport float float_field() const; - - /*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ - eProsima_user_DllExport float& float_field(); - - - /*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ - eProsima_user_DllExport void double_field( - double _double_field); - - /*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ - eProsima_user_DllExport double double_field() const; - - /*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ - eProsima_user_DllExport double& double_field(); - - - /*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ - eProsima_user_DllExport void long_double_field( - long double _long_double_field); - - /*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ - eProsima_user_DllExport long double long_double_field() const; - - /*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ - eProsima_user_DllExport long double& long_double_field(); - - - /*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ - eProsima_user_DllExport void bool_field( - bool _bool_field); - - /*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ - eProsima_user_DllExport bool bool_field() const; - - /*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ - eProsima_user_DllExport bool& bool_field(); - - - /*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ - eProsima_user_DllExport void string_field( - const std::string& _string_field); - - /*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ - eProsima_user_DllExport void string_field( - std::string&& _string_field); - - /*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ - eProsima_user_DllExport const std::string& string_field() const; - - /*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ - eProsima_user_DllExport std::string& string_field(); - - - /*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ - eProsima_user_DllExport void enum_field( - Color _enum_field); - - /*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ - eProsima_user_DllExport Color enum_field() const; - - /*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ - eProsima_user_DllExport Color& enum_field(); - - - /*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ - eProsima_user_DllExport void enum2_field( - Material _enum2_field); - - /*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ - eProsima_user_DllExport Material enum2_field() const; - - /*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ - eProsima_user_DllExport Material& enum2_field(); - - - /*! - * @brief This function copies the value in member struct_field - * @param _struct_field New value to be copied in member struct_field - */ - eProsima_user_DllExport void struct_field( - const StructType& _struct_field); - - /*! - * @brief This function moves the value in member struct_field - * @param _struct_field New value to be moved in member struct_field - */ - eProsima_user_DllExport void struct_field( - StructType&& _struct_field); - - /*! - * @brief This function returns a constant reference to member struct_field - * @return Constant reference to member struct_field - */ - eProsima_user_DllExport const StructType& struct_field() const; - - /*! - * @brief This function returns a reference to member struct_field - * @return Reference to member struct_field - */ - eProsima_user_DllExport StructType& struct_field(); - - - /*! - * @brief This function copies the value in member array_char_field - * @param _array_char_field New value to be copied in member array_char_field - */ - eProsima_user_DllExport void array_char_field( - const std::array& _array_char_field); - - /*! - * @brief This function moves the value in member array_char_field - * @param _array_char_field New value to be moved in member array_char_field - */ - eProsima_user_DllExport void array_char_field( - std::array&& _array_char_field); - - /*! - * @brief This function returns a constant reference to member array_char_field - * @return Constant reference to member array_char_field - */ - eProsima_user_DllExport const std::array& array_char_field() const; - - /*! - * @brief This function returns a reference to member array_char_field - * @return Reference to member array_char_field - */ - eProsima_user_DllExport std::array& array_char_field(); - - - /*! - * @brief This function copies the value in member array_uint8_field - * @param _array_uint8_field New value to be copied in member array_uint8_field - */ - eProsima_user_DllExport void array_uint8_field( - const std::array& _array_uint8_field); - - /*! - * @brief This function moves the value in member array_uint8_field - * @param _array_uint8_field New value to be moved in member array_uint8_field - */ - eProsima_user_DllExport void array_uint8_field( - std::array&& _array_uint8_field); - - /*! - * @brief This function returns a constant reference to member array_uint8_field - * @return Constant reference to member array_uint8_field - */ - eProsima_user_DllExport const std::array& array_uint8_field() const; - - /*! - * @brief This function returns a reference to member array_uint8_field - * @return Reference to member array_uint8_field - */ - eProsima_user_DllExport std::array& array_uint8_field(); - - - /*! - * @brief This function copies the value in member array_int16_field - * @param _array_int16_field New value to be copied in member array_int16_field - */ - eProsima_user_DllExport void array_int16_field( - const std::array& _array_int16_field); - - /*! - * @brief This function moves the value in member array_int16_field - * @param _array_int16_field New value to be moved in member array_int16_field - */ - eProsima_user_DllExport void array_int16_field( - std::array&& _array_int16_field); - - /*! - * @brief This function returns a constant reference to member array_int16_field - * @return Constant reference to member array_int16_field - */ - eProsima_user_DllExport const std::array& array_int16_field() const; - - /*! - * @brief This function returns a reference to member array_int16_field - * @return Reference to member array_int16_field - */ - eProsima_user_DllExport std::array& array_int16_field(); - - - /*! - * @brief This function copies the value in member array_uint16_field - * @param _array_uint16_field New value to be copied in member array_uint16_field - */ - eProsima_user_DllExport void array_uint16_field( - const std::array& _array_uint16_field); - - /*! - * @brief This function moves the value in member array_uint16_field - * @param _array_uint16_field New value to be moved in member array_uint16_field - */ - eProsima_user_DllExport void array_uint16_field( - std::array&& _array_uint16_field); - - /*! - * @brief This function returns a constant reference to member array_uint16_field - * @return Constant reference to member array_uint16_field - */ - eProsima_user_DllExport const std::array& array_uint16_field() const; - - /*! - * @brief This function returns a reference to member array_uint16_field - * @return Reference to member array_uint16_field - */ - eProsima_user_DllExport std::array& array_uint16_field(); - - - /*! - * @brief This function copies the value in member array_int32_field - * @param _array_int32_field New value to be copied in member array_int32_field - */ - eProsima_user_DllExport void array_int32_field( - const std::array& _array_int32_field); - - /*! - * @brief This function moves the value in member array_int32_field - * @param _array_int32_field New value to be moved in member array_int32_field - */ - eProsima_user_DllExport void array_int32_field( - std::array&& _array_int32_field); - - /*! - * @brief This function returns a constant reference to member array_int32_field - * @return Constant reference to member array_int32_field - */ - eProsima_user_DllExport const std::array& array_int32_field() const; - - /*! - * @brief This function returns a reference to member array_int32_field - * @return Reference to member array_int32_field - */ - eProsima_user_DllExport std::array& array_int32_field(); - - - /*! - * @brief This function copies the value in member array_uint32_field - * @param _array_uint32_field New value to be copied in member array_uint32_field - */ - eProsima_user_DllExport void array_uint32_field( - const std::array& _array_uint32_field); - - /*! - * @brief This function moves the value in member array_uint32_field - * @param _array_uint32_field New value to be moved in member array_uint32_field - */ - eProsima_user_DllExport void array_uint32_field( - std::array&& _array_uint32_field); - - /*! - * @brief This function returns a constant reference to member array_uint32_field - * @return Constant reference to member array_uint32_field - */ - eProsima_user_DllExport const std::array& array_uint32_field() const; - - /*! - * @brief This function returns a reference to member array_uint32_field - * @return Reference to member array_uint32_field - */ - eProsima_user_DllExport std::array& array_uint32_field(); - - - /*! - * @brief This function copies the value in member array_int64_field - * @param _array_int64_field New value to be copied in member array_int64_field - */ - eProsima_user_DllExport void array_int64_field( - const std::array& _array_int64_field); - - /*! - * @brief This function moves the value in member array_int64_field - * @param _array_int64_field New value to be moved in member array_int64_field - */ - eProsima_user_DllExport void array_int64_field( - std::array&& _array_int64_field); - - /*! - * @brief This function returns a constant reference to member array_int64_field - * @return Constant reference to member array_int64_field - */ - eProsima_user_DllExport const std::array& array_int64_field() const; - - /*! - * @brief This function returns a reference to member array_int64_field - * @return Reference to member array_int64_field - */ - eProsima_user_DllExport std::array& array_int64_field(); - - - /*! - * @brief This function copies the value in member array_uint64_field - * @param _array_uint64_field New value to be copied in member array_uint64_field - */ - eProsima_user_DllExport void array_uint64_field( - const std::array& _array_uint64_field); - - /*! - * @brief This function moves the value in member array_uint64_field - * @param _array_uint64_field New value to be moved in member array_uint64_field - */ - eProsima_user_DllExport void array_uint64_field( - std::array&& _array_uint64_field); - - /*! - * @brief This function returns a constant reference to member array_uint64_field - * @return Constant reference to member array_uint64_field - */ - eProsima_user_DllExport const std::array& array_uint64_field() const; - - /*! - * @brief This function returns a reference to member array_uint64_field - * @return Reference to member array_uint64_field - */ - eProsima_user_DllExport std::array& array_uint64_field(); - - - /*! - * @brief This function copies the value in member array_float_field - * @param _array_float_field New value to be copied in member array_float_field - */ - eProsima_user_DllExport void array_float_field( - const std::array& _array_float_field); - - /*! - * @brief This function moves the value in member array_float_field - * @param _array_float_field New value to be moved in member array_float_field - */ - eProsima_user_DllExport void array_float_field( - std::array&& _array_float_field); - - /*! - * @brief This function returns a constant reference to member array_float_field - * @return Constant reference to member array_float_field - */ - eProsima_user_DllExport const std::array& array_float_field() const; - - /*! - * @brief This function returns a reference to member array_float_field - * @return Reference to member array_float_field - */ - eProsima_user_DllExport std::array& array_float_field(); - - - /*! - * @brief This function copies the value in member array_double_field - * @param _array_double_field New value to be copied in member array_double_field - */ - eProsima_user_DllExport void array_double_field( - const std::array& _array_double_field); - - /*! - * @brief This function moves the value in member array_double_field - * @param _array_double_field New value to be moved in member array_double_field - */ - eProsima_user_DllExport void array_double_field( - std::array&& _array_double_field); - - /*! - * @brief This function returns a constant reference to member array_double_field - * @return Constant reference to member array_double_field - */ - eProsima_user_DllExport const std::array& array_double_field() const; - - /*! - * @brief This function returns a reference to member array_double_field - * @return Reference to member array_double_field - */ - eProsima_user_DllExport std::array& array_double_field(); - - - /*! - * @brief This function copies the value in member array_long_double_field - * @param _array_long_double_field New value to be copied in member array_long_double_field - */ - eProsima_user_DllExport void array_long_double_field( - const std::array& _array_long_double_field); - - /*! - * @brief This function moves the value in member array_long_double_field - * @param _array_long_double_field New value to be moved in member array_long_double_field - */ - eProsima_user_DllExport void array_long_double_field( - std::array&& _array_long_double_field); - - /*! - * @brief This function returns a constant reference to member array_long_double_field - * @return Constant reference to member array_long_double_field - */ - eProsima_user_DllExport const std::array& array_long_double_field() const; - - /*! - * @brief This function returns a reference to member array_long_double_field - * @return Reference to member array_long_double_field - */ - eProsima_user_DllExport std::array& array_long_double_field(); - - - /*! - * @brief This function copies the value in member array_bool_field - * @param _array_bool_field New value to be copied in member array_bool_field - */ - eProsima_user_DllExport void array_bool_field( - const std::array& _array_bool_field); - - /*! - * @brief This function moves the value in member array_bool_field - * @param _array_bool_field New value to be moved in member array_bool_field - */ - eProsima_user_DllExport void array_bool_field( - std::array&& _array_bool_field); - - /*! - * @brief This function returns a constant reference to member array_bool_field - * @return Constant reference to member array_bool_field - */ - eProsima_user_DllExport const std::array& array_bool_field() const; - - /*! - * @brief This function returns a reference to member array_bool_field - * @return Reference to member array_bool_field - */ - eProsima_user_DllExport std::array& array_bool_field(); - - - /*! - * @brief This function copies the value in member array_string_field - * @param _array_string_field New value to be copied in member array_string_field - */ - eProsima_user_DllExport void array_string_field( - const std::array& _array_string_field); - - /*! - * @brief This function moves the value in member array_string_field - * @param _array_string_field New value to be moved in member array_string_field - */ - eProsima_user_DllExport void array_string_field( - std::array&& _array_string_field); - - /*! - * @brief This function returns a constant reference to member array_string_field - * @return Constant reference to member array_string_field - */ - eProsima_user_DllExport const std::array& array_string_field() const; - - /*! - * @brief This function returns a reference to member array_string_field - * @return Reference to member array_string_field - */ - eProsima_user_DllExport std::array& array_string_field(); - - - /*! - * @brief This function copies the value in member array_enum_field - * @param _array_enum_field New value to be copied in member array_enum_field - */ - eProsima_user_DllExport void array_enum_field( - const std::array& _array_enum_field); - - /*! - * @brief This function moves the value in member array_enum_field - * @param _array_enum_field New value to be moved in member array_enum_field - */ - eProsima_user_DllExport void array_enum_field( - std::array&& _array_enum_field); - - /*! - * @brief This function returns a constant reference to member array_enum_field - * @return Constant reference to member array_enum_field - */ - eProsima_user_DllExport const std::array& array_enum_field() const; - - /*! - * @brief This function returns a reference to member array_enum_field - * @return Reference to member array_enum_field - */ - eProsima_user_DllExport std::array& array_enum_field(); - - - /*! - * @brief This function copies the value in member array_enum2_field - * @param _array_enum2_field New value to be copied in member array_enum2_field - */ - eProsima_user_DllExport void array_enum2_field( - const std::array& _array_enum2_field); - - /*! - * @brief This function moves the value in member array_enum2_field - * @param _array_enum2_field New value to be moved in member array_enum2_field - */ - eProsima_user_DllExport void array_enum2_field( - std::array&& _array_enum2_field); - - /*! - * @brief This function returns a constant reference to member array_enum2_field - * @return Constant reference to member array_enum2_field - */ - eProsima_user_DllExport const std::array& array_enum2_field() const; - - /*! - * @brief This function returns a reference to member array_enum2_field - * @return Reference to member array_enum2_field - */ - eProsima_user_DllExport std::array& array_enum2_field(); - - - /*! - * @brief This function copies the value in member array_struct_field - * @param _array_struct_field New value to be copied in member array_struct_field - */ - eProsima_user_DllExport void array_struct_field( - const std::array& _array_struct_field); - - /*! - * @brief This function moves the value in member array_struct_field - * @param _array_struct_field New value to be moved in member array_struct_field - */ - eProsima_user_DllExport void array_struct_field( - std::array&& _array_struct_field); - - /*! - * @brief This function returns a constant reference to member array_struct_field - * @return Constant reference to member array_struct_field - */ - eProsima_user_DllExport const std::array& array_struct_field() const; - - /*! - * @brief This function returns a reference to member array_struct_field - * @return Reference to member array_struct_field - */ - eProsima_user_DllExport std::array& array_struct_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field - */ - eProsima_user_DllExport void bounded_sequence_char_field( - const std::vector& _bounded_sequence_char_field); - - /*! - * @brief This function moves the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field - */ - eProsima_user_DllExport void bounded_sequence_char_field( - std::vector&& _bounded_sequence_char_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_char_field - * @return Constant reference to member bounded_sequence_char_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_char_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_char_field - * @return Reference to member bounded_sequence_char_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_char_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field - */ - eProsima_user_DllExport void bounded_sequence_uint8_field( - const std::vector& _bounded_sequence_uint8_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field - */ - eProsima_user_DllExport void bounded_sequence_uint8_field( - std::vector&& _bounded_sequence_uint8_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint8_field - * @return Constant reference to member bounded_sequence_uint8_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint8_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint8_field - * @return Reference to member bounded_sequence_uint8_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint8_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field - */ - eProsima_user_DllExport void bounded_sequence_int16_field( - const std::vector& _bounded_sequence_int16_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field - */ - eProsima_user_DllExport void bounded_sequence_int16_field( - std::vector&& _bounded_sequence_int16_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int16_field - * @return Constant reference to member bounded_sequence_int16_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int16_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int16_field - * @return Reference to member bounded_sequence_int16_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int16_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field - */ - eProsima_user_DllExport void bounded_sequence_uint16_field( - const std::vector& _bounded_sequence_uint16_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field - */ - eProsima_user_DllExport void bounded_sequence_uint16_field( - std::vector&& _bounded_sequence_uint16_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint16_field - * @return Constant reference to member bounded_sequence_uint16_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint16_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint16_field - * @return Reference to member bounded_sequence_uint16_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint16_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field - */ - eProsima_user_DllExport void bounded_sequence_int32_field( - const std::vector& _bounded_sequence_int32_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field - */ - eProsima_user_DllExport void bounded_sequence_int32_field( - std::vector&& _bounded_sequence_int32_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int32_field - * @return Constant reference to member bounded_sequence_int32_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int32_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int32_field - * @return Reference to member bounded_sequence_int32_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int32_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field - */ - eProsima_user_DllExport void bounded_sequence_uint32_field( - const std::vector& _bounded_sequence_uint32_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field - */ - eProsima_user_DllExport void bounded_sequence_uint32_field( - std::vector&& _bounded_sequence_uint32_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint32_field - * @return Constant reference to member bounded_sequence_uint32_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint32_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint32_field - * @return Reference to member bounded_sequence_uint32_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint32_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field - */ - eProsima_user_DllExport void bounded_sequence_int64_field( - const std::vector& _bounded_sequence_int64_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field - */ - eProsima_user_DllExport void bounded_sequence_int64_field( - std::vector&& _bounded_sequence_int64_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int64_field - * @return Constant reference to member bounded_sequence_int64_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int64_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int64_field - * @return Reference to member bounded_sequence_int64_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int64_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field - */ - eProsima_user_DllExport void bounded_sequence_uint64_field( - const std::vector& _bounded_sequence_uint64_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field - */ - eProsima_user_DllExport void bounded_sequence_uint64_field( - std::vector&& _bounded_sequence_uint64_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint64_field - * @return Constant reference to member bounded_sequence_uint64_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint64_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint64_field - * @return Reference to member bounded_sequence_uint64_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint64_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field - */ - eProsima_user_DllExport void bounded_sequence_float_field( - const std::vector& _bounded_sequence_float_field); - - /*! - * @brief This function moves the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field - */ - eProsima_user_DllExport void bounded_sequence_float_field( - std::vector&& _bounded_sequence_float_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_float_field - * @return Constant reference to member bounded_sequence_float_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_float_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_float_field - * @return Reference to member bounded_sequence_float_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_float_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field - */ - eProsima_user_DllExport void bounded_sequence_double_field( - const std::vector& _bounded_sequence_double_field); - - /*! - * @brief This function moves the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field - */ - eProsima_user_DllExport void bounded_sequence_double_field( - std::vector&& _bounded_sequence_double_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_double_field - * @return Constant reference to member bounded_sequence_double_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_double_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_double_field - * @return Reference to member bounded_sequence_double_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_double_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field - */ - eProsima_user_DllExport void bounded_sequence_long_double_field( - const std::vector& _bounded_sequence_long_double_field); - - /*! - * @brief This function moves the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field - */ - eProsima_user_DllExport void bounded_sequence_long_double_field( - std::vector&& _bounded_sequence_long_double_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_long_double_field - * @return Constant reference to member bounded_sequence_long_double_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_long_double_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_long_double_field - * @return Reference to member bounded_sequence_long_double_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_long_double_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field - */ - eProsima_user_DllExport void bounded_sequence_bool_field( - const std::vector& _bounded_sequence_bool_field); - - /*! - * @brief This function moves the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field - */ - eProsima_user_DllExport void bounded_sequence_bool_field( - std::vector&& _bounded_sequence_bool_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_bool_field - * @return Constant reference to member bounded_sequence_bool_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_bool_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_bool_field - * @return Reference to member bounded_sequence_bool_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_bool_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field - */ - eProsima_user_DllExport void bounded_sequence_string_field( - const std::vector& _bounded_sequence_string_field); - - /*! - * @brief This function moves the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field - */ - eProsima_user_DllExport void bounded_sequence_string_field( - std::vector&& _bounded_sequence_string_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_string_field - * @return Constant reference to member bounded_sequence_string_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_string_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_string_field - * @return Reference to member bounded_sequence_string_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_string_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field - */ - eProsima_user_DllExport void bounded_sequence_enum_field( - const std::vector& _bounded_sequence_enum_field); - - /*! - * @brief This function moves the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field - */ - eProsima_user_DllExport void bounded_sequence_enum_field( - std::vector&& _bounded_sequence_enum_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_enum_field - * @return Constant reference to member bounded_sequence_enum_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_enum_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_enum_field - * @return Reference to member bounded_sequence_enum_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_enum_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field - */ - eProsima_user_DllExport void bounded_sequence_enum2_field( - const std::vector& _bounded_sequence_enum2_field); - - /*! - * @brief This function moves the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field - */ - eProsima_user_DllExport void bounded_sequence_enum2_field( - std::vector&& _bounded_sequence_enum2_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_enum2_field - * @return Constant reference to member bounded_sequence_enum2_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_enum2_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_enum2_field - * @return Reference to member bounded_sequence_enum2_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_enum2_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field - */ - eProsima_user_DllExport void bounded_sequence_struct_field( - const std::vector& _bounded_sequence_struct_field); - - /*! - * @brief This function moves the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field - */ - eProsima_user_DllExport void bounded_sequence_struct_field( - std::vector&& _bounded_sequence_struct_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_struct_field - * @return Constant reference to member bounded_sequence_struct_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_struct_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_struct_field - * @return Reference to member bounded_sequence_struct_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_struct_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field - */ - eProsima_user_DllExport void unbounded_sequence_char_field( - const std::vector& _unbounded_sequence_char_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field - */ - eProsima_user_DllExport void unbounded_sequence_char_field( - std::vector&& _unbounded_sequence_char_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_char_field - * @return Constant reference to member unbounded_sequence_char_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_char_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_char_field - * @return Reference to member unbounded_sequence_char_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_char_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport void unbounded_sequence_uint8_field( - const std::vector& _unbounded_sequence_uint8_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport void unbounded_sequence_uint8_field( - std::vector&& _unbounded_sequence_uint8_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint8_field - * @return Constant reference to member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint8_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint8_field - * @return Reference to member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field - */ - eProsima_user_DllExport void unbounded_sequence_int16_field( - const std::vector& _unbounded_sequence_int16_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field - */ - eProsima_user_DllExport void unbounded_sequence_int16_field( - std::vector&& _unbounded_sequence_int16_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int16_field - * @return Constant reference to member unbounded_sequence_int16_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int16_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int16_field - * @return Reference to member unbounded_sequence_int16_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int16_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport void unbounded_sequence_uint16_field( - const std::vector& _unbounded_sequence_uint16_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport void unbounded_sequence_uint16_field( - std::vector&& _unbounded_sequence_uint16_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint16_field - * @return Constant reference to member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint16_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint16_field - * @return Reference to member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field - */ - eProsima_user_DllExport void unbounded_sequence_int32_field( - const std::vector& _unbounded_sequence_int32_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field - */ - eProsima_user_DllExport void unbounded_sequence_int32_field( - std::vector&& _unbounded_sequence_int32_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int32_field - * @return Constant reference to member unbounded_sequence_int32_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int32_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int32_field - * @return Reference to member unbounded_sequence_int32_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int32_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport void unbounded_sequence_uint32_field( - const std::vector& _unbounded_sequence_uint32_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport void unbounded_sequence_uint32_field( - std::vector&& _unbounded_sequence_uint32_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint32_field - * @return Constant reference to member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint32_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint32_field - * @return Reference to member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field - */ - eProsima_user_DllExport void unbounded_sequence_int64_field( - const std::vector& _unbounded_sequence_int64_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field - */ - eProsima_user_DllExport void unbounded_sequence_int64_field( - std::vector&& _unbounded_sequence_int64_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int64_field - * @return Constant reference to member unbounded_sequence_int64_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int64_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int64_field - * @return Reference to member unbounded_sequence_int64_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int64_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport void unbounded_sequence_uint64_field( - const std::vector& _unbounded_sequence_uint64_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport void unbounded_sequence_uint64_field( - std::vector&& _unbounded_sequence_uint64_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint64_field - * @return Constant reference to member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint64_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint64_field - * @return Reference to member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field - */ - eProsima_user_DllExport void unbounded_sequence_float_field( - const std::vector& _unbounded_sequence_float_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field - */ - eProsima_user_DllExport void unbounded_sequence_float_field( - std::vector&& _unbounded_sequence_float_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_float_field - * @return Constant reference to member unbounded_sequence_float_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_float_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_float_field - * @return Reference to member unbounded_sequence_float_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_float_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field - */ - eProsima_user_DllExport void unbounded_sequence_double_field( - const std::vector& _unbounded_sequence_double_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field - */ - eProsima_user_DllExport void unbounded_sequence_double_field( - std::vector&& _unbounded_sequence_double_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_double_field - * @return Constant reference to member unbounded_sequence_double_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_double_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_double_field - * @return Reference to member unbounded_sequence_double_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_double_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport void unbounded_sequence_long_double_field( - const std::vector& _unbounded_sequence_long_double_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport void unbounded_sequence_long_double_field( - std::vector&& _unbounded_sequence_long_double_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_long_double_field - * @return Constant reference to member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_long_double_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_long_double_field - * @return Reference to member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_long_double_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field - */ - eProsima_user_DllExport void unbounded_sequence_bool_field( - const std::vector& _unbounded_sequence_bool_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field - */ - eProsima_user_DllExport void unbounded_sequence_bool_field( - std::vector&& _unbounded_sequence_bool_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_bool_field - * @return Constant reference to member unbounded_sequence_bool_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_bool_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_bool_field - * @return Reference to member unbounded_sequence_bool_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_bool_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field - */ - eProsima_user_DllExport void unbounded_sequence_string_field( - const std::vector& _unbounded_sequence_string_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field - */ - eProsima_user_DllExport void unbounded_sequence_string_field( - std::vector&& _unbounded_sequence_string_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_string_field - * @return Constant reference to member unbounded_sequence_string_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_string_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_string_field - * @return Reference to member unbounded_sequence_string_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_string_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field - */ - eProsima_user_DllExport void unbounded_sequence_enum_field( - const std::vector& _unbounded_sequence_enum_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field - */ - eProsima_user_DllExport void unbounded_sequence_enum_field( - std::vector&& _unbounded_sequence_enum_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_enum_field - * @return Constant reference to member unbounded_sequence_enum_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_enum_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_enum_field - * @return Reference to member unbounded_sequence_enum_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_enum_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport void unbounded_sequence_enum2_field( - const std::vector& _unbounded_sequence_enum2_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport void unbounded_sequence_enum2_field( - std::vector&& _unbounded_sequence_enum2_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_enum2_field - * @return Constant reference to member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_enum2_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_enum2_field - * @return Reference to member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field - */ - eProsima_user_DllExport void unbounded_sequence_struct_field( - const std::vector& _unbounded_sequence_struct_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field - */ - eProsima_user_DllExport void unbounded_sequence_struct_field( - std::vector&& _unbounded_sequence_struct_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_struct_field - * @return Constant reference to member unbounded_sequence_struct_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_struct_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_struct_field - * @return Reference to member unbounded_sequence_struct_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_struct_field(); - -private: - - char m_char_field{0}; - uint8_t m_uint8_field{0}; - int16_t m_int16_field{0}; - uint16_t m_uint16_field{0}; - int32_t m_int32_field{0}; - uint32_t m_uint32_field{0}; - int64_t m_int64_field{0}; - uint64_t m_uint64_field{0}; - float m_float_field{0.0}; - double m_double_field{0.0}; - long double m_long_double_field{0.0}; - bool m_bool_field{false}; - std::string m_string_field; - Color m_enum_field{::RED}; - Material m_enum2_field{::WOOD}; - StructType m_struct_field; - std::array m_array_char_field{0}; - std::array m_array_uint8_field{0}; - std::array m_array_int16_field{0}; - std::array m_array_uint16_field{0}; - std::array m_array_int32_field{0}; - std::array m_array_uint32_field{0}; - std::array m_array_int64_field{0}; - std::array m_array_uint64_field{0}; - std::array m_array_float_field{0.0}; - std::array m_array_double_field{0.0}; - std::array m_array_long_double_field{0.0}; - std::array m_array_bool_field{false}; - std::array m_array_string_field; - std::array m_array_enum_field{::RED}; - std::array m_array_enum2_field{::WOOD}; - std::array m_array_struct_field; - std::vector m_bounded_sequence_char_field; - std::vector m_bounded_sequence_uint8_field; - std::vector m_bounded_sequence_int16_field; - std::vector m_bounded_sequence_uint16_field; - std::vector m_bounded_sequence_int32_field; - std::vector m_bounded_sequence_uint32_field; - std::vector m_bounded_sequence_int64_field; - std::vector m_bounded_sequence_uint64_field; - std::vector m_bounded_sequence_float_field; - std::vector m_bounded_sequence_double_field; - std::vector m_bounded_sequence_long_double_field; - std::vector m_bounded_sequence_bool_field; - std::vector m_bounded_sequence_string_field; - std::vector m_bounded_sequence_enum_field; - std::vector m_bounded_sequence_enum2_field; - std::vector m_bounded_sequence_struct_field; - std::vector m_unbounded_sequence_char_field; - std::vector m_unbounded_sequence_uint8_field; - std::vector m_unbounded_sequence_int16_field; - std::vector m_unbounded_sequence_uint16_field; - std::vector m_unbounded_sequence_int32_field; - std::vector m_unbounded_sequence_uint32_field; - std::vector m_unbounded_sequence_int64_field; - std::vector m_unbounded_sequence_uint64_field; - std::vector m_unbounded_sequence_float_field; - std::vector m_unbounded_sequence_double_field; - std::vector m_unbounded_sequence_long_double_field; - std::vector m_unbounded_sequence_bool_field; - std::vector m_unbounded_sequence_string_field; - std::vector m_unbounded_sequence_enum_field; - std::vector m_unbounded_sequence_enum2_field; - std::vector m_unbounded_sequence_struct_field; - -}; - -#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.hpp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.hpp new file mode 100644 index 00000000000..828fce7b0ff --- /dev/null +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.hpp @@ -0,0 +1,3691 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ContentFilterTestType.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_HPP_ +#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_HPP_ + +#include +#include +#include +#include +#include + +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CONTENTFILTERTESTTYPE_SOURCE) +#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllexport ) +#else +#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllimport ) +#endif // CONTENTFILTERTESTTYPE_SOURCE +#else +#define CONTENTFILTERTESTTYPE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CONTENTFILTERTESTTYPE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the enumeration Color defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +enum class Color : uint32_t +{ + RED, + GREEN, + BLUE, + YELLOW, + MAGENTA +}; +/*! + * @brief This class represents the enumeration Material defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +enum class Material : uint32_t +{ + WOOD, + PLASTIC, + METAL, + CONCRETE, + STONE +}; +/*! + * @brief This class represents the structure StructType defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +class StructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StructType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StructType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType( + const StructType& x) + { + m_char_field = x.m_char_field; + + m_uint8_field = x.m_uint8_field; + + m_int16_field = x.m_int16_field; + + m_uint16_field = x.m_uint16_field; + + m_int32_field = x.m_int32_field; + + m_uint32_field = x.m_uint32_field; + + m_int64_field = x.m_int64_field; + + m_uint64_field = x.m_uint64_field; + + m_float_field = x.m_float_field; + + m_double_field = x.m_double_field; + + m_long_double_field = x.m_long_double_field; + + m_bool_field = x.m_bool_field; + + m_string_field = x.m_string_field; + + m_enum_field = x.m_enum_field; + + m_enum2_field = x.m_enum2_field; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType( + StructType&& x) noexcept + { + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_long_double_field = x.m_long_double_field; + m_bool_field = x.m_bool_field; + m_string_field = std::move(x.m_string_field); + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType& operator =( + const StructType& x) + { + + m_char_field = x.m_char_field; + + m_uint8_field = x.m_uint8_field; + + m_int16_field = x.m_int16_field; + + m_uint16_field = x.m_uint16_field; + + m_int32_field = x.m_int32_field; + + m_uint32_field = x.m_uint32_field; + + m_int64_field = x.m_int64_field; + + m_uint64_field = x.m_uint64_field; + + m_float_field = x.m_float_field; + + m_double_field = x.m_double_field; + + m_long_double_field = x.m_long_double_field; + + m_bool_field = x.m_bool_field; + + m_string_field = x.m_string_field; + + m_enum_field = x.m_enum_field; + + m_enum2_field = x.m_enum2_field; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType& operator =( + StructType&& x) noexcept + { + + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_long_double_field = x.m_long_double_field; + m_bool_field = x.m_bool_field; + m_string_field = std::move(x.m_string_field); + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StructType& x) const + { + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_long_double_field == x.m_long_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field); + } + + /*! + * @brief Comparison operator. + * @param x StructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StructType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ + eProsima_user_DllExport void char_field( + char _char_field) + { + m_char_field = _char_field; + } + + /*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ + eProsima_user_DllExport char char_field() const + { + return m_char_field; + } + + /*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ + eProsima_user_DllExport char& char_field() + { + return m_char_field; + } + + + /*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ + eProsima_user_DllExport void uint8_field( + uint8_t _uint8_field) + { + m_uint8_field = _uint8_field; + } + + /*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ + eProsima_user_DllExport uint8_t uint8_field() const + { + return m_uint8_field; + } + + /*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ + eProsima_user_DllExport uint8_t& uint8_field() + { + return m_uint8_field; + } + + + /*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ + eProsima_user_DllExport void int16_field( + int16_t _int16_field) + { + m_int16_field = _int16_field; + } + + /*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ + eProsima_user_DllExport int16_t int16_field() const + { + return m_int16_field; + } + + /*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ + eProsima_user_DllExport int16_t& int16_field() + { + return m_int16_field; + } + + + /*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ + eProsima_user_DllExport void uint16_field( + uint16_t _uint16_field) + { + m_uint16_field = _uint16_field; + } + + /*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ + eProsima_user_DllExport uint16_t uint16_field() const + { + return m_uint16_field; + } + + /*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ + eProsima_user_DllExport uint16_t& uint16_field() + { + return m_uint16_field; + } + + + /*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ + eProsima_user_DllExport void int32_field( + int32_t _int32_field) + { + m_int32_field = _int32_field; + } + + /*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ + eProsima_user_DllExport int32_t int32_field() const + { + return m_int32_field; + } + + /*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ + eProsima_user_DllExport int32_t& int32_field() + { + return m_int32_field; + } + + + /*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ + eProsima_user_DllExport void uint32_field( + uint32_t _uint32_field) + { + m_uint32_field = _uint32_field; + } + + /*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ + eProsima_user_DllExport uint32_t uint32_field() const + { + return m_uint32_field; + } + + /*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ + eProsima_user_DllExport uint32_t& uint32_field() + { + return m_uint32_field; + } + + + /*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ + eProsima_user_DllExport void int64_field( + int64_t _int64_field) + { + m_int64_field = _int64_field; + } + + /*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ + eProsima_user_DllExport int64_t int64_field() const + { + return m_int64_field; + } + + /*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ + eProsima_user_DllExport int64_t& int64_field() + { + return m_int64_field; + } + + + /*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ + eProsima_user_DllExport void uint64_field( + uint64_t _uint64_field) + { + m_uint64_field = _uint64_field; + } + + /*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ + eProsima_user_DllExport uint64_t uint64_field() const + { + return m_uint64_field; + } + + /*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ + eProsima_user_DllExport uint64_t& uint64_field() + { + return m_uint64_field; + } + + + /*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ + eProsima_user_DllExport void float_field( + float _float_field) + { + m_float_field = _float_field; + } + + /*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ + eProsima_user_DllExport float float_field() const + { + return m_float_field; + } + + /*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ + eProsima_user_DllExport float& float_field() + { + return m_float_field; + } + + + /*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ + eProsima_user_DllExport void double_field( + double _double_field) + { + m_double_field = _double_field; + } + + /*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ + eProsima_user_DllExport double double_field() const + { + return m_double_field; + } + + /*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ + eProsima_user_DllExport double& double_field() + { + return m_double_field; + } + + + /*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ + eProsima_user_DllExport void long_double_field( + long double _long_double_field) + { + m_long_double_field = _long_double_field; + } + + /*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ + eProsima_user_DllExport long double long_double_field() const + { + return m_long_double_field; + } + + /*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ + eProsima_user_DllExport long double& long_double_field() + { + return m_long_double_field; + } + + + /*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ + eProsima_user_DllExport void bool_field( + bool _bool_field) + { + m_bool_field = _bool_field; + } + + /*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ + eProsima_user_DllExport bool bool_field() const + { + return m_bool_field; + } + + /*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ + eProsima_user_DllExport bool& bool_field() + { + return m_bool_field; + } + + + /*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ + eProsima_user_DllExport void string_field( + const std::string& _string_field) + { + m_string_field = _string_field; + } + + /*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ + eProsima_user_DllExport void string_field( + std::string&& _string_field) + { + m_string_field = std::move(_string_field); + } + + /*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ + eProsima_user_DllExport const std::string& string_field() const + { + return m_string_field; + } + + /*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ + eProsima_user_DllExport std::string& string_field() + { + return m_string_field; + } + + + /*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ + eProsima_user_DllExport void enum_field( + Color _enum_field) + { + m_enum_field = _enum_field; + } + + /*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ + eProsima_user_DllExport Color enum_field() const + { + return m_enum_field; + } + + /*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ + eProsima_user_DllExport Color& enum_field() + { + return m_enum_field; + } + + + /*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ + eProsima_user_DllExport void enum2_field( + Material _enum2_field) + { + m_enum2_field = _enum2_field; + } + + /*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ + eProsima_user_DllExport Material enum2_field() const + { + return m_enum2_field; + } + + /*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ + eProsima_user_DllExport Material& enum2_field() + { + return m_enum2_field; + } + + + +private: + + char m_char_field{0}; + uint8_t m_uint8_field{0}; + int16_t m_int16_field{0}; + uint16_t m_uint16_field{0}; + int32_t m_int32_field{0}; + uint32_t m_uint32_field{0}; + int64_t m_int64_field{0}; + uint64_t m_uint64_field{0}; + float m_float_field{0.0}; + double m_double_field{0.0}; + long double m_long_double_field{0.0}; + bool m_bool_field{false}; + std::string m_string_field; + Color m_enum_field{Color::RED}; + Material m_enum2_field{Material::WOOD}; + +}; +const uint32_t max_array_size = 3; +const uint32_t max_seq_size = 5; +/*! + * @brief This class represents the structure ContentFilterTestType defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +class ContentFilterTestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ContentFilterTestType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ContentFilterTestType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType( + const ContentFilterTestType& x) + { + m_char_field = x.m_char_field; + + m_uint8_field = x.m_uint8_field; + + m_int16_field = x.m_int16_field; + + m_uint16_field = x.m_uint16_field; + + m_int32_field = x.m_int32_field; + + m_uint32_field = x.m_uint32_field; + + m_int64_field = x.m_int64_field; + + m_uint64_field = x.m_uint64_field; + + m_float_field = x.m_float_field; + + m_double_field = x.m_double_field; + + m_long_double_field = x.m_long_double_field; + + m_bool_field = x.m_bool_field; + + m_string_field = x.m_string_field; + + m_enum_field = x.m_enum_field; + + m_enum2_field = x.m_enum2_field; + + m_struct_field = x.m_struct_field; + + m_array_char_field = x.m_array_char_field; + + m_array_uint8_field = x.m_array_uint8_field; + + m_array_int16_field = x.m_array_int16_field; + + m_array_uint16_field = x.m_array_uint16_field; + + m_array_int32_field = x.m_array_int32_field; + + m_array_uint32_field = x.m_array_uint32_field; + + m_array_int64_field = x.m_array_int64_field; + + m_array_uint64_field = x.m_array_uint64_field; + + m_array_float_field = x.m_array_float_field; + + m_array_double_field = x.m_array_double_field; + + m_array_long_double_field = x.m_array_long_double_field; + + m_array_bool_field = x.m_array_bool_field; + + m_array_string_field = x.m_array_string_field; + + m_array_enum_field = x.m_array_enum_field; + + m_array_enum2_field = x.m_array_enum2_field; + + m_array_struct_field = x.m_array_struct_field; + + m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; + + m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; + + m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; + + m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; + + m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; + + m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; + + m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; + + m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; + + m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; + + m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; + + m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; + + m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; + + m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; + + m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; + + m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; + + m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; + + m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; + + m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; + + m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; + + m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; + + m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; + + m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; + + m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; + + m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; + + m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; + + m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; + + m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; + + m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; + + m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; + + m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; + + m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; + + m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType( + ContentFilterTestType&& x) noexcept + { + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_long_double_field = x.m_long_double_field; + m_bool_field = x.m_bool_field; + m_string_field = std::move(x.m_string_field); + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + m_struct_field = std::move(x.m_struct_field); + m_array_char_field = std::move(x.m_array_char_field); + m_array_uint8_field = std::move(x.m_array_uint8_field); + m_array_int16_field = std::move(x.m_array_int16_field); + m_array_uint16_field = std::move(x.m_array_uint16_field); + m_array_int32_field = std::move(x.m_array_int32_field); + m_array_uint32_field = std::move(x.m_array_uint32_field); + m_array_int64_field = std::move(x.m_array_int64_field); + m_array_uint64_field = std::move(x.m_array_uint64_field); + m_array_float_field = std::move(x.m_array_float_field); + m_array_double_field = std::move(x.m_array_double_field); + m_array_long_double_field = std::move(x.m_array_long_double_field); + m_array_bool_field = std::move(x.m_array_bool_field); + m_array_string_field = std::move(x.m_array_string_field); + m_array_enum_field = std::move(x.m_array_enum_field); + m_array_enum2_field = std::move(x.m_array_enum2_field); + m_array_struct_field = std::move(x.m_array_struct_field); + m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); + m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); + m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); + m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); + m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); + m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); + m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); + m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); + m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); + m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); + m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); + m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); + m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); + m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); + m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); + m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType& operator =( + const ContentFilterTestType& x) + { + + m_char_field = x.m_char_field; + + m_uint8_field = x.m_uint8_field; + + m_int16_field = x.m_int16_field; + + m_uint16_field = x.m_uint16_field; + + m_int32_field = x.m_int32_field; + + m_uint32_field = x.m_uint32_field; + + m_int64_field = x.m_int64_field; + + m_uint64_field = x.m_uint64_field; + + m_float_field = x.m_float_field; + + m_double_field = x.m_double_field; + + m_long_double_field = x.m_long_double_field; + + m_bool_field = x.m_bool_field; + + m_string_field = x.m_string_field; + + m_enum_field = x.m_enum_field; + + m_enum2_field = x.m_enum2_field; + + m_struct_field = x.m_struct_field; + + m_array_char_field = x.m_array_char_field; + + m_array_uint8_field = x.m_array_uint8_field; + + m_array_int16_field = x.m_array_int16_field; + + m_array_uint16_field = x.m_array_uint16_field; + + m_array_int32_field = x.m_array_int32_field; + + m_array_uint32_field = x.m_array_uint32_field; + + m_array_int64_field = x.m_array_int64_field; + + m_array_uint64_field = x.m_array_uint64_field; + + m_array_float_field = x.m_array_float_field; + + m_array_double_field = x.m_array_double_field; + + m_array_long_double_field = x.m_array_long_double_field; + + m_array_bool_field = x.m_array_bool_field; + + m_array_string_field = x.m_array_string_field; + + m_array_enum_field = x.m_array_enum_field; + + m_array_enum2_field = x.m_array_enum2_field; + + m_array_struct_field = x.m_array_struct_field; + + m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; + + m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; + + m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; + + m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; + + m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; + + m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; + + m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; + + m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; + + m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; + + m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; + + m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; + + m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; + + m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; + + m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; + + m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; + + m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; + + m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; + + m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; + + m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; + + m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; + + m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; + + m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; + + m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; + + m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; + + m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; + + m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; + + m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; + + m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; + + m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; + + m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; + + m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; + + m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType& operator =( + ContentFilterTestType&& x) noexcept + { + + m_char_field = x.m_char_field; + m_uint8_field = x.m_uint8_field; + m_int16_field = x.m_int16_field; + m_uint16_field = x.m_uint16_field; + m_int32_field = x.m_int32_field; + m_uint32_field = x.m_uint32_field; + m_int64_field = x.m_int64_field; + m_uint64_field = x.m_uint64_field; + m_float_field = x.m_float_field; + m_double_field = x.m_double_field; + m_long_double_field = x.m_long_double_field; + m_bool_field = x.m_bool_field; + m_string_field = std::move(x.m_string_field); + m_enum_field = x.m_enum_field; + m_enum2_field = x.m_enum2_field; + m_struct_field = std::move(x.m_struct_field); + m_array_char_field = std::move(x.m_array_char_field); + m_array_uint8_field = std::move(x.m_array_uint8_field); + m_array_int16_field = std::move(x.m_array_int16_field); + m_array_uint16_field = std::move(x.m_array_uint16_field); + m_array_int32_field = std::move(x.m_array_int32_field); + m_array_uint32_field = std::move(x.m_array_uint32_field); + m_array_int64_field = std::move(x.m_array_int64_field); + m_array_uint64_field = std::move(x.m_array_uint64_field); + m_array_float_field = std::move(x.m_array_float_field); + m_array_double_field = std::move(x.m_array_double_field); + m_array_long_double_field = std::move(x.m_array_long_double_field); + m_array_bool_field = std::move(x.m_array_bool_field); + m_array_string_field = std::move(x.m_array_string_field); + m_array_enum_field = std::move(x.m_array_enum_field); + m_array_enum2_field = std::move(x.m_array_enum2_field); + m_array_struct_field = std::move(x.m_array_struct_field); + m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); + m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); + m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); + m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); + m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); + m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); + m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); + m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); + m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); + m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); + m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); + m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); + m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); + m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); + m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); + m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ContentFilterTestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ContentFilterTestType& x) const + { + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_long_double_field == x.m_long_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field && + m_struct_field == x.m_struct_field && + m_array_char_field == x.m_array_char_field && + m_array_uint8_field == x.m_array_uint8_field && + m_array_int16_field == x.m_array_int16_field && + m_array_uint16_field == x.m_array_uint16_field && + m_array_int32_field == x.m_array_int32_field && + m_array_uint32_field == x.m_array_uint32_field && + m_array_int64_field == x.m_array_int64_field && + m_array_uint64_field == x.m_array_uint64_field && + m_array_float_field == x.m_array_float_field && + m_array_double_field == x.m_array_double_field && + m_array_long_double_field == x.m_array_long_double_field && + m_array_bool_field == x.m_array_bool_field && + m_array_string_field == x.m_array_string_field && + m_array_enum_field == x.m_array_enum_field && + m_array_enum2_field == x.m_array_enum2_field && + m_array_struct_field == x.m_array_struct_field && + m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && + m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && + m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && + m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && + m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && + m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && + m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && + m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && + m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && + m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && + m_bounded_sequence_long_double_field == x.m_bounded_sequence_long_double_field && + m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && + m_bounded_sequence_string_field == x.m_bounded_sequence_string_field && + m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && + m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && + m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && + m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && + m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && + m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && + m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && + m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && + m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && + m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && + m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && + m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && + m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && + m_unbounded_sequence_long_double_field == x.m_unbounded_sequence_long_double_field && + m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && + m_unbounded_sequence_string_field == x.m_unbounded_sequence_string_field && + m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && + m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && + m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); + } + + /*! + * @brief Comparison operator. + * @param x ContentFilterTestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ContentFilterTestType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ + eProsima_user_DllExport void char_field( + char _char_field) + { + m_char_field = _char_field; + } + + /*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ + eProsima_user_DllExport char char_field() const + { + return m_char_field; + } + + /*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ + eProsima_user_DllExport char& char_field() + { + return m_char_field; + } + + + /*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ + eProsima_user_DllExport void uint8_field( + uint8_t _uint8_field) + { + m_uint8_field = _uint8_field; + } + + /*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ + eProsima_user_DllExport uint8_t uint8_field() const + { + return m_uint8_field; + } + + /*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ + eProsima_user_DllExport uint8_t& uint8_field() + { + return m_uint8_field; + } + + + /*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ + eProsima_user_DllExport void int16_field( + int16_t _int16_field) + { + m_int16_field = _int16_field; + } + + /*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ + eProsima_user_DllExport int16_t int16_field() const + { + return m_int16_field; + } + + /*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ + eProsima_user_DllExport int16_t& int16_field() + { + return m_int16_field; + } + + + /*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ + eProsima_user_DllExport void uint16_field( + uint16_t _uint16_field) + { + m_uint16_field = _uint16_field; + } + + /*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ + eProsima_user_DllExport uint16_t uint16_field() const + { + return m_uint16_field; + } + + /*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ + eProsima_user_DllExport uint16_t& uint16_field() + { + return m_uint16_field; + } + + + /*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ + eProsima_user_DllExport void int32_field( + int32_t _int32_field) + { + m_int32_field = _int32_field; + } + + /*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ + eProsima_user_DllExport int32_t int32_field() const + { + return m_int32_field; + } + + /*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ + eProsima_user_DllExport int32_t& int32_field() + { + return m_int32_field; + } + + + /*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ + eProsima_user_DllExport void uint32_field( + uint32_t _uint32_field) + { + m_uint32_field = _uint32_field; + } + + /*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ + eProsima_user_DllExport uint32_t uint32_field() const + { + return m_uint32_field; + } + + /*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ + eProsima_user_DllExport uint32_t& uint32_field() + { + return m_uint32_field; + } + + + /*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ + eProsima_user_DllExport void int64_field( + int64_t _int64_field) + { + m_int64_field = _int64_field; + } + + /*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ + eProsima_user_DllExport int64_t int64_field() const + { + return m_int64_field; + } + + /*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ + eProsima_user_DllExport int64_t& int64_field() + { + return m_int64_field; + } + + + /*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ + eProsima_user_DllExport void uint64_field( + uint64_t _uint64_field) + { + m_uint64_field = _uint64_field; + } + + /*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ + eProsima_user_DllExport uint64_t uint64_field() const + { + return m_uint64_field; + } + + /*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ + eProsima_user_DllExport uint64_t& uint64_field() + { + return m_uint64_field; + } + + + /*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ + eProsima_user_DllExport void float_field( + float _float_field) + { + m_float_field = _float_field; + } + + /*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ + eProsima_user_DllExport float float_field() const + { + return m_float_field; + } + + /*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ + eProsima_user_DllExport float& float_field() + { + return m_float_field; + } + + + /*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ + eProsima_user_DllExport void double_field( + double _double_field) + { + m_double_field = _double_field; + } + + /*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ + eProsima_user_DllExport double double_field() const + { + return m_double_field; + } + + /*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ + eProsima_user_DllExport double& double_field() + { + return m_double_field; + } + + + /*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ + eProsima_user_DllExport void long_double_field( + long double _long_double_field) + { + m_long_double_field = _long_double_field; + } + + /*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ + eProsima_user_DllExport long double long_double_field() const + { + return m_long_double_field; + } + + /*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ + eProsima_user_DllExport long double& long_double_field() + { + return m_long_double_field; + } + + + /*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ + eProsima_user_DllExport void bool_field( + bool _bool_field) + { + m_bool_field = _bool_field; + } + + /*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ + eProsima_user_DllExport bool bool_field() const + { + return m_bool_field; + } + + /*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ + eProsima_user_DllExport bool& bool_field() + { + return m_bool_field; + } + + + /*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ + eProsima_user_DllExport void string_field( + const std::string& _string_field) + { + m_string_field = _string_field; + } + + /*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ + eProsima_user_DllExport void string_field( + std::string&& _string_field) + { + m_string_field = std::move(_string_field); + } + + /*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ + eProsima_user_DllExport const std::string& string_field() const + { + return m_string_field; + } + + /*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ + eProsima_user_DllExport std::string& string_field() + { + return m_string_field; + } + + + /*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ + eProsima_user_DllExport void enum_field( + Color _enum_field) + { + m_enum_field = _enum_field; + } + + /*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ + eProsima_user_DllExport Color enum_field() const + { + return m_enum_field; + } + + /*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ + eProsima_user_DllExport Color& enum_field() + { + return m_enum_field; + } + + + /*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ + eProsima_user_DllExport void enum2_field( + Material _enum2_field) + { + m_enum2_field = _enum2_field; + } + + /*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ + eProsima_user_DllExport Material enum2_field() const + { + return m_enum2_field; + } + + /*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ + eProsima_user_DllExport Material& enum2_field() + { + return m_enum2_field; + } + + + /*! + * @brief This function copies the value in member struct_field + * @param _struct_field New value to be copied in member struct_field + */ + eProsima_user_DllExport void struct_field( + const StructType& _struct_field) + { + m_struct_field = _struct_field; + } + + /*! + * @brief This function moves the value in member struct_field + * @param _struct_field New value to be moved in member struct_field + */ + eProsima_user_DllExport void struct_field( + StructType&& _struct_field) + { + m_struct_field = std::move(_struct_field); + } + + /*! + * @brief This function returns a constant reference to member struct_field + * @return Constant reference to member struct_field + */ + eProsima_user_DllExport const StructType& struct_field() const + { + return m_struct_field; + } + + /*! + * @brief This function returns a reference to member struct_field + * @return Reference to member struct_field + */ + eProsima_user_DllExport StructType& struct_field() + { + return m_struct_field; + } + + + /*! + * @brief This function copies the value in member array_char_field + * @param _array_char_field New value to be copied in member array_char_field + */ + eProsima_user_DllExport void array_char_field( + const std::array& _array_char_field) + { + m_array_char_field = _array_char_field; + } + + /*! + * @brief This function moves the value in member array_char_field + * @param _array_char_field New value to be moved in member array_char_field + */ + eProsima_user_DllExport void array_char_field( + std::array&& _array_char_field) + { + m_array_char_field = std::move(_array_char_field); + } + + /*! + * @brief This function returns a constant reference to member array_char_field + * @return Constant reference to member array_char_field + */ + eProsima_user_DllExport const std::array& array_char_field() const + { + return m_array_char_field; + } + + /*! + * @brief This function returns a reference to member array_char_field + * @return Reference to member array_char_field + */ + eProsima_user_DllExport std::array& array_char_field() + { + return m_array_char_field; + } + + + /*! + * @brief This function copies the value in member array_uint8_field + * @param _array_uint8_field New value to be copied in member array_uint8_field + */ + eProsima_user_DllExport void array_uint8_field( + const std::array& _array_uint8_field) + { + m_array_uint8_field = _array_uint8_field; + } + + /*! + * @brief This function moves the value in member array_uint8_field + * @param _array_uint8_field New value to be moved in member array_uint8_field + */ + eProsima_user_DllExport void array_uint8_field( + std::array&& _array_uint8_field) + { + m_array_uint8_field = std::move(_array_uint8_field); + } + + /*! + * @brief This function returns a constant reference to member array_uint8_field + * @return Constant reference to member array_uint8_field + */ + eProsima_user_DllExport const std::array& array_uint8_field() const + { + return m_array_uint8_field; + } + + /*! + * @brief This function returns a reference to member array_uint8_field + * @return Reference to member array_uint8_field + */ + eProsima_user_DllExport std::array& array_uint8_field() + { + return m_array_uint8_field; + } + + + /*! + * @brief This function copies the value in member array_int16_field + * @param _array_int16_field New value to be copied in member array_int16_field + */ + eProsima_user_DllExport void array_int16_field( + const std::array& _array_int16_field) + { + m_array_int16_field = _array_int16_field; + } + + /*! + * @brief This function moves the value in member array_int16_field + * @param _array_int16_field New value to be moved in member array_int16_field + */ + eProsima_user_DllExport void array_int16_field( + std::array&& _array_int16_field) + { + m_array_int16_field = std::move(_array_int16_field); + } + + /*! + * @brief This function returns a constant reference to member array_int16_field + * @return Constant reference to member array_int16_field + */ + eProsima_user_DllExport const std::array& array_int16_field() const + { + return m_array_int16_field; + } + + /*! + * @brief This function returns a reference to member array_int16_field + * @return Reference to member array_int16_field + */ + eProsima_user_DllExport std::array& array_int16_field() + { + return m_array_int16_field; + } + + + /*! + * @brief This function copies the value in member array_uint16_field + * @param _array_uint16_field New value to be copied in member array_uint16_field + */ + eProsima_user_DllExport void array_uint16_field( + const std::array& _array_uint16_field) + { + m_array_uint16_field = _array_uint16_field; + } + + /*! + * @brief This function moves the value in member array_uint16_field + * @param _array_uint16_field New value to be moved in member array_uint16_field + */ + eProsima_user_DllExport void array_uint16_field( + std::array&& _array_uint16_field) + { + m_array_uint16_field = std::move(_array_uint16_field); + } + + /*! + * @brief This function returns a constant reference to member array_uint16_field + * @return Constant reference to member array_uint16_field + */ + eProsima_user_DllExport const std::array& array_uint16_field() const + { + return m_array_uint16_field; + } + + /*! + * @brief This function returns a reference to member array_uint16_field + * @return Reference to member array_uint16_field + */ + eProsima_user_DllExport std::array& array_uint16_field() + { + return m_array_uint16_field; + } + + + /*! + * @brief This function copies the value in member array_int32_field + * @param _array_int32_field New value to be copied in member array_int32_field + */ + eProsima_user_DllExport void array_int32_field( + const std::array& _array_int32_field) + { + m_array_int32_field = _array_int32_field; + } + + /*! + * @brief This function moves the value in member array_int32_field + * @param _array_int32_field New value to be moved in member array_int32_field + */ + eProsima_user_DllExport void array_int32_field( + std::array&& _array_int32_field) + { + m_array_int32_field = std::move(_array_int32_field); + } + + /*! + * @brief This function returns a constant reference to member array_int32_field + * @return Constant reference to member array_int32_field + */ + eProsima_user_DllExport const std::array& array_int32_field() const + { + return m_array_int32_field; + } + + /*! + * @brief This function returns a reference to member array_int32_field + * @return Reference to member array_int32_field + */ + eProsima_user_DllExport std::array& array_int32_field() + { + return m_array_int32_field; + } + + + /*! + * @brief This function copies the value in member array_uint32_field + * @param _array_uint32_field New value to be copied in member array_uint32_field + */ + eProsima_user_DllExport void array_uint32_field( + const std::array& _array_uint32_field) + { + m_array_uint32_field = _array_uint32_field; + } + + /*! + * @brief This function moves the value in member array_uint32_field + * @param _array_uint32_field New value to be moved in member array_uint32_field + */ + eProsima_user_DllExport void array_uint32_field( + std::array&& _array_uint32_field) + { + m_array_uint32_field = std::move(_array_uint32_field); + } + + /*! + * @brief This function returns a constant reference to member array_uint32_field + * @return Constant reference to member array_uint32_field + */ + eProsima_user_DllExport const std::array& array_uint32_field() const + { + return m_array_uint32_field; + } + + /*! + * @brief This function returns a reference to member array_uint32_field + * @return Reference to member array_uint32_field + */ + eProsima_user_DllExport std::array& array_uint32_field() + { + return m_array_uint32_field; + } + + + /*! + * @brief This function copies the value in member array_int64_field + * @param _array_int64_field New value to be copied in member array_int64_field + */ + eProsima_user_DllExport void array_int64_field( + const std::array& _array_int64_field) + { + m_array_int64_field = _array_int64_field; + } + + /*! + * @brief This function moves the value in member array_int64_field + * @param _array_int64_field New value to be moved in member array_int64_field + */ + eProsima_user_DllExport void array_int64_field( + std::array&& _array_int64_field) + { + m_array_int64_field = std::move(_array_int64_field); + } + + /*! + * @brief This function returns a constant reference to member array_int64_field + * @return Constant reference to member array_int64_field + */ + eProsima_user_DllExport const std::array& array_int64_field() const + { + return m_array_int64_field; + } + + /*! + * @brief This function returns a reference to member array_int64_field + * @return Reference to member array_int64_field + */ + eProsima_user_DllExport std::array& array_int64_field() + { + return m_array_int64_field; + } + + + /*! + * @brief This function copies the value in member array_uint64_field + * @param _array_uint64_field New value to be copied in member array_uint64_field + */ + eProsima_user_DllExport void array_uint64_field( + const std::array& _array_uint64_field) + { + m_array_uint64_field = _array_uint64_field; + } + + /*! + * @brief This function moves the value in member array_uint64_field + * @param _array_uint64_field New value to be moved in member array_uint64_field + */ + eProsima_user_DllExport void array_uint64_field( + std::array&& _array_uint64_field) + { + m_array_uint64_field = std::move(_array_uint64_field); + } + + /*! + * @brief This function returns a constant reference to member array_uint64_field + * @return Constant reference to member array_uint64_field + */ + eProsima_user_DllExport const std::array& array_uint64_field() const + { + return m_array_uint64_field; + } + + /*! + * @brief This function returns a reference to member array_uint64_field + * @return Reference to member array_uint64_field + */ + eProsima_user_DllExport std::array& array_uint64_field() + { + return m_array_uint64_field; + } + + + /*! + * @brief This function copies the value in member array_float_field + * @param _array_float_field New value to be copied in member array_float_field + */ + eProsima_user_DllExport void array_float_field( + const std::array& _array_float_field) + { + m_array_float_field = _array_float_field; + } + + /*! + * @brief This function moves the value in member array_float_field + * @param _array_float_field New value to be moved in member array_float_field + */ + eProsima_user_DllExport void array_float_field( + std::array&& _array_float_field) + { + m_array_float_field = std::move(_array_float_field); + } + + /*! + * @brief This function returns a constant reference to member array_float_field + * @return Constant reference to member array_float_field + */ + eProsima_user_DllExport const std::array& array_float_field() const + { + return m_array_float_field; + } + + /*! + * @brief This function returns a reference to member array_float_field + * @return Reference to member array_float_field + */ + eProsima_user_DllExport std::array& array_float_field() + { + return m_array_float_field; + } + + + /*! + * @brief This function copies the value in member array_double_field + * @param _array_double_field New value to be copied in member array_double_field + */ + eProsima_user_DllExport void array_double_field( + const std::array& _array_double_field) + { + m_array_double_field = _array_double_field; + } + + /*! + * @brief This function moves the value in member array_double_field + * @param _array_double_field New value to be moved in member array_double_field + */ + eProsima_user_DllExport void array_double_field( + std::array&& _array_double_field) + { + m_array_double_field = std::move(_array_double_field); + } + + /*! + * @brief This function returns a constant reference to member array_double_field + * @return Constant reference to member array_double_field + */ + eProsima_user_DllExport const std::array& array_double_field() const + { + return m_array_double_field; + } + + /*! + * @brief This function returns a reference to member array_double_field + * @return Reference to member array_double_field + */ + eProsima_user_DllExport std::array& array_double_field() + { + return m_array_double_field; + } + + + /*! + * @brief This function copies the value in member array_long_double_field + * @param _array_long_double_field New value to be copied in member array_long_double_field + */ + eProsima_user_DllExport void array_long_double_field( + const std::array& _array_long_double_field) + { + m_array_long_double_field = _array_long_double_field; + } + + /*! + * @brief This function moves the value in member array_long_double_field + * @param _array_long_double_field New value to be moved in member array_long_double_field + */ + eProsima_user_DllExport void array_long_double_field( + std::array&& _array_long_double_field) + { + m_array_long_double_field = std::move(_array_long_double_field); + } + + /*! + * @brief This function returns a constant reference to member array_long_double_field + * @return Constant reference to member array_long_double_field + */ + eProsima_user_DllExport const std::array& array_long_double_field() const + { + return m_array_long_double_field; + } + + /*! + * @brief This function returns a reference to member array_long_double_field + * @return Reference to member array_long_double_field + */ + eProsima_user_DllExport std::array& array_long_double_field() + { + return m_array_long_double_field; + } + + + /*! + * @brief This function copies the value in member array_bool_field + * @param _array_bool_field New value to be copied in member array_bool_field + */ + eProsima_user_DllExport void array_bool_field( + const std::array& _array_bool_field) + { + m_array_bool_field = _array_bool_field; + } + + /*! + * @brief This function moves the value in member array_bool_field + * @param _array_bool_field New value to be moved in member array_bool_field + */ + eProsima_user_DllExport void array_bool_field( + std::array&& _array_bool_field) + { + m_array_bool_field = std::move(_array_bool_field); + } + + /*! + * @brief This function returns a constant reference to member array_bool_field + * @return Constant reference to member array_bool_field + */ + eProsima_user_DllExport const std::array& array_bool_field() const + { + return m_array_bool_field; + } + + /*! + * @brief This function returns a reference to member array_bool_field + * @return Reference to member array_bool_field + */ + eProsima_user_DllExport std::array& array_bool_field() + { + return m_array_bool_field; + } + + + /*! + * @brief This function copies the value in member array_string_field + * @param _array_string_field New value to be copied in member array_string_field + */ + eProsima_user_DllExport void array_string_field( + const std::array& _array_string_field) + { + m_array_string_field = _array_string_field; + } + + /*! + * @brief This function moves the value in member array_string_field + * @param _array_string_field New value to be moved in member array_string_field + */ + eProsima_user_DllExport void array_string_field( + std::array&& _array_string_field) + { + m_array_string_field = std::move(_array_string_field); + } + + /*! + * @brief This function returns a constant reference to member array_string_field + * @return Constant reference to member array_string_field + */ + eProsima_user_DllExport const std::array& array_string_field() const + { + return m_array_string_field; + } + + /*! + * @brief This function returns a reference to member array_string_field + * @return Reference to member array_string_field + */ + eProsima_user_DllExport std::array& array_string_field() + { + return m_array_string_field; + } + + + /*! + * @brief This function copies the value in member array_enum_field + * @param _array_enum_field New value to be copied in member array_enum_field + */ + eProsima_user_DllExport void array_enum_field( + const std::array& _array_enum_field) + { + m_array_enum_field = _array_enum_field; + } + + /*! + * @brief This function moves the value in member array_enum_field + * @param _array_enum_field New value to be moved in member array_enum_field + */ + eProsima_user_DllExport void array_enum_field( + std::array&& _array_enum_field) + { + m_array_enum_field = std::move(_array_enum_field); + } + + /*! + * @brief This function returns a constant reference to member array_enum_field + * @return Constant reference to member array_enum_field + */ + eProsima_user_DllExport const std::array& array_enum_field() const + { + return m_array_enum_field; + } + + /*! + * @brief This function returns a reference to member array_enum_field + * @return Reference to member array_enum_field + */ + eProsima_user_DllExport std::array& array_enum_field() + { + return m_array_enum_field; + } + + + /*! + * @brief This function copies the value in member array_enum2_field + * @param _array_enum2_field New value to be copied in member array_enum2_field + */ + eProsima_user_DllExport void array_enum2_field( + const std::array& _array_enum2_field) + { + m_array_enum2_field = _array_enum2_field; + } + + /*! + * @brief This function moves the value in member array_enum2_field + * @param _array_enum2_field New value to be moved in member array_enum2_field + */ + eProsima_user_DllExport void array_enum2_field( + std::array&& _array_enum2_field) + { + m_array_enum2_field = std::move(_array_enum2_field); + } + + /*! + * @brief This function returns a constant reference to member array_enum2_field + * @return Constant reference to member array_enum2_field + */ + eProsima_user_DllExport const std::array& array_enum2_field() const + { + return m_array_enum2_field; + } + + /*! + * @brief This function returns a reference to member array_enum2_field + * @return Reference to member array_enum2_field + */ + eProsima_user_DllExport std::array& array_enum2_field() + { + return m_array_enum2_field; + } + + + /*! + * @brief This function copies the value in member array_struct_field + * @param _array_struct_field New value to be copied in member array_struct_field + */ + eProsima_user_DllExport void array_struct_field( + const std::array& _array_struct_field) + { + m_array_struct_field = _array_struct_field; + } + + /*! + * @brief This function moves the value in member array_struct_field + * @param _array_struct_field New value to be moved in member array_struct_field + */ + eProsima_user_DllExport void array_struct_field( + std::array&& _array_struct_field) + { + m_array_struct_field = std::move(_array_struct_field); + } + + /*! + * @brief This function returns a constant reference to member array_struct_field + * @return Constant reference to member array_struct_field + */ + eProsima_user_DllExport const std::array& array_struct_field() const + { + return m_array_struct_field; + } + + /*! + * @brief This function returns a reference to member array_struct_field + * @return Reference to member array_struct_field + */ + eProsima_user_DllExport std::array& array_struct_field() + { + return m_array_struct_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field + */ + eProsima_user_DllExport void bounded_sequence_char_field( + const std::vector& _bounded_sequence_char_field) + { + m_bounded_sequence_char_field = _bounded_sequence_char_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field + */ + eProsima_user_DllExport void bounded_sequence_char_field( + std::vector&& _bounded_sequence_char_field) + { + m_bounded_sequence_char_field = std::move(_bounded_sequence_char_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_char_field + * @return Constant reference to member bounded_sequence_char_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_char_field() const + { + return m_bounded_sequence_char_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_char_field + * @return Reference to member bounded_sequence_char_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_char_field() + { + return m_bounded_sequence_char_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field + */ + eProsima_user_DllExport void bounded_sequence_uint8_field( + const std::vector& _bounded_sequence_uint8_field) + { + m_bounded_sequence_uint8_field = _bounded_sequence_uint8_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field + */ + eProsima_user_DllExport void bounded_sequence_uint8_field( + std::vector&& _bounded_sequence_uint8_field) + { + m_bounded_sequence_uint8_field = std::move(_bounded_sequence_uint8_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint8_field + * @return Constant reference to member bounded_sequence_uint8_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint8_field() const + { + return m_bounded_sequence_uint8_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_uint8_field + * @return Reference to member bounded_sequence_uint8_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint8_field() + { + return m_bounded_sequence_uint8_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field + */ + eProsima_user_DllExport void bounded_sequence_int16_field( + const std::vector& _bounded_sequence_int16_field) + { + m_bounded_sequence_int16_field = _bounded_sequence_int16_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field + */ + eProsima_user_DllExport void bounded_sequence_int16_field( + std::vector&& _bounded_sequence_int16_field) + { + m_bounded_sequence_int16_field = std::move(_bounded_sequence_int16_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int16_field + * @return Constant reference to member bounded_sequence_int16_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int16_field() const + { + return m_bounded_sequence_int16_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_int16_field + * @return Reference to member bounded_sequence_int16_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int16_field() + { + return m_bounded_sequence_int16_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field + */ + eProsima_user_DllExport void bounded_sequence_uint16_field( + const std::vector& _bounded_sequence_uint16_field) + { + m_bounded_sequence_uint16_field = _bounded_sequence_uint16_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field + */ + eProsima_user_DllExport void bounded_sequence_uint16_field( + std::vector&& _bounded_sequence_uint16_field) + { + m_bounded_sequence_uint16_field = std::move(_bounded_sequence_uint16_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint16_field + * @return Constant reference to member bounded_sequence_uint16_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint16_field() const + { + return m_bounded_sequence_uint16_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_uint16_field + * @return Reference to member bounded_sequence_uint16_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint16_field() + { + return m_bounded_sequence_uint16_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field + */ + eProsima_user_DllExport void bounded_sequence_int32_field( + const std::vector& _bounded_sequence_int32_field) + { + m_bounded_sequence_int32_field = _bounded_sequence_int32_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field + */ + eProsima_user_DllExport void bounded_sequence_int32_field( + std::vector&& _bounded_sequence_int32_field) + { + m_bounded_sequence_int32_field = std::move(_bounded_sequence_int32_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int32_field + * @return Constant reference to member bounded_sequence_int32_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int32_field() const + { + return m_bounded_sequence_int32_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_int32_field + * @return Reference to member bounded_sequence_int32_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int32_field() + { + return m_bounded_sequence_int32_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field + */ + eProsima_user_DllExport void bounded_sequence_uint32_field( + const std::vector& _bounded_sequence_uint32_field) + { + m_bounded_sequence_uint32_field = _bounded_sequence_uint32_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field + */ + eProsima_user_DllExport void bounded_sequence_uint32_field( + std::vector&& _bounded_sequence_uint32_field) + { + m_bounded_sequence_uint32_field = std::move(_bounded_sequence_uint32_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint32_field + * @return Constant reference to member bounded_sequence_uint32_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint32_field() const + { + return m_bounded_sequence_uint32_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_uint32_field + * @return Reference to member bounded_sequence_uint32_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint32_field() + { + return m_bounded_sequence_uint32_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field + */ + eProsima_user_DllExport void bounded_sequence_int64_field( + const std::vector& _bounded_sequence_int64_field) + { + m_bounded_sequence_int64_field = _bounded_sequence_int64_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field + */ + eProsima_user_DllExport void bounded_sequence_int64_field( + std::vector&& _bounded_sequence_int64_field) + { + m_bounded_sequence_int64_field = std::move(_bounded_sequence_int64_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int64_field + * @return Constant reference to member bounded_sequence_int64_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int64_field() const + { + return m_bounded_sequence_int64_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_int64_field + * @return Reference to member bounded_sequence_int64_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int64_field() + { + return m_bounded_sequence_int64_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field + */ + eProsima_user_DllExport void bounded_sequence_uint64_field( + const std::vector& _bounded_sequence_uint64_field) + { + m_bounded_sequence_uint64_field = _bounded_sequence_uint64_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field + */ + eProsima_user_DllExport void bounded_sequence_uint64_field( + std::vector&& _bounded_sequence_uint64_field) + { + m_bounded_sequence_uint64_field = std::move(_bounded_sequence_uint64_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint64_field + * @return Constant reference to member bounded_sequence_uint64_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint64_field() const + { + return m_bounded_sequence_uint64_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_uint64_field + * @return Reference to member bounded_sequence_uint64_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint64_field() + { + return m_bounded_sequence_uint64_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field + */ + eProsima_user_DllExport void bounded_sequence_float_field( + const std::vector& _bounded_sequence_float_field) + { + m_bounded_sequence_float_field = _bounded_sequence_float_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field + */ + eProsima_user_DllExport void bounded_sequence_float_field( + std::vector&& _bounded_sequence_float_field) + { + m_bounded_sequence_float_field = std::move(_bounded_sequence_float_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_float_field + * @return Constant reference to member bounded_sequence_float_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_float_field() const + { + return m_bounded_sequence_float_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_float_field + * @return Reference to member bounded_sequence_float_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_float_field() + { + return m_bounded_sequence_float_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field + */ + eProsima_user_DllExport void bounded_sequence_double_field( + const std::vector& _bounded_sequence_double_field) + { + m_bounded_sequence_double_field = _bounded_sequence_double_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field + */ + eProsima_user_DllExport void bounded_sequence_double_field( + std::vector&& _bounded_sequence_double_field) + { + m_bounded_sequence_double_field = std::move(_bounded_sequence_double_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_double_field + * @return Constant reference to member bounded_sequence_double_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_double_field() const + { + return m_bounded_sequence_double_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_double_field + * @return Reference to member bounded_sequence_double_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_double_field() + { + return m_bounded_sequence_double_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field + */ + eProsima_user_DllExport void bounded_sequence_long_double_field( + const std::vector& _bounded_sequence_long_double_field) + { + m_bounded_sequence_long_double_field = _bounded_sequence_long_double_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field + */ + eProsima_user_DllExport void bounded_sequence_long_double_field( + std::vector&& _bounded_sequence_long_double_field) + { + m_bounded_sequence_long_double_field = std::move(_bounded_sequence_long_double_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_long_double_field + * @return Constant reference to member bounded_sequence_long_double_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_long_double_field() const + { + return m_bounded_sequence_long_double_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_long_double_field + * @return Reference to member bounded_sequence_long_double_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_long_double_field() + { + return m_bounded_sequence_long_double_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field + */ + eProsima_user_DllExport void bounded_sequence_bool_field( + const std::vector& _bounded_sequence_bool_field) + { + m_bounded_sequence_bool_field = _bounded_sequence_bool_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field + */ + eProsima_user_DllExport void bounded_sequence_bool_field( + std::vector&& _bounded_sequence_bool_field) + { + m_bounded_sequence_bool_field = std::move(_bounded_sequence_bool_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_bool_field + * @return Constant reference to member bounded_sequence_bool_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_bool_field() const + { + return m_bounded_sequence_bool_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_bool_field + * @return Reference to member bounded_sequence_bool_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_bool_field() + { + return m_bounded_sequence_bool_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field + */ + eProsima_user_DllExport void bounded_sequence_string_field( + const std::vector& _bounded_sequence_string_field) + { + m_bounded_sequence_string_field = _bounded_sequence_string_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field + */ + eProsima_user_DllExport void bounded_sequence_string_field( + std::vector&& _bounded_sequence_string_field) + { + m_bounded_sequence_string_field = std::move(_bounded_sequence_string_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_string_field + * @return Constant reference to member bounded_sequence_string_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_string_field() const + { + return m_bounded_sequence_string_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_string_field + * @return Reference to member bounded_sequence_string_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_string_field() + { + return m_bounded_sequence_string_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field + */ + eProsima_user_DllExport void bounded_sequence_enum_field( + const std::vector& _bounded_sequence_enum_field) + { + m_bounded_sequence_enum_field = _bounded_sequence_enum_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field + */ + eProsima_user_DllExport void bounded_sequence_enum_field( + std::vector&& _bounded_sequence_enum_field) + { + m_bounded_sequence_enum_field = std::move(_bounded_sequence_enum_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_enum_field + * @return Constant reference to member bounded_sequence_enum_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_enum_field() const + { + return m_bounded_sequence_enum_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_enum_field + * @return Reference to member bounded_sequence_enum_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_enum_field() + { + return m_bounded_sequence_enum_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field + */ + eProsima_user_DllExport void bounded_sequence_enum2_field( + const std::vector& _bounded_sequence_enum2_field) + { + m_bounded_sequence_enum2_field = _bounded_sequence_enum2_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field + */ + eProsima_user_DllExport void bounded_sequence_enum2_field( + std::vector&& _bounded_sequence_enum2_field) + { + m_bounded_sequence_enum2_field = std::move(_bounded_sequence_enum2_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_enum2_field + * @return Constant reference to member bounded_sequence_enum2_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_enum2_field() const + { + return m_bounded_sequence_enum2_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_enum2_field + * @return Reference to member bounded_sequence_enum2_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_enum2_field() + { + return m_bounded_sequence_enum2_field; + } + + + /*! + * @brief This function copies the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field + */ + eProsima_user_DllExport void bounded_sequence_struct_field( + const std::vector& _bounded_sequence_struct_field) + { + m_bounded_sequence_struct_field = _bounded_sequence_struct_field; + } + + /*! + * @brief This function moves the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field + */ + eProsima_user_DllExport void bounded_sequence_struct_field( + std::vector&& _bounded_sequence_struct_field) + { + m_bounded_sequence_struct_field = std::move(_bounded_sequence_struct_field); + } + + /*! + * @brief This function returns a constant reference to member bounded_sequence_struct_field + * @return Constant reference to member bounded_sequence_struct_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_struct_field() const + { + return m_bounded_sequence_struct_field; + } + + /*! + * @brief This function returns a reference to member bounded_sequence_struct_field + * @return Reference to member bounded_sequence_struct_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_struct_field() + { + return m_bounded_sequence_struct_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field + */ + eProsima_user_DllExport void unbounded_sequence_char_field( + const std::vector& _unbounded_sequence_char_field) + { + m_unbounded_sequence_char_field = _unbounded_sequence_char_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field + */ + eProsima_user_DllExport void unbounded_sequence_char_field( + std::vector&& _unbounded_sequence_char_field) + { + m_unbounded_sequence_char_field = std::move(_unbounded_sequence_char_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_char_field + * @return Constant reference to member unbounded_sequence_char_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_char_field() const + { + return m_unbounded_sequence_char_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_char_field + * @return Reference to member unbounded_sequence_char_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_char_field() + { + return m_unbounded_sequence_char_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport void unbounded_sequence_uint8_field( + const std::vector& _unbounded_sequence_uint8_field) + { + m_unbounded_sequence_uint8_field = _unbounded_sequence_uint8_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport void unbounded_sequence_uint8_field( + std::vector&& _unbounded_sequence_uint8_field) + { + m_unbounded_sequence_uint8_field = std::move(_unbounded_sequence_uint8_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint8_field + * @return Constant reference to member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint8_field() const + { + return m_unbounded_sequence_uint8_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint8_field + * @return Reference to member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field() + { + return m_unbounded_sequence_uint8_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field + */ + eProsima_user_DllExport void unbounded_sequence_int16_field( + const std::vector& _unbounded_sequence_int16_field) + { + m_unbounded_sequence_int16_field = _unbounded_sequence_int16_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field + */ + eProsima_user_DllExport void unbounded_sequence_int16_field( + std::vector&& _unbounded_sequence_int16_field) + { + m_unbounded_sequence_int16_field = std::move(_unbounded_sequence_int16_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int16_field + * @return Constant reference to member unbounded_sequence_int16_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int16_field() const + { + return m_unbounded_sequence_int16_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_int16_field + * @return Reference to member unbounded_sequence_int16_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int16_field() + { + return m_unbounded_sequence_int16_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport void unbounded_sequence_uint16_field( + const std::vector& _unbounded_sequence_uint16_field) + { + m_unbounded_sequence_uint16_field = _unbounded_sequence_uint16_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport void unbounded_sequence_uint16_field( + std::vector&& _unbounded_sequence_uint16_field) + { + m_unbounded_sequence_uint16_field = std::move(_unbounded_sequence_uint16_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint16_field + * @return Constant reference to member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint16_field() const + { + return m_unbounded_sequence_uint16_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint16_field + * @return Reference to member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field() + { + return m_unbounded_sequence_uint16_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field + */ + eProsima_user_DllExport void unbounded_sequence_int32_field( + const std::vector& _unbounded_sequence_int32_field) + { + m_unbounded_sequence_int32_field = _unbounded_sequence_int32_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field + */ + eProsima_user_DllExport void unbounded_sequence_int32_field( + std::vector&& _unbounded_sequence_int32_field) + { + m_unbounded_sequence_int32_field = std::move(_unbounded_sequence_int32_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int32_field + * @return Constant reference to member unbounded_sequence_int32_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int32_field() const + { + return m_unbounded_sequence_int32_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_int32_field + * @return Reference to member unbounded_sequence_int32_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int32_field() + { + return m_unbounded_sequence_int32_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport void unbounded_sequence_uint32_field( + const std::vector& _unbounded_sequence_uint32_field) + { + m_unbounded_sequence_uint32_field = _unbounded_sequence_uint32_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport void unbounded_sequence_uint32_field( + std::vector&& _unbounded_sequence_uint32_field) + { + m_unbounded_sequence_uint32_field = std::move(_unbounded_sequence_uint32_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint32_field + * @return Constant reference to member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint32_field() const + { + return m_unbounded_sequence_uint32_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint32_field + * @return Reference to member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field() + { + return m_unbounded_sequence_uint32_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field + */ + eProsima_user_DllExport void unbounded_sequence_int64_field( + const std::vector& _unbounded_sequence_int64_field) + { + m_unbounded_sequence_int64_field = _unbounded_sequence_int64_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field + */ + eProsima_user_DllExport void unbounded_sequence_int64_field( + std::vector&& _unbounded_sequence_int64_field) + { + m_unbounded_sequence_int64_field = std::move(_unbounded_sequence_int64_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int64_field + * @return Constant reference to member unbounded_sequence_int64_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int64_field() const + { + return m_unbounded_sequence_int64_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_int64_field + * @return Reference to member unbounded_sequence_int64_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int64_field() + { + return m_unbounded_sequence_int64_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport void unbounded_sequence_uint64_field( + const std::vector& _unbounded_sequence_uint64_field) + { + m_unbounded_sequence_uint64_field = _unbounded_sequence_uint64_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport void unbounded_sequence_uint64_field( + std::vector&& _unbounded_sequence_uint64_field) + { + m_unbounded_sequence_uint64_field = std::move(_unbounded_sequence_uint64_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint64_field + * @return Constant reference to member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint64_field() const + { + return m_unbounded_sequence_uint64_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint64_field + * @return Reference to member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field() + { + return m_unbounded_sequence_uint64_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field + */ + eProsima_user_DllExport void unbounded_sequence_float_field( + const std::vector& _unbounded_sequence_float_field) + { + m_unbounded_sequence_float_field = _unbounded_sequence_float_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field + */ + eProsima_user_DllExport void unbounded_sequence_float_field( + std::vector&& _unbounded_sequence_float_field) + { + m_unbounded_sequence_float_field = std::move(_unbounded_sequence_float_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_float_field + * @return Constant reference to member unbounded_sequence_float_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_float_field() const + { + return m_unbounded_sequence_float_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_float_field + * @return Reference to member unbounded_sequence_float_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_float_field() + { + return m_unbounded_sequence_float_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field + */ + eProsima_user_DllExport void unbounded_sequence_double_field( + const std::vector& _unbounded_sequence_double_field) + { + m_unbounded_sequence_double_field = _unbounded_sequence_double_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field + */ + eProsima_user_DllExport void unbounded_sequence_double_field( + std::vector&& _unbounded_sequence_double_field) + { + m_unbounded_sequence_double_field = std::move(_unbounded_sequence_double_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_double_field + * @return Constant reference to member unbounded_sequence_double_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_double_field() const + { + return m_unbounded_sequence_double_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_double_field + * @return Reference to member unbounded_sequence_double_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_double_field() + { + return m_unbounded_sequence_double_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport void unbounded_sequence_long_double_field( + const std::vector& _unbounded_sequence_long_double_field) + { + m_unbounded_sequence_long_double_field = _unbounded_sequence_long_double_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport void unbounded_sequence_long_double_field( + std::vector&& _unbounded_sequence_long_double_field) + { + m_unbounded_sequence_long_double_field = std::move(_unbounded_sequence_long_double_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_long_double_field + * @return Constant reference to member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_long_double_field() const + { + return m_unbounded_sequence_long_double_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_long_double_field + * @return Reference to member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_long_double_field() + { + return m_unbounded_sequence_long_double_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field + */ + eProsima_user_DllExport void unbounded_sequence_bool_field( + const std::vector& _unbounded_sequence_bool_field) + { + m_unbounded_sequence_bool_field = _unbounded_sequence_bool_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field + */ + eProsima_user_DllExport void unbounded_sequence_bool_field( + std::vector&& _unbounded_sequence_bool_field) + { + m_unbounded_sequence_bool_field = std::move(_unbounded_sequence_bool_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_bool_field + * @return Constant reference to member unbounded_sequence_bool_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_bool_field() const + { + return m_unbounded_sequence_bool_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_bool_field + * @return Reference to member unbounded_sequence_bool_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_bool_field() + { + return m_unbounded_sequence_bool_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field + */ + eProsima_user_DllExport void unbounded_sequence_string_field( + const std::vector& _unbounded_sequence_string_field) + { + m_unbounded_sequence_string_field = _unbounded_sequence_string_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field + */ + eProsima_user_DllExport void unbounded_sequence_string_field( + std::vector&& _unbounded_sequence_string_field) + { + m_unbounded_sequence_string_field = std::move(_unbounded_sequence_string_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_string_field + * @return Constant reference to member unbounded_sequence_string_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_string_field() const + { + return m_unbounded_sequence_string_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_string_field + * @return Reference to member unbounded_sequence_string_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_string_field() + { + return m_unbounded_sequence_string_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field + */ + eProsima_user_DllExport void unbounded_sequence_enum_field( + const std::vector& _unbounded_sequence_enum_field) + { + m_unbounded_sequence_enum_field = _unbounded_sequence_enum_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field + */ + eProsima_user_DllExport void unbounded_sequence_enum_field( + std::vector&& _unbounded_sequence_enum_field) + { + m_unbounded_sequence_enum_field = std::move(_unbounded_sequence_enum_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_enum_field + * @return Constant reference to member unbounded_sequence_enum_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_enum_field() const + { + return m_unbounded_sequence_enum_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_enum_field + * @return Reference to member unbounded_sequence_enum_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_enum_field() + { + return m_unbounded_sequence_enum_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport void unbounded_sequence_enum2_field( + const std::vector& _unbounded_sequence_enum2_field) + { + m_unbounded_sequence_enum2_field = _unbounded_sequence_enum2_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport void unbounded_sequence_enum2_field( + std::vector&& _unbounded_sequence_enum2_field) + { + m_unbounded_sequence_enum2_field = std::move(_unbounded_sequence_enum2_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_enum2_field + * @return Constant reference to member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_enum2_field() const + { + return m_unbounded_sequence_enum2_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_enum2_field + * @return Reference to member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field() + { + return m_unbounded_sequence_enum2_field; + } + + + /*! + * @brief This function copies the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field + */ + eProsima_user_DllExport void unbounded_sequence_struct_field( + const std::vector& _unbounded_sequence_struct_field) + { + m_unbounded_sequence_struct_field = _unbounded_sequence_struct_field; + } + + /*! + * @brief This function moves the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field + */ + eProsima_user_DllExport void unbounded_sequence_struct_field( + std::vector&& _unbounded_sequence_struct_field) + { + m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); + } + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_struct_field + * @return Constant reference to member unbounded_sequence_struct_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_struct_field() const + { + return m_unbounded_sequence_struct_field; + } + + /*! + * @brief This function returns a reference to member unbounded_sequence_struct_field + * @return Reference to member unbounded_sequence_struct_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_struct_field() + { + return m_unbounded_sequence_struct_field; + } + + + +private: + + char m_char_field{0}; + uint8_t m_uint8_field{0}; + int16_t m_int16_field{0}; + uint16_t m_uint16_field{0}; + int32_t m_int32_field{0}; + uint32_t m_uint32_field{0}; + int64_t m_int64_field{0}; + uint64_t m_uint64_field{0}; + float m_float_field{0.0}; + double m_double_field{0.0}; + long double m_long_double_field{0.0}; + bool m_bool_field{false}; + std::string m_string_field; + Color m_enum_field{Color::RED}; + Material m_enum2_field{Material::WOOD}; + StructType m_struct_field; + std::array m_array_char_field{0}; + std::array m_array_uint8_field{0}; + std::array m_array_int16_field{0}; + std::array m_array_uint16_field{0}; + std::array m_array_int32_field{0}; + std::array m_array_uint32_field{0}; + std::array m_array_int64_field{0}; + std::array m_array_uint64_field{0}; + std::array m_array_float_field{0.0}; + std::array m_array_double_field{0.0}; + std::array m_array_long_double_field{0.0}; + std::array m_array_bool_field{false}; + std::array m_array_string_field; + std::array m_array_enum_field{Color::RED}; + std::array m_array_enum2_field{Material::WOOD}; + std::array m_array_struct_field; + std::vector m_bounded_sequence_char_field; + std::vector m_bounded_sequence_uint8_field; + std::vector m_bounded_sequence_int16_field; + std::vector m_bounded_sequence_uint16_field; + std::vector m_bounded_sequence_int32_field; + std::vector m_bounded_sequence_uint32_field; + std::vector m_bounded_sequence_int64_field; + std::vector m_bounded_sequence_uint64_field; + std::vector m_bounded_sequence_float_field; + std::vector m_bounded_sequence_double_field; + std::vector m_bounded_sequence_long_double_field; + std::vector m_bounded_sequence_bool_field; + std::vector m_bounded_sequence_string_field; + std::vector m_bounded_sequence_enum_field; + std::vector m_bounded_sequence_enum2_field; + std::vector m_bounded_sequence_struct_field; + std::vector m_unbounded_sequence_char_field; + std::vector m_unbounded_sequence_uint8_field; + std::vector m_unbounded_sequence_int16_field; + std::vector m_unbounded_sequence_uint16_field; + std::vector m_unbounded_sequence_int32_field; + std::vector m_unbounded_sequence_uint32_field; + std::vector m_unbounded_sequence_int64_field; + std::vector m_unbounded_sequence_uint64_field; + std::vector m_unbounded_sequence_float_field; + std::vector m_unbounded_sequence_double_field; + std::vector m_unbounded_sequence_long_double_field; + std::vector m_unbounded_sequence_bool_field; + std::vector m_unbounded_sequence_string_field; + std::vector m_unbounded_sequence_enum_field; + std::vector m_unbounded_sequence_enum2_field; + std::vector m_unbounded_sequence_struct_field; + +}; + +#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_HPP_ + + diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp index f1ae8c42f15..c0276205e62 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp @@ -22,12 +22,12 @@ #ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_HPP_ #define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_HPP_ -#include "ContentFilterTestType.h" +#include "ContentFilterTestType.hpp" constexpr uint32_t StructType_max_cdr_typesize {344UL}; constexpr uint32_t StructType_max_key_cdr_typesize {0UL}; -constexpr uint32_t ContentFilterTestType_max_cdr_typesize {73360UL}; +constexpr uint32_t ContentFilterTestType_max_cdr_typesize {6248UL}; constexpr uint32_t ContentFilterTestType_max_key_cdr_typesize {0UL}; @@ -39,20 +39,12 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StructType& data); - - - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ContentFilterTestType& data); diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp index 6e0b9053b9d..22665d4a663 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -226,12 +224,6 @@ void serialize_key( - - - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx index c4bd34e1232..f33c4acd920 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "ContentFilterTestTypePubSubTypes.h" +#include #include -#include "ContentFilterTestTypePubSubTypes.h" #include "ContentFilterTestTypeCdrAux.hpp" +#include "ContentFilterTestTypeTypeObjectSupport.hpp" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - StructTypePubSubType::StructTypePubSubType() { setName("StructType"); @@ -219,11 +219,10 @@ bool StructTypePubSubType::getKey( return true; } - - - - - +void StructTypePubSubType::register_type_object_representation() const +{ + register_ContentFilterTestType_type_objects(); +} @@ -415,3 +414,11 @@ bool ContentFilterTestTypePubSubType::getKey( return true; } +void ContentFilterTestTypePubSubType::register_type_object_representation() const +{ + register_ContentFilterTestType_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "ContentFilterTestTypeCdrAux.ipp" diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h index 776f184b73e..adac04295fb 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h @@ -27,9 +27,9 @@ #include #include #include -#include +#include -#include "ContentFilterTestType.h" +#include "ContentFilterTestType.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type StructType defined by the user in the IDL file. * @ingroup ContentFilterTestType @@ -90,6 +88,9 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -130,12 +131,6 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType - - - - - - /*! * @brief This class represents the TopicDataType of the type ContentFilterTestType defined by the user in the IDL file. * @ingroup ContentFilterTestType @@ -186,6 +181,9 @@ class ContentFilterTestTypePubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx deleted file mode 100644 index c9ec87ccb80..00000000000 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx +++ /dev/null @@ -1,3610 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ContentFilterTestTypeTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "ContentFilterTestType.h" -#include "ContentFilterTestTypeTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerContentFilterTestTypeTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("Color", GetColorIdentifier(true), - GetColorObject(true)); - factory->add_type_object("Color", GetColorIdentifier(false), - GetColorObject(false)); - - - factory->add_type_object("Material", GetMaterialIdentifier(true), - GetMaterialObject(true)); - factory->add_type_object("Material", GetMaterialIdentifier(false), - GetMaterialObject(false)); - - - factory->add_type_object("StructType", GetStructTypeIdentifier(true), - GetStructTypeObject(true)); - factory->add_type_object("StructType", GetStructTypeIdentifier(false), - GetStructTypeObject(false)); - - - - - factory->add_type_object("ContentFilterTestType", GetContentFilterTestTypeIdentifier(true), - GetContentFilterTestTypeObject(true)); - factory->add_type_object("ContentFilterTestType", GetContentFilterTestTypeIdentifier(false), - GetContentFilterTestTypeObject(false)); - - }); -} - -const TypeIdentifier* GetColorIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Color", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetColorObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("Color", complete); -} - -const TypeObject* GetColorObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Color", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteColorObject(); - } - // else - return GetMinimalColorObject(); -} - -const TypeObject* GetMinimalColorObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Color", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_RED; - mel_RED.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_RED.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_RED.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_RED.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_RED.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_RED.common().flags().IS_KEY(false); // Doesn't apply - mel_RED.common().flags().IS_DEFAULT(false); - mel_RED.common().value(value++); - MD5 RED_hash("RED"); - for(int i = 0; i < 4; ++i) - { - mel_RED.detail().name_hash()[i] = RED_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_RED); - - MinimalEnumeratedLiteral mel_GREEN; - mel_GREEN.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_GREEN.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_GREEN.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_GREEN.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_GREEN.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_GREEN.common().flags().IS_KEY(false); // Doesn't apply - mel_GREEN.common().flags().IS_DEFAULT(false); - mel_GREEN.common().value(value++); - MD5 GREEN_hash("GREEN"); - for(int i = 0; i < 4; ++i) - { - mel_GREEN.detail().name_hash()[i] = GREEN_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_GREEN); - - MinimalEnumeratedLiteral mel_BLUE; - mel_BLUE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_BLUE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_BLUE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_BLUE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_BLUE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_BLUE.common().flags().IS_KEY(false); // Doesn't apply - mel_BLUE.common().flags().IS_DEFAULT(false); - mel_BLUE.common().value(value++); - MD5 BLUE_hash("BLUE"); - for(int i = 0; i < 4; ++i) - { - mel_BLUE.detail().name_hash()[i] = BLUE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_BLUE); - - MinimalEnumeratedLiteral mel_YELLOW; - mel_YELLOW.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_YELLOW.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_YELLOW.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_YELLOW.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_YELLOW.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_YELLOW.common().flags().IS_KEY(false); // Doesn't apply - mel_YELLOW.common().flags().IS_DEFAULT(false); - mel_YELLOW.common().value(value++); - MD5 YELLOW_hash("YELLOW"); - for(int i = 0; i < 4; ++i) - { - mel_YELLOW.detail().name_hash()[i] = YELLOW_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_YELLOW); - - MinimalEnumeratedLiteral mel_MAGENTA; - mel_MAGENTA.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_MAGENTA.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_MAGENTA.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_MAGENTA.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_MAGENTA.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_MAGENTA.common().flags().IS_KEY(false); // Doesn't apply - mel_MAGENTA.common().flags().IS_DEFAULT(false); - mel_MAGENTA.common().value(value++); - MD5 MAGENTA_hash("MAGENTA"); - for(int i = 0; i < 4; ++i) - { - mel_MAGENTA.detail().name_hash()[i] = MAGENTA_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_MAGENTA); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Color", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("Color", false); -} - -const TypeObject* GetCompleteColorObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Color", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("Color"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_RED; - cel_RED.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_RED.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_RED.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_RED.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_RED.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_RED.common().flags().IS_KEY(false); // Doesn't apply - cel_RED.common().flags().IS_DEFAULT(false); - cel_RED.common().value(value++); - cel_RED.detail().name("RED"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_RED); - - CompleteEnumeratedLiteral cel_GREEN; - cel_GREEN.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_GREEN.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_GREEN.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_GREEN.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_GREEN.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_GREEN.common().flags().IS_KEY(false); // Doesn't apply - cel_GREEN.common().flags().IS_DEFAULT(false); - cel_GREEN.common().value(value++); - cel_GREEN.detail().name("GREEN"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_GREEN); - - CompleteEnumeratedLiteral cel_BLUE; - cel_BLUE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_BLUE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_BLUE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_BLUE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_BLUE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_BLUE.common().flags().IS_KEY(false); // Doesn't apply - cel_BLUE.common().flags().IS_DEFAULT(false); - cel_BLUE.common().value(value++); - cel_BLUE.detail().name("BLUE"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_BLUE); - - CompleteEnumeratedLiteral cel_YELLOW; - cel_YELLOW.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_YELLOW.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_YELLOW.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_YELLOW.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_YELLOW.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_YELLOW.common().flags().IS_KEY(false); // Doesn't apply - cel_YELLOW.common().flags().IS_DEFAULT(false); - cel_YELLOW.common().value(value++); - cel_YELLOW.detail().name("YELLOW"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_YELLOW); - - CompleteEnumeratedLiteral cel_MAGENTA; - cel_MAGENTA.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_MAGENTA.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_MAGENTA.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_MAGENTA.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_MAGENTA.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_MAGENTA.common().flags().IS_KEY(false); // Doesn't apply - cel_MAGENTA.common().flags().IS_DEFAULT(false); - cel_MAGENTA.common().value(value++); - cel_MAGENTA.detail().name("MAGENTA"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_MAGENTA); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Color", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("Color", true); -} - -const TypeIdentifier* GetMaterialIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Material", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMaterialObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("Material", complete); -} - -const TypeObject* GetMaterialObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Material", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMaterialObject(); - } - // else - return GetMinimalMaterialObject(); -} - -const TypeObject* GetMinimalMaterialObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Material", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_WOOD; - mel_WOOD.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_WOOD.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_WOOD.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_WOOD.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_WOOD.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_WOOD.common().flags().IS_KEY(false); // Doesn't apply - mel_WOOD.common().flags().IS_DEFAULT(false); - mel_WOOD.common().value(value++); - MD5 WOOD_hash("WOOD"); - for(int i = 0; i < 4; ++i) - { - mel_WOOD.detail().name_hash()[i] = WOOD_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_WOOD); - - MinimalEnumeratedLiteral mel_PLASTIC; - mel_PLASTIC.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_PLASTIC.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_PLASTIC.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_PLASTIC.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_PLASTIC.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_PLASTIC.common().flags().IS_KEY(false); // Doesn't apply - mel_PLASTIC.common().flags().IS_DEFAULT(false); - mel_PLASTIC.common().value(value++); - MD5 PLASTIC_hash("PLASTIC"); - for(int i = 0; i < 4; ++i) - { - mel_PLASTIC.detail().name_hash()[i] = PLASTIC_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_PLASTIC); - - MinimalEnumeratedLiteral mel_METAL; - mel_METAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_METAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_METAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_METAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_METAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_METAL.common().flags().IS_KEY(false); // Doesn't apply - mel_METAL.common().flags().IS_DEFAULT(false); - mel_METAL.common().value(value++); - MD5 METAL_hash("METAL"); - for(int i = 0; i < 4; ++i) - { - mel_METAL.detail().name_hash()[i] = METAL_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_METAL); - - MinimalEnumeratedLiteral mel_CONCRETE; - mel_CONCRETE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_CONCRETE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_CONCRETE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_CONCRETE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_CONCRETE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_CONCRETE.common().flags().IS_KEY(false); // Doesn't apply - mel_CONCRETE.common().flags().IS_DEFAULT(false); - mel_CONCRETE.common().value(value++); - MD5 CONCRETE_hash("CONCRETE"); - for(int i = 0; i < 4; ++i) - { - mel_CONCRETE.detail().name_hash()[i] = CONCRETE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_CONCRETE); - - MinimalEnumeratedLiteral mel_STONE; - mel_STONE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_STONE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_STONE.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_STONE.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_STONE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_STONE.common().flags().IS_KEY(false); // Doesn't apply - mel_STONE.common().flags().IS_DEFAULT(false); - mel_STONE.common().value(value++); - MD5 STONE_hash("STONE"); - for(int i = 0; i < 4; ++i) - { - mel_STONE.detail().name_hash()[i] = STONE_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_STONE); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Material", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("Material", false); -} - -const TypeObject* GetCompleteMaterialObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Material", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("Material"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_WOOD; - cel_WOOD.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_WOOD.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_WOOD.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_WOOD.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_WOOD.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_WOOD.common().flags().IS_KEY(false); // Doesn't apply - cel_WOOD.common().flags().IS_DEFAULT(false); - cel_WOOD.common().value(value++); - cel_WOOD.detail().name("WOOD"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_WOOD); - - CompleteEnumeratedLiteral cel_PLASTIC; - cel_PLASTIC.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_PLASTIC.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_PLASTIC.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_PLASTIC.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_PLASTIC.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_PLASTIC.common().flags().IS_KEY(false); // Doesn't apply - cel_PLASTIC.common().flags().IS_DEFAULT(false); - cel_PLASTIC.common().value(value++); - cel_PLASTIC.detail().name("PLASTIC"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_PLASTIC); - - CompleteEnumeratedLiteral cel_METAL; - cel_METAL.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_METAL.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_METAL.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_METAL.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_METAL.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_METAL.common().flags().IS_KEY(false); // Doesn't apply - cel_METAL.common().flags().IS_DEFAULT(false); - cel_METAL.common().value(value++); - cel_METAL.detail().name("METAL"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_METAL); - - CompleteEnumeratedLiteral cel_CONCRETE; - cel_CONCRETE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_CONCRETE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_CONCRETE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_CONCRETE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_CONCRETE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_CONCRETE.common().flags().IS_KEY(false); // Doesn't apply - cel_CONCRETE.common().flags().IS_DEFAULT(false); - cel_CONCRETE.common().value(value++); - cel_CONCRETE.detail().name("CONCRETE"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_CONCRETE); - - CompleteEnumeratedLiteral cel_STONE; - cel_STONE.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_STONE.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_STONE.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_STONE.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_STONE.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_STONE.common().flags().IS_KEY(false); // Doesn't apply - cel_STONE.common().flags().IS_DEFAULT(false); - cel_STONE.common().value(value++); - cel_STONE.detail().name("STONE"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_STONE); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Material", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("Material", true); -} - - - -const TypeIdentifier* GetStructTypeIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructType", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStructTypeObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StructType", complete); -} - -const TypeObject* GetStructTypeObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructType", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStructTypeObject(); - } - //else - return GetMinimalStructTypeObject(); -} - -const TypeObject* GetMinimalStructTypeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructType", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_char_field; - mst_char_field.common().member_id(memberId++); - mst_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_char_field.common().member_flags().IS_OPTIONAL(false); - mst_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_char_field.common().member_flags().IS_KEY(false); - mst_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - MD5 char_field_hash("char_field"); - for(int i = 0; i < 4; ++i) - { - mst_char_field.detail().name_hash()[i] = char_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_char_field); - - MinimalStructMember mst_uint8_field; - mst_uint8_field.common().member_id(memberId++); - mst_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint8_field.common().member_flags().IS_OPTIONAL(false); - mst_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint8_field.common().member_flags().IS_KEY(false); - mst_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 uint8_field_hash("uint8_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint8_field.detail().name_hash()[i] = uint8_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint8_field); - - MinimalStructMember mst_int16_field; - mst_int16_field.common().member_id(memberId++); - mst_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int16_field.common().member_flags().IS_OPTIONAL(false); - mst_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int16_field.common().member_flags().IS_KEY(false); - mst_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - MD5 int16_field_hash("int16_field"); - for(int i = 0; i < 4; ++i) - { - mst_int16_field.detail().name_hash()[i] = int16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int16_field); - - MinimalStructMember mst_uint16_field; - mst_uint16_field.common().member_id(memberId++); - mst_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint16_field.common().member_flags().IS_OPTIONAL(false); - mst_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint16_field.common().member_flags().IS_KEY(false); - mst_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 uint16_field_hash("uint16_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint16_field.detail().name_hash()[i] = uint16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint16_field); - - MinimalStructMember mst_int32_field; - mst_int32_field.common().member_id(memberId++); - mst_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int32_field.common().member_flags().IS_OPTIONAL(false); - mst_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int32_field.common().member_flags().IS_KEY(false); - mst_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 int32_field_hash("int32_field"); - for(int i = 0; i < 4; ++i) - { - mst_int32_field.detail().name_hash()[i] = int32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int32_field); - - MinimalStructMember mst_uint32_field; - mst_uint32_field.common().member_id(memberId++); - mst_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint32_field.common().member_flags().IS_OPTIONAL(false); - mst_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint32_field.common().member_flags().IS_KEY(false); - mst_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 uint32_field_hash("uint32_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint32_field.detail().name_hash()[i] = uint32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint32_field); - - MinimalStructMember mst_int64_field; - mst_int64_field.common().member_id(memberId++); - mst_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int64_field.common().member_flags().IS_OPTIONAL(false); - mst_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int64_field.common().member_flags().IS_KEY(false); - mst_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 int64_field_hash("int64_field"); - for(int i = 0; i < 4; ++i) - { - mst_int64_field.detail().name_hash()[i] = int64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int64_field); - - MinimalStructMember mst_uint64_field; - mst_uint64_field.common().member_id(memberId++); - mst_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint64_field.common().member_flags().IS_OPTIONAL(false); - mst_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint64_field.common().member_flags().IS_KEY(false); - mst_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - MD5 uint64_field_hash("uint64_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint64_field.detail().name_hash()[i] = uint64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint64_field); - - MinimalStructMember mst_float_field; - mst_float_field.common().member_id(memberId++); - mst_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_float_field.common().member_flags().IS_OPTIONAL(false); - mst_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_float_field.common().member_flags().IS_KEY(false); - mst_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - MD5 float_field_hash("float_field"); - for(int i = 0; i < 4; ++i) - { - mst_float_field.detail().name_hash()[i] = float_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_float_field); - - MinimalStructMember mst_double_field; - mst_double_field.common().member_id(memberId++); - mst_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_double_field.common().member_flags().IS_OPTIONAL(false); - mst_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_double_field.common().member_flags().IS_KEY(false); - mst_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - MD5 double_field_hash("double_field"); - for(int i = 0; i < 4; ++i) - { - mst_double_field.detail().name_hash()[i] = double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_double_field); - - MinimalStructMember mst_long_double_field; - mst_long_double_field.common().member_id(memberId++); - mst_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_long_double_field.common().member_flags().IS_OPTIONAL(false); - mst_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_long_double_field.common().member_flags().IS_KEY(false); - mst_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - MD5 long_double_field_hash("long_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_long_double_field.detail().name_hash()[i] = long_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_long_double_field); - - MinimalStructMember mst_bool_field; - mst_bool_field.common().member_id(memberId++); - mst_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bool_field.common().member_flags().IS_OPTIONAL(false); - mst_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bool_field.common().member_flags().IS_KEY(false); - mst_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 bool_field_hash("bool_field"); - for(int i = 0; i < 4; ++i) - { - mst_bool_field.detail().name_hash()[i] = bool_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bool_field); - - MinimalStructMember mst_string_field; - mst_string_field.common().member_id(memberId++); - mst_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_string_field.common().member_flags().IS_OPTIONAL(false); - mst_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_string_field.common().member_flags().IS_KEY(false); - mst_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 string_field_hash("string_field"); - for(int i = 0; i < 4; ++i) - { - mst_string_field.detail().name_hash()[i] = string_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_string_field); - - MinimalStructMember mst_enum_field; - mst_enum_field.common().member_id(memberId++); - mst_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_enum_field.common().member_flags().IS_OPTIONAL(false); - mst_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_enum_field.common().member_flags().IS_KEY(false); - mst_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_enum_field.common().member_type_id(*GetColorIdentifier(false)); - - MD5 enum_field_hash("enum_field"); - for(int i = 0; i < 4; ++i) - { - mst_enum_field.detail().name_hash()[i] = enum_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_enum_field); - - MinimalStructMember mst_enum2_field; - mst_enum2_field.common().member_id(memberId++); - mst_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_enum2_field.common().member_flags().IS_OPTIONAL(false); - mst_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_enum2_field.common().member_flags().IS_KEY(false); - mst_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_enum2_field.common().member_type_id(*GetMaterialIdentifier(false)); - - MD5 enum2_field_hash("enum2_field"); - for(int i = 0; i < 4; ++i) - { - mst_enum2_field.detail().name_hash()[i] = enum2_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_enum2_field); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructType", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructType", false); -} - -const TypeObject* GetCompleteStructTypeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructType", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_char_field; - cst_char_field.common().member_id(memberId++); - cst_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_char_field.common().member_flags().IS_OPTIONAL(false); - cst_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_char_field.common().member_flags().IS_KEY(false); - cst_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - cst_char_field.detail().name("char_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_char_field); - - CompleteStructMember cst_uint8_field; - cst_uint8_field.common().member_id(memberId++); - cst_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint8_field.common().member_flags().IS_OPTIONAL(false); - cst_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint8_field.common().member_flags().IS_KEY(false); - cst_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_uint8_field.detail().name("uint8_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint8_field); - - CompleteStructMember cst_int16_field; - cst_int16_field.common().member_id(memberId++); - cst_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int16_field.common().member_flags().IS_OPTIONAL(false); - cst_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int16_field.common().member_flags().IS_KEY(false); - cst_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - cst_int16_field.detail().name("int16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int16_field); - - CompleteStructMember cst_uint16_field; - cst_uint16_field.common().member_id(memberId++); - cst_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint16_field.common().member_flags().IS_OPTIONAL(false); - cst_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint16_field.common().member_flags().IS_KEY(false); - cst_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_uint16_field.detail().name("uint16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint16_field); - - CompleteStructMember cst_int32_field; - cst_int32_field.common().member_id(memberId++); - cst_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int32_field.common().member_flags().IS_OPTIONAL(false); - cst_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int32_field.common().member_flags().IS_KEY(false); - cst_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_int32_field.detail().name("int32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int32_field); - - CompleteStructMember cst_uint32_field; - cst_uint32_field.common().member_id(memberId++); - cst_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint32_field.common().member_flags().IS_OPTIONAL(false); - cst_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint32_field.common().member_flags().IS_KEY(false); - cst_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_uint32_field.detail().name("uint32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint32_field); - - CompleteStructMember cst_int64_field; - cst_int64_field.common().member_id(memberId++); - cst_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int64_field.common().member_flags().IS_OPTIONAL(false); - cst_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int64_field.common().member_flags().IS_KEY(false); - cst_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_int64_field.detail().name("int64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int64_field); - - CompleteStructMember cst_uint64_field; - cst_uint64_field.common().member_id(memberId++); - cst_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint64_field.common().member_flags().IS_OPTIONAL(false); - cst_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint64_field.common().member_flags().IS_KEY(false); - cst_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - cst_uint64_field.detail().name("uint64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint64_field); - - CompleteStructMember cst_float_field; - cst_float_field.common().member_id(memberId++); - cst_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_float_field.common().member_flags().IS_OPTIONAL(false); - cst_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_float_field.common().member_flags().IS_KEY(false); - cst_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - cst_float_field.detail().name("float_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_float_field); - - CompleteStructMember cst_double_field; - cst_double_field.common().member_id(memberId++); - cst_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_double_field.common().member_flags().IS_OPTIONAL(false); - cst_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_double_field.common().member_flags().IS_KEY(false); - cst_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - cst_double_field.detail().name("double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_double_field); - - CompleteStructMember cst_long_double_field; - cst_long_double_field.common().member_id(memberId++); - cst_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_long_double_field.common().member_flags().IS_OPTIONAL(false); - cst_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_long_double_field.common().member_flags().IS_KEY(false); - cst_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - cst_long_double_field.detail().name("long_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_long_double_field); - - CompleteStructMember cst_bool_field; - cst_bool_field.common().member_id(memberId++); - cst_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bool_field.common().member_flags().IS_OPTIONAL(false); - cst_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bool_field.common().member_flags().IS_KEY(false); - cst_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_bool_field.detail().name("bool_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bool_field); - - CompleteStructMember cst_string_field; - cst_string_field.common().member_id(memberId++); - cst_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_string_field.common().member_flags().IS_OPTIONAL(false); - cst_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_string_field.common().member_flags().IS_KEY(false); - cst_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_string_field.detail().name("string_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_string_field); - - CompleteStructMember cst_enum_field; - cst_enum_field.common().member_id(memberId++); - cst_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_enum_field.common().member_flags().IS_OPTIONAL(false); - cst_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_enum_field.common().member_flags().IS_KEY(false); - cst_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_enum_field.common().member_type_id(*GetColorIdentifier(true)); - - cst_enum_field.detail().name("enum_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_enum_field); - - CompleteStructMember cst_enum2_field; - cst_enum2_field.common().member_id(memberId++); - cst_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_enum2_field.common().member_flags().IS_OPTIONAL(false); - cst_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_enum2_field.common().member_flags().IS_KEY(false); - cst_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_enum2_field.common().member_type_id(*GetMaterialIdentifier(true)); - - cst_enum2_field.detail().name("enum2_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_enum2_field); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StructType"); - // TODO inheritance - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetnestedIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("nested")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_BOOLEAN); - paramValue.from_string("true"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); - } - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructType", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructType", true); -} - - - - - - - - - -const TypeIdentifier* GetContentFilterTestTypeIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ContentFilterTestType", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetContentFilterTestTypeObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ContentFilterTestType", complete); -} - -const TypeObject* GetContentFilterTestTypeObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ContentFilterTestType", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteContentFilterTestTypeObject(); - } - //else - return GetMinimalContentFilterTestTypeObject(); -} - -const TypeObject* GetMinimalContentFilterTestTypeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ContentFilterTestType", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_char_field; - mst_char_field.common().member_id(memberId++); - mst_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_char_field.common().member_flags().IS_OPTIONAL(false); - mst_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_char_field.common().member_flags().IS_KEY(false); - mst_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - MD5 char_field_hash("char_field"); - for(int i = 0; i < 4; ++i) - { - mst_char_field.detail().name_hash()[i] = char_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_char_field); - - MinimalStructMember mst_uint8_field; - mst_uint8_field.common().member_id(memberId++); - mst_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint8_field.common().member_flags().IS_OPTIONAL(false); - mst_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint8_field.common().member_flags().IS_KEY(false); - mst_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 uint8_field_hash("uint8_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint8_field.detail().name_hash()[i] = uint8_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint8_field); - - MinimalStructMember mst_int16_field; - mst_int16_field.common().member_id(memberId++); - mst_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int16_field.common().member_flags().IS_OPTIONAL(false); - mst_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int16_field.common().member_flags().IS_KEY(false); - mst_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - MD5 int16_field_hash("int16_field"); - for(int i = 0; i < 4; ++i) - { - mst_int16_field.detail().name_hash()[i] = int16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int16_field); - - MinimalStructMember mst_uint16_field; - mst_uint16_field.common().member_id(memberId++); - mst_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint16_field.common().member_flags().IS_OPTIONAL(false); - mst_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint16_field.common().member_flags().IS_KEY(false); - mst_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 uint16_field_hash("uint16_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint16_field.detail().name_hash()[i] = uint16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint16_field); - - MinimalStructMember mst_int32_field; - mst_int32_field.common().member_id(memberId++); - mst_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int32_field.common().member_flags().IS_OPTIONAL(false); - mst_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int32_field.common().member_flags().IS_KEY(false); - mst_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 int32_field_hash("int32_field"); - for(int i = 0; i < 4; ++i) - { - mst_int32_field.detail().name_hash()[i] = int32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int32_field); - - MinimalStructMember mst_uint32_field; - mst_uint32_field.common().member_id(memberId++); - mst_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint32_field.common().member_flags().IS_OPTIONAL(false); - mst_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint32_field.common().member_flags().IS_KEY(false); - mst_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 uint32_field_hash("uint32_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint32_field.detail().name_hash()[i] = uint32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint32_field); - - MinimalStructMember mst_int64_field; - mst_int64_field.common().member_id(memberId++); - mst_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int64_field.common().member_flags().IS_OPTIONAL(false); - mst_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int64_field.common().member_flags().IS_KEY(false); - mst_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 int64_field_hash("int64_field"); - for(int i = 0; i < 4; ++i) - { - mst_int64_field.detail().name_hash()[i] = int64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int64_field); - - MinimalStructMember mst_uint64_field; - mst_uint64_field.common().member_id(memberId++); - mst_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint64_field.common().member_flags().IS_OPTIONAL(false); - mst_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint64_field.common().member_flags().IS_KEY(false); - mst_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - MD5 uint64_field_hash("uint64_field"); - for(int i = 0; i < 4; ++i) - { - mst_uint64_field.detail().name_hash()[i] = uint64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint64_field); - - MinimalStructMember mst_float_field; - mst_float_field.common().member_id(memberId++); - mst_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_float_field.common().member_flags().IS_OPTIONAL(false); - mst_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_float_field.common().member_flags().IS_KEY(false); - mst_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - MD5 float_field_hash("float_field"); - for(int i = 0; i < 4; ++i) - { - mst_float_field.detail().name_hash()[i] = float_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_float_field); - - MinimalStructMember mst_double_field; - mst_double_field.common().member_id(memberId++); - mst_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_double_field.common().member_flags().IS_OPTIONAL(false); - mst_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_double_field.common().member_flags().IS_KEY(false); - mst_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - MD5 double_field_hash("double_field"); - for(int i = 0; i < 4; ++i) - { - mst_double_field.detail().name_hash()[i] = double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_double_field); - - MinimalStructMember mst_long_double_field; - mst_long_double_field.common().member_id(memberId++); - mst_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_long_double_field.common().member_flags().IS_OPTIONAL(false); - mst_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_long_double_field.common().member_flags().IS_KEY(false); - mst_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - MD5 long_double_field_hash("long_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_long_double_field.detail().name_hash()[i] = long_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_long_double_field); - - MinimalStructMember mst_bool_field; - mst_bool_field.common().member_id(memberId++); - mst_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bool_field.common().member_flags().IS_OPTIONAL(false); - mst_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bool_field.common().member_flags().IS_KEY(false); - mst_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 bool_field_hash("bool_field"); - for(int i = 0; i < 4; ++i) - { - mst_bool_field.detail().name_hash()[i] = bool_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bool_field); - - MinimalStructMember mst_string_field; - mst_string_field.common().member_id(memberId++); - mst_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_string_field.common().member_flags().IS_OPTIONAL(false); - mst_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_string_field.common().member_flags().IS_KEY(false); - mst_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 string_field_hash("string_field"); - for(int i = 0; i < 4; ++i) - { - mst_string_field.detail().name_hash()[i] = string_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_string_field); - - MinimalStructMember mst_enum_field; - mst_enum_field.common().member_id(memberId++); - mst_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_enum_field.common().member_flags().IS_OPTIONAL(false); - mst_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_enum_field.common().member_flags().IS_KEY(false); - mst_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_enum_field.common().member_type_id(*GetColorIdentifier(false)); - - MD5 enum_field_hash("enum_field"); - for(int i = 0; i < 4; ++i) - { - mst_enum_field.detail().name_hash()[i] = enum_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_enum_field); - - MinimalStructMember mst_enum2_field; - mst_enum2_field.common().member_id(memberId++); - mst_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_enum2_field.common().member_flags().IS_OPTIONAL(false); - mst_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_enum2_field.common().member_flags().IS_KEY(false); - mst_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_enum2_field.common().member_type_id(*GetMaterialIdentifier(false)); - - MD5 enum2_field_hash("enum2_field"); - for(int i = 0; i < 4; ++i) - { - mst_enum2_field.detail().name_hash()[i] = enum2_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_enum2_field); - - MinimalStructMember mst_struct_field; - mst_struct_field.common().member_id(memberId++); - mst_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_struct_field.common().member_flags().IS_OPTIONAL(false); - mst_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_struct_field.common().member_flags().IS_KEY(false); - mst_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_struct_field.common().member_type_id(*GetStructTypeIdentifier(false)); - - MD5 struct_field_hash("struct_field"); - for(int i = 0; i < 4; ++i) - { - mst_struct_field.detail().name_hash()[i] = struct_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_struct_field); - - MinimalStructMember mst_array_char_field; - mst_array_char_field.common().member_id(memberId++); - mst_array_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_char_field.common().member_flags().IS_OPTIONAL(false); - mst_array_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_char_field.common().member_flags().IS_KEY(false); - mst_array_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {max_array_size}, false)); - - MD5 array_char_field_hash("array_char_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_char_field.detail().name_hash()[i] = array_char_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_char_field); - - MinimalStructMember mst_array_uint8_field; - mst_array_uint8_field.common().member_id(memberId++); - mst_array_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_uint8_field.common().member_flags().IS_OPTIONAL(false); - mst_array_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_uint8_field.common().member_flags().IS_KEY(false); - mst_array_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {max_array_size}, false)); - - MD5 array_uint8_field_hash("array_uint8_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_uint8_field.detail().name_hash()[i] = array_uint8_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_uint8_field); - - MinimalStructMember mst_array_int16_field; - mst_array_int16_field.common().member_id(memberId++); - mst_array_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_int16_field.common().member_flags().IS_OPTIONAL(false); - mst_array_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_int16_field.common().member_flags().IS_KEY(false); - mst_array_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {max_array_size}, false)); - - MD5 array_int16_field_hash("array_int16_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_int16_field.detail().name_hash()[i] = array_int16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_int16_field); - - MinimalStructMember mst_array_uint16_field; - mst_array_uint16_field.common().member_id(memberId++); - mst_array_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_uint16_field.common().member_flags().IS_OPTIONAL(false); - mst_array_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_uint16_field.common().member_flags().IS_KEY(false); - mst_array_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {max_array_size}, false)); - - MD5 array_uint16_field_hash("array_uint16_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_uint16_field.detail().name_hash()[i] = array_uint16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_uint16_field); - - MinimalStructMember mst_array_int32_field; - mst_array_int32_field.common().member_id(memberId++); - mst_array_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_int32_field.common().member_flags().IS_OPTIONAL(false); - mst_array_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_int32_field.common().member_flags().IS_KEY(false); - mst_array_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {max_array_size}, false)); - - MD5 array_int32_field_hash("array_int32_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_int32_field.detail().name_hash()[i] = array_int32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_int32_field); - - MinimalStructMember mst_array_uint32_field; - mst_array_uint32_field.common().member_id(memberId++); - mst_array_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_uint32_field.common().member_flags().IS_OPTIONAL(false); - mst_array_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_uint32_field.common().member_flags().IS_KEY(false); - mst_array_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {max_array_size}, false)); - - MD5 array_uint32_field_hash("array_uint32_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_uint32_field.detail().name_hash()[i] = array_uint32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_uint32_field); - - MinimalStructMember mst_array_int64_field; - mst_array_int64_field.common().member_id(memberId++); - mst_array_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_int64_field.common().member_flags().IS_OPTIONAL(false); - mst_array_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_int64_field.common().member_flags().IS_KEY(false); - mst_array_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {max_array_size}, false)); - - MD5 array_int64_field_hash("array_int64_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_int64_field.detail().name_hash()[i] = array_int64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_int64_field); - - MinimalStructMember mst_array_uint64_field; - mst_array_uint64_field.common().member_id(memberId++); - mst_array_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_uint64_field.common().member_flags().IS_OPTIONAL(false); - mst_array_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_uint64_field.common().member_flags().IS_KEY(false); - mst_array_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {max_array_size}, false)); - - MD5 array_uint64_field_hash("array_uint64_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_uint64_field.detail().name_hash()[i] = array_uint64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_uint64_field); - - MinimalStructMember mst_array_float_field; - mst_array_float_field.common().member_id(memberId++); - mst_array_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_float_field.common().member_flags().IS_OPTIONAL(false); - mst_array_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_float_field.common().member_flags().IS_KEY(false); - mst_array_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {max_array_size}, false)); - - MD5 array_float_field_hash("array_float_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_float_field.detail().name_hash()[i] = array_float_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_float_field); - - MinimalStructMember mst_array_double_field; - mst_array_double_field.common().member_id(memberId++); - mst_array_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_double_field.common().member_flags().IS_OPTIONAL(false); - mst_array_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_double_field.common().member_flags().IS_KEY(false); - mst_array_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {max_array_size}, false)); - - MD5 array_double_field_hash("array_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_double_field.detail().name_hash()[i] = array_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_double_field); - - MinimalStructMember mst_array_long_double_field; - mst_array_long_double_field.common().member_id(memberId++); - mst_array_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_long_double_field.common().member_flags().IS_OPTIONAL(false); - mst_array_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_long_double_field.common().member_flags().IS_KEY(false); - mst_array_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {max_array_size}, false)); - - MD5 array_long_double_field_hash("array_long_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_long_double_field.detail().name_hash()[i] = array_long_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_long_double_field); - - MinimalStructMember mst_array_bool_field; - mst_array_bool_field.common().member_id(memberId++); - mst_array_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_bool_field.common().member_flags().IS_OPTIONAL(false); - mst_array_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_bool_field.common().member_flags().IS_KEY(false); - mst_array_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {max_array_size}, false)); - - MD5 array_bool_field_hash("array_bool_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_bool_field.detail().name_hash()[i] = array_bool_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_bool_field); - - MinimalStructMember mst_array_string_field; - mst_array_string_field.common().member_id(memberId++); - mst_array_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_string_field.common().member_flags().IS_OPTIONAL(false); - mst_array_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_string_field.common().member_flags().IS_KEY(false); - mst_array_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {max_array_size}, false)); - - MD5 array_string_field_hash("array_string_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_string_field.detail().name_hash()[i] = array_string_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_string_field); - - MinimalStructMember mst_array_enum_field; - mst_array_enum_field.common().member_id(memberId++); - mst_array_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_enum_field.common().member_flags().IS_OPTIONAL(false); - mst_array_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_enum_field.common().member_flags().IS_KEY(false); - mst_array_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {max_array_size}, false)); - - MD5 array_enum_field_hash("array_enum_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_enum_field.detail().name_hash()[i] = array_enum_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_enum_field); - - MinimalStructMember mst_array_enum2_field; - mst_array_enum2_field.common().member_id(memberId++); - mst_array_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_enum2_field.common().member_flags().IS_OPTIONAL(false); - mst_array_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_enum2_field.common().member_flags().IS_KEY(false); - mst_array_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {max_array_size}, false)); - - MD5 array_enum2_field_hash("array_enum2_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_enum2_field.detail().name_hash()[i] = array_enum2_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_enum2_field); - - MinimalStructMember mst_array_struct_field; - mst_array_struct_field.common().member_id(memberId++); - mst_array_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_array_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_array_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_array_struct_field.common().member_flags().IS_OPTIONAL(false); - mst_array_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_array_struct_field.common().member_flags().IS_KEY(false); - mst_array_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {max_array_size}, false)); - - MD5 array_struct_field_hash("array_struct_field"); - for(int i = 0; i < 4; ++i) - { - mst_array_struct_field.detail().name_hash()[i] = array_struct_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_array_struct_field); - - MinimalStructMember mst_bounded_sequence_char_field; - mst_bounded_sequence_char_field.common().member_id(memberId++); - mst_bounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_char_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_char_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", max_seq_size, false)); - - MD5 bounded_sequence_char_field_hash("bounded_sequence_char_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_char_field.detail().name_hash()[i] = bounded_sequence_char_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_char_field); - - MinimalStructMember mst_bounded_sequence_uint8_field; - mst_bounded_sequence_uint8_field.common().member_id(memberId++); - mst_bounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_uint8_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_uint8_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", max_seq_size, false)); - - MD5 bounded_sequence_uint8_field_hash("bounded_sequence_uint8_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_uint8_field.detail().name_hash()[i] = bounded_sequence_uint8_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_uint8_field); - - MinimalStructMember mst_bounded_sequence_int16_field; - mst_bounded_sequence_int16_field.common().member_id(memberId++); - mst_bounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_int16_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_int16_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", max_seq_size, false)); - - MD5 bounded_sequence_int16_field_hash("bounded_sequence_int16_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_int16_field.detail().name_hash()[i] = bounded_sequence_int16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_int16_field); - - MinimalStructMember mst_bounded_sequence_uint16_field; - mst_bounded_sequence_uint16_field.common().member_id(memberId++); - mst_bounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_uint16_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_uint16_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", max_seq_size, false)); - - MD5 bounded_sequence_uint16_field_hash("bounded_sequence_uint16_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_uint16_field.detail().name_hash()[i] = bounded_sequence_uint16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_uint16_field); - - MinimalStructMember mst_bounded_sequence_int32_field; - mst_bounded_sequence_int32_field.common().member_id(memberId++); - mst_bounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_int32_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_int32_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", max_seq_size, false)); - - MD5 bounded_sequence_int32_field_hash("bounded_sequence_int32_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_int32_field.detail().name_hash()[i] = bounded_sequence_int32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_int32_field); - - MinimalStructMember mst_bounded_sequence_uint32_field; - mst_bounded_sequence_uint32_field.common().member_id(memberId++); - mst_bounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_uint32_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_uint32_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", max_seq_size, false)); - - MD5 bounded_sequence_uint32_field_hash("bounded_sequence_uint32_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_uint32_field.detail().name_hash()[i] = bounded_sequence_uint32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_uint32_field); - - MinimalStructMember mst_bounded_sequence_int64_field; - mst_bounded_sequence_int64_field.common().member_id(memberId++); - mst_bounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_int64_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_int64_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", max_seq_size, false)); - - MD5 bounded_sequence_int64_field_hash("bounded_sequence_int64_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_int64_field.detail().name_hash()[i] = bounded_sequence_int64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_int64_field); - - MinimalStructMember mst_bounded_sequence_uint64_field; - mst_bounded_sequence_uint64_field.common().member_id(memberId++); - mst_bounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_uint64_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_uint64_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", max_seq_size, false)); - - MD5 bounded_sequence_uint64_field_hash("bounded_sequence_uint64_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_uint64_field.detail().name_hash()[i] = bounded_sequence_uint64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_uint64_field); - - MinimalStructMember mst_bounded_sequence_float_field; - mst_bounded_sequence_float_field.common().member_id(memberId++); - mst_bounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_float_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_float_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", max_seq_size, false)); - - MD5 bounded_sequence_float_field_hash("bounded_sequence_float_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_float_field.detail().name_hash()[i] = bounded_sequence_float_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_float_field); - - MinimalStructMember mst_bounded_sequence_double_field; - mst_bounded_sequence_double_field.common().member_id(memberId++); - mst_bounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_double_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_double_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", max_seq_size, false)); - - MD5 bounded_sequence_double_field_hash("bounded_sequence_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_double_field.detail().name_hash()[i] = bounded_sequence_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_double_field); - - MinimalStructMember mst_bounded_sequence_long_double_field; - mst_bounded_sequence_long_double_field.common().member_id(memberId++); - mst_bounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_long_double_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_long_double_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", max_seq_size, false)); - - MD5 bounded_sequence_long_double_field_hash("bounded_sequence_long_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_long_double_field.detail().name_hash()[i] = bounded_sequence_long_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_long_double_field); - - MinimalStructMember mst_bounded_sequence_bool_field; - mst_bounded_sequence_bool_field.common().member_id(memberId++); - mst_bounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_bool_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_bool_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", max_seq_size, false)); - - MD5 bounded_sequence_bool_field_hash("bounded_sequence_bool_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_bool_field.detail().name_hash()[i] = bounded_sequence_bool_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_bool_field); - - MinimalStructMember mst_bounded_sequence_string_field; - mst_bounded_sequence_string_field.common().member_id(memberId++); - mst_bounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_string_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_string_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), max_seq_size, false)); - - MD5 bounded_sequence_string_field_hash("bounded_sequence_string_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_string_field.detail().name_hash()[i] = bounded_sequence_string_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_string_field); - - MinimalStructMember mst_bounded_sequence_enum_field; - mst_bounded_sequence_enum_field.common().member_id(memberId++); - mst_bounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_enum_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_enum_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", max_seq_size, false)); - - MD5 bounded_sequence_enum_field_hash("bounded_sequence_enum_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_enum_field.detail().name_hash()[i] = bounded_sequence_enum_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_enum_field); - - MinimalStructMember mst_bounded_sequence_enum2_field; - mst_bounded_sequence_enum2_field.common().member_id(memberId++); - mst_bounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_enum2_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_enum2_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", max_seq_size, false)); - - MD5 bounded_sequence_enum2_field_hash("bounded_sequence_enum2_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_enum2_field.detail().name_hash()[i] = bounded_sequence_enum2_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_enum2_field); - - MinimalStructMember mst_bounded_sequence_struct_field; - mst_bounded_sequence_struct_field.common().member_id(memberId++); - mst_bounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_bounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_bounded_sequence_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_bounded_sequence_struct_field.common().member_flags().IS_OPTIONAL(false); - mst_bounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_bounded_sequence_struct_field.common().member_flags().IS_KEY(false); - mst_bounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", max_seq_size, false)); - - MD5 bounded_sequence_struct_field_hash("bounded_sequence_struct_field"); - for(int i = 0; i < 4; ++i) - { - mst_bounded_sequence_struct_field.detail().name_hash()[i] = bounded_sequence_struct_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_bounded_sequence_struct_field); - - MinimalStructMember mst_unbounded_sequence_char_field; - mst_unbounded_sequence_char_field.common().member_id(memberId++); - mst_unbounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_char_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_char_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", 100, false)); - - MD5 unbounded_sequence_char_field_hash("unbounded_sequence_char_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_char_field.detail().name_hash()[i] = unbounded_sequence_char_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_char_field); - - MinimalStructMember mst_unbounded_sequence_uint8_field; - mst_unbounded_sequence_uint8_field.common().member_id(memberId++); - mst_unbounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_uint8_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_uint8_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 100, false)); - - MD5 unbounded_sequence_uint8_field_hash("unbounded_sequence_uint8_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_uint8_field.detail().name_hash()[i] = unbounded_sequence_uint8_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_uint8_field); - - MinimalStructMember mst_unbounded_sequence_int16_field; - mst_unbounded_sequence_int16_field.common().member_id(memberId++); - mst_unbounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_int16_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_int16_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", 100, false)); - - MD5 unbounded_sequence_int16_field_hash("unbounded_sequence_int16_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_int16_field.detail().name_hash()[i] = unbounded_sequence_int16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_int16_field); - - MinimalStructMember mst_unbounded_sequence_uint16_field; - mst_unbounded_sequence_uint16_field.common().member_id(memberId++); - mst_unbounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_uint16_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_uint16_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", 100, false)); - - MD5 unbounded_sequence_uint16_field_hash("unbounded_sequence_uint16_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_uint16_field.detail().name_hash()[i] = unbounded_sequence_uint16_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_uint16_field); - - MinimalStructMember mst_unbounded_sequence_int32_field; - mst_unbounded_sequence_int32_field.common().member_id(memberId++); - mst_unbounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_int32_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_int32_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 100, false)); - - MD5 unbounded_sequence_int32_field_hash("unbounded_sequence_int32_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_int32_field.detail().name_hash()[i] = unbounded_sequence_int32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_int32_field); - - MinimalStructMember mst_unbounded_sequence_uint32_field; - mst_unbounded_sequence_uint32_field.common().member_id(memberId++); - mst_unbounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_uint32_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_uint32_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", 100, false)); - - MD5 unbounded_sequence_uint32_field_hash("unbounded_sequence_uint32_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_uint32_field.detail().name_hash()[i] = unbounded_sequence_uint32_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_uint32_field); - - MinimalStructMember mst_unbounded_sequence_int64_field; - mst_unbounded_sequence_int64_field.common().member_id(memberId++); - mst_unbounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_int64_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_int64_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", 100, false)); - - MD5 unbounded_sequence_int64_field_hash("unbounded_sequence_int64_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_int64_field.detail().name_hash()[i] = unbounded_sequence_int64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_int64_field); - - MinimalStructMember mst_unbounded_sequence_uint64_field; - mst_unbounded_sequence_uint64_field.common().member_id(memberId++); - mst_unbounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_uint64_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_uint64_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", 100, false)); - - MD5 unbounded_sequence_uint64_field_hash("unbounded_sequence_uint64_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_uint64_field.detail().name_hash()[i] = unbounded_sequence_uint64_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_uint64_field); - - MinimalStructMember mst_unbounded_sequence_float_field; - mst_unbounded_sequence_float_field.common().member_id(memberId++); - mst_unbounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_float_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_float_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", 100, false)); - - MD5 unbounded_sequence_float_field_hash("unbounded_sequence_float_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_float_field.detail().name_hash()[i] = unbounded_sequence_float_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_float_field); - - MinimalStructMember mst_unbounded_sequence_double_field; - mst_unbounded_sequence_double_field.common().member_id(memberId++); - mst_unbounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_double_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_double_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", 100, false)); - - MD5 unbounded_sequence_double_field_hash("unbounded_sequence_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_double_field.detail().name_hash()[i] = unbounded_sequence_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_double_field); - - MinimalStructMember mst_unbounded_sequence_long_double_field; - mst_unbounded_sequence_long_double_field.common().member_id(memberId++); - mst_unbounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_long_double_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_long_double_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", 100, false)); - - MD5 unbounded_sequence_long_double_field_hash("unbounded_sequence_long_double_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_long_double_field.detail().name_hash()[i] = unbounded_sequence_long_double_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_long_double_field); - - MinimalStructMember mst_unbounded_sequence_bool_field; - mst_unbounded_sequence_bool_field.common().member_id(memberId++); - mst_unbounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_bool_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_bool_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", 100, false)); - - MD5 unbounded_sequence_bool_field_hash("unbounded_sequence_bool_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_bool_field.detail().name_hash()[i] = unbounded_sequence_bool_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_bool_field); - - MinimalStructMember mst_unbounded_sequence_string_field; - mst_unbounded_sequence_string_field.common().member_id(memberId++); - mst_unbounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_string_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_string_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), 100, false)); - - MD5 unbounded_sequence_string_field_hash("unbounded_sequence_string_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_string_field.detail().name_hash()[i] = unbounded_sequence_string_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_string_field); - - MinimalStructMember mst_unbounded_sequence_enum_field; - mst_unbounded_sequence_enum_field.common().member_id(memberId++); - mst_unbounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_enum_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_enum_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", 100, false)); - - MD5 unbounded_sequence_enum_field_hash("unbounded_sequence_enum_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_enum_field.detail().name_hash()[i] = unbounded_sequence_enum_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_enum_field); - - MinimalStructMember mst_unbounded_sequence_enum2_field; - mst_unbounded_sequence_enum2_field.common().member_id(memberId++); - mst_unbounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_enum2_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_enum2_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", 100, false)); - - MD5 unbounded_sequence_enum2_field_hash("unbounded_sequence_enum2_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_enum2_field.detail().name_hash()[i] = unbounded_sequence_enum2_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_enum2_field); - - MinimalStructMember mst_unbounded_sequence_struct_field; - mst_unbounded_sequence_struct_field.common().member_id(memberId++); - mst_unbounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_unbounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_unbounded_sequence_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_unbounded_sequence_struct_field.common().member_flags().IS_OPTIONAL(false); - mst_unbounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_unbounded_sequence_struct_field.common().member_flags().IS_KEY(false); - mst_unbounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_unbounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", 100, false)); - - MD5 unbounded_sequence_struct_field_hash("unbounded_sequence_struct_field"); - for(int i = 0; i < 4; ++i) - { - mst_unbounded_sequence_struct_field.detail().name_hash()[i] = unbounded_sequence_struct_field_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_unbounded_sequence_struct_field); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ContentFilterTestType", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ContentFilterTestType", false); -} - -const TypeObject* GetCompleteContentFilterTestTypeObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ContentFilterTestType", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_char_field; - cst_char_field.common().member_id(memberId++); - cst_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_char_field.common().member_flags().IS_OPTIONAL(false); - cst_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_char_field.common().member_flags().IS_KEY(false); - cst_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - cst_char_field.detail().name("char_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_char_field); - - CompleteStructMember cst_uint8_field; - cst_uint8_field.common().member_id(memberId++); - cst_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint8_field.common().member_flags().IS_OPTIONAL(false); - cst_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint8_field.common().member_flags().IS_KEY(false); - cst_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_uint8_field.detail().name("uint8_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint8_field); - - CompleteStructMember cst_int16_field; - cst_int16_field.common().member_id(memberId++); - cst_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int16_field.common().member_flags().IS_OPTIONAL(false); - cst_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int16_field.common().member_flags().IS_KEY(false); - cst_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - cst_int16_field.detail().name("int16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int16_field); - - CompleteStructMember cst_uint16_field; - cst_uint16_field.common().member_id(memberId++); - cst_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint16_field.common().member_flags().IS_OPTIONAL(false); - cst_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint16_field.common().member_flags().IS_KEY(false); - cst_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_uint16_field.detail().name("uint16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint16_field); - - CompleteStructMember cst_int32_field; - cst_int32_field.common().member_id(memberId++); - cst_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int32_field.common().member_flags().IS_OPTIONAL(false); - cst_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int32_field.common().member_flags().IS_KEY(false); - cst_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_int32_field.detail().name("int32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int32_field); - - CompleteStructMember cst_uint32_field; - cst_uint32_field.common().member_id(memberId++); - cst_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint32_field.common().member_flags().IS_OPTIONAL(false); - cst_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint32_field.common().member_flags().IS_KEY(false); - cst_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_uint32_field.detail().name("uint32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint32_field); - - CompleteStructMember cst_int64_field; - cst_int64_field.common().member_id(memberId++); - cst_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int64_field.common().member_flags().IS_OPTIONAL(false); - cst_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int64_field.common().member_flags().IS_KEY(false); - cst_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_int64_field.detail().name("int64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int64_field); - - CompleteStructMember cst_uint64_field; - cst_uint64_field.common().member_id(memberId++); - cst_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint64_field.common().member_flags().IS_OPTIONAL(false); - cst_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint64_field.common().member_flags().IS_KEY(false); - cst_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - cst_uint64_field.detail().name("uint64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint64_field); - - CompleteStructMember cst_float_field; - cst_float_field.common().member_id(memberId++); - cst_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_float_field.common().member_flags().IS_OPTIONAL(false); - cst_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_float_field.common().member_flags().IS_KEY(false); - cst_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - cst_float_field.detail().name("float_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_float_field); - - CompleteStructMember cst_double_field; - cst_double_field.common().member_id(memberId++); - cst_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_double_field.common().member_flags().IS_OPTIONAL(false); - cst_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_double_field.common().member_flags().IS_KEY(false); - cst_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - cst_double_field.detail().name("double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_double_field); - - CompleteStructMember cst_long_double_field; - cst_long_double_field.common().member_id(memberId++); - cst_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_long_double_field.common().member_flags().IS_OPTIONAL(false); - cst_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_long_double_field.common().member_flags().IS_KEY(false); - cst_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - cst_long_double_field.detail().name("long_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_long_double_field); - - CompleteStructMember cst_bool_field; - cst_bool_field.common().member_id(memberId++); - cst_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bool_field.common().member_flags().IS_OPTIONAL(false); - cst_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bool_field.common().member_flags().IS_KEY(false); - cst_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_bool_field.detail().name("bool_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bool_field); - - CompleteStructMember cst_string_field; - cst_string_field.common().member_id(memberId++); - cst_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_string_field.common().member_flags().IS_OPTIONAL(false); - cst_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_string_field.common().member_flags().IS_KEY(false); - cst_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_string_field.detail().name("string_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_string_field); - - CompleteStructMember cst_enum_field; - cst_enum_field.common().member_id(memberId++); - cst_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_enum_field.common().member_flags().IS_OPTIONAL(false); - cst_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_enum_field.common().member_flags().IS_KEY(false); - cst_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_enum_field.common().member_type_id(*GetColorIdentifier(true)); - - cst_enum_field.detail().name("enum_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_enum_field); - - CompleteStructMember cst_enum2_field; - cst_enum2_field.common().member_id(memberId++); - cst_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_enum2_field.common().member_flags().IS_OPTIONAL(false); - cst_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_enum2_field.common().member_flags().IS_KEY(false); - cst_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_enum2_field.common().member_type_id(*GetMaterialIdentifier(true)); - - cst_enum2_field.detail().name("enum2_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_enum2_field); - - CompleteStructMember cst_struct_field; - cst_struct_field.common().member_id(memberId++); - cst_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_struct_field.common().member_flags().IS_OPTIONAL(false); - cst_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_struct_field.common().member_flags().IS_KEY(false); - cst_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_struct_field.common().member_type_id(*GetStructTypeIdentifier(true)); - - cst_struct_field.detail().name("struct_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_struct_field); - - CompleteStructMember cst_array_char_field; - cst_array_char_field.common().member_id(memberId++); - cst_array_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_char_field.common().member_flags().IS_OPTIONAL(false); - cst_array_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_char_field.common().member_flags().IS_KEY(false); - cst_array_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {max_array_size}, true)); - - cst_array_char_field.detail().name("array_char_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_char_field); - - CompleteStructMember cst_array_uint8_field; - cst_array_uint8_field.common().member_id(memberId++); - cst_array_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_uint8_field.common().member_flags().IS_OPTIONAL(false); - cst_array_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_uint8_field.common().member_flags().IS_KEY(false); - cst_array_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {max_array_size}, true)); - - cst_array_uint8_field.detail().name("array_uint8_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_uint8_field); - - CompleteStructMember cst_array_int16_field; - cst_array_int16_field.common().member_id(memberId++); - cst_array_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_int16_field.common().member_flags().IS_OPTIONAL(false); - cst_array_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_int16_field.common().member_flags().IS_KEY(false); - cst_array_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {max_array_size}, true)); - - cst_array_int16_field.detail().name("array_int16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_int16_field); - - CompleteStructMember cst_array_uint16_field; - cst_array_uint16_field.common().member_id(memberId++); - cst_array_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_uint16_field.common().member_flags().IS_OPTIONAL(false); - cst_array_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_uint16_field.common().member_flags().IS_KEY(false); - cst_array_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {max_array_size}, true)); - - cst_array_uint16_field.detail().name("array_uint16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_uint16_field); - - CompleteStructMember cst_array_int32_field; - cst_array_int32_field.common().member_id(memberId++); - cst_array_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_int32_field.common().member_flags().IS_OPTIONAL(false); - cst_array_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_int32_field.common().member_flags().IS_KEY(false); - cst_array_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {max_array_size}, true)); - - cst_array_int32_field.detail().name("array_int32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_int32_field); - - CompleteStructMember cst_array_uint32_field; - cst_array_uint32_field.common().member_id(memberId++); - cst_array_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_uint32_field.common().member_flags().IS_OPTIONAL(false); - cst_array_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_uint32_field.common().member_flags().IS_KEY(false); - cst_array_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {max_array_size}, true)); - - cst_array_uint32_field.detail().name("array_uint32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_uint32_field); - - CompleteStructMember cst_array_int64_field; - cst_array_int64_field.common().member_id(memberId++); - cst_array_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_int64_field.common().member_flags().IS_OPTIONAL(false); - cst_array_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_int64_field.common().member_flags().IS_KEY(false); - cst_array_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {max_array_size}, true)); - - cst_array_int64_field.detail().name("array_int64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_int64_field); - - CompleteStructMember cst_array_uint64_field; - cst_array_uint64_field.common().member_id(memberId++); - cst_array_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_uint64_field.common().member_flags().IS_OPTIONAL(false); - cst_array_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_uint64_field.common().member_flags().IS_KEY(false); - cst_array_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {max_array_size}, true)); - - cst_array_uint64_field.detail().name("array_uint64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_uint64_field); - - CompleteStructMember cst_array_float_field; - cst_array_float_field.common().member_id(memberId++); - cst_array_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_float_field.common().member_flags().IS_OPTIONAL(false); - cst_array_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_float_field.common().member_flags().IS_KEY(false); - cst_array_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {max_array_size}, true)); - - cst_array_float_field.detail().name("array_float_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_float_field); - - CompleteStructMember cst_array_double_field; - cst_array_double_field.common().member_id(memberId++); - cst_array_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_double_field.common().member_flags().IS_OPTIONAL(false); - cst_array_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_double_field.common().member_flags().IS_KEY(false); - cst_array_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {max_array_size}, true)); - - cst_array_double_field.detail().name("array_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_double_field); - - CompleteStructMember cst_array_long_double_field; - cst_array_long_double_field.common().member_id(memberId++); - cst_array_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_long_double_field.common().member_flags().IS_OPTIONAL(false); - cst_array_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_long_double_field.common().member_flags().IS_KEY(false); - cst_array_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {max_array_size}, true)); - - cst_array_long_double_field.detail().name("array_long_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_long_double_field); - - CompleteStructMember cst_array_bool_field; - cst_array_bool_field.common().member_id(memberId++); - cst_array_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_bool_field.common().member_flags().IS_OPTIONAL(false); - cst_array_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_bool_field.common().member_flags().IS_KEY(false); - cst_array_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {max_array_size}, true)); - - cst_array_bool_field.detail().name("array_bool_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_bool_field); - - CompleteStructMember cst_array_string_field; - cst_array_string_field.common().member_id(memberId++); - cst_array_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_string_field.common().member_flags().IS_OPTIONAL(false); - cst_array_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_string_field.common().member_flags().IS_KEY(false); - cst_array_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {max_array_size}, true)); - - cst_array_string_field.detail().name("array_string_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_string_field); - - CompleteStructMember cst_array_enum_field; - cst_array_enum_field.common().member_id(memberId++); - cst_array_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_enum_field.common().member_flags().IS_OPTIONAL(false); - cst_array_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_enum_field.common().member_flags().IS_KEY(false); - cst_array_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {max_array_size}, true)); - - cst_array_enum_field.detail().name("array_enum_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_enum_field); - - CompleteStructMember cst_array_enum2_field; - cst_array_enum2_field.common().member_id(memberId++); - cst_array_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_enum2_field.common().member_flags().IS_OPTIONAL(false); - cst_array_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_enum2_field.common().member_flags().IS_KEY(false); - cst_array_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {max_array_size}, true)); - - cst_array_enum2_field.detail().name("array_enum2_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_enum2_field); - - CompleteStructMember cst_array_struct_field; - cst_array_struct_field.common().member_id(memberId++); - cst_array_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_array_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_array_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_array_struct_field.common().member_flags().IS_OPTIONAL(false); - cst_array_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_array_struct_field.common().member_flags().IS_KEY(false); - cst_array_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {max_array_size}, true)); - - cst_array_struct_field.detail().name("array_struct_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_array_struct_field); - - CompleteStructMember cst_bounded_sequence_char_field; - cst_bounded_sequence_char_field.common().member_id(memberId++); - cst_bounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_char_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_char_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", max_seq_size, true)); - - cst_bounded_sequence_char_field.detail().name("bounded_sequence_char_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_char_field); - - CompleteStructMember cst_bounded_sequence_uint8_field; - cst_bounded_sequence_uint8_field.common().member_id(memberId++); - cst_bounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_uint8_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_uint8_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", max_seq_size, true)); - - cst_bounded_sequence_uint8_field.detail().name("bounded_sequence_uint8_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_uint8_field); - - CompleteStructMember cst_bounded_sequence_int16_field; - cst_bounded_sequence_int16_field.common().member_id(memberId++); - cst_bounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_int16_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_int16_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", max_seq_size, true)); - - cst_bounded_sequence_int16_field.detail().name("bounded_sequence_int16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_int16_field); - - CompleteStructMember cst_bounded_sequence_uint16_field; - cst_bounded_sequence_uint16_field.common().member_id(memberId++); - cst_bounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_uint16_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_uint16_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", max_seq_size, true)); - - cst_bounded_sequence_uint16_field.detail().name("bounded_sequence_uint16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_uint16_field); - - CompleteStructMember cst_bounded_sequence_int32_field; - cst_bounded_sequence_int32_field.common().member_id(memberId++); - cst_bounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_int32_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_int32_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", max_seq_size, true)); - - cst_bounded_sequence_int32_field.detail().name("bounded_sequence_int32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_int32_field); - - CompleteStructMember cst_bounded_sequence_uint32_field; - cst_bounded_sequence_uint32_field.common().member_id(memberId++); - cst_bounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_uint32_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_uint32_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", max_seq_size, true)); - - cst_bounded_sequence_uint32_field.detail().name("bounded_sequence_uint32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_uint32_field); - - CompleteStructMember cst_bounded_sequence_int64_field; - cst_bounded_sequence_int64_field.common().member_id(memberId++); - cst_bounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_int64_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_int64_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", max_seq_size, true)); - - cst_bounded_sequence_int64_field.detail().name("bounded_sequence_int64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_int64_field); - - CompleteStructMember cst_bounded_sequence_uint64_field; - cst_bounded_sequence_uint64_field.common().member_id(memberId++); - cst_bounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_uint64_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_uint64_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", max_seq_size, true)); - - cst_bounded_sequence_uint64_field.detail().name("bounded_sequence_uint64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_uint64_field); - - CompleteStructMember cst_bounded_sequence_float_field; - cst_bounded_sequence_float_field.common().member_id(memberId++); - cst_bounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_float_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_float_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", max_seq_size, true)); - - cst_bounded_sequence_float_field.detail().name("bounded_sequence_float_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_float_field); - - CompleteStructMember cst_bounded_sequence_double_field; - cst_bounded_sequence_double_field.common().member_id(memberId++); - cst_bounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_double_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_double_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", max_seq_size, true)); - - cst_bounded_sequence_double_field.detail().name("bounded_sequence_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_double_field); - - CompleteStructMember cst_bounded_sequence_long_double_field; - cst_bounded_sequence_long_double_field.common().member_id(memberId++); - cst_bounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_long_double_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_long_double_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", max_seq_size, true)); - - cst_bounded_sequence_long_double_field.detail().name("bounded_sequence_long_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_long_double_field); - - CompleteStructMember cst_bounded_sequence_bool_field; - cst_bounded_sequence_bool_field.common().member_id(memberId++); - cst_bounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_bool_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_bool_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", max_seq_size, true)); - - cst_bounded_sequence_bool_field.detail().name("bounded_sequence_bool_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_bool_field); - - CompleteStructMember cst_bounded_sequence_string_field; - cst_bounded_sequence_string_field.common().member_id(memberId++); - cst_bounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_string_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_string_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), max_seq_size, true)); - - cst_bounded_sequence_string_field.detail().name("bounded_sequence_string_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_string_field); - - CompleteStructMember cst_bounded_sequence_enum_field; - cst_bounded_sequence_enum_field.common().member_id(memberId++); - cst_bounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_enum_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_enum_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", max_seq_size, true)); - - cst_bounded_sequence_enum_field.detail().name("bounded_sequence_enum_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_enum_field); - - CompleteStructMember cst_bounded_sequence_enum2_field; - cst_bounded_sequence_enum2_field.common().member_id(memberId++); - cst_bounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_enum2_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_enum2_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", max_seq_size, true)); - - cst_bounded_sequence_enum2_field.detail().name("bounded_sequence_enum2_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_enum2_field); - - CompleteStructMember cst_bounded_sequence_struct_field; - cst_bounded_sequence_struct_field.common().member_id(memberId++); - cst_bounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_bounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_bounded_sequence_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_bounded_sequence_struct_field.common().member_flags().IS_OPTIONAL(false); - cst_bounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_bounded_sequence_struct_field.common().member_flags().IS_KEY(false); - cst_bounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", max_seq_size, true)); - - cst_bounded_sequence_struct_field.detail().name("bounded_sequence_struct_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_bounded_sequence_struct_field); - - CompleteStructMember cst_unbounded_sequence_char_field; - cst_unbounded_sequence_char_field.common().member_id(memberId++); - cst_unbounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_char_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_char_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_char_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_char_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", 100, true)); - - cst_unbounded_sequence_char_field.detail().name("unbounded_sequence_char_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_char_field); - - CompleteStructMember cst_unbounded_sequence_uint8_field; - cst_unbounded_sequence_uint8_field.common().member_id(memberId++); - cst_unbounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_uint8_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_uint8_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_uint8_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_uint8_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 100, true)); - - cst_unbounded_sequence_uint8_field.detail().name("unbounded_sequence_uint8_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_uint8_field); - - CompleteStructMember cst_unbounded_sequence_int16_field; - cst_unbounded_sequence_int16_field.common().member_id(memberId++); - cst_unbounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_int16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_int16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_int16_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_int16_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", 100, true)); - - cst_unbounded_sequence_int16_field.detail().name("unbounded_sequence_int16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_int16_field); - - CompleteStructMember cst_unbounded_sequence_uint16_field; - cst_unbounded_sequence_uint16_field.common().member_id(memberId++); - cst_unbounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_uint16_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_uint16_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_uint16_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_uint16_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", 100, true)); - - cst_unbounded_sequence_uint16_field.detail().name("unbounded_sequence_uint16_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_uint16_field); - - CompleteStructMember cst_unbounded_sequence_int32_field; - cst_unbounded_sequence_int32_field.common().member_id(memberId++); - cst_unbounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_int32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_int32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_int32_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_int32_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 100, true)); - - cst_unbounded_sequence_int32_field.detail().name("unbounded_sequence_int32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_int32_field); - - CompleteStructMember cst_unbounded_sequence_uint32_field; - cst_unbounded_sequence_uint32_field.common().member_id(memberId++); - cst_unbounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_uint32_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_uint32_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_uint32_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_uint32_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", 100, true)); - - cst_unbounded_sequence_uint32_field.detail().name("unbounded_sequence_uint32_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_uint32_field); - - CompleteStructMember cst_unbounded_sequence_int64_field; - cst_unbounded_sequence_int64_field.common().member_id(memberId++); - cst_unbounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_int64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_int64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_int64_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_int64_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", 100, true)); - - cst_unbounded_sequence_int64_field.detail().name("unbounded_sequence_int64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_int64_field); - - CompleteStructMember cst_unbounded_sequence_uint64_field; - cst_unbounded_sequence_uint64_field.common().member_id(memberId++); - cst_unbounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_uint64_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_uint64_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_uint64_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_uint64_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", 100, true)); - - cst_unbounded_sequence_uint64_field.detail().name("unbounded_sequence_uint64_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_uint64_field); - - CompleteStructMember cst_unbounded_sequence_float_field; - cst_unbounded_sequence_float_field.common().member_id(memberId++); - cst_unbounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_float_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_float_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_float_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_float_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", 100, true)); - - cst_unbounded_sequence_float_field.detail().name("unbounded_sequence_float_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_float_field); - - CompleteStructMember cst_unbounded_sequence_double_field; - cst_unbounded_sequence_double_field.common().member_id(memberId++); - cst_unbounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_double_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_double_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", 100, true)); - - cst_unbounded_sequence_double_field.detail().name("unbounded_sequence_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_double_field); - - CompleteStructMember cst_unbounded_sequence_long_double_field; - cst_unbounded_sequence_long_double_field.common().member_id(memberId++); - cst_unbounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_long_double_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_long_double_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_long_double_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_long_double_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", 100, true)); - - cst_unbounded_sequence_long_double_field.detail().name("unbounded_sequence_long_double_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_long_double_field); - - CompleteStructMember cst_unbounded_sequence_bool_field; - cst_unbounded_sequence_bool_field.common().member_id(memberId++); - cst_unbounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_bool_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_bool_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_bool_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_bool_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", 100, true)); - - cst_unbounded_sequence_bool_field.detail().name("unbounded_sequence_bool_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_bool_field); - - CompleteStructMember cst_unbounded_sequence_string_field; - cst_unbounded_sequence_string_field.common().member_id(memberId++); - cst_unbounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_string_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_string_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_string_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_string_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), 100, true)); - - cst_unbounded_sequence_string_field.detail().name("unbounded_sequence_string_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_string_field); - - CompleteStructMember cst_unbounded_sequence_enum_field; - cst_unbounded_sequence_enum_field.common().member_id(memberId++); - cst_unbounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_enum_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_enum_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_enum_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_enum_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", 100, true)); - - cst_unbounded_sequence_enum_field.detail().name("unbounded_sequence_enum_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_enum_field); - - CompleteStructMember cst_unbounded_sequence_enum2_field; - cst_unbounded_sequence_enum2_field.common().member_id(memberId++); - cst_unbounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_enum2_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_enum2_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_enum2_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_enum2_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", 100, true)); - - cst_unbounded_sequence_enum2_field.detail().name("unbounded_sequence_enum2_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_enum2_field); - - CompleteStructMember cst_unbounded_sequence_struct_field; - cst_unbounded_sequence_struct_field.common().member_id(memberId++); - cst_unbounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_unbounded_sequence_struct_field.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_unbounded_sequence_struct_field.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_unbounded_sequence_struct_field.common().member_flags().IS_OPTIONAL(false); - cst_unbounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_unbounded_sequence_struct_field.common().member_flags().IS_KEY(false); - cst_unbounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_unbounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", 100, true)); - - cst_unbounded_sequence_struct_field.detail().name("unbounded_sequence_struct_field"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_unbounded_sequence_struct_field); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ContentFilterTestType"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ContentFilterTestType", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ContentFilterTestType", true); -} diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h deleted file mode 100644 index f9d5ec3dc0f..00000000000 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ContentFilterTestTypeTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ContentFilterTestType_SOURCE) -#define ContentFilterTestType_DllAPI __declspec( dllexport ) -#else -#define ContentFilterTestType_DllAPI __declspec( dllimport ) -#endif // ContentFilterTestType_SOURCE -#else -#define ContentFilterTestType_DllAPI -#endif -#else -#define ContentFilterTestType_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerContentFilterTestTypeTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetColorIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetColorObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalColorObject(); -eProsima_user_DllExport const TypeObject* GetCompleteColorObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMaterialIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMaterialObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMaterialObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMaterialObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStructTypeIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStructTypeObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStructTypeObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStructTypeObject(); - - - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetContentFilterTestTypeIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetContentFilterTestTypeObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalContentFilterTestTypeObject(); -eProsima_user_DllExport const TypeObject* GetCompleteContentFilterTestTypeObject(); - - -#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.cxx new file mode 100644 index 00000000000..02c507f9f65 --- /dev/null +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.cxx @@ -0,0 +1,15231 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ContentFilterTestTypeTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "ContentFilterTestTypeTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ContentFilterTestType.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_ContentFilterTestType_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_StructType_type_identifier(); + + register_ContentFilterTestType_type_identifier(); + + }); +} + +void register_StructType_type_identifier() +{ + { + StructTypeFlag struct_flags_StructType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + true, false); + ReturnCode_t return_code_StructType; + TypeIdentifierPair type_ids_StructType; + QualifiedTypeName type_name_StructType = "StructType"; + eprosima::fastcdr::optional type_ann_builtin_StructType; + eprosima::fastcdr::optional ann_custom_StructType; + AppliedAnnotationSeq tmp_ann_custom_StructType; + eprosima::fastcdr::optional verbatim_StructType; + if (!tmp_ann_custom_StructType.empty()) + { + ann_custom_StructType = tmp_ann_custom_StructType; + } + + CompleteTypeDetail detail_StructType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructType, ann_custom_StructType, type_name_StructType.to_string()); + CompleteStructHeader header_StructType; + header_StructType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructType); + CompleteStructMemberSeq member_seq_StructType; + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_StructType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_char_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_StructType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint8_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_StructType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_StructType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_StructType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_StructType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_StructType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_StructType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_StructType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_float_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_StructType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_StructType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_long_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_StructType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_bool_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_StructType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_string_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_StructType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_StructType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum2_field); + } + CompleteStructType struct_type_StructType = TypeObjectUtils::build_complete_struct_type(struct_flags_StructType, header_StructType, member_seq_StructType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructType, type_name_StructType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_ContentFilterTestType_type_identifier() +{ + { + StructTypeFlag struct_flags_ContentFilterTestType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_ContentFilterTestType; + TypeIdentifierPair type_ids_ContentFilterTestType; + QualifiedTypeName type_name_ContentFilterTestType = "ContentFilterTestType"; + eprosima::fastcdr::optional type_ann_builtin_ContentFilterTestType; + eprosima::fastcdr::optional ann_custom_ContentFilterTestType; + CompleteTypeDetail detail_ContentFilterTestType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ContentFilterTestType, ann_custom_ContentFilterTestType, type_name_ContentFilterTestType.to_string()); + CompleteStructHeader header_ContentFilterTestType; + header_ContentFilterTestType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ContentFilterTestType); + CompleteStructMemberSeq member_seq_ContentFilterTestType; + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_char_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_uint8_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_int16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_uint16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_int32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_uint32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_int64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_uint64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_float_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_long_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bool_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_string_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_enum_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_enum2_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_StructType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + true, false); + ReturnCode_t return_code_StructType; + TypeIdentifierPair type_ids_StructType; + QualifiedTypeName type_name_StructType = "StructType"; + eprosima::fastcdr::optional type_ann_builtin_StructType; + eprosima::fastcdr::optional ann_custom_StructType; + AppliedAnnotationSeq tmp_ann_custom_StructType; + eprosima::fastcdr::optional verbatim_StructType; + if (!tmp_ann_custom_StructType.empty()) + { + ann_custom_StructType = tmp_ann_custom_StructType; + } + + CompleteTypeDetail detail_StructType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructType, ann_custom_StructType, type_name_StructType.to_string()); + CompleteStructHeader header_StructType; + header_StructType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructType); + CompleteStructMemberSeq member_seq_StructType; + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_StructType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_char_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_StructType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint8_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_StructType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_StructType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_StructType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_StructType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_StructType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_StructType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_StructType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_float_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_StructType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_StructType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_long_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_StructType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_bool_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_StructType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_string_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_StructType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_StructType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum2_field); + } + CompleteStructType struct_type_StructType = TypeObjectUtils::build_complete_struct_type(struct_flags_StructType, header_StructType, member_seq_StructType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructType, type_name_StructType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + StructMemberFlag member_flags_struct_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_struct_field; + MemberId member_id_struct_field = 0x0000000f; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_struct_field = TypeObjectUtils::build_common_struct_member(member_id_struct_field, member_flags_struct_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_struct_field = TypeObjectUtils::build_common_struct_member(member_id_struct_field, member_flags_struct_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure struct_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_struct_field = "struct_field"; + eprosima::fastcdr::optional member_ann_builtin_struct_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_struct_field = TypeObjectUtils::build_complete_member_detail(name_struct_field, member_ann_builtin_struct_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_struct_field = TypeObjectUtils::build_complete_struct_member(common_struct_field, detail_struct_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_struct_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_3 = 0; + PlainCollectionHeader header_anonymous_array_char_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_3, element_flags_anonymous_array_char_3); + std::string type_id_kind_anonymous_array_char_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_char_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_char_field; + MemberId member_id_array_char_field = 0x00000010; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_char_field = TypeObjectUtils::build_common_struct_member(member_id_array_char_field, member_flags_array_char_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_char_field = TypeObjectUtils::build_common_struct_member(member_id_array_char_field, member_flags_array_char_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_char_field = "array_char_field"; + eprosima::fastcdr::optional member_ann_builtin_array_char_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_char_field = TypeObjectUtils::build_complete_member_detail(name_array_char_field, member_ann_builtin_array_char_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_char_field = TypeObjectUtils::build_complete_struct_member(common_array_char_field, detail_array_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_char_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint8_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint8_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint8_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint8_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint8_t_3 = 0; + PlainCollectionHeader header_anonymous_array_uint8_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint8_t_3, element_flags_anonymous_array_uint8_t_3); + std::string type_id_kind_anonymous_array_uint8_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint8_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint8_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint8_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint8_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint8_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint8_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint8_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint8_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_uint8_field; + MemberId member_id_array_uint8_field = 0x00000011; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint8_field, member_flags_array_uint8_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint8_field, member_flags_array_uint8_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_uint8_field = "array_uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_array_uint8_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_uint8_field = TypeObjectUtils::build_complete_member_detail(name_array_uint8_field, member_ann_builtin_array_uint8_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_uint8_field = TypeObjectUtils::build_complete_struct_member(common_array_uint8_field, detail_array_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_uint8_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int16_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_int16_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int16_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int16_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_int16_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_int16_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_int16_t_3 = 0; + PlainCollectionHeader header_anonymous_array_int16_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int16_t_3, element_flags_anonymous_array_int16_t_3); + std::string type_id_kind_anonymous_array_int16_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_int16_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int16_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int16_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int16_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int16_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int16_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int16_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int16_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int16_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int16_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int16_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_int16_field; + MemberId member_id_array_int16_field = 0x00000012; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_int16_field = TypeObjectUtils::build_common_struct_member(member_id_array_int16_field, member_flags_array_int16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_int16_field = TypeObjectUtils::build_common_struct_member(member_id_array_int16_field, member_flags_array_int16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_int16_field = "array_int16_field"; + eprosima::fastcdr::optional member_ann_builtin_array_int16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_int16_field = TypeObjectUtils::build_complete_member_detail(name_array_int16_field, member_ann_builtin_array_int16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_int16_field = TypeObjectUtils::build_complete_struct_member(common_array_int16_field, detail_array_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_int16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint16_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint16_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint16_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint16_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint16_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint16_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint16_t_3 = 0; + PlainCollectionHeader header_anonymous_array_uint16_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint16_t_3, element_flags_anonymous_array_uint16_t_3); + std::string type_id_kind_anonymous_array_uint16_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint16_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint16_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint16_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint16_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint16_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint16_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint16_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint16_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint16_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint16_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint16_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_uint16_field; + MemberId member_id_array_uint16_field = 0x00000013; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint16_field, member_flags_array_uint16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint16_field, member_flags_array_uint16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_uint16_field = "array_uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_array_uint16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_uint16_field = TypeObjectUtils::build_complete_member_detail(name_array_uint16_field, member_ann_builtin_array_uint16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_uint16_field = TypeObjectUtils::build_complete_struct_member(common_array_uint16_field, detail_array_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_uint16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int32_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_int32_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int32_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int32_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_int32_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_int32_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_int32_t_3 = 0; + PlainCollectionHeader header_anonymous_array_int32_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int32_t_3, element_flags_anonymous_array_int32_t_3); + std::string type_id_kind_anonymous_array_int32_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_int32_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int32_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int32_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int32_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int32_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int32_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int32_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int32_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int32_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int32_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_int32_field; + MemberId member_id_array_int32_field = 0x00000014; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_int32_field = TypeObjectUtils::build_common_struct_member(member_id_array_int32_field, member_flags_array_int32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_int32_field = TypeObjectUtils::build_common_struct_member(member_id_array_int32_field, member_flags_array_int32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_int32_field = "array_int32_field"; + eprosima::fastcdr::optional member_ann_builtin_array_int32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_int32_field = TypeObjectUtils::build_complete_member_detail(name_array_int32_field, member_ann_builtin_array_int32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_int32_field = TypeObjectUtils::build_complete_struct_member(common_array_int32_field, detail_array_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_int32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint32_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint32_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint32_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint32_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint32_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint32_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint32_t_3 = 0; + PlainCollectionHeader header_anonymous_array_uint32_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint32_t_3, element_flags_anonymous_array_uint32_t_3); + std::string type_id_kind_anonymous_array_uint32_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint32_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint32_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint32_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint32_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint32_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint32_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint32_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint32_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint32_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint32_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint32_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_uint32_field; + MemberId member_id_array_uint32_field = 0x00000015; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint32_field, member_flags_array_uint32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint32_field, member_flags_array_uint32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_uint32_field = "array_uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_array_uint32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_uint32_field = TypeObjectUtils::build_complete_member_detail(name_array_uint32_field, member_ann_builtin_array_uint32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_uint32_field = TypeObjectUtils::build_complete_struct_member(common_array_uint32_field, detail_array_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_uint32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int64_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_int64_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int64_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_int64_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_int64_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_int64_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_int64_t_3 = 0; + PlainCollectionHeader header_anonymous_array_int64_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_int64_t_3, element_flags_anonymous_array_int64_t_3); + std::string type_id_kind_anonymous_array_int64_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_int64_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_int64_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int64_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_int64_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int64_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_int64_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_int64_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_int64_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int64_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_int64_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_int64_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_int64_field; + MemberId member_id_array_int64_field = 0x00000016; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_int64_field = TypeObjectUtils::build_common_struct_member(member_id_array_int64_field, member_flags_array_int64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_int64_field = TypeObjectUtils::build_common_struct_member(member_id_array_int64_field, member_flags_array_int64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_int64_field = "array_int64_field"; + eprosima::fastcdr::optional member_ann_builtin_array_int64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_int64_field = TypeObjectUtils::build_complete_member_detail(name_array_int64_field, member_ann_builtin_array_int64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_int64_field = TypeObjectUtils::build_complete_struct_member(common_array_int64_field, detail_array_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_int64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint64_t_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_uint64_t_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint64_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_uint64_t_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_uint64_t_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_uint64_t_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_uint64_t_3 = 0; + PlainCollectionHeader header_anonymous_array_uint64_t_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_uint64_t_3, element_flags_anonymous_array_uint64_t_3); + std::string type_id_kind_anonymous_array_uint64_t_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_uint64_t_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_uint64_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint64_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_uint64_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint64_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_uint64_t_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_uint64_t_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_uint64_t_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint64_t_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_uint64_t_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_uint64_t_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_uint64_field; + MemberId member_id_array_uint64_field = 0x00000017; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint64_field, member_flags_array_uint64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_array_uint64_field, member_flags_array_uint64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_uint64_field = "array_uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_array_uint64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_uint64_field = TypeObjectUtils::build_complete_member_detail(name_array_uint64_field, member_ann_builtin_array_uint64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_uint64_field = TypeObjectUtils::build_complete_struct_member(common_array_uint64_field, detail_array_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_uint64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_float_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_float_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_float_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_float_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_float_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_float_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_float_3 = 0; + PlainCollectionHeader header_anonymous_array_float_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_float_3, element_flags_anonymous_array_float_3); + std::string type_id_kind_anonymous_array_float_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_float_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_float_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_float_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_float_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_float_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_float_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_float_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_float_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_float_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_float_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_float_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_float_field; + MemberId member_id_array_float_field = 0x00000018; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_float_field = TypeObjectUtils::build_common_struct_member(member_id_array_float_field, member_flags_array_float_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_float_field = TypeObjectUtils::build_common_struct_member(member_id_array_float_field, member_flags_array_float_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_float_field = "array_float_field"; + eprosima::fastcdr::optional member_ann_builtin_array_float_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_float_field = TypeObjectUtils::build_complete_member_detail(name_array_float_field, member_ann_builtin_array_float_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_float_field = TypeObjectUtils::build_complete_struct_member(common_array_float_field, detail_array_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_float_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_double_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_double_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_double_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_double_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_double_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_double_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_double_3 = 0; + PlainCollectionHeader header_anonymous_array_double_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_double_3, element_flags_anonymous_array_double_3); + std::string type_id_kind_anonymous_array_double_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_double_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_double_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_double_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_double_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_double_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_double_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_double_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_double_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_double_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_double_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_double_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_double_field; + MemberId member_id_array_double_field = 0x00000019; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_double_field = TypeObjectUtils::build_common_struct_member(member_id_array_double_field, member_flags_array_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_double_field = TypeObjectUtils::build_common_struct_member(member_id_array_double_field, member_flags_array_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_double_field = "array_double_field"; + eprosima::fastcdr::optional member_ann_builtin_array_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_double_field = TypeObjectUtils::build_complete_member_detail(name_array_double_field, member_ann_builtin_array_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_double_field = TypeObjectUtils::build_complete_struct_member(common_array_double_field, detail_array_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_longdouble_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_longdouble_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_longdouble_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_longdouble_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_longdouble_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_longdouble_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_longdouble_3 = 0; + PlainCollectionHeader header_anonymous_array_longdouble_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_longdouble_3, element_flags_anonymous_array_longdouble_3); + std::string type_id_kind_anonymous_array_longdouble_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_longdouble_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_longdouble_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_longdouble_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_longdouble_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_longdouble_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_longdouble_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_longdouble_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_longdouble_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_longdouble_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_longdouble_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_longdouble_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_long_double_field; + MemberId member_id_array_long_double_field = 0x0000001a; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_array_long_double_field, member_flags_array_long_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_array_long_double_field, member_flags_array_long_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_long_double_field = "array_long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_array_long_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_long_double_field = TypeObjectUtils::build_complete_member_detail(name_array_long_double_field, member_ann_builtin_array_long_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_long_double_field = TypeObjectUtils::build_complete_struct_member(common_array_long_double_field, detail_array_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_long_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_bool_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_bool_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_bool_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_bool_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_bool_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_bool_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_bool_3 = 0; + PlainCollectionHeader header_anonymous_array_bool_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_bool_3, element_flags_anonymous_array_bool_3); + std::string type_id_kind_anonymous_array_bool_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_bool_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_bool_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_bool_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_bool_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_bool_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_bool_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_bool_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_bool_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_bool_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_bool_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_bool_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_bool_field; + MemberId member_id_array_bool_field = 0x0000001b; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_bool_field = TypeObjectUtils::build_common_struct_member(member_id_array_bool_field, member_flags_array_bool_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_bool_field = TypeObjectUtils::build_common_struct_member(member_id_array_bool_field, member_flags_array_bool_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_bool_field = "array_bool_field"; + eprosima::fastcdr::optional member_ann_builtin_array_bool_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_bool_field = TypeObjectUtils::build_complete_member_detail(name_array_bool_field, member_ann_builtin_array_bool_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_bool_field = TypeObjectUtils::build_complete_struct_member(common_array_bool_field, detail_array_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_bool_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_anonymous_string_unbounded_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_array_anonymous_string_unbounded_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_anonymous_string_unbounded_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_anonymous_string_unbounded_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_anonymous_string_unbounded_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_anonymous_string_unbounded_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_anonymous_string_unbounded_3 = 0; + PlainCollectionHeader header_anonymous_array_anonymous_string_unbounded_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_anonymous_string_unbounded_3, element_flags_anonymous_array_anonymous_string_unbounded_3); + std::string type_id_kind_anonymous_array_anonymous_string_unbounded_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_anonymous_string_unbounded_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_anonymous_string_unbounded_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_unbounded_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_anonymous_string_unbounded_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_anonymous_string_unbounded_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_anonymous_string_unbounded_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_anonymous_string_unbounded_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_anonymous_string_unbounded_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_anonymous_string_unbounded_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_anonymous_string_unbounded_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_anonymous_string_unbounded_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_string_field; + MemberId member_id_array_string_field = 0x0000001c; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_string_field = TypeObjectUtils::build_common_struct_member(member_id_array_string_field, member_flags_array_string_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_string_field = TypeObjectUtils::build_common_struct_member(member_id_array_string_field, member_flags_array_string_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_string_field = "array_string_field"; + eprosima::fastcdr::optional member_ann_builtin_array_string_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_string_field = TypeObjectUtils::build_complete_member_detail(name_array_string_field, member_ann_builtin_array_string_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_string_field = TypeObjectUtils::build_complete_struct_member(common_array_string_field, detail_array_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_string_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_Color_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_array_Color_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_Color_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_Color_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_Color_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_Color_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_Color_3 = 0; + PlainCollectionHeader header_anonymous_array_Color_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_Color_3, element_flags_anonymous_array_Color_3); + std::string type_id_kind_anonymous_array_Color_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_Color_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_Color_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_Color_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_Color_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Color_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_Color_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_Color_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_Color_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Color_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_Color_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Color_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_enum_field; + MemberId member_id_array_enum_field = 0x0000001d; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_enum_field = TypeObjectUtils::build_common_struct_member(member_id_array_enum_field, member_flags_array_enum_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_enum_field = TypeObjectUtils::build_common_struct_member(member_id_array_enum_field, member_flags_array_enum_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_enum_field = "array_enum_field"; + eprosima::fastcdr::optional member_ann_builtin_array_enum_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_enum_field = TypeObjectUtils::build_complete_member_detail(name_array_enum_field, member_ann_builtin_array_enum_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_enum_field = TypeObjectUtils::build_complete_struct_member(common_array_enum_field, detail_array_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_enum_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_Material_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_array_Material_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_Material_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_Material_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_Material_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_Material_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_Material_3 = 0; + PlainCollectionHeader header_anonymous_array_Material_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_Material_3, element_flags_anonymous_array_Material_3); + std::string type_id_kind_anonymous_array_Material_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_Material_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_Material_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_Material_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_Material_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Material_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_Material_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_Material_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_Material_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Material_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_Material_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_Material_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_enum2_field; + MemberId member_id_array_enum2_field = 0x0000001e; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_array_enum2_field, member_flags_array_enum2_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_array_enum2_field, member_flags_array_enum2_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_enum2_field = "array_enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_array_enum2_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_enum2_field = TypeObjectUtils::build_complete_member_detail(name_array_enum2_field, member_ann_builtin_array_enum2_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_enum2_field = TypeObjectUtils::build_complete_struct_member(common_array_enum2_field, detail_array_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_enum2_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_StructType_3", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_StructType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + true, false); + ReturnCode_t return_code_StructType; + TypeIdentifierPair type_ids_StructType; + QualifiedTypeName type_name_StructType = "StructType"; + eprosima::fastcdr::optional type_ann_builtin_StructType; + eprosima::fastcdr::optional ann_custom_StructType; + AppliedAnnotationSeq tmp_ann_custom_StructType; + eprosima::fastcdr::optional verbatim_StructType; + if (!tmp_ann_custom_StructType.empty()) + { + ann_custom_StructType = tmp_ann_custom_StructType; + } + + CompleteTypeDetail detail_StructType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructType, ann_custom_StructType, type_name_StructType.to_string()); + CompleteStructHeader header_StructType; + header_StructType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructType); + CompleteStructMemberSeq member_seq_StructType; + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_StructType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_char_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_StructType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint8_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_StructType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_StructType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_StructType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_StructType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_StructType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_StructType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_StructType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_float_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_StructType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_StructType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_long_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_StructType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_bool_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_StructType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_string_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_StructType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_StructType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum2_field); + } + CompleteStructType struct_type_StructType = TypeObjectUtils::build_complete_struct_type(struct_flags_StructType, header_StructType, member_seq_StructType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructType, type_name_StructType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_array_StructType_3 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_StructType_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_StructType_3 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_StructType_3 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_array_StructType_3 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_StructType_3 = 0; + PlainCollectionHeader header_anonymous_array_StructType_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_StructType_3, element_flags_anonymous_array_StructType_3); + std::string type_id_kind_anonymous_array_StructType_3("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_StructType_3 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_StructType_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_StructType_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_StructType_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_StructType_3 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(3)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_StructType_3, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_StructType_3)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_StructType_3")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_StructType_3 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_StructType_3", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_StructType_3: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_array_struct_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_array_struct_field; + MemberId member_id_array_struct_field = 0x0000001f; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_array_struct_field = TypeObjectUtils::build_common_struct_member(member_id_array_struct_field, member_flags_array_struct_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_array_struct_field = TypeObjectUtils::build_common_struct_member(member_id_array_struct_field, member_flags_array_struct_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure array_struct_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_array_struct_field = "array_struct_field"; + eprosima::fastcdr::optional member_ann_builtin_array_struct_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_array_struct_field = TypeObjectUtils::build_complete_member_detail(name_array_struct_field, member_ann_builtin_array_struct_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_array_struct_field = TypeObjectUtils::build_complete_struct_member(common_array_struct_field, detail_array_struct_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_array_struct_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_char_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_char_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_char_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_char_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_char_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_char_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_char_5 = 0; + PlainCollectionHeader header_anonymous_sequence_char_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_char_5, element_flags_anonymous_sequence_char_5); + std::string type_id_kind_anonymous_sequence_char_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_char_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_char_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_char_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_char_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_char_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_char_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_char_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_char_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_char_field; + MemberId member_id_bounded_sequence_char_field = 0x00000020; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_char_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_char_field, member_flags_bounded_sequence_char_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_char_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_char_field, member_flags_bounded_sequence_char_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_char_field = "bounded_sequence_char_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_char_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_char_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_char_field, member_ann_builtin_bounded_sequence_char_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_char_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_char_field, detail_bounded_sequence_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_char_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_5, element_flags_anonymous_sequence_uint8_t_5); + std::string type_id_kind_anonymous_sequence_uint8_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_uint8_field; + MemberId member_id_bounded_sequence_uint8_field = 0x00000021; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint8_field, member_flags_bounded_sequence_uint8_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint8_field, member_flags_bounded_sequence_uint8_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_uint8_field = "bounded_sequence_uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_uint8_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_uint8_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_uint8_field, member_ann_builtin_bounded_sequence_uint8_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_uint8_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_uint8_field, detail_bounded_sequence_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_uint8_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int16_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int16_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int16_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int16_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int16_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int16_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int16_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_int16_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int16_t_5, element_flags_anonymous_sequence_int16_t_5); + std::string type_id_kind_anonymous_sequence_int16_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int16_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int16_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int16_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int16_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int16_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int16_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int16_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int16_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_int16_field; + MemberId member_id_bounded_sequence_int16_field = 0x00000022; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int16_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int16_field, member_flags_bounded_sequence_int16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int16_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int16_field, member_flags_bounded_sequence_int16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_int16_field = "bounded_sequence_int16_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_int16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_int16_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_int16_field, member_ann_builtin_bounded_sequence_int16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_int16_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_int16_field, detail_bounded_sequence_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_int16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint16_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint16_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint16_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint16_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint16_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint16_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint16_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_uint16_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint16_t_5, element_flags_anonymous_sequence_uint16_t_5); + std::string type_id_kind_anonymous_sequence_uint16_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint16_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint16_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint16_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint16_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint16_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint16_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint16_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint16_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_uint16_field; + MemberId member_id_bounded_sequence_uint16_field = 0x00000023; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint16_field, member_flags_bounded_sequence_uint16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint16_field, member_flags_bounded_sequence_uint16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_uint16_field = "bounded_sequence_uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_uint16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_uint16_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_uint16_field, member_ann_builtin_bounded_sequence_uint16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_uint16_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_uint16_field, detail_bounded_sequence_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_uint16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int32_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int32_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int32_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int32_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int32_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int32_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int32_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_int32_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_5, element_flags_anonymous_sequence_int32_t_5); + std::string type_id_kind_anonymous_sequence_int32_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int32_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int32_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_int32_field; + MemberId member_id_bounded_sequence_int32_field = 0x00000024; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int32_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int32_field, member_flags_bounded_sequence_int32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int32_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int32_field, member_flags_bounded_sequence_int32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_int32_field = "bounded_sequence_int32_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_int32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_int32_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_int32_field, member_ann_builtin_bounded_sequence_int32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_int32_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_int32_field, detail_bounded_sequence_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_int32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint32_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint32_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint32_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint32_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint32_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint32_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint32_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_uint32_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint32_t_5, element_flags_anonymous_sequence_uint32_t_5); + std::string type_id_kind_anonymous_sequence_uint32_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint32_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint32_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint32_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint32_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint32_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint32_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint32_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint32_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_uint32_field; + MemberId member_id_bounded_sequence_uint32_field = 0x00000025; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint32_field, member_flags_bounded_sequence_uint32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint32_field, member_flags_bounded_sequence_uint32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_uint32_field = "bounded_sequence_uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_uint32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_uint32_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_uint32_field, member_ann_builtin_bounded_sequence_uint32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_uint32_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_uint32_field, detail_bounded_sequence_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_uint32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int64_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int64_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int64_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int64_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int64_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int64_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int64_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_int64_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int64_t_5, element_flags_anonymous_sequence_int64_t_5); + std::string type_id_kind_anonymous_sequence_int64_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int64_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int64_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int64_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int64_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int64_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int64_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int64_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int64_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_int64_field; + MemberId member_id_bounded_sequence_int64_field = 0x00000026; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int64_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int64_field, member_flags_bounded_sequence_int64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_int64_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_int64_field, member_flags_bounded_sequence_int64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_int64_field = "bounded_sequence_int64_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_int64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_int64_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_int64_field, member_ann_builtin_bounded_sequence_int64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_int64_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_int64_field, detail_bounded_sequence_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_int64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint64_t_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint64_t_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint64_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint64_t_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint64_t_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint64_t_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint64_t_5 = 0; + PlainCollectionHeader header_anonymous_sequence_uint64_t_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint64_t_5, element_flags_anonymous_sequence_uint64_t_5); + std::string type_id_kind_anonymous_sequence_uint64_t_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint64_t_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint64_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint64_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint64_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint64_t_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint64_t_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint64_t_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint64_t_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_uint64_field; + MemberId member_id_bounded_sequence_uint64_field = 0x00000027; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint64_field, member_flags_bounded_sequence_uint64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_uint64_field, member_flags_bounded_sequence_uint64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_uint64_field = "bounded_sequence_uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_uint64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_uint64_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_uint64_field, member_ann_builtin_bounded_sequence_uint64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_uint64_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_uint64_field, detail_bounded_sequence_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_uint64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_float_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_float_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_float_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_float_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_float_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_float_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_float_5 = 0; + PlainCollectionHeader header_anonymous_sequence_float_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_float_5, element_flags_anonymous_sequence_float_5); + std::string type_id_kind_anonymous_sequence_float_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_float_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_float_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_float_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_float_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_float_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_float_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_float_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_float_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_float_field; + MemberId member_id_bounded_sequence_float_field = 0x00000028; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_float_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_float_field, member_flags_bounded_sequence_float_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_float_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_float_field, member_flags_bounded_sequence_float_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_float_field = "bounded_sequence_float_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_float_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_float_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_float_field, member_ann_builtin_bounded_sequence_float_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_float_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_float_field, detail_bounded_sequence_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_float_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_double_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_double_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_double_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_double_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_double_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_double_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_double_5 = 0; + PlainCollectionHeader header_anonymous_sequence_double_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_double_5, element_flags_anonymous_sequence_double_5); + std::string type_id_kind_anonymous_sequence_double_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_double_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_double_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_double_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_double_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_double_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_double_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_double_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_double_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_double_field; + MemberId member_id_bounded_sequence_double_field = 0x00000029; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_double_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_double_field, member_flags_bounded_sequence_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_double_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_double_field, member_flags_bounded_sequence_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_double_field = "bounded_sequence_double_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_double_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_double_field, member_ann_builtin_bounded_sequence_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_double_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_double_field, detail_bounded_sequence_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_longdouble_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_longdouble_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_longdouble_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_longdouble_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_longdouble_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_longdouble_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_longdouble_5 = 0; + PlainCollectionHeader header_anonymous_sequence_longdouble_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_longdouble_5, element_flags_anonymous_sequence_longdouble_5); + std::string type_id_kind_anonymous_sequence_longdouble_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_longdouble_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_longdouble_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_longdouble_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_longdouble_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_longdouble_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_longdouble_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_longdouble_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_longdouble_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_long_double_field; + MemberId member_id_bounded_sequence_long_double_field = 0x0000002a; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_long_double_field, member_flags_bounded_sequence_long_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_long_double_field, member_flags_bounded_sequence_long_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_long_double_field = "bounded_sequence_long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_long_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_long_double_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_long_double_field, member_ann_builtin_bounded_sequence_long_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_long_double_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_long_double_field, detail_bounded_sequence_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_long_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_bool_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_bool_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_bool_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_bool_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_bool_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_bool_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_bool_5 = 0; + PlainCollectionHeader header_anonymous_sequence_bool_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_bool_5, element_flags_anonymous_sequence_bool_5); + std::string type_id_kind_anonymous_sequence_bool_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_bool_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_bool_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_bool_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_bool_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_bool_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_bool_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_bool_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_bool_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_bool_field; + MemberId member_id_bounded_sequence_bool_field = 0x0000002b; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_bool_field, member_flags_bounded_sequence_bool_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_bool_field, member_flags_bounded_sequence_bool_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_bool_field = "bounded_sequence_bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_bool_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_bool_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_bool_field, member_ann_builtin_bounded_sequence_bool_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_bool_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_bool_field, detail_bounded_sequence_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_bool_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_anonymous_string_unbounded_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_anonymous_string_unbounded_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_anonymous_string_unbounded_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_anonymous_string_unbounded_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_anonymous_string_unbounded_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_anonymous_string_unbounded_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_anonymous_string_unbounded_5 = 0; + PlainCollectionHeader header_anonymous_sequence_anonymous_string_unbounded_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_string_unbounded_5, element_flags_anonymous_sequence_anonymous_string_unbounded_5); + std::string type_id_kind_anonymous_sequence_anonymous_string_unbounded_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_anonymous_string_unbounded_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_string_unbounded_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_string_unbounded_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_string_unbounded_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_anonymous_string_unbounded_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_string_unbounded_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_string_unbounded_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_anonymous_string_unbounded_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_string_field; + MemberId member_id_bounded_sequence_string_field = 0x0000002c; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_string_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_string_field, member_flags_bounded_sequence_string_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_string_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_string_field, member_flags_bounded_sequence_string_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_string_field = "bounded_sequence_string_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_string_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_string_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_string_field, member_ann_builtin_bounded_sequence_string_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_string_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_string_field, detail_bounded_sequence_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_string_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Color_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_Color_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Color_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Color_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_Color_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_Color_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_Color_5 = 0; + PlainCollectionHeader header_anonymous_sequence_Color_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_Color_5, element_flags_anonymous_sequence_Color_5); + std::string type_id_kind_anonymous_sequence_Color_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_Color_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_Color_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Color_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_Color_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_Color_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Color_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_Color_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Color_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_enum_field; + MemberId member_id_bounded_sequence_enum_field = 0x0000002d; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_enum_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_enum_field, member_flags_bounded_sequence_enum_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_enum_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_enum_field, member_flags_bounded_sequence_enum_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_enum_field = "bounded_sequence_enum_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_enum_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_enum_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_enum_field, member_ann_builtin_bounded_sequence_enum_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_enum_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_enum_field, detail_bounded_sequence_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_enum_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Material_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_Material_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Material_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Material_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_Material_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_Material_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_Material_5 = 0; + PlainCollectionHeader header_anonymous_sequence_Material_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_Material_5, element_flags_anonymous_sequence_Material_5); + std::string type_id_kind_anonymous_sequence_Material_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_Material_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_Material_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Material_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_Material_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_Material_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Material_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_Material_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Material_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_enum2_field; + MemberId member_id_bounded_sequence_enum2_field = 0x0000002e; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_enum2_field, member_flags_bounded_sequence_enum2_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_enum2_field, member_flags_bounded_sequence_enum2_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_enum2_field = "bounded_sequence_enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_enum2_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_enum2_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_enum2_field, member_ann_builtin_bounded_sequence_enum2_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_enum2_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_enum2_field, detail_bounded_sequence_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_enum2_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_StructType_5", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_StructType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + true, false); + ReturnCode_t return_code_StructType; + TypeIdentifierPair type_ids_StructType; + QualifiedTypeName type_name_StructType = "StructType"; + eprosima::fastcdr::optional type_ann_builtin_StructType; + eprosima::fastcdr::optional ann_custom_StructType; + AppliedAnnotationSeq tmp_ann_custom_StructType; + eprosima::fastcdr::optional verbatim_StructType; + if (!tmp_ann_custom_StructType.empty()) + { + ann_custom_StructType = tmp_ann_custom_StructType; + } + + CompleteTypeDetail detail_StructType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructType, ann_custom_StructType, type_name_StructType.to_string()); + CompleteStructHeader header_StructType; + header_StructType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructType); + CompleteStructMemberSeq member_seq_StructType; + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_StructType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_char_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_StructType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint8_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_StructType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_StructType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_StructType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_StructType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_StructType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_StructType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_StructType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_float_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_StructType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_StructType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_long_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_StructType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_bool_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_StructType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_string_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_StructType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_StructType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum2_field); + } + CompleteStructType struct_type_StructType = TypeObjectUtils::build_complete_struct_type(struct_flags_StructType, header_StructType, member_seq_StructType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructType, type_name_StructType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_StructType_5 {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_StructType_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_StructType_5 = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_StructType_5 = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_StructType_5 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_StructType_5 = 0; + PlainCollectionHeader header_anonymous_sequence_StructType_5 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_StructType_5, element_flags_anonymous_sequence_StructType_5); + std::string type_id_kind_anonymous_sequence_StructType_5("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_StructType_5 == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = static_cast(5); + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_StructType_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_StructType_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_StructType_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_5 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 5; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_StructType_5, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_StructType_5)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_StructType_5")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_5 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_StructType_5", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_5: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_bounded_sequence_struct_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bounded_sequence_struct_field; + MemberId member_id_bounded_sequence_struct_field = 0x0000002f; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_struct_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_struct_field, member_flags_bounded_sequence_struct_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bounded_sequence_struct_field = TypeObjectUtils::build_common_struct_member(member_id_bounded_sequence_struct_field, member_flags_bounded_sequence_struct_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bounded_sequence_struct_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bounded_sequence_struct_field = "bounded_sequence_struct_field"; + eprosima::fastcdr::optional member_ann_builtin_bounded_sequence_struct_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_bounded_sequence_struct_field = TypeObjectUtils::build_complete_member_detail(name_bounded_sequence_struct_field, member_ann_builtin_bounded_sequence_struct_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_bounded_sequence_struct_field = TypeObjectUtils::build_complete_struct_member(common_bounded_sequence_struct_field, detail_bounded_sequence_struct_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_bounded_sequence_struct_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_char_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_char_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_char_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_char_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_char_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_char_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_char_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_char_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_char_unbounded, element_flags_anonymous_sequence_char_unbounded); + std::string type_id_kind_anonymous_sequence_char_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_char_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_char_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_char_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_char_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_char_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_char_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_char_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_char_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_char_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_char_field; + MemberId member_id_unbounded_sequence_char_field = 0x00000030; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_char_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_char_field, member_flags_unbounded_sequence_char_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_char_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_char_field, member_flags_unbounded_sequence_char_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_char_field = "unbounded_sequence_char_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_char_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_char_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_char_field, member_ann_builtin_unbounded_sequence_char_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_char_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_char_field, detail_unbounded_sequence_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_char_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_uint8_field; + MemberId member_id_unbounded_sequence_uint8_field = 0x00000031; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint8_field, member_flags_unbounded_sequence_uint8_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint8_field, member_flags_unbounded_sequence_uint8_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_uint8_field = "unbounded_sequence_uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_uint8_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_uint8_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_uint8_field, member_ann_builtin_unbounded_sequence_uint8_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_uint8_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_uint8_field, detail_unbounded_sequence_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_uint8_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int16_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int16_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int16_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int16_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int16_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int16_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int16_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_int16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int16_t_unbounded, element_flags_anonymous_sequence_int16_t_unbounded); + std::string type_id_kind_anonymous_sequence_int16_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int16_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int16_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int16_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int16_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int16_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int16_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int16_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int16_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int16_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_int16_field; + MemberId member_id_unbounded_sequence_int16_field = 0x00000032; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int16_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int16_field, member_flags_unbounded_sequence_int16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int16_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int16_field, member_flags_unbounded_sequence_int16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_int16_field = "unbounded_sequence_int16_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_int16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_int16_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_int16_field, member_ann_builtin_unbounded_sequence_int16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_int16_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_int16_field, detail_unbounded_sequence_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_int16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint16_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint16_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint16_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint16_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint16_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint16_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint16_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint16_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint16_t_unbounded, element_flags_anonymous_sequence_uint16_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint16_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint16_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint16_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint16_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint16_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint16_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint16_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint16_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint16_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint16_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_uint16_field; + MemberId member_id_unbounded_sequence_uint16_field = 0x00000033; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint16_field, member_flags_unbounded_sequence_uint16_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint16_field, member_flags_unbounded_sequence_uint16_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_uint16_field = "unbounded_sequence_uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_uint16_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_uint16_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_uint16_field, member_ann_builtin_unbounded_sequence_uint16_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_uint16_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_uint16_field, detail_unbounded_sequence_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_uint16_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int32_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int32_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int32_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int32_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int32_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int32_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_int32_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int32_t_unbounded, element_flags_anonymous_sequence_int32_t_unbounded); + std::string type_id_kind_anonymous_sequence_int32_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int32_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int32_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int32_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int32_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int32_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int32_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int32_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int32_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_int32_field; + MemberId member_id_unbounded_sequence_int32_field = 0x00000034; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int32_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int32_field, member_flags_unbounded_sequence_int32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int32_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int32_field, member_flags_unbounded_sequence_int32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_int32_field = "unbounded_sequence_int32_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_int32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_int32_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_int32_field, member_ann_builtin_unbounded_sequence_int32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_int32_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_int32_field, detail_unbounded_sequence_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_int32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint32_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint32_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint32_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint32_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint32_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint32_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint32_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint32_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint32_t_unbounded, element_flags_anonymous_sequence_uint32_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint32_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint32_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint32_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint32_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint32_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint32_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint32_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint32_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint32_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint32_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_uint32_field; + MemberId member_id_unbounded_sequence_uint32_field = 0x00000035; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint32_field, member_flags_unbounded_sequence_uint32_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint32_field, member_flags_unbounded_sequence_uint32_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_uint32_field = "unbounded_sequence_uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_uint32_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_uint32_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_uint32_field, member_ann_builtin_unbounded_sequence_uint32_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_uint32_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_uint32_field, detail_unbounded_sequence_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_uint32_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int64_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_int64_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int64_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_int64_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_int64_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_int64_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_int64_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_int64_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_int64_t_unbounded, element_flags_anonymous_sequence_int64_t_unbounded); + std::string type_id_kind_anonymous_sequence_int64_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_int64_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_int64_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int64_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_int64_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_int64_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_int64_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_int64_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_int64_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_int64_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_int64_field; + MemberId member_id_unbounded_sequence_int64_field = 0x00000036; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int64_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int64_field, member_flags_unbounded_sequence_int64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_int64_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_int64_field, member_flags_unbounded_sequence_int64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_int64_field = "unbounded_sequence_int64_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_int64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_int64_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_int64_field, member_ann_builtin_unbounded_sequence_int64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_int64_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_int64_field, detail_unbounded_sequence_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_int64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint64_t_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint64_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint64_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint64_t_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint64_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint64_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint64_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint64_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint64_t_unbounded, element_flags_anonymous_sequence_uint64_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint64_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint64_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint64_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint64_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint64_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint64_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint64_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint64_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint64_t_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint64_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_uint64_field; + MemberId member_id_unbounded_sequence_uint64_field = 0x00000037; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint64_field, member_flags_unbounded_sequence_uint64_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_uint64_field, member_flags_unbounded_sequence_uint64_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_uint64_field = "unbounded_sequence_uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_uint64_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_uint64_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_uint64_field, member_ann_builtin_unbounded_sequence_uint64_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_uint64_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_uint64_field, detail_unbounded_sequence_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_uint64_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_float_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_float_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_float_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_float_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_float_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_float_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_float_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_float_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_float_unbounded, element_flags_anonymous_sequence_float_unbounded); + std::string type_id_kind_anonymous_sequence_float_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_float_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_float_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_float_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_float_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_float_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_float_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_float_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_float_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_float_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_float_field; + MemberId member_id_unbounded_sequence_float_field = 0x00000038; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_float_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_float_field, member_flags_unbounded_sequence_float_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_float_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_float_field, member_flags_unbounded_sequence_float_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_float_field = "unbounded_sequence_float_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_float_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_float_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_float_field, member_ann_builtin_unbounded_sequence_float_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_float_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_float_field, detail_unbounded_sequence_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_float_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_double_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_double_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_double_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_double_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_double_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_double_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_double_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_double_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_double_unbounded, element_flags_anonymous_sequence_double_unbounded); + std::string type_id_kind_anonymous_sequence_double_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_double_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_double_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_double_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_double_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_double_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_double_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_double_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_double_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_double_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_double_field; + MemberId member_id_unbounded_sequence_double_field = 0x00000039; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_double_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_double_field, member_flags_unbounded_sequence_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_double_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_double_field, member_flags_unbounded_sequence_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_double_field = "unbounded_sequence_double_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_double_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_double_field, member_ann_builtin_unbounded_sequence_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_double_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_double_field, detail_unbounded_sequence_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_longdouble_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_longdouble_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_longdouble_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_longdouble_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_longdouble_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_longdouble_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_longdouble_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_longdouble_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_longdouble_unbounded, element_flags_anonymous_sequence_longdouble_unbounded); + std::string type_id_kind_anonymous_sequence_longdouble_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_longdouble_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_longdouble_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_longdouble_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_longdouble_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_longdouble_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_longdouble_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_longdouble_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_longdouble_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_longdouble_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_long_double_field; + MemberId member_id_unbounded_sequence_long_double_field = 0x0000003a; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_long_double_field, member_flags_unbounded_sequence_long_double_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_long_double_field, member_flags_unbounded_sequence_long_double_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_long_double_field = "unbounded_sequence_long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_long_double_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_long_double_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_long_double_field, member_ann_builtin_unbounded_sequence_long_double_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_long_double_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_long_double_field, detail_unbounded_sequence_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_long_double_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_bool_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_bool_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_bool_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_bool_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_bool_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_bool_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_bool_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_bool_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_bool_unbounded, element_flags_anonymous_sequence_bool_unbounded); + std::string type_id_kind_anonymous_sequence_bool_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_bool_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_bool_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_bool_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_bool_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_bool_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_bool_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_bool_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_bool_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_bool_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_bool_field; + MemberId member_id_unbounded_sequence_bool_field = 0x0000003b; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_bool_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_bool_field, member_flags_unbounded_sequence_bool_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_bool_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_bool_field, member_flags_unbounded_sequence_bool_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_bool_field = "unbounded_sequence_bool_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_bool_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_bool_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_bool_field, member_ann_builtin_unbounded_sequence_bool_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_bool_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_bool_field, detail_unbounded_sequence_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_bool_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_anonymous_string_unbounded_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_anonymous_string_unbounded_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_anonymous_string_unbounded_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_anonymous_string_unbounded_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_anonymous_string_unbounded_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_anonymous_string_unbounded_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_anonymous_string_unbounded_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_anonymous_string_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_anonymous_string_unbounded_unbounded, element_flags_anonymous_sequence_anonymous_string_unbounded_unbounded); + std::string type_id_kind_anonymous_sequence_anonymous_string_unbounded_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_anonymous_string_unbounded_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_anonymous_string_unbounded_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_string_unbounded_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_anonymous_string_unbounded_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_anonymous_string_unbounded_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_anonymous_string_unbounded_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_anonymous_string_unbounded_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_anonymous_string_unbounded_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_anonymous_string_unbounded_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_string_field; + MemberId member_id_unbounded_sequence_string_field = 0x0000003c; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_string_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_string_field, member_flags_unbounded_sequence_string_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_string_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_string_field, member_flags_unbounded_sequence_string_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_string_field = "unbounded_sequence_string_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_string_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_string_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_string_field, member_ann_builtin_unbounded_sequence_string_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_string_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_string_field, detail_unbounded_sequence_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_string_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Color_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_Color_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Color_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Color_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_Color_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_Color_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_Color_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_Color_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_Color_unbounded, element_flags_anonymous_sequence_Color_unbounded); + std::string type_id_kind_anonymous_sequence_Color_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_Color_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_Color_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Color_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_Color_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_Color_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Color_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_Color_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Color_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Color_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_enum_field; + MemberId member_id_unbounded_sequence_enum_field = 0x0000003d; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_enum_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_enum_field, member_flags_unbounded_sequence_enum_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_enum_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_enum_field, member_flags_unbounded_sequence_enum_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_enum_field = "unbounded_sequence_enum_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_enum_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_enum_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_enum_field, member_ann_builtin_unbounded_sequence_enum_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_enum_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_enum_field, detail_unbounded_sequence_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_enum_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Material_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + TypeIdentifier* element_identifier_anonymous_sequence_Material_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Material_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_Material_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_Material_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_Material_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_Material_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_Material_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_Material_unbounded, element_flags_anonymous_sequence_Material_unbounded); + std::string type_id_kind_anonymous_sequence_Material_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_Material_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_Material_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Material_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_Material_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_Material_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_Material_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_Material_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_Material_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_Material_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_enum2_field; + MemberId member_id_unbounded_sequence_enum2_field = 0x0000003e; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_enum2_field, member_flags_unbounded_sequence_enum2_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_enum2_field, member_flags_unbounded_sequence_enum2_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_enum2_field = "unbounded_sequence_enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_enum2_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_enum2_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_enum2_field, member_ann_builtin_unbounded_sequence_enum2_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_enum2_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_enum2_field, detail_unbounded_sequence_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_enum2_field); + } + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_StructType_unbounded", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_ContentFilterTestType); + + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + { + StructTypeFlag struct_flags_StructType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + true, false); + ReturnCode_t return_code_StructType; + TypeIdentifierPair type_ids_StructType; + QualifiedTypeName type_name_StructType = "StructType"; + eprosima::fastcdr::optional type_ann_builtin_StructType; + eprosima::fastcdr::optional ann_custom_StructType; + AppliedAnnotationSeq tmp_ann_custom_StructType; + eprosima::fastcdr::optional verbatim_StructType; + if (!tmp_ann_custom_StructType.empty()) + { + ann_custom_StructType = tmp_ann_custom_StructType; + } + + CompleteTypeDetail detail_StructType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_StructType, ann_custom_StructType, type_name_StructType.to_string()); + CompleteStructHeader header_StructType; + header_StructType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_StructType); + CompleteStructMemberSeq member_seq_StructType; + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "char_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_char_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_char_field; + MemberId member_id_char_field = 0x00000000; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_char_field = TypeObjectUtils::build_common_struct_member(member_id_char_field, member_flags_char_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure char_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_char_field = "char_field"; + eprosima::fastcdr::optional member_ann_builtin_char_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_char_field = TypeObjectUtils::build_complete_member_detail(name_char_field, member_ann_builtin_char_field, ann_custom_StructType); + CompleteStructMember member_char_field = TypeObjectUtils::build_complete_struct_member(common_char_field, detail_char_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_char_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint8_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint8_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint8_field; + MemberId member_id_uint8_field = 0x00000001; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint8_field = TypeObjectUtils::build_common_struct_member(member_id_uint8_field, member_flags_uint8_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint8_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint8_field = "uint8_field"; + eprosima::fastcdr::optional member_ann_builtin_uint8_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint8_field = TypeObjectUtils::build_complete_member_detail(name_uint8_field, member_ann_builtin_uint8_field, ann_custom_StructType); + CompleteStructMember member_uint8_field = TypeObjectUtils::build_complete_struct_member(common_uint8_field, detail_uint8_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint8_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int16_field; + MemberId member_id_int16_field = 0x00000002; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int16_field = TypeObjectUtils::build_common_struct_member(member_id_int16_field, member_flags_int16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int16_field = "int16_field"; + eprosima::fastcdr::optional member_ann_builtin_int16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int16_field = TypeObjectUtils::build_complete_member_detail(name_int16_field, member_ann_builtin_int16_field, ann_custom_StructType); + CompleteStructMember member_int16_field = TypeObjectUtils::build_complete_struct_member(common_int16_field, detail_int16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint16_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint16_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint16_field; + MemberId member_id_uint16_field = 0x00000003; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint16_field = TypeObjectUtils::build_common_struct_member(member_id_uint16_field, member_flags_uint16_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint16_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint16_field = "uint16_field"; + eprosima::fastcdr::optional member_ann_builtin_uint16_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint16_field = TypeObjectUtils::build_complete_member_detail(name_uint16_field, member_ann_builtin_uint16_field, ann_custom_StructType); + CompleteStructMember member_uint16_field = TypeObjectUtils::build_complete_struct_member(common_uint16_field, detail_uint16_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint16_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int32_field; + MemberId member_id_int32_field = 0x00000004; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int32_field = TypeObjectUtils::build_common_struct_member(member_id_int32_field, member_flags_int32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int32_field = "int32_field"; + eprosima::fastcdr::optional member_ann_builtin_int32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int32_field = TypeObjectUtils::build_complete_member_detail(name_int32_field, member_ann_builtin_int32_field, ann_custom_StructType); + CompleteStructMember member_int32_field = TypeObjectUtils::build_complete_struct_member(common_int32_field, detail_int32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint32_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint32_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint32_field; + MemberId member_id_uint32_field = 0x00000005; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint32_field = TypeObjectUtils::build_common_struct_member(member_id_uint32_field, member_flags_uint32_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint32_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint32_field = "uint32_field"; + eprosima::fastcdr::optional member_ann_builtin_uint32_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint32_field = TypeObjectUtils::build_complete_member_detail(name_uint32_field, member_ann_builtin_uint32_field, ann_custom_StructType); + CompleteStructMember member_uint32_field = TypeObjectUtils::build_complete_struct_member(common_uint32_field, detail_uint32_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint32_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "int64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_int64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_int64_field; + MemberId member_id_int64_field = 0x00000006; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_int64_field = TypeObjectUtils::build_common_struct_member(member_id_int64_field, member_flags_int64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure int64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_int64_field = "int64_field"; + eprosima::fastcdr::optional member_ann_builtin_int64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_int64_field = TypeObjectUtils::build_complete_member_detail(name_int64_field, member_ann_builtin_int64_field, ann_custom_StructType); + CompleteStructMember member_int64_field = TypeObjectUtils::build_complete_struct_member(common_int64_field, detail_int64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_int64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint64_t", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "uint64_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_uint64_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_uint64_field; + MemberId member_id_uint64_field = 0x00000007; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_uint64_field = TypeObjectUtils::build_common_struct_member(member_id_uint64_field, member_flags_uint64_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure uint64_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_uint64_field = "uint64_field"; + eprosima::fastcdr::optional member_ann_builtin_uint64_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_uint64_field = TypeObjectUtils::build_complete_member_detail(name_uint64_field, member_ann_builtin_uint64_field, ann_custom_StructType); + CompleteStructMember member_uint64_field = TypeObjectUtils::build_complete_struct_member(common_uint64_field, detail_uint64_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_uint64_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "float_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_float_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_float_field; + MemberId member_id_float_field = 0x00000008; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_float_field = TypeObjectUtils::build_common_struct_member(member_id_float_field, member_flags_float_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure float_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_float_field = "float_field"; + eprosima::fastcdr::optional member_ann_builtin_float_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_float_field = TypeObjectUtils::build_complete_member_detail(name_float_field, member_ann_builtin_float_field, ann_custom_StructType); + CompleteStructMember member_float_field = TypeObjectUtils::build_complete_struct_member(common_float_field, detail_float_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_float_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_double", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_double_field; + MemberId member_id_double_field = 0x00000009; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_double_field = TypeObjectUtils::build_common_struct_member(member_id_double_field, member_flags_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_double_field = "double_field"; + eprosima::fastcdr::optional member_ann_builtin_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_double_field = TypeObjectUtils::build_complete_member_detail(name_double_field, member_ann_builtin_double_field, ann_custom_StructType); + CompleteStructMember member_double_field = TypeObjectUtils::build_complete_struct_member(common_double_field, detail_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_longdouble", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "long_double_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_long_double_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_long_double_field; + MemberId member_id_long_double_field = 0x0000000a; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_long_double_field = TypeObjectUtils::build_common_struct_member(member_id_long_double_field, member_flags_long_double_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure long_double_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_long_double_field = "long_double_field"; + eprosima::fastcdr::optional member_ann_builtin_long_double_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_long_double_field = TypeObjectUtils::build_complete_member_detail(name_long_double_field, member_ann_builtin_long_double_field, ann_custom_StructType); + CompleteStructMember member_long_double_field = TypeObjectUtils::build_complete_struct_member(common_long_double_field, detail_long_double_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_long_double_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "bool_field Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_bool_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_bool_field; + MemberId member_id_bool_field = 0x0000000b; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_bool_field = TypeObjectUtils::build_common_struct_member(member_id_bool_field, member_flags_bool_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure bool_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_bool_field = "bool_field"; + eprosima::fastcdr::optional member_ann_builtin_bool_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_bool_field = TypeObjectUtils::build_complete_member_detail(name_bool_field, member_ann_builtin_bool_field, ann_custom_StructType); + CompleteStructMember member_bool_field = TypeObjectUtils::build_complete_struct_member(common_bool_field, detail_bool_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_bool_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_string_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_string_field; + MemberId member_id_string_field = 0x0000000c; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_string_field = TypeObjectUtils::build_common_struct_member(member_id_string_field, member_flags_string_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure string_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_string_field = "string_field"; + eprosima::fastcdr::optional member_ann_builtin_string_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_string_field = TypeObjectUtils::build_complete_member_detail(name_string_field, member_ann_builtin_string_field, ann_custom_StructType); + CompleteStructMember member_string_field = TypeObjectUtils::build_complete_struct_member(common_string_field, detail_string_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_string_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Color = 0; + BitBound bit_bound_Color = 32; + CommonEnumeratedHeader common_Color = TypeObjectUtils::build_common_enumerated_header(bit_bound_Color); + QualifiedTypeName type_name_Color = "Color"; + eprosima::fastcdr::optional type_ann_builtin_Color; + eprosima::fastcdr::optional ann_custom_Color; + CompleteTypeDetail detail_Color = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Color, ann_custom_Color, type_name_Color.to_string()); + CompleteEnumeratedHeader header_Color = TypeObjectUtils::build_complete_enumerated_header(common_Color, detail_Color); + CompleteEnumeratedLiteralSeq literal_seq_Color; + { + EnumeratedLiteralFlag flags_RED = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_RED = TypeObjectUtils::build_common_enumerated_literal(0, flags_RED); + eprosima::fastcdr::optional member_ann_builtin_RED; + ann_custom_Color.reset(); + MemberName name_RED = "RED"; + CompleteMemberDetail detail_RED = TypeObjectUtils::build_complete_member_detail(name_RED, member_ann_builtin_RED, ann_custom_Color); + CompleteEnumeratedLiteral literal_RED = TypeObjectUtils::build_complete_enumerated_literal(common_RED, detail_RED); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_RED); + } + { + EnumeratedLiteralFlag flags_GREEN = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_GREEN = TypeObjectUtils::build_common_enumerated_literal(1, flags_GREEN); + eprosima::fastcdr::optional member_ann_builtin_GREEN; + ann_custom_Color.reset(); + MemberName name_GREEN = "GREEN"; + CompleteMemberDetail detail_GREEN = TypeObjectUtils::build_complete_member_detail(name_GREEN, member_ann_builtin_GREEN, ann_custom_Color); + CompleteEnumeratedLiteral literal_GREEN = TypeObjectUtils::build_complete_enumerated_literal(common_GREEN, detail_GREEN); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_GREEN); + } + { + EnumeratedLiteralFlag flags_BLUE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_BLUE = TypeObjectUtils::build_common_enumerated_literal(2, flags_BLUE); + eprosima::fastcdr::optional member_ann_builtin_BLUE; + ann_custom_Color.reset(); + MemberName name_BLUE = "BLUE"; + CompleteMemberDetail detail_BLUE = TypeObjectUtils::build_complete_member_detail(name_BLUE, member_ann_builtin_BLUE, ann_custom_Color); + CompleteEnumeratedLiteral literal_BLUE = TypeObjectUtils::build_complete_enumerated_literal(common_BLUE, detail_BLUE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_BLUE); + } + { + EnumeratedLiteralFlag flags_YELLOW = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_YELLOW = TypeObjectUtils::build_common_enumerated_literal(3, flags_YELLOW); + eprosima::fastcdr::optional member_ann_builtin_YELLOW; + ann_custom_Color.reset(); + MemberName name_YELLOW = "YELLOW"; + CompleteMemberDetail detail_YELLOW = TypeObjectUtils::build_complete_member_detail(name_YELLOW, member_ann_builtin_YELLOW, ann_custom_Color); + CompleteEnumeratedLiteral literal_YELLOW = TypeObjectUtils::build_complete_enumerated_literal(common_YELLOW, detail_YELLOW); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_YELLOW); + } + { + EnumeratedLiteralFlag flags_MAGENTA = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MAGENTA = TypeObjectUtils::build_common_enumerated_literal(4, flags_MAGENTA); + eprosima::fastcdr::optional member_ann_builtin_MAGENTA; + ann_custom_Color.reset(); + MemberName name_MAGENTA = "MAGENTA"; + CompleteMemberDetail detail_MAGENTA = TypeObjectUtils::build_complete_member_detail(name_MAGENTA, member_ann_builtin_MAGENTA, ann_custom_Color); + CompleteEnumeratedLiteral literal_MAGENTA = TypeObjectUtils::build_complete_enumerated_literal(common_MAGENTA, detail_MAGENTA); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Color, literal_MAGENTA); + } + CompleteEnumeratedType enumerated_type_Color = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Color, header_Color, + literal_seq_Color); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Color, type_name_Color.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Color", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Color: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum_field; + MemberId member_id_enum_field = 0x0000000d; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum_field = TypeObjectUtils::build_common_struct_member(member_id_enum_field, member_flags_enum_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum_field = "enum_field"; + eprosima::fastcdr::optional member_ann_builtin_enum_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum_field = TypeObjectUtils::build_complete_member_detail(name_enum_field, member_ann_builtin_enum_field, ann_custom_StructType); + CompleteStructMember member_enum_field = TypeObjectUtils::build_complete_struct_member(common_enum_field, detail_enum_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum_field); + } + { + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_Material = 0; + BitBound bit_bound_Material = 32; + CommonEnumeratedHeader common_Material = TypeObjectUtils::build_common_enumerated_header(bit_bound_Material); + QualifiedTypeName type_name_Material = "Material"; + eprosima::fastcdr::optional type_ann_builtin_Material; + eprosima::fastcdr::optional ann_custom_Material; + CompleteTypeDetail detail_Material = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Material, ann_custom_Material, type_name_Material.to_string()); + CompleteEnumeratedHeader header_Material = TypeObjectUtils::build_complete_enumerated_header(common_Material, detail_Material); + CompleteEnumeratedLiteralSeq literal_seq_Material; + { + EnumeratedLiteralFlag flags_WOOD = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_WOOD = TypeObjectUtils::build_common_enumerated_literal(0, flags_WOOD); + eprosima::fastcdr::optional member_ann_builtin_WOOD; + ann_custom_Material.reset(); + MemberName name_WOOD = "WOOD"; + CompleteMemberDetail detail_WOOD = TypeObjectUtils::build_complete_member_detail(name_WOOD, member_ann_builtin_WOOD, ann_custom_Material); + CompleteEnumeratedLiteral literal_WOOD = TypeObjectUtils::build_complete_enumerated_literal(common_WOOD, detail_WOOD); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_WOOD); + } + { + EnumeratedLiteralFlag flags_PLASTIC = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_PLASTIC = TypeObjectUtils::build_common_enumerated_literal(1, flags_PLASTIC); + eprosima::fastcdr::optional member_ann_builtin_PLASTIC; + ann_custom_Material.reset(); + MemberName name_PLASTIC = "PLASTIC"; + CompleteMemberDetail detail_PLASTIC = TypeObjectUtils::build_complete_member_detail(name_PLASTIC, member_ann_builtin_PLASTIC, ann_custom_Material); + CompleteEnumeratedLiteral literal_PLASTIC = TypeObjectUtils::build_complete_enumerated_literal(common_PLASTIC, detail_PLASTIC); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_PLASTIC); + } + { + EnumeratedLiteralFlag flags_METAL = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_METAL = TypeObjectUtils::build_common_enumerated_literal(2, flags_METAL); + eprosima::fastcdr::optional member_ann_builtin_METAL; + ann_custom_Material.reset(); + MemberName name_METAL = "METAL"; + CompleteMemberDetail detail_METAL = TypeObjectUtils::build_complete_member_detail(name_METAL, member_ann_builtin_METAL, ann_custom_Material); + CompleteEnumeratedLiteral literal_METAL = TypeObjectUtils::build_complete_enumerated_literal(common_METAL, detail_METAL); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_METAL); + } + { + EnumeratedLiteralFlag flags_CONCRETE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_CONCRETE = TypeObjectUtils::build_common_enumerated_literal(3, flags_CONCRETE); + eprosima::fastcdr::optional member_ann_builtin_CONCRETE; + ann_custom_Material.reset(); + MemberName name_CONCRETE = "CONCRETE"; + CompleteMemberDetail detail_CONCRETE = TypeObjectUtils::build_complete_member_detail(name_CONCRETE, member_ann_builtin_CONCRETE, ann_custom_Material); + CompleteEnumeratedLiteral literal_CONCRETE = TypeObjectUtils::build_complete_enumerated_literal(common_CONCRETE, detail_CONCRETE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_CONCRETE); + } + { + EnumeratedLiteralFlag flags_STONE = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_STONE = TypeObjectUtils::build_common_enumerated_literal(4, flags_STONE); + eprosima::fastcdr::optional member_ann_builtin_STONE; + ann_custom_Material.reset(); + MemberName name_STONE = "STONE"; + CompleteMemberDetail detail_STONE = TypeObjectUtils::build_complete_member_detail(name_STONE, member_ann_builtin_STONE, ann_custom_Material); + CompleteEnumeratedLiteral literal_STONE = TypeObjectUtils::build_complete_enumerated_literal(common_STONE, detail_STONE); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_Material, literal_STONE); + } + CompleteEnumeratedType enumerated_type_Material = TypeObjectUtils::build_complete_enumerated_type(enum_flags_Material, header_Material, + literal_seq_Material); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_Material, type_name_Material.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Material", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Material: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_enum2_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_enum2_field; + MemberId member_id_enum2_field = 0x0000000e; + if (EK_COMPLETE == type_ids_StructType.type_identifier1()._d() || TK_NONE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier1()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_StructType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_StructType.type_identifier2()._d() && + EK_COMPLETE == type_ids_StructType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_StructType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_StructType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_enum2_field = TypeObjectUtils::build_common_struct_member(member_id_enum2_field, member_flags_enum2_field, type_ids_StructType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure enum2_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_enum2_field = "enum2_field"; + eprosima::fastcdr::optional member_ann_builtin_enum2_field; + ann_custom_StructType.reset(); + CompleteMemberDetail detail_enum2_field = TypeObjectUtils::build_complete_member_detail(name_enum2_field, member_ann_builtin_enum2_field, ann_custom_StructType); + CompleteStructMember member_enum2_field = TypeObjectUtils::build_complete_struct_member(common_enum2_field, detail_enum2_field); + TypeObjectUtils::add_complete_struct_member(member_seq_StructType, member_enum2_field); + } + CompleteStructType struct_type_StructType = TypeObjectUtils::build_complete_struct_type(struct_flags_StructType, header_StructType, member_seq_StructType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_StructType, type_name_StructType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType already registered in TypeObjectRegistry for a different type."); + } + return_code_StructType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "StructType", type_ids_StructType); + if (return_code_StructType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StructType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + } + TypeIdentifier* element_identifier_anonymous_sequence_StructType_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_StructType_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_StructType_unbounded = new TypeIdentifier(type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_StructType_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_StructType_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_StructType_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_StructType_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_StructType_unbounded, element_flags_anonymous_sequence_StructType_unbounded); + std::string type_id_kind_anonymous_sequence_StructType_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_StructType_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_StructType_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_StructType_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_StructType_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_StructType_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_StructType_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_StructType_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_StructType_unbounded", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_StructType_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_unbounded_sequence_struct_field = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_unbounded_sequence_struct_field; + MemberId member_id_unbounded_sequence_struct_field = 0x0000003f; + if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1()._d() || TK_NONE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_struct_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_struct_field, member_flags_unbounded_sequence_struct_field, type_ids_ContentFilterTestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ContentFilterTestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ContentFilterTestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_unbounded_sequence_struct_field = TypeObjectUtils::build_common_struct_member(member_id_unbounded_sequence_struct_field, member_flags_unbounded_sequence_struct_field, type_ids_ContentFilterTestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure unbounded_sequence_struct_field member TypeIdentifier inconsistent."); + return; + } + MemberName name_unbounded_sequence_struct_field = "unbounded_sequence_struct_field"; + eprosima::fastcdr::optional member_ann_builtin_unbounded_sequence_struct_field; + ann_custom_ContentFilterTestType.reset(); + CompleteMemberDetail detail_unbounded_sequence_struct_field = TypeObjectUtils::build_complete_member_detail(name_unbounded_sequence_struct_field, member_ann_builtin_unbounded_sequence_struct_field, ann_custom_ContentFilterTestType); + CompleteStructMember member_unbounded_sequence_struct_field = TypeObjectUtils::build_complete_struct_member(common_unbounded_sequence_struct_field, detail_unbounded_sequence_struct_field); + TypeObjectUtils::add_complete_struct_member(member_seq_ContentFilterTestType, member_unbounded_sequence_struct_field); + } + CompleteStructType struct_type_ContentFilterTestType = TypeObjectUtils::build_complete_struct_type(struct_flags_ContentFilterTestType, header_ContentFilterTestType, member_seq_ContentFilterTestType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ContentFilterTestType, type_name_ContentFilterTestType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ContentFilterTestType already registered in TypeObjectRegistry for a different type."); + } + return_code_ContentFilterTestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "ContentFilterTestType", type_ids_ContentFilterTestType); + if (return_code_ContentFilterTestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ContentFilterTestType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.hpp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.hpp new file mode 100644 index 00000000000..607d693ecc7 --- /dev/null +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObjectSupport.hpp @@ -0,0 +1,61 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! + * @file ContentFilterTestTypeTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_ContentFilterTestType_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register StructType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_StructType_type_identifier(); +/** + * @brief Register ContentFilterTestType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_ContentFilterTestType_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx deleted file mode 100644 index 6b2d8da6280..00000000000 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx +++ /dev/null @@ -1,5318 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ContentFilterTestType.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "ContentFilterTestType.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "ContentFilterTestTypeTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define StructType_max_cdr_typesize 344ULL; -#define ContentFilterTestType_max_cdr_typesize 73360ULL; - - - - - - -StructType::StructType() -{ - // char m_char_field - m_char_field = 0; - // octet m_uint8_field - m_uint8_field = 0; - // short m_int16_field - m_int16_field = 0; - // unsigned short m_uint16_field - m_uint16_field = 0; - // long m_int32_field - m_int32_field = 0; - // unsigned long m_uint32_field - m_uint32_field = 0; - // long long m_int64_field - m_int64_field = 0; - // unsigned long long m_uint64_field - m_uint64_field = 0; - // float m_float_field - m_float_field = 0.0; - // double m_double_field - m_double_field = 0.0; - // long double m_long_double_field - m_long_double_field = 0.0; - // boolean m_bool_field - m_bool_field = false; - // /type_d() m_string_field - - // Color m_enum_field - m_enum_field = ::RED; - // Material m_enum2_field - m_enum2_field = ::WOOD; - - // Just to register all known types - registerContentFilterTestTypeTypes(); -} - -StructType::~StructType() -{ -} - -StructType::StructType( - const StructType& x) -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = x.m_string_field; - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - -} - -StructType::StructType( - StructType&& x) noexcept -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = std::move(x.m_string_field); - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - -} - -StructType& StructType::operator =( - const StructType& x) -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = x.m_string_field; - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - return *this; -} - -StructType& StructType::operator =( - StructType&& x) noexcept -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = std::move(x.m_string_field); - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - return *this; -} - -bool StructType::operator ==( - const StructType& x) const -{ - return (m_char_field == x.m_char_field && - m_uint8_field == x.m_uint8_field && - m_int16_field == x.m_int16_field && - m_uint16_field == x.m_uint16_field && - m_int32_field == x.m_int32_field && - m_uint32_field == x.m_uint32_field && - m_int64_field == x.m_int64_field && - m_uint64_field == x.m_uint64_field && - m_float_field == x.m_float_field && - m_double_field == x.m_double_field && - m_long_double_field == x.m_long_double_field && - m_bool_field == x.m_bool_field && - m_string_field == x.m_string_field && - m_enum_field == x.m_enum_field && - m_enum2_field == x.m_enum2_field); -} - -bool StructType::operator !=( - const StructType& x) const -{ - return !(*this == x); -} - -size_t StructType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructType_max_cdr_typesize; -} - -size_t StructType::getCdrSerializedSize( - const StructType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void StructType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_char_field; - - scdr << m_uint8_field; - - scdr << m_int16_field; - - scdr << m_uint16_field; - - scdr << m_int32_field; - - scdr << m_uint32_field; - - scdr << m_int64_field; - - scdr << m_uint64_field; - - scdr << m_float_field; - - scdr << m_double_field; - - scdr << m_long_double_field; - - scdr << m_bool_field; - - scdr << m_string_field.c_str(); - - scdr << (uint32_t)m_enum_field; - - scdr << (uint32_t)m_enum2_field; - -} - -void StructType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_char_field; - - - - dcdr >> m_uint8_field; - - - - dcdr >> m_int16_field; - - - - dcdr >> m_uint16_field; - - - - dcdr >> m_int32_field; - - - - dcdr >> m_uint32_field; - - - - dcdr >> m_int64_field; - - - - dcdr >> m_uint64_field; - - - - dcdr >> m_float_field; - - - - dcdr >> m_double_field; - - - - dcdr >> m_long_double_field; - - - - dcdr >> m_bool_field; - - - - dcdr >> m_string_field; - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum_field = (Color)enum_value; - } - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum2_field = (Material)enum_value; - } - - -} - - -bool StructType::isKeyDefined() -{ - return false; -} - -void StructType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ -void StructType::char_field( - char _char_field) -{ - m_char_field = _char_field; -} - -/*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ -char StructType::char_field() const -{ - return m_char_field; -} - -/*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ -char& StructType::char_field() -{ - return m_char_field; -} - - -/*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ -void StructType::uint8_field( - uint8_t _uint8_field) -{ - m_uint8_field = _uint8_field; -} - -/*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ -uint8_t StructType::uint8_field() const -{ - return m_uint8_field; -} - -/*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ -uint8_t& StructType::uint8_field() -{ - return m_uint8_field; -} - - -/*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ -void StructType::int16_field( - int16_t _int16_field) -{ - m_int16_field = _int16_field; -} - -/*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ -int16_t StructType::int16_field() const -{ - return m_int16_field; -} - -/*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ -int16_t& StructType::int16_field() -{ - return m_int16_field; -} - - -/*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ -void StructType::uint16_field( - uint16_t _uint16_field) -{ - m_uint16_field = _uint16_field; -} - -/*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ -uint16_t StructType::uint16_field() const -{ - return m_uint16_field; -} - -/*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ -uint16_t& StructType::uint16_field() -{ - return m_uint16_field; -} - - -/*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ -void StructType::int32_field( - int32_t _int32_field) -{ - m_int32_field = _int32_field; -} - -/*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ -int32_t StructType::int32_field() const -{ - return m_int32_field; -} - -/*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ -int32_t& StructType::int32_field() -{ - return m_int32_field; -} - - -/*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ -void StructType::uint32_field( - uint32_t _uint32_field) -{ - m_uint32_field = _uint32_field; -} - -/*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ -uint32_t StructType::uint32_field() const -{ - return m_uint32_field; -} - -/*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ -uint32_t& StructType::uint32_field() -{ - return m_uint32_field; -} - - -/*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ -void StructType::int64_field( - int64_t _int64_field) -{ - m_int64_field = _int64_field; -} - -/*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ -int64_t StructType::int64_field() const -{ - return m_int64_field; -} - -/*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ -int64_t& StructType::int64_field() -{ - return m_int64_field; -} - - -/*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ -void StructType::uint64_field( - uint64_t _uint64_field) -{ - m_uint64_field = _uint64_field; -} - -/*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ -uint64_t StructType::uint64_field() const -{ - return m_uint64_field; -} - -/*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ -uint64_t& StructType::uint64_field() -{ - return m_uint64_field; -} - - -/*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ -void StructType::float_field( - float _float_field) -{ - m_float_field = _float_field; -} - -/*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ -float StructType::float_field() const -{ - return m_float_field; -} - -/*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ -float& StructType::float_field() -{ - return m_float_field; -} - - -/*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ -void StructType::double_field( - double _double_field) -{ - m_double_field = _double_field; -} - -/*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ -double StructType::double_field() const -{ - return m_double_field; -} - -/*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ -double& StructType::double_field() -{ - return m_double_field; -} - - -/*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ -void StructType::long_double_field( - long double _long_double_field) -{ - m_long_double_field = _long_double_field; -} - -/*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ -long double StructType::long_double_field() const -{ - return m_long_double_field; -} - -/*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ -long double& StructType::long_double_field() -{ - return m_long_double_field; -} - - -/*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ -void StructType::bool_field( - bool _bool_field) -{ - m_bool_field = _bool_field; -} - -/*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ -bool StructType::bool_field() const -{ - return m_bool_field; -} - -/*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ -bool& StructType::bool_field() -{ - return m_bool_field; -} - - -/*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ -void StructType::string_field( - const std::string& _string_field) -{ - m_string_field = _string_field; -} - -/*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ -void StructType::string_field( - std::string&& _string_field) -{ - m_string_field = std::move(_string_field); -} - -/*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ -const std::string& StructType::string_field() const -{ - return m_string_field; -} - -/*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ -std::string& StructType::string_field() -{ - return m_string_field; -} - - -/*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ -void StructType::enum_field( - Color _enum_field) -{ - m_enum_field = _enum_field; -} - -/*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ -Color StructType::enum_field() const -{ - return m_enum_field; -} - -/*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ -Color& StructType::enum_field() -{ - return m_enum_field; -} - - -/*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ -void StructType::enum2_field( - Material _enum2_field) -{ - m_enum2_field = _enum2_field; -} - -/*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ -Material StructType::enum2_field() const -{ - return m_enum2_field; -} - -/*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ -Material& StructType::enum2_field() -{ - return m_enum2_field; -} - - - - - - - - - -ContentFilterTestType::ContentFilterTestType() -{ - // char m_char_field - m_char_field = 0; - // octet m_uint8_field - m_uint8_field = 0; - // short m_int16_field - m_int16_field = 0; - // unsigned short m_uint16_field - m_uint16_field = 0; - // long m_int32_field - m_int32_field = 0; - // unsigned long m_uint32_field - m_uint32_field = 0; - // long long m_int64_field - m_int64_field = 0; - // unsigned long long m_uint64_field - m_uint64_field = 0; - // float m_float_field - m_float_field = 0.0; - // double m_double_field - m_double_field = 0.0; - // long double m_long_double_field - m_long_double_field = 0.0; - // boolean m_bool_field - m_bool_field = false; - // /type_d() m_string_field - - // Color m_enum_field - m_enum_field = ::RED; - // Material m_enum2_field - m_enum2_field = ::WOOD; - // StructType m_struct_field - - // char m_array_char_field - memset(&m_array_char_field, 0, ((max_array_size)) * 1); - // octet m_array_uint8_field - memset(&m_array_uint8_field, 0, ((max_array_size)) * 1); - // short m_array_int16_field - memset(&m_array_int16_field, 0, ((max_array_size)) * 2); - // unsigned short m_array_uint16_field - memset(&m_array_uint16_field, 0, ((max_array_size)) * 2); - // long m_array_int32_field - memset(&m_array_int32_field, 0, ((max_array_size)) * 4); - // unsigned long m_array_uint32_field - memset(&m_array_uint32_field, 0, ((max_array_size)) * 4); - // long long m_array_int64_field - memset(&m_array_int64_field, 0, ((max_array_size)) * 8); - // unsigned long long m_array_uint64_field - memset(&m_array_uint64_field, 0, ((max_array_size)) * 8); - // float m_array_float_field - memset(&m_array_float_field, 0, ((max_array_size)) * 4); - // double m_array_double_field - memset(&m_array_double_field, 0, ((max_array_size)) * 8); - // long double m_array_long_double_field - memset(&m_array_long_double_field, 0, ((max_array_size)) * 16); - // boolean m_array_bool_field - memset(&m_array_bool_field, 0, ((max_array_size)) * 1); - // /type_d() m_array_string_field - - // Color m_array_enum_field - memset(&m_array_enum_field, 0, ((max_array_size)) * 4); - // Material m_array_enum2_field - memset(&m_array_enum2_field, 0, ((max_array_size)) * 4); - // StructType m_array_struct_field - - // sequence m_bounded_sequence_char_field - - // sequence m_bounded_sequence_uint8_field - - // sequence m_bounded_sequence_int16_field - - // sequence m_bounded_sequence_uint16_field - - // sequence m_bounded_sequence_int32_field - - // sequence m_bounded_sequence_uint32_field - - // sequence m_bounded_sequence_int64_field - - // sequence m_bounded_sequence_uint64_field - - // sequence m_bounded_sequence_float_field - - // sequence m_bounded_sequence_double_field - - // sequence m_bounded_sequence_long_double_field - - // sequence m_bounded_sequence_bool_field - - // sequence m_bounded_sequence_string_field - - // sequence m_bounded_sequence_enum_field - - // sequence m_bounded_sequence_enum2_field - - // sequence m_bounded_sequence_struct_field - - // sequence m_unbounded_sequence_char_field - - // sequence m_unbounded_sequence_uint8_field - - // sequence m_unbounded_sequence_int16_field - - // sequence m_unbounded_sequence_uint16_field - - // sequence m_unbounded_sequence_int32_field - - // sequence m_unbounded_sequence_uint32_field - - // sequence m_unbounded_sequence_int64_field - - // sequence m_unbounded_sequence_uint64_field - - // sequence m_unbounded_sequence_float_field - - // sequence m_unbounded_sequence_double_field - - // sequence m_unbounded_sequence_long_double_field - - // sequence m_unbounded_sequence_bool_field - - // sequence m_unbounded_sequence_string_field - - // sequence m_unbounded_sequence_enum_field - - // sequence m_unbounded_sequence_enum2_field - - // sequence m_unbounded_sequence_struct_field - - - // Just to register all known types - registerContentFilterTestTypeTypes(); -} - -ContentFilterTestType::~ContentFilterTestType() -{ -} - -ContentFilterTestType::ContentFilterTestType( - const ContentFilterTestType& x) -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = x.m_string_field; - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - - m_struct_field = x.m_struct_field; - - - m_array_char_field = x.m_array_char_field; - - - m_array_uint8_field = x.m_array_uint8_field; - - - m_array_int16_field = x.m_array_int16_field; - - - m_array_uint16_field = x.m_array_uint16_field; - - - m_array_int32_field = x.m_array_int32_field; - - - m_array_uint32_field = x.m_array_uint32_field; - - - m_array_int64_field = x.m_array_int64_field; - - - m_array_uint64_field = x.m_array_uint64_field; - - - m_array_float_field = x.m_array_float_field; - - - m_array_double_field = x.m_array_double_field; - - - m_array_long_double_field = x.m_array_long_double_field; - - - m_array_bool_field = x.m_array_bool_field; - - - m_array_string_field = x.m_array_string_field; - - - m_array_enum_field = x.m_array_enum_field; - - - m_array_enum2_field = x.m_array_enum2_field; - - - m_array_struct_field = x.m_array_struct_field; - - - m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; - - - m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; - - - m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; - - - m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; - - - m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; - - - m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; - - - m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; - - - m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; - - - m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; - - - m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; - - - m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; - - - m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; - - - m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; - - - m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; - - - m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; - - - m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; - - - m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; - - - m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; - - - m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; - - - m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; - - - m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; - - - m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; - - - m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; - - - m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; - - - m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; - - - m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; - - - m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; - - - m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; - - - m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; - - - m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; - - - m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; - - - m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - -} - -ContentFilterTestType::ContentFilterTestType( - ContentFilterTestType&& x) noexcept -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = std::move(x.m_string_field); - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - - m_struct_field = std::move(x.m_struct_field); - - - m_array_char_field = std::move(x.m_array_char_field); - - - m_array_uint8_field = std::move(x.m_array_uint8_field); - - - m_array_int16_field = std::move(x.m_array_int16_field); - - - m_array_uint16_field = std::move(x.m_array_uint16_field); - - - m_array_int32_field = std::move(x.m_array_int32_field); - - - m_array_uint32_field = std::move(x.m_array_uint32_field); - - - m_array_int64_field = std::move(x.m_array_int64_field); - - - m_array_uint64_field = std::move(x.m_array_uint64_field); - - - m_array_float_field = std::move(x.m_array_float_field); - - - m_array_double_field = std::move(x.m_array_double_field); - - - m_array_long_double_field = std::move(x.m_array_long_double_field); - - - m_array_bool_field = std::move(x.m_array_bool_field); - - - m_array_string_field = std::move(x.m_array_string_field); - - - m_array_enum_field = std::move(x.m_array_enum_field); - - - m_array_enum2_field = std::move(x.m_array_enum2_field); - - - m_array_struct_field = std::move(x.m_array_struct_field); - - - m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); - - - m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); - - - m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); - - - m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); - - - m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); - - - m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); - - - m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); - - - m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); - - - m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); - - - m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); - - - m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); - - - m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); - - - m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); - - - m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); - - - m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); - - - m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - - - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - - - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - - - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - - - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - - - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - - - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - - - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - - - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - - - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - - - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - - - m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); - - - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - - - m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); - - - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - - - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - - - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - -} - -ContentFilterTestType& ContentFilterTestType::operator =( - const ContentFilterTestType& x) -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = x.m_string_field; - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - - m_struct_field = x.m_struct_field; - - - m_array_char_field = x.m_array_char_field; - - - m_array_uint8_field = x.m_array_uint8_field; - - - m_array_int16_field = x.m_array_int16_field; - - - m_array_uint16_field = x.m_array_uint16_field; - - - m_array_int32_field = x.m_array_int32_field; - - - m_array_uint32_field = x.m_array_uint32_field; - - - m_array_int64_field = x.m_array_int64_field; - - - m_array_uint64_field = x.m_array_uint64_field; - - - m_array_float_field = x.m_array_float_field; - - - m_array_double_field = x.m_array_double_field; - - - m_array_long_double_field = x.m_array_long_double_field; - - - m_array_bool_field = x.m_array_bool_field; - - - m_array_string_field = x.m_array_string_field; - - - m_array_enum_field = x.m_array_enum_field; - - - m_array_enum2_field = x.m_array_enum2_field; - - - m_array_struct_field = x.m_array_struct_field; - - - m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; - - - m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; - - - m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; - - - m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; - - - m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; - - - m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; - - - m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; - - - m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; - - - m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; - - - m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; - - - m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; - - - m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; - - - m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; - - - m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; - - - m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; - - - m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; - - - m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; - - - m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; - - - m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; - - - m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; - - - m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; - - - m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; - - - m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; - - - m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; - - - m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; - - - m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; - - - m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; - - - m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; - - - m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; - - - m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; - - - m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; - - - m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - - return *this; -} - -ContentFilterTestType& ContentFilterTestType::operator =( - ContentFilterTestType&& x) noexcept -{ - m_char_field = x.m_char_field; - - - m_uint8_field = x.m_uint8_field; - - - m_int16_field = x.m_int16_field; - - - m_uint16_field = x.m_uint16_field; - - - m_int32_field = x.m_int32_field; - - - m_uint32_field = x.m_uint32_field; - - - m_int64_field = x.m_int64_field; - - - m_uint64_field = x.m_uint64_field; - - - m_float_field = x.m_float_field; - - - m_double_field = x.m_double_field; - - - m_long_double_field = x.m_long_double_field; - - - m_bool_field = x.m_bool_field; - - - m_string_field = std::move(x.m_string_field); - - - m_enum_field = x.m_enum_field; - - - m_enum2_field = x.m_enum2_field; - - - m_struct_field = std::move(x.m_struct_field); - - - m_array_char_field = std::move(x.m_array_char_field); - - - m_array_uint8_field = std::move(x.m_array_uint8_field); - - - m_array_int16_field = std::move(x.m_array_int16_field); - - - m_array_uint16_field = std::move(x.m_array_uint16_field); - - - m_array_int32_field = std::move(x.m_array_int32_field); - - - m_array_uint32_field = std::move(x.m_array_uint32_field); - - - m_array_int64_field = std::move(x.m_array_int64_field); - - - m_array_uint64_field = std::move(x.m_array_uint64_field); - - - m_array_float_field = std::move(x.m_array_float_field); - - - m_array_double_field = std::move(x.m_array_double_field); - - - m_array_long_double_field = std::move(x.m_array_long_double_field); - - - m_array_bool_field = std::move(x.m_array_bool_field); - - - m_array_string_field = std::move(x.m_array_string_field); - - - m_array_enum_field = std::move(x.m_array_enum_field); - - - m_array_enum2_field = std::move(x.m_array_enum2_field); - - - m_array_struct_field = std::move(x.m_array_struct_field); - - - m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); - - - m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); - - - m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); - - - m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); - - - m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); - - - m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); - - - m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); - - - m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); - - - m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); - - - m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); - - - m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); - - - m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); - - - m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); - - - m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); - - - m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); - - - m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); - - - m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); - - - m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); - - - m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); - - - m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); - - - m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); - - - m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); - - - m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); - - - m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); - - - m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); - - - m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); - - - m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); - - - m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); - - - m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); - - - m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); - - - m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); - - - m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - - return *this; -} - -bool ContentFilterTestType::operator ==( - const ContentFilterTestType& x) const -{ - return (m_char_field == x.m_char_field && - m_uint8_field == x.m_uint8_field && - m_int16_field == x.m_int16_field && - m_uint16_field == x.m_uint16_field && - m_int32_field == x.m_int32_field && - m_uint32_field == x.m_uint32_field && - m_int64_field == x.m_int64_field && - m_uint64_field == x.m_uint64_field && - m_float_field == x.m_float_field && - m_double_field == x.m_double_field && - m_long_double_field == x.m_long_double_field && - m_bool_field == x.m_bool_field && - m_string_field == x.m_string_field && - m_enum_field == x.m_enum_field && - m_enum2_field == x.m_enum2_field && - m_struct_field == x.m_struct_field && - m_array_char_field == x.m_array_char_field && - m_array_uint8_field == x.m_array_uint8_field && - m_array_int16_field == x.m_array_int16_field && - m_array_uint16_field == x.m_array_uint16_field && - m_array_int32_field == x.m_array_int32_field && - m_array_uint32_field == x.m_array_uint32_field && - m_array_int64_field == x.m_array_int64_field && - m_array_uint64_field == x.m_array_uint64_field && - m_array_float_field == x.m_array_float_field && - m_array_double_field == x.m_array_double_field && - m_array_long_double_field == x.m_array_long_double_field && - m_array_bool_field == x.m_array_bool_field && - m_array_string_field == x.m_array_string_field && - m_array_enum_field == x.m_array_enum_field && - m_array_enum2_field == x.m_array_enum2_field && - m_array_struct_field == x.m_array_struct_field && - m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && - m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && - m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && - m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && - m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && - m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && - m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && - m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && - m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && - m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && - m_bounded_sequence_long_double_field == x.m_bounded_sequence_long_double_field && - m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && - m_bounded_sequence_string_field == x.m_bounded_sequence_string_field && - m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && - m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && - m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && - m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && - m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && - m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && - m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && - m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && - m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && - m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && - m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && - m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && - m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && - m_unbounded_sequence_long_double_field == x.m_unbounded_sequence_long_double_field && - m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && - m_unbounded_sequence_string_field == x.m_unbounded_sequence_string_field && - m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && - m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && - m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); -} - -bool ContentFilterTestType::operator !=( - const ContentFilterTestType& x) const -{ - return !(*this == x); -} - -size_t ContentFilterTestType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ContentFilterTestType_max_cdr_typesize; -} - -size_t ContentFilterTestType::getCdrSerializedSize( - const ContentFilterTestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); - - - current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += (((max_array_size)) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += (((max_array_size)) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - - current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - current_alignment += (((max_array_size)) * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); - - - - current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - - for(size_t a = 0; a < data.array_string_field().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.array_string_field().at(a).size() + 1; - - } - - - - current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - - for(size_t a = 0; a < data.array_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.array_struct_field().at(a), current_alignment); - - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_char_field().size() > 0) - { - current_alignment += (data.bounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.bounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_float_field().size() > 0) - { - current_alignment += (data.bounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_double_field().size() > 0) - { - current_alignment += (data.bounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_long_double_field().size() > 0) - { - current_alignment += (data.bounded_sequence_long_double_field().size() * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.bounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.bounded_sequence_string_field().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data.bounded_sequence_string_field().at(a).size() + 1; - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.bounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.bounded_sequence_enum2_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.bounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.bounded_sequence_struct_field().at(a), current_alignment); - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_char_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint8_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint16_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint32_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_int64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_uint64_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_float_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_double_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_long_double_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_long_double_field().size() * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_bool_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.unbounded_sequence_string_field().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + - data.unbounded_sequence_string_field().at(a).size() + 1; - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.unbounded_sequence_enum2_field().size() > 0) - { - current_alignment += (data.unbounded_sequence_enum2_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.unbounded_sequence_struct_field().size(); ++a) - { - current_alignment += StructType::getCdrSerializedSize(data.unbounded_sequence_struct_field().at(a), current_alignment); - } - - - - return current_alignment - initial_alignment; -} - - -void ContentFilterTestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_char_field; - - scdr << m_uint8_field; - - scdr << m_int16_field; - - scdr << m_uint16_field; - - scdr << m_int32_field; - - scdr << m_uint32_field; - - scdr << m_int64_field; - - scdr << m_uint64_field; - - scdr << m_float_field; - - scdr << m_double_field; - - scdr << m_long_double_field; - - scdr << m_bool_field; - - scdr << m_string_field.c_str(); - - scdr << (uint32_t)m_enum_field; - - scdr << (uint32_t)m_enum2_field; - - scdr << m_struct_field; - - scdr << m_array_char_field; - - - scdr << m_array_uint8_field; - - - scdr << m_array_int16_field; - - - scdr << m_array_uint16_field; - - - scdr << m_array_int32_field; - - - scdr << m_array_uint32_field; - - - scdr << m_array_int64_field; - - - scdr << m_array_uint64_field; - - - scdr << m_array_float_field; - - - scdr << m_array_double_field; - - - scdr << m_array_long_double_field; - - - scdr << m_array_bool_field; - - - for (const auto& str : m_array_string_field) - { - scdr << str.c_str(); - } - - - - - - scdr.serializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - scdr.serializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - scdr << m_array_struct_field; - - - scdr << m_bounded_sequence_char_field; - - - scdr << m_bounded_sequence_uint8_field; - - - scdr << m_bounded_sequence_int16_field; - - - scdr << m_bounded_sequence_uint16_field; - - - scdr << m_bounded_sequence_int32_field; - - - scdr << m_bounded_sequence_uint32_field; - - - scdr << m_bounded_sequence_int64_field; - - - scdr << m_bounded_sequence_uint64_field; - - - scdr << m_bounded_sequence_float_field; - - - scdr << m_bounded_sequence_double_field; - - - scdr << m_bounded_sequence_long_double_field; - - - scdr << m_bounded_sequence_bool_field; - - - scdr << m_bounded_sequence_string_field; - - - - - scdr << static_cast(m_bounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), m_bounded_sequence_enum_field.size()); - - - scdr << static_cast(m_bounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), m_bounded_sequence_enum2_field.size()); - - - scdr << m_bounded_sequence_struct_field; - - - scdr << m_unbounded_sequence_char_field; - - - scdr << m_unbounded_sequence_uint8_field; - - - scdr << m_unbounded_sequence_int16_field; - - - scdr << m_unbounded_sequence_uint16_field; - - - scdr << m_unbounded_sequence_int32_field; - - - scdr << m_unbounded_sequence_uint32_field; - - - scdr << m_unbounded_sequence_int64_field; - - - scdr << m_unbounded_sequence_uint64_field; - - - scdr << m_unbounded_sequence_float_field; - - - scdr << m_unbounded_sequence_double_field; - - - scdr << m_unbounded_sequence_long_double_field; - - - scdr << m_unbounded_sequence_bool_field; - - - scdr << m_unbounded_sequence_string_field; - - - - - scdr << static_cast(m_unbounded_sequence_enum_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), m_unbounded_sequence_enum_field.size()); - - - scdr << static_cast(m_unbounded_sequence_enum2_field.size()); - scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), m_unbounded_sequence_enum2_field.size()); - - - scdr << m_unbounded_sequence_struct_field; - - -} - -void ContentFilterTestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_char_field; - - - - dcdr >> m_uint8_field; - - - - dcdr >> m_int16_field; - - - - dcdr >> m_uint16_field; - - - - dcdr >> m_int32_field; - - - - dcdr >> m_uint32_field; - - - - dcdr >> m_int64_field; - - - - dcdr >> m_uint64_field; - - - - dcdr >> m_float_field; - - - - dcdr >> m_double_field; - - - - dcdr >> m_long_double_field; - - - - dcdr >> m_bool_field; - - - - dcdr >> m_string_field; - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum_field = (Color)enum_value; - } - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_enum2_field = (Material)enum_value; - } - - - - dcdr >> m_struct_field; - - - - dcdr >> m_array_char_field; - - - - dcdr >> m_array_uint8_field; - - - - dcdr >> m_array_int16_field; - - - - dcdr >> m_array_uint16_field; - - - - dcdr >> m_array_int32_field; - - - - dcdr >> m_array_uint32_field; - - - - dcdr >> m_array_int64_field; - - - - dcdr >> m_array_uint64_field; - - - - dcdr >> m_array_float_field; - - - - dcdr >> m_array_double_field; - - - - dcdr >> m_array_long_double_field; - - - - dcdr >> m_array_bool_field; - - - - for (auto& str : m_array_string_field) - { - dcdr >> str; - } - - - - - - - dcdr.deserializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); - - - - dcdr.deserializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); - - - - dcdr >> m_array_struct_field; - - - - dcdr >> m_bounded_sequence_char_field; - - - - dcdr >> m_bounded_sequence_uint8_field; - - - - dcdr >> m_bounded_sequence_int16_field; - - - - dcdr >> m_bounded_sequence_uint16_field; - - - - dcdr >> m_bounded_sequence_int32_field; - - - - dcdr >> m_bounded_sequence_uint32_field; - - - - dcdr >> m_bounded_sequence_int64_field; - - - - dcdr >> m_bounded_sequence_uint64_field; - - - - dcdr >> m_bounded_sequence_float_field; - - - - dcdr >> m_bounded_sequence_double_field; - - - - dcdr >> m_bounded_sequence_long_double_field; - - - - dcdr >> m_bounded_sequence_bool_field; - - - - dcdr >> m_bounded_sequence_string_field; - - - - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), seq_length); - } - - - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_bounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), seq_length); - } - - - - dcdr >> m_bounded_sequence_struct_field; - - - - dcdr >> m_unbounded_sequence_char_field; - - - - dcdr >> m_unbounded_sequence_uint8_field; - - - - dcdr >> m_unbounded_sequence_int16_field; - - - - dcdr >> m_unbounded_sequence_uint16_field; - - - - dcdr >> m_unbounded_sequence_int32_field; - - - - dcdr >> m_unbounded_sequence_uint32_field; - - - - dcdr >> m_unbounded_sequence_int64_field; - - - - dcdr >> m_unbounded_sequence_uint64_field; - - - - dcdr >> m_unbounded_sequence_float_field; - - - - dcdr >> m_unbounded_sequence_double_field; - - - - dcdr >> m_unbounded_sequence_long_double_field; - - - - dcdr >> m_unbounded_sequence_bool_field; - - - - dcdr >> m_unbounded_sequence_string_field; - - - - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), seq_length); - } - - - - { - uint32_t seq_length = 0; - dcdr >> seq_length; - m_unbounded_sequence_enum2_field.resize(seq_length); - dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), seq_length); - } - - - - dcdr >> m_unbounded_sequence_struct_field; - - -} - - -bool ContentFilterTestType::isKeyDefined() -{ - return false; -} - -void ContentFilterTestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ -void ContentFilterTestType::char_field( - char _char_field) -{ - m_char_field = _char_field; -} - -/*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ -char ContentFilterTestType::char_field() const -{ - return m_char_field; -} - -/*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ -char& ContentFilterTestType::char_field() -{ - return m_char_field; -} - - -/*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ -void ContentFilterTestType::uint8_field( - uint8_t _uint8_field) -{ - m_uint8_field = _uint8_field; -} - -/*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ -uint8_t ContentFilterTestType::uint8_field() const -{ - return m_uint8_field; -} - -/*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ -uint8_t& ContentFilterTestType::uint8_field() -{ - return m_uint8_field; -} - - -/*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ -void ContentFilterTestType::int16_field( - int16_t _int16_field) -{ - m_int16_field = _int16_field; -} - -/*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ -int16_t ContentFilterTestType::int16_field() const -{ - return m_int16_field; -} - -/*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ -int16_t& ContentFilterTestType::int16_field() -{ - return m_int16_field; -} - - -/*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ -void ContentFilterTestType::uint16_field( - uint16_t _uint16_field) -{ - m_uint16_field = _uint16_field; -} - -/*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ -uint16_t ContentFilterTestType::uint16_field() const -{ - return m_uint16_field; -} - -/*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ -uint16_t& ContentFilterTestType::uint16_field() -{ - return m_uint16_field; -} - - -/*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ -void ContentFilterTestType::int32_field( - int32_t _int32_field) -{ - m_int32_field = _int32_field; -} - -/*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ -int32_t ContentFilterTestType::int32_field() const -{ - return m_int32_field; -} - -/*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ -int32_t& ContentFilterTestType::int32_field() -{ - return m_int32_field; -} - - -/*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ -void ContentFilterTestType::uint32_field( - uint32_t _uint32_field) -{ - m_uint32_field = _uint32_field; -} - -/*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ -uint32_t ContentFilterTestType::uint32_field() const -{ - return m_uint32_field; -} - -/*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ -uint32_t& ContentFilterTestType::uint32_field() -{ - return m_uint32_field; -} - - -/*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ -void ContentFilterTestType::int64_field( - int64_t _int64_field) -{ - m_int64_field = _int64_field; -} - -/*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ -int64_t ContentFilterTestType::int64_field() const -{ - return m_int64_field; -} - -/*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ -int64_t& ContentFilterTestType::int64_field() -{ - return m_int64_field; -} - - -/*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ -void ContentFilterTestType::uint64_field( - uint64_t _uint64_field) -{ - m_uint64_field = _uint64_field; -} - -/*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ -uint64_t ContentFilterTestType::uint64_field() const -{ - return m_uint64_field; -} - -/*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ -uint64_t& ContentFilterTestType::uint64_field() -{ - return m_uint64_field; -} - - -/*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ -void ContentFilterTestType::float_field( - float _float_field) -{ - m_float_field = _float_field; -} - -/*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ -float ContentFilterTestType::float_field() const -{ - return m_float_field; -} - -/*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ -float& ContentFilterTestType::float_field() -{ - return m_float_field; -} - - -/*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ -void ContentFilterTestType::double_field( - double _double_field) -{ - m_double_field = _double_field; -} - -/*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ -double ContentFilterTestType::double_field() const -{ - return m_double_field; -} - -/*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ -double& ContentFilterTestType::double_field() -{ - return m_double_field; -} - - -/*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ -void ContentFilterTestType::long_double_field( - long double _long_double_field) -{ - m_long_double_field = _long_double_field; -} - -/*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ -long double ContentFilterTestType::long_double_field() const -{ - return m_long_double_field; -} - -/*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ -long double& ContentFilterTestType::long_double_field() -{ - return m_long_double_field; -} - - -/*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ -void ContentFilterTestType::bool_field( - bool _bool_field) -{ - m_bool_field = _bool_field; -} - -/*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ -bool ContentFilterTestType::bool_field() const -{ - return m_bool_field; -} - -/*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ -bool& ContentFilterTestType::bool_field() -{ - return m_bool_field; -} - - -/*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ -void ContentFilterTestType::string_field( - const std::string& _string_field) -{ - m_string_field = _string_field; -} - -/*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ -void ContentFilterTestType::string_field( - std::string&& _string_field) -{ - m_string_field = std::move(_string_field); -} - -/*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ -const std::string& ContentFilterTestType::string_field() const -{ - return m_string_field; -} - -/*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ -std::string& ContentFilterTestType::string_field() -{ - return m_string_field; -} - - -/*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ -void ContentFilterTestType::enum_field( - Color _enum_field) -{ - m_enum_field = _enum_field; -} - -/*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ -Color ContentFilterTestType::enum_field() const -{ - return m_enum_field; -} - -/*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ -Color& ContentFilterTestType::enum_field() -{ - return m_enum_field; -} - - -/*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ -void ContentFilterTestType::enum2_field( - Material _enum2_field) -{ - m_enum2_field = _enum2_field; -} - -/*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ -Material ContentFilterTestType::enum2_field() const -{ - return m_enum2_field; -} - -/*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ -Material& ContentFilterTestType::enum2_field() -{ - return m_enum2_field; -} - - -/*! - * @brief This function copies the value in member struct_field - * @param _struct_field New value to be copied in member struct_field - */ -void ContentFilterTestType::struct_field( - const StructType& _struct_field) -{ - m_struct_field = _struct_field; -} - -/*! - * @brief This function moves the value in member struct_field - * @param _struct_field New value to be moved in member struct_field - */ -void ContentFilterTestType::struct_field( - StructType&& _struct_field) -{ - m_struct_field = std::move(_struct_field); -} - -/*! - * @brief This function returns a constant reference to member struct_field - * @return Constant reference to member struct_field - */ -const StructType& ContentFilterTestType::struct_field() const -{ - return m_struct_field; -} - -/*! - * @brief This function returns a reference to member struct_field - * @return Reference to member struct_field - */ -StructType& ContentFilterTestType::struct_field() -{ - return m_struct_field; -} - - -/*! - * @brief This function copies the value in member array_char_field - * @param _array_char_field New value to be copied in member array_char_field - */ -void ContentFilterTestType::array_char_field( - const std::array& _array_char_field) -{ - m_array_char_field = _array_char_field; -} - -/*! - * @brief This function moves the value in member array_char_field - * @param _array_char_field New value to be moved in member array_char_field - */ -void ContentFilterTestType::array_char_field( - std::array&& _array_char_field) -{ - m_array_char_field = std::move(_array_char_field); -} - -/*! - * @brief This function returns a constant reference to member array_char_field - * @return Constant reference to member array_char_field - */ -const std::array& ContentFilterTestType::array_char_field() const -{ - return m_array_char_field; -} - -/*! - * @brief This function returns a reference to member array_char_field - * @return Reference to member array_char_field - */ -std::array& ContentFilterTestType::array_char_field() -{ - return m_array_char_field; -} - - -/*! - * @brief This function copies the value in member array_uint8_field - * @param _array_uint8_field New value to be copied in member array_uint8_field - */ -void ContentFilterTestType::array_uint8_field( - const std::array& _array_uint8_field) -{ - m_array_uint8_field = _array_uint8_field; -} - -/*! - * @brief This function moves the value in member array_uint8_field - * @param _array_uint8_field New value to be moved in member array_uint8_field - */ -void ContentFilterTestType::array_uint8_field( - std::array&& _array_uint8_field) -{ - m_array_uint8_field = std::move(_array_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint8_field - * @return Constant reference to member array_uint8_field - */ -const std::array& ContentFilterTestType::array_uint8_field() const -{ - return m_array_uint8_field; -} - -/*! - * @brief This function returns a reference to member array_uint8_field - * @return Reference to member array_uint8_field - */ -std::array& ContentFilterTestType::array_uint8_field() -{ - return m_array_uint8_field; -} - - -/*! - * @brief This function copies the value in member array_int16_field - * @param _array_int16_field New value to be copied in member array_int16_field - */ -void ContentFilterTestType::array_int16_field( - const std::array& _array_int16_field) -{ - m_array_int16_field = _array_int16_field; -} - -/*! - * @brief This function moves the value in member array_int16_field - * @param _array_int16_field New value to be moved in member array_int16_field - */ -void ContentFilterTestType::array_int16_field( - std::array&& _array_int16_field) -{ - m_array_int16_field = std::move(_array_int16_field); -} - -/*! - * @brief This function returns a constant reference to member array_int16_field - * @return Constant reference to member array_int16_field - */ -const std::array& ContentFilterTestType::array_int16_field() const -{ - return m_array_int16_field; -} - -/*! - * @brief This function returns a reference to member array_int16_field - * @return Reference to member array_int16_field - */ -std::array& ContentFilterTestType::array_int16_field() -{ - return m_array_int16_field; -} - - -/*! - * @brief This function copies the value in member array_uint16_field - * @param _array_uint16_field New value to be copied in member array_uint16_field - */ -void ContentFilterTestType::array_uint16_field( - const std::array& _array_uint16_field) -{ - m_array_uint16_field = _array_uint16_field; -} - -/*! - * @brief This function moves the value in member array_uint16_field - * @param _array_uint16_field New value to be moved in member array_uint16_field - */ -void ContentFilterTestType::array_uint16_field( - std::array&& _array_uint16_field) -{ - m_array_uint16_field = std::move(_array_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint16_field - * @return Constant reference to member array_uint16_field - */ -const std::array& ContentFilterTestType::array_uint16_field() const -{ - return m_array_uint16_field; -} - -/*! - * @brief This function returns a reference to member array_uint16_field - * @return Reference to member array_uint16_field - */ -std::array& ContentFilterTestType::array_uint16_field() -{ - return m_array_uint16_field; -} - - -/*! - * @brief This function copies the value in member array_int32_field - * @param _array_int32_field New value to be copied in member array_int32_field - */ -void ContentFilterTestType::array_int32_field( - const std::array& _array_int32_field) -{ - m_array_int32_field = _array_int32_field; -} - -/*! - * @brief This function moves the value in member array_int32_field - * @param _array_int32_field New value to be moved in member array_int32_field - */ -void ContentFilterTestType::array_int32_field( - std::array&& _array_int32_field) -{ - m_array_int32_field = std::move(_array_int32_field); -} - -/*! - * @brief This function returns a constant reference to member array_int32_field - * @return Constant reference to member array_int32_field - */ -const std::array& ContentFilterTestType::array_int32_field() const -{ - return m_array_int32_field; -} - -/*! - * @brief This function returns a reference to member array_int32_field - * @return Reference to member array_int32_field - */ -std::array& ContentFilterTestType::array_int32_field() -{ - return m_array_int32_field; -} - - -/*! - * @brief This function copies the value in member array_uint32_field - * @param _array_uint32_field New value to be copied in member array_uint32_field - */ -void ContentFilterTestType::array_uint32_field( - const std::array& _array_uint32_field) -{ - m_array_uint32_field = _array_uint32_field; -} - -/*! - * @brief This function moves the value in member array_uint32_field - * @param _array_uint32_field New value to be moved in member array_uint32_field - */ -void ContentFilterTestType::array_uint32_field( - std::array&& _array_uint32_field) -{ - m_array_uint32_field = std::move(_array_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint32_field - * @return Constant reference to member array_uint32_field - */ -const std::array& ContentFilterTestType::array_uint32_field() const -{ - return m_array_uint32_field; -} - -/*! - * @brief This function returns a reference to member array_uint32_field - * @return Reference to member array_uint32_field - */ -std::array& ContentFilterTestType::array_uint32_field() -{ - return m_array_uint32_field; -} - - -/*! - * @brief This function copies the value in member array_int64_field - * @param _array_int64_field New value to be copied in member array_int64_field - */ -void ContentFilterTestType::array_int64_field( - const std::array& _array_int64_field) -{ - m_array_int64_field = _array_int64_field; -} - -/*! - * @brief This function moves the value in member array_int64_field - * @param _array_int64_field New value to be moved in member array_int64_field - */ -void ContentFilterTestType::array_int64_field( - std::array&& _array_int64_field) -{ - m_array_int64_field = std::move(_array_int64_field); -} - -/*! - * @brief This function returns a constant reference to member array_int64_field - * @return Constant reference to member array_int64_field - */ -const std::array& ContentFilterTestType::array_int64_field() const -{ - return m_array_int64_field; -} - -/*! - * @brief This function returns a reference to member array_int64_field - * @return Reference to member array_int64_field - */ -std::array& ContentFilterTestType::array_int64_field() -{ - return m_array_int64_field; -} - - -/*! - * @brief This function copies the value in member array_uint64_field - * @param _array_uint64_field New value to be copied in member array_uint64_field - */ -void ContentFilterTestType::array_uint64_field( - const std::array& _array_uint64_field) -{ - m_array_uint64_field = _array_uint64_field; -} - -/*! - * @brief This function moves the value in member array_uint64_field - * @param _array_uint64_field New value to be moved in member array_uint64_field - */ -void ContentFilterTestType::array_uint64_field( - std::array&& _array_uint64_field) -{ - m_array_uint64_field = std::move(_array_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member array_uint64_field - * @return Constant reference to member array_uint64_field - */ -const std::array& ContentFilterTestType::array_uint64_field() const -{ - return m_array_uint64_field; -} - -/*! - * @brief This function returns a reference to member array_uint64_field - * @return Reference to member array_uint64_field - */ -std::array& ContentFilterTestType::array_uint64_field() -{ - return m_array_uint64_field; -} - - -/*! - * @brief This function copies the value in member array_float_field - * @param _array_float_field New value to be copied in member array_float_field - */ -void ContentFilterTestType::array_float_field( - const std::array& _array_float_field) -{ - m_array_float_field = _array_float_field; -} - -/*! - * @brief This function moves the value in member array_float_field - * @param _array_float_field New value to be moved in member array_float_field - */ -void ContentFilterTestType::array_float_field( - std::array&& _array_float_field) -{ - m_array_float_field = std::move(_array_float_field); -} - -/*! - * @brief This function returns a constant reference to member array_float_field - * @return Constant reference to member array_float_field - */ -const std::array& ContentFilterTestType::array_float_field() const -{ - return m_array_float_field; -} - -/*! - * @brief This function returns a reference to member array_float_field - * @return Reference to member array_float_field - */ -std::array& ContentFilterTestType::array_float_field() -{ - return m_array_float_field; -} - - -/*! - * @brief This function copies the value in member array_double_field - * @param _array_double_field New value to be copied in member array_double_field - */ -void ContentFilterTestType::array_double_field( - const std::array& _array_double_field) -{ - m_array_double_field = _array_double_field; -} - -/*! - * @brief This function moves the value in member array_double_field - * @param _array_double_field New value to be moved in member array_double_field - */ -void ContentFilterTestType::array_double_field( - std::array&& _array_double_field) -{ - m_array_double_field = std::move(_array_double_field); -} - -/*! - * @brief This function returns a constant reference to member array_double_field - * @return Constant reference to member array_double_field - */ -const std::array& ContentFilterTestType::array_double_field() const -{ - return m_array_double_field; -} - -/*! - * @brief This function returns a reference to member array_double_field - * @return Reference to member array_double_field - */ -std::array& ContentFilterTestType::array_double_field() -{ - return m_array_double_field; -} - - -/*! - * @brief This function copies the value in member array_long_double_field - * @param _array_long_double_field New value to be copied in member array_long_double_field - */ -void ContentFilterTestType::array_long_double_field( - const std::array& _array_long_double_field) -{ - m_array_long_double_field = _array_long_double_field; -} - -/*! - * @brief This function moves the value in member array_long_double_field - * @param _array_long_double_field New value to be moved in member array_long_double_field - */ -void ContentFilterTestType::array_long_double_field( - std::array&& _array_long_double_field) -{ - m_array_long_double_field = std::move(_array_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member array_long_double_field - * @return Constant reference to member array_long_double_field - */ -const std::array& ContentFilterTestType::array_long_double_field() const -{ - return m_array_long_double_field; -} - -/*! - * @brief This function returns a reference to member array_long_double_field - * @return Reference to member array_long_double_field - */ -std::array& ContentFilterTestType::array_long_double_field() -{ - return m_array_long_double_field; -} - - -/*! - * @brief This function copies the value in member array_bool_field - * @param _array_bool_field New value to be copied in member array_bool_field - */ -void ContentFilterTestType::array_bool_field( - const std::array& _array_bool_field) -{ - m_array_bool_field = _array_bool_field; -} - -/*! - * @brief This function moves the value in member array_bool_field - * @param _array_bool_field New value to be moved in member array_bool_field - */ -void ContentFilterTestType::array_bool_field( - std::array&& _array_bool_field) -{ - m_array_bool_field = std::move(_array_bool_field); -} - -/*! - * @brief This function returns a constant reference to member array_bool_field - * @return Constant reference to member array_bool_field - */ -const std::array& ContentFilterTestType::array_bool_field() const -{ - return m_array_bool_field; -} - -/*! - * @brief This function returns a reference to member array_bool_field - * @return Reference to member array_bool_field - */ -std::array& ContentFilterTestType::array_bool_field() -{ - return m_array_bool_field; -} - - -/*! - * @brief This function copies the value in member array_string_field - * @param _array_string_field New value to be copied in member array_string_field - */ -void ContentFilterTestType::array_string_field( - const std::array& _array_string_field) -{ - m_array_string_field = _array_string_field; -} - -/*! - * @brief This function moves the value in member array_string_field - * @param _array_string_field New value to be moved in member array_string_field - */ -void ContentFilterTestType::array_string_field( - std::array&& _array_string_field) -{ - m_array_string_field = std::move(_array_string_field); -} - -/*! - * @brief This function returns a constant reference to member array_string_field - * @return Constant reference to member array_string_field - */ -const std::array& ContentFilterTestType::array_string_field() const -{ - return m_array_string_field; -} - -/*! - * @brief This function returns a reference to member array_string_field - * @return Reference to member array_string_field - */ -std::array& ContentFilterTestType::array_string_field() -{ - return m_array_string_field; -} - - -/*! - * @brief This function copies the value in member array_enum_field - * @param _array_enum_field New value to be copied in member array_enum_field - */ -void ContentFilterTestType::array_enum_field( - const std::array& _array_enum_field) -{ - m_array_enum_field = _array_enum_field; -} - -/*! - * @brief This function moves the value in member array_enum_field - * @param _array_enum_field New value to be moved in member array_enum_field - */ -void ContentFilterTestType::array_enum_field( - std::array&& _array_enum_field) -{ - m_array_enum_field = std::move(_array_enum_field); -} - -/*! - * @brief This function returns a constant reference to member array_enum_field - * @return Constant reference to member array_enum_field - */ -const std::array& ContentFilterTestType::array_enum_field() const -{ - return m_array_enum_field; -} - -/*! - * @brief This function returns a reference to member array_enum_field - * @return Reference to member array_enum_field - */ -std::array& ContentFilterTestType::array_enum_field() -{ - return m_array_enum_field; -} - - -/*! - * @brief This function copies the value in member array_enum2_field - * @param _array_enum2_field New value to be copied in member array_enum2_field - */ -void ContentFilterTestType::array_enum2_field( - const std::array& _array_enum2_field) -{ - m_array_enum2_field = _array_enum2_field; -} - -/*! - * @brief This function moves the value in member array_enum2_field - * @param _array_enum2_field New value to be moved in member array_enum2_field - */ -void ContentFilterTestType::array_enum2_field( - std::array&& _array_enum2_field) -{ - m_array_enum2_field = std::move(_array_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member array_enum2_field - * @return Constant reference to member array_enum2_field - */ -const std::array& ContentFilterTestType::array_enum2_field() const -{ - return m_array_enum2_field; -} - -/*! - * @brief This function returns a reference to member array_enum2_field - * @return Reference to member array_enum2_field - */ -std::array& ContentFilterTestType::array_enum2_field() -{ - return m_array_enum2_field; -} - - -/*! - * @brief This function copies the value in member array_struct_field - * @param _array_struct_field New value to be copied in member array_struct_field - */ -void ContentFilterTestType::array_struct_field( - const std::array& _array_struct_field) -{ - m_array_struct_field = _array_struct_field; -} - -/*! - * @brief This function moves the value in member array_struct_field - * @param _array_struct_field New value to be moved in member array_struct_field - */ -void ContentFilterTestType::array_struct_field( - std::array&& _array_struct_field) -{ - m_array_struct_field = std::move(_array_struct_field); -} - -/*! - * @brief This function returns a constant reference to member array_struct_field - * @return Constant reference to member array_struct_field - */ -const std::array& ContentFilterTestType::array_struct_field() const -{ - return m_array_struct_field; -} - -/*! - * @brief This function returns a reference to member array_struct_field - * @return Reference to member array_struct_field - */ -std::array& ContentFilterTestType::array_struct_field() -{ - return m_array_struct_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field - */ -void ContentFilterTestType::bounded_sequence_char_field( - const std::vector& _bounded_sequence_char_field) -{ - m_bounded_sequence_char_field = _bounded_sequence_char_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field - */ -void ContentFilterTestType::bounded_sequence_char_field( - std::vector&& _bounded_sequence_char_field) -{ - m_bounded_sequence_char_field = std::move(_bounded_sequence_char_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_char_field - * @return Constant reference to member bounded_sequence_char_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_char_field() const -{ - return m_bounded_sequence_char_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_char_field - * @return Reference to member bounded_sequence_char_field - */ -std::vector& ContentFilterTestType::bounded_sequence_char_field() -{ - return m_bounded_sequence_char_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field - */ -void ContentFilterTestType::bounded_sequence_uint8_field( - const std::vector& _bounded_sequence_uint8_field) -{ - m_bounded_sequence_uint8_field = _bounded_sequence_uint8_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field - */ -void ContentFilterTestType::bounded_sequence_uint8_field( - std::vector&& _bounded_sequence_uint8_field) -{ - m_bounded_sequence_uint8_field = std::move(_bounded_sequence_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint8_field - * @return Constant reference to member bounded_sequence_uint8_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint8_field() const -{ - return m_bounded_sequence_uint8_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint8_field - * @return Reference to member bounded_sequence_uint8_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint8_field() -{ - return m_bounded_sequence_uint8_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field - */ -void ContentFilterTestType::bounded_sequence_int16_field( - const std::vector& _bounded_sequence_int16_field) -{ - m_bounded_sequence_int16_field = _bounded_sequence_int16_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field - */ -void ContentFilterTestType::bounded_sequence_int16_field( - std::vector&& _bounded_sequence_int16_field) -{ - m_bounded_sequence_int16_field = std::move(_bounded_sequence_int16_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int16_field - * @return Constant reference to member bounded_sequence_int16_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int16_field() const -{ - return m_bounded_sequence_int16_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int16_field - * @return Reference to member bounded_sequence_int16_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int16_field() -{ - return m_bounded_sequence_int16_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field - */ -void ContentFilterTestType::bounded_sequence_uint16_field( - const std::vector& _bounded_sequence_uint16_field) -{ - m_bounded_sequence_uint16_field = _bounded_sequence_uint16_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field - */ -void ContentFilterTestType::bounded_sequence_uint16_field( - std::vector&& _bounded_sequence_uint16_field) -{ - m_bounded_sequence_uint16_field = std::move(_bounded_sequence_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint16_field - * @return Constant reference to member bounded_sequence_uint16_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint16_field() const -{ - return m_bounded_sequence_uint16_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint16_field - * @return Reference to member bounded_sequence_uint16_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint16_field() -{ - return m_bounded_sequence_uint16_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field - */ -void ContentFilterTestType::bounded_sequence_int32_field( - const std::vector& _bounded_sequence_int32_field) -{ - m_bounded_sequence_int32_field = _bounded_sequence_int32_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field - */ -void ContentFilterTestType::bounded_sequence_int32_field( - std::vector&& _bounded_sequence_int32_field) -{ - m_bounded_sequence_int32_field = std::move(_bounded_sequence_int32_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int32_field - * @return Constant reference to member bounded_sequence_int32_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int32_field() const -{ - return m_bounded_sequence_int32_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int32_field - * @return Reference to member bounded_sequence_int32_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int32_field() -{ - return m_bounded_sequence_int32_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field - */ -void ContentFilterTestType::bounded_sequence_uint32_field( - const std::vector& _bounded_sequence_uint32_field) -{ - m_bounded_sequence_uint32_field = _bounded_sequence_uint32_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field - */ -void ContentFilterTestType::bounded_sequence_uint32_field( - std::vector&& _bounded_sequence_uint32_field) -{ - m_bounded_sequence_uint32_field = std::move(_bounded_sequence_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint32_field - * @return Constant reference to member bounded_sequence_uint32_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint32_field() const -{ - return m_bounded_sequence_uint32_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint32_field - * @return Reference to member bounded_sequence_uint32_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint32_field() -{ - return m_bounded_sequence_uint32_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field - */ -void ContentFilterTestType::bounded_sequence_int64_field( - const std::vector& _bounded_sequence_int64_field) -{ - m_bounded_sequence_int64_field = _bounded_sequence_int64_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field - */ -void ContentFilterTestType::bounded_sequence_int64_field( - std::vector&& _bounded_sequence_int64_field) -{ - m_bounded_sequence_int64_field = std::move(_bounded_sequence_int64_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_int64_field - * @return Constant reference to member bounded_sequence_int64_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_int64_field() const -{ - return m_bounded_sequence_int64_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_int64_field - * @return Reference to member bounded_sequence_int64_field - */ -std::vector& ContentFilterTestType::bounded_sequence_int64_field() -{ - return m_bounded_sequence_int64_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field - */ -void ContentFilterTestType::bounded_sequence_uint64_field( - const std::vector& _bounded_sequence_uint64_field) -{ - m_bounded_sequence_uint64_field = _bounded_sequence_uint64_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field - */ -void ContentFilterTestType::bounded_sequence_uint64_field( - std::vector&& _bounded_sequence_uint64_field) -{ - m_bounded_sequence_uint64_field = std::move(_bounded_sequence_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_uint64_field - * @return Constant reference to member bounded_sequence_uint64_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_uint64_field() const -{ - return m_bounded_sequence_uint64_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_uint64_field - * @return Reference to member bounded_sequence_uint64_field - */ -std::vector& ContentFilterTestType::bounded_sequence_uint64_field() -{ - return m_bounded_sequence_uint64_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field - */ -void ContentFilterTestType::bounded_sequence_float_field( - const std::vector& _bounded_sequence_float_field) -{ - m_bounded_sequence_float_field = _bounded_sequence_float_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field - */ -void ContentFilterTestType::bounded_sequence_float_field( - std::vector&& _bounded_sequence_float_field) -{ - m_bounded_sequence_float_field = std::move(_bounded_sequence_float_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_float_field - * @return Constant reference to member bounded_sequence_float_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_float_field() const -{ - return m_bounded_sequence_float_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_float_field - * @return Reference to member bounded_sequence_float_field - */ -std::vector& ContentFilterTestType::bounded_sequence_float_field() -{ - return m_bounded_sequence_float_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field - */ -void ContentFilterTestType::bounded_sequence_double_field( - const std::vector& _bounded_sequence_double_field) -{ - m_bounded_sequence_double_field = _bounded_sequence_double_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field - */ -void ContentFilterTestType::bounded_sequence_double_field( - std::vector&& _bounded_sequence_double_field) -{ - m_bounded_sequence_double_field = std::move(_bounded_sequence_double_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_double_field - * @return Constant reference to member bounded_sequence_double_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_double_field() const -{ - return m_bounded_sequence_double_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_double_field - * @return Reference to member bounded_sequence_double_field - */ -std::vector& ContentFilterTestType::bounded_sequence_double_field() -{ - return m_bounded_sequence_double_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field - */ -void ContentFilterTestType::bounded_sequence_long_double_field( - const std::vector& _bounded_sequence_long_double_field) -{ - m_bounded_sequence_long_double_field = _bounded_sequence_long_double_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field - */ -void ContentFilterTestType::bounded_sequence_long_double_field( - std::vector&& _bounded_sequence_long_double_field) -{ - m_bounded_sequence_long_double_field = std::move(_bounded_sequence_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_long_double_field - * @return Constant reference to member bounded_sequence_long_double_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_long_double_field() const -{ - return m_bounded_sequence_long_double_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_long_double_field - * @return Reference to member bounded_sequence_long_double_field - */ -std::vector& ContentFilterTestType::bounded_sequence_long_double_field() -{ - return m_bounded_sequence_long_double_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field - */ -void ContentFilterTestType::bounded_sequence_bool_field( - const std::vector& _bounded_sequence_bool_field) -{ - m_bounded_sequence_bool_field = _bounded_sequence_bool_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field - */ -void ContentFilterTestType::bounded_sequence_bool_field( - std::vector&& _bounded_sequence_bool_field) -{ - m_bounded_sequence_bool_field = std::move(_bounded_sequence_bool_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_bool_field - * @return Constant reference to member bounded_sequence_bool_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_bool_field() const -{ - return m_bounded_sequence_bool_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_bool_field - * @return Reference to member bounded_sequence_bool_field - */ -std::vector& ContentFilterTestType::bounded_sequence_bool_field() -{ - return m_bounded_sequence_bool_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field - */ -void ContentFilterTestType::bounded_sequence_string_field( - const std::vector& _bounded_sequence_string_field) -{ - m_bounded_sequence_string_field = _bounded_sequence_string_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field - */ -void ContentFilterTestType::bounded_sequence_string_field( - std::vector&& _bounded_sequence_string_field) -{ - m_bounded_sequence_string_field = std::move(_bounded_sequence_string_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_string_field - * @return Constant reference to member bounded_sequence_string_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_string_field() const -{ - return m_bounded_sequence_string_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_string_field - * @return Reference to member bounded_sequence_string_field - */ -std::vector& ContentFilterTestType::bounded_sequence_string_field() -{ - return m_bounded_sequence_string_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field - */ -void ContentFilterTestType::bounded_sequence_enum_field( - const std::vector& _bounded_sequence_enum_field) -{ - m_bounded_sequence_enum_field = _bounded_sequence_enum_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field - */ -void ContentFilterTestType::bounded_sequence_enum_field( - std::vector&& _bounded_sequence_enum_field) -{ - m_bounded_sequence_enum_field = std::move(_bounded_sequence_enum_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_enum_field - * @return Constant reference to member bounded_sequence_enum_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_enum_field() const -{ - return m_bounded_sequence_enum_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_enum_field - * @return Reference to member bounded_sequence_enum_field - */ -std::vector& ContentFilterTestType::bounded_sequence_enum_field() -{ - return m_bounded_sequence_enum_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field - */ -void ContentFilterTestType::bounded_sequence_enum2_field( - const std::vector& _bounded_sequence_enum2_field) -{ - m_bounded_sequence_enum2_field = _bounded_sequence_enum2_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field - */ -void ContentFilterTestType::bounded_sequence_enum2_field( - std::vector&& _bounded_sequence_enum2_field) -{ - m_bounded_sequence_enum2_field = std::move(_bounded_sequence_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_enum2_field - * @return Constant reference to member bounded_sequence_enum2_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_enum2_field() const -{ - return m_bounded_sequence_enum2_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_enum2_field - * @return Reference to member bounded_sequence_enum2_field - */ -std::vector& ContentFilterTestType::bounded_sequence_enum2_field() -{ - return m_bounded_sequence_enum2_field; -} - - -/*! - * @brief This function copies the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field - */ -void ContentFilterTestType::bounded_sequence_struct_field( - const std::vector& _bounded_sequence_struct_field) -{ - m_bounded_sequence_struct_field = _bounded_sequence_struct_field; -} - -/*! - * @brief This function moves the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field - */ -void ContentFilterTestType::bounded_sequence_struct_field( - std::vector&& _bounded_sequence_struct_field) -{ - m_bounded_sequence_struct_field = std::move(_bounded_sequence_struct_field); -} - -/*! - * @brief This function returns a constant reference to member bounded_sequence_struct_field - * @return Constant reference to member bounded_sequence_struct_field - */ -const std::vector& ContentFilterTestType::bounded_sequence_struct_field() const -{ - return m_bounded_sequence_struct_field; -} - -/*! - * @brief This function returns a reference to member bounded_sequence_struct_field - * @return Reference to member bounded_sequence_struct_field - */ -std::vector& ContentFilterTestType::bounded_sequence_struct_field() -{ - return m_bounded_sequence_struct_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field - */ -void ContentFilterTestType::unbounded_sequence_char_field( - const std::vector& _unbounded_sequence_char_field) -{ - m_unbounded_sequence_char_field = _unbounded_sequence_char_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field - */ -void ContentFilterTestType::unbounded_sequence_char_field( - std::vector&& _unbounded_sequence_char_field) -{ - m_unbounded_sequence_char_field = std::move(_unbounded_sequence_char_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_char_field - * @return Constant reference to member unbounded_sequence_char_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_char_field() const -{ - return m_unbounded_sequence_char_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_char_field - * @return Reference to member unbounded_sequence_char_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_char_field() -{ - return m_unbounded_sequence_char_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field - */ -void ContentFilterTestType::unbounded_sequence_uint8_field( - const std::vector& _unbounded_sequence_uint8_field) -{ - m_unbounded_sequence_uint8_field = _unbounded_sequence_uint8_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field - */ -void ContentFilterTestType::unbounded_sequence_uint8_field( - std::vector&& _unbounded_sequence_uint8_field) -{ - m_unbounded_sequence_uint8_field = std::move(_unbounded_sequence_uint8_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint8_field - * @return Constant reference to member unbounded_sequence_uint8_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() const -{ - return m_unbounded_sequence_uint8_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint8_field - * @return Reference to member unbounded_sequence_uint8_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() -{ - return m_unbounded_sequence_uint8_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field - */ -void ContentFilterTestType::unbounded_sequence_int16_field( - const std::vector& _unbounded_sequence_int16_field) -{ - m_unbounded_sequence_int16_field = _unbounded_sequence_int16_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field - */ -void ContentFilterTestType::unbounded_sequence_int16_field( - std::vector&& _unbounded_sequence_int16_field) -{ - m_unbounded_sequence_int16_field = std::move(_unbounded_sequence_int16_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int16_field - * @return Constant reference to member unbounded_sequence_int16_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int16_field() const -{ - return m_unbounded_sequence_int16_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int16_field - * @return Reference to member unbounded_sequence_int16_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int16_field() -{ - return m_unbounded_sequence_int16_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field - */ -void ContentFilterTestType::unbounded_sequence_uint16_field( - const std::vector& _unbounded_sequence_uint16_field) -{ - m_unbounded_sequence_uint16_field = _unbounded_sequence_uint16_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field - */ -void ContentFilterTestType::unbounded_sequence_uint16_field( - std::vector&& _unbounded_sequence_uint16_field) -{ - m_unbounded_sequence_uint16_field = std::move(_unbounded_sequence_uint16_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint16_field - * @return Constant reference to member unbounded_sequence_uint16_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() const -{ - return m_unbounded_sequence_uint16_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint16_field - * @return Reference to member unbounded_sequence_uint16_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() -{ - return m_unbounded_sequence_uint16_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field - */ -void ContentFilterTestType::unbounded_sequence_int32_field( - const std::vector& _unbounded_sequence_int32_field) -{ - m_unbounded_sequence_int32_field = _unbounded_sequence_int32_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field - */ -void ContentFilterTestType::unbounded_sequence_int32_field( - std::vector&& _unbounded_sequence_int32_field) -{ - m_unbounded_sequence_int32_field = std::move(_unbounded_sequence_int32_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int32_field - * @return Constant reference to member unbounded_sequence_int32_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int32_field() const -{ - return m_unbounded_sequence_int32_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int32_field - * @return Reference to member unbounded_sequence_int32_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int32_field() -{ - return m_unbounded_sequence_int32_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field - */ -void ContentFilterTestType::unbounded_sequence_uint32_field( - const std::vector& _unbounded_sequence_uint32_field) -{ - m_unbounded_sequence_uint32_field = _unbounded_sequence_uint32_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field - */ -void ContentFilterTestType::unbounded_sequence_uint32_field( - std::vector&& _unbounded_sequence_uint32_field) -{ - m_unbounded_sequence_uint32_field = std::move(_unbounded_sequence_uint32_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint32_field - * @return Constant reference to member unbounded_sequence_uint32_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() const -{ - return m_unbounded_sequence_uint32_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint32_field - * @return Reference to member unbounded_sequence_uint32_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() -{ - return m_unbounded_sequence_uint32_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field - */ -void ContentFilterTestType::unbounded_sequence_int64_field( - const std::vector& _unbounded_sequence_int64_field) -{ - m_unbounded_sequence_int64_field = _unbounded_sequence_int64_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field - */ -void ContentFilterTestType::unbounded_sequence_int64_field( - std::vector&& _unbounded_sequence_int64_field) -{ - m_unbounded_sequence_int64_field = std::move(_unbounded_sequence_int64_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_int64_field - * @return Constant reference to member unbounded_sequence_int64_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_int64_field() const -{ - return m_unbounded_sequence_int64_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_int64_field - * @return Reference to member unbounded_sequence_int64_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_int64_field() -{ - return m_unbounded_sequence_int64_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field - */ -void ContentFilterTestType::unbounded_sequence_uint64_field( - const std::vector& _unbounded_sequence_uint64_field) -{ - m_unbounded_sequence_uint64_field = _unbounded_sequence_uint64_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field - */ -void ContentFilterTestType::unbounded_sequence_uint64_field( - std::vector&& _unbounded_sequence_uint64_field) -{ - m_unbounded_sequence_uint64_field = std::move(_unbounded_sequence_uint64_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_uint64_field - * @return Constant reference to member unbounded_sequence_uint64_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() const -{ - return m_unbounded_sequence_uint64_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_uint64_field - * @return Reference to member unbounded_sequence_uint64_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() -{ - return m_unbounded_sequence_uint64_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field - */ -void ContentFilterTestType::unbounded_sequence_float_field( - const std::vector& _unbounded_sequence_float_field) -{ - m_unbounded_sequence_float_field = _unbounded_sequence_float_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field - */ -void ContentFilterTestType::unbounded_sequence_float_field( - std::vector&& _unbounded_sequence_float_field) -{ - m_unbounded_sequence_float_field = std::move(_unbounded_sequence_float_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_float_field - * @return Constant reference to member unbounded_sequence_float_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_float_field() const -{ - return m_unbounded_sequence_float_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_float_field - * @return Reference to member unbounded_sequence_float_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_float_field() -{ - return m_unbounded_sequence_float_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field - */ -void ContentFilterTestType::unbounded_sequence_double_field( - const std::vector& _unbounded_sequence_double_field) -{ - m_unbounded_sequence_double_field = _unbounded_sequence_double_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field - */ -void ContentFilterTestType::unbounded_sequence_double_field( - std::vector&& _unbounded_sequence_double_field) -{ - m_unbounded_sequence_double_field = std::move(_unbounded_sequence_double_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_double_field - * @return Constant reference to member unbounded_sequence_double_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_double_field() const -{ - return m_unbounded_sequence_double_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_double_field - * @return Reference to member unbounded_sequence_double_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_double_field() -{ - return m_unbounded_sequence_double_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field - */ -void ContentFilterTestType::unbounded_sequence_long_double_field( - const std::vector& _unbounded_sequence_long_double_field) -{ - m_unbounded_sequence_long_double_field = _unbounded_sequence_long_double_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field - */ -void ContentFilterTestType::unbounded_sequence_long_double_field( - std::vector&& _unbounded_sequence_long_double_field) -{ - m_unbounded_sequence_long_double_field = std::move(_unbounded_sequence_long_double_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_long_double_field - * @return Constant reference to member unbounded_sequence_long_double_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() const -{ - return m_unbounded_sequence_long_double_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_long_double_field - * @return Reference to member unbounded_sequence_long_double_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() -{ - return m_unbounded_sequence_long_double_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field - */ -void ContentFilterTestType::unbounded_sequence_bool_field( - const std::vector& _unbounded_sequence_bool_field) -{ - m_unbounded_sequence_bool_field = _unbounded_sequence_bool_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field - */ -void ContentFilterTestType::unbounded_sequence_bool_field( - std::vector&& _unbounded_sequence_bool_field) -{ - m_unbounded_sequence_bool_field = std::move(_unbounded_sequence_bool_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_bool_field - * @return Constant reference to member unbounded_sequence_bool_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_bool_field() const -{ - return m_unbounded_sequence_bool_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_bool_field - * @return Reference to member unbounded_sequence_bool_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_bool_field() -{ - return m_unbounded_sequence_bool_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field - */ -void ContentFilterTestType::unbounded_sequence_string_field( - const std::vector& _unbounded_sequence_string_field) -{ - m_unbounded_sequence_string_field = _unbounded_sequence_string_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field - */ -void ContentFilterTestType::unbounded_sequence_string_field( - std::vector&& _unbounded_sequence_string_field) -{ - m_unbounded_sequence_string_field = std::move(_unbounded_sequence_string_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_string_field - * @return Constant reference to member unbounded_sequence_string_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_string_field() const -{ - return m_unbounded_sequence_string_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_string_field - * @return Reference to member unbounded_sequence_string_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_string_field() -{ - return m_unbounded_sequence_string_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field - */ -void ContentFilterTestType::unbounded_sequence_enum_field( - const std::vector& _unbounded_sequence_enum_field) -{ - m_unbounded_sequence_enum_field = _unbounded_sequence_enum_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field - */ -void ContentFilterTestType::unbounded_sequence_enum_field( - std::vector&& _unbounded_sequence_enum_field) -{ - m_unbounded_sequence_enum_field = std::move(_unbounded_sequence_enum_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_enum_field - * @return Constant reference to member unbounded_sequence_enum_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_enum_field() const -{ - return m_unbounded_sequence_enum_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_enum_field - * @return Reference to member unbounded_sequence_enum_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_enum_field() -{ - return m_unbounded_sequence_enum_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field - */ -void ContentFilterTestType::unbounded_sequence_enum2_field( - const std::vector& _unbounded_sequence_enum2_field) -{ - m_unbounded_sequence_enum2_field = _unbounded_sequence_enum2_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field - */ -void ContentFilterTestType::unbounded_sequence_enum2_field( - std::vector&& _unbounded_sequence_enum2_field) -{ - m_unbounded_sequence_enum2_field = std::move(_unbounded_sequence_enum2_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_enum2_field - * @return Constant reference to member unbounded_sequence_enum2_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() const -{ - return m_unbounded_sequence_enum2_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_enum2_field - * @return Reference to member unbounded_sequence_enum2_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() -{ - return m_unbounded_sequence_enum2_field; -} - - -/*! - * @brief This function copies the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field - */ -void ContentFilterTestType::unbounded_sequence_struct_field( - const std::vector& _unbounded_sequence_struct_field) -{ - m_unbounded_sequence_struct_field = _unbounded_sequence_struct_field; -} - -/*! - * @brief This function moves the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field - */ -void ContentFilterTestType::unbounded_sequence_struct_field( - std::vector&& _unbounded_sequence_struct_field) -{ - m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); -} - -/*! - * @brief This function returns a constant reference to member unbounded_sequence_struct_field - * @return Constant reference to member unbounded_sequence_struct_field - */ -const std::vector& ContentFilterTestType::unbounded_sequence_struct_field() const -{ - return m_unbounded_sequence_struct_field; -} - -/*! - * @brief This function returns a reference to member unbounded_sequence_struct_field - * @return Reference to member unbounded_sequence_struct_field - */ -std::vector& ContentFilterTestType::unbounded_sequence_struct_field() -{ - return m_unbounded_sequence_struct_field; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h deleted file mode 100644 index b67d7e3d05b..00000000000 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h +++ /dev/null @@ -1,2359 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file ContentFilterTestType.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ -#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CONTENTFILTERTESTTYPE_SOURCE) -#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllexport ) -#else -#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllimport ) -#endif // CONTENTFILTERTESTTYPE_SOURCE -#else -#define CONTENTFILTERTESTTYPE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CONTENTFILTERTESTTYPE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration Color defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -enum Color : uint32_t -{ - RED, - GREEN, - BLUE, - YELLOW, - MAGENTA -}; -/*! - * @brief This class represents the enumeration Material defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -enum Material : uint32_t -{ - WOOD, - PLASTIC, - METAL, - CONCRETE, - STONE -}; - - -/*! - * @brief This class represents the structure StructType defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -class StructType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType( - const StructType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType( - StructType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType& operator =( - const StructType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructType that will be copied. - */ - eProsima_user_DllExport StructType& operator =( - StructType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructType& x) const; - - /*! - * @brief Comparison operator. - * @param x StructType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructType& x) const; - - /*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ - eProsima_user_DllExport void char_field( - char _char_field); - - /*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ - eProsima_user_DllExport char char_field() const; - - /*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ - eProsima_user_DllExport char& char_field(); - - - /*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ - eProsima_user_DllExport void uint8_field( - uint8_t _uint8_field); - - /*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ - eProsima_user_DllExport uint8_t uint8_field() const; - - /*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ - eProsima_user_DllExport uint8_t& uint8_field(); - - - /*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ - eProsima_user_DllExport void int16_field( - int16_t _int16_field); - - /*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ - eProsima_user_DllExport int16_t int16_field() const; - - /*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ - eProsima_user_DllExport int16_t& int16_field(); - - - /*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ - eProsima_user_DllExport void uint16_field( - uint16_t _uint16_field); - - /*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ - eProsima_user_DllExport uint16_t uint16_field() const; - - /*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ - eProsima_user_DllExport uint16_t& uint16_field(); - - - /*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ - eProsima_user_DllExport void int32_field( - int32_t _int32_field); - - /*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ - eProsima_user_DllExport int32_t int32_field() const; - - /*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ - eProsima_user_DllExport int32_t& int32_field(); - - - /*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ - eProsima_user_DllExport void uint32_field( - uint32_t _uint32_field); - - /*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ - eProsima_user_DllExport uint32_t uint32_field() const; - - /*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ - eProsima_user_DllExport uint32_t& uint32_field(); - - - /*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ - eProsima_user_DllExport void int64_field( - int64_t _int64_field); - - /*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ - eProsima_user_DllExport int64_t int64_field() const; - - /*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ - eProsima_user_DllExport int64_t& int64_field(); - - - /*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ - eProsima_user_DllExport void uint64_field( - uint64_t _uint64_field); - - /*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ - eProsima_user_DllExport uint64_t uint64_field() const; - - /*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ - eProsima_user_DllExport uint64_t& uint64_field(); - - - /*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ - eProsima_user_DllExport void float_field( - float _float_field); - - /*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ - eProsima_user_DllExport float float_field() const; - - /*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ - eProsima_user_DllExport float& float_field(); - - - /*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ - eProsima_user_DllExport void double_field( - double _double_field); - - /*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ - eProsima_user_DllExport double double_field() const; - - /*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ - eProsima_user_DllExport double& double_field(); - - - /*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ - eProsima_user_DllExport void long_double_field( - long double _long_double_field); - - /*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ - eProsima_user_DllExport long double long_double_field() const; - - /*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ - eProsima_user_DllExport long double& long_double_field(); - - - /*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ - eProsima_user_DllExport void bool_field( - bool _bool_field); - - /*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ - eProsima_user_DllExport bool bool_field() const; - - /*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ - eProsima_user_DllExport bool& bool_field(); - - - /*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ - eProsima_user_DllExport void string_field( - const std::string& _string_field); - - /*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ - eProsima_user_DllExport void string_field( - std::string&& _string_field); - - /*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ - eProsima_user_DllExport const std::string& string_field() const; - - /*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ - eProsima_user_DllExport std::string& string_field(); - - - /*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ - eProsima_user_DllExport void enum_field( - Color _enum_field); - - /*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ - eProsima_user_DllExport Color enum_field() const; - - /*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ - eProsima_user_DllExport Color& enum_field(); - - - /*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ - eProsima_user_DllExport void enum2_field( - Material _enum2_field); - - /*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ - eProsima_user_DllExport Material enum2_field() const; - - /*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ - eProsima_user_DllExport Material& enum2_field(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StructType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - char m_char_field; - uint8_t m_uint8_field; - int16_t m_int16_field; - uint16_t m_uint16_field; - int32_t m_int32_field; - uint32_t m_uint32_field; - int64_t m_int64_field; - uint64_t m_uint64_field; - float m_float_field; - double m_double_field; - long double m_long_double_field; - bool m_bool_field; - std::string m_string_field; - Color m_enum_field; - Material m_enum2_field; - -}; - -const uint32_t max_array_size = 3; - -const uint32_t max_seq_size = 5; - - - - - -/*! - * @brief This class represents the structure ContentFilterTestType defined by the user in the IDL file. - * @ingroup ContentFilterTestType - */ -class ContentFilterTestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ContentFilterTestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ContentFilterTestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType( - const ContentFilterTestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType( - ContentFilterTestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType& operator =( - const ContentFilterTestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ContentFilterTestType that will be copied. - */ - eProsima_user_DllExport ContentFilterTestType& operator =( - ContentFilterTestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ContentFilterTestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ContentFilterTestType& x) const; - - /*! - * @brief Comparison operator. - * @param x ContentFilterTestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ContentFilterTestType& x) const; - - /*! - * @brief This function sets a value in member char_field - * @param _char_field New value for member char_field - */ - eProsima_user_DllExport void char_field( - char _char_field); - - /*! - * @brief This function returns the value of member char_field - * @return Value of member char_field - */ - eProsima_user_DllExport char char_field() const; - - /*! - * @brief This function returns a reference to member char_field - * @return Reference to member char_field - */ - eProsima_user_DllExport char& char_field(); - - - /*! - * @brief This function sets a value in member uint8_field - * @param _uint8_field New value for member uint8_field - */ - eProsima_user_DllExport void uint8_field( - uint8_t _uint8_field); - - /*! - * @brief This function returns the value of member uint8_field - * @return Value of member uint8_field - */ - eProsima_user_DllExport uint8_t uint8_field() const; - - /*! - * @brief This function returns a reference to member uint8_field - * @return Reference to member uint8_field - */ - eProsima_user_DllExport uint8_t& uint8_field(); - - - /*! - * @brief This function sets a value in member int16_field - * @param _int16_field New value for member int16_field - */ - eProsima_user_DllExport void int16_field( - int16_t _int16_field); - - /*! - * @brief This function returns the value of member int16_field - * @return Value of member int16_field - */ - eProsima_user_DllExport int16_t int16_field() const; - - /*! - * @brief This function returns a reference to member int16_field - * @return Reference to member int16_field - */ - eProsima_user_DllExport int16_t& int16_field(); - - - /*! - * @brief This function sets a value in member uint16_field - * @param _uint16_field New value for member uint16_field - */ - eProsima_user_DllExport void uint16_field( - uint16_t _uint16_field); - - /*! - * @brief This function returns the value of member uint16_field - * @return Value of member uint16_field - */ - eProsima_user_DllExport uint16_t uint16_field() const; - - /*! - * @brief This function returns a reference to member uint16_field - * @return Reference to member uint16_field - */ - eProsima_user_DllExport uint16_t& uint16_field(); - - - /*! - * @brief This function sets a value in member int32_field - * @param _int32_field New value for member int32_field - */ - eProsima_user_DllExport void int32_field( - int32_t _int32_field); - - /*! - * @brief This function returns the value of member int32_field - * @return Value of member int32_field - */ - eProsima_user_DllExport int32_t int32_field() const; - - /*! - * @brief This function returns a reference to member int32_field - * @return Reference to member int32_field - */ - eProsima_user_DllExport int32_t& int32_field(); - - - /*! - * @brief This function sets a value in member uint32_field - * @param _uint32_field New value for member uint32_field - */ - eProsima_user_DllExport void uint32_field( - uint32_t _uint32_field); - - /*! - * @brief This function returns the value of member uint32_field - * @return Value of member uint32_field - */ - eProsima_user_DllExport uint32_t uint32_field() const; - - /*! - * @brief This function returns a reference to member uint32_field - * @return Reference to member uint32_field - */ - eProsima_user_DllExport uint32_t& uint32_field(); - - - /*! - * @brief This function sets a value in member int64_field - * @param _int64_field New value for member int64_field - */ - eProsima_user_DllExport void int64_field( - int64_t _int64_field); - - /*! - * @brief This function returns the value of member int64_field - * @return Value of member int64_field - */ - eProsima_user_DllExport int64_t int64_field() const; - - /*! - * @brief This function returns a reference to member int64_field - * @return Reference to member int64_field - */ - eProsima_user_DllExport int64_t& int64_field(); - - - /*! - * @brief This function sets a value in member uint64_field - * @param _uint64_field New value for member uint64_field - */ - eProsima_user_DllExport void uint64_field( - uint64_t _uint64_field); - - /*! - * @brief This function returns the value of member uint64_field - * @return Value of member uint64_field - */ - eProsima_user_DllExport uint64_t uint64_field() const; - - /*! - * @brief This function returns a reference to member uint64_field - * @return Reference to member uint64_field - */ - eProsima_user_DllExport uint64_t& uint64_field(); - - - /*! - * @brief This function sets a value in member float_field - * @param _float_field New value for member float_field - */ - eProsima_user_DllExport void float_field( - float _float_field); - - /*! - * @brief This function returns the value of member float_field - * @return Value of member float_field - */ - eProsima_user_DllExport float float_field() const; - - /*! - * @brief This function returns a reference to member float_field - * @return Reference to member float_field - */ - eProsima_user_DllExport float& float_field(); - - - /*! - * @brief This function sets a value in member double_field - * @param _double_field New value for member double_field - */ - eProsima_user_DllExport void double_field( - double _double_field); - - /*! - * @brief This function returns the value of member double_field - * @return Value of member double_field - */ - eProsima_user_DllExport double double_field() const; - - /*! - * @brief This function returns a reference to member double_field - * @return Reference to member double_field - */ - eProsima_user_DllExport double& double_field(); - - - /*! - * @brief This function sets a value in member long_double_field - * @param _long_double_field New value for member long_double_field - */ - eProsima_user_DllExport void long_double_field( - long double _long_double_field); - - /*! - * @brief This function returns the value of member long_double_field - * @return Value of member long_double_field - */ - eProsima_user_DllExport long double long_double_field() const; - - /*! - * @brief This function returns a reference to member long_double_field - * @return Reference to member long_double_field - */ - eProsima_user_DllExport long double& long_double_field(); - - - /*! - * @brief This function sets a value in member bool_field - * @param _bool_field New value for member bool_field - */ - eProsima_user_DllExport void bool_field( - bool _bool_field); - - /*! - * @brief This function returns the value of member bool_field - * @return Value of member bool_field - */ - eProsima_user_DllExport bool bool_field() const; - - /*! - * @brief This function returns a reference to member bool_field - * @return Reference to member bool_field - */ - eProsima_user_DllExport bool& bool_field(); - - - /*! - * @brief This function copies the value in member string_field - * @param _string_field New value to be copied in member string_field - */ - eProsima_user_DllExport void string_field( - const std::string& _string_field); - - /*! - * @brief This function moves the value in member string_field - * @param _string_field New value to be moved in member string_field - */ - eProsima_user_DllExport void string_field( - std::string&& _string_field); - - /*! - * @brief This function returns a constant reference to member string_field - * @return Constant reference to member string_field - */ - eProsima_user_DllExport const std::string& string_field() const; - - /*! - * @brief This function returns a reference to member string_field - * @return Reference to member string_field - */ - eProsima_user_DllExport std::string& string_field(); - - - /*! - * @brief This function sets a value in member enum_field - * @param _enum_field New value for member enum_field - */ - eProsima_user_DllExport void enum_field( - Color _enum_field); - - /*! - * @brief This function returns the value of member enum_field - * @return Value of member enum_field - */ - eProsima_user_DllExport Color enum_field() const; - - /*! - * @brief This function returns a reference to member enum_field - * @return Reference to member enum_field - */ - eProsima_user_DllExport Color& enum_field(); - - - /*! - * @brief This function sets a value in member enum2_field - * @param _enum2_field New value for member enum2_field - */ - eProsima_user_DllExport void enum2_field( - Material _enum2_field); - - /*! - * @brief This function returns the value of member enum2_field - * @return Value of member enum2_field - */ - eProsima_user_DllExport Material enum2_field() const; - - /*! - * @brief This function returns a reference to member enum2_field - * @return Reference to member enum2_field - */ - eProsima_user_DllExport Material& enum2_field(); - - - /*! - * @brief This function copies the value in member struct_field - * @param _struct_field New value to be copied in member struct_field - */ - eProsima_user_DllExport void struct_field( - const StructType& _struct_field); - - /*! - * @brief This function moves the value in member struct_field - * @param _struct_field New value to be moved in member struct_field - */ - eProsima_user_DllExport void struct_field( - StructType&& _struct_field); - - /*! - * @brief This function returns a constant reference to member struct_field - * @return Constant reference to member struct_field - */ - eProsima_user_DllExport const StructType& struct_field() const; - - /*! - * @brief This function returns a reference to member struct_field - * @return Reference to member struct_field - */ - eProsima_user_DllExport StructType& struct_field(); - - - /*! - * @brief This function copies the value in member array_char_field - * @param _array_char_field New value to be copied in member array_char_field - */ - eProsima_user_DllExport void array_char_field( - const std::array& _array_char_field); - - /*! - * @brief This function moves the value in member array_char_field - * @param _array_char_field New value to be moved in member array_char_field - */ - eProsima_user_DllExport void array_char_field( - std::array&& _array_char_field); - - /*! - * @brief This function returns a constant reference to member array_char_field - * @return Constant reference to member array_char_field - */ - eProsima_user_DllExport const std::array& array_char_field() const; - - /*! - * @brief This function returns a reference to member array_char_field - * @return Reference to member array_char_field - */ - eProsima_user_DllExport std::array& array_char_field(); - - - /*! - * @brief This function copies the value in member array_uint8_field - * @param _array_uint8_field New value to be copied in member array_uint8_field - */ - eProsima_user_DllExport void array_uint8_field( - const std::array& _array_uint8_field); - - /*! - * @brief This function moves the value in member array_uint8_field - * @param _array_uint8_field New value to be moved in member array_uint8_field - */ - eProsima_user_DllExport void array_uint8_field( - std::array&& _array_uint8_field); - - /*! - * @brief This function returns a constant reference to member array_uint8_field - * @return Constant reference to member array_uint8_field - */ - eProsima_user_DllExport const std::array& array_uint8_field() const; - - /*! - * @brief This function returns a reference to member array_uint8_field - * @return Reference to member array_uint8_field - */ - eProsima_user_DllExport std::array& array_uint8_field(); - - - /*! - * @brief This function copies the value in member array_int16_field - * @param _array_int16_field New value to be copied in member array_int16_field - */ - eProsima_user_DllExport void array_int16_field( - const std::array& _array_int16_field); - - /*! - * @brief This function moves the value in member array_int16_field - * @param _array_int16_field New value to be moved in member array_int16_field - */ - eProsima_user_DllExport void array_int16_field( - std::array&& _array_int16_field); - - /*! - * @brief This function returns a constant reference to member array_int16_field - * @return Constant reference to member array_int16_field - */ - eProsima_user_DllExport const std::array& array_int16_field() const; - - /*! - * @brief This function returns a reference to member array_int16_field - * @return Reference to member array_int16_field - */ - eProsima_user_DllExport std::array& array_int16_field(); - - - /*! - * @brief This function copies the value in member array_uint16_field - * @param _array_uint16_field New value to be copied in member array_uint16_field - */ - eProsima_user_DllExport void array_uint16_field( - const std::array& _array_uint16_field); - - /*! - * @brief This function moves the value in member array_uint16_field - * @param _array_uint16_field New value to be moved in member array_uint16_field - */ - eProsima_user_DllExport void array_uint16_field( - std::array&& _array_uint16_field); - - /*! - * @brief This function returns a constant reference to member array_uint16_field - * @return Constant reference to member array_uint16_field - */ - eProsima_user_DllExport const std::array& array_uint16_field() const; - - /*! - * @brief This function returns a reference to member array_uint16_field - * @return Reference to member array_uint16_field - */ - eProsima_user_DllExport std::array& array_uint16_field(); - - - /*! - * @brief This function copies the value in member array_int32_field - * @param _array_int32_field New value to be copied in member array_int32_field - */ - eProsima_user_DllExport void array_int32_field( - const std::array& _array_int32_field); - - /*! - * @brief This function moves the value in member array_int32_field - * @param _array_int32_field New value to be moved in member array_int32_field - */ - eProsima_user_DllExport void array_int32_field( - std::array&& _array_int32_field); - - /*! - * @brief This function returns a constant reference to member array_int32_field - * @return Constant reference to member array_int32_field - */ - eProsima_user_DllExport const std::array& array_int32_field() const; - - /*! - * @brief This function returns a reference to member array_int32_field - * @return Reference to member array_int32_field - */ - eProsima_user_DllExport std::array& array_int32_field(); - - - /*! - * @brief This function copies the value in member array_uint32_field - * @param _array_uint32_field New value to be copied in member array_uint32_field - */ - eProsima_user_DllExport void array_uint32_field( - const std::array& _array_uint32_field); - - /*! - * @brief This function moves the value in member array_uint32_field - * @param _array_uint32_field New value to be moved in member array_uint32_field - */ - eProsima_user_DllExport void array_uint32_field( - std::array&& _array_uint32_field); - - /*! - * @brief This function returns a constant reference to member array_uint32_field - * @return Constant reference to member array_uint32_field - */ - eProsima_user_DllExport const std::array& array_uint32_field() const; - - /*! - * @brief This function returns a reference to member array_uint32_field - * @return Reference to member array_uint32_field - */ - eProsima_user_DllExport std::array& array_uint32_field(); - - - /*! - * @brief This function copies the value in member array_int64_field - * @param _array_int64_field New value to be copied in member array_int64_field - */ - eProsima_user_DllExport void array_int64_field( - const std::array& _array_int64_field); - - /*! - * @brief This function moves the value in member array_int64_field - * @param _array_int64_field New value to be moved in member array_int64_field - */ - eProsima_user_DllExport void array_int64_field( - std::array&& _array_int64_field); - - /*! - * @brief This function returns a constant reference to member array_int64_field - * @return Constant reference to member array_int64_field - */ - eProsima_user_DllExport const std::array& array_int64_field() const; - - /*! - * @brief This function returns a reference to member array_int64_field - * @return Reference to member array_int64_field - */ - eProsima_user_DllExport std::array& array_int64_field(); - - - /*! - * @brief This function copies the value in member array_uint64_field - * @param _array_uint64_field New value to be copied in member array_uint64_field - */ - eProsima_user_DllExport void array_uint64_field( - const std::array& _array_uint64_field); - - /*! - * @brief This function moves the value in member array_uint64_field - * @param _array_uint64_field New value to be moved in member array_uint64_field - */ - eProsima_user_DllExport void array_uint64_field( - std::array&& _array_uint64_field); - - /*! - * @brief This function returns a constant reference to member array_uint64_field - * @return Constant reference to member array_uint64_field - */ - eProsima_user_DllExport const std::array& array_uint64_field() const; - - /*! - * @brief This function returns a reference to member array_uint64_field - * @return Reference to member array_uint64_field - */ - eProsima_user_DllExport std::array& array_uint64_field(); - - - /*! - * @brief This function copies the value in member array_float_field - * @param _array_float_field New value to be copied in member array_float_field - */ - eProsima_user_DllExport void array_float_field( - const std::array& _array_float_field); - - /*! - * @brief This function moves the value in member array_float_field - * @param _array_float_field New value to be moved in member array_float_field - */ - eProsima_user_DllExport void array_float_field( - std::array&& _array_float_field); - - /*! - * @brief This function returns a constant reference to member array_float_field - * @return Constant reference to member array_float_field - */ - eProsima_user_DllExport const std::array& array_float_field() const; - - /*! - * @brief This function returns a reference to member array_float_field - * @return Reference to member array_float_field - */ - eProsima_user_DllExport std::array& array_float_field(); - - - /*! - * @brief This function copies the value in member array_double_field - * @param _array_double_field New value to be copied in member array_double_field - */ - eProsima_user_DllExport void array_double_field( - const std::array& _array_double_field); - - /*! - * @brief This function moves the value in member array_double_field - * @param _array_double_field New value to be moved in member array_double_field - */ - eProsima_user_DllExport void array_double_field( - std::array&& _array_double_field); - - /*! - * @brief This function returns a constant reference to member array_double_field - * @return Constant reference to member array_double_field - */ - eProsima_user_DllExport const std::array& array_double_field() const; - - /*! - * @brief This function returns a reference to member array_double_field - * @return Reference to member array_double_field - */ - eProsima_user_DllExport std::array& array_double_field(); - - - /*! - * @brief This function copies the value in member array_long_double_field - * @param _array_long_double_field New value to be copied in member array_long_double_field - */ - eProsima_user_DllExport void array_long_double_field( - const std::array& _array_long_double_field); - - /*! - * @brief This function moves the value in member array_long_double_field - * @param _array_long_double_field New value to be moved in member array_long_double_field - */ - eProsima_user_DllExport void array_long_double_field( - std::array&& _array_long_double_field); - - /*! - * @brief This function returns a constant reference to member array_long_double_field - * @return Constant reference to member array_long_double_field - */ - eProsima_user_DllExport const std::array& array_long_double_field() const; - - /*! - * @brief This function returns a reference to member array_long_double_field - * @return Reference to member array_long_double_field - */ - eProsima_user_DllExport std::array& array_long_double_field(); - - - /*! - * @brief This function copies the value in member array_bool_field - * @param _array_bool_field New value to be copied in member array_bool_field - */ - eProsima_user_DllExport void array_bool_field( - const std::array& _array_bool_field); - - /*! - * @brief This function moves the value in member array_bool_field - * @param _array_bool_field New value to be moved in member array_bool_field - */ - eProsima_user_DllExport void array_bool_field( - std::array&& _array_bool_field); - - /*! - * @brief This function returns a constant reference to member array_bool_field - * @return Constant reference to member array_bool_field - */ - eProsima_user_DllExport const std::array& array_bool_field() const; - - /*! - * @brief This function returns a reference to member array_bool_field - * @return Reference to member array_bool_field - */ - eProsima_user_DllExport std::array& array_bool_field(); - - - /*! - * @brief This function copies the value in member array_string_field - * @param _array_string_field New value to be copied in member array_string_field - */ - eProsima_user_DllExport void array_string_field( - const std::array& _array_string_field); - - /*! - * @brief This function moves the value in member array_string_field - * @param _array_string_field New value to be moved in member array_string_field - */ - eProsima_user_DllExport void array_string_field( - std::array&& _array_string_field); - - /*! - * @brief This function returns a constant reference to member array_string_field - * @return Constant reference to member array_string_field - */ - eProsima_user_DllExport const std::array& array_string_field() const; - - /*! - * @brief This function returns a reference to member array_string_field - * @return Reference to member array_string_field - */ - eProsima_user_DllExport std::array& array_string_field(); - - - /*! - * @brief This function copies the value in member array_enum_field - * @param _array_enum_field New value to be copied in member array_enum_field - */ - eProsima_user_DllExport void array_enum_field( - const std::array& _array_enum_field); - - /*! - * @brief This function moves the value in member array_enum_field - * @param _array_enum_field New value to be moved in member array_enum_field - */ - eProsima_user_DllExport void array_enum_field( - std::array&& _array_enum_field); - - /*! - * @brief This function returns a constant reference to member array_enum_field - * @return Constant reference to member array_enum_field - */ - eProsima_user_DllExport const std::array& array_enum_field() const; - - /*! - * @brief This function returns a reference to member array_enum_field - * @return Reference to member array_enum_field - */ - eProsima_user_DllExport std::array& array_enum_field(); - - - /*! - * @brief This function copies the value in member array_enum2_field - * @param _array_enum2_field New value to be copied in member array_enum2_field - */ - eProsima_user_DllExport void array_enum2_field( - const std::array& _array_enum2_field); - - /*! - * @brief This function moves the value in member array_enum2_field - * @param _array_enum2_field New value to be moved in member array_enum2_field - */ - eProsima_user_DllExport void array_enum2_field( - std::array&& _array_enum2_field); - - /*! - * @brief This function returns a constant reference to member array_enum2_field - * @return Constant reference to member array_enum2_field - */ - eProsima_user_DllExport const std::array& array_enum2_field() const; - - /*! - * @brief This function returns a reference to member array_enum2_field - * @return Reference to member array_enum2_field - */ - eProsima_user_DllExport std::array& array_enum2_field(); - - - /*! - * @brief This function copies the value in member array_struct_field - * @param _array_struct_field New value to be copied in member array_struct_field - */ - eProsima_user_DllExport void array_struct_field( - const std::array& _array_struct_field); - - /*! - * @brief This function moves the value in member array_struct_field - * @param _array_struct_field New value to be moved in member array_struct_field - */ - eProsima_user_DllExport void array_struct_field( - std::array&& _array_struct_field); - - /*! - * @brief This function returns a constant reference to member array_struct_field - * @return Constant reference to member array_struct_field - */ - eProsima_user_DllExport const std::array& array_struct_field() const; - - /*! - * @brief This function returns a reference to member array_struct_field - * @return Reference to member array_struct_field - */ - eProsima_user_DllExport std::array& array_struct_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field - */ - eProsima_user_DllExport void bounded_sequence_char_field( - const std::vector& _bounded_sequence_char_field); - - /*! - * @brief This function moves the value in member bounded_sequence_char_field - * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field - */ - eProsima_user_DllExport void bounded_sequence_char_field( - std::vector&& _bounded_sequence_char_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_char_field - * @return Constant reference to member bounded_sequence_char_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_char_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_char_field - * @return Reference to member bounded_sequence_char_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_char_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field - */ - eProsima_user_DllExport void bounded_sequence_uint8_field( - const std::vector& _bounded_sequence_uint8_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint8_field - * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field - */ - eProsima_user_DllExport void bounded_sequence_uint8_field( - std::vector&& _bounded_sequence_uint8_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint8_field - * @return Constant reference to member bounded_sequence_uint8_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint8_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint8_field - * @return Reference to member bounded_sequence_uint8_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint8_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field - */ - eProsima_user_DllExport void bounded_sequence_int16_field( - const std::vector& _bounded_sequence_int16_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int16_field - * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field - */ - eProsima_user_DllExport void bounded_sequence_int16_field( - std::vector&& _bounded_sequence_int16_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int16_field - * @return Constant reference to member bounded_sequence_int16_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int16_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int16_field - * @return Reference to member bounded_sequence_int16_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int16_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field - */ - eProsima_user_DllExport void bounded_sequence_uint16_field( - const std::vector& _bounded_sequence_uint16_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint16_field - * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field - */ - eProsima_user_DllExport void bounded_sequence_uint16_field( - std::vector&& _bounded_sequence_uint16_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint16_field - * @return Constant reference to member bounded_sequence_uint16_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint16_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint16_field - * @return Reference to member bounded_sequence_uint16_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint16_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field - */ - eProsima_user_DllExport void bounded_sequence_int32_field( - const std::vector& _bounded_sequence_int32_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int32_field - * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field - */ - eProsima_user_DllExport void bounded_sequence_int32_field( - std::vector&& _bounded_sequence_int32_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int32_field - * @return Constant reference to member bounded_sequence_int32_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int32_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int32_field - * @return Reference to member bounded_sequence_int32_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int32_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field - */ - eProsima_user_DllExport void bounded_sequence_uint32_field( - const std::vector& _bounded_sequence_uint32_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint32_field - * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field - */ - eProsima_user_DllExport void bounded_sequence_uint32_field( - std::vector&& _bounded_sequence_uint32_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint32_field - * @return Constant reference to member bounded_sequence_uint32_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint32_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint32_field - * @return Reference to member bounded_sequence_uint32_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint32_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field - */ - eProsima_user_DllExport void bounded_sequence_int64_field( - const std::vector& _bounded_sequence_int64_field); - - /*! - * @brief This function moves the value in member bounded_sequence_int64_field - * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field - */ - eProsima_user_DllExport void bounded_sequence_int64_field( - std::vector&& _bounded_sequence_int64_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_int64_field - * @return Constant reference to member bounded_sequence_int64_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_int64_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_int64_field - * @return Reference to member bounded_sequence_int64_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_int64_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field - */ - eProsima_user_DllExport void bounded_sequence_uint64_field( - const std::vector& _bounded_sequence_uint64_field); - - /*! - * @brief This function moves the value in member bounded_sequence_uint64_field - * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field - */ - eProsima_user_DllExport void bounded_sequence_uint64_field( - std::vector&& _bounded_sequence_uint64_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_uint64_field - * @return Constant reference to member bounded_sequence_uint64_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_uint64_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_uint64_field - * @return Reference to member bounded_sequence_uint64_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_uint64_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field - */ - eProsima_user_DllExport void bounded_sequence_float_field( - const std::vector& _bounded_sequence_float_field); - - /*! - * @brief This function moves the value in member bounded_sequence_float_field - * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field - */ - eProsima_user_DllExport void bounded_sequence_float_field( - std::vector&& _bounded_sequence_float_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_float_field - * @return Constant reference to member bounded_sequence_float_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_float_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_float_field - * @return Reference to member bounded_sequence_float_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_float_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field - */ - eProsima_user_DllExport void bounded_sequence_double_field( - const std::vector& _bounded_sequence_double_field); - - /*! - * @brief This function moves the value in member bounded_sequence_double_field - * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field - */ - eProsima_user_DllExport void bounded_sequence_double_field( - std::vector&& _bounded_sequence_double_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_double_field - * @return Constant reference to member bounded_sequence_double_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_double_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_double_field - * @return Reference to member bounded_sequence_double_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_double_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field - */ - eProsima_user_DllExport void bounded_sequence_long_double_field( - const std::vector& _bounded_sequence_long_double_field); - - /*! - * @brief This function moves the value in member bounded_sequence_long_double_field - * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field - */ - eProsima_user_DllExport void bounded_sequence_long_double_field( - std::vector&& _bounded_sequence_long_double_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_long_double_field - * @return Constant reference to member bounded_sequence_long_double_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_long_double_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_long_double_field - * @return Reference to member bounded_sequence_long_double_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_long_double_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field - */ - eProsima_user_DllExport void bounded_sequence_bool_field( - const std::vector& _bounded_sequence_bool_field); - - /*! - * @brief This function moves the value in member bounded_sequence_bool_field - * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field - */ - eProsima_user_DllExport void bounded_sequence_bool_field( - std::vector&& _bounded_sequence_bool_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_bool_field - * @return Constant reference to member bounded_sequence_bool_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_bool_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_bool_field - * @return Reference to member bounded_sequence_bool_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_bool_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field - */ - eProsima_user_DllExport void bounded_sequence_string_field( - const std::vector& _bounded_sequence_string_field); - - /*! - * @brief This function moves the value in member bounded_sequence_string_field - * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field - */ - eProsima_user_DllExport void bounded_sequence_string_field( - std::vector&& _bounded_sequence_string_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_string_field - * @return Constant reference to member bounded_sequence_string_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_string_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_string_field - * @return Reference to member bounded_sequence_string_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_string_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field - */ - eProsima_user_DllExport void bounded_sequence_enum_field( - const std::vector& _bounded_sequence_enum_field); - - /*! - * @brief This function moves the value in member bounded_sequence_enum_field - * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field - */ - eProsima_user_DllExport void bounded_sequence_enum_field( - std::vector&& _bounded_sequence_enum_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_enum_field - * @return Constant reference to member bounded_sequence_enum_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_enum_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_enum_field - * @return Reference to member bounded_sequence_enum_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_enum_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field - */ - eProsima_user_DllExport void bounded_sequence_enum2_field( - const std::vector& _bounded_sequence_enum2_field); - - /*! - * @brief This function moves the value in member bounded_sequence_enum2_field - * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field - */ - eProsima_user_DllExport void bounded_sequence_enum2_field( - std::vector&& _bounded_sequence_enum2_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_enum2_field - * @return Constant reference to member bounded_sequence_enum2_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_enum2_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_enum2_field - * @return Reference to member bounded_sequence_enum2_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_enum2_field(); - - - /*! - * @brief This function copies the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field - */ - eProsima_user_DllExport void bounded_sequence_struct_field( - const std::vector& _bounded_sequence_struct_field); - - /*! - * @brief This function moves the value in member bounded_sequence_struct_field - * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field - */ - eProsima_user_DllExport void bounded_sequence_struct_field( - std::vector&& _bounded_sequence_struct_field); - - /*! - * @brief This function returns a constant reference to member bounded_sequence_struct_field - * @return Constant reference to member bounded_sequence_struct_field - */ - eProsima_user_DllExport const std::vector& bounded_sequence_struct_field() const; - - /*! - * @brief This function returns a reference to member bounded_sequence_struct_field - * @return Reference to member bounded_sequence_struct_field - */ - eProsima_user_DllExport std::vector& bounded_sequence_struct_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field - */ - eProsima_user_DllExport void unbounded_sequence_char_field( - const std::vector& _unbounded_sequence_char_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_char_field - * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field - */ - eProsima_user_DllExport void unbounded_sequence_char_field( - std::vector&& _unbounded_sequence_char_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_char_field - * @return Constant reference to member unbounded_sequence_char_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_char_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_char_field - * @return Reference to member unbounded_sequence_char_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_char_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport void unbounded_sequence_uint8_field( - const std::vector& _unbounded_sequence_uint8_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint8_field - * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport void unbounded_sequence_uint8_field( - std::vector&& _unbounded_sequence_uint8_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint8_field - * @return Constant reference to member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint8_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint8_field - * @return Reference to member unbounded_sequence_uint8_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field - */ - eProsima_user_DllExport void unbounded_sequence_int16_field( - const std::vector& _unbounded_sequence_int16_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int16_field - * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field - */ - eProsima_user_DllExport void unbounded_sequence_int16_field( - std::vector&& _unbounded_sequence_int16_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int16_field - * @return Constant reference to member unbounded_sequence_int16_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int16_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int16_field - * @return Reference to member unbounded_sequence_int16_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int16_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport void unbounded_sequence_uint16_field( - const std::vector& _unbounded_sequence_uint16_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint16_field - * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport void unbounded_sequence_uint16_field( - std::vector&& _unbounded_sequence_uint16_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint16_field - * @return Constant reference to member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint16_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint16_field - * @return Reference to member unbounded_sequence_uint16_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field - */ - eProsima_user_DllExport void unbounded_sequence_int32_field( - const std::vector& _unbounded_sequence_int32_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int32_field - * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field - */ - eProsima_user_DllExport void unbounded_sequence_int32_field( - std::vector&& _unbounded_sequence_int32_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int32_field - * @return Constant reference to member unbounded_sequence_int32_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int32_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int32_field - * @return Reference to member unbounded_sequence_int32_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int32_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport void unbounded_sequence_uint32_field( - const std::vector& _unbounded_sequence_uint32_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint32_field - * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport void unbounded_sequence_uint32_field( - std::vector&& _unbounded_sequence_uint32_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint32_field - * @return Constant reference to member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint32_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint32_field - * @return Reference to member unbounded_sequence_uint32_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field - */ - eProsima_user_DllExport void unbounded_sequence_int64_field( - const std::vector& _unbounded_sequence_int64_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_int64_field - * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field - */ - eProsima_user_DllExport void unbounded_sequence_int64_field( - std::vector&& _unbounded_sequence_int64_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_int64_field - * @return Constant reference to member unbounded_sequence_int64_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_int64_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_int64_field - * @return Reference to member unbounded_sequence_int64_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_int64_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport void unbounded_sequence_uint64_field( - const std::vector& _unbounded_sequence_uint64_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_uint64_field - * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport void unbounded_sequence_uint64_field( - std::vector&& _unbounded_sequence_uint64_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_uint64_field - * @return Constant reference to member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_uint64_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_uint64_field - * @return Reference to member unbounded_sequence_uint64_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field - */ - eProsima_user_DllExport void unbounded_sequence_float_field( - const std::vector& _unbounded_sequence_float_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_float_field - * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field - */ - eProsima_user_DllExport void unbounded_sequence_float_field( - std::vector&& _unbounded_sequence_float_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_float_field - * @return Constant reference to member unbounded_sequence_float_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_float_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_float_field - * @return Reference to member unbounded_sequence_float_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_float_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field - */ - eProsima_user_DllExport void unbounded_sequence_double_field( - const std::vector& _unbounded_sequence_double_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_double_field - * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field - */ - eProsima_user_DllExport void unbounded_sequence_double_field( - std::vector&& _unbounded_sequence_double_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_double_field - * @return Constant reference to member unbounded_sequence_double_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_double_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_double_field - * @return Reference to member unbounded_sequence_double_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_double_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport void unbounded_sequence_long_double_field( - const std::vector& _unbounded_sequence_long_double_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_long_double_field - * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport void unbounded_sequence_long_double_field( - std::vector&& _unbounded_sequence_long_double_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_long_double_field - * @return Constant reference to member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_long_double_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_long_double_field - * @return Reference to member unbounded_sequence_long_double_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_long_double_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field - */ - eProsima_user_DllExport void unbounded_sequence_bool_field( - const std::vector& _unbounded_sequence_bool_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_bool_field - * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field - */ - eProsima_user_DllExport void unbounded_sequence_bool_field( - std::vector&& _unbounded_sequence_bool_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_bool_field - * @return Constant reference to member unbounded_sequence_bool_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_bool_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_bool_field - * @return Reference to member unbounded_sequence_bool_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_bool_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field - */ - eProsima_user_DllExport void unbounded_sequence_string_field( - const std::vector& _unbounded_sequence_string_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_string_field - * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field - */ - eProsima_user_DllExport void unbounded_sequence_string_field( - std::vector&& _unbounded_sequence_string_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_string_field - * @return Constant reference to member unbounded_sequence_string_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_string_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_string_field - * @return Reference to member unbounded_sequence_string_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_string_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field - */ - eProsima_user_DllExport void unbounded_sequence_enum_field( - const std::vector& _unbounded_sequence_enum_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_enum_field - * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field - */ - eProsima_user_DllExport void unbounded_sequence_enum_field( - std::vector&& _unbounded_sequence_enum_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_enum_field - * @return Constant reference to member unbounded_sequence_enum_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_enum_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_enum_field - * @return Reference to member unbounded_sequence_enum_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_enum_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport void unbounded_sequence_enum2_field( - const std::vector& _unbounded_sequence_enum2_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_enum2_field - * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport void unbounded_sequence_enum2_field( - std::vector&& _unbounded_sequence_enum2_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_enum2_field - * @return Constant reference to member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_enum2_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_enum2_field - * @return Reference to member unbounded_sequence_enum2_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field(); - - - /*! - * @brief This function copies the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field - */ - eProsima_user_DllExport void unbounded_sequence_struct_field( - const std::vector& _unbounded_sequence_struct_field); - - /*! - * @brief This function moves the value in member unbounded_sequence_struct_field - * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field - */ - eProsima_user_DllExport void unbounded_sequence_struct_field( - std::vector&& _unbounded_sequence_struct_field); - - /*! - * @brief This function returns a constant reference to member unbounded_sequence_struct_field - * @return Constant reference to member unbounded_sequence_struct_field - */ - eProsima_user_DllExport const std::vector& unbounded_sequence_struct_field() const; - - /*! - * @brief This function returns a reference to member unbounded_sequence_struct_field - * @return Reference to member unbounded_sequence_struct_field - */ - eProsima_user_DllExport std::vector& unbounded_sequence_struct_field(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ContentFilterTestType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - char m_char_field; - uint8_t m_uint8_field; - int16_t m_int16_field; - uint16_t m_uint16_field; - int32_t m_int32_field; - uint32_t m_uint32_field; - int64_t m_int64_field; - uint64_t m_uint64_field; - float m_float_field; - double m_double_field; - long double m_long_double_field; - bool m_bool_field; - std::string m_string_field; - Color m_enum_field; - Material m_enum2_field; - StructType m_struct_field; - std::array m_array_char_field; - std::array m_array_uint8_field; - std::array m_array_int16_field; - std::array m_array_uint16_field; - std::array m_array_int32_field; - std::array m_array_uint32_field; - std::array m_array_int64_field; - std::array m_array_uint64_field; - std::array m_array_float_field; - std::array m_array_double_field; - std::array m_array_long_double_field; - std::array m_array_bool_field; - std::array m_array_string_field; - std::array m_array_enum_field; - std::array m_array_enum2_field; - std::array m_array_struct_field; - std::vector m_bounded_sequence_char_field; - std::vector m_bounded_sequence_uint8_field; - std::vector m_bounded_sequence_int16_field; - std::vector m_bounded_sequence_uint16_field; - std::vector m_bounded_sequence_int32_field; - std::vector m_bounded_sequence_uint32_field; - std::vector m_bounded_sequence_int64_field; - std::vector m_bounded_sequence_uint64_field; - std::vector m_bounded_sequence_float_field; - std::vector m_bounded_sequence_double_field; - std::vector m_bounded_sequence_long_double_field; - std::vector m_bounded_sequence_bool_field; - std::vector m_bounded_sequence_string_field; - std::vector m_bounded_sequence_enum_field; - std::vector m_bounded_sequence_enum2_field; - std::vector m_bounded_sequence_struct_field; - std::vector m_unbounded_sequence_char_field; - std::vector m_unbounded_sequence_uint8_field; - std::vector m_unbounded_sequence_int16_field; - std::vector m_unbounded_sequence_uint16_field; - std::vector m_unbounded_sequence_int32_field; - std::vector m_unbounded_sequence_uint32_field; - std::vector m_unbounded_sequence_int64_field; - std::vector m_unbounded_sequence_uint64_field; - std::vector m_unbounded_sequence_float_field; - std::vector m_unbounded_sequence_double_field; - std::vector m_unbounded_sequence_long_double_field; - std::vector m_unbounded_sequence_bool_field; - std::vector m_unbounded_sequence_string_field; - std::vector m_unbounded_sequence_enum_field; - std::vector m_unbounded_sequence_enum2_field; - std::vector m_unbounded_sequence_struct_field; - -}; - - -#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dds/topic/TopicTests.cpp b/test/unittest/dds/topic/TopicTests.cpp index bd102150bfe..94b38e4ee46 100644 --- a/test/unittest/dds/topic/TopicTests.cpp +++ b/test/unittest/dds/topic/TopicTests.cpp @@ -15,30 +15,19 @@ #include #include -#include #include +#include +#include +#include +#include #include #include -#include -#include - -#include -#include -#include - -#include -#include - +#include namespace eprosima { namespace fastdds { namespace dds { -using fastrtps::TopicAttributes; -using fastrtps::xmlparser::XMLProfileManager; -using fastrtps::xmlparser::XMLP_ret; - - class FooType { public: @@ -143,21 +132,21 @@ TEST(TopicTests, ChangeTopicQos) ASSERT_NE(topic, nullptr); TopicQos qos; - ASSERT_EQ(topic->get_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->get_qos(qos), RETCODE_OK); ASSERT_EQ(qos, TOPIC_QOS_DEFAULT); qos.reliability().kind = RELIABLE_RELIABILITY_QOS; - ASSERT_EQ(topic->set_qos(qos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->set_qos(qos), RETCODE_OK); TopicQos tqos; - ASSERT_EQ(topic->get_qos(tqos), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->get_qos(tqos), RETCODE_OK); ASSERT_TRUE(qos == tqos); ASSERT_EQ(tqos.reliability().kind, RELIABLE_RELIABILITY_QOS); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } @@ -175,8 +164,8 @@ TEST(TopicTests, GetTopicParticipant) ASSERT_EQ(topic->get_participant(), participant); - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } void set_listener_test ( @@ -184,7 +173,7 @@ void set_listener_test ( TopicListener* listener, StatusMask mask) { - ASSERT_EQ(topic->set_listener(listener, mask), ReturnCode_t::RETCODE_OK); + ASSERT_EQ(topic->set_listener(listener, mask), RETCODE_OK); ASSERT_EQ(topic->get_status_mask(), mask); } @@ -225,8 +214,8 @@ TEST(TopicTests, SetListener) std::get<2>(testing_case)); } - ASSERT_TRUE(participant->delete_topic(topic) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == ReturnCode_t::RETCODE_OK); + ASSERT_TRUE(participant->delete_topic(topic) == RETCODE_OK); + ASSERT_TRUE(DomainParticipantFactory::get_instance()->delete_participant(participant) == RETCODE_OK); } /* @@ -301,12 +290,12 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyNotKeyed) ASSERT_NE(topic5, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 TopicQos qos2 = TOPIC_QOS_DEFAULT; Topic* default_topic1 = participant->create_topic("footopic6", type.get_type_name(), qos2); ASSERT_NE(default_topic1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -316,35 +305,35 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyNotKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 4999; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0 + // set_qos() should return RETCODE_OK = 0 // By not using instances, instance allocation consistency is not checked. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); } /* @@ -429,12 +418,12 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) ASSERT_NE(topic6, nullptr); // Next QoS config checks the default qos configuration, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. TopicQos qos2 = TOPIC_QOS_DEFAULT; Topic* default_topic1 = participant->create_topic("footopic7", type.get_type_name(), qos2); ASSERT_NE(default_topic1, nullptr); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. @@ -443,7 +432,7 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = -1; qos2.resource_limits().max_samples_per_instance = -1; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples < ( max_instances * max_samples_per_instance ) , // set_qos() should return a value != 0 (not OK) @@ -451,32 +440,32 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_NE(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_NE(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples > ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5001; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples = ( max_instances * max_samples_per_instance ) , - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 5000; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); // Next QoS config checks that if user sets max_samples infinite // and ( max_instances * max_samples_per_instance ) finite, - // set_qos() should return ReturnCode_t::RETCODE_OK = 0. + // set_qos() should return RETCODE_OK = 0. qos2.resource_limits().max_samples = 0; qos2.resource_limits().max_instances = 10; qos2.resource_limits().max_samples_per_instance = 500; - ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); + ASSERT_EQ(RETCODE_OK, default_topic1->set_qos(qos2)); } } // namespace dds diff --git a/test/unittest/dds/xtypes/type_representation/CMakeLists.txt b/test/unittest/dds/xtypes/type_representation/CMakeLists.txt new file mode 100644 index 00000000000..52e1664ecbb --- /dev/null +++ b/test/unittest/dds/xtypes/type_representation/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(TYPEOBJECTUTILSTESTS_SOURCE TypeObjectUtilsTests.cpp) +set(TYPEOBJECTREGISTRYTESTS_SOURCE TypeObjectRegistryTests.cpp) + +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) +endif() + +add_executable(TypeObjectUtilsTests ${TYPEOBJECTUTILSTESTS_SOURCE}) +target_compile_definitions(TypeObjectUtilsTests PRIVATE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) +target_include_directories(TypeObjectUtilsTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) +target_link_libraries(TypeObjectUtilsTests + fastcdr + fastdds + GTest::gtest + ${CMAKE_DL_LIBS}) +gtest_discover_tests(TypeObjectUtilsTests SOURCES ${TYPEOBJECTUTILSTESTS_SOURCE}) + +add_executable(TypeObjectRegistryTests ${TYPEOBJECTREGISTRYTESTS_SOURCE}) +target_compile_definitions(TypeObjectRegistryTests PRIVATE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) +target_include_directories(TypeObjectRegistryTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) +target_link_libraries(TypeObjectRegistryTests + fastcdr + fastdds + GTest::gtest + ${CMAKE_DL_LIBS}) + gtest_discover_tests(TypeObjectRegistryTests SOURCES ${TYPEOBJECTREGISTRYTESTS_SOURCE}) diff --git a/test/unittest/dds/xtypes/type_representation/TypeObjectRegistryTests.cpp b/test/unittest/dds/xtypes/type_representation/TypeObjectRegistryTests.cpp new file mode 100644 index 00000000000..7e331436d42 --- /dev/null +++ b/test/unittest/dds/xtypes/type_representation/TypeObjectRegistryTests.cpp @@ -0,0 +1,265 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file + * This file contains unit tests related to the TypeObjectRegistry API. + */ + +#include + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +// Test TypeObjectRegistry::register_type_object +TEST(TypeObjectRegistryTests, register_type_object) +{ + TypeIdentifier type_id; + type_id._d(TK_BYTE); + CompleteAliasType complete_alias_type; + complete_alias_type.header().detail().type_name("alias_name"); + CompleteTypeObject type_object; + type_object.alias_type(complete_alias_type); +#if !defined(NDEBUG) + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("alias", + type_object)); +#endif // if !defined(NDEBUG) + complete_alias_type.body().common().related_type(type_id); + type_object.alias_type(complete_alias_type); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("", type_object)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("alias", + type_object)); + complete_alias_type.header().detail().type_name("other_name"); + type_object.alias_type(complete_alias_type); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("alias", + type_object)); +} + +// Test TypeObjectRegistry::register_type_identifier +TEST(TypeObjectRegistryTests, register_type_identifier) +{ + TypeIdentifier type_id; + type_id.equivalence_hash(EquivalenceHash()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_identifier("hash_type_id", + type_id)); + StringSTypeDefn small_string; + small_string.bound(10); + type_id.string_sdefn(small_string); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_identifier("", + type_id)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_identifier("string_type_id", + type_id)); + type_id.string_sdefn().bound(5); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_identifier("string_type_id", + type_id)); +} + +// Test TypeObjectRegistry::get_type_objects +TEST(TypeObjectRegistryTests, get_type_objects) +{ + TypeObjectPair type_objects; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects("", type_objects)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects("test_name", + type_objects)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects(boolean_type_name, + type_objects)); + TypeIdentifier alias_type_id; + alias_type_id._d(TK_BYTE); + CompleteAliasType complete_alias_type; + complete_alias_type.header().detail().type_name("alias_name"); + complete_alias_type.body().common().related_type(alias_type_id); + TypeObject type_object; + CompleteTypeObject complete_type_object; + complete_type_object.alias_type(complete_alias_type); + type_object.complete(complete_type_object); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("test_name", + type_object.complete())); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_objects("test_name", + type_objects)); + EXPECT_EQ(type_objects.complete_type_object, type_object); +} + +// Test TypeObjectRegistry::get_type_identifiers +TEST(TypeObjectRegistryTests, get_type_identifiers) +{ + TypeIdentifierPair type_ids; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("", type_ids)); + TypeIdentifier none_type_id; + TypeIdentifier type_id; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("test_type", + type_ids)); + + // Register fully descriptive TypeIdentifier + StringSTypeDefn small_string = TypeObjectUtils::build_string_s_type_defn(32); + type_id.string_sdefn(small_string); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_identifier("test_type", + type_id)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("test_type", + type_ids)); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + + // Register hash TypeIdentifier + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("alias", type_ids)); + TypeIdentifier alias_type_id; + alias_type_id._d(TK_BYTE); + CompleteAliasType complete_alias_type; + complete_alias_type.header().detail().type_name("alias_name"); + complete_alias_type.body().common().related_type(alias_type_id); + CompleteTypeObject type_object; + type_object.alias_type(complete_alias_type); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().register_type_object("alias", + type_object)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("alias", type_ids)); + EXPECT_TRUE((type_ids.type_identifier1()._d() == EK_MINIMAL && type_ids.type_identifier2()._d() == EK_COMPLETE) || + (type_ids.type_identifier1()._d() == EK_COMPLETE && type_ids.type_identifier2()._d() == EK_MINIMAL)); +} + +// Test TypeObjectRegistry::get_type_identifiers for primitive types +TEST(TypeObjectRegistryTests, get_type_identifiers_primitive_types) +{ + TypeIdentifierPair type_ids; + TypeIdentifier none_type_id; + TypeIdentifier type_id; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(boolean_type_name, + type_ids)); + type_id._d(TK_BOOLEAN); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(byte_type_name, + type_ids)); + type_id._d(TK_BYTE); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(int16_type_name, + type_ids)); + type_id._d(TK_INT16); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(int32_type_name, + type_ids)); + type_id._d(TK_INT32); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(int64_type_name, + type_ids)); + type_id._d(TK_INT64); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(uint16_type_name, + type_ids)); + type_id._d(TK_UINT16); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(uint32_type_name, + type_ids)); + type_id._d(TK_UINT32); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(uint64_type_name, + type_ids)); + type_id._d(TK_UINT64); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(float32_type_name, + type_ids)); + type_id._d(TK_FLOAT32); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(float64_type_name, + type_ids)); + type_id._d(TK_FLOAT64); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(float128_type_name, + type_ids)); + type_id._d(TK_FLOAT128); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(int8_type_name, + type_ids)); + type_id._d(TK_INT8); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(uint8_type_name, + type_ids)); + type_id._d(TK_UINT8); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(char8_type_name, + type_ids)); + type_id._d(TK_CHAR8); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(char16_type_name, + type_ids)); + type_id._d(TK_CHAR16); + EXPECT_EQ(type_ids.type_identifier1(), type_id); + EXPECT_EQ(type_ids.type_identifier2(), none_type_id); +} + +} // xtypes +} // dds +} // fastdds +} // eprosima + +int main( + int argc, + char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/unittest/dds/xtypes/type_representation/TypeObjectUtilsTests.cpp b/test/unittest/dds/xtypes/type_representation/TypeObjectUtilsTests.cpp new file mode 100644 index 00000000000..55cbd0b5d6a --- /dev/null +++ b/test/unittest/dds/xtypes/type_representation/TypeObjectUtilsTests.cpp @@ -0,0 +1,3457 @@ +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file + * This file contains negative tests related to the TypeObjectUtils API. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +// Build TypeObjectHashId object with wrong discriminator. +TEST(TypeObjectUtilsTests, build_type_object_hash_id_wrong_discriminator) +{ + uint8_t bad_discriminator = EK_BOTH; + EquivalenceHash hash; + EXPECT_THROW(TypeObjectHashId type_object_hash_id = TypeObjectUtils::build_type_object_hash_id( + bad_discriminator, hash), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectHashId type_object_hash_id = TypeObjectUtils::build_type_object_hash_id( + EK_MINIMAL, hash)); + EXPECT_NO_THROW(TypeObjectHashId type_object_hash_id = TypeObjectUtils::build_type_object_hash_id( + EK_COMPLETE, hash)); +} + +// Build inconsistent StructMemberFlag +TEST(TypeObjectUtilsTests, build_inconsistent_struct_member_flag) +{ + EXPECT_THROW(TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, + true, false, true, false), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, + true, false, false, false)); + EXPECT_NO_THROW(TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, + false, false, true, false)); +} + +// Build StringLTypeDefn with bound smaller than 256. +TEST(TypeObjectUtilsTests, build_string_l_type_defn_small_bound) +{ + LBound wrong_bound = 255; + EXPECT_THROW(StringLTypeDefn string_l_type_defn = TypeObjectUtils::build_string_l_type_defn(wrong_bound), + InvalidArgumentError); + EXPECT_NO_THROW(StringLTypeDefn string_l_type_defn = TypeObjectUtils::build_string_l_type_defn(256)); +} + +void register_empty_structure_type_object() +{ + std::string empty_struct_name = "empty_structure"; + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), empty_struct_name); + CompleteStructHeader header = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail); + CompleteStructType struct_type = TypeObjectUtils::build_complete_struct_type(0, header, CompleteStructMemberSeq()); + TypeObjectUtils::build_and_register_struct_type_object(struct_type, empty_struct_name); +} + +void register_plain_seq_type_object( + eprosima::fastcdr::external complete_typeid) +{ + std::string plain_seq_name = "plain_sequence"; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_COMPLETE, flags); + PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + header, 255, complete_typeid); + TypeObjectUtils::build_and_register_s_sequence_type_identifier(plain_seq, plain_seq_name); +} + +void register_alias_type_object() +{ + TypeIdentifier primitive_type_id; + primitive_type_id._d(TK_INT16); + CommonAliasBody int16_common_body = TypeObjectUtils::build_common_alias_body(0, primitive_type_id); + CompleteAliasBody int16_body = TypeObjectUtils::build_complete_alias_body(int16_common_body, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteAliasHeader alias_header = TypeObjectUtils::build_complete_alias_header(empty_type_detail); + CompleteAliasType alias_type = TypeObjectUtils::build_complete_alias_type(0, alias_header, int16_body); + TypeObjectUtils::build_and_register_alias_type_object(alias_type, "int16_alias"); +} + +// Build PlainSequenceSElemDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_sequence_s_elem_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + wrong_header, 10, test_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + wrong_header, 10, test_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + complete_header, 10, test_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check SBound consistency + SBound wrong_bound = 0; + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + complete_header, wrong_bound, test_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + complete_header, 10, test_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + minimal_header, 10, test_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // TypeIdentifier consistent with fully-descriptive header + EXPECT_NO_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + fully_descriptive_header, 10, test_identifier)); + // Change discriminator to EK_COMPLETE + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + // TypeIdentifier consistent with complete header + EXPECT_NO_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + complete_header, 10, test_identifier)); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + minimal_header, 10, test_identifier), InvalidArgumentError); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + fully_descriptive_header, 10, test_identifier), InvalidArgumentError); + // Change discriminator to EK_MINIMAL + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + complete_header, 10, test_identifier), InvalidArgumentError); + // TypeIdentifier consistent with minimal header + EXPECT_NO_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + minimal_header, 10, test_identifier)); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + fully_descriptive_header, 10, test_identifier), InvalidArgumentError); +} + +// Build PlainSequenceLElemDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_sequence_l_elem_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + wrong_header, 256, test_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + wrong_header, 256, test_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, 256, test_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check LBound consistency + LBound wrong_bound = 255; + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, wrong_bound, test_identifier), InvalidArgumentError); + wrong_bound = 0; + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, wrong_bound, test_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, 256, test_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + minimal_header, 256, test_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // TypeIdentifier consistent with fully-descriptive header + EXPECT_NO_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + fully_descriptive_header, 256, test_identifier)); + // Change discriminator to EK_COMPLETE + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + // TypeIdentifier consistent with complete header + EXPECT_NO_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, 256, test_identifier)); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + minimal_header, 256, test_identifier), InvalidArgumentError); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + fully_descriptive_header, 256, test_identifier), InvalidArgumentError); + // Change discriminator to EK_MINIMAL + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + complete_header, 256, test_identifier), InvalidArgumentError); + // TypeIdentifier consistent with minimal header + EXPECT_NO_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + minimal_header, 256, test_identifier)); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + fully_descriptive_header, 256, test_identifier), InvalidArgumentError); +} + +// Add inconsistent dimension to array +TEST(TypeObjectUtilsTests, add_inconsistent_array_dimension) +{ + SBoundSeq small_dimensions; + LBoundSeq large_dimensions; + SBound invalid_sbound = 0; + LBound invalid_lbound = 0; + EXPECT_THROW(TypeObjectUtils::add_array_dimension(small_dimensions, invalid_sbound), InvalidArgumentError); + EXPECT_THROW(TypeObjectUtils::add_array_dimension(large_dimensions, invalid_lbound), InvalidArgumentError); +} + +// Build PlainArraySElemDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_array_s_elem_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + SBoundSeq bound_seq; + SBound bound = 10; + TypeObjectUtils::add_array_dimension(bound_seq, bound); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + wrong_header, bound_seq, test_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + wrong_header, bound_seq, test_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check SBoundSeq consistency + SBoundSeq wrong_bound_seq; + // Empty array_bound_seq + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, wrong_bound_seq, test_identifier), InvalidArgumentError); + // Zero element + TypeObjectUtils::add_array_dimension(wrong_bound_seq, bound); + bound = 0; + EXPECT_THROW(TypeObjectUtils::add_array_dimension(wrong_bound_seq, bound), InvalidArgumentError); + wrong_bound_seq.push_back(0); + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, wrong_bound_seq, test_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + minimal_header, bound_seq, test_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // TypeIdentifier consistent with fully-descriptive header + EXPECT_NO_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + fully_descriptive_header, bound_seq, test_identifier)); + // Change discriminator to EK_COMPLETE + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + // TypeIdentifier consistent with complete header + EXPECT_NO_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, bound_seq, test_identifier)); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + minimal_header, bound_seq, test_identifier), InvalidArgumentError); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + fully_descriptive_header, bound_seq, test_identifier), InvalidArgumentError); + // Change discriminator to EK_MINIMAL + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); + // TypeIdentifier consistent with minimal header + EXPECT_NO_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + minimal_header, bound_seq, test_identifier)); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn( + fully_descriptive_header, bound_seq, test_identifier), InvalidArgumentError); +} + +// Build PlainArrayLElemDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_array_l_elem_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + LBoundSeq bound_seq; + LBound bound = 256; + TypeObjectUtils::add_array_dimension(bound_seq, bound); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + wrong_header, bound_seq, test_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + wrong_header, bound_seq, test_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check SBoundSeq consistency + LBoundSeq wrong_bound_seq; + // Empty array_bound_seq + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, wrong_bound_seq, test_identifier), InvalidArgumentError); + // Non-large bound dimension + bound = 10; + TypeObjectUtils::add_array_dimension(wrong_bound_seq, bound); + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, wrong_bound_seq, test_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + minimal_header, bound_seq, test_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // TypeIdentifier consistent with fully-descriptive header + EXPECT_NO_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + fully_descriptive_header, bound_seq, test_identifier)); + // At least one dimension should be large + bound = 256; + TypeObjectUtils::add_array_dimension(wrong_bound_seq, bound); + EXPECT_NO_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + fully_descriptive_header, wrong_bound_seq, test_identifier)); + // Zero element + bound = 0; + EXPECT_THROW(TypeObjectUtils::add_array_dimension(wrong_bound_seq, bound), InvalidArgumentError); + wrong_bound_seq.push_back(0); + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + fully_descriptive_header, wrong_bound_seq, test_identifier), InvalidArgumentError); + // Change discriminator to EK_COMPLETE + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + // TypeIdentifier consistent with complete header + EXPECT_NO_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, bound_seq, test_identifier)); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + minimal_header, bound_seq, test_identifier), InvalidArgumentError); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + fully_descriptive_header, bound_seq, test_identifier), InvalidArgumentError); + // Change discriminator to EK_MINIMAL + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + test_identifier = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + complete_header, bound_seq, test_identifier), InvalidArgumentError); + // TypeIdentifier consistent with minimal header + EXPECT_NO_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + minimal_header, bound_seq, test_identifier)); + // TypeIdentifier inconsistent with fully-descriptive header + EXPECT_THROW(PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn( + fully_descriptive_header, bound_seq, test_identifier), InvalidArgumentError); +} + +// Build PlainMapSTypeDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_map_s_type_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + eprosima::fastcdr::external key_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + wrong_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + wrong_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check SBound consistency + SBound wrong_bound = 0; + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, wrong_bound, test_identifier, flags, key_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // Wrong key_flags + CollectionElementFlag wrong_flags = 0; + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, wrong_flags, key_identifier), InvalidArgumentError); +#if !defined(NDEBUG) + // Uninitialized key_identifier + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Non-integer key identifier + EXPECT_NO_THROW(key_identifier->_d(TK_FLOAT32)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + // TypeIdentifier consistent with fully-descriptive header and integer key identifier + EXPECT_NO_THROW(key_identifier->_d(TK_INT64)); + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, key_identifier)); + StringSTypeDefn string_type_def = TypeObjectUtils::build_string_s_type_defn(50); + EXPECT_NO_THROW(key_identifier->string_sdefn(string_type_def)); + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, key_identifier)); + + // Get EK_COMPLETE and EK_MINIMAL TypeIdentifiers + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + eprosima::fastcdr::external complete_typeid; + eprosima::fastcdr::external minimal_typeid; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + register_plain_seq_type_object(complete_typeid); + eprosima::fastcdr::external complete_indirect_id; + eprosima::fastcdr::external minimal_indirect_id; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("plain_sequence", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + register_alias_type_object(); + eprosima::fastcdr::external complete_alias_id; + eprosima::fastcdr::external minimal_alias_id; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("int16_alias", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, test_identifier, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + fully_descriptive_header, 10, minimal_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key/// + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key/// + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, complete_alias_id)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, test_identifier, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, complete_alias_id)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, complete_alias_id)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, complete_alias_id)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + complete_header, 10, minimal_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, test_identifier, flags, minimal_alias_id)); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_typeid, flags, minimal_alias_id)); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_indirect_id, flags, minimal_alias_id)); + + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, key_identifier)); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn( + minimal_header, 10, minimal_alias_id, flags, minimal_alias_id)); +} + +// Build PlainMapLTypeDefn with inconsistent parameters. +TEST(TypeObjectUtilsTests, build_plain_map_l_type_defn_inconsistencies) +{ + eprosima::fastcdr::external test_identifier{new TypeIdentifier()}; + eprosima::fastcdr::external key_identifier{new TypeIdentifier()}; + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::TRIM, false); + PlainCollectionHeader complete_header = TypeObjectUtils::build_plain_collection_header( + EK_COMPLETE, flags); +#if !defined(NDEBUG) + PlainCollectionHeader wrong_header; + // Inconsistent header CollectionElementFlags + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + wrong_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + wrong_header.element_flags(flags); + // Inconsistent header EquivalenceKind + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + wrong_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + // Non-initialized TypeIdentifier + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Check LBound consistency + LBound wrong_bound = 255; + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, wrong_bound, test_identifier, flags, key_identifier), InvalidArgumentError); + wrong_bound = 0; + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, wrong_bound, test_identifier, flags, key_identifier), InvalidArgumentError); + + // Primitive TypeIdentifier + EXPECT_NO_THROW(test_identifier->_d(TK_BOOLEAN)); + // TypeIdentifier inconsistent with complete header + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + PlainCollectionHeader minimal_header = TypeObjectUtils::build_plain_collection_header( + EK_MINIMAL, flags); + // TypeIdentifier inconsistent with minimal header + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + PlainCollectionHeader fully_descriptive_header = TypeObjectUtils::build_plain_collection_header( + EK_BOTH, flags); + // Wrong key_flags + CollectionElementFlag wrong_flags = 0; + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, wrong_flags, key_identifier), InvalidArgumentError); +#if !defined(NDEBUG) + // Uninitialized key_identifier + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); +#endif // !defined(NDEBUG) + // Non-integer key identifier + EXPECT_NO_THROW(key_identifier->_d(TK_FLOAT32)); + EXPECT_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + // TypeIdentifier consistent with fully-descriptive header and integer key identifier + EXPECT_NO_THROW(key_identifier->_d(TK_INT64)); + EXPECT_NO_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, key_identifier)); + StringSTypeDefn string_type_def = TypeObjectUtils::build_string_s_type_defn(50); + EXPECT_NO_THROW(key_identifier->string_sdefn(string_type_def)); + EXPECT_NO_THROW(PlainMapLTypeDefn plain_seq = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, key_identifier)); + + + + // Get EK_COMPLETE and EK_MINIMAL TypeIdentifiers + register_empty_structure_type_object(); + TypeIdentifierPair type_ids; + eprosima::fastcdr::external complete_typeid; + eprosima::fastcdr::external minimal_typeid; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("empty_structure", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_typeid = eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + register_plain_seq_type_object(complete_typeid); + eprosima::fastcdr::external complete_indirect_id; + eprosima::fastcdr::external minimal_indirect_id; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("plain_sequence", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_indirect_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + register_alias_type_object(); + eprosima::fastcdr::external complete_alias_id; + eprosima::fastcdr::external minimal_alias_id; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("int16_alias", type_ids); + if (EK_COMPLETE == type_ids.type_identifier1()._d()) + { + complete_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + minimal_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + } + else + { + complete_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier2())); + minimal_alias_id = + eprosima::fastcdr::external(new TypeIdentifier(type_ids.type_identifier1())); + } + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, test_identifier, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, complete_indirect_id), + InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, minimal_indirect_id), + InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, complete_indirect_id), + InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + fully_descriptive_header, 1000, minimal_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key/// + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key/// + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, complete_alias_id)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, test_identifier, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, complete_alias_id)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, complete_alias_id)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, complete_alias_id)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + complete_header, 1000, minimal_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, test_identifier, flags, minimal_alias_id)); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_typeid, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_indirect_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, key_identifier), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, complete_alias_id, flags, minimal_alias_id), InvalidArgumentError); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_typeid, flags, minimal_alias_id)); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_indirect_id, flags, minimal_alias_id)); + + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, key_identifier)); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, complete_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, complete_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, complete_alias_id), InvalidArgumentError); + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, minimal_typeid), InvalidArgumentError); //Invalid key + EXPECT_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, minimal_indirect_id), InvalidArgumentError); //Invalid key + EXPECT_NO_THROW(PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn( + minimal_header, 1000, minimal_alias_id, flags, minimal_alias_id)); +} + +// Register small string/wstring. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_s_string) +{ + StringSTypeDefn string_defn = TypeObjectUtils::build_string_s_type_defn(32); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_string_type_identifier(string_defn, + "small_string")); + // Registering twice the same TypeIdentifier should not fail + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_string_type_identifier(string_defn, + "small_string")); + // Registering another TypeIdentifier with the same name should return RETCODE_BAD_PARAMETER + StringSTypeDefn another_string_defn = TypeObjectUtils::build_string_s_type_defn(100); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_s_string_type_identifier( + another_string_defn, + "small_string")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_s_string_type_identifier( + another_string_defn, + type_name)); +} + +// Register large string/wstring. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_l_string) +{ + StringLTypeDefn string_defn = TypeObjectUtils::build_string_l_type_defn(1000); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_string_type_identifier(string_defn, + "large_string")); + // Registering twice the same TypeIdentifier should not fail + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_string_type_identifier(string_defn, + "large_string")); + // Registering another TypeIdentifier with the same name should return RETCODE_BAD_PARAMETER + StringLTypeDefn another_string_defn = TypeObjectUtils::build_string_l_type_defn(2000); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_l_string_type_identifier( + another_string_defn, + "large_string")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_l_string_type_identifier( + another_string_defn, + type_name)); +} + +// Register small sequence. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_s_sequence) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_FLOAT128); + PlainSequenceSElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + header, 255, primitive_identifier); + // Another external is required cause the comparison is only of the pointer and not the data contained. + eprosima::fastcdr::external other_identifier{new TypeIdentifier()}; + other_identifier->_d(TK_INT16); + PlainSequenceSElemDefn another_plain_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn( + header, 255, other_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_sequence_type_identifier(plain_seq, + "small_sequence")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_sequence_type_identifier(plain_seq, + "small_sequence")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_s_sequence_type_identifier( + another_plain_seq, + "small_sequence")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + TypeObjectUtils::build_and_register_s_sequence_type_identifier(another_plain_seq, type_name)); +} + +// Register large sequence. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_l_sequence) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_FLOAT128); + PlainSequenceLElemDefn plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + header, 256, primitive_identifier); + eprosima::fastcdr::external other_identifier{new TypeIdentifier()}; + other_identifier->_d(TK_INT16); + PlainSequenceLElemDefn another_plain_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn( + header, 256, other_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_sequence_type_identifier(plain_seq, + "large_sequence")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_sequence_type_identifier(plain_seq, + "large_sequence")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_l_sequence_type_identifier( + another_plain_seq, + "large_sequence")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + TypeObjectUtils::build_and_register_l_sequence_type_identifier(another_plain_seq, type_name)); +} + +// Register small array. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_s_array) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_FLOAT128); + SBoundSeq array_bounds; + SBound bound = 26; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + PlainArraySElemDefn plain_array = TypeObjectUtils::build_plain_array_s_elem_defn(header, array_bounds, + primitive_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_array_type_identifier(plain_array, + "small_array")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_s_array_type_identifier(plain_array, + "small_array")); + bound = 100; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + PlainArraySElemDefn another_plain_array = TypeObjectUtils::build_plain_array_s_elem_defn(header, array_bounds, + primitive_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_s_array_type_identifier( + another_plain_array, + "small_array")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_s_array_type_identifier( + another_plain_array, + type_name)); +} + +// Register large array. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_l_array) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_FLOAT128); + LBoundSeq array_bounds; + LBound bound = 260; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + PlainArrayLElemDefn plain_array = TypeObjectUtils::build_plain_array_l_elem_defn(header, array_bounds, + primitive_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_array_type_identifier(plain_array, + "large_array")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_l_array_type_identifier(plain_array, + "large_array")); + bound = 1000; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + PlainArrayLElemDefn another_plain_array = TypeObjectUtils::build_plain_array_l_elem_defn(header, array_bounds, + primitive_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_l_array_type_identifier( + another_plain_array, + "large_array")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_l_array_type_identifier( + another_plain_array, + type_name)); +} + +// Register small map. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_s_map) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_UINT32); + PlainMapSTypeDefn plain_map = TypeObjectUtils::build_plain_map_s_type_defn(header, 10, primitive_identifier, flags, + primitive_identifier); + eprosima::fastcdr::external key_identifier{new TypeIdentifier()}; + key_identifier->_d(TK_INT8); + PlainMapSTypeDefn another_plain_map = TypeObjectUtils::build_plain_map_s_type_defn(header, 10, primitive_identifier, + flags, key_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_s_map_type_identifier(plain_map, + "small_map")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_s_map_type_identifier(plain_map, + "small_map")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_s_map_type_identifier( + another_plain_map, "small_map")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_s_map_type_identifier( + another_plain_map, + type_name)); +} + +// Register large map. This test does not check member consistency (only checked in Debug build mode). +TEST(TypeObjectUtilsTests, register_l_map) +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, false); + PlainCollectionHeader header = TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); + eprosima::fastcdr::external primitive_identifier{new TypeIdentifier()}; + primitive_identifier->_d(TK_UINT32); + PlainMapLTypeDefn plain_map = TypeObjectUtils::build_plain_map_l_type_defn(header, 500, primitive_identifier, flags, + primitive_identifier); + eprosima::fastcdr::external key_identifier{new TypeIdentifier()}; + key_identifier->_d(TK_INT8); + PlainMapLTypeDefn other_plain_map = TypeObjectUtils::build_plain_map_l_type_defn(header, 500, primitive_identifier, + flags, key_identifier); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_l_map_type_identifier(plain_map, + "large_map")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_l_map_type_identifier(plain_map, + "large_map")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_l_map_type_identifier( + other_plain_map, "large_map")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_l_map_type_identifier( + other_plain_map, + type_name)); +} + +// Build AppliedAnnotation invalid TypeIdentifier +TEST(TypeObjectUtilsTests, build_applied_annotation_invalid_type_identifier) +{ + TypeIdentifier type_id; + type_id._d(TK_INT32); + EXPECT_THROW(AppliedAnnotation annotation = TypeObjectUtils::build_applied_annotation(type_id, + eprosima::fastcdr::optional()), InvalidArgumentError); + CompleteAnnotationHeader annotation_header = TypeObjectUtils::build_complete_annotation_header("custom_annotation"); + CompleteAnnotationType custom_annotation = TypeObjectUtils::build_complete_annotation_type(0, annotation_header, + CompleteAnnotationParameterSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_annotation_type_object(custom_annotation, + "custom")); + TypeIdentifierPair custom_annotation_ids; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("custom", + custom_annotation_ids)); + EXPECT_NO_THROW(AppliedAnnotation annotation = TypeObjectUtils::build_applied_annotation( + custom_annotation_ids.type_identifier1(), + eprosima::fastcdr::optional())); +} + +// Build CompleteMemberDetail with empty name +TEST(TypeObjectUtilsTests, build_complete_member_detail_empty_member_name) +{ + EXPECT_THROW(CompleteMemberDetail detail = TypeObjectUtils::build_complete_member_detail("", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()), InvalidArgumentError); + EXPECT_NO_THROW(CompleteMemberDetail detail = TypeObjectUtils::build_complete_member_detail("member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional())); +} + +// Build CompleteStructMember with inconsistent @hashid annotation value and member id +TEST(TypeObjectUtilsTests, build_complete_struct_member_inconsistent_hashid_member_id) +{ + StructMemberFlag basic_flags = TypeObjectUtils::build_struct_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false, + false, false); + TypeIdentifier type_id; + type_id._d(TK_INT32); + CommonStructMember common = TypeObjectUtils::build_common_struct_member(0x047790DA, basic_flags, type_id); + AppliedBuiltinMemberAnnotations wrong_ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("color")); + AppliedBuiltinMemberAnnotations ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("shapesize")); + AppliedBuiltinMemberAnnotations empty_ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("")); + CompleteMemberDetail wrong_detail = TypeObjectUtils::build_complete_member_detail("member_name", wrong_ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail detail = TypeObjectUtils::build_complete_member_detail("member_name", ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail empty_detail = TypeObjectUtils::build_complete_member_detail("shapesize", empty_ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail other_wrong_detail = TypeObjectUtils::build_complete_member_detail("name", empty_ann_builtin, + eprosima::fastcdr::optional()); + EXPECT_THROW(CompleteStructMember member = TypeObjectUtils::build_complete_struct_member(common, wrong_detail), + InvalidArgumentError); + EXPECT_NO_THROW(CompleteStructMember member = TypeObjectUtils::build_complete_struct_member(common, detail)); + EXPECT_THROW(CompleteStructMember member = TypeObjectUtils::build_complete_struct_member(common, + other_wrong_detail), InvalidArgumentError); + EXPECT_NO_THROW(CompleteStructMember member = TypeObjectUtils::build_complete_struct_member(common, empty_detail)); +} + +// Build CompleteTypeDetail with empty type_name +TEST(TypeObjectUtilsTests, build_complete_type_detail_empty_type_name) +{ + EXPECT_THROW(CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), ""), InvalidArgumentError); + EXPECT_NO_THROW(CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name")); +} + +// Build CommonUnionMember with empty case labels +TEST(TypeObjectUtilsTests, build_common_union_member_empty_case_labels) +{ + UnionMemberFlag basic_flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false); + UnionMemberFlag default_flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, true, false); + TypeIdentifier type_id; + type_id._d(TK_INT32); + EXPECT_THROW(CommonUnionMember common = TypeObjectUtils::build_common_union_member(0, basic_flags, type_id, + UnionCaseLabelSeq()), InvalidArgumentError); + EXPECT_NO_THROW(CommonUnionMember common = TypeObjectUtils::build_common_union_member(0, default_flags, type_id, + UnionCaseLabelSeq())); +} + +// Build CompleteUnionMember with inconsistent @hashid annotation value and member id +TEST(TypeObjectUtilsTests, build_complete_union_member_inconsistent_hashid_member_id) +{ + UnionMemberFlag basic_flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false); + TypeIdentifier type_id; + type_id._d(TK_INT32); + CommonUnionMember common = TypeObjectUtils::build_common_union_member(0x047790DA, basic_flags, type_id, + {1}); + AppliedBuiltinMemberAnnotations wrong_ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("color")); + AppliedBuiltinMemberAnnotations ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("shapesize")); + AppliedBuiltinMemberAnnotations empty_ann_builtin = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("")); + CompleteMemberDetail wrong_detail = TypeObjectUtils::build_complete_member_detail("member_name", wrong_ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail detail = TypeObjectUtils::build_complete_member_detail("member_name", ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail empty_detail = TypeObjectUtils::build_complete_member_detail("shapesize", empty_ann_builtin, + eprosima::fastcdr::optional()); + CompleteMemberDetail other_wrong_detail = TypeObjectUtils::build_complete_member_detail("name", empty_ann_builtin, + eprosima::fastcdr::optional()); + EXPECT_THROW(CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common, wrong_detail), + InvalidArgumentError); + EXPECT_NO_THROW(CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common, detail)); + EXPECT_THROW(CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common, + other_wrong_detail), InvalidArgumentError); + EXPECT_NO_THROW(CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common, empty_detail)); +} + +/** + * Auxiliary methods to build valid hash TypeIdentifiers + */ +void small_string_type_identifier( + TypeIdentifier& type_id) +{ + StringSTypeDefn small_string = TypeObjectUtils::build_string_s_type_defn(56); + type_id.string_sdefn(small_string); +} + +void large_string_type_identifier( + TypeIdentifier& type_id) +{ + StringLTypeDefn large_string = TypeObjectUtils::build_string_l_type_defn(300); + type_id.string_ldefn(large_string); +} + +const PlainCollectionHeader plain_collection_header() +{ + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false); + return TypeObjectUtils::build_plain_collection_header(EK_BOTH, flags); +} + +const eprosima::fastcdr::external primitive_type_identifier() +{ + eprosima::fastcdr::external primitive_type_id{new TypeIdentifier()}; + primitive_type_id->_d(TK_INT16); + return primitive_type_id; +} + +void small_sequence_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + PlainSequenceSElemDefn small_seq = TypeObjectUtils::build_plain_sequence_s_elem_defn(collection_header, 100, + primitive_type_id); + type_id.seq_sdefn(small_seq); +} + +void large_sequence_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + PlainSequenceLElemDefn large_seq = TypeObjectUtils::build_plain_sequence_l_elem_defn(collection_header, 1000, + primitive_type_id); + type_id.seq_ldefn(large_seq); +} + +void small_array_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + PlainArraySElemDefn small_array = TypeObjectUtils::build_plain_array_s_elem_defn(collection_header, + {5, 3}, primitive_type_id); + type_id.array_sdefn(small_array); +} + +void large_array_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + PlainArrayLElemDefn large_array = TypeObjectUtils::build_plain_array_l_elem_defn(collection_header, + {500, 3}, primitive_type_id); + type_id.array_ldefn(large_array); +} + +void small_map_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false); + PlainMapSTypeDefn small_map = TypeObjectUtils::build_plain_map_s_type_defn(collection_header, 100, + primitive_type_id, flags, primitive_type_id); + type_id.map_sdefn(small_map); +} + +void large_map_type_identifier( + TypeIdentifier& type_id) +{ + PlainCollectionHeader collection_header = plain_collection_header(); + eprosima::fastcdr::external primitive_type_id = primitive_type_identifier(); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false); + PlainMapLTypeDefn large_map = TypeObjectUtils::build_plain_map_l_type_defn(collection_header, 500, + primitive_type_id, flags, primitive_type_id); + type_id.map_ldefn(large_map); +} + +const CompleteAliasType int_16_alias() +{ + TypeIdentifier primitive_type_id; + primitive_type_id._d(TK_INT16); + CommonAliasBody int16_common_body = TypeObjectUtils::build_common_alias_body(0, primitive_type_id); + CompleteAliasBody int16_body = TypeObjectUtils::build_complete_alias_body(int16_common_body, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteAliasHeader alias_header = TypeObjectUtils::build_complete_alias_header(empty_type_detail); + return TypeObjectUtils::build_complete_alias_type(0, alias_header, int16_body); +} + +const CompleteAliasType float32_alias() +{ + TypeIdentifier primitive_type_id; + primitive_type_id._d(TK_FLOAT32); + CommonAliasBody float_common_body = TypeObjectUtils::build_common_alias_body(0, primitive_type_id); + CompleteAliasBody float_body = TypeObjectUtils::build_complete_alias_body(float_common_body, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteAliasHeader alias_header = TypeObjectUtils::build_complete_alias_header(empty_type_detail); + return TypeObjectUtils::build_complete_alias_type(0, alias_header, float_body); +} + +void register_basic_enum() +{ + std::string basic_enum_name = "basic_enum"; + CommonEnumeratedHeader common = TypeObjectUtils::build_common_enumerated_header(32); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), basic_enum_name); + CompleteEnumeratedHeader header = TypeObjectUtils::build_complete_enumerated_header(common, detail); + CommonEnumeratedLiteral common_literal = TypeObjectUtils::build_common_enumerated_literal(1, 0); + CompleteMemberDetail detail_literal = TypeObjectUtils::build_complete_member_detail("literal", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteEnumeratedLiteral literal = TypeObjectUtils::build_complete_enumerated_literal(common_literal, + detail_literal); + CompleteEnumeratedLiteralSeq literal_seq; + TypeObjectUtils::add_complete_enumerated_literal(literal_seq, literal); + CompleteEnumeratedType enum_type = TypeObjectUtils::build_complete_enumerated_type(0, header, literal_seq); + TypeObjectUtils::build_and_register_enumerated_type_object(enum_type, basic_enum_name); +} + +void register_basic_bitmask() +{ + std::string basic_bitmask_name = "basic_bitmask"; + CommonEnumeratedHeader common = TypeObjectUtils::build_common_enumerated_header(32, true); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), basic_bitmask_name); + CompleteEnumeratedHeader header = TypeObjectUtils::build_complete_enumerated_header(common, detail, true); + CommonBitflag common_flag = TypeObjectUtils::build_common_bitflag(5, 0); + CompleteMemberDetail detail_flag = TypeObjectUtils::build_complete_member_detail("flag", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitflag flag = TypeObjectUtils::build_complete_bitflag(common_flag, detail_flag); + CompleteBitflagSeq flag_seq; + TypeObjectUtils::add_complete_bitflag(flag_seq, flag); + CompleteBitmaskType bitmask_type = TypeObjectUtils::build_complete_bitmask_type(0, header, flag_seq); + TypeObjectUtils::build_and_register_bitmask_type_object(bitmask_type, basic_bitmask_name); +} + +// Build CommonDiscriminatorMember with inconsistent TypeIdentifier +TEST(TypeObjectUtilsTests, build_common_discriminator_member_inconsistent_type_identifier) +{ + UnionDiscriminatorFlag flags = TypeObjectUtils::build_union_discriminator_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false); + TypeIdentifier type_id; + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TK_BOOLEAN); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_BYTE); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_INT8); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_INT16); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_INT32); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_INT64); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_UINT8); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_UINT16); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_UINT32); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_UINT64); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_FLOAT32); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TK_FLOAT64); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TK_FLOAT128); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TK_CHAR8); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + type_id._d(TK_CHAR16); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_id)); + small_string_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TI_STRING16_SMALL); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + large_string_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + type_id._d(TI_STRING16_LARGE); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + small_sequence_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + large_sequence_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + small_array_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + large_array_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + small_map_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + large_map_type_identifier(type_id); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, type_id), + InvalidArgumentError); + // Enum + register_basic_enum(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_enum", type_ids); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_ids.type_identifier1())); + // Bitmask + register_basic_bitmask(); + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_bitmask", type_ids); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + type_ids.type_identifier1()), InvalidArgumentError); + // Alias: int16_t & float + CompleteAliasType int16_alias = int_16_alias(); + CompleteAliasType float_alias = float32_alias(); + TypeObjectUtils::build_and_register_alias_type_object(int16_alias, "alias_int16"); + TypeObjectUtils::build_and_register_alias_type_object(float_alias, "alias_float"); + TypeIdentifierPair alias_type_identifiers; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, DomainParticipantFactory::get_instance()->type_object_registry(). + get_type_identifiers("alias_float", alias_type_identifiers)); + EXPECT_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + alias_type_identifiers.type_identifier1()), InvalidArgumentError); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, DomainParticipantFactory::get_instance()->type_object_registry(). + get_type_identifiers("alias_int16", alias_type_identifiers)); + EXPECT_NO_THROW(CommonDiscriminatorMember member = TypeObjectUtils::build_common_discriminator_member(flags, + alias_type_identifiers.type_identifier1())); +} + +// Add CompleteUnionMember to sequence with invalid name +TEST(TypeObjectUtilsTests, build_complete_union_member_invalid_name) +{ + std::string invalid_name = "discriminator"; + UnionMemberFlag member_flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + UnionCaseLabelSeq case_labels; + TypeObjectUtils::add_union_case_label(case_labels, 5); + CommonUnionMember common_member = TypeObjectUtils::build_common_union_member(3, member_flags, type_id, case_labels); + CompleteMemberDetail invalid_member_detail = TypeObjectUtils::build_complete_member_detail(invalid_name, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common_member, invalid_member_detail); + CompleteUnionMemberSeq member_seq; + EXPECT_THROW(TypeObjectUtils::add_complete_union_member(member_seq, member), InvalidArgumentError); +} + +// Build CommonAnnotationParameter with non-empty flags +TEST(TypeObjectUtilsTests, build_common_annotation_parameter_non_empty_flags) +{ + AnnotationParameterFlag non_empty_flags = 1; + AnnotationParameterFlag empty_flags = 0; + TypeIdentifier type_id; + EXPECT_NO_THROW(type_id._d(TK_INT16)); + EXPECT_THROW(CommonAnnotationParameter common = TypeObjectUtils::build_common_annotation_parameter(non_empty_flags, + type_id), InvalidArgumentError); + EXPECT_NO_THROW(CommonAnnotationParameter common = TypeObjectUtils::build_common_annotation_parameter(empty_flags, + type_id)); +} + +/** + * Auxiliary method to check annotation parameter consistency + */ +void check_annotation_parameter_consistency( + const CommonAnnotationParameter& common, + const std::vector& ann_param_seq, + const std::vector& expected_results) +{ + for (size_t i = 0; i < ann_param_seq.size(); i++) + { + if (expected_results[i]) + { + EXPECT_NO_THROW(CompleteAnnotationParameter param = TypeObjectUtils::build_complete_annotation_parameter( + common, "param_name", ann_param_seq[i])); + } + else + { + EXPECT_THROW(CompleteAnnotationParameter param = TypeObjectUtils::build_complete_annotation_parameter( + common, "param_name", ann_param_seq[i]), InvalidArgumentError); + } + } +} + +// Build CompleteAnnotationParameter with inconsistent TypeIdentifier and AnnotationParameterValue +TEST(TypeObjectUtilsTests, build_complete_annotation_parameter_inconsistent_data) +{ + AnnotationParameterValue bool_param = TypeObjectUtils::build_annotation_parameter_value(true); + AnnotationParameterValue byte_param = TypeObjectUtils::build_annotation_parameter_value_byte(16); + AnnotationParameterValue int8_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue uint8_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue int16_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue uint16_param = TypeObjectUtils::build_annotation_parameter_value(static_cast( + 16)); + AnnotationParameterValue int32_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue uint32_param = TypeObjectUtils::build_annotation_parameter_value(static_cast( + 16)); + AnnotationParameterValue int64_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue uint64_param = TypeObjectUtils::build_annotation_parameter_value(static_cast( + 16)); + AnnotationParameterValue float32_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue float64_param = TypeObjectUtils::build_annotation_parameter_value(static_cast(16)); + AnnotationParameterValue float128_param = TypeObjectUtils::build_annotation_parameter_value( + static_cast(16)); + AnnotationParameterValue char8_param = TypeObjectUtils::build_annotation_parameter_value('A'); + AnnotationParameterValue char16_param = TypeObjectUtils::build_annotation_parameter_value(L'A'); + // TODO(jlbueno) + AnnotationParameterValue enum_param = TypeObjectUtils::build_annotation_parameter_value_enum( + static_cast(0)); + AnnotationParameterValue string8_param = TypeObjectUtils::build_annotation_parameter_value( + eprosima::fastcdr::fixed_string<128>("Hello")); + AnnotationParameterValue string16_param = TypeObjectUtils::build_annotation_parameter_value(std::wstring(L"Hello")); + std::vector ann_param_seq; + ann_param_seq.push_back(bool_param); + ann_param_seq.push_back(byte_param); + ann_param_seq.push_back(int8_param); + ann_param_seq.push_back(uint8_param); + ann_param_seq.push_back(int16_param); + ann_param_seq.push_back(uint16_param); + ann_param_seq.push_back(int32_param); + ann_param_seq.push_back(uint32_param); + ann_param_seq.push_back(int64_param); + ann_param_seq.push_back(uint64_param); + ann_param_seq.push_back(float32_param); + ann_param_seq.push_back(float64_param); + ann_param_seq.push_back(float128_param); + ann_param_seq.push_back(char8_param); + ann_param_seq.push_back(char16_param); + ann_param_seq.push_back(enum_param); + ann_param_seq.push_back(string8_param); + ann_param_seq.push_back(string16_param); + CommonAnnotationParameter common; + std::vector expected_results = {false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false}; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + TypeIdentifier type_id; + type_id._d(TK_BOOLEAN); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[0] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_BYTE); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[0] = false; + expected_results[1] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_INT8); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[1] = false; + expected_results[2] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_INT16); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[2] = false; + expected_results[4] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_INT32); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[4] = false; + expected_results[6] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_INT64); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[6] = false; + expected_results[8] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_UINT8); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[8] = false; + expected_results[3] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_UINT16); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[3] = false; + expected_results[5] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_UINT32); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[5] = false; + expected_results[7] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_UINT64); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[7] = false; + expected_results[9] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_FLOAT32); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[9] = false; + expected_results[10] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_FLOAT64); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[10] = false; + expected_results[11] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_FLOAT128); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[11] = false; + expected_results[12] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_CHAR8); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[12] = false; + expected_results[13] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TK_CHAR16); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[13] = false; + expected_results[14] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + small_string_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[14] = false; + expected_results[16] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TI_STRING16_SMALL); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[16] = false; + expected_results[17] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + large_string_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[17] = false; + expected_results[16] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + type_id._d(TI_STRING16_LARGE); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[16] = false; + expected_results[17] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + small_sequence_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + expected_results[17] = false; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + large_sequence_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + small_array_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + large_array_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + small_map_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + large_map_type_identifier(type_id); + common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + register_basic_enum(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_enum", type_ids); + common = TypeObjectUtils::build_common_annotation_parameter(0, + type_ids.type_identifier1()); + expected_results[15] = true; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); + register_basic_bitmask(); + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_bitmask", type_ids); + common = TypeObjectUtils::build_common_annotation_parameter(0, + type_ids.type_identifier1()); + expected_results[15] = false; + check_annotation_parameter_consistency(common, ann_param_seq, expected_results); +} + +// Build CompleteAnnotationParameter with empty name +TEST(TypeObjectUtilsTests, build_complete_annotation_parameter_empty_name) +{ + std::string parameter_name; + TypeIdentifier type_id; + type_id._d(TK_INT32); + CommonAnnotationParameter common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + int32_t param_value = 100; + AnnotationParameterValue param = TypeObjectUtils::build_annotation_parameter_value(param_value); + EXPECT_THROW(CompleteAnnotationParameter ann_param = TypeObjectUtils::build_complete_annotation_parameter(common, + parameter_name, param), InvalidArgumentError); + EXPECT_NO_THROW(CompleteAnnotationParameter ann_param = TypeObjectUtils::build_complete_annotation_parameter(common, + "parameter_name", param)); +} + +// Build CompleteAnnotationHeader with empty name +TEST(TypeObjectUtilsTests, build_complete_annotation_header_empty_name) +{ + std::string annotation_name; + EXPECT_THROW(CompleteAnnotationHeader header = TypeObjectUtils::build_complete_annotation_header(annotation_name), + InvalidArgumentError); + EXPECT_NO_THROW(CompleteAnnotationHeader header = TypeObjectUtils::build_complete_annotation_header( + "annotation_name")); +} + +// Build CompleteAnnotationType with non-empty flags +TEST(TypeObjectUtilsTests, build_complete_annotation_type_non_empty_flags) +{ + AnnotationTypeFlag non_empty_flags = 1; + AnnotationTypeFlag empty_flags = 0; + CompleteAnnotationHeader header = TypeObjectUtils::build_complete_annotation_header("annotation_name"); + CompleteAnnotationParameterSeq sequence; + EXPECT_THROW(CompleteAnnotationType annotation = TypeObjectUtils::build_complete_annotation_type(non_empty_flags, + header, sequence), InvalidArgumentError); + EXPECT_NO_THROW(CompleteAnnotationType annotation = TypeObjectUtils::build_complete_annotation_type(empty_flags, + header, sequence)); +} + +// Build CommonAliasBody with non-empty flags +TEST(TypeObjectUtilsTests, build_common_alias_body_non_empty_flags) +{ + AliasMemberFlag non_empty_flags = 1; + AliasMemberFlag empty_flags = 0; + TypeIdentifier type_id; + EXPECT_NO_THROW(type_id._d(TK_INT16)); + EXPECT_THROW(CommonAliasBody common = TypeObjectUtils::build_common_alias_body(non_empty_flags, + type_id), InvalidArgumentError); + EXPECT_NO_THROW(CommonAliasBody common = TypeObjectUtils::build_common_alias_body(empty_flags, + type_id)); +} + +// Build CompleteAliasBody with @hashid annotation applied +TEST(TypeObjectUtilsTests, build_complete_alias_body_inconsistent_hashid) +{ + TypeIdentifier type_id; + type_id._d(TK_INT16); + CommonAliasBody common_body = TypeObjectUtils::build_common_alias_body(0, type_id); + AppliedBuiltinMemberAnnotations unit_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional("unit"), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + // TODO(jlbueno) @min & @max annotations cannot be applied: TypeObject depends on 'any' block implementation. + AppliedBuiltinMemberAnnotations hash_id_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("member_hash")); + EXPECT_THROW(CompleteAliasBody body = TypeObjectUtils::build_complete_alias_body(common_body, hash_id_builtin_ann, + eprosima::fastcdr::optional()), InvalidArgumentError); + EXPECT_NO_THROW(CompleteAliasBody body = TypeObjectUtils::build_complete_alias_body(common_body, unit_builtin_ann, + eprosima::fastcdr::optional())); +} + +// Build CompleteAliasType with non-empty flags +TEST(TypeObjectUtilsTests, build_complete_alias_type_non_empty_flags) +{ + AliasTypeFlag non_empty_flags = 1; + AliasTypeFlag empty_flags = 0; + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "alias_name"); + CompleteAliasHeader header = TypeObjectUtils::build_complete_alias_header(detail); + TypeIdentifier type_id; + type_id._d(TK_CHAR8); + CommonAliasBody common = TypeObjectUtils::build_common_alias_body(0, type_id); + eprosima::fastcdr::optional ann_builtin; + eprosima::fastcdr::optional ann_custom; + CompleteAliasBody body = TypeObjectUtils::build_complete_alias_body(common, ann_builtin, ann_custom); + EXPECT_THROW(CompleteAliasType alias = TypeObjectUtils::build_complete_alias_type(non_empty_flags, + header, body), InvalidArgumentError); + EXPECT_NO_THROW(CompleteAliasType alias = TypeObjectUtils::build_complete_alias_type(empty_flags, + header, body)); +} + +// Build CompleteElementDetail with @hasid builtin annotation +TEST(TypeObjectUtilsTests, build_complete_element_detail_inconsistent_hashid) +{ + AppliedBuiltinMemberAnnotations unit_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional("unit"), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + // TODO(jlbueno) @min & @max annotations cannot be applied: TypeObject depends on 'any' block implementation. + AppliedBuiltinMemberAnnotations hash_id_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("member_hash")); + EXPECT_THROW(CompleteElementDetail element_detail = TypeObjectUtils::build_complete_element_detail( + hash_id_builtin_ann, eprosima::fastcdr::optional()), InvalidArgumentError); + EXPECT_NO_THROW(CompleteElementDetail element_detail = TypeObjectUtils::build_complete_element_detail( + unit_builtin_ann, eprosima::fastcdr::optional())); +} + +// Build CompleteSequenceType with non-empty flags. +TEST(TypeObjectUtilsTests, build_complete_sequence_type_non_empty_flags) +{ + CollectionTypeFlag non_empty_flags = 1; + CollectionTypeFlag empty_flags = 0; + CommonCollectionHeader common_header = TypeObjectUtils::build_common_collection_header(356); + CompleteCollectionHeader header = TypeObjectUtils::build_complete_collection_header(common_header, + eprosima::fastcdr::optional()); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteElementDetail detail; + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, detail); + EXPECT_THROW(CompleteSequenceType sequence = TypeObjectUtils::build_complete_sequence_type(non_empty_flags, header, + element), InvalidArgumentError); + EXPECT_NO_THROW(CompleteSequenceType sequence = TypeObjectUtils::build_complete_sequence_type(empty_flags, header, + element)); +} + +// Build CommonArrayHeader with invalid bound +TEST(TypeObjectUtilsTests, build_common_array_header_invalid_bound) +{ + LBoundSeq array_bounds; + EXPECT_THROW(CommonArrayHeader header = TypeObjectUtils::build_common_array_header(array_bounds), + InvalidArgumentError); + LBound bound = 150; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + EXPECT_NO_THROW(CommonArrayHeader header = TypeObjectUtils::build_common_array_header(array_bounds)); + bound = 0; + EXPECT_THROW(TypeObjectUtils::add_array_dimension(array_bounds, bound), InvalidArgumentError); + array_bounds.push_back(bound); + EXPECT_THROW(CommonArrayHeader header = TypeObjectUtils::build_common_array_header(array_bounds), + InvalidArgumentError); +} + +// Build CompleteArrayType with non-empty flags. +TEST(TypeObjectUtilsTests, build_complete_array_type_non_empty_flags) +{ + CollectionTypeFlag non_empty_flags = 1; + CollectionTypeFlag empty_flags = 0; + LBoundSeq array_bounds; + LBound bound = 356; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + CommonArrayHeader common_header = TypeObjectUtils::build_common_array_header(array_bounds); + CompleteTypeDetail type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "array_type_name"); + CompleteArrayHeader header = TypeObjectUtils::build_complete_array_header(common_header, type_detail); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteElementDetail detail; + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, detail); + EXPECT_THROW(CompleteArrayType array = TypeObjectUtils::build_complete_array_type(non_empty_flags, header, + element), InvalidArgumentError); + EXPECT_NO_THROW(CompleteArrayType array = TypeObjectUtils::build_complete_array_type(empty_flags, header, + element)); +} + +// Build CompleteMapType with non-empty flags. +TEST(TypeObjectUtilsTests, build_complete_map_type_non_empty_flags) +{ + CollectionTypeFlag non_empty_flags = 1; + CollectionTypeFlag empty_flags = 0; + CommonCollectionHeader common_header = TypeObjectUtils::build_common_collection_header(356); + CompleteCollectionHeader header = TypeObjectUtils::build_complete_collection_header(common_header, + eprosima::fastcdr::optional()); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_INT16); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteElementDetail detail; + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(non_empty_flags, header, + element, element), InvalidArgumentError); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + element, element)); +} + +// Build CompleteMapType with inconsistent key TypeIdentifier. +TEST(TypeObjectUtilsTests, build_complete_map_type_inconsistent_key) +{ + CollectionTypeFlag empty_flags = 0; + CommonCollectionHeader common_header = TypeObjectUtils::build_common_collection_header(356); + CompleteCollectionHeader header = TypeObjectUtils::build_complete_collection_header(common_header, + eprosima::fastcdr::optional()); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_FLOAT32); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteElementDetail detail; + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + element, element), InvalidArgumentError); + TypeIdentifier key_type_id; + key_type_id._d(TK_INT32); + CommonCollectionElement common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + CompleteCollectionElement key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); + key_type_id._d(TK_BOOLEAN); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + key_type_id._d(TK_BYTE); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + key_type_id._d(TK_FLOAT64); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + key_type_id._d(TK_FLOAT128); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + key_type_id._d(TK_CHAR8); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + key_type_id._d(TK_CHAR16); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + small_string_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); + key_type_id._d(TI_STRING16_SMALL); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); + large_string_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); + key_type_id._d(TI_STRING16_LARGE); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); + small_sequence_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + large_sequence_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + small_array_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + large_array_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + small_map_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + large_map_type_identifier(key_type_id); + common_key = TypeObjectUtils::build_common_collection_element(flags, key_type_id); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + register_basic_enum(); + TypeIdentifierPair type_ids; + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_enum", type_ids); + common_key = TypeObjectUtils::build_common_collection_element(flags, + type_ids.type_identifier1()); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + register_basic_bitmask(); + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("basic_bitmask", type_ids); + common_key = TypeObjectUtils::build_common_collection_element(flags, + type_ids.type_identifier1()); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + CompleteAliasType int16_alias = int_16_alias(); + CompleteAliasType float_alias = float32_alias(); + TypeObjectUtils::build_and_register_alias_type_object(int16_alias, "alias_int16"); + TypeObjectUtils::build_and_register_alias_type_object(float_alias, "alias_float"); + TypeIdentifierPair alias_type_identifiers; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, DomainParticipantFactory::get_instance()->type_object_registry(). + get_type_identifiers("alias_float", alias_type_identifiers)); + common_key = TypeObjectUtils::build_common_collection_element(flags, + alias_type_identifiers.type_identifier1()); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element), InvalidArgumentError); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, DomainParticipantFactory::get_instance()->type_object_registry(). + get_type_identifiers("alias_int16", alias_type_identifiers)); + common_key = TypeObjectUtils::build_common_collection_element(flags, + alias_type_identifiers.type_identifier1()); + key = TypeObjectUtils::build_complete_collection_element(common_key, detail); + EXPECT_NO_THROW(CompleteMapType map = TypeObjectUtils::build_complete_map_type(empty_flags, header, + key, element)); +} + +// Build CompleteEnumeratedLiteral with non-applying builtin annotations. +TEST(TypeObjectUtilsTests, build_complete_enumerated_literal_invalid_builtin_annotations) +{ + AppliedBuiltinMemberAnnotations unit_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional("unit"), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + // TODO(jlbueno) @min & @max annotations cannot be applied: TypeObject depends on 'any' block implementation. + AppliedBuiltinMemberAnnotations hash_id_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("member_hash")); + CompleteMemberDetail unit_member = TypeObjectUtils::build_complete_member_detail("member_name", unit_builtin_ann, + eprosima::fastcdr::optional()); + CompleteMemberDetail hash_id_member = TypeObjectUtils::build_complete_member_detail("member_name", + hash_id_builtin_ann, eprosima::fastcdr::optional()); + EXPECT_THROW(CompleteEnumeratedLiteral enum_literal = TypeObjectUtils::build_complete_enumerated_literal( + CommonEnumeratedLiteral(), unit_member), InvalidArgumentError); + EXPECT_THROW(CompleteEnumeratedLiteral enum_literal = TypeObjectUtils::build_complete_enumerated_literal( + CommonEnumeratedLiteral(), hash_id_member), InvalidArgumentError); +} + +// Build CommonEnumeratedHeader with inconsistent bit bound +TEST(TypeObjectUtilsTests, build_common_enumerated_header_inconsistent_bit_bound) +{ + BitBound bit_bound = 0; + EXPECT_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound), + InvalidArgumentError); + bit_bound = 16; + EXPECT_NO_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound)); + bit_bound = 33; + EXPECT_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound), + InvalidArgumentError); +} + +// Build CompleteEnumeratedType with non-empty flags +TEST(TypeObjectUtilsTests, build_complete_enumerated_type_non_empty_flags) +{ + EnumTypeFlag empty_flags = 0; + EnumTypeFlag non_empty_flags = 1; + CommonEnumeratedHeader common_header = TypeObjectUtils::build_common_enumerated_header(32); + CompleteTypeDetail type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "enumerated_type_name"); + CompleteEnumeratedHeader header = TypeObjectUtils::build_complete_enumerated_header(common_header, type_detail); + CommonEnumeratedLiteral common_literal = TypeObjectUtils::build_common_enumerated_literal(1, 0); + CompleteMemberDetail member_detail = TypeObjectUtils::build_complete_member_detail("enum_member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteEnumeratedLiteral literal = TypeObjectUtils::build_complete_enumerated_literal(common_literal, + member_detail); + CompleteEnumeratedLiteralSeq literal_seq; + TypeObjectUtils::add_complete_enumerated_literal(literal_seq, literal); + EXPECT_THROW(CompleteEnumeratedType enumeration = TypeObjectUtils::build_complete_enumerated_type(non_empty_flags, + header, literal_seq), InvalidArgumentError); + EXPECT_NO_THROW(CompleteEnumeratedType enumeration = TypeObjectUtils::build_complete_enumerated_type(empty_flags, + header, literal_seq)); +} + +// Build CommonBitflag with inconsistent data +TEST(TypeObjectUtilsTests, build_common_bitflag_inconsistent_data) +{ + BitflagFlag empty_flags = 0; + BitflagFlag non_empty_flags = 1; + EXPECT_THROW(CommonBitflag bitflag = TypeObjectUtils::build_common_bitflag(65, non_empty_flags), + InvalidArgumentError); + EXPECT_THROW(CommonBitflag bitflag = TypeObjectUtils::build_common_bitflag(65, empty_flags), + InvalidArgumentError); + EXPECT_THROW(CommonBitflag bitflag = TypeObjectUtils::build_common_bitflag(32, non_empty_flags), + InvalidArgumentError); + EXPECT_NO_THROW(CommonBitflag bitflag = TypeObjectUtils::build_common_bitflag(32, empty_flags)); +} + +// Build CompleteBitflag with non-applying builtin annotations. +TEST(TypeObjectUtilsTests, build_complete_bitflag_invalid_builtin_annotations) +{ + AppliedBuiltinMemberAnnotations unit_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional("unit"), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + // TODO(jlbueno) @min & @max annotations cannot be applied: TypeObject depends on 'any' block implementation. + AppliedBuiltinMemberAnnotations hash_id_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("member_hash")); + CompleteMemberDetail unit_member = TypeObjectUtils::build_complete_member_detail("member_name", unit_builtin_ann, + eprosima::fastcdr::optional()); + CompleteMemberDetail hash_id_member = TypeObjectUtils::build_complete_member_detail("member_name", + hash_id_builtin_ann, eprosima::fastcdr::optional()); + EXPECT_THROW(CompleteBitflag bitflag = TypeObjectUtils::build_complete_bitflag(CommonBitflag(), unit_member), + InvalidArgumentError); + EXPECT_THROW(CompleteBitflag bitflag = TypeObjectUtils::build_complete_bitflag(CommonBitflag(), hash_id_member), + InvalidArgumentError); +} + +// Build CommonEnumeratedHeader with inconsistent bitmask bit bound +TEST(TypeObjectUtilsTests, build_common_enumerated_header_inconsistent_bitmask_bit_bound) +{ + BitBound bit_bound = 0; + EXPECT_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound, true), + InvalidArgumentError); + bit_bound = 33; + EXPECT_NO_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound, true)); + bit_bound = 65; + EXPECT_THROW(CommonEnumeratedHeader header = TypeObjectUtils::build_common_enumerated_header(bit_bound, true), + InvalidArgumentError); +} + +// Build CompleteBitmaskType with non-empty flags +TEST(TypeObjectUtilsTests, build_complete_bitmask_type_non_empty_flags) +{ + EnumTypeFlag empty_flags = 0; + EnumTypeFlag non_empty_flags = 1; + CommonEnumeratedHeader common_header = TypeObjectUtils::build_common_enumerated_header(64, true); + CompleteTypeDetail type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "bitmask_type_name"); + CompleteBitmaskHeader header = TypeObjectUtils::build_complete_enumerated_header(common_header, type_detail, true); + CompleteMemberDetail member_detail = TypeObjectUtils::build_complete_member_detail("bitflag_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitflag bitflag = TypeObjectUtils::build_complete_bitflag(CommonBitflag(), member_detail); + CompleteBitflagSeq bitflag_seq; + TypeObjectUtils::add_complete_bitflag(bitflag_seq, bitflag); + EXPECT_THROW(CompleteBitmaskType bitmask = TypeObjectUtils::build_complete_bitmask_type(non_empty_flags, header, + bitflag_seq), InvalidArgumentError); + EXPECT_NO_THROW(CompleteBitmaskType bitmask = TypeObjectUtils::build_complete_bitmask_type(empty_flags, header, + bitflag_seq)); +} + +// Build CommonBitfield with inconsistent data +TEST(TypeObjectUtilsTests, build_common_bitfield_inconsistent_data) +{ + BitsetMemberFlag empty_flags = 0; + BitsetMemberFlag non_empty_flags = 1; + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(65, non_empty_flags, 0, TK_FLOAT128), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(32, non_empty_flags, 0, TK_FLOAT128), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(65, empty_flags, 0, TK_FLOAT128), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(65, non_empty_flags, 3, TK_FLOAT128), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(65, non_empty_flags, 0, TK_BYTE), + InvalidArgumentError); + EXPECT_NO_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(32, empty_flags, 3, TK_BYTE)); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(32, empty_flags, 3, TK_BOOLEAN), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(32, empty_flags, 15, TK_BYTE), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(32, empty_flags, 27, TK_UINT16), + InvalidArgumentError); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(0, empty_flags, 33, TK_INT32), + InvalidArgumentError); + EXPECT_NO_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(0, empty_flags, 64, TK_INT64)); + EXPECT_THROW(CommonBitfield bitfield = TypeObjectUtils::build_common_bitfield(1, empty_flags, 64, TK_UINT64), + InvalidArgumentError); +} + +// Build CompleteBitfield with non-applying builtin annotations. +TEST(TypeObjectUtilsTests, build_complete_bitfield_invalid_builtin_annotations) +{ + AppliedBuiltinMemberAnnotations unit_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional("unit"), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + // TODO(jlbueno) @min & @max annotations cannot be applied: TypeObject depends on 'any' block implementation. + AppliedBuiltinMemberAnnotations hash_id_builtin_ann = TypeObjectUtils::build_applied_builtin_member_annotations( + eprosima::fastcdr::optional(), eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional("member_hash")); + CompleteMemberDetail unit_member = TypeObjectUtils::build_complete_member_detail("member_name", unit_builtin_ann, + eprosima::fastcdr::optional()); + CompleteMemberDetail hash_id_member = TypeObjectUtils::build_complete_member_detail("member_name", + hash_id_builtin_ann, eprosima::fastcdr::optional()); + CommonBitfield common_bitfield = TypeObjectUtils::build_common_bitfield(0, 0, 1, TK_BOOLEAN); + EXPECT_THROW(CompleteBitfield bitfield = TypeObjectUtils::build_complete_bitfield(common_bitfield, unit_member), + InvalidArgumentError); + EXPECT_THROW(CompleteBitfield bitfield = TypeObjectUtils::build_complete_bitfield(common_bitfield, hash_id_member), + InvalidArgumentError); +} + +// Build CompleteBitsetType with non-empty flags +TEST(TypeObjectUtilsTests, build_complete_bitset_type_non_empty_flags) +{ + BitsetTypeFlag empty_flags = 0; + BitsetTypeFlag non_empty_flags = 1; + CommonBitfield common_bitfield = TypeObjectUtils::build_common_bitfield(0, empty_flags, 3, TK_BYTE); + CompleteMemberDetail member_detail = TypeObjectUtils::build_complete_member_detail("bitfield_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitfield bitfield = TypeObjectUtils::build_complete_bitfield(common_bitfield, member_detail); + CompleteBitfieldSeq bitfield_seq; + TypeObjectUtils::add_complete_bitfield(bitfield_seq, bitfield); + CompleteTypeDetail type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "bitset_type_name"); + CompleteBitsetHeader header = TypeObjectUtils::build_complete_bitset_header(type_detail); + EXPECT_THROW(CompleteBitsetType bitset = TypeObjectUtils::build_complete_bitset_type(non_empty_flags, + header, bitfield_seq), InvalidArgumentError); + EXPECT_NO_THROW(CompleteBitsetType bitset = TypeObjectUtils::build_complete_bitset_type(empty_flags, + header, bitfield_seq)); +} + +// Register alias TypeObject +TEST(TypeObjectUtilsTests, register_alias_type_object) +{ + TypeIdentifier related_type; + related_type._d(TK_CHAR16); + CommonAliasBody common_body = TypeObjectUtils::build_common_alias_body(0, related_type); + CompleteAliasBody body = TypeObjectUtils::build_complete_alias_body(common_body, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteAliasHeader empty_header = TypeObjectUtils::build_complete_alias_header(empty_type_detail); + CompleteAliasType alias = TypeObjectUtils::build_complete_alias_type(0, empty_header, body); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_alias_type_object(alias, "alias")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_alias_type_object(alias, "alias")); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + "alias_name"); + CompleteAliasHeader header = TypeObjectUtils::build_complete_alias_header(detail); + CompleteAliasType other_alias = TypeObjectUtils::build_complete_alias_type(0, header, body); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + TypeObjectUtils::build_and_register_alias_type_object(other_alias, + "alias")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_alias_type_object( + other_alias, + type_name)); +} + +// Register annotation TypeObject +TEST(TypeObjectUtilsTests, register_annotation_type_object) +{ + CompleteAnnotationHeader header = TypeObjectUtils::build_complete_annotation_header("annotation_name"); + CompleteAnnotationType annotation = TypeObjectUtils::build_complete_annotation_type(0, header, + CompleteAnnotationParameterSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_annotation_type_object(annotation, + "annotation")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_annotation_type_object(annotation, + "annotation")); + CompleteAnnotationHeader other_header = TypeObjectUtils::build_complete_annotation_header("other_annotation_name"); + CompleteAnnotationType other_annotation = TypeObjectUtils::build_complete_annotation_type(0, other_header, + CompleteAnnotationParameterSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_annotation_type_object( + other_annotation, "annotation")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_annotation_type_object( + other_annotation, + type_name)); +} + +// Register structure TypeObject +TEST(TypeObjectUtilsTests, register_structure_type_object) +{ + StructTypeFlag flags = TypeObjectUtils::build_struct_type_flag( + eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteStructHeader header = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), empty_type_detail); + CompleteStructType structure = TypeObjectUtils::build_complete_struct_type(flags, header, + CompleteStructMemberSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_struct_type_object(structure, + "structure")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_struct_type_object(structure, + "structure")); + StructTypeFlag other_flags = TypeObjectUtils::build_struct_type_flag( + eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, false, false); + CompleteStructType other_structure = TypeObjectUtils::build_complete_struct_type(other_flags, + header, CompleteStructMemberSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_struct_type_object( + other_structure, "structure")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_struct_type_object( + other_structure, + type_name)); +} + +// Register union TypeObject +TEST(TypeObjectUtilsTests, register_union_type_object) +{ + UnionTypeFlag flags = TypeObjectUtils::build_union_type_flag( + eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); + UnionDiscriminatorFlag discr_flags = TypeObjectUtils::build_union_discriminator_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, + false); + TypeIdentifier discriminator_type_id; + discriminator_type_id._d(TK_BYTE); + CommonDiscriminatorMember discr_member = TypeObjectUtils::build_common_discriminator_member(discr_flags, + discriminator_type_id); + CompleteDiscriminatorMember discriminator = TypeObjectUtils::build_complete_discriminator_member(discr_member, + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + UnionMemberFlag member_flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + UnionCaseLabelSeq case_labels; + TypeObjectUtils::add_union_case_label(case_labels, 5); + CommonUnionMember common_member = TypeObjectUtils::build_common_union_member(3, member_flags, type_id, case_labels); + CompleteMemberDetail empty_member_detail = TypeObjectUtils::build_complete_member_detail("member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteUnionMember member = TypeObjectUtils::build_complete_union_member(common_member, empty_member_detail); + CompleteUnionMemberSeq member_seq; + TypeObjectUtils::add_complete_union_member(member_seq, member); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteUnionHeader header = TypeObjectUtils::build_complete_union_header(empty_type_detail); + CompleteUnionType union_type = TypeObjectUtils::build_complete_union_type(flags, header, + discriminator, member_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_union_type_object(union_type, "union")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_union_type_object(union_type, "union")); + UnionTypeFlag other_flags = TypeObjectUtils::build_union_type_flag( + eprosima::fastdds::dds::xtypes::ExtensibilityKind::MUTABLE, false, false); + CompleteUnionType other_union_type = TypeObjectUtils::build_complete_union_type(other_flags, header, + discriminator, member_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_union_type_object( + other_union_type, "union")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_union_type_object( + other_union_type, + type_name)); +} + +// Register bitset TypeObject +TEST(TypeObjectUtilsTests, register_bitset_type_object) +{ + CommonBitfield common_bitfield = TypeObjectUtils::build_common_bitfield(0, 0, 3, TK_BYTE); + CompleteMemberDetail empty_member_detail = TypeObjectUtils::build_complete_member_detail("member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitfield bitfield = TypeObjectUtils::build_complete_bitfield(common_bitfield, empty_member_detail); + CompleteBitfieldSeq bitfield_seq; + TypeObjectUtils::add_complete_bitfield(bitfield_seq, bitfield); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteBitsetHeader header = TypeObjectUtils::build_complete_bitset_header(empty_type_detail); + CompleteBitsetType bitset = TypeObjectUtils::build_complete_bitset_type(0, header, bitfield_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_bitset_type_object(bitset, "bitset")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_bitset_type_object(bitset, "bitset")); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + "bitset"); + CompleteBitsetHeader other_header = TypeObjectUtils::build_complete_bitset_header(detail); + CompleteBitsetType other_bitset = TypeObjectUtils::build_complete_bitset_type(0, other_header, bitfield_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_bitset_type_object( + other_bitset, "bitset")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_bitset_type_object( + other_bitset, + type_name)); +} + +// Register sequence TypeObject +TEST(TypeObjectUtilsTests, register_sequence_type_object) +{ + CommonCollectionHeader common_header = TypeObjectUtils::build_common_collection_header(356); + CompleteCollectionHeader header = TypeObjectUtils::build_complete_collection_header(common_header, + eprosima::fastcdr::optional()); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, + CompleteElementDetail()); + CompleteSequenceType sequence = TypeObjectUtils::build_complete_sequence_type(0, header, element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_sequence_type_object(sequence, "sequence")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_sequence_type_object(sequence, "sequence")); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + "sequence"); + CompleteCollectionHeader other_header = TypeObjectUtils::build_complete_collection_header(common_header, detail); + CompleteSequenceType other_sequence = TypeObjectUtils::build_complete_sequence_type(0, other_header, element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, TypeObjectUtils::build_and_register_sequence_type_object( + other_sequence, "sequence")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_sequence_type_object( + other_sequence, + type_name)); +} + +// Register array TypeObject +TEST(TypeObjectUtilsTests, register_array_type_object) +{ + LBoundSeq array_bounds; + LBound bound = 356; + TypeObjectUtils::add_array_dimension(array_bounds, bound); + CommonArrayHeader common_header = TypeObjectUtils::build_common_array_header(array_bounds); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteArrayHeader header = TypeObjectUtils::build_complete_array_header(common_header, empty_type_detail); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_FLOAT128); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, + CompleteElementDetail()); + CompleteArrayType array = TypeObjectUtils::build_complete_array_type(0, header, element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_array_type_object(array, "array")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_array_type_object(array, "array")); + type_id._d(TK_INT16); + CommonCollectionElement other_common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteCollectionElement other_element = TypeObjectUtils::build_complete_collection_element(other_common_element, + CompleteElementDetail()); + CompleteArrayType other_array = TypeObjectUtils::build_complete_array_type(0, header, other_element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + TypeObjectUtils::build_and_register_array_type_object(other_array, + "array")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_array_type_object( + other_array, + type_name)); +} + +// Register map TypeObject +TEST(TypeObjectUtilsTests, register_map_type_object) +{ + CommonCollectionHeader common_header = TypeObjectUtils::build_common_collection_header(356); + CompleteCollectionHeader header = TypeObjectUtils::build_complete_collection_header(common_header, + eprosima::fastcdr::optional()); + CollectionElementFlag flags = TypeObjectUtils::build_collection_element_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::USE_DEFAULT, true); + TypeIdentifier type_id; + type_id._d(TK_INT16); + CommonCollectionElement common_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteCollectionElement element = TypeObjectUtils::build_complete_collection_element(common_element, + CompleteElementDetail()); + CompleteMapType map = TypeObjectUtils::build_complete_map_type(0, header, element, element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_map_type_object(map, "map")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_map_type_object(map, "map")); + type_id._d(TK_INT32); + CommonCollectionElement key_element = TypeObjectUtils::build_common_collection_element(flags, type_id); + CompleteCollectionElement key = TypeObjectUtils::build_complete_collection_element(key_element, + CompleteElementDetail()); + CompleteMapType other_map = TypeObjectUtils::build_complete_map_type(0, header, key, element); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + TypeObjectUtils::build_and_register_map_type_object(other_map, + "map")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, + TypeObjectUtils::build_and_register_map_type_object(other_map, + type_name)); +} + +// Register enumeration TypeObject +TEST(TypeObjectUtilsTests, register_enumerated_type_object) +{ + CommonEnumeratedHeader common_header = TypeObjectUtils::build_common_enumerated_header(32); + CompleteTypeDetail empty_type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteEnumeratedHeader header = TypeObjectUtils::build_complete_enumerated_header(common_header, + empty_type_detail); + CommonEnumeratedLiteral common_literal = TypeObjectUtils::build_common_enumerated_literal(1, 0); + CompleteMemberDetail empty_member_detail = TypeObjectUtils::build_complete_member_detail("member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteEnumeratedLiteral literal = TypeObjectUtils::build_complete_enumerated_literal(common_literal, + empty_member_detail); + CompleteEnumeratedLiteralSeq literal_seq; + TypeObjectUtils::add_complete_enumerated_literal(literal_seq, literal); + CompleteEnumeratedType enumeration = TypeObjectUtils::build_complete_enumerated_type(0, header, literal_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_enumerated_type_object(enumeration, + "enum")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_enumerated_type_object(enumeration, + "enum")); + CompleteTypeDetail detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), + "enumeration"); + CompleteEnumeratedHeader other_header = TypeObjectUtils::build_complete_enumerated_header(common_header, detail); + CompleteEnumeratedType other_enumeration = TypeObjectUtils::build_complete_enumerated_type(0, other_header, + literal_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + TypeObjectUtils::build_and_register_enumerated_type_object(other_enumeration, + "enum")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_enumerated_type_object( + other_enumeration, + type_name)); +} + +// Register bitmask TypeObject +TEST(TypeObjectUtilsTests, register_bitmask_type_object) +{ + CommonEnumeratedHeader common_header = TypeObjectUtils::build_common_enumerated_header(64, true); + CompleteTypeDetail type_detail = TypeObjectUtils::build_complete_type_detail( + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional(), "type_name"); + CompleteBitmaskHeader header = TypeObjectUtils::build_complete_enumerated_header(common_header, type_detail, true); + CompleteMemberDetail empty_member_detail = TypeObjectUtils::build_complete_member_detail("member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitflag bitflag = TypeObjectUtils::build_complete_bitflag(CommonBitflag(), empty_member_detail); + CompleteBitflagSeq bitflag_seq; + TypeObjectUtils::add_complete_bitflag(bitflag_seq, bitflag); + CompleteBitmaskType bitmask = TypeObjectUtils::build_complete_bitmask_type(0, header, bitflag_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_bitmask_type_object(bitmask, "bitmask")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + TypeObjectUtils::build_and_register_bitmask_type_object(bitmask, "bitmask")); + CommonBitflag common = TypeObjectUtils::build_common_bitflag(1, 0); + CompleteMemberDetail other_member_detail = TypeObjectUtils::build_complete_member_detail("other_member_name", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteBitflag other_bitflag = TypeObjectUtils::build_complete_bitflag(common, other_member_detail); + TypeObjectUtils::add_complete_bitflag(bitflag_seq, other_bitflag); + CompleteBitmaskType other_bitmask = TypeObjectUtils::build_complete_bitmask_type(0, header, bitflag_seq); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, + TypeObjectUtils::build_and_register_bitmask_type_object(other_bitmask, + "bitmask")); + std::string type_name; + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_PRECONDITION_NOT_MET, TypeObjectUtils::build_and_register_bitmask_type_object( + other_bitmask, + type_name)); +} + +// This tests only check that Complete TypeObjects sequences are correctly ordered. TypeObjectUtils API only generates +// Complete TypeObjects. Minimal TypeObject sequence order is checked in Fast DDS-Gen. +// Test add element to AppliedAnnotationParameterSeq +TEST(TypeObjectUtilsTests, add_to_applied_annotation_parameter_seq) +{ + NameHash get_dependencies_hash = TypeObjectUtils::name_hash("getDependencies"); // 0x31FBAA_5 + NameHash color_hash = TypeObjectUtils::name_hash("color"); // 0x70DDA5DF + NameHash shapesize_hash = TypeObjectUtils::name_hash("shapesize"); // 0xDA907714 + EXPECT_TRUE(color_hash < shapesize_hash); + AnnotationParameterValue param_value = TypeObjectUtils::build_annotation_parameter_value(true); + AppliedAnnotationParameter get_dependencies_param = TypeObjectUtils::build_applied_annotation_parameter( + get_dependencies_hash, param_value); + AppliedAnnotationParameter color_param = TypeObjectUtils::build_applied_annotation_parameter(color_hash, + param_value); + AppliedAnnotationParameter shapesize_param = TypeObjectUtils::build_applied_annotation_parameter(shapesize_hash, + param_value); + AppliedAnnotationParameterSeq param_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, shapesize_param)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, shapesize_param), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, get_dependencies_param)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, get_dependencies_param), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, color_param)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation_parameter(param_seq, color_param), InvalidArgumentError); + EXPECT_EQ(3, param_seq.size()); + EXPECT_EQ(get_dependencies_param, param_seq[0]); + EXPECT_EQ(color_param, param_seq[1]); + EXPECT_EQ(shapesize_param, param_seq[2]); + EXPECT_TRUE(param_seq[0].paramname_hash() < param_seq[1].paramname_hash()); + EXPECT_TRUE(param_seq[1].paramname_hash() < param_seq[2].paramname_hash()); +} + +// Test add element to AppliedAnnotationSeq +TEST(TypeObjectUtilsTests, add_to_applied_annotation_seq) +{ + CompleteAnnotationHeader first_ann = TypeObjectUtils::build_complete_annotation_header("first"); + CompleteAnnotationHeader second_ann = TypeObjectUtils::build_complete_annotation_header("second"); + CompleteAnnotationHeader third_ann = TypeObjectUtils::build_complete_annotation_header("third"); + CompleteAnnotationType first_custom_annotation = TypeObjectUtils::build_complete_annotation_type(0, first_ann, + CompleteAnnotationParameterSeq()); + CompleteAnnotationType second_custom_annotation = TypeObjectUtils::build_complete_annotation_type(0, second_ann, + CompleteAnnotationParameterSeq()); + CompleteAnnotationType third_custom_annotation = TypeObjectUtils::build_complete_annotation_type(0, third_ann, + CompleteAnnotationParameterSeq()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_annotation_type_object( + first_custom_annotation, "first_custom")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_annotation_type_object( + second_custom_annotation, "second_custom")); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, TypeObjectUtils::build_and_register_annotation_type_object( + third_custom_annotation, "third_custom")); + TypeIdentifierPair first_custom_annotation_ids; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("first_custom", + first_custom_annotation_ids)); + TypeIdentifierPair second_custom_annotation_ids; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("second_custom", + second_custom_annotation_ids)); + TypeIdentifierPair third_custom_annotation_ids; + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, + DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers("third_custom", + third_custom_annotation_ids)); + // Ensure to use Complete TypeIdentifier. The test uses annotations that differs on the name which is not included + // in the Minimal TypeObject. + AppliedAnnotation first_annotation; + AppliedAnnotation second_annotation; + AppliedAnnotation third_annotation; + if (EK_COMPLETE == first_custom_annotation_ids.type_identifier1()._d()) + { + first_annotation = TypeObjectUtils::build_applied_annotation( + first_custom_annotation_ids.type_identifier1(), + eprosima::fastcdr::optional()); + } + else + { + first_annotation = TypeObjectUtils::build_applied_annotation( + first_custom_annotation_ids.type_identifier2(), + eprosima::fastcdr::optional()); + } + if (EK_COMPLETE == second_custom_annotation_ids.type_identifier1()._d()) + { + second_annotation = TypeObjectUtils::build_applied_annotation( + second_custom_annotation_ids.type_identifier1(), + eprosima::fastcdr::optional()); + } + else + { + second_annotation = TypeObjectUtils::build_applied_annotation( + second_custom_annotation_ids.type_identifier2(), + eprosima::fastcdr::optional()); + } + if (EK_COMPLETE == third_custom_annotation_ids.type_identifier1()._d()) + { + third_annotation = TypeObjectUtils::build_applied_annotation( + third_custom_annotation_ids.type_identifier1(), + eprosima::fastcdr::optional()); + } + else + { + third_annotation = TypeObjectUtils::build_applied_annotation( + third_custom_annotation_ids.type_identifier2(), + eprosima::fastcdr::optional()); + } + AppliedAnnotationSeq applied_annotation_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, third_annotation)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, third_annotation), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, first_annotation)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, first_annotation), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, second_annotation)); + EXPECT_THROW(TypeObjectUtils::add_applied_annotation(applied_annotation_seq, second_annotation), + InvalidArgumentError); + EXPECT_EQ(3, applied_annotation_seq.size()); + // Ordered by Annotation TypeIdentifier + EXPECT_TRUE(applied_annotation_seq[0].annotation_typeid().equivalence_hash() < + applied_annotation_seq[1].annotation_typeid().equivalence_hash()); + EXPECT_TRUE(applied_annotation_seq[1].annotation_typeid().equivalence_hash() < + applied_annotation_seq[2].annotation_typeid().equivalence_hash()); +} + +// Test add element to CompleteStructMemberSeq +TEST(TypeObjectUtilsTests, add_to_complete_struct_member_seq) +{ + StructMemberFlag flags = TypeObjectUtils::build_struct_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false, false, + false); + TypeIdentifier type_id; + type_id._d(TK_INT32); + CommonStructMember first_member = TypeObjectUtils::build_common_struct_member(0, flags, type_id); + CommonStructMember second_member = TypeObjectUtils::build_common_struct_member(1, flags, type_id); + CommonStructMember third_member = TypeObjectUtils::build_common_struct_member(2, flags, type_id); + CompleteMemberDetail first_detail = TypeObjectUtils::build_complete_member_detail("first", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail second_detail = TypeObjectUtils::build_complete_member_detail("second", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail third_detail = TypeObjectUtils::build_complete_member_detail("third", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteStructMember first = TypeObjectUtils::build_complete_struct_member(first_member, first_detail); + CompleteStructMember second = TypeObjectUtils::build_complete_struct_member(second_member, second_detail); + CompleteStructMember third = TypeObjectUtils::build_complete_struct_member(third_member, third_detail); + CompleteStructMember invalid = TypeObjectUtils::build_complete_struct_member(first_member, third_detail); + CompleteStructMemberSeq member_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, third)); + EXPECT_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, third), InvalidArgumentError); +#if !defined(NDEBUG) + EXPECT_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, invalid), InvalidArgumentError); +#endif // !defined(NDEBUG) + EXPECT_NO_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, first)); + EXPECT_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, first), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, second)); + EXPECT_THROW(TypeObjectUtils::add_complete_struct_member(member_seq, second), InvalidArgumentError); + EXPECT_EQ(3, member_seq.size()); + EXPECT_EQ(first, member_seq[0]); + EXPECT_EQ(second, member_seq[1]); + EXPECT_EQ(third, member_seq[2]); +} + +// Test add element to UnionCaseLabelSeq +TEST(TypeObjectUtilsTests, add_to_union_case_label_seq) +{ + UnionCaseLabelSeq labels; + EXPECT_NO_THROW(TypeObjectUtils::add_union_case_label(labels, 3)); + EXPECT_EQ(1, labels.size()); + EXPECT_NO_THROW(TypeObjectUtils::add_union_case_label(labels, 3)); + EXPECT_EQ(1, labels.size()); + EXPECT_NO_THROW(TypeObjectUtils::add_union_case_label(labels, 1)); + EXPECT_NO_THROW(TypeObjectUtils::add_union_case_label(labels, 2)); + EXPECT_EQ(3, labels.size()); + EXPECT_EQ(1, labels[0]); + EXPECT_EQ(2, labels[1]); + EXPECT_EQ(3, labels[2]); +} + +// Test add element to CompleteUnionMemberSeq +TEST(TypeObjectUtilsTests, add_to_complete_union_member_seq) +{ + UnionMemberFlag flags = TypeObjectUtils::build_union_member_flag( + eprosima::fastdds::dds::xtypes::TryConstructKind::DISCARD, false, false); + TypeIdentifier type_id; + type_id._d(TK_UINT32); + UnionCaseLabelSeq label_1; + UnionCaseLabelSeq label_2; + UnionCaseLabelSeq label_3; + TypeObjectUtils::add_union_case_label(label_1, 1); + TypeObjectUtils::add_union_case_label(label_2, 2); + TypeObjectUtils::add_union_case_label(label_3, 3); + CommonUnionMember member_1 = TypeObjectUtils::build_common_union_member(1, flags, type_id, label_1); + CommonUnionMember member_2 = TypeObjectUtils::build_common_union_member(2, flags, type_id, label_2); + CommonUnionMember member_3 = TypeObjectUtils::build_common_union_member(3, flags, type_id, label_3); + CompleteMemberDetail first_detail = TypeObjectUtils::build_complete_member_detail("first", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail second_detail = TypeObjectUtils::build_complete_member_detail("second", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail third_detail = TypeObjectUtils::build_complete_member_detail("third", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteUnionMember first_member = TypeObjectUtils::build_complete_union_member(member_1, first_detail); + CompleteUnionMember second_member = TypeObjectUtils::build_complete_union_member(member_2, second_detail); + CompleteUnionMember third_member = TypeObjectUtils::build_complete_union_member(member_3, third_detail); + CompleteUnionMemberSeq member_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_union_member(member_seq, third_member)); + EXPECT_THROW(TypeObjectUtils::add_complete_union_member(member_seq, third_member), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_union_member(member_seq, first_member)); + EXPECT_THROW(TypeObjectUtils::add_complete_union_member(member_seq, first_member), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_union_member(member_seq, second_member)); + EXPECT_THROW(TypeObjectUtils::add_complete_union_member(member_seq, second_member), InvalidArgumentError); + EXPECT_EQ(3, member_seq.size()); + EXPECT_EQ(first_member, member_seq[0]); + EXPECT_EQ(second_member, member_seq[1]); + EXPECT_EQ(third_member, member_seq[2]); +} + +// Test add element to CompleteAnnotationParameterSeq +TEST(TypeObjectUtilsTests, add_to_complete_annotation_parameter_seq) +{ + TypeIdentifier type_id; + type_id._d(TK_BOOLEAN); + CommonAnnotationParameter common = TypeObjectUtils::build_common_annotation_parameter(0, type_id); + AnnotationParameterValue default_value = TypeObjectUtils::build_annotation_parameter_value(false); + MemberName first = "first"; + MemberName second = "second"; + MemberName third = "third"; + CompleteAnnotationParameter first_param = TypeObjectUtils::build_complete_annotation_parameter(common, first, + default_value); + CompleteAnnotationParameter second_param = TypeObjectUtils::build_complete_annotation_parameter(common, second, + default_value); + CompleteAnnotationParameter third_param = TypeObjectUtils::build_complete_annotation_parameter(common, third, + default_value); + CompleteAnnotationParameterSeq param_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, third_param)); + EXPECT_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, third_param), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, first_param)); + EXPECT_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, first_param), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, second_param)); + EXPECT_THROW(TypeObjectUtils::add_complete_annotation_parameter(param_seq, second_param), InvalidArgumentError); + EXPECT_EQ(3, param_seq.size()); + EXPECT_EQ(first_param, param_seq[0]); + EXPECT_EQ(second_param, param_seq[1]); + EXPECT_EQ(third_param, param_seq[2]); +} + +// Test add element to CompleteEnumeratedLiteralSeq +TEST(TypeObjectUtils, add_to_complete_enumerated_literal_seq) +{ + EnumeratedLiteralFlag flags = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral first = TypeObjectUtils::build_common_enumerated_literal(1, flags); + CommonEnumeratedLiteral second = TypeObjectUtils::build_common_enumerated_literal(2, flags); + CommonEnumeratedLiteral third = TypeObjectUtils::build_common_enumerated_literal(3, flags); + CompleteMemberDetail first_detail = TypeObjectUtils::build_complete_member_detail("first", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail second_detail = TypeObjectUtils::build_complete_member_detail("second", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail third_detail = TypeObjectUtils::build_complete_member_detail("third", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteEnumeratedLiteral first_literal = TypeObjectUtils::build_complete_enumerated_literal(first, first_detail); + CompleteEnumeratedLiteral second_literal = + TypeObjectUtils::build_complete_enumerated_literal(second, second_detail); + CompleteEnumeratedLiteral third_literal = TypeObjectUtils::build_complete_enumerated_literal(third, third_detail); + CompleteEnumeratedLiteralSeq literal_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, third_literal)); + EXPECT_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, third_literal), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, first_literal)); + EXPECT_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, first_literal), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, second_literal)); + EXPECT_THROW(TypeObjectUtils::add_complete_enumerated_literal(literal_seq, second_literal), InvalidArgumentError); + EXPECT_EQ(3, literal_seq.size()); + EXPECT_EQ(first_literal, literal_seq[0]); + EXPECT_EQ(second_literal, literal_seq[1]); + EXPECT_EQ(third_literal, literal_seq[2]); +} + +// Test add element to CompleteBitflagSeq +TEST(TypeObjectUtilsTests, add_to_complete_bitflag_seq) +{ + CompleteMemberDetail first_detail = TypeObjectUtils::build_complete_member_detail("first", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail second_detail = TypeObjectUtils::build_complete_member_detail("second", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail third_detail = TypeObjectUtils::build_complete_member_detail("third", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CommonBitflag first = TypeObjectUtils::build_common_bitflag(1, 0); + CommonBitflag second = TypeObjectUtils::build_common_bitflag(2, 0); + CommonBitflag third = TypeObjectUtils::build_common_bitflag(3, 0); + CompleteBitflag first_bitflag = TypeObjectUtils::build_complete_bitflag(first, first_detail); + CompleteBitflag second_bitflag = TypeObjectUtils::build_complete_bitflag(second, second_detail); + CompleteBitflag third_bitflag = TypeObjectUtils::build_complete_bitflag(third, third_detail); + CompleteBitflagSeq bitflag_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, third_bitflag)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, third_bitflag), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, first_bitflag)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, first_bitflag), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, second_bitflag)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitflag(bitflag_seq, second_bitflag), InvalidArgumentError); + EXPECT_EQ(3, bitflag_seq.size()); + EXPECT_EQ(first_bitflag, bitflag_seq[0]); + EXPECT_EQ(second_bitflag, bitflag_seq[1]); + EXPECT_EQ(third_bitflag, bitflag_seq[2]); +} + +// Test add element to CompleteBitfieldSeq +TEST(TypeObjectUtilsTests, add_to_complete_bitfield_seq) +{ + CompleteMemberDetail first_detail = TypeObjectUtils::build_complete_member_detail("first", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail second_detail = TypeObjectUtils::build_complete_member_detail("second", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CompleteMemberDetail third_detail = TypeObjectUtils::build_complete_member_detail("third", + eprosima::fastcdr::optional(), + eprosima::fastcdr::optional()); + CommonBitfield first = TypeObjectUtils::build_common_bitfield(1, 0, 1, TK_BOOLEAN); + CommonBitfield second = TypeObjectUtils::build_common_bitfield(2, 0, 1, TK_BOOLEAN); + CommonBitfield third = TypeObjectUtils::build_common_bitfield(3, 0, 1, TK_BOOLEAN); + CompleteBitfield first_bitfield = TypeObjectUtils::build_complete_bitfield(first, first_detail); + CompleteBitfield second_bitfield = TypeObjectUtils::build_complete_bitfield(second, second_detail); + CompleteBitfield third_bitfield = TypeObjectUtils::build_complete_bitfield(third, third_detail); + CompleteBitfieldSeq bitfield_seq; + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, third_bitfield)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, third_bitfield), InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, first_bitfield)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, first_bitfield), + InvalidArgumentError); + EXPECT_NO_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, second_bitfield)); + EXPECT_THROW(TypeObjectUtils::add_complete_bitfield(bitfield_seq, second_bitfield), InvalidArgumentError); + EXPECT_EQ(3, bitfield_seq.size()); + EXPECT_EQ(first_bitfield, bitfield_seq[0]); + EXPECT_EQ(second_bitfield, bitfield_seq[1]); + EXPECT_EQ(third_bitfield, bitfield_seq[2]); +} + +} // xtypes +} // dds +} // fastdds +} // eprosima + +int main( + int argc, + char** argv) +{ + testing::InitGoogleTest(&argc, argv); + int ret_value = RUN_ALL_TESTS(); + eprosima::fastdds::dds::Log::KillThread(); + return ret_value; +} diff --git a/test/unittest/dynamic_types/CMakeLists.txt b/test/unittest/dynamic_types/CMakeLists.txt deleted file mode 100644 index ce0e8ec043d..00000000000 --- a/test/unittest/dynamic_types/CMakeLists.txt +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -set(DYNAMIC_TYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/network.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetmaskFilterKind.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp - ) - -# External sources -if(TINYXML2_SOURCE_DIR) - list(APPEND DYNAMIC_TYPES_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) -endif() - -if(ANDROID) - if (ANDROID_NATIVE_API_LEVEL LESS 24) - list(APPEND DYNAMIC_TYPES_SOURCE - ${ANDROID_IFADDRS_SOURCE_DIR}/ifaddrs.c - ) - endif() -endif() - -set(DYNAMIC_TYPES_TEST_SOURCE - DynamicTypesTests.cpp - idl/Basic.cxx - idl/Basicv1.cxx - idl/BasicPubSubTypes.cxx - idl/BasicTypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp - ) - -set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE - DynamicComplexTypesTests.cpp - idl/Test.cxx - idl/Testv1.cxx - idl/TestPubSubTypes.cxx - idl/TestTypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} - ) - -set(DYNAMIC_TYPES_4_2_TEST_SOURCE - DynamicTypes_4_2_Tests.cpp - idl/new_features_4_2.cxx - idl/new_features_4_2v1.cxx - idl/new_features_4_2PubSubTypes.cxx - idl/new_features_4_2TypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} - ) - -include_directories(mock/) - -add_executable(DynamicTypesTests ${DYNAMIC_TYPES_TEST_SOURCE}) -target_compile_definitions(DynamicTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantAttributes - $<$:${TINYXML2_INCLUDE_DIR}> - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ) -target_link_libraries(DynamicTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - ) -if(QNX) - target_link_libraries(DynamicTypesTests socket) -endif() -gtest_discover_tests(DynamicTypesTests) - - -add_executable(DynamicComplexTypesTests ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) -target_compile_definitions(DynamicComplexTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicComplexTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}>) -target_link_libraries(DynamicComplexTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - ) -if(QNX) - target_link_libraries(DynamicComplexTypesTests socket) -endif() -gtest_discover_tests(DynamicComplexTypesTests) - - -add_executable(DynamicTypes_4_2_Tests ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) -target_compile_definitions(DynamicTypes_4_2_Tests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(DynamicTypes_4_2_Tests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp) - target_link_libraries(DynamicTypes_4_2_Tests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> - ) -if(QNX) - target_link_libraries(DynamicTypes_4_2_Tests socket) -endif() -gtest_discover_tests(DynamicTypes_4_2_Tests) - -configure_file("types_profile.xml" "types_profile.xml" COPYONLY) diff --git a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp b/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp deleted file mode 100644 index 75930dcc02f..00000000000 --- a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp +++ /dev/null @@ -1,2322 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "idl/Test.h" -#include "idl/TestPubSubTypes.h" -#include "idl/TestTypeObject.h" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -class DynamicComplexTypesTests : public ::testing::Test -{ -public: - - DynamicComplexTypesTests() - { - registerTestTypes(); - m_factory = DynamicTypeBuilderFactory::get_instance(); - init(); - } - - ~DynamicComplexTypesTests() - { - m_DynAutoType = nullptr; - //DynamicDataFactory::get_instance()->delete_data(m_DynAuto); - - m_DynManualType = nullptr; - //DynamicDataFactory::get_instance()->delete_data(m_DynManual); - - if (!DynamicTypeBuilderFactory::get_instance()->is_empty()) - { - EPROSIMA_LOG_ERROR(DYN_TEST, "DynamicTypeBuilderFactory is not empty."); - } - - if (!DynamicDataFactory::get_instance()->is_empty()) - { - EPROSIMA_LOG_ERROR(DYN_TEST, "DynamicDataFactory is not empty."); - } - - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - TypeObjectFactory::delete_instance(); - - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - } - - void init(); - - types::DynamicType_ptr GetMyEnumType(); - types::DynamicType_ptr GetMyAliasEnumType(); - types::DynamicType_ptr GetMyAliasEnum2Type(); - types::DynamicType_ptr GetMyAliasEnum3Type(); - types::DynamicType_ptr GetMyOctetArray500Type(); - types::DynamicType_ptr GetBSAlias5Type(); - types::DynamicType_ptr GetMA3Type(); - types::DynamicType_ptr GetMyMiniArrayType(); - types::DynamicType_ptr GetMySequenceLongType(); - types::DynamicType_ptr GetBasicStructType(); - types::DynamicType_ptr GetComplexStructType(); - types::DynamicType_ptr GetUnionSwitchType(); - types::DynamicType_ptr GetUnion2SwitchType(); - types::DynamicType_ptr GetCompleteStructType(); - types::DynamicType_ptr GetKeyedStructType(); - - // Static types - //CompleteStruct m_Static; - CompleteStructPubSubType m_StaticType; - // Dynamic Types - //DynamicData* m_DynAuto; - types::DynamicType_ptr m_DynAutoType; - //DynamicData* m_DynManual; - types::DynamicType_ptr m_DynManualType; - DynamicTypeBuilderFactory* m_factory; - -private: - - types::DynamicType_ptr m_MyEnumType; - types::DynamicType_ptr m_MyAliasEnumType; - types::DynamicType_ptr m_MyAliasEnum2Type; - types::DynamicType_ptr m_MyAliasEnum3Type; - types::DynamicType_ptr m_MyOctetArray500; - types::DynamicType_ptr m_BSAlias5; - types::DynamicType_ptr m_MA3; - types::DynamicType_ptr m_MyMiniArray; - types::DynamicType_ptr m_MySequenceLong; - types::DynamicType_ptr m_BasicStructType; - types::DynamicType_ptr m_ComplexStructType; - types::DynamicType_ptr m_UnionSwitchType; - types::DynamicType_ptr m_Union2SwitchType; - types::DynamicType_ptr m_CompleteStructType; - types::DynamicType_ptr m_KeyedStructType; -}; - -/* - - struct KeyedStruct - { - @Key octet key; - BasicStruct basic; - }; - */ -types::DynamicType_ptr DynamicComplexTypesTests::GetKeyedStructType() -{ - if (m_KeyedStructType.get() == nullptr) - { - DynamicTypeBuilder_ptr keyedStruct_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - octet_builder->apply_annotation(ANNOTATION_KEY_ID, "value", "true"); - keyedStruct_builder->add_member(0, "key", octet_builder->build()); - keyedStruct_builder->add_member(1, "basic", GetBasicStructType()); - keyedStruct_builder->apply_annotation(ANNOTATION_KEY_ID, "value", "true"); - keyedStruct_builder->set_name("KeyedStruct"); - m_KeyedStructType = keyedStruct_builder->build(); - } - - return m_KeyedStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyEnumType() -{ - if (m_MyEnumType.get() == nullptr) - { - DynamicTypeBuilder_ptr myEnum_builder = m_factory->create_enum_builder(); - myEnum_builder->set_name("MyEnum"); - myEnum_builder->add_empty_member(0, "A"); - myEnum_builder->add_empty_member(1, "B"); - myEnum_builder->add_empty_member(2, "C"); - m_MyEnumType = myEnum_builder->build(); - } - - return m_MyEnumType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnumType() -{ - if (m_MyAliasEnumType.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum_builder = m_factory->create_alias_builder(GetMyEnumType(), "MyAliasEnum"); - m_MyAliasEnumType = myAliasEnum_builder->build(); - } - - return m_MyAliasEnumType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnum2Type() -{ - if (m_MyAliasEnum2Type.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum2_builder = m_factory->create_alias_builder( - GetMyAliasEnumType(), "MyAliasEnum2"); - m_MyAliasEnum2Type = myAliasEnum2_builder->build(); - } - - return m_MyAliasEnum2Type; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyAliasEnum3Type() -{ - if (m_MyAliasEnum3Type.get() == nullptr) - { - DynamicTypeBuilder_ptr myAliasEnum3_builder = m_factory->create_alias_builder( - GetMyAliasEnum2Type(), "MyAliasEnum3"); - m_MyAliasEnum3Type = myAliasEnum3_builder->build(); - } - - return m_MyAliasEnum3Type; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyOctetArray500Type() -{ - if (m_MyOctetArray500.get() == nullptr) - { - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr myOctetArray500_builder = m_factory->create_array_builder(octet_builder.get(), { 500 }); - myOctetArray500_builder->set_name("MyOctetArray500"); - m_MyOctetArray500 = myOctetArray500_builder->build(); - } - - return m_MyOctetArray500; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetBSAlias5Type() -{ - if (m_BSAlias5.get() == nullptr) - { - DynamicTypeBuilder_ptr bSAlias5_builder = m_factory->create_array_builder(GetBasicStructType(), { 5 }); - bSAlias5_builder->set_name("BSAlias5"); - m_BSAlias5 = bSAlias5_builder->build(); - } - - return m_BSAlias5; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMA3Type() -{ - if (m_MA3.get() == nullptr) - { - DynamicTypeBuilder_ptr mA3_builder = m_factory->create_array_builder(GetMyAliasEnum3Type(), { 42 }); - mA3_builder->set_name("MA3"); - m_MA3 = mA3_builder->build(); - } - - return m_MA3; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMyMiniArrayType() -{ - if (m_MyMiniArray.get() == nullptr) - { - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr myMiniArray_builder = m_factory->create_array_builder(int32_builder.get(), { 2 }); - myMiniArray_builder->set_name("MyMiniArray"); - m_MyMiniArray = myMiniArray_builder->build(); - } - - return m_MyMiniArray; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetMySequenceLongType() -{ - if (m_MySequenceLong.get() == nullptr) - { - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seqLong_builder = m_factory->create_sequence_builder(int32_builder.get()); - DynamicTypeBuilder_ptr mySequenceLong_builder = m_factory->create_alias_builder( - seqLong_builder.get(), "MySequenceLong"); - m_MySequenceLong = mySequenceLong_builder->build(); - } - - return m_MySequenceLong; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetBasicStructType() -{ - if (m_BasicStructType.get() == nullptr) - { - // Members - DynamicTypeBuilder_ptr bool_builder = m_factory->create_bool_builder(); - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - DynamicTypeBuilder_ptr uint16_builder = m_factory->create_uint16_builder(); - DynamicTypeBuilder_ptr uint32_builder = m_factory->create_uint32_builder(); - DynamicTypeBuilder_ptr uint64_builder = m_factory->create_uint64_builder(); - DynamicTypeBuilder_ptr float_builder = m_factory->create_float32_builder(); - DynamicTypeBuilder_ptr double_builder = m_factory->create_float64_builder(); - DynamicTypeBuilder_ptr ldouble_builder = m_factory->create_float128_builder(); - DynamicTypeBuilder_ptr char_builder = m_factory->create_char8_builder(); - //DynamicTypeBuilder_ptr wchar_builder = m_factory->create_char16_builder(); - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - //DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - DynamicTypeBuilder_ptr basicStruct_builder = m_factory->create_struct_builder(); - - // Add members to the struct. - int idx = 0; - basicStruct_builder->add_member(idx++, "my_bool", bool_builder.get()); - basicStruct_builder->add_member(idx++, "my_octet", octet_builder.get()); - basicStruct_builder->add_member(idx++, "my_int16", int16_builder.get()); - basicStruct_builder->add_member(idx++, "my_int32", int32_builder.get()); - basicStruct_builder->add_member(idx++, "my_int64", int64_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint16", uint16_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint32", uint32_builder.get()); - basicStruct_builder->add_member(idx++, "my_uint64", uint64_builder.get()); - basicStruct_builder->add_member(idx++, "my_float32", float_builder.get()); - basicStruct_builder->add_member(idx++, "my_float64", double_builder.get()); - basicStruct_builder->add_member(idx++, "my_float128", ldouble_builder.get()); - basicStruct_builder->add_member(idx++, "my_char", char_builder.get()); - //basicStruct_builder->add_member(idx++, "my_wchar", wchar_builder.get()); - basicStruct_builder->add_member(idx++, "my_string", string_builder.get()); - //basicStruct_builder->add_member(idx++, "my_wstring", wstring_builder.get()); - basicStruct_builder->set_name("BasicStruct"); - - m_BasicStructType = basicStruct_builder->build(); - } - - return m_BasicStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetComplexStructType() -{ - if (m_ComplexStructType.get() == nullptr) - { - // Members (auxiliar types are tab) - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr my_sequence_octet_builder = m_factory->create_sequence_builder(octet_builder.get(), 55); - DynamicTypeBuilder_ptr my_sequence_struct_builder = m_factory->create_sequence_builder(GetBasicStructType()); - DynamicTypeBuilder_ptr char_builder = m_factory->create_char8_builder(); - DynamicTypeBuilder_ptr byte_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr my_array_octet_builder = m_factory->create_array_builder( - byte_builder.get(), { 500, 5, 4 }); - // MyOctetArray500 is already created - // We reuse the bounds... { 5 } - DynamicTypeBuilder_ptr my_array_struct_builder = m_factory->create_array_builder(GetBasicStructType(), { 5 }); - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - DynamicTypeBuilder_ptr my_map_octet_short_builder = m_factory->create_map_builder( - octet_builder.get(), int16_builder.get()); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr my_map_long_struct_builder = m_factory->create_map_builder( - int32_builder.get()->build(), GetBasicStructType()); - DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - DynamicTypeBuilder_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get()); - DynamicTypeBuilder_ptr my_map_long_seq_octet_builder = m_factory->create_map_builder( - int32_builder.get(), seqSeqOctet_builder.get()); - DynamicTypeBuilder_ptr my_map_long_octet_array_500_builder = m_factory->create_map_builder( - int32_builder.get()->build(), GetMyOctetArray500Type()); - DynamicTypeBuilder_ptr map_octet_bsalias5_builder = m_factory->create_map_builder( - octet_builder.get()->build(), GetBSAlias5Type()); - DynamicTypeBuilder_ptr my_map_long_lol_type_builder = m_factory->create_map_builder( - int32_builder.get(), map_octet_bsalias5_builder.get()); - DynamicTypeBuilder_ptr my_small_string_8_builder = m_factory->create_string_builder(128); - //DynamicTypeBuilder_ptr my_small_string_16_builder = m_factory->create_wstring_builder(64); - DynamicTypeBuilder_ptr my_large_string_8_builder = m_factory->create_string_builder(500); - //DynamicTypeBuilder_ptr my_large_string_16_builder = m_factory->create_wstring_builder(1024); - DynamicTypeBuilder_ptr string75_8_builder = m_factory->create_string_builder(75); - DynamicTypeBuilder_ptr my_array_string_builder = m_factory->create_array_builder( - string75_8_builder.get(), { 5, 5 }); - - // MA3 is already defined. - // { 5 } being reused - DynamicTypeBuilder_ptr my_array_arrays_builder = m_factory->create_array_builder(GetMyMiniArrayType(), { 5 }); - DynamicTypeBuilder_ptr my_sequences_array_builder = m_factory->create_array_builder( - GetMySequenceLongType(), { 23 }); - DynamicTypeBuilder_ptr complexStruct_builder = m_factory->create_struct_builder(); - - // Add members to the struct. - int idx = 0; - complexStruct_builder->add_member(idx++, "my_octet", octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_basic_struct", GetBasicStructType()); - complexStruct_builder->add_member(idx++, "my_alias_enum", GetMyAliasEnumType()); - complexStruct_builder->add_member(idx++, "my_enum", GetMyEnumType()); - complexStruct_builder->add_member(idx++, "my_sequence_octet", my_sequence_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_sequence_struct", my_sequence_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_array_octet", my_array_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_octet_array_500", GetMyOctetArray500Type()); - complexStruct_builder->add_member(idx++, "my_array_struct", my_array_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_octet_short", my_map_octet_short_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_struct", my_map_long_struct_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_seq_octet", my_map_long_seq_octet_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_octet_array_500", - my_map_long_octet_array_500_builder.get()); - complexStruct_builder->add_member(idx++, "my_map_long_lol_type", my_map_long_lol_type_builder.get()); - complexStruct_builder->add_member(idx++, "my_small_string_8", my_small_string_8_builder.get()); - //complexStruct_builder->add_member(idx++, "my_small_string_16", my_small_string_16_builder.get()); - complexStruct_builder->add_member(idx++, "my_large_string_8", my_large_string_8_builder.get()); - //complexStruct_builder->add_member(idx++, "my_large_string_16", my_large_string_16_builder.get()); - complexStruct_builder->add_member(idx++, "my_array_string", my_array_string_builder.get()); - complexStruct_builder->add_member(idx++, "multi_alias_array_42", GetMA3Type()); - complexStruct_builder->add_member(idx++, "my_array_arrays", my_array_arrays_builder.get()); - complexStruct_builder->add_member(idx++, "my_sequences_array", my_sequences_array_builder.get()); - complexStruct_builder->set_name("ComplexStruct"); - m_ComplexStructType = complexStruct_builder->build(); - } - - return m_ComplexStructType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetUnionSwitchType() -{ - if (m_UnionSwitchType.get() == nullptr) - { - DynamicTypeBuilder_ptr myUnion_builder = m_factory->create_union_builder(GetMyEnumType()); - myUnion_builder->add_member(0, "basic", GetBasicStructType(), "A", { 0 }, false); - myUnion_builder->add_member(1, "complex", GetComplexStructType(), "B", { 1, 2 }, false); - myUnion_builder->set_name("MyUnion"); - m_UnionSwitchType = myUnion_builder->build(); - } - - return m_UnionSwitchType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetUnion2SwitchType() -{ - if (m_Union2SwitchType.get() == nullptr) - { - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - DynamicTypeBuilder_ptr myUnion2_builder = m_factory->create_union_builder(octet_builder.get()); - myUnion2_builder->add_member(0, "uno", int32_builder.get(), "0", { 0 }, false); - myUnion2_builder->add_member(1, "imString", string_builder.get(), "1", { 1 }, false); - myUnion2_builder->add_member(2, "tres", int32_builder.get(), "2", { 2 }, false); - myUnion2_builder->set_name("MyUnion2"); - m_Union2SwitchType = myUnion2_builder->build(); - } - - return m_Union2SwitchType; -} - -types::DynamicType_ptr DynamicComplexTypesTests::GetCompleteStructType() -{ - if (m_CompleteStructType.get() == nullptr) - { - DynamicTypeBuilder_ptr completeStruct_builder = m_factory->create_struct_builder(); - // Add members to the struct. - int idx = 0; - completeStruct_builder->add_member(idx++, "my_union", GetUnionSwitchType()); - completeStruct_builder->add_member(idx++, "my_union_2", GetUnion2SwitchType()); - completeStruct_builder->set_name("CompleteStruct"); - m_CompleteStructType = completeStruct_builder->build(); - } - - return m_CompleteStructType; -} - -void DynamicComplexTypesTests::init() -{ - const TypeIdentifier* id = TypeObjectFactory::get_instance()->get_type_identifier("CompleteStruct", true); - const TypeObject* obj = TypeObjectFactory::get_instance()->get_type_object(id); - m_DynAutoType = TypeObjectFactory::get_instance()->build_dynamic_type("CompleteStruct", id, obj); - - m_DynManualType = GetCompleteStructType(); -} - -TEST_F(DynamicComplexTypesTests, Static_Manual_Comparison) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynData2(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - ASSERT_TRUE(dynData2->equals(dynData.get())); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - - CompleteStruct staticData; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - SerializedPayload_t payload2(payloadSize2); - ASSERT_TRUE(m_StaticType.deserialize(&payload, &staticData)); - ASSERT_TRUE(m_StaticType.serialize(&staticData, &payload2)); - - ASSERT_TRUE(pubsubType.deserialize(&payload2, dynData2.get())); - ASSERT_TRUE(dynData2->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Manual_Auto_Comparision) -{ - types::DynamicData* dynAutoData = DynamicDataFactory::get_instance()->create_data(m_DynAutoType); - types::DynamicData* dynManualData = DynamicDataFactory::get_instance()->create_data(m_DynManualType); - - ASSERT_TRUE(dynManualData->equals(dynAutoData)); - - DynamicDataFactory::get_instance()->delete_data(dynAutoData); - DynamicDataFactory::get_instance()->delete_data(dynManualData); -} - -TEST_F(DynamicComplexTypesTests, Static_Auto_Comparision) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubtype(m_DynAutoType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - uint32_t payloadSize = static_cast(pubsubtype.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubtype.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payloadSize == payload.length); - - CompleteStruct staticData; - ASSERT_TRUE(m_StaticType.deserialize(&payload, &staticData)); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t payload2 = SerializedPayload_t(payloadSize2); - ASSERT_TRUE(m_StaticType.serialize(&staticData, &payload2)); - ASSERT_TRUE(payloadSize2 == payload2.length); - - types::DynamicData_ptr dynData2(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubtype.deserialize(&payload2, dynData2.get())); - - ASSERT_TRUE(dynData2->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Conversions_Test) -{ - TypeObject newObject; - DynamicTypeBuilderFactory::get_instance()->build_type_object(m_DynManualType, newObject, true); - - const TypeIdentifier* identifier = TypeObjectFactory::get_instance()->get_type_identifier( - m_DynManualType->get_name(), - true); - DynamicType_ptr newAutoType = TypeObjectFactory::get_instance()->build_dynamic_type(m_DynManualType->get_name(), - identifier, &newObject); - types::DynamicData* dynData = DynamicDataFactory::get_instance()->create_data(m_DynManualType); - types::DynamicData* dynData2 = DynamicDataFactory::get_instance()->create_data(newAutoType); - - ASSERT_TRUE(dynData2->equals(dynData)); - - DynamicDataFactory::get_instance()->delete_data(dynData); - DynamicDataFactory::get_instance()->delete_data(dynData2); -} - -TEST_F(DynamicComplexTypesTests, DynamicDiscoveryTest) -{ - TypeObject typeObject1, typeObject2, typeObject3; - DynamicTypeBuilder_ptr type1, type2, type3; - { - type1 = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); - //types::DynamicData_ptr data(DynamicDataFactory::get_instance()->create_data(type1)); - DynamicTypeBuilderFactory::get_instance()->build_type_object(type1->get_type_descriptor(), typeObject1); - } - { - type2 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - //types::DynamicData_ptr data2(DynamicDataFactory::get_instance()->create_data(type2)); - DynamicTypeBuilderFactory::get_instance()->build_type_object(type2->get_type_descriptor(), typeObject2); - } - - { - type3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - //types::DynamicData_ptr data2(DynamicDataFactory::get_instance()->create_data(type3)); - DynamicTypeBuilderFactory::get_instance()->build_type_object(type3->get_type_descriptor(), typeObject3); - } - - const TypeIdentifier* identifier1 = TypeObjectFactory::get_instance()->get_type_identifier(type1->get_name()); - const TypeIdentifier* identifier2 = TypeObjectFactory::get_instance()->get_type_identifier(type2->get_name()); - const TypeIdentifier* identifier3 = TypeObjectFactory::get_instance()->get_type_identifier(type3->get_name()); - ASSERT_FALSE(*identifier1 == *identifier2); - ASSERT_FALSE(*identifier1 == *identifier3); - ASSERT_TRUE(*identifier2 == *identifier3); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_A) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - //staticData.my_union_2()._d(A); - staticData.my_union_2().uno(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("uno")); - - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_B) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union_2().imString("JuanCarlosArcereredekljnjkds"); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_string_value("JuanCarlosArcereredekljnjkds", my_union_2->get_member_id_by_name("imString")); - - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_A_C) -{ - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - - CompleteStruct staticData; - staticData.my_union()._d(A); - staticData.my_union().basic().my_bool(true); - staticData.my_union().basic().my_octet(166); - staticData.my_union().basic().my_int16(-10401); - staticData.my_union().basic().my_int32(5884001); - staticData.my_union().basic().my_int64(884481567); - staticData.my_union().basic().my_uint16(250); - staticData.my_union().basic().my_uint32(15884); - staticData.my_union().basic().my_uint64(765241); - staticData.my_union().basic().my_float32(158.55f); - staticData.my_union().basic().my_float64(765241.58); - staticData.my_union().basic().my_float128(765241878.154874); - staticData.my_union().basic().my_char('L'); - //staticData.my_union().basic().my_wchar(L'G'); - staticData.my_union().basic().my_string("Luis@eProsima"); - //staticData.my_union().basic().my_wstring(L"LuisGasco@eProsima"); - - //staticData.my_union_2()._d(A); - staticData.my_union_2().tres(333); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - DynamicData* basic = my_union->loan_value(my_union->get_member_id_by_name("basic")); - - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - - my_union->return_loaned_value(basic); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(333, my_union_2->get_member_id_by_name("tres")); - - dynData->return_loaned_value(my_union_2); - - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - ASSERT_TRUE(payloadSize == payloadSize2); - - CompleteStructPubSubType pbComplete; - ASSERT_TRUE(pbComplete.serialize(&staticData, &payload)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynData.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_A) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(C); - staticData.my_union().complex().my_enum(B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({1, 2, 3, 4, 5}); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({1, 2, 3, 4, 5}); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({1, 2, 3, 4, 5}); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - staticData.my_union_2()._d(A); - staticData.my_union_2().uno(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - // TODO De la muerte para Juan Carlos - Esto no es NADA prΓ‘ctico... - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - // "my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("uno")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < payload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < payload.length) - { - if ((int)payload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)payload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < stPayload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < stPayload.length) - { - if ((int)stPayload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)stPayload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_B) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(C); - staticData.my_union().complex().my_enum(B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({ 1, 2, 3, 4, 5 }); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - //staticData.my_union_2()._d() = B; - staticData.my_union_2().imString("GASCO!"); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - // TODO De la muerte para Juan Carlos - Esto no es NADA prΓ‘ctico... - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - //"my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_string_value("GASCO!", my_union_2->get_member_id_by_name("imString")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_B_C) -{ - types::DynamicData_ptr dynData(DynamicDataFactory::get_instance()->create_data(m_DynManualType)); - - CompleteStruct staticData; - staticData.my_union()._d() = B; - staticData.my_union().complex().my_octet(66); - staticData.my_union().complex().my_basic_struct().my_bool(true); - staticData.my_union().complex().my_basic_struct().my_octet(166); - staticData.my_union().complex().my_basic_struct().my_int16(-10401); - staticData.my_union().complex().my_basic_struct().my_int32(5884001); - staticData.my_union().complex().my_basic_struct().my_int64(884481567); - staticData.my_union().complex().my_basic_struct().my_uint16(250); - staticData.my_union().complex().my_basic_struct().my_uint32(15884); - staticData.my_union().complex().my_basic_struct().my_uint64(765241); - staticData.my_union().complex().my_basic_struct().my_float32(158.55f); - staticData.my_union().complex().my_basic_struct().my_float64(765241.58); - staticData.my_union().complex().my_basic_struct().my_float128(765241878.154874); - staticData.my_union().complex().my_basic_struct().my_char('L'); - //staticData.my_union().complex().my_basic_struct().my_wchar(L'G'); - staticData.my_union().complex().my_basic_struct().my_string("Luis@eProsima"); - //staticData.my_union().complex().my_basic_struct().my_wstring(L"LuisGasco@eProsima"); - - staticData.my_union().complex().my_alias_enum(C); - staticData.my_union().complex().my_enum(B); - staticData.my_union().complex().my_sequence_octet().push_back(88); - staticData.my_union().complex().my_sequence_octet().push_back(99); - staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - for (int i = 0; i < 500; ++i) - { - for (int j = 0; j < 5; ++j) - { - for (int k = 0; k < 4; ++k) - { - staticData.my_union().complex().my_array_octet()[i][j][k] = static_cast(j * k); - } - } - } - - for (int i = 0; i < 5; ++i) - { - staticData.my_union().complex().my_array_struct()[i].my_bool(i % 2 == 1); - staticData.my_union().complex().my_array_struct()[i].my_octet(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_int16(static_cast(-i)); - staticData.my_union().complex().my_array_struct()[i].my_int32(i); - staticData.my_union().complex().my_array_struct()[i].my_int64(i * 1000); - staticData.my_union().complex().my_array_struct()[i].my_uint16(static_cast(i)); - staticData.my_union().complex().my_array_struct()[i].my_uint32(i); - staticData.my_union().complex().my_array_struct()[i].my_uint64(i * 10005); - staticData.my_union().complex().my_array_struct()[i].my_float32(i * 5.5f); - staticData.my_union().complex().my_array_struct()[i].my_float64(i * 8.8); - staticData.my_union().complex().my_array_struct()[i].my_float128(i * 10.0); - staticData.my_union().complex().my_array_struct()[i].my_char('J'); - //staticData.my_union().complex().my_array_struct()[i].my_wchar(L'C'); - staticData.my_union().complex().my_array_struct()[i].my_string("JC@eProsima"); - //staticData.my_union().complex().my_array_struct()[i].my_wstring(L"JC-BOOM-Armadilo!@eProsima"); - } - - staticData.my_union().complex().my_map_octet_short()[0] = 1340; - staticData.my_union().complex().my_map_octet_short()[1] = 1341; - staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[55].push_back({ 1, 2, 3, 4, 5 }); - staticData.my_union().complex().my_map_long_seq_octet()[0].push_back({ 1, 2, 3, 4, 5 }); - for (int i = 0; i < 500; ++i) - { - staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i % 256; - staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i + 55) % 256; - } - - staticData.my_union().complex().my_small_string_8( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd"); - //staticData.my_union().complex().my_small_string_16( - // L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c"); - staticData.my_union().complex().my_large_string_8( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1"); - //staticData.my_union().complex().my_large_string_16( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX"); - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 5; ++j) - { - staticData.my_union().complex().my_array_string()[i][j] = - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"; - } - } - for (int i = 0; i < 42; ++i) - { - staticData.my_union().complex().multi_alias_array_42()[i] = (MyEnum)(i % 3); - } - - for (int i = 0; i < 5; ++i) - { - for (int j = 0; j < 2; ++j) - { - staticData.my_union().complex().my_array_arrays()[i][j] = i * j; - } - } - - for (int i = 0; i < 23; ++i) - { - staticData.my_union().complex().my_sequences_array()[i].push_back(i); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 10); - staticData.my_union().complex().my_sequences_array()[i].push_back(i * 100); - } - staticData.my_union_2().tres(156); - - DynamicData* my_union = dynData->loan_value(dynData->get_member_id_by_name("my_union")); - - DynamicData* complex = my_union->loan_value(my_union->get_member_id_by_name("complex")); - complex->set_byte_value(66, complex->get_member_id_by_name("my_octet")); - - DynamicData* basic = complex->loan_value(complex->get_member_id_by_name("my_basic_struct")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - complex->return_loaned_value(basic); - - complex->set_enum_value("C", complex->get_member_id_by_name("my_alias_enum")); - complex->set_enum_value("B", complex->get_member_id_by_name("my_enum")); - - DynamicData* my_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_sequence_octet")); - MemberId id; - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(88, id); - my_seq_octet->insert_sequence_data(id); - my_seq_octet->set_byte_value(99, id); - //staticData.my_union().complex().my_sequence_octet().push_back(88); - //staticData.my_union().complex().my_sequence_octet().push_back(99); - complex->return_loaned_value(my_seq_octet); - - DynamicData* my_seq_struct = complex->loan_value(complex->get_member_id_by_name("my_sequence_struct")); - my_seq_struct->insert_sequence_data(id); - my_seq_struct->set_complex_value(DynamicDataFactory::get_instance()->create_copy(basic), id); - //staticData.my_union().complex().my_sequence_struct().push_back(staticData.my_union().complex().my_basic_struct()); - complex->return_loaned_value(my_seq_struct); - - DynamicData* my_array_octet = complex->loan_value(complex->get_member_id_by_name("my_array_octet")); - for (unsigned int i = 0; i < 500; ++i) - { - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 4; ++k) - { - MemberId array_idx = my_array_octet->get_array_index({ i, j, k }); - my_array_octet->set_byte_value(static_cast(j * k), array_idx); - } - } - //staticData.my_union().complex().my_array_octet()[i][j][k] = j*k; - } - complex->return_loaned_value(my_array_octet); - - DynamicData* my_array_struct = complex->loan_value(complex->get_member_id_by_name("my_array_struct")); - for (int i = 0; i < 5; ++i) - { - DynamicData* tempBasic = DynamicDataFactory::get_instance()->create_data(GetBasicStructType()); - tempBasic->set_bool_value(i % 2 == 1, tempBasic->get_member_id_by_name("my_bool")); - tempBasic->set_byte_value(static_cast(i), tempBasic->get_member_id_by_name("my_octet")); - tempBasic->set_int16_value(static_cast(-i), tempBasic->get_member_id_by_name("my_int16")); - tempBasic->set_int32_value(i, tempBasic->get_member_id_by_name("my_int32")); - tempBasic->set_int64_value(i * 1000, tempBasic->get_member_id_by_name("my_int64")); - tempBasic->set_uint16_value(static_cast(i), tempBasic->get_member_id_by_name("my_uint16")); - tempBasic->set_uint32_value(i, tempBasic->get_member_id_by_name("my_uint32")); - tempBasic->set_uint64_value(i * 10005, tempBasic->get_member_id_by_name("my_uint64")); - tempBasic->set_float32_value(i * 5.5f, tempBasic->get_member_id_by_name("my_float32")); - tempBasic->set_float64_value(i * 8.8, tempBasic->get_member_id_by_name("my_float64")); - tempBasic->set_float128_value(i * 10.0, tempBasic->get_member_id_by_name("my_float128")); - tempBasic->set_char8_value('J', tempBasic->get_member_id_by_name("my_char")); - //tempBasic->set_char16_value(L'C', tempBasic->get_member_id_by_name("my_wchar")); - tempBasic->set_string_value("JC@eProsima", tempBasic->get_member_id_by_name("my_string")); - //tempBasic->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", tempBasic->get_member_id_by_name("my_wstring")); - my_array_struct->set_complex_value(tempBasic, i); - } - complex->return_loaned_value(my_array_struct); - - DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - DynamicData_ptr key_oct(DynamicDataFactory::get_instance()->create_data(octet_builder->build())); - MemberId kId; - MemberId vId; - MemberId ssId; - MemberId sId; - DynamicData* my_map_octet_short = complex->loan_value(complex->get_member_id_by_name("my_map_octet_short")); - key_oct->set_byte_value(0); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1340, vId); - key_oct = DynamicDataFactory::get_instance()->create_data(octet_builder->build()); - key_oct->set_byte_value(1); - my_map_octet_short->insert_map_data(key_oct.get(), kId, vId); - my_map_octet_short->set_int16_value((short)1341, vId); - //staticData.my_union().complex().my_map_octet_short()[0] = 1340; - //staticData.my_union().complex().my_map_octet_short()[1] = 1341; - complex->return_loaned_value(my_map_octet_short); - - DynamicTypeBuilder_ptr long_builder = m_factory->create_int32_builder(); - DynamicData_ptr key(DynamicDataFactory::get_instance()->create_data(long_builder->build())); - DynamicData* my_map_long_struct = complex->loan_value(complex->get_member_id_by_name("my_map_long_struct")); - - //DynamicData *mas3 = my_array_struct->loan_value(3); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - basic = my_map_long_struct->loan_value(vId); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(166, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-10401, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(5884001, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(884481567, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(250, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(15884, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(765241, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(158.55f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(765241.58, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(765241878.154874, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('L', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'G', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("Luis@eProsima", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L"LuisGasco@eProsima", basic->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(basic); - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(1000); - my_map_long_struct->insert_map_data(key.get(), kId, vId); - DynamicData* mas3 = my_map_long_struct->loan_value(vId); - int i = 3; - mas3->set_bool_value(i % 2 == 1, mas3->get_member_id_by_name("my_bool")); - mas3->set_byte_value(static_cast(i), mas3->get_member_id_by_name("my_octet")); - mas3->set_int16_value(static_cast(-i), mas3->get_member_id_by_name("my_int16")); - mas3->set_int32_value(i, mas3->get_member_id_by_name("my_int32")); - mas3->set_int64_value(i * 1000, mas3->get_member_id_by_name("my_int64")); - mas3->set_uint16_value(static_cast(i), mas3->get_member_id_by_name("my_uint16")); - mas3->set_uint32_value(i, mas3->get_member_id_by_name("my_uint32")); - mas3->set_uint64_value(i * 10005, mas3->get_member_id_by_name("my_uint64")); - mas3->set_float32_value(i * 5.5f, mas3->get_member_id_by_name("my_float32")); - mas3->set_float64_value(i * 8.8, mas3->get_member_id_by_name("my_float64")); - mas3->set_float128_value(i * 10.0, mas3->get_member_id_by_name("my_float128")); - mas3->set_char8_value('J', mas3->get_member_id_by_name("my_char")); - //mas3->set_char16_value(L'C', mas3->get_member_id_by_name("my_wchar")); - mas3->set_string_value("JC@eProsima", mas3->get_member_id_by_name("my_string")); - //mas3->set_wstring_value(L"JC-BOOM-Armadilo!@eProsima", mas3->get_member_id_by_name("my_wstring")); - my_map_long_struct->return_loaned_value(mas3); - - // staticData.my_union().complex().my_map_long_struct()[1000] = staticData.my_union().complex().my_array_struct()[3]; - // staticData.my_union().complex().my_map_long_struct()[55] = staticData.my_union().complex().my_basic_struct(); - complex->return_loaned_value(my_map_long_struct); - - DynamicData* my_map_long_seq_octet = complex->loan_value(complex->get_member_id_by_name("my_map_long_seq_octet")); - //std::vector my_vector_octet = {1, 2, 3, 4, 5}; - //MemberId id; - /*DynamicTypeBuilder_ptr octet_builder = m_factory->create_byte_builder(); - types::DynamicTypeBuilder_ptr seqOctet_builder = m_factory->create_sequence_builder(octet_builder.get()); - types::DynamicType_ptr seqSeqOctet_builder = m_factory->create_sequence_builder(seqOctet_builder.get())->build(); - DynamicData *dataSeqOctet = seqOctet_builder->build(); - DynamicData *dataSeqSeqOctet = seqSeqOctet_builder->build(); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(1, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(2, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(3, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(4, id); - dataSeqOctet->insert_sequence_data(id); - dataSeqOctet->set_byte_value(5, id); - dataSeqSeqOctet->insert_sequence_data(id); - dataSeqSeqOctet->set_complex_value(dataSeqOctet, id);*/ - // insert_map_data(DynamicData_ptr key, MemberId& outKeyId, MemberId& outValueId); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - DynamicData* seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - DynamicData* seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(55); - my_map_long_seq_octet->insert_map_data(key.get(), kId, vId); - - seq_seq_oct = my_map_long_seq_octet->loan_value(vId); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - seq_seq_oct->insert_sequence_data(ssId); - seq_oct = seq_seq_oct->loan_value(ssId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(1, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(2, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(3, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(4, sId); - seq_oct->insert_sequence_data(sId); - seq_oct->set_byte_value(5, sId); - seq_seq_oct->return_loaned_value(seq_oct); - my_map_long_seq_octet->return_loaned_value(seq_seq_oct); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[55].push_back(my_vector_octet); - //staticData.my_union().complex().my_map_long_seq_octet()[0].push_back(my_vector_octet); - complex->return_loaned_value(my_map_long_seq_octet); - - DynamicData* my_map_long_octet_array_500 = - complex->loan_value(complex->get_member_id_by_name("my_map_long_octet_array_500")); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(0); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - - DynamicData* oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value(j % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[0][i] = i%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - - key = DynamicDataFactory::get_instance()->create_data(long_builder->build()); - key->set_int32_value(10); - my_map_long_octet_array_500->insert_map_data(key.get(), kId, vId); - oct_array_500 = my_map_long_octet_array_500->loan_value(vId); - - for (int j = 0; j < 500; ++j) - { - oct_array_500->set_byte_value((j + 55) % 256, j); - //staticData.my_union().complex().my_map_long_octet_array_500()[10][i] = (i+55)%256; - } - my_map_long_octet_array_500->return_loaned_value(oct_array_500); - complex->return_loaned_value(my_map_long_octet_array_500); - - complex->set_string_value( - "Bv7EMffURwGNqePoujdSfkF9PXN9TH125X5nGpNLfzya53tZtNJdgMROlYdZnTE1SLWzBdIU7ZyjjGvsGHkmuJUROwVPcNa9q5dRUV3KZAKNx1exL7BjhqIgQFconhd", complex->get_member_id_by_name( - "my_small_string_8")); - //complex->set_wstring_value(L"AgzΓ±gXsI9pXbWjYLDvvn8JUFWhxZhk9t92rdsTqylvdpqtXA6hy9dHkoBTgmF2c", complex->get_member_id_by_name( - // "my_small_string_16")); - complex->set_string_value( - "hYE5vjcLJe6ML5DmoqQwh9ns866dAbnjkVKIKu2VF6lbkvh91ZOG2enEcdoRa8T43hR0Ym0k7tI621EQGufvzmLqxKCPgiXSp2zUTTmIWtn4fM8tC3aP1Yd0dKvn0tDobyp6p3156KvxqG3BKQ6VjFiHlMFoEyz8pjCclhXLl2cfAi97sQzXLUoPYUC5BWKyQTrA2JF6HXZM6vrbw5dc3B4AOJNGdPJ9ai6weF43h1RhnXE9MOFxPNoQnJ8gqSXYbMtpG6ZzqhUyoz0XhFDt7EOqXIgvc9SCejQTVMPeRcF5Zy57hrYZiKrCQqFWidS4BdfEAkuwESgBmEpEFOpZotwDt0TGDaLktSt3dKRsURO6TpuZ2nZNdiEJyc597ZjjQXtyKU7OCyRRqllzAnHEtoU3zd3OLTOvT5uk32N1Y64tpUte63De2EMwDNYb2eGAQfATdSt8VcGBOzJQjsmrMwMumtk48JzXXLxjo6s2vl2rNK9WQM1", complex->get_member_id_by_name( - "my_large_string_8")); - //complex->set_wstring_value( - // L"nosYBfFr1s3t8rUsuUrVCWFi6moDk7GULFj6XnkebIDkjl3n2ykKxUIaLj3qNNUx0ny8DvFbdfxZBdMhBNW3fHbKrig4GkHnN1JoEo0ACiPxrARusDs3xKzvaQQrls6lVUFAUXzDOtw5f2CNVJKiruGjXUO2Lq5Mmy8ygW3eUiTlueAHA2dRXXryOFi47jS3DkmBH4aAOKcmR27KhhJnXaY0gWy3XdSnaGQNB3XvbmxQ7xXDsf1wz860WMEKP3VhdOLsmS6tKCb4sshuOlmUSyTggY7vNoxfpG1EUFP5iPro9E0tHLLdHlWf2NwU8OXCYx6KKEbs5pFMvgEstnQglsdTk0lOv6riaFkFOwx83gW1l6Pg4eXjacnJKoVh1pOeZxULLZpCECw8yRZ9z4JPHxh2C7ytkCHMKp9O4MwQwYvvvgWWLWfJgb7Ecy2tgvWLpNDzgkFrEFhaCTKitChlG422CnLSsXvTBNnF52sULH6rcwOVx3mbhqte3ld3fObtAuH3zPzjOF4vVbvUXxgZh1Zx1cey0iGfnhOZHUfUwJ3Qv0WZNcuVLvMMhhg85A3620b84MAIc2UoW9Hl4BIT7pHo41ApF0DxIPJL0QdIdAOjn0JTPZqAhoHVBQoYvivPHftk5Crd1a1J8L7hSs0s4uSQKAMTKDxy3gKLaGAg277h4iEsEZRCI4RPlPTo9nZ48s8OO2KzqrUbMkoPSTgaJEXq8GsozAzh0wtL4P3gPeHO5nQzoytoXAkiXoPph0GaTLiahYQksYeK1eVQADDqZPXC55teXKKdX4aomCufr1ZizgzkGwAmnsFmhmBSF0gvbm56NDaUVT0UqXxKxAfRjkILeWR1mW8jfn6RYJH3IWiHxEfyB23rr78NySfgzIchhrm7jEFtmwPpKPKAwzajLv0HpkrtTr38YwWeT5LzHokFAQEc6l3aWdJWapVyt9wX89dEkmPPG9torCV2ddjyF4jAKsxKvzU4pCxV6B3m16IIdnksemJ0xG8iKh4ZPsX", complex->get_member_id_by_name( - // "my_large_string_16")); - - DynamicData* my_array_string = complex->loan_value(complex->get_member_id_by_name("my_array_string")); - for (unsigned int j = 0; j < 5; ++j) - { - for (unsigned int k = 0; k < 5; ++k) - { - MemberId array_idx = my_array_string->get_array_index({ j, k }); - my_array_string->set_string_value( - "Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42", array_idx); - //staticData.my_union().complex().my_array_string()[i][j]("Ee4rH8nSX1xnWrlDqDJjKWtWntMia9RrZqZPznr0yIDjeroWxUUzpPVV8UK4qUF4eilYR3Dz42"); - } - } - complex->return_loaned_value(my_array_string); - - DynamicData* multi_alias_array_42 = complex->loan_value(complex->get_member_id_by_name("multi_alias_array_42")); - for (int j = 0; j < 42; ++j) - { - multi_alias_array_42->set_enum_value(j % 3, j); - //staticData.my_union().complex().multi_alias_array_42()[i](i%3); - } - complex->return_loaned_value(multi_alias_array_42); - - DynamicData* my_array_arrays = complex->loan_value(complex->get_member_id_by_name("my_array_arrays")); - for (unsigned int j = 0; j < 5; ++j) - { - DynamicData* myMiniArray = my_array_arrays->loan_value(j); - for (unsigned int k = 0; k < 2; ++k) - { - myMiniArray->set_int32_value(j * k, k); - //staticData.my_union().complex().my_array_arrays()[i][j](i*j); - } - my_array_arrays->return_loaned_value(myMiniArray); - } - complex->return_loaned_value(my_array_arrays); - - DynamicData* my_sequences_array = complex->loan_value(complex->get_member_id_by_name("my_sequences_array")); - for (int j = 0; j < 23; ++j) - { - DynamicData* seq = DynamicDataFactory::get_instance()->create_data(GetMySequenceLongType()); - seq->insert_sequence_data(id); - seq->set_int32_value(j, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 10, id); - seq->insert_sequence_data(id); - seq->set_int32_value(j * 100, id); - my_sequences_array->set_complex_value(seq, j); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*10); - // staticData.my_union().complex().my_sequences_array()[i].push_back(i*100); - } - complex->return_loaned_value(my_sequences_array); - - my_union->return_loaned_value(complex); - dynData->return_loaned_value(my_union); - - DynamicData* my_union_2 = dynData->loan_value(dynData->get_member_id_by_name("my_union_2")); - my_union_2->set_int32_value(156, my_union_2->get_member_id_by_name("tres")); - - dynData->return_loaned_value(my_union_2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(m_DynManualType); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(dynData.get())()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(dynData.get(), &payload)); - ASSERT_TRUE(payload.length == payloadSize); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < payload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < payload.length) - { - if ((int)payload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)payload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - CompleteStructPubSubType pbComplete; - uint32_t payloadSize2 = static_cast(m_StaticType.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize2); - ASSERT_TRUE(pbComplete.serialize(&staticData, &stPayload)); - ASSERT_TRUE(stPayload.length == payloadSize2); - /* - std::cout << "BEGIN" << std::endl; - for (uint32_t j = 0; j < stPayload.length; j += 100) - { - std::cout << std::endl; - for (uint32_t k = 0; k < 100; k++) - { - if (j + k < stPayload.length) - { - if ((int)stPayload.data[j + k] == 204) - { - std::cout << 0 << " "; - } - else - { - std::cout << (int)stPayload.data[j + k] << " "; - } - } - } - } - std::cout << "END" << std::endl; - */ - types::DynamicData_ptr dynDataFromDynamic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&payload, dynDataFromDynamic.get())); - - types::DynamicData_ptr dynDataFromStatic(DynamicDataFactory::get_instance()->create_data(m_DynAutoType)); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic.get())); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic.get())); -} - -TEST_F(DynamicComplexTypesTests, Data_Comparison_with_Keys) -{ - KeyedStruct staticData; - - staticData.basic().my_bool(true); - staticData.basic().my_octet(100); - staticData.basic().my_int16(-12000); - staticData.basic().my_int32(-12000000); - staticData.basic().my_int64(-1200000000); - staticData.basic().my_uint16(12000); - staticData.basic().my_uint32(12000000); - staticData.basic().my_uint64(1200000000); - staticData.basic().my_float32(5.5f); - staticData.basic().my_float64(8.888); - staticData.basic().my_float128(1005.1005); - staticData.basic().my_char('O'); - //staticData.basic().my_wchar(L'M'); - staticData.basic().my_string("G It's"); - //staticData.basic().my_wstring(L" Working"); - //staticData.key(88); - - DynamicData* dynData = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - DynamicData* basic = dynData->loan_value(dynData->get_member_id_by_name("basic")); - basic->set_bool_value(true, basic->get_member_id_by_name("my_bool")); - basic->set_byte_value(100, basic->get_member_id_by_name("my_octet")); - basic->set_int16_value(-12000, basic->get_member_id_by_name("my_int16")); - basic->set_int32_value(-12000000, basic->get_member_id_by_name("my_int32")); - basic->set_int64_value(-1200000000, basic->get_member_id_by_name("my_int64")); - basic->set_uint16_value(12000, basic->get_member_id_by_name("my_uint16")); - basic->set_uint32_value(12000000, basic->get_member_id_by_name("my_uint32")); - basic->set_uint64_value(1200000000, basic->get_member_id_by_name("my_uint64")); - basic->set_float32_value(5.5f, basic->get_member_id_by_name("my_float32")); - basic->set_float64_value(8.888, basic->get_member_id_by_name("my_float64")); - basic->set_float128_value(1005.1005, basic->get_member_id_by_name("my_float128")); - basic->set_char8_value('O', basic->get_member_id_by_name("my_char")); - //basic->set_char16_value(L'M', basic->get_member_id_by_name("my_wchar")); - basic->set_string_value("G It's", basic->get_member_id_by_name("my_string")); - //basic->set_wstring_value(L" Working", basic->get_member_id_by_name("my_wstring")); - dynData->return_loaned_value(basic); - //dynData->set_byte_value(88, dynData->get_member_id_by_name("key")); - - KeyedStructPubSubType pbKeyed; - DynamicPubSubType pubsubType(GetKeyedStructType()); - uint32_t payloadSize = static_cast(pbKeyed.getSerializedSizeProvider(&staticData)()); - SerializedPayload_t stPayload(payloadSize); - ASSERT_TRUE(pbKeyed.serialize(&staticData, &stPayload)); - ASSERT_TRUE(payloadSize == stPayload.length); - - DynamicPubSubType dynPubSub; - uint32_t payloadSize2 = static_cast(dynPubSub.getSerializedSizeProvider(dynData)()); - SerializedPayload_t dynPayload(payloadSize2); - ASSERT_TRUE(dynPubSub.serialize(dynData, &dynPayload)); - ASSERT_TRUE(payloadSize2 == dynPayload.length); - - types::DynamicData* dynDataFromStatic = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - ASSERT_TRUE(pubsubType.deserialize(&stPayload, dynDataFromStatic)); - - types::DynamicData* dynDataFromDynamic = DynamicDataFactory::get_instance()->create_data(GetKeyedStructType()); - ASSERT_TRUE(dynPubSub.deserialize(&dynPayload, dynDataFromDynamic)); - - ASSERT_TRUE(dynDataFromStatic->equals(dynDataFromDynamic)); - - DynamicDataFactory::get_instance()->delete_data(dynData); - DynamicDataFactory::get_instance()->delete_data(dynDataFromStatic); - DynamicDataFactory::get_instance()->delete_data(dynDataFromDynamic); -} - -TEST_F(DynamicComplexTypesTests, TypeInformation) -{ - const TypeObject* compl_obj = TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", true); - const TypeInformation* info = TypeObjectFactory::get_instance()->get_type_information("CompleteStruct"); - ASSERT_FALSE(info->minimal().typeid_with_size().type_id() == info->complete().typeid_with_size().type_id()); - ASSERT_TRUE(info->complete().typeid_with_size().type_id()._d() == EK_COMPLETE); - ASSERT_TRUE(info->complete().dependent_typeid_count() == 2); - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - ASSERT_TRUE(info->complete().typeid_with_size().typeobject_serialized_size() - == calculator.calculate_serialized_size(*compl_obj, current_alignment)); - const TypeInformation* enum_info = TypeObjectFactory::get_instance()->get_type_information("MyAliasEnum"); - ASSERT_TRUE(enum_info->minimal().typeid_with_size().type_id()._d() == EK_MINIMAL); - const TypeInformation* bool_info = TypeObjectFactory::get_instance()->get_type_information("bool"); - ASSERT_TRUE(bool_info->minimal().typeid_with_size().type_id()._d() == TK_BOOLEAN); - ASSERT_TRUE(bool_info->minimal().typeid_with_size().typeobject_serialized_size() == 0); - - const TypeObject* key_obj = TypeObjectFactory::get_instance()->get_type_object("key"); - ASSERT_EQ(key_obj->minimal()._d(), TK_ANNOTATION); - key_obj = TypeObjectFactory::get_instance()->get_type_object("Key"); - ASSERT_EQ(key_obj->minimal()._d(), TK_ANNOTATION); -} - -int main( - int argc, - char** argv) -{ - eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/dynamic_types/DynamicTypesTests.cpp b/test/unittest/dynamic_types/DynamicTypesTests.cpp deleted file mode 100644 index b4e3e097199..00000000000 --- a/test/unittest/dynamic_types/DynamicTypesTests.cpp +++ /dev/null @@ -1,5106 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "idl/BasicPubSubTypes.h" -#include "idl/BasicTypeObject.h" -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; - -class DynamicTypesTests : public ::testing::Test -{ - const std::string config_file_ = "types_profile.xml"; - -public: - - DynamicTypesTests() - { - } - - ~DynamicTypesTests() - { - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - } - - const std::string& config_file() - { - return config_file_; - } - -}; - -TEST_F(DynamicTypesTests, TypeDescriptors_unit_tests) -{ - // Given - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.set_kind(TK_INT32); - pInt32Descriptor.set_name("TEST_INT32"); - TypeDescriptor pInt32Descriptor2; - - // Then - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); - ASSERT_FALSE(pInt32Descriptor2.copy_from(nullptr) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(pInt32Descriptor2.copy_from(&pInt32Descriptor) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_name("TEST_2"); - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_name(pInt32Descriptor.get_name()); - ASSERT_TRUE(pInt32Descriptor.equals(&pInt32Descriptor2)); - pInt32Descriptor2.set_kind(TK_NONE); - ASSERT_FALSE(pInt32Descriptor.equals(&pInt32Descriptor2)); -} - -TEST_F(DynamicTypesTests, DynamicType_basic_unit_tests) -{ - // Create basic types - DynamicTypeBuilder_ptr int32_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(int32_builder != nullptr); - ASSERT_FALSE(int32_builder == nullptr); - DynamicType_ptr int32_type = DynamicTypeBuilderFactory::get_instance()->create_type(int32_builder.get()); - ASSERT_TRUE(int32_type != nullptr); - ASSERT_FALSE(int32_type == nullptr); - DynamicType_ptr type2 = DynamicTypeBuilderFactory::get_instance()->create_type(int32_builder.get()); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type2->equals(int32_type.get())); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", int32_type) == ReturnCode_t::RETCODE_OK); - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", - DynamicTypeBuilderFactory::get_instance()->create_int64_type()) == ReturnCode_t::RETCODE_OK); - auto struct_type2 = struct_type_builder->build(); - ASSERT_TRUE(struct_type2 != nullptr); - ASSERT_FALSE(struct_type->equals(struct_type2.get())); -} - -TEST_F(DynamicTypesTests, DynamicTypeBuilderFactory_unit_tests) -{ - // Try to create with invalid values - ASSERT_FALSE(DynamicTypeBuilderFactory::get_instance()->create_custom_builder(nullptr)); - { - // Create basic types - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - DynamicType_ptr type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - DynamicType_ptr type3 = DynamicTypeBuilderFactory::get_instance()->create_int32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - auto data = DynamicDataFactory::get_instance()->create_data(created_builder.get()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - - auto data2 = DynamicDataFactory::get_instance()->create_data(type); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_int16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_int64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_uint64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float32_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float64_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_float128_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_char8_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_char16_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_byte_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_bool_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = - DynamicTypeBuilderFactory::get_instance()->create_string_builder(BOUND_UNLIMITED); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_string_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(BOUND_UNLIMITED); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - type3 = DynamicTypeBuilderFactory::get_instance()->create_wstring_type(); - ASSERT_TRUE(type3 != nullptr); - ASSERT_TRUE(type->equals(type3.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - // Create with custom types - TypeDescriptor pInt32Descriptor; - pInt32Descriptor.set_kind(TK_INT32); - pInt32Descriptor.set_name("TEST_INT32"); - created_builder = DynamicTypeBuilderFactory::get_instance()->create_custom_builder(&pInt32Descriptor); - ASSERT_TRUE(created_builder != nullptr); - type = created_builder->build(); - ASSERT_TRUE(type != nullptr); - type2 = created_builder->build(); - ASSERT_TRUE(type2 != nullptr); - ASSERT_TRUE(type->equals(type2.get())); - data = DynamicDataFactory::get_instance()->create_data(type); - data2 = DynamicDataFactory::get_instance()->create_copy(data); - ASSERT_TRUE(data2->equals(data)); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int32_t test1 = 123; - int32_t test2 = 0; - ASSERT_TRUE(data->set_int32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - //ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - //int32_t iTest32; - //ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongStruct wlong; - LongStructPubSubType wlongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlongpb.deserialize(&dynamic_payload, &wlong)); - - uint32_t static_payloadSize = static_cast(wlongpb.getSerializedSizeProvider(&wlong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlongpb.serialize(&wlong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint32_t test1 = 123; - uint32_t test2 = 0; - ASSERT_TRUE(data->set_uint32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //uint32_t uTest32; - //ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ULongStruct wlong; - ULongStructPubSubType wlongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlongpb.deserialize(&dynamic_payload, &wlong)); - - uint32_t static_payloadSize = static_cast(wlongpb.getSerializedSizeProvider(&wlong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlongpb.serialize(&wlong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int16_t test1 = 123; - int16_t test2 = 0; - ASSERT_TRUE(data->set_int16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //int16_t iTest16; - //ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ShortStruct wshort; - ShortStructPubSubType wshortpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wshortpb.deserialize(&dynamic_payload, &wshort)); - - uint32_t static_payloadSize = static_cast(wshortpb.getSerializedSizeProvider(&wshort)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wshortpb.serialize(&wshort, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint16_t test1 = 123; - uint16_t test2 = 0; - ASSERT_TRUE(data->set_uint16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //uint16_t uTest16; - //ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - UShortStruct wshort; - UShortStructPubSubType wshortpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wshortpb.deserialize(&dynamic_payload, &wshort)); - - uint32_t static_payloadSize = static_cast(wshortpb.getSerializedSizeProvider(&wshort)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wshortpb.serialize(&wshort, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_int64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - int64_t test1 = 123; - int64_t test2 = 0; - ASSERT_TRUE(data->set_int64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_int64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //int64_t iTest64; - //ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongLongStruct wlonglong; - LongLongStructPubSubType wlonglongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlonglongpb.deserialize(&dynamic_payload, &wlonglong)); - - uint32_t static_payloadSize = static_cast(wlonglongpb.getSerializedSizeProvider(&wlonglong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlonglongpb.serialize(&wlonglong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_uint64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - uint64_t test1 = 123; - uint64_t test2 = 0; - ASSERT_TRUE(data->set_uint64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_uint64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_uint64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - ULongLongStruct wlonglong; - ULongLongStructPubSubType wlonglongpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wlonglongpb.deserialize(&dynamic_payload, &wlonglong)); - - uint32_t static_payloadSize = static_cast(wlonglongpb.getSerializedSizeProvider(&wlonglong)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wlonglongpb.serialize(&wlonglong, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float32_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - float test1 = 123.0f; - float test2 = 0.0f; - ASSERT_TRUE(data->set_float32_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float32_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //float fTest32; - //ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - FloatStruct wfloat; - FloatStructPubSubType wfloatpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wfloatpb.deserialize(&dynamic_payload, &wfloat)); - - uint32_t static_payloadSize = static_cast(wfloatpb.getSerializedSizeProvider(&wfloat)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wfloatpb.serialize(&wfloat, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float64_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - double test1 = 123.0; - double test2 = 0.0; - ASSERT_TRUE(data->set_float64_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float64_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float64_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //double fTest64; - //ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - DoubleStruct wdouble; - DoubleStructPubSubType wdoublepb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wdoublepb.deserialize(&dynamic_payload, &wdouble)); - - uint32_t static_payloadSize = static_cast(wdoublepb.getSerializedSizeProvider(&wdouble)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wdoublepb.serialize(&wdouble, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_float128_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - long double test1 = 123.0; - long double test2 = 0.0; - ASSERT_TRUE(data->set_float128_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_float128_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_float128_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //long double fTest128; - //ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - LongDoubleStruct wldouble; - LongDoubleStructPubSubType wldoublepb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wldoublepb.deserialize(&dynamic_payload, &wldouble)); - - uint32_t static_payloadSize = static_cast(wldoublepb.getSerializedSizeProvider(&wldouble)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wldoublepb.serialize(&wldouble, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - char test1 = 'a'; - char test2 = 'b'; - ASSERT_TRUE(data->set_char8_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_char8_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_char8_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //char cTest8; - //ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - CharStruct wchar; - CharStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -#if FASTCDR_VERSION_MAJOR == 1 -TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - wchar_t test1 = L'a'; - wchar_t test2 = L'b'; - ASSERT_TRUE(data->set_char16_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_char16_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_char16_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //wchar_t cTest16; - //ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - WCharStruct wchar; - WCharStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} -#endif // if FASTCDR_VERSION_MAJOR == 1 - -TEST_F(DynamicTypesTests, DynamicType_byte_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - octet test1 = 255; - octet test2 = 0; - ASSERT_TRUE(data->set_byte_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_byte_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //octet oTest; - //ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - OctetStruct wchar; - OctetStructPubSubType wcharpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wcharpb.deserialize(&dynamic_payload, &wchar)); - - uint32_t static_payloadSize = static_cast(wcharpb.getSerializedSizeProvider(&wchar)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wcharpb.serialize(&wchar, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bool_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - bool test1 = true; - bool test2 = false; - ASSERT_TRUE(data->set_bool_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_bool_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //bool bTest; - //ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - BoolStruct wbool; - BoolStructPubSubType wboolpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wboolpb.deserialize(&dynamic_payload, &wbool)); - - uint32_t static_payloadSize = static_cast(wboolpb.getSerializedSizeProvider(&wbool)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wboolpb.serialize(&wbool, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_enum_unit_tests) -{ - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); - ASSERT_TRUE(created_builder != nullptr); - - // Add three members to the enum. - ASSERT_TRUE(created_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(created_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - - // Try to add a descriptor with the same name. - ASSERT_FALSE(created_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Try to set an invalid value. - ASSERT_FALSE(data->set_enum_value("BAD", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - std::string test1 = "SECOND"; - ASSERT_FALSE(data->set_enum_value(test1, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(test1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - std::string test2; - int iTest; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(test2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Work as uint32_t - uint32_t uTest1 = 2; - ASSERT_FALSE(data->set_enum_value(uTest1, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_enum_value(uTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - uint32_t uTest2; - ASSERT_FALSE(data->get_int32_value(iTest, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->get_enum_value(uTest2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_enum_value(uTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(uTest1 == uTest2); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //std::string sEnumTest; - //ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - EnumStruct wenum; - EnumStructPubSubType wenumpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wenumpb.deserialize(&dynamic_payload, &wenum)); - - uint32_t static_payloadSize = static_cast(wenumpb.getSerializedSizeProvider(&wenum)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wenumpb.serialize(&wenum, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) -{ - uint32_t length = 15; - { - DynamicTypeBuilderFactory::get_instance()->create_string_type(length); - DynamicTypeBuilder_ptr created_builder = - DynamicTypeBuilderFactory::get_instance()->create_string_builder(length); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); - std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(data->set_string_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest2 = ""; - ASSERT_FALSE(data->get_string_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_string_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //std::string sTest; - //ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - StringStruct wstring; - StringStructPubSubType wstringpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wstringpb.deserialize(&dynamic_payload, &wstring)); - - uint32_t static_payloadSize = static_cast(wstringpb.getSerializedSizeProvider(&wstring)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wstringpb.serialize(&wstring, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -#if FASTCDR_VERSION_MAJOR == 1 -TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) -{ - uint32_t length = 15; - { - DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder( - length); - ASSERT_TRUE(created_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", 1) == ReturnCode_t::RETCODE_OK); - std::wstring sTest1 = L"STRING_TEST"; - ASSERT_TRUE(data->set_wstring_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(data->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring sTest2 = L""; - ASSERT_FALSE(data->get_wstring_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_wstring_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(data->set_wstring_value(L"TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //std::wstring wsTest; - //ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // SERIALIZATION TEST - WStringStruct wwstring; - WStringStructPubSubType wwstringpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(wwstringpb.deserialize(&dynamic_payload, &wwstring)); - - uint32_t static_payloadSize = static_cast(wwstringpb.getSerializedSizeProvider(&wwstring)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(wwstringpb.serialize(&wwstring, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} -#endif // if FASTCDR_VERSION_MAJOR == 1 - -TEST_F(DynamicTypesTests, DynamicType_alias_unit_tests) -{ - { - std::string name = "ALIAS"; - DynamicTypeBuilder_ptr base_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(base_builder != nullptr); - DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_builder.get(), name); - ASSERT_TRUE(alias_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); - ASSERT_TRUE(created_type != nullptr); - ASSERT_TRUE(created_type->get_name() == "ALIAS"); - DynamicData* aliasData = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(aliasData != nullptr); - - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); - - uint32_t uTest1 = 2; - ASSERT_TRUE(aliasData->set_uint32_value(uTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - uint32_t uTest2 = 0; - ASSERT_TRUE(aliasData->get_uint32_value(uTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(uTest1 == uTest2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(aliasData)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(aliasData)); - - // SERIALIZATION TEST - AliasStruct walias; - AliasStructPubSubType waliaspb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &dynamic_payload)); - ASSERT_TRUE(waliaspb.deserialize(&dynamic_payload, &walias)); - - uint32_t static_payloadSize = static_cast(waliaspb.getSerializedSizeProvider(&walias)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(waliaspb.serialize(&walias, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(aliasData)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_multi_alias_unit_tests) -{ - { - uint32_t length = 15; - std::string name = "ALIAS"; - std::string name2 = "ALIAS2"; - DynamicTypeBuilder_ptr base_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(length); - ASSERT_TRUE(base_builder != nullptr); - DynamicTypeBuilder_ptr base_alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_builder.get(), name); - ASSERT_TRUE(base_alias_builder != nullptr); - DynamicType_ptr base_type = DynamicTypeBuilderFactory::get_instance()->create_type(base_alias_builder.get()); - ASSERT_TRUE(base_type != nullptr); - ASSERT_TRUE(base_type->get_name() == name); - DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - base_alias_builder.get(), name2); - ASSERT_TRUE(alias_builder != nullptr); - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); - ASSERT_TRUE(created_type != nullptr); - ASSERT_TRUE(created_type->get_name() == name2); - DynamicData* aliasData = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(aliasData != nullptr); - - // Try to create an alias without base type. - DynamicTypeBuilder_ptr alias2_type_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder( - nullptr, "ALIAS2"); - ASSERT_FALSE(alias2_type_builder != nullptr); - - ASSERT_FALSE(aliasData->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(aliasData->set_string_value("", 1) == ReturnCode_t::RETCODE_OK); - std::string sTest1 = "STRING_TEST"; - ASSERT_TRUE(aliasData->set_string_value(sTest1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int test = 0; - ASSERT_FALSE(aliasData->get_int32_value(test, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest2 = ""; - ASSERT_FALSE(aliasData->get_string_value(sTest2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(aliasData->get_string_value(sTest2, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(sTest1 == sTest2); - - ASSERT_FALSE(aliasData->set_string_value("TEST_OVER_LENGTH_LIMITS", - MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(aliasData)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(aliasData, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(aliasData)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(aliasData) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bitset_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr bitset_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); - ASSERT_TRUE(bitset_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(bitset_type_builder->add_member(0, "int2", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(bitset_type_builder->add_member(1, "int20", base_type2) == ReturnCode_t::RETCODE_OK); - bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); - bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); - bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); - bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); // 8 bits empty - - auto bitset_type = bitset_type_builder->build(); - ASSERT_TRUE(bitset_type != nullptr); - auto bitset_data = DynamicDataFactory::get_instance()->create_data(bitset_type); - ASSERT_TRUE(bitset_data != nullptr); - - ASSERT_FALSE(bitset_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(bitset_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Set and get the child values. - octet test1(234); - ASSERT_TRUE(bitset_data->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); - octet test2(0); - ASSERT_TRUE(bitset_data->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(test1 == test2); - // 11101010 - // 00000010 (two bits) - ASSERT_TRUE(test2 == 2); - uint32_t test3(289582314); - ASSERT_TRUE(bitset_data->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); - uint32_t test4(0); - ASSERT_TRUE(bitset_data->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(test3 == test4); - // 00000001010000101010110011101010 - // 00000000000000101010110011101010 (20 bits) - ASSERT_TRUE(test4 == 175338); - - - - // Bitset serialization - // Tested in DynamicTypes_4_2_Tests - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(bitset_data) == ReturnCode_t::RETCODE_OK); - - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_bitmask_unit_tests) -{ - uint32_t limit = 5; - { - DynamicTypeBuilder_ptr created_builder = - DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); - ASSERT_TRUE(created_builder != nullptr); - - // Add two members to the bitmask - ASSERT_TRUE(created_builder->add_empty_member(0, "TEST") == ReturnCode_t::RETCODE_OK); - - // Try to add a descriptor with the same name - ASSERT_FALSE(created_builder->add_empty_member(1, "TEST") == ReturnCode_t::RETCODE_OK); - - ASSERT_TRUE(created_builder->add_empty_member(1, "TEST2") == ReturnCode_t::RETCODE_OK); - - ASSERT_TRUE(created_builder->add_empty_member(4, "TEST4") == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(created_builder->add_empty_member(5, "TEST5") == ReturnCode_t::RETCODE_OK); // Out of bounds - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); - ASSERT_TRUE(created_type != nullptr); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(data != nullptr); - - MemberId testId = data->get_member_id_by_name("TEST"); - ASSERT_TRUE(testId != MEMBER_ID_INVALID); - MemberId test2Id = data->get_member_id_by_name("TEST2"); - ASSERT_TRUE(test2Id != MEMBER_ID_INVALID); - MemberId test4Id = data->get_member_id_by_name("TEST4"); - ASSERT_TRUE(test4Id != MEMBER_ID_INVALID); - MemberId test5Id = data->get_member_id_by_name("TEST5"); - ASSERT_TRUE(test5Id == MEMBER_ID_INVALID); - - bool test1 = true; - ASSERT_FALSE(data->set_int32_value(1, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->set_bool_value(test1, testId) == ReturnCode_t::RETCODE_OK); - - // Over the limit - ASSERT_FALSE(data->set_bool_value(test1, limit + 1) == ReturnCode_t::RETCODE_OK); - - bool test2 = false; - ASSERT_TRUE(data->get_bool_value(test2, 2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test2 == false); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - bool test3 = data->get_bool_value("TEST"); - ASSERT_TRUE(test1 == test3); - ASSERT_TRUE(data->set_bool_value(true, "TEST4") == ReturnCode_t::RETCODE_OK); - bool test4 = data->get_bool_value("TEST4"); - ASSERT_TRUE(test4 == true); - - test1 = false; - ASSERT_TRUE(data->set_bool_value(test1, testId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, test2Id) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_bool_value(test2, testId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - data->set_bitmask_value(55); // 00110111 - uint64_t value = data->get_bitmask_value(); - ASSERT_TRUE(value == 55); - ASSERT_TRUE(data->get_bool_value("TEST")); - ASSERT_TRUE(data->get_bool_value("TEST2")); - ASSERT_TRUE(data->get_bool_value("TEST4")); - data->set_bitmask_value(37); // 00100101 - ASSERT_TRUE(data->get_bool_value("TEST")); - ASSERT_FALSE(data->get_bool_value("TEST2")); - ASSERT_FALSE(data->get_bool_value("TEST4")); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - //uint64_t uTest64; - //ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - ASSERT_TRUE(data->set_bool_value(true, 0) == ReturnCode_t::RETCODE_OK); - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_sequence_unit_tests) -{ - uint32_t length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - DynamicTypeBuilder_ptr seq_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - base_type_builder.get(), length); - ASSERT_TRUE(seq_type_builder != nullptr); - auto seq_type = seq_type_builder->build(); - ASSERT_TRUE(seq_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 1) == ReturnCode_t::RETCODE_OK); - - MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - - // Try to insert more than the limit. - MemberId newId3; - ASSERT_FALSE(data->insert_sequence_data(newId3) == ReturnCode_t::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, newId2) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, newId2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(seq_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - - // New Insert Methods - ASSERT_TRUE(data->insert_int32_value(test1, newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_int32_value(test2, newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - - // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - - // SERIALIZATION TEST - SequenceStruct seq; - SequenceStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_sequence_of_sequences_unit_tests) -{ - uint32_t sequence_length = 2; - uint32_t sup_sequence_length = 3; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - - DynamicTypeBuilder_ptr seq_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - base_type_builder.get(), sequence_length); - ASSERT_TRUE(seq_type_builder != nullptr); - auto seq_type = seq_type_builder->build(); - ASSERT_TRUE(seq_type != nullptr); - - DynamicTypeBuilder_ptr seq_seq_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_sequence_builder( - seq_type_builder.get(), sup_sequence_length); - ASSERT_TRUE(seq_seq_type_builder != nullptr); - auto seq_seq_type = seq_seq_type_builder->build(); - ASSERT_TRUE(seq_seq_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(seq_seq_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - MemberId newId; - ASSERT_TRUE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - MemberId newId2; - ASSERT_TRUE(data->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - - // Loan Value to modify the first sequence - auto seq_data = data->loan_value(newId); - ASSERT_TRUE(seq_data != nullptr); - - MemberId newSeqId; - ASSERT_TRUE(seq_data->insert_sequence_data(newSeqId) == ReturnCode_t::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, newSeqId) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Return the pointer of the sequence - ASSERT_TRUE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(seq_seq_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(seq_seq_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Remove the elements. - ASSERT_TRUE(data->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - - // Check that the sequence is empty. - ASSERT_FALSE(data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // SERIALIZATION TEST - SequenceSequenceStruct seq; - SequenceSequenceStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - // New Insert Methods - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - seq_data = DynamicDataFactory::get_instance()->create_data(seq_type); - ASSERT_TRUE(seq_data->insert_int32_value(test1, newSeqId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(seq_data->get_int32_value(test2, newSeqId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(data->insert_complex_value(seq_data, newId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_array_unit_tests) -{ - std::vector sequence_lengths = { 2, 2, 2 }; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr array_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder( - base_type_builder.get(), sequence_lengths); - ASSERT_TRUE(array_type_builder != nullptr); - auto array_type = array_type_builder->build(); - ASSERT_TRUE(array_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - - // Get an index in the multidimensional array. - std::vector vPosition = { 1, 1, 1 }; - MemberId testPos(0); - testPos = data->get_array_index(vPosition); - ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - - // Invalid input vectors. - std::vector vPosition2 = { 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition2) != MEMBER_ID_INVALID); - std::vector vPosition3 = { 1, 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition3) != MEMBER_ID_INVALID); - - // Set and get a value. - int32_t test1 = 156; - ASSERT_TRUE(data->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(array_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Check items count before and after remove an element. - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - - // Check the clear values method - ASSERT_TRUE(data->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == array_type->get_total_bounds()); - - // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // SERIALIZATION TEST - ArraytStruct seq; - ArraytStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_array_of_arrays_unit_tests) -{ - std::vector sequence_lengths = { 2, 2 }; - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr array_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder( - base_type_builder.get(), sequence_lengths); - ASSERT_TRUE(array_type_builder != nullptr); - auto array_type = array_type_builder->build(); - ASSERT_TRUE(array_type != nullptr); - - DynamicTypeBuilder_ptr parent_array_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_array_builder( - array_type_builder.get(), sequence_lengths); - ASSERT_TRUE(parent_array_type_builder != nullptr); - auto parent_array_type = parent_array_type_builder->build(); - ASSERT_TRUE(parent_array_type != nullptr); - - auto data = DynamicDataFactory::get_instance()->create_data(parent_array_type); - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - MemberId newId; - ASSERT_FALSE(data->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); - - // Get an index in the multidimensional array. - std::vector vPosition = { 1, 1 }; - MemberId testPos(0); - testPos = data->get_array_index(vPosition); - ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - - // Invalid input vectors. - std::vector vPosition2 = { 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition2) != MEMBER_ID_INVALID); - std::vector vPosition3 = { 1, 1, 1, 1 }; - ASSERT_FALSE(data->get_array_index(vPosition3) != MEMBER_ID_INVALID); - - // Loan Complex values. - DynamicData* temp = data->loan_value(testPos); - ASSERT_TRUE(temp != nullptr); - DynamicData* temp2 = data->loan_value(testPos); - ASSERT_FALSE(temp2 != nullptr); - - int32_t test1 = 156; - ASSERT_TRUE(temp->set_int32_value(test1, testPos) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(temp->get_int32_value(test2, testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_TRUE(data->return_loaned_value(temp) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(temp2) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(parent_array_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(parent_array_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - // Check items count before and after remove an element. - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_value(testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - ASSERT_TRUE(data->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == parent_array_type->get_total_bounds()); - - // Try to set a value out of the array. - ASSERT_FALSE(data->set_int32_value(test1, 100) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // SERIALIZATION TEST - ArrayArrayStruct seq; - ArrayArrayStructPubSubType seqpb; - - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(array_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_map_unit_tests) -{ - uint32_t map_length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), base_type_builder.get(), map_length); - ASSERT_TRUE(map_type_builder != nullptr); - auto map_type = map_type_builder->build(); - ASSERT_TRUE(map_type != nullptr); - - DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Try to write on an empty position - ASSERT_FALSE(data->set_int32_value(234, 0) == ReturnCode_t::RETCODE_OK); - - MemberId keyId; - MemberId valueId; - auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - - // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - - MemberId keyId2; - MemberId valueId2; - key_data = DynamicDataFactory::get_instance()->create_data(base_type); - key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - - // Try to Add one more than the limit - auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); - key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == ReturnCode_t::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(data->set_int32_value(test1, valueId) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(data->get_int32_value(test2, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(map_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - // Check items count with removes - ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 2); - ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 1); - ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(data->get_item_count() == 0); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - //// SERIALIZATION TEST - //MapStruct seq; - //MapStructPubSubType seqpb; - - //uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(data)()); - //SerializedPayload_t dynamic_payload(payloadSize3); - //ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - //ASSERT_TRUE(dynamic_payload.length == payloadSize3); - //ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - //uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - //SerializedPayload_t static_payload(static_payloadSize); - //ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - //ASSERT_TRUE(static_payload.length == static_payloadSize); - //types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); - //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - //ASSERT_TRUE(data3->equals(data)); - - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_map_of_maps_unit_tests) -{ - uint32_t map_length = 2; - { - // Then - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), base_type_builder.get(), map_length); - ASSERT_TRUE(map_type_builder != nullptr); - auto map_type = map_type_builder->build(); - ASSERT_TRUE(map_type != nullptr); - - DynamicTypeBuilder_ptr map_map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder( - base_type_builder.get(), map_type_builder.get(), map_length); - ASSERT_TRUE(map_map_type_builder != nullptr); - auto map_map_type = map_map_type_builder->build(); - ASSERT_TRUE(map_map_type != nullptr); - - DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_map_type); - - ASSERT_FALSE(data->set_int32_value(10, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - MemberId keyId; - MemberId valueId; - auto key_data = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - - // Try to Add the same key twice. - ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - - MemberId keyId2; - MemberId valueId2; - key_data = DynamicDataFactory::get_instance()->create_data(base_type); - key_data->set_int32_value(2, MEMBER_ID_INVALID); - ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - - // Try to Add one more than the limit - auto key_data2 = DynamicDataFactory::get_instance()->create_data(base_type); - key_data2->set_int32_value(3, MEMBER_ID_INVALID); - ASSERT_FALSE(data->insert_map_data(key_data2, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == ReturnCode_t::RETCODE_OK); - - auto seq_data = data->loan_value(valueId); - ASSERT_TRUE(seq_data != nullptr); - - auto key_data3 = DynamicDataFactory::get_instance()->create_data(base_type); - ASSERT_TRUE(seq_data->insert_map_data(key_data3, keyId, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data3) == ReturnCode_t::RETCODE_OK); - - // Set and get a value. - int32_t test1(234); - ASSERT_TRUE(seq_data->set_int32_value(test1, valueId) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(seq_data->get_int32_value(test2, valueId) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - ASSERT_TRUE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->return_loaned_value(seq_data) == ReturnCode_t::RETCODE_OK); - - ASSERT_FALSE(data->set_int32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint16_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_int64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_uint64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float32_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float64_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_float128_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char8_value('a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_char16_value(L'a', MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_byte_value(0, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_bool_value(false, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_wstring_value(L"", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(data->set_enum_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - int32_t iTest32; - ASSERT_FALSE(data->get_int32_value(iTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint32_t uTest32; - ASSERT_FALSE(data->get_uint32_value(uTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int16_t iTest16; - ASSERT_FALSE(data->get_int16_value(iTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint16_t uTest16; - ASSERT_FALSE(data->get_uint16_value(uTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - int64_t iTest64; - ASSERT_FALSE(data->get_int64_value(iTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - uint64_t uTest64; - ASSERT_FALSE(data->get_uint64_value(uTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - float fTest32; - ASSERT_FALSE(data->get_float32_value(fTest32, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - double fTest64; - ASSERT_FALSE(data->get_float64_value(fTest64, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - long double fTest128; - ASSERT_FALSE(data->get_float128_value(fTest128, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - char cTest8; - ASSERT_FALSE(data->get_char8_value(cTest8, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - wchar_t cTest16; - ASSERT_FALSE(data->get_char16_value(cTest16, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - octet oTest; - ASSERT_FALSE(data->get_byte_value(oTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - bool bTest; - ASSERT_FALSE(data->get_bool_value(bTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sTest; - ASSERT_FALSE(data->get_string_value(sTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::wstring wsTest; - ASSERT_FALSE(data->get_wstring_value(wsTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - std::string sEnumTest; - ASSERT_FALSE(data->get_enum_value(sEnumTest, MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(map_map_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_map_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(data)); - - //// SERIALIZATION TEST - //MapMapStruct seq; - //MapMapStructPubSubType seqpb; - - //uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(data)()); - //SerializedPayload_t dynamic_payload(payloadSize3); - //ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); - //ASSERT_TRUE(dynamic_payload.length == payloadSize3); - //ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - //uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - //SerializedPayload_t static_payload(static_payloadSize); - //ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - //ASSERT_TRUE(static_payload.length == static_payloadSize); - //types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_map_type); - //ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - //ASSERT_TRUE(data3->equals(data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - //ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_structure_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - auto struct_data = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Set and get the child values. - int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - // SERIALIZATION TEST - StructStruct seq; - StructStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(struct_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(struct_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); - - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_structure_inheritance_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - // Try to create the child struct without parent - DynamicTypeBuilder_ptr child_struct_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); - ASSERT_FALSE(child_struct_type_builder != nullptr); - - // Create the child struct. - child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder( - struct_type_builder.get()); - ASSERT_TRUE(child_struct_type_builder != nullptr); - - // Add a new member to the child struct. - ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int32", base_type) == ReturnCode_t::RETCODE_OK); - - // try to add a member to override one of the parent struct. - ASSERT_FALSE(child_struct_type_builder->add_member(3, "int32", base_type) == ReturnCode_t::RETCODE_OK); - - auto child_struct_type = child_struct_type_builder->build(); - ASSERT_TRUE(child_struct_type != nullptr); - auto struct_data = DynamicDataFactory::get_instance()->create_data(child_struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Set and get the parent values. - int32_t test1(234); - ASSERT_TRUE(struct_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(struct_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - int64_t test3(234); - ASSERT_TRUE(struct_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - int64_t test4(0); - ASSERT_TRUE(struct_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - // Set and get the child value. - int32_t test5(234); - ASSERT_TRUE(struct_data->set_int32_value(test5, 2) == ReturnCode_t::RETCODE_OK); - int32_t test6(0); - ASSERT_TRUE(struct_data->get_int32_value(test6, 2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test5 == test6); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(child_struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - // Delete the structure - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_multi_structure_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(struct_type_builder != nullptr); - - // Add members to the struct. - ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(struct_type_builder->add_member(1, "int64", base_type2) == ReturnCode_t::RETCODE_OK); - - auto struct_type = struct_type_builder->build(); - ASSERT_TRUE(struct_type != nullptr); - - // Create the parent struct. - DynamicTypeBuilder_ptr parent_struct_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); - ASSERT_TRUE(parent_struct_type_builder != nullptr); - - // Add members to the parent struct. - ASSERT_TRUE(parent_struct_type_builder->add_member(0, "child_struct", struct_type) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(parent_struct_type_builder->add_member(1, "child_int64", base_type2) == ReturnCode_t::RETCODE_OK); - - auto parent_struct_type = parent_struct_type_builder->build(); - ASSERT_TRUE(parent_struct_type != nullptr); - - auto struct_data = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(struct_data != nullptr); - - ASSERT_FALSE(struct_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - // Set and get the child values. - int64_t test1(234); - ASSERT_TRUE(struct_data->set_int64_value(test1, 1) == ReturnCode_t::RETCODE_OK); - int64_t test2(0); - ASSERT_TRUE(struct_data->get_int64_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - - auto child_struct_data = struct_data->loan_value(0); - ASSERT_TRUE(child_struct_data != nullptr); - - // Set and get the child values. - int32_t test3(234); - ASSERT_TRUE(child_struct_data->set_int32_value(test3, 0) == ReturnCode_t::RETCODE_OK); - int32_t test4(0); - ASSERT_TRUE(child_struct_data->get_int32_value(test4, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - int64_t test5(234); - ASSERT_TRUE(child_struct_data->set_int64_value(test5, 1) == ReturnCode_t::RETCODE_OK); - int64_t test6(0); - ASSERT_TRUE(child_struct_data->get_int64_value(test6, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test5 == test6); - - ASSERT_TRUE(struct_data->return_loaned_value(child_struct_data) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(struct_data->return_loaned_value(child_struct_data) == ReturnCode_t::RETCODE_OK); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(parent_struct_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(struct_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(struct_data)); - - // SERIALIZATION TEST - StructStructStruct seq; - StructStructStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(struct_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(struct_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(parent_struct_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(struct_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(struct_data) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_union_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder( - base_type_builder.get()); - ASSERT_TRUE(union_type_builder != nullptr); - - // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); - - // Try to add a second "DEFAULT" value to the union - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); - - // Try to add a second value to the same case label - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); - - // Create a data of this union - auto union_type = union_type_builder->build(); - ASSERT_TRUE(union_type != nullptr); - auto union_data = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(union_data != nullptr); - - // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int64_t test3(234); - int64_t test4(0); - - // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(union_data->get_int32_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - - ASSERT_TRUE(union_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 1); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(union_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(union_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(union_data)); - - // SERIALIZATION TEST - SimpleUnionStruct seq; - SimpleUnionStructPubSubType seqpb; - - uint32_t payloadSize3 = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t dynamic_payload(payloadSize3); - ASSERT_TRUE(pubsubType.serialize(union_data, &dynamic_payload)); - ASSERT_TRUE(dynamic_payload.length == payloadSize3); - ASSERT_TRUE(seqpb.deserialize(&dynamic_payload, &seq)); - - uint32_t static_payloadSize = static_cast(seqpb.getSerializedSizeProvider(&seq)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(seqpb.serialize(&seq, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - types::DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(union_type); - ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); - ASSERT_TRUE(data3->equals(union_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_union_with_unions_unit_tests) -{ - { - DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); - ASSERT_TRUE(base_type_builder != nullptr); - auto base_type = base_type_builder->build(); - - DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); - ASSERT_TRUE(base_type_builder2 != nullptr); - auto base_type2 = base_type_builder2->build(); - - DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder( - base_type); - ASSERT_TRUE(union_type_builder != nullptr); - - // Add members to the union. - ASSERT_TRUE(union_type_builder->add_member(0, "first", base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_type_builder->add_member(1, "second", base_type2, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); - - // Try to add a second "DEFAULT" value to the union - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); - - // Try to add a second value to the same case label - ASSERT_FALSE(union_type_builder->add_member(0, "third", base_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); - - // Create a data of this union - auto union_type = union_type_builder->build(); - ASSERT_TRUE(union_type != nullptr); - - DynamicTypeBuilder_ptr parent_union_type_builder = - DynamicTypeBuilderFactory::get_instance()->create_union_builder(base_type); - ASSERT_TRUE(parent_union_type_builder != nullptr); - - // Add Members to the parent union - ASSERT_TRUE(parent_union_type_builder->add_member(0, "first", base_type, "", { 0 }, - true) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(parent_union_type_builder->add_member(1, "second", union_type, "", { 1 }, - false) == ReturnCode_t::RETCODE_OK); - - DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type( - parent_union_type_builder.get()); - ASSERT_TRUE(created_type != nullptr); - auto union_data = DynamicDataFactory::get_instance()->create_data(parent_union_type_builder.get()); - ASSERT_TRUE(union_data != nullptr); - - // Set and get the child values. - ASSERT_FALSE(union_data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(union_data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - - uint64_t label; - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 0); - - int32_t test1(234); - ASSERT_TRUE(union_data->set_int32_value(test1, 0) == ReturnCode_t::RETCODE_OK); - int32_t test2(0); - ASSERT_TRUE(union_data->get_int32_value(test2, 0) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test1 == test2); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 0); - - // Loan Value ( Activates this union id ) - DynamicData* child_data = union_data->loan_value(1); - ASSERT_TRUE(child_data != 0); - - int64_t test3(234); - int64_t test4(0); - - // Try to get values from invalid indexes and from an invalid element ( not the current one ) - ASSERT_FALSE(child_data->get_int32_value(test2, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_FALSE(child_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - - ASSERT_TRUE(child_data->set_int64_value(test3, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(child_data->get_int64_value(test4, 1) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(test3 == test4); - - ASSERT_TRUE(union_data->return_loaned_value(child_data) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(union_data->get_union_label(label) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(label == 1); - - // Serialize <-> Deserialize Test - DynamicPubSubType pubsubType(created_type); - uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(union_data)()); - SerializedPayload_t payload(payloadSize); - ASSERT_TRUE(pubsubType.serialize(union_data, &payload)); - ASSERT_TRUE(payload.length == payloadSize); - - types::DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); - ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); - ASSERT_TRUE(data2->equals(union_data)); - - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); - - // Delete the map - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(union_data) == ReturnCode_t::RETCODE_OK); - } - ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); - ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -} - -TEST_F(DynamicTypesTests, DynamicType_XML_EnumStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("EnumStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Struct EnumStruct - DynamicTypeBuilder_ptr es_builder = m_factory->create_struct_builder(); - es_builder->add_member(0, "my_enum", enum_builder.get()); - es_builder->set_name("EnumStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(es_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("AliasStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Alias - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(enum_builder.get(), "MyAliasEnum"); - - // Struct AliasStruct - DynamicTypeBuilder_ptr aliass_builder_ptr = m_factory->create_struct_builder(); - aliass_builder_ptr->add_member(0, "my_alias", alias_builder.get()); - aliass_builder_ptr->set_name("AliasStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aliass_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasAliasStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("AliasAliasStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Enum - DynamicTypeBuilder_ptr enum_builder = m_factory->create_enum_builder(); - enum_builder->add_empty_member(0, "A"); - enum_builder->add_empty_member(1, "B"); - enum_builder->add_empty_member(2, "C"); - enum_builder->set_name("MyEnum"); - - // Alias and aliasalias - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(enum_builder.get(), "MyAliasEnum"); - DynamicTypeBuilder_ptr alias_alias_builder = m_factory->create_alias_builder( - alias_builder.get(), "MyAliasAliasEnum"); - - // Struct AliasAliasStruct - DynamicTypeBuilder_ptr aliasAliasS_builder_ptr = m_factory->create_struct_builder(); - aliasAliasS_builder_ptr->add_member(0, "my_alias_alias", alias_alias_builder.get()); - aliasAliasS_builder_ptr->set_name("AliasAliasStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aliasAliasS_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_BoolStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("BoolStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Boolean - DynamicTypeBuilder_ptr boolean_builder = m_factory->create_bool_builder(); - - // Struct BoolStruct - DynamicTypeBuilder_ptr bool_builder_ptr = m_factory->create_struct_builder(); - bool_builder_ptr->add_member(0, "my_bool", boolean_builder.get()); - bool_builder_ptr->set_name("BoolStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(bool_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_OctetStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("OctetStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Byte - DynamicTypeBuilder_ptr byte_builder = m_factory->create_byte_builder(); - - // Struct OctetStruct - DynamicTypeBuilder_ptr octet_builder_ptr = m_factory->create_struct_builder(); - octet_builder_ptr->add_member(0, "my_octet", byte_builder.get()); - octet_builder_ptr->set_name("OctetStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(octet_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int16 - DynamicTypeBuilder_ptr int16_builder = m_factory->create_int16_builder(); - - // Struct ShortStruct - DynamicTypeBuilder_ptr int16_builder_ptr = m_factory->create_struct_builder(); - int16_builder_ptr->add_member(0, "my_int16", int16_builder.get()); - int16_builder_ptr->set_name("ShortStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int16_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int32 - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - - // Struct LongStruct - DynamicTypeBuilder_ptr int32_builder_ptr = m_factory->create_struct_builder(); - int32_builder_ptr->add_member(0, "my_int32", int32_builder.get()); - int32_builder_ptr->set_name("LongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongLongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongLongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int64 - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - // Struct LongLongStruct - DynamicTypeBuilder_ptr int64_builder_ptr = m_factory->create_struct_builder(); - int64_builder_ptr->add_member(0, "my_int64", int64_builder.get()); - int64_builder_ptr->set_name("LongLongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(int64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_UShortStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("UShortStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint16 - DynamicTypeBuilder_ptr uint16_builder = m_factory->create_uint16_builder(); - - // Struct UShortStruct - DynamicTypeBuilder_ptr uint16_builder_ptr = m_factory->create_struct_builder(); - uint16_builder_ptr->add_member(0, "my_uint16", uint16_builder.get()); - uint16_builder_ptr->set_name("UShortStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint16_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ULongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ULongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint32 - DynamicTypeBuilder_ptr uint32_builder = m_factory->create_uint32_builder(); - - // Struct ULongStruct - DynamicTypeBuilder_ptr uint32_builder_ptr = m_factory->create_struct_builder(); - uint32_builder_ptr->add_member(0, "my_uint32", uint32_builder.get()); - uint32_builder_ptr->set_name("ULongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ULongLongStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ULongLongStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // uint64 - DynamicTypeBuilder_ptr uint64_builder = m_factory->create_uint64_builder(); - - // Struct ULongLongStruct - DynamicTypeBuilder_ptr uint64_builder_ptr = m_factory->create_struct_builder(); - uint64_builder_ptr->add_member(0, "my_uint64", uint64_builder.get()); - uint64_builder_ptr->set_name("ULongLongStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uint64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_FloatStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("FloatStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float32 - DynamicTypeBuilder_ptr float32_builder = m_factory->create_float32_builder(); - - // Struct FloatStruct - DynamicTypeBuilder_ptr float32_builder_ptr = m_factory->create_struct_builder(); - float32_builder_ptr->add_member(0, "my_float32", float32_builder.get()); - float32_builder_ptr->set_name("FloatStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_DoubleStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("DoubleStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float64 - DynamicTypeBuilder_ptr float64_builder = m_factory->create_float64_builder(); - - // Struct DoubleStruct - DynamicTypeBuilder_ptr float64_builder_ptr = m_factory->create_struct_builder(); - float64_builder_ptr->add_member(0, "my_float64", float64_builder.get()); - float64_builder_ptr->set_name("DoubleStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float64_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LongDoubleStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LongDoubleStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // float128 - DynamicTypeBuilder_ptr float128_builder = m_factory->create_float128_builder(); - - // Struct LongDoubleStruct - DynamicTypeBuilder_ptr float128_builder_ptr = m_factory->create_struct_builder(); - float128_builder_ptr->add_member(0, "my_float128", float128_builder.get()); - float128_builder_ptr->set_name("LongDoubleStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(float128_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_CharStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("CharStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // char - DynamicTypeBuilder_ptr char8_builder = m_factory->create_char8_builder(); - - // Struct CharStruct - DynamicTypeBuilder_ptr char_builder_ptr = m_factory->create_struct_builder(); - char_builder_ptr->add_member(0, "my_char", char8_builder.get()); - char_builder_ptr->set_name("CharStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(char_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WCharStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WCharStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wchar - DynamicTypeBuilder_ptr char16_builder = m_factory->create_char16_builder(); - - // Struct WCharStruct - DynamicTypeBuilder_ptr wchar_builder_ptr = m_factory->create_struct_builder(); - wchar_builder_ptr->add_member(0, "my_wchar", char16_builder.get()); - wchar_builder_ptr->set_name("WCharStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(wchar_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - - // Struct StringStruct - DynamicTypeBuilder_ptr string_builder_ptr = m_factory->create_struct_builder(); - string_builder_ptr->add_member(0, "my_string", string_builder.get()); - string_builder_ptr->set_name("StringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - - // Struct WStringStruct - DynamicTypeBuilder_ptr wstring_builder_ptr = m_factory->create_struct_builder(); - wstring_builder_ptr->add_member(0, "my_wstring", wstring_builder.get()); - wstring_builder_ptr->set_name("WStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LargeStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LargeStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // large string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(41925); - - // Struct LargeStringStruct - DynamicTypeBuilder_ptr large_string_builder_ptr = m_factory->create_struct_builder(); - large_string_builder_ptr->add_member(0, "my_large_string", string_builder.get()); - large_string_builder_ptr->set_name("LargeStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(large_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_LargeWStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("LargeWStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // large wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(41925); - - // Struct LargeWStringStruct - DynamicTypeBuilder_ptr large_wstring_builder_ptr = m_factory->create_struct_builder(); - large_wstring_builder_ptr->add_member(0, "my_large_wstring", wstring_builder.get()); - large_wstring_builder_ptr->set_name("LargeWStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(large_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Short string - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(15); - - // Struct ShortStringStruct - DynamicTypeBuilder_ptr short_string_builder_ptr = m_factory->create_struct_builder(); - short_string_builder_ptr->add_member(0, "my_short_string", string_builder.get()); - short_string_builder_ptr->set_name("ShortStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(short_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ShortWStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortWStringStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Short wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(15); - - // Struct ShortWStringStruct - DynamicTypeBuilder_ptr short_wstring_builder_ptr = m_factory->create_struct_builder(); - short_wstring_builder_ptr->add_member(0, "my_short_wstring", wstring_builder.get()); - short_wstring_builder_ptr->set_name("ShortWStringStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(short_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_AliasStringStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructAliasString"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // String - DynamicTypeBuilder_ptr string_builder = m_factory->create_string_builder(); - - // Alias - DynamicTypeBuilder_ptr myAlias_builder = m_factory->create_alias_builder(string_builder.get(), "MyAliasString"); - - // Struct StructAliasString - DynamicTypeBuilder_ptr alias_string_builder_ptr = m_factory->create_struct_builder(); - alias_string_builder_ptr->add_member(0, "my_alias_string", myAlias_builder.get()); - alias_string_builder_ptr->set_name("StructAliasString"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(alias_string_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructAliasWString_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructAliasWString"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // wstring - DynamicTypeBuilder_ptr wstring_builder = m_factory->create_wstring_builder(); - - // Alias - DynamicTypeBuilder_ptr myAlias_builder = - m_factory->create_alias_builder(wstring_builder.get(), "MyAliasWString"); - - // Struct StructAliasWString - DynamicTypeBuilder_ptr alias_wstring_builder_ptr = m_factory->create_struct_builder(); - alias_wstring_builder_ptr->add_member(0, "my_alias_wstring", myAlias_builder.get()); - alias_wstring_builder_ptr->set_name("StructAliasWString"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(alias_wstring_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArraytStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArraytStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Int32 - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - - // Array - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2, 2 }); - - // Struct ShortWStringStruct - DynamicTypeBuilder_ptr array_int32_builder_ptr = m_factory->create_struct_builder(); - array_int32_builder_ptr->add_member(0, "my_array", array_builder.get()); - array_int32_builder_ptr->set_name("ArraytStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(array_int32_builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArrayArrayStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArrayArrayStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Typedef aka Alias - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2 }); - DynamicTypeBuilder_ptr myArray_builder = m_factory->create_alias_builder(array_builder.get(), "MyArray"); - - // Struct ArrayArrayStruct - DynamicTypeBuilder_ptr aas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aMyArray_builder = m_factory->create_array_builder(myArray_builder.get(), { 2, 2 }); - aas_builder->add_member(0, "my_array_array", aMyArray_builder.get()); - aas_builder->set_name("ArrayArrayStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aas_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_ArrayArrayArrayStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ArrayArrayArrayStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - // Manual comparision test - /* - typedef long MyArray[2][2]; - - struct ArrayArrayStruct - { - MyArray my_array_array[2][2]; - }; - - struct ArrayArrayArrayStruct - { - ArrayArrayStruct my_array_array_array[2][2]; - }; - - ====== - - - - - - - - - - - - - - - */ - // Typedef aka Alias - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr array_builder = m_factory->create_array_builder(int32_builder.get(), { 2, 2 }); - DynamicTypeBuilder_ptr myArray_builder = m_factory->create_alias_builder(array_builder.get(), "MyArray"); - - // Struct ArrayArrayStruct - DynamicTypeBuilder_ptr aas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aMyArray_builder = m_factory->create_array_builder(myArray_builder.get(), { 2, 2 }); - aas_builder->add_member(0, "my_array_array", aMyArray_builder.get()); - aas_builder->set_name("ArrayArrayStruct"); - - // Struct ArrayArrayArrayStruct - DynamicTypeBuilder_ptr aaas_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr aas_array_builder = m_factory->create_array_builder(aas_builder.get(), { 2, 2 }); - aaas_builder->add_member(0, "my_array_array_array", aas_array_builder.get()); - aaas_builder->set_name("ArrayArrayArrayStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(aaas_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SequenceStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SequenceStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seq_builder = m_factory->create_sequence_builder(int32_builder.get(), 2); - - DynamicTypeBuilder_ptr seqs_builder = m_factory->create_struct_builder(); - seqs_builder->add_member(0, "my_sequence", seq_builder.get()); - seqs_builder->set_name("SequenceStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(seqs_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SequenceSequenceStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SequenceSequenceStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr seq_builder = m_factory->create_sequence_builder(int32_builder.get(), 2); - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder( - seq_builder.get(), "my_sequence_sequence_inner"); - - DynamicTypeBuilder_ptr sss_builder = m_factory->create_struct_builder(); - DynamicTypeBuilder_ptr seq_seq_builder = m_factory->create_sequence_builder(alias_builder.get(), 2); - sss_builder->add_member(0, "my_sequence_sequence", seq_seq_builder.get()); - sss_builder->set_name("SequenceSequenceStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(sss_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_MapStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MapStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr map_builder = m_factory->create_map_builder(int32_builder.get(), int32_builder.get(), 7); - - DynamicTypeBuilder_ptr maps_builder = m_factory->create_struct_builder(); - maps_builder->add_member(0, "my_map", map_builder.get()); - maps_builder->set_name("MapStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(maps_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_MapMapStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MapMapStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr map_builder = m_factory->create_map_builder(int32_builder.get(), int32_builder.get(), 7); - DynamicTypeBuilder_ptr alias_builder = m_factory->create_alias_builder(map_builder.get(), "my_map_map_inner"); - DynamicTypeBuilder_ptr map_map_builder = m_factory->create_map_builder(alias_builder.get(), - int32_builder.get(), 2); - - - DynamicTypeBuilder_ptr maps_builder = m_factory->create_struct_builder(); - maps_builder->add_member(0, "my_map_map", map_map_builder.get()); - maps_builder->set_name("MapMapStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(maps_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr structs_builder = m_factory->create_struct_builder(); - structs_builder->add_member(0, "a", int32_builder.get()); - structs_builder->add_member(1, "b", int64_builder.get()); - structs_builder->set_name("StructStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(structs_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_StructStructStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("StructStructStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr structs_builder = m_factory->create_struct_builder(); - structs_builder->add_member(0, "a", int32_builder.get()); - structs_builder->add_member(1, "b", int64_builder.get()); - structs_builder->set_name("StructStruct"); - - DynamicTypeBuilder_ptr sss_builder = m_factory->create_struct_builder(); - sss_builder->add_member(0, "child_struct", structs_builder.get()); - sss_builder->add_member(1, "child_int64", int64_builder.get()); - sss_builder->set_name("StructStructStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(sss_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_SimpleUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("SimpleUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(int32_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("SimpleUnion"); - - - DynamicTypeBuilder_ptr us_builder = m_factory->create_struct_builder(); - us_builder->add_member(0, "my_union", union_builder.get()); - us_builder->set_name("SimpleUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(us_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_UnionUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("UnionUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(int32_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("SimpleUnion"); - - DynamicTypeBuilder_ptr union_union_builder = m_factory->create_union_builder(int32_builder.get()); - union_union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_union_builder->add_member(1, "second", union_builder.get(), "", { 1 }, false); - union_union_builder->set_name("UnionUnion"); - - - DynamicTypeBuilder_ptr uus_builder = m_factory->create_struct_builder(); - uus_builder->add_member(0, "my_union", union_union_builder.get()); - uus_builder->set_name("UnionUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(uus_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_WCharUnionStruct_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("WCharUnionStruct"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr wchar_builder = m_factory->create_char16_builder(); - DynamicTypeBuilder_ptr int32_builder = m_factory->create_int32_builder(); - DynamicTypeBuilder_ptr int64_builder = m_factory->create_int64_builder(); - - DynamicTypeBuilder_ptr union_builder = m_factory->create_union_builder(wchar_builder.get()); - union_builder->add_member(0, "first", int32_builder.get(), "", { 0 }, true); - union_builder->add_member(1, "second", int64_builder.get(), "", { 1 }, false); - union_builder->set_name("WCharUnion"); - - - DynamicTypeBuilder_ptr us_builder = m_factory->create_struct_builder(); - us_builder->add_member(0, "my_union", union_builder.get()); - us_builder->set_name("WCharUnionStruct"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(us_builder->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_bounded_string_unit_tests) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortStringStruct"); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(pbType->GetDynamicType()); - - // SERIALIZATION TEST - StringStruct refData; - StringStructPubSubType refDatapb; - - uint32_t payloadSize = static_cast(pbType->getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pbType->serialize(data, &dynamic_payload)); - ASSERT_TRUE(refDatapb.deserialize(&dynamic_payload, &refData)); - - uint32_t static_payloadSize = static_cast(refDatapb.getSerializedSizeProvider(&refData)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_bounded_wstring_unit_tests) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("ShortWStringStruct"); - DynamicData* data = DynamicDataFactory::get_instance()->create_data(pbType->GetDynamicType()); - - // SERIALIZATION TEST - StringStruct refData; - StringStructPubSubType refDatapb; - - uint32_t payloadSize = static_cast(pbType->getSerializedSizeProvider(data)()); - SerializedPayload_t payload(payloadSize); - SerializedPayload_t dynamic_payload(payloadSize); - ASSERT_TRUE(pbType->serialize(data, &dynamic_payload)); - ASSERT_TRUE(refDatapb.deserialize(&dynamic_payload, &refData)); - - uint32_t static_payloadSize = static_cast(refDatapb.getSerializedSizeProvider(&refData)()); - SerializedPayload_t static_payload(static_payloadSize); - ASSERT_TRUE(refDatapb.serialize(&refData, &static_payload)); - ASSERT_TRUE(static_payload.length == static_payloadSize); - ASSERT_FALSE(data->set_string_value("TEST_OVER_LENGTH_LIMITS", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_Bitset_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MyBitSet"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - DynamicTypeBuilder_ptr a_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr b_builder = m_factory->create_bool_builder(); - DynamicTypeBuilder_ptr empty_builder = m_factory->create_byte_builder(); - DynamicTypeBuilder_ptr c_builder = m_factory->create_uint16_builder(); - DynamicTypeBuilder_ptr d_builder = m_factory->create_int16_builder(); - auto a_type = a_builder->build(); - auto b_type = b_builder->build(); - auto e_type = empty_builder->build(); - auto c_type = c_builder->build(); - auto d_type = d_builder->build(); - - // Bitset - DynamicTypeBuilder_ptr builder_ptr = m_factory->create_bitset_builder(); - builder_ptr->add_member(0, "a", a_type); - builder_ptr->add_member(1, "b", b_type); - builder_ptr->add_member(2, "", e_type); - builder_ptr->add_member(3, "c", c_type); - builder_ptr->add_member(4, "d", d_type); - builder_ptr->add_member(5, "", e_type); // Test more than one empty member. Trailing shouldn't affect equallity. - builder_ptr->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "3"); - builder_ptr->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); - builder_ptr->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "1"); - builder_ptr->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "3"); - // The member doesn't exist so the annotation application will fail, and isn't needed. - //builder_ptr->apply_annotation_to_member(2, ANNOTATION_BIT_BOUND_ID, "value", "4"); - //builder_ptr->apply_annotation_to_member(2, ANNOTATION_POSITION_ID, "value", "4"); - builder_ptr->apply_annotation_to_member(3, ANNOTATION_BIT_BOUND_ID, "value", "10"); - builder_ptr->apply_annotation_to_member(3, ANNOTATION_POSITION_ID, "value", "8"); // 4 empty - builder_ptr->apply_annotation_to_member(4, ANNOTATION_BIT_BOUND_ID, "value", "12"); - builder_ptr->apply_annotation_to_member(4, ANNOTATION_POSITION_ID, "value", "18"); - builder_ptr->set_name("MyBitSet"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_Bitmask_test) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("MyBitMask"); - - DynamicTypeBuilderFactory* m_factory = DynamicTypeBuilderFactory::get_instance(); - - // Bitset - DynamicTypeBuilder_ptr builder_ptr = m_factory->create_bitmask_builder(8); - builder_ptr->add_empty_member(0, "flag0"); - builder_ptr->add_empty_member(1, "flag1"); - builder_ptr->add_empty_member(2, "flag2"); - builder_ptr->add_empty_member(5, "flag5"); - builder_ptr->set_name("MyBitMask"); - - ASSERT_TRUE(pbType->GetDynamicType()->equals(builder_ptr->build().get())); - - delete(pbType); - XMLProfileManager::DeleteInstance(); - } -} - -TEST_F(DynamicTypesTests, DynamicType_XML_key_annotation) -{ - using namespace xmlparser; - using namespace types; - - XMLP_ret ret = XMLProfileManager::loadXMLFile(DynamicTypesTests::config_file()); - ASSERT_EQ(ret, XMLP_ret::XML_OK); - - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("BoolStruct"); - ASSERT_FALSE(pbType->m_isGetKeyDefined); - XMLProfileManager::DeleteDynamicPubSubType(pbType); - } - - { - DynamicPubSubType* pbType = XMLProfileManager::CreateDynamicPubSubType("my_keyed_struct"); - ASSERT_TRUE(pbType->m_isGetKeyDefined); - XMLProfileManager::DeleteDynamicPubSubType(pbType); - } - - XMLProfileManager::DeleteInstance(); -} - -TEST(TypeIdentifierTests, MinimalTypeIdentifierComparision) -{ - TypeIdentifier enum1 = *GetMyEnumIdentifier(false); - TypeIdentifier aliasEnum1 = *GetMyAliasEnumIdentifier(false); - TypeIdentifier aliasAliasEnum1 = *GetMyAliasAliasEnumIdentifier(false); - TypeIdentifier boolStruct1 = *GetBoolStructIdentifier(false); - TypeIdentifier octetStruct1 = *GetOctetStructIdentifier(false); - TypeIdentifier shortStruct1 = *GetShortStructIdentifier(false); - TypeIdentifier longStruct1 = *GetLongStructIdentifier(false); - TypeIdentifier longLongStruct1 = *GetLongLongStructIdentifier(false); - TypeIdentifier uShortStruct1 = *GetShortStructIdentifier(false); - TypeIdentifier uLongStruct1 = *GetULongStructIdentifier(false); - TypeIdentifier uLongLongStruct1 = *GetULongLongStructIdentifier(false); - TypeIdentifier floatStruct1 = *GetFloatStructIdentifier(false); - TypeIdentifier doubleStruct1 = *GetDoubleStructIdentifier(false); - TypeIdentifier longDoubleStruct1 = *GetLongDoubleStructIdentifier(false); - TypeIdentifier charStruct1 = *GetCharStructIdentifier(false); - TypeIdentifier wcharStruct1 = *GetWCharStructIdentifier(false); - TypeIdentifier stringStruct1 = *GetStringStructIdentifier(false); - TypeIdentifier wstringStruct1 = *GetWStringStructIdentifier(false); - TypeIdentifier largeStringStruct1 = *GetLargeStringStructIdentifier(false); - TypeIdentifier largeWStringStruct1 = *GetLargeWStringStructIdentifier(false); - TypeIdentifier arrayStruct1 = *GetArraytStructIdentifier(false); - GetMyArrayIdentifier(false); // We need to generate it before arrayArrayStruct - TypeIdentifier arrayArrayStruct1 = *GetArrayArrayStructIdentifier(false); - TypeIdentifier sequenceStruct1 = *GetSequenceStructIdentifier(false); - TypeIdentifier sequenceSequenceStruct1 = *GetSequenceSequenceStructIdentifier(false); - TypeIdentifier mapStruct1 = *GetMapStructIdentifier(false); - TypeIdentifier mapMapStruct1 = *GetMapMapStructIdentifier(false); - TypeIdentifier structStruct1 = *GetStructStructIdentifier(false); - TypeIdentifier structStructStruct1 = *GetStructStructStructIdentifier(false); - TypeIdentifier simpleUnion1 = *GetSimpleUnionIdentifier(false); - TypeIdentifier unionUnion1 = *GetUnionUnionIdentifier(false); - TypeIdentifier wCharUnion1 = *GetWCharUnionIdentifier(false); - TypeIdentifier unionUnionStruct1 = *GetUnionUnionUnionStructIdentifier(false); - TypeObjectFactory::get_instance()->delete_instance(); // Force new instances instead reusing them - registerBasicTypes(); // Register them again - TypeIdentifier enum2 = *GetMyEnumIdentifier(false); - TypeIdentifier aliasEnum2 = *GetMyAliasEnumIdentifier(false); - TypeIdentifier aliasAliasEnum2 = *GetMyAliasAliasEnumIdentifier(false); - TypeIdentifier boolStruct2 = *GetBoolStructIdentifier(false); - TypeIdentifier octetStruct2 = *GetOctetStructIdentifier(false); - TypeIdentifier shortStruct2 = *GetShortStructIdentifier(false); - TypeIdentifier longStruct2 = *GetLongStructIdentifier(false); - TypeIdentifier longLongStruct2 = *GetLongLongStructIdentifier(false); - TypeIdentifier uShortStruct2 = *GetShortStructIdentifier(false); - TypeIdentifier uLongStruct2 = *GetULongStructIdentifier(false); - TypeIdentifier uLongLongStruct2 = *GetULongLongStructIdentifier(false); - TypeIdentifier floatStruct2 = *GetFloatStructIdentifier(false); - TypeIdentifier doubleStruct2 = *GetDoubleStructIdentifier(false); - TypeIdentifier longDoubleStruct2 = *GetLongDoubleStructIdentifier(false); - TypeIdentifier charStruct2 = *GetCharStructIdentifier(false); - TypeIdentifier wcharStruct2 = *GetWCharStructIdentifier(false); - TypeIdentifier stringStruct2 = *GetStringStructIdentifier(false); - TypeIdentifier wstringStruct2 = *GetWStringStructIdentifier(false); - TypeIdentifier largeStringStruct2 = *GetLargeStringStructIdentifier(false); - TypeIdentifier largeWStringStruct2 = *GetLargeWStringStructIdentifier(false); - TypeIdentifier arrayStruct2 = *GetArraytStructIdentifier(false); - TypeIdentifier arrayArrayStruct2 = *GetArrayArrayStructIdentifier(false); - TypeIdentifier sequenceStruct2 = *GetSequenceStructIdentifier(false); - TypeIdentifier sequenceSequenceStruct2 = *GetSequenceSequenceStructIdentifier(false); - TypeIdentifier mapStruct2 = *GetMapStructIdentifier(false); - TypeIdentifier mapMapStruct2 = *GetMapMapStructIdentifier(false); - TypeIdentifier structStruct2 = *GetStructStructIdentifier(false); - TypeIdentifier structStructStruct2 = *GetStructStructStructIdentifier(false); - TypeIdentifier simpleUnion2 = *GetSimpleUnionIdentifier(false); - TypeIdentifier unionUnion2 = *GetUnionUnionIdentifier(false); - TypeIdentifier wCharUnion2 = *GetWCharUnionIdentifier(false); - TypeIdentifier unionUnionStruct2 = *GetUnionUnionUnionStructIdentifier(false); - - // Compare equals - ASSERT_TRUE(enum1 == enum2); - ASSERT_TRUE(aliasEnum1 == aliasEnum2 || aliasEnum2 == enum1); - ASSERT_TRUE(aliasAliasEnum1 == aliasAliasEnum2 || aliasAliasEnum2 == enum1); - ASSERT_TRUE(boolStruct1 == boolStruct2); - ASSERT_TRUE(octetStruct1 == octetStruct2); - ASSERT_TRUE(shortStruct1 == shortStruct2); - ASSERT_TRUE(longStruct1 == longStruct2); - ASSERT_TRUE(longLongStruct1 == longLongStruct2); - ASSERT_TRUE(uShortStruct1 == uShortStruct2); - ASSERT_TRUE(uLongStruct1 == uLongStruct2); - ASSERT_TRUE(uLongLongStruct1 == uLongLongStruct2); - ASSERT_TRUE(floatStruct1 == floatStruct2); - ASSERT_TRUE(doubleStruct1 == doubleStruct2); - ASSERT_TRUE(longDoubleStruct1 == longDoubleStruct2); - ASSERT_TRUE(charStruct1 == charStruct2); - ASSERT_TRUE(wcharStruct1 == wcharStruct2); - ASSERT_TRUE(stringStruct1 == stringStruct2); - ASSERT_TRUE(wstringStruct1 == wstringStruct2); - ASSERT_TRUE(largeStringStruct1 == largeStringStruct2); - ASSERT_TRUE(largeWStringStruct1 == largeWStringStruct2); - ASSERT_TRUE(arrayStruct1 == arrayStruct2); - ASSERT_TRUE(arrayArrayStruct1 == arrayArrayStruct2); - ASSERT_TRUE(sequenceStruct1 == sequenceStruct2); - ASSERT_TRUE(sequenceSequenceStruct1 == sequenceSequenceStruct2); - ASSERT_TRUE(mapStruct1 == mapStruct2); - ASSERT_TRUE(mapMapStruct1 == mapMapStruct2); - ASSERT_TRUE(structStruct1 == structStruct2); - ASSERT_TRUE(structStructStruct1 == structStructStruct2); - ASSERT_TRUE(simpleUnion1 == simpleUnion2); - ASSERT_TRUE(unionUnion1 == unionUnion2); - ASSERT_TRUE(wCharUnion1 == wCharUnion2); - ASSERT_TRUE(unionUnionStruct1 == unionUnionStruct2); - ASSERT_TRUE(enum2 == aliasEnum2); - - // Compare some not equals - ASSERT_FALSE(aliasAliasEnum1 == boolStruct1); - ASSERT_FALSE(octetStruct1 == shortStruct1); - ASSERT_FALSE(longStruct1 == longLongStruct1); - ASSERT_FALSE(uShortStruct1 == uLongStruct1); - ASSERT_FALSE(uLongStruct1 == uLongLongStruct2); - ASSERT_FALSE(floatStruct1 == doubleStruct1); - ASSERT_FALSE(doubleStruct1 == longDoubleStruct2); - ASSERT_FALSE(charStruct1 == wcharStruct1); - ASSERT_FALSE(stringStruct1 == wstringStruct1); - ASSERT_FALSE(stringStruct1 == largeStringStruct2); - ASSERT_FALSE(wstringStruct1 == largeWStringStruct2); - ASSERT_FALSE(arrayStruct1 == arrayArrayStruct1); - ASSERT_FALSE(sequenceStruct1 == sequenceSequenceStruct1); - ASSERT_FALSE(mapStruct1 == mapMapStruct1); - ASSERT_FALSE(structStruct1 == structStructStruct1); - ASSERT_FALSE(simpleUnion1 == unionUnion1); - ASSERT_FALSE(unionUnion1 == wCharUnion2); - ASSERT_FALSE(unionUnionStruct1 == unionUnion1); -} - -int main( - int argc, - char** argv) -{ - eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/dynamic_types/DynamicTypes_4_2_Tests.cpp b/test/unittest/dynamic_types/DynamicTypes_4_2_Tests.cpp deleted file mode 100644 index 217d6531f11..00000000000 --- a/test/unittest/dynamic_types/DynamicTypes_4_2_Tests.cpp +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "idl/new_features_4_2PubSubTypes.h" -#include "idl/new_features_4_2TypeObject.h" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; -using namespace eprosima::fastrtps::types; -using namespace eprosima::fastcdr::exception; - -class DynamicTypes_4_2_Tests : public ::testing::Test -{ - const std::string config_file_ = "types_profile.xml"; - -public: - - DynamicTypes_4_2_Tests() - { - } - - ~DynamicTypes_4_2_Tests() - { - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() override - { - TypeObjectFactory::delete_instance(); - DynamicDataFactory::delete_instance(); - DynamicTypeBuilderFactory::delete_instance(); - } - -}; - -TEST_F(DynamicTypes_4_2_Tests, Inheritance_And_Default_Value) -{ - StructTest struct_test; - ASSERT_TRUE(struct_test.uint64_() == 555); - ASSERT_TRUE(struct_test.int64_() == 0); -} - -TEST_F(DynamicTypes_4_2_Tests, Bitmask) -{ - using namespace bitmodule; - MyBitMask bitmask(static_cast(0)); - - ASSERT_TRUE(bitmask == static_cast(0)); - bitmask = MyBitMaskBits::flag0; - ASSERT_TRUE(bitmask == static_cast(1)); - bitmask = MyBitMaskBits::flag1; - ASSERT_TRUE(bitmask == static_cast(2)); - bitmask = MyBitMaskBits::flag4; - ASSERT_TRUE(bitmask == static_cast(16)); - bitmask = MyBitMaskBits::flag6; - ASSERT_TRUE(bitmask == static_cast(64)); - bitmask = MyBitMaskBits::flag7; - ASSERT_TRUE(bitmask == static_cast(128)); - - bitmask = static_cast(MyBitMaskBits::flag0 | MyBitMaskBits::flag4); - ASSERT_TRUE(bitmask == static_cast(17)); - - bitmask = static_cast(9); - ASSERT_TRUE(bitmask & MyBitMaskBits::flag0); - ASSERT_FALSE(bitmask & MyBitMaskBits::flag1); - ASSERT_FALSE(bitmask & MyBitMaskBits::flag4); -} - -TEST_F(DynamicTypes_4_2_Tests, Bitset) -{ - using namespace bitmodule; - MyBitset mybitset; - - ASSERT_TRUE(mybitset.a() == 0); - ASSERT_TRUE(mybitset.b() == 0); - ASSERT_TRUE(mybitset.c() == 0); - ASSERT_TRUE(mybitset.d() == 0); - ASSERT_TRUE(mybitset.e() == 0); - ASSERT_TRUE(mybitset.f() == 0); - ASSERT_TRUE(mybitset.parent_bitfield() == 0); - - mybitset.a(static_cast(15)); // 00001111 - ASSERT_TRUE(mybitset.a() == 7); // 00000111 - ASSERT_TRUE(mybitset.b() == 0); // b unaffected - ASSERT_FALSE(mybitset.b()); - mybitset.b(true); - ASSERT_TRUE(mybitset.b()); - mybitset.c(static_cast(-1));// 1111111111111111 - ASSERT_TRUE(mybitset.c() == 1023); // 0000001111111111 (2^10 - 1) - mybitset.d(-1); // 1111111111111111 - mybitset.e(5555); // 0001010110110011 (The most significant bit is not stored) - mybitset.f(3851); - ASSERT_TRUE(mybitset.d() == 31); // 0000111111111111 (2^12 - 1) - ASSERT_TRUE(mybitset.e() == 19); // 0000010110110011 (The most significant bit is not stored) - ASSERT_TRUE(mybitset.f() == 11); - mybitset.parent_bitfield(static_cast(-1));// 11111111111111111111111111111111 - ASSERT_TRUE(mybitset.parent_bitfield() == 131071); // 00000000000000111111111111111111 (2^17 - 1) -} - -TEST_F(DynamicTypes_4_2_Tests, Non_Serialized_Annotation) -{ - NewAliases struct_test; - struct_test.int8_(-8); - struct_test.uint8_(8); - struct_test.int16_(-16); - struct_test.uint16_(16); - struct_test.int32_(-32); - struct_test.uint32_(32); - struct_test.int64_(-64); - struct_test.uint64_(64); - struct_test.local_string("DON'T_SERIALIZE"); - - NewAliasesPubSubType pst; - NewAliases destination; - uint32_t payloadSize = static_cast(pst.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t payload(payloadSize); - - pst.serialize(&struct_test, &payload); - pst.deserialize(&payload, &destination); - - ASSERT_TRUE(destination.int8_() == -8); - ASSERT_TRUE(destination.uint8_() == 8); - ASSERT_TRUE(destination.int16_() == -16); - ASSERT_TRUE(destination.uint16_() == 16); - ASSERT_TRUE(destination.int32_() == -32); - ASSERT_TRUE(destination.uint32_() == 32); - ASSERT_TRUE(destination.int64_() == -64); - ASSERT_TRUE(destination.uint64_() == 64); - ASSERT_FALSE(destination.local_string() == "DON'T_SERIALIZE"); // Is non_serialized annotated -} - -TEST_F(DynamicTypes_4_2_Tests, New_Union_Discriminators) -{ - StructTest struct_test; - - ASSERT_TRUE(sizeof(struct_test.int8Union()._d()) == 1); - ASSERT_TRUE(sizeof(struct_test.octetUnion()._d()) == 1); - //ASSERT_TRUE(sizeof(struct_test.charUnion()._d()) == sizeof(wchar_t)); - - // int8Union - struct_test.int8Union().case_three(333); - struct_test.int8Union().case_six(666); - - struct_test.int8Union()._d() = 3; - ASSERT_TRUE(struct_test.int8Union().case_three() == 333); - try - { - ASSERT_FALSE(struct_test.int8Union().case_six() == 666); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.int8Union()._d() = 6; - try - { - ASSERT_FALSE(struct_test.int8Union().case_three() == 333); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.int8Union().case_six() == 666); - - // octetUnion - struct_test.octetUnion().case_five(555); - struct_test.octetUnion().case_seven(777); - - struct_test.octetUnion()._d() = 5; - ASSERT_TRUE(struct_test.octetUnion().case_five() == 555); - try - { - ASSERT_FALSE(struct_test.octetUnion().case_seven() == 777); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.octetUnion()._d() = 7; - try - { - ASSERT_FALSE(struct_test.octetUnion().case_five() == 555); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.octetUnion().case_seven() == 777); - - /* - // charUnion - struct_test.charUnion().case_zero(111); - struct_test.charUnion().case_one(222); - - struct_test.charUnion()._d() = L'a'; - ASSERT_TRUE(struct_test.charUnion().case_zero() == 111); - try - { - ASSERT_FALSE(struct_test.charUnion().case_one() == 222); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - - struct_test.charUnion()._d() = L'b'; - try - { - ASSERT_FALSE(struct_test.charUnion().case_zero() == 111); - ASSERT_TRUE(false); - } - catch (const BadParamException&) - { - } - ASSERT_TRUE(struct_test.charUnion().case_one() == 222); - */ -} - -TEST_F(DynamicTypes_4_2_Tests, TypeObject_DynamicType_Conversion) -{ - registernew_features_4_2Types(); - - // TODO Bitset serialization isn't compatible. - const TypeIdentifier* identifier = GetStructTestIdentifier(true); - const TypeObject* object = GetCompleteStructTestObject(); - - DynamicType_ptr dyn_type = - TypeObjectFactory::get_instance()->build_dynamic_type("StructTest", identifier, object); - - TypeIdentifier conv_identifier; - TypeObject conv_object; - DynamicTypeBuilderFactory::get_instance()->build_type_object(dyn_type, conv_object, true, true); // Avoid factory - DynamicTypeBuilderFactory::get_instance()->build_type_identifier(dyn_type, conv_identifier, true); - - ASSERT_TRUE(*identifier == conv_identifier); - //ASSERT_TRUE(*object == conv_object); //TODO(richiware) Fails because not implemented get appendable flag to - //dynamic_type in `build_dynamic_type()`. - - // Serialize static <-> dynamic - - StructTest struct_test; - DynamicData_ptr dyn_data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - - DynamicPubSubType pst_dynamic(dyn_type); - uint32_t payload_dyn_size = static_cast(pst_dynamic.getSerializedSizeProvider(dyn_data.get())()); - SerializedPayload_t payload(payload_dyn_size); - ASSERT_TRUE(pst_dynamic.serialize(dyn_data.get(), &payload)); - ASSERT_TRUE(payload.length == payload_dyn_size); - - StructTestPubSubType pst_static; - uint32_t payload_size = static_cast(pst_static.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t st_payload(payload_size); - ASSERT_TRUE(pst_static.serialize(&struct_test, &st_payload)); - ASSERT_TRUE(st_payload.length == payload_size); - - DynamicData_ptr dyn_data_from_dynamic(DynamicDataFactory::get_instance()->create_data(dyn_type)); - ASSERT_TRUE(pst_dynamic.deserialize(&payload, dyn_data_from_dynamic.get())); - - types::DynamicData_ptr dyn_data_from_static(DynamicDataFactory::get_instance()->create_data(dyn_type)); - //ASSERT_TRUE(pst_dynamic.deserialize(&st_payload, dyn_data_from_static.get())); //TODO(richiware) Bitsets are not - //serialized correctly currently by DynamicData. - //dynamic_type in `build_dynamic_type()`. - - // DEBUG Printing payloads - /* - std::cout << "Payload: " << std::endl; - for (int i = 0; i < payload_size; ++i) - { - std::cout << std::hex << (uint32_t)(payload.data[i]) << " "; - } - std::cout << std::endl; - std::cout << "ST_Payload: " << std::endl; - for (int i = 0; i < st_payload.length; ++i) - { - std::cout << std::hex << (uint32_t)(st_payload.data[i]) << " "; - } - std::cout << "--------------------------" << std::endl; - */ - ASSERT_TRUE(dyn_data_from_static->equals(dyn_data_from_dynamic.get())); -} - -/* TODO(richiware) Bitsets are not serialized correctly currently by DynamicData. - TEST_F(DynamicTypes_4_2_Tests, Static_Dynamic_Values) - { - registernew_features_4_2Types(); - - const TypeIdentifier* identifier = GetStructTestIdentifier(true); - const TypeObject* object = GetCompleteStructTestObject(); - - DynamicType_ptr dyn_type = - TypeObjectFactory::get_instance()->build_dynamic_type("StructTest", identifier, object); - - // Serialize static initialization with values - StructTest struct_test; - StructTestPubSubType pst_static; - - struct_test.int8_(-8); - struct_test.uint8_(8); - struct_test.int16_(-16); - struct_test.uint16_(16); - struct_test.int32_(-32); - struct_test.uint32_(32); - struct_test.int64_(-64); - struct_test.uint64_(64); - struct_test.local_string("DON'T_SERIALIZE"); - struct_test.charUnion().case_one(11111); - struct_test.octetUnion().case_seven(77777); - struct_test.int8Union().case_three(33333); - struct_test.myStructBits().mybitset().parent_bitfield(2121); - struct_test.myStructBits().mybitset().a(5); - struct_test.myStructBits().mybitset().b(true); - struct_test.myStructBits().mybitset().c(333); - struct_test.myStructBits().mybitset().d(4000); - struct_test.myStructBits().mybitset().e(4001); - struct_test.myStructBits().mybitset().f(3001); - struct_test.myStructBits().mybitmask( - static_cast(bitmodule::MyBitMaskBits::flag0 | bitmodule::MyBitMaskBits::flag4)); - struct_test.myStructBits().two( - static_cast(bitmodule::MyBitMaskBits::flag1 | bitmodule::MyBitMaskBits::flag6)); - struct_test.myStructBits().mylong(static_cast(struct_test.myStructBits().two())); - - // Static serialization - uint32_t payload_size = static_cast(pst_static.getSerializedSizeProvider(&struct_test)()); - SerializedPayload_t st_payload(payload_size); - ASSERT_TRUE(pst_static.serialize(&struct_test, &st_payload)); - ASSERT_TRUE(st_payload.length == payload_size); - - // Dynamic deserialization from static - DynamicPubSubType pst_dynamic(dyn_type); - DynamicData_ptr dyn_data(DynamicDataFactory::get_instance()->create_data(dyn_type)); - ASSERT_TRUE(pst_dynamic.deserialize(&st_payload, dyn_data.get())); - - - // Dynamic serialization - uint32_t payload_dyn_size = static_cast(pst_dynamic.getSerializedSizeProvider(dyn_data.get())()); - SerializedPayload_t dyn_payload(payload_dyn_size); - ASSERT_TRUE(pst_dynamic.serialize(dyn_data.get(), &dyn_payload)); - ASSERT_TRUE(dyn_payload.length == payload_dyn_size); - - // Static deserialization from dynamic - StructTest struct_test_from_dynamic; - ASSERT_TRUE(pst_static.deserialize(&dyn_payload, &struct_test_from_dynamic)); - - // Check values - ASSERT_TRUE(struct_test_from_dynamic.int8_() == struct_test.int8_()); - ASSERT_TRUE(struct_test_from_dynamic.uint8_() == struct_test.uint8_()); - ASSERT_TRUE(struct_test_from_dynamic.int16_() == struct_test.int16_()); - ASSERT_TRUE(struct_test_from_dynamic.uint16_() == struct_test.uint16_()); - ASSERT_TRUE(struct_test_from_dynamic.int32_() == struct_test.int32_()); - ASSERT_TRUE(struct_test_from_dynamic.uint32_() == struct_test.uint32_()); - ASSERT_TRUE(struct_test_from_dynamic.int64_() == struct_test.int64_()); - ASSERT_TRUE(struct_test_from_dynamic.uint64_() == struct_test.uint64_()); - ASSERT_FALSE(struct_test_from_dynamic.local_string() == struct_test.local_string()); // Non serialized - //ASSERT_TRUE(struct_test_from_dynamic.charUnion().case_one() == struct_test.charUnion().case_one()); - ASSERT_TRUE(struct_test_from_dynamic.octetUnion().case_seven() == struct_test.octetUnion().case_seven()); - ASSERT_TRUE(struct_test_from_dynamic.int8Union().case_three() == struct_test.int8Union().case_three()); - ASSERT_TRUE( - struct_test_from_dynamic.myStructBits().mybitset().parent_bitfield() == - struct_test.myStructBits().mybitset().parent_bitfield()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().a() == struct_test.myStructBits().mybitset().a()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().b() == struct_test.myStructBits().mybitset().b()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().c() == struct_test.myStructBits().mybitset().c()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().d() == struct_test.myStructBits().mybitset().d()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().e() == struct_test.myStructBits().mybitset().e()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitset().f() == struct_test.myStructBits().mybitset().f()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mybitmask() == struct_test.myStructBits().mybitmask()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().two() == struct_test.myStructBits().two()); - ASSERT_TRUE(struct_test_from_dynamic.myStructBits().mylong() == struct_test.myStructBits().mylong()); - - ASSERT_TRUE(dyn_data->get_int8_value(dyn_data->get_member_id_by_name("int8_")) == struct_test.int8_()); - ASSERT_TRUE(dyn_data->get_uint8_value(dyn_data->get_member_id_by_name("uint8_")) == struct_test.uint8_()); - ASSERT_TRUE(dyn_data->get_int16_value(dyn_data->get_member_id_by_name("int16_")) == struct_test.int16_()); - ASSERT_TRUE(dyn_data->get_uint16_value(dyn_data->get_member_id_by_name("uint16_")) == struct_test.uint16_()); - ASSERT_TRUE(dyn_data->get_int32_value(dyn_data->get_member_id_by_name("int32_")) == struct_test.int32_()); - ASSERT_TRUE(dyn_data->get_uint32_value(dyn_data->get_member_id_by_name("uint32_")) == struct_test.uint32_()); - ASSERT_TRUE(dyn_data->get_int64_value(dyn_data->get_member_id_by_name("int64_")) == struct_test.int64_()); - ASSERT_TRUE(dyn_data->get_uint64_value(dyn_data->get_member_id_by_name("uint64_")) == struct_test.uint64_()); - ASSERT_FALSE(dyn_data->get_string_value(dyn_data->get_member_id_by_name("local_string")) == - struct_test.local_string()); // Non serialized - - DynamicData* charUnion = dyn_data->loan_value(dyn_data->get_member_id_by_name("charUnion")); - ASSERT_TRUE(charUnion->get_int32_value(charUnion->get_member_id_by_name("case_one")) == - struct_test.charUnion().case_one()); - dyn_data->return_loaned_value(charUnion); - - DynamicData* octetUnion = dyn_data->loan_value(dyn_data->get_member_id_by_name("octetUnion")); - ASSERT_TRUE(octetUnion->get_int32_value(octetUnion->get_member_id_by_name("case_seven")) == - struct_test.octetUnion().case_seven()); - dyn_data->return_loaned_value(octetUnion); - - DynamicData* int8Union = dyn_data->loan_value(dyn_data->get_member_id_by_name("int8Union")); - ASSERT_TRUE(int8Union->get_int32_value(int8Union->get_member_id_by_name("case_three")) == - struct_test.int8Union().case_three()); - dyn_data->return_loaned_value(int8Union); - - DynamicData* myStructBits = dyn_data->loan_value(dyn_data->get_member_id_by_name("myStructBits")); - DynamicData* mybitset = myStructBits->loan_value(myStructBits->get_member_id_by_name("mybitset")); - - ASSERT_TRUE(mybitset->get_uint32_value(mybitset->get_member_id_by_name("parent_bitfield")) - == struct_test.myStructBits().mybitset().parent_bitfield()); - ASSERT_TRUE(mybitset->get_char8_value(mybitset->get_member_id_by_name("a")) - == struct_test.myStructBits().mybitset().a()); - ASSERT_TRUE(mybitset->get_bool_value(mybitset->get_member_id_by_name("b")) - == struct_test.myStructBits().mybitset().b()); - ASSERT_TRUE(mybitset->get_uint16_value(mybitset->get_member_id_by_name("c")) - == struct_test.myStructBits().mybitset().c()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("d")) - == struct_test.myStructBits().mybitset().d()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("e")) - == struct_test.myStructBits().mybitset().e()); - ASSERT_TRUE(mybitset->get_int16_value(mybitset->get_member_id_by_name("f")) - == struct_test.myStructBits().mybitset().f()); - - myStructBits->return_loaned_value(mybitset); - ASSERT_TRUE(myStructBits->get_uint64_value(myStructBits->get_member_id_by_name("mybitmask")) == - struct_test.myStructBits().mybitmask()); - ASSERT_TRUE(myStructBits->get_uint64_value(myStructBits->get_member_id_by_name("two")) == - struct_test.myStructBits().two()); - ASSERT_TRUE(myStructBits->get_int32_value(myStructBits->get_member_id_by_name("mylong")) == - struct_test.myStructBits().mylong()); - dyn_data->return_loaned_value(myStructBits); - } - */ - -int main( - int argc, - char** argv) -{ - eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/dynamic_types/idl/Basic.cxx b/test/unittest/dynamic_types/idl/Basic.cxx deleted file mode 100644 index 90e2adc8191..00000000000 --- a/test/unittest/dynamic_types/idl/Basic.cxx +++ /dev/null @@ -1,3858 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Basic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Basic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "BasicTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -EnumStruct::EnumStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -EnumStruct::~EnumStruct() -{ -} - -EnumStruct::EnumStruct( - const EnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -EnumStruct::EnumStruct( - EnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -EnumStruct& EnumStruct::operator =( - const EnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -EnumStruct& EnumStruct::operator =( - EnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool EnumStruct::operator ==( - const EnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool EnumStruct::operator !=( - const EnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void EnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum EnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& EnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -AliasStruct::AliasStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -AliasStruct::~AliasStruct() -{ -} - -AliasStruct::AliasStruct( - const AliasStruct& x) -{ - m_my_alias = x.m_my_alias; -} - -AliasStruct::AliasStruct( - AliasStruct&& x) noexcept -{ - m_my_alias = x.m_my_alias; -} - -AliasStruct& AliasStruct::operator =( - const AliasStruct& x) -{ - - m_my_alias = x.m_my_alias; - return *this; -} - -AliasStruct& AliasStruct::operator =( - AliasStruct&& x) noexcept -{ - - m_my_alias = x.m_my_alias; - return *this; -} - -bool AliasStruct::operator ==( - const AliasStruct& x) const -{ - return (m_my_alias == x.m_my_alias); -} - -bool AliasStruct::operator !=( - const AliasStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_alias - * @param _my_alias New value for member my_alias - */ -void AliasStruct::my_alias( - MyAliasEnum _my_alias) -{ - m_my_alias = _my_alias; -} - -/*! - * @brief This function returns the value of member my_alias - * @return Value of member my_alias - */ -MyAliasEnum AliasStruct::my_alias() const -{ - return m_my_alias; -} - -/*! - * @brief This function returns a reference to member my_alias - * @return Reference to member my_alias - */ -MyAliasEnum& AliasStruct::my_alias() -{ - return m_my_alias; -} - - - - -AliasAliasStruct::AliasAliasStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -AliasAliasStruct::~AliasAliasStruct() -{ -} - -AliasAliasStruct::AliasAliasStruct( - const AliasAliasStruct& x) -{ - m_my_alias_alias = x.m_my_alias_alias; -} - -AliasAliasStruct::AliasAliasStruct( - AliasAliasStruct&& x) noexcept -{ - m_my_alias_alias = x.m_my_alias_alias; -} - -AliasAliasStruct& AliasAliasStruct::operator =( - const AliasAliasStruct& x) -{ - - m_my_alias_alias = x.m_my_alias_alias; - return *this; -} - -AliasAliasStruct& AliasAliasStruct::operator =( - AliasAliasStruct&& x) noexcept -{ - - m_my_alias_alias = x.m_my_alias_alias; - return *this; -} - -bool AliasAliasStruct::operator ==( - const AliasAliasStruct& x) const -{ - return (m_my_alias_alias == x.m_my_alias_alias); -} - -bool AliasAliasStruct::operator !=( - const AliasAliasStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_alias_alias - * @param _my_alias_alias New value for member my_alias_alias - */ -void AliasAliasStruct::my_alias_alias( - MyAliasAliasEnum _my_alias_alias) -{ - m_my_alias_alias = _my_alias_alias; -} - -/*! - * @brief This function returns the value of member my_alias_alias - * @return Value of member my_alias_alias - */ -MyAliasAliasEnum AliasAliasStruct::my_alias_alias() const -{ - return m_my_alias_alias; -} - -/*! - * @brief This function returns a reference to member my_alias_alias - * @return Reference to member my_alias_alias - */ -MyAliasAliasEnum& AliasAliasStruct::my_alias_alias() -{ - return m_my_alias_alias; -} - - - - -BoolStruct::BoolStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -BoolStruct::~BoolStruct() -{ -} - -BoolStruct::BoolStruct( - const BoolStruct& x) -{ - m_my_bool = x.m_my_bool; -} - -BoolStruct::BoolStruct( - BoolStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; -} - -BoolStruct& BoolStruct::operator =( - const BoolStruct& x) -{ - - m_my_bool = x.m_my_bool; - return *this; -} - -BoolStruct& BoolStruct::operator =( - BoolStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - return *this; -} - -bool BoolStruct::operator ==( - const BoolStruct& x) const -{ - return (m_my_bool == x.m_my_bool); -} - -bool BoolStruct::operator !=( - const BoolStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BoolStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BoolStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BoolStruct::my_bool() -{ - return m_my_bool; -} - - - - -OctetStruct::OctetStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -OctetStruct::~OctetStruct() -{ -} - -OctetStruct::OctetStruct( - const OctetStruct& x) -{ - m_my_octet = x.m_my_octet; -} - -OctetStruct::OctetStruct( - OctetStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; -} - -OctetStruct& OctetStruct::operator =( - const OctetStruct& x) -{ - - m_my_octet = x.m_my_octet; - return *this; -} - -OctetStruct& OctetStruct::operator =( - OctetStruct&& x) noexcept -{ - - m_my_octet = x.m_my_octet; - return *this; -} - -bool OctetStruct::operator ==( - const OctetStruct& x) const -{ - return (m_my_octet == x.m_my_octet); -} - -bool OctetStruct::operator !=( - const OctetStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void OctetStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t OctetStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& OctetStruct::my_octet() -{ - return m_my_octet; -} - - - - -ShortStruct::ShortStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -ShortStruct::~ShortStruct() -{ -} - -ShortStruct::ShortStruct( - const ShortStruct& x) -{ - m_my_int16 = x.m_my_int16; -} - -ShortStruct::ShortStruct( - ShortStruct&& x) noexcept -{ - m_my_int16 = x.m_my_int16; -} - -ShortStruct& ShortStruct::operator =( - const ShortStruct& x) -{ - - m_my_int16 = x.m_my_int16; - return *this; -} - -ShortStruct& ShortStruct::operator =( - ShortStruct&& x) noexcept -{ - - m_my_int16 = x.m_my_int16; - return *this; -} - -bool ShortStruct::operator ==( - const ShortStruct& x) const -{ - return (m_my_int16 == x.m_my_int16); -} - -bool ShortStruct::operator !=( - const ShortStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ -void ShortStruct::my_int16( - int16_t _my_int16) -{ - m_my_int16 = _my_int16; -} - -/*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ -int16_t ShortStruct::my_int16() const -{ - return m_my_int16; -} - -/*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ -int16_t& ShortStruct::my_int16() -{ - return m_my_int16; -} - - - - -LongStruct::LongStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -LongStruct::~LongStruct() -{ -} - -LongStruct::LongStruct( - const LongStruct& x) -{ - m_my_int32 = x.m_my_int32; -} - -LongStruct::LongStruct( - LongStruct&& x) noexcept -{ - m_my_int32 = x.m_my_int32; -} - -LongStruct& LongStruct::operator =( - const LongStruct& x) -{ - - m_my_int32 = x.m_my_int32; - return *this; -} - -LongStruct& LongStruct::operator =( - LongStruct&& x) noexcept -{ - - m_my_int32 = x.m_my_int32; - return *this; -} - -bool LongStruct::operator ==( - const LongStruct& x) const -{ - return (m_my_int32 == x.m_my_int32); -} - -bool LongStruct::operator !=( - const LongStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void LongStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t LongStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& LongStruct::my_int32() -{ - return m_my_int32; -} - - - - -LongLongStruct::LongLongStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -LongLongStruct::~LongLongStruct() -{ -} - -LongLongStruct::LongLongStruct( - const LongLongStruct& x) -{ - m_my_int64 = x.m_my_int64; -} - -LongLongStruct::LongLongStruct( - LongLongStruct&& x) noexcept -{ - m_my_int64 = x.m_my_int64; -} - -LongLongStruct& LongLongStruct::operator =( - const LongLongStruct& x) -{ - - m_my_int64 = x.m_my_int64; - return *this; -} - -LongLongStruct& LongLongStruct::operator =( - LongLongStruct&& x) noexcept -{ - - m_my_int64 = x.m_my_int64; - return *this; -} - -bool LongLongStruct::operator ==( - const LongLongStruct& x) const -{ - return (m_my_int64 == x.m_my_int64); -} - -bool LongLongStruct::operator !=( - const LongLongStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ -void LongLongStruct::my_int64( - int64_t _my_int64) -{ - m_my_int64 = _my_int64; -} - -/*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ -int64_t LongLongStruct::my_int64() const -{ - return m_my_int64; -} - -/*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ -int64_t& LongLongStruct::my_int64() -{ - return m_my_int64; -} - - - - -UShortStruct::UShortStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -UShortStruct::~UShortStruct() -{ -} - -UShortStruct::UShortStruct( - const UShortStruct& x) -{ - m_my_uint16 = x.m_my_uint16; -} - -UShortStruct::UShortStruct( - UShortStruct&& x) noexcept -{ - m_my_uint16 = x.m_my_uint16; -} - -UShortStruct& UShortStruct::operator =( - const UShortStruct& x) -{ - - m_my_uint16 = x.m_my_uint16; - return *this; -} - -UShortStruct& UShortStruct::operator =( - UShortStruct&& x) noexcept -{ - - m_my_uint16 = x.m_my_uint16; - return *this; -} - -bool UShortStruct::operator ==( - const UShortStruct& x) const -{ - return (m_my_uint16 == x.m_my_uint16); -} - -bool UShortStruct::operator !=( - const UShortStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ -void UShortStruct::my_uint16( - uint16_t _my_uint16) -{ - m_my_uint16 = _my_uint16; -} - -/*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ -uint16_t UShortStruct::my_uint16() const -{ - return m_my_uint16; -} - -/*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ -uint16_t& UShortStruct::my_uint16() -{ - return m_my_uint16; -} - - - - -ULongStruct::ULongStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -ULongStruct::~ULongStruct() -{ -} - -ULongStruct::ULongStruct( - const ULongStruct& x) -{ - m_my_uint32 = x.m_my_uint32; -} - -ULongStruct::ULongStruct( - ULongStruct&& x) noexcept -{ - m_my_uint32 = x.m_my_uint32; -} - -ULongStruct& ULongStruct::operator =( - const ULongStruct& x) -{ - - m_my_uint32 = x.m_my_uint32; - return *this; -} - -ULongStruct& ULongStruct::operator =( - ULongStruct&& x) noexcept -{ - - m_my_uint32 = x.m_my_uint32; - return *this; -} - -bool ULongStruct::operator ==( - const ULongStruct& x) const -{ - return (m_my_uint32 == x.m_my_uint32); -} - -bool ULongStruct::operator !=( - const ULongStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ -void ULongStruct::my_uint32( - uint32_t _my_uint32) -{ - m_my_uint32 = _my_uint32; -} - -/*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ -uint32_t ULongStruct::my_uint32() const -{ - return m_my_uint32; -} - -/*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ -uint32_t& ULongStruct::my_uint32() -{ - return m_my_uint32; -} - - - - -ULongLongStruct::ULongLongStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -ULongLongStruct::~ULongLongStruct() -{ -} - -ULongLongStruct::ULongLongStruct( - const ULongLongStruct& x) -{ - m_my_uint64 = x.m_my_uint64; -} - -ULongLongStruct::ULongLongStruct( - ULongLongStruct&& x) noexcept -{ - m_my_uint64 = x.m_my_uint64; -} - -ULongLongStruct& ULongLongStruct::operator =( - const ULongLongStruct& x) -{ - - m_my_uint64 = x.m_my_uint64; - return *this; -} - -ULongLongStruct& ULongLongStruct::operator =( - ULongLongStruct&& x) noexcept -{ - - m_my_uint64 = x.m_my_uint64; - return *this; -} - -bool ULongLongStruct::operator ==( - const ULongLongStruct& x) const -{ - return (m_my_uint64 == x.m_my_uint64); -} - -bool ULongLongStruct::operator !=( - const ULongLongStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ -void ULongLongStruct::my_uint64( - uint64_t _my_uint64) -{ - m_my_uint64 = _my_uint64; -} - -/*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ -uint64_t ULongLongStruct::my_uint64() const -{ - return m_my_uint64; -} - -/*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ -uint64_t& ULongLongStruct::my_uint64() -{ - return m_my_uint64; -} - - - - -FloatStruct::FloatStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -FloatStruct::~FloatStruct() -{ -} - -FloatStruct::FloatStruct( - const FloatStruct& x) -{ - m_my_float32 = x.m_my_float32; -} - -FloatStruct::FloatStruct( - FloatStruct&& x) noexcept -{ - m_my_float32 = x.m_my_float32; -} - -FloatStruct& FloatStruct::operator =( - const FloatStruct& x) -{ - - m_my_float32 = x.m_my_float32; - return *this; -} - -FloatStruct& FloatStruct::operator =( - FloatStruct&& x) noexcept -{ - - m_my_float32 = x.m_my_float32; - return *this; -} - -bool FloatStruct::operator ==( - const FloatStruct& x) const -{ - return (m_my_float32 == x.m_my_float32); -} - -bool FloatStruct::operator !=( - const FloatStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ -void FloatStruct::my_float32( - float _my_float32) -{ - m_my_float32 = _my_float32; -} - -/*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ -float FloatStruct::my_float32() const -{ - return m_my_float32; -} - -/*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ -float& FloatStruct::my_float32() -{ - return m_my_float32; -} - - - - -DoubleStruct::DoubleStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -DoubleStruct::~DoubleStruct() -{ -} - -DoubleStruct::DoubleStruct( - const DoubleStruct& x) -{ - m_my_float64 = x.m_my_float64; -} - -DoubleStruct::DoubleStruct( - DoubleStruct&& x) noexcept -{ - m_my_float64 = x.m_my_float64; -} - -DoubleStruct& DoubleStruct::operator =( - const DoubleStruct& x) -{ - - m_my_float64 = x.m_my_float64; - return *this; -} - -DoubleStruct& DoubleStruct::operator =( - DoubleStruct&& x) noexcept -{ - - m_my_float64 = x.m_my_float64; - return *this; -} - -bool DoubleStruct::operator ==( - const DoubleStruct& x) const -{ - return (m_my_float64 == x.m_my_float64); -} - -bool DoubleStruct::operator !=( - const DoubleStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ -void DoubleStruct::my_float64( - double _my_float64) -{ - m_my_float64 = _my_float64; -} - -/*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ -double DoubleStruct::my_float64() const -{ - return m_my_float64; -} - -/*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ -double& DoubleStruct::my_float64() -{ - return m_my_float64; -} - - - - -LongDoubleStruct::LongDoubleStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -LongDoubleStruct::~LongDoubleStruct() -{ -} - -LongDoubleStruct::LongDoubleStruct( - const LongDoubleStruct& x) -{ - m_my_float128 = x.m_my_float128; -} - -LongDoubleStruct::LongDoubleStruct( - LongDoubleStruct&& x) noexcept -{ - m_my_float128 = x.m_my_float128; -} - -LongDoubleStruct& LongDoubleStruct::operator =( - const LongDoubleStruct& x) -{ - - m_my_float128 = x.m_my_float128; - return *this; -} - -LongDoubleStruct& LongDoubleStruct::operator =( - LongDoubleStruct&& x) noexcept -{ - - m_my_float128 = x.m_my_float128; - return *this; -} - -bool LongDoubleStruct::operator ==( - const LongDoubleStruct& x) const -{ - return (m_my_float128 == x.m_my_float128); -} - -bool LongDoubleStruct::operator !=( - const LongDoubleStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ -void LongDoubleStruct::my_float128( - long double _my_float128) -{ - m_my_float128 = _my_float128; -} - -/*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ -long double LongDoubleStruct::my_float128() const -{ - return m_my_float128; -} - -/*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ -long double& LongDoubleStruct::my_float128() -{ - return m_my_float128; -} - - - - -CharStruct::CharStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -CharStruct::~CharStruct() -{ -} - -CharStruct::CharStruct( - const CharStruct& x) -{ - m_my_char = x.m_my_char; -} - -CharStruct::CharStruct( - CharStruct&& x) noexcept -{ - m_my_char = x.m_my_char; -} - -CharStruct& CharStruct::operator =( - const CharStruct& x) -{ - - m_my_char = x.m_my_char; - return *this; -} - -CharStruct& CharStruct::operator =( - CharStruct&& x) noexcept -{ - - m_my_char = x.m_my_char; - return *this; -} - -bool CharStruct::operator ==( - const CharStruct& x) const -{ - return (m_my_char == x.m_my_char); -} - -bool CharStruct::operator !=( - const CharStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ -void CharStruct::my_char( - char _my_char) -{ - m_my_char = _my_char; -} - -/*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ -char CharStruct::my_char() const -{ - return m_my_char; -} - -/*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ -char& CharStruct::my_char() -{ - return m_my_char; -} - - - - -WCharStruct::WCharStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -WCharStruct::~WCharStruct() -{ -} - -WCharStruct::WCharStruct( - const WCharStruct& x) -{ - m_my_wchar = x.m_my_wchar; -} - -WCharStruct::WCharStruct( - WCharStruct&& x) noexcept -{ - m_my_wchar = x.m_my_wchar; -} - -WCharStruct& WCharStruct::operator =( - const WCharStruct& x) -{ - - m_my_wchar = x.m_my_wchar; - return *this; -} - -WCharStruct& WCharStruct::operator =( - WCharStruct&& x) noexcept -{ - - m_my_wchar = x.m_my_wchar; - return *this; -} - -bool WCharStruct::operator ==( - const WCharStruct& x) const -{ - return (m_my_wchar == x.m_my_wchar); -} - -bool WCharStruct::operator !=( - const WCharStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_wchar - * @param _my_wchar New value for member my_wchar - */ -void WCharStruct::my_wchar( - wchar_t _my_wchar) -{ - m_my_wchar = _my_wchar; -} - -/*! - * @brief This function returns the value of member my_wchar - * @return Value of member my_wchar - */ -wchar_t WCharStruct::my_wchar() const -{ - return m_my_wchar; -} - -/*! - * @brief This function returns a reference to member my_wchar - * @return Reference to member my_wchar - */ -wchar_t& WCharStruct::my_wchar() -{ - return m_my_wchar; -} - - - - -StringStruct::StringStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - - m_my_string = x.m_my_string; - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - -WStringStruct::WStringStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - - m_my_wstring = x.m_my_wstring; - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - - m_my_wstring = std::move(x.m_my_wstring); - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - -LargeStringStruct::LargeStringStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - - m_my_large_string = x.m_my_large_string; - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - - m_my_large_string = std::move(x.m_my_large_string); - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - - m_my_large_wstring = x.m_my_large_wstring; - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - -ArraytStruct::ArraytStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -ArraytStruct::~ArraytStruct() -{ -} - -ArraytStruct::ArraytStruct( - const ArraytStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArraytStruct::ArraytStruct( - ArraytStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArraytStruct& ArraytStruct::operator =( - const ArraytStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArraytStruct& ArraytStruct::operator =( - ArraytStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArraytStruct::operator ==( - const ArraytStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraytStruct::operator !=( - const ArraytStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraytStruct::my_array( - const std::array, 2>, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraytStruct::my_array( - std::array, 2>, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>, 2>& ArraytStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>, 2>& ArraytStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayArrayStruct::ArrayArrayStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -ArrayArrayStruct::~ArrayArrayStruct() -{ -} - -ArrayArrayStruct::ArrayArrayStruct( - const ArrayArrayStruct& x) -{ - m_my_array_array = x.m_my_array_array; -} - -ArrayArrayStruct::ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept -{ - m_my_array_array = std::move(x.m_my_array_array); -} - -ArrayArrayStruct& ArrayArrayStruct::operator =( - const ArrayArrayStruct& x) -{ - - m_my_array_array = x.m_my_array_array; - return *this; -} - -ArrayArrayStruct& ArrayArrayStruct::operator =( - ArrayArrayStruct&& x) noexcept -{ - - m_my_array_array = std::move(x.m_my_array_array); - return *this; -} - -bool ArrayArrayStruct::operator ==( - const ArrayArrayStruct& x) const -{ - return (m_my_array_array == x.m_my_array_array); -} - -bool ArrayArrayStruct::operator !=( - const ArrayArrayStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array_array - * @param _my_array_array New value to be copied in member my_array_array - */ -void ArrayArrayStruct::my_array_array( - const std::array, 2>& _my_array_array) -{ - m_my_array_array = _my_array_array; -} - -/*! - * @brief This function moves the value in member my_array_array - * @param _my_array_array New value to be moved in member my_array_array - */ -void ArrayArrayStruct::my_array_array( - std::array, 2>&& _my_array_array) -{ - m_my_array_array = std::move(_my_array_array); -} - -/*! - * @brief This function returns a constant reference to member my_array_array - * @return Constant reference to member my_array_array - */ -const std::array, 2>& ArrayArrayStruct::my_array_array() const -{ - return m_my_array_array; -} - -/*! - * @brief This function returns a reference to member my_array_array - * @return Reference to member my_array_array - */ -std::array, 2>& ArrayArrayStruct::my_array_array() -{ - return m_my_array_array; -} - - - - - - -SequenceStruct::SequenceStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - -MapStruct::MapStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - -MyBitset::MyBitset(){ - // Just to register all known types - registerBasicTypes(); -} - -MyBitset::~MyBitset() -{ -} - -MyBitset::MyBitset( - const MyBitset& x){ - m_bitset = x.m_bitset; -} - -MyBitset::MyBitset( - MyBitset&& x) noexcept { - m_bitset = x.m_bitset; -} - -MyBitset& MyBitset::operator =( - const MyBitset& x) -{ - - m_bitset = x.m_bitset; - - return *this; -} - -MyBitset& MyBitset::operator =( - MyBitset&& x) noexcept -{ - - m_bitset = x.m_bitset; - - return *this; -} - -bool MyBitset::operator ==( - const MyBitset& x) const -{ - - return m_bitset == x.m_bitset; -} - -bool MyBitset::operator !=( - const MyBitset& x) const -{ - return !(*this == x); -} - - -void MyBitset::a( - char _a) -{ - int base = 0; - int size = 2; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - -} - -char MyBitset::a() const -{ - int base = 0; - int size = 2; - std::bitset<2> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - - -void MyBitset::b( - uint32_t _b) -{ - int base = 10; - int size = 20; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_b & 0x01)); - _b = _b >> 1; - } - -} - -uint32_t MyBitset::b() const -{ - int base = 10; - int size = 20; - std::bitset<20> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<30> MyBitset::bitset() const -{ - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<30>(str_value); -} - -void MyBitset::bitset( - const std::bitset<30>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 30; - m_bitset = std::bitset<30>(str_value.substr(str_value.length() - base_diff, last_post)); -} - - - -BitsetStruct::BitsetStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -BitsetStruct::~BitsetStruct() -{ -} - -BitsetStruct::BitsetStruct( - const BitsetStruct& x) -{ - m_a = x.m_a; -} - -BitsetStruct::BitsetStruct( - BitsetStruct&& x) noexcept -{ - m_a = std::move(x.m_a); -} - -BitsetStruct& BitsetStruct::operator =( - const BitsetStruct& x) -{ - - m_a = x.m_a; - return *this; -} - -BitsetStruct& BitsetStruct::operator =( - BitsetStruct&& x) noexcept -{ - - m_a = std::move(x.m_a); - return *this; -} - -bool BitsetStruct::operator ==( - const BitsetStruct& x) const -{ - return (m_a == x.m_a); -} - -bool BitsetStruct::operator !=( - const BitsetStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member a - * @param _a New value to be copied in member a - */ -void BitsetStruct::a( - const MyBitset& _a) -{ - m_a = _a; -} - -/*! - * @brief This function moves the value in member a - * @param _a New value to be moved in member a - */ -void BitsetStruct::a( - MyBitset&& _a) -{ - m_a = std::move(_a); -} - -/*! - * @brief This function returns a constant reference to member a - * @return Constant reference to member a - */ -const MyBitset& BitsetStruct::a() const -{ - return m_a; -} - -/*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ -MyBitset& BitsetStruct::a() -{ - return m_a; -} - - - - -StructStruct::StructStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -StructStruct::~StructStruct() -{ -} - -StructStruct::StructStruct( - const StructStruct& x) -{ - m_a = x.m_a; - m_b = x.m_b; -} - -StructStruct::StructStruct( - StructStruct&& x) noexcept -{ - m_a = x.m_a; - m_b = x.m_b; -} - -StructStruct& StructStruct::operator =( - const StructStruct& x) -{ - - m_a = x.m_a; - m_b = x.m_b; - return *this; -} - -StructStruct& StructStruct::operator =( - StructStruct&& x) noexcept -{ - - m_a = x.m_a; - m_b = x.m_b; - return *this; -} - -bool StructStruct::operator ==( - const StructStruct& x) const -{ - return (m_a == x.m_a && - m_b == x.m_b); -} - -bool StructStruct::operator !=( - const StructStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ -void StructStruct::a( - int32_t _a) -{ - m_a = _a; -} - -/*! - * @brief This function returns the value of member a - * @return Value of member a - */ -int32_t StructStruct::a() const -{ - return m_a; -} - -/*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ -int32_t& StructStruct::a() -{ - return m_a; -} - - -/*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ -void StructStruct::b( - int64_t _b) -{ - m_b = _b; -} - -/*! - * @brief This function returns the value of member b - * @return Value of member b - */ -int64_t StructStruct::b() const -{ - return m_b; -} - -/*! - * @brief This function returns a reference to member b - * @return Reference to member b - */ -int64_t& StructStruct::b() -{ - return m_b; -} - - - - -StructStructStruct::StructStructStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -StructStructStruct::~StructStructStruct() -{ -} - -StructStructStruct::StructStructStruct( - const StructStructStruct& x) -{ - m_child_struct = x.m_child_struct; - m_child_int64 = x.m_child_int64; -} - -StructStructStruct::StructStructStruct( - StructStructStruct&& x) noexcept -{ - m_child_struct = std::move(x.m_child_struct); - m_child_int64 = x.m_child_int64; -} - -StructStructStruct& StructStructStruct::operator =( - const StructStructStruct& x) -{ - - m_child_struct = x.m_child_struct; - m_child_int64 = x.m_child_int64; - return *this; -} - -StructStructStruct& StructStructStruct::operator =( - StructStructStruct&& x) noexcept -{ - - m_child_struct = std::move(x.m_child_struct); - m_child_int64 = x.m_child_int64; - return *this; -} - -bool StructStructStruct::operator ==( - const StructStructStruct& x) const -{ - return (m_child_struct == x.m_child_struct && - m_child_int64 == x.m_child_int64); -} - -bool StructStructStruct::operator !=( - const StructStructStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member child_struct - * @param _child_struct New value to be copied in member child_struct - */ -void StructStructStruct::child_struct( - const StructStruct& _child_struct) -{ - m_child_struct = _child_struct; -} - -/*! - * @brief This function moves the value in member child_struct - * @param _child_struct New value to be moved in member child_struct - */ -void StructStructStruct::child_struct( - StructStruct&& _child_struct) -{ - m_child_struct = std::move(_child_struct); -} - -/*! - * @brief This function returns a constant reference to member child_struct - * @return Constant reference to member child_struct - */ -const StructStruct& StructStructStruct::child_struct() const -{ - return m_child_struct; -} - -/*! - * @brief This function returns a reference to member child_struct - * @return Reference to member child_struct - */ -StructStruct& StructStructStruct::child_struct() -{ - return m_child_struct; -} - - -/*! - * @brief This function sets a value in member child_int64 - * @param _child_int64 New value for member child_int64 - */ -void StructStructStruct::child_int64( - int64_t _child_int64) -{ - m_child_int64 = _child_int64; -} - -/*! - * @brief This function returns the value of member child_int64 - * @return Value of member child_int64 - */ -int64_t StructStructStruct::child_int64() const -{ - return m_child_int64; -} - -/*! - * @brief This function returns a reference to member child_int64 - * @return Reference to member child_int64 - */ -int64_t& StructStructStruct::child_int64() -{ - return m_child_int64; -} - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -UnionUnion::UnionUnion() -{ - m__d = A; -} - -UnionUnion::~UnionUnion() -{ -} - -UnionUnion::UnionUnion( - const UnionUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -UnionUnion::UnionUnion( - UnionUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = std::move(x.m_second); - - break; - - default: - break; - } -} - -UnionUnion& UnionUnion::operator =( - const UnionUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -UnionUnion& UnionUnion::operator =( - UnionUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = std::move(x.m_second); - - break; - - default: - break; - } - - return *this; -} - -bool UnionUnion::operator ==( - const UnionUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool UnionUnion::operator !=( - const UnionUnion& x) const -{ - return !(*this == x); -} - -void UnionUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t UnionUnion::_d() const -{ - return m__d; -} - -int32_t& UnionUnion::_d() -{ - return m__d; -} - -void UnionUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t UnionUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& UnionUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void UnionUnion::second( - const SimpleUnion& _second) -{ - m_second = _second; - m__d = B; - -} - -void UnionUnion::second( - SimpleUnion&& _second) -{ - m_second = std::move(_second); - m__d = B; - -} - -const SimpleUnion& UnionUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -SimpleUnion& UnionUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -WCharUnion::WCharUnion() -{ - m__d = A; -} - -WCharUnion::~WCharUnion() -{ -} - -WCharUnion::WCharUnion( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -WCharUnion::WCharUnion( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -WCharUnion& WCharUnion::operator =( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -WCharUnion& WCharUnion::operator =( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool WCharUnion::operator ==( - const WCharUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool WCharUnion::operator !=( - const WCharUnion& x) const -{ - return !(*this == x); -} - -void WCharUnion::_d( - wchar_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -wchar_t WCharUnion::_d() const -{ - return m__d; -} - -wchar_t& WCharUnion::_d() -{ - return m__d; -} - -void WCharUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t WCharUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& WCharUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void WCharUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t WCharUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& WCharUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - -UnionUnionUnionStruct::UnionUnionUnionStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -UnionUnionUnionStruct::~UnionUnionUnionStruct() -{ -} - -UnionUnionUnionStruct::UnionUnionUnionStruct( - const UnionUnionUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -UnionUnionUnionStruct::UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( - const UnionUnionUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( - UnionUnionUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool UnionUnionUnionStruct::operator ==( - const UnionUnionUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool UnionUnionUnionStruct::operator !=( - const UnionUnionUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void UnionUnionUnionStruct::my_union( - const UnionUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void UnionUnionUnionStruct::my_union( - UnionUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const UnionUnion& UnionUnionUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -UnionUnion& UnionUnionUnionStruct::my_union() -{ - return m_my_union; -} - - - - -WCharUnionStruct::WCharUnionStruct() -{ - // Just to register all known types - registerBasicTypes(); -} - -WCharUnionStruct::~WCharUnionStruct() -{ -} - -WCharUnionStruct::WCharUnionStruct( - const WCharUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -WCharUnionStruct::WCharUnionStruct( - WCharUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -WCharUnionStruct& WCharUnionStruct::operator =( - const WCharUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -WCharUnionStruct& WCharUnionStruct::operator =( - WCharUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool WCharUnionStruct::operator ==( - const WCharUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool WCharUnionStruct::operator !=( - const WCharUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void WCharUnionStruct::my_union( - const WCharUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void WCharUnionStruct::my_union( - WCharUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const WCharUnion& WCharUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -WCharUnion& WCharUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "BasicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Basic.h b/test/unittest/dynamic_types/idl/Basic.h deleted file mode 100644 index 3f82c93abc2..00000000000 --- a/test/unittest/dynamic_types/idl/Basic.h +++ /dev/null @@ -1,3511 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Basic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Basicv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_BASIC_H_ -#define _FAST_DDS_GENERATED_BASIC_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BASIC_SOURCE) -#define BASIC_DllAPI __declspec( dllexport ) -#else -#define BASIC_DllAPI __declspec( dllimport ) -#endif // BASIC_SOURCE -#else -#define BASIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define BASIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Basic - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasAliasEnum; - - - -/*! - * @brief This class represents the structure EnumStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class EnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - const EnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - EnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - const EnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - EnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - -private: - - MyEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure AliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - const AliasStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - AliasStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - const AliasStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - AliasStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasStruct& x) const; - - /*! - * @brief This function sets a value in member my_alias - * @param _my_alias New value for member my_alias - */ - eProsima_user_DllExport void my_alias( - MyAliasEnum _my_alias); - - /*! - * @brief This function returns the value of member my_alias - * @return Value of member my_alias - */ - eProsima_user_DllExport MyAliasEnum my_alias() const; - - /*! - * @brief This function returns a reference to member my_alias - * @return Reference to member my_alias - */ - eProsima_user_DllExport MyAliasEnum& my_alias(); - -private: - - MyAliasEnum m_my_alias{::A}; - -}; - - -/*! - * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasAliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasAliasStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasAliasStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - const AliasAliasStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - AliasAliasStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - const AliasAliasStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - AliasAliasStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasAliasStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasAliasStruct& x) const; - - /*! - * @brief This function sets a value in member my_alias_alias - * @param _my_alias_alias New value for member my_alias_alias - */ - eProsima_user_DllExport void my_alias_alias( - MyAliasAliasEnum _my_alias_alias); - - /*! - * @brief This function returns the value of member my_alias_alias - * @return Value of member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum my_alias_alias() const; - - /*! - * @brief This function returns a reference to member my_alias_alias - * @return Reference to member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum& my_alias_alias(); - -private: - - MyAliasAliasEnum m_my_alias_alias{::A}; - -}; - - -/*! - * @brief This class represents the structure BoolStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BoolStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BoolStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BoolStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - const BoolStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - BoolStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - const BoolStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - BoolStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BoolStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BoolStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - -private: - - bool m_my_bool{false}; - -}; - - -/*! - * @brief This class represents the structure OctetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class OctetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - const OctetStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - OctetStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - const OctetStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - OctetStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetStruct& x) const; - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - -private: - - uint8_t m_my_octet{0}; - -}; - - -/*! - * @brief This class represents the structure ShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ShortStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ShortStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - const ShortStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - ShortStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - const ShortStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - ShortStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ShortStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ShortStruct& x) const; - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16); - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const; - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16(); - -private: - - int16_t m_my_int16{0}; - -}; - - -/*! - * @brief This class represents the structure LongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - const LongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - LongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - const LongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - LongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongStruct& x) const; - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - -private: - - int32_t m_my_int32{0}; - -}; - - -/*! - * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongLongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongLongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - const LongLongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - LongLongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - const LongLongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - LongLongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongLongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongLongStruct& x) const; - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64); - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const; - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64(); - -private: - - int64_t m_my_int64{0}; - -}; - - -/*! - * @brief This class represents the structure UShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UShortStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UShortStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - const UShortStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - UShortStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - const UShortStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - UShortStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UShortStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UShortStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16); - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const; - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16(); - -private: - - uint16_t m_my_uint16{0}; - -}; - - -/*! - * @brief This class represents the structure ULongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - const ULongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - ULongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - const ULongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - ULongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32); - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const; - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32(); - -private: - - uint32_t m_my_uint32{0}; - -}; - - -/*! - * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongLongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongLongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - const ULongLongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - ULongLongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - const ULongLongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - ULongLongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongLongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongLongStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64); - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const; - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64(); - -private: - - uint64_t m_my_uint64{0}; - -}; - - -/*! - * @brief This class represents the structure FloatStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class FloatStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FloatStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FloatStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - const FloatStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - FloatStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - const FloatStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - FloatStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FloatStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FloatStruct& x) const; - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32); - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const; - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32(); - -private: - - float m_my_float32{0.0}; - -}; - - -/*! - * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class DoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DoubleStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DoubleStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - const DoubleStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - DoubleStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - const DoubleStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - DoubleStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DoubleStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DoubleStruct& x) const; - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64); - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const; - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64(); - -private: - - double m_my_float64{0.0}; - -}; - - -/*! - * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongDoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongDoubleStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongDoubleStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - const LongDoubleStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - LongDoubleStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - const LongDoubleStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - LongDoubleStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongDoubleStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongDoubleStruct& x) const; - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128); - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const; - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128(); - -private: - - long double m_my_float128{0.0}; - -}; - - -/*! - * @brief This class represents the structure CharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class CharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CharStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CharStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - const CharStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - CharStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - const CharStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - CharStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CharStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CharStruct& x) const; - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char); - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const; - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char(); - -private: - - char m_my_char{0}; - -}; - - -/*! - * @brief This class represents the structure WCharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - const WCharStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - WCharStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - const WCharStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - WCharStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharStruct& x) const; - - /*! - * @brief This function sets a value in member my_wchar - * @param _my_wchar New value for member my_wchar - */ - eProsima_user_DllExport void my_wchar( - wchar_t _my_wchar); - - /*! - * @brief This function returns the value of member my_wchar - * @return Value of member my_wchar - */ - eProsima_user_DllExport wchar_t my_wchar() const; - - /*! - * @brief This function returns a reference to member my_wchar - * @return Reference to member my_wchar - */ - eProsima_user_DllExport wchar_t& my_wchar(); - -private: - - wchar_t m_my_wchar{0}; - -}; - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - -private: - - std::wstring m_my_wstring; - -}; - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - -private: - - std::wstring m_my_large_wstring; - -}; - - -/*! - * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArraytStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraytStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraytStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - const ArraytStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - ArraytStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - const ArraytStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - ArraytStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraytStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraytStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>, 2>& my_array(); - -private: - - std::array, 2>, 2> m_my_array{ {{ {{0}} }} }; - -}; -typedef std::array, 2> MyArray; - - - -/*! - * @brief This class represents the structure ArrayArrayStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArrayArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - const ArrayArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - const ArrayArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - ArrayArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array_array - * @param _my_array_array New value to be copied in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - const std::array, 2>& _my_array_array); - - /*! - * @brief This function moves the value in member my_array_array - * @param _my_array_array New value to be moved in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - std::array, 2>&& _my_array_array); - - /*! - * @brief This function returns a constant reference to member my_array_array - * @return Constant reference to member my_array_array - */ - eProsima_user_DllExport const std::array, 2>& my_array_array() const; - - /*! - * @brief This function returns a reference to member my_array_array - * @return Reference to member my_array_array - */ - eProsima_user_DllExport std::array, 2>& my_array_array(); - -private: - - std::array, 2> m_my_array_array{ {{ {{ {{0}} }} }} }; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; -/*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup Basic - */ -class MyBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - char _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport char a() const; - - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - uint32_t _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport uint32_t b() const; - - - eProsima_user_DllExport std::bitset<30> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<30>&); - - - -private: - - std::bitset<30> m_bitset; -}; - - -/*! - * @brief This class represents the structure BitsetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BitsetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - const BitsetStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - BitsetStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - const BitsetStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - BitsetStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetStruct& x) const; - - /*! - * @brief This function copies the value in member a - * @param _a New value to be copied in member a - */ - eProsima_user_DllExport void a( - const MyBitset& _a); - - /*! - * @brief This function moves the value in member a - * @param _a New value to be moved in member a - */ - eProsima_user_DllExport void a( - MyBitset&& _a); - - /*! - * @brief This function returns a constant reference to member a - * @return Constant reference to member a - */ - eProsima_user_DllExport const MyBitset& a() const; - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport MyBitset& a(); - -private: - - MyBitset m_a; - -}; - - -/*! - * @brief This class represents the structure StructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - const StructStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - StructStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - const StructStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - StructStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStruct& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - int32_t _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport int32_t a() const; - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport int32_t& a(); - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - int64_t _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport int64_t b() const; - - /*! - * @brief This function returns a reference to member b - * @return Reference to member b - */ - eProsima_user_DllExport int64_t& b(); - -private: - - int32_t m_a{0}; - int64_t m_b{0}; - -}; - - -/*! - * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStructStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStructStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - const StructStructStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - StructStructStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - const StructStructStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - StructStructStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStructStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStructStruct& x) const; - - /*! - * @brief This function copies the value in member child_struct - * @param _child_struct New value to be copied in member child_struct - */ - eProsima_user_DllExport void child_struct( - const StructStruct& _child_struct); - - /*! - * @brief This function moves the value in member child_struct - * @param _child_struct New value to be moved in member child_struct - */ - eProsima_user_DllExport void child_struct( - StructStruct&& _child_struct); - - /*! - * @brief This function returns a constant reference to member child_struct - * @return Constant reference to member child_struct - */ - eProsima_user_DllExport const StructStruct& child_struct() const; - - /*! - * @brief This function returns a reference to member child_struct - * @return Reference to member child_struct - */ - eProsima_user_DllExport StructStruct& child_struct(); - - - /*! - * @brief This function sets a value in member child_int64 - * @param _child_int64 New value for member child_int64 - */ - eProsima_user_DllExport void child_int64( - int64_t _child_int64); - - /*! - * @brief This function returns the value of member child_int64 - * @return Value of member child_int64 - */ - eProsima_user_DllExport int64_t child_int64() const; - - /*! - * @brief This function returns a reference to member child_int64 - * @return Reference to member child_int64 - */ - eProsima_user_DllExport int64_t& child_int64(); - -private: - - StructStruct m_child_struct; - int64_t m_child_int64{0}; - -}; - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union UnionUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - const UnionUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - UnionUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - const UnionUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - UnionUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function copies the value in member second - * @param _second New value to be copied in member second - */ - eProsima_user_DllExport void second( - const SimpleUnion& _second); - - /*! - * @brief This function moves the value in member second - * @param _second New value to be moved in member second - */ - eProsima_user_DllExport void second( - SimpleUnion&& _second); - - /*! - * @brief This function returns a constant reference to member second - * @return Constant reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const SimpleUnion& second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport SimpleUnion& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - SimpleUnion m_second; -}; - - -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - wchar_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport wchar_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - wchar_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - -private: - - SimpleUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnionUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnionUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnionUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - const UnionUnionUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - const UnionUnionUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - UnionUnionUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnionUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnionUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const UnionUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - UnionUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const UnionUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport UnionUnion& my_union(); - -private: - - UnionUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - const WCharUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - WCharUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - const WCharUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - WCharUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const WCharUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - WCharUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const WCharUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport WCharUnion& my_union(); - -private: - - WCharUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_BASIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Basic.idl b/test/unittest/dynamic_types/idl/Basic.idl deleted file mode 100644 index e800494e7de..00000000000 --- a/test/unittest/dynamic_types/idl/Basic.idl +++ /dev/null @@ -1,204 +0,0 @@ -enum MyEnum -{ - A, - B, - C -}; - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasAliasEnum; - -struct EnumStruct -{ - MyEnum my_enum; -}; - -struct AliasStruct -{ - MyAliasEnum my_alias; -}; - -struct AliasAliasStruct -{ - MyAliasAliasEnum my_alias_alias; -}; - -struct BoolStruct -{ - boolean my_bool; -}; - -struct OctetStruct -{ - octet my_octet; -}; - -struct ShortStruct -{ - short my_int16; -}; - -struct LongStruct -{ - long my_int32; -}; - -struct LongLongStruct -{ - long long my_int64; -}; - -struct UShortStruct -{ - unsigned short my_uint16; -}; - -struct ULongStruct -{ - unsigned long my_uint32; -}; - -struct ULongLongStruct -{ - unsigned long long my_uint64; -}; - -struct FloatStruct -{ - float my_float32; -}; - -struct DoubleStruct -{ - double my_float64; -}; - -struct LongDoubleStruct -{ - long double my_float128; -}; - -struct CharStruct -{ - char my_char; -}; - -struct WCharStruct -{ - wchar my_wchar; -}; - -struct StringStruct -{ - string my_string; -}; - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -struct ArraytStruct -{ - long my_array[2][2][2]; -}; - -typedef long MyArray[2][2]; - -struct ArrayArrayStruct -{ - MyArray my_array_array[2][2]; -}; - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct MapStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -bitset MyBitset -{ - bitfield<2> a; - bitfield<8>; - bitfield<20> b; -}; - -struct BitsetStruct -{ - MyBitset a; -}; - -struct StructStruct -{ - long a; - long long b; -}; - -struct StructStructStruct -{ - StructStruct child_struct; - long long child_int64; -}; - -union SimpleUnion switch (long) -{ - case A: - long first; - case B: - long long second; -}; - -union UnionUnion switch (long) -{ - case A: - long first; - case B: - SimpleUnion second; -}; - -union WCharUnion switch (wchar) -{ - case A: - long first; - case B: - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct UnionUnionUnionStruct -{ - UnionUnion my_union; -}; - -struct WCharUnionStruct -{ - WCharUnion my_union; -}; \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp b/test/unittest/dynamic_types/idl/BasicCdrAux.hpp deleted file mode 100644 index ddb7d2cc3b4..00000000000 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ - -#include "Basic.h" - -constexpr uint32_t ArraytStruct_max_cdr_typesize {36UL}; -constexpr uint32_t ArraytStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WCharUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t WCharUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t OctetStruct_max_cdr_typesize {5UL}; -constexpr uint32_t OctetStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongStruct_max_cdr_typesize {8UL}; -constexpr uint32_t LongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t EnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t EnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BitsetStruct_max_cdr_typesize {8UL}; -constexpr uint32_t BitsetStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t DoubleStruct_max_cdr_typesize {16UL}; -constexpr uint32_t DoubleStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeWStringStruct_max_cdr_typesize {83858UL}; -constexpr uint32_t LargeWStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t WCharStruct_max_cdr_typesize {6UL}; -constexpr uint32_t WCharStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WStringStruct_max_cdr_typesize {518UL}; -constexpr uint32_t WStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStruct_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ULongStruct_max_cdr_typesize {8UL}; -constexpr uint32_t ULongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceStruct_max_cdr_typesize {48UL}; -constexpr uint32_t SequenceSequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t FloatStruct_max_cdr_typesize {8UL}; -constexpr uint32_t FloatStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongDoubleStruct_max_cdr_typesize {24UL}; -constexpr uint32_t LongDoubleStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StructStructStruct_max_cdr_typesize {32UL}; -constexpr uint32_t StructStructStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t UnionUnionUnionStruct_max_cdr_typesize {32UL}; -constexpr uint32_t UnionUnionUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BoolStruct_max_cdr_typesize {5UL}; -constexpr uint32_t BoolStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapMapStruct_max_cdr_typesize {60UL}; -constexpr uint32_t MapMapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t AliasAliasStruct_max_cdr_typesize {8UL}; -constexpr uint32_t AliasAliasStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayArrayStruct_max_cdr_typesize {72UL}; -constexpr uint32_t ArrayArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ShortStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ShortStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t UShortStruct_max_cdr_typesize {6UL}; -constexpr uint32_t UShortStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t ULongLongStruct_max_cdr_typesize {16UL}; -constexpr uint32_t ULongLongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t AliasStruct_max_cdr_typesize {8UL}; -constexpr uint32_t AliasStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeStringStruct_max_cdr_typesize {41934UL}; -constexpr uint32_t LargeStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t CharStruct_max_cdr_typesize {5UL}; -constexpr uint32_t CharStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LongLongStruct_max_cdr_typesize {16UL}; -constexpr uint32_t LongLongStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StringStruct_max_cdr_typesize {264UL}; -constexpr uint32_t StringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StructStruct_max_cdr_typesize {16UL}; -constexpr uint32_t StructStruct_max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const EnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasAliasStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const OctetStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ShortStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongLongStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UShortStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongLongStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const FloatStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const DoubleStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongDoubleStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CharStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraytStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayArrayStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data); - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BitsetStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStructStruct& data); - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UnionUnionUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp b/test/unittest/dynamic_types/idl/BasicCdrAux.ipp deleted file mode 100644 index 98a0f8f1dd5..00000000000 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp +++ /dev/null @@ -1,2926 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ - -#include "BasicCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const EnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const EnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - EnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const EnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const AliasStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_alias(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const AliasStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_alias() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - AliasStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_alias(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const AliasAliasStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_alias_alias(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const AliasAliasStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_alias_alias() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - AliasAliasStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_alias_alias(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const AliasAliasStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BoolStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BoolStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BoolStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const OctetStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_octet(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const OctetStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_octet() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - OctetStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_octet(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const OctetStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ShortStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_int16(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ShortStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_int16() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ShortStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_int16(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ShortStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_int32(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LongStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_int32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_int32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongLongStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_int64(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LongLongStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_int64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongLongStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_int64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongLongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const UShortStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_uint16(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const UShortStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_uint16() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - UShortStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_uint16(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UShortStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ULongStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_uint32(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ULongStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_uint32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ULongStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_uint32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ULongLongStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_uint64(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ULongLongStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_uint64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ULongLongStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_uint64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ULongLongStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const FloatStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_float32(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const FloatStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_float32() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - FloatStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_float32(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const FloatStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const DoubleStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_float64(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const DoubleStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_float64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - DoubleStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_float64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const DoubleStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LongDoubleStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_float128(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LongDoubleStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_float128() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LongDoubleStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_float128(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LongDoubleStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const CharStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_char(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const CharStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_char() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - CharStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_char(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CharStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_wchar(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WCharStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_wchar() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_wchar(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeWStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeWStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArraytStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArraytStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArraytStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraytStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayArrayStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayArrayStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayArrayStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayArrayStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyBitset& data, - size_t& current_alignment) -{ - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyBitset& data) -{ - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - MyBitset& data) -{ - std::bitset<30> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BitsetStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.a(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BitsetStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.a() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BitsetStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.a(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BitsetStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.a(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.b(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StructStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.a() - << eprosima::fastcdr::MemberId(1) << data.b() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.a(); - break; - - case 1: - dcdr >> data.b(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructStructStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.child_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.child_int64(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StructStructStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.child_struct() - << eprosima::fastcdr::MemberId(1) << data.child_int64() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructStructStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.child_struct(); - break; - - case 1: - dcdr >> data.child_int64(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructStructStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const UnionUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const UnionUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - UnionUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WCharUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const UnionUnionUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const UnionUnionUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - UnionUnionUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const UnionUnionUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WCharUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WCharUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx b/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx deleted file mode 100644 index efe25ce72f8..00000000000 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx +++ /dev/null @@ -1,6142 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "BasicPubSubTypes.h" -#include "BasicCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - - - - -EnumStructPubSubType::EnumStructPubSubType() -{ - setName("EnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(EnumStruct::getMaxCdrSerializedSize()); -#else - EnumStruct_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 = EnumStruct_max_key_cdr_typesize > 16 ? EnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -EnumStructPubSubType::~EnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool EnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - EnumStruct* 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; - } - 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 EnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - EnumStruct* 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 EnumStructPubSubType::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* EnumStructPubSubType::createData() -{ - return reinterpret_cast(new EnumStruct()); -} - -void EnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool EnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - EnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - EnumStruct_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 || EnumStruct_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; -} - - - -AliasStructPubSubType::AliasStructPubSubType() -{ - setName("AliasStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(AliasStruct::getMaxCdrSerializedSize()); -#else - AliasStruct_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 = AliasStruct_max_key_cdr_typesize > 16 ? AliasStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -AliasStructPubSubType::~AliasStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool AliasStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - AliasStruct* 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; - } - 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 AliasStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - AliasStruct* 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 AliasStructPubSubType::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* AliasStructPubSubType::createData() -{ - return reinterpret_cast(new AliasStruct()); -} - -void AliasStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool AliasStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - AliasStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AliasStruct_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 || AliasStruct_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; -} - - - -AliasAliasStructPubSubType::AliasAliasStructPubSubType() -{ - setName("AliasAliasStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(AliasAliasStruct::getMaxCdrSerializedSize()); -#else - AliasAliasStruct_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 = AliasAliasStruct_max_key_cdr_typesize > 16 ? AliasAliasStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -AliasAliasStructPubSubType::~AliasAliasStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool AliasAliasStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - AliasAliasStruct* 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; - } - 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 AliasAliasStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - AliasAliasStruct* 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 AliasAliasStructPubSubType::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* AliasAliasStructPubSubType::createData() -{ - return reinterpret_cast(new AliasAliasStruct()); -} - -void AliasAliasStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool AliasAliasStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - AliasAliasStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - AliasAliasStruct_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 || AliasAliasStruct_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; -} - - - -BoolStructPubSubType::BoolStructPubSubType() -{ - setName("BoolStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BoolStruct::getMaxCdrSerializedSize()); -#else - BoolStruct_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 = BoolStruct_max_key_cdr_typesize > 16 ? BoolStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BoolStructPubSubType::~BoolStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BoolStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BoolStruct* 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; - } - 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 BoolStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BoolStruct* 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 BoolStructPubSubType::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* BoolStructPubSubType::createData() -{ - return reinterpret_cast(new BoolStruct()); -} - -void BoolStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BoolStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BoolStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BoolStruct_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 || BoolStruct_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; -} - - - -OctetStructPubSubType::OctetStructPubSubType() -{ - setName("OctetStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(OctetStruct::getMaxCdrSerializedSize()); -#else - OctetStruct_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 = OctetStruct_max_key_cdr_typesize > 16 ? OctetStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -OctetStructPubSubType::~OctetStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool OctetStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - OctetStruct* 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; - } - 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 OctetStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - OctetStruct* 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 OctetStructPubSubType::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* OctetStructPubSubType::createData() -{ - return reinterpret_cast(new OctetStruct()); -} - -void OctetStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool OctetStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - OctetStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - OctetStruct_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 || OctetStruct_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; -} - - - -ShortStructPubSubType::ShortStructPubSubType() -{ - setName("ShortStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ShortStruct::getMaxCdrSerializedSize()); -#else - ShortStruct_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 = ShortStruct_max_key_cdr_typesize > 16 ? ShortStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ShortStructPubSubType::~ShortStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ShortStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ShortStruct* 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; - } - 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 ShortStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ShortStruct* 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 ShortStructPubSubType::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* ShortStructPubSubType::createData() -{ - return reinterpret_cast(new ShortStruct()); -} - -void ShortStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ShortStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ShortStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ShortStruct_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 || ShortStruct_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; -} - - - -LongStructPubSubType::LongStructPubSubType() -{ - setName("LongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongStruct::getMaxCdrSerializedSize()); -#else - LongStruct_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 = LongStruct_max_key_cdr_typesize > 16 ? LongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongStructPubSubType::~LongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongStruct* 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; - } - 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 LongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongStruct* 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 LongStructPubSubType::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* LongStructPubSubType::createData() -{ - return reinterpret_cast(new LongStruct()); -} - -void LongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongStruct_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 || LongStruct_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; -} - - - -LongLongStructPubSubType::LongLongStructPubSubType() -{ - setName("LongLongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongLongStruct::getMaxCdrSerializedSize()); -#else - LongLongStruct_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 = LongLongStruct_max_key_cdr_typesize > 16 ? LongLongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongLongStructPubSubType::~LongLongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongLongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongLongStruct* 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; - } - 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 LongLongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongLongStruct* 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 LongLongStructPubSubType::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* LongLongStructPubSubType::createData() -{ - return reinterpret_cast(new LongLongStruct()); -} - -void LongLongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongLongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongLongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongLongStruct_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 || LongLongStruct_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; -} - - - -UShortStructPubSubType::UShortStructPubSubType() -{ - setName("UShortStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(UShortStruct::getMaxCdrSerializedSize()); -#else - UShortStruct_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 = UShortStruct_max_key_cdr_typesize > 16 ? UShortStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -UShortStructPubSubType::~UShortStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool UShortStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - UShortStruct* 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; - } - 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 UShortStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - UShortStruct* 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 UShortStructPubSubType::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* UShortStructPubSubType::createData() -{ - return reinterpret_cast(new UShortStruct()); -} - -void UShortStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool UShortStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - UShortStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - UShortStruct_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 || UShortStruct_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; -} - - - -ULongStructPubSubType::ULongStructPubSubType() -{ - setName("ULongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ULongStruct::getMaxCdrSerializedSize()); -#else - ULongStruct_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 = ULongStruct_max_key_cdr_typesize > 16 ? ULongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ULongStructPubSubType::~ULongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ULongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ULongStruct* 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; - } - 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 ULongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ULongStruct* 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 ULongStructPubSubType::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* ULongStructPubSubType::createData() -{ - return reinterpret_cast(new ULongStruct()); -} - -void ULongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ULongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ULongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ULongStruct_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 || ULongStruct_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; -} - - - -ULongLongStructPubSubType::ULongLongStructPubSubType() -{ - setName("ULongLongStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ULongLongStruct::getMaxCdrSerializedSize()); -#else - ULongLongStruct_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 = ULongLongStruct_max_key_cdr_typesize > 16 ? ULongLongStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ULongLongStructPubSubType::~ULongLongStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ULongLongStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ULongLongStruct* 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; - } - 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 ULongLongStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ULongLongStruct* 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 ULongLongStructPubSubType::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* ULongLongStructPubSubType::createData() -{ - return reinterpret_cast(new ULongLongStruct()); -} - -void ULongLongStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ULongLongStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ULongLongStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ULongLongStruct_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 || ULongLongStruct_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; -} - - - -FloatStructPubSubType::FloatStructPubSubType() -{ - setName("FloatStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(FloatStruct::getMaxCdrSerializedSize()); -#else - FloatStruct_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 = FloatStruct_max_key_cdr_typesize > 16 ? FloatStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -FloatStructPubSubType::~FloatStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool FloatStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - FloatStruct* 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; - } - 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 FloatStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - FloatStruct* 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 FloatStructPubSubType::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* FloatStructPubSubType::createData() -{ - return reinterpret_cast(new FloatStruct()); -} - -void FloatStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool FloatStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - FloatStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - FloatStruct_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 || FloatStruct_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; -} - - - -DoubleStructPubSubType::DoubleStructPubSubType() -{ - setName("DoubleStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(DoubleStruct::getMaxCdrSerializedSize()); -#else - DoubleStruct_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 = DoubleStruct_max_key_cdr_typesize > 16 ? DoubleStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -DoubleStructPubSubType::~DoubleStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool DoubleStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - DoubleStruct* 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; - } - 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 DoubleStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - DoubleStruct* 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 DoubleStructPubSubType::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* DoubleStructPubSubType::createData() -{ - return reinterpret_cast(new DoubleStruct()); -} - -void DoubleStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool DoubleStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - DoubleStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - DoubleStruct_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 || DoubleStruct_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; -} - - - -LongDoubleStructPubSubType::LongDoubleStructPubSubType() -{ - setName("LongDoubleStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LongDoubleStruct::getMaxCdrSerializedSize()); -#else - LongDoubleStruct_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 = LongDoubleStruct_max_key_cdr_typesize > 16 ? LongDoubleStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LongDoubleStructPubSubType::~LongDoubleStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LongDoubleStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LongDoubleStruct* 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; - } - 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 LongDoubleStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LongDoubleStruct* 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 LongDoubleStructPubSubType::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* LongDoubleStructPubSubType::createData() -{ - return reinterpret_cast(new LongDoubleStruct()); -} - -void LongDoubleStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LongDoubleStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LongDoubleStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LongDoubleStruct_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 || LongDoubleStruct_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; -} - - - -CharStructPubSubType::CharStructPubSubType() -{ - setName("CharStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(CharStruct::getMaxCdrSerializedSize()); -#else - CharStruct_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 = CharStruct_max_key_cdr_typesize > 16 ? CharStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -CharStructPubSubType::~CharStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool CharStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - CharStruct* 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; - } - 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 CharStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - CharStruct* 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 CharStructPubSubType::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* CharStructPubSubType::createData() -{ - return reinterpret_cast(new CharStruct()); -} - -void CharStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool CharStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - CharStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CharStruct_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 || CharStruct_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; -} - - - -WCharStructPubSubType::WCharStructPubSubType() -{ - setName("WCharStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WCharStruct::getMaxCdrSerializedSize()); -#else - WCharStruct_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 = WCharStruct_max_key_cdr_typesize > 16 ? WCharStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WCharStructPubSubType::~WCharStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WCharStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WCharStruct* 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; - } - 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 WCharStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WCharStruct* 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 WCharStructPubSubType::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* WCharStructPubSubType::createData() -{ - return reinterpret_cast(new WCharStruct()); -} - -void WCharStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WCharStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WCharStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WCharStruct_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 || WCharStruct_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; -} - - - -StringStructPubSubType::StringStructPubSubType() -{ - setName("StringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StringStruct::getMaxCdrSerializedSize()); -#else - StringStruct_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 = StringStruct_max_key_cdr_typesize > 16 ? StringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StringStructPubSubType::~StringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StringStruct* 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; - } - 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 StringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StringStruct* 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 StringStructPubSubType::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* StringStructPubSubType::createData() -{ - return reinterpret_cast(new StringStruct()); -} - -void StringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StringStruct_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 || StringStruct_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; -} - - - -WStringStructPubSubType::WStringStructPubSubType() -{ - setName("WStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WStringStruct::getMaxCdrSerializedSize()); -#else - WStringStruct_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 = WStringStruct_max_key_cdr_typesize > 16 ? WStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WStringStructPubSubType::~WStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WStringStruct* 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; - } - 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 WStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WStringStruct* 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 WStringStructPubSubType::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* WStringStructPubSubType::createData() -{ - return reinterpret_cast(new WStringStruct()); -} - -void WStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WStringStruct_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 || WStringStruct_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; -} - - - -LargeStringStructPubSubType::LargeStringStructPubSubType() -{ - setName("LargeStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeStringStruct::getMaxCdrSerializedSize()); -#else - LargeStringStruct_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 = LargeStringStruct_max_key_cdr_typesize > 16 ? LargeStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeStringStructPubSubType::~LargeStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeStringStruct* 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; - } - 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 LargeStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeStringStruct* 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 LargeStringStructPubSubType::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* LargeStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeStringStruct()); -} - -void LargeStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeStringStruct_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 || LargeStringStruct_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; -} - - - -LargeWStringStructPubSubType::LargeWStringStructPubSubType() -{ - setName("LargeWStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); -#else - LargeWStringStruct_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 = LargeWStringStruct_max_key_cdr_typesize > 16 ? LargeWStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeWStringStructPubSubType::~LargeWStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeWStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeWStringStruct* 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; - } - 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 LargeWStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeWStringStruct* 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 LargeWStringStructPubSubType::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* LargeWStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeWStringStruct()); -} - -void LargeWStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeWStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeWStringStruct_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 || LargeWStringStruct_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; -} - - - -ArraytStructPubSubType::ArraytStructPubSubType() -{ - setName("ArraytStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraytStruct::getMaxCdrSerializedSize()); -#else - ArraytStruct_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 = ArraytStruct_max_key_cdr_typesize > 16 ? ArraytStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraytStructPubSubType::~ArraytStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraytStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraytStruct* 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; - } - 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 ArraytStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraytStruct* 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 ArraytStructPubSubType::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* ArraytStructPubSubType::createData() -{ - return reinterpret_cast(new ArraytStruct()); -} - -void ArraytStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraytStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraytStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraytStruct_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 || ArraytStruct_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; -} - - - - - -ArrayArrayStructPubSubType::ArrayArrayStructPubSubType() -{ - setName("ArrayArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayArrayStruct_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 = ArrayArrayStruct_max_key_cdr_typesize > 16 ? ArrayArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayArrayStructPubSubType::~ArrayArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayArrayStruct* 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; - } - 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 ArrayArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayArrayStruct* 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 ArrayArrayStructPubSubType::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* ArrayArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayArrayStruct()); -} - -void ArrayArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayArrayStruct_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 || ArrayArrayStruct_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; -} - - - - - -SequenceStructPubSubType::SequenceStructPubSubType() -{ - setName("SequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceStruct_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 = SequenceStruct_max_key_cdr_typesize > 16 ? SequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructPubSubType::~SequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStruct* 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; - } - 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 SequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStruct* 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 SequenceStructPubSubType::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* SequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceStruct()); -} - -void SequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStruct_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 || SequenceStruct_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; -} - - - - - - - -SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() -{ - setName("SequenceSequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceStruct_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 = SequenceSequenceStruct_max_key_cdr_typesize > 16 ? SequenceSequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceStructPubSubType::~SequenceSequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceStruct* 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; - } - 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 SequenceSequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceStruct* 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 SequenceSequenceStructPubSubType::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* SequenceSequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceStruct()); -} - -void SequenceSequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceStruct_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 || SequenceSequenceStruct_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; -} - - - - - -MapStructPubSubType::MapStructPubSubType() -{ - setName("MapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStruct::getMaxCdrSerializedSize()); -#else - MapStruct_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 = MapStruct_max_key_cdr_typesize > 16 ? MapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructPubSubType::~MapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStruct* 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; - } - 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 MapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStruct* 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 MapStructPubSubType::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* MapStructPubSubType::createData() -{ - return reinterpret_cast(new MapStruct()); -} - -void MapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStruct_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 || MapStruct_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; -} - - - - - - - -MapMapStructPubSubType::MapMapStructPubSubType() -{ - setName("MapMapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapStruct::getMaxCdrSerializedSize()); -#else - MapMapStruct_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 = MapMapStruct_max_key_cdr_typesize > 16 ? MapMapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapStructPubSubType::~MapMapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapStruct* 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; - } - 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 MapMapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapStruct* 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 MapMapStructPubSubType::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* MapMapStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapStruct()); -} - -void MapMapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapStruct_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 || MapMapStruct_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; -} - - - - -BitsetStructPubSubType::BitsetStructPubSubType() -{ - setName("BitsetStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BitsetStruct::getMaxCdrSerializedSize()); -#else - BitsetStruct_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 = BitsetStruct_max_key_cdr_typesize > 16 ? BitsetStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BitsetStructPubSubType::~BitsetStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BitsetStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BitsetStruct* 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; - } - 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 BitsetStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BitsetStruct* 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 BitsetStructPubSubType::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* BitsetStructPubSubType::createData() -{ - return reinterpret_cast(new BitsetStruct()); -} - -void BitsetStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BitsetStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BitsetStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BitsetStruct_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 || BitsetStruct_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; -} - - - -StructStructPubSubType::StructStructPubSubType() -{ - setName("StructStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructStruct::getMaxCdrSerializedSize()); -#else - StructStruct_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 = StructStruct_max_key_cdr_typesize > 16 ? StructStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructStructPubSubType::~StructStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructStruct* 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; - } - 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 StructStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructStruct* 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 StructStructPubSubType::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* StructStructPubSubType::createData() -{ - return reinterpret_cast(new StructStruct()); -} - -void StructStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructStruct_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 || StructStruct_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; -} - - - -StructStructStructPubSubType::StructStructStructPubSubType() -{ - setName("StructStructStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructStructStruct::getMaxCdrSerializedSize()); -#else - StructStructStruct_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 = StructStructStruct_max_key_cdr_typesize > 16 ? StructStructStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructStructStructPubSubType::~StructStructStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructStructStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructStructStruct* 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; - } - 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 StructStructStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructStructStruct* 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 StructStructStructPubSubType::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* StructStructStructPubSubType::createData() -{ - return reinterpret_cast(new StructStructStruct()); -} - -void StructStructStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructStructStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructStructStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructStructStruct_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 || StructStructStruct_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; -} - - - - - - - - - - - - - - - -SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() -{ - setName("SimpleUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionStruct_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 = SimpleUnionStruct_max_key_cdr_typesize > 16 ? SimpleUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructPubSubType::~SimpleUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStruct* 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; - } - 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 SimpleUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStruct* 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 SimpleUnionStructPubSubType::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* SimpleUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStruct()); -} - -void SimpleUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStruct_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 || SimpleUnionStruct_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; -} - - - -UnionUnionUnionStructPubSubType::UnionUnionUnionStructPubSubType() -{ - setName("UnionUnionUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(UnionUnionUnionStruct::getMaxCdrSerializedSize()); -#else - UnionUnionUnionStruct_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 = UnionUnionUnionStruct_max_key_cdr_typesize > 16 ? UnionUnionUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -UnionUnionUnionStructPubSubType::~UnionUnionUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool UnionUnionUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - UnionUnionUnionStruct* 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; - } - 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 UnionUnionUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - UnionUnionUnionStruct* 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 UnionUnionUnionStructPubSubType::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* UnionUnionUnionStructPubSubType::createData() -{ - return reinterpret_cast(new UnionUnionUnionStruct()); -} - -void UnionUnionUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool UnionUnionUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - UnionUnionUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - UnionUnionUnionStruct_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 || UnionUnionUnionStruct_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; -} - - - -WCharUnionStructPubSubType::WCharUnionStructPubSubType() -{ - setName("WCharUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WCharUnionStruct::getMaxCdrSerializedSize()); -#else - WCharUnionStruct_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 = WCharUnionStruct_max_key_cdr_typesize > 16 ? WCharUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WCharUnionStructPubSubType::~WCharUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WCharUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WCharUnionStruct* 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; - } - 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 WCharUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WCharUnionStruct* 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 WCharUnionStructPubSubType::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* WCharUnionStructPubSubType::createData() -{ - return reinterpret_cast(new WCharUnionStruct()); -} - -void WCharUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WCharUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WCharUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WCharUnionStruct_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 || WCharUnionStruct_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; -} - diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h deleted file mode 100644 index 467e624b19b..00000000000 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h +++ /dev/null @@ -1,2950 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Basic.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Basic is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasAliasEnum; - - - -/*! - * @brief This class represents the TopicDataType of the type EnumStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class EnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef EnumStruct type; - - eProsima_user_DllExport EnumStructPubSubType(); - - eProsima_user_DllExport ~EnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type AliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef AliasStruct type; - - eProsima_user_DllExport AliasStructPubSubType(); - - eProsima_user_DllExport ~AliasStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type AliasAliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasAliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef AliasAliasStruct type; - - eProsima_user_DllExport AliasAliasStructPubSubType(); - - eProsima_user_DllExport ~AliasAliasStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BoolStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BoolStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BoolStruct type; - - eProsima_user_DllExport BoolStructPubSubType(); - - eProsima_user_DllExport ~BoolStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type OctetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class OctetStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef OctetStruct type; - - eProsima_user_DllExport OctetStructPubSubType(); - - eProsima_user_DllExport ~OctetStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ShortStruct type; - - eProsima_user_DllExport ShortStructPubSubType(); - - eProsima_user_DllExport ~ShortStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongStruct type; - - eProsima_user_DllExport LongStructPubSubType(); - - eProsima_user_DllExport ~LongStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongLongStruct type; - - eProsima_user_DllExport LongLongStructPubSubType(); - - eProsima_user_DllExport ~LongLongStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type UShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef UShortStruct type; - - eProsima_user_DllExport UShortStructPubSubType(); - - eProsima_user_DllExport ~UShortStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ULongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ULongStruct type; - - eProsima_user_DllExport ULongStructPubSubType(); - - eProsima_user_DllExport ~ULongStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ULongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ULongLongStruct type; - - eProsima_user_DllExport ULongLongStructPubSubType(); - - eProsima_user_DllExport ~ULongLongStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type FloatStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class FloatStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef FloatStruct type; - - eProsima_user_DllExport FloatStructPubSubType(); - - eProsima_user_DllExport ~FloatStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type DoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class DoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef DoubleStruct type; - - eProsima_user_DllExport DoubleStructPubSubType(); - - eProsima_user_DllExport ~DoubleStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LongDoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongDoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LongDoubleStruct type; - - eProsima_user_DllExport LongDoubleStructPubSubType(); - - eProsima_user_DllExport ~LongDoubleStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type CharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class CharStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef CharStruct type; - - eProsima_user_DllExport CharStructPubSubType(); - - eProsima_user_DllExport ~CharStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WCharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WCharStruct type; - - eProsima_user_DllExport WCharStructPubSubType(); - - eProsima_user_DllExport ~WCharStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StringStruct type; - - eProsima_user_DllExport StringStructPubSubType(); - - eProsima_user_DllExport ~StringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WStringStruct type; - - eProsima_user_DllExport WStringStructPubSubType(); - - eProsima_user_DllExport ~WStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeStringStruct type; - - eProsima_user_DllExport LargeStringStructPubSubType(); - - eProsima_user_DllExport ~LargeStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeWStringStruct type; - - eProsima_user_DllExport LargeWStringStructPubSubType(); - - eProsima_user_DllExport ~LargeWStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArraytStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArraytStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraytStruct type; - - eProsima_user_DllExport ArraytStructPubSubType(); - - eProsima_user_DllExport ~ArraytStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef std::array, 2> MyArray; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayArrayStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArrayArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayArrayStruct type; - - eProsima_user_DllExport ArrayArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayArrayStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStruct type; - - eProsima_user_DllExport SequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceStruct type; - - eProsima_user_DllExport SequenceSequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStruct type; - - eProsima_user_DllExport MapStructPubSubType(); - - eProsima_user_DllExport ~MapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapStruct type; - - eProsima_user_DllExport MapMapStructPubSubType(); - - eProsima_user_DllExport ~MapMapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - -/*! - * @brief This class represents the TopicDataType of the type BitsetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BitsetStruct type; - - eProsima_user_DllExport BitsetStructPubSubType(); - - eProsima_user_DllExport ~BitsetStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructStruct type; - - eProsima_user_DllExport StructStructPubSubType(); - - eProsima_user_DllExport ~StructStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StructStructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructStructStruct type; - - eProsima_user_DllExport StructStructStructPubSubType(); - - eProsima_user_DllExport ~StructStructStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStruct type; - - eProsima_user_DllExport SimpleUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type UnionUnionUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnionUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef UnionUnionUnionStruct type; - - eProsima_user_DllExport UnionUnionUnionStructPubSubType(); - - eProsima_user_DllExport ~UnionUnionUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WCharUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WCharUnionStruct type; - - eProsima_user_DllExport WCharUnionStructPubSubType(); - - eProsima_user_DllExport ~WCharUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_BASIC_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/BasicTypeObject.cxx b/test/unittest/dynamic_types/idl/BasicTypeObject.cxx deleted file mode 100644 index 282c8898fe4..00000000000 --- a/test/unittest/dynamic_types/idl/BasicTypeObject.cxx +++ /dev/null @@ -1,7817 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Basic.h" -#include "BasicTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerBasicTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasAliasEnum", GetMyAliasAliasEnumIdentifier(true), - GetMyAliasAliasEnumObject(true)); - factory->add_type_object("MyAliasAliasEnum", GetMyAliasAliasEnumIdentifier(false), - GetMyAliasAliasEnumObject(false)); - - - factory->add_type_object("EnumStruct", GetEnumStructIdentifier(true), - GetEnumStructObject(true)); - factory->add_type_object("EnumStruct", GetEnumStructIdentifier(false), - GetEnumStructObject(false)); - - - factory->add_type_object("AliasStruct", GetAliasStructIdentifier(true), - GetAliasStructObject(true)); - factory->add_type_object("AliasStruct", GetAliasStructIdentifier(false), - GetAliasStructObject(false)); - - - factory->add_type_object("AliasAliasStruct", GetAliasAliasStructIdentifier(true), - GetAliasAliasStructObject(true)); - factory->add_type_object("AliasAliasStruct", GetAliasAliasStructIdentifier(false), - GetAliasAliasStructObject(false)); - - - factory->add_type_object("BoolStruct", GetBoolStructIdentifier(true), - GetBoolStructObject(true)); - factory->add_type_object("BoolStruct", GetBoolStructIdentifier(false), - GetBoolStructObject(false)); - - - factory->add_type_object("OctetStruct", GetOctetStructIdentifier(true), - GetOctetStructObject(true)); - factory->add_type_object("OctetStruct", GetOctetStructIdentifier(false), - GetOctetStructObject(false)); - - - factory->add_type_object("ShortStruct", GetShortStructIdentifier(true), - GetShortStructObject(true)); - factory->add_type_object("ShortStruct", GetShortStructIdentifier(false), - GetShortStructObject(false)); - - - factory->add_type_object("LongStruct", GetLongStructIdentifier(true), - GetLongStructObject(true)); - factory->add_type_object("LongStruct", GetLongStructIdentifier(false), - GetLongStructObject(false)); - - - factory->add_type_object("LongLongStruct", GetLongLongStructIdentifier(true), - GetLongLongStructObject(true)); - factory->add_type_object("LongLongStruct", GetLongLongStructIdentifier(false), - GetLongLongStructObject(false)); - - - factory->add_type_object("UShortStruct", GetUShortStructIdentifier(true), - GetUShortStructObject(true)); - factory->add_type_object("UShortStruct", GetUShortStructIdentifier(false), - GetUShortStructObject(false)); - - - factory->add_type_object("ULongStruct", GetULongStructIdentifier(true), - GetULongStructObject(true)); - factory->add_type_object("ULongStruct", GetULongStructIdentifier(false), - GetULongStructObject(false)); - - - factory->add_type_object("ULongLongStruct", GetULongLongStructIdentifier(true), - GetULongLongStructObject(true)); - factory->add_type_object("ULongLongStruct", GetULongLongStructIdentifier(false), - GetULongLongStructObject(false)); - - - factory->add_type_object("FloatStruct", GetFloatStructIdentifier(true), - GetFloatStructObject(true)); - factory->add_type_object("FloatStruct", GetFloatStructIdentifier(false), - GetFloatStructObject(false)); - - - factory->add_type_object("DoubleStruct", GetDoubleStructIdentifier(true), - GetDoubleStructObject(true)); - factory->add_type_object("DoubleStruct", GetDoubleStructIdentifier(false), - GetDoubleStructObject(false)); - - - factory->add_type_object("LongDoubleStruct", GetLongDoubleStructIdentifier(true), - GetLongDoubleStructObject(true)); - factory->add_type_object("LongDoubleStruct", GetLongDoubleStructIdentifier(false), - GetLongDoubleStructObject(false)); - - - factory->add_type_object("CharStruct", GetCharStructIdentifier(true), - GetCharStructObject(true)); - factory->add_type_object("CharStruct", GetCharStructIdentifier(false), - GetCharStructObject(false)); - - - factory->add_type_object("WCharStruct", GetWCharStructIdentifier(true), - GetWCharStructObject(true)); - factory->add_type_object("WCharStruct", GetWCharStructIdentifier(false), - GetWCharStructObject(false)); - - - factory->add_type_object("StringStruct", GetStringStructIdentifier(true), - GetStringStructObject(true)); - factory->add_type_object("StringStruct", GetStringStructIdentifier(false), - GetStringStructObject(false)); - - - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(true), - GetWStringStructObject(true)); - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(false), - GetWStringStructObject(false)); - - - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(true), - GetLargeStringStructObject(true)); - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(false), - GetLargeStringStructObject(false)); - - - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(true), - GetLargeWStringStructObject(true)); - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(false), - GetLargeWStringStructObject(false)); - - - factory->add_type_object("ArraytStruct", GetArraytStructIdentifier(true), - GetArraytStructObject(true)); - factory->add_type_object("ArraytStruct", GetArraytStructIdentifier(false), - GetArraytStructObject(false)); - - - factory->add_type_object("MyArray", GetMyArrayIdentifier(true), - GetMyArrayObject(true)); - factory->add_type_object("MyArray", GetMyArrayIdentifier(false), - GetMyArrayObject(false)); - - - factory->add_type_object("ArrayArrayStruct", GetArrayArrayStructIdentifier(true), - GetArrayArrayStructObject(true)); - factory->add_type_object("ArrayArrayStruct", GetArrayArrayStructIdentifier(false), - GetArrayArrayStructObject(false)); - - - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(true), - GetSequenceStructObject(true)); - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(false), - GetSequenceStructObject(false)); - - - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(true), - GetSequenceSequenceStructObject(true)); - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(false), - GetSequenceSequenceStructObject(false)); - - - factory->add_type_object("MapStruct", GetMapStructIdentifier(true), - GetMapStructObject(true)); - factory->add_type_object("MapStruct", GetMapStructIdentifier(false), - GetMapStructObject(false)); - - - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(true), - GetMapMapStructObject(true)); - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(false), - GetMapMapStructObject(false)); - - - factory->add_type_object("MyBitset", GetMyBitsetIdentifier(true), - GetMyBitsetObject(true)); - factory->add_type_object("MyBitset", GetMyBitsetIdentifier(false), - GetMyBitsetObject(false)); - - - factory->add_type_object("BitsetStruct", GetBitsetStructIdentifier(true), - GetBitsetStructObject(true)); - factory->add_type_object("BitsetStruct", GetBitsetStructIdentifier(false), - GetBitsetStructObject(false)); - - - factory->add_type_object("StructStruct", GetStructStructIdentifier(true), - GetStructStructObject(true)); - factory->add_type_object("StructStruct", GetStructStructIdentifier(false), - GetStructStructObject(false)); - - - factory->add_type_object("StructStructStruct", GetStructStructStructIdentifier(true), - GetStructStructStructObject(true)); - factory->add_type_object("StructStructStruct", GetStructStructStructIdentifier(false), - GetStructStructStructObject(false)); - - - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(true), - GetSimpleUnionObject(true)); - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(false), - GetSimpleUnionObject(false)); - - - factory->add_type_object("UnionUnion", GetUnionUnionIdentifier(true), - GetUnionUnionObject(true)); - factory->add_type_object("UnionUnion", GetUnionUnionIdentifier(false), - GetUnionUnionObject(false)); - - - factory->add_type_object("WCharUnion", GetWCharUnionIdentifier(true), - GetWCharUnionObject(true)); - factory->add_type_object("WCharUnion", GetWCharUnionIdentifier(false), - GetWCharUnionObject(false)); - - - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(true), - GetSimpleUnionStructObject(true)); - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(false), - GetSimpleUnionStructObject(false)); - - - factory->add_type_object("UnionUnionUnionStruct", GetUnionUnionUnionStructIdentifier(true), - GetUnionUnionUnionStructObject(true)); - factory->add_type_object("UnionUnionUnionStruct", GetUnionUnionUnionStructIdentifier(false), - GetUnionUnionUnionStructObject(false)); - - - factory->add_type_object("WCharUnionStruct", GetWCharUnionStructIdentifier(true), - GetWCharUnionStructObject(true)); - factory->add_type_object("WCharUnionStruct", GetWCharUnionStructIdentifier(false), - GetWCharUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - -const TypeIdentifier* GetMyAliasAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasAliasEnum", complete); -} - -const TypeObject* GetMyAliasAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasAliasEnumObject(); - } - else - { - return GetMinimalMyAliasAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasAliasEnum", "MyAliasEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyAliasEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasAliasEnum", "MyAliasEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", true); -} - - - -const TypeIdentifier* GetEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("EnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("EnumStruct", complete); -} - -const TypeObject* GetEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteEnumStructObject(); - } - //else - return GetMinimalEnumStructObject(); -} - -const TypeObject* GetMinimalEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("EnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("EnumStruct", false); -} - -const TypeObject* GetCompleteEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("EnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("EnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("EnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("EnumStruct", true); -} - - - -const TypeIdentifier* GetAliasStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("AliasStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetAliasStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("AliasStruct", complete); -} - -const TypeObject* GetAliasStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteAliasStructObject(); - } - //else - return GetMinimalAliasStructObject(); -} - -const TypeObject* GetMinimalAliasStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_alias; - mst_my_alias.common().member_id(memberId++); - mst_my_alias.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_alias.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_alias.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_alias.common().member_flags().IS_OPTIONAL(false); - mst_my_alias.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_alias.common().member_flags().IS_KEY(false); - mst_my_alias.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_alias.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_alias_hash("my_alias"); - for(int i = 0; i < 4; ++i) - { - mst_my_alias.detail().name_hash()[i] = my_alias_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_alias); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AliasStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AliasStruct", false); -} - -const TypeObject* GetCompleteAliasStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_alias; - cst_my_alias.common().member_id(memberId++); - cst_my_alias.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_alias.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_alias.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_alias.common().member_flags().IS_OPTIONAL(false); - cst_my_alias.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_alias.common().member_flags().IS_KEY(false); - cst_my_alias.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_alias.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_alias.detail().name("my_alias"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_alias); - - - // Header - type_object->complete().struct_type().header().detail().type_name("AliasStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AliasStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AliasStruct", true); -} - - - -const TypeIdentifier* GetAliasAliasStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("AliasAliasStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetAliasAliasStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("AliasAliasStruct", complete); -} - -const TypeObject* GetAliasAliasStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteAliasAliasStructObject(); - } - //else - return GetMinimalAliasAliasStructObject(); -} - -const TypeObject* GetMinimalAliasAliasStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_alias_alias; - mst_my_alias_alias.common().member_id(memberId++); - mst_my_alias_alias.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_alias_alias.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_alias_alias.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_alias_alias.common().member_flags().IS_OPTIONAL(false); - mst_my_alias_alias.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_alias_alias.common().member_flags().IS_KEY(false); - mst_my_alias_alias.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_alias_alias.common().member_type_id(*GetMyAliasAliasEnumIdentifier(false)); - - MD5 my_alias_alias_hash("my_alias_alias"); - for(int i = 0; i < 4; ++i) - { - mst_my_alias_alias.detail().name_hash()[i] = my_alias_alias_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_alias_alias); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AliasAliasStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", false); -} - -const TypeObject* GetCompleteAliasAliasStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_alias_alias; - cst_my_alias_alias.common().member_id(memberId++); - cst_my_alias_alias.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_alias_alias.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_alias_alias.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_alias_alias.common().member_flags().IS_OPTIONAL(false); - cst_my_alias_alias.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_alias_alias.common().member_flags().IS_KEY(false); - cst_my_alias_alias.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_alias_alias.common().member_type_id(*GetMyAliasAliasEnumIdentifier(true)); - - cst_my_alias_alias.detail().name("my_alias_alias"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_alias_alias); - - - // Header - type_object->complete().struct_type().header().detail().type_name("AliasAliasStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("AliasAliasStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", true); -} - - - -const TypeIdentifier* GetBoolStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BoolStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBoolStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BoolStruct", complete); -} - -const TypeObject* GetBoolStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BoolStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBoolStructObject(); - } - //else - return GetMinimalBoolStructObject(); -} - -const TypeObject* GetMinimalBoolStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BoolStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BoolStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BoolStruct", false); -} - -const TypeObject* GetCompleteBoolStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BoolStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BoolStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BoolStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BoolStruct", true); -} - - - -const TypeIdentifier* GetOctetStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("OctetStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetOctetStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("OctetStruct", complete); -} - -const TypeObject* GetOctetStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteOctetStructObject(); - } - //else - return GetMinimalOctetStructObject(); -} - -const TypeObject* GetMinimalOctetStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_octet; - mst_my_octet.common().member_id(memberId++); - mst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_octet.common().member_flags().IS_KEY(false); - mst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_octet_hash("my_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_octet.detail().name_hash()[i] = my_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_octet); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("OctetStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("OctetStruct", false); -} - -const TypeObject* GetCompleteOctetStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_octet; - cst_my_octet.common().member_id(memberId++); - cst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_octet.common().member_flags().IS_KEY(false); - cst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_octet.detail().name("my_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_octet); - - - // Header - type_object->complete().struct_type().header().detail().type_name("OctetStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("OctetStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("OctetStruct", true); -} - - - -const TypeIdentifier* GetShortStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ShortStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetShortStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ShortStruct", complete); -} - -const TypeObject* GetShortStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ShortStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteShortStructObject(); - } - //else - return GetMinimalShortStructObject(); -} - -const TypeObject* GetMinimalShortStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ShortStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_int16; - mst_my_int16.common().member_id(memberId++); - mst_my_int16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int16.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int16.common().member_flags().IS_OPTIONAL(false); - mst_my_int16.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int16.common().member_flags().IS_KEY(false); - mst_my_int16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - MD5 my_int16_hash("my_int16"); - for(int i = 0; i < 4; ++i) - { - mst_my_int16.detail().name_hash()[i] = my_int16_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int16); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ShortStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ShortStruct", false); -} - -const TypeObject* GetCompleteShortStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ShortStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_int16; - cst_my_int16.common().member_id(memberId++); - cst_my_int16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int16.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int16.common().member_flags().IS_OPTIONAL(false); - cst_my_int16.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int16.common().member_flags().IS_KEY(false); - cst_my_int16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - cst_my_int16.detail().name("my_int16"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int16); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ShortStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ShortStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ShortStruct", true); -} - - - -const TypeIdentifier* GetLongStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLongStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LongStruct", complete); -} - -const TypeObject* GetLongStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLongStructObject(); - } - //else - return GetMinimalLongStructObject(); -} - -const TypeObject* GetMinimalLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongStruct", false); -} - -const TypeObject* GetCompleteLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LongStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongStruct", true); -} - - - -const TypeIdentifier* GetLongLongStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongLongStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLongLongStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LongLongStruct", complete); -} - -const TypeObject* GetLongLongStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLongLongStructObject(); - } - //else - return GetMinimalLongLongStructObject(); -} - -const TypeObject* GetMinimalLongLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_int64; - mst_my_int64.common().member_id(memberId++); - mst_my_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int64.common().member_flags().IS_OPTIONAL(false); - mst_my_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int64.common().member_flags().IS_KEY(false); - mst_my_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 my_int64_hash("my_int64"); - for(int i = 0; i < 4; ++i) - { - mst_my_int64.detail().name_hash()[i] = my_int64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int64); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongLongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", false); -} - -const TypeObject* GetCompleteLongLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_int64; - cst_my_int64.common().member_id(memberId++); - cst_my_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int64.common().member_flags().IS_OPTIONAL(false); - cst_my_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int64.common().member_flags().IS_KEY(false); - cst_my_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_my_int64.detail().name("my_int64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int64); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LongLongStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongLongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", true); -} - - - -const TypeIdentifier* GetUShortStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UShortStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetUShortStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("UShortStruct", complete); -} - -const TypeObject* GetUShortStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UShortStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteUShortStructObject(); - } - //else - return GetMinimalUShortStructObject(); -} - -const TypeObject* GetMinimalUShortStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UShortStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_uint16; - mst_my_uint16.common().member_id(memberId++); - mst_my_uint16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint16.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint16.common().member_flags().IS_OPTIONAL(false); - mst_my_uint16.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint16.common().member_flags().IS_KEY(false); - mst_my_uint16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 my_uint16_hash("my_uint16"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint16.detail().name_hash()[i] = my_uint16_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint16); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UShortStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("UShortStruct", false); -} - -const TypeObject* GetCompleteUShortStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UShortStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_uint16; - cst_my_uint16.common().member_id(memberId++); - cst_my_uint16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint16.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint16.common().member_flags().IS_OPTIONAL(false); - cst_my_uint16.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint16.common().member_flags().IS_KEY(false); - cst_my_uint16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_my_uint16.detail().name("my_uint16"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint16); - - - // Header - type_object->complete().struct_type().header().detail().type_name("UShortStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UShortStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("UShortStruct", true); -} - - - -const TypeIdentifier* GetULongStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ULongStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetULongStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ULongStruct", complete); -} - -const TypeObject* GetULongStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteULongStructObject(); - } - //else - return GetMinimalULongStructObject(); -} - -const TypeObject* GetMinimalULongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_uint32; - mst_my_uint32.common().member_id(memberId++); - mst_my_uint32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint32.common().member_flags().IS_OPTIONAL(false); - mst_my_uint32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint32.common().member_flags().IS_KEY(false); - mst_my_uint32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 my_uint32_hash("my_uint32"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint32.detail().name_hash()[i] = my_uint32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint32); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ULongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ULongStruct", false); -} - -const TypeObject* GetCompleteULongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_uint32; - cst_my_uint32.common().member_id(memberId++); - cst_my_uint32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint32.common().member_flags().IS_OPTIONAL(false); - cst_my_uint32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint32.common().member_flags().IS_KEY(false); - cst_my_uint32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_my_uint32.detail().name("my_uint32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint32); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ULongStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ULongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ULongStruct", true); -} - - - -const TypeIdentifier* GetULongLongStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ULongLongStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetULongLongStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ULongLongStruct", complete); -} - -const TypeObject* GetULongLongStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteULongLongStructObject(); - } - //else - return GetMinimalULongLongStructObject(); -} - -const TypeObject* GetMinimalULongLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_uint64; - mst_my_uint64.common().member_id(memberId++); - mst_my_uint64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint64.common().member_flags().IS_OPTIONAL(false); - mst_my_uint64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint64.common().member_flags().IS_KEY(false); - mst_my_uint64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - MD5 my_uint64_hash("my_uint64"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint64.detail().name_hash()[i] = my_uint64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint64); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ULongLongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", false); -} - -const TypeObject* GetCompleteULongLongStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_uint64; - cst_my_uint64.common().member_id(memberId++); - cst_my_uint64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint64.common().member_flags().IS_OPTIONAL(false); - cst_my_uint64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint64.common().member_flags().IS_KEY(false); - cst_my_uint64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - cst_my_uint64.detail().name("my_uint64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint64); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ULongLongStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ULongLongStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", true); -} - - - -const TypeIdentifier* GetFloatStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("FloatStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetFloatStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("FloatStruct", complete); -} - -const TypeObject* GetFloatStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("FloatStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteFloatStructObject(); - } - //else - return GetMinimalFloatStructObject(); -} - -const TypeObject* GetMinimalFloatStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("FloatStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_float32; - mst_my_float32.common().member_id(memberId++); - mst_my_float32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float32.common().member_flags().IS_OPTIONAL(false); - mst_my_float32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float32.common().member_flags().IS_KEY(false); - mst_my_float32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - MD5 my_float32_hash("my_float32"); - for(int i = 0; i < 4; ++i) - { - mst_my_float32.detail().name_hash()[i] = my_float32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float32); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("FloatStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("FloatStruct", false); -} - -const TypeObject* GetCompleteFloatStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("FloatStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_float32; - cst_my_float32.common().member_id(memberId++); - cst_my_float32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float32.common().member_flags().IS_OPTIONAL(false); - cst_my_float32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float32.common().member_flags().IS_KEY(false); - cst_my_float32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - cst_my_float32.detail().name("my_float32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float32); - - - // Header - type_object->complete().struct_type().header().detail().type_name("FloatStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("FloatStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("FloatStruct", true); -} - - - -const TypeIdentifier* GetDoubleStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("DoubleStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetDoubleStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("DoubleStruct", complete); -} - -const TypeObject* GetDoubleStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteDoubleStructObject(); - } - //else - return GetMinimalDoubleStructObject(); -} - -const TypeObject* GetMinimalDoubleStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_float64; - mst_my_float64.common().member_id(memberId++); - mst_my_float64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float64.common().member_flags().IS_OPTIONAL(false); - mst_my_float64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float64.common().member_flags().IS_KEY(false); - mst_my_float64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - MD5 my_float64_hash("my_float64"); - for(int i = 0; i < 4; ++i) - { - mst_my_float64.detail().name_hash()[i] = my_float64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float64); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("DoubleStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", false); -} - -const TypeObject* GetCompleteDoubleStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_float64; - cst_my_float64.common().member_id(memberId++); - cst_my_float64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float64.common().member_flags().IS_OPTIONAL(false); - cst_my_float64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float64.common().member_flags().IS_KEY(false); - cst_my_float64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - cst_my_float64.detail().name("my_float64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float64); - - - // Header - type_object->complete().struct_type().header().detail().type_name("DoubleStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("DoubleStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", true); -} - - - -const TypeIdentifier* GetLongDoubleStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongDoubleStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLongDoubleStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LongDoubleStruct", complete); -} - -const TypeObject* GetLongDoubleStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLongDoubleStructObject(); - } - //else - return GetMinimalLongDoubleStructObject(); -} - -const TypeObject* GetMinimalLongDoubleStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_float128; - mst_my_float128.common().member_id(memberId++); - mst_my_float128.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float128.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float128.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float128.common().member_flags().IS_OPTIONAL(false); - mst_my_float128.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float128.common().member_flags().IS_KEY(false); - mst_my_float128.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float128.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - MD5 my_float128_hash("my_float128"); - for(int i = 0; i < 4; ++i) - { - mst_my_float128.detail().name_hash()[i] = my_float128_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float128); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongDoubleStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", false); -} - -const TypeObject* GetCompleteLongDoubleStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_float128; - cst_my_float128.common().member_id(memberId++); - cst_my_float128.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float128.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float128.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float128.common().member_flags().IS_OPTIONAL(false); - cst_my_float128.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float128.common().member_flags().IS_KEY(false); - cst_my_float128.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float128.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - cst_my_float128.detail().name("my_float128"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float128); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LongDoubleStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LongDoubleStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", true); -} - - - -const TypeIdentifier* GetCharStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("CharStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetCharStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("CharStruct", complete); -} - -const TypeObject* GetCharStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CharStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteCharStructObject(); - } - //else - return GetMinimalCharStructObject(); -} - -const TypeObject* GetMinimalCharStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CharStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_char; - mst_my_char.common().member_id(memberId++); - mst_my_char.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_char.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_char.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_char.common().member_flags().IS_OPTIONAL(false); - mst_my_char.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_char.common().member_flags().IS_KEY(false); - mst_my_char.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_char.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - MD5 my_char_hash("my_char"); - for(int i = 0; i < 4; ++i) - { - mst_my_char.detail().name_hash()[i] = my_char_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_char); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("CharStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("CharStruct", false); -} - -const TypeObject* GetCompleteCharStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CharStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_char; - cst_my_char.common().member_id(memberId++); - cst_my_char.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_char.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_char.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_char.common().member_flags().IS_OPTIONAL(false); - cst_my_char.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_char.common().member_flags().IS_KEY(false); - cst_my_char.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_char.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - cst_my_char.detail().name("my_char"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_char); - - - // Header - type_object->complete().struct_type().header().detail().type_name("CharStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("CharStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("CharStruct", true); -} - - - -const TypeIdentifier* GetWCharStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWCharStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WCharStruct", complete); -} - -const TypeObject* GetWCharStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWCharStructObject(); - } - //else - return GetMinimalWCharStructObject(); -} - -const TypeObject* GetMinimalWCharStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wchar; - mst_my_wchar.common().member_id(memberId++); - mst_my_wchar.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wchar.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wchar.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wchar.common().member_flags().IS_OPTIONAL(false); - mst_my_wchar.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wchar.common().member_flags().IS_KEY(false); - mst_my_wchar.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wchar.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - - MD5 my_wchar_hash("my_wchar"); - for(int i = 0; i < 4; ++i) - { - mst_my_wchar.detail().name_hash()[i] = my_wchar_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wchar); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WCharStruct", false); -} - -const TypeObject* GetCompleteWCharStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wchar; - cst_my_wchar.common().member_id(memberId++); - cst_my_wchar.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wchar.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wchar.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wchar.common().member_flags().IS_OPTIONAL(false); - cst_my_wchar.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wchar.common().member_flags().IS_KEY(false); - cst_my_wchar.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wchar.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - - cst_my_wchar.detail().name("my_wchar"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wchar); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WCharStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WCharStruct", true); -} - - - -const TypeIdentifier* GetStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); -} - -const TypeObject* GetStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStringStructObject(); - } - //else - return GetMinimalStringStructObject(); -} - -const TypeObject* GetMinimalStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); -} - -const TypeObject* GetCompleteStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); -} - - - -const TypeIdentifier* GetWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); -} - -const TypeObject* GetWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWStringStructObject(); - } - //else - return GetMinimalWStringStructObject(); -} - -const TypeObject* GetMinimalWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wstring; - mst_my_wstring.common().member_id(memberId++); - mst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wstring.common().member_flags().IS_KEY(false); - mst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - MD5 my_wstring_hash("my_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_wstring.detail().name_hash()[i] = my_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); -} - -const TypeObject* GetCompleteWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wstring; - cst_my_wstring.common().member_id(memberId++); - cst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wstring.common().member_flags().IS_KEY(false); - cst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - cst_my_wstring.detail().name("my_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); -} - - - -const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); -} - -const TypeObject* GetLargeStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeStringStructObject(); - } - //else - return GetMinimalLargeStringStructObject(); -} - -const TypeObject* GetMinimalLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_string; - mst_my_large_string.common().member_id(memberId++); - mst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string.common().member_flags().IS_KEY(false); - mst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - MD5 my_large_string_hash("my_large_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string.detail().name_hash()[i] = my_large_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); -} - -const TypeObject* GetCompleteLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_string; - cst_my_large_string.common().member_id(memberId++); - cst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string.common().member_flags().IS_KEY(false); - cst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - cst_my_large_string.detail().name("my_large_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); -} - - - -const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); -} - -const TypeObject* GetLargeWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeWStringStructObject(); - } - //else - return GetMinimalLargeWStringStructObject(); -} - -const TypeObject* GetMinimalLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_wstring; - mst_my_large_wstring.common().member_id(memberId++); - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_wstring.common().member_flags().IS_KEY(false); - mst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - MD5 my_large_wstring_hash("my_large_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_wstring.detail().name_hash()[i] = my_large_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); -} - -const TypeObject* GetCompleteLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_wstring; - cst_my_large_wstring.common().member_id(memberId++); - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_wstring.common().member_flags().IS_KEY(false); - cst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - cst_my_large_wstring.detail().name("my_large_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); -} - - - -const TypeIdentifier* GetArraytStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraytStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArraytStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArraytStruct", complete); -} - -const TypeObject* GetArraytStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraytStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArraytStructObject(); - } - //else - return GetMinimalArraytStructObject(); -} - -const TypeObject* GetMinimalArraytStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraytStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2, 2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraytStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraytStruct", false); -} - -const TypeObject* GetCompleteArraytStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraytStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2, 2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArraytStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraytStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraytStruct", true); -} - -const TypeIdentifier* GetMyArrayIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyArray", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyArrayObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyArray", complete); -} - -const TypeObject* GetMyArrayObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyArray", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyArrayObject(); - } - else - { - return GetMinimalMyArrayObject(); - } -} - -const TypeObject* GetMinimalMyArrayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyArray", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_array_type_name("int32_t", {2, 2}), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyArray", TypeNamesGenerator::get_array_type_name("int32_t", {2, 2})); - - TypeObjectFactory::get_instance()->add_type_object("MyArray", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyArray", false); -} - -const TypeObject* GetCompleteMyArrayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyArray", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyArray"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_array_type_name("int32_t", {2, 2})); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyArray", TypeNamesGenerator::get_array_type_name("int32_t", {2, 2})); - - TypeObjectFactory::get_instance()->add_type_object("MyArray", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyArray", true); -} - - - -const TypeIdentifier* GetArrayArrayStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayArrayStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayArrayStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayArrayStruct", complete); -} - -const TypeObject* GetArrayArrayStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayArrayStructObject(); - } - //else - return GetMinimalArrayArrayStructObject(); -} - -const TypeObject* GetMinimalArrayArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array_array; - mst_my_array_array.common().member_id(memberId++); - mst_my_array_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_array.common().member_flags().IS_KEY(false); - mst_my_array_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MyArray", {2, 2}, false)); - - MD5 my_array_array_hash("my_array_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_array.detail().name_hash()[i] = my_array_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", false); -} - -const TypeObject* GetCompleteArrayArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array_array; - cst_my_array_array.common().member_id(memberId++); - cst_my_array_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_array.common().member_flags().IS_KEY(false); - cst_my_array_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MyArray", {2, 2}, true)); - - cst_my_array_array.detail().name("my_array_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayArrayStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); -} - -const TypeObject* GetSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructObject(); - } - //else - return GetMinimalSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); -} - -const TypeObject* GetSequenceSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceStructObject(); - } - //else - return GetMinimalSequenceSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); -} - -const TypeObject* GetMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructObject(); - } - //else - return GetMinimalMapStructObject(); -} - -const TypeObject* GetMinimalMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); -} - -const TypeObject* GetCompleteMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); -} - -const TypeObject* GetMapMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapStructObject(); - } - //else - return GetMinimalMapMapStructObject(); -} - -const TypeObject* GetMinimalMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); -} - -const TypeObject* GetCompleteMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); -} - -const TypeIdentifier* GetMyBitsetIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBitset", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBitsetObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBitset", complete); -} - -const TypeObject* GetMyBitsetObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBitsetObject(); - } - // else - return GetMinimalMyBitsetObject(); -} - -const TypeObject* GetMinimalMyBitsetObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_BITSET); - - MinimalBitfield mbf_a; - mbf_a.common().flags().TRY_CONSTRUCT1(false); - mbf_a.common().flags().TRY_CONSTRUCT2(false); - mbf_a.common().flags().IS_EXTERNAL(false); - mbf_a.common().flags().IS_OPTIONAL(false); - mbf_a.common().flags().IS_MUST_UNDERSTAND(false); - mbf_a.common().flags().IS_KEY(false); - mbf_a.common().flags().IS_DEFAULT(false); - mbf_a.common().position(0); - mbf_a.common().bitcount(2); - mbf_a.common().holder_type(TK_CHAR8); - MD5 a_hash("a"); - for(int i = 0; i < 4; ++i) - { - mbf_a.name_hash()[i] = a_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_a); - - - - MinimalBitfield mbf_b; - mbf_b.common().flags().TRY_CONSTRUCT1(false); - mbf_b.common().flags().TRY_CONSTRUCT2(false); - mbf_b.common().flags().IS_EXTERNAL(false); - mbf_b.common().flags().IS_OPTIONAL(false); - mbf_b.common().flags().IS_MUST_UNDERSTAND(false); - mbf_b.common().flags().IS_KEY(false); - mbf_b.common().flags().IS_DEFAULT(false); - mbf_b.common().position(10); - mbf_b.common().bitcount(20); - mbf_b.common().holder_type(TK_UINT32); - MD5 b_hash("b"); - for(int i = 0; i < 4; ++i) - { - mbf_b.name_hash()[i] = b_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_b); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitset", false); -} - -const TypeObject* GetCompleteMyBitsetObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_BITSET); - - // No flags apply - //type_object->complete().bitset_type().bitset_flags().IS_FINAL(false); - //type_object->complete().bitset_type().bitset_flags().IS_APPENDABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_MUTABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_NESTED(false); - //type_object->complete().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - - type_object->complete().bitset_type().header().detail().type_name("MyBitset"); - - CompleteBitfield cbf_a; - cbf_a.common().flags().TRY_CONSTRUCT1(false); - cbf_a.common().flags().TRY_CONSTRUCT2(false); - cbf_a.common().flags().IS_EXTERNAL(false); - cbf_a.common().flags().IS_OPTIONAL(false); - cbf_a.common().flags().IS_MUST_UNDERSTAND(false); - cbf_a.common().flags().IS_KEY(false); - cbf_a.common().flags().IS_DEFAULT(false); - cbf_a.common().position(0); - cbf_a.common().bitcount(2); - cbf_a.common().holder_type(TK_CHAR8); - cbf_a.detail().name("a"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(0); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_a.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(2); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_a.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_a); - - - - CompleteBitfield cbf_b; - cbf_b.common().flags().TRY_CONSTRUCT1(false); - cbf_b.common().flags().TRY_CONSTRUCT2(false); - cbf_b.common().flags().IS_EXTERNAL(false); - cbf_b.common().flags().IS_OPTIONAL(false); - cbf_b.common().flags().IS_MUST_UNDERSTAND(false); - cbf_b.common().flags().IS_KEY(false); - cbf_b.common().flags().IS_DEFAULT(false); - cbf_b.common().position(10); - cbf_b.common().bitcount(20); - cbf_b.common().holder_type(TK_UINT32); - cbf_b.detail().name("b"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(10); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_b.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(20); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_b.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_b); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitset", true); -} - - - -const TypeIdentifier* GetBitsetStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BitsetStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBitsetStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BitsetStruct", complete); -} - -const TypeObject* GetBitsetStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBitsetStructObject(); - } - //else - return GetMinimalBitsetStructObject(); -} - -const TypeObject* GetMinimalBitsetStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_a; - mst_a.common().member_id(memberId++); - mst_a.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_a.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_a.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_a.common().member_flags().IS_OPTIONAL(false); - mst_a.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_a.common().member_flags().IS_KEY(false); - mst_a.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_a.common().member_type_id(*GetMyBitsetIdentifier(false)); - - MD5 a_hash("a"); - for(int i = 0; i < 4; ++i) - { - mst_a.detail().name_hash()[i] = a_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_a); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BitsetStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", false); -} - -const TypeObject* GetCompleteBitsetStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_a; - cst_a.common().member_id(memberId++); - cst_a.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_a.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_a.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_a.common().member_flags().IS_OPTIONAL(false); - cst_a.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_a.common().member_flags().IS_KEY(false); - cst_a.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_a.common().member_type_id(*GetMyBitsetIdentifier(true)); - - cst_a.detail().name("a"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_a); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BitsetStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BitsetStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", true); -} - - - -const TypeIdentifier* GetStructStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStructStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StructStruct", complete); -} - -const TypeObject* GetStructStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStructStructObject(); - } - //else - return GetMinimalStructStructObject(); -} - -const TypeObject* GetMinimalStructStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_a; - mst_a.common().member_id(memberId++); - mst_a.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_a.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_a.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_a.common().member_flags().IS_OPTIONAL(false); - mst_a.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_a.common().member_flags().IS_KEY(false); - mst_a.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_a.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 a_hash("a"); - for(int i = 0; i < 4; ++i) - { - mst_a.detail().name_hash()[i] = a_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_a); - - MinimalStructMember mst_b; - mst_b.common().member_id(memberId++); - mst_b.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_b.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_b.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_b.common().member_flags().IS_OPTIONAL(false); - mst_b.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_b.common().member_flags().IS_KEY(false); - mst_b.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_b.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 b_hash("b"); - for(int i = 0; i < 4; ++i) - { - mst_b.detail().name_hash()[i] = b_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_b); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructStruct", false); -} - -const TypeObject* GetCompleteStructStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_a; - cst_a.common().member_id(memberId++); - cst_a.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_a.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_a.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_a.common().member_flags().IS_OPTIONAL(false); - cst_a.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_a.common().member_flags().IS_KEY(false); - cst_a.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_a.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_a.detail().name("a"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_a); - - CompleteStructMember cst_b; - cst_b.common().member_id(memberId++); - cst_b.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_b.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_b.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_b.common().member_flags().IS_OPTIONAL(false); - cst_b.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_b.common().member_flags().IS_KEY(false); - cst_b.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_b.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_b.detail().name("b"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_b); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StructStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructStruct", true); -} - - - -const TypeIdentifier* GetStructStructStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructStructStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStructStructStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StructStructStruct", complete); -} - -const TypeObject* GetStructStructStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStructStructStructObject(); - } - //else - return GetMinimalStructStructStructObject(); -} - -const TypeObject* GetMinimalStructStructStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_child_struct; - mst_child_struct.common().member_id(memberId++); - mst_child_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_child_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_child_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_child_struct.common().member_flags().IS_OPTIONAL(false); - mst_child_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_child_struct.common().member_flags().IS_KEY(false); - mst_child_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_child_struct.common().member_type_id(*GetStructStructIdentifier(false)); - - MD5 child_struct_hash("child_struct"); - for(int i = 0; i < 4; ++i) - { - mst_child_struct.detail().name_hash()[i] = child_struct_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_child_struct); - - MinimalStructMember mst_child_int64; - mst_child_int64.common().member_id(memberId++); - mst_child_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_child_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_child_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_child_int64.common().member_flags().IS_OPTIONAL(false); - mst_child_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_child_int64.common().member_flags().IS_KEY(false); - mst_child_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_child_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 child_int64_hash("child_int64"); - for(int i = 0; i < 4; ++i) - { - mst_child_int64.detail().name_hash()[i] = child_int64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_child_int64); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructStructStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", false); -} - -const TypeObject* GetCompleteStructStructStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_child_struct; - cst_child_struct.common().member_id(memberId++); - cst_child_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_child_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_child_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_child_struct.common().member_flags().IS_OPTIONAL(false); - cst_child_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_child_struct.common().member_flags().IS_KEY(false); - cst_child_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_child_struct.common().member_type_id(*GetStructStructIdentifier(true)); - - cst_child_struct.detail().name("child_struct"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_child_struct); - - CompleteStructMember cst_child_int64; - cst_child_int64.common().member_id(memberId++); - cst_child_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_child_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_child_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_child_int64.common().member_flags().IS_OPTIONAL(false); - cst_child_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_child_int64.common().member_flags().IS_KEY(false); - cst_child_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_child_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_child_int64.detail().name("child_int64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_child_int64); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StructStructStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructStructStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); -} - -const TypeObject* GetSimpleUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionObject(); - } - // else - return GetMinimalSimpleUnionObject(); -} - -const TypeObject* GetMinimalSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); -} - -const TypeObject* GetCompleteSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); -} - - - -const TypeIdentifier* GetUnionUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UnionUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetUnionUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("UnionUnion", complete); -} - -const TypeObject* GetUnionUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteUnionUnionObject(); - } - // else - return GetMinimalUnionUnionObject(); -} - -const TypeObject* GetMinimalUnionUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*GetSimpleUnionIdentifier(false)); - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UnionUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("UnionUnion", false); -} - -const TypeObject* GetCompleteUnionUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*GetSimpleUnionIdentifier(true)); - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("UnionUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UnionUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("UnionUnion", true); -} - - - -const TypeIdentifier* GetWCharUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWCharUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); -} - -const TypeObject* GetWCharUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWCharUnionObject(); - } - // else - return GetMinimalWCharUnionObject(); -} - -const TypeObject* GetMinimalWCharUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", false); -} - -const TypeObject* GetCompleteWCharUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("WCharUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); -} - -const TypeObject* GetSimpleUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructObject(); - } - //else - return GetMinimalSimpleUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); -} - - - -const TypeIdentifier* GetUnionUnionUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UnionUnionUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetUnionUnionUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("UnionUnionUnionStruct", complete); -} - -const TypeObject* GetUnionUnionUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteUnionUnionUnionStructObject(); - } - //else - return GetMinimalUnionUnionUnionStructObject(); -} - -const TypeObject* GetMinimalUnionUnionUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetUnionUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UnionUnionUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", false); -} - -const TypeObject* GetCompleteUnionUnionUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetUnionUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("UnionUnionUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("UnionUnionUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", true); -} - - - -const TypeIdentifier* GetWCharUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWCharUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WCharUnionStruct", complete); -} - -const TypeObject* GetWCharUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWCharUnionStructObject(); - } - //else - return GetMinimalWCharUnionStructObject(); -} - -const TypeObject* GetMinimalWCharUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetWCharUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnionStruct", false); -} - -const TypeObject* GetCompleteWCharUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetWCharUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WCharUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnionStruct", true); -} diff --git a/test/unittest/dynamic_types/idl/BasicTypeObject.h b/test/unittest/dynamic_types/idl/BasicTypeObject.h deleted file mode 100644 index e114b7d10d0..00000000000 --- a/test/unittest/dynamic_types/idl/BasicTypeObject.h +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file BasicTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_BASIC_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_BASIC_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Basic_SOURCE) -#define Basic_DllAPI __declspec( dllexport ) -#else -#define Basic_DllAPI __declspec( dllimport ) -#endif // Basic_SOURCE -#else -#define Basic_DllAPI -#endif -#else -#define Basic_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerBasicTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasAliasEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetAliasStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetAliasStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalAliasStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteAliasStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetAliasAliasStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetAliasAliasStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalAliasAliasStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteAliasAliasStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBoolStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBoolStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBoolStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBoolStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetOctetStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetOctetStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalOctetStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteOctetStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetShortStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetShortStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalShortStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteShortStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLongStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLongStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLongStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLongStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLongLongStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLongLongStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLongLongStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLongLongStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetUShortStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetUShortStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalUShortStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteUShortStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetULongStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetULongStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalULongStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteULongStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetULongLongStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetULongLongStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalULongLongStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteULongLongStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetFloatStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetFloatStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalFloatStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteFloatStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetDoubleStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetDoubleStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalDoubleStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteDoubleStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLongDoubleStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLongDoubleStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLongDoubleStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLongDoubleStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetCharStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetCharStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalCharStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteCharStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWCharStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWCharStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWCharStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWCharStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArraytStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArraytStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArraytStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArraytStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyArrayIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyArrayObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyArrayObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyArrayObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayArrayStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayArrayStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayArrayStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayArrayStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyBitsetIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBitsetObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBitsetObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBitsetObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBitsetStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBitsetStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBitsetStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBitsetStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStructStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStructStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStructStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStructStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStructStructStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStructStructStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStructStructStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStructStructStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetUnionUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetUnionUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalUnionUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteUnionUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWCharUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWCharUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWCharUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetUnionUnionUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetUnionUnionUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalUnionUnionUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteUnionUnionUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWCharUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWCharUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWCharUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_BASIC_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/Basicv1.cxx b/test/unittest/dynamic_types/idl/Basicv1.cxx deleted file mode 100644 index b8fca04e00d..00000000000 --- a/test/unittest/dynamic_types/idl/Basicv1.cxx +++ /dev/null @@ -1,6119 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Basic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Basic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "BasicTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define ArraytStruct_max_cdr_typesize 36ULL; -#define SimpleUnionStruct_max_cdr_typesize 24ULL; - -#define WCharUnionStruct_max_cdr_typesize 24ULL; -#define OctetStruct_max_cdr_typesize 5ULL; -#define LongStruct_max_cdr_typesize 8ULL; -#define EnumStruct_max_cdr_typesize 8ULL; -#define BitsetStruct_max_cdr_typesize 8ULL; - - -#define DoubleStruct_max_cdr_typesize 16ULL; -#define LargeWStringStruct_max_cdr_typesize 167708ULL; -#define WCharStruct_max_cdr_typesize 8ULL; - -#define WStringStruct_max_cdr_typesize 1028ULL; -#define SequenceStruct_max_cdr_typesize 16ULL; - -#define ULongStruct_max_cdr_typesize 8ULL; -#define SequenceSequenceStruct_max_cdr_typesize 48ULL; -#define FloatStruct_max_cdr_typesize 8ULL; -#define LongDoubleStruct_max_cdr_typesize 24ULL; -#define StructStructStruct_max_cdr_typesize 32ULL; -#define UnionUnionUnionStruct_max_cdr_typesize 32ULL; -#define BoolStruct_max_cdr_typesize 5ULL; -#define MapMapStruct_max_cdr_typesize 60ULL; -#define AliasAliasStruct_max_cdr_typesize 8ULL; -#define ArrayArrayStruct_max_cdr_typesize 72ULL; -#define ShortStruct_max_cdr_typesize 6ULL; -#define MapStruct_max_cdr_typesize 24ULL; -#define UShortStruct_max_cdr_typesize 6ULL; - - -#define ULongLongStruct_max_cdr_typesize 16ULL; -#define AliasStruct_max_cdr_typesize 8ULL; -#define LargeStringStruct_max_cdr_typesize 41934ULL; -#define CharStruct_max_cdr_typesize 5ULL; -#define LongLongStruct_max_cdr_typesize 16ULL; -#define StringStruct_max_cdr_typesize 264ULL; -#define StructStruct_max_cdr_typesize 16ULL; - - - - - -EnumStruct::EnumStruct() -{ - // MyEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerBasicTypes(); -} - -EnumStruct::~EnumStruct() -{ -} - -EnumStruct::EnumStruct( - const EnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -EnumStruct::EnumStruct( - EnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -EnumStruct& EnumStruct::operator =( - const EnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -EnumStruct& EnumStruct::operator =( - EnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool EnumStruct::operator ==( - const EnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool EnumStruct::operator !=( - const EnumStruct& x) const -{ - return !(*this == x); -} - -size_t EnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return EnumStruct_max_cdr_typesize; -} - -size_t EnumStruct::getCdrSerializedSize( - const EnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void EnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void EnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - -} - - -bool EnumStruct::isKeyDefined() -{ - return false; -} - -void EnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void EnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum EnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& EnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -AliasStruct::AliasStruct() -{ - // MyAliasEnum m_my_alias - m_my_alias = ::A; - - // Just to register all known types - registerBasicTypes(); -} - -AliasStruct::~AliasStruct() -{ -} - -AliasStruct::AliasStruct( - const AliasStruct& x) -{ - m_my_alias = x.m_my_alias; - -} - -AliasStruct::AliasStruct( - AliasStruct&& x) noexcept -{ - m_my_alias = x.m_my_alias; - -} - -AliasStruct& AliasStruct::operator =( - const AliasStruct& x) -{ - m_my_alias = x.m_my_alias; - - return *this; -} - -AliasStruct& AliasStruct::operator =( - AliasStruct&& x) noexcept -{ - m_my_alias = x.m_my_alias; - - return *this; -} - -bool AliasStruct::operator ==( - const AliasStruct& x) const -{ - return (m_my_alias == x.m_my_alias); -} - -bool AliasStruct::operator !=( - const AliasStruct& x) const -{ - return !(*this == x); -} - -size_t AliasStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return AliasStruct_max_cdr_typesize; -} - -size_t AliasStruct::getCdrSerializedSize( - const AliasStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void AliasStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_alias; - -} - -void AliasStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_alias = (MyAliasEnum)enum_value; - } - - -} - - -bool AliasStruct::isKeyDefined() -{ - return false; -} - -void AliasStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_alias - * @param _my_alias New value for member my_alias - */ -void AliasStruct::my_alias( - MyAliasEnum _my_alias) -{ - m_my_alias = _my_alias; -} - -/*! - * @brief This function returns the value of member my_alias - * @return Value of member my_alias - */ -MyAliasEnum AliasStruct::my_alias() const -{ - return m_my_alias; -} - -/*! - * @brief This function returns a reference to member my_alias - * @return Reference to member my_alias - */ -MyAliasEnum& AliasStruct::my_alias() -{ - return m_my_alias; -} - - - - - -AliasAliasStruct::AliasAliasStruct() -{ - // MyAliasAliasEnum m_my_alias_alias - m_my_alias_alias = ::A; - - // Just to register all known types - registerBasicTypes(); -} - -AliasAliasStruct::~AliasAliasStruct() -{ -} - -AliasAliasStruct::AliasAliasStruct( - const AliasAliasStruct& x) -{ - m_my_alias_alias = x.m_my_alias_alias; - -} - -AliasAliasStruct::AliasAliasStruct( - AliasAliasStruct&& x) noexcept -{ - m_my_alias_alias = x.m_my_alias_alias; - -} - -AliasAliasStruct& AliasAliasStruct::operator =( - const AliasAliasStruct& x) -{ - m_my_alias_alias = x.m_my_alias_alias; - - return *this; -} - -AliasAliasStruct& AliasAliasStruct::operator =( - AliasAliasStruct&& x) noexcept -{ - m_my_alias_alias = x.m_my_alias_alias; - - return *this; -} - -bool AliasAliasStruct::operator ==( - const AliasAliasStruct& x) const -{ - return (m_my_alias_alias == x.m_my_alias_alias); -} - -bool AliasAliasStruct::operator !=( - const AliasAliasStruct& x) const -{ - return !(*this == x); -} - -size_t AliasAliasStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return AliasAliasStruct_max_cdr_typesize; -} - -size_t AliasAliasStruct::getCdrSerializedSize( - const AliasAliasStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void AliasAliasStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_alias_alias; - -} - -void AliasAliasStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_alias_alias = (MyAliasAliasEnum)enum_value; - } - - -} - - -bool AliasAliasStruct::isKeyDefined() -{ - return false; -} - -void AliasAliasStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_alias_alias - * @param _my_alias_alias New value for member my_alias_alias - */ -void AliasAliasStruct::my_alias_alias( - MyAliasAliasEnum _my_alias_alias) -{ - m_my_alias_alias = _my_alias_alias; -} - -/*! - * @brief This function returns the value of member my_alias_alias - * @return Value of member my_alias_alias - */ -MyAliasAliasEnum AliasAliasStruct::my_alias_alias() const -{ - return m_my_alias_alias; -} - -/*! - * @brief This function returns a reference to member my_alias_alias - * @return Reference to member my_alias_alias - */ -MyAliasAliasEnum& AliasAliasStruct::my_alias_alias() -{ - return m_my_alias_alias; -} - - - - - -BoolStruct::BoolStruct() -{ - // boolean m_my_bool - m_my_bool = false; - - // Just to register all known types - registerBasicTypes(); -} - -BoolStruct::~BoolStruct() -{ -} - -BoolStruct::BoolStruct( - const BoolStruct& x) -{ - m_my_bool = x.m_my_bool; - -} - -BoolStruct::BoolStruct( - BoolStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - -} - -BoolStruct& BoolStruct::operator =( - const BoolStruct& x) -{ - m_my_bool = x.m_my_bool; - - return *this; -} - -BoolStruct& BoolStruct::operator =( - BoolStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - return *this; -} - -bool BoolStruct::operator ==( - const BoolStruct& x) const -{ - return (m_my_bool == x.m_my_bool); -} - -bool BoolStruct::operator !=( - const BoolStruct& x) const -{ - return !(*this == x); -} - -size_t BoolStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BoolStruct_max_cdr_typesize; -} - -size_t BoolStruct::getCdrSerializedSize( - const BoolStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void BoolStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - -} - -void BoolStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - -} - - -bool BoolStruct::isKeyDefined() -{ - return false; -} - -void BoolStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BoolStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BoolStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BoolStruct::my_bool() -{ - return m_my_bool; -} - - - - - -OctetStruct::OctetStruct() -{ - // octet m_my_octet - m_my_octet = 0; - - // Just to register all known types - registerBasicTypes(); -} - -OctetStruct::~OctetStruct() -{ -} - -OctetStruct::OctetStruct( - const OctetStruct& x) -{ - m_my_octet = x.m_my_octet; - -} - -OctetStruct::OctetStruct( - OctetStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; - -} - -OctetStruct& OctetStruct::operator =( - const OctetStruct& x) -{ - m_my_octet = x.m_my_octet; - - return *this; -} - -OctetStruct& OctetStruct::operator =( - OctetStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; - - return *this; -} - -bool OctetStruct::operator ==( - const OctetStruct& x) const -{ - return (m_my_octet == x.m_my_octet); -} - -bool OctetStruct::operator !=( - const OctetStruct& x) const -{ - return !(*this == x); -} - -size_t OctetStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return OctetStruct_max_cdr_typesize; -} - -size_t OctetStruct::getCdrSerializedSize( - const OctetStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void OctetStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_octet; - -} - -void OctetStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_octet; - - -} - - -bool OctetStruct::isKeyDefined() -{ - return false; -} - -void OctetStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void OctetStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t OctetStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& OctetStruct::my_octet() -{ - return m_my_octet; -} - - - - - -ShortStruct::ShortStruct() -{ - // short m_my_int16 - m_my_int16 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -ShortStruct::~ShortStruct() -{ -} - -ShortStruct::ShortStruct( - const ShortStruct& x) -{ - m_my_int16 = x.m_my_int16; - -} - -ShortStruct::ShortStruct( - ShortStruct&& x) noexcept -{ - m_my_int16 = x.m_my_int16; - -} - -ShortStruct& ShortStruct::operator =( - const ShortStruct& x) -{ - m_my_int16 = x.m_my_int16; - - return *this; -} - -ShortStruct& ShortStruct::operator =( - ShortStruct&& x) noexcept -{ - m_my_int16 = x.m_my_int16; - - return *this; -} - -bool ShortStruct::operator ==( - const ShortStruct& x) const -{ - return (m_my_int16 == x.m_my_int16); -} - -bool ShortStruct::operator !=( - const ShortStruct& x) const -{ - return !(*this == x); -} - -size_t ShortStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ShortStruct_max_cdr_typesize; -} - -size_t ShortStruct::getCdrSerializedSize( - const ShortStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - - -void ShortStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_int16; - -} - -void ShortStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_int16; - - -} - - -bool ShortStruct::isKeyDefined() -{ - return false; -} - -void ShortStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ -void ShortStruct::my_int16( - int16_t _my_int16) -{ - m_my_int16 = _my_int16; -} - -/*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ -int16_t ShortStruct::my_int16() const -{ - return m_my_int16; -} - -/*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ -int16_t& ShortStruct::my_int16() -{ - return m_my_int16; -} - - - - - -LongStruct::LongStruct() -{ - // long m_my_int32 - m_my_int32 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -LongStruct::~LongStruct() -{ -} - -LongStruct::LongStruct( - const LongStruct& x) -{ - m_my_int32 = x.m_my_int32; - -} - -LongStruct::LongStruct( - LongStruct&& x) noexcept -{ - m_my_int32 = x.m_my_int32; - -} - -LongStruct& LongStruct::operator =( - const LongStruct& x) -{ - m_my_int32 = x.m_my_int32; - - return *this; -} - -LongStruct& LongStruct::operator =( - LongStruct&& x) noexcept -{ - m_my_int32 = x.m_my_int32; - - return *this; -} - -bool LongStruct::operator ==( - const LongStruct& x) const -{ - return (m_my_int32 == x.m_my_int32); -} - -bool LongStruct::operator !=( - const LongStruct& x) const -{ - return !(*this == x); -} - -size_t LongStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LongStruct_max_cdr_typesize; -} - -size_t LongStruct::getCdrSerializedSize( - const LongStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void LongStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_int32; - -} - -void LongStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_int32; - - -} - - -bool LongStruct::isKeyDefined() -{ - return false; -} - -void LongStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void LongStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t LongStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& LongStruct::my_int32() -{ - return m_my_int32; -} - - - - - -LongLongStruct::LongLongStruct() -{ - // long long m_my_int64 - m_my_int64 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -LongLongStruct::~LongLongStruct() -{ -} - -LongLongStruct::LongLongStruct( - const LongLongStruct& x) -{ - m_my_int64 = x.m_my_int64; - -} - -LongLongStruct::LongLongStruct( - LongLongStruct&& x) noexcept -{ - m_my_int64 = x.m_my_int64; - -} - -LongLongStruct& LongLongStruct::operator =( - const LongLongStruct& x) -{ - m_my_int64 = x.m_my_int64; - - return *this; -} - -LongLongStruct& LongLongStruct::operator =( - LongLongStruct&& x) noexcept -{ - m_my_int64 = x.m_my_int64; - - return *this; -} - -bool LongLongStruct::operator ==( - const LongLongStruct& x) const -{ - return (m_my_int64 == x.m_my_int64); -} - -bool LongLongStruct::operator !=( - const LongLongStruct& x) const -{ - return !(*this == x); -} - -size_t LongLongStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LongLongStruct_max_cdr_typesize; -} - -size_t LongLongStruct::getCdrSerializedSize( - const LongLongStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void LongLongStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_int64; - -} - -void LongLongStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_int64; - - -} - - -bool LongLongStruct::isKeyDefined() -{ - return false; -} - -void LongLongStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ -void LongLongStruct::my_int64( - int64_t _my_int64) -{ - m_my_int64 = _my_int64; -} - -/*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ -int64_t LongLongStruct::my_int64() const -{ - return m_my_int64; -} - -/*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ -int64_t& LongLongStruct::my_int64() -{ - return m_my_int64; -} - - - - - -UShortStruct::UShortStruct() -{ - // unsigned short m_my_uint16 - m_my_uint16 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -UShortStruct::~UShortStruct() -{ -} - -UShortStruct::UShortStruct( - const UShortStruct& x) -{ - m_my_uint16 = x.m_my_uint16; - -} - -UShortStruct::UShortStruct( - UShortStruct&& x) noexcept -{ - m_my_uint16 = x.m_my_uint16; - -} - -UShortStruct& UShortStruct::operator =( - const UShortStruct& x) -{ - m_my_uint16 = x.m_my_uint16; - - return *this; -} - -UShortStruct& UShortStruct::operator =( - UShortStruct&& x) noexcept -{ - m_my_uint16 = x.m_my_uint16; - - return *this; -} - -bool UShortStruct::operator ==( - const UShortStruct& x) const -{ - return (m_my_uint16 == x.m_my_uint16); -} - -bool UShortStruct::operator !=( - const UShortStruct& x) const -{ - return !(*this == x); -} - -size_t UShortStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return UShortStruct_max_cdr_typesize; -} - -size_t UShortStruct::getCdrSerializedSize( - const UShortStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - return current_alignment - initial_alignment; -} - - -void UShortStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_uint16; - -} - -void UShortStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_uint16; - - -} - - -bool UShortStruct::isKeyDefined() -{ - return false; -} - -void UShortStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ -void UShortStruct::my_uint16( - uint16_t _my_uint16) -{ - m_my_uint16 = _my_uint16; -} - -/*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ -uint16_t UShortStruct::my_uint16() const -{ - return m_my_uint16; -} - -/*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ -uint16_t& UShortStruct::my_uint16() -{ - return m_my_uint16; -} - - - - - -ULongStruct::ULongStruct() -{ - // unsigned long m_my_uint32 - m_my_uint32 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -ULongStruct::~ULongStruct() -{ -} - -ULongStruct::ULongStruct( - const ULongStruct& x) -{ - m_my_uint32 = x.m_my_uint32; - -} - -ULongStruct::ULongStruct( - ULongStruct&& x) noexcept -{ - m_my_uint32 = x.m_my_uint32; - -} - -ULongStruct& ULongStruct::operator =( - const ULongStruct& x) -{ - m_my_uint32 = x.m_my_uint32; - - return *this; -} - -ULongStruct& ULongStruct::operator =( - ULongStruct&& x) noexcept -{ - m_my_uint32 = x.m_my_uint32; - - return *this; -} - -bool ULongStruct::operator ==( - const ULongStruct& x) const -{ - return (m_my_uint32 == x.m_my_uint32); -} - -bool ULongStruct::operator !=( - const ULongStruct& x) const -{ - return !(*this == x); -} - -size_t ULongStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ULongStruct_max_cdr_typesize; -} - -size_t ULongStruct::getCdrSerializedSize( - const ULongStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void ULongStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_uint32; - -} - -void ULongStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_uint32; - - -} - - -bool ULongStruct::isKeyDefined() -{ - return false; -} - -void ULongStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ -void ULongStruct::my_uint32( - uint32_t _my_uint32) -{ - m_my_uint32 = _my_uint32; -} - -/*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ -uint32_t ULongStruct::my_uint32() const -{ - return m_my_uint32; -} - -/*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ -uint32_t& ULongStruct::my_uint32() -{ - return m_my_uint32; -} - - - - - -ULongLongStruct::ULongLongStruct() -{ - // unsigned long long m_my_uint64 - m_my_uint64 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -ULongLongStruct::~ULongLongStruct() -{ -} - -ULongLongStruct::ULongLongStruct( - const ULongLongStruct& x) -{ - m_my_uint64 = x.m_my_uint64; - -} - -ULongLongStruct::ULongLongStruct( - ULongLongStruct&& x) noexcept -{ - m_my_uint64 = x.m_my_uint64; - -} - -ULongLongStruct& ULongLongStruct::operator =( - const ULongLongStruct& x) -{ - m_my_uint64 = x.m_my_uint64; - - return *this; -} - -ULongLongStruct& ULongLongStruct::operator =( - ULongLongStruct&& x) noexcept -{ - m_my_uint64 = x.m_my_uint64; - - return *this; -} - -bool ULongLongStruct::operator ==( - const ULongLongStruct& x) const -{ - return (m_my_uint64 == x.m_my_uint64); -} - -bool ULongLongStruct::operator !=( - const ULongLongStruct& x) const -{ - return !(*this == x); -} - -size_t ULongLongStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ULongLongStruct_max_cdr_typesize; -} - -size_t ULongLongStruct::getCdrSerializedSize( - const ULongLongStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void ULongLongStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_uint64; - -} - -void ULongLongStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_uint64; - - -} - - -bool ULongLongStruct::isKeyDefined() -{ - return false; -} - -void ULongLongStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ -void ULongLongStruct::my_uint64( - uint64_t _my_uint64) -{ - m_my_uint64 = _my_uint64; -} - -/*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ -uint64_t ULongLongStruct::my_uint64() const -{ - return m_my_uint64; -} - -/*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ -uint64_t& ULongLongStruct::my_uint64() -{ - return m_my_uint64; -} - - - - - -FloatStruct::FloatStruct() -{ - // float m_my_float32 - m_my_float32 = 0.0; - - // Just to register all known types - registerBasicTypes(); -} - -FloatStruct::~FloatStruct() -{ -} - -FloatStruct::FloatStruct( - const FloatStruct& x) -{ - m_my_float32 = x.m_my_float32; - -} - -FloatStruct::FloatStruct( - FloatStruct&& x) noexcept -{ - m_my_float32 = x.m_my_float32; - -} - -FloatStruct& FloatStruct::operator =( - const FloatStruct& x) -{ - m_my_float32 = x.m_my_float32; - - return *this; -} - -FloatStruct& FloatStruct::operator =( - FloatStruct&& x) noexcept -{ - m_my_float32 = x.m_my_float32; - - return *this; -} - -bool FloatStruct::operator ==( - const FloatStruct& x) const -{ - return (m_my_float32 == x.m_my_float32); -} - -bool FloatStruct::operator !=( - const FloatStruct& x) const -{ - return !(*this == x); -} - -size_t FloatStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FloatStruct_max_cdr_typesize; -} - -size_t FloatStruct::getCdrSerializedSize( - const FloatStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void FloatStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_float32; - -} - -void FloatStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_float32; - - -} - - -bool FloatStruct::isKeyDefined() -{ - return false; -} - -void FloatStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ -void FloatStruct::my_float32( - float _my_float32) -{ - m_my_float32 = _my_float32; -} - -/*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ -float FloatStruct::my_float32() const -{ - return m_my_float32; -} - -/*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ -float& FloatStruct::my_float32() -{ - return m_my_float32; -} - - - - - -DoubleStruct::DoubleStruct() -{ - // double m_my_float64 - m_my_float64 = 0.0; - - // Just to register all known types - registerBasicTypes(); -} - -DoubleStruct::~DoubleStruct() -{ -} - -DoubleStruct::DoubleStruct( - const DoubleStruct& x) -{ - m_my_float64 = x.m_my_float64; - -} - -DoubleStruct::DoubleStruct( - DoubleStruct&& x) noexcept -{ - m_my_float64 = x.m_my_float64; - -} - -DoubleStruct& DoubleStruct::operator =( - const DoubleStruct& x) -{ - m_my_float64 = x.m_my_float64; - - return *this; -} - -DoubleStruct& DoubleStruct::operator =( - DoubleStruct&& x) noexcept -{ - m_my_float64 = x.m_my_float64; - - return *this; -} - -bool DoubleStruct::operator ==( - const DoubleStruct& x) const -{ - return (m_my_float64 == x.m_my_float64); -} - -bool DoubleStruct::operator !=( - const DoubleStruct& x) const -{ - return !(*this == x); -} - -size_t DoubleStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return DoubleStruct_max_cdr_typesize; -} - -size_t DoubleStruct::getCdrSerializedSize( - const DoubleStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void DoubleStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_float64; - -} - -void DoubleStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_float64; - - -} - - -bool DoubleStruct::isKeyDefined() -{ - return false; -} - -void DoubleStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ -void DoubleStruct::my_float64( - double _my_float64) -{ - m_my_float64 = _my_float64; -} - -/*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ -double DoubleStruct::my_float64() const -{ - return m_my_float64; -} - -/*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ -double& DoubleStruct::my_float64() -{ - return m_my_float64; -} - - - - - -LongDoubleStruct::LongDoubleStruct() -{ - // long double m_my_float128 - m_my_float128 = 0.0; - - // Just to register all known types - registerBasicTypes(); -} - -LongDoubleStruct::~LongDoubleStruct() -{ -} - -LongDoubleStruct::LongDoubleStruct( - const LongDoubleStruct& x) -{ - m_my_float128 = x.m_my_float128; - -} - -LongDoubleStruct::LongDoubleStruct( - LongDoubleStruct&& x) noexcept -{ - m_my_float128 = x.m_my_float128; - -} - -LongDoubleStruct& LongDoubleStruct::operator =( - const LongDoubleStruct& x) -{ - m_my_float128 = x.m_my_float128; - - return *this; -} - -LongDoubleStruct& LongDoubleStruct::operator =( - LongDoubleStruct&& x) noexcept -{ - m_my_float128 = x.m_my_float128; - - return *this; -} - -bool LongDoubleStruct::operator ==( - const LongDoubleStruct& x) const -{ - return (m_my_float128 == x.m_my_float128); -} - -bool LongDoubleStruct::operator !=( - const LongDoubleStruct& x) const -{ - return !(*this == x); -} - -size_t LongDoubleStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LongDoubleStruct_max_cdr_typesize; -} - -size_t LongDoubleStruct::getCdrSerializedSize( - const LongDoubleStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - - return current_alignment - initial_alignment; -} - - -void LongDoubleStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_float128; - -} - -void LongDoubleStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_float128; - - -} - - -bool LongDoubleStruct::isKeyDefined() -{ - return false; -} - -void LongDoubleStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ -void LongDoubleStruct::my_float128( - long double _my_float128) -{ - m_my_float128 = _my_float128; -} - -/*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ -long double LongDoubleStruct::my_float128() const -{ - return m_my_float128; -} - -/*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ -long double& LongDoubleStruct::my_float128() -{ - return m_my_float128; -} - - - - - -CharStruct::CharStruct() -{ - // char m_my_char - m_my_char = 0; - - // Just to register all known types - registerBasicTypes(); -} - -CharStruct::~CharStruct() -{ -} - -CharStruct::CharStruct( - const CharStruct& x) -{ - m_my_char = x.m_my_char; - -} - -CharStruct::CharStruct( - CharStruct&& x) noexcept -{ - m_my_char = x.m_my_char; - -} - -CharStruct& CharStruct::operator =( - const CharStruct& x) -{ - m_my_char = x.m_my_char; - - return *this; -} - -CharStruct& CharStruct::operator =( - CharStruct&& x) noexcept -{ - m_my_char = x.m_my_char; - - return *this; -} - -bool CharStruct::operator ==( - const CharStruct& x) const -{ - return (m_my_char == x.m_my_char); -} - -bool CharStruct::operator !=( - const CharStruct& x) const -{ - return !(*this == x); -} - -size_t CharStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return CharStruct_max_cdr_typesize; -} - -size_t CharStruct::getCdrSerializedSize( - const CharStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void CharStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_char; - -} - -void CharStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_char; - - -} - - -bool CharStruct::isKeyDefined() -{ - return false; -} - -void CharStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ -void CharStruct::my_char( - char _my_char) -{ - m_my_char = _my_char; -} - -/*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ -char CharStruct::my_char() const -{ - return m_my_char; -} - -/*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ -char& CharStruct::my_char() -{ - return m_my_char; -} - - - - - -WCharStruct::WCharStruct() -{ - // wchar m_my_wchar - m_my_wchar = 0; - - // Just to register all known types - registerBasicTypes(); -} - -WCharStruct::~WCharStruct() -{ -} - -WCharStruct::WCharStruct( - const WCharStruct& x) -{ - m_my_wchar = x.m_my_wchar; - -} - -WCharStruct::WCharStruct( - WCharStruct&& x) noexcept -{ - m_my_wchar = x.m_my_wchar; - -} - -WCharStruct& WCharStruct::operator =( - const WCharStruct& x) -{ - m_my_wchar = x.m_my_wchar; - - return *this; -} - -WCharStruct& WCharStruct::operator =( - WCharStruct&& x) noexcept -{ - m_my_wchar = x.m_my_wchar; - - return *this; -} - -bool WCharStruct::operator ==( - const WCharStruct& x) const -{ - return (m_my_wchar == x.m_my_wchar); -} - -bool WCharStruct::operator !=( - const WCharStruct& x) const -{ - return !(*this == x); -} - -size_t WCharStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WCharStruct_max_cdr_typesize; -} - -size_t WCharStruct::getCdrSerializedSize( - const WCharStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void WCharStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wchar; - -} - -void WCharStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wchar; - - -} - - -bool WCharStruct::isKeyDefined() -{ - return false; -} - -void WCharStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_wchar - * @param _my_wchar New value for member my_wchar - */ -void WCharStruct::my_wchar( - wchar_t _my_wchar) -{ - m_my_wchar = _my_wchar; -} - -/*! - * @brief This function returns the value of member my_wchar - * @return Value of member my_wchar - */ -wchar_t WCharStruct::my_wchar() const -{ - return m_my_wchar; -} - -/*! - * @brief This function returns a reference to member my_wchar - * @return Reference to member my_wchar - */ -wchar_t& WCharStruct::my_wchar() -{ - return m_my_wchar; -} - - - - - -StringStruct::StringStruct() -{ - // /type_d() m_my_string - - - // Just to register all known types - registerBasicTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -size_t StringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringStruct_max_cdr_typesize; -} - -size_t StringStruct::getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_string.c_str(); - -} - -void StringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_string; - - -} - - -bool StringStruct::isKeyDefined() -{ - return false; -} - -void StringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - - -WStringStruct::WStringStruct() -{ - // /type_15() m_my_wstring - - - // Just to register all known types - registerBasicTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -size_t WStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WStringStruct_max_cdr_typesize; -} - -size_t WStringStruct::getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void WStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wstring; - -} - -void WStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wstring; - - -} - - -bool WStringStruct::isKeyDefined() -{ - return false; -} - -void WStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - - -LargeStringStruct::LargeStringStruct() -{ - // /type_d() m_my_large_string - - - // Just to register all known types - registerBasicTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeStringStruct_max_cdr_typesize; -} - -size_t LargeStringStruct::getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void LargeStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_string.c_str(); - -} - -void LargeStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_my_large_string = aux.c_str(); - } - - -} - - -bool LargeStringStruct::isKeyDefined() -{ - return false; -} - -void LargeStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // /type_15() m_my_large_wstring - - - // Just to register all known types - registerBasicTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeWStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeWStringStruct_max_cdr_typesize; -} - -size_t LargeWStringStruct::getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void LargeWStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_wstring; - -} - -void LargeWStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_large_wstring; - - -} - - -bool LargeWStringStruct::isKeyDefined() -{ - return false; -} - -void LargeWStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - - -ArraytStruct::ArraytStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2) * (2) * (2)) * 4); - - // Just to register all known types - registerBasicTypes(); -} - -ArraytStruct::~ArraytStruct() -{ -} - -ArraytStruct::ArraytStruct( - const ArraytStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArraytStruct::ArraytStruct( - ArraytStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArraytStruct& ArraytStruct::operator =( - const ArraytStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArraytStruct& ArraytStruct::operator =( - ArraytStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArraytStruct::operator ==( - const ArraytStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraytStruct::operator !=( - const ArraytStruct& x) const -{ - return !(*this == x); -} - -size_t ArraytStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArraytStruct_max_cdr_typesize; -} - -size_t ArraytStruct::getCdrSerializedSize( - const ArraytStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2) * (2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArraytStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t b = 0; b < m_my_array.size(); ++b) - { - for (uint32_t c = 0; c < m_my_array[b].size(); ++c) - { - scdr << m_my_array[b][c]; - - } - - } - - - -} - -void ArraytStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t e = 0; e < m_my_array.size(); ++e) - { - for (uint32_t f = 0; f < m_my_array[e].size(); ++f) - { - dcdr >> m_my_array[e][f]; - - } - - } - - - -} - - -bool ArraytStruct::isKeyDefined() -{ - return false; -} - -void ArraytStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraytStruct::my_array( - const std::array, 2>, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraytStruct::my_array( - std::array, 2>, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>, 2>& ArraytStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>, 2>& ArraytStruct::my_array() -{ - return m_my_array; -} - - - - - - -ArrayArrayStruct::ArrayArrayStruct() -{ - // MyArray m_my_array_array - - - // Just to register all known types - registerBasicTypes(); -} - -ArrayArrayStruct::~ArrayArrayStruct() -{ -} - -ArrayArrayStruct::ArrayArrayStruct( - const ArrayArrayStruct& x) -{ - m_my_array_array = x.m_my_array_array; - -} - -ArrayArrayStruct::ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept -{ - m_my_array_array = std::move(x.m_my_array_array); - -} - -ArrayArrayStruct& ArrayArrayStruct::operator =( - const ArrayArrayStruct& x) -{ - m_my_array_array = x.m_my_array_array; - - return *this; -} - -ArrayArrayStruct& ArrayArrayStruct::operator =( - ArrayArrayStruct&& x) noexcept -{ - m_my_array_array = std::move(x.m_my_array_array); - - return *this; -} - -bool ArrayArrayStruct::operator ==( - const ArrayArrayStruct& x) const -{ - return (m_my_array_array == x.m_my_array_array); -} - -bool ArrayArrayStruct::operator !=( - const ArrayArrayStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayArrayStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayArrayStruct_max_cdr_typesize; -} - -size_t ArrayArrayStruct::getCdrSerializedSize( - const ArrayArrayStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - - for(size_t a = 0; a < data.my_array_array().size(); ++a) - { - - for(size_t b = 0; b < data.my_array_array().at(a).size(); ++b) - { - current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - } - - - - return current_alignment - initial_alignment; -} - - -void ArrayArrayStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t d = 0; d < m_my_array_array.size(); ++d) - { - scdr << m_my_array_array[d]; - - } - - - -} - -void ArrayArrayStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t f = 0; f < m_my_array_array.size(); ++f) - { - dcdr >> m_my_array_array[f]; - - } - - - -} - - -bool ArrayArrayStruct::isKeyDefined() -{ - return false; -} - -void ArrayArrayStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array_array - * @param _my_array_array New value to be copied in member my_array_array - */ -void ArrayArrayStruct::my_array_array( - const std::array, 2>& _my_array_array) -{ - m_my_array_array = _my_array_array; -} - -/*! - * @brief This function moves the value in member my_array_array - * @param _my_array_array New value to be moved in member my_array_array - */ -void ArrayArrayStruct::my_array_array( - std::array, 2>&& _my_array_array) -{ - m_my_array_array = std::move(_my_array_array); -} - -/*! - * @brief This function returns a constant reference to member my_array_array - * @return Constant reference to member my_array_array - */ -const std::array, 2>& ArrayArrayStruct::my_array_array() const -{ - return m_my_array_array; -} - -/*! - * @brief This function returns a reference to member my_array_array - * @return Reference to member my_array_array - */ -std::array, 2>& ArrayArrayStruct::my_array_array() -{ - return m_my_array_array; -} - - - - - - - -SequenceStruct::SequenceStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerBasicTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStruct_max_cdr_typesize; -} - -size_t SequenceStruct::getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // sequence, 3> m_my_sequence_sequence - - - // Just to register all known types - registerBasicTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceStruct_max_cdr_typesize; -} - -size_t SequenceSequenceStruct::getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - -MapStruct::MapStruct() -{ - // map m_my_map - - - // Just to register all known types - registerBasicTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -size_t MapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStruct_max_cdr_typesize; -} - -size_t MapStruct::getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapStruct::isKeyDefined() -{ - return false; -} - -void MapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerBasicTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapStruct_max_cdr_typesize; -} - -size_t MapMapStruct::getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - } - - - return current_alignment - initial_alignment; -} - - -void MapMapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapStruct::isKeyDefined() -{ - return false; -} - -void MapMapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - -MyBitset::MyBitset() -{ - // Just to register all known types - registerBasicTypes(); -} - -MyBitset::~MyBitset() -{ -} - -MyBitset::MyBitset( - const MyBitset& x) -{ - m_bitset = x.m_bitset; -} - -MyBitset::MyBitset( - MyBitset&& x) noexcept -{ - m_bitset = x.m_bitset; -} - -MyBitset& MyBitset::operator =( - const MyBitset& x) -{ - m_bitset = x.m_bitset; - - return *this; -} - -MyBitset& MyBitset::operator =( - MyBitset&& x) noexcept -{ - m_bitset = x.m_bitset; - - return *this; -} - -bool MyBitset::operator ==( - const MyBitset& x) const -{ - return m_bitset == x.m_bitset; -} - -bool MyBitset::operator !=( - const MyBitset& x) const -{ - return !(*this == x); -} - -size_t MyBitset::getCdrSerializedSize( - const MyBitset&, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - current_alignment += sizeof(helper::FindType<30>::type) + - eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<30>::type)); - - return current_alignment - initial_alignment; -} - - -void MyBitset::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - helper::FindType<30>::type bits = static_cast::type>(bitset().to_ullong()); - scdr << bits; -} - -void MyBitset::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - helper::FindType<30>::type bits; - dcdr >> bits; - bitset(std::bitset<30>(bits)); -} - - - -void MyBitset::a( - char _a) -{ - int base = 0; - int size = 2; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - -} - -char MyBitset::a() const -{ - int base = 0; - int size = 2; - std::bitset<2> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - - -void MyBitset::b( - uint32_t _b) -{ - int base = 10; - int size = 20; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_b & 0x01)); - _b = _b >> 1; - } - -} - -uint32_t MyBitset::b() const -{ - int base = 10; - int size = 20; - std::bitset<20> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<30> MyBitset::bitset() const -{ - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<30>(str_value); -} - -void MyBitset::bitset( - const std::bitset<30>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 30; - m_bitset = std::bitset<30>(str_value.substr(str_value.length() - base_diff, last_post)); -} - - - -BitsetStruct::BitsetStruct() -{ - // MyBitset m_a - - - // Just to register all known types - registerBasicTypes(); -} - -BitsetStruct::~BitsetStruct() -{ -} - -BitsetStruct::BitsetStruct( - const BitsetStruct& x) -{ - m_a = x.m_a; - -} - -BitsetStruct::BitsetStruct( - BitsetStruct&& x) noexcept -{ - m_a = std::move(x.m_a); - -} - -BitsetStruct& BitsetStruct::operator =( - const BitsetStruct& x) -{ - m_a = x.m_a; - - return *this; -} - -BitsetStruct& BitsetStruct::operator =( - BitsetStruct&& x) noexcept -{ - m_a = std::move(x.m_a); - - return *this; -} - -bool BitsetStruct::operator ==( - const BitsetStruct& x) const -{ - return (m_a == x.m_a); -} - -bool BitsetStruct::operator !=( - const BitsetStruct& x) const -{ - return !(*this == x); -} - -size_t BitsetStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BitsetStruct_max_cdr_typesize; -} - -size_t BitsetStruct::getCdrSerializedSize( - const BitsetStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += MyBitset::getCdrSerializedSize(data.a(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void BitsetStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_a; - -} - -void BitsetStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_a; - - -} - - -bool BitsetStruct::isKeyDefined() -{ - return false; -} - -void BitsetStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member a - * @param _a New value to be copied in member a - */ -void BitsetStruct::a( - const MyBitset& _a) -{ - m_a = _a; -} - -/*! - * @brief This function moves the value in member a - * @param _a New value to be moved in member a - */ -void BitsetStruct::a( - MyBitset&& _a) -{ - m_a = std::move(_a); -} - -/*! - * @brief This function returns a constant reference to member a - * @return Constant reference to member a - */ -const MyBitset& BitsetStruct::a() const -{ - return m_a; -} - -/*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ -MyBitset& BitsetStruct::a() -{ - return m_a; -} - - - - - -StructStruct::StructStruct() -{ - // long m_a - m_a = 0; - // long long m_b - m_b = 0; - - // Just to register all known types - registerBasicTypes(); -} - -StructStruct::~StructStruct() -{ -} - -StructStruct::StructStruct( - const StructStruct& x) -{ - m_a = x.m_a; - - - m_b = x.m_b; - -} - -StructStruct::StructStruct( - StructStruct&& x) noexcept -{ - m_a = x.m_a; - - - m_b = x.m_b; - -} - -StructStruct& StructStruct::operator =( - const StructStruct& x) -{ - m_a = x.m_a; - - - m_b = x.m_b; - - return *this; -} - -StructStruct& StructStruct::operator =( - StructStruct&& x) noexcept -{ - m_a = x.m_a; - - - m_b = x.m_b; - - return *this; -} - -bool StructStruct::operator ==( - const StructStruct& x) const -{ - return (m_a == x.m_a && - m_b == x.m_b); -} - -bool StructStruct::operator !=( - const StructStruct& x) const -{ - return !(*this == x); -} - -size_t StructStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructStruct_max_cdr_typesize; -} - -size_t StructStruct::getCdrSerializedSize( - const StructStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void StructStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_a; - - scdr << m_b; - -} - -void StructStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_a; - - - - dcdr >> m_b; - - -} - - -bool StructStruct::isKeyDefined() -{ - return false; -} - -void StructStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ -void StructStruct::a( - int32_t _a) -{ - m_a = _a; -} - -/*! - * @brief This function returns the value of member a - * @return Value of member a - */ -int32_t StructStruct::a() const -{ - return m_a; -} - -/*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ -int32_t& StructStruct::a() -{ - return m_a; -} - - -/*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ -void StructStruct::b( - int64_t _b) -{ - m_b = _b; -} - -/*! - * @brief This function returns the value of member b - * @return Value of member b - */ -int64_t StructStruct::b() const -{ - return m_b; -} - -/*! - * @brief This function returns a reference to member b - * @return Reference to member b - */ -int64_t& StructStruct::b() -{ - return m_b; -} - - - - - -StructStructStruct::StructStructStruct() -{ - // StructStruct m_child_struct - - // long long m_child_int64 - m_child_int64 = 0; - - // Just to register all known types - registerBasicTypes(); -} - -StructStructStruct::~StructStructStruct() -{ -} - -StructStructStruct::StructStructStruct( - const StructStructStruct& x) -{ - m_child_struct = x.m_child_struct; - - - m_child_int64 = x.m_child_int64; - -} - -StructStructStruct::StructStructStruct( - StructStructStruct&& x) noexcept -{ - m_child_struct = std::move(x.m_child_struct); - - - m_child_int64 = x.m_child_int64; - -} - -StructStructStruct& StructStructStruct::operator =( - const StructStructStruct& x) -{ - m_child_struct = x.m_child_struct; - - - m_child_int64 = x.m_child_int64; - - return *this; -} - -StructStructStruct& StructStructStruct::operator =( - StructStructStruct&& x) noexcept -{ - m_child_struct = std::move(x.m_child_struct); - - - m_child_int64 = x.m_child_int64; - - return *this; -} - -bool StructStructStruct::operator ==( - const StructStructStruct& x) const -{ - return (m_child_struct == x.m_child_struct && - m_child_int64 == x.m_child_int64); -} - -bool StructStructStruct::operator !=( - const StructStructStruct& x) const -{ - return !(*this == x); -} - -size_t StructStructStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructStructStruct_max_cdr_typesize; -} - -size_t StructStructStruct::getCdrSerializedSize( - const StructStructStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += StructStruct::getCdrSerializedSize(data.child_struct(), current_alignment); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void StructStructStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_child_struct; - - scdr << m_child_int64; - -} - -void StructStructStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_child_struct; - - - - dcdr >> m_child_int64; - - -} - - -bool StructStructStruct::isKeyDefined() -{ - return false; -} - -void StructStructStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member child_struct - * @param _child_struct New value to be copied in member child_struct - */ -void StructStructStruct::child_struct( - const StructStruct& _child_struct) -{ - m_child_struct = _child_struct; -} - -/*! - * @brief This function moves the value in member child_struct - * @param _child_struct New value to be moved in member child_struct - */ -void StructStructStruct::child_struct( - StructStruct&& _child_struct) -{ - m_child_struct = std::move(_child_struct); -} - -/*! - * @brief This function returns a constant reference to member child_struct - * @return Constant reference to member child_struct - */ -const StructStruct& StructStructStruct::child_struct() const -{ - return m_child_struct; -} - -/*! - * @brief This function returns a reference to member child_struct - * @return Reference to member child_struct - */ -StructStruct& StructStructStruct::child_struct() -{ - return m_child_struct; -} - - -/*! - * @brief This function sets a value in member child_int64 - * @param _child_int64 New value for member child_int64 - */ -void StructStructStruct::child_int64( - int64_t _child_int64) -{ - m_child_int64 = _child_int64; -} - -/*! - * @brief This function returns the value of member child_int64 - * @return Value of member child_int64 - */ -int64_t StructStructStruct::child_int64() const -{ - return m_child_int64; -} - -/*! - * @brief This function returns a reference to member child_int64 - * @return Reference to member child_int64 - */ -int64_t& StructStructStruct::child_int64() -{ - return m_child_int64; -} - - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleUnion::getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -UnionUnion::UnionUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // SimpleUnion m_second - -} - -UnionUnion::~UnionUnion() -{ -} - -UnionUnion::UnionUnion( - const UnionUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -UnionUnion::UnionUnion( - UnionUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = std::move(x.m_second); - - break; - - default: - break; - } -} - -UnionUnion& UnionUnion::operator =( - const UnionUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -UnionUnion& UnionUnion::operator =( - UnionUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = std::move(x.m_second); - - break; - - default: - break; - } - - return *this; -} - -bool UnionUnion::operator ==( - const UnionUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool UnionUnion::operator !=( - const UnionUnion& x) const -{ - return !(*this == x); -} - -void UnionUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t UnionUnion::_d() const -{ - return m__d; -} - -int32_t& UnionUnion::_d() -{ - return m__d; -} - -void UnionUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t UnionUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& UnionUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void UnionUnion::second( - const SimpleUnion& _second) -{ - m_second = _second; - m__d = B; - -} - -void UnionUnion::second( - SimpleUnion&& _second) -{ - m_second = std::move(_second); - m__d = B; - -} - -const SimpleUnion& UnionUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -SimpleUnion& UnionUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t UnionUnion::getCdrSerializedSize( - const UnionUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += SimpleUnion::getCdrSerializedSize(data.second(), current_alignment); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void UnionUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void UnionUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -WCharUnion::WCharUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -WCharUnion::~WCharUnion() -{ -} - -WCharUnion::WCharUnion( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -WCharUnion::WCharUnion( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -WCharUnion& WCharUnion::operator =( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -WCharUnion& WCharUnion::operator =( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool WCharUnion::operator ==( - const WCharUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool WCharUnion::operator !=( - const WCharUnion& x) const -{ - return !(*this == x); -} - -void WCharUnion::_d( - wchar_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -wchar_t WCharUnion::_d() const -{ - return m__d; -} - -wchar_t& WCharUnion::_d() -{ - return m__d; -} - -void WCharUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t WCharUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& WCharUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void WCharUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t WCharUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& WCharUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t WCharUnion::getCdrSerializedSize( - const WCharUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void WCharUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void WCharUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // SimpleUnion m_my_union - - - // Just to register all known types - registerBasicTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStruct_max_cdr_typesize; -} - -size_t SimpleUnionStruct::getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -UnionUnionUnionStruct::UnionUnionUnionStruct() -{ - // UnionUnion m_my_union - - - // Just to register all known types - registerBasicTypes(); -} - -UnionUnionUnionStruct::~UnionUnionUnionStruct() -{ -} - -UnionUnionUnionStruct::UnionUnionUnionStruct( - const UnionUnionUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -UnionUnionUnionStruct::UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( - const UnionUnionUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( - UnionUnionUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool UnionUnionUnionStruct::operator ==( - const UnionUnionUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool UnionUnionUnionStruct::operator !=( - const UnionUnionUnionStruct& x) const -{ - return !(*this == x); -} - -size_t UnionUnionUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return UnionUnionUnionStruct_max_cdr_typesize; -} - -size_t UnionUnionUnionStruct::getCdrSerializedSize( - const UnionUnionUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += UnionUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void UnionUnionUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void UnionUnionUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool UnionUnionUnionStruct::isKeyDefined() -{ - return false; -} - -void UnionUnionUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void UnionUnionUnionStruct::my_union( - const UnionUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void UnionUnionUnionStruct::my_union( - UnionUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const UnionUnion& UnionUnionUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -UnionUnion& UnionUnionUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -WCharUnionStruct::WCharUnionStruct() -{ - // WCharUnion m_my_union - - - // Just to register all known types - registerBasicTypes(); -} - -WCharUnionStruct::~WCharUnionStruct() -{ -} - -WCharUnionStruct::WCharUnionStruct( - const WCharUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -WCharUnionStruct::WCharUnionStruct( - WCharUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -WCharUnionStruct& WCharUnionStruct::operator =( - const WCharUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -WCharUnionStruct& WCharUnionStruct::operator =( - WCharUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool WCharUnionStruct::operator ==( - const WCharUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool WCharUnionStruct::operator !=( - const WCharUnionStruct& x) const -{ - return !(*this == x); -} - -size_t WCharUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WCharUnionStruct_max_cdr_typesize; -} - -size_t WCharUnionStruct::getCdrSerializedSize( - const WCharUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += WCharUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void WCharUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void WCharUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool WCharUnionStruct::isKeyDefined() -{ - return false; -} - -void WCharUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void WCharUnionStruct::my_union( - const WCharUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void WCharUnionStruct::my_union( - WCharUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const WCharUnion& WCharUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -WCharUnion& WCharUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Basicv1.h b/test/unittest/dynamic_types/idl/Basicv1.h deleted file mode 100644 index 1a8ac2db83d..00000000000 --- a/test/unittest/dynamic_types/idl/Basicv1.h +++ /dev/null @@ -1,5327 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Basic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_BASIC_H_ -#define _FAST_DDS_GENERATED_BASIC_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(BASIC_SOURCE) -#define BASIC_DllAPI __declspec( dllexport ) -#else -#define BASIC_DllAPI __declspec( dllimport ) -#endif // BASIC_SOURCE -#else -#define BASIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define BASIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Basic - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasAliasEnum; - - - -/*! - * @brief This class represents the structure EnumStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class EnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - const EnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct( - EnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - const EnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object EnumStruct that will be copied. - */ - eProsima_user_DllExport EnumStruct& operator =( - EnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x EnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const EnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure AliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - const AliasStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct( - AliasStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - const AliasStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasStruct that will be copied. - */ - eProsima_user_DllExport AliasStruct& operator =( - AliasStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x AliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasStruct& x) const; - - /*! - * @brief This function sets a value in member my_alias - * @param _my_alias New value for member my_alias - */ - eProsima_user_DllExport void my_alias( - MyAliasEnum _my_alias); - - /*! - * @brief This function returns the value of member my_alias - * @return Value of member my_alias - */ - eProsima_user_DllExport MyAliasEnum my_alias() const; - - /*! - * @brief This function returns a reference to member my_alias - * @return Reference to member my_alias - */ - eProsima_user_DllExport MyAliasEnum& my_alias(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const AliasStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasEnum m_my_alias; - -}; - - - -/*! - * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class AliasAliasStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AliasAliasStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AliasAliasStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - const AliasAliasStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct( - AliasAliasStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - const AliasAliasStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AliasAliasStruct that will be copied. - */ - eProsima_user_DllExport AliasAliasStruct& operator =( - AliasAliasStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AliasAliasStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x AliasAliasStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AliasAliasStruct& x) const; - - /*! - * @brief This function sets a value in member my_alias_alias - * @param _my_alias_alias New value for member my_alias_alias - */ - eProsima_user_DllExport void my_alias_alias( - MyAliasAliasEnum _my_alias_alias); - - /*! - * @brief This function returns the value of member my_alias_alias - * @return Value of member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum my_alias_alias() const; - - /*! - * @brief This function returns a reference to member my_alias_alias - * @return Reference to member my_alias_alias - */ - eProsima_user_DllExport MyAliasAliasEnum& my_alias_alias(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const AliasAliasStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasAliasEnum m_my_alias_alias; - -}; - - - -/*! - * @brief This class represents the structure BoolStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BoolStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BoolStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BoolStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - const BoolStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct( - BoolStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - const BoolStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BoolStruct that will be copied. - */ - eProsima_user_DllExport BoolStruct& operator =( - BoolStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BoolStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BoolStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BoolStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BoolStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - -}; - - - -/*! - * @brief This class represents the structure OctetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class OctetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - const OctetStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct( - OctetStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - const OctetStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetStruct that will be copied. - */ - eProsima_user_DllExport OctetStruct& operator =( - OctetStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x OctetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetStruct& x) const; - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const OctetStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_octet; - -}; - - - -/*! - * @brief This class represents the structure ShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ShortStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ShortStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - const ShortStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct( - ShortStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - const ShortStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ShortStruct that will be copied. - */ - eProsima_user_DllExport ShortStruct& operator =( - ShortStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ShortStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ShortStruct& x) const; - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16); - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const; - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ShortStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int16_t m_my_int16; - -}; - - - -/*! - * @brief This class represents the structure LongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - const LongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct( - LongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - const LongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongStruct that will be copied. - */ - eProsima_user_DllExport LongStruct& operator =( - LongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongStruct& x) const; - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LongStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_my_int32; - -}; - - - -/*! - * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongLongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongLongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - const LongLongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct( - LongLongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - const LongLongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongLongStruct that will be copied. - */ - eProsima_user_DllExport LongLongStruct& operator =( - LongLongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongLongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongLongStruct& x) const; - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64); - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const; - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LongLongStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int64_t m_my_int64; - -}; - - - -/*! - * @brief This class represents the structure UShortStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UShortStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UShortStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UShortStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - const UShortStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct( - UShortStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - const UShortStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UShortStruct that will be copied. - */ - eProsima_user_DllExport UShortStruct& operator =( - UShortStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UShortStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x UShortStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UShortStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16); - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const; - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const UShortStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_my_uint16; - -}; - - - -/*! - * @brief This class represents the structure ULongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - const ULongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct( - ULongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - const ULongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongStruct that will be copied. - */ - eProsima_user_DllExport ULongStruct& operator =( - ULongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ULongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32); - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const; - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ULongStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_my_uint32; - -}; - - - -/*! - * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ULongLongStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ULongLongStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ULongLongStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - const ULongLongStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct( - ULongLongStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - const ULongLongStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ULongLongStruct that will be copied. - */ - eProsima_user_DllExport ULongLongStruct& operator =( - ULongLongStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ULongLongStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ULongLongStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ULongLongStruct& x) const; - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64); - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const; - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ULongLongStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint64_t m_my_uint64; - -}; - - - -/*! - * @brief This class represents the structure FloatStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class FloatStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FloatStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FloatStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - const FloatStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct( - FloatStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - const FloatStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FloatStruct that will be copied. - */ - eProsima_user_DllExport FloatStruct& operator =( - FloatStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FloatStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x FloatStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FloatStruct& x) const; - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32); - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const; - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const FloatStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - float m_my_float32; - -}; - - - -/*! - * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class DoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DoubleStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DoubleStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - const DoubleStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct( - DoubleStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - const DoubleStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object DoubleStruct that will be copied. - */ - eProsima_user_DllExport DoubleStruct& operator =( - DoubleStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DoubleStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x DoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DoubleStruct& x) const; - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64); - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const; - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const DoubleStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - double m_my_float64; - -}; - - - -/*! - * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LongDoubleStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LongDoubleStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LongDoubleStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - const LongDoubleStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct( - LongDoubleStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - const LongDoubleStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LongDoubleStruct that will be copied. - */ - eProsima_user_DllExport LongDoubleStruct& operator =( - LongDoubleStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LongDoubleStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LongDoubleStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LongDoubleStruct& x) const; - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128); - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const; - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LongDoubleStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - long double m_my_float128; - -}; - - - -/*! - * @brief This class represents the structure CharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class CharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CharStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CharStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - const CharStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct( - CharStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - const CharStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CharStruct that will be copied. - */ - eProsima_user_DllExport CharStruct& operator =( - CharStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CharStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x CharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CharStruct& x) const; - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char); - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const; - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const CharStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - char m_my_char; - -}; - - - -/*! - * @brief This class represents the structure WCharStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - const WCharStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct( - WCharStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - const WCharStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharStruct that will be copied. - */ - eProsima_user_DllExport WCharStruct& operator =( - WCharStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharStruct& x) const; - - /*! - * @brief This function sets a value in member my_wchar - * @param _my_wchar New value for member my_wchar - */ - eProsima_user_DllExport void my_wchar( - wchar_t _my_wchar); - - /*! - * @brief This function returns the value of member my_wchar - * @return Value of member my_wchar - */ - eProsima_user_DllExport wchar_t my_wchar() const; - - /*! - * @brief This function returns a reference to member my_wchar - * @return Reference to member my_wchar - */ - eProsima_user_DllExport wchar_t& my_wchar(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WCharStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - wchar_t m_my_wchar; - -}; - - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_wstring; - -}; - - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastrtps::fixed_string<41925> m_my_large_string; - -}; - - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_large_wstring; - -}; - - - -/*! - * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArraytStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraytStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraytStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - const ArraytStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct( - ArraytStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - const ArraytStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraytStruct that will be copied. - */ - eProsima_user_DllExport ArraytStruct& operator =( - ArraytStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraytStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraytStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraytStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>, 2>& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArraytStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2>, 2> m_my_array; - -}; - -typedef std::array, 2> MyArray; - - - -/*! - * @brief This class represents the structure ArrayArrayStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class ArrayArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - const ArrayArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct( - ArrayArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - const ArrayArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayArrayStruct& operator =( - ArrayArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array_array - * @param _my_array_array New value to be copied in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - const std::array, 2>& _my_array_array); - - /*! - * @brief This function moves the value in member my_array_array - * @param _my_array_array New value to be moved in member my_array_array - */ - eProsima_user_DllExport void my_array_array( - std::array, 2>&& _my_array_array); - - /*! - * @brief This function returns a constant reference to member my_array_array - * @return Constant reference to member my_array_array - */ - eProsima_user_DllExport const std::array, 2>& my_array_array() const; - - /*! - * @brief This function returns a reference to member my_array_array - * @return Reference to member my_array_array - */ - eProsima_user_DllExport std::array, 2>& my_array_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayArrayStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2> m_my_array_array; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - -/*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup Basic - */ -class MyBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - char _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport char a() const; - - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - uint32_t _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport uint32_t b() const; - - - eProsima_user_DllExport std::bitset<30> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<30>&); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyBitset& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - std::bitset<30> m_bitset; -}; - - -/*! - * @brief This class represents the structure BitsetStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class BitsetStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - const BitsetStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct( - BitsetStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - const BitsetStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BitsetStruct that will be copied. - */ - eProsima_user_DllExport BitsetStruct& operator =( - BitsetStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BitsetStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetStruct& x) const; - - /*! - * @brief This function copies the value in member a - * @param _a New value to be copied in member a - */ - eProsima_user_DllExport void a( - const MyBitset& _a); - - /*! - * @brief This function moves the value in member a - * @param _a New value to be moved in member a - */ - eProsima_user_DllExport void a( - MyBitset&& _a); - - /*! - * @brief This function returns a constant reference to member a - * @return Constant reference to member a - */ - eProsima_user_DllExport const MyBitset& a() const; - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport MyBitset& a(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BitsetStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyBitset m_a; - -}; - - - -/*! - * @brief This class represents the structure StructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - const StructStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct( - StructStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - const StructStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStruct that will be copied. - */ - eProsima_user_DllExport StructStruct& operator =( - StructStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStruct& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - int32_t _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport int32_t a() const; - - /*! - * @brief This function returns a reference to member a - * @return Reference to member a - */ - eProsima_user_DllExport int32_t& a(); - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - int64_t _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport int64_t b() const; - - /*! - * @brief This function returns a reference to member b - * @return Reference to member b - */ - eProsima_user_DllExport int64_t& b(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StructStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_a; - int64_t m_b; - -}; - - - -/*! - * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class StructStructStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructStructStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructStructStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - const StructStructStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct( - StructStructStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - const StructStructStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructStructStruct that will be copied. - */ - eProsima_user_DllExport StructStructStruct& operator =( - StructStructStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructStructStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StructStructStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructStructStruct& x) const; - - /*! - * @brief This function copies the value in member child_struct - * @param _child_struct New value to be copied in member child_struct - */ - eProsima_user_DllExport void child_struct( - const StructStruct& _child_struct); - - /*! - * @brief This function moves the value in member child_struct - * @param _child_struct New value to be moved in member child_struct - */ - eProsima_user_DllExport void child_struct( - StructStruct&& _child_struct); - - /*! - * @brief This function returns a constant reference to member child_struct - * @return Constant reference to member child_struct - */ - eProsima_user_DllExport const StructStruct& child_struct() const; - - /*! - * @brief This function returns a reference to member child_struct - * @return Reference to member child_struct - */ - eProsima_user_DllExport StructStruct& child_struct(); - - - /*! - * @brief This function sets a value in member child_int64 - * @param _child_int64 New value for member child_int64 - */ - eProsima_user_DllExport void child_int64( - int64_t _child_int64); - - /*! - * @brief This function returns the value of member child_int64 - * @return Value of member child_int64 - */ - eProsima_user_DllExport int64_t child_int64() const; - - /*! - * @brief This function returns a reference to member child_int64 - * @return Reference to member child_int64 - */ - eProsima_user_DllExport int64_t& child_int64(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StructStructStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - StructStruct m_child_struct; - int64_t m_child_int64; - -}; - - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union UnionUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - const UnionUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion( - UnionUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - const UnionUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnion that will be copied. - */ - eProsima_user_DllExport UnionUnion& operator =( - UnionUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x UnionUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function copies the value in member second - * @param _second New value to be copied in member second - */ - eProsima_user_DllExport void second( - const SimpleUnion& _second); - - /*! - * @brief This function moves the value in member second - * @param _second New value to be moved in member second - */ - eProsima_user_DllExport void second( - SimpleUnion&& _second); - - /*! - * @brief This function returns a constant reference to member second - * @return Constant reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const SimpleUnion& second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport SimpleUnion& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const UnionUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - SimpleUnion m_second; -}; - - - -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - wchar_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport wchar_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WCharUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - wchar_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class UnionUnionUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport UnionUnionUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~UnionUnionUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - const UnionUnionUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct( - UnionUnionUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - const UnionUnionUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object UnionUnionUnionStruct that will be copied. - */ - eProsima_user_DllExport UnionUnionUnionStruct& operator =( - UnionUnionUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const UnionUnionUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x UnionUnionUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const UnionUnionUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const UnionUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - UnionUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const UnionUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport UnionUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const UnionUnionUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - UnionUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. - * @ingroup Basic - */ -class WCharUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - const WCharUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct( - WCharUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - const WCharUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnionStruct that will be copied. - */ - eProsima_user_DllExport WCharUnionStruct& operator =( - WCharUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const WCharUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - WCharUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const WCharUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport WCharUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WCharUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - WCharUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_BASIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Test.cxx b/test/unittest/dynamic_types/idl/Test.cxx deleted file mode 100644 index 423925e0980..00000000000 --- a/test/unittest/dynamic_types/idl/Test.cxx +++ /dev/null @@ -1,2405 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Test.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Test.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TestTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -BasicStruct::BasicStruct() -{ - // Just to register all known types - registerTestTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = x.m_my_string; -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = std::move(x.m_my_string); -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = x.m_my_string; - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_octet = x.m_my_octet; - m_my_int16 = x.m_my_int16; - m_my_int32 = x.m_my_int32; - m_my_int64 = x.m_my_int64; - m_my_uint16 = x.m_my_uint16; - m_my_uint32 = x.m_my_uint32; - m_my_uint64 = x.m_my_uint64; - m_my_float32 = x.m_my_float32; - m_my_float64 = x.m_my_float64; - m_my_float128 = x.m_my_float128; - m_my_char = x.m_my_char; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_octet == x.m_my_octet && - m_my_int16 == x.m_my_int16 && - m_my_int32 == x.m_my_int32 && - m_my_int64 == x.m_my_int64 && - m_my_uint16 == x.m_my_uint16 && - m_my_uint32 == x.m_my_uint32 && - m_my_uint64 == x.m_my_uint64 && - m_my_float32 == x.m_my_float32 && - m_my_float64 == x.m_my_float64 && - m_my_float128 == x.m_my_float128 && - m_my_char == x.m_my_char && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void BasicStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t BasicStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& BasicStruct::my_octet() -{ - return m_my_octet; -} - - -/*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ -void BasicStruct::my_int16( - int16_t _my_int16) -{ - m_my_int16 = _my_int16; -} - -/*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ -int16_t BasicStruct::my_int16() const -{ - return m_my_int16; -} - -/*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ -int16_t& BasicStruct::my_int16() -{ - return m_my_int16; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ -void BasicStruct::my_int64( - int64_t _my_int64) -{ - m_my_int64 = _my_int64; -} - -/*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ -int64_t BasicStruct::my_int64() const -{ - return m_my_int64; -} - -/*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ -int64_t& BasicStruct::my_int64() -{ - return m_my_int64; -} - - -/*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ -void BasicStruct::my_uint16( - uint16_t _my_uint16) -{ - m_my_uint16 = _my_uint16; -} - -/*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ -uint16_t BasicStruct::my_uint16() const -{ - return m_my_uint16; -} - -/*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ -uint16_t& BasicStruct::my_uint16() -{ - return m_my_uint16; -} - - -/*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ -void BasicStruct::my_uint32( - uint32_t _my_uint32) -{ - m_my_uint32 = _my_uint32; -} - -/*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ -uint32_t BasicStruct::my_uint32() const -{ - return m_my_uint32; -} - -/*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ -uint32_t& BasicStruct::my_uint32() -{ - return m_my_uint32; -} - - -/*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ -void BasicStruct::my_uint64( - uint64_t _my_uint64) -{ - m_my_uint64 = _my_uint64; -} - -/*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ -uint64_t BasicStruct::my_uint64() const -{ - return m_my_uint64; -} - -/*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ -uint64_t& BasicStruct::my_uint64() -{ - return m_my_uint64; -} - - -/*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ -void BasicStruct::my_float32( - float _my_float32) -{ - m_my_float32 = _my_float32; -} - -/*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ -float BasicStruct::my_float32() const -{ - return m_my_float32; -} - -/*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ -float& BasicStruct::my_float32() -{ - return m_my_float32; -} - - -/*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ -void BasicStruct::my_float64( - double _my_float64) -{ - m_my_float64 = _my_float64; -} - -/*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ -double BasicStruct::my_float64() const -{ - return m_my_float64; -} - -/*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ -double& BasicStruct::my_float64() -{ - return m_my_float64; -} - - -/*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ -void BasicStruct::my_float128( - long double _my_float128) -{ - m_my_float128 = _my_float128; -} - -/*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ -long double BasicStruct::my_float128() const -{ - return m_my_float128; -} - -/*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ -long double& BasicStruct::my_float128() -{ - return m_my_float128; -} - - -/*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ -void BasicStruct::my_char( - char _my_char) -{ - m_my_char = _my_char; -} - -/*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ -char BasicStruct::my_char() const -{ - return m_my_char; -} - -/*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ -char& BasicStruct::my_char() -{ - return m_my_char; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - - - - - - - -ComplexStruct::ComplexStruct() -{ - // Just to register all known types - registerTestTypes(); -} - -ComplexStruct::~ComplexStruct() -{ -} - -ComplexStruct::ComplexStruct( - const ComplexStruct& x) -{ - m_my_octet = x.m_my_octet; - m_my_basic_struct = x.m_my_basic_struct; - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = x.m_my_sequence_octet; - m_my_sequence_struct = x.m_my_sequence_struct; - m_my_array_octet = x.m_my_array_octet; - m_my_octet_array_500 = x.m_my_octet_array_500; - m_my_array_struct = x.m_my_array_struct; - m_my_map_octet_short = x.m_my_map_octet_short; - m_my_map_long_struct = x.m_my_map_long_struct; - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - m_my_small_string_8 = x.m_my_small_string_8; - m_my_large_string_8 = x.m_my_large_string_8; - m_my_array_string = x.m_my_array_string; - m_multi_alias_array_42 = x.m_multi_alias_array_42; - m_my_array_arrays = x.m_my_array_arrays; - m_my_sequences_array = x.m_my_sequences_array; -} - -ComplexStruct::ComplexStruct( - ComplexStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; - m_my_basic_struct = std::move(x.m_my_basic_struct); - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - m_my_array_octet = std::move(x.m_my_array_octet); - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - m_my_array_struct = std::move(x.m_my_array_struct); - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - m_my_small_string_8 = std::move(x.m_my_small_string_8); - m_my_large_string_8 = std::move(x.m_my_large_string_8); - m_my_array_string = std::move(x.m_my_array_string); - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - m_my_array_arrays = std::move(x.m_my_array_arrays); - m_my_sequences_array = std::move(x.m_my_sequences_array); -} - -ComplexStruct& ComplexStruct::operator =( - const ComplexStruct& x) -{ - - m_my_octet = x.m_my_octet; - m_my_basic_struct = x.m_my_basic_struct; - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = x.m_my_sequence_octet; - m_my_sequence_struct = x.m_my_sequence_struct; - m_my_array_octet = x.m_my_array_octet; - m_my_octet_array_500 = x.m_my_octet_array_500; - m_my_array_struct = x.m_my_array_struct; - m_my_map_octet_short = x.m_my_map_octet_short; - m_my_map_long_struct = x.m_my_map_long_struct; - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - m_my_small_string_8 = x.m_my_small_string_8; - m_my_large_string_8 = x.m_my_large_string_8; - m_my_array_string = x.m_my_array_string; - m_multi_alias_array_42 = x.m_multi_alias_array_42; - m_my_array_arrays = x.m_my_array_arrays; - m_my_sequences_array = x.m_my_sequences_array; - return *this; -} - -ComplexStruct& ComplexStruct::operator =( - ComplexStruct&& x) noexcept -{ - - m_my_octet = x.m_my_octet; - m_my_basic_struct = std::move(x.m_my_basic_struct); - m_my_alias_enum = x.m_my_alias_enum; - m_my_enum = x.m_my_enum; - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - m_my_array_octet = std::move(x.m_my_array_octet); - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - m_my_array_struct = std::move(x.m_my_array_struct); - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - m_my_small_string_8 = std::move(x.m_my_small_string_8); - m_my_large_string_8 = std::move(x.m_my_large_string_8); - m_my_array_string = std::move(x.m_my_array_string); - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - m_my_array_arrays = std::move(x.m_my_array_arrays); - m_my_sequences_array = std::move(x.m_my_sequences_array); - return *this; -} - -bool ComplexStruct::operator ==( - const ComplexStruct& x) const -{ - return (m_my_octet == x.m_my_octet && - m_my_basic_struct == x.m_my_basic_struct && - m_my_alias_enum == x.m_my_alias_enum && - m_my_enum == x.m_my_enum && - m_my_sequence_octet == x.m_my_sequence_octet && - m_my_sequence_struct == x.m_my_sequence_struct && - m_my_array_octet == x.m_my_array_octet && - m_my_octet_array_500 == x.m_my_octet_array_500 && - m_my_array_struct == x.m_my_array_struct && - m_my_map_octet_short == x.m_my_map_octet_short && - m_my_map_long_struct == x.m_my_map_long_struct && - m_my_map_long_seq_octet == x.m_my_map_long_seq_octet && - m_my_map_long_octet_array_500 == x.m_my_map_long_octet_array_500 && - m_my_map_long_lol_type == x.m_my_map_long_lol_type && - m_my_small_string_8 == x.m_my_small_string_8 && - m_my_large_string_8 == x.m_my_large_string_8 && - m_my_array_string == x.m_my_array_string && - m_multi_alias_array_42 == x.m_multi_alias_array_42 && - m_my_array_arrays == x.m_my_array_arrays && - m_my_sequences_array == x.m_my_sequences_array); -} - -bool ComplexStruct::operator !=( - const ComplexStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void ComplexStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t ComplexStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& ComplexStruct::my_octet() -{ - return m_my_octet; -} - - -/*! - * @brief This function copies the value in member my_basic_struct - * @param _my_basic_struct New value to be copied in member my_basic_struct - */ -void ComplexStruct::my_basic_struct( - const BasicStruct& _my_basic_struct) -{ - m_my_basic_struct = _my_basic_struct; -} - -/*! - * @brief This function moves the value in member my_basic_struct - * @param _my_basic_struct New value to be moved in member my_basic_struct - */ -void ComplexStruct::my_basic_struct( - BasicStruct&& _my_basic_struct) -{ - m_my_basic_struct = std::move(_my_basic_struct); -} - -/*! - * @brief This function returns a constant reference to member my_basic_struct - * @return Constant reference to member my_basic_struct - */ -const BasicStruct& ComplexStruct::my_basic_struct() const -{ - return m_my_basic_struct; -} - -/*! - * @brief This function returns a reference to member my_basic_struct - * @return Reference to member my_basic_struct - */ -BasicStruct& ComplexStruct::my_basic_struct() -{ - return m_my_basic_struct; -} - - -/*! - * @brief This function sets a value in member my_alias_enum - * @param _my_alias_enum New value for member my_alias_enum - */ -void ComplexStruct::my_alias_enum( - MyAliasEnum _my_alias_enum) -{ - m_my_alias_enum = _my_alias_enum; -} - -/*! - * @brief This function returns the value of member my_alias_enum - * @return Value of member my_alias_enum - */ -MyAliasEnum ComplexStruct::my_alias_enum() const -{ - return m_my_alias_enum; -} - -/*! - * @brief This function returns a reference to member my_alias_enum - * @return Reference to member my_alias_enum - */ -MyAliasEnum& ComplexStruct::my_alias_enum() -{ - return m_my_alias_enum; -} - - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void ComplexStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum ComplexStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& ComplexStruct::my_enum() -{ - return m_my_enum; -} - - -/*! - * @brief This function copies the value in member my_sequence_octet - * @param _my_sequence_octet New value to be copied in member my_sequence_octet - */ -void ComplexStruct::my_sequence_octet( - const std::vector& _my_sequence_octet) -{ - m_my_sequence_octet = _my_sequence_octet; -} - -/*! - * @brief This function moves the value in member my_sequence_octet - * @param _my_sequence_octet New value to be moved in member my_sequence_octet - */ -void ComplexStruct::my_sequence_octet( - std::vector&& _my_sequence_octet) -{ - m_my_sequence_octet = std::move(_my_sequence_octet); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_octet - * @return Constant reference to member my_sequence_octet - */ -const std::vector& ComplexStruct::my_sequence_octet() const -{ - return m_my_sequence_octet; -} - -/*! - * @brief This function returns a reference to member my_sequence_octet - * @return Reference to member my_sequence_octet - */ -std::vector& ComplexStruct::my_sequence_octet() -{ - return m_my_sequence_octet; -} - - -/*! - * @brief This function copies the value in member my_sequence_struct - * @param _my_sequence_struct New value to be copied in member my_sequence_struct - */ -void ComplexStruct::my_sequence_struct( - const std::vector& _my_sequence_struct) -{ - m_my_sequence_struct = _my_sequence_struct; -} - -/*! - * @brief This function moves the value in member my_sequence_struct - * @param _my_sequence_struct New value to be moved in member my_sequence_struct - */ -void ComplexStruct::my_sequence_struct( - std::vector&& _my_sequence_struct) -{ - m_my_sequence_struct = std::move(_my_sequence_struct); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_struct - * @return Constant reference to member my_sequence_struct - */ -const std::vector& ComplexStruct::my_sequence_struct() const -{ - return m_my_sequence_struct; -} - -/*! - * @brief This function returns a reference to member my_sequence_struct - * @return Reference to member my_sequence_struct - */ -std::vector& ComplexStruct::my_sequence_struct() -{ - return m_my_sequence_struct; -} - - -/*! - * @brief This function copies the value in member my_array_octet - * @param _my_array_octet New value to be copied in member my_array_octet - */ -void ComplexStruct::my_array_octet( - const std::array, 5>, 500>& _my_array_octet) -{ - m_my_array_octet = _my_array_octet; -} - -/*! - * @brief This function moves the value in member my_array_octet - * @param _my_array_octet New value to be moved in member my_array_octet - */ -void ComplexStruct::my_array_octet( - std::array, 5>, 500>&& _my_array_octet) -{ - m_my_array_octet = std::move(_my_array_octet); -} - -/*! - * @brief This function returns a constant reference to member my_array_octet - * @return Constant reference to member my_array_octet - */ -const std::array, 5>, 500>& ComplexStruct::my_array_octet() const -{ - return m_my_array_octet; -} - -/*! - * @brief This function returns a reference to member my_array_octet - * @return Reference to member my_array_octet - */ -std::array, 5>, 500>& ComplexStruct::my_array_octet() -{ - return m_my_array_octet; -} - - -/*! - * @brief This function copies the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 - */ -void ComplexStruct::my_octet_array_500( - const MyOctetArray500& _my_octet_array_500) -{ - m_my_octet_array_500 = _my_octet_array_500; -} - -/*! - * @brief This function moves the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 - */ -void ComplexStruct::my_octet_array_500( - MyOctetArray500&& _my_octet_array_500) -{ - m_my_octet_array_500 = std::move(_my_octet_array_500); -} - -/*! - * @brief This function returns a constant reference to member my_octet_array_500 - * @return Constant reference to member my_octet_array_500 - */ -const MyOctetArray500& ComplexStruct::my_octet_array_500() const -{ - return m_my_octet_array_500; -} - -/*! - * @brief This function returns a reference to member my_octet_array_500 - * @return Reference to member my_octet_array_500 - */ -MyOctetArray500& ComplexStruct::my_octet_array_500() -{ - return m_my_octet_array_500; -} - - -/*! - * @brief This function copies the value in member my_array_struct - * @param _my_array_struct New value to be copied in member my_array_struct - */ -void ComplexStruct::my_array_struct( - const std::array& _my_array_struct) -{ - m_my_array_struct = _my_array_struct; -} - -/*! - * @brief This function moves the value in member my_array_struct - * @param _my_array_struct New value to be moved in member my_array_struct - */ -void ComplexStruct::my_array_struct( - std::array&& _my_array_struct) -{ - m_my_array_struct = std::move(_my_array_struct); -} - -/*! - * @brief This function returns a constant reference to member my_array_struct - * @return Constant reference to member my_array_struct - */ -const std::array& ComplexStruct::my_array_struct() const -{ - return m_my_array_struct; -} - -/*! - * @brief This function returns a reference to member my_array_struct - * @return Reference to member my_array_struct - */ -std::array& ComplexStruct::my_array_struct() -{ - return m_my_array_struct; -} - - -/*! - * @brief This function copies the value in member my_map_octet_short - * @param _my_map_octet_short New value to be copied in member my_map_octet_short - */ -void ComplexStruct::my_map_octet_short( - const std::map& _my_map_octet_short) -{ - m_my_map_octet_short = _my_map_octet_short; -} - -/*! - * @brief This function moves the value in member my_map_octet_short - * @param _my_map_octet_short New value to be moved in member my_map_octet_short - */ -void ComplexStruct::my_map_octet_short( - std::map&& _my_map_octet_short) -{ - m_my_map_octet_short = std::move(_my_map_octet_short); -} - -/*! - * @brief This function returns a constant reference to member my_map_octet_short - * @return Constant reference to member my_map_octet_short - */ -const std::map& ComplexStruct::my_map_octet_short() const -{ - return m_my_map_octet_short; -} - -/*! - * @brief This function returns a reference to member my_map_octet_short - * @return Reference to member my_map_octet_short - */ -std::map& ComplexStruct::my_map_octet_short() -{ - return m_my_map_octet_short; -} - - -/*! - * @brief This function copies the value in member my_map_long_struct - * @param _my_map_long_struct New value to be copied in member my_map_long_struct - */ -void ComplexStruct::my_map_long_struct( - const std::map& _my_map_long_struct) -{ - m_my_map_long_struct = _my_map_long_struct; -} - -/*! - * @brief This function moves the value in member my_map_long_struct - * @param _my_map_long_struct New value to be moved in member my_map_long_struct - */ -void ComplexStruct::my_map_long_struct( - std::map&& _my_map_long_struct) -{ - m_my_map_long_struct = std::move(_my_map_long_struct); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_struct - * @return Constant reference to member my_map_long_struct - */ -const std::map& ComplexStruct::my_map_long_struct() const -{ - return m_my_map_long_struct; -} - -/*! - * @brief This function returns a reference to member my_map_long_struct - * @return Reference to member my_map_long_struct - */ -std::map& ComplexStruct::my_map_long_struct() -{ - return m_my_map_long_struct; -} - - -/*! - * @brief This function copies the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet - */ -void ComplexStruct::my_map_long_seq_octet( - const std::map>>& _my_map_long_seq_octet) -{ - m_my_map_long_seq_octet = _my_map_long_seq_octet; -} - -/*! - * @brief This function moves the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet - */ -void ComplexStruct::my_map_long_seq_octet( - std::map>>&& _my_map_long_seq_octet) -{ - m_my_map_long_seq_octet = std::move(_my_map_long_seq_octet); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_seq_octet - * @return Constant reference to member my_map_long_seq_octet - */ -const std::map>>& ComplexStruct::my_map_long_seq_octet() const -{ - return m_my_map_long_seq_octet; -} - -/*! - * @brief This function returns a reference to member my_map_long_seq_octet - * @return Reference to member my_map_long_seq_octet - */ -std::map>>& ComplexStruct::my_map_long_seq_octet() -{ - return m_my_map_long_seq_octet; -} - - -/*! - * @brief This function copies the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 - */ -void ComplexStruct::my_map_long_octet_array_500( - const std::map& _my_map_long_octet_array_500) -{ - m_my_map_long_octet_array_500 = _my_map_long_octet_array_500; -} - -/*! - * @brief This function moves the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 - */ -void ComplexStruct::my_map_long_octet_array_500( - std::map&& _my_map_long_octet_array_500) -{ - m_my_map_long_octet_array_500 = std::move(_my_map_long_octet_array_500); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_octet_array_500 - * @return Constant reference to member my_map_long_octet_array_500 - */ -const std::map& ComplexStruct::my_map_long_octet_array_500() const -{ - return m_my_map_long_octet_array_500; -} - -/*! - * @brief This function returns a reference to member my_map_long_octet_array_500 - * @return Reference to member my_map_long_octet_array_500 - */ -std::map& ComplexStruct::my_map_long_octet_array_500() -{ - return m_my_map_long_octet_array_500; -} - - -/*! - * @brief This function copies the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type - */ -void ComplexStruct::my_map_long_lol_type( - const std::map>& _my_map_long_lol_type) -{ - m_my_map_long_lol_type = _my_map_long_lol_type; -} - -/*! - * @brief This function moves the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type - */ -void ComplexStruct::my_map_long_lol_type( - std::map>&& _my_map_long_lol_type) -{ - m_my_map_long_lol_type = std::move(_my_map_long_lol_type); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_lol_type - * @return Constant reference to member my_map_long_lol_type - */ -const std::map>& ComplexStruct::my_map_long_lol_type() const -{ - return m_my_map_long_lol_type; -} - -/*! - * @brief This function returns a reference to member my_map_long_lol_type - * @return Reference to member my_map_long_lol_type - */ -std::map>& ComplexStruct::my_map_long_lol_type() -{ - return m_my_map_long_lol_type; -} - - -/*! - * @brief This function copies the value in member my_small_string_8 - * @param _my_small_string_8 New value to be copied in member my_small_string_8 - */ -void ComplexStruct::my_small_string_8( - const eprosima::fastcdr::fixed_string<128>& _my_small_string_8) -{ - m_my_small_string_8 = _my_small_string_8; -} - -/*! - * @brief This function moves the value in member my_small_string_8 - * @param _my_small_string_8 New value to be moved in member my_small_string_8 - */ -void ComplexStruct::my_small_string_8( - eprosima::fastcdr::fixed_string<128>&& _my_small_string_8) -{ - m_my_small_string_8 = std::move(_my_small_string_8); -} - -/*! - * @brief This function returns a constant reference to member my_small_string_8 - * @return Constant reference to member my_small_string_8 - */ -const eprosima::fastcdr::fixed_string<128>& ComplexStruct::my_small_string_8() const -{ - return m_my_small_string_8; -} - -/*! - * @brief This function returns a reference to member my_small_string_8 - * @return Reference to member my_small_string_8 - */ -eprosima::fastcdr::fixed_string<128>& ComplexStruct::my_small_string_8() -{ - return m_my_small_string_8; -} - - -/*! - * @brief This function copies the value in member my_large_string_8 - * @param _my_large_string_8 New value to be copied in member my_large_string_8 - */ -void ComplexStruct::my_large_string_8( - const eprosima::fastcdr::fixed_string<500>& _my_large_string_8) -{ - m_my_large_string_8 = _my_large_string_8; -} - -/*! - * @brief This function moves the value in member my_large_string_8 - * @param _my_large_string_8 New value to be moved in member my_large_string_8 - */ -void ComplexStruct::my_large_string_8( - eprosima::fastcdr::fixed_string<500>&& _my_large_string_8) -{ - m_my_large_string_8 = std::move(_my_large_string_8); -} - -/*! - * @brief This function returns a constant reference to member my_large_string_8 - * @return Constant reference to member my_large_string_8 - */ -const eprosima::fastcdr::fixed_string<500>& ComplexStruct::my_large_string_8() const -{ - return m_my_large_string_8; -} - -/*! - * @brief This function returns a reference to member my_large_string_8 - * @return Reference to member my_large_string_8 - */ -eprosima::fastcdr::fixed_string<500>& ComplexStruct::my_large_string_8() -{ - return m_my_large_string_8; -} - - -/*! - * @brief This function copies the value in member my_array_string - * @param _my_array_string New value to be copied in member my_array_string - */ -void ComplexStruct::my_array_string( - const std::array, 5>, 5>& _my_array_string) -{ - m_my_array_string = _my_array_string; -} - -/*! - * @brief This function moves the value in member my_array_string - * @param _my_array_string New value to be moved in member my_array_string - */ -void ComplexStruct::my_array_string( - std::array, 5>, 5>&& _my_array_string) -{ - m_my_array_string = std::move(_my_array_string); -} - -/*! - * @brief This function returns a constant reference to member my_array_string - * @return Constant reference to member my_array_string - */ -const std::array, 5>, 5>& ComplexStruct::my_array_string() const -{ - return m_my_array_string; -} - -/*! - * @brief This function returns a reference to member my_array_string - * @return Reference to member my_array_string - */ -std::array, 5>, 5>& ComplexStruct::my_array_string() -{ - return m_my_array_string; -} - - -/*! - * @brief This function copies the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 - */ -void ComplexStruct::multi_alias_array_42( - const MA3& _multi_alias_array_42) -{ - m_multi_alias_array_42 = _multi_alias_array_42; -} - -/*! - * @brief This function moves the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 - */ -void ComplexStruct::multi_alias_array_42( - MA3&& _multi_alias_array_42) -{ - m_multi_alias_array_42 = std::move(_multi_alias_array_42); -} - -/*! - * @brief This function returns a constant reference to member multi_alias_array_42 - * @return Constant reference to member multi_alias_array_42 - */ -const MA3& ComplexStruct::multi_alias_array_42() const -{ - return m_multi_alias_array_42; -} - -/*! - * @brief This function returns a reference to member multi_alias_array_42 - * @return Reference to member multi_alias_array_42 - */ -MA3& ComplexStruct::multi_alias_array_42() -{ - return m_multi_alias_array_42; -} - - -/*! - * @brief This function copies the value in member my_array_arrays - * @param _my_array_arrays New value to be copied in member my_array_arrays - */ -void ComplexStruct::my_array_arrays( - const std::array& _my_array_arrays) -{ - m_my_array_arrays = _my_array_arrays; -} - -/*! - * @brief This function moves the value in member my_array_arrays - * @param _my_array_arrays New value to be moved in member my_array_arrays - */ -void ComplexStruct::my_array_arrays( - std::array&& _my_array_arrays) -{ - m_my_array_arrays = std::move(_my_array_arrays); -} - -/*! - * @brief This function returns a constant reference to member my_array_arrays - * @return Constant reference to member my_array_arrays - */ -const std::array& ComplexStruct::my_array_arrays() const -{ - return m_my_array_arrays; -} - -/*! - * @brief This function returns a reference to member my_array_arrays - * @return Reference to member my_array_arrays - */ -std::array& ComplexStruct::my_array_arrays() -{ - return m_my_array_arrays; -} - - -/*! - * @brief This function copies the value in member my_sequences_array - * @param _my_sequences_array New value to be copied in member my_sequences_array - */ -void ComplexStruct::my_sequences_array( - const std::array& _my_sequences_array) -{ - m_my_sequences_array = _my_sequences_array; -} - -/*! - * @brief This function moves the value in member my_sequences_array - * @param _my_sequences_array New value to be moved in member my_sequences_array - */ -void ComplexStruct::my_sequences_array( - std::array&& _my_sequences_array) -{ - m_my_sequences_array = std::move(_my_sequences_array); -} - -/*! - * @brief This function returns a constant reference to member my_sequences_array - * @return Constant reference to member my_sequences_array - */ -const std::array& ComplexStruct::my_sequences_array() const -{ - return m_my_sequences_array; -} - -/*! - * @brief This function returns a reference to member my_sequences_array - * @return Reference to member my_sequences_array - */ -std::array& ComplexStruct::my_sequences_array() -{ - return m_my_sequences_array; -} - - - - -MyUnion::MyUnion() -{ - m__d = ::A; -} - -MyUnion::~MyUnion() -{ -} - -MyUnion::MyUnion( - const MyUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case ::A: - m_basic = x.m_basic; - break; - - - case ::B: - case ::C: - m_complex = x.m_complex; - break; - - default: - break; - } -} - -MyUnion::MyUnion( - MyUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case ::A: - m_basic = std::move(x.m_basic); - - break; - - - case ::B: - case ::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } -} - -MyUnion& MyUnion::operator =( - const MyUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case ::A: - m_basic = x.m_basic; - break; - - - case ::B: - case ::C: - m_complex = x.m_complex; - break; - - default: - break; - } - - return *this; -} - -MyUnion& MyUnion::operator =( - MyUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case ::A: - m_basic = std::move(x.m_basic); - - break; - - - case ::B: - case ::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } - - return *this; -} - -bool MyUnion::operator ==( - const MyUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case ::A: - return (m_basic == x.m_basic); - break; - - - case ::B: - case ::C: - return (m_complex == x.m_complex); - break; - - default: - break; - } - return false; -} - -bool MyUnion::operator !=( - const MyUnion& x) const -{ - return !(*this == x); -} - -void MyUnion::_d( - MyEnum __d) -{ - bool b = false; - - switch (m__d) - { - case ::A: - switch (__d) - { - case ::A: - b = true; - break; - default: - break; - } - break; - - - case ::B: - case ::C: - switch (__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -MyEnum MyUnion::_d() const -{ - return m__d; -} - -MyEnum& MyUnion::_d() -{ - return m__d; -} - -void MyUnion::basic( - const BasicStruct& _basic) -{ - m_basic = _basic; - m__d = ::A; - -} - -void MyUnion::basic( - BasicStruct&& _basic) -{ - m_basic = std::move(_basic); - m__d = ::A; - -} - -const BasicStruct& MyUnion::basic() const -{ - bool b = false; - - switch (m__d) - { - case ::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_basic; -} - -BasicStruct& MyUnion::basic() -{ - bool b = false; - - switch (m__d) - { - case ::A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_basic; -} - - -void MyUnion::complex( - const ComplexStruct& _complex) -{ - m_complex = _complex; - m__d = ::B; - -} - -void MyUnion::complex( - ComplexStruct&& _complex) -{ - m_complex = std::move(_complex); - m__d = ::B; - -} - -const ComplexStruct& MyUnion::complex() const -{ - bool b = false; - - switch (m__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_complex; -} - -ComplexStruct& MyUnion::complex() -{ - bool b = false; - - switch (m__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_complex; -} - - - - -MyUnion2::MyUnion2() -{ - m__d = A; -} - -MyUnion2::~MyUnion2() -{ -} - -MyUnion2::MyUnion2( - const MyUnion2& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = x.m_imString; - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } -} - -MyUnion2::MyUnion2( - MyUnion2&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = std::move(x.m_imString); - - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } -} - -MyUnion2& MyUnion2::operator =( - const MyUnion2& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = x.m_imString; - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; -} - -MyUnion2& MyUnion2::operator =( - MyUnion2&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = std::move(x.m_imString); - - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; -} - -bool MyUnion2::operator ==( - const MyUnion2& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_uno == x.m_uno); - break; - - - case B: - return (m_imString == x.m_imString); - break; - - - case C: - return (m_tres == x.m_tres); - break; - - default: - break; - } - return false; -} - -bool MyUnion2::operator !=( - const MyUnion2& x) const -{ - return !(*this == x); -} - -void MyUnion2::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case C: - switch (__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t MyUnion2::_d() const -{ - return m__d; -} - -uint8_t& MyUnion2::_d() -{ - return m__d; -} - -void MyUnion2::uno( - int32_t _uno) -{ - m_uno = _uno; - m__d = A; - -} - -int32_t MyUnion2::uno() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_uno; -} - -int32_t& MyUnion2::uno() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_uno; -} - - -void MyUnion2::imString( - const std::string& _imString) -{ - m_imString = _imString; - m__d = B; - -} - -void MyUnion2::imString( - std::string&& _imString) -{ - m_imString = std::move(_imString); - m__d = B; - -} - -const std::string& MyUnion2::imString() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_imString; -} - -std::string& MyUnion2::imString() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_imString; -} - - -void MyUnion2::tres( - int32_t _tres) -{ - m_tres = _tres; - m__d = C; - -} - -int32_t MyUnion2::tres() const -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_tres; -} - -int32_t& MyUnion2::tres() -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_tres; -} - - - - -CompleteStruct::CompleteStruct() -{ - // Just to register all known types - registerTestTypes(); -} - -CompleteStruct::~CompleteStruct() -{ -} - -CompleteStruct::CompleteStruct( - const CompleteStruct& x) -{ - m_my_union = x.m_my_union; - m_my_union_2 = x.m_my_union_2; -} - -CompleteStruct::CompleteStruct( - CompleteStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - m_my_union_2 = std::move(x.m_my_union_2); -} - -CompleteStruct& CompleteStruct::operator =( - const CompleteStruct& x) -{ - - m_my_union = x.m_my_union; - m_my_union_2 = x.m_my_union_2; - return *this; -} - -CompleteStruct& CompleteStruct::operator =( - CompleteStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - m_my_union_2 = std::move(x.m_my_union_2); - return *this; -} - -bool CompleteStruct::operator ==( - const CompleteStruct& x) const -{ - return (m_my_union == x.m_my_union && - m_my_union_2 == x.m_my_union_2); -} - -bool CompleteStruct::operator !=( - const CompleteStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void CompleteStruct::my_union( - const MyUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void CompleteStruct::my_union( - MyUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const MyUnion& CompleteStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -MyUnion& CompleteStruct::my_union() -{ - return m_my_union; -} - - -/*! - * @brief This function copies the value in member my_union_2 - * @param _my_union_2 New value to be copied in member my_union_2 - */ -void CompleteStruct::my_union_2( - const MyUnion2& _my_union_2) -{ - m_my_union_2 = _my_union_2; -} - -/*! - * @brief This function moves the value in member my_union_2 - * @param _my_union_2 New value to be moved in member my_union_2 - */ -void CompleteStruct::my_union_2( - MyUnion2&& _my_union_2) -{ - m_my_union_2 = std::move(_my_union_2); -} - -/*! - * @brief This function returns a constant reference to member my_union_2 - * @return Constant reference to member my_union_2 - */ -const MyUnion2& CompleteStruct::my_union_2() const -{ - return m_my_union_2; -} - -/*! - * @brief This function returns a reference to member my_union_2 - * @return Reference to member my_union_2 - */ -MyUnion2& CompleteStruct::my_union_2() -{ - return m_my_union_2; -} - - - - -KeyedStruct::KeyedStruct() -{ - // Just to register all known types - registerTestTypes(); -} - -KeyedStruct::~KeyedStruct() -{ -} - -KeyedStruct::KeyedStruct( - const KeyedStruct& x) -{ - m_key = x.m_key; - m_basic = x.m_basic; -} - -KeyedStruct::KeyedStruct( - KeyedStruct&& x) noexcept -{ - m_key = x.m_key; - m_basic = std::move(x.m_basic); -} - -KeyedStruct& KeyedStruct::operator =( - const KeyedStruct& x) -{ - - m_key = x.m_key; - m_basic = x.m_basic; - return *this; -} - -KeyedStruct& KeyedStruct::operator =( - KeyedStruct&& x) noexcept -{ - - m_key = x.m_key; - m_basic = std::move(x.m_basic); - return *this; -} - -bool KeyedStruct::operator ==( - const KeyedStruct& x) const -{ - return (m_key == x.m_key && - m_basic == x.m_basic); -} - -bool KeyedStruct::operator !=( - const KeyedStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedStruct::key( - uint8_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint8_t KeyedStruct::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint8_t& KeyedStruct::key() -{ - return m_key; -} - - -/*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ -void KeyedStruct::basic( - const BasicStruct& _basic) -{ - m_basic = _basic; -} - -/*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ -void KeyedStruct::basic( - BasicStruct&& _basic) -{ - m_basic = std::move(_basic); -} - -/*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - */ -const BasicStruct& KeyedStruct::basic() const -{ - return m_basic; -} - -/*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - */ -BasicStruct& KeyedStruct::basic() -{ - return m_basic; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TestCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Test.h b/test/unittest/dynamic_types/idl/Test.h deleted file mode 100644 index a67ced7e1c2..00000000000 --- a/test/unittest/dynamic_types/idl/Test.h +++ /dev/null @@ -1,1601 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Test.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Testv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TEST_H_ -#define _FAST_DDS_GENERATED_TEST_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TEST_SOURCE) -#define TEST_DllAPI __declspec( dllexport ) -#else -#define TEST_DllAPI __declspec( dllimport ) -#endif // TEST_SOURCE -#else -#define TEST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TEST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Test - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasEnum2; - -typedef MyAliasEnum2 MyAliasEnum3; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Test - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16); - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const; - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64); - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const; - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64(); - - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16); - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const; - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16(); - - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32); - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const; - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32(); - - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64); - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const; - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64(); - - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32); - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const; - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32(); - - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64); - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const; - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64(); - - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128); - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const; - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128(); - - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char); - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const; - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - bool m_my_bool{false}; - uint8_t m_my_octet{0}; - int16_t m_my_int16{0}; - int32_t m_my_int32{0}; - int64_t m_my_int64{0}; - uint16_t m_my_uint16{0}; - uint32_t m_my_uint32{0}; - uint64_t m_my_uint64{0}; - float m_my_float32{0.0}; - double m_my_float64{0.0}; - long double m_my_float128{0.0}; - char m_my_char{0}; - std::string m_my_string; - -}; -typedef std::array MyOctetArray500; - -typedef std::array BSAlias5; - -typedef std::array MA3; - -typedef std::array MyMiniArray; - - - -typedef std::vector MySequenceLong; - - - -/*! - * @brief This class represents the structure ComplexStruct defined by the user in the IDL file. - * @ingroup Test - */ -class ComplexStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ComplexStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ComplexStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - const ComplexStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - ComplexStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - const ComplexStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - ComplexStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ComplexStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ComplexStruct& x) const; - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - - - /*! - * @brief This function copies the value in member my_basic_struct - * @param _my_basic_struct New value to be copied in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - const BasicStruct& _my_basic_struct); - - /*! - * @brief This function moves the value in member my_basic_struct - * @param _my_basic_struct New value to be moved in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - BasicStruct&& _my_basic_struct); - - /*! - * @brief This function returns a constant reference to member my_basic_struct - * @return Constant reference to member my_basic_struct - */ - eProsima_user_DllExport const BasicStruct& my_basic_struct() const; - - /*! - * @brief This function returns a reference to member my_basic_struct - * @return Reference to member my_basic_struct - */ - eProsima_user_DllExport BasicStruct& my_basic_struct(); - - - /*! - * @brief This function sets a value in member my_alias_enum - * @param _my_alias_enum New value for member my_alias_enum - */ - eProsima_user_DllExport void my_alias_enum( - MyAliasEnum _my_alias_enum); - - /*! - * @brief This function returns the value of member my_alias_enum - * @return Value of member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum my_alias_enum() const; - - /*! - * @brief This function returns a reference to member my_alias_enum - * @return Reference to member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum& my_alias_enum(); - - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @brief This function copies the value in member my_sequence_octet - * @param _my_sequence_octet New value to be copied in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - const std::vector& _my_sequence_octet); - - /*! - * @brief This function moves the value in member my_sequence_octet - * @param _my_sequence_octet New value to be moved in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - std::vector&& _my_sequence_octet); - - /*! - * @brief This function returns a constant reference to member my_sequence_octet - * @return Constant reference to member my_sequence_octet - */ - eProsima_user_DllExport const std::vector& my_sequence_octet() const; - - /*! - * @brief This function returns a reference to member my_sequence_octet - * @return Reference to member my_sequence_octet - */ - eProsima_user_DllExport std::vector& my_sequence_octet(); - - - /*! - * @brief This function copies the value in member my_sequence_struct - * @param _my_sequence_struct New value to be copied in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - const std::vector& _my_sequence_struct); - - /*! - * @brief This function moves the value in member my_sequence_struct - * @param _my_sequence_struct New value to be moved in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - std::vector&& _my_sequence_struct); - - /*! - * @brief This function returns a constant reference to member my_sequence_struct - * @return Constant reference to member my_sequence_struct - */ - eProsima_user_DllExport const std::vector& my_sequence_struct() const; - - /*! - * @brief This function returns a reference to member my_sequence_struct - * @return Reference to member my_sequence_struct - */ - eProsima_user_DllExport std::vector& my_sequence_struct(); - - - /*! - * @brief This function copies the value in member my_array_octet - * @param _my_array_octet New value to be copied in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - const std::array, 5>, 500>& _my_array_octet); - - /*! - * @brief This function moves the value in member my_array_octet - * @param _my_array_octet New value to be moved in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - std::array, 5>, 500>&& _my_array_octet); - - /*! - * @brief This function returns a constant reference to member my_array_octet - * @return Constant reference to member my_array_octet - */ - eProsima_user_DllExport const std::array, 5>, 500>& my_array_octet() const; - - /*! - * @brief This function returns a reference to member my_array_octet - * @return Reference to member my_array_octet - */ - eProsima_user_DllExport std::array, 5>, 500>& my_array_octet(); - - - /*! - * @brief This function copies the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - const MyOctetArray500& _my_octet_array_500); - - /*! - * @brief This function moves the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - MyOctetArray500&& _my_octet_array_500); - - /*! - * @brief This function returns a constant reference to member my_octet_array_500 - * @return Constant reference to member my_octet_array_500 - */ - eProsima_user_DllExport const MyOctetArray500& my_octet_array_500() const; - - /*! - * @brief This function returns a reference to member my_octet_array_500 - * @return Reference to member my_octet_array_500 - */ - eProsima_user_DllExport MyOctetArray500& my_octet_array_500(); - - - /*! - * @brief This function copies the value in member my_array_struct - * @param _my_array_struct New value to be copied in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - const std::array& _my_array_struct); - - /*! - * @brief This function moves the value in member my_array_struct - * @param _my_array_struct New value to be moved in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - std::array&& _my_array_struct); - - /*! - * @brief This function returns a constant reference to member my_array_struct - * @return Constant reference to member my_array_struct - */ - eProsima_user_DllExport const std::array& my_array_struct() const; - - /*! - * @brief This function returns a reference to member my_array_struct - * @return Reference to member my_array_struct - */ - eProsima_user_DllExport std::array& my_array_struct(); - - - /*! - * @brief This function copies the value in member my_map_octet_short - * @param _my_map_octet_short New value to be copied in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - const std::map& _my_map_octet_short); - - /*! - * @brief This function moves the value in member my_map_octet_short - * @param _my_map_octet_short New value to be moved in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - std::map&& _my_map_octet_short); - - /*! - * @brief This function returns a constant reference to member my_map_octet_short - * @return Constant reference to member my_map_octet_short - */ - eProsima_user_DllExport const std::map& my_map_octet_short() const; - - /*! - * @brief This function returns a reference to member my_map_octet_short - * @return Reference to member my_map_octet_short - */ - eProsima_user_DllExport std::map& my_map_octet_short(); - - - /*! - * @brief This function copies the value in member my_map_long_struct - * @param _my_map_long_struct New value to be copied in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - const std::map& _my_map_long_struct); - - /*! - * @brief This function moves the value in member my_map_long_struct - * @param _my_map_long_struct New value to be moved in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - std::map&& _my_map_long_struct); - - /*! - * @brief This function returns a constant reference to member my_map_long_struct - * @return Constant reference to member my_map_long_struct - */ - eProsima_user_DllExport const std::map& my_map_long_struct() const; - - /*! - * @brief This function returns a reference to member my_map_long_struct - * @return Reference to member my_map_long_struct - */ - eProsima_user_DllExport std::map& my_map_long_struct(); - - - /*! - * @brief This function copies the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - const std::map>>& _my_map_long_seq_octet); - - /*! - * @brief This function moves the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - std::map>>&& _my_map_long_seq_octet); - - /*! - * @brief This function returns a constant reference to member my_map_long_seq_octet - * @return Constant reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport const std::map>>& my_map_long_seq_octet() const; - - /*! - * @brief This function returns a reference to member my_map_long_seq_octet - * @return Reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport std::map>>& my_map_long_seq_octet(); - - - /*! - * @brief This function copies the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - const std::map& _my_map_long_octet_array_500); - - /*! - * @brief This function moves the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - std::map&& _my_map_long_octet_array_500); - - /*! - * @brief This function returns a constant reference to member my_map_long_octet_array_500 - * @return Constant reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport const std::map& my_map_long_octet_array_500() const; - - /*! - * @brief This function returns a reference to member my_map_long_octet_array_500 - * @return Reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport std::map& my_map_long_octet_array_500(); - - - /*! - * @brief This function copies the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - const std::map>& _my_map_long_lol_type); - - /*! - * @brief This function moves the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - std::map>&& _my_map_long_lol_type); - - /*! - * @brief This function returns a constant reference to member my_map_long_lol_type - * @return Constant reference to member my_map_long_lol_type - */ - eProsima_user_DllExport const std::map>& my_map_long_lol_type() const; - - /*! - * @brief This function returns a reference to member my_map_long_lol_type - * @return Reference to member my_map_long_lol_type - */ - eProsima_user_DllExport std::map>& my_map_long_lol_type(); - - - /*! - * @brief This function copies the value in member my_small_string_8 - * @param _my_small_string_8 New value to be copied in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - const eprosima::fastcdr::fixed_string<128>& _my_small_string_8); - - /*! - * @brief This function moves the value in member my_small_string_8 - * @param _my_small_string_8 New value to be moved in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - eprosima::fastcdr::fixed_string<128>&& _my_small_string_8); - - /*! - * @brief This function returns a constant reference to member my_small_string_8 - * @return Constant reference to member my_small_string_8 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<128>& my_small_string_8() const; - - /*! - * @brief This function returns a reference to member my_small_string_8 - * @return Reference to member my_small_string_8 - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<128>& my_small_string_8(); - - - /*! - * @brief This function copies the value in member my_large_string_8 - * @param _my_large_string_8 New value to be copied in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - const eprosima::fastcdr::fixed_string<500>& _my_large_string_8); - - /*! - * @brief This function moves the value in member my_large_string_8 - * @param _my_large_string_8 New value to be moved in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - eprosima::fastcdr::fixed_string<500>&& _my_large_string_8); - - /*! - * @brief This function returns a constant reference to member my_large_string_8 - * @return Constant reference to member my_large_string_8 - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<500>& my_large_string_8() const; - - /*! - * @brief This function returns a reference to member my_large_string_8 - * @return Reference to member my_large_string_8 - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<500>& my_large_string_8(); - - - /*! - * @brief This function copies the value in member my_array_string - * @param _my_array_string New value to be copied in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - const std::array, 5>, 5>& _my_array_string); - - /*! - * @brief This function moves the value in member my_array_string - * @param _my_array_string New value to be moved in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - std::array, 5>, 5>&& _my_array_string); - - /*! - * @brief This function returns a constant reference to member my_array_string - * @return Constant reference to member my_array_string - */ - eProsima_user_DllExport const std::array, 5>, 5>& my_array_string() const; - - /*! - * @brief This function returns a reference to member my_array_string - * @return Reference to member my_array_string - */ - eProsima_user_DllExport std::array, 5>, 5>& my_array_string(); - - - /*! - * @brief This function copies the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - const MA3& _multi_alias_array_42); - - /*! - * @brief This function moves the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - MA3&& _multi_alias_array_42); - - /*! - * @brief This function returns a constant reference to member multi_alias_array_42 - * @return Constant reference to member multi_alias_array_42 - */ - eProsima_user_DllExport const MA3& multi_alias_array_42() const; - - /*! - * @brief This function returns a reference to member multi_alias_array_42 - * @return Reference to member multi_alias_array_42 - */ - eProsima_user_DllExport MA3& multi_alias_array_42(); - - - /*! - * @brief This function copies the value in member my_array_arrays - * @param _my_array_arrays New value to be copied in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - const std::array& _my_array_arrays); - - /*! - * @brief This function moves the value in member my_array_arrays - * @param _my_array_arrays New value to be moved in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - std::array&& _my_array_arrays); - - /*! - * @brief This function returns a constant reference to member my_array_arrays - * @return Constant reference to member my_array_arrays - */ - eProsima_user_DllExport const std::array& my_array_arrays() const; - - /*! - * @brief This function returns a reference to member my_array_arrays - * @return Reference to member my_array_arrays - */ - eProsima_user_DllExport std::array& my_array_arrays(); - - - /*! - * @brief This function copies the value in member my_sequences_array - * @param _my_sequences_array New value to be copied in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - const std::array& _my_sequences_array); - - /*! - * @brief This function moves the value in member my_sequences_array - * @param _my_sequences_array New value to be moved in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - std::array&& _my_sequences_array); - - /*! - * @brief This function returns a constant reference to member my_sequences_array - * @return Constant reference to member my_sequences_array - */ - eProsima_user_DllExport const std::array& my_sequences_array() const; - - /*! - * @brief This function returns a reference to member my_sequences_array - * @return Reference to member my_sequences_array - */ - eProsima_user_DllExport std::array& my_sequences_array(); - -private: - - uint8_t m_my_octet{0}; - BasicStruct m_my_basic_struct; - MyAliasEnum m_my_alias_enum{::A}; - MyEnum m_my_enum{::A}; - std::vector m_my_sequence_octet; - std::vector m_my_sequence_struct; - std::array, 5>, 500> m_my_array_octet{ {{ {{0}} }} }; - MyOctetArray500 m_my_octet_array_500{0}; - std::array m_my_array_struct; - std::map m_my_map_octet_short; - std::map m_my_map_long_struct; - std::map>> m_my_map_long_seq_octet; - std::map m_my_map_long_octet_array_500; - std::map> m_my_map_long_lol_type; - eprosima::fastcdr::fixed_string<128> m_my_small_string_8; - eprosima::fastcdr::fixed_string<500> m_my_large_string_8; - std::array, 5>, 5> m_my_array_string; - MA3 m_multi_alias_array_42{::A}; - std::array m_my_array_arrays{ {{0}} }; - std::array m_my_sequences_array; - -}; - - -/*! - * @brief This class represents the union MyUnion defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - const MyUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - MyUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - const MyUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - MyUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - MyEnum __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport MyEnum _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport MyEnum& _d(); - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic); - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic); - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const BasicStruct& basic() const; - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport BasicStruct& basic(); - - - /*! - * @brief This function copies the value in member complex - * @param _complex New value to be copied in member complex - */ - eProsima_user_DllExport void complex( - const ComplexStruct& _complex); - - /*! - * @brief This function moves the value in member complex - * @param _complex New value to be moved in member complex - */ - eProsima_user_DllExport void complex( - ComplexStruct&& _complex); - - /*! - * @brief This function returns a constant reference to member complex - * @return Constant reference to member complex - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const ComplexStruct& complex() const; - - /*! - * @brief This function returns a reference to member complex - * @return Reference to member complex - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport ComplexStruct& complex(); - -private: - - MyEnum m__d; - - BasicStruct m_basic; - ComplexStruct m_complex; -}; - - -/*! - * @brief This class represents the union MyUnion2 defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion2 -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion2(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion2(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - const MyUnion2& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - MyUnion2&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - const MyUnion2& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - MyUnion2&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion2& x) const; - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion2& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member uno - * @param _uno New value for member uno - */ - eProsima_user_DllExport void uno( - int32_t _uno); - - /*! - * @brief This function returns the value of member uno - * @return Value of member uno - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t uno() const; - - /*! - * @brief This function returns a reference to member uno - * @return Reference to member uno - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& uno(); - - - /*! - * @brief This function copies the value in member imString - * @param _imString New value to be copied in member imString - */ - eProsima_user_DllExport void imString( - const std::string& _imString); - - /*! - * @brief This function moves the value in member imString - * @param _imString New value to be moved in member imString - */ - eProsima_user_DllExport void imString( - std::string&& _imString); - - /*! - * @brief This function returns a constant reference to member imString - * @return Constant reference to member imString - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::string& imString() const; - - /*! - * @brief This function returns a reference to member imString - * @return Reference to member imString - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::string& imString(); - - - /*! - * @brief This function sets a value in member tres - * @param _tres New value for member tres - */ - eProsima_user_DllExport void tres( - int32_t _tres); - - /*! - * @brief This function returns the value of member tres - * @return Value of member tres - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t tres() const; - - /*! - * @brief This function returns a reference to member tres - * @return Reference to member tres - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& tres(); - -private: - - uint8_t m__d; - - int32_t m_uno{0}; - std::string m_imString; - int32_t m_tres{0}; -}; - - -/*! - * @brief This class represents the structure CompleteStruct defined by the user in the IDL file. - * @ingroup Test - */ -class CompleteStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CompleteStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CompleteStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - const CompleteStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - CompleteStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - const CompleteStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - CompleteStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CompleteStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CompleteStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const MyUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - MyUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const MyUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport MyUnion& my_union(); - - - /*! - * @brief This function copies the value in member my_union_2 - * @param _my_union_2 New value to be copied in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - const MyUnion2& _my_union_2); - - /*! - * @brief This function moves the value in member my_union_2 - * @param _my_union_2 New value to be moved in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - MyUnion2&& _my_union_2); - - /*! - * @brief This function returns a constant reference to member my_union_2 - * @return Constant reference to member my_union_2 - */ - eProsima_user_DllExport const MyUnion2& my_union_2() const; - - /*! - * @brief This function returns a reference to member my_union_2 - * @return Reference to member my_union_2 - */ - eProsima_user_DllExport MyUnion2& my_union_2(); - -private: - - MyUnion m_my_union; - MyUnion2 m_my_union_2; - -}; - - -/*! - * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. - * @ingroup Test - */ -class KeyedStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - const KeyedStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - KeyedStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - const KeyedStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - KeyedStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedStruct& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint8_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint8_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint8_t& key(); - - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic); - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic); - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - */ - eProsima_user_DllExport const BasicStruct& basic() const; - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - */ - eProsima_user_DllExport BasicStruct& basic(); - -private: - - uint8_t m_key{0}; - BasicStruct m_basic; - -}; - -#endif // _FAST_DDS_GENERATED_TEST_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Test.idl b/test/unittest/dynamic_types/idl/Test.idl deleted file mode 100644 index 8da8bd7cc2a..00000000000 --- a/test/unittest/dynamic_types/idl/Test.idl +++ /dev/null @@ -1,93 +0,0 @@ - -enum MyEnum -{ - A, - B, - C -}; - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasEnum2; -typedef MyAliasEnum2 MyAliasEnum3; - -struct BasicStruct -{ - boolean my_bool; - octet my_octet; - short my_int16; - long my_int32; - long long my_int64; - unsigned short my_uint16; - unsigned long my_uint32; - unsigned long long my_uint64; - float my_float32; - double my_float64; - long double my_float128; - char my_char; - //wchar my_wchar; //TODO(richiware) Remove when xtype 1.3. Also in DynamicComplexTypesTests.cpp. - string my_string; - //wstring my_wstring; //TODO(richiware) Remove when xtype 1.3. Also in DynamicComplexTypesTests.cpp. -}; - -typedef octet MyOctetArray500[500]; -typedef BasicStruct BSAlias5[5]; -typedef MyAliasEnum3 MA3[42]; -typedef long MyMiniArray[2]; -typedef sequence MySequenceLong; - -struct ComplexStruct -{ - octet my_octet; - BasicStruct my_basic_struct; - MyAliasEnum my_alias_enum; - MyEnum my_enum; - sequence my_sequence_octet; - sequence my_sequence_struct; - char my_array_octet[500][5][4]; - MyOctetArray500 my_octet_array_500; - BasicStruct my_array_struct[5]; - map my_map_octet_short; - map my_map_long_struct; - map > > my_map_long_seq_octet; - map my_map_long_octet_array_500; - map > my_map_long_lol_type; - string<128> my_small_string_8; - //wstring<64> my_small_string_16; //TODO(richiware) Remove when xtype 1.3 - string<500> my_large_string_8; - //wstring<1024> my_large_string_16; //TODO(richiware) Remove when xtype 1.3 - string<75> my_array_string[5][5]; - MA3 multi_alias_array_42; - MyMiniArray my_array_arrays[5]; - MySequenceLong my_sequences_array[23]; -}; - -union MyUnion switch (MyEnum) -{ - case A: - BasicStruct basic; - case B: - case C: - ComplexStruct complex; -}; - -union MyUnion2 switch (octet) -{ - case A: - long uno; - case B: - string imString; - case C: - long tres; -}; - -struct CompleteStruct -{ - MyUnion my_union; - MyUnion2 my_union_2; -}; - -struct KeyedStruct -{ - @key octet key; - BasicStruct basic; -}; diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.hpp b/test/unittest/dynamic_types/idl/TestCdrAux.hpp deleted file mode 100644 index 785beb525b0..00000000000 --- a/test/unittest/dynamic_types/idl/TestCdrAux.hpp +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ - -#include "Test.h" - -constexpr uint32_t KeyedStruct_max_cdr_typesize {344UL}; -constexpr uint32_t KeyedStruct_max_key_cdr_typesize {1UL}; - - - - -constexpr uint32_t BasicStruct_max_cdr_typesize {336UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ComplexStruct_max_cdr_typesize {18064796UL}; -constexpr uint32_t ComplexStruct_max_key_cdr_typesize {0UL}; - - - -constexpr uint32_t CompleteStruct_max_cdr_typesize {18065072UL}; -constexpr uint32_t CompleteStruct_max_key_cdr_typesize {0UL}; - - - - - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ComplexStruct& data); - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CompleteStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const KeyedStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.ipp b/test/unittest/dynamic_types/idl/TestCdrAux.ipp deleted file mode 100644 index f6f905aa6ca..00000000000 --- a/test/unittest/dynamic_types/idl/TestCdrAux.ipp +++ /dev/null @@ -1,873 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ - -#include "TestCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_int16(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_int64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.my_uint16(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.my_uint32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.my_uint64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), - data.my_float32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.my_float64(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.my_float128(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.my_char(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_octet() - << eprosima::fastcdr::MemberId(2) << data.my_int16() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_int64() - << eprosima::fastcdr::MemberId(5) << data.my_uint16() - << eprosima::fastcdr::MemberId(6) << data.my_uint32() - << eprosima::fastcdr::MemberId(7) << data.my_uint64() - << eprosima::fastcdr::MemberId(8) << data.my_float32() - << eprosima::fastcdr::MemberId(9) << data.my_float64() - << eprosima::fastcdr::MemberId(10) << data.my_float128() - << eprosima::fastcdr::MemberId(11) << data.my_char() - << eprosima::fastcdr::MemberId(12) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_octet(); - break; - - case 2: - dcdr >> data.my_int16(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_int64(); - break; - - case 5: - dcdr >> data.my_uint16(); - break; - - case 6: - dcdr >> data.my_uint32(); - break; - - case 7: - dcdr >> data.my_uint64(); - break; - - case 8: - dcdr >> data.my_float32(); - break; - - case 9: - dcdr >> data.my_float64(); - break; - - case 10: - dcdr >> data.my_float128(); - break; - - case 11: - dcdr >> data.my_char(); - break; - - case 12: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ComplexStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_basic_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_alias_enum(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_enum(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_sequence_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.my_sequence_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.my_array_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.my_octet_array_500(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), - data.my_array_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.my_map_octet_short(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.my_map_long_struct(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.my_map_long_seq_octet(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), - data.my_map_long_octet_array_500(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), - data.my_map_long_lol_type(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), - data.my_small_string_8(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), - data.my_large_string_8(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), - data.my_array_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), - data.multi_alias_array_42(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), - data.my_array_arrays(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), - data.my_sequences_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ComplexStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_octet() - << eprosima::fastcdr::MemberId(1) << data.my_basic_struct() - << eprosima::fastcdr::MemberId(2) << data.my_alias_enum() - << eprosima::fastcdr::MemberId(3) << data.my_enum() - << eprosima::fastcdr::MemberId(4) << data.my_sequence_octet() - << eprosima::fastcdr::MemberId(5) << data.my_sequence_struct() - << eprosima::fastcdr::MemberId(6) << data.my_array_octet() - << eprosima::fastcdr::MemberId(7) << data.my_octet_array_500() - << eprosima::fastcdr::MemberId(8) << data.my_array_struct() - << eprosima::fastcdr::MemberId(9) << data.my_map_octet_short() - << eprosima::fastcdr::MemberId(10) << data.my_map_long_struct() - << eprosima::fastcdr::MemberId(11) << data.my_map_long_seq_octet() - << eprosima::fastcdr::MemberId(12) << data.my_map_long_octet_array_500() - << eprosima::fastcdr::MemberId(13) << data.my_map_long_lol_type() - << eprosima::fastcdr::MemberId(14) << data.my_small_string_8() - << eprosima::fastcdr::MemberId(15) << data.my_large_string_8() - << eprosima::fastcdr::MemberId(16) << data.my_array_string() - << eprosima::fastcdr::MemberId(17) << data.multi_alias_array_42() - << eprosima::fastcdr::MemberId(18) << data.my_array_arrays() - << eprosima::fastcdr::MemberId(19) << data.my_sequences_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ComplexStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_octet(); - break; - - case 1: - dcdr >> data.my_basic_struct(); - break; - - case 2: - dcdr >> data.my_alias_enum(); - break; - - case 3: - dcdr >> data.my_enum(); - break; - - case 4: - dcdr >> data.my_sequence_octet(); - break; - - case 5: - dcdr >> data.my_sequence_struct(); - break; - - case 6: - dcdr >> data.my_array_octet(); - break; - - case 7: - dcdr >> data.my_octet_array_500(); - break; - - case 8: - dcdr >> data.my_array_struct(); - break; - - case 9: - dcdr >> data.my_map_octet_short(); - break; - - case 10: - dcdr >> data.my_map_long_struct(); - break; - - case 11: - dcdr >> data.my_map_long_seq_octet(); - break; - - case 12: - dcdr >> data.my_map_long_octet_array_500(); - break; - - case 13: - dcdr >> data.my_map_long_lol_type(); - break; - - case 14: - dcdr >> data.my_small_string_8(); - break; - - case 15: - dcdr >> data.my_large_string_8(); - break; - - case 16: - dcdr >> data.my_array_string(); - break; - - case 17: - dcdr >> data.multi_alias_array_42(); - break; - - case 18: - dcdr >> data.my_array_arrays(); - break; - - case 19: - dcdr >> data.my_sequences_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ComplexStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case ::A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.basic(), current_alignment); - break; - - case ::B: - case ::C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.complex(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case ::A: - scdr << eprosima::fastcdr::MemberId(1) << data.basic(); - break; - - case ::B: - case ::C: - scdr << eprosima::fastcdr::MemberId(2) << data.complex(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case ::A: - dcdr >> data.basic(); - break; - - case ::B: - case ::C: - dcdr >> data.complex(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyUnion2& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.uno(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.imString(), current_alignment); - break; - - case C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.tres(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyUnion2& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.uno(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.imString(); - break; - - case C: - scdr << eprosima::fastcdr::MemberId(3) << data.tres(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyUnion2& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.uno(); - break; - - case B: - dcdr >> data.imString(); - break; - - case C: - dcdr >> data.tres(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const CompleteStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_union_2(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const CompleteStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() - << eprosima::fastcdr::MemberId(1) << data.my_union_2() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - CompleteStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - case 1: - dcdr >> data.my_union_2(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const CompleteStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const KeyedStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.key(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.basic(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const KeyedStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.key() - << eprosima::fastcdr::MemberId(1) << data.basic() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - KeyedStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.key(); - break; - - case 1: - dcdr >> data.basic(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const KeyedStruct& data) -{ - static_cast(scdr); - static_cast(data); - scdr << data.key(); - - -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx b/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx deleted file mode 100644 index d450d6de064..00000000000 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx +++ /dev/null @@ -1,817 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TestPubSubTypes.h" -#include "TestCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - - - - - - - -BasicStructPubSubType::BasicStructPubSubType() -{ - setName("BasicStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicStruct::getMaxCdrSerializedSize()); -#else - BasicStruct_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 = BasicStruct_max_key_cdr_typesize > 16 ? BasicStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicStructPubSubType::~BasicStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicStruct* 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; - } - 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 BasicStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicStruct* 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 BasicStructPubSubType::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* BasicStructPubSubType::createData() -{ - return reinterpret_cast(new BasicStruct()); -} - -void BasicStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicStruct_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 || BasicStruct_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; -} - - - - - - - - - - - - - - - -ComplexStructPubSubType::ComplexStructPubSubType() -{ - setName("ComplexStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ComplexStruct::getMaxCdrSerializedSize()); -#else - ComplexStruct_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 = ComplexStruct_max_key_cdr_typesize > 16 ? ComplexStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ComplexStructPubSubType::~ComplexStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ComplexStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ComplexStruct* 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; - } - 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 ComplexStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ComplexStruct* 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 ComplexStructPubSubType::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* ComplexStructPubSubType::createData() -{ - return reinterpret_cast(new ComplexStruct()); -} - -void ComplexStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ComplexStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ComplexStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ComplexStruct_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 || ComplexStruct_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; -} - - - - - - - - - - - -CompleteStructPubSubType::CompleteStructPubSubType() -{ - setName("CompleteStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(CompleteStruct::getMaxCdrSerializedSize()); -#else - CompleteStruct_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 = CompleteStruct_max_key_cdr_typesize > 16 ? CompleteStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -CompleteStructPubSubType::~CompleteStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool CompleteStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - CompleteStruct* 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; - } - 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 CompleteStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - CompleteStruct* 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 CompleteStructPubSubType::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* CompleteStructPubSubType::createData() -{ - return reinterpret_cast(new CompleteStruct()); -} - -void CompleteStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool CompleteStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - CompleteStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - CompleteStruct_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 || CompleteStruct_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; -} - - - -KeyedStructPubSubType::KeyedStructPubSubType() -{ - setName("KeyedStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(KeyedStruct::getMaxCdrSerializedSize()); -#else - KeyedStruct_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 = KeyedStruct_max_key_cdr_typesize > 16 ? KeyedStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -KeyedStructPubSubType::~KeyedStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool KeyedStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - KeyedStruct* 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; - } - 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 KeyedStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - KeyedStruct* 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 KeyedStructPubSubType::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* KeyedStructPubSubType::createData() -{ - return reinterpret_cast(new KeyedStruct()); -} - -void KeyedStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool KeyedStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - KeyedStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - KeyedStruct_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 || KeyedStruct_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; -} - diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.h b/test/unittest/dynamic_types/idl/TestPubSubTypes.h deleted file mode 100644 index d74f7ae2664..00000000000 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.h +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Test.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Test is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - -typedef MyEnum MyAliasEnum; -typedef MyAliasEnum MyAliasEnum2; -typedef MyAliasEnum2 MyAliasEnum3; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Test - */ -class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicStruct type; - - eProsima_user_DllExport BasicStructPubSubType(); - - eProsima_user_DllExport ~BasicStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef std::array MyOctetArray500; -typedef std::array BSAlias5; -typedef std::array MA3; -typedef std::array MyMiniArray; - - -typedef std::vector MySequenceLong; - - - -/*! - * @brief This class represents the TopicDataType of the type ComplexStruct defined by the user in the IDL file. - * @ingroup Test - */ -class ComplexStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ComplexStruct type; - - eProsima_user_DllExport ComplexStructPubSubType(); - - eProsima_user_DllExport ~ComplexStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type CompleteStruct defined by the user in the IDL file. - * @ingroup Test - */ -class CompleteStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef CompleteStruct type; - - eProsima_user_DllExport CompleteStructPubSubType(); - - eProsima_user_DllExport ~CompleteStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type KeyedStruct defined by the user in the IDL file. - * @ingroup Test - */ -class KeyedStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef KeyedStruct type; - - eProsima_user_DllExport KeyedStructPubSubType(); - - eProsima_user_DllExport ~KeyedStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_TEST_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/TestTypeObject.cxx b/test/unittest/dynamic_types/idl/TestTypeObject.cxx deleted file mode 100644 index 60d8dba0b18..00000000000 --- a/test/unittest/dynamic_types/idl/TestTypeObject.cxx +++ /dev/null @@ -1,4306 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Test.h" -#include "TestTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTestTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasEnum2", GetMyAliasEnum2Identifier(true), - GetMyAliasEnum2Object(true)); - factory->add_type_object("MyAliasEnum2", GetMyAliasEnum2Identifier(false), - GetMyAliasEnum2Object(false)); - - - factory->add_type_object("MyAliasEnum3", GetMyAliasEnum3Identifier(true), - GetMyAliasEnum3Object(true)); - factory->add_type_object("MyAliasEnum3", GetMyAliasEnum3Identifier(false), - GetMyAliasEnum3Object(false)); - - - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(true), - GetBasicStructObject(true)); - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(false), - GetBasicStructObject(false)); - - - factory->add_type_object("MyOctetArray500", GetMyOctetArray500Identifier(true), - GetMyOctetArray500Object(true)); - factory->add_type_object("MyOctetArray500", GetMyOctetArray500Identifier(false), - GetMyOctetArray500Object(false)); - - - factory->add_type_object("BSAlias5", GetBSAlias5Identifier(true), - GetBSAlias5Object(true)); - factory->add_type_object("BSAlias5", GetBSAlias5Identifier(false), - GetBSAlias5Object(false)); - - - factory->add_type_object("MA3", GetMA3Identifier(true), - GetMA3Object(true)); - factory->add_type_object("MA3", GetMA3Identifier(false), - GetMA3Object(false)); - - - factory->add_type_object("MyMiniArray", GetMyMiniArrayIdentifier(true), - GetMyMiniArrayObject(true)); - factory->add_type_object("MyMiniArray", GetMyMiniArrayIdentifier(false), - GetMyMiniArrayObject(false)); - - - factory->add_type_object("MySequenceLong", GetMySequenceLongIdentifier(true), - GetMySequenceLongObject(true)); - factory->add_type_object("MySequenceLong", GetMySequenceLongIdentifier(false), - GetMySequenceLongObject(false)); - - - factory->add_type_object("ComplexStruct", GetComplexStructIdentifier(true), - GetComplexStructObject(true)); - factory->add_type_object("ComplexStruct", GetComplexStructIdentifier(false), - GetComplexStructObject(false)); - - - factory->add_type_object("MyUnion", GetMyUnionIdentifier(true), - GetMyUnionObject(true)); - factory->add_type_object("MyUnion", GetMyUnionIdentifier(false), - GetMyUnionObject(false)); - - - factory->add_type_object("MyUnion2", GetMyUnion2Identifier(true), - GetMyUnion2Object(true)); - factory->add_type_object("MyUnion2", GetMyUnion2Identifier(false), - GetMyUnion2Object(false)); - - - factory->add_type_object("CompleteStruct", GetCompleteStructIdentifier(true), - GetCompleteStructObject(true)); - factory->add_type_object("CompleteStruct", GetCompleteStructIdentifier(false), - GetCompleteStructObject(false)); - - - factory->add_type_object("KeyedStruct", GetKeyedStructIdentifier(true), - GetKeyedStructObject(true)); - factory->add_type_object("KeyedStruct", GetKeyedStructIdentifier(false), - GetKeyedStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - -const TypeIdentifier* GetMyAliasEnum2Identifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum2", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnum2Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum2", complete); -} - -const TypeObject* GetMyAliasEnum2Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum2", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnum2Object(); - } - else - { - return GetMinimalMyAliasEnum2Object(); - } -} - -const TypeObject* GetMinimalMyAliasEnum2Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum2", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum2", "MyAliasEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum2", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum2", false); -} - -const TypeObject* GetCompleteMyAliasEnum2Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum2", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum2"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyAliasEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum2", "MyAliasEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum2", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum2", true); -} - -const TypeIdentifier* GetMyAliasEnum3Identifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum3", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnum3Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum3", complete); -} - -const TypeObject* GetMyAliasEnum3Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnum3Object(); - } - else - { - return GetMinimalMyAliasEnum3Object(); - } -} - -const TypeObject* GetMinimalMyAliasEnum3Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum2", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum3", "MyAliasEnum2"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum3", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", false); -} - -const TypeObject* GetCompleteMyAliasEnum3Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum3"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyAliasEnum2"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum3", "MyAliasEnum2"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum3", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", true); -} - - - -const TypeIdentifier* GetBasicStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); -} - -const TypeObject* GetBasicStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicStructObject(); - } - //else - return GetMinimalBasicStructObject(); -} - -const TypeObject* GetMinimalBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_octet; - mst_my_octet.common().member_id(memberId++); - mst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_octet.common().member_flags().IS_KEY(false); - mst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_octet_hash("my_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_octet.detail().name_hash()[i] = my_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_octet); - - MinimalStructMember mst_my_int16; - mst_my_int16.common().member_id(memberId++); - mst_my_int16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int16.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int16.common().member_flags().IS_OPTIONAL(false); - mst_my_int16.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int16.common().member_flags().IS_KEY(false); - mst_my_int16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - MD5 my_int16_hash("my_int16"); - for(int i = 0; i < 4; ++i) - { - mst_my_int16.detail().name_hash()[i] = my_int16_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int16); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_int64; - mst_my_int64.common().member_id(memberId++); - mst_my_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int64.common().member_flags().IS_OPTIONAL(false); - mst_my_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int64.common().member_flags().IS_KEY(false); - mst_my_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 my_int64_hash("my_int64"); - for(int i = 0; i < 4; ++i) - { - mst_my_int64.detail().name_hash()[i] = my_int64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int64); - - MinimalStructMember mst_my_uint16; - mst_my_uint16.common().member_id(memberId++); - mst_my_uint16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint16.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint16.common().member_flags().IS_OPTIONAL(false); - mst_my_uint16.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint16.common().member_flags().IS_KEY(false); - mst_my_uint16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 my_uint16_hash("my_uint16"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint16.detail().name_hash()[i] = my_uint16_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint16); - - MinimalStructMember mst_my_uint32; - mst_my_uint32.common().member_id(memberId++); - mst_my_uint32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint32.common().member_flags().IS_OPTIONAL(false); - mst_my_uint32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint32.common().member_flags().IS_KEY(false); - mst_my_uint32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 my_uint32_hash("my_uint32"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint32.detail().name_hash()[i] = my_uint32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint32); - - MinimalStructMember mst_my_uint64; - mst_my_uint64.common().member_id(memberId++); - mst_my_uint64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_uint64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_uint64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_uint64.common().member_flags().IS_OPTIONAL(false); - mst_my_uint64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_uint64.common().member_flags().IS_KEY(false); - mst_my_uint64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_uint64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - MD5 my_uint64_hash("my_uint64"); - for(int i = 0; i < 4; ++i) - { - mst_my_uint64.detail().name_hash()[i] = my_uint64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_uint64); - - MinimalStructMember mst_my_float32; - mst_my_float32.common().member_id(memberId++); - mst_my_float32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float32.common().member_flags().IS_OPTIONAL(false); - mst_my_float32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float32.common().member_flags().IS_KEY(false); - mst_my_float32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - MD5 my_float32_hash("my_float32"); - for(int i = 0; i < 4; ++i) - { - mst_my_float32.detail().name_hash()[i] = my_float32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float32); - - MinimalStructMember mst_my_float64; - mst_my_float64.common().member_id(memberId++); - mst_my_float64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float64.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float64.common().member_flags().IS_OPTIONAL(false); - mst_my_float64.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float64.common().member_flags().IS_KEY(false); - mst_my_float64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - MD5 my_float64_hash("my_float64"); - for(int i = 0; i < 4; ++i) - { - mst_my_float64.detail().name_hash()[i] = my_float64_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float64); - - MinimalStructMember mst_my_float128; - mst_my_float128.common().member_id(memberId++); - mst_my_float128.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_float128.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_float128.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_float128.common().member_flags().IS_OPTIONAL(false); - mst_my_float128.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_float128.common().member_flags().IS_KEY(false); - mst_my_float128.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_float128.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - MD5 my_float128_hash("my_float128"); - for(int i = 0; i < 4; ++i) - { - mst_my_float128.detail().name_hash()[i] = my_float128_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_float128); - - MinimalStructMember mst_my_char; - mst_my_char.common().member_id(memberId++); - mst_my_char.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_char.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_char.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_char.common().member_flags().IS_OPTIONAL(false); - mst_my_char.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_char.common().member_flags().IS_KEY(false); - mst_my_char.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_char.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - MD5 my_char_hash("my_char"); - for(int i = 0; i < 4; ++i) - { - mst_my_char.detail().name_hash()[i] = my_char_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_char); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); -} - -const TypeObject* GetCompleteBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_octet; - cst_my_octet.common().member_id(memberId++); - cst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_octet.common().member_flags().IS_KEY(false); - cst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_octet.detail().name("my_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_octet); - - CompleteStructMember cst_my_int16; - cst_my_int16.common().member_id(memberId++); - cst_my_int16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int16.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int16.common().member_flags().IS_OPTIONAL(false); - cst_my_int16.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int16.common().member_flags().IS_KEY(false); - cst_my_int16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - cst_my_int16.detail().name("my_int16"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int16); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_int64; - cst_my_int64.common().member_id(memberId++); - cst_my_int64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int64.common().member_flags().IS_OPTIONAL(false); - cst_my_int64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int64.common().member_flags().IS_KEY(false); - cst_my_int64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_my_int64.detail().name("my_int64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int64); - - CompleteStructMember cst_my_uint16; - cst_my_uint16.common().member_id(memberId++); - cst_my_uint16.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint16.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint16.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint16.common().member_flags().IS_OPTIONAL(false); - cst_my_uint16.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint16.common().member_flags().IS_KEY(false); - cst_my_uint16.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint16.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_my_uint16.detail().name("my_uint16"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint16); - - CompleteStructMember cst_my_uint32; - cst_my_uint32.common().member_id(memberId++); - cst_my_uint32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint32.common().member_flags().IS_OPTIONAL(false); - cst_my_uint32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint32.common().member_flags().IS_KEY(false); - cst_my_uint32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_my_uint32.detail().name("my_uint32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint32); - - CompleteStructMember cst_my_uint64; - cst_my_uint64.common().member_id(memberId++); - cst_my_uint64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_uint64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_uint64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_uint64.common().member_flags().IS_OPTIONAL(false); - cst_my_uint64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_uint64.common().member_flags().IS_KEY(false); - cst_my_uint64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_uint64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - cst_my_uint64.detail().name("my_uint64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_uint64); - - CompleteStructMember cst_my_float32; - cst_my_float32.common().member_id(memberId++); - cst_my_float32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float32.common().member_flags().IS_OPTIONAL(false); - cst_my_float32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float32.common().member_flags().IS_KEY(false); - cst_my_float32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("float", false)); - - - cst_my_float32.detail().name("my_float32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float32); - - CompleteStructMember cst_my_float64; - cst_my_float64.common().member_id(memberId++); - cst_my_float64.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float64.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float64.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float64.common().member_flags().IS_OPTIONAL(false); - cst_my_float64.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float64.common().member_flags().IS_KEY(false); - cst_my_float64.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float64.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("double", false)); - - - cst_my_float64.detail().name("my_float64"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float64); - - CompleteStructMember cst_my_float128; - cst_my_float128.common().member_id(memberId++); - cst_my_float128.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_float128.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_float128.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_float128.common().member_flags().IS_OPTIONAL(false); - cst_my_float128.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_float128.common().member_flags().IS_KEY(false); - cst_my_float128.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_float128.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("longdouble", false)); - - - cst_my_float128.detail().name("my_float128"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_float128); - - CompleteStructMember cst_my_char; - cst_my_char.common().member_id(memberId++); - cst_my_char.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_char.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_char.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_char.common().member_flags().IS_OPTIONAL(false); - cst_my_char.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_char.common().member_flags().IS_KEY(false); - cst_my_char.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_char.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("char", false)); - - - cst_my_char.detail().name("my_char"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_char); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); -} - -const TypeIdentifier* GetMyOctetArray500Identifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyOctetArray500", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyOctetArray500Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyOctetArray500", complete); -} - -const TypeObject* GetMyOctetArray500Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyOctetArray500", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyOctetArray500Object(); - } - else - { - return GetMinimalMyOctetArray500Object(); - } -} - -const TypeObject* GetMinimalMyOctetArray500Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyOctetArray500", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_array_type_name("uint8_t", {500}), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyOctetArray500", TypeNamesGenerator::get_array_type_name("uint8_t", {500})); - - TypeObjectFactory::get_instance()->add_type_object("MyOctetArray500", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyOctetArray500", false); -} - -const TypeObject* GetCompleteMyOctetArray500Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyOctetArray500", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyOctetArray500"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_array_type_name("uint8_t", {500})); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyOctetArray500", TypeNamesGenerator::get_array_type_name("uint8_t", {500})); - - TypeObjectFactory::get_instance()->add_type_object("MyOctetArray500", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyOctetArray500", true); -} - -const TypeIdentifier* GetBSAlias5Identifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BSAlias5", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBSAlias5Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BSAlias5", complete); -} - -const TypeObject* GetBSAlias5Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BSAlias5", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBSAlias5Object(); - } - else - { - return GetMinimalBSAlias5Object(); - } -} - -const TypeObject* GetMinimalBSAlias5Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BSAlias5", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_array_type_name("BasicStruct", {5}), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("BSAlias5", TypeNamesGenerator::get_array_type_name("BasicStruct", {5})); - - TypeObjectFactory::get_instance()->add_type_object("BSAlias5", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BSAlias5", false); -} - -const TypeObject* GetCompleteBSAlias5Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BSAlias5", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("BSAlias5"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_array_type_name("BasicStruct", {5})); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("BSAlias5", TypeNamesGenerator::get_array_type_name("BasicStruct", {5})); - - TypeObjectFactory::get_instance()->add_type_object("BSAlias5", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BSAlias5", true); -} - -const TypeIdentifier* GetMA3Identifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MA3", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMA3Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MA3", complete); -} - -const TypeObject* GetMA3Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MA3", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMA3Object(); - } - else - { - return GetMinimalMA3Object(); - } -} - -const TypeObject* GetMinimalMA3Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MA3", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_array_type_name("MyAliasEnum3", {42}), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MA3", TypeNamesGenerator::get_array_type_name("MyAliasEnum3", {42})); - - TypeObjectFactory::get_instance()->add_type_object("MA3", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MA3", false); -} - -const TypeObject* GetCompleteMA3Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MA3", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MA3"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_array_type_name("MyAliasEnum3", {42})); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MA3", TypeNamesGenerator::get_array_type_name("MyAliasEnum3", {42})); - - TypeObjectFactory::get_instance()->add_type_object("MA3", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MA3", true); -} - -const TypeIdentifier* GetMyMiniArrayIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyMiniArray", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyMiniArrayObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyMiniArray", complete); -} - -const TypeObject* GetMyMiniArrayObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyMiniArrayObject(); - } - else - { - return GetMinimalMyMiniArrayObject(); - } -} - -const TypeObject* GetMinimalMyMiniArrayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_array_type_name("int32_t", {2}), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyMiniArray", TypeNamesGenerator::get_array_type_name("int32_t", {2})); - - TypeObjectFactory::get_instance()->add_type_object("MyMiniArray", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", false); -} - -const TypeObject* GetCompleteMyMiniArrayObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyMiniArray"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_array_type_name("int32_t", {2})); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyMiniArray", TypeNamesGenerator::get_array_type_name("int32_t", {2})); - - TypeObjectFactory::get_instance()->add_type_object("MyMiniArray", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", true); -} - - - -const TypeIdentifier* GetMySequenceLongIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MySequenceLong", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMySequenceLongObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MySequenceLong", complete); -} - -const TypeObject* GetMySequenceLongObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMySequenceLongObject(); - } - else - { - return GetMinimalMySequenceLongObject(); - } -} - -const TypeObject* GetMinimalMySequenceLongObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 100), false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); - - TypeObjectFactory::get_instance()->add_type_object("MySequenceLong", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", false); -} - -const TypeObject* GetCompleteMySequenceLongObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MySequenceLong"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MySequenceLong", TypeNamesGenerator::get_sequence_type_name("int32_t", 100)); - - TypeObjectFactory::get_instance()->add_type_object("MySequenceLong", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", true); -} - - - -const TypeIdentifier* GetComplexStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ComplexStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetComplexStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ComplexStruct", complete); -} - -const TypeObject* GetComplexStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteComplexStructObject(); - } - //else - return GetMinimalComplexStructObject(); -} - -const TypeObject* GetMinimalComplexStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_octet; - mst_my_octet.common().member_id(memberId++); - mst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_octet.common().member_flags().IS_KEY(false); - mst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_octet_hash("my_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_octet.detail().name_hash()[i] = my_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_octet); - - MinimalStructMember mst_my_basic_struct; - mst_my_basic_struct.common().member_id(memberId++); - mst_my_basic_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_basic_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_basic_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_basic_struct.common().member_flags().IS_OPTIONAL(false); - mst_my_basic_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_basic_struct.common().member_flags().IS_KEY(false); - mst_my_basic_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_basic_struct.common().member_type_id(*GetBasicStructIdentifier(false)); - - MD5 my_basic_struct_hash("my_basic_struct"); - for(int i = 0; i < 4; ++i) - { - mst_my_basic_struct.detail().name_hash()[i] = my_basic_struct_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_basic_struct); - - MinimalStructMember mst_my_alias_enum; - mst_my_alias_enum.common().member_id(memberId++); - mst_my_alias_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_alias_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_alias_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_alias_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_alias_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_alias_enum.common().member_flags().IS_KEY(false); - mst_my_alias_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_alias_enum.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_alias_enum_hash("my_alias_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_alias_enum.detail().name_hash()[i] = my_alias_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_alias_enum); - - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - MinimalStructMember mst_my_sequence_octet; - mst_my_sequence_octet.common().member_id(memberId++); - mst_my_sequence_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_octet.common().member_flags().IS_KEY(false); - mst_my_sequence_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 55, false)); - - MD5 my_sequence_octet_hash("my_sequence_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_octet.detail().name_hash()[i] = my_sequence_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_octet); - - MinimalStructMember mst_my_sequence_struct; - mst_my_sequence_struct.common().member_id(memberId++); - mst_my_sequence_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_struct.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_struct.common().member_flags().IS_KEY(false); - mst_my_sequence_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 100, false)); - - MD5 my_sequence_struct_hash("my_sequence_struct"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_struct.detail().name_hash()[i] = my_sequence_struct_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_struct); - - MinimalStructMember mst_my_array_octet; - mst_my_array_octet.common().member_id(memberId++); - mst_my_array_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_array_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_octet.common().member_flags().IS_KEY(false); - mst_my_array_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {500, 5, 4}, false)); - - MD5 my_array_octet_hash("my_array_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_octet.detail().name_hash()[i] = my_array_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_octet); - - MinimalStructMember mst_my_octet_array_500; - mst_my_octet_array_500.common().member_id(memberId++); - mst_my_octet_array_500.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_octet_array_500.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_octet_array_500.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_octet_array_500.common().member_flags().IS_OPTIONAL(false); - mst_my_octet_array_500.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_octet_array_500.common().member_flags().IS_KEY(false); - mst_my_octet_array_500.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_octet_array_500.common().member_type_id(*GetMyOctetArray500Identifier(false)); - - MD5 my_octet_array_500_hash("my_octet_array_500"); - for(int i = 0; i < 4; ++i) - { - mst_my_octet_array_500.detail().name_hash()[i] = my_octet_array_500_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_octet_array_500); - - MinimalStructMember mst_my_array_struct; - mst_my_array_struct.common().member_id(memberId++); - mst_my_array_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_struct.common().member_flags().IS_OPTIONAL(false); - mst_my_array_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_struct.common().member_flags().IS_KEY(false); - mst_my_array_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("BasicStruct", {5}, false)); - - MD5 my_array_struct_hash("my_array_struct"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_struct.detail().name_hash()[i] = my_array_struct_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_struct); - - MinimalStructMember mst_my_map_octet_short; - mst_my_map_octet_short.common().member_id(memberId++); - mst_my_map_octet_short.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_octet_short.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_octet_short.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_octet_short.common().member_flags().IS_OPTIONAL(false); - mst_my_map_octet_short.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_octet_short.common().member_flags().IS_KEY(false); - mst_my_map_octet_short.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_octet_short.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int16_t", 100, false)); - - MD5 my_map_octet_short_hash("my_map_octet_short"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_octet_short.detail().name_hash()[i] = my_map_octet_short_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_octet_short); - - MinimalStructMember mst_my_map_long_struct; - mst_my_map_long_struct.common().member_id(memberId++); - mst_my_map_long_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_long_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_long_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_long_struct.common().member_flags().IS_OPTIONAL(false); - mst_my_map_long_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_long_struct.common().member_flags().IS_KEY(false); - mst_my_map_long_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_long_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "BasicStruct", 100, false)); - - MD5 my_map_long_struct_hash("my_map_long_struct"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_long_struct.detail().name_hash()[i] = my_map_long_struct_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_long_struct); - - MinimalStructMember mst_my_map_long_seq_octet; - mst_my_map_long_seq_octet.common().member_id(memberId++); - mst_my_map_long_seq_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_long_seq_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_long_seq_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_long_seq_octet.common().member_flags().IS_OPTIONAL(false); - mst_my_map_long_seq_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_long_seq_octet.common().member_flags().IS_KEY(false); - mst_my_map_long_seq_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 100), 100), 100, false)); - - MD5 my_map_long_seq_octet_hash("my_map_long_seq_octet"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_long_seq_octet.detail().name_hash()[i] = my_map_long_seq_octet_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_long_seq_octet); - - MinimalStructMember mst_my_map_long_octet_array_500; - mst_my_map_long_octet_array_500.common().member_id(memberId++); - mst_my_map_long_octet_array_500.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_long_octet_array_500.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_long_octet_array_500.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_long_octet_array_500.common().member_flags().IS_OPTIONAL(false); - mst_my_map_long_octet_array_500.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_long_octet_array_500.common().member_flags().IS_KEY(false); - mst_my_map_long_octet_array_500.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_long_octet_array_500.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "MyOctetArray500", 100, false)); - - MD5 my_map_long_octet_array_500_hash("my_map_long_octet_array_500"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_long_octet_array_500.detail().name_hash()[i] = my_map_long_octet_array_500_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_long_octet_array_500); - - MinimalStructMember mst_my_map_long_lol_type; - mst_my_map_long_lol_type.common().member_id(memberId++); - mst_my_map_long_lol_type.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_long_lol_type.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_long_lol_type.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_long_lol_type.common().member_flags().IS_OPTIONAL(false); - mst_my_map_long_lol_type.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_long_lol_type.common().member_flags().IS_KEY(false); - mst_my_map_long_lol_type.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_long_lol_type.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("uint8_t", "BSAlias5", 100), 100, false)); - - MD5 my_map_long_lol_type_hash("my_map_long_lol_type"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_long_lol_type.detail().name_hash()[i] = my_map_long_lol_type_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_long_lol_type); - - MinimalStructMember mst_my_small_string_8; - mst_my_small_string_8.common().member_id(memberId++); - mst_my_small_string_8.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_small_string_8.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_small_string_8.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_small_string_8.common().member_flags().IS_OPTIONAL(false); - mst_my_small_string_8.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_small_string_8.common().member_flags().IS_KEY(false); - mst_my_small_string_8.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_small_string_8.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(128, false)); - - MD5 my_small_string_8_hash("my_small_string_8"); - for(int i = 0; i < 4; ++i) - { - mst_my_small_string_8.detail().name_hash()[i] = my_small_string_8_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_small_string_8); - - MinimalStructMember mst_my_large_string_8; - mst_my_large_string_8.common().member_id(memberId++); - mst_my_large_string_8.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string_8.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string_8.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string_8.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string_8.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string_8.common().member_flags().IS_KEY(false); - mst_my_large_string_8.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string_8.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(500, false)); - - MD5 my_large_string_8_hash("my_large_string_8"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string_8.detail().name_hash()[i] = my_large_string_8_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string_8); - - MinimalStructMember mst_my_array_string; - mst_my_array_string.common().member_id(memberId++); - mst_my_array_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_string.common().member_flags().IS_OPTIONAL(false); - mst_my_array_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_string.common().member_flags().IS_KEY(false); - mst_my_array_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(75, false), {5, 5}, false)); - - MD5 my_array_string_hash("my_array_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_string.detail().name_hash()[i] = my_array_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_string); - - MinimalStructMember mst_multi_alias_array_42; - mst_multi_alias_array_42.common().member_id(memberId++); - mst_multi_alias_array_42.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_multi_alias_array_42.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_multi_alias_array_42.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_multi_alias_array_42.common().member_flags().IS_OPTIONAL(false); - mst_multi_alias_array_42.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_multi_alias_array_42.common().member_flags().IS_KEY(false); - mst_multi_alias_array_42.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_multi_alias_array_42.common().member_type_id(*GetMA3Identifier(false)); - - MD5 multi_alias_array_42_hash("multi_alias_array_42"); - for(int i = 0; i < 4; ++i) - { - mst_multi_alias_array_42.detail().name_hash()[i] = multi_alias_array_42_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_multi_alias_array_42); - - MinimalStructMember mst_my_array_arrays; - mst_my_array_arrays.common().member_id(memberId++); - mst_my_array_arrays.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_arrays.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_arrays.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_arrays.common().member_flags().IS_OPTIONAL(false); - mst_my_array_arrays.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_arrays.common().member_flags().IS_KEY(false); - mst_my_array_arrays.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_arrays.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MyMiniArray", {5}, false)); - - MD5 my_array_arrays_hash("my_array_arrays"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_arrays.detail().name_hash()[i] = my_array_arrays_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_arrays); - - MinimalStructMember mst_my_sequences_array; - mst_my_sequences_array.common().member_id(memberId++); - mst_my_sequences_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequences_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequences_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequences_array.common().member_flags().IS_OPTIONAL(false); - mst_my_sequences_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequences_array.common().member_flags().IS_KEY(false); - mst_my_sequences_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequences_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MySequenceLong", {23}, false)); - - MD5 my_sequences_array_hash("my_sequences_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequences_array.detail().name_hash()[i] = my_sequences_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequences_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ComplexStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", false); -} - -const TypeObject* GetCompleteComplexStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_octet; - cst_my_octet.common().member_id(memberId++); - cst_my_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_octet.common().member_flags().IS_KEY(false); - cst_my_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_octet.detail().name("my_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_octet); - - CompleteStructMember cst_my_basic_struct; - cst_my_basic_struct.common().member_id(memberId++); - cst_my_basic_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_basic_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_basic_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_basic_struct.common().member_flags().IS_OPTIONAL(false); - cst_my_basic_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_basic_struct.common().member_flags().IS_KEY(false); - cst_my_basic_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_basic_struct.common().member_type_id(*GetBasicStructIdentifier(true)); - - cst_my_basic_struct.detail().name("my_basic_struct"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_basic_struct); - - CompleteStructMember cst_my_alias_enum; - cst_my_alias_enum.common().member_id(memberId++); - cst_my_alias_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_alias_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_alias_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_alias_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_alias_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_alias_enum.common().member_flags().IS_KEY(false); - cst_my_alias_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_alias_enum.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_alias_enum.detail().name("my_alias_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_alias_enum); - - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - CompleteStructMember cst_my_sequence_octet; - cst_my_sequence_octet.common().member_id(memberId++); - cst_my_sequence_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_octet.common().member_flags().IS_KEY(false); - cst_my_sequence_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 55, true)); - - cst_my_sequence_octet.detail().name("my_sequence_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_octet); - - CompleteStructMember cst_my_sequence_struct; - cst_my_sequence_struct.common().member_id(memberId++); - cst_my_sequence_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_struct.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_struct.common().member_flags().IS_KEY(false); - cst_my_sequence_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("BasicStruct", 100, true)); - - cst_my_sequence_struct.detail().name("my_sequence_struct"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_struct); - - CompleteStructMember cst_my_array_octet; - cst_my_array_octet.common().member_id(memberId++); - cst_my_array_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_array_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_octet.common().member_flags().IS_KEY(false); - cst_my_array_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {500, 5, 4}, true)); - - cst_my_array_octet.detail().name("my_array_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_octet); - - CompleteStructMember cst_my_octet_array_500; - cst_my_octet_array_500.common().member_id(memberId++); - cst_my_octet_array_500.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_octet_array_500.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_octet_array_500.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_octet_array_500.common().member_flags().IS_OPTIONAL(false); - cst_my_octet_array_500.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_octet_array_500.common().member_flags().IS_KEY(false); - cst_my_octet_array_500.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_octet_array_500.common().member_type_id(*GetMyOctetArray500Identifier(true)); - - cst_my_octet_array_500.detail().name("my_octet_array_500"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_octet_array_500); - - CompleteStructMember cst_my_array_struct; - cst_my_array_struct.common().member_id(memberId++); - cst_my_array_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_struct.common().member_flags().IS_OPTIONAL(false); - cst_my_array_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_struct.common().member_flags().IS_KEY(false); - cst_my_array_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("BasicStruct", {5}, true)); - - cst_my_array_struct.detail().name("my_array_struct"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_struct); - - CompleteStructMember cst_my_map_octet_short; - cst_my_map_octet_short.common().member_id(memberId++); - cst_my_map_octet_short.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_octet_short.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_octet_short.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_octet_short.common().member_flags().IS_OPTIONAL(false); - cst_my_map_octet_short.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_octet_short.common().member_flags().IS_KEY(false); - cst_my_map_octet_short.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_octet_short.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int16_t", 100, true)); - - cst_my_map_octet_short.detail().name("my_map_octet_short"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_octet_short); - - CompleteStructMember cst_my_map_long_struct; - cst_my_map_long_struct.common().member_id(memberId++); - cst_my_map_long_struct.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_long_struct.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_long_struct.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_long_struct.common().member_flags().IS_OPTIONAL(false); - cst_my_map_long_struct.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_long_struct.common().member_flags().IS_KEY(false); - cst_my_map_long_struct.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_long_struct.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "BasicStruct", 100, true)); - - cst_my_map_long_struct.detail().name("my_map_long_struct"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_long_struct); - - CompleteStructMember cst_my_map_long_seq_octet; - cst_my_map_long_seq_octet.common().member_id(memberId++); - cst_my_map_long_seq_octet.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_long_seq_octet.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_long_seq_octet.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_long_seq_octet.common().member_flags().IS_OPTIONAL(false); - cst_my_map_long_seq_octet.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_long_seq_octet.common().member_flags().IS_KEY(false); - cst_my_map_long_seq_octet.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_long_seq_octet.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_sequence_type_name(TypeNamesGenerator::get_sequence_type_name("uint8_t", 100), 100), 100, true)); - - cst_my_map_long_seq_octet.detail().name("my_map_long_seq_octet"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_long_seq_octet); - - CompleteStructMember cst_my_map_long_octet_array_500; - cst_my_map_long_octet_array_500.common().member_id(memberId++); - cst_my_map_long_octet_array_500.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_long_octet_array_500.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_long_octet_array_500.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_long_octet_array_500.common().member_flags().IS_OPTIONAL(false); - cst_my_map_long_octet_array_500.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_long_octet_array_500.common().member_flags().IS_KEY(false); - cst_my_map_long_octet_array_500.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_long_octet_array_500.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "MyOctetArray500", 100, true)); - - cst_my_map_long_octet_array_500.detail().name("my_map_long_octet_array_500"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_long_octet_array_500); - - CompleteStructMember cst_my_map_long_lol_type; - cst_my_map_long_lol_type.common().member_id(memberId++); - cst_my_map_long_lol_type.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_long_lol_type.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_long_lol_type.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_long_lol_type.common().member_flags().IS_OPTIONAL(false); - cst_my_map_long_lol_type.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_long_lol_type.common().member_flags().IS_KEY(false); - cst_my_map_long_lol_type.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_long_lol_type.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("uint8_t", "BSAlias5", 100), 100, true)); - - cst_my_map_long_lol_type.detail().name("my_map_long_lol_type"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_long_lol_type); - - CompleteStructMember cst_my_small_string_8; - cst_my_small_string_8.common().member_id(memberId++); - cst_my_small_string_8.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_small_string_8.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_small_string_8.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_small_string_8.common().member_flags().IS_OPTIONAL(false); - cst_my_small_string_8.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_small_string_8.common().member_flags().IS_KEY(false); - cst_my_small_string_8.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_small_string_8.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(128, false)); - - cst_my_small_string_8.detail().name("my_small_string_8"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_small_string_8); - - CompleteStructMember cst_my_large_string_8; - cst_my_large_string_8.common().member_id(memberId++); - cst_my_large_string_8.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string_8.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string_8.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string_8.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string_8.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string_8.common().member_flags().IS_KEY(false); - cst_my_large_string_8.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string_8.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(500, false)); - - cst_my_large_string_8.detail().name("my_large_string_8"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string_8); - - CompleteStructMember cst_my_array_string; - cst_my_array_string.common().member_id(memberId++); - cst_my_array_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_string.common().member_flags().IS_OPTIONAL(false); - cst_my_array_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_string.common().member_flags().IS_KEY(false); - cst_my_array_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(75, false), {5, 5}, true)); - - cst_my_array_string.detail().name("my_array_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_string); - - CompleteStructMember cst_multi_alias_array_42; - cst_multi_alias_array_42.common().member_id(memberId++); - cst_multi_alias_array_42.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_multi_alias_array_42.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_multi_alias_array_42.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_multi_alias_array_42.common().member_flags().IS_OPTIONAL(false); - cst_multi_alias_array_42.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_multi_alias_array_42.common().member_flags().IS_KEY(false); - cst_multi_alias_array_42.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_multi_alias_array_42.common().member_type_id(*GetMA3Identifier(true)); - - cst_multi_alias_array_42.detail().name("multi_alias_array_42"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_multi_alias_array_42); - - CompleteStructMember cst_my_array_arrays; - cst_my_array_arrays.common().member_id(memberId++); - cst_my_array_arrays.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_arrays.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_arrays.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_arrays.common().member_flags().IS_OPTIONAL(false); - cst_my_array_arrays.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_arrays.common().member_flags().IS_KEY(false); - cst_my_array_arrays.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_arrays.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MyMiniArray", {5}, true)); - - cst_my_array_arrays.detail().name("my_array_arrays"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_arrays); - - CompleteStructMember cst_my_sequences_array; - cst_my_sequences_array.common().member_id(memberId++); - cst_my_sequences_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequences_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequences_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequences_array.common().member_flags().IS_OPTIONAL(false); - cst_my_sequences_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequences_array.common().member_flags().IS_KEY(false); - cst_my_sequences_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequences_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("MySequenceLong", {23}, true)); - - cst_my_sequences_array.detail().name("my_sequences_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequences_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ComplexStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ComplexStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", true); -} - - - -const TypeIdentifier* GetMyUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("MyUnion", complete); -} - -const TypeObject* GetMyUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyUnionObject(); - } - // else - return GetMinimalMyUnionObject(); -} - -const TypeObject* GetMinimalMyUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*GetMyEnumIdentifier(false)); - - MemberId memberId = 0; - MinimalUnionMember mst_basic; - mst_basic.common().member_id(memberId++); - mst_basic.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_basic.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_basic.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_basic.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_basic.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_basic.common().member_flags().IS_KEY(false); // Doesn't apply - mst_basic.common().member_flags().IS_DEFAULT(false); - mst_basic.common().type_id(*GetBasicStructIdentifier(false)); - - mst_basic.common().label_seq().emplace_back(::A); - - MD5 basic_hash("basic"); - for(int i = 0; i < 4; ++i) - { - mst_basic.detail().name_hash()[i] = basic_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_basic); - - MinimalUnionMember mst_complex; - mst_complex.common().member_id(memberId++); - mst_complex.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_complex.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_complex.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_complex.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_complex.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_complex.common().member_flags().IS_KEY(false); // Doesn't apply - mst_complex.common().member_flags().IS_DEFAULT(false); - mst_complex.common().type_id(*GetComplexStructIdentifier(false)); - - mst_complex.common().label_seq().emplace_back(::B); - mst_complex.common().label_seq().emplace_back(::C); - - MD5 complex_hash("complex"); - for(int i = 0; i < 4; ++i) - { - mst_complex.detail().name_hash()[i] = complex_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_complex); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("MyUnion", false); -} - -const TypeObject* GetCompleteMyUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*GetMyEnumIdentifier(true)); - - MemberId memberId = 0; - CompleteUnionMember cst_basic; - cst_basic.common().member_id(memberId++); - cst_basic.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_basic.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_basic.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_basic.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_basic.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_basic.common().member_flags().IS_KEY(false); // Doesn't apply - cst_basic.common().member_flags().IS_DEFAULT(false); - cst_basic.common().type_id(*GetBasicStructIdentifier(true)); - cst_basic.common().label_seq().emplace_back(::A); - - - cst_basic.detail().name("basic"); - - type_object->complete().union_type().member_seq().emplace_back(cst_basic); - - CompleteUnionMember cst_complex; - cst_complex.common().member_id(memberId++); - cst_complex.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_complex.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_complex.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_complex.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_complex.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_complex.common().member_flags().IS_KEY(false); // Doesn't apply - cst_complex.common().member_flags().IS_DEFAULT(false); - cst_complex.common().type_id(*GetComplexStructIdentifier(true)); - cst_complex.common().label_seq().emplace_back(::B); - cst_complex.common().label_seq().emplace_back(::C); - - - cst_complex.detail().name("complex"); - - type_object->complete().union_type().member_seq().emplace_back(cst_complex); - - - // Header - type_object->complete().union_type().header().detail().type_name("MyUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("MyUnion", true); -} - - - -const TypeIdentifier* GetMyUnion2Identifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyUnion2", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyUnion2Object(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("MyUnion2", complete); -} - -const TypeObject* GetMyUnion2Object(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion2", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyUnion2Object(); - } - // else - return GetMinimalMyUnion2Object(); -} - -const TypeObject* GetMinimalMyUnion2Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion2", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_uno; - mst_uno.common().member_id(memberId++); - mst_uno.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uno.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uno.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uno.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_uno.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_uno.common().member_flags().IS_KEY(false); // Doesn't apply - mst_uno.common().member_flags().IS_DEFAULT(false); - mst_uno.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_uno.common().label_seq().emplace_back(A); - - MD5 uno_hash("uno"); - for(int i = 0; i < 4; ++i) - { - mst_uno.detail().name_hash()[i] = uno_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_uno); - - MinimalUnionMember mst_imString; - mst_imString.common().member_id(memberId++); - mst_imString.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_imString.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_imString.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_imString.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_imString.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_imString.common().member_flags().IS_KEY(false); // Doesn't apply - mst_imString.common().member_flags().IS_DEFAULT(false); - mst_imString.common().type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - mst_imString.common().label_seq().emplace_back(B); - - MD5 imString_hash("imString"); - for(int i = 0; i < 4; ++i) - { - mst_imString.detail().name_hash()[i] = imString_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_imString); - - MinimalUnionMember mst_tres; - mst_tres.common().member_id(memberId++); - mst_tres.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_tres.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_tres.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_tres.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_tres.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_tres.common().member_flags().IS_KEY(false); // Doesn't apply - mst_tres.common().member_flags().IS_DEFAULT(false); - mst_tres.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_tres.common().label_seq().emplace_back(C); - - MD5 tres_hash("tres"); - for(int i = 0; i < 4; ++i) - { - mst_tres.detail().name_hash()[i] = tres_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_tres); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyUnion2", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("MyUnion2", false); -} - -const TypeObject* GetCompleteMyUnion2Object() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyUnion2", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_uno; - cst_uno.common().member_id(memberId++); - cst_uno.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uno.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uno.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uno.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_uno.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_uno.common().member_flags().IS_KEY(false); // Doesn't apply - cst_uno.common().member_flags().IS_DEFAULT(false); - cst_uno.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_uno.common().label_seq().emplace_back(A); - - - cst_uno.detail().name("uno"); - - type_object->complete().union_type().member_seq().emplace_back(cst_uno); - - CompleteUnionMember cst_imString; - cst_imString.common().member_id(memberId++); - cst_imString.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_imString.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_imString.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_imString.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_imString.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_imString.common().member_flags().IS_KEY(false); // Doesn't apply - cst_imString.common().member_flags().IS_DEFAULT(false); - cst_imString.common().type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - cst_imString.common().label_seq().emplace_back(B); - - - cst_imString.detail().name("imString"); - - type_object->complete().union_type().member_seq().emplace_back(cst_imString); - - CompleteUnionMember cst_tres; - cst_tres.common().member_id(memberId++); - cst_tres.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_tres.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_tres.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_tres.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_tres.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_tres.common().member_flags().IS_KEY(false); // Doesn't apply - cst_tres.common().member_flags().IS_DEFAULT(false); - cst_tres.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_tres.common().label_seq().emplace_back(C); - - - cst_tres.detail().name("tres"); - - type_object->complete().union_type().member_seq().emplace_back(cst_tres); - - - // Header - type_object->complete().union_type().header().detail().type_name("MyUnion2"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyUnion2", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("MyUnion2", true); -} - - - -const TypeIdentifier* GetCompleteStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("CompleteStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetCompleteStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("CompleteStruct", complete); -} - -const TypeObject* GetCompleteStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteCompleteStructObject(); - } - //else - return GetMinimalCompleteStructObject(); -} - -const TypeObject* GetMinimalCompleteStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetMyUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - MinimalStructMember mst_my_union_2; - mst_my_union_2.common().member_id(memberId++); - mst_my_union_2.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union_2.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union_2.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union_2.common().member_flags().IS_OPTIONAL(false); - mst_my_union_2.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union_2.common().member_flags().IS_KEY(false); - mst_my_union_2.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union_2.common().member_type_id(*GetMyUnion2Identifier(false)); - - MD5 my_union_2_hash("my_union_2"); - for(int i = 0; i < 4; ++i) - { - mst_my_union_2.detail().name_hash()[i] = my_union_2_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union_2); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("CompleteStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", false); -} - -const TypeObject* GetCompleteCompleteStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetMyUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - CompleteStructMember cst_my_union_2; - cst_my_union_2.common().member_id(memberId++); - cst_my_union_2.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union_2.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union_2.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union_2.common().member_flags().IS_OPTIONAL(false); - cst_my_union_2.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union_2.common().member_flags().IS_KEY(false); - cst_my_union_2.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union_2.common().member_type_id(*GetMyUnion2Identifier(true)); - - cst_my_union_2.detail().name("my_union_2"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union_2); - - - // Header - type_object->complete().struct_type().header().detail().type_name("CompleteStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("CompleteStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", true); -} - - - -const TypeIdentifier* GetKeyedStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("KeyedStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetKeyedStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("KeyedStruct", complete); -} - -const TypeObject* GetKeyedStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("KeyedStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteKeyedStructObject(); - } - //else - return GetMinimalKeyedStructObject(); -} - -const TypeObject* GetMinimalKeyedStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("KeyedStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_key; - mst_key.common().member_id(memberId++); - mst_key.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_key.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_key.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_key.common().member_flags().IS_OPTIONAL(false); - mst_key.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_key.common().member_flags().IS_KEY(true); - mst_key.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_key.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 key_hash("key"); - for(int i = 0; i < 4; ++i) - { - mst_key.detail().name_hash()[i] = key_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_key); - - MinimalStructMember mst_basic; - mst_basic.common().member_id(memberId++); - mst_basic.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_basic.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_basic.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_basic.common().member_flags().IS_OPTIONAL(false); - mst_basic.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_basic.common().member_flags().IS_KEY(false); - mst_basic.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_basic.common().member_type_id(*GetBasicStructIdentifier(false)); - - MD5 basic_hash("basic"); - for(int i = 0; i < 4; ++i) - { - mst_basic.detail().name_hash()[i] = basic_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_basic); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("KeyedStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("KeyedStruct", false); -} - -const TypeObject* GetCompleteKeyedStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("KeyedStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_key; - cst_key.common().member_id(memberId++); - cst_key.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_key.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_key.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_key.common().member_flags().IS_OPTIONAL(false); - cst_key.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_key.common().member_flags().IS_KEY(true); - cst_key.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_key.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_key.detail().name("key"); - - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetkeyIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("key")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_BOOLEAN); - paramValue.from_string("true"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cst_key.detail().ann_custom().push_back(ann); - } - - - type_object->complete().struct_type().member_seq().emplace_back(cst_key); - - CompleteStructMember cst_basic; - cst_basic.common().member_id(memberId++); - cst_basic.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_basic.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_basic.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_basic.common().member_flags().IS_OPTIONAL(false); - cst_basic.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_basic.common().member_flags().IS_KEY(false); - cst_basic.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_basic.common().member_type_id(*GetBasicStructIdentifier(true)); - - cst_basic.detail().name("basic"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_basic); - - - // Header - type_object->complete().struct_type().header().detail().type_name("KeyedStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("KeyedStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("KeyedStruct", true); -} diff --git a/test/unittest/dynamic_types/idl/TestTypeObject.h b/test/unittest/dynamic_types/idl/TestTypeObject.h deleted file mode 100644 index 9d4dc990651..00000000000 --- a/test/unittest/dynamic_types/idl/TestTypeObject.h +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TestTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TEST_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TEST_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Test_SOURCE) -#define Test_DllAPI __declspec( dllexport ) -#else -#define Test_DllAPI __declspec( dllimport ) -#endif // Test_SOURCE -#else -#define Test_DllAPI -#endif -#else -#define Test_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTestTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnum2Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnum2Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnum2Object(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnum2Object(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnum3Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnum3Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnum3Object(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnum3Object(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyOctetArray500Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyOctetArray500Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyOctetArray500Object(); -eProsima_user_DllExport const TypeObject* GetCompleteMyOctetArray500Object(); - -eProsima_user_DllExport const TypeIdentifier* GetBSAlias5Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBSAlias5Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBSAlias5Object(); -eProsima_user_DllExport const TypeObject* GetCompleteBSAlias5Object(); - -eProsima_user_DllExport const TypeIdentifier* GetMA3Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMA3Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMA3Object(); -eProsima_user_DllExport const TypeObject* GetCompleteMA3Object(); - -eProsima_user_DllExport const TypeIdentifier* GetMyMiniArrayIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyMiniArrayObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyMiniArrayObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyMiniArrayObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMySequenceLongIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMySequenceLongObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMySequenceLongObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMySequenceLongObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetComplexStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetComplexStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalComplexStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteComplexStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyUnion2Identifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyUnion2Object(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyUnion2Object(); -eProsima_user_DllExport const TypeObject* GetCompleteMyUnion2Object(); - - - -eProsima_user_DllExport const TypeIdentifier* GetCompleteStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetCompleteStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalCompleteStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteCompleteStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetKeyedStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetKeyedStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalKeyedStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteKeyedStructObject(); - - -#endif // _FAST_DDS_GENERATED_TEST_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/Testv1.cxx b/test/unittest/dynamic_types/idl/Testv1.cxx deleted file mode 100644 index d5f720de3dd..00000000000 --- a/test/unittest/dynamic_types/idl/Testv1.cxx +++ /dev/null @@ -1,3744 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Test.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Test.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TestTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define KeyedStruct_max_cdr_typesize 344ULL; - - - -#define BasicStruct_max_cdr_typesize 336ULL; - -#define ComplexStruct_max_cdr_typesize 18064796ULL; - - -#define CompleteStruct_max_cdr_typesize 18065072ULL; - - - - - - - - - -BasicStruct::BasicStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // octet m_my_octet - m_my_octet = 0; - // short m_my_int16 - m_my_int16 = 0; - // long m_my_int32 - m_my_int32 = 0; - // long long m_my_int64 - m_my_int64 = 0; - // unsigned short m_my_uint16 - m_my_uint16 = 0; - // unsigned long m_my_uint32 - m_my_uint32 = 0; - // unsigned long long m_my_uint64 - m_my_uint64 = 0; - // float m_my_float32 - m_my_float32 = 0.0; - // double m_my_float64 - m_my_float64 = 0.0; - // long double m_my_float128 - m_my_float128 = 0.0; - // char m_my_char - m_my_char = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTestTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_octet = x.m_my_octet; - - - m_my_int16 = x.m_my_int16; - - - m_my_int32 = x.m_my_int32; - - - m_my_int64 = x.m_my_int64; - - - m_my_uint16 = x.m_my_uint16; - - - m_my_uint32 = x.m_my_uint32; - - - m_my_uint64 = x.m_my_uint64; - - - m_my_float32 = x.m_my_float32; - - - m_my_float64 = x.m_my_float64; - - - m_my_float128 = x.m_my_float128; - - - m_my_char = x.m_my_char; - - - m_my_string = x.m_my_string; - -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_octet = x.m_my_octet; - - - m_my_int16 = x.m_my_int16; - - - m_my_int32 = x.m_my_int32; - - - m_my_int64 = x.m_my_int64; - - - m_my_uint16 = x.m_my_uint16; - - - m_my_uint32 = x.m_my_uint32; - - - m_my_uint64 = x.m_my_uint64; - - - m_my_float32 = x.m_my_float32; - - - m_my_float64 = x.m_my_float64; - - - m_my_float128 = x.m_my_float128; - - - m_my_char = x.m_my_char; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_octet = x.m_my_octet; - - - m_my_int16 = x.m_my_int16; - - - m_my_int32 = x.m_my_int32; - - - m_my_int64 = x.m_my_int64; - - - m_my_uint16 = x.m_my_uint16; - - - m_my_uint32 = x.m_my_uint32; - - - m_my_uint64 = x.m_my_uint64; - - - m_my_float32 = x.m_my_float32; - - - m_my_float64 = x.m_my_float64; - - - m_my_float128 = x.m_my_float128; - - - m_my_char = x.m_my_char; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_octet = x.m_my_octet; - - - m_my_int16 = x.m_my_int16; - - - m_my_int32 = x.m_my_int32; - - - m_my_int64 = x.m_my_int64; - - - m_my_uint16 = x.m_my_uint16; - - - m_my_uint32 = x.m_my_uint32; - - - m_my_uint64 = x.m_my_uint64; - - - m_my_float32 = x.m_my_float32; - - - m_my_float64 = x.m_my_float64; - - - m_my_float128 = x.m_my_float128; - - - m_my_char = x.m_my_char; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_octet == x.m_my_octet && - m_my_int16 == x.m_my_int16 && - m_my_int32 == x.m_my_int32 && - m_my_int64 == x.m_my_int64 && - m_my_uint16 == x.m_my_uint16 && - m_my_uint32 == x.m_my_uint32 && - m_my_uint64 == x.m_my_uint64 && - m_my_float32 == x.m_my_float32 && - m_my_float64 == x.m_my_float64 && - m_my_float128 == x.m_my_float128 && - m_my_char == x.m_my_char && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -size_t BasicStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicStruct_max_cdr_typesize; -} - -size_t BasicStruct::getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_octet; - - scdr << m_my_int16; - - scdr << m_my_int32; - - scdr << m_my_int64; - - scdr << m_my_uint16; - - scdr << m_my_uint32; - - scdr << m_my_uint64; - - scdr << m_my_float32; - - scdr << m_my_float64; - - scdr << m_my_float128; - - scdr << m_my_char; - - scdr << m_my_string.c_str(); - -} - -void BasicStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_octet; - - - - dcdr >> m_my_int16; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_int64; - - - - dcdr >> m_my_uint16; - - - - dcdr >> m_my_uint32; - - - - dcdr >> m_my_uint64; - - - - dcdr >> m_my_float32; - - - - dcdr >> m_my_float64; - - - - dcdr >> m_my_float128; - - - - dcdr >> m_my_char; - - - - dcdr >> m_my_string; - - -} - - -bool BasicStruct::isKeyDefined() -{ - return false; -} - -void BasicStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void BasicStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t BasicStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& BasicStruct::my_octet() -{ - return m_my_octet; -} - - -/*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ -void BasicStruct::my_int16( - int16_t _my_int16) -{ - m_my_int16 = _my_int16; -} - -/*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ -int16_t BasicStruct::my_int16() const -{ - return m_my_int16; -} - -/*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ -int16_t& BasicStruct::my_int16() -{ - return m_my_int16; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ -void BasicStruct::my_int64( - int64_t _my_int64) -{ - m_my_int64 = _my_int64; -} - -/*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ -int64_t BasicStruct::my_int64() const -{ - return m_my_int64; -} - -/*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ -int64_t& BasicStruct::my_int64() -{ - return m_my_int64; -} - - -/*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ -void BasicStruct::my_uint16( - uint16_t _my_uint16) -{ - m_my_uint16 = _my_uint16; -} - -/*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ -uint16_t BasicStruct::my_uint16() const -{ - return m_my_uint16; -} - -/*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ -uint16_t& BasicStruct::my_uint16() -{ - return m_my_uint16; -} - - -/*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ -void BasicStruct::my_uint32( - uint32_t _my_uint32) -{ - m_my_uint32 = _my_uint32; -} - -/*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ -uint32_t BasicStruct::my_uint32() const -{ - return m_my_uint32; -} - -/*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ -uint32_t& BasicStruct::my_uint32() -{ - return m_my_uint32; -} - - -/*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ -void BasicStruct::my_uint64( - uint64_t _my_uint64) -{ - m_my_uint64 = _my_uint64; -} - -/*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ -uint64_t BasicStruct::my_uint64() const -{ - return m_my_uint64; -} - -/*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ -uint64_t& BasicStruct::my_uint64() -{ - return m_my_uint64; -} - - -/*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ -void BasicStruct::my_float32( - float _my_float32) -{ - m_my_float32 = _my_float32; -} - -/*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ -float BasicStruct::my_float32() const -{ - return m_my_float32; -} - -/*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ -float& BasicStruct::my_float32() -{ - return m_my_float32; -} - - -/*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ -void BasicStruct::my_float64( - double _my_float64) -{ - m_my_float64 = _my_float64; -} - -/*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ -double BasicStruct::my_float64() const -{ - return m_my_float64; -} - -/*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ -double& BasicStruct::my_float64() -{ - return m_my_float64; -} - - -/*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ -void BasicStruct::my_float128( - long double _my_float128) -{ - m_my_float128 = _my_float128; -} - -/*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ -long double BasicStruct::my_float128() const -{ - return m_my_float128; -} - -/*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ -long double& BasicStruct::my_float128() -{ - return m_my_float128; -} - - -/*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ -void BasicStruct::my_char( - char _my_char) -{ - m_my_char = _my_char; -} - -/*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ -char BasicStruct::my_char() const -{ - return m_my_char; -} - -/*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ -char& BasicStruct::my_char() -{ - return m_my_char; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - - - - - - - - -ComplexStruct::ComplexStruct() -{ - // octet m_my_octet - m_my_octet = 0; - // BasicStruct m_my_basic_struct - - // MyAliasEnum m_my_alias_enum - m_my_alias_enum = ::A; - // MyEnum m_my_enum - m_my_enum = ::A; - // sequence m_my_sequence_octet - - // sequence m_my_sequence_struct - - // char m_my_array_octet - memset(&m_my_array_octet, 0, ((500) * (5) * (4)) * 1); - // MyOctetArray500 m_my_octet_array_500 - memset(&m_my_octet_array_500, 0, ((500)) * 1); - // BasicStruct m_my_array_struct - - // map m_my_map_octet_short - - // map m_my_map_long_struct - - // map>> m_my_map_long_seq_octet - - // map m_my_map_long_octet_array_500 - - // map> m_my_map_long_lol_type - - // /type_d() m_my_small_string_8 - - // /type_d() m_my_large_string_8 - - // /type_d() m_my_array_string - - // MA3 m_multi_alias_array_42 - memset(&m_multi_alias_array_42, 0, ((42)) * 4); - // MyMiniArray m_my_array_arrays - - // MySequenceLong m_my_sequences_array - - - // Just to register all known types - registerTestTypes(); -} - -ComplexStruct::~ComplexStruct() -{ -} - -ComplexStruct::ComplexStruct( - const ComplexStruct& x) -{ - m_my_octet = x.m_my_octet; - - - m_my_basic_struct = x.m_my_basic_struct; - - - m_my_alias_enum = x.m_my_alias_enum; - - - m_my_enum = x.m_my_enum; - - - m_my_sequence_octet = x.m_my_sequence_octet; - - - m_my_sequence_struct = x.m_my_sequence_struct; - - - m_my_array_octet = x.m_my_array_octet; - - - m_my_octet_array_500 = x.m_my_octet_array_500; - - - m_my_array_struct = x.m_my_array_struct; - - - m_my_map_octet_short = x.m_my_map_octet_short; - - - m_my_map_long_struct = x.m_my_map_long_struct; - - - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - - - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - - - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - - - m_my_small_string_8 = x.m_my_small_string_8; - - - m_my_large_string_8 = x.m_my_large_string_8; - - - m_my_array_string = x.m_my_array_string; - - - m_multi_alias_array_42 = x.m_multi_alias_array_42; - - - m_my_array_arrays = x.m_my_array_arrays; - - - m_my_sequences_array = x.m_my_sequences_array; - -} - -ComplexStruct::ComplexStruct( - ComplexStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; - - - m_my_basic_struct = std::move(x.m_my_basic_struct); - - - m_my_alias_enum = x.m_my_alias_enum; - - - m_my_enum = x.m_my_enum; - - - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - - - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - - - m_my_array_octet = std::move(x.m_my_array_octet); - - - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - - - m_my_array_struct = std::move(x.m_my_array_struct); - - - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - - - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - - - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - - - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - - - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - - - m_my_small_string_8 = std::move(x.m_my_small_string_8); - - - m_my_large_string_8 = std::move(x.m_my_large_string_8); - - - m_my_array_string = std::move(x.m_my_array_string); - - - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - - - m_my_array_arrays = std::move(x.m_my_array_arrays); - - - m_my_sequences_array = std::move(x.m_my_sequences_array); - -} - -ComplexStruct& ComplexStruct::operator =( - const ComplexStruct& x) -{ - m_my_octet = x.m_my_octet; - - - m_my_basic_struct = x.m_my_basic_struct; - - - m_my_alias_enum = x.m_my_alias_enum; - - - m_my_enum = x.m_my_enum; - - - m_my_sequence_octet = x.m_my_sequence_octet; - - - m_my_sequence_struct = x.m_my_sequence_struct; - - - m_my_array_octet = x.m_my_array_octet; - - - m_my_octet_array_500 = x.m_my_octet_array_500; - - - m_my_array_struct = x.m_my_array_struct; - - - m_my_map_octet_short = x.m_my_map_octet_short; - - - m_my_map_long_struct = x.m_my_map_long_struct; - - - m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; - - - m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; - - - m_my_map_long_lol_type = x.m_my_map_long_lol_type; - - - m_my_small_string_8 = x.m_my_small_string_8; - - - m_my_large_string_8 = x.m_my_large_string_8; - - - m_my_array_string = x.m_my_array_string; - - - m_multi_alias_array_42 = x.m_multi_alias_array_42; - - - m_my_array_arrays = x.m_my_array_arrays; - - - m_my_sequences_array = x.m_my_sequences_array; - - return *this; -} - -ComplexStruct& ComplexStruct::operator =( - ComplexStruct&& x) noexcept -{ - m_my_octet = x.m_my_octet; - - - m_my_basic_struct = std::move(x.m_my_basic_struct); - - - m_my_alias_enum = x.m_my_alias_enum; - - - m_my_enum = x.m_my_enum; - - - m_my_sequence_octet = std::move(x.m_my_sequence_octet); - - - m_my_sequence_struct = std::move(x.m_my_sequence_struct); - - - m_my_array_octet = std::move(x.m_my_array_octet); - - - m_my_octet_array_500 = std::move(x.m_my_octet_array_500); - - - m_my_array_struct = std::move(x.m_my_array_struct); - - - m_my_map_octet_short = std::move(x.m_my_map_octet_short); - - - m_my_map_long_struct = std::move(x.m_my_map_long_struct); - - - m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); - - - m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); - - - m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); - - - m_my_small_string_8 = std::move(x.m_my_small_string_8); - - - m_my_large_string_8 = std::move(x.m_my_large_string_8); - - - m_my_array_string = std::move(x.m_my_array_string); - - - m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); - - - m_my_array_arrays = std::move(x.m_my_array_arrays); - - - m_my_sequences_array = std::move(x.m_my_sequences_array); - - return *this; -} - -bool ComplexStruct::operator ==( - const ComplexStruct& x) const -{ - return (m_my_octet == x.m_my_octet && - m_my_basic_struct == x.m_my_basic_struct && - m_my_alias_enum == x.m_my_alias_enum && - m_my_enum == x.m_my_enum && - m_my_sequence_octet == x.m_my_sequence_octet && - m_my_sequence_struct == x.m_my_sequence_struct && - m_my_array_octet == x.m_my_array_octet && - m_my_octet_array_500 == x.m_my_octet_array_500 && - m_my_array_struct == x.m_my_array_struct && - m_my_map_octet_short == x.m_my_map_octet_short && - m_my_map_long_struct == x.m_my_map_long_struct && - m_my_map_long_seq_octet == x.m_my_map_long_seq_octet && - m_my_map_long_octet_array_500 == x.m_my_map_long_octet_array_500 && - m_my_map_long_lol_type == x.m_my_map_long_lol_type && - m_my_small_string_8 == x.m_my_small_string_8 && - m_my_large_string_8 == x.m_my_large_string_8 && - m_my_array_string == x.m_my_array_string && - m_multi_alias_array_42 == x.m_multi_alias_array_42 && - m_my_array_arrays == x.m_my_array_arrays && - m_my_sequences_array == x.m_my_sequences_array); -} - -bool ComplexStruct::operator !=( - const ComplexStruct& x) const -{ - return !(*this == x); -} - -size_t ComplexStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ComplexStruct_max_cdr_typesize; -} - -size_t ComplexStruct::getCdrSerializedSize( - const ComplexStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += BasicStruct::getCdrSerializedSize(data.my_basic_struct(), current_alignment); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_octet().size() > 0) - { - current_alignment += (data.my_sequence_octet().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_struct().size(); ++a) - { - current_alignment += BasicStruct::getCdrSerializedSize(data.my_sequence_struct().at(a), current_alignment); - } - - - - current_alignment += (((500) * (5) * (4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += (((500)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - - for(size_t a = 0; a < data.my_array_struct().size(); ++a) - { - current_alignment += BasicStruct::getCdrSerializedSize(data.my_array_struct().at(a), current_alignment); - - } - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_octet_short()) - { - (void)a; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - } - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_long_struct()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += BasicStruct::getCdrSerializedSize(a.second, current_alignment); - - } - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_long_seq_octet()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t b = 0; b < a.second.size(); ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (a.second.at(b).size() > 0) - { - current_alignment += (a.second.at(b).size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - } - - - } - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_long_octet_array_500()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += (((500)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - } - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_long_lol_type()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - for(size_t c = 0; c < b.second.size(); ++c) - { - current_alignment += BasicStruct::getCdrSerializedSize(b.second.at(c), current_alignment); - - } - - - } - - } - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_small_string_8().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string_8().size() + 1; - - - - for(size_t a = 0; a < data.my_array_string().size(); ++a) - { - - for(size_t b = 0; b < data.my_array_string().at(a).size(); ++b) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_array_string().at(a).at(b).size() + 1; - - } - - } - - - - current_alignment += (((42)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - - for(size_t a = 0; a < data.my_array_arrays().size(); ++a) - { - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - } - - - - - for(size_t a = 0; a < data.my_sequences_array().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequences_array().at(a).size() > 0) - { - current_alignment += (data.my_sequences_array().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - } - - - - return current_alignment - initial_alignment; -} - - -void ComplexStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_octet; - - scdr << m_my_basic_struct; - - scdr << (uint32_t)m_my_alias_enum; - - scdr << (uint32_t)m_my_enum; - - scdr << m_my_sequence_octet; - - - scdr << m_my_sequence_struct; - - - for (uint32_t d = 0; d < m_my_array_octet.size(); ++d) - { - for (uint32_t e = 0; e < m_my_array_octet[d].size(); ++e) - { - scdr << m_my_array_octet[d][e]; - - } - - } - - - - scdr << m_my_octet_array_500; - - - scdr << m_my_array_struct; - - - scdr << static_cast(m_my_map_octet_short.size()); - for (const auto& pair : m_my_map_octet_short) - { - scdr << pair.first; - scdr << pair.second; - } - - scdr << static_cast(m_my_map_long_struct.size()); - for (const auto& pair : m_my_map_long_struct) - { - scdr << pair.first; - scdr << pair.second; - } - - scdr << static_cast(m_my_map_long_seq_octet.size()); - for (const auto& pair : m_my_map_long_seq_octet) - { - scdr << pair.first; - scdr << pair.second; - } - - scdr << static_cast(m_my_map_long_octet_array_500.size()); - for (const auto& pair : m_my_map_long_octet_array_500) - { - scdr << pair.first; - scdr << pair.second; - } - - scdr << static_cast(m_my_map_long_lol_type.size()); - for (const auto& pair : m_my_map_long_lol_type) - { - scdr << pair.first; - scdr << pair.second; - } - - scdr << m_my_small_string_8.c_str(); - - scdr << m_my_large_string_8.c_str(); - - for (uint32_t g = 0; g < m_my_array_string.size(); ++g) - { - for (const auto& str : m_my_array_string[g]) - { - scdr << str.c_str(); - } - - - } - - - - - scdr.serializeArray(reinterpret_cast(m_multi_alias_array_42.data()), m_multi_alias_array_42.size()); - - - scdr << m_my_array_arrays; - - - scdr << m_my_sequences_array; - - -} - -void ComplexStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_octet; - - - - dcdr >> m_my_basic_struct; - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_alias_enum = (MyAliasEnum)enum_value; - } - - - - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - - - dcdr >> m_my_sequence_octet; - - - - dcdr >> m_my_sequence_struct; - - - - for (uint32_t i = 0; i < m_my_array_octet.size(); ++i) - { - for (uint32_t j = 0; j < m_my_array_octet[i].size(); ++j) - { - dcdr >> m_my_array_octet[i][j]; - - } - - } - - - - - dcdr >> m_my_octet_array_500; - - - - dcdr >> m_my_array_struct; - - - - - dcdr >> m_my_map_octet_short; - - - - - dcdr >> m_my_map_long_struct; - - - - - dcdr >> m_my_map_long_seq_octet; - - - - - dcdr >> m_my_map_long_octet_array_500; - - - - - dcdr >> m_my_map_long_lol_type; - - - - { - std::string aux; - dcdr >> aux; - m_my_small_string_8 = aux.c_str(); - } - - - - { - std::string aux; - dcdr >> aux; - m_my_large_string_8 = aux.c_str(); - } - - - - for (uint32_t l = 0; l < m_my_array_string.size(); ++l) - { - for (auto& str : m_my_array_string[l]) - { - { - std::string aux_str; - dcdr >> aux_str; - str = aux_str.c_str(); - } - - } - - - } - - - - - - dcdr.deserializeArray(reinterpret_cast(m_multi_alias_array_42.data()), m_multi_alias_array_42.size()); - - - - dcdr >> m_my_array_arrays; - - - - dcdr >> m_my_sequences_array; - - -} - - -bool ComplexStruct::isKeyDefined() -{ - return false; -} - -void ComplexStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ -void ComplexStruct::my_octet( - uint8_t _my_octet) -{ - m_my_octet = _my_octet; -} - -/*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ -uint8_t ComplexStruct::my_octet() const -{ - return m_my_octet; -} - -/*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ -uint8_t& ComplexStruct::my_octet() -{ - return m_my_octet; -} - - -/*! - * @brief This function copies the value in member my_basic_struct - * @param _my_basic_struct New value to be copied in member my_basic_struct - */ -void ComplexStruct::my_basic_struct( - const BasicStruct& _my_basic_struct) -{ - m_my_basic_struct = _my_basic_struct; -} - -/*! - * @brief This function moves the value in member my_basic_struct - * @param _my_basic_struct New value to be moved in member my_basic_struct - */ -void ComplexStruct::my_basic_struct( - BasicStruct&& _my_basic_struct) -{ - m_my_basic_struct = std::move(_my_basic_struct); -} - -/*! - * @brief This function returns a constant reference to member my_basic_struct - * @return Constant reference to member my_basic_struct - */ -const BasicStruct& ComplexStruct::my_basic_struct() const -{ - return m_my_basic_struct; -} - -/*! - * @brief This function returns a reference to member my_basic_struct - * @return Reference to member my_basic_struct - */ -BasicStruct& ComplexStruct::my_basic_struct() -{ - return m_my_basic_struct; -} - - -/*! - * @brief This function sets a value in member my_alias_enum - * @param _my_alias_enum New value for member my_alias_enum - */ -void ComplexStruct::my_alias_enum( - MyAliasEnum _my_alias_enum) -{ - m_my_alias_enum = _my_alias_enum; -} - -/*! - * @brief This function returns the value of member my_alias_enum - * @return Value of member my_alias_enum - */ -MyAliasEnum ComplexStruct::my_alias_enum() const -{ - return m_my_alias_enum; -} - -/*! - * @brief This function returns a reference to member my_alias_enum - * @return Reference to member my_alias_enum - */ -MyAliasEnum& ComplexStruct::my_alias_enum() -{ - return m_my_alias_enum; -} - - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void ComplexStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum ComplexStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& ComplexStruct::my_enum() -{ - return m_my_enum; -} - - -/*! - * @brief This function copies the value in member my_sequence_octet - * @param _my_sequence_octet New value to be copied in member my_sequence_octet - */ -void ComplexStruct::my_sequence_octet( - const std::vector& _my_sequence_octet) -{ - m_my_sequence_octet = _my_sequence_octet; -} - -/*! - * @brief This function moves the value in member my_sequence_octet - * @param _my_sequence_octet New value to be moved in member my_sequence_octet - */ -void ComplexStruct::my_sequence_octet( - std::vector&& _my_sequence_octet) -{ - m_my_sequence_octet = std::move(_my_sequence_octet); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_octet - * @return Constant reference to member my_sequence_octet - */ -const std::vector& ComplexStruct::my_sequence_octet() const -{ - return m_my_sequence_octet; -} - -/*! - * @brief This function returns a reference to member my_sequence_octet - * @return Reference to member my_sequence_octet - */ -std::vector& ComplexStruct::my_sequence_octet() -{ - return m_my_sequence_octet; -} - - -/*! - * @brief This function copies the value in member my_sequence_struct - * @param _my_sequence_struct New value to be copied in member my_sequence_struct - */ -void ComplexStruct::my_sequence_struct( - const std::vector& _my_sequence_struct) -{ - m_my_sequence_struct = _my_sequence_struct; -} - -/*! - * @brief This function moves the value in member my_sequence_struct - * @param _my_sequence_struct New value to be moved in member my_sequence_struct - */ -void ComplexStruct::my_sequence_struct( - std::vector&& _my_sequence_struct) -{ - m_my_sequence_struct = std::move(_my_sequence_struct); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_struct - * @return Constant reference to member my_sequence_struct - */ -const std::vector& ComplexStruct::my_sequence_struct() const -{ - return m_my_sequence_struct; -} - -/*! - * @brief This function returns a reference to member my_sequence_struct - * @return Reference to member my_sequence_struct - */ -std::vector& ComplexStruct::my_sequence_struct() -{ - return m_my_sequence_struct; -} - - -/*! - * @brief This function copies the value in member my_array_octet - * @param _my_array_octet New value to be copied in member my_array_octet - */ -void ComplexStruct::my_array_octet( - const std::array, 5>, 500>& _my_array_octet) -{ - m_my_array_octet = _my_array_octet; -} - -/*! - * @brief This function moves the value in member my_array_octet - * @param _my_array_octet New value to be moved in member my_array_octet - */ -void ComplexStruct::my_array_octet( - std::array, 5>, 500>&& _my_array_octet) -{ - m_my_array_octet = std::move(_my_array_octet); -} - -/*! - * @brief This function returns a constant reference to member my_array_octet - * @return Constant reference to member my_array_octet - */ -const std::array, 5>, 500>& ComplexStruct::my_array_octet() const -{ - return m_my_array_octet; -} - -/*! - * @brief This function returns a reference to member my_array_octet - * @return Reference to member my_array_octet - */ -std::array, 5>, 500>& ComplexStruct::my_array_octet() -{ - return m_my_array_octet; -} - - -/*! - * @brief This function copies the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 - */ -void ComplexStruct::my_octet_array_500( - const MyOctetArray500& _my_octet_array_500) -{ - m_my_octet_array_500 = _my_octet_array_500; -} - -/*! - * @brief This function moves the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 - */ -void ComplexStruct::my_octet_array_500( - MyOctetArray500&& _my_octet_array_500) -{ - m_my_octet_array_500 = std::move(_my_octet_array_500); -} - -/*! - * @brief This function returns a constant reference to member my_octet_array_500 - * @return Constant reference to member my_octet_array_500 - */ -const MyOctetArray500& ComplexStruct::my_octet_array_500() const -{ - return m_my_octet_array_500; -} - -/*! - * @brief This function returns a reference to member my_octet_array_500 - * @return Reference to member my_octet_array_500 - */ -MyOctetArray500& ComplexStruct::my_octet_array_500() -{ - return m_my_octet_array_500; -} - - -/*! - * @brief This function copies the value in member my_array_struct - * @param _my_array_struct New value to be copied in member my_array_struct - */ -void ComplexStruct::my_array_struct( - const std::array& _my_array_struct) -{ - m_my_array_struct = _my_array_struct; -} - -/*! - * @brief This function moves the value in member my_array_struct - * @param _my_array_struct New value to be moved in member my_array_struct - */ -void ComplexStruct::my_array_struct( - std::array&& _my_array_struct) -{ - m_my_array_struct = std::move(_my_array_struct); -} - -/*! - * @brief This function returns a constant reference to member my_array_struct - * @return Constant reference to member my_array_struct - */ -const std::array& ComplexStruct::my_array_struct() const -{ - return m_my_array_struct; -} - -/*! - * @brief This function returns a reference to member my_array_struct - * @return Reference to member my_array_struct - */ -std::array& ComplexStruct::my_array_struct() -{ - return m_my_array_struct; -} - - -/*! - * @brief This function copies the value in member my_map_octet_short - * @param _my_map_octet_short New value to be copied in member my_map_octet_short - */ -void ComplexStruct::my_map_octet_short( - const std::map& _my_map_octet_short) -{ - m_my_map_octet_short = _my_map_octet_short; -} - -/*! - * @brief This function moves the value in member my_map_octet_short - * @param _my_map_octet_short New value to be moved in member my_map_octet_short - */ -void ComplexStruct::my_map_octet_short( - std::map&& _my_map_octet_short) -{ - m_my_map_octet_short = std::move(_my_map_octet_short); -} - -/*! - * @brief This function returns a constant reference to member my_map_octet_short - * @return Constant reference to member my_map_octet_short - */ -const std::map& ComplexStruct::my_map_octet_short() const -{ - return m_my_map_octet_short; -} - -/*! - * @brief This function returns a reference to member my_map_octet_short - * @return Reference to member my_map_octet_short - */ -std::map& ComplexStruct::my_map_octet_short() -{ - return m_my_map_octet_short; -} - - -/*! - * @brief This function copies the value in member my_map_long_struct - * @param _my_map_long_struct New value to be copied in member my_map_long_struct - */ -void ComplexStruct::my_map_long_struct( - const std::map& _my_map_long_struct) -{ - m_my_map_long_struct = _my_map_long_struct; -} - -/*! - * @brief This function moves the value in member my_map_long_struct - * @param _my_map_long_struct New value to be moved in member my_map_long_struct - */ -void ComplexStruct::my_map_long_struct( - std::map&& _my_map_long_struct) -{ - m_my_map_long_struct = std::move(_my_map_long_struct); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_struct - * @return Constant reference to member my_map_long_struct - */ -const std::map& ComplexStruct::my_map_long_struct() const -{ - return m_my_map_long_struct; -} - -/*! - * @brief This function returns a reference to member my_map_long_struct - * @return Reference to member my_map_long_struct - */ -std::map& ComplexStruct::my_map_long_struct() -{ - return m_my_map_long_struct; -} - - -/*! - * @brief This function copies the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet - */ -void ComplexStruct::my_map_long_seq_octet( - const std::map>>& _my_map_long_seq_octet) -{ - m_my_map_long_seq_octet = _my_map_long_seq_octet; -} - -/*! - * @brief This function moves the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet - */ -void ComplexStruct::my_map_long_seq_octet( - std::map>>&& _my_map_long_seq_octet) -{ - m_my_map_long_seq_octet = std::move(_my_map_long_seq_octet); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_seq_octet - * @return Constant reference to member my_map_long_seq_octet - */ -const std::map>>& ComplexStruct::my_map_long_seq_octet() const -{ - return m_my_map_long_seq_octet; -} - -/*! - * @brief This function returns a reference to member my_map_long_seq_octet - * @return Reference to member my_map_long_seq_octet - */ -std::map>>& ComplexStruct::my_map_long_seq_octet() -{ - return m_my_map_long_seq_octet; -} - - -/*! - * @brief This function copies the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 - */ -void ComplexStruct::my_map_long_octet_array_500( - const std::map& _my_map_long_octet_array_500) -{ - m_my_map_long_octet_array_500 = _my_map_long_octet_array_500; -} - -/*! - * @brief This function moves the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 - */ -void ComplexStruct::my_map_long_octet_array_500( - std::map&& _my_map_long_octet_array_500) -{ - m_my_map_long_octet_array_500 = std::move(_my_map_long_octet_array_500); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_octet_array_500 - * @return Constant reference to member my_map_long_octet_array_500 - */ -const std::map& ComplexStruct::my_map_long_octet_array_500() const -{ - return m_my_map_long_octet_array_500; -} - -/*! - * @brief This function returns a reference to member my_map_long_octet_array_500 - * @return Reference to member my_map_long_octet_array_500 - */ -std::map& ComplexStruct::my_map_long_octet_array_500() -{ - return m_my_map_long_octet_array_500; -} - - -/*! - * @brief This function copies the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type - */ -void ComplexStruct::my_map_long_lol_type( - const std::map>& _my_map_long_lol_type) -{ - m_my_map_long_lol_type = _my_map_long_lol_type; -} - -/*! - * @brief This function moves the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type - */ -void ComplexStruct::my_map_long_lol_type( - std::map>&& _my_map_long_lol_type) -{ - m_my_map_long_lol_type = std::move(_my_map_long_lol_type); -} - -/*! - * @brief This function returns a constant reference to member my_map_long_lol_type - * @return Constant reference to member my_map_long_lol_type - */ -const std::map>& ComplexStruct::my_map_long_lol_type() const -{ - return m_my_map_long_lol_type; -} - -/*! - * @brief This function returns a reference to member my_map_long_lol_type - * @return Reference to member my_map_long_lol_type - */ -std::map>& ComplexStruct::my_map_long_lol_type() -{ - return m_my_map_long_lol_type; -} - - -/*! - * @brief This function copies the value in member my_small_string_8 - * @param _my_small_string_8 New value to be copied in member my_small_string_8 - */ -void ComplexStruct::my_small_string_8( - const eprosima::fastrtps::fixed_string<128>& _my_small_string_8) -{ - m_my_small_string_8 = _my_small_string_8; -} - -/*! - * @brief This function moves the value in member my_small_string_8 - * @param _my_small_string_8 New value to be moved in member my_small_string_8 - */ -void ComplexStruct::my_small_string_8( - eprosima::fastrtps::fixed_string<128>&& _my_small_string_8) -{ - m_my_small_string_8 = std::move(_my_small_string_8); -} - -/*! - * @brief This function returns a constant reference to member my_small_string_8 - * @return Constant reference to member my_small_string_8 - */ -const eprosima::fastrtps::fixed_string<128>& ComplexStruct::my_small_string_8() const -{ - return m_my_small_string_8; -} - -/*! - * @brief This function returns a reference to member my_small_string_8 - * @return Reference to member my_small_string_8 - */ -eprosima::fastrtps::fixed_string<128>& ComplexStruct::my_small_string_8() -{ - return m_my_small_string_8; -} - - -/*! - * @brief This function copies the value in member my_large_string_8 - * @param _my_large_string_8 New value to be copied in member my_large_string_8 - */ -void ComplexStruct::my_large_string_8( - const eprosima::fastrtps::fixed_string<500>& _my_large_string_8) -{ - m_my_large_string_8 = _my_large_string_8; -} - -/*! - * @brief This function moves the value in member my_large_string_8 - * @param _my_large_string_8 New value to be moved in member my_large_string_8 - */ -void ComplexStruct::my_large_string_8( - eprosima::fastrtps::fixed_string<500>&& _my_large_string_8) -{ - m_my_large_string_8 = std::move(_my_large_string_8); -} - -/*! - * @brief This function returns a constant reference to member my_large_string_8 - * @return Constant reference to member my_large_string_8 - */ -const eprosima::fastrtps::fixed_string<500>& ComplexStruct::my_large_string_8() const -{ - return m_my_large_string_8; -} - -/*! - * @brief This function returns a reference to member my_large_string_8 - * @return Reference to member my_large_string_8 - */ -eprosima::fastrtps::fixed_string<500>& ComplexStruct::my_large_string_8() -{ - return m_my_large_string_8; -} - - -/*! - * @brief This function copies the value in member my_array_string - * @param _my_array_string New value to be copied in member my_array_string - */ -void ComplexStruct::my_array_string( - const std::array, 5>, 5>& _my_array_string) -{ - m_my_array_string = _my_array_string; -} - -/*! - * @brief This function moves the value in member my_array_string - * @param _my_array_string New value to be moved in member my_array_string - */ -void ComplexStruct::my_array_string( - std::array, 5>, 5>&& _my_array_string) -{ - m_my_array_string = std::move(_my_array_string); -} - -/*! - * @brief This function returns a constant reference to member my_array_string - * @return Constant reference to member my_array_string - */ -const std::array, 5>, 5>& ComplexStruct::my_array_string() const -{ - return m_my_array_string; -} - -/*! - * @brief This function returns a reference to member my_array_string - * @return Reference to member my_array_string - */ -std::array, 5>, 5>& ComplexStruct::my_array_string() -{ - return m_my_array_string; -} - - -/*! - * @brief This function copies the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 - */ -void ComplexStruct::multi_alias_array_42( - const MA3& _multi_alias_array_42) -{ - m_multi_alias_array_42 = _multi_alias_array_42; -} - -/*! - * @brief This function moves the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 - */ -void ComplexStruct::multi_alias_array_42( - MA3&& _multi_alias_array_42) -{ - m_multi_alias_array_42 = std::move(_multi_alias_array_42); -} - -/*! - * @brief This function returns a constant reference to member multi_alias_array_42 - * @return Constant reference to member multi_alias_array_42 - */ -const MA3& ComplexStruct::multi_alias_array_42() const -{ - return m_multi_alias_array_42; -} - -/*! - * @brief This function returns a reference to member multi_alias_array_42 - * @return Reference to member multi_alias_array_42 - */ -MA3& ComplexStruct::multi_alias_array_42() -{ - return m_multi_alias_array_42; -} - - -/*! - * @brief This function copies the value in member my_array_arrays - * @param _my_array_arrays New value to be copied in member my_array_arrays - */ -void ComplexStruct::my_array_arrays( - const std::array& _my_array_arrays) -{ - m_my_array_arrays = _my_array_arrays; -} - -/*! - * @brief This function moves the value in member my_array_arrays - * @param _my_array_arrays New value to be moved in member my_array_arrays - */ -void ComplexStruct::my_array_arrays( - std::array&& _my_array_arrays) -{ - m_my_array_arrays = std::move(_my_array_arrays); -} - -/*! - * @brief This function returns a constant reference to member my_array_arrays - * @return Constant reference to member my_array_arrays - */ -const std::array& ComplexStruct::my_array_arrays() const -{ - return m_my_array_arrays; -} - -/*! - * @brief This function returns a reference to member my_array_arrays - * @return Reference to member my_array_arrays - */ -std::array& ComplexStruct::my_array_arrays() -{ - return m_my_array_arrays; -} - - -/*! - * @brief This function copies the value in member my_sequences_array - * @param _my_sequences_array New value to be copied in member my_sequences_array - */ -void ComplexStruct::my_sequences_array( - const std::array& _my_sequences_array) -{ - m_my_sequences_array = _my_sequences_array; -} - -/*! - * @brief This function moves the value in member my_sequences_array - * @param _my_sequences_array New value to be moved in member my_sequences_array - */ -void ComplexStruct::my_sequences_array( - std::array&& _my_sequences_array) -{ - m_my_sequences_array = std::move(_my_sequences_array); -} - -/*! - * @brief This function returns a constant reference to member my_sequences_array - * @return Constant reference to member my_sequences_array - */ -const std::array& ComplexStruct::my_sequences_array() const -{ - return m_my_sequences_array; -} - -/*! - * @brief This function returns a reference to member my_sequences_array - * @return Reference to member my_sequences_array - */ -std::array& ComplexStruct::my_sequences_array() -{ - return m_my_sequences_array; -} - - - - - -MyUnion::MyUnion() -{ - m__d = ::A; - // BasicStruct m_basic - - // ComplexStruct m_complex - -} - -MyUnion::~MyUnion() -{ -} - -MyUnion::MyUnion( - const MyUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case ::A: - m_basic = x.m_basic; - break; - - - case ::B: - case ::C: - m_complex = x.m_complex; - break; - - default: - break; - } -} - -MyUnion::MyUnion( - MyUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case ::A: - m_basic = std::move(x.m_basic); - - break; - - - case ::B: - case ::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } -} - -MyUnion& MyUnion::operator =( - const MyUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case ::A: - m_basic = x.m_basic; - break; - - - case ::B: - case ::C: - m_complex = x.m_complex; - break; - - default: - break; - } - - return *this; -} - -MyUnion& MyUnion::operator =( - MyUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case ::A: - m_basic = std::move(x.m_basic); - - break; - - - case ::B: - case ::C: - m_complex = std::move(x.m_complex); - - break; - - default: - break; - } - - return *this; -} - -bool MyUnion::operator ==( - const MyUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case ::A: - return (m_basic == x.m_basic); - break; - - - case ::B: - case ::C: - return (m_complex == x.m_complex); - break; - - default: - break; - } - return false; -} - -bool MyUnion::operator !=( - const MyUnion& x) const -{ - return !(*this == x); -} - -void MyUnion::_d( - MyEnum __d) -{ - bool b = false; - - switch(m__d) - { - case ::A: - switch(__d) - { - case ::A: - b = true; - break; - default: - break; - } - break; - - - case ::B: - case ::C: - switch(__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -MyEnum MyUnion::_d() const -{ - return m__d; -} - -MyEnum& MyUnion::_d() -{ - return m__d; -} - -void MyUnion::basic( - const BasicStruct& _basic) -{ - m_basic = _basic; - m__d = ::A; - -} - -void MyUnion::basic( - BasicStruct&& _basic) -{ - m_basic = std::move(_basic); - m__d = ::A; - -} - -const BasicStruct& MyUnion::basic() const -{ - bool b = false; - - switch(m__d) - { - case ::A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_basic; -} - -BasicStruct& MyUnion::basic() -{ - bool b = false; - - switch(m__d) - { - case ::A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_basic; -} - - -void MyUnion::complex( - const ComplexStruct& _complex) -{ - m_complex = _complex; - m__d = ::B; - -} - -void MyUnion::complex( - ComplexStruct&& _complex) -{ - m_complex = std::move(_complex); - m__d = ::B; - -} - -const ComplexStruct& MyUnion::complex() const -{ - bool b = false; - - switch(m__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_complex; -} - -ComplexStruct& MyUnion::complex() -{ - bool b = false; - - switch(m__d) - { - case ::B: - case ::C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_complex; -} - - -// TODO(Ricardo) Review -size_t MyUnion::getCdrSerializedSize( - const MyUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case ::A: - current_alignment += BasicStruct::getCdrSerializedSize(data.basic(), current_alignment); - - break; - - - case ::B: - case ::C: - current_alignment += ComplexStruct::getCdrSerializedSize(data.complex(), current_alignment); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void MyUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m__d; - - switch(m__d) - { - case ::A: - scdr << m_basic; - - break; - - - case ::B: - case ::C: - scdr << m_complex; - - break; - - default: - break; - } -} - -void MyUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m__d = (MyEnum)enum_value; - } - - - switch(m__d) - { - case ::A: - dcdr >> m_basic; - - - break; - - - case ::B: - case ::C: - dcdr >> m_complex; - - - break; - - default: - break; - } -} - - - - - -MyUnion2::MyUnion2() -{ - m__d = A; - // long m_uno - m_uno = 0; - // /type_d() m_imString - - // long m_tres - m_tres = 0; -} - -MyUnion2::~MyUnion2() -{ -} - -MyUnion2::MyUnion2( - const MyUnion2& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = x.m_imString; - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } -} - -MyUnion2::MyUnion2( - MyUnion2&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = std::move(x.m_imString); - - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } -} - -MyUnion2& MyUnion2::operator =( - const MyUnion2& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = x.m_imString; - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; -} - -MyUnion2& MyUnion2::operator =( - MyUnion2&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_uno = x.m_uno; - break; - - - case B: - m_imString = std::move(x.m_imString); - - break; - - - case C: - m_tres = x.m_tres; - break; - - default: - break; - } - - return *this; -} - -bool MyUnion2::operator ==( - const MyUnion2& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_uno == x.m_uno); - break; - - - case B: - return (m_imString == x.m_imString); - break; - - - case C: - return (m_tres == x.m_tres); - break; - - default: - break; - } - return false; -} - -bool MyUnion2::operator !=( - const MyUnion2& x) const -{ - return !(*this == x); -} - -void MyUnion2::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case C: - switch(__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t MyUnion2::_d() const -{ - return m__d; -} - -uint8_t& MyUnion2::_d() -{ - return m__d; -} - -void MyUnion2::uno( - int32_t _uno) -{ - m_uno = _uno; - m__d = A; - -} - -int32_t MyUnion2::uno() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_uno; -} - -int32_t& MyUnion2::uno() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_uno; -} - - -void MyUnion2::imString( - const std::string& _imString) -{ - m_imString = _imString; - m__d = B; - -} - -void MyUnion2::imString( - std::string&& _imString) -{ - m_imString = std::move(_imString); - m__d = B; - -} - -const std::string& MyUnion2::imString() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_imString; -} - -std::string& MyUnion2::imString() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_imString; -} - - -void MyUnion2::tres( - int32_t _tres) -{ - m_tres = _tres; - m__d = C; - -} - -int32_t MyUnion2::tres() const -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_tres; -} - -int32_t& MyUnion2::tres() -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_tres; -} - - -// TODO(Ricardo) Review -size_t MyUnion2::getCdrSerializedSize( - const MyUnion2& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.imString().size() + 1; - - break; - - - case C: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void MyUnion2::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_uno; - - break; - - - case B: - scdr << m_imString.c_str(); - - break; - - - case C: - scdr << m_tres; - - break; - - default: - break; - } -} - -void MyUnion2::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_uno; - - - break; - - - case B: - dcdr >> m_imString; - - - break; - - - case C: - dcdr >> m_tres; - - - break; - - default: - break; - } -} - - - - - -CompleteStruct::CompleteStruct() -{ - // MyUnion m_my_union - - // MyUnion2 m_my_union_2 - - - // Just to register all known types - registerTestTypes(); -} - -CompleteStruct::~CompleteStruct() -{ -} - -CompleteStruct::CompleteStruct( - const CompleteStruct& x) -{ - m_my_union = x.m_my_union; - - - m_my_union_2 = x.m_my_union_2; - -} - -CompleteStruct::CompleteStruct( - CompleteStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - - m_my_union_2 = std::move(x.m_my_union_2); - -} - -CompleteStruct& CompleteStruct::operator =( - const CompleteStruct& x) -{ - m_my_union = x.m_my_union; - - - m_my_union_2 = x.m_my_union_2; - - return *this; -} - -CompleteStruct& CompleteStruct::operator =( - CompleteStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - - m_my_union_2 = std::move(x.m_my_union_2); - - return *this; -} - -bool CompleteStruct::operator ==( - const CompleteStruct& x) const -{ - return (m_my_union == x.m_my_union && - m_my_union_2 == x.m_my_union_2); -} - -bool CompleteStruct::operator !=( - const CompleteStruct& x) const -{ - return !(*this == x); -} - -size_t CompleteStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return CompleteStruct_max_cdr_typesize; -} - -size_t CompleteStruct::getCdrSerializedSize( - const CompleteStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += MyUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - current_alignment += MyUnion2::getCdrSerializedSize(data.my_union_2(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void CompleteStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - - scdr << m_my_union_2; - -} - -void CompleteStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - - - dcdr >> m_my_union_2; - - -} - - -bool CompleteStruct::isKeyDefined() -{ - return false; -} - -void CompleteStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void CompleteStruct::my_union( - const MyUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void CompleteStruct::my_union( - MyUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const MyUnion& CompleteStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -MyUnion& CompleteStruct::my_union() -{ - return m_my_union; -} - - -/*! - * @brief This function copies the value in member my_union_2 - * @param _my_union_2 New value to be copied in member my_union_2 - */ -void CompleteStruct::my_union_2( - const MyUnion2& _my_union_2) -{ - m_my_union_2 = _my_union_2; -} - -/*! - * @brief This function moves the value in member my_union_2 - * @param _my_union_2 New value to be moved in member my_union_2 - */ -void CompleteStruct::my_union_2( - MyUnion2&& _my_union_2) -{ - m_my_union_2 = std::move(_my_union_2); -} - -/*! - * @brief This function returns a constant reference to member my_union_2 - * @return Constant reference to member my_union_2 - */ -const MyUnion2& CompleteStruct::my_union_2() const -{ - return m_my_union_2; -} - -/*! - * @brief This function returns a reference to member my_union_2 - * @return Reference to member my_union_2 - */ -MyUnion2& CompleteStruct::my_union_2() -{ - return m_my_union_2; -} - - - - - -KeyedStruct::KeyedStruct() -{ - // octet m_key - m_key = 0; - // BasicStruct m_basic - - - // Just to register all known types - registerTestTypes(); -} - -KeyedStruct::~KeyedStruct() -{ -} - -KeyedStruct::KeyedStruct( - const KeyedStruct& x) -{ - m_key = x.m_key; - - - m_basic = x.m_basic; - -} - -KeyedStruct::KeyedStruct( - KeyedStruct&& x) noexcept -{ - m_key = x.m_key; - - - m_basic = std::move(x.m_basic); - -} - -KeyedStruct& KeyedStruct::operator =( - const KeyedStruct& x) -{ - m_key = x.m_key; - - - m_basic = x.m_basic; - - return *this; -} - -KeyedStruct& KeyedStruct::operator =( - KeyedStruct&& x) noexcept -{ - m_key = x.m_key; - - - m_basic = std::move(x.m_basic); - - return *this; -} - -bool KeyedStruct::operator ==( - const KeyedStruct& x) const -{ - return (m_key == x.m_key && - m_basic == x.m_basic); -} - -bool KeyedStruct::operator !=( - const KeyedStruct& x) const -{ - return !(*this == x); -} - -size_t KeyedStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return KeyedStruct_max_cdr_typesize; -} - -size_t KeyedStruct::getCdrSerializedSize( - const KeyedStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += BasicStruct::getCdrSerializedSize(data.basic(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void KeyedStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_key; - - scdr << m_basic; - -} - -void KeyedStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_key; - - - - dcdr >> m_basic; - - -} - - -bool KeyedStruct::isKeyDefined() -{ - return true; -} - -void KeyedStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - scdr << m_key; - - -} - -/*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ -void KeyedStruct::key( - uint8_t _key) -{ - m_key = _key; -} - -/*! - * @brief This function returns the value of member key - * @return Value of member key - */ -uint8_t KeyedStruct::key() const -{ - return m_key; -} - -/*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ -uint8_t& KeyedStruct::key() -{ - return m_key; -} - - -/*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ -void KeyedStruct::basic( - const BasicStruct& _basic) -{ - m_basic = _basic; -} - -/*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ -void KeyedStruct::basic( - BasicStruct&& _basic) -{ - m_basic = std::move(_basic); -} - -/*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - */ -const BasicStruct& KeyedStruct::basic() const -{ - return m_basic; -} - -/*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - */ -BasicStruct& KeyedStruct::basic() -{ - return m_basic; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Testv1.h b/test/unittest/dynamic_types/idl/Testv1.h deleted file mode 100644 index 42ae9b215ea..00000000000 --- a/test/unittest/dynamic_types/idl/Testv1.h +++ /dev/null @@ -1,1873 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Test.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TEST_H_ -#define _FAST_DDS_GENERATED_TEST_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TEST_SOURCE) -#define TEST_DllAPI __declspec( dllexport ) -#else -#define TEST_DllAPI __declspec( dllimport ) -#endif // TEST_SOURCE -#else -#define TEST_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TEST_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Test - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -typedef MyEnum MyAliasEnum; - -typedef MyAliasEnum MyAliasEnum2; - -typedef MyAliasEnum2 MyAliasEnum3; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Test - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - - - /*! - * @brief This function sets a value in member my_int16 - * @param _my_int16 New value for member my_int16 - */ - eProsima_user_DllExport void my_int16( - int16_t _my_int16); - - /*! - * @brief This function returns the value of member my_int16 - * @return Value of member my_int16 - */ - eProsima_user_DllExport int16_t my_int16() const; - - /*! - * @brief This function returns a reference to member my_int16 - * @return Reference to member my_int16 - */ - eProsima_user_DllExport int16_t& my_int16(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function sets a value in member my_int64 - * @param _my_int64 New value for member my_int64 - */ - eProsima_user_DllExport void my_int64( - int64_t _my_int64); - - /*! - * @brief This function returns the value of member my_int64 - * @return Value of member my_int64 - */ - eProsima_user_DllExport int64_t my_int64() const; - - /*! - * @brief This function returns a reference to member my_int64 - * @return Reference to member my_int64 - */ - eProsima_user_DllExport int64_t& my_int64(); - - - /*! - * @brief This function sets a value in member my_uint16 - * @param _my_uint16 New value for member my_uint16 - */ - eProsima_user_DllExport void my_uint16( - uint16_t _my_uint16); - - /*! - * @brief This function returns the value of member my_uint16 - * @return Value of member my_uint16 - */ - eProsima_user_DllExport uint16_t my_uint16() const; - - /*! - * @brief This function returns a reference to member my_uint16 - * @return Reference to member my_uint16 - */ - eProsima_user_DllExport uint16_t& my_uint16(); - - - /*! - * @brief This function sets a value in member my_uint32 - * @param _my_uint32 New value for member my_uint32 - */ - eProsima_user_DllExport void my_uint32( - uint32_t _my_uint32); - - /*! - * @brief This function returns the value of member my_uint32 - * @return Value of member my_uint32 - */ - eProsima_user_DllExport uint32_t my_uint32() const; - - /*! - * @brief This function returns a reference to member my_uint32 - * @return Reference to member my_uint32 - */ - eProsima_user_DllExport uint32_t& my_uint32(); - - - /*! - * @brief This function sets a value in member my_uint64 - * @param _my_uint64 New value for member my_uint64 - */ - eProsima_user_DllExport void my_uint64( - uint64_t _my_uint64); - - /*! - * @brief This function returns the value of member my_uint64 - * @return Value of member my_uint64 - */ - eProsima_user_DllExport uint64_t my_uint64() const; - - /*! - * @brief This function returns a reference to member my_uint64 - * @return Reference to member my_uint64 - */ - eProsima_user_DllExport uint64_t& my_uint64(); - - - /*! - * @brief This function sets a value in member my_float32 - * @param _my_float32 New value for member my_float32 - */ - eProsima_user_DllExport void my_float32( - float _my_float32); - - /*! - * @brief This function returns the value of member my_float32 - * @return Value of member my_float32 - */ - eProsima_user_DllExport float my_float32() const; - - /*! - * @brief This function returns a reference to member my_float32 - * @return Reference to member my_float32 - */ - eProsima_user_DllExport float& my_float32(); - - - /*! - * @brief This function sets a value in member my_float64 - * @param _my_float64 New value for member my_float64 - */ - eProsima_user_DllExport void my_float64( - double _my_float64); - - /*! - * @brief This function returns the value of member my_float64 - * @return Value of member my_float64 - */ - eProsima_user_DllExport double my_float64() const; - - /*! - * @brief This function returns a reference to member my_float64 - * @return Reference to member my_float64 - */ - eProsima_user_DllExport double& my_float64(); - - - /*! - * @brief This function sets a value in member my_float128 - * @param _my_float128 New value for member my_float128 - */ - eProsima_user_DllExport void my_float128( - long double _my_float128); - - /*! - * @brief This function returns the value of member my_float128 - * @return Value of member my_float128 - */ - eProsima_user_DllExport long double my_float128() const; - - /*! - * @brief This function returns a reference to member my_float128 - * @return Reference to member my_float128 - */ - eProsima_user_DllExport long double& my_float128(); - - - /*! - * @brief This function sets a value in member my_char - * @param _my_char New value for member my_char - */ - eProsima_user_DllExport void my_char( - char _my_char); - - /*! - * @brief This function returns the value of member my_char - * @return Value of member my_char - */ - eProsima_user_DllExport char my_char() const; - - /*! - * @brief This function returns a reference to member my_char - * @return Reference to member my_char - */ - eProsima_user_DllExport char& my_char(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - uint8_t m_my_octet; - int16_t m_my_int16; - int32_t m_my_int32; - int64_t m_my_int64; - uint16_t m_my_uint16; - uint32_t m_my_uint32; - uint64_t m_my_uint64; - float m_my_float32; - double m_my_float64; - long double m_my_float128; - char m_my_char; - std::string m_my_string; - -}; - -typedef std::array MyOctetArray500; - -typedef std::array BSAlias5; - -typedef std::array MA3; - -typedef std::array MyMiniArray; - - - -typedef std::vector MySequenceLong; - - - -/*! - * @brief This class represents the structure ComplexStruct defined by the user in the IDL file. - * @ingroup Test - */ -class ComplexStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ComplexStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ComplexStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - const ComplexStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct( - ComplexStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - const ComplexStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ComplexStruct that will be copied. - */ - eProsima_user_DllExport ComplexStruct& operator =( - ComplexStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ComplexStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ComplexStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ComplexStruct& x) const; - - /*! - * @brief This function sets a value in member my_octet - * @param _my_octet New value for member my_octet - */ - eProsima_user_DllExport void my_octet( - uint8_t _my_octet); - - /*! - * @brief This function returns the value of member my_octet - * @return Value of member my_octet - */ - eProsima_user_DllExport uint8_t my_octet() const; - - /*! - * @brief This function returns a reference to member my_octet - * @return Reference to member my_octet - */ - eProsima_user_DllExport uint8_t& my_octet(); - - - /*! - * @brief This function copies the value in member my_basic_struct - * @param _my_basic_struct New value to be copied in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - const BasicStruct& _my_basic_struct); - - /*! - * @brief This function moves the value in member my_basic_struct - * @param _my_basic_struct New value to be moved in member my_basic_struct - */ - eProsima_user_DllExport void my_basic_struct( - BasicStruct&& _my_basic_struct); - - /*! - * @brief This function returns a constant reference to member my_basic_struct - * @return Constant reference to member my_basic_struct - */ - eProsima_user_DllExport const BasicStruct& my_basic_struct() const; - - /*! - * @brief This function returns a reference to member my_basic_struct - * @return Reference to member my_basic_struct - */ - eProsima_user_DllExport BasicStruct& my_basic_struct(); - - - /*! - * @brief This function sets a value in member my_alias_enum - * @param _my_alias_enum New value for member my_alias_enum - */ - eProsima_user_DllExport void my_alias_enum( - MyAliasEnum _my_alias_enum); - - /*! - * @brief This function returns the value of member my_alias_enum - * @return Value of member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum my_alias_enum() const; - - /*! - * @brief This function returns a reference to member my_alias_enum - * @return Reference to member my_alias_enum - */ - eProsima_user_DllExport MyAliasEnum& my_alias_enum(); - - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @brief This function copies the value in member my_sequence_octet - * @param _my_sequence_octet New value to be copied in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - const std::vector& _my_sequence_octet); - - /*! - * @brief This function moves the value in member my_sequence_octet - * @param _my_sequence_octet New value to be moved in member my_sequence_octet - */ - eProsima_user_DllExport void my_sequence_octet( - std::vector&& _my_sequence_octet); - - /*! - * @brief This function returns a constant reference to member my_sequence_octet - * @return Constant reference to member my_sequence_octet - */ - eProsima_user_DllExport const std::vector& my_sequence_octet() const; - - /*! - * @brief This function returns a reference to member my_sequence_octet - * @return Reference to member my_sequence_octet - */ - eProsima_user_DllExport std::vector& my_sequence_octet(); - - - /*! - * @brief This function copies the value in member my_sequence_struct - * @param _my_sequence_struct New value to be copied in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - const std::vector& _my_sequence_struct); - - /*! - * @brief This function moves the value in member my_sequence_struct - * @param _my_sequence_struct New value to be moved in member my_sequence_struct - */ - eProsima_user_DllExport void my_sequence_struct( - std::vector&& _my_sequence_struct); - - /*! - * @brief This function returns a constant reference to member my_sequence_struct - * @return Constant reference to member my_sequence_struct - */ - eProsima_user_DllExport const std::vector& my_sequence_struct() const; - - /*! - * @brief This function returns a reference to member my_sequence_struct - * @return Reference to member my_sequence_struct - */ - eProsima_user_DllExport std::vector& my_sequence_struct(); - - - /*! - * @brief This function copies the value in member my_array_octet - * @param _my_array_octet New value to be copied in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - const std::array, 5>, 500>& _my_array_octet); - - /*! - * @brief This function moves the value in member my_array_octet - * @param _my_array_octet New value to be moved in member my_array_octet - */ - eProsima_user_DllExport void my_array_octet( - std::array, 5>, 500>&& _my_array_octet); - - /*! - * @brief This function returns a constant reference to member my_array_octet - * @return Constant reference to member my_array_octet - */ - eProsima_user_DllExport const std::array, 5>, 500>& my_array_octet() const; - - /*! - * @brief This function returns a reference to member my_array_octet - * @return Reference to member my_array_octet - */ - eProsima_user_DllExport std::array, 5>, 500>& my_array_octet(); - - - /*! - * @brief This function copies the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - const MyOctetArray500& _my_octet_array_500); - - /*! - * @brief This function moves the value in member my_octet_array_500 - * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 - */ - eProsima_user_DllExport void my_octet_array_500( - MyOctetArray500&& _my_octet_array_500); - - /*! - * @brief This function returns a constant reference to member my_octet_array_500 - * @return Constant reference to member my_octet_array_500 - */ - eProsima_user_DllExport const MyOctetArray500& my_octet_array_500() const; - - /*! - * @brief This function returns a reference to member my_octet_array_500 - * @return Reference to member my_octet_array_500 - */ - eProsima_user_DllExport MyOctetArray500& my_octet_array_500(); - - - /*! - * @brief This function copies the value in member my_array_struct - * @param _my_array_struct New value to be copied in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - const std::array& _my_array_struct); - - /*! - * @brief This function moves the value in member my_array_struct - * @param _my_array_struct New value to be moved in member my_array_struct - */ - eProsima_user_DllExport void my_array_struct( - std::array&& _my_array_struct); - - /*! - * @brief This function returns a constant reference to member my_array_struct - * @return Constant reference to member my_array_struct - */ - eProsima_user_DllExport const std::array& my_array_struct() const; - - /*! - * @brief This function returns a reference to member my_array_struct - * @return Reference to member my_array_struct - */ - eProsima_user_DllExport std::array& my_array_struct(); - - - /*! - * @brief This function copies the value in member my_map_octet_short - * @param _my_map_octet_short New value to be copied in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - const std::map& _my_map_octet_short); - - /*! - * @brief This function moves the value in member my_map_octet_short - * @param _my_map_octet_short New value to be moved in member my_map_octet_short - */ - eProsima_user_DllExport void my_map_octet_short( - std::map&& _my_map_octet_short); - - /*! - * @brief This function returns a constant reference to member my_map_octet_short - * @return Constant reference to member my_map_octet_short - */ - eProsima_user_DllExport const std::map& my_map_octet_short() const; - - /*! - * @brief This function returns a reference to member my_map_octet_short - * @return Reference to member my_map_octet_short - */ - eProsima_user_DllExport std::map& my_map_octet_short(); - - - /*! - * @brief This function copies the value in member my_map_long_struct - * @param _my_map_long_struct New value to be copied in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - const std::map& _my_map_long_struct); - - /*! - * @brief This function moves the value in member my_map_long_struct - * @param _my_map_long_struct New value to be moved in member my_map_long_struct - */ - eProsima_user_DllExport void my_map_long_struct( - std::map&& _my_map_long_struct); - - /*! - * @brief This function returns a constant reference to member my_map_long_struct - * @return Constant reference to member my_map_long_struct - */ - eProsima_user_DllExport const std::map& my_map_long_struct() const; - - /*! - * @brief This function returns a reference to member my_map_long_struct - * @return Reference to member my_map_long_struct - */ - eProsima_user_DllExport std::map& my_map_long_struct(); - - - /*! - * @brief This function copies the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - const std::map>>& _my_map_long_seq_octet); - - /*! - * @brief This function moves the value in member my_map_long_seq_octet - * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet - */ - eProsima_user_DllExport void my_map_long_seq_octet( - std::map>>&& _my_map_long_seq_octet); - - /*! - * @brief This function returns a constant reference to member my_map_long_seq_octet - * @return Constant reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport const std::map>>& my_map_long_seq_octet() const; - - /*! - * @brief This function returns a reference to member my_map_long_seq_octet - * @return Reference to member my_map_long_seq_octet - */ - eProsima_user_DllExport std::map>>& my_map_long_seq_octet(); - - - /*! - * @brief This function copies the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - const std::map& _my_map_long_octet_array_500); - - /*! - * @brief This function moves the value in member my_map_long_octet_array_500 - * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 - */ - eProsima_user_DllExport void my_map_long_octet_array_500( - std::map&& _my_map_long_octet_array_500); - - /*! - * @brief This function returns a constant reference to member my_map_long_octet_array_500 - * @return Constant reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport const std::map& my_map_long_octet_array_500() const; - - /*! - * @brief This function returns a reference to member my_map_long_octet_array_500 - * @return Reference to member my_map_long_octet_array_500 - */ - eProsima_user_DllExport std::map& my_map_long_octet_array_500(); - - - /*! - * @brief This function copies the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - const std::map>& _my_map_long_lol_type); - - /*! - * @brief This function moves the value in member my_map_long_lol_type - * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type - */ - eProsima_user_DllExport void my_map_long_lol_type( - std::map>&& _my_map_long_lol_type); - - /*! - * @brief This function returns a constant reference to member my_map_long_lol_type - * @return Constant reference to member my_map_long_lol_type - */ - eProsima_user_DllExport const std::map>& my_map_long_lol_type() const; - - /*! - * @brief This function returns a reference to member my_map_long_lol_type - * @return Reference to member my_map_long_lol_type - */ - eProsima_user_DllExport std::map>& my_map_long_lol_type(); - - - /*! - * @brief This function copies the value in member my_small_string_8 - * @param _my_small_string_8 New value to be copied in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - const eprosima::fastrtps::fixed_string<128>& _my_small_string_8); - - /*! - * @brief This function moves the value in member my_small_string_8 - * @param _my_small_string_8 New value to be moved in member my_small_string_8 - */ - eProsima_user_DllExport void my_small_string_8( - eprosima::fastrtps::fixed_string<128>&& _my_small_string_8); - - /*! - * @brief This function returns a constant reference to member my_small_string_8 - * @return Constant reference to member my_small_string_8 - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& my_small_string_8() const; - - /*! - * @brief This function returns a reference to member my_small_string_8 - * @return Reference to member my_small_string_8 - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& my_small_string_8(); - - - /*! - * @brief This function copies the value in member my_large_string_8 - * @param _my_large_string_8 New value to be copied in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - const eprosima::fastrtps::fixed_string<500>& _my_large_string_8); - - /*! - * @brief This function moves the value in member my_large_string_8 - * @param _my_large_string_8 New value to be moved in member my_large_string_8 - */ - eProsima_user_DllExport void my_large_string_8( - eprosima::fastrtps::fixed_string<500>&& _my_large_string_8); - - /*! - * @brief This function returns a constant reference to member my_large_string_8 - * @return Constant reference to member my_large_string_8 - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<500>& my_large_string_8() const; - - /*! - * @brief This function returns a reference to member my_large_string_8 - * @return Reference to member my_large_string_8 - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<500>& my_large_string_8(); - - - /*! - * @brief This function copies the value in member my_array_string - * @param _my_array_string New value to be copied in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - const std::array, 5>, 5>& _my_array_string); - - /*! - * @brief This function moves the value in member my_array_string - * @param _my_array_string New value to be moved in member my_array_string - */ - eProsima_user_DllExport void my_array_string( - std::array, 5>, 5>&& _my_array_string); - - /*! - * @brief This function returns a constant reference to member my_array_string - * @return Constant reference to member my_array_string - */ - eProsima_user_DllExport const std::array, 5>, 5>& my_array_string() const; - - /*! - * @brief This function returns a reference to member my_array_string - * @return Reference to member my_array_string - */ - eProsima_user_DllExport std::array, 5>, 5>& my_array_string(); - - - /*! - * @brief This function copies the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - const MA3& _multi_alias_array_42); - - /*! - * @brief This function moves the value in member multi_alias_array_42 - * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 - */ - eProsima_user_DllExport void multi_alias_array_42( - MA3&& _multi_alias_array_42); - - /*! - * @brief This function returns a constant reference to member multi_alias_array_42 - * @return Constant reference to member multi_alias_array_42 - */ - eProsima_user_DllExport const MA3& multi_alias_array_42() const; - - /*! - * @brief This function returns a reference to member multi_alias_array_42 - * @return Reference to member multi_alias_array_42 - */ - eProsima_user_DllExport MA3& multi_alias_array_42(); - - - /*! - * @brief This function copies the value in member my_array_arrays - * @param _my_array_arrays New value to be copied in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - const std::array& _my_array_arrays); - - /*! - * @brief This function moves the value in member my_array_arrays - * @param _my_array_arrays New value to be moved in member my_array_arrays - */ - eProsima_user_DllExport void my_array_arrays( - std::array&& _my_array_arrays); - - /*! - * @brief This function returns a constant reference to member my_array_arrays - * @return Constant reference to member my_array_arrays - */ - eProsima_user_DllExport const std::array& my_array_arrays() const; - - /*! - * @brief This function returns a reference to member my_array_arrays - * @return Reference to member my_array_arrays - */ - eProsima_user_DllExport std::array& my_array_arrays(); - - - /*! - * @brief This function copies the value in member my_sequences_array - * @param _my_sequences_array New value to be copied in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - const std::array& _my_sequences_array); - - /*! - * @brief This function moves the value in member my_sequences_array - * @param _my_sequences_array New value to be moved in member my_sequences_array - */ - eProsima_user_DllExport void my_sequences_array( - std::array&& _my_sequences_array); - - /*! - * @brief This function returns a constant reference to member my_sequences_array - * @return Constant reference to member my_sequences_array - */ - eProsima_user_DllExport const std::array& my_sequences_array() const; - - /*! - * @brief This function returns a reference to member my_sequences_array - * @return Reference to member my_sequences_array - */ - eProsima_user_DllExport std::array& my_sequences_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ComplexStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_octet; - BasicStruct m_my_basic_struct; - MyAliasEnum m_my_alias_enum; - MyEnum m_my_enum; - std::vector m_my_sequence_octet; - std::vector m_my_sequence_struct; - std::array, 5>, 500> m_my_array_octet; - MyOctetArray500 m_my_octet_array_500; - std::array m_my_array_struct; - std::map m_my_map_octet_short; - std::map m_my_map_long_struct; - std::map>> m_my_map_long_seq_octet; - std::map m_my_map_long_octet_array_500; - std::map> m_my_map_long_lol_type; - eprosima::fastrtps::fixed_string<128> m_my_small_string_8; - eprosima::fastrtps::fixed_string<500> m_my_large_string_8; - std::array, 5>, 5> m_my_array_string; - MA3 m_multi_alias_array_42; - std::array m_my_array_arrays; - std::array m_my_sequences_array; - -}; - - - -/*! - * @brief This class represents the union MyUnion defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - const MyUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion( - MyUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - const MyUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion that will be copied. - */ - eProsima_user_DllExport MyUnion& operator =( - MyUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x MyUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - MyEnum __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport MyEnum _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport MyEnum& _d(); - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic); - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic); - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const BasicStruct& basic() const; - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport BasicStruct& basic(); - - - /*! - * @brief This function copies the value in member complex - * @param _complex New value to be copied in member complex - */ - eProsima_user_DllExport void complex( - const ComplexStruct& _complex); - - /*! - * @brief This function moves the value in member complex - * @param _complex New value to be moved in member complex - */ - eProsima_user_DllExport void complex( - ComplexStruct&& _complex); - - /*! - * @brief This function returns a constant reference to member complex - * @return Constant reference to member complex - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const ComplexStruct& complex() const; - - /*! - * @brief This function returns a reference to member complex - * @return Reference to member complex - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport ComplexStruct& complex(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - MyEnum m__d; - - BasicStruct m_basic; - ComplexStruct m_complex; -}; - - - -/*! - * @brief This class represents the union MyUnion2 defined by the user in the IDL file. - * @ingroup Test - */ -class MyUnion2 -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyUnion2(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyUnion2(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - const MyUnion2& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2( - MyUnion2&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - const MyUnion2& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyUnion2 that will be copied. - */ - eProsima_user_DllExport MyUnion2& operator =( - MyUnion2&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyUnion2& x) const; - - /*! - * @brief Comparison operator. - * @param x MyUnion2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyUnion2& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member uno - * @param _uno New value for member uno - */ - eProsima_user_DllExport void uno( - int32_t _uno); - - /*! - * @brief This function returns the value of member uno - * @return Value of member uno - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t uno() const; - - /*! - * @brief This function returns a reference to member uno - * @return Reference to member uno - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& uno(); - - - /*! - * @brief This function copies the value in member imString - * @param _imString New value to be copied in member imString - */ - eProsima_user_DllExport void imString( - const std::string& _imString); - - /*! - * @brief This function moves the value in member imString - * @param _imString New value to be moved in member imString - */ - eProsima_user_DllExport void imString( - std::string&& _imString); - - /*! - * @brief This function returns a constant reference to member imString - * @return Constant reference to member imString - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const std::string& imString() const; - - /*! - * @brief This function returns a reference to member imString - * @return Reference to member imString - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport std::string& imString(); - - - /*! - * @brief This function sets a value in member tres - * @param _tres New value for member tres - */ - eProsima_user_DllExport void tres( - int32_t _tres); - - /*! - * @brief This function returns the value of member tres - * @return Value of member tres - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t tres() const; - - /*! - * @brief This function returns a reference to member tres - * @return Reference to member tres - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& tres(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyUnion2& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - uint8_t m__d; - - int32_t m_uno; - std::string m_imString; - int32_t m_tres; -}; - - - -/*! - * @brief This class represents the structure CompleteStruct defined by the user in the IDL file. - * @ingroup Test - */ -class CompleteStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CompleteStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CompleteStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - const CompleteStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct( - CompleteStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - const CompleteStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CompleteStruct that will be copied. - */ - eProsima_user_DllExport CompleteStruct& operator =( - CompleteStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CompleteStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x CompleteStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CompleteStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const MyUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - MyUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const MyUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport MyUnion& my_union(); - - - /*! - * @brief This function copies the value in member my_union_2 - * @param _my_union_2 New value to be copied in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - const MyUnion2& _my_union_2); - - /*! - * @brief This function moves the value in member my_union_2 - * @param _my_union_2 New value to be moved in member my_union_2 - */ - eProsima_user_DllExport void my_union_2( - MyUnion2&& _my_union_2); - - /*! - * @brief This function returns a constant reference to member my_union_2 - * @return Constant reference to member my_union_2 - */ - eProsima_user_DllExport const MyUnion2& my_union_2() const; - - /*! - * @brief This function returns a reference to member my_union_2 - * @return Reference to member my_union_2 - */ - eProsima_user_DllExport MyUnion2& my_union_2(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const CompleteStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyUnion m_my_union; - MyUnion2 m_my_union_2; - -}; - - - -/*! - * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. - * @ingroup Test - */ -class KeyedStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport KeyedStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~KeyedStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - const KeyedStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct( - KeyedStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - const KeyedStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object KeyedStruct that will be copied. - */ - eProsima_user_DllExport KeyedStruct& operator =( - KeyedStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const KeyedStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x KeyedStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const KeyedStruct& x) const; - - /*! - * @brief This function sets a value in member key - * @param _key New value for member key - */ - eProsima_user_DllExport void key( - uint8_t _key); - - /*! - * @brief This function returns the value of member key - * @return Value of member key - */ - eProsima_user_DllExport uint8_t key() const; - - /*! - * @brief This function returns a reference to member key - * @return Reference to member key - */ - eProsima_user_DllExport uint8_t& key(); - - - /*! - * @brief This function copies the value in member basic - * @param _basic New value to be copied in member basic - */ - eProsima_user_DllExport void basic( - const BasicStruct& _basic); - - /*! - * @brief This function moves the value in member basic - * @param _basic New value to be moved in member basic - */ - eProsima_user_DllExport void basic( - BasicStruct&& _basic); - - /*! - * @brief This function returns a constant reference to member basic - * @return Constant reference to member basic - */ - eProsima_user_DllExport const BasicStruct& basic() const; - - /*! - * @brief This function returns a reference to member basic - * @return Reference to member basic - */ - eProsima_user_DllExport BasicStruct& basic(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const KeyedStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_key; - BasicStruct m_basic; - -}; - - -#endif // _FAST_DDS_GENERATED_TEST_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.cxx b/test/unittest/dynamic_types/idl/new_features_4_2.cxx deleted file mode 100644 index 17bb0eb11e5..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2.cxx +++ /dev/null @@ -1,2065 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "new_features_4_2.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "new_features_4_2TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -NewAliases::NewAliases() -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -NewAliases::~NewAliases() -{ -} - -NewAliases::NewAliases( - const NewAliases& x) -{ - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = x.m_local_string; -} - -NewAliases::NewAliases( - NewAliases&& x) noexcept -{ - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = std::move(x.m_local_string); -} - -NewAliases& NewAliases::operator =( - const NewAliases& x) -{ - - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = x.m_local_string; - return *this; -} - -NewAliases& NewAliases::operator =( - NewAliases&& x) noexcept -{ - - m_int8_ = x.m_int8_; - m_uint8_ = x.m_uint8_; - m_int16_ = x.m_int16_; - m_uint16_ = x.m_uint16_; - m_int32_ = x.m_int32_; - m_uint32_ = x.m_uint32_; - m_int64_ = x.m_int64_; - m_uint64_ = x.m_uint64_; - m_local_string = std::move(x.m_local_string); - return *this; -} - -bool NewAliases::operator ==( - const NewAliases& x) const -{ - return (m_int8_ == x.m_int8_ && - m_uint8_ == x.m_uint8_ && - m_int16_ == x.m_int16_ && - m_uint16_ == x.m_uint16_ && - m_int32_ == x.m_int32_ && - m_uint32_ == x.m_uint32_ && - m_int64_ == x.m_int64_ && - m_uint64_ == x.m_uint64_ && - m_local_string == x.m_local_string); -} - -bool NewAliases::operator !=( - const NewAliases& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member int8_ - * @param _int8_ New value for member int8_ - */ -void NewAliases::int8_( - int8_t _int8_) -{ - m_int8_ = _int8_; -} - -/*! - * @brief This function returns the value of member int8_ - * @return Value of member int8_ - */ -int8_t NewAliases::int8_() const -{ - return m_int8_; -} - -/*! - * @brief This function returns a reference to member int8_ - * @return Reference to member int8_ - */ -int8_t& NewAliases::int8_() -{ - return m_int8_; -} - - -/*! - * @brief This function sets a value in member uint8_ - * @param _uint8_ New value for member uint8_ - */ -void NewAliases::uint8_( - uint8_t _uint8_) -{ - m_uint8_ = _uint8_; -} - -/*! - * @brief This function returns the value of member uint8_ - * @return Value of member uint8_ - */ -uint8_t NewAliases::uint8_() const -{ - return m_uint8_; -} - -/*! - * @brief This function returns a reference to member uint8_ - * @return Reference to member uint8_ - */ -uint8_t& NewAliases::uint8_() -{ - return m_uint8_; -} - - -/*! - * @brief This function sets a value in member int16_ - * @param _int16_ New value for member int16_ - */ -void NewAliases::int16_( - int16_t _int16_) -{ - m_int16_ = _int16_; -} - -/*! - * @brief This function returns the value of member int16_ - * @return Value of member int16_ - */ -int16_t NewAliases::int16_() const -{ - return m_int16_; -} - -/*! - * @brief This function returns a reference to member int16_ - * @return Reference to member int16_ - */ -int16_t& NewAliases::int16_() -{ - return m_int16_; -} - - -/*! - * @brief This function sets a value in member uint16_ - * @param _uint16_ New value for member uint16_ - */ -void NewAliases::uint16_( - uint16_t _uint16_) -{ - m_uint16_ = _uint16_; -} - -/*! - * @brief This function returns the value of member uint16_ - * @return Value of member uint16_ - */ -uint16_t NewAliases::uint16_() const -{ - return m_uint16_; -} - -/*! - * @brief This function returns a reference to member uint16_ - * @return Reference to member uint16_ - */ -uint16_t& NewAliases::uint16_() -{ - return m_uint16_; -} - - -/*! - * @brief This function sets a value in member int32_ - * @param _int32_ New value for member int32_ - */ -void NewAliases::int32_( - int32_t _int32_) -{ - m_int32_ = _int32_; -} - -/*! - * @brief This function returns the value of member int32_ - * @return Value of member int32_ - */ -int32_t NewAliases::int32_() const -{ - return m_int32_; -} - -/*! - * @brief This function returns a reference to member int32_ - * @return Reference to member int32_ - */ -int32_t& NewAliases::int32_() -{ - return m_int32_; -} - - -/*! - * @brief This function sets a value in member uint32_ - * @param _uint32_ New value for member uint32_ - */ -void NewAliases::uint32_( - uint32_t _uint32_) -{ - m_uint32_ = _uint32_; -} - -/*! - * @brief This function returns the value of member uint32_ - * @return Value of member uint32_ - */ -uint32_t NewAliases::uint32_() const -{ - return m_uint32_; -} - -/*! - * @brief This function returns a reference to member uint32_ - * @return Reference to member uint32_ - */ -uint32_t& NewAliases::uint32_() -{ - return m_uint32_; -} - - -/*! - * @brief This function sets a value in member int64_ - * @param _int64_ New value for member int64_ - */ -void NewAliases::int64_( - int64_t _int64_) -{ - m_int64_ = _int64_; -} - -/*! - * @brief This function returns the value of member int64_ - * @return Value of member int64_ - */ -int64_t NewAliases::int64_() const -{ - return m_int64_; -} - -/*! - * @brief This function returns a reference to member int64_ - * @return Reference to member int64_ - */ -int64_t& NewAliases::int64_() -{ - return m_int64_; -} - - -/*! - * @brief This function sets a value in member uint64_ - * @param _uint64_ New value for member uint64_ - */ -void NewAliases::uint64_( - uint64_t _uint64_) -{ - m_uint64_ = _uint64_; -} - -/*! - * @brief This function returns the value of member uint64_ - * @return Value of member uint64_ - */ -uint64_t NewAliases::uint64_() const -{ - return m_uint64_; -} - -/*! - * @brief This function returns a reference to member uint64_ - * @return Reference to member uint64_ - */ -uint64_t& NewAliases::uint64_() -{ - return m_uint64_; -} - - -/*! - * @brief This function copies the value in member local_string - * @param _local_string New value to be copied in member local_string - */ -void NewAliases::local_string( - const std::string& _local_string) -{ - m_local_string = _local_string; -} - -/*! - * @brief This function moves the value in member local_string - * @param _local_string New value to be moved in member local_string - */ -void NewAliases::local_string( - std::string&& _local_string) -{ - m_local_string = std::move(_local_string); -} - -/*! - * @brief This function returns a constant reference to member local_string - * @return Constant reference to member local_string - */ -const std::string& NewAliases::local_string() const -{ - return m_local_string; -} - -/*! - * @brief This function returns a reference to member local_string - * @return Reference to member local_string - */ -std::string& NewAliases::local_string() -{ - return m_local_string; -} - - - - -WCharUnion::WCharUnion() -{ - m__d = 'a'; -} - -WCharUnion::~WCharUnion() -{ -} - -WCharUnion::WCharUnion( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } -} - -WCharUnion::WCharUnion( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } -} - -WCharUnion& WCharUnion::operator =( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; -} - -WCharUnion& WCharUnion::operator =( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; -} - -bool WCharUnion::operator ==( - const WCharUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 'a': - return (m_case_zero == x.m_case_zero); - break; - - - case 'b': - return (m_case_one == x.m_case_one); - break; - - default: - break; - } - return false; -} - -bool WCharUnion::operator !=( - const WCharUnion& x) const -{ - return !(*this == x); -} - -void WCharUnion::_d( - wchar_t __d) -{ - bool b = false; - - switch (m__d) - { - case 'a': - switch (__d) - { - case 'a': - b = true; - break; - default: - break; - } - break; - - - case 'b': - switch (__d) - { - case 'b': - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -wchar_t WCharUnion::_d() const -{ - return m__d; -} - -wchar_t& WCharUnion::_d() -{ - return m__d; -} - -void WCharUnion::case_zero( - int32_t _case_zero) -{ - m_case_zero = _case_zero; - m__d = 'a'; - -} - -int32_t WCharUnion::case_zero() const -{ - bool b = false; - - switch (m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_zero; -} - -int32_t& WCharUnion::case_zero() -{ - bool b = false; - - switch (m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_zero; -} - - -void WCharUnion::case_one( - int32_t _case_one) -{ - m_case_one = _case_one; - m__d = 'b'; - -} - -int32_t WCharUnion::case_one() const -{ - bool b = false; - - switch (m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_one; -} - -int32_t& WCharUnion::case_one() -{ - bool b = false; - - switch (m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_one; -} - - - - -OctetUnion::OctetUnion() -{ - m__d = 5; -} - -OctetUnion::~OctetUnion() -{ -} - -OctetUnion::OctetUnion( - const OctetUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } -} - -OctetUnion::OctetUnion( - OctetUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } -} - -OctetUnion& OctetUnion::operator =( - const OctetUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; -} - -OctetUnion& OctetUnion::operator =( - OctetUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; -} - -bool OctetUnion::operator ==( - const OctetUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 5: - return (m_case_five == x.m_case_five); - break; - - - case 7: - return (m_case_seven == x.m_case_seven); - break; - - default: - break; - } - return false; -} - -bool OctetUnion::operator !=( - const OctetUnion& x) const -{ - return !(*this == x); -} - -void OctetUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 5: - switch (__d) - { - case 5: - b = true; - break; - default: - break; - } - break; - - - case 7: - switch (__d) - { - case 7: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t OctetUnion::_d() const -{ - return m__d; -} - -uint8_t& OctetUnion::_d() -{ - return m__d; -} - -void OctetUnion::case_five( - int32_t _case_five) -{ - m_case_five = _case_five; - m__d = 5; - -} - -int32_t OctetUnion::case_five() const -{ - bool b = false; - - switch (m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_five; -} - -int32_t& OctetUnion::case_five() -{ - bool b = false; - - switch (m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_five; -} - - -void OctetUnion::case_seven( - int32_t _case_seven) -{ - m_case_seven = _case_seven; - m__d = 7; - -} - -int32_t OctetUnion::case_seven() const -{ - bool b = false; - - switch (m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_seven; -} - -int32_t& OctetUnion::case_seven() -{ - bool b = false; - - switch (m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_seven; -} - - - - -Int8Union::Int8Union() -{ - m__d = 3; -} - -Int8Union::~Int8Union() -{ -} - -Int8Union::Int8Union( - const Int8Union& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } -} - -Int8Union::Int8Union( - Int8Union&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } -} - -Int8Union& Int8Union::operator =( - const Int8Union& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; -} - -Int8Union& Int8Union::operator =( - Int8Union&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; -} - -bool Int8Union::operator ==( - const Int8Union& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 3: - return (m_case_three == x.m_case_three); - break; - - - case 6: - return (m_case_six == x.m_case_six); - break; - - default: - break; - } - return false; -} - -bool Int8Union::operator !=( - const Int8Union& x) const -{ - return !(*this == x); -} - -void Int8Union::_d( - int8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 3: - switch (__d) - { - case 3: - b = true; - break; - default: - break; - } - break; - - - case 6: - switch (__d) - { - case 6: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int8_t Int8Union::_d() const -{ - return m__d; -} - -int8_t& Int8Union::_d() -{ - return m__d; -} - -void Int8Union::case_three( - int32_t _case_three) -{ - m_case_three = _case_three; - m__d = 3; - -} - -int32_t Int8Union::case_three() const -{ - bool b = false; - - switch (m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_three; -} - -int32_t& Int8Union::case_three() -{ - bool b = false; - - switch (m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_three; -} - - -void Int8Union::case_six( - int32_t _case_six) -{ - m_case_six = _case_six; - m__d = 6; - -} - -int32_t Int8Union::case_six() const -{ - bool b = false; - - switch (m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_six; -} - -int32_t& Int8Union::case_six() -{ - bool b = false; - - switch (m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_six; -} - - -namespace bitmodule { - -ParentBitset::ParentBitset(){ - // Just to register all known types - registernew_features_4_2Types(); -} - -ParentBitset::~ParentBitset() -{ -} - -ParentBitset::ParentBitset( - const ParentBitset& x){ - m_bitset = x.m_bitset; -} - -ParentBitset::ParentBitset( - ParentBitset&& x) noexcept { - m_bitset = x.m_bitset; -} - -ParentBitset& ParentBitset::operator =( - const ParentBitset& x) -{ - - m_bitset = x.m_bitset; - - return *this; -} - -ParentBitset& ParentBitset::operator =( - ParentBitset&& x) noexcept -{ - - m_bitset = x.m_bitset; - - return *this; -} - -bool ParentBitset::operator ==( - const ParentBitset& x) const -{ - - return m_bitset == x.m_bitset; -} - -bool ParentBitset::operator !=( - const ParentBitset& x) const -{ - return !(*this == x); -} - - -void ParentBitset::parent_bitfield( - uint32_t _parent_bitfield) -{ - int base = 0; - int size = 17; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_parent_bitfield & 0x01)); - _parent_bitfield = _parent_bitfield >> 1; - } - -} - -uint32_t ParentBitset::parent_bitfield() const -{ - int base = 0; - int size = 17; - std::bitset<17> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<17> ParentBitset::bitset() const -{ - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<17>(str_value); -} - -void ParentBitset::bitset( - const std::bitset<17>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 17; - m_bitset = std::bitset<17>(str_value.substr(str_value.length() - base_diff, last_post)); -} - -MyBitset::MyBitset() - : bitmodule::ParentBitset(){ - // Just to register all known types - registernew_features_4_2Types(); -} - -MyBitset::~MyBitset() -{ -} - -MyBitset::MyBitset( - const MyBitset& x) - : bitmodule::ParentBitset(x){ - m_bitset = x.m_bitset; -} - -MyBitset::MyBitset( - MyBitset&& x) noexcept - : bitmodule::ParentBitset(std::move(x)){ - m_bitset = x.m_bitset; -} - -MyBitset& MyBitset::operator =( - const MyBitset& x) -{ - bitmodule::ParentBitset::operator =(x); - - m_bitset = x.m_bitset; - - return *this; -} - -MyBitset& MyBitset::operator =( - MyBitset&& x) noexcept -{ - bitmodule::ParentBitset::operator =(std::move(x)); - - m_bitset = x.m_bitset; - - return *this; -} - -bool MyBitset::operator ==( - const MyBitset& x) const -{ - if (bitmodule::ParentBitset::operator !=(x)) return false; - - return m_bitset == x.m_bitset; -} - -bool MyBitset::operator !=( - const MyBitset& x) const -{ - return !(*this == x); -} - - -void MyBitset::a( - char _a) -{ - int base = 0; - int size = 3; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - -} - -char MyBitset::a() const -{ - int base = 0; - int size = 3; - std::bitset<3> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void MyBitset::b( - bool _b) -{ - int base = 3; - m_bitset.set(base, _b); -} - -bool MyBitset::b() const -{ - int base = 3; - return m_bitset.test(base); -} - - - -void MyBitset::c( - uint16_t _c) -{ - int base = 8; - int size = 10; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_c & 0x01)); - _c = _c >> 1; - } - -} - -uint16_t MyBitset::c() const -{ - int base = 8; - int size = 10; - std::bitset<10> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void MyBitset::d( - int16_t _d) -{ - int base = 18; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_d & 0x01)); - _d = _d >> 1; - } - -} - -int16_t MyBitset::d() const -{ - int base = 18; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void MyBitset::e( - int16_t _e) -{ - int base = 23; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_e & 0x01)); - _e = _e >> 1; - } - -} - -int16_t MyBitset::e() const -{ - int base = 23; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void MyBitset::f( - int16_t _f) -{ - int base = 28; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_f & 0x01)); - _f = _f >> 1; - } - -} - -int16_t MyBitset::f() const -{ - int base = 28; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<50> MyBitset::bitset() const -{ - std::string str_value; - - str_value = static_cast(this)->bitset().to_string() + str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<50>(str_value); -} - -void MyBitset::bitset( - const std::bitset<50>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - { - base_diff += 17; - std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); - static_cast(this)->bitset(internal_bitset); - last_post = base_diff; - } - - base_diff += 33; - m_bitset = std::bitset<33>(str_value.substr(str_value.length() - base_diff, last_post)); -} - - - - -BitsetBitmask::BitsetBitmask() -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -BitsetBitmask::~BitsetBitmask() -{ -} - -BitsetBitmask::BitsetBitmask( - const BitsetBitmask& x) -{ - m_mybitset = x.m_mybitset; - m_mybitmask = x.m_mybitmask; -} - -BitsetBitmask::BitsetBitmask( - BitsetBitmask&& x) noexcept -{ - m_mybitset = std::move(x.m_mybitset); - m_mybitmask = std::move(x.m_mybitmask); -} - -BitsetBitmask& BitsetBitmask::operator =( - const BitsetBitmask& x) -{ - - m_mybitset = x.m_mybitset; - m_mybitmask = x.m_mybitmask; - return *this; -} - -BitsetBitmask& BitsetBitmask::operator =( - BitsetBitmask&& x) noexcept -{ - - m_mybitset = std::move(x.m_mybitset); - m_mybitmask = std::move(x.m_mybitmask); - return *this; -} - -bool BitsetBitmask::operator ==( - const BitsetBitmask& x) const -{ - return (m_mybitset == x.m_mybitset && - m_mybitmask == x.m_mybitmask); -} - -bool BitsetBitmask::operator !=( - const BitsetBitmask& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ -void BitsetBitmask::mybitset( - const bitmodule::MyBitset& _mybitset) -{ - m_mybitset = _mybitset; -} - -/*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ -void BitsetBitmask::mybitset( - bitmodule::MyBitset&& _mybitset) -{ - m_mybitset = std::move(_mybitset); -} - -/*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ -const bitmodule::MyBitset& BitsetBitmask::mybitset() const -{ - return m_mybitset; -} - -/*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ -bitmodule::MyBitset& BitsetBitmask::mybitset() -{ - return m_mybitset; -} - - -/*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ -void BitsetBitmask::mybitmask( - const bitmodule::MyBitMask& _mybitmask) -{ - m_mybitmask = _mybitmask; -} - -/*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ -void BitsetBitmask::mybitmask( - bitmodule::MyBitMask&& _mybitmask) -{ - m_mybitmask = std::move(_mybitmask); -} - -/*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ -const bitmodule::MyBitMask& BitsetBitmask::mybitmask() const -{ - return m_mybitmask; -} - -/*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ -bitmodule::MyBitMask& BitsetBitmask::mybitmask() -{ - return m_mybitmask; -} - - - - -BM2::BM2() - : bitmodule::BitsetBitmask() - -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -BM2::~BM2() -{ -} - -BM2::BM2( - const BM2& x) - : bitmodule::BitsetBitmask(x) - -{ - m_two = x.m_two; - m_mylong = x.m_mylong; -} - -BM2::BM2( - BM2&& x) noexcept - : bitmodule::BitsetBitmask(std::move(x)) - -{ - m_two = std::move(x.m_two); - m_mylong = x.m_mylong; -} - -BM2& BM2::operator =( - const BM2& x) -{ - bitmodule::BitsetBitmask::operator =(x); - - m_two = x.m_two; - m_mylong = x.m_mylong; - return *this; -} - -BM2& BM2::operator =( - BM2&& x) noexcept -{ - bitmodule::BitsetBitmask::operator =(std::move(x)); - - m_two = std::move(x.m_two); - m_mylong = x.m_mylong; - return *this; -} - -bool BM2::operator ==( - const BM2& x) const -{ - if (bitmodule::BitsetBitmask::operator !=(x)) - { - return false; - } - return (m_two == x.m_two && - m_mylong == x.m_mylong); -} - -bool BM2::operator !=( - const BM2& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ -void BM2::two( - const bitmodule::MyBitMask& _two) -{ - m_two = _two; -} - -/*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ -void BM2::two( - bitmodule::MyBitMask&& _two) -{ - m_two = std::move(_two); -} - -/*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ -const bitmodule::MyBitMask& BM2::two() const -{ - return m_two; -} - -/*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ -bitmodule::MyBitMask& BM2::two() -{ - return m_two; -} - - -/*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ -void BM2::mylong( - int32_t _mylong) -{ - m_mylong = _mylong; -} - -/*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ -int32_t BM2::mylong() const -{ - return m_mylong; -} - -/*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ -int32_t& BM2::mylong() -{ - return m_mylong; -} - - - - -} // namespace bitmodule - - -StructTest::StructTest() - : NewAliases() - -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -StructTest::~StructTest() -{ -} - -StructTest::StructTest( - const StructTest& x) - : NewAliases(x) - -{ - m_octetUnion = x.m_octetUnion; - m_int8Union = x.m_int8Union; - m_myStructBits = x.m_myStructBits; -} - -StructTest::StructTest( - StructTest&& x) noexcept - : NewAliases(std::move(x)) - -{ - m_octetUnion = std::move(x.m_octetUnion); - m_int8Union = std::move(x.m_int8Union); - m_myStructBits = std::move(x.m_myStructBits); -} - -StructTest& StructTest::operator =( - const StructTest& x) -{ - NewAliases::operator =(x); - - m_octetUnion = x.m_octetUnion; - m_int8Union = x.m_int8Union; - m_myStructBits = x.m_myStructBits; - return *this; -} - -StructTest& StructTest::operator =( - StructTest&& x) noexcept -{ - NewAliases::operator =(std::move(x)); - - m_octetUnion = std::move(x.m_octetUnion); - m_int8Union = std::move(x.m_int8Union); - m_myStructBits = std::move(x.m_myStructBits); - return *this; -} - -bool StructTest::operator ==( - const StructTest& x) const -{ - if (NewAliases::operator !=(x)) - { - return false; - } - return (m_octetUnion == x.m_octetUnion && - m_int8Union == x.m_int8Union && - m_myStructBits == x.m_myStructBits); -} - -bool StructTest::operator !=( - const StructTest& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member octetUnion - * @param _octetUnion New value to be copied in member octetUnion - */ -void StructTest::octetUnion( - const OctetUnion& _octetUnion) -{ - m_octetUnion = _octetUnion; -} - -/*! - * @brief This function moves the value in member octetUnion - * @param _octetUnion New value to be moved in member octetUnion - */ -void StructTest::octetUnion( - OctetUnion&& _octetUnion) -{ - m_octetUnion = std::move(_octetUnion); -} - -/*! - * @brief This function returns a constant reference to member octetUnion - * @return Constant reference to member octetUnion - */ -const OctetUnion& StructTest::octetUnion() const -{ - return m_octetUnion; -} - -/*! - * @brief This function returns a reference to member octetUnion - * @return Reference to member octetUnion - */ -OctetUnion& StructTest::octetUnion() -{ - return m_octetUnion; -} - - -/*! - * @brief This function copies the value in member int8Union - * @param _int8Union New value to be copied in member int8Union - */ -void StructTest::int8Union( - const Int8Union& _int8Union) -{ - m_int8Union = _int8Union; -} - -/*! - * @brief This function moves the value in member int8Union - * @param _int8Union New value to be moved in member int8Union - */ -void StructTest::int8Union( - Int8Union&& _int8Union) -{ - m_int8Union = std::move(_int8Union); -} - -/*! - * @brief This function returns a constant reference to member int8Union - * @return Constant reference to member int8Union - */ -const Int8Union& StructTest::int8Union() const -{ - return m_int8Union; -} - -/*! - * @brief This function returns a reference to member int8Union - * @return Reference to member int8Union - */ -Int8Union& StructTest::int8Union() -{ - return m_int8Union; -} - - -/*! - * @brief This function copies the value in member myStructBits - * @param _myStructBits New value to be copied in member myStructBits - */ -void StructTest::myStructBits( - const bitmodule::BM2& _myStructBits) -{ - m_myStructBits = _myStructBits; -} - -/*! - * @brief This function moves the value in member myStructBits - * @param _myStructBits New value to be moved in member myStructBits - */ -void StructTest::myStructBits( - bitmodule::BM2&& _myStructBits) -{ - m_myStructBits = std::move(_myStructBits); -} - -/*! - * @brief This function returns a constant reference to member myStructBits - * @return Constant reference to member myStructBits - */ -const bitmodule::BM2& StructTest::myStructBits() const -{ - return m_myStructBits; -} - -/*! - * @brief This function returns a reference to member myStructBits - * @return Reference to member myStructBits - */ -bitmodule::BM2& StructTest::myStructBits() -{ - return m_myStructBits; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "new_features_4_2CdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.h b/test/unittest/dynamic_types/idl/new_features_4_2.h deleted file mode 100644 index de85dadf42c..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2.h +++ /dev/null @@ -1,1380 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "new_features_4_2v1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NEW_FEATURES_4_2_SOURCE) -#define NEW_FEATURES_4_2_DllAPI __declspec( dllexport ) -#else -#define NEW_FEATURES_4_2_DllAPI __declspec( dllimport ) -#endif // NEW_FEATURES_4_2_SOURCE -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure NewAliases defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NewAliases(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NewAliases(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - const NewAliases& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - NewAliases&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - const NewAliases& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - NewAliases&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator ==( - const NewAliases& x) const; - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator !=( - const NewAliases& x) const; - - /*! - * @brief This function sets a value in member int8_ - * @param _int8_ New value for member int8_ - */ - eProsima_user_DllExport void int8_( - int8_t _int8_); - - /*! - * @brief This function returns the value of member int8_ - * @return Value of member int8_ - */ - eProsima_user_DllExport int8_t int8_() const; - - /*! - * @brief This function returns a reference to member int8_ - * @return Reference to member int8_ - */ - eProsima_user_DllExport int8_t& int8_(); - - - /*! - * @brief This function sets a value in member uint8_ - * @param _uint8_ New value for member uint8_ - */ - eProsima_user_DllExport void uint8_( - uint8_t _uint8_); - - /*! - * @brief This function returns the value of member uint8_ - * @return Value of member uint8_ - */ - eProsima_user_DllExport uint8_t uint8_() const; - - /*! - * @brief This function returns a reference to member uint8_ - * @return Reference to member uint8_ - */ - eProsima_user_DllExport uint8_t& uint8_(); - - - /*! - * @brief This function sets a value in member int16_ - * @param _int16_ New value for member int16_ - */ - eProsima_user_DllExport void int16_( - int16_t _int16_); - - /*! - * @brief This function returns the value of member int16_ - * @return Value of member int16_ - */ - eProsima_user_DllExport int16_t int16_() const; - - /*! - * @brief This function returns a reference to member int16_ - * @return Reference to member int16_ - */ - eProsima_user_DllExport int16_t& int16_(); - - - /*! - * @brief This function sets a value in member uint16_ - * @param _uint16_ New value for member uint16_ - */ - eProsima_user_DllExport void uint16_( - uint16_t _uint16_); - - /*! - * @brief This function returns the value of member uint16_ - * @return Value of member uint16_ - */ - eProsima_user_DllExport uint16_t uint16_() const; - - /*! - * @brief This function returns a reference to member uint16_ - * @return Reference to member uint16_ - */ - eProsima_user_DllExport uint16_t& uint16_(); - - - /*! - * @brief This function sets a value in member int32_ - * @param _int32_ New value for member int32_ - */ - eProsima_user_DllExport void int32_( - int32_t _int32_); - - /*! - * @brief This function returns the value of member int32_ - * @return Value of member int32_ - */ - eProsima_user_DllExport int32_t int32_() const; - - /*! - * @brief This function returns a reference to member int32_ - * @return Reference to member int32_ - */ - eProsima_user_DllExport int32_t& int32_(); - - - /*! - * @brief This function sets a value in member uint32_ - * @param _uint32_ New value for member uint32_ - */ - eProsima_user_DllExport void uint32_( - uint32_t _uint32_); - - /*! - * @brief This function returns the value of member uint32_ - * @return Value of member uint32_ - */ - eProsima_user_DllExport uint32_t uint32_() const; - - /*! - * @brief This function returns a reference to member uint32_ - * @return Reference to member uint32_ - */ - eProsima_user_DllExport uint32_t& uint32_(); - - - /*! - * @brief This function sets a value in member int64_ - * @param _int64_ New value for member int64_ - */ - eProsima_user_DllExport void int64_( - int64_t _int64_); - - /*! - * @brief This function returns the value of member int64_ - * @return Value of member int64_ - */ - eProsima_user_DllExport int64_t int64_() const; - - /*! - * @brief This function returns a reference to member int64_ - * @return Reference to member int64_ - */ - eProsima_user_DllExport int64_t& int64_(); - - - /*! - * @brief This function sets a value in member uint64_ - * @param _uint64_ New value for member uint64_ - */ - eProsima_user_DllExport void uint64_( - uint64_t _uint64_); - - /*! - * @brief This function returns the value of member uint64_ - * @return Value of member uint64_ - */ - eProsima_user_DllExport uint64_t uint64_() const; - - /*! - * @brief This function returns a reference to member uint64_ - * @return Reference to member uint64_ - */ - eProsima_user_DllExport uint64_t& uint64_(); - - - /*! - * @brief This function copies the value in member local_string - * @param _local_string New value to be copied in member local_string - */ - eProsima_user_DllExport void local_string( - const std::string& _local_string); - - /*! - * @brief This function moves the value in member local_string - * @param _local_string New value to be moved in member local_string - */ - eProsima_user_DllExport void local_string( - std::string&& _local_string); - - /*! - * @brief This function returns a constant reference to member local_string - * @return Constant reference to member local_string - */ - eProsima_user_DllExport const std::string& local_string() const; - - /*! - * @brief This function returns a reference to member local_string - * @return Reference to member local_string - */ - eProsima_user_DllExport std::string& local_string(); - -private: - - int8_t m_int8_{0}; - uint8_t m_uint8_{0}; - int16_t m_int16_{0}; - uint16_t m_uint16_{0}; - int32_t m_int32_{0}; - uint32_t m_uint32_{0}; - int64_t m_int64_{0}; - uint64_t m_uint64_{555}; - std::string m_local_string; - -}; - - -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - wchar_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport wchar_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d(); - - /*! - * @brief This function sets a value in member case_zero - * @param _case_zero New value for member case_zero - */ - eProsima_user_DllExport void case_zero( - int32_t _case_zero); - - /*! - * @brief This function returns the value of member case_zero - * @return Value of member case_zero - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_zero() const; - - /*! - * @brief This function returns a reference to member case_zero - * @return Reference to member case_zero - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_zero(); - - - /*! - * @brief This function sets a value in member case_one - * @param _case_one New value for member case_one - */ - eProsima_user_DllExport void case_one( - int32_t _case_one); - - /*! - * @brief This function returns the value of member case_one - * @return Value of member case_one - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_one() const; - - /*! - * @brief This function returns a reference to member case_one - * @return Reference to member case_one - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_one(); - -private: - - wchar_t m__d; - - int32_t m_case_zero{0}; - int32_t m_case_one{0}; -}; - - -/*! - * @brief This class represents the union OctetUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class OctetUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - const OctetUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - OctetUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - const OctetUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - OctetUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member case_five - * @param _case_five New value for member case_five - */ - eProsima_user_DllExport void case_five( - int32_t _case_five); - - /*! - * @brief This function returns the value of member case_five - * @return Value of member case_five - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_five() const; - - /*! - * @brief This function returns a reference to member case_five - * @return Reference to member case_five - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_five(); - - - /*! - * @brief This function sets a value in member case_seven - * @param _case_seven New value for member case_seven - */ - eProsima_user_DllExport void case_seven( - int32_t _case_seven); - - /*! - * @brief This function returns the value of member case_seven - * @return Value of member case_seven - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_seven() const; - - /*! - * @brief This function returns a reference to member case_seven - * @return Reference to member case_seven - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_seven(); - -private: - - uint8_t m__d; - - int32_t m_case_five{0}; - int32_t m_case_seven{0}; -}; - - -/*! - * @brief This class represents the union Int8Union defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class Int8Union -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Int8Union(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Int8Union(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - const Int8Union& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - Int8Union&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - const Int8Union& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - Int8Union&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Int8Union& x) const; - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Int8Union& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int8_t& _d(); - - /*! - * @brief This function sets a value in member case_three - * @param _case_three New value for member case_three - */ - eProsima_user_DllExport void case_three( - int32_t _case_three); - - /*! - * @brief This function returns the value of member case_three - * @return Value of member case_three - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_three() const; - - /*! - * @brief This function returns a reference to member case_three - * @return Reference to member case_three - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_three(); - - - /*! - * @brief This function sets a value in member case_six - * @param _case_six New value for member case_six - */ - eProsima_user_DllExport void case_six( - int32_t _case_six); - - /*! - * @brief This function returns the value of member case_six - * @return Value of member case_six - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_six() const; - - /*! - * @brief This function returns a reference to member case_six - * @return Reference to member case_six - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_six(); - -private: - - int8_t m__d; - - int32_t m_case_three{0}; - int32_t m_case_six{0}; -}; -namespace bitmodule { - -/*! - * @brief This class represents the structure ParentBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class ParentBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ParentBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ParentBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - const ParentBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - ParentBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - const ParentBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - ParentBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ParentBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ParentBitset& x) const; - - /*! - * @brief This function sets a value in member parent_bitfield - * @param _parent_bitfield New value for member parent_bitfield - */ - eProsima_user_DllExport void parent_bitfield( - uint32_t _parent_bitfield); - - /*! - * @brief This function returns the value of member parent_bitfield - * @return Value of member parent_bitfield - */ - eProsima_user_DllExport uint32_t parent_bitfield() const; - - - eProsima_user_DllExport std::bitset<17> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<17>&); - - - -private: - - std::bitset<17> m_bitset; -}; -/*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class MyBitset : public bitmodule::ParentBitset -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - char _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport char a() const; - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - bool _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport bool b() const; - - - - /*! - * @brief This function sets a value in member c - * @param _c New value for member c - */ - eProsima_user_DllExport void c( - uint16_t _c); - - /*! - * @brief This function returns the value of member c - * @return Value of member c - */ - eProsima_user_DllExport uint16_t c() const; - - - /*! - * @brief This function sets a value in member d - * @param _d New value for member d - */ - eProsima_user_DllExport void d( - int16_t _d); - - /*! - * @brief This function returns the value of member d - * @return Value of member d - */ - eProsima_user_DllExport int16_t d() const; - - - /*! - * @brief This function sets a value in member e - * @param _e New value for member e - */ - eProsima_user_DllExport void e( - int16_t _e); - - /*! - * @brief This function returns the value of member e - * @return Value of member e - */ - eProsima_user_DllExport int16_t e() const; - - - /*! - * @brief This function sets a value in member f - * @param _f New value for member f - */ - eProsima_user_DllExport void f( - int16_t _f); - - /*! - * @brief This function returns the value of member f - * @return Value of member f - */ - eProsima_user_DllExport int16_t f() const; - - - eProsima_user_DllExport std::bitset<50> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<50>&); - - - -private: - - std::bitset<33> m_bitset; -}; -/*! - * @brief This enumeration represents the MyBitMask bitflags defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -enum MyBitMaskBits : uint8_t -{ - flag0 = 0x01ull << 0, - flag1 = 0x01ull << 1, - flag4 = 0x01ull << 4, - flag6 = 0x01ull << 6, - flag7 = 0x01ull << 7 -}; -typedef uint8_t MyBitMask; - - -/*! - * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class BitsetBitmask -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetBitmask(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetBitmask(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - const BitsetBitmask& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - const BitsetBitmask& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetBitmask& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetBitmask& x) const; - - /*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ - eProsima_user_DllExport void mybitset( - const bitmodule::MyBitset& _mybitset); - - /*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ - eProsima_user_DllExport void mybitset( - bitmodule::MyBitset&& _mybitset); - - /*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ - eProsima_user_DllExport const bitmodule::MyBitset& mybitset() const; - - /*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ - eProsima_user_DllExport bitmodule::MyBitset& mybitset(); - - - /*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - const bitmodule::MyBitMask& _mybitmask); - - /*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - bitmodule::MyBitMask&& _mybitmask); - - /*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ - eProsima_user_DllExport const bitmodule::MyBitMask& mybitmask() const; - - /*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ - eProsima_user_DllExport bitmodule::MyBitMask& mybitmask(); - -private: - - bitmodule::MyBitset m_mybitset; - bitmodule::MyBitMask m_mybitmask{0}; - -}; - - -/*! - * @brief This class represents the structure BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class BM2 : public bitmodule::BitsetBitmask -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BM2(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BM2(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - const BM2& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - BM2&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - const BM2& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - BM2&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BM2& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BM2& x) const; - - /*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ - eProsima_user_DllExport void two( - const bitmodule::MyBitMask& _two); - - /*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ - eProsima_user_DllExport void two( - bitmodule::MyBitMask&& _two); - - /*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ - eProsima_user_DllExport const bitmodule::MyBitMask& two() const; - - /*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ - eProsima_user_DllExport bitmodule::MyBitMask& two(); - - - /*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ - eProsima_user_DllExport void mylong( - int32_t _mylong); - - /*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ - eProsima_user_DllExport int32_t mylong() const; - - /*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ - eProsima_user_DllExport int32_t& mylong(); - -private: - - bitmodule::MyBitMask m_two{0}; - int32_t m_mylong{0}; - -}; - -} // namespace bitmodule - - -/*! - * @brief This class represents the structure StructTest defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class StructTest : public NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructTest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructTest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - const StructTest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - StructTest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - const StructTest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - StructTest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructTest& x) const; - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructTest& x) const; - - /*! - * @brief This function copies the value in member octetUnion - * @param _octetUnion New value to be copied in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - const OctetUnion& _octetUnion); - - /*! - * @brief This function moves the value in member octetUnion - * @param _octetUnion New value to be moved in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - OctetUnion&& _octetUnion); - - /*! - * @brief This function returns a constant reference to member octetUnion - * @return Constant reference to member octetUnion - */ - eProsima_user_DllExport const OctetUnion& octetUnion() const; - - /*! - * @brief This function returns a reference to member octetUnion - * @return Reference to member octetUnion - */ - eProsima_user_DllExport OctetUnion& octetUnion(); - - - /*! - * @brief This function copies the value in member int8Union - * @param _int8Union New value to be copied in member int8Union - */ - eProsima_user_DllExport void int8Union( - const Int8Union& _int8Union); - - /*! - * @brief This function moves the value in member int8Union - * @param _int8Union New value to be moved in member int8Union - */ - eProsima_user_DllExport void int8Union( - Int8Union&& _int8Union); - - /*! - * @brief This function returns a constant reference to member int8Union - * @return Constant reference to member int8Union - */ - eProsima_user_DllExport const Int8Union& int8Union() const; - - /*! - * @brief This function returns a reference to member int8Union - * @return Reference to member int8Union - */ - eProsima_user_DllExport Int8Union& int8Union(); - - - /*! - * @brief This function copies the value in member myStructBits - * @param _myStructBits New value to be copied in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - const bitmodule::BM2& _myStructBits); - - /*! - * @brief This function moves the value in member myStructBits - * @param _myStructBits New value to be moved in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - bitmodule::BM2&& _myStructBits); - - /*! - * @brief This function returns a constant reference to member myStructBits - * @return Constant reference to member myStructBits - */ - eProsima_user_DllExport const bitmodule::BM2& myStructBits() const; - - /*! - * @brief This function returns a reference to member myStructBits - * @return Reference to member myStructBits - */ - eProsima_user_DllExport bitmodule::BM2& myStructBits(); - -private: - - OctetUnion m_octetUnion; - Int8Union m_int8Union; - bitmodule::BM2 m_myStructBits; - -}; - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.idl b/test/unittest/dynamic_types/idl/new_features_4_2.idl deleted file mode 100644 index 533096f4353..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2.idl +++ /dev/null @@ -1,85 +0,0 @@ -struct NewAliases -{ - int8 int8_; - uint8 uint8_; - int16 int16_; - uint16 uint16_; - int32 int32_; - uint32 uint32_; - int64 int64_; - @default(555) uint64 uint64_; - @non_serialized string local_string; -}; - -union WCharUnion switch (wchar) -{ - case 'a': - long case_zero; - case 'b': - long case_one; -}; - -union OctetUnion switch (octet) -{ - case 5: - long case_five; - case 7: - long case_seven; -}; - - -union Int8Union switch (int8) -{ - case 3: - long case_three; - case 6: - long case_six; -}; - -module bitmodule -{ - bitset ParentBitset - { - bitfield<17> parent_bitfield; - }; - - bitset MyBitset : ParentBitset - { - bitfield<3> a; - bitfield<1> b; - bitfield<4>; - bitfield<10> c; - bitfield<5, short> d, e, f; - }; - - @bit_bound(8) - bitmask MyBitMask - { - @position(0) flag0, - @position(1) flag1, - @position(4) flag4, - @position(6) flag6, - flag7 - }; - - - struct BitsetBitmask - { - MyBitset mybitset; - MyBitMask mybitmask; - }; - - struct BM2 : BitsetBitmask - { - MyBitMask two; - long mylong; - }; -}; - -struct StructTest : NewAliases -{ - //WCharUnion charUnion; //TODO(richiware) Remove when xtype 1.3. Uncomment also in DynamicTypes_4_2_Tests.cpp - OctetUnion octetUnion; - Int8Union int8Union; - bitmodule::BM2 myStructBits; -}; diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp deleted file mode 100644 index 213ee811979..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2CdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ - -#include "new_features_4_2.h" - -constexpr uint32_t bitmodule_BM2_max_cdr_typesize {24UL}; -constexpr uint32_t bitmodule_BM2_max_key_cdr_typesize {0UL}; - -constexpr uint32_t NewAliases_max_cdr_typesize {40UL}; -constexpr uint32_t NewAliases_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t StructTest_max_cdr_typesize {88UL}; -constexpr uint32_t StructTest_max_key_cdr_typesize {0UL}; - - - - -constexpr uint32_t bitmodule_BitsetBitmask_max_cdr_typesize {17UL}; -constexpr uint32_t bitmodule_BitsetBitmask_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const NewAliases& data); - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BitsetBitmask& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BM2& data); - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructTest& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp deleted file mode 100644 index 55ea9cc4dd5..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp +++ /dev/null @@ -1,941 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2CdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ - -#include "new_features_4_2CdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const NewAliases& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.int8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.uint8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.int16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.uint16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.int32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.uint32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.int64_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.uint64_(), current_alignment); - - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const NewAliases& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.int8_() - << eprosima::fastcdr::MemberId(1) << data.uint8_() - << eprosima::fastcdr::MemberId(2) << data.int16_() - << eprosima::fastcdr::MemberId(3) << data.uint16_() - << eprosima::fastcdr::MemberId(4) << data.int32_() - << eprosima::fastcdr::MemberId(5) << data.uint32_() - << eprosima::fastcdr::MemberId(6) << data.int64_() - << eprosima::fastcdr::MemberId(7) << data.uint64_() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - NewAliases& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.int8_(); - break; - - case 1: - dcdr >> data.uint8_(); - break; - - case 2: - dcdr >> data.int16_(); - break; - - case 3: - dcdr >> data.uint16_(); - break; - - case 4: - dcdr >> data.int32_(); - break; - - case 5: - dcdr >> data.uint32_(); - break; - - case 6: - dcdr >> data.int64_(); - break; - - case 7: - dcdr >> data.uint64_(); - break; - - case 8: - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const NewAliases& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WCharUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case 'a': - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.case_zero(), current_alignment); - break; - - case 'b': - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_one(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WCharUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case 'a': - scdr << eprosima::fastcdr::MemberId(1) << data.case_zero(); - break; - - case 'b': - scdr << eprosima::fastcdr::MemberId(2) << data.case_one(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WCharUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case 'a': - dcdr >> data.case_zero(); - break; - - case 'b': - dcdr >> data.case_one(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const OctetUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case 5: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.case_five(), current_alignment); - break; - - case 7: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_seven(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const OctetUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case 5: - scdr << eprosima::fastcdr::MemberId(1) << data.case_five(); - break; - - case 7: - scdr << eprosima::fastcdr::MemberId(2) << data.case_seven(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - OctetUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case 5: - dcdr >> data.case_five(); - break; - - case 7: - dcdr >> data.case_seven(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const Int8Union& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case 3: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.case_three(), current_alignment); - break; - - case 6: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.case_six(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const Int8Union& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case 3: - scdr << eprosima::fastcdr::MemberId(1) << data.case_three(); - break; - - case 6: - scdr << eprosima::fastcdr::MemberId(2) << data.case_six(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - Int8Union& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case 3: - dcdr >> data.case_three(); - break; - - case 6: - dcdr >> data.case_six(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::ParentBitset& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::ParentBitset& data) -{ - using namespace bitmodule; - - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - bitmodule::ParentBitset& data) -{ - using namespace bitmodule; - - std::bitset<17> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::MyBitset& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - return calculator.calculate_serialized_size(data.bitset(), current_alignment); -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::MyBitset& data) -{ - using namespace bitmodule; - - scdr << data.bitset(); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& dcdr, - bitmodule::MyBitset& data) -{ - using namespace bitmodule; - - std::bitset<50> bitset; - dcdr >> bitset; - data.bitset(bitset); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::BitsetBitmask& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.mybitset(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.mybitmask(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.mybitset() - << eprosima::fastcdr::MemberId(1) << data.mybitmask() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.mybitset(); - break; - - case 1: - dcdr >> data.mybitmask(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BitsetBitmask& data) -{ - using namespace bitmodule; - - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const bitmodule::BM2& data, - size_t& current_alignment) -{ - using namespace bitmodule; - - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.mybitset(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.mybitmask(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.two(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.mylong(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BM2& data) -{ - using namespace bitmodule; - - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.mybitset() - << eprosima::fastcdr::MemberId(1) << data.mybitmask() - << eprosima::fastcdr::MemberId(2) << data.two() - << eprosima::fastcdr::MemberId(3) << data.mylong() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - bitmodule::BM2& data) -{ - using namespace bitmodule; - - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.mybitset(); - break; - - case 1: - dcdr >> data.mybitmask(); - break; - - case 2: - dcdr >> data.two(); - break; - - case 3: - dcdr >> data.mylong(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const bitmodule::BM2& data) -{ - using namespace bitmodule; - - static_cast(scdr); - static_cast(data); -} - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StructTest& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.int8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.uint8_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.int16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.uint16_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.int32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), - data.uint32_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), - data.int64_(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), - data.uint64_(), current_alignment); - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), - data.octetUnion(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), - data.int8Union(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), - data.myStructBits(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StructTest& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.int8_() - << eprosima::fastcdr::MemberId(1) << data.uint8_() - << eprosima::fastcdr::MemberId(2) << data.int16_() - << eprosima::fastcdr::MemberId(3) << data.uint16_() - << eprosima::fastcdr::MemberId(4) << data.int32_() - << eprosima::fastcdr::MemberId(5) << data.uint32_() - << eprosima::fastcdr::MemberId(6) << data.int64_() - << eprosima::fastcdr::MemberId(7) << data.uint64_() - << eprosima::fastcdr::MemberId(9) << data.octetUnion() - << eprosima::fastcdr::MemberId(10) << data.int8Union() - << eprosima::fastcdr::MemberId(11) << data.myStructBits() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StructTest& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.int8_(); - break; - - case 1: - dcdr >> data.uint8_(); - break; - - case 2: - dcdr >> data.int16_(); - break; - - case 3: - dcdr >> data.uint16_(); - break; - - case 4: - dcdr >> data.int32_(); - break; - - case 5: - dcdr >> data.uint32_(); - break; - - case 6: - dcdr >> data.int64_(); - break; - - case 7: - dcdr >> data.uint64_(); - break; - - case 8: - break; - - case 9: - dcdr >> data.octetUnion(); - break; - - case 10: - dcdr >> data.int8Union(); - break; - - case 11: - dcdr >> data.myStructBits(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StructTest& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx deleted file mode 100644 index 61982d3150e..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx +++ /dev/null @@ -1,807 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2PubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "new_features_4_2PubSubTypes.h" -#include "new_features_4_2CdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - -NewAliasesPubSubType::NewAliasesPubSubType() -{ - setName("NewAliases"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(NewAliases::getMaxCdrSerializedSize()); -#else - NewAliases_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 = NewAliases_max_key_cdr_typesize > 16 ? NewAliases_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -NewAliasesPubSubType::~NewAliasesPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool NewAliasesPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - NewAliases* 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; - } - 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 NewAliasesPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - NewAliases* 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 NewAliasesPubSubType::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* NewAliasesPubSubType::createData() -{ - return reinterpret_cast(new NewAliases()); -} - -void NewAliasesPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool NewAliasesPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - NewAliases* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - NewAliases_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 || NewAliases_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; -} - - - - - - - - - - - - - -namespace bitmodule { - - - BitsetBitmaskPubSubType::BitsetBitmaskPubSubType() - { - setName("bitmodule::BitsetBitmask"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(BitsetBitmask::getMaxCdrSerializedSize()); - #else - bitmodule_BitsetBitmask_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 = bitmodule_BitsetBitmask_max_key_cdr_typesize > 16 ? bitmodule_BitsetBitmask_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BitsetBitmaskPubSubType::~BitsetBitmaskPubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BitsetBitmaskPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - BitsetBitmask* 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; - } - 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 BitsetBitmaskPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - BitsetBitmask* 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 BitsetBitmaskPubSubType::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* BitsetBitmaskPubSubType::createData() - { - return reinterpret_cast(new BitsetBitmask()); - } - - void BitsetBitmaskPubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BitsetBitmaskPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BitsetBitmask* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - bitmodule_BitsetBitmask_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 || bitmodule_BitsetBitmask_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; - } - - - - BM2PubSubType::BM2PubSubType() - { - setName("bitmodule::BM2"); - uint32_t type_size = - #if FASTCDR_VERSION_MAJOR == 1 - static_cast(BM2::getMaxCdrSerializedSize()); - #else - bitmodule_BM2_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 = bitmodule_BM2_max_key_cdr_typesize > 16 ? bitmodule_BM2_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); - } - - BM2PubSubType::~BM2PubSubType() - { - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } - } - - bool BM2PubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) - { - BM2* 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; - } - 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 BM2PubSubType::deserialize( - SerializedPayload_t* payload, - void* data) - { - try - { - // Convert DATA to pointer of your type - BM2* 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 BM2PubSubType::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* BM2PubSubType::createData() - { - return reinterpret_cast(new BM2()); - } - - void BM2PubSubType::deleteData( - void* data) - { - delete(reinterpret_cast(data)); - } - - bool BM2PubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) - { - if (!m_isGetKeyDefined) - { - return false; - } - - BM2* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - bitmodule_BM2_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 || bitmodule_BM2_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 bitmodule - - - -StructTestPubSubType::StructTestPubSubType() -{ - setName("StructTest"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StructTest::getMaxCdrSerializedSize()); -#else - StructTest_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 = StructTest_max_key_cdr_typesize > 16 ? StructTest_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StructTestPubSubType::~StructTestPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StructTestPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StructTest* 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; - } - 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 StructTestPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StructTest* 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 StructTestPubSubType::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* StructTestPubSubType::createData() -{ - return reinterpret_cast(new StructTest()); -} - -void StructTestPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StructTestPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StructTest* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StructTest_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 || StructTest_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; -} - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h deleted file mode 100644 index 03f413ae74f..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2PubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "new_features_4_2.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated new_features_4_2 is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - - - - -/*! - * @brief This class represents the TopicDataType of the type NewAliases defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class NewAliasesPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef NewAliases type; - - eProsima_user_DllExport NewAliasesPubSubType(); - - eProsima_user_DllExport ~NewAliasesPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - -namespace bitmodule -{ - - - - /*! - * @brief This class represents the TopicDataType of the type BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BitsetBitmaskPubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef BitsetBitmask type; - - eProsima_user_DllExport BitsetBitmaskPubSubType(); - - eProsima_user_DllExport ~BitsetBitmaskPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - - #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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; - - - - /*! - * @brief This class represents the TopicDataType of the type BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BM2PubSubType : public eprosima::fastdds::dds::TopicDataType - { - public: - - typedef BM2 type; - - eProsima_user_DllExport BM2PubSubType(); - - eProsima_user_DllExport ~BM2PubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - - #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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - - #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - - }; -} - - - -/*! - * @brief This class represents the TopicDataType of the type StructTest defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class StructTestPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StructTest type; - - eProsima_user_DllExport StructTestPubSubType(); - - eProsima_user_DllExport ~StructTestPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_PUBSUBTYPES_H_ - diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx deleted file mode 100644 index 32f204ac131..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx +++ /dev/null @@ -1,3276 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2TypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "new_features_4_2.h" -#include "new_features_4_2TypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registernew_features_4_2Types() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("NewAliases", GetNewAliasesIdentifier(true), - GetNewAliasesObject(true)); - factory->add_type_object("NewAliases", GetNewAliasesIdentifier(false), - GetNewAliasesObject(false)); - - - factory->add_type_object("WCharUnion", GetWCharUnionIdentifier(true), - GetWCharUnionObject(true)); - factory->add_type_object("WCharUnion", GetWCharUnionIdentifier(false), - GetWCharUnionObject(false)); - - - factory->add_type_object("OctetUnion", GetOctetUnionIdentifier(true), - GetOctetUnionObject(true)); - factory->add_type_object("OctetUnion", GetOctetUnionIdentifier(false), - GetOctetUnionObject(false)); - - - factory->add_type_object("Int8Union", GetInt8UnionIdentifier(true), - GetInt8UnionObject(true)); - factory->add_type_object("Int8Union", GetInt8UnionIdentifier(false), - GetInt8UnionObject(false)); - - - factory->add_type_object("bitmodule::ParentBitset", bitmodule::GetParentBitsetIdentifier(true), - bitmodule::GetParentBitsetObject(true)); - factory->add_type_object("bitmodule::ParentBitset", bitmodule::GetParentBitsetIdentifier(false), - bitmodule::GetParentBitsetObject(false)); - - - factory->add_type_object("bitmodule::MyBitset", bitmodule::GetMyBitsetIdentifier(true), - bitmodule::GetMyBitsetObject(true)); - factory->add_type_object("bitmodule::MyBitset", bitmodule::GetMyBitsetIdentifier(false), - bitmodule::GetMyBitsetObject(false)); - - - factory->add_type_object("bitmodule::MyBitMask", bitmodule::GetMyBitMaskIdentifier(true), - bitmodule::GetMyBitMaskObject(true)); - factory->add_type_object("bitmodule::MyBitMask", bitmodule::GetMyBitMaskIdentifier(false), - bitmodule::GetMyBitMaskObject(false)); - - - factory->add_type_object("bitmodule::BitsetBitmask", bitmodule::GetBitsetBitmaskIdentifier(true), - bitmodule::GetBitsetBitmaskObject(true)); - factory->add_type_object("bitmodule::BitsetBitmask", bitmodule::GetBitsetBitmaskIdentifier(false), - bitmodule::GetBitsetBitmaskObject(false)); - - - factory->add_type_object("bitmodule::BM2", bitmodule::GetBM2Identifier(true), - bitmodule::GetBM2Object(true)); - factory->add_type_object("bitmodule::BM2", bitmodule::GetBM2Identifier(false), - bitmodule::GetBM2Object(false)); - - - - factory->add_type_object("StructTest", GetStructTestIdentifier(true), - GetStructTestObject(true)); - factory->add_type_object("StructTest", GetStructTestIdentifier(false), - GetStructTestObject(false)); - - }); -} - - - -const TypeIdentifier* GetNewAliasesIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("NewAliases", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetNewAliasesObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("NewAliases", complete); -} - -const TypeObject* GetNewAliasesObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("NewAliases", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteNewAliasesObject(); - } - //else - return GetMinimalNewAliasesObject(); -} - -const TypeObject* GetMinimalNewAliasesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("NewAliases", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_int8_; - mst_int8_.common().member_id(memberId++); - mst_int8_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int8_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int8_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int8_.common().member_flags().IS_OPTIONAL(false); - mst_int8_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int8_.common().member_flags().IS_KEY(false); - mst_int8_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int8_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int8_t", false)); - - - MD5 int8__hash("int8_"); - for(int i = 0; i < 4; ++i) - { - mst_int8_.detail().name_hash()[i] = int8__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int8_); - - MinimalStructMember mst_uint8_; - mst_uint8_.common().member_id(memberId++); - mst_uint8_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint8_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint8_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint8_.common().member_flags().IS_OPTIONAL(false); - mst_uint8_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint8_.common().member_flags().IS_KEY(false); - mst_uint8_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint8_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 uint8__hash("uint8_"); - for(int i = 0; i < 4; ++i) - { - mst_uint8_.detail().name_hash()[i] = uint8__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint8_); - - MinimalStructMember mst_int16_; - mst_int16_.common().member_id(memberId++); - mst_int16_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int16_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int16_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int16_.common().member_flags().IS_OPTIONAL(false); - mst_int16_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int16_.common().member_flags().IS_KEY(false); - mst_int16_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int16_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - MD5 int16__hash("int16_"); - for(int i = 0; i < 4; ++i) - { - mst_int16_.detail().name_hash()[i] = int16__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int16_); - - MinimalStructMember mst_uint16_; - mst_uint16_.common().member_id(memberId++); - mst_uint16_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint16_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint16_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint16_.common().member_flags().IS_OPTIONAL(false); - mst_uint16_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint16_.common().member_flags().IS_KEY(false); - mst_uint16_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint16_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - MD5 uint16__hash("uint16_"); - for(int i = 0; i < 4; ++i) - { - mst_uint16_.detail().name_hash()[i] = uint16__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint16_); - - MinimalStructMember mst_int32_; - mst_int32_.common().member_id(memberId++); - mst_int32_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int32_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int32_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int32_.common().member_flags().IS_OPTIONAL(false); - mst_int32_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int32_.common().member_flags().IS_KEY(false); - mst_int32_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int32_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 int32__hash("int32_"); - for(int i = 0; i < 4; ++i) - { - mst_int32_.detail().name_hash()[i] = int32__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int32_); - - MinimalStructMember mst_uint32_; - mst_uint32_.common().member_id(memberId++); - mst_uint32_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint32_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint32_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint32_.common().member_flags().IS_OPTIONAL(false); - mst_uint32_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint32_.common().member_flags().IS_KEY(false); - mst_uint32_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint32_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 uint32__hash("uint32_"); - for(int i = 0; i < 4; ++i) - { - mst_uint32_.detail().name_hash()[i] = uint32__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint32_); - - MinimalStructMember mst_int64_; - mst_int64_.common().member_id(memberId++); - mst_int64_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int64_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int64_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int64_.common().member_flags().IS_OPTIONAL(false); - mst_int64_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int64_.common().member_flags().IS_KEY(false); - mst_int64_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int64_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - MD5 int64__hash("int64_"); - for(int i = 0; i < 4; ++i) - { - mst_int64_.detail().name_hash()[i] = int64__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int64_); - - MinimalStructMember mst_uint64_; - mst_uint64_.common().member_id(memberId++); - mst_uint64_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_uint64_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_uint64_.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_uint64_.common().member_flags().IS_OPTIONAL(false); - mst_uint64_.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_uint64_.common().member_flags().IS_KEY(false); - mst_uint64_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_uint64_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - MD5 uint64__hash("uint64_"); - for(int i = 0; i < 4; ++i) - { - mst_uint64_.detail().name_hash()[i] = uint64__hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_uint64_); - - MinimalStructMember mst_local_string; - mst_local_string.common().member_id(memberId++); - mst_local_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_local_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_local_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_local_string.common().member_flags().IS_OPTIONAL(false); - mst_local_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_local_string.common().member_flags().IS_KEY(false); - mst_local_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_local_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 local_string_hash("local_string"); - for(int i = 0; i < 4; ++i) - { - mst_local_string.detail().name_hash()[i] = local_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_local_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("NewAliases", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("NewAliases", false); -} - -const TypeObject* GetCompleteNewAliasesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("NewAliases", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_int8_; - cst_int8_.common().member_id(memberId++); - cst_int8_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int8_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int8_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int8_.common().member_flags().IS_OPTIONAL(false); - cst_int8_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int8_.common().member_flags().IS_KEY(false); - cst_int8_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int8_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int8_t", false)); - - - cst_int8_.detail().name("int8_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int8_); - - CompleteStructMember cst_uint8_; - cst_uint8_.common().member_id(memberId++); - cst_uint8_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint8_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint8_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint8_.common().member_flags().IS_OPTIONAL(false); - cst_uint8_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint8_.common().member_flags().IS_KEY(false); - cst_uint8_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint8_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_uint8_.detail().name("uint8_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint8_); - - CompleteStructMember cst_int16_; - cst_int16_.common().member_id(memberId++); - cst_int16_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int16_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int16_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int16_.common().member_flags().IS_OPTIONAL(false); - cst_int16_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int16_.common().member_flags().IS_KEY(false); - cst_int16_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int16_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int16_t", false)); - - - cst_int16_.detail().name("int16_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int16_); - - CompleteStructMember cst_uint16_; - cst_uint16_.common().member_id(memberId++); - cst_uint16_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint16_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint16_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint16_.common().member_flags().IS_OPTIONAL(false); - cst_uint16_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint16_.common().member_flags().IS_KEY(false); - cst_uint16_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint16_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint16_t", false)); - - - cst_uint16_.detail().name("uint16_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint16_); - - CompleteStructMember cst_int32_; - cst_int32_.common().member_id(memberId++); - cst_int32_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int32_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int32_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int32_.common().member_flags().IS_OPTIONAL(false); - cst_int32_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int32_.common().member_flags().IS_KEY(false); - cst_int32_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int32_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_int32_.detail().name("int32_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int32_); - - CompleteStructMember cst_uint32_; - cst_uint32_.common().member_id(memberId++); - cst_uint32_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint32_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint32_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint32_.common().member_flags().IS_OPTIONAL(false); - cst_uint32_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint32_.common().member_flags().IS_KEY(false); - cst_uint32_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint32_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_uint32_.detail().name("uint32_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint32_); - - CompleteStructMember cst_int64_; - cst_int64_.common().member_id(memberId++); - cst_int64_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int64_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int64_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int64_.common().member_flags().IS_OPTIONAL(false); - cst_int64_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int64_.common().member_flags().IS_KEY(false); - cst_int64_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int64_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - cst_int64_.detail().name("int64_"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int64_); - - CompleteStructMember cst_uint64_; - cst_uint64_.common().member_id(memberId++); - cst_uint64_.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_uint64_.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_uint64_.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_uint64_.common().member_flags().IS_OPTIONAL(false); - cst_uint64_.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_uint64_.common().member_flags().IS_KEY(false); - cst_uint64_.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_uint64_.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint64_t", false)); - - - cst_uint64_.detail().name("uint64_"); - - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetdefaultIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("default")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(); - paramValue.from_string("555"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cst_uint64_.detail().ann_custom().push_back(ann); - } - - - type_object->complete().struct_type().member_seq().emplace_back(cst_uint64_); - - CompleteStructMember cst_local_string; - cst_local_string.common().member_id(memberId++); - cst_local_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_local_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_local_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_local_string.common().member_flags().IS_OPTIONAL(false); - cst_local_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_local_string.common().member_flags().IS_KEY(false); - cst_local_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_local_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_local_string.detail().name("local_string"); - - { - AppliedAnnotation ann; - //ann.annotation_typeid(Getnon_serializedIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("non_serialized")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_BOOLEAN); - paramValue.from_string("true"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cst_local_string.detail().ann_custom().push_back(ann); - } - - - type_object->complete().struct_type().member_seq().emplace_back(cst_local_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("NewAliases"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("NewAliases", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("NewAliases", true); -} - - - -const TypeIdentifier* GetWCharUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWCharUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); -} - -const TypeObject* GetWCharUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWCharUnionObject(); - } - // else - return GetMinimalWCharUnionObject(); -} - -const TypeObject* GetMinimalWCharUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_case_zero; - mst_case_zero.common().member_id(memberId++); - mst_case_zero.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_zero.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_zero.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_zero.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_zero.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_zero.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_zero.common().member_flags().IS_DEFAULT(false); - mst_case_zero.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_zero.common().label_seq().emplace_back('a'); - - MD5 case_zero_hash("case_zero"); - for(int i = 0; i < 4; ++i) - { - mst_case_zero.detail().name_hash()[i] = case_zero_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_zero); - - MinimalUnionMember mst_case_one; - mst_case_one.common().member_id(memberId++); - mst_case_one.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_one.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_one.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_one.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_one.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_one.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_one.common().member_flags().IS_DEFAULT(false); - mst_case_one.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_one.common().label_seq().emplace_back('b'); - - MD5 case_one_hash("case_one"); - for(int i = 0; i < 4; ++i) - { - mst_case_one.detail().name_hash()[i] = case_one_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_one); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", false); -} - -const TypeObject* GetCompleteWCharUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("wchar_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_case_zero; - cst_case_zero.common().member_id(memberId++); - cst_case_zero.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_zero.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_zero.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_zero.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_zero.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_zero.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_zero.common().member_flags().IS_DEFAULT(false); - cst_case_zero.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_zero.common().label_seq().emplace_back('a'); - - - cst_case_zero.detail().name("case_zero"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_zero); - - CompleteUnionMember cst_case_one; - cst_case_one.common().member_id(memberId++); - cst_case_one.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_one.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_one.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_one.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_one.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_one.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_one.common().member_flags().IS_DEFAULT(false); - cst_case_one.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_one.common().label_seq().emplace_back('b'); - - - cst_case_one.detail().name("case_one"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_one); - - - // Header - type_object->complete().union_type().header().detail().type_name("WCharUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WCharUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); -} - - - -const TypeIdentifier* GetOctetUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("OctetUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetOctetUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("OctetUnion", complete); -} - -const TypeObject* GetOctetUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteOctetUnionObject(); - } - // else - return GetMinimalOctetUnionObject(); -} - -const TypeObject* GetMinimalOctetUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_case_five; - mst_case_five.common().member_id(memberId++); - mst_case_five.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_five.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_five.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_five.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_five.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_five.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_five.common().member_flags().IS_DEFAULT(false); - mst_case_five.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_five.common().label_seq().emplace_back(5); - - MD5 case_five_hash("case_five"); - for(int i = 0; i < 4; ++i) - { - mst_case_five.detail().name_hash()[i] = case_five_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_five); - - MinimalUnionMember mst_case_seven; - mst_case_seven.common().member_id(memberId++); - mst_case_seven.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_seven.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_seven.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_seven.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_seven.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_seven.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_seven.common().member_flags().IS_DEFAULT(false); - mst_case_seven.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_seven.common().label_seq().emplace_back(7); - - MD5 case_seven_hash("case_seven"); - for(int i = 0; i < 4; ++i) - { - mst_case_seven.detail().name_hash()[i] = case_seven_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_seven); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("OctetUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("OctetUnion", false); -} - -const TypeObject* GetCompleteOctetUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("OctetUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_case_five; - cst_case_five.common().member_id(memberId++); - cst_case_five.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_five.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_five.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_five.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_five.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_five.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_five.common().member_flags().IS_DEFAULT(false); - cst_case_five.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_five.common().label_seq().emplace_back(5); - - - cst_case_five.detail().name("case_five"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_five); - - CompleteUnionMember cst_case_seven; - cst_case_seven.common().member_id(memberId++); - cst_case_seven.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_seven.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_seven.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_seven.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_seven.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_seven.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_seven.common().member_flags().IS_DEFAULT(false); - cst_case_seven.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_seven.common().label_seq().emplace_back(7); - - - cst_case_seven.detail().name("case_seven"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_seven); - - - // Header - type_object->complete().union_type().header().detail().type_name("OctetUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("OctetUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("OctetUnion", true); -} - - - -const TypeIdentifier* GetInt8UnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Int8Union", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetInt8UnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("Int8Union", complete); -} - -const TypeObject* GetInt8UnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Int8Union", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteInt8UnionObject(); - } - // else - return GetMinimalInt8UnionObject(); -} - -const TypeObject* GetMinimalInt8UnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Int8Union", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_case_three; - mst_case_three.common().member_id(memberId++); - mst_case_three.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_three.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_three.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_three.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_three.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_three.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_three.common().member_flags().IS_DEFAULT(false); - mst_case_three.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_three.common().label_seq().emplace_back(3); - - MD5 case_three_hash("case_three"); - for(int i = 0; i < 4; ++i) - { - mst_case_three.detail().name_hash()[i] = case_three_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_three); - - MinimalUnionMember mst_case_six; - mst_case_six.common().member_id(memberId++); - mst_case_six.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_case_six.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_case_six.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_case_six.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_case_six.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_case_six.common().member_flags().IS_KEY(false); // Doesn't apply - mst_case_six.common().member_flags().IS_DEFAULT(false); - mst_case_six.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_case_six.common().label_seq().emplace_back(6); - - MD5 case_six_hash("case_six"); - for(int i = 0; i < 4; ++i) - { - mst_case_six.detail().name_hash()[i] = case_six_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_case_six); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Int8Union", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("Int8Union", false); -} - -const TypeObject* GetCompleteInt8UnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("Int8Union", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_case_three; - cst_case_three.common().member_id(memberId++); - cst_case_three.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_three.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_three.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_three.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_three.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_three.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_three.common().member_flags().IS_DEFAULT(false); - cst_case_three.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_three.common().label_seq().emplace_back(3); - - - cst_case_three.detail().name("case_three"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_three); - - CompleteUnionMember cst_case_six; - cst_case_six.common().member_id(memberId++); - cst_case_six.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_case_six.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_case_six.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_case_six.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_case_six.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_case_six.common().member_flags().IS_KEY(false); // Doesn't apply - cst_case_six.common().member_flags().IS_DEFAULT(false); - cst_case_six.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_case_six.common().label_seq().emplace_back(6); - - - cst_case_six.detail().name("case_six"); - - type_object->complete().union_type().member_seq().emplace_back(cst_case_six); - - - // Header - type_object->complete().union_type().header().detail().type_name("Int8Union"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("Int8Union", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("Int8Union", true); -} - -namespace bitmodule { - const TypeIdentifier* GetParentBitsetIdentifier(bool complete) - { - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ParentBitset", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetParentBitsetObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ParentBitset", complete); - } - - const TypeObject* GetParentBitsetObject(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ParentBitset", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteParentBitsetObject(); - } - // else - return GetMinimalParentBitsetObject(); - } - - const TypeObject* GetMinimalParentBitsetObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ParentBitset", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_BITSET); - - MinimalBitfield mbf_parent_bitfield; - mbf_parent_bitfield.common().flags().TRY_CONSTRUCT1(false); - mbf_parent_bitfield.common().flags().TRY_CONSTRUCT2(false); - mbf_parent_bitfield.common().flags().IS_EXTERNAL(false); - mbf_parent_bitfield.common().flags().IS_OPTIONAL(false); - mbf_parent_bitfield.common().flags().IS_MUST_UNDERSTAND(false); - mbf_parent_bitfield.common().flags().IS_KEY(false); - mbf_parent_bitfield.common().flags().IS_DEFAULT(false); - mbf_parent_bitfield.common().position(0); - mbf_parent_bitfield.common().bitcount(17); - mbf_parent_bitfield.common().holder_type(TK_UINT32); - MD5 parent_bitfield_hash("parent_bitfield"); - for(int i = 0; i < 4; ++i) - { - mbf_parent_bitfield.name_hash()[i] = parent_bitfield_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_parent_bitfield); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ParentBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ParentBitset", false); - } - - const TypeObject* GetCompleteParentBitsetObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ParentBitset", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_BITSET); - - // No flags apply - //type_object->complete().bitset_type().bitset_flags().IS_FINAL(false); - //type_object->complete().bitset_type().bitset_flags().IS_APPENDABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_MUTABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_NESTED(false); - //type_object->complete().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - - type_object->complete().bitset_type().header().detail().type_name("ParentBitset"); - - CompleteBitfield cbf_parent_bitfield; - cbf_parent_bitfield.common().flags().TRY_CONSTRUCT1(false); - cbf_parent_bitfield.common().flags().TRY_CONSTRUCT2(false); - cbf_parent_bitfield.common().flags().IS_EXTERNAL(false); - cbf_parent_bitfield.common().flags().IS_OPTIONAL(false); - cbf_parent_bitfield.common().flags().IS_MUST_UNDERSTAND(false); - cbf_parent_bitfield.common().flags().IS_KEY(false); - cbf_parent_bitfield.common().flags().IS_DEFAULT(false); - cbf_parent_bitfield.common().position(0); - cbf_parent_bitfield.common().bitcount(17); - cbf_parent_bitfield.common().holder_type(TK_UINT32); - cbf_parent_bitfield.detail().name("parent_bitfield"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(0); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_parent_bitfield.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(17); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_parent_bitfield.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_parent_bitfield); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ParentBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ParentBitset", true); - } - - const TypeIdentifier* GetMyBitsetIdentifier(bool complete) - { - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBitset", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBitsetObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBitset", complete); - } - - const TypeObject* GetMyBitsetObject(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBitsetObject(); - } - // else - return GetMinimalMyBitsetObject(); - } - - const TypeObject* GetMinimalMyBitsetObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_BITSET); - - MinimalBitfield mbf_a; - mbf_a.common().flags().TRY_CONSTRUCT1(false); - mbf_a.common().flags().TRY_CONSTRUCT2(false); - mbf_a.common().flags().IS_EXTERNAL(false); - mbf_a.common().flags().IS_OPTIONAL(false); - mbf_a.common().flags().IS_MUST_UNDERSTAND(false); - mbf_a.common().flags().IS_KEY(false); - mbf_a.common().flags().IS_DEFAULT(false); - mbf_a.common().position(0); - mbf_a.common().bitcount(3); - mbf_a.common().holder_type(TK_CHAR8); - MD5 a_hash("a"); - for(int i = 0; i < 4; ++i) - { - mbf_a.name_hash()[i] = a_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_a); - - - MinimalBitfield mbf_b; - mbf_b.common().flags().TRY_CONSTRUCT1(false); - mbf_b.common().flags().TRY_CONSTRUCT2(false); - mbf_b.common().flags().IS_EXTERNAL(false); - mbf_b.common().flags().IS_OPTIONAL(false); - mbf_b.common().flags().IS_MUST_UNDERSTAND(false); - mbf_b.common().flags().IS_KEY(false); - mbf_b.common().flags().IS_DEFAULT(false); - mbf_b.common().position(3); - mbf_b.common().bitcount(1); - mbf_b.common().holder_type(TK_BOOLEAN); - MD5 b_hash("b"); - for(int i = 0; i < 4; ++i) - { - mbf_b.name_hash()[i] = b_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_b); - - - - MinimalBitfield mbf_c; - mbf_c.common().flags().TRY_CONSTRUCT1(false); - mbf_c.common().flags().TRY_CONSTRUCT2(false); - mbf_c.common().flags().IS_EXTERNAL(false); - mbf_c.common().flags().IS_OPTIONAL(false); - mbf_c.common().flags().IS_MUST_UNDERSTAND(false); - mbf_c.common().flags().IS_KEY(false); - mbf_c.common().flags().IS_DEFAULT(false); - mbf_c.common().position(8); - mbf_c.common().bitcount(10); - mbf_c.common().holder_type(TK_UINT16); - MD5 c_hash("c"); - for(int i = 0; i < 4; ++i) - { - mbf_c.name_hash()[i] = c_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_c); - - - MinimalBitfield mbf_d; - mbf_d.common().flags().TRY_CONSTRUCT1(false); - mbf_d.common().flags().TRY_CONSTRUCT2(false); - mbf_d.common().flags().IS_EXTERNAL(false); - mbf_d.common().flags().IS_OPTIONAL(false); - mbf_d.common().flags().IS_MUST_UNDERSTAND(false); - mbf_d.common().flags().IS_KEY(false); - mbf_d.common().flags().IS_DEFAULT(false); - mbf_d.common().position(18); - mbf_d.common().bitcount(5); - mbf_d.common().holder_type(TK_INT16); - MD5 d_hash("d"); - for(int i = 0; i < 4; ++i) - { - mbf_d.name_hash()[i] = d_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_d); - - - MinimalBitfield mbf_e; - mbf_e.common().flags().TRY_CONSTRUCT1(false); - mbf_e.common().flags().TRY_CONSTRUCT2(false); - mbf_e.common().flags().IS_EXTERNAL(false); - mbf_e.common().flags().IS_OPTIONAL(false); - mbf_e.common().flags().IS_MUST_UNDERSTAND(false); - mbf_e.common().flags().IS_KEY(false); - mbf_e.common().flags().IS_DEFAULT(false); - mbf_e.common().position(23); - mbf_e.common().bitcount(5); - mbf_e.common().holder_type(TK_INT16); - MD5 e_hash("e"); - for(int i = 0; i < 4; ++i) - { - mbf_e.name_hash()[i] = e_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_e); - - - MinimalBitfield mbf_f; - mbf_f.common().flags().TRY_CONSTRUCT1(false); - mbf_f.common().flags().TRY_CONSTRUCT2(false); - mbf_f.common().flags().IS_EXTERNAL(false); - mbf_f.common().flags().IS_OPTIONAL(false); - mbf_f.common().flags().IS_MUST_UNDERSTAND(false); - mbf_f.common().flags().IS_KEY(false); - mbf_f.common().flags().IS_DEFAULT(false); - mbf_f.common().position(28); - mbf_f.common().bitcount(5); - mbf_f.common().holder_type(TK_INT16); - MD5 f_hash("f"); - for(int i = 0; i < 4; ++i) - { - mbf_f.name_hash()[i] = f_hash.digest[i]; - } - type_object->minimal().bitset_type().field_seq().emplace_back(mbf_f); - - - type_object->minimal().bitset_type().header().base_type(*GetParentBitsetIdentifier(false)); - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitset", false); - } - - const TypeObject* GetCompleteMyBitsetObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitset", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_BITSET); - - // No flags apply - //type_object->complete().bitset_type().bitset_flags().IS_FINAL(false); - //type_object->complete().bitset_type().bitset_flags().IS_APPENDABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_MUTABLE(false); - //type_object->complete().bitset_type().bitset_flags().IS_NESTED(false); - //type_object->complete().bitset_type().bitset_flags().IS_AUTOID_HASH(false); - - type_object->complete().bitset_type().header().detail().type_name("MyBitset"); - - CompleteBitfield cbf_a; - cbf_a.common().flags().TRY_CONSTRUCT1(false); - cbf_a.common().flags().TRY_CONSTRUCT2(false); - cbf_a.common().flags().IS_EXTERNAL(false); - cbf_a.common().flags().IS_OPTIONAL(false); - cbf_a.common().flags().IS_MUST_UNDERSTAND(false); - cbf_a.common().flags().IS_KEY(false); - cbf_a.common().flags().IS_DEFAULT(false); - cbf_a.common().position(0); - cbf_a.common().bitcount(3); - cbf_a.common().holder_type(TK_CHAR8); - cbf_a.detail().name("a"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(0); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_a.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(3); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_a.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_a); - - - CompleteBitfield cbf_b; - cbf_b.common().flags().TRY_CONSTRUCT1(false); - cbf_b.common().flags().TRY_CONSTRUCT2(false); - cbf_b.common().flags().IS_EXTERNAL(false); - cbf_b.common().flags().IS_OPTIONAL(false); - cbf_b.common().flags().IS_MUST_UNDERSTAND(false); - cbf_b.common().flags().IS_KEY(false); - cbf_b.common().flags().IS_DEFAULT(false); - cbf_b.common().position(3); - cbf_b.common().bitcount(1); - cbf_b.common().holder_type(TK_BOOLEAN); - cbf_b.detail().name("b"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(3); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_b.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(1); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_b.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_b); - - - - CompleteBitfield cbf_c; - cbf_c.common().flags().TRY_CONSTRUCT1(false); - cbf_c.common().flags().TRY_CONSTRUCT2(false); - cbf_c.common().flags().IS_EXTERNAL(false); - cbf_c.common().flags().IS_OPTIONAL(false); - cbf_c.common().flags().IS_MUST_UNDERSTAND(false); - cbf_c.common().flags().IS_KEY(false); - cbf_c.common().flags().IS_DEFAULT(false); - cbf_c.common().position(8); - cbf_c.common().bitcount(10); - cbf_c.common().holder_type(TK_UINT16); - cbf_c.detail().name("c"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(8); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_c.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(10); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_c.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_c); - - - CompleteBitfield cbf_d; - cbf_d.common().flags().TRY_CONSTRUCT1(false); - cbf_d.common().flags().TRY_CONSTRUCT2(false); - cbf_d.common().flags().IS_EXTERNAL(false); - cbf_d.common().flags().IS_OPTIONAL(false); - cbf_d.common().flags().IS_MUST_UNDERSTAND(false); - cbf_d.common().flags().IS_KEY(false); - cbf_d.common().flags().IS_DEFAULT(false); - cbf_d.common().position(18); - cbf_d.common().bitcount(5); - cbf_d.common().holder_type(TK_INT16); - cbf_d.detail().name("d"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(18); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_d.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(5); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_d.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_d); - - - CompleteBitfield cbf_e; - cbf_e.common().flags().TRY_CONSTRUCT1(false); - cbf_e.common().flags().TRY_CONSTRUCT2(false); - cbf_e.common().flags().IS_EXTERNAL(false); - cbf_e.common().flags().IS_OPTIONAL(false); - cbf_e.common().flags().IS_MUST_UNDERSTAND(false); - cbf_e.common().flags().IS_KEY(false); - cbf_e.common().flags().IS_DEFAULT(false); - cbf_e.common().position(23); - cbf_e.common().bitcount(5); - cbf_e.common().holder_type(TK_INT16); - cbf_e.detail().name("e"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(23); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_e.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(5); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_e.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_e); - - - CompleteBitfield cbf_f; - cbf_f.common().flags().TRY_CONSTRUCT1(false); - cbf_f.common().flags().TRY_CONSTRUCT2(false); - cbf_f.common().flags().IS_EXTERNAL(false); - cbf_f.common().flags().IS_OPTIONAL(false); - cbf_f.common().flags().IS_MUST_UNDERSTAND(false); - cbf_f.common().flags().IS_KEY(false); - cbf_f.common().flags().IS_DEFAULT(false); - cbf_f.common().position(28); - cbf_f.common().bitcount(5); - cbf_f.common().holder_type(TK_INT16); - cbf_f.detail().name("f"); - - // Position annotation always present - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(28); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_f.detail().ann_custom().push_back(ann); - } - - // Use bit_bound as bitcount. - { - // Position - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(5); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_f.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitset_type().field_seq().emplace_back(cbf_f); - - - type_object->complete().bitset_type().header().base_type(*GetParentBitsetIdentifier(true)); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().bitset_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitset", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitset", true); - } - - const TypeIdentifier* GetMyBitMaskIdentifier(bool complete) - { - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBitMask", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBitMaskObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBitMask", complete); - } - - const TypeObject* GetMyBitMaskObject(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitMask", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBitMaskObject(); - } - // else - return GetMinimalMyBitMaskObject(); - } - - const TypeObject* GetMinimalMyBitMaskObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitMask", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_BITMASK); - - type_object->minimal().bitmask_type().header().common().bit_bound(8); - - MinimalBitflag mbf_flag0; - mbf_flag0.common().flags().TRY_CONSTRUCT1(false); - mbf_flag0.common().flags().TRY_CONSTRUCT2(false); - mbf_flag0.common().flags().IS_EXTERNAL(false); - mbf_flag0.common().flags().IS_OPTIONAL(false); - mbf_flag0.common().flags().IS_MUST_UNDERSTAND(false); - mbf_flag0.common().flags().IS_KEY(false); - mbf_flag0.common().flags().IS_DEFAULT(false); - mbf_flag0.common().position(0); - MD5 flag0_hash("flag0"); - for(int i = 0; i < 4; ++i) - { - mbf_flag0.detail().name_hash()[i] = flag0_hash.digest[i]; - } - type_object->minimal().bitmask_type().flag_seq().emplace_back(mbf_flag0); - - MinimalBitflag mbf_flag1; - mbf_flag1.common().flags().TRY_CONSTRUCT1(false); - mbf_flag1.common().flags().TRY_CONSTRUCT2(false); - mbf_flag1.common().flags().IS_EXTERNAL(false); - mbf_flag1.common().flags().IS_OPTIONAL(false); - mbf_flag1.common().flags().IS_MUST_UNDERSTAND(false); - mbf_flag1.common().flags().IS_KEY(false); - mbf_flag1.common().flags().IS_DEFAULT(false); - mbf_flag1.common().position(1); - MD5 flag1_hash("flag1"); - for(int i = 0; i < 4; ++i) - { - mbf_flag1.detail().name_hash()[i] = flag1_hash.digest[i]; - } - type_object->minimal().bitmask_type().flag_seq().emplace_back(mbf_flag1); - - MinimalBitflag mbf_flag4; - mbf_flag4.common().flags().TRY_CONSTRUCT1(false); - mbf_flag4.common().flags().TRY_CONSTRUCT2(false); - mbf_flag4.common().flags().IS_EXTERNAL(false); - mbf_flag4.common().flags().IS_OPTIONAL(false); - mbf_flag4.common().flags().IS_MUST_UNDERSTAND(false); - mbf_flag4.common().flags().IS_KEY(false); - mbf_flag4.common().flags().IS_DEFAULT(false); - mbf_flag4.common().position(4); - MD5 flag4_hash("flag4"); - for(int i = 0; i < 4; ++i) - { - mbf_flag4.detail().name_hash()[i] = flag4_hash.digest[i]; - } - type_object->minimal().bitmask_type().flag_seq().emplace_back(mbf_flag4); - - MinimalBitflag mbf_flag6; - mbf_flag6.common().flags().TRY_CONSTRUCT1(false); - mbf_flag6.common().flags().TRY_CONSTRUCT2(false); - mbf_flag6.common().flags().IS_EXTERNAL(false); - mbf_flag6.common().flags().IS_OPTIONAL(false); - mbf_flag6.common().flags().IS_MUST_UNDERSTAND(false); - mbf_flag6.common().flags().IS_KEY(false); - mbf_flag6.common().flags().IS_DEFAULT(false); - mbf_flag6.common().position(6); - MD5 flag6_hash("flag6"); - for(int i = 0; i < 4; ++i) - { - mbf_flag6.detail().name_hash()[i] = flag6_hash.digest[i]; - } - type_object->minimal().bitmask_type().flag_seq().emplace_back(mbf_flag6); - - MinimalBitflag mbf_flag7; - mbf_flag7.common().flags().TRY_CONSTRUCT1(false); - mbf_flag7.common().flags().TRY_CONSTRUCT2(false); - mbf_flag7.common().flags().IS_EXTERNAL(false); - mbf_flag7.common().flags().IS_OPTIONAL(false); - mbf_flag7.common().flags().IS_MUST_UNDERSTAND(false); - mbf_flag7.common().flags().IS_KEY(false); - mbf_flag7.common().flags().IS_DEFAULT(false); - mbf_flag7.common().position(7); - MD5 flag7_hash("flag7"); - for(int i = 0; i < 4; ++i) - { - mbf_flag7.detail().name_hash()[i] = flag7_hash.digest[i]; - } - type_object->minimal().bitmask_type().flag_seq().emplace_back(mbf_flag7); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().bitmask_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitMask", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitMask", false); - } - - const TypeObject* GetCompleteMyBitMaskObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBitMask", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_BITMASK); - - // No flags apply - //type_object->complete().bitmask_type().bitmask_flags().IS_FINAL(false); - //type_object->complete().bitmask_type().bitmask_flags().IS_APPENDABLE(false); - //type_object->complete().bitmask_type().bitmask_flags().IS_MUTABLE(false); - //type_object->complete().bitmask_type().bitmask_flags().IS_NESTED(false); - //type_object->complete().bitmask_type().bitmask_flags().IS_AUTOID_HASH(false); - - type_object->complete().bitmask_type().header().common().bit_bound(8); - - { - AppliedAnnotation ann; - //ann.annotation_typeid(Getbit_boundIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.from_string("8"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - type_object->complete().bitmask_type().header().detail().ann_custom().push_back(ann); - } - - - type_object->complete().bitmask_type().header().detail().type_name("MyBitMask"); - - CompleteBitflag cbf_flag0; - cbf_flag0.common().flags().TRY_CONSTRUCT1(false); - cbf_flag0.common().flags().TRY_CONSTRUCT2(false); - cbf_flag0.common().flags().IS_EXTERNAL(false); - cbf_flag0.common().flags().IS_OPTIONAL(false); - cbf_flag0.common().flags().IS_MUST_UNDERSTAND(false); - cbf_flag0.common().flags().IS_KEY(false); - cbf_flag0.common().flags().IS_DEFAULT(false); - cbf_flag0.common().position(0); - cbf_flag0.detail().name("flag0"); - - // Position annotation always present - { - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(0); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_flag0.detail().ann_custom().push_back(ann); - } - - { - if (std::strcmp("position", "position") != 0) - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetpositionIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.from_string("0"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cbf_flag0.detail().ann_custom().push_back(ann); - } - } - - - type_object->complete().bitmask_type().flag_seq().emplace_back(cbf_flag0); - - CompleteBitflag cbf_flag1; - cbf_flag1.common().flags().TRY_CONSTRUCT1(false); - cbf_flag1.common().flags().TRY_CONSTRUCT2(false); - cbf_flag1.common().flags().IS_EXTERNAL(false); - cbf_flag1.common().flags().IS_OPTIONAL(false); - cbf_flag1.common().flags().IS_MUST_UNDERSTAND(false); - cbf_flag1.common().flags().IS_KEY(false); - cbf_flag1.common().flags().IS_DEFAULT(false); - cbf_flag1.common().position(1); - cbf_flag1.detail().name("flag1"); - - // Position annotation always present - { - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(1); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_flag1.detail().ann_custom().push_back(ann); - } - - { - if (std::strcmp("position", "position") != 0) - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetpositionIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.from_string("1"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cbf_flag1.detail().ann_custom().push_back(ann); - } - } - - - type_object->complete().bitmask_type().flag_seq().emplace_back(cbf_flag1); - - CompleteBitflag cbf_flag4; - cbf_flag4.common().flags().TRY_CONSTRUCT1(false); - cbf_flag4.common().flags().TRY_CONSTRUCT2(false); - cbf_flag4.common().flags().IS_EXTERNAL(false); - cbf_flag4.common().flags().IS_OPTIONAL(false); - cbf_flag4.common().flags().IS_MUST_UNDERSTAND(false); - cbf_flag4.common().flags().IS_KEY(false); - cbf_flag4.common().flags().IS_DEFAULT(false); - cbf_flag4.common().position(4); - cbf_flag4.detail().name("flag4"); - - // Position annotation always present - { - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(4); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_flag4.detail().ann_custom().push_back(ann); - } - - { - if (std::strcmp("position", "position") != 0) - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetpositionIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.from_string("4"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cbf_flag4.detail().ann_custom().push_back(ann); - } - } - - - type_object->complete().bitmask_type().flag_seq().emplace_back(cbf_flag4); - - CompleteBitflag cbf_flag6; - cbf_flag6.common().flags().TRY_CONSTRUCT1(false); - cbf_flag6.common().flags().TRY_CONSTRUCT2(false); - cbf_flag6.common().flags().IS_EXTERNAL(false); - cbf_flag6.common().flags().IS_OPTIONAL(false); - cbf_flag6.common().flags().IS_MUST_UNDERSTAND(false); - cbf_flag6.common().flags().IS_KEY(false); - cbf_flag6.common().flags().IS_DEFAULT(false); - cbf_flag6.common().position(6); - cbf_flag6.detail().name("flag6"); - - // Position annotation always present - { - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(6); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_flag6.detail().ann_custom().push_back(ann); - } - - { - if (std::strcmp("position", "position") != 0) - { - AppliedAnnotation ann; - //ann.annotation_typeid(GetpositionIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - { - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.from_string("6"); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - } - - cbf_flag6.detail().ann_custom().push_back(ann); - } - } - - - type_object->complete().bitmask_type().flag_seq().emplace_back(cbf_flag6); - - CompleteBitflag cbf_flag7; - cbf_flag7.common().flags().TRY_CONSTRUCT1(false); - cbf_flag7.common().flags().TRY_CONSTRUCT2(false); - cbf_flag7.common().flags().IS_EXTERNAL(false); - cbf_flag7.common().flags().IS_OPTIONAL(false); - cbf_flag7.common().flags().IS_MUST_UNDERSTAND(false); - cbf_flag7.common().flags().IS_KEY(false); - cbf_flag7.common().flags().IS_DEFAULT(false); - cbf_flag7.common().position(7); - cbf_flag7.detail().name("flag7"); - - // Position annotation always present - { - AppliedAnnotation ann; - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("position")); - AppliedAnnotationParameter annParam; - MD5 message_hash("value"); - for(int i = 0; i < 4; ++i) - { - annParam.paramname_hash()[i] = message_hash.digest[i]; - } - AnnotationParameterValue paramValue; - paramValue._d(TK_UINT16); - paramValue.uint_16_value(7); - annParam.value(paramValue); - ann.param_seq().push_back(annParam); - - cbf_flag7.detail().ann_custom().push_back(ann); - } - - type_object->complete().bitmask_type().flag_seq().emplace_back(cbf_flag7); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().bitmask_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBitMask", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBitMask", true); - } - - - - const TypeIdentifier* GetBitsetBitmaskIdentifier(bool complete) - { - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BitsetBitmask", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBitsetBitmaskObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BitsetBitmask", complete); - } - - const TypeObject* GetBitsetBitmaskObject(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBitsetBitmaskObject(); - } - //else - return GetMinimalBitsetBitmaskObject(); - } - - const TypeObject* GetMinimalBitsetBitmaskObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_mybitset; - mst_mybitset.common().member_id(memberId++); - mst_mybitset.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_mybitset.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_mybitset.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_mybitset.common().member_flags().IS_OPTIONAL(false); - mst_mybitset.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_mybitset.common().member_flags().IS_KEY(false); - mst_mybitset.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_mybitset.common().member_type_id(*bitmodule::GetMyBitsetIdentifier(false)); - - MD5 mybitset_hash("mybitset"); - for(int i = 0; i < 4; ++i) - { - mst_mybitset.detail().name_hash()[i] = mybitset_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_mybitset); - - MinimalStructMember mst_mybitmask; - mst_mybitmask.common().member_id(memberId++); - mst_mybitmask.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_mybitmask.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_mybitmask.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_mybitmask.common().member_flags().IS_OPTIONAL(false); - mst_mybitmask.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_mybitmask.common().member_flags().IS_KEY(false); - mst_mybitmask.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_mybitmask.common().member_type_id(*bitmodule::GetMyBitMaskIdentifier(false)); - - MD5 mybitmask_hash("mybitmask"); - for(int i = 0; i < 4; ++i) - { - mst_mybitmask.detail().name_hash()[i] = mybitmask_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_mybitmask); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BitsetBitmask", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", false); - } - - const TypeObject* GetCompleteBitsetBitmaskObject() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_mybitset; - cst_mybitset.common().member_id(memberId++); - cst_mybitset.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_mybitset.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_mybitset.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_mybitset.common().member_flags().IS_OPTIONAL(false); - cst_mybitset.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_mybitset.common().member_flags().IS_KEY(false); - cst_mybitset.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_mybitset.common().member_type_id(*bitmodule::GetMyBitsetIdentifier(true)); - - cst_mybitset.detail().name("mybitset"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_mybitset); - - CompleteStructMember cst_mybitmask; - cst_mybitmask.common().member_id(memberId++); - cst_mybitmask.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_mybitmask.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_mybitmask.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_mybitmask.common().member_flags().IS_OPTIONAL(false); - cst_mybitmask.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_mybitmask.common().member_flags().IS_KEY(false); - cst_mybitmask.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_mybitmask.common().member_type_id(*bitmodule::GetMyBitMaskIdentifier(true)); - - cst_mybitmask.detail().name("mybitmask"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_mybitmask); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BitsetBitmask"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BitsetBitmask", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", true); - } - - - - const TypeIdentifier* GetBM2Identifier(bool complete) - { - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BM2", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBM2Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BM2", complete); - } - - const TypeObject* GetBM2Object(bool complete) - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BM2", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBM2Object(); - } - //else - return GetMinimalBM2Object(); - } - - const TypeObject* GetMinimalBM2Object() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BM2", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_two; - mst_two.common().member_id(memberId++); - mst_two.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_two.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_two.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_two.common().member_flags().IS_OPTIONAL(false); - mst_two.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_two.common().member_flags().IS_KEY(false); - mst_two.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_two.common().member_type_id(*bitmodule::GetMyBitMaskIdentifier(false)); - - MD5 two_hash("two"); - for(int i = 0; i < 4; ++i) - { - mst_two.detail().name_hash()[i] = two_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_two); - - MinimalStructMember mst_mylong; - mst_mylong.common().member_id(memberId++); - mst_mylong.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_mylong.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_mylong.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_mylong.common().member_flags().IS_OPTIONAL(false); - mst_mylong.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_mylong.common().member_flags().IS_KEY(false); - mst_mylong.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_mylong.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 mylong_hash("mylong"); - for(int i = 0; i < 4; ++i) - { - mst_mylong.detail().name_hash()[i] = mylong_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_mylong); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - type_object->minimal().struct_type().header().base_type(*GetBitsetBitmaskIdentifier(false)); - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BM2", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BM2", false); - } - - const TypeObject* GetCompleteBM2Object() - { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BM2", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_two; - cst_two.common().member_id(memberId++); - cst_two.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_two.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_two.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_two.common().member_flags().IS_OPTIONAL(false); - cst_two.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_two.common().member_flags().IS_KEY(false); - cst_two.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_two.common().member_type_id(*bitmodule::GetMyBitMaskIdentifier(true)); - - cst_two.detail().name("two"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_two); - - CompleteStructMember cst_mylong; - cst_mylong.common().member_id(memberId++); - cst_mylong.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_mylong.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_mylong.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_mylong.common().member_flags().IS_OPTIONAL(false); - cst_mylong.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_mylong.common().member_flags().IS_KEY(false); - cst_mylong.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_mylong.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_mylong.detail().name("mylong"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_mylong); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BM2"); - // TODO inheritance - type_object->complete().struct_type().header().base_type(*GetBitsetBitmaskIdentifier(true)); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; - #if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length - #else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length - #endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BM2", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BM2", true); - } - -} // namespace bitmodule - - -const TypeIdentifier* GetStructTestIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructTest", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStructTestObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StructTest", complete); -} - -const TypeObject* GetStructTestObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructTest", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStructTestObject(); - } - //else - return GetMinimalStructTestObject(); -} - -const TypeObject* GetMinimalStructTestObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructTest", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_octetUnion; - mst_octetUnion.common().member_id(memberId++); - mst_octetUnion.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_octetUnion.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_octetUnion.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_octetUnion.common().member_flags().IS_OPTIONAL(false); - mst_octetUnion.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_octetUnion.common().member_flags().IS_KEY(false); - mst_octetUnion.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_octetUnion.common().member_type_id(*GetOctetUnionIdentifier(false)); - - MD5 octetUnion_hash("octetUnion"); - for(int i = 0; i < 4; ++i) - { - mst_octetUnion.detail().name_hash()[i] = octetUnion_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_octetUnion); - - MinimalStructMember mst_int8Union; - mst_int8Union.common().member_id(memberId++); - mst_int8Union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_int8Union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_int8Union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_int8Union.common().member_flags().IS_OPTIONAL(false); - mst_int8Union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_int8Union.common().member_flags().IS_KEY(false); - mst_int8Union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_int8Union.common().member_type_id(*GetInt8UnionIdentifier(false)); - - MD5 int8Union_hash("int8Union"); - for(int i = 0; i < 4; ++i) - { - mst_int8Union.detail().name_hash()[i] = int8Union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_int8Union); - - MinimalStructMember mst_myStructBits; - mst_myStructBits.common().member_id(memberId++); - mst_myStructBits.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_myStructBits.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_myStructBits.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_myStructBits.common().member_flags().IS_OPTIONAL(false); - mst_myStructBits.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_myStructBits.common().member_flags().IS_KEY(false); - mst_myStructBits.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_myStructBits.common().member_type_id(*bitmodule::GetBM2Identifier(false)); - - MD5 myStructBits_hash("myStructBits"); - for(int i = 0; i < 4; ++i) - { - mst_myStructBits.detail().name_hash()[i] = myStructBits_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_myStructBits); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - type_object->minimal().struct_type().header().base_type(*GetNewAliasesIdentifier(false)); - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructTest", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructTest", false); -} - -const TypeObject* GetCompleteStructTestObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StructTest", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_octetUnion; - cst_octetUnion.common().member_id(memberId++); - cst_octetUnion.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_octetUnion.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_octetUnion.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_octetUnion.common().member_flags().IS_OPTIONAL(false); - cst_octetUnion.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_octetUnion.common().member_flags().IS_KEY(false); - cst_octetUnion.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_octetUnion.common().member_type_id(*GetOctetUnionIdentifier(true)); - - cst_octetUnion.detail().name("octetUnion"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_octetUnion); - - CompleteStructMember cst_int8Union; - cst_int8Union.common().member_id(memberId++); - cst_int8Union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_int8Union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_int8Union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_int8Union.common().member_flags().IS_OPTIONAL(false); - cst_int8Union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_int8Union.common().member_flags().IS_KEY(false); - cst_int8Union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_int8Union.common().member_type_id(*GetInt8UnionIdentifier(true)); - - cst_int8Union.detail().name("int8Union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_int8Union); - - CompleteStructMember cst_myStructBits; - cst_myStructBits.common().member_id(memberId++); - cst_myStructBits.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_myStructBits.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_myStructBits.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_myStructBits.common().member_flags().IS_OPTIONAL(false); - cst_myStructBits.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_myStructBits.common().member_flags().IS_KEY(false); - cst_myStructBits.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_myStructBits.common().member_type_id(*bitmodule::GetBM2Identifier(true)); - - cst_myStructBits.detail().name("myStructBits"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_myStructBits); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StructTest"); - // TODO inheritance - type_object->complete().struct_type().header().base_type(*GetNewAliasesIdentifier(true)); - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StructTest", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StructTest", true); -} diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h deleted file mode 100644 index 55337a6942d..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2TypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(new_features_4_2_SOURCE) -#define new_features_4_2_DllAPI __declspec( dllexport ) -#else -#define new_features_4_2_DllAPI __declspec( dllimport ) -#endif // new_features_4_2_SOURCE -#else -#define new_features_4_2_DllAPI -#endif -#else -#define new_features_4_2_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registernew_features_4_2Types(); - - - -eProsima_user_DllExport const TypeIdentifier* GetNewAliasesIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetNewAliasesObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalNewAliasesObject(); -eProsima_user_DllExport const TypeObject* GetCompleteNewAliasesObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWCharUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWCharUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWCharUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetOctetUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetOctetUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalOctetUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteOctetUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetInt8UnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetInt8UnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalInt8UnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteInt8UnionObject(); - -namespace bitmodule { - eProsima_user_DllExport const TypeIdentifier* GetParentBitsetIdentifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetParentBitsetObject(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalParentBitsetObject(); - eProsima_user_DllExport const TypeObject* GetCompleteParentBitsetObject(); - - eProsima_user_DllExport const TypeIdentifier* GetMyBitsetIdentifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMyBitsetObject(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalMyBitsetObject(); - eProsima_user_DllExport const TypeObject* GetCompleteMyBitsetObject(); - - eProsima_user_DllExport const TypeIdentifier* GetMyBitMaskIdentifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMyBitMaskObject(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalMyBitMaskObject(); - eProsima_user_DllExport const TypeObject* GetCompleteMyBitMaskObject(); - - - - eProsima_user_DllExport const TypeIdentifier* GetBitsetBitmaskIdentifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetBitsetBitmaskObject(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalBitsetBitmaskObject(); - eProsima_user_DllExport const TypeObject* GetCompleteBitsetBitmaskObject(); - - - - eProsima_user_DllExport const TypeIdentifier* GetBM2Identifier(bool complete = false); - eProsima_user_DllExport const TypeObject* GetBM2Object(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalBM2Object(); - eProsima_user_DllExport const TypeObject* GetCompleteBM2Object(); - -} // namespace bitmodule - - -eProsima_user_DllExport const TypeIdentifier* GetStructTestIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStructTestObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStructTestObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStructTestObject(); - - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx b/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx deleted file mode 100644 index 4287df4cf97..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx +++ /dev/null @@ -1,2905 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "new_features_4_2.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "new_features_4_2TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define bitmodule_BM2_max_cdr_typesize 24ULL; -#define NewAliases_max_cdr_typesize 40ULL; - -#define StructTest_max_cdr_typesize 88ULL; - - - -#define bitmodule_BitsetBitmask_max_cdr_typesize 17ULL; - - - - -NewAliases::NewAliases() -{ - // int8 m_int8_ - m_int8_ = 0; - // uint8 m_uint8_ - m_uint8_ = 0; - // short m_int16_ - m_int16_ = 0; - // unsigned short m_uint16_ - m_uint16_ = 0; - // long m_int32_ - m_int32_ = 0; - // unsigned long m_uint32_ - m_uint32_ = 0; - // long long m_int64_ - m_int64_ = 0; - // unsigned long long m_uint64_ - m_uint64_ = 555; - // /type_d() m_local_string - - - // Just to register all known types - registernew_features_4_2Types(); -} - -NewAliases::~NewAliases() -{ -} - -NewAliases::NewAliases( - const NewAliases& x) -{ - m_int8_ = x.m_int8_; - - - m_uint8_ = x.m_uint8_; - - - m_int16_ = x.m_int16_; - - - m_uint16_ = x.m_uint16_; - - - m_int32_ = x.m_int32_; - - - m_uint32_ = x.m_uint32_; - - - m_int64_ = x.m_int64_; - - - m_uint64_ = x.m_uint64_; - - - m_local_string = x.m_local_string; - -} - -NewAliases::NewAliases( - NewAliases&& x) noexcept -{ - m_int8_ = x.m_int8_; - - - m_uint8_ = x.m_uint8_; - - - m_int16_ = x.m_int16_; - - - m_uint16_ = x.m_uint16_; - - - m_int32_ = x.m_int32_; - - - m_uint32_ = x.m_uint32_; - - - m_int64_ = x.m_int64_; - - - m_uint64_ = x.m_uint64_; - - - m_local_string = std::move(x.m_local_string); - -} - -NewAliases& NewAliases::operator =( - const NewAliases& x) -{ - m_int8_ = x.m_int8_; - - - m_uint8_ = x.m_uint8_; - - - m_int16_ = x.m_int16_; - - - m_uint16_ = x.m_uint16_; - - - m_int32_ = x.m_int32_; - - - m_uint32_ = x.m_uint32_; - - - m_int64_ = x.m_int64_; - - - m_uint64_ = x.m_uint64_; - - - m_local_string = x.m_local_string; - - return *this; -} - -NewAliases& NewAliases::operator =( - NewAliases&& x) noexcept -{ - m_int8_ = x.m_int8_; - - - m_uint8_ = x.m_uint8_; - - - m_int16_ = x.m_int16_; - - - m_uint16_ = x.m_uint16_; - - - m_int32_ = x.m_int32_; - - - m_uint32_ = x.m_uint32_; - - - m_int64_ = x.m_int64_; - - - m_uint64_ = x.m_uint64_; - - - m_local_string = std::move(x.m_local_string); - - return *this; -} - -bool NewAliases::operator ==( - const NewAliases& x) const -{ - return (m_int8_ == x.m_int8_ && - m_uint8_ == x.m_uint8_ && - m_int16_ == x.m_int16_ && - m_uint16_ == x.m_uint16_ && - m_int32_ == x.m_int32_ && - m_uint32_ == x.m_uint32_ && - m_int64_ == x.m_int64_ && - m_uint64_ == x.m_uint64_ && - m_local_string == x.m_local_string); -} - -bool NewAliases::operator !=( - const NewAliases& x) const -{ - return !(*this == x); -} - -size_t NewAliases::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return NewAliases_max_cdr_typesize; -} - -size_t NewAliases::getCdrSerializedSize( - const NewAliases& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - - return current_alignment - initial_alignment; -} - - -void NewAliases::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_int8_; - - scdr << m_uint8_; - - scdr << m_int16_; - - scdr << m_uint16_; - - scdr << m_int32_; - - scdr << m_uint32_; - - scdr << m_int64_; - - scdr << m_uint64_; - -} - -void NewAliases::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_int8_; - - - - dcdr >> m_uint8_; - - - - dcdr >> m_int16_; - - - - dcdr >> m_uint16_; - - - - dcdr >> m_int32_; - - - - dcdr >> m_uint32_; - - - - dcdr >> m_int64_; - - - - dcdr >> m_uint64_; - - - -} - - -bool NewAliases::isKeyDefined() -{ - return false; -} - -void NewAliases::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member int8_ - * @param _int8_ New value for member int8_ - */ -void NewAliases::int8_( - int8_t _int8_) -{ - m_int8_ = _int8_; -} - -/*! - * @brief This function returns the value of member int8_ - * @return Value of member int8_ - */ -int8_t NewAliases::int8_() const -{ - return m_int8_; -} - -/*! - * @brief This function returns a reference to member int8_ - * @return Reference to member int8_ - */ -int8_t& NewAliases::int8_() -{ - return m_int8_; -} - - -/*! - * @brief This function sets a value in member uint8_ - * @param _uint8_ New value for member uint8_ - */ -void NewAliases::uint8_( - uint8_t _uint8_) -{ - m_uint8_ = _uint8_; -} - -/*! - * @brief This function returns the value of member uint8_ - * @return Value of member uint8_ - */ -uint8_t NewAliases::uint8_() const -{ - return m_uint8_; -} - -/*! - * @brief This function returns a reference to member uint8_ - * @return Reference to member uint8_ - */ -uint8_t& NewAliases::uint8_() -{ - return m_uint8_; -} - - -/*! - * @brief This function sets a value in member int16_ - * @param _int16_ New value for member int16_ - */ -void NewAliases::int16_( - int16_t _int16_) -{ - m_int16_ = _int16_; -} - -/*! - * @brief This function returns the value of member int16_ - * @return Value of member int16_ - */ -int16_t NewAliases::int16_() const -{ - return m_int16_; -} - -/*! - * @brief This function returns a reference to member int16_ - * @return Reference to member int16_ - */ -int16_t& NewAliases::int16_() -{ - return m_int16_; -} - - -/*! - * @brief This function sets a value in member uint16_ - * @param _uint16_ New value for member uint16_ - */ -void NewAliases::uint16_( - uint16_t _uint16_) -{ - m_uint16_ = _uint16_; -} - -/*! - * @brief This function returns the value of member uint16_ - * @return Value of member uint16_ - */ -uint16_t NewAliases::uint16_() const -{ - return m_uint16_; -} - -/*! - * @brief This function returns a reference to member uint16_ - * @return Reference to member uint16_ - */ -uint16_t& NewAliases::uint16_() -{ - return m_uint16_; -} - - -/*! - * @brief This function sets a value in member int32_ - * @param _int32_ New value for member int32_ - */ -void NewAliases::int32_( - int32_t _int32_) -{ - m_int32_ = _int32_; -} - -/*! - * @brief This function returns the value of member int32_ - * @return Value of member int32_ - */ -int32_t NewAliases::int32_() const -{ - return m_int32_; -} - -/*! - * @brief This function returns a reference to member int32_ - * @return Reference to member int32_ - */ -int32_t& NewAliases::int32_() -{ - return m_int32_; -} - - -/*! - * @brief This function sets a value in member uint32_ - * @param _uint32_ New value for member uint32_ - */ -void NewAliases::uint32_( - uint32_t _uint32_) -{ - m_uint32_ = _uint32_; -} - -/*! - * @brief This function returns the value of member uint32_ - * @return Value of member uint32_ - */ -uint32_t NewAliases::uint32_() const -{ - return m_uint32_; -} - -/*! - * @brief This function returns a reference to member uint32_ - * @return Reference to member uint32_ - */ -uint32_t& NewAliases::uint32_() -{ - return m_uint32_; -} - - -/*! - * @brief This function sets a value in member int64_ - * @param _int64_ New value for member int64_ - */ -void NewAliases::int64_( - int64_t _int64_) -{ - m_int64_ = _int64_; -} - -/*! - * @brief This function returns the value of member int64_ - * @return Value of member int64_ - */ -int64_t NewAliases::int64_() const -{ - return m_int64_; -} - -/*! - * @brief This function returns a reference to member int64_ - * @return Reference to member int64_ - */ -int64_t& NewAliases::int64_() -{ - return m_int64_; -} - - -/*! - * @brief This function sets a value in member uint64_ - * @param _uint64_ New value for member uint64_ - */ -void NewAliases::uint64_( - uint64_t _uint64_) -{ - m_uint64_ = _uint64_; -} - -/*! - * @brief This function returns the value of member uint64_ - * @return Value of member uint64_ - */ -uint64_t NewAliases::uint64_() const -{ - return m_uint64_; -} - -/*! - * @brief This function returns a reference to member uint64_ - * @return Reference to member uint64_ - */ -uint64_t& NewAliases::uint64_() -{ - return m_uint64_; -} - - -/*! - * @brief This function copies the value in member local_string - * @param _local_string New value to be copied in member local_string - */ -void NewAliases::local_string( - const std::string& _local_string) -{ - m_local_string = _local_string; -} - -/*! - * @brief This function moves the value in member local_string - * @param _local_string New value to be moved in member local_string - */ -void NewAliases::local_string( - std::string&& _local_string) -{ - m_local_string = std::move(_local_string); -} - -/*! - * @brief This function returns a constant reference to member local_string - * @return Constant reference to member local_string - */ -const std::string& NewAliases::local_string() const -{ - return m_local_string; -} - -/*! - * @brief This function returns a reference to member local_string - * @return Reference to member local_string - */ -std::string& NewAliases::local_string() -{ - return m_local_string; -} - - - - - -WCharUnion::WCharUnion() -{ - m__d = 'a'; - // long m_case_zero - m_case_zero = 0; - // long m_case_one - m_case_one = 0; -} - -WCharUnion::~WCharUnion() -{ -} - -WCharUnion::WCharUnion( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } -} - -WCharUnion::WCharUnion( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } -} - -WCharUnion& WCharUnion::operator =( - const WCharUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; -} - -WCharUnion& WCharUnion::operator =( - WCharUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 'a': - m_case_zero = x.m_case_zero; - break; - - - case 'b': - m_case_one = x.m_case_one; - break; - - default: - break; - } - - return *this; -} - -bool WCharUnion::operator ==( - const WCharUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 'a': - return (m_case_zero == x.m_case_zero); - break; - - - case 'b': - return (m_case_one == x.m_case_one); - break; - - default: - break; - } - return false; -} - -bool WCharUnion::operator !=( - const WCharUnion& x) const -{ - return !(*this == x); -} - -void WCharUnion::_d( - wchar_t __d) -{ - bool b = false; - - switch(m__d) - { - case 'a': - switch(__d) - { - case 'a': - b = true; - break; - default: - break; - } - break; - - - case 'b': - switch(__d) - { - case 'b': - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -wchar_t WCharUnion::_d() const -{ - return m__d; -} - -wchar_t& WCharUnion::_d() -{ - return m__d; -} - -void WCharUnion::case_zero( - int32_t _case_zero) -{ - m_case_zero = _case_zero; - m__d = 'a'; - -} - -int32_t WCharUnion::case_zero() const -{ - bool b = false; - - switch(m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_zero; -} - -int32_t& WCharUnion::case_zero() -{ - bool b = false; - - switch(m__d) - { - case 'a': - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_zero; -} - - -void WCharUnion::case_one( - int32_t _case_one) -{ - m_case_one = _case_one; - m__d = 'b'; - -} - -int32_t WCharUnion::case_one() const -{ - bool b = false; - - switch(m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_one; -} - -int32_t& WCharUnion::case_one() -{ - bool b = false; - - switch(m__d) - { - case 'b': - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_one; -} - - -// TODO(Ricardo) Review -size_t WCharUnion::getCdrSerializedSize( - const WCharUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case 'a': - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 'b': - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void WCharUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 'a': - scdr << m_case_zero; - - break; - - - case 'b': - scdr << m_case_one; - - break; - - default: - break; - } -} - -void WCharUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 'a': - dcdr >> m_case_zero; - - - break; - - - case 'b': - dcdr >> m_case_one; - - - break; - - default: - break; - } -} - - - - - -OctetUnion::OctetUnion() -{ - m__d = 5; - // long m_case_five - m_case_five = 0; - // long m_case_seven - m_case_seven = 0; -} - -OctetUnion::~OctetUnion() -{ -} - -OctetUnion::OctetUnion( - const OctetUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } -} - -OctetUnion::OctetUnion( - OctetUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } -} - -OctetUnion& OctetUnion::operator =( - const OctetUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; -} - -OctetUnion& OctetUnion::operator =( - OctetUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 5: - m_case_five = x.m_case_five; - break; - - - case 7: - m_case_seven = x.m_case_seven; - break; - - default: - break; - } - - return *this; -} - -bool OctetUnion::operator ==( - const OctetUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 5: - return (m_case_five == x.m_case_five); - break; - - - case 7: - return (m_case_seven == x.m_case_seven); - break; - - default: - break; - } - return false; -} - -bool OctetUnion::operator !=( - const OctetUnion& x) const -{ - return !(*this == x); -} - -void OctetUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 5: - switch(__d) - { - case 5: - b = true; - break; - default: - break; - } - break; - - - case 7: - switch(__d) - { - case 7: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t OctetUnion::_d() const -{ - return m__d; -} - -uint8_t& OctetUnion::_d() -{ - return m__d; -} - -void OctetUnion::case_five( - int32_t _case_five) -{ - m_case_five = _case_five; - m__d = 5; - -} - -int32_t OctetUnion::case_five() const -{ - bool b = false; - - switch(m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_five; -} - -int32_t& OctetUnion::case_five() -{ - bool b = false; - - switch(m__d) - { - case 5: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_five; -} - - -void OctetUnion::case_seven( - int32_t _case_seven) -{ - m_case_seven = _case_seven; - m__d = 7; - -} - -int32_t OctetUnion::case_seven() const -{ - bool b = false; - - switch(m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_seven; -} - -int32_t& OctetUnion::case_seven() -{ - bool b = false; - - switch(m__d) - { - case 7: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_seven; -} - - -// TODO(Ricardo) Review -size_t OctetUnion::getCdrSerializedSize( - const OctetUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 5: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 7: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void OctetUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 5: - scdr << m_case_five; - - break; - - - case 7: - scdr << m_case_seven; - - break; - - default: - break; - } -} - -void OctetUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 5: - dcdr >> m_case_five; - - - break; - - - case 7: - dcdr >> m_case_seven; - - - break; - - default: - break; - } -} - - - - - -Int8Union::Int8Union() -{ - m__d = 3; - // long m_case_three - m_case_three = 0; - // long m_case_six - m_case_six = 0; -} - -Int8Union::~Int8Union() -{ -} - -Int8Union::Int8Union( - const Int8Union& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } -} - -Int8Union::Int8Union( - Int8Union&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } -} - -Int8Union& Int8Union::operator =( - const Int8Union& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; -} - -Int8Union& Int8Union::operator =( - Int8Union&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 3: - m_case_three = x.m_case_three; - break; - - - case 6: - m_case_six = x.m_case_six; - break; - - default: - break; - } - - return *this; -} - -bool Int8Union::operator ==( - const Int8Union& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 3: - return (m_case_three == x.m_case_three); - break; - - - case 6: - return (m_case_six == x.m_case_six); - break; - - default: - break; - } - return false; -} - -bool Int8Union::operator !=( - const Int8Union& x) const -{ - return !(*this == x); -} - -void Int8Union::_d( - int8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 3: - switch(__d) - { - case 3: - b = true; - break; - default: - break; - } - break; - - - case 6: - switch(__d) - { - case 6: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int8_t Int8Union::_d() const -{ - return m__d; -} - -int8_t& Int8Union::_d() -{ - return m__d; -} - -void Int8Union::case_three( - int32_t _case_three) -{ - m_case_three = _case_three; - m__d = 3; - -} - -int32_t Int8Union::case_three() const -{ - bool b = false; - - switch(m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_three; -} - -int32_t& Int8Union::case_three() -{ - bool b = false; - - switch(m__d) - { - case 3: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_three; -} - - -void Int8Union::case_six( - int32_t _case_six) -{ - m_case_six = _case_six; - m__d = 6; - -} - -int32_t Int8Union::case_six() const -{ - bool b = false; - - switch(m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_six; -} - -int32_t& Int8Union::case_six() -{ - bool b = false; - - switch(m__d) - { - case 6: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_case_six; -} - - -// TODO(Ricardo) Review -size_t Int8Union::getCdrSerializedSize( - const Int8Union& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 3: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 6: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void Int8Union::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 3: - scdr << m_case_three; - - break; - - - case 6: - scdr << m_case_six; - - break; - - default: - break; - } -} - -void Int8Union::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 3: - dcdr >> m_case_three; - - - break; - - - case 6: - dcdr >> m_case_six; - - - break; - - default: - break; - } -} - - - -namespace bitmodule { - -ParentBitset::ParentBitset() -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -ParentBitset::~ParentBitset() -{ -} - -ParentBitset::ParentBitset( - const ParentBitset& x) -{ - m_bitset = x.m_bitset; -} - -ParentBitset::ParentBitset( - ParentBitset&& x) noexcept -{ - m_bitset = x.m_bitset; -} - -ParentBitset& ParentBitset::operator =( - const ParentBitset& x) -{ - m_bitset = x.m_bitset; - - return *this; -} - -ParentBitset& ParentBitset::operator =( - ParentBitset&& x) noexcept -{ - m_bitset = x.m_bitset; - - return *this; -} - -bool ParentBitset::operator ==( - const ParentBitset& x) const -{ - return m_bitset == x.m_bitset; -} - -bool ParentBitset::operator !=( - const ParentBitset& x) const -{ - return !(*this == x); -} - -size_t ParentBitset::getCdrSerializedSize( - const ParentBitset&, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - current_alignment += sizeof(helper::FindType<17>::type) + - eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<17>::type)); - - return current_alignment - initial_alignment; -} - - -void ParentBitset::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - using namespace bitmodule; - - helper::FindType<17>::type bits = static_cast::type>(bitset().to_ullong()); - scdr << bits; -} - -void ParentBitset::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - using namespace bitmodule; - - helper::FindType<17>::type bits; - dcdr >> bits; - bitset(std::bitset<17>(bits)); -} - - - -void bitmodule::ParentBitset::parent_bitfield( - uint32_t _parent_bitfield) -{ - int base = 0; - int size = 17; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_parent_bitfield & 0x01)); - _parent_bitfield = _parent_bitfield >> 1; - } - -} - -uint32_t bitmodule::ParentBitset::parent_bitfield() const -{ - int base = 0; - int size = 17; - std::bitset<17> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<17> ParentBitset::bitset() const -{ - std::string str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<17>(str_value); -} - -void ParentBitset::bitset( - const std::bitset<17>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 17; - m_bitset = std::bitset<17>(str_value.substr(str_value.length() - base_diff, last_post)); -} - -MyBitset::MyBitset() - : bitmodule::ParentBitset() -{ - // Just to register all known types - registernew_features_4_2Types(); -} - -MyBitset::~MyBitset() -{ -} - -MyBitset::MyBitset( - const MyBitset& x) - : bitmodule::ParentBitset(x) -{ - m_bitset = x.m_bitset; -} - -MyBitset::MyBitset( - MyBitset&& x) noexcept - : bitmodule::ParentBitset(std::move(x)) -{ - m_bitset = x.m_bitset; -} - -MyBitset& MyBitset::operator =( - const MyBitset& x) -{ - bitmodule::ParentBitset::operator =(x); - - m_bitset = x.m_bitset; - - return *this; -} - -MyBitset& MyBitset::operator =( - MyBitset&& x) noexcept -{ - bitmodule::ParentBitset::operator =(std::move(x)); - - m_bitset = x.m_bitset; - - return *this; -} - -bool MyBitset::operator ==( - const MyBitset& x) const -{ - if (bitmodule::ParentBitset::operator !=(x)) return false; - - return m_bitset == x.m_bitset; -} - -bool MyBitset::operator !=( - const MyBitset& x) const -{ - return !(*this == x); -} - -size_t MyBitset::getCdrSerializedSize( - const MyBitset&, - size_t current_alignment) -{ - size_t initial_alignment = current_alignment; - - current_alignment += sizeof(helper::FindType<50>::type) + - eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<50>::type)); - - return current_alignment - initial_alignment; -} - - -void MyBitset::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - using namespace bitmodule; - - helper::FindType<50>::type bits = static_cast::type>(bitset().to_ullong()); - scdr << bits; -} - -void MyBitset::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - using namespace bitmodule; - - helper::FindType<50>::type bits; - dcdr >> bits; - bitset(std::bitset<50>(bits)); -} - - - -void bitmodule::MyBitset::a( - char _a) -{ - int base = 0; - int size = 3; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_a & 0x01)); - _a = _a >> 1; - } - -} - -char bitmodule::MyBitset::a() const -{ - int base = 0; - int size = 3; - std::bitset<3> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void bitmodule::MyBitset::b( - bool _b) -{ - int base = 3; - m_bitset.set(base, _b); -} - -bool bitmodule::MyBitset::b() const -{ - int base = 3; - return m_bitset.test(base); -} - - - -void bitmodule::MyBitset::c( - uint16_t _c) -{ - int base = 8; - int size = 10; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_c & 0x01)); - _c = _c >> 1; - } - -} - -uint16_t bitmodule::MyBitset::c() const -{ - int base = 8; - int size = 10; - std::bitset<10> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void bitmodule::MyBitset::d( - int16_t _d) -{ - int base = 18; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_d & 0x01)); - _d = _d >> 1; - } - -} - -int16_t bitmodule::MyBitset::d() const -{ - int base = 18; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void bitmodule::MyBitset::e( - int16_t _e) -{ - int base = 23; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_e & 0x01)); - _e = _e >> 1; - } - -} - -int16_t bitmodule::MyBitset::e() const -{ - int base = 23; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -void bitmodule::MyBitset::f( - int16_t _f) -{ - int base = 28; - int size = 5; - for (int i = base; i < base + size; ++i) - { - m_bitset.set(i, !!(_f & 0x01)); - _f = _f >> 1; - } - -} - -int16_t bitmodule::MyBitset::f() const -{ - int base = 28; - int size = 5; - std::bitset<5> aux; - for (int i = 0; i < size; ++i) - { - aux.set(i, m_bitset.test(i + base)); - } - return static_cast(aux.to_ullong()); - -} - - -std::bitset<50> MyBitset::bitset() const -{ - std::string str_value; - - str_value = static_cast(this)->bitset().to_string() + str_value; - - str_value = m_bitset.to_string() + str_value; - - return std::bitset<50>(str_value); -} - -void MyBitset::bitset( - const std::bitset<50>& bitset) -{ - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - { - base_diff += 17; - std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); - static_cast(this)->bitset(internal_bitset); - last_post = base_diff; - } - - base_diff += 33; - m_bitset = std::bitset<33>(str_value.substr(str_value.length() - base_diff, last_post)); -} - - - - -BitsetBitmask::BitsetBitmask() -{ - // bitmodule::MyBitset m_mybitset - - // bitmodule::MyBitMask m_mybitmask - - - // Just to register all known types - registernew_features_4_2Types(); -} - -BitsetBitmask::~BitsetBitmask() -{ -} - -BitsetBitmask::BitsetBitmask( - const BitsetBitmask& x) -{ - m_mybitset = x.m_mybitset; - - - m_mybitmask = x.m_mybitmask; - -} - -BitsetBitmask::BitsetBitmask( - BitsetBitmask&& x) noexcept -{ - m_mybitset = std::move(x.m_mybitset); - - - m_mybitmask = std::move(x.m_mybitmask); - -} - -BitsetBitmask& BitsetBitmask::operator =( - const BitsetBitmask& x) -{ - m_mybitset = x.m_mybitset; - - - m_mybitmask = x.m_mybitmask; - - return *this; -} - -BitsetBitmask& BitsetBitmask::operator =( - BitsetBitmask&& x) noexcept -{ - m_mybitset = std::move(x.m_mybitset); - - - m_mybitmask = std::move(x.m_mybitmask); - - return *this; -} - -bool BitsetBitmask::operator ==( - const BitsetBitmask& x) const -{ - return (m_mybitset == x.m_mybitset && - m_mybitmask == x.m_mybitmask); -} - -bool BitsetBitmask::operator !=( - const BitsetBitmask& x) const -{ - return !(*this == x); -} - -size_t BitsetBitmask::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return bitmodule_BitsetBitmask_max_cdr_typesize; -} - -size_t BitsetBitmask::getCdrSerializedSize( - const BitsetBitmask& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += bitmodule::MyBitset::getCdrSerializedSize(data.mybitset(), current_alignment); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void BitsetBitmask::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_mybitset; - - scdr << (uint8_t)m_mybitmask; - -} - -void BitsetBitmask::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_mybitset; - - - - { - uint8_t bitmask_value = 0; - dcdr >> bitmask_value; - m_mybitmask = (bitmodule::MyBitMask)bitmask_value; - } - - - -} - - -bool BitsetBitmask::isKeyDefined() -{ - return false; -} - -void BitsetBitmask::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ -void BitsetBitmask::mybitset( - const bitmodule::MyBitset& _mybitset) -{ - m_mybitset = _mybitset; -} - -/*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ -void BitsetBitmask::mybitset( - bitmodule::MyBitset&& _mybitset) -{ - m_mybitset = std::move(_mybitset); -} - -/*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ -const bitmodule::MyBitset& BitsetBitmask::mybitset() const -{ - return m_mybitset; -} - -/*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ -bitmodule::MyBitset& BitsetBitmask::mybitset() -{ - return m_mybitset; -} - - -/*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ -void BitsetBitmask::mybitmask( - const bitmodule::MyBitMask& _mybitmask) -{ - m_mybitmask = _mybitmask; -} - -/*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ -void BitsetBitmask::mybitmask( - bitmodule::MyBitMask&& _mybitmask) -{ - m_mybitmask = std::move(_mybitmask); -} - -/*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ -const bitmodule::MyBitMask& BitsetBitmask::mybitmask() const -{ - return m_mybitmask; -} - -/*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ -bitmodule::MyBitMask& BitsetBitmask::mybitmask() -{ - return m_mybitmask; -} - - - - - -BM2::BM2() - : bitmodule::BitsetBitmask() -{ - // bitmodule::MyBitMask m_two - - // long m_mylong - m_mylong = 0; - - // Just to register all known types - registernew_features_4_2Types(); -} - -BM2::~BM2() -{ -} - -BM2::BM2( - const BM2& x) - : bitmodule::BitsetBitmask(x) -{ - m_two = x.m_two; - - - m_mylong = x.m_mylong; - -} - -BM2::BM2( - BM2&& x) noexcept - : bitmodule::BitsetBitmask(std::move(x)) -{ - m_two = std::move(x.m_two); - - - m_mylong = x.m_mylong; - -} - -BM2& BM2::operator =( - const BM2& x) -{ - bitmodule::BitsetBitmask::operator =(x); - - m_two = x.m_two; - - - m_mylong = x.m_mylong; - - return *this; -} - -BM2& BM2::operator =( - BM2&& x) noexcept -{ - bitmodule::BitsetBitmask::operator =(std::move(x)); - - m_two = std::move(x.m_two); - - - m_mylong = x.m_mylong; - - return *this; -} - -bool BM2::operator ==( - const BM2& x) const -{ - if (bitmodule::BitsetBitmask::operator !=(x)) return false; - - return (m_two == x.m_two && - m_mylong == x.m_mylong); -} - -bool BM2::operator !=( - const BM2& x) const -{ - return !(*this == x); -} - -size_t BM2::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return bitmodule_BM2_max_cdr_typesize; -} - -size_t BM2::getCdrSerializedSize( - const BM2& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += bitmodule::BitsetBitmask::getCdrSerializedSize(data, current_alignment); - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void BM2::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - bitmodule::BitsetBitmask::serialize(scdr); - - scdr << (uint8_t)m_two; - - scdr << m_mylong; - -} - -void BM2::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - bitmodule::BitsetBitmask::deserialize(dcdr); - - { - uint8_t bitmask_value = 0; - dcdr >> bitmask_value; - m_two = (bitmodule::MyBitMask)bitmask_value; - } - - - - - dcdr >> m_mylong; - - -} - - -bool BM2::isKeyDefined() -{ - if (bitmodule::BitsetBitmask::isKeyDefined()) - return true; - - return false; -} - -void BM2::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - bitmodule::BitsetBitmask::serializeKey(scdr); -} - -/*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ -void BM2::two( - const bitmodule::MyBitMask& _two) -{ - m_two = _two; -} - -/*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ -void BM2::two( - bitmodule::MyBitMask&& _two) -{ - m_two = std::move(_two); -} - -/*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ -const bitmodule::MyBitMask& BM2::two() const -{ - return m_two; -} - -/*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ -bitmodule::MyBitMask& BM2::two() -{ - return m_two; -} - - -/*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ -void BM2::mylong( - int32_t _mylong) -{ - m_mylong = _mylong; -} - -/*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ -int32_t BM2::mylong() const -{ - return m_mylong; -} - -/*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ -int32_t& BM2::mylong() -{ - return m_mylong; -} - - - - - -} // namespace bitmodule - - -StructTest::StructTest() - : NewAliases() -{ - // OctetUnion m_octetUnion - - // Int8Union m_int8Union - - // bitmodule::BM2 m_myStructBits - - - // Just to register all known types - registernew_features_4_2Types(); -} - -StructTest::~StructTest() -{ -} - -StructTest::StructTest( - const StructTest& x) - : NewAliases(x) -{ - m_octetUnion = x.m_octetUnion; - - - m_int8Union = x.m_int8Union; - - - m_myStructBits = x.m_myStructBits; - -} - -StructTest::StructTest( - StructTest&& x) noexcept - : NewAliases(std::move(x)) -{ - m_octetUnion = std::move(x.m_octetUnion); - - - m_int8Union = std::move(x.m_int8Union); - - - m_myStructBits = std::move(x.m_myStructBits); - -} - -StructTest& StructTest::operator =( - const StructTest& x) -{ - NewAliases::operator =(x); - - m_octetUnion = x.m_octetUnion; - - - m_int8Union = x.m_int8Union; - - - m_myStructBits = x.m_myStructBits; - - return *this; -} - -StructTest& StructTest::operator =( - StructTest&& x) noexcept -{ - NewAliases::operator =(std::move(x)); - - m_octetUnion = std::move(x.m_octetUnion); - - - m_int8Union = std::move(x.m_int8Union); - - - m_myStructBits = std::move(x.m_myStructBits); - - return *this; -} - -bool StructTest::operator ==( - const StructTest& x) const -{ - if (NewAliases::operator !=(x)) return false; - - return (m_octetUnion == x.m_octetUnion && - m_int8Union == x.m_int8Union && - m_myStructBits == x.m_myStructBits); -} - -bool StructTest::operator !=( - const StructTest& x) const -{ - return !(*this == x); -} - -size_t StructTest::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StructTest_max_cdr_typesize; -} - -size_t StructTest::getCdrSerializedSize( - const StructTest& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += NewAliases::getCdrSerializedSize(data, current_alignment); - - current_alignment += OctetUnion::getCdrSerializedSize(data.octetUnion(), current_alignment); - - - current_alignment += Int8Union::getCdrSerializedSize(data.int8Union(), current_alignment); - - - current_alignment += bitmodule::BM2::getCdrSerializedSize(data.myStructBits(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void StructTest::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - NewAliases::serialize(scdr); - - scdr << m_octetUnion; - - scdr << m_int8Union; - - scdr << m_myStructBits; - -} - -void StructTest::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - NewAliases::deserialize(dcdr); - - dcdr >> m_octetUnion; - - - - dcdr >> m_int8Union; - - - - dcdr >> m_myStructBits; - - -} - - -bool StructTest::isKeyDefined() -{ - if (NewAliases::isKeyDefined()) - return true; - - return false; -} - -void StructTest::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - NewAliases::serializeKey(scdr); -} - -/*! - * @brief This function copies the value in member octetUnion - * @param _octetUnion New value to be copied in member octetUnion - */ -void StructTest::octetUnion( - const OctetUnion& _octetUnion) -{ - m_octetUnion = _octetUnion; -} - -/*! - * @brief This function moves the value in member octetUnion - * @param _octetUnion New value to be moved in member octetUnion - */ -void StructTest::octetUnion( - OctetUnion&& _octetUnion) -{ - m_octetUnion = std::move(_octetUnion); -} - -/*! - * @brief This function returns a constant reference to member octetUnion - * @return Constant reference to member octetUnion - */ -const OctetUnion& StructTest::octetUnion() const -{ - return m_octetUnion; -} - -/*! - * @brief This function returns a reference to member octetUnion - * @return Reference to member octetUnion - */ -OctetUnion& StructTest::octetUnion() -{ - return m_octetUnion; -} - - -/*! - * @brief This function copies the value in member int8Union - * @param _int8Union New value to be copied in member int8Union - */ -void StructTest::int8Union( - const Int8Union& _int8Union) -{ - m_int8Union = _int8Union; -} - -/*! - * @brief This function moves the value in member int8Union - * @param _int8Union New value to be moved in member int8Union - */ -void StructTest::int8Union( - Int8Union&& _int8Union) -{ - m_int8Union = std::move(_int8Union); -} - -/*! - * @brief This function returns a constant reference to member int8Union - * @return Constant reference to member int8Union - */ -const Int8Union& StructTest::int8Union() const -{ - return m_int8Union; -} - -/*! - * @brief This function returns a reference to member int8Union - * @return Reference to member int8Union - */ -Int8Union& StructTest::int8Union() -{ - return m_int8Union; -} - - -/*! - * @brief This function copies the value in member myStructBits - * @param _myStructBits New value to be copied in member myStructBits - */ -void StructTest::myStructBits( - const bitmodule::BM2& _myStructBits) -{ - m_myStructBits = _myStructBits; -} - -/*! - * @brief This function moves the value in member myStructBits - * @param _myStructBits New value to be moved in member myStructBits - */ -void StructTest::myStructBits( - bitmodule::BM2&& _myStructBits) -{ - m_myStructBits = std::move(_myStructBits); -} - -/*! - * @brief This function returns a constant reference to member myStructBits - * @return Constant reference to member myStructBits - */ -const bitmodule::BM2& StructTest::myStructBits() const -{ - return m_myStructBits; -} - -/*! - * @brief This function returns a reference to member myStructBits - * @return Reference to member myStructBits - */ -bitmodule::BM2& StructTest::myStructBits() -{ - return m_myStructBits; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2v1.h b/test/unittest/dynamic_types/idl/new_features_4_2v1.h deleted file mode 100644 index d66f6b145e6..00000000000 --- a/test/unittest/dynamic_types/idl/new_features_4_2v1.h +++ /dev/null @@ -1,1738 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file new_features_4_2.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ -#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(NEW_FEATURES_4_2_SOURCE) -#define NEW_FEATURES_4_2_DllAPI __declspec( dllexport ) -#else -#define NEW_FEATURES_4_2_DllAPI __declspec( dllimport ) -#endif // NEW_FEATURES_4_2_SOURCE -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define NEW_FEATURES_4_2_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure NewAliases defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport NewAliases(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~NewAliases(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - const NewAliases& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases( - NewAliases&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - const NewAliases& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object NewAliases that will be copied. - */ - eProsima_user_DllExport NewAliases& operator =( - NewAliases&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator ==( - const NewAliases& x) const; - - /*! - * @brief Comparison operator. - * @param x NewAliases object to compare. - */ - eProsima_user_DllExport bool operator !=( - const NewAliases& x) const; - - /*! - * @brief This function sets a value in member int8_ - * @param _int8_ New value for member int8_ - */ - eProsima_user_DllExport void int8_( - int8_t _int8_); - - /*! - * @brief This function returns the value of member int8_ - * @return Value of member int8_ - */ - eProsima_user_DllExport int8_t int8_() const; - - /*! - * @brief This function returns a reference to member int8_ - * @return Reference to member int8_ - */ - eProsima_user_DllExport int8_t& int8_(); - - - /*! - * @brief This function sets a value in member uint8_ - * @param _uint8_ New value for member uint8_ - */ - eProsima_user_DllExport void uint8_( - uint8_t _uint8_); - - /*! - * @brief This function returns the value of member uint8_ - * @return Value of member uint8_ - */ - eProsima_user_DllExport uint8_t uint8_() const; - - /*! - * @brief This function returns a reference to member uint8_ - * @return Reference to member uint8_ - */ - eProsima_user_DllExport uint8_t& uint8_(); - - - /*! - * @brief This function sets a value in member int16_ - * @param _int16_ New value for member int16_ - */ - eProsima_user_DllExport void int16_( - int16_t _int16_); - - /*! - * @brief This function returns the value of member int16_ - * @return Value of member int16_ - */ - eProsima_user_DllExport int16_t int16_() const; - - /*! - * @brief This function returns a reference to member int16_ - * @return Reference to member int16_ - */ - eProsima_user_DllExport int16_t& int16_(); - - - /*! - * @brief This function sets a value in member uint16_ - * @param _uint16_ New value for member uint16_ - */ - eProsima_user_DllExport void uint16_( - uint16_t _uint16_); - - /*! - * @brief This function returns the value of member uint16_ - * @return Value of member uint16_ - */ - eProsima_user_DllExport uint16_t uint16_() const; - - /*! - * @brief This function returns a reference to member uint16_ - * @return Reference to member uint16_ - */ - eProsima_user_DllExport uint16_t& uint16_(); - - - /*! - * @brief This function sets a value in member int32_ - * @param _int32_ New value for member int32_ - */ - eProsima_user_DllExport void int32_( - int32_t _int32_); - - /*! - * @brief This function returns the value of member int32_ - * @return Value of member int32_ - */ - eProsima_user_DllExport int32_t int32_() const; - - /*! - * @brief This function returns a reference to member int32_ - * @return Reference to member int32_ - */ - eProsima_user_DllExport int32_t& int32_(); - - - /*! - * @brief This function sets a value in member uint32_ - * @param _uint32_ New value for member uint32_ - */ - eProsima_user_DllExport void uint32_( - uint32_t _uint32_); - - /*! - * @brief This function returns the value of member uint32_ - * @return Value of member uint32_ - */ - eProsima_user_DllExport uint32_t uint32_() const; - - /*! - * @brief This function returns a reference to member uint32_ - * @return Reference to member uint32_ - */ - eProsima_user_DllExport uint32_t& uint32_(); - - - /*! - * @brief This function sets a value in member int64_ - * @param _int64_ New value for member int64_ - */ - eProsima_user_DllExport void int64_( - int64_t _int64_); - - /*! - * @brief This function returns the value of member int64_ - * @return Value of member int64_ - */ - eProsima_user_DllExport int64_t int64_() const; - - /*! - * @brief This function returns a reference to member int64_ - * @return Reference to member int64_ - */ - eProsima_user_DllExport int64_t& int64_(); - - - /*! - * @brief This function sets a value in member uint64_ - * @param _uint64_ New value for member uint64_ - */ - eProsima_user_DllExport void uint64_( - uint64_t _uint64_); - - /*! - * @brief This function returns the value of member uint64_ - * @return Value of member uint64_ - */ - eProsima_user_DllExport uint64_t uint64_() const; - - /*! - * @brief This function returns a reference to member uint64_ - * @return Reference to member uint64_ - */ - eProsima_user_DllExport uint64_t& uint64_(); - - - /*! - * @brief This function copies the value in member local_string - * @param _local_string New value to be copied in member local_string - */ - eProsima_user_DllExport void local_string( - const std::string& _local_string); - - /*! - * @brief This function moves the value in member local_string - * @param _local_string New value to be moved in member local_string - */ - eProsima_user_DllExport void local_string( - std::string&& _local_string); - - /*! - * @brief This function returns a constant reference to member local_string - * @return Constant reference to member local_string - */ - eProsima_user_DllExport const std::string& local_string() const; - - /*! - * @brief This function returns a reference to member local_string - * @return Reference to member local_string - */ - eProsima_user_DllExport std::string& local_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const NewAliases& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int8_t m_int8_; - uint8_t m_uint8_; - int16_t m_int16_; - uint16_t m_uint16_; - int32_t m_int32_; - uint32_t m_uint32_; - int64_t m_int64_; - uint64_t m_uint64_; - std::string m_local_string; - -}; - - - -/*! - * @brief This class represents the union WCharUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class WCharUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WCharUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WCharUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - const WCharUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion( - WCharUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - const WCharUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WCharUnion that will be copied. - */ - eProsima_user_DllExport WCharUnion& operator =( - WCharUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WCharUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x WCharUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WCharUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - wchar_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport wchar_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport wchar_t& _d(); - - /*! - * @brief This function sets a value in member case_zero - * @param _case_zero New value for member case_zero - */ - eProsima_user_DllExport void case_zero( - int32_t _case_zero); - - /*! - * @brief This function returns the value of member case_zero - * @return Value of member case_zero - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_zero() const; - - /*! - * @brief This function returns a reference to member case_zero - * @return Reference to member case_zero - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_zero(); - - - /*! - * @brief This function sets a value in member case_one - * @param _case_one New value for member case_one - */ - eProsima_user_DllExport void case_one( - int32_t _case_one); - - /*! - * @brief This function returns the value of member case_one - * @return Value of member case_one - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_one() const; - - /*! - * @brief This function returns a reference to member case_one - * @return Reference to member case_one - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_one(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WCharUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - wchar_t m__d; - - int32_t m_case_zero; - int32_t m_case_one; -}; - - - -/*! - * @brief This class represents the union OctetUnion defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class OctetUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport OctetUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~OctetUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - const OctetUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion( - OctetUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - const OctetUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object OctetUnion that will be copied. - */ - eProsima_user_DllExport OctetUnion& operator =( - OctetUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const OctetUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x OctetUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const OctetUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member case_five - * @param _case_five New value for member case_five - */ - eProsima_user_DllExport void case_five( - int32_t _case_five); - - /*! - * @brief This function returns the value of member case_five - * @return Value of member case_five - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_five() const; - - /*! - * @brief This function returns a reference to member case_five - * @return Reference to member case_five - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_five(); - - - /*! - * @brief This function sets a value in member case_seven - * @param _case_seven New value for member case_seven - */ - eProsima_user_DllExport void case_seven( - int32_t _case_seven); - - /*! - * @brief This function returns the value of member case_seven - * @return Value of member case_seven - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_seven() const; - - /*! - * @brief This function returns a reference to member case_seven - * @return Reference to member case_seven - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_seven(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const OctetUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - uint8_t m__d; - - int32_t m_case_five; - int32_t m_case_seven; -}; - - - -/*! - * @brief This class represents the union Int8Union defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class Int8Union -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Int8Union(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Int8Union(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - const Int8Union& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union( - Int8Union&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - const Int8Union& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Int8Union that will be copied. - */ - eProsima_user_DllExport Int8Union& operator =( - Int8Union&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Int8Union& x) const; - - /*! - * @brief Comparison operator. - * @param x Int8Union object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Int8Union& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int8_t& _d(); - - /*! - * @brief This function sets a value in member case_three - * @param _case_three New value for member case_three - */ - eProsima_user_DllExport void case_three( - int32_t _case_three); - - /*! - * @brief This function returns the value of member case_three - * @return Value of member case_three - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_three() const; - - /*! - * @brief This function returns a reference to member case_three - * @return Reference to member case_three - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_three(); - - - /*! - * @brief This function sets a value in member case_six - * @param _case_six New value for member case_six - */ - eProsima_user_DllExport void case_six( - int32_t _case_six); - - /*! - * @brief This function returns the value of member case_six - * @return Value of member case_six - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t case_six() const; - - /*! - * @brief This function returns a reference to member case_six - * @return Reference to member case_six - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& case_six(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const Int8Union& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int8_t m__d; - - int32_t m_case_three; - int32_t m_case_six; -}; - -namespace bitmodule { - /*! - * @brief This class represents the structure ParentBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class ParentBitset - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ParentBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ParentBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - const ParentBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - ParentBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - const ParentBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - ParentBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ParentBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ParentBitset& x) const; - - /*! - * @brief This function sets a value in member parent_bitfield - * @param _parent_bitfield New value for member parent_bitfield - */ - eProsima_user_DllExport void parent_bitfield( - uint32_t _parent_bitfield); - - /*! - * @brief This function returns the value of member parent_bitfield - * @return Value of member parent_bitfield - */ - eProsima_user_DllExport uint32_t parent_bitfield() const; - - - eProsima_user_DllExport std::bitset<17> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<17>&); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const bitmodule::ParentBitset& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - - private: - - std::bitset<17> m_bitset; - }; - /*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class MyBitset : public bitmodule::ParentBitset - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - char _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport char a() const; - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - bool _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport bool b() const; - - - - /*! - * @brief This function sets a value in member c - * @param _c New value for member c - */ - eProsima_user_DllExport void c( - uint16_t _c); - - /*! - * @brief This function returns the value of member c - * @return Value of member c - */ - eProsima_user_DllExport uint16_t c() const; - - - /*! - * @brief This function sets a value in member d - * @param _d New value for member d - */ - eProsima_user_DllExport void d( - int16_t _d); - - /*! - * @brief This function returns the value of member d - * @return Value of member d - */ - eProsima_user_DllExport int16_t d() const; - - - /*! - * @brief This function sets a value in member e - * @param _e New value for member e - */ - eProsima_user_DllExport void e( - int16_t _e); - - /*! - * @brief This function returns the value of member e - * @return Value of member e - */ - eProsima_user_DllExport int16_t e() const; - - - /*! - * @brief This function sets a value in member f - * @param _f New value for member f - */ - eProsima_user_DllExport void f( - int16_t _f); - - /*! - * @brief This function returns the value of member f - * @return Value of member f - */ - eProsima_user_DllExport int16_t f() const; - - - eProsima_user_DllExport std::bitset<50> bitset() const; - - eProsima_user_DllExport void bitset( - const std::bitset<50>&); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const bitmodule::MyBitset& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - - private: - - std::bitset<33> m_bitset; - }; - /*! - * @brief This class represents the bitmask MyBitMask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - enum MyBitMaskBits : uint8_t - { - flag0 = 0x01ull << 0, - flag1 = 0x01ull << 1, - flag4 = 0x01ull << 4, - flag6 = 0x01ull << 6, - flag7 = 0x01ull << 7 - }; - typedef uint8_t MyBitMask; - - - /*! - * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BitsetBitmask - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetBitmask(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetBitmask(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - const BitsetBitmask& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - const BitsetBitmask& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetBitmask& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetBitmask& x) const; - - /*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ - eProsima_user_DllExport void mybitset( - const bitmodule::MyBitset& _mybitset); - - /*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ - eProsima_user_DllExport void mybitset( - bitmodule::MyBitset&& _mybitset); - - /*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ - eProsima_user_DllExport const bitmodule::MyBitset& mybitset() const; - - /*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ - eProsima_user_DllExport bitmodule::MyBitset& mybitset(); - - - /*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - const bitmodule::MyBitMask& _mybitmask); - - /*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - bitmodule::MyBitMask&& _mybitmask); - - /*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ - eProsima_user_DllExport const bitmodule::MyBitMask& mybitmask() const; - - /*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ - eProsima_user_DllExport bitmodule::MyBitMask& mybitmask(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const bitmodule::BitsetBitmask& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - bitmodule::MyBitset m_mybitset; - bitmodule::MyBitMask m_mybitmask; - - }; - - - - /*! - * @brief This class represents the structure BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BM2 : public bitmodule::BitsetBitmask - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BM2(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BM2(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - const BM2& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - BM2&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - const BM2& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - BM2&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BM2& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BM2& x) const; - - /*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ - eProsima_user_DllExport void two( - const bitmodule::MyBitMask& _two); - - /*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ - eProsima_user_DllExport void two( - bitmodule::MyBitMask&& _two); - - /*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ - eProsima_user_DllExport const bitmodule::MyBitMask& two() const; - - /*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ - eProsima_user_DllExport bitmodule::MyBitMask& two(); - - - /*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ - eProsima_user_DllExport void mylong( - int32_t _mylong); - - /*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ - eProsima_user_DllExport int32_t mylong() const; - - /*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ - eProsima_user_DllExport int32_t& mylong(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const bitmodule::BM2& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - - private: - - bitmodule::MyBitMask m_two; - int32_t m_mylong; - - }; - -} // namespace bitmodule - - -/*! - * @brief This class represents the structure StructTest defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ -class StructTest : public NewAliases -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StructTest(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StructTest(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - const StructTest& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest( - StructTest&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - const StructTest& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StructTest that will be copied. - */ - eProsima_user_DllExport StructTest& operator =( - StructTest&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StructTest& x) const; - - /*! - * @brief Comparison operator. - * @param x StructTest object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StructTest& x) const; - - /*! - * @brief This function copies the value in member octetUnion - * @param _octetUnion New value to be copied in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - const OctetUnion& _octetUnion); - - /*! - * @brief This function moves the value in member octetUnion - * @param _octetUnion New value to be moved in member octetUnion - */ - eProsima_user_DllExport void octetUnion( - OctetUnion&& _octetUnion); - - /*! - * @brief This function returns a constant reference to member octetUnion - * @return Constant reference to member octetUnion - */ - eProsima_user_DllExport const OctetUnion& octetUnion() const; - - /*! - * @brief This function returns a reference to member octetUnion - * @return Reference to member octetUnion - */ - eProsima_user_DllExport OctetUnion& octetUnion(); - - - /*! - * @brief This function copies the value in member int8Union - * @param _int8Union New value to be copied in member int8Union - */ - eProsima_user_DllExport void int8Union( - const Int8Union& _int8Union); - - /*! - * @brief This function moves the value in member int8Union - * @param _int8Union New value to be moved in member int8Union - */ - eProsima_user_DllExport void int8Union( - Int8Union&& _int8Union); - - /*! - * @brief This function returns a constant reference to member int8Union - * @return Constant reference to member int8Union - */ - eProsima_user_DllExport const Int8Union& int8Union() const; - - /*! - * @brief This function returns a reference to member int8Union - * @return Reference to member int8Union - */ - eProsima_user_DllExport Int8Union& int8Union(); - - - /*! - * @brief This function copies the value in member myStructBits - * @param _myStructBits New value to be copied in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - const bitmodule::BM2& _myStructBits); - - /*! - * @brief This function moves the value in member myStructBits - * @param _myStructBits New value to be moved in member myStructBits - */ - eProsima_user_DllExport void myStructBits( - bitmodule::BM2&& _myStructBits); - - /*! - * @brief This function returns a constant reference to member myStructBits - * @return Constant reference to member myStructBits - */ - eProsima_user_DllExport const bitmodule::BM2& myStructBits() const; - - /*! - * @brief This function returns a reference to member myStructBits - * @return Reference to member myStructBits - */ - eProsima_user_DllExport bitmodule::BM2& myStructBits(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StructTest& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - OctetUnion m_octetUnion; - Int8Union m_int8Union; - bitmodule::BM2 m_myStructBits; - -}; - - -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/types_profile.xml b/test/unittest/dynamic_types/types_profile.xml deleted file mode 100644 index bb0bffdfe07..00000000000 --- a/test/unittest/dynamic_types/types_profile.xml +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/unittest/logging/CMakeLists.txt b/test/unittest/logging/CMakeLists.txt index be92901677e..1c3cbceba53 100644 --- a/test/unittest/logging/CMakeLists.txt +++ b/test/unittest/logging/CMakeLists.txt @@ -19,10 +19,6 @@ if(WIN32) endif() set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -57,7 +53,11 @@ target_include_directories(LogTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogTests GTest::gtest ${MOCKS} +target_link_libraries(LogTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogTests) @@ -67,8 +67,8 @@ set(LOGFILETESTS_TEST_SOURCE LogFileTests.cpp) set(LOGFILETESTS_SOURCE ${LOG_COMMON_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${LOGFILETESTS_TEST_SOURCE}) + ${LOGFILETESTS_TEST_SOURCE} + ) # External sources if(TINYXML2_SOURCE_DIR) @@ -97,5 +97,6 @@ target_link_libraries(LogFileTests GTest::gtest ${MOCKS} $<$:iphlpapi$Shlwapi> ${TINYXML2_LIBRARY} fastcdr + fastdds::log ) gtest_discover_tests(LogFileTests) diff --git a/test/unittest/logging/log_macros/CMakeLists.txt b/test/unittest/logging/log_macros/CMakeLists.txt index 0e0b64f5954..8e25c598db3 100644 --- a/test/unittest/logging/log_macros/CMakeLists.txt +++ b/test/unittest/logging/log_macros/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -51,7 +47,11 @@ target_include_directories(LogMacrosAllActiveTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosAllActiveTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosAllActiveTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosAllActiveTests) @@ -75,7 +75,11 @@ target_include_directories(LogMacrosNoInfoTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoInfoTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoInfoTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoInfoTests) @@ -99,7 +103,11 @@ target_include_directories(LogMacrosNoWarningTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoWarningTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoWarningTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoWarningTests) @@ -123,7 +131,11 @@ target_include_directories(LogMacrosNoErrorTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoErrorTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoErrorTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoErrorTests) @@ -147,7 +159,11 @@ target_include_directories(LogMacrosDefaultTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosDefaultTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosDefaultTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosDefaultTests) @@ -173,7 +189,11 @@ target_include_directories(LogMacrosInternalDebugOffTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosInternalDebugOffTests GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosInternalDebugOffTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosInternalDebugOffTests) @@ -196,7 +216,11 @@ target_include_directories(OldLogMacrosTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosTests GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(OldLogMacrosTests) @@ -220,7 +244,11 @@ target_include_directories(OldLogMacrosDisableTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosDisableTests GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosDisableTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(OldLogMacrosDisableTests) diff --git a/test/unittest/rtps/DataSharing/CMakeLists.txt b/test/unittest/rtps/DataSharing/CMakeLists.txt index ca66e5558ce..b769066e807 100644 --- a/test/unittest/rtps/DataSharing/CMakeLists.txt +++ b/test/unittest/rtps/DataSharing/CMakeLists.txt @@ -38,7 +38,7 @@ target_include_directories(SHMSegmentTests PRIVATE ${THIRDPARTY_BOOST_INCLUDE_DIR} ) target_link_libraries(SHMSegmentTests - fastcdr fastrtps foonathan_memory + fastcdr fastdds foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} ${CMAKE_DL_LIBS} diff --git a/test/unittest/rtps/DataSharing/SHMSegmentTests.cpp b/test/unittest/rtps/DataSharing/SHMSegmentTests.cpp index 495cdde0aa9..70cb3f07343 100644 --- a/test/unittest/rtps/DataSharing/SHMSegmentTests.cpp +++ b/test/unittest/rtps/DataSharing/SHMSegmentTests.cpp @@ -12,22 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "fastdds/rtps/common/Types.h" -#include "fastrtps/qos/QosPolicies.h" #include #include -#include +#include "fastdds/rtps/common/Types.h" +#include +#include #include +#include #include -#include +#include #include #include #include -#include - namespace eprosima { namespace fastrtps { namespace rtps { diff --git a/test/unittest/rtps/builtin/BuiltinDataSerializationTests.cpp b/test/unittest/rtps/builtin/BuiltinDataSerializationTests.cpp index ae7274f243a..76cd708b1bc 100644 --- a/test/unittest/rtps/builtin/BuiltinDataSerializationTests.cpp +++ b/test/unittest/rtps/builtin/BuiltinDataSerializationTests.cpp @@ -20,16 +20,16 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include #include @@ -140,8 +140,9 @@ TEST(BuiltinDataSerializationTests, ok_with_defaults) } } -// Regression test for redmine issue #10547 -TEST(BuiltinDataSerializationTests, ignore_unsupported_type_info) +// Regression test for redmine issue #10547. +// Update against OpenDDS 3.27. With this version we can read the remote DATA(w). +TEST(BuiltinDataSerializationTests, interoperability_with_opendds_3_27) { // DATA(w) { @@ -153,16 +154,17 @@ TEST(BuiltinDataSerializationTests, ignore_unsupported_type_info) // Topic name 0x05, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x00, 0x00, 0x43, 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, - // Type information - 0x75, 0x00, 0x50, 0x00, - 0x4c, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0xf1, 0x80, 0x99, 0x5e, 0xfc, 0xdb, 0xda, 0xbe, 0xd5, 0xb3, 0x3d, 0xe3, - 0xea, 0x3a, 0x4b, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x10, 0x00, 0x40, 0x18, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Type name 0x07, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x53, 0x68, 0x61, 0x70, 0x65, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, + // Type information + 0x75, 0x00, 0x58, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0xf1, 0x8b, 0x4b, 0x28, 0x4d, 0xe3, 0xa2, 0x4e, 0x5f, 0x86, 0x58, 0x5c, + 0x57, 0x88, 0xf6, 0x00, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x40, 0x1c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reliability 0x1a, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0xf5, 0x05, @@ -171,15 +173,27 @@ TEST(BuiltinDataSerializationTests, ignore_unsupported_type_info) 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // Endpoint GUID 0x5a, 0x00, 0x10, 0x00, - 0x01, 0x03, 0x08, 0x00, 0x27, 0x5c, 0x4f, 0x05, 0x0f, 0x19, 0x05, 0xea, 0x00, 0x00, 0x00, 0x02, + 0x01, 0x03, 0x74, 0x04, 0xf1, 0x0b, 0x6b, 0x16, 0x94, 0x6c, 0x26, 0x73, 0x00, 0x00, 0x00, 0x02, // Multicast locator 0x30, 0x00, 0x18, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe9, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x00, 0x02, // Unicast locator 0x2f, 0x00, 0x18, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x3e, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0xb4, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0x27, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x00, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x05, 0x00, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x50, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0x8b, // Sentinel 0x01, 0x00, 0x00, 0x00 }; @@ -203,35 +217,45 @@ TEST(BuiltinDataSerializationTests, ignore_unsupported_type_info) 0x05, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x00, 0x00, 0x43, 0x69, 0x72, 0x63, 0x6c, 0x65, 0x00, 0x00, // Type information - 0x75, 0x00, 0x50, 0x00, - 0x4c, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x24, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0xf1, 0x80, 0x99, 0x5e, 0xfc, 0xdb, 0xda, 0xbe, 0xd5, 0xb3, 0x3d, 0xe3, - 0xea, 0x3a, 0x4b, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x10, 0x00, 0x40, 0x18, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x75, 0x00, 0x58, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0xf1, 0x8b, 0x4b, 0x28, 0x4d, 0xe3, 0xa2, 0x4e, 0x5f, 0x86, 0x58, 0x5c, + 0x57, 0x88, 0xf6, 0x00, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x40, 0x1c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Type name 0x07, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x53, 0x68, 0x61, 0x70, 0x65, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, // Reliability 0x1a, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, - // Endpoint GUID - 0x5a, 0x00, 0x10, 0x00, - 0x01, 0x03, 0x08, 0x00, 0x27, 0x5c, 0x4f, 0x05, 0x0f, 0x40, 0x29, 0x9d, 0x00, 0x00, 0x00, 0x07, // Data representation 0x73, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x94, 0xd0, 0x00, 0x00, + // Endpoint GUID + 0x5a, 0x00, 0x10, 0x00, + 0x01, 0x03, 0x74, 0x04, 0xf1, 0x0b, 0x6b, 0x16, 0x84, 0x3e, 0x9d, 0x2b, 0x00, 0x00, 0x00, 0x07, // Multicast locator 0x30, 0x00, 0x18, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe9, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x00, 0x02, // Unicast locator 0x2f, 0x00, 0x18, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x45, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0xb4, - // Type consistency - 0x74, 0x00, 0x08, 0x00, - 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0x27, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x00, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x05, 0x00, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x50, 0x01, + 0x2f, 0x00, 0x18, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x67, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, 0x01, 0x8b, // Sentinel 0x01, 0x00, 0x00, 0x00 }; diff --git a/test/unittest/rtps/builtin/CMakeLists.txt b/test/unittest/rtps/builtin/CMakeLists.txt index 6080be5c018..79d207a3766 100644 --- a/test/unittest/rtps/builtin/CMakeLists.txt +++ b/test/unittest/rtps/builtin/CMakeLists.txt @@ -13,36 +13,12 @@ # limitations under the License. set(BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE BuiltinDataSerializationTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp @@ -88,13 +64,18 @@ target_compile_definitions(BuiltinDataSerializationTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(BuiltinDataSerializationTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) -target_link_libraries(BuiltinDataSerializationTests foonathan_memory +target_link_libraries(BuiltinDataSerializationTests + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) if(QNX) diff --git a/test/unittest/rtps/common/CMakeLists.txt b/test/unittest/rtps/common/CMakeLists.txt index 1aaa1f32094..770533a4d34 100644 --- a/test/unittest/rtps/common/CMakeLists.txt +++ b/test/unittest/rtps/common/CMakeLists.txt @@ -15,10 +15,6 @@ set(CACHECHANGETESTS_SOURCE CacheChangeTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) set(GUID_UTILS_TESTS_SOURCE GuidUtilsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -47,10 +43,6 @@ endif() set(SEQUENCENUMBERTESTS_SOURCE SequenceNumberTests.cpp) set(PORTPARAMETERSTESTS_SOURCE PortParametersTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -89,7 +81,11 @@ target_include_directories(GuidUtilsTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}>) -target_link_libraries(GuidUtilsTests GTest::gtest) +target_link_libraries(GuidUtilsTests + fastcdr + fastdds::log + GTest::gtest + ) if(QNX) target_link_libraries(GuidUtilsTests socket) endif() @@ -119,7 +115,11 @@ target_include_directories(PortParametersTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(PortParametersTests GTest::gtest) +target_link_libraries(PortParametersTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(PortParametersTests PROPERTIES LABELS "NoMemoryCheck") ################### diff --git a/test/unittest/rtps/common/CacheChangeTests.cpp b/test/unittest/rtps/common/CacheChangeTests.cpp index d9f07608ad6..bdc53a79063 100644 --- a/test/unittest/rtps/common/CacheChangeTests.cpp +++ b/test/unittest/rtps/common/CacheChangeTests.cpp @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include #include + #include +#include + using namespace eprosima::fastrtps::rtps; struct FragmentTestStep @@ -28,12 +29,14 @@ struct FragmentTestStep { uint32_t initial_fragment; uint16_t num_fragments; - } input; + } + input; struct __Check { bool missing_fragments[10]; - } check; + } + check; void do_test( CacheChange_t& uut) const @@ -134,7 +137,7 @@ TEST(CacheChange, FragmentManagement) int main( int argc, - char **argv) + char** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/test/unittest/rtps/common/PortParametersTests.cpp b/test/unittest/rtps/common/PortParametersTests.cpp index 6eb2bdd5b69..a0eacc02ab3 100644 --- a/test/unittest/rtps/common/PortParametersTests.cpp +++ b/test/unittest/rtps/common/PortParametersTests.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include + #include +#include + using namespace eprosima::fastrtps::rtps; /*! @@ -88,7 +89,9 @@ TEST(PortParametersDeathTest, Limit_Multicast_Domain_FAIL) ASSERT_EXIT( { params.getMulticastPort(233); }, ::testing::ExitedWithCode(EXIT_FAILURE), ""); } -int main(int argc, char **argv) +int main( + int argc, + char** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/test/unittest/rtps/common/SequenceNumberTests.cpp b/test/unittest/rtps/common/SequenceNumberTests.cpp index 09708e42021..96f8252832b 100644 --- a/test/unittest/rtps/common/SequenceNumberTests.cpp +++ b/test/unittest/rtps/common/SequenceNumberTests.cpp @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include + #include +#include + using namespace eprosima::fastrtps::rtps; /*! @@ -445,7 +446,7 @@ TEST(SequenceNumberSet, AddOperation) ASSERT_TRUE(set.add(seq)); seq += 3; - + ASSERT_FALSE(set.add(seq)); } @@ -490,7 +491,9 @@ TEST(SequenceNumberSet, GetMaxSeqNumOperation) ASSERT_EQ(set.max(), expected_seq); } -int main(int argc, char **argv) +int main( + int argc, + char** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/test/unittest/rtps/common/TimeTests.cpp b/test/unittest/rtps/common/TimeTests.cpp index 5f8521bfc20..ca00d4e278c 100644 --- a/test/unittest/rtps/common/TimeTests.cpp +++ b/test/unittest/rtps/common/TimeTests.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include +#include + using namespace eprosima::fastrtps::rtps; /* diff --git a/test/unittest/rtps/discovery/CMakeLists.txt b/test/unittest/rtps/discovery/CMakeLists.txt index b0217786eff..c3bbc5c71e2 100644 --- a/test/unittest/rtps/discovery/CMakeLists.txt +++ b/test/unittest/rtps/discovery/CMakeLists.txt @@ -14,32 +14,6 @@ #EDP TESTS set(EDPTESTS_SOURCE EdpTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp @@ -89,11 +63,15 @@ target_include_directories(EdpTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityManager + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} ) -target_link_libraries(EdpTests foonathan_memory +target_link_libraries(EdpTests + fastdds::log + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) if(QNX) @@ -131,36 +109,11 @@ if(TLS_FOUND) endif() set(PDPTESTS_SOURCE PDPTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp @@ -189,7 +142,7 @@ set(PDPTESTS_SOURCE PDPTests.cpp add_executable(PDPTests ${PDPTESTS_SOURCE}) -target_compile_definitions(PDPTests PRIVATE FASTRTPS_NO_LIB +target_compile_definitions(PDPTests PRIVATE FASTDDS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE $<$>,$>:__DEBUG> @@ -220,7 +173,9 @@ target_include_directories(PDPTests PRIVATE ${Asio_INCLUDE_DIR} ) -target_link_libraries(PDPTests foonathan_memory +target_link_libraries(PDPTests + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) diff --git a/test/unittest/rtps/discovery/EdpTests.cpp b/test/unittest/rtps/discovery/EdpTests.cpp index 930d13ba9dc..f092e87bbbe 100644 --- a/test/unittest/rtps/discovery/EdpTests.cpp +++ b/test/unittest/rtps/discovery/EdpTests.cpp @@ -15,14 +15,14 @@ #include #include -#include -#include -#include -#include +#include +#include + +#include +#include #include #include - namespace eprosima { namespace fastrtps { namespace rtps { @@ -133,6 +133,8 @@ class EdpTests : public ::testing::Test void set_incompatible_type() { rdata->typeName("AnotherTypeName"); + rdata->type_information().assigned(false); + wdata->type_information().assigned(false); } void check_expectations( @@ -266,23 +268,39 @@ TEST_F(EdpTests, CheckPartitionCompatibility) TEST_F(EdpTests, CheckDurabilityCompatibility) { - std::vector> testing_cases{ - { PERSISTENT_DURABILITY_QOS, PERSISTENT_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { PERSISTENT_DURABILITY_QOS, TRANSIENT_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { PERSISTENT_DURABILITY_QOS, TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { PERSISTENT_DURABILITY_QOS, VOLATILE_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { TRANSIENT_DURABILITY_QOS, PERSISTENT_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { TRANSIENT_DURABILITY_QOS, TRANSIENT_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { TRANSIENT_DURABILITY_QOS, TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { TRANSIENT_DURABILITY_QOS, VOLATILE_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { TRANSIENT_LOCAL_DURABILITY_QOS, PERSISTENT_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { TRANSIENT_LOCAL_DURABILITY_QOS, TRANSIENT_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { TRANSIENT_LOCAL_DURABILITY_QOS, TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { TRANSIENT_LOCAL_DURABILITY_QOS, VOLATILE_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { VOLATILE_DURABILITY_QOS, PERSISTENT_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { VOLATILE_DURABILITY_QOS, TRANSIENT_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { VOLATILE_DURABILITY_QOS, TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::DURABILITY_QOS_POLICY_ID}, - { VOLATILE_DURABILITY_QOS, VOLATILE_DURABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID} + std::vector> testing_cases{ + { fastdds::dds::PERSISTENT_DURABILITY_QOS, fastdds::dds::PERSISTENT_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::PERSISTENT_DURABILITY_QOS, fastdds::dds::TRANSIENT_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::PERSISTENT_DURABILITY_QOS, fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::PERSISTENT_DURABILITY_QOS, fastdds::dds::VOLATILE_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_DURABILITY_QOS, fastdds::dds::PERSISTENT_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_DURABILITY_QOS, fastdds::dds::TRANSIENT_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_DURABILITY_QOS, fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_DURABILITY_QOS, fastdds::dds::VOLATILE_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::PERSISTENT_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::TRANSIENT_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, fastdds::dds::VOLATILE_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::VOLATILE_DURABILITY_QOS, fastdds::dds::PERSISTENT_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::VOLATILE_DURABILITY_QOS, fastdds::dds::TRANSIENT_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::VOLATILE_DURABILITY_QOS, fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS, + fastdds::dds::DURABILITY_QOS_POLICY_ID}, + { fastdds::dds::VOLATILE_DURABILITY_QOS, fastdds::dds::VOLATILE_DURABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID} }; for (auto testing_case : testing_cases) @@ -311,11 +329,14 @@ TEST_F(EdpTests, CheckDeadlineCompatibility) TEST_F(EdpTests, CheckOwnershipCompatibility) { - std::vector> testing_cases{ - { SHARED_OWNERSHIP_QOS, SHARED_OWNERSHIP_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { SHARED_OWNERSHIP_QOS, EXCLUSIVE_OWNERSHIP_QOS, fastdds::dds::OWNERSHIP_QOS_POLICY_ID}, - { EXCLUSIVE_OWNERSHIP_QOS, SHARED_OWNERSHIP_QOS, fastdds::dds::OWNERSHIP_QOS_POLICY_ID}, - { EXCLUSIVE_OWNERSHIP_QOS, EXCLUSIVE_OWNERSHIP_QOS, fastdds::dds::INVALID_QOS_POLICY_ID} + std::vector> testing_cases{ + { fastdds::dds::SHARED_OWNERSHIP_QOS, fastdds::dds::SHARED_OWNERSHIP_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::SHARED_OWNERSHIP_QOS, fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS, + fastdds::dds::OWNERSHIP_QOS_POLICY_ID}, + { fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS, fastdds::dds::SHARED_OWNERSHIP_QOS, + fastdds::dds::OWNERSHIP_QOS_POLICY_ID}, + { fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS, fastdds::dds::EXCLUSIVE_OWNERSHIP_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID} }; for (auto testing_case : testing_cases) @@ -328,17 +349,25 @@ TEST_F(EdpTests, CheckOwnershipCompatibility) TEST_F(EdpTests, CheckLivelinessKindCompatibility) { - std::vector> testing_cases{ - { MANUAL_BY_TOPIC_LIVELINESS_QOS, MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { MANUAL_BY_TOPIC_LIVELINESS_QOS, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { MANUAL_BY_TOPIC_LIVELINESS_QOS, AUTOMATIC_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::LIVELINESS_QOS_POLICY_ID}, - { MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + std::vector> testing_cases{ + { fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, + fastdds::dds::LIVELINESS_QOS_POLICY_ID}, + { fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, AUTOMATIC_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { AUTOMATIC_LIVELINESS_QOS, MANUAL_BY_TOPIC_LIVELINESS_QOS, fastdds::dds::LIVELINESS_QOS_POLICY_ID}, - { AUTOMATIC_LIVELINESS_QOS, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, fastdds::dds::LIVELINESS_QOS_POLICY_ID}, - { AUTOMATIC_LIVELINESS_QOS, AUTOMATIC_LIVELINESS_QOS, fastdds::dds::INVALID_QOS_POLICY_ID} + { fastdds::dds::AUTOMATIC_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, + fastdds::dds::LIVELINESS_QOS_POLICY_ID}, + { fastdds::dds::AUTOMATIC_LIVELINESS_QOS, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + fastdds::dds::LIVELINESS_QOS_POLICY_ID}, + { fastdds::dds::AUTOMATIC_LIVELINESS_QOS, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID} }; for (auto testing_case : testing_cases) @@ -367,11 +396,15 @@ TEST_F(EdpTests, CheckLeaseDurationCompatibility) TEST_F(EdpTests, CheckReliabilityCompatibility) { - std::vector> testing_cases{ - { RELIABLE_RELIABILITY_QOS, RELIABLE_RELIABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { RELIABLE_RELIABILITY_QOS, BEST_EFFORT_RELIABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID}, - { BEST_EFFORT_RELIABILITY_QOS, RELIABLE_RELIABILITY_QOS, fastdds::dds::RELIABILITY_QOS_POLICY_ID}, - { BEST_EFFORT_RELIABILITY_QOS, BEST_EFFORT_RELIABILITY_QOS, fastdds::dds::INVALID_QOS_POLICY_ID} + std::vector> testing_cases{ + { fastdds::dds::RELIABLE_RELIABILITY_QOS, fastdds::dds::RELIABLE_RELIABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::RELIABLE_RELIABILITY_QOS, fastdds::dds::BEST_EFFORT_RELIABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID}, + { fastdds::dds::BEST_EFFORT_RELIABILITY_QOS, fastdds::dds::RELIABLE_RELIABILITY_QOS, + fastdds::dds::RELIABILITY_QOS_POLICY_ID}, + { fastdds::dds::BEST_EFFORT_RELIABILITY_QOS, fastdds::dds::BEST_EFFORT_RELIABILITY_QOS, + fastdds::dds::INVALID_QOS_POLICY_ID} }; for (auto testing_case : testing_cases) @@ -401,28 +434,38 @@ TEST_F(EdpTests, CheckPositiveAckCompatibility) TEST_F(EdpTests, CheckDataRepresentationCompatibility) { - using DataRepresentationQosVector = std::vector; + using DataRepresentationQosVector = std::vector; std::vector> testing_cases{ { {}, {}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {}, {DataRepresentationId::XCDR_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {}, {DataRepresentationId::XCDR_DATA_REPRESENTATION, DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + { {}, {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, + { {}, + {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION, + fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {}, {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR_DATA_REPRESENTATION}, {}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR_DATA_REPRESENTATION}, {DataRepresentationId::XCDR_DATA_REPRESENTATION}, + { {}, {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, + { {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, {}, fastdds::dds::INVALID_QOS_POLICY_ID}, + { {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR_DATA_REPRESENTATION}, - {DataRepresentationId::XCDR_DATA_REPRESENTATION, DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + { {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION, + fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR_DATA_REPRESENTATION}, {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + { {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, + { {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, {}, fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, {}, fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, {DataRepresentationId::XCDR_DATA_REPRESENTATION}, + { {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION}, fastdds::dds::DATAREPRESENTATION_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, - {DataRepresentationId::XCDR_DATA_REPRESENTATION, DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + { {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR_DATA_REPRESENTATION, + fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID}, - { {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, {DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + { {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, + {fastdds::dds::DataRepresentationId::XCDR2_DATA_REPRESENTATION}, fastdds::dds::INVALID_QOS_POLICY_ID} }; diff --git a/test/unittest/rtps/discovery/PDPTests.cpp b/test/unittest/rtps/discovery/PDPTests.cpp index 67321b3cd97..cae1a91143d 100644 --- a/test/unittest/rtps/discovery/PDPTests.cpp +++ b/test/unittest/rtps/discovery/PDPTests.cpp @@ -13,25 +13,25 @@ // limitations under the License. #include -#include #include +#include #include +#include + #include #include -#include #include -#include #include #include #include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include #include @@ -47,17 +47,6 @@ #endif // if defined(_WIN32) namespace eprosima { - -namespace fastdds { -namespace dds { -namespace builtin { - -const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -} // namespace builtin -} // namespace dds -} // namespace fastdds - namespace fastrtps { namespace rtps { @@ -262,17 +251,6 @@ class Listener : public eprosima::fastdds::dds::DomainParticipantListener { } - void on_participant_discovery( - fastdds::dds::DomainParticipant* participant, - fastrtps::rtps::ParticipantDiscoveryInfo&& /*info*/) override - { - if (std::find(p_matched_.begin(), p_matched_.end(), participant->guid()) == p_matched_.end()) - { - matched++; - p_matched_.push_back(participant->guid()); - } - } - void on_participant_discovery( fastdds::dds::DomainParticipant* participant, fastrtps::rtps::ParticipantDiscoveryInfo&& /*info*/, diff --git a/test/unittest/rtps/domain/CMakeLists.txt b/test/unittest/rtps/domain/CMakeLists.txt new file mode 100644 index 00000000000..c6253245c05 --- /dev/null +++ b/test/unittest/rtps/domain/CMakeLists.txt @@ -0,0 +1,67 @@ +# Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(RTPS_DOMAIN_TESTS_EXEC RTPSDomainTests) + +file(GLOB RTPS_DOMAIN_TESTS_SOURCE + RTPSDomainTests.cpp + ) + +# External sources +if(TINYXML2_SOURCE_DIR) + list(APPEND RTPS_DOMAIN_TESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ) +endif() + +if(TINYXML2_INCLUDE_DIR) + include_directories(${TINYXML2_INCLUDE_DIR}) +endif(TINYXML2_INCLUDE_DIR) + +if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) +endif() + +add_executable( + ${RTPS_DOMAIN_TESTS_EXEC} + ${RTPS_DOMAIN_TESTS_SOURCE} + ) + +target_compile_definitions(${RTPS_DOMAIN_TESTS_EXEC} PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + +target_include_directories( + ${RTPS_DOMAIN_TESTS_EXEC} + PRIVATE + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ${Asio_INCLUDE_DIR} + ) + +target_link_libraries( + ${RTPS_DOMAIN_TESTS_EXEC} + GTest::gmock + ${CMAKE_DL_LIBS} + fastcdr + fastdds + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ${TINYXML2_LIBRARY} + ) + +gtest_discover_tests(${RTPS_DOMAIN_TESTS_EXEC}) diff --git a/test/unittest/rtps/domain/RTPSDomainTests.cpp b/test/unittest/rtps/domain/RTPSDomainTests.cpp new file mode 100644 index 00000000000..ed89b579c8f --- /dev/null +++ b/test/unittest/rtps/domain/RTPSDomainTests.cpp @@ -0,0 +1,107 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include +#include +#include + +/** + * This test checks the getter and setter for the library settings in the RTPS layer. + */ +TEST(RTPSDomainTests, library_settings_test) +{ + eprosima::fastdds::LibrarySettings library_settings; + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + // Get LibrarySettings default values +#if HAVE_STRICT_REALTIME + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); +#else + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_FULL, library_settings.intraprocess_delivery); +#endif // if HAVE_STRICT_REALTIME + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY; + // Setting the library settings within an empty RTPSDomain shall return true + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Create RTPSParticipant + eprosima::fastrtps::rtps::RTPSParticipantAttributes part_attr; + eprosima::fastrtps::rtps::RTPSParticipant* participant = + eprosima::fastrtps::rtps::RTPSDomain::createParticipant(0, part_attr); + ASSERT_NE(nullptr, participant); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with any RTPSParticipant shall fail + EXPECT_FALSE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_USER_DATA_ONLY, library_settings.intraprocess_delivery); + // Remove RTPSParticipant + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::removeRTPSParticipant(participant)); + library_settings.intraprocess_delivery = eprosima::fastdds::INTRAPROCESS_OFF; + // Setting LibrarySettings with no participants shall suceed + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::set_library_settings(library_settings)); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_library_settings(library_settings)); + EXPECT_EQ(eprosima::fastdds::INTRAPROCESS_OFF, library_settings.intraprocess_delivery); + eprosima::fastrtps::rtps::RTPSDomain::stopAll(); +} + +/** + * This test checks get_topic_attributes_from_profile API. + */ +TEST(RTPSDomainTests, get_topic_attributes_from_profile_test) +{ + std::string profile_name = "test_profile_name"; + eprosima::fastrtps::TopicAttributes topic_att; + EXPECT_FALSE(eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(profile_name, topic_att)); + + const std::string xml = + R"( + + Test + DataTest + + KEEP_LAST + 20 + + + 5 + 2 + 1 + 20 + 10 + + +)"; + + EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_string(xml.c_str(), + xml.length()), eprosima::fastdds::dds::RETCODE_OK); + EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(profile_name, topic_att)); + EXPECT_EQ(topic_att.topicName, "Test"); + EXPECT_EQ(topic_att.topicDataType, "DataTest"); + EXPECT_EQ(topic_att.historyQos.kind, eprosima::fastdds::dds::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS); + EXPECT_EQ(topic_att.historyQos.depth, 20); + EXPECT_EQ(topic_att.resourceLimitsQos.max_samples, 5); + EXPECT_EQ(topic_att.resourceLimitsQos.max_instances, 2); + EXPECT_EQ(topic_att.resourceLimitsQos.max_samples_per_instance, 1); + EXPECT_EQ(topic_att.resourceLimitsQos.allocated_samples, 20); + EXPECT_EQ(topic_att.resourceLimitsQos.extra_samples, 10); +} + +int main( + int argc, + char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/unittest/rtps/flowcontrol/CMakeLists.txt b/test/unittest/rtps/flowcontrol/CMakeLists.txt index b5c706ae2d1..e4c7e412dc9 100644 --- a/test/unittest/rtps/flowcontrol/CMakeLists.txt +++ b/test/unittest/rtps/flowcontrol/CMakeLists.txt @@ -17,9 +17,6 @@ if(WIN32) endif() set(FLOWCONTROLLER_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -58,6 +55,7 @@ target_include_directories(FlowControllerFactoryTests PRIVATE ) target_link_libraries(FlowControllerFactoryTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -92,6 +90,7 @@ target_include_directories(FlowControllerPublishModesTests PRIVATE ) target_link_libraries(FlowControllerPublishModesTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -122,6 +121,7 @@ target_include_directories(FlowControllerSchedulersTests PRIVATE ) target_link_libraries(FlowControllerSchedulersTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) diff --git a/test/unittest/rtps/history/CMakeLists.txt b/test/unittest/rtps/history/CMakeLists.txt index 73c78eceb21..31fa6a7ca92 100644 --- a/test/unittest/rtps/history/CMakeLists.txt +++ b/test/unittest/rtps/history/CMakeLists.txt @@ -13,10 +13,6 @@ # limitations under the License. set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -32,10 +28,6 @@ set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -49,10 +41,6 @@ set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -67,10 +55,6 @@ set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp set(TOPICPAYLOADPOOLTESTS_SOURCE TopicPayloadPoolTests.cpp TopicPayloadPoolRegistryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp @@ -112,6 +96,8 @@ target_include_directories(ReaderHistoryTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(ReaderHistoryTests + fastcdr + fastdds::log GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(ReaderHistoryTests) @@ -128,6 +114,8 @@ target_include_directories(BasicPoolsTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(BasicPoolsTests + fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(BasicPoolsTests) @@ -144,6 +132,8 @@ target_include_directories(CacheChangePoolTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(CacheChangePoolTests + fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(CacheChangePoolTests) @@ -161,6 +151,8 @@ target_include_directories(TopicPayloadPoolTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(TopicPayloadPoolTests + fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(TopicPayloadPoolTests) diff --git a/test/unittest/rtps/history/ReaderHistoryTests.cpp b/test/unittest/rtps/history/ReaderHistoryTests.cpp index 9bfad247506..4f82977b609 100644 --- a/test/unittest/rtps/history/ReaderHistoryTests.cpp +++ b/test/unittest/rtps/history/ReaderHistoryTests.cpp @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/test/unittest/rtps/network/CMakeLists.txt b/test/unittest/rtps/network/CMakeLists.txt index 429a2d5e05c..8095ff14daf 100644 --- a/test/unittest/rtps/network/CMakeLists.txt +++ b/test/unittest/rtps/network/CMakeLists.txt @@ -16,10 +16,6 @@ set(NETWORKFACTORYTESTS_SOURCE NetworkFactoryTests.cpp mock/MockTransport.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -55,7 +51,6 @@ set(NETWORKFACTORYTESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ) @@ -95,7 +90,10 @@ target_include_directories(NetworkFactoryTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) -target_link_libraries(NetworkFactoryTests fastcdr foonathan_memory +target_link_libraries(NetworkFactoryTests + fastcdr + fastdds::log + foonathan_memory GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto> ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) @@ -105,34 +103,10 @@ if(QNX) endif() add_executable(ExternalLocatorsTests ExternalLocatorsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -158,13 +132,19 @@ target_compile_definitions(ExternalLocatorsTests PRIVATE ) target_include_directories(ExternalLocatorsTests PRIVATE ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ExternalLocatorsTests fastcdr +target_link_libraries(ExternalLocatorsTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl GTest::gtest ${MOCKS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) diff --git a/test/unittest/rtps/network/ExternalLocatorsTests.cpp b/test/unittest/rtps/network/ExternalLocatorsTests.cpp index cf643b0f1a5..a81467bab89 100644 --- a/test/unittest/rtps/network/ExternalLocatorsTests.cpp +++ b/test/unittest/rtps/network/ExternalLocatorsTests.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include diff --git a/test/unittest/rtps/network/NetworkFactoryTests.cpp b/test/unittest/rtps/network/NetworkFactoryTests.cpp index 536547d872e..241c2dc79a8 100644 --- a/test/unittest/rtps/network/NetworkFactoryTests.cpp +++ b/test/unittest/rtps/network/NetworkFactoryTests.cpp @@ -17,19 +17,19 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -using namespace std; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::rtps; class NetworkTests : public ::testing::Test { @@ -65,7 +65,7 @@ TEST_F(NetworkTests, build_sender_resource_returns_send_resource_for_a_kind_comp int ArbitraryKind = 1; HELPER_RegisterTransportWithKindAndChannels(ArbitraryKind, 10); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t kindCompatibleLocator; kindCompatibleLocator.kind = ArbitraryKind; @@ -121,7 +121,7 @@ TEST_F(NetworkTests, build_sender_resource_returns_multiple_resources_if_multipl HELPER_RegisterTransportWithKindAndChannels(2, 10); HELPER_RegisterTransportWithKindAndChannels(2, 10); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t locatorCompatibleWithTwoTransports; locatorCompatibleWithTwoTransports.kind = 2; @@ -223,7 +223,7 @@ TEST_F(NetworkTests, BuildSenderResources_returns_empty_vector_if_no_registered_ mockTransportDescriptor.maximumChannels = 10; networkFactoryUnderTest.RegisterTransport(mockTransportDescriptor); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t locatorOfDifferentKind; locatorOfDifferentKind.kind = 2; @@ -242,7 +242,7 @@ TEST_F(NetworkTests, BuildSenderResources_returns_empty_vector_if_all_compatible // Given int ArbitraryKind = 1; HELPER_RegisterTransportWithKindAndChannels(ArbitraryKind, 10); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t locator; locator.kind = ArbitraryKind; @@ -288,7 +288,7 @@ TEST_F(NetworkTests, A_receiver_resource_accurately_reports_whether_it_supports_ // Given int ArbitraryKind = 1; HELPER_RegisterTransportWithKindAndChannels(ArbitraryKind, 10); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t locator; locator.kind = ArbitraryKind; ASSERT_TRUE(networkFactoryUnderTest.build_send_resources(send_resource_list, locator)); @@ -651,7 +651,7 @@ TEST_F(NetworkTests, LocatorShrink) fill_blackbox_locators_test_cases(test_cases); NetworkFactory f{pattr}; - UDPv4TransportDescriptor udpv4; + eprosima::fastdds::rtps::UDPv4TransportDescriptor udpv4; f.RegisterTransport(&udpv4); // TODO: Register more transports diff --git a/test/unittest/rtps/network/mock/MockTransport.cpp b/test/unittest/rtps/network/mock/MockTransport.cpp index 0520a98b63e..506b7137256 100644 --- a/test/unittest/rtps/network/mock/MockTransport.cpp +++ b/test/unittest/rtps/network/mock/MockTransport.cpp @@ -12,14 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include -#include +#include -using namespace std; +#include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { std::vector MockTransport::mockTransportInstances; @@ -49,7 +48,7 @@ MockTransport::~MockTransport() } bool MockTransport::init( - const PropertyPolicy* /*properties*/, + const fastrtps::rtps::PropertyPolicy* /*properties*/, const uint32_t& /*max_msg_size_no_frag*/) { return true; @@ -75,7 +74,7 @@ bool MockTransport::is_locator_allowed( } bool MockTransport::OpenOutputChannel( - SendResourceList& send_resource_list, + fastdds::rtps::SendResourceList& send_resource_list, const Locator_t& locator) { if (!IsLocatorSupported(locator)) @@ -98,7 +97,7 @@ bool MockTransport::OpenOutputChannel( bool MockTransport::OpenInputChannel( const Locator_t& locator, - TransportReceiverInterface*, + fastdds::rtps::TransportReceiverInterface*, uint32_t) { mockOpenInputChannels.push_back(locator.port); @@ -116,7 +115,6 @@ Locator_t MockTransport::RemoteToMainLocal( const Locator_t& remote) const { Locator_t mainLocal(remote); - //memset(mainLocal.address, 0x00, sizeof(mainLocal.address)); mainLocal.set_Invalid_Address(); return mainLocal; } @@ -140,12 +138,12 @@ LocatorList_t MockTransport::NormalizeLocator( } void MockTransport::select_locators( - LocatorSelector& selector) const + fastrtps::rtps::LocatorSelector& selector) const { - ResourceLimitedVector& entries = selector.transport_starts(); + fastrtps::ResourceLimitedVector& entries = selector.transport_starts(); for (size_t i = 0; i < entries.size(); ++i) { - LocatorSelectorEntry* entry = entries[i]; + fastrtps::rtps::LocatorSelectorEntry* entry = entries[i]; if (entry->transport_should_process) { for (size_t j = 0; j < entry->unicast.size(); ++j) diff --git a/test/unittest/rtps/network/mock/MockTransport.h b/test/unittest/rtps/network/mock/MockTransport.h index cf575acd6d3..358d45224f0 100644 --- a/test/unittest/rtps/network/mock/MockTransport.h +++ b/test/unittest/rtps/network/mock/MockTransport.h @@ -15,15 +15,22 @@ #ifndef MOCK_TRANSPORT_H #define MOCK_TRANSPORT_H -#include -#include #include #include +#include +#include +#include +#include + namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { +using Locator_t = eprosima::fastrtps::rtps::Locator_t; +using LocatorList_t = eprosima::fastrtps::rtps::LocatorList_t; +using SenderResource = eprosima::fastrtps::rtps::SenderResource; + class MockTransportDescriptor; class MockSenderResource : public SenderResource @@ -47,7 +54,7 @@ class MockSenderResource : public SenderResource Locator_t locator_; }; -class MockTransport : public TransportInterface +class MockTransport : public fastdds::rtps::TransportInterface { public: @@ -59,7 +66,7 @@ class MockTransport : public TransportInterface ~MockTransport(); bool init( - const PropertyPolicy* properties = nullptr, + const fastrtps::rtps::PropertyPolicy* properties = nullptr, const uint32_t& max_msg_size_no_frag = 0) override; //API implementation @@ -67,12 +74,12 @@ class MockTransport : public TransportInterface const Locator_t&) const override; bool OpenOutputChannel( - SendResourceList& sender_resource_list, + fastdds::rtps::SendResourceList& sender_resource_list, const Locator_t&) override; bool OpenInputChannel( const Locator_t&, - TransportReceiverInterface*, + fastdds::rtps::TransportReceiverInterface*, uint32_t) override; bool CloseInputChannel( @@ -105,7 +112,7 @@ class MockTransport : public TransportInterface * @param [in, out] selector Locator selector. */ void select_locators( - LocatorSelector& selector) const override; + fastrtps::rtps::LocatorSelector& selector) const override; bool is_local_locator( const Locator_t&) const override @@ -118,7 +125,7 @@ class MockTransport : public TransportInterface return false; } - TransportDescriptorInterface* get_configuration() override + fastdds::rtps::TransportDescriptorInterface* get_configuration() override { return nullptr; } @@ -165,7 +172,7 @@ class MockTransport : public TransportInterface bool configureInitialPeerLocator( Locator_t&, - const PortParameters&, + const fastrtps::rtps::PortParameters&, uint32_t, LocatorList_t& ) const override { @@ -205,7 +212,7 @@ class MockTransport : public TransportInterface { Locator_t destination; Locator_t origin; - std::vector data; + std::vector data; } MockMessage; std::vector mockMessagesToReceive; @@ -224,7 +231,7 @@ class MockTransport : public TransportInterface static std::vector mockTransportInstances; }; -class MockTransportDescriptor : public SocketTransportDescriptor +class MockTransportDescriptor : public fastdds::rtps::SocketTransportDescriptor { public: @@ -235,7 +242,7 @@ class MockTransportDescriptor : public SocketTransportDescriptor int maximumChannels; int supportedKind; - TransportInterface* create_transport() const override + fastdds::rtps::TransportInterface* create_transport() const override { return new MockTransport(*this); } @@ -243,7 +250,7 @@ class MockTransportDescriptor : public SocketTransportDescriptor }; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif // ifndef MOCK_TRANSPORT_H diff --git a/test/unittest/rtps/persistence/CMakeLists.txt b/test/unittest/rtps/persistence/CMakeLists.txt index 502d5404d71..eeadf5ffe1f 100644 --- a/test/unittest/rtps/persistence/CMakeLists.txt +++ b/test/unittest/rtps/persistence/CMakeLists.txt @@ -18,10 +18,6 @@ if(SQLITE3_SUPPORT) set(PERSISTENCETESTS_SOURCE PersistenceTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -53,8 +49,10 @@ if(SQLITE3_SUPPORT) ${PROJECT_SOURCE_DIR}/src/cpp ) target_link_libraries(PersistenceTests + fastcdr + fastdds::log foonathan_memory - GTest::gmock + GTest::gmock ${CMAKE_DL_LIBS} ) if(MSVC OR MSVC_IDE) diff --git a/test/unittest/rtps/persistence/PersistenceTests.cpp b/test/unittest/rtps/persistence/PersistenceTests.cpp index 9e1ff61e15f..d76b4ba1b7b 100644 --- a/test/unittest/rtps/persistence/PersistenceTests.cpp +++ b/test/unittest/rtps/persistence/PersistenceTests.cpp @@ -12,23 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include +#include + +#include + #include +#include +#include #include #include #include #include - -#include -#include -#include - #include -#include -#include -#include - using namespace eprosima::fastrtps::rtps; class NoOpPayloadPool : public IPayloadPool diff --git a/test/unittest/rtps/reader/CMakeLists.txt b/test/unittest/rtps/reader/CMakeLists.txt index 68827d15e73..503782b447a 100644 --- a/test/unittest/rtps/reader/CMakeLists.txt +++ b/test/unittest/rtps/reader/CMakeLists.txt @@ -17,10 +17,6 @@ # WriterProxyTests ########################################################################### set(WRITERPROXYTESTS_SOURCE WriterProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -62,7 +58,10 @@ target_include_directories(WriterProxyTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyTests foonathan_memory +target_link_libraries(WriterProxyTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyTests) @@ -71,10 +70,6 @@ gtest_discover_tests(WriterProxyTests) # WriterProxyStopTest ########################################################################### set(WRITERPROXYSTOPTEST_SOURCE WriterProxyStopTest.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -118,7 +113,10 @@ target_include_directories(WriterProxyStopTest PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyStopTest foonathan_memory +target_link_libraries(WriterProxyStopTest + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyStopTest) @@ -127,10 +125,6 @@ gtest_discover_tests(WriterProxyStopTest) # WriterProxyAcknackTests ########################################################################### set(WRITERPROXYACKNACKTESTS_SOURCE WriterProxyAcknackTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -173,7 +167,10 @@ target_include_directories(WriterProxyAcknackTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyAcknackTests foonathan_memory +target_link_libraries(WriterProxyAcknackTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyAcknackTests) diff --git a/test/unittest/rtps/reader/WriterProxyAcknackTests.cpp b/test/unittest/rtps/reader/WriterProxyAcknackTests.cpp index b216494eff2..e3a203f670d 100644 --- a/test/unittest/rtps/reader/WriterProxyAcknackTests.cpp +++ b/test/unittest/rtps/reader/WriterProxyAcknackTests.cpp @@ -13,19 +13,21 @@ // limitations under the License. #include +#include + #include #include -#include #define TEST_FRIENDS \ FRIEND_TEST(WriterProxyAcknackTests, AcknackBackoff); -#include +#include +#include +#include +#include + #include -#include -#include -#include -#include +#include #include diff --git a/test/unittest/rtps/reader/WriterProxyStopTest.cpp b/test/unittest/rtps/reader/WriterProxyStopTest.cpp index f587984e7ee..038382f0894 100644 --- a/test/unittest/rtps/reader/WriterProxyStopTest.cpp +++ b/test/unittest/rtps/reader/WriterProxyStopTest.cpp @@ -13,16 +13,18 @@ // limitations under the License. #include + #include #include -#include +#include +#include +#include +#include +#include + #include -#include -#include -#include -#include -#include +#include #include diff --git a/test/unittest/rtps/reader/WriterProxyTests.cpp b/test/unittest/rtps/reader/WriterProxyTests.cpp index 7d7311fdcba..649db33f020 100644 --- a/test/unittest/rtps/reader/WriterProxyTests.cpp +++ b/test/unittest/rtps/reader/WriterProxyTests.cpp @@ -21,12 +21,13 @@ FRIEND_TEST(WriterProxyTests, ReceivedChangeSet); \ FRIEND_TEST(WriterProxyTests, IrrelevantChangeSet); -#include +#include +#include +#include +#include + #include -#include -#include -#include -#include +#include #include diff --git a/test/unittest/rtps/resources/timedevent/CMakeLists.txt b/test/unittest/rtps/resources/timedevent/CMakeLists.txt index 122fe4b1dfd..b25201384ff 100644 --- a/test/unittest/rtps/resources/timedevent/CMakeLists.txt +++ b/test/unittest/rtps/resources/timedevent/CMakeLists.txt @@ -14,10 +14,6 @@ set(TIMEDEVENTTESTS_SOURCE mock/MockEvent.cpp TimedEventTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -58,5 +54,10 @@ target_include_directories(TimedEventTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(TimedEventTests GTest::gtest ${CMAKE_DL_LIBS}) +target_link_libraries(TimedEventTests + fastcdr + fastdds::log + GTest::gtest + ${CMAKE_DL_LIBS} + ) gtest_discover_tests(TimedEventTests) diff --git a/test/unittest/rtps/resources/timedevent/TimedEventTests.cpp b/test/unittest/rtps/resources/timedevent/TimedEventTests.cpp index 258c629bc4f..62e11d28994 100644 --- a/test/unittest/rtps/resources/timedevent/TimedEventTests.cpp +++ b/test/unittest/rtps/resources/timedevent/TimedEventTests.cpp @@ -12,12 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "mock/MockEvent.h" -#include -#include #include +#include + #include +#include + +#include "mock/MockEvent.h" + class TimedEventEnvironment : public ::testing::Environment { public: diff --git a/test/unittest/rtps/resources/timedevent/mock/MockEvent.h b/test/unittest/rtps/resources/timedevent/mock/MockEvent.h index 16ec04b6f35..dc00803d984 100644 --- a/test/unittest/rtps/resources/timedevent/mock/MockEvent.h +++ b/test/unittest/rtps/resources/timedevent/mock/MockEvent.h @@ -15,13 +15,14 @@ #ifndef _TEST_RTPS_RESOURCES_TIMEDEVENT_MOCKEVENT_H_ #define _TEST_RTPS_RESOURCES_TIMEDEVENT_MOCKEVENT_H_ -#include - #include #include -#include #include +#include + +#include + class MockEvent { public: diff --git a/test/unittest/rtps/security/CMakeLists.txt b/test/unittest/rtps/security/CMakeLists.txt index d0e70b5ce98..c927133ca28 100644 --- a/test/unittest/rtps/security/CMakeLists.txt +++ b/test/unittest/rtps/security/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(SOURCES_SECURITY_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp @@ -96,7 +92,9 @@ target_include_directories(SecurityAuthentication PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(SecurityAuthentication fastcdr +target_link_libraries(SecurityAuthentication + fastcdr + fastdds::log GTest::gmock ${OPENSSL_LIBRARIES} ) diff --git a/test/unittest/rtps/security/SecurityTests.hpp b/test/unittest/rtps/security/SecurityTests.hpp index 852cd82145e..ccb14129f64 100644 --- a/test/unittest/rtps/security/SecurityTests.hpp +++ b/test/unittest/rtps/security/SecurityTests.hpp @@ -15,23 +15,24 @@ #ifndef __TEST_UNITTEST_RTPS_SECURITY_SECURITYTESTS_HPP__ #define __TEST_UNITTEST_RTPS_SECURITY_SECURITYTESTS_HPP__ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include - -#include +#include using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; diff --git a/test/unittest/rtps/writer/CMakeLists.txt b/test/unittest/rtps/writer/CMakeLists.txt index bcc2f523a80..8011e7f35b0 100644 --- a/test/unittest/rtps/writer/CMakeLists.txt +++ b/test/unittest/rtps/writer/CMakeLists.txt @@ -14,10 +14,6 @@ # ReaderProxy set(WRITERPROXYTESTS_SOURCE ReaderProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -65,6 +61,7 @@ target_include_directories(ReaderProxyTests PRIVATE ) target_link_libraries(ReaderProxyTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} @@ -72,10 +69,6 @@ target_link_libraries(ReaderProxyTests gtest_discover_tests(ReaderProxyTests) set(LIVELINESSMANAGERTESTS_SOURCE LivelinessManagerTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -106,7 +99,10 @@ target_include_directories(LivelinessManagerTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ) target_link_libraries(LivelinessManagerTests PRIVATE - GTest::gmock) + fastcdr + fastdds::log + GTest::gmock + ) gtest_discover_tests(LivelinessManagerTests) if(NOT QNX) @@ -121,7 +117,7 @@ if(NOT QNX) ) target_include_directories(RTPSWriterTests PRIVATE ${Asio_INCLUDE_DIR}) - target_link_libraries(RTPSWriterTests fastcdr fastrtps foonathan_memory + target_link_libraries(RTPSWriterTests fastcdr fastdds foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(RTPSWriterTests) diff --git a/test/unittest/rtps/writer/LivelinessManagerTests.cpp b/test/unittest/rtps/writer/LivelinessManagerTests.cpp index 03ed08ababb..05d2829fd16 100644 --- a/test/unittest/rtps/writer/LivelinessManagerTests.cpp +++ b/test/unittest/rtps/writer/LivelinessManagerTests.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,17 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include +#include +#include -#include -#include -#include #include -#include -#include + +#include #include +#include +#include + +#include + class LivelinessManagerTests : public ::testing::Test { public: @@ -56,7 +58,7 @@ class LivelinessManagerTests : public ::testing::Test void liveliness_changed( eprosima::fastrtps::rtps::GUID_t guid, - const eprosima::fastrtps::LivelinessQosPolicyKind&, + const eprosima::fastdds::dds::LivelinessQosPolicyKind&, const eprosima::fastrtps::Duration_t&, int alive_change, int not_alive_change) @@ -128,19 +130,20 @@ TEST_F(LivelinessManagerTests, WriterCanAlwaysBeAdded) // Writers with same Guid, liveliness kind and lease duration cannot be added - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); // Same guid and different liveliness kind can be added - EXPECT_EQ(liveliness_manager.add_writer(guid, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.add_writer(guid, MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t( + 1)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), true); // Same guid and different lease duration can be added - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(2)), true); - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(3)), true); - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(4)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(2)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(3)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(4)), true); // Same guid, same kind, and same lease duration can also be added - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); } TEST_F(LivelinessManagerTests, WriterCannotBeRemovedTwice) @@ -153,17 +156,22 @@ TEST_F(LivelinessManagerTests, WriterCannotBeRemovedTwice) guidP.value[0] = 1; GUID_t guid(guidP, 0); - EXPECT_EQ(liveliness_manager.add_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), false); - - EXPECT_EQ(liveliness_manager.add_writer(guid, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)), false); - - EXPECT_EQ(liveliness_manager.add_writer(guid, MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), true); - EXPECT_EQ(liveliness_manager.remove_writer(guid, MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), false); + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)), false); + + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t( + 1)), true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t( + 1)), true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t( + 1)), false); + + EXPECT_EQ(liveliness_manager.add_writer(guid, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), + true); + EXPECT_EQ(liveliness_manager.remove_writer(guid, fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)), + false); } //! Tests that the assert_liveliness() method that takes liveliness kind as argument sets the alive state and time @@ -177,15 +185,15 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByKind) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(10)); - liveliness_manager.add_writer(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(10)); - liveliness_manager.add_writer(GUID_t(guidP, 3), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(10)); - liveliness_manager.add_writer(GUID_t(guidP, 4), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(10)); - liveliness_manager.add_writer(GUID_t(guidP, 5), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(10)); - liveliness_manager.add_writer(GUID_t(guidP, 6), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 3), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 4), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 5), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(10)); + liveliness_manager.add_writer(GUID_t(guidP, 6), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(10)); // Assert liveliness of automatic writers (the rest should be unchanged) - EXPECT_TRUE(liveliness_manager.assert_liveliness(AUTOMATIC_LIVELINESS_QOS, guidP)); + EXPECT_TRUE(liveliness_manager.assert_liveliness(fastdds::dds::AUTOMATIC_LIVELINESS_QOS, guidP)); auto liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::ALIVE); EXPECT_EQ(liveliness_data[1].status, LivelinessData::WriterStatus::ALIVE); @@ -195,7 +203,7 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByKind) EXPECT_EQ(liveliness_data[5].status, LivelinessData::WriterStatus::NOT_ASSERTED); // Assert liveliness of manual by participant writers - EXPECT_TRUE(liveliness_manager.assert_liveliness(MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, guidP)); + EXPECT_TRUE(liveliness_manager.assert_liveliness(fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, guidP)); liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::ALIVE); EXPECT_EQ(liveliness_data[1].status, LivelinessData::WriterStatus::ALIVE); @@ -205,7 +213,7 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByKind) EXPECT_EQ(liveliness_data[5].status, LivelinessData::WriterStatus::NOT_ASSERTED); // Assert liveliness of manual by topic writers - EXPECT_TRUE(liveliness_manager.assert_liveliness(MANUAL_BY_TOPIC_LIVELINESS_QOS, guidP)); + EXPECT_TRUE(liveliness_manager.assert_liveliness(fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, guidP)); liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::ALIVE); EXPECT_EQ(liveliness_data[1].status, LivelinessData::WriterStatus::ALIVE); @@ -233,17 +241,17 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByWriter) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.add_writer(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.add_writer(GUID_t(guidP, 3), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.add_writer(GUID_t(guidP, 4), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.add_writer(GUID_t(guidP, 5), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.add_writer(GUID_t(guidP, 6), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 3), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 4), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 5), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 6), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1)); // If a manual by topic writer is asserted the other writers are unchanged EXPECT_TRUE(liveliness_manager.assert_liveliness( GUID_t(guidP, 6), - MANUAL_BY_TOPIC_LIVELINESS_QOS, + fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1))); auto liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::NOT_ASSERTED); @@ -255,7 +263,7 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByWriter) EXPECT_TRUE(liveliness_manager.assert_liveliness( GUID_t(guidP, 5), - MANUAL_BY_TOPIC_LIVELINESS_QOS, + fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(1))); liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::NOT_ASSERTED); @@ -268,7 +276,7 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByWriter) // If an automatic writer is asserted all automatic writers are asserted as well EXPECT_TRUE(liveliness_manager.assert_liveliness( GUID_t(guidP, 1), - AUTOMATIC_LIVELINESS_QOS, + fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1))); liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::ALIVE); @@ -281,7 +289,7 @@ TEST_F(LivelinessManagerTests, AssertLivelinessByWriter) // If a manual by participant writer is asserted all manual by participant writers are asserted as well EXPECT_TRUE(liveliness_manager.assert_liveliness( GUID_t(guidP, 4), - MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(1))); liveliness_data = liveliness_manager.get_liveliness_data(); EXPECT_EQ(liveliness_data[0].status, LivelinessData::WriterStatus::ALIVE); @@ -317,11 +325,11 @@ TEST_F(LivelinessManagerTests, TimerExpired_Automatic) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.1)); - liveliness_manager.add_writer(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.1)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); // Assert liveliness - liveliness_manager.assert_liveliness(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.assert_liveliness(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); num_writers_recovered = 0u; // Wait so that first writer loses liveliness @@ -333,7 +341,7 @@ TEST_F(LivelinessManagerTests, TimerExpired_Automatic) EXPECT_EQ(writer_losing_liveliness, GUID_t(guidP, 2)); // Assert first writer - liveliness_manager.assert_liveliness(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.1)); + liveliness_manager.assert_liveliness(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.1)); wait_liveliness_recovered(2u); EXPECT_EQ(num_writers_recovered, 2u); } @@ -356,11 +364,15 @@ TEST_F(LivelinessManagerTests, TimerExpired_ManualByParticipant) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(0.1)); - liveliness_manager.add_writer(GUID_t(guidP, 2), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + Duration_t(0.1)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + Duration_t(0.5)); // Assert liveliness - liveliness_manager.assert_liveliness(GUID_t(guidP, 2), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.assert_liveliness(GUID_t(guidP, + 2), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + Duration_t(0.5)); num_writers_recovered = 0u; // Wait so that first writer loses liveliness @@ -374,7 +386,9 @@ TEST_F(LivelinessManagerTests, TimerExpired_ManualByParticipant) EXPECT_EQ(num_writers_lost, 2u); // Assert first writer - liveliness_manager.assert_liveliness(GUID_t(guidP, 1), MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, Duration_t(0.1)); + liveliness_manager.assert_liveliness(GUID_t(guidP, + 1), fastdds::dds::MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, + Duration_t(0.1)); wait_liveliness_recovered(2u); EXPECT_EQ(num_writers_recovered, 2u); } @@ -397,11 +411,12 @@ TEST_F(LivelinessManagerTests, TimerExpired_ManualByTopic) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.1)); - liveliness_manager.add_writer(GUID_t(guidP, 2), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.2)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.1)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.2)); // Assert first writer - liveliness_manager.assert_liveliness(GUID_t(guidP, 1), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.1)); + liveliness_manager.assert_liveliness(GUID_t(guidP, 1), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, + Duration_t(0.1)); wait_liveliness_recovered(1u); // Wait so that first writer loses liveliness @@ -415,7 +430,8 @@ TEST_F(LivelinessManagerTests, TimerExpired_ManualByTopic) EXPECT_EQ(num_writers_lost, 1u); // Assert second writer - liveliness_manager.assert_liveliness(GUID_t(guidP, 2), MANUAL_BY_TOPIC_LIVELINESS_QOS, Duration_t(0.2)); + liveliness_manager.assert_liveliness(GUID_t(guidP, 2), fastdds::dds::MANUAL_BY_TOPIC_LIVELINESS_QOS, + Duration_t(0.2)); wait_liveliness_recovered(2u); num_writers_lost = 0u; @@ -443,11 +459,11 @@ TEST_F(LivelinessManagerTests, TimerOwnerCalculation) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(100 * 1e-3)); - liveliness_manager.add_writer(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(1000 * 1e-3)); - liveliness_manager.add_writer(GUID_t(guidP, 3), AUTOMATIC_LIVELINESS_QOS, Duration_t(500 * 1e-3)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(100 * 1e-3)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1000 * 1e-3)); + liveliness_manager.add_writer(GUID_t(guidP, 3), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(500 * 1e-3)); - liveliness_manager.assert_liveliness(AUTOMATIC_LIVELINESS_QOS, guidP); + liveliness_manager.assert_liveliness(fastdds::dds::AUTOMATIC_LIVELINESS_QOS, guidP); wait_liveliness_lost(1u); EXPECT_EQ(writer_losing_liveliness, GUID_t(guidP, 1)); @@ -480,11 +496,11 @@ TEST_F(LivelinessManagerTests, TimerOwnerRemoved) GuidPrefix_t guidP; guidP.value[0] = 1; - liveliness_manager.add_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); - liveliness_manager.add_writer(GUID_t(guidP, 2), AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); + liveliness_manager.add_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.add_writer(GUID_t(guidP, 2), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(1)); - liveliness_manager.assert_liveliness(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); - liveliness_manager.remove_writer(GUID_t(guidP, 1), AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.assert_liveliness(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); + liveliness_manager.remove_writer(GUID_t(guidP, 1), fastdds::dds::AUTOMATIC_LIVELINESS_QOS, Duration_t(0.5)); wait_liveliness_lost(1u); EXPECT_EQ(writer_losing_liveliness, GUID_t(guidP, 2)); diff --git a/test/unittest/rtps/writer/ReaderProxyTests.cpp b/test/unittest/rtps/writer/ReaderProxyTests.cpp index bb6d0bee937..e92d8473710 100644 --- a/test/unittest/rtps/writer/ReaderProxyTests.cpp +++ b/test/unittest/rtps/writer/ReaderProxyTests.cpp @@ -15,8 +15,9 @@ #include #include -#include -#include +#include +#include + #include //using namespace eprosima::fastrtps::rtps; @@ -128,7 +129,7 @@ TEST(ReaderProxyTests, requested_changes_set_test) RTPSGapBuilder gap_builder(message_group); ReaderProxyData reader_attributes(0, 0); - reader_attributes.m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + reader_attributes.m_qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS; rproxy.start(reader_attributes); @@ -188,7 +189,7 @@ TEST(ReaderProxyTests, process_nack_frag_single_fragment_different_windows_test) RTPSGapBuilder gap_builder(message_group); ReaderProxyData reader_attributes(0, 0); - reader_attributes.m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + reader_attributes.m_qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS; rproxy.start(reader_attributes); ChangeForReader_t change(&seq); @@ -257,7 +258,7 @@ TEST(ReaderProxyTests, process_nack_frag_multiple_fragments_different_windows_te RTPSGapBuilder gap_builder(message_group); ReaderProxyData reader_attributes(0, 0); - reader_attributes.m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + reader_attributes.m_qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS; rproxy.start(reader_attributes); ChangeForReader_t change(&seq); @@ -346,7 +347,7 @@ TEST(ReaderProxyTests, has_been_delivered_test) seq2.sequenceNumber = {0, 2}; ReaderProxyData reader_attributes(0, 0); - reader_attributes.m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + reader_attributes.m_qos.m_reliability.kind = fastdds::dds::RELIABLE_RELIABILITY_QOS; rproxy.start(reader_attributes); auto expect_result = [&rproxy](SequenceNumber_t seq, bool delivered, bool should_be_found) @@ -392,7 +393,7 @@ TEST(ReaderProxyTests, acknack_count) ReaderProxy rproxy(w_times, alloc, &writer_mock); ReaderProxyData reader_attributes(0, 0); - reader_attributes.m_qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS; + reader_attributes.m_qos.m_reliability.kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; rproxy.start(reader_attributes); // Check that the initial acknack count is 0. diff --git a/test/unittest/security/accesscontrol/AccessControlTests.cpp b/test/unittest/security/accesscontrol/AccessControlTests.cpp index 3cd39972e31..afdfe5c4f51 100644 --- a/test/unittest/security/accesscontrol/AccessControlTests.cpp +++ b/test/unittest/security/accesscontrol/AccessControlTests.cpp @@ -12,22 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include + +#include -#include -#include -#include +#include +#include +#include +#include -#include +#include +#include #include -#include #include -#include -#include - -#include - -#include +#include +#include using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; @@ -230,7 +229,7 @@ void AccessControlTest::check_remote_datareader( SecurityException exception; ReaderProxyData reader_proxy_data(1, 1); - reader_proxy_data.topicName(eprosima::fastrtps::string_255(topic_name)); + reader_proxy_data.topicName(eprosima::fastcdr::string_255(topic_name)); reader_proxy_data.m_qos.m_partition.setNames(partitions); bool relay_only; bool result = access_plugin.check_remote_datareader( @@ -288,7 +287,7 @@ void AccessControlTest::check_remote_datawriter( SecurityException exception; WriterProxyData writer_proxy_data(1, 1); - writer_proxy_data.topicName(eprosima::fastrtps::string_255(topic_name)); + writer_proxy_data.topicName(eprosima::fastcdr::string_255(topic_name)); writer_proxy_data.m_qos.m_partition.setNames(partitions); bool result = access_plugin.check_remote_datawriter( *access_handle, diff --git a/test/unittest/security/accesscontrol/CMakeLists.txt b/test/unittest/security/accesscontrol/CMakeLists.txt index 1ece99f44da..fe0a56d91d6 100644 --- a/test/unittest/security/accesscontrol/CMakeLists.txt +++ b/test/unittest/security/accesscontrol/CMakeLists.txt @@ -16,15 +16,12 @@ if(WIN32) add_definitions( -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS + -DNOMINMAX ) endif() set(COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -101,6 +98,7 @@ target_link_libraries(AccessControlTests GTest::gmock ${OPENSSL_LIBRARIES} fastcdr + fastdds::log foonathan_memory $<$:ws2_32> ${TINYXML2_LIBRARY} @@ -128,12 +126,6 @@ set( add_executable( ${DISTINGUISHEDNAME_TEST_NAME} - # Log related files - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - # src files ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -145,6 +137,7 @@ add_executable( ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + # Log related files ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp # test files @@ -169,8 +162,9 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries( - ${DISTINGUISHEDNAME_TEST_NAME} +target_link_libraries(${DISTINGUISHEDNAME_TEST_NAME} + fastcdr + fastdds::log GTest::gtest ) diff --git a/test/unittest/security/authentication/AuthenticationPluginTests.hpp b/test/unittest/security/authentication/AuthenticationPluginTests.hpp index 95087dd4d85..31482ae88aa 100644 --- a/test/unittest/security/authentication/AuthenticationPluginTests.hpp +++ b/test/unittest/security/authentication/AuthenticationPluginTests.hpp @@ -15,17 +15,16 @@ #ifndef _UNITTEST_SECURITY_AUTHENTICATION_AUTHENTICATIONPLUGINTESTS_HPP_ #define _UNITTEST_SECURITY_AUTHENTICATION_AUTHENTICATIONPLUGINTESTS_HPP_ -#include -#include +#include // Include first necessary mocks -#include -#include -#include - #include +#include +#include +#include -#include +#include +#include class AuthenticationPluginTest : public ::testing::Test { diff --git a/test/unittest/security/authentication/BuiltinPKIDHTests.cpp b/test/unittest/security/authentication/BuiltinPKIDHTests.cpp index 14a8d2301ab..37622e782f1 100644 --- a/test/unittest/security/authentication/BuiltinPKIDHTests.cpp +++ b/test/unittest/security/authentication/BuiltinPKIDHTests.cpp @@ -16,13 +16,15 @@ // suppresses the warnings until true OpenSSL 3.0 APIs can be used. #define OPENSSL_API_COMPAT 10101 -#include "AuthenticationPluginTests.hpp" +#include +#include +#include -#include -#include -#include +#include -#include +#include "AuthenticationPluginTests.hpp" +#include +#include #if OPENSSL_VERSION_NUMBER >= 0x10100000L #define IS_OPENSSL_1_1 1 @@ -30,9 +32,6 @@ #define IS_OPENSSL_1_1 0 #endif // if OPENSSL_VERSION_NUMBER >= 0x10100000L -#include -#include - using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; diff --git a/test/unittest/security/authentication/CMakeLists.txt b/test/unittest/security/authentication/CMakeLists.txt index b03767f0723..e896ba3d77b 100644 --- a/test/unittest/security/authentication/CMakeLists.txt +++ b/test/unittest/security/authentication/CMakeLists.txt @@ -16,15 +16,12 @@ if(WIN32) add_definitions( -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS + -DNOMINMAX ) endif() set(COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -75,6 +72,7 @@ target_link_libraries(BuiltinPKIDH GTest::gtest ${OPENSSL_LIBRARIES} fastcdr + fastdds::log foonathan_memory $<$:ws2_32> $<$:eProsima_p11> # $ diff --git a/test/unittest/security/cryptography/CMakeLists.txt b/test/unittest/security/cryptography/CMakeLists.txt index f353b295f69..4e5bc2508e2 100644 --- a/test/unittest/security/cryptography/CMakeLists.txt +++ b/test/unittest/security/cryptography/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -63,7 +59,12 @@ target_include_directories(BuiltinAESGCMGMAC PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(BuiltinAESGCMGMAC fastcdr GTest::gmock ${OPENSSL_LIBRARIES}) +target_link_libraries(BuiltinAESGCMGMAC + fastcdr + fastdds::log + GTest::gmock + ${OPENSSL_LIBRARIES} + ) gtest_discover_tests(BuiltinAESGCMGMAC SOURCES ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} PROPERTIES ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") diff --git a/test/unittest/security/cryptography/CryptographyPluginTests.hpp b/test/unittest/security/cryptography/CryptographyPluginTests.hpp index 8e7f7487572..43b3a109cee 100644 --- a/test/unittest/security/cryptography/CryptographyPluginTests.hpp +++ b/test/unittest/security/cryptography/CryptographyPluginTests.hpp @@ -15,18 +15,19 @@ #ifndef _UNITTEST_SECURITY_CRYPTOGRAPHY_CRYPTOGRAPHYPLUGINTESTS_HPP_ #define _UNITTEST_SECURITY_CRYPTOGRAPHY_CRYPTOGRAPHYPLUGINTESTS_HPP_ -#include -#include -#include -#include - -#include -#include +#include +#include #include #include -#include -#include + +#include + +#include +#include +#include +#include +#include class CryptographyPluginTest : public ::testing::Test { diff --git a/test/unittest/security/logging/CMakeLists.txt b/test/unittest/security/logging/CMakeLists.txt index fa218fa762b..5e6d9b02922 100644 --- a/test/unittest/security/logging/CMakeLists.txt +++ b/test/unittest/security/logging/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -53,5 +49,10 @@ target_include_directories(BuiltinLogging PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(BuiltinLogging fastcdr GTest::gtest ${OPENSSL_LIBRARIES}) +target_link_libraries(BuiltinLogging + fastcdr + fastdds::log + GTest::gtest + ${OPENSSL_LIBRARIES} + ) gtest_discover_tests(BuiltinLogging) diff --git a/test/unittest/statistics/dds/CMakeLists.txt b/test/unittest/statistics/dds/CMakeLists.txt index 511a6f821fd..e4d949d7051 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -25,12 +25,11 @@ endif(TINYXML2_INCLUDE_DIR) ## StatisticsDomainParticipantTests set(STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE StatisticsDomainParticipantTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx) + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx + ) add_executable(StatisticsDomainParticipantTests ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) target_compile_definitions(StatisticsDomainParticipantTests PRIVATE @@ -39,7 +38,11 @@ target_compile_definitions(StatisticsDomainParticipantTests PRIVATE ) target_include_directories(StatisticsDomainParticipantTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(StatisticsDomainParticipantTests fastrtps fastcdr GTest::gtest) +target_link_libraries(StatisticsDomainParticipantTests + fastcdr + fastdds + GTest::gtest + ) gtest_discover_tests(StatisticsDomainParticipantTests) ## StatisticsQosTests @@ -63,7 +66,12 @@ target_compile_definitions(StatisticsQosTests PRIVATE BOOST_ASIO_STANDALONE ASIO ) target_include_directories(StatisticsQosTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${THIRDPARTY_BOOST_INCLUDE_DIR}) -target_link_libraries(StatisticsQosTests fastrtps fastcdr ${TINYXML2_LIBRARY} foonathan_memory GTest::gtest) +target_link_libraries(StatisticsQosTests + fastcdr + fastdds + foonathan_memory + ${TINYXML2_LIBRARY} + GTest::gtest) gtest_discover_tests(StatisticsQosTests) ## StatisticsDomainParticipantListenerTests @@ -72,29 +80,43 @@ if (FASTDDS_STATISTICS) DomainParticipantStatisticsListenerTests.cpp) add_executable(DomainParticipantStatisticsListenerTests + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/network.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${TINYXML2_SOURCES} ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) target_compile_definitions(DomainParticipantStatisticsListenerTests PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE $<$>,$>:__DEBUG> $<$:__INTERNAL_DEBUG> # Internal debug activated. ) target_include_directories(DomainParticipantStatisticsListenerTests PRIVATE + ${Asio_INCLUDE_DIR} DomainParticipantStatisticsListenerTests/mock + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) target_link_libraries(DomainParticipantStatisticsListenerTests - ${TINYXML2_LIBRARY} fastcdr GTest::gmock ) + ${TINYXML2_LIBRARY} + fastcdr + fastdds::log + fastdds::xtypes::type-representation + GTest::gmock + ) gtest_discover_tests(DomainParticipantStatisticsListenerTests) endif() @@ -103,34 +125,13 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) # this test includes C sources enable_language(C) - set(STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + file(GLOB STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE StatisticsDomainParticipantMockTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -275,12 +276,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp @@ -290,12 +285,10 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -304,36 +297,22 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) set(STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE StatisticsDomainParticipantStatusQueryableTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/Entity.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -342,16 +321,10 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/Entity.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp @@ -476,12 +449,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp @@ -490,14 +457,11 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -506,6 +470,12 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # SHM Transport @@ -532,79 +502,43 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) # Security Support if(SECURITY) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + file(GLOB security_sources ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/*.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/FileProvider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/Pkcs11Provider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp - ) - list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/FileProvider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/Pkcs11Provider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/*.cpp ) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE ${security_sources}) + list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE ${security_sources}) endif() # External sources if(TINYXML2_SOURCE_DIR) list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ${TINYXML2_SOURCES} ) list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) endif() - add_executable(StatisticsDomainParticipantMockTests ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) + add_executable(StatisticsDomainParticipantMockTests + ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE} + ) target_compile_definitions(StatisticsDomainParticipantMockTests PRIVATE BOOST_ASIO_STANDALONE ASIO_STANDALONE SQLITE_WIN32_GETVERSIONEX=0 $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + $<$:__INTERNAL_DEBUG> # Internal debug activated. $<$,$>:_WIN32_WINNT=0x0603> $<$,$>>:_WIN32_WINNT=0x0601> $<$,$>:SQLITE_OS_WINRT> @@ -616,7 +550,7 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ) target_include_directories(StatisticsDomainParticipantMockTests PRIVATE $<$:${OPENSSL_INCLUDE_DIR}> - StatisticsDomainParticipantMockTests/mock/ + StatisticsDomainParticipantMockTests/mock ${PROJECT_SOURCE_DIR}/test/mock/dds/Publisher/ ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantImpl/ ${PROJECT_SOURCE_DIR}/include @@ -626,6 +560,9 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${THIRDPARTY_BOOST_INCLUDE_DIR}) target_link_libraries(StatisticsDomainParticipantMockTests ${PRIVACY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} @@ -644,7 +581,7 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) gtest_discover_tests(StatisticsDomainParticipantMockTests) add_executable(StatisticsDomainParticipantStatusQueryableTests ${STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE}) - target_compile_definitions(StatisticsDomainParticipantStatusQueryableTests PRIVATE FASTRTPS_NO_LIB + target_compile_definitions(StatisticsDomainParticipantStatusQueryableTests PRIVATE FASTDDS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE SQLITE_WIN32_GETVERSIONEX=0 @@ -672,6 +609,9 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${THIRDPARTY_BOOST_INCLUDE_DIR}) target_link_libraries(StatisticsDomainParticipantStatusQueryableTests ${PRIVACY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} diff --git a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp index 553ab7d2b98..7475d19bed1 100644 --- a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp +++ b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { @@ -134,7 +134,7 @@ class DomainParticipantStatisticsListenerTests : public ::testing::Test } void write_all_data_except( - EventKind kind) + uint32_t kind) { for (const Data& data : data_) { @@ -156,25 +156,25 @@ class DomainParticipantStatisticsListenerTests : public ::testing::Test std::array, 17> writers_; std::array data_to_check_; std::array data_; - std::array kinds_ = + std::array kinds_ = { - EventKindBits::HISTORY2HISTORY_LATENCY, - EventKindBits::NETWORK_LATENCY, - EventKindBits::PUBLICATION_THROUGHPUT, - EventKindBits::SUBSCRIPTION_THROUGHPUT, - EventKindBits::RTPS_SENT, - EventKindBits::RTPS_LOST, - EventKindBits::RESENT_DATAS, - EventKindBits::HEARTBEAT_COUNT, - EventKindBits::ACKNACK_COUNT, - EventKindBits::NACKFRAG_COUNT, - EventKindBits::GAP_COUNT, - EventKindBits::DATA_COUNT, - EventKindBits::PDP_PACKETS, - EventKindBits::EDP_PACKETS, - EventKindBits::DISCOVERED_ENTITY, - EventKindBits::SAMPLE_DATAS, - EventKindBits::PHYSICAL_DATA + EventKind::HISTORY2HISTORY_LATENCY, + EventKind::NETWORK_LATENCY, + EventKind::PUBLICATION_THROUGHPUT, + EventKind::SUBSCRIPTION_THROUGHPUT, + EventKind::RTPS_SENT, + EventKind::RTPS_LOST, + EventKind::RESENT_DATAS, + EventKind::HEARTBEAT_COUNT, + EventKind::ACKNACK_COUNT, + EventKind::NACKFRAG_COUNT, + EventKind::GAP_COUNT, + EventKind::DATA_COUNT, + EventKind::PDP_PACKETS, + EventKind::EDP_PACKETS, + EventKind::DISCOVERED_ENTITY, + EventKind::SAMPLE_DATAS, + EventKind::PHYSICAL_DATA }; DomainParticipantStatisticsListener listener_; diff --git a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp index 0fc0cff7f28..fc7e092503a 100644 --- a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp +++ b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp @@ -21,10 +21,18 @@ #include +#include +#include +#include + namespace eprosima { namespace fastdds { namespace dds { +class DataWriterImpl; +class Publisher; +class Topic; + class DataWriter { public: diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp index 88c0399fa36..b276d4611d1 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp @@ -14,6 +14,8 @@ #include #include + +#include #include #include #include @@ -21,15 +23,12 @@ #include #include #include -#include #include #include #include #include "../../logging/mock/MockConsumer.h" -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace statistics { @@ -77,7 +76,7 @@ class DomainParticipantTest : public eprosima::fastdds::dds::DomainParticipant }; /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when create_datawriter fails + * This test checks that enable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when create_datawriter fails * returning a nullptr. * 1. Create participant * 2. Mock create_datawriter so it returns nullptr @@ -116,7 +115,8 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(true)); // 3. enable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); @@ -127,12 +127,12 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_EQ(consumed_entries.size(), 1u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_datawriter fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_datawriter fails. * 1. Create a participant * 2. Mock delete_datawriter * 3. Enable a statistics datawriter @@ -168,29 +168,30 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); EXPECT_CALL(*builtin_pub, delete_datawriter_mock()).WillOnce(testing::Return(false)); EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_topic fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_topic fails. * 1. Create a participant * 2. Mock delete_topic * 3. Enable a statistics datawriter @@ -223,24 +224,25 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // As the DataWriter has been deleted, the topic has to be removed manually EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->delete_topic( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->delete_topic( dynamic_cast(statistics_participant->lookup_topicdescription( HEARTBEAT_COUNT_TOPIC)))); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp index e9c3dec1e3f..e5b5bc30bb7 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp @@ -22,15 +22,12 @@ #include #include #include -#include #include #include #include #include "../../logging/mock/MockConsumer.h" -using eprosima::fastrtps::types::ReturnCode_t; - constexpr const char* TEST_TOPIC = "test_topic"; class TopicDataTypeMock : public eprosima::fastdds::dds::TopicDataType diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp index e6036a05b00..ca7b6c59787 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp @@ -16,40 +16,34 @@ * @file DataWriterImpl.hpp */ -#ifndef _FASTRTPS_DATAWRITERIMPL_HPP_ -#define _FASTRTPS_DATAWRITERIMPL_HPP_ +#ifndef _FASTDDS_DATAWRITERIMPL_HPP_ +#define _FASTDDS_DATAWRITERIMPL_HPP_ #include +#include #include +#include #include #include #include #include #include #include - +#include +#include #include -#include #include +#include #include #include #include #include #include -#include -#include - -#include - -#include -#include - #include -#include #include - +#include namespace eprosima { namespace fastrtps { @@ -151,25 +145,25 @@ class DataWriterImpl : protected rtps::IReaderDataFilter virtual ReturnCode_t enable() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_delete_preconditions() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t loan_sample( void*&, LoanInitializationKind ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t discard_loan( void*& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool write( @@ -189,7 +183,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter void*, const InstanceHandle_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t write_w_timestamp( @@ -197,7 +191,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, const fastrtps::Time_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } InstanceHandle_t register_instance( @@ -218,7 +212,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, bool = false) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t unregister_instance_w_timestamp( @@ -227,7 +221,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const fastrtps::Time_t&, bool = false) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void gen_guid() @@ -257,7 +251,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t wait_for_acknowledgments( const fastrtps::Duration_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t wait_for_acknowledgments( @@ -265,33 +259,33 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, const fastrtps::Duration_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_publication_matched_status( PublicationMatchedStatus&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_offered_deadline_missed_status( - fastrtps::OfferedDeadlineMissedStatus& status) + OfferedDeadlineMissedStatus& status) { status = deadline_missed_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_offered_incompatible_qos_status( OfferedIncompatibleQosStatus& status) { status = offered_incompatible_qos_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_qos( const DataWriterQos&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterQos& get_qos() const @@ -312,21 +306,21 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t set_listener( DataWriterListener*) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_key_value( void*, const InstanceHandle_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_liveliness_lost_status( LivelinessLostStatus& status) { status = liveliness_lost_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const Publisher* get_publisher() const @@ -342,7 +336,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t assert_liveliness() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } virtual void disable() @@ -353,13 +347,13 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t clear_history( size_t*) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_sending_locators( rtps::LocatorList&) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void filter_is_being_removed( @@ -411,14 +405,14 @@ class DataWriterImpl : protected rtps::IReaderDataFilter static ReturnCode_t check_qos( const ::eprosima::fastdds::dds::DataWriterQos&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static ReturnCode_t check_qos_including_resource_limits( const DataWriterQos&, const TypeSupport& ) { - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static void set_qos( @@ -451,4 +445,4 @@ class DataWriterImpl : protected rtps::IReaderDataFilter } /* namespace fastdds */ } /* namespace eprosima */ -#endif //_FASTRTPS_DATAWRITERIMPL_HPP_ +#endif //_FASTDDS_DATAWRITERIMPL_HPP_ diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp index f56e0b3326b..7fb59c56b26 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp @@ -65,9 +65,9 @@ class DataWriterImpl : public efd::DataWriterImpl { } - ReturnCode_t enable() override + efd::ReturnCode_t enable() override { - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } void disable() override diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp index 69e0f445156..6b5f3e54759 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp @@ -116,7 +116,7 @@ class PublisherImpl : public efd::PublisherImpl return retcode; } - ReturnCode_t delete_datawriters() + efd::ReturnCode_t delete_datawriters() { std::unique_lock lock(mtx_writers_); @@ -131,7 +131,7 @@ class PublisherImpl : public efd::PublisherImpl writers_.clear(); - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } private: diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp index aaa34188199..c3d0db2e535 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "../../logging/mock/MockConsumer.h" @@ -41,8 +40,6 @@ namespace fastdds { namespace statistics { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class FooType { public: @@ -191,31 +188,31 @@ TEST_F(StatisticsDomainParticipantTests, NarrowDomainParticipantTest) // 4. Delete DDS entities ASSERT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); } /* * This test checks both eprosima::fastdds::statistics::dds::DomainParticipant enable_statistics_datawriter() and * disable_statistics_datawriter() methods. - * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return RETCODE_UNSUPPORTED. + * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return fastdds::dds::RETCODE_UNSUPPORTED. * Check that this error takes precedence over other possible errors. * 2. Narrow DomainParticipant to the children class. * 3. Create TypeSupports. * 4. Check that the types are not registered yet. * 5. Check that the topics do not exist yet. * 6. Enable each statistics DataWriter checking that topics are created and types are registered. - * 7. Enable an already enabled statistics DataWriter and check that it returns RETCODE_OK. - * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns RETCODE_BAD_PARAMETER. + * 7. Enable an already enabled statistics DataWriter and check that it returns fastdds::dds::RETCODE_OK. + * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns fastdds::dds::RETCODE_BAD_PARAMETER. * 9. Disable one statistics DataWriter and check that it is successful. * 10. Enable the previous statistics DataWriter with an inconsistent QoS and check that it returns - * RETCODE_INCONSISTENT_POLICY. - * 11. Check error code precedence: RETCODE_BAD_PARAMETER takes precedence over RETCODE_INCONSISTENT_POLICY. - * The case where the create_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * 11. Check error code precedence: fastdds::dds::RETCODE_BAD_PARAMETER takes precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * The case where the create_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. - * 12. Try to disable an already disabled statistics DataWriter and check that returns RETCODE_ERROR. + * 12. Try to disable an already disabled statistics DataWriter and check that returns fastdds::dds::RETCODE_ERROR. * 13. Check that if an invalid topic name is provided to the disable_statistics_datawriter method, it returns - * RETCODE_BAD_PARAMETER. - * The case where the delete_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_BAD_PARAMETER. + * The case where the delete_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. * 14. Delete DDS entities. */ @@ -235,13 +232,13 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) DomainParticipant* statistics_participant = static_cast(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( HISTORY_LATENCY_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); #else // 2. Narrow DomainParticipant to eprosima::fastdds::statistics::dds::DomainParticipant @@ -289,202 +286,202 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); // 6. Enable each statistics DataWriter checking that topics are created and types are registered. - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_TRUE(history_latency_type == statistics_participant->find_type(history_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_TRUE(network_latency_type == statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_TRUE(discovery_type == statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_TRUE(sample_identity_count_type == statistics_participant->find_type( sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_TRUE(physical_data_type == statistics_participant->find_type(physical_data_type.get_type_name())); // 7. Enable an already enabled statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); // 8. Invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription("INVALID_TOPIC")); // 9. Disable statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); // 10. Enable previous statistics DataWriter with an inconsistent QoS - EXPECT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, inconsistent_qos)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); - // 11. RETCODE_BAD_PARAMETER error has precedence over RETCODE_INCONSISTENT_POLICY - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + // 11. fastdds::dds::RETCODE_BAD_PARAMETER error has precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); // 12. Disable already disabled DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); // 13. Disable invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); // 14. Remove DDS entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(physical_data_type.get_type_name())); #endif // FASTDDS_STATISTICS - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> + EXPECT_EQ(fastdds::dds::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> delete_participant(statistics_participant)); } @@ -559,12 +556,12 @@ TEST_F(StatisticsDomainParticipantTests, CreateParticipantWithInvalidTopicName) EXPECT_EQ(consumed_entries.size(), 2u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a TypeSupport + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a TypeSupport * using a statistics reserved name registered in the participant. * 1. Create a participant and register a TypeSupport using one of the statistics reserved type names. * 2. Call enable_statistics_datawriter and check that it fails. @@ -603,7 +600,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); eprosima::fastdds::dds::TypeSupport type = participant->find_type(count_type.get_type_name()); EXPECT_FALSE(count_type == type); @@ -614,7 +611,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // 4. Call enable_statistics_datawriter with an already correctly registered type. EXPECT_EQ(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(physical_data_type == participant->find_type(physical_data_type.get_type_name())); EXPECT_NE(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); @@ -626,12 +623,12 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // delete_participant removes all builtin statistics entities EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a statistics + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a statistics * Topic created with another type different from the one expected. * 1. Create a participant and register a Topic using one of the statistics reserved topic names and with another type * different from the one expected. Register another Topic correctly. @@ -678,19 +675,19 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Check type registration EXPECT_EQ(null_type, participant->find_type(history_latency_type.get_type_name())); // 4. Call enable_statistics_datawriter with correctly created topic - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(count_type == participant->find_type(count_type.get_type_name())); // 5. Call enable_statistics_datawriter and check it is successful - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); // 6. Check log error entry @@ -699,9 +696,9 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp EXPECT_EQ(consumed_entries.size(), 1u); // delete_participant removes all builtin statistics entities but not others - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(invalid_topic)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, participant->delete_topic(invalid_topic)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -736,15 +733,15 @@ TEST_F(StatisticsDomainParticipantTests, DeleteParticipantAfterDeleteContainedEn DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Perform a delete_contained_entities() in the statistics participant - EXPECT_EQ(participant->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(participant->delete_contained_entities(), fastdds::dds::RETCODE_OK); // 4. Delete the participant EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsQosTests.cpp b/test/unittest/statistics/dds/StatisticsQosTests.cpp index d5c1f73d1f1..aaad09d88ba 100644 --- a/test/unittest/statistics/dds/StatisticsQosTests.cpp +++ b/test/unittest/statistics/dds/StatisticsQosTests.cpp @@ -15,10 +15,10 @@ #include #include - #include #include +#include #include #include #include @@ -29,7 +29,6 @@ #include #include #include -#include #ifdef FASTDDS_STATISTICS #include @@ -40,8 +39,6 @@ namespace fastdds { namespace statistics { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class StatisticsFromXMLProfileTests : public ::testing::Test { public: @@ -170,7 +167,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo const std::string xml = " \ \ - \ + \ \ \ \ @@ -318,10 +315,10 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(network_latency_writer, nullptr); // But user can enable it manually through enable_statistics_datawriter_with_profile() - ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( + fastdds::dds::ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); network_latency_writer = statistics_publisher->lookup_datawriter(network_latency_name); ASSERT_NE(network_latency_writer, nullptr); @@ -339,7 +336,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); subscription_througput_writer = statistics_publisher->lookup_datawriter(subscription_throughput_name); ASSERT_NE(subscription_througput_writer, nullptr); @@ -359,11 +356,11 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(qos4, subscription_througput_writer->get_qos()); // Calling enable_statistics_datawriter_with_profile with a profile that does not exist, - // RETCODE_ERROR must be returned. + // fastdds::dds::RETCODE_ERROR must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "FAKE_TOPIC", "FAKE_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_ERROR, ret); + ASSERT_EQ(fastdds::dds::RETCODE_ERROR, ret); // DATA_COUNT_TOPIC is defined with inconsistent QoS policies, // and configured to be enabled automatically at initialization @@ -376,17 +373,17 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(data_count_writer, nullptr); // Calling enable_statistics_datawriter_with_profile with a profile defined with inconsistent QoS configuration, - // RETCODE_INCONSISTENT_POLICY must be returned. + // fastdds::dds::RETCODE_INCONSISTENT_POLICY must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "HEARTBEAT_COUNT_TOPIC", "HEARTBEAT_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, ret); + ASSERT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, ret); // There is the possibility to enable a statistics topic with a profile defined with different name: ret = statistics_participant->enable_statistics_datawriter_with_profile( "OTHER_NAME_FOR_PROFILE", "NACKFRAG_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); std::string nackfrag_count_name = NACKFRAG_COUNT_TOPIC; eprosima::fastdds::dds::DataWriter* nackfrag_count_writer = statistics_publisher->lookup_datawriter(nackfrag_count_name); @@ -414,20 +411,20 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo statistics_participant = static_cast(participant); ASSERT_NE(statistics_participant, nullptr); - ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( + fastdds::dds::ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "HISTORY_LATENCY_TOPIC", "HISTORY_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); #endif // FASTDDS_STATISTICS @@ -446,7 +443,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo const std::string xml = " \ \ - \ + \ \ \ \ diff --git a/test/unittest/statistics/rtps/CMakeLists.txt b/test/unittest/statistics/rtps/CMakeLists.txt index a13e24cd0da..ea906b30359 100644 --- a/test/unittest/statistics/rtps/CMakeLists.txt +++ b/test/unittest/statistics/rtps/CMakeLists.txt @@ -18,10 +18,6 @@ endif() set(STATISTICS_RTPS_TESTS_SOURCE RTPSStatisticsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ) add_executable(RTPSStatisticsTests ${STATISTICS_RTPS_TESTS_SOURCE}) @@ -40,7 +36,7 @@ target_include_directories(RTPSStatisticsTests PRIVATE ${Asio_INCLUDE_DIR} ) -target_link_libraries(RTPSStatisticsTests fastrtps fastcdr GTest::gtest GTest::gmock) +target_link_libraries(RTPSStatisticsTests fastdds fastcdr GTest::gtest GTest::gmock) gtest_discover_tests(RTPSStatisticsTests) set(TCPTransportInterface_SOURCE @@ -66,37 +62,7 @@ endif() set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE MonitorServiceTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp @@ -123,11 +89,10 @@ set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -138,7 +103,7 @@ set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE add_executable(MonitorServiceTests ${STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE}) -target_compile_definitions(MonitorServiceTests PRIVATE FASTRTPS_NO_LIB +target_compile_definitions(MonitorServiceTests PRIVATE FASTDDS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE $<$>,$>:__DEBUG> @@ -148,6 +113,7 @@ target_compile_definitions(MonitorServiceTests PRIVATE FASTRTPS_NO_LIB target_include_directories(MonitorServiceTests PRIVATE mock/Publisher mock/StatisticsBase + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory ${PROJECT_SOURCE_DIR}/test/mock/rtps/BuiltinProtocols ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint @@ -155,6 +121,7 @@ target_include_directories(MonitorServiceTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/ExternalLocatorsProcessor ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter @@ -174,9 +141,13 @@ target_include_directories(MonitorServiceTests PRIVATE target_link_libraries(MonitorServiceTests fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation GTest::gtest GTest::gmock - $<$:OpenSSL::SSL$OpenSSL::Crypto>) + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ) gtest_discover_tests(MonitorServiceTests) diff --git a/test/unittest/statistics/rtps/MonitorServiceTests.cpp b/test/unittest/statistics/rtps/MonitorServiceTests.cpp index af7852a825f..bb35df72573 100644 --- a/test/unittest/statistics/rtps/MonitorServiceTests.cpp +++ b/test/unittest/statistics/rtps/MonitorServiceTests.cpp @@ -80,7 +80,7 @@ class MonitorServiceTests : public ::testing::Test [&]( fastrtps::rtps::RTPSWriter*, const fastrtps::TopicAttributes&, - const fastrtps::WriterQos&)->bool + const fastdds::dds::WriterQos&)->bool { return true; }, @@ -217,11 +217,11 @@ TEST_F(MonitorServiceTests, multiple_dds_status_updates) //! Trigger statuses updates for each entity for (auto& entity : mock_guids) { - listener_.on_local_entity_status_change(entity, statistics::INCOMPATIBLE_QOS); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_CHANGED); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_LOST); - listener_.on_local_entity_status_change(entity, statistics::DEADLINE_MISSED); - listener_.on_local_entity_status_change(entity, statistics::SAMPLE_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::INCOMPATIBLE_QOS); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_CHANGED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::DEADLINE_MISSED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::SAMPLE_LOST); } //! Verify expectations @@ -263,11 +263,11 @@ TEST_F(MonitorServiceTests, entity_removal_correctly_performs) for (auto& entity : mock_guids) { listener_.on_local_entity_connections_change(entity); - listener_.on_local_entity_status_change(entity, statistics::INCOMPATIBLE_QOS); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_CHANGED); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_LOST); - listener_.on_local_entity_status_change(entity, statistics::DEADLINE_MISSED); - listener_.on_local_entity_status_change(entity, statistics::SAMPLE_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::INCOMPATIBLE_QOS); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_CHANGED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::DEADLINE_MISSED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::SAMPLE_LOST); } //! Verify expectations diff --git a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp index a54d4c88183..2bf525fe701 100644 --- a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp +++ b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp @@ -14,6 +14,7 @@ #include #include + #if defined(_WIN32) #include #else @@ -26,9 +27,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -36,24 +39,17 @@ #include #include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #include #include #include -#include +#include +#include #include +#include namespace eprosima { namespace fastdds { @@ -88,52 +84,52 @@ struct MockListener : IListener auto kind = data._d(); switch (kind) { - case HISTORY2HISTORY_LATENCY: + case EventKind::HISTORY2HISTORY_LATENCY: on_history_latency(data.writer_reader_data()); break; - case RTPS_SENT: + case EventKind::RTPS_SENT: on_rtps_sent(data.entity2locator_traffic()); break; - case RTPS_LOST: + case EventKind::RTPS_LOST: on_rtps_lost(data.entity2locator_traffic()); break; - case NETWORK_LATENCY: + case EventKind::NETWORK_LATENCY: on_network_latency(data.locator2locator_data()); break; - case HEARTBEAT_COUNT: + case EventKind::HEARTBEAT_COUNT: on_heartbeat_count(data.entity_count()); break; - case ACKNACK_COUNT: + case EventKind::ACKNACK_COUNT: on_acknack_count(data.entity_count()); break; - case DATA_COUNT: + case EventKind::DATA_COUNT: on_data_count(data.entity_count()); break; - case RESENT_DATAS: + case EventKind::RESENT_DATAS: on_resent_count(data.entity_count()); break; - case GAP_COUNT: + case EventKind::GAP_COUNT: on_gap_count(data.entity_count()); break; - case NACKFRAG_COUNT: + case EventKind::NACKFRAG_COUNT: on_nackfrag_count(data.entity_count()); break; - case DISCOVERED_ENTITY: + case EventKind::DISCOVERED_ENTITY: on_entity_discovery(data.discovery_time()); break; - case PDP_PACKETS: + case EventKind::PDP_PACKETS: on_pdp_packets(data.entity_count()); break; - case EDP_PACKETS: + case EventKind::EDP_PACKETS: on_edp_packets(data.entity_count()); break; - case SAMPLE_DATAS: + case EventKind::SAMPLE_DATAS: on_sample_datas(data.sample_identity_count()); break; - case PUBLICATION_THROUGHPUT: + case EventKind::PUBLICATION_THROUGHPUT: on_publisher_throughput(data.entity_data()); break; - case SUBSCRIPTION_THROUGHPUT: + case EventKind::SUBSCRIPTION_THROUGHPUT: on_subscriber_throughput(data.entity_data()); break; default: @@ -158,7 +154,7 @@ struct MockListener : IListener MOCK_METHOD1(on_sample_datas, void(const eprosima::fastdds::statistics::SampleIdentityCount&)); MOCK_METHOD1(on_publisher_throughput, void(const eprosima::fastdds::statistics::EntityData&)); MOCK_METHOD1(on_subscriber_throughput, void(const eprosima::fastdds::statistics::EntityData&)); - MOCK_METHOD1(on_unexpected_kind, void(eprosima::fastdds::statistics::EventKind)); + MOCK_METHOD1(on_unexpected_kind, void(uint32_t)); }; class RTPSStatisticsTestsImpl @@ -355,8 +351,8 @@ class RTPSStatisticsTestsImpl void match_endpoints( bool key, - fastrtps::string_255 data_type, - fastrtps::string_255 topic_name) + fastcdr::string_255 data_type, + fastcdr::string_255 topic_name) { using namespace fastrtps; using namespace fastrtps::rtps; @@ -469,9 +465,9 @@ class RTPSStatisticsTests using namespace fastrtps; // Intraprocess must be disable in order to receive DATA callbacks - LibrarySettingsAttributes att; + LibrarySettings att; att.intraprocess_delivery = INTRAPROCESS_OFF; - xmlparser::XMLProfileManager::library_settings(att); + fastrtps::rtps::RTPSDomain::set_library_settings(att); create_participant(); } @@ -503,9 +499,9 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_management) auto nolistener = listener1; nolistener.reset(); - EventKind kind = EventKindBits::PUBLICATION_THROUGHPUT; - EventKind another_kind = EventKindBits::SUBSCRIPTION_THROUGHPUT; - EventKind yet_another_kind = EventKindBits::NETWORK_LATENCY; + uint32_t kind = EventKind::PUBLICATION_THROUGHPUT; + uint32_t another_kind = EventKind::SUBSCRIPTION_THROUGHPUT; + uint32_t yet_another_kind = EventKind::NETWORK_LATENCY; // test the participant apis // + fails to remove an empty listener @@ -635,13 +631,13 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks) // participant specific callbacks auto participant_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, - EventKindBits::RTPS_SENT | EventKindBits::NETWORK_LATENCY | EventKindBits::RTPS_LOST)); + EventKind::RTPS_SENT | EventKind::NETWORK_LATENCY | EventKind::RTPS_LOST)); // writer callbacks through participant listener auto participant_writer_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_writer_listener, - EventKindBits::DATA_COUNT | EventKindBits::RESENT_DATAS | - EventKindBits::PUBLICATION_THROUGHPUT | EventKindBits::SAMPLE_DATAS)); + EventKind::DATA_COUNT | EventKind::RESENT_DATAS | + EventKind::PUBLICATION_THROUGHPUT | EventKind::SAMPLE_DATAS)); // writer specific callbacks auto writer_listener = make_shared(); @@ -650,8 +646,8 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks) // reader callbacks through participant listener auto participant_reader_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_reader_listener, - EventKindBits::ACKNACK_COUNT | EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::SUBSCRIPTION_THROUGHPUT)); + EventKind::ACKNACK_COUNT | EventKind::HISTORY2HISTORY_LATENCY | + EventKind::SUBSCRIPTION_THROUGHPUT)); // reader specific callbacks auto reader_listener = make_shared(); @@ -726,28 +722,28 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks) EXPECT_TRUE(reader_->remove_statistics_listener(reader_listener)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, - EventKindBits::RTPS_SENT | EventKindBits::NETWORK_LATENCY | EventKindBits::RTPS_LOST)); + EventKind::RTPS_SENT | EventKind::NETWORK_LATENCY | EventKind::RTPS_LOST)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_writer_listener, - EventKindBits::DATA_COUNT | EventKindBits::RESENT_DATAS | - EventKindBits::PUBLICATION_THROUGHPUT | EventKindBits::SAMPLE_DATAS)); + EventKind::DATA_COUNT | EventKind::RESENT_DATAS | + EventKind::PUBLICATION_THROUGHPUT | EventKind::SAMPLE_DATAS)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_reader_listener, - EventKindBits::ACKNACK_COUNT | EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::SUBSCRIPTION_THROUGHPUT)); + EventKind::ACKNACK_COUNT | EventKind::HISTORY2HISTORY_LATENCY | + EventKind::SUBSCRIPTION_THROUGHPUT)); }; // Check that setting the mask after creating the endpoints work uint32_t enable_writers_mask = - EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::NETWORK_LATENCY | - EventKindBits::PUBLICATION_THROUGHPUT | - EventKindBits::SUBSCRIPTION_THROUGHPUT | - EventKindBits::RTPS_SENT | - EventKindBits::RTPS_LOST | - EventKindBits::RESENT_DATAS | - EventKindBits::HEARTBEAT_COUNT | - EventKindBits::ACKNACK_COUNT | - EventKindBits::DATA_COUNT | - EventKindBits::SAMPLE_DATAS; + EventKind::HISTORY2HISTORY_LATENCY | + EventKind::NETWORK_LATENCY | + EventKind::PUBLICATION_THROUGHPUT | + EventKind::SUBSCRIPTION_THROUGHPUT | + EventKind::RTPS_SENT | + EventKind::RTPS_LOST | + EventKind::RESENT_DATAS | + EventKind::HEARTBEAT_COUNT | + EventKind::ACKNACK_COUNT | + EventKind::DATA_COUNT | + EventKind::SAMPLE_DATAS; create_endpoints(length, RELIABLE); participant_->set_enabled_statistics_writers_mask(enable_writers_mask); test_execution(); @@ -803,16 +799,16 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks_fragmented) }); uint32_t enable_writers_mask = - EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::HEARTBEAT_COUNT | - EventKindBits::ACKNACK_COUNT | - EventKindBits::NACKFRAG_COUNT | - EventKindBits::DATA_COUNT; + EventKind::HISTORY2HISTORY_LATENCY | + EventKind::HEARTBEAT_COUNT | + EventKind::ACKNACK_COUNT | + EventKind::NACKFRAG_COUNT | + EventKind::DATA_COUNT; // writer callbacks through participant listener auto participant_listener = make_shared(); - uint32_t mask = EventKindBits::DATA_COUNT | EventKindBits::HEARTBEAT_COUNT - | EventKindBits::ACKNACK_COUNT | EventKindBits::NACKFRAG_COUNT | EventKindBits::HISTORY2HISTORY_LATENCY; + uint32_t mask = EventKind::DATA_COUNT | EventKind::HEARTBEAT_COUNT + | EventKind::ACKNACK_COUNT | EventKind::NACKFRAG_COUNT | EventKind::HISTORY2HISTORY_LATENCY; ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, mask)); participant_->set_enabled_statistics_writers_mask(enable_writers_mask); @@ -913,13 +909,13 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks_no_enabled_writer // participant specific callbacks auto participant_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, - EventKindBits::RTPS_SENT | EventKindBits::NETWORK_LATENCY | EventKindBits::RTPS_LOST)); + EventKind::RTPS_SENT | EventKind::NETWORK_LATENCY | EventKind::RTPS_LOST)); // writer callbacks through participant listener auto participant_writer_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_writer_listener, - EventKindBits::DATA_COUNT | EventKindBits::RESENT_DATAS | - EventKindBits::PUBLICATION_THROUGHPUT | EventKindBits::SAMPLE_DATAS)); + EventKind::DATA_COUNT | EventKind::RESENT_DATAS | + EventKind::PUBLICATION_THROUGHPUT | EventKind::SAMPLE_DATAS)); // writer specific callbacks auto writer_listener = make_shared(); @@ -928,8 +924,8 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks_no_enabled_writer // reader callbacks through participant listener auto participant_reader_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_reader_listener, - EventKindBits::ACKNACK_COUNT | EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::SUBSCRIPTION_THROUGHPUT)); + EventKind::ACKNACK_COUNT | EventKind::HISTORY2HISTORY_LATENCY | + EventKind::SUBSCRIPTION_THROUGHPUT)); // reader specific callbacks auto reader_listener = make_shared(); @@ -1004,13 +1000,13 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_callbacks_no_enabled_writer EXPECT_TRUE(reader_->remove_statistics_listener(reader_listener)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, - EventKindBits::RTPS_SENT | EventKindBits::NETWORK_LATENCY | EventKindBits::RTPS_LOST)); + EventKind::RTPS_SENT | EventKind::NETWORK_LATENCY | EventKind::RTPS_LOST)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_writer_listener, - EventKindBits::DATA_COUNT | EventKindBits::RESENT_DATAS | - EventKindBits::PUBLICATION_THROUGHPUT | EventKindBits::SAMPLE_DATAS)); + EventKind::DATA_COUNT | EventKind::RESENT_DATAS | + EventKind::PUBLICATION_THROUGHPUT | EventKind::SAMPLE_DATAS)); EXPECT_TRUE(participant_->remove_statistics_listener(participant_reader_listener, - EventKindBits::ACKNACK_COUNT | EventKindBits::HISTORY2HISTORY_LATENCY | - EventKindBits::SUBSCRIPTION_THROUGHPUT)); + EventKind::ACKNACK_COUNT | EventKind::HISTORY2HISTORY_LATENCY | + EventKind::SUBSCRIPTION_THROUGHPUT)); } /* @@ -1024,14 +1020,14 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_gap_callback) using namespace std; uint32_t enable_writers_mask = - EventKindBits::PUBLICATION_THROUGHPUT | - EventKindBits::RESENT_DATAS | - EventKindBits::HEARTBEAT_COUNT | - EventKindBits::ACKNACK_COUNT | - EventKindBits::NACKFRAG_COUNT | - EventKindBits::GAP_COUNT | - EventKindBits::DATA_COUNT | - EventKindBits::SAMPLE_DATAS; + EventKind::PUBLICATION_THROUGHPUT | + EventKind::RESENT_DATAS | + EventKind::HEARTBEAT_COUNT | + EventKind::ACKNACK_COUNT | + EventKind::NACKFRAG_COUNT | + EventKind::GAP_COUNT | + EventKind::DATA_COUNT | + EventKind::SAMPLE_DATAS; // create the listeners and set expectations auto participant_writer_listener = make_shared(); @@ -1060,7 +1056,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_gap_callback) writer_->set_enabled_statistics_writers_mask(enable_writers_mask); // writer callback through participant listener - ASSERT_TRUE(participant_->add_statistics_listener(participant_writer_listener, EventKindBits::GAP_COUNT)); + ASSERT_TRUE(participant_->add_statistics_listener(participant_writer_listener, EventKind::GAP_COUNT)); // writer specific callbacks ASSERT_TRUE(writer_->add_statistics_listener(writer_listener)); @@ -1091,7 +1087,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_gap_callback) // release the listeners EXPECT_TRUE(writer_->remove_statistics_listener(writer_listener)); - EXPECT_TRUE(participant_->remove_statistics_listener(participant_writer_listener, EventKindBits::GAP_COUNT)); + EXPECT_TRUE(participant_->remove_statistics_listener(participant_writer_listener, EventKind::GAP_COUNT)); } /* @@ -1105,14 +1101,14 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_discovery_callbacks) using namespace std; uint32_t enable_writers_mask = - EventKindBits::PDP_PACKETS | - EventKindBits::EDP_PACKETS | - EventKindBits::DISCOVERED_ENTITY; + EventKind::PDP_PACKETS | + EventKind::EDP_PACKETS | + EventKind::DISCOVERED_ENTITY; // create the listener and set expectations auto participant_listener = make_shared(); ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, - EventKindBits::DISCOVERED_ENTITY | EventKindBits::PDP_PACKETS | EventKindBits::EDP_PACKETS)); + EventKind::DISCOVERED_ENTITY | EventKind::PDP_PACKETS | EventKind::EDP_PACKETS)); participant_->set_enabled_statistics_writers_mask(enable_writers_mask); // check callbacks on data exchange @@ -1157,7 +1153,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_listener_discovery_callbacks) } // release the listener - EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, EventKindBits::DISCOVERED_ENTITY)); + EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, EventKind::DISCOVERED_ENTITY)); } /* @@ -1241,11 +1237,11 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_avoid_empty_resent_callbacks) uint16_t length = 255; create_lazy_writer(length, RELIABLE, TRANSIENT_LOCAL); uint32_t enable_writers_mask = - EventKindBits::HEARTBEAT_COUNT | - EventKindBits::DATA_COUNT | - EventKindBits::SAMPLE_DATAS | - EventKindBits::PUBLICATION_THROUGHPUT | - EventKindBits::RESENT_DATAS; + EventKind::HEARTBEAT_COUNT | + EventKind::DATA_COUNT | + EventKind::SAMPLE_DATAS | + EventKind::PUBLICATION_THROUGHPUT | + EventKind::RESENT_DATAS; writer_->set_enabled_statistics_writers_mask(enable_writers_mask); // writer specific callbacks @@ -1348,8 +1344,8 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_unordered_datagrams) // create the listener and set expectations auto participant_listener = make_shared(); - ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, EventKindBits::RTPS_LOST)); - participant_->set_enabled_statistics_writers_mask(EventKindBits::RTPS_LOST); + ASSERT_TRUE(participant_->add_statistics_listener(participant_listener, EventKind::RTPS_LOST)); + participant_->set_enabled_statistics_writers_mask(EventKind::RTPS_LOST); std::vector lost_callback_data; auto callback_action = [&lost_callback_data](const Entity2LocatorTraffic& data) -> void @@ -1386,7 +1382,7 @@ TEST_F(RTPSStatisticsTests, statistics_rpts_unordered_datagrams) std::this_thread::sleep_for(std::chrono::seconds(1)); // release the listener - EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, EventKindBits::RTPS_LOST)); + EXPECT_TRUE(participant_->remove_statistics_listener(participant_listener, EventKind::RTPS_LOST)); // Check reported callbacks EXPECT_EQ(sizeof(lost_count_notified) / sizeof(lost_count_notified[0]), lost_callback_data.size()); diff --git a/test/unittest/statistics/rtps/mock/Publisher/fastdds/publisher/DataWriterHistory.hpp b/test/unittest/statistics/rtps/mock/Publisher/fastdds/publisher/DataWriterHistory.hpp index f1859167b1f..ef28c734513 100644 --- a/test/unittest/statistics/rtps/mock/Publisher/fastdds/publisher/DataWriterHistory.hpp +++ b/test/unittest/statistics/rtps/mock/Publisher/fastdds/publisher/DataWriterHistory.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include namespace eprosima { namespace fastrtps { diff --git a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp index 8d1ee7f86de..8f2b04b0f27 100644 --- a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp +++ b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp @@ -24,11 +24,9 @@ #include #include -#include - - -#include +#include +#include namespace eprosima { namespace fastdds { diff --git a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp index 0160eec3d28..636a93084af 100644 --- a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp +++ b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp @@ -27,16 +27,16 @@ #include #include +#include #include #include #include #include -#include #include #include #include -#include +#include #include namespace eprosima { @@ -63,7 +63,7 @@ class MonitorService using endpoint_registrator_t = std::function; + const fastdds::dds::WriterQos&)>; MonitorService( const fastrtps::rtps::GUID_t& guid, @@ -167,7 +167,7 @@ class MonitorService */ bool write_status( const fastrtps::rtps::EntityId_t& entity_id, - const std::bitset& changed_statuses, + const std::bitset& changed_statuses, const bool& entity_disposed); /** @@ -233,7 +233,7 @@ class MonitorService //! inserted twice. std::map, bool>> local_entities_; + std::bitset, bool>> local_entities_; std::unique_ptr event_; diff --git a/test/unittest/transport/CMakeLists.txt b/test/unittest/transport/CMakeLists.txt index 9d201a3a95a..fdbe4c131cb 100644 --- a/test/unittest/transport/CMakeLists.txt +++ b/test/unittest/transport/CMakeLists.txt @@ -67,10 +67,6 @@ endif() set(UDPV4TESTS_SOURCE UDPv4Tests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -99,10 +95,6 @@ set(UDPV4TESTS_SOURCE set(UDPV6TESTS_SOURCE UDPv6Tests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -134,10 +126,6 @@ set(TCPV4TESTS_SOURCE mock/MockReceiverResource.cpp mock/MockTCPChannelResource.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -168,7 +156,6 @@ set(TCPV4TESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ) @@ -185,10 +172,6 @@ set(TCPV6TESTS_SOURCE TCPv6Tests.cpp mock/MockReceiverResource.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -219,7 +202,6 @@ set(TCPV6TESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp ) @@ -235,10 +217,6 @@ endif() set(SHAREDMEMTESTS_SOURCE SharedMemTests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -305,6 +283,7 @@ target_include_directories(UDPv4Tests PRIVATE ) target_link_libraries(UDPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -341,6 +320,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(UDPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -374,6 +354,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(TCPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -410,6 +391,7 @@ target_include_directories(TCPv4Tests PRIVATE ) target_link_libraries(TCPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -449,6 +431,7 @@ if(IS_THIRDPARTY_BOOST_OK) target_link_libraries(SharedMemTests foonathan_memory fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto> diff --git a/test/unittest/transport/SharedMemTests.cpp b/test/unittest/transport/SharedMemTests.cpp index 35470bf9489..8459305fbbd 100644 --- a/test/unittest/transport/SharedMemTests.cpp +++ b/test/unittest/transport/SharedMemTests.cpp @@ -12,24 +12,28 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include -#include -#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemSenderResource.hpp" -#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemManager.hpp" -#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemGlobal.hpp" -#include "../../../src/cpp/rtps/transport/shared_mem/MultiProducerConsumerRingBuffer.hpp" - -#include #include +#include #include #include -#include -#include +#include #include +#include + +#include +#include + +#include + +#include "../../../src/cpp/rtps/transport/shared_mem/MultiProducerConsumerRingBuffer.hpp" +#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemGlobal.hpp" +#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemManager.hpp" +#include "../../../src/cpp/rtps/transport/shared_mem/SharedMemSenderResource.hpp" + +#include +#include + using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastdds; @@ -386,7 +390,7 @@ TEST_F(SHMCondition, wait_notify) // POSIX glibc 2.25 conditions are not robust when used with interprocess shared memory: // https://sourceware.org/bugzilla/show_bug.cgi?id=21422 -// FastRTPS > v1.10.0 SHM has implemented robust conditions to solve issue #1144 +// Fast DDS > v1.10.0 SHM has implemented robust conditions to solve issue #1144 // This is the correspoding regresion test #ifndef _MSC_VER TEST_F(SHMCondition, robust_condition_fix_glibc_deadlock) @@ -733,7 +737,7 @@ TEST_F(SHMTransportTests, send_and_receive_between_ports) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); ASSERT_TRUE(transportUnderTest.IsInputChannelOpen(unicastLocator)); @@ -796,7 +800,7 @@ TEST_F(SHMTransportTests, port_and_segment_overflow_discard) outputChannelLocator.kind = LOCATOR_KIND_SHM; outputChannelLocator.port = g_default_port + 1; - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[4] = { 'H', 'e', 'l', 'l'}; @@ -1781,7 +1785,7 @@ TEST_F(SHMTransportTests, remote_segments_free) LocatorList send_locators_list; send_locators_list.push_back(pub_locator); - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transport.OpenOutputChannel(send_resource_list, pub_locator)); std::function sub_callback = [&]() @@ -1817,7 +1821,7 @@ TEST_F(SHMTransportTests, remote_segments_free) LocatorList send_locators_list; send_locators_list.push_back(sub_locator); - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transport.OpenOutputChannel(send_resource_list, sub_locator)); std::chrono::high_resolution_clock::rep total_times = 0; @@ -1920,7 +1924,7 @@ TEST_F(SHMTransportTests, remote_segments_free) LocatorList send_locators_list; send_locators_list.push_back(sub_locator); - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(pub_transport.OpenOutputChannel(send_resource_list, sub_locator)); auto t0 = std::chrono::high_resolution_clock::now(); @@ -2005,7 +2009,7 @@ TEST_F(SHMTransportTests, remote_segments_free) LocatorList send_locators_list; send_locators_list.push_back(sub_locator); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(pub_transport.OpenOutputChannel(send_resource_list, sub_locator)); auto t0 = std::chrono::high_resolution_clock::now(); @@ -2052,7 +2056,7 @@ TEST_F(SHMTransportTests, dump_file) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - eprosima::fastrtps::rtps::SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); ASSERT_TRUE(transportUnderTest.IsInputChannelOpen(unicastLocator)); diff --git a/test/unittest/transport/TCPv4Tests.cpp b/test/unittest/transport/TCPv4Tests.cpp index 7c6ad31efb0..64786dfcd13 100644 --- a/test/unittest/transport/TCPv4Tests.cpp +++ b/test/unittest/transport/TCPv4Tests.cpp @@ -17,22 +17,30 @@ #include #include -#include -#include "mock/MockTCPChannelResource.h" -#include "mock/MockTCPv4Transport.h" + #include #include -#include -#include -#include -#include -#include +#include +#include +#include + +#include "mock/MockTCPChannelResource.h" +#include "mock/MockTCPv4Transport.h" +#include + #include +#include +#include +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; +using MockTCPv4Transport = eprosima::fastdds::rtps::MockTCPv4Transport; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; +using TCPChannelResourceBasic = eprosima::fastdds::rtps::TCPChannelResourceBasic; using TCPHeader = eprosima::fastdds::rtps::TCPHeader; +using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; +using TCPv4TransportDescriptor = eprosima::fastdds::rtps::TCPv4TransportDescriptor; #if defined(_WIN32) #define GET_PID _getpid @@ -75,8 +83,8 @@ class TCPv4Tests : public ::testing::Test void HELPER_SetDescriptorDefaults(); - TCPv4TransportDescriptor descriptor; - TCPv4TransportDescriptor descriptorOnlyOutput; + eprosima::fastdds::rtps::TCPv4TransportDescriptor descriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor descriptorOnlyOutput; std::unique_ptr senderThread; std::unique_ptr receiverThread; }; @@ -110,7 +118,7 @@ TEST_F(TCPv4Tests, opening_and_closing_output_channel) genericOutputChannelLocator.kind = LOCATOR_KIND_TCPv4; genericOutputChannelLocator.port = g_output_port; // arbitrary IPLocator::setLogicalPort(genericOutputChannelLocator, g_output_port); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; // Then ASSERT_FALSE(transportUnderTest.is_output_channel_open_for(genericOutputChannelLocator)); @@ -137,7 +145,7 @@ TEST_F(TCPv4Tests, opening_and_closing_output_channel_with_listener) // acceptor (no channel resource is created until it receives a connection request). genericOutputChannelLocator.port = g_output_port + 1; IPLocator::setLogicalPort(genericOutputChannelLocator, g_output_port + 1); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; // Then ASSERT_FALSE(transportUnderTest.is_output_channel_open_for(genericOutputChannelLocator)); @@ -174,12 +182,12 @@ TEST_F(TCPv4Tests, send_and_receive_between_ports) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; TCPv4Transport sendTransportUnderTest(sendDescriptor); sendTransportUnderTest.init(); @@ -202,7 +210,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_ports) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -249,7 +257,7 @@ TEST_F(TCPv4Tests, send_is_rejected_if_buffer_size_is_bigger_to_size_specified_i genericOutputChannelLocator.kind = LOCATOR_KIND_TCPv4; genericOutputChannelLocator.port = g_output_port; IPLocator::setLogicalPort(genericOutputChannelLocator, 7400); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; transportUnderTest.OpenOutputChannel(send_resource_list, genericOutputChannelLocator); ASSERT_FALSE(send_resource_list.empty()); @@ -285,7 +293,7 @@ TEST_F(TCPv4Tests, RemoteToMainLocal_simply_strips_out_address_leaving_IP_ANY) ASSERT_EQ(mainLocalLocator.port, remote_locator.port); ASSERT_EQ(mainLocalLocator.kind, remote_locator.kind); - ASSERT_EQ(IPLocator::toIPv4string(mainLocalLocator), s_IPv4AddressAny); + ASSERT_EQ(IPLocator::toIPv4string(mainLocalLocator), eprosima::fastdds::rtps::s_IPv4AddressAny); } TEST_F(TCPv4Tests, match_if_port_AND_address_matches) @@ -317,7 +325,7 @@ TEST_F(TCPv4Tests, send_to_wrong_interface) outputChannelLocator.kind = LOCATOR_KIND_TCPv4; IPLocator::setLogicalPort(outputChannelLocator, 7400); IPLocator::setIPv4(outputChannelLocator, 127, 0, 0, 1); // Loopback - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); @@ -346,7 +354,7 @@ TEST_F(TCPv4Tests, send_to_blocked_interface) outputChannelLocator.kind = LOCATOR_KIND_TCPv4; IPLocator::setLogicalPort(outputChannelLocator, 7400); IPLocator::setIPv4(outputChannelLocator, 127, 0, 0, 1); // Loopback - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); @@ -386,13 +394,13 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_interfaces_ports) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.interfaceWhiteList.emplace_back(IPLocator::toIPv4string(locator)); recvDescriptor.add_listener_port(g_default_port); TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.interfaceWhiteList.emplace_back(IPLocator::toIPv4string(locator)); TCPv4Transport sendTransportUnderTest(sendDescriptor); sendTransportUnderTest.init(); @@ -417,7 +425,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_interfaces_ports) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -490,7 +498,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_interfaces_ports_by_name) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; std::cout << "Adding to whitelist: " << interfaces[0].dev << " " << interfaces[0].name << " " << interfaces[0].locator << std::endl; recvDescriptor.interfaceWhiteList.emplace_back(interfaces[0].dev); @@ -499,7 +507,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_interfaces_ports_by_name) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.interfaceWhiteList.emplace_back(interfaces[0].dev); TCPv4Transport sendTransportUnderTest(sendDescriptor); @@ -525,7 +533,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_interfaces_ports_by_name) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -618,7 +626,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_client_verifies) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.password = "fastddspwd"; @@ -633,7 +641,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_client_verifies) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.verify_file = "ca.crt"; sendDescriptor.tls_config.verify_mode = TLSVerifyMode::VERIFY_PEER; @@ -664,7 +672,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_client_verifies) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -715,7 +723,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_server_verifies) using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; using TLSHSRole = TCPTransportDescriptor::TLSConfig::TLSHandShakeRole; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.handshake_role = TLSHSRole::CLIENT; @@ -728,7 +736,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_server_verifies) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.handshake_role = TLSHSRole::SERVER; sendDescriptor.tls_config.password = "fastddspwd"; @@ -763,7 +771,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_server_verifies) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -813,7 +821,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.password = "testkey"; @@ -830,7 +838,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.password = "testkey"; sendDescriptor.tls_config.cert_chain_file = "mainsubcert.pem"; @@ -865,7 +873,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -915,7 +923,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_untrusted) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.password = "testkey"; @@ -932,7 +940,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_untrusted) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.password = "testkey"; sendDescriptor.tls_config.cert_chain_file = "mainsubcert.pem"; @@ -967,7 +975,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_untrusted) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1022,7 +1030,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_clients_1) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSHSRole = TCPTransportDescriptor::TLSConfig::TLSHandShakeRole; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.handshake_role = TLSHSRole::CLIENT; @@ -1038,7 +1046,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_clients_1) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.handshake_role = TLSHSRole::SERVER; sendDescriptor.tls_config.password = "testkey"; @@ -1073,7 +1081,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_clients_1) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1124,7 +1132,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_untrusted_server) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.password = "testkey"; @@ -1140,7 +1148,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_untrusted_server) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.verify_file = "ca.pem"; // This CA doesn't know about these certificates sendDescriptor.tls_config.verify_mode = TLSVerifyMode::VERIFY_PEER; @@ -1172,7 +1180,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_secure_ports_untrusted_server) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1229,7 +1237,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_with_sni) using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); recvDescriptor.apply_security = true; recvDescriptor.tls_config.password = "testkey"; @@ -1246,7 +1254,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_with_sni) TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.apply_security = true; sendDescriptor.tls_config.password = "testkey"; sendDescriptor.tls_config.cert_chain_file = "mainsubcert.pem"; @@ -1282,7 +1290,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_both_secure_ports_with_sni) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1337,7 +1345,7 @@ TEST_F(TCPv4Tests, secure_non_blocking_send) // Create a TCP Server transport using TLSOptions = TCPTransportDescriptor::TLSConfig::TLSOptions; using TLSVerifyMode = TCPTransportDescriptor::TLSConfig::TLSVerifyMode; - TCPv4TransportDescriptor senderDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor senderDescriptor; senderDescriptor.add_listener_port(port); senderDescriptor.apply_security = true; senderDescriptor.non_blocking_send = true; @@ -1436,7 +1444,8 @@ TEST_F(TCPv4Tests, secure_non_blocking_send) auto sender_unbound_channel_resources = senderTransportUnderTest.get_unbound_channel_resources(); ASSERT_TRUE(sender_unbound_channel_resources.size() == 1u); auto sender_channel_resource = - std::static_pointer_cast(sender_unbound_channel_resources[0]); + std::static_pointer_cast( + sender_unbound_channel_resources[0]); // Prepare the message asio::error_code ec; @@ -1476,13 +1485,13 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_localhost_interfaces_ports) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.interfaceWhiteList.emplace_back("127.0.0.1"); recvDescriptor.add_listener_port(g_default_port); TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.interfaceWhiteList.emplace_back("127.0.0.1"); TCPv4Transport sendTransportUnderTest(sendDescriptor); sendTransportUnderTest.init(); @@ -1507,7 +1516,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_allowed_localhost_interfaces_ports) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1571,13 +1580,13 @@ TEST_F(TCPv4Tests, send_and_receive_between_blocked_interfaces_ports) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Kind::Info); std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.interfaceWhiteList.emplace_back(IPLocator::toIPv4string(locator)); recvDescriptor.add_listener_port(g_default_port); TCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor; sendDescriptor.interfaceWhiteList.emplace_back(IPLocator::toIPv4string(locator)); TCPv4Transport sendTransportUnderTest(sendDescriptor); sendTransportUnderTest.init(); @@ -1602,7 +1611,7 @@ TEST_F(TCPv4Tests, send_and_receive_between_blocked_interfaces_ports) MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); ASSERT_TRUE(receiveTransportUnderTest.IsInputChannelOpen(inputLocator)); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(sendTransportUnderTest.OpenOutputChannel(send_resource_list, outputLocator)); ASSERT_FALSE(send_resource_list.empty()); octet message[5] = { 'H', 'e', 'l', 'l', 'o' }; @@ -1663,7 +1672,7 @@ TEST_F(TCPv4Tests, receive_unordered_data) "-RTCRTC", "-RTCRT", "-RTCR" }; - struct Receiver : public TransportReceiverInterface + struct Receiver : public eprosima::fastdds::rtps::TransportReceiverInterface { std::array num_received{ 0, 0, 0 }; @@ -1697,7 +1706,7 @@ TEST_F(TCPv4Tests, receive_unordered_data) Receiver receiver; - TCPv4TransportDescriptor test_descriptor = descriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor test_descriptor = descriptor; test_descriptor.check_crc = false; TCPv4Transport uut(test_descriptor); ASSERT_TRUE(uut.init()) << "Failed to initialize transport. Port " << g_default_port << " may be in use"; @@ -1790,7 +1799,7 @@ TEST_F(TCPv4Tests, header_read_interrumption) std::regex filter("RTCP(?!_SEQ)"); eprosima::fastdds::dds::Log::SetCategoryFilter(filter); - TCPv4TransportDescriptor test_descriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor test_descriptor; test_descriptor.add_listener_port(g_default_port); TCPv4Transport transportUnderTest(test_descriptor); transportUnderTest.init(); @@ -1832,7 +1841,7 @@ TEST_F(TCPv4Tests, header_read_interrumption) TEST_F(TCPv4Tests, autofill_port) { // Check normal port assignation - TCPv4TransportDescriptor test_descriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor test_descriptor; test_descriptor.add_listener_port(g_default_port); TCPv4Transport transportUnderTest(test_descriptor); transportUnderTest.init(); @@ -1840,7 +1849,7 @@ TEST_F(TCPv4Tests, autofill_port) EXPECT_TRUE(transportUnderTest.configuration()->listening_ports[0] == g_default_port); // Check default port assignation - TCPv4TransportDescriptor test_descriptor_autofill; + eprosima::fastdds::rtps::TCPv4TransportDescriptor test_descriptor_autofill; test_descriptor_autofill.add_listener_port(0); TCPv4Transport transportUnderTest_autofill(test_descriptor_autofill); transportUnderTest_autofill.init(); @@ -1854,16 +1863,16 @@ TEST_F(TCPv4Tests, autofill_port) // process this lead to overwriting server's channel resources map elements. TEST_F(TCPv4Tests, client_announced_local_port_uniqueness) { - TCPv4TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); MockTCPv4Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv4TransportDescriptor sendDescriptor_1; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor_1; TCPv4Transport sendTransportUnderTest_1(sendDescriptor_1); sendTransportUnderTest_1.init(); - TCPv4TransportDescriptor sendDescriptor_2; + eprosima::fastdds::rtps::TCPv4TransportDescriptor sendDescriptor_2; TCPv4Transport sendTransportUnderTest_2(sendDescriptor_2); sendTransportUnderTest_2.init(); @@ -1873,11 +1882,11 @@ TEST_F(TCPv4Tests, client_announced_local_port_uniqueness) outputLocator.port = g_default_port; IPLocator::setLogicalPort(outputLocator, 7410); - SendResourceList send_resource_list_1; + eprosima::fastdds::rtps::SendResourceList send_resource_list_1; ASSERT_TRUE(sendTransportUnderTest_1.OpenOutputChannel(send_resource_list_1, outputLocator)); ASSERT_FALSE(send_resource_list_1.empty()); - SendResourceList send_resource_list_2; + eprosima::fastdds::rtps::SendResourceList send_resource_list_2; ASSERT_TRUE(sendTransportUnderTest_2.OpenOutputChannel(send_resource_list_2, outputLocator)); ASSERT_FALSE(send_resource_list_2.empty()); @@ -1894,7 +1903,7 @@ TEST_F(TCPv4Tests, non_blocking_send) uint16_t port = g_default_port; uint32_t msg_size = eprosima::fastdds::rtps::s_minimumSocketBuffer; // Create a TCP Server transport - TCPv4TransportDescriptor senderDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor senderDescriptor; senderDescriptor.add_listener_port(port); senderDescriptor.non_blocking_send = true; senderDescriptor.sendBufferSize = msg_size; @@ -1949,7 +1958,8 @@ TEST_F(TCPv4Tests, non_blocking_send) auto sender_unbound_channel_resources = senderTransportUnderTest.get_unbound_channel_resources(); ASSERT_TRUE(sender_unbound_channel_resources.size() == 1u); auto sender_channel_resource = - std::static_pointer_cast(sender_unbound_channel_resources[0]); + std::static_pointer_cast( + sender_unbound_channel_resources[0]); // Prepare the message asio::error_code ec; @@ -1987,13 +1997,13 @@ TEST_F(TCPv4Tests, reconnect_after_open_port_failure) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Warning); uint16_t port = g_default_port; // Create a TCP Server transport - TCPv4TransportDescriptor serverDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor serverDescriptor; serverDescriptor.add_listener_port(port); std::unique_ptr serverTransportUnderTest(new TCPv4Transport(serverDescriptor)); serverTransportUnderTest->init(); // Create a TCP Client transport - TCPv4TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor clientDescriptor; std::unique_ptr clientTransportUnderTest(new MockTCPv4Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -2004,7 +2014,7 @@ TEST_F(TCPv4Tests, reconnect_after_open_port_failure) // Connect client to server EXPECT_TRUE(serverTransportUnderTest->OpenInputChannel(initialPeerLocator, nullptr, 0x00FF)); - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); ASSERT_FALSE(client_resource_list.empty()); std::this_thread::sleep_for(std::chrono::milliseconds(300)); @@ -2082,7 +2092,7 @@ TEST_F(TCPv4Tests, opening_output_channel_with_same_locator_as_local_listening_p IPLocator::setIPv4(lowerOutputChannelLocator, 1, 1, 1, 1); IPLocator::setIPv4(higherOutputChannelLocator, 255, 255, 255, 255); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; // If the remote address is lower than the local one, no channel must be created but it must be added to the send_resource_list ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, lowerOutputChannelLocator)); @@ -2109,7 +2119,7 @@ TEST_F(TCPv4Tests, remove_from_send_resource_list) for (const std::string& test_case : test_cases) { - TCPv4TransportDescriptor send_descriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor send_descriptor; MockTCPv4Transport send_transport_under_test(send_descriptor); send_transport_under_test.init(); @@ -2136,7 +2146,7 @@ TEST_F(TCPv4Tests, remove_from_send_resource_list) initial_peer_list.push_back(initial_peer_locator); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(send_transport_under_test.OpenOutputChannel(send_resource_list, discovery_locator)); ASSERT_TRUE(send_transport_under_test.OpenOutputChannel(send_resource_list, initial_peer_locator)); ASSERT_EQ(send_resource_list.size(), 2u); @@ -2193,7 +2203,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) // TCP Client { uint16_t port = 12345; - TCPv4TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor clientDescriptor; std::unique_ptr clientTransportUnderTest(new MockTCPv4Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -2203,7 +2213,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(initialPeerLocator, 7410); // OpenOutputChannel - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); IPLocator::setLogicalPort(initialPeerLocator, 7411); ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); @@ -2223,7 +2233,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) // Discovered participant physical port has to have a lower value than the listening port to behave as a server uint16_t participantPhysicalLocator = 12344; // Create a TCP Server transport - TCPv4TransportDescriptor serverDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor serverDescriptor; serverDescriptor.add_listener_port(port); std::unique_ptr serverTransportUnderTest(new MockTCPv4Transport(serverDescriptor)); serverTransportUnderTest->init(); @@ -2235,7 +2245,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(discoveredParticipantLocator, 7410); // OpenOutputChannel - SendResourceList server_resource_list; + eprosima::fastdds::rtps::SendResourceList server_resource_list; ASSERT_TRUE(serverTransportUnderTest->OpenOutputChannel(server_resource_list, discoveredParticipantLocator)); IPLocator::setLogicalPort(discoveredParticipantLocator, 7411); ASSERT_TRUE(serverTransportUnderTest->OpenOutputChannel(server_resource_list, discoveredParticipantLocator)); @@ -2258,7 +2268,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) // Discovered participant physical port has to have a larger value than the listening port to behave as a client uint16_t participantPhysicalLocator = 12346; // Create a TCP Client transport - TCPv4TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv4TransportDescriptor clientDescriptor; clientDescriptor.add_listener_port(port); std::unique_ptr clientTransportUnderTest(new MockTCPv4Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -2270,7 +2280,7 @@ TEST_F(TCPv4Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(discoveredParticipantLocator, 7410); // OpenOutputChannel - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, discoveredParticipantLocator)); IPLocator::setLogicalPort(discoveredParticipantLocator, 7411); ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, discoveredParticipantLocator)); diff --git a/test/unittest/transport/TCPv6Tests.cpp b/test/unittest/transport/TCPv6Tests.cpp index c88a79ff063..c5abb31ca88 100644 --- a/test/unittest/transport/TCPv6Tests.cpp +++ b/test/unittest/transport/TCPv6Tests.cpp @@ -21,18 +21,20 @@ #include #include #include -#include -#include -#include +#include +#include -#include -#include "mock/MockTCPv6Transport.h" #include #include +#include + +#include "mock/MockTCPv6Transport.h" +#include using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps; using TCPv6Transport = eprosima::fastdds::rtps::TCPv6Transport; +using TCPv6TransportDescriptor = eprosima::fastdds::rtps::TCPv6TransportDescriptor; #if defined(_WIN32) #define GET_PID _getpid @@ -78,7 +80,7 @@ class TCPv6Tests : public ::testing::Test void HELPER_SetDescriptorDefaults(); - TCPv6TransportDescriptor descriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor descriptor; std::unique_ptr senderThread; std::unique_ptr receiverThread; }; @@ -164,7 +166,7 @@ TEST_F(TCPv6Tests, opening_and_closing_input_channel) RTPSParticipantAttributes p_attr{}; NetworkFactory factory{p_attr}; - factory.RegisterTransport(descriptor); + factory.RegisterTransport(descriptor); std::vector> receivers; factory.BuildReceiverResources(multicastFilterLocator, receivers, 0x8FFF); ReceiverResource* receiver = receivers.back().get(); @@ -183,7 +185,7 @@ TEST_F(TCPv6Tests, opening_and_closing_input_channel) TEST_F(TCPv6Tests, autofill_port) { // Check normal port assignation - TCPv6TransportDescriptor test_descriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor test_descriptor; test_descriptor.add_listener_port(g_default_port); TCPv6Transport transportUnderTest(test_descriptor); transportUnderTest.init(); @@ -191,7 +193,7 @@ TEST_F(TCPv6Tests, autofill_port) EXPECT_TRUE(transportUnderTest.configuration()->listening_ports[0] == g_default_port); // Check default port assignation - TCPv6TransportDescriptor test_descriptor_autofill; + eprosima::fastdds::rtps::TCPv6TransportDescriptor test_descriptor_autofill; test_descriptor_autofill.add_listener_port(0); TCPv6Transport transportUnderTest_autofill(test_descriptor_autofill); transportUnderTest_autofill.init(); @@ -269,16 +271,16 @@ TEST_F(TCPv6Tests, check_TCPv6_interface_whitelist_initialization) // process this lead to overwriting server's channel resources map elements. TEST_F(TCPv6Tests, client_announced_local_port_uniqueness) { - TCPv6TransportDescriptor recvDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor recvDescriptor; recvDescriptor.add_listener_port(g_default_port); MockTCPv6Transport receiveTransportUnderTest(recvDescriptor); receiveTransportUnderTest.init(); - TCPv6TransportDescriptor sendDescriptor_1; + eprosima::fastdds::rtps::TCPv6TransportDescriptor sendDescriptor_1; TCPv6Transport sendTransportUnderTest_1(sendDescriptor_1); sendTransportUnderTest_1.init(); - TCPv6TransportDescriptor sendDescriptor_2; + eprosima::fastdds::rtps::TCPv6TransportDescriptor sendDescriptor_2; TCPv6Transport sendTransportUnderTest_2(sendDescriptor_2); sendTransportUnderTest_2.init(); @@ -288,11 +290,11 @@ TEST_F(TCPv6Tests, client_announced_local_port_uniqueness) outputLocator.port = g_default_port; IPLocator::setLogicalPort(outputLocator, 7610); - SendResourceList send_resource_list_1; + eprosima::fastdds::rtps::SendResourceList send_resource_list_1; ASSERT_TRUE(sendTransportUnderTest_1.OpenOutputChannel(send_resource_list_1, outputLocator)); ASSERT_FALSE(send_resource_list_1.empty()); - SendResourceList send_resource_list_2; + eprosima::fastdds::rtps::SendResourceList send_resource_list_2; ASSERT_TRUE(sendTransportUnderTest_2.OpenOutputChannel(send_resource_list_2, outputLocator)); ASSERT_FALSE(send_resource_list_2.empty()); @@ -309,7 +311,7 @@ TEST_F(TCPv6Tests, non_blocking_send) uint16_t port = g_default_port; uint32_t msg_size = eprosima::fastdds::rtps::s_minimumSocketBuffer; // Create a TCP Server transport - TCPv6TransportDescriptor senderDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor senderDescriptor; senderDescriptor.add_listener_port(port); senderDescriptor.non_blocking_send = true; senderDescriptor.sendBufferSize = msg_size; @@ -402,13 +404,13 @@ TEST_F(TCPv6Tests, reconnect_after_open_port_failure) eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Warning); uint16_t port = g_default_port; // Create a TCP Server transport - TCPv6TransportDescriptor serverDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor serverDescriptor; serverDescriptor.add_listener_port(port); std::unique_ptr serverTransportUnderTest(new TCPv6Transport(serverDescriptor)); serverTransportUnderTest->init(); // Create a TCP Client transport - TCPv6TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor clientDescriptor; std::unique_ptr clientTransportUnderTest(new MockTCPv6Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -419,7 +421,7 @@ TEST_F(TCPv6Tests, reconnect_after_open_port_failure) // Connect client to server EXPECT_TRUE(serverTransportUnderTest->OpenInputChannel(initialPeerLocator, nullptr, 0x00FF)); - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); ASSERT_FALSE(client_resource_list.empty()); std::this_thread::sleep_for(std::chrono::milliseconds(300)); @@ -496,7 +498,7 @@ TEST_F(TCPv6Tests, opening_output_channel_with_same_locator_as_local_listening_p IPLocator::setIPv6(lowerOutputChannelLocator, "::"); IPLocator::setIPv6(higherOutputChannelLocator, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; // If the remote address is lower than the local one, no channel must be created but it must be added to the send_resource_list ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, lowerOutputChannelLocator)); @@ -512,7 +514,7 @@ TEST_F(TCPv6Tests, opening_output_channel_with_same_locator_as_local_listening_p // from the channel_resources_map. TEST_F(TCPv6Tests, remove_from_send_resource_list) { - TCPv6TransportDescriptor send_descriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor send_descriptor; MockTCPv6Transport send_transport_under_test(send_descriptor); send_transport_under_test.init(); @@ -527,7 +529,7 @@ TEST_F(TCPv6Tests, remove_from_send_resource_list) LocatorList_t initial_peer_list; initial_peer_list.push_back(output_locator_2); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(send_transport_under_test.OpenOutputChannel(send_resource_list, output_locator_1)); ASSERT_TRUE(send_transport_under_test.OpenOutputChannel(send_resource_list, output_locator_2)); ASSERT_EQ(send_resource_list.size(), 2u); @@ -572,7 +574,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) // TCP Client { uint16_t port = 12345; - TCPv6TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor clientDescriptor; std::unique_ptr clientTransportUnderTest(new MockTCPv6Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -582,7 +584,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(initialPeerLocator, 7410); // OpenOutputChannel - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); IPLocator::setLogicalPort(initialPeerLocator, 7411); ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, initialPeerLocator)); @@ -602,7 +604,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) // Discovered participant physical port has to have a lower value than the listening port to behave as a server uint16_t participantPhysicalLocator = 12344; // Create a TCP Server transport - TCPv6TransportDescriptor serverDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor serverDescriptor; serverDescriptor.add_listener_port(port); std::unique_ptr serverTransportUnderTest(new MockTCPv6Transport(serverDescriptor)); serverTransportUnderTest->init(); @@ -613,7 +615,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(discoveredParticipantLocator, 7410); // OpenOutputChannel - SendResourceList server_resource_list; + eprosima::fastdds::rtps::SendResourceList server_resource_list; ASSERT_TRUE(serverTransportUnderTest->OpenOutputChannel(server_resource_list, discoveredParticipantLocator)); IPLocator::setLogicalPort(discoveredParticipantLocator, 7411); ASSERT_TRUE(serverTransportUnderTest->OpenOutputChannel(server_resource_list, discoveredParticipantLocator)); @@ -636,7 +638,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) // Discovered participant physical port has to have a larger value than the listening port to behave as a client uint16_t participantPhysicalLocator = 12346; // Create a TCP Client transport - TCPv6TransportDescriptor clientDescriptor; + eprosima::fastdds::rtps::TCPv6TransportDescriptor clientDescriptor; clientDescriptor.add_listener_port(port); std::unique_ptr clientTransportUnderTest(new MockTCPv6Transport(clientDescriptor)); clientTransportUnderTest->init(); @@ -647,7 +649,7 @@ TEST_F(TCPv6Tests, add_logical_port_on_send_resource_creation) IPLocator::setLogicalPort(discoveredParticipantLocator, 7410); // OpenOutputChannel - SendResourceList client_resource_list; + eprosima::fastdds::rtps::SendResourceList client_resource_list; ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, discoveredParticipantLocator)); IPLocator::setLogicalPort(discoveredParticipantLocator, 7411); ASSERT_TRUE(clientTransportUnderTest->OpenOutputChannel(client_resource_list, discoveredParticipantLocator)); diff --git a/test/unittest/transport/UDPv4Tests.cpp b/test/unittest/transport/UDPv4Tests.cpp index 430e58feabf..21d5f2d037b 100644 --- a/test/unittest/transport/UDPv4Tests.cpp +++ b/test/unittest/transport/UDPv4Tests.cpp @@ -18,17 +18,21 @@ #include #include -#include -#include -#include -#include +#include +#include +#include + +#include #include #include +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using UDPv4Transport = eprosima::fastdds::rtps::UDPv4Transport; +using UDPv4TransportDescriptor = eprosima::fastdds::rtps::UDPv4TransportDescriptor; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; #ifndef __APPLE__ const uint32_t ReceiveBufferCapacity = 65536; @@ -70,7 +74,7 @@ class UDPv4Tests : public ::testing::Test void HELPER_SetDescriptorDefaults(); - UDPv4TransportDescriptor descriptor; + eprosima::fastdds::rtps::UDPv4TransportDescriptor descriptor; std::unique_ptr senderThread; std::unique_ptr receiverThread; }; @@ -129,7 +133,7 @@ TEST_F(UDPv4Tests, send_and_receive_between_ports) MockReceiverResource receiver(transportUnderTest, multicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, multicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -189,7 +193,7 @@ TEST_F(UDPv4Tests, send_to_loopback) MockReceiverResource receiver(transportUnderTest, multicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, multicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -238,7 +242,7 @@ TEST_F(UDPv4Tests, send_is_rejected_if_buffer_size_is_bigger_to_size_specified_i UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t genericOutputChannelLocator; genericOutputChannelLocator.kind = LOCATOR_KIND_UDPv4; genericOutputChannelLocator.port = g_default_port; @@ -277,7 +281,7 @@ TEST_F(UDPv4Tests, RemoteToMainLocal_simply_strips_out_address_leaving_IP_ANY) ASSERT_EQ(mainLocalLocator.port, remote_locator.port); ASSERT_EQ(mainLocalLocator.kind, remote_locator.kind); - ASSERT_EQ(IPLocator::toIPv4string(mainLocalLocator), s_IPv4AddressAny); + ASSERT_EQ(IPLocator::toIPv4string(mainLocalLocator), eprosima::fastdds::rtps::s_IPv4AddressAny); } TEST_F(UDPv4Tests, match_if_port_AND_address_matches) @@ -304,7 +308,7 @@ TEST_F(UDPv4Tests, send_to_wrong_interface) UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv4; @@ -332,7 +336,7 @@ TEST_F(UDPv4Tests, send_to_blocked_interface) UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv4; @@ -362,7 +366,7 @@ TEST_F(UDPv4Tests, send_to_allowed_interface) UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv4; @@ -429,7 +433,7 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_localhost) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -467,9 +471,9 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast) if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -490,7 +494,7 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -529,9 +533,9 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv4Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -552,7 +556,7 @@ TEST_F(UDPv4Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -656,7 +660,7 @@ TEST_F(UDPv4Tests, simple_throughput) sub_locator.port = 50000; IPLocator::setIPv4(sub_locator, 127, 0, 0, 1); - UDPv4TransportDescriptor my_descriptor; + eprosima::fastdds::rtps::UDPv4TransportDescriptor my_descriptor; // Subscriber @@ -681,7 +685,7 @@ TEST_F(UDPv4Tests, simple_throughput) LocatorList_t send_locators_list; send_locators_list.push_back(sub_locator); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(pub_transport.OpenOutputChannel(send_resource_list, sub_locator)); auto t0 = std::chrono::high_resolution_clock::now(); diff --git a/test/unittest/transport/UDPv6Tests.cpp b/test/unittest/transport/UDPv6Tests.cpp index 805518934c5..803753dfb9d 100644 --- a/test/unittest/transport/UDPv6Tests.cpp +++ b/test/unittest/transport/UDPv6Tests.cpp @@ -19,16 +19,20 @@ #include #include -#include -#include -#include +#include +#include -#include #include +#include -using namespace eprosima::fastrtps::rtps; +#include + +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; +using namespace eprosima::fastrtps::rtps; using UDPv6Transport = eprosima::fastdds::rtps::UDPv6Transport; +using UDPv6TransportDescriptor = eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; #ifndef __APPLE__ const uint32_t ReceiveBufferCapacity = 65536; @@ -78,7 +82,7 @@ class UDPv6Tests : public ::testing::Test void HELPER_SetDescriptorDefaults(); - UDPv6TransportDescriptor descriptor; + eprosima::fastdds::rtps::UDPv6TransportDescriptor descriptor; std::unique_ptr senderThread; std::unique_ptr receiverThread; }; @@ -167,7 +171,7 @@ TEST_F(UDPv6Tests, send_and_receive_between_ports) MockReceiverResource receiver(transportUnderTest, multicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, multicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -227,7 +231,7 @@ TEST_F(UDPv6Tests, send_to_loopback) MockReceiverResource receiver(transportUnderTest, multicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, multicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); ASSERT_FALSE(send_resource_list.empty()); @@ -276,7 +280,7 @@ TEST_F(UDPv6Tests, send_is_rejected_if_buffer_size_is_bigger_to_size_specified_i UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t genericOutputChannelLocator; genericOutputChannelLocator.kind = LOCATOR_KIND_UDPv6; genericOutputChannelLocator.port = g_default_port; @@ -315,7 +319,7 @@ TEST_F(UDPv6Tests, RemoteToMainLocal_simply_strips_out_address_leaving_IP_ANY) ASSERT_EQ(mainLocalLocator.port, remote_locator.port); ASSERT_EQ(mainLocalLocator.kind, remote_locator.kind); - ASSERT_EQ(IPLocator::toIPv6string(mainLocalLocator), s_IPv6AddressAny); + ASSERT_EQ(IPLocator::toIPv6string(mainLocalLocator), eprosima::fastdds::rtps::s_IPv6AddressAny); } TEST_F(UDPv6Tests, match_if_port_AND_address_matches) @@ -343,7 +347,7 @@ TEST_F(UDPv6Tests, send_to_wrong_interface) UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv6; @@ -372,7 +376,7 @@ TEST_F(UDPv6Tests, send_to_blocked_interface) UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv6; @@ -402,7 +406,7 @@ TEST_F(UDPv6Tests, send_to_allowed_interface) UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; Locator_t outputChannelLocator; outputChannelLocator.port = g_default_port; outputChannelLocator.kind = LOCATOR_KIND_UDPv6; @@ -470,7 +474,7 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_localhost) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -508,9 +512,9 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast) if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -531,7 +535,7 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast) MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -570,9 +574,9 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul if (interfaces.size() > 0) { - for (const auto& interface : interfaces) + for (const auto& network_interface : interfaces) { - descriptor.interfaceWhiteList.push_back(interface.name); + descriptor.interfaceWhiteList.push_back(network_interface.name); } UDPv6Transport transportUnderTest(descriptor); transportUnderTest.init(); @@ -593,7 +597,7 @@ TEST_F(UDPv6Tests, send_and_receive_between_allowed_sockets_using_unicast_to_mul MockReceiverResource receiver(transportUnderTest, unicastLocator); MockMessageReceiver* msg_recv = dynamic_cast(receiver.CreateMessageReceiver()); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, unicastLocator)); ASSERT_TRUE(transportUnderTest.OpenOutputChannel(send_resource_list, outputChannelLocator)); // Includes loopback ASSERT_FALSE(send_resource_list.empty()); @@ -697,7 +701,7 @@ TEST_F(UDPv6Tests, simple_throughput) sub_locator.port = 50000; IPLocator::setIPv6(sub_locator, std::string("::1")); - UDPv6TransportDescriptor my_descriptor; + eprosima::fastdds::rtps::UDPv6TransportDescriptor my_descriptor; // Subscriber @@ -722,7 +726,7 @@ TEST_F(UDPv6Tests, simple_throughput) LocatorList_t send_locators_list; send_locators_list.push_back(sub_locator); - SendResourceList send_resource_list; + eprosima::fastdds::rtps::SendResourceList send_resource_list; ASSERT_TRUE(pub_transport.OpenOutputChannel(send_resource_list, sub_locator)); auto t0 = std::chrono::high_resolution_clock::now(); diff --git a/test/unittest/transport/mock/MockReceiverResource.cpp b/test/unittest/transport/mock/MockReceiverResource.cpp index b1542c30e94..d22d4d7126d 100644 --- a/test/unittest/transport/mock/MockReceiverResource.cpp +++ b/test/unittest/transport/mock/MockReceiverResource.cpp @@ -14,12 +14,14 @@ #include "MockReceiverResource.h" -namespace eprosima{ -namespace fastrtps{ -namespace rtps{ +namespace eprosima { +namespace fastrtps { +namespace rtps { -MockReceiverResource::MockReceiverResource(TransportInterface& transport, const Locator_t& locator) - : msg_receiver(nullptr) +MockReceiverResource::MockReceiverResource( + eprosima::fastdds::rtps::TransportInterface& transport, + const Locator_t& locator) + : msg_receiver(nullptr) { m_maxMsgSize = 0x8FFF; // Internal channel is opened and assigned to this resource. @@ -30,9 +32,14 @@ MockReceiverResource::MockReceiverResource(TransportInterface& transport, const } // Implementation functions are bound to the right transport parameters - Cleanup = [&transport, locator]() { transport.CloseInputChannel(locator); }; + Cleanup = [&transport, locator]() + { + transport.CloseInputChannel(locator); + }; LocatorMapsToManagedChannel = [&transport, locator](const Locator_t& locatorToCheck) -> bool - { return transport.DoInputLocatorsMatch(locator, locatorToCheck); }; + { + return transport.DoInputLocatorsMatch(locator, locatorToCheck); + }; } MockReceiverResource::~MockReceiverResource() @@ -55,8 +62,11 @@ MessageReceiver* MockReceiverResource::CreateMessageReceiver() return msg_receiver; } -void MockReceiverResource::OnDataReceived(const octet* buf, const uint32_t size, - const Locator_t&, const Locator_t& remote) +void MockReceiverResource::OnDataReceived( + const octet* buf, + const uint32_t size, + const Locator_t&, + const Locator_t& remote) { if (msg_receiver != nullptr) { @@ -68,12 +78,15 @@ void MockReceiverResource::OnDataReceived(const octet* buf, const uint32_t size, } } -void MockMessageReceiver::setCallback(std::function cb) +void MockMessageReceiver::setCallback( + std::function cb) { this->callback = cb; } -void MockMessageReceiver::processCDRMsg(const Locator_t&, CDRMessage_t*msg) +void MockMessageReceiver::processCDRMsg( + const Locator_t&, + CDRMessage_t* msg) { data = msg->buffer; if (callback != nullptr) diff --git a/test/unittest/transport/mock/MockReceiverResource.h b/test/unittest/transport/mock/MockReceiverResource.h index b1da38cd24a..9e2f4843e24 100644 --- a/test/unittest/transport/mock/MockReceiverResource.h +++ b/test/unittest/transport/mock/MockReceiverResource.h @@ -17,8 +17,7 @@ #include -#include - +#include #include namespace eprosima { @@ -42,7 +41,7 @@ class MockReceiverResource : public ReceiverResource const Locator_t&, const Locator_t&) override; MockReceiverResource( - TransportInterface& transport, + eprosima::fastdds::rtps::TransportInterface& transport, const Locator_t& locator); ~MockReceiverResource(); MessageReceiver* CreateMessageReceiver() override; diff --git a/test/unittest/transport/mock/MockTCPv4Transport.h b/test/unittest/transport/mock/MockTCPv4Transport.h index e2aa8e0e9b1..414b3c52c3b 100644 --- a/test/unittest/transport/mock/MockTCPv4Transport.h +++ b/test/unittest/transport/mock/MockTCPv4Transport.h @@ -15,23 +15,22 @@ #ifndef MOCK_TRANSPORT_TCP4_STUFF_H #define MOCK_TRANSPORT_TCP4_STUFF_H -#include +#include + #include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { -using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; -using TCPChannelResource = eprosima::fastdds::rtps::TCPChannelResource; -using TCPChannelResourceBasic = eprosima::fastdds::rtps::TCPChannelResourceBasic; +using Locator_t = eprosima::fastrtps::rtps::Locator_t; class MockTCPv4Transport : public TCPv4Transport { public: MockTCPv4Transport( - const TCPv4TransportDescriptor& descriptor) + const eprosima::fastdds::rtps::TCPv4TransportDescriptor& descriptor) : TCPv4Transport(descriptor) { } diff --git a/test/unittest/transport/mock/MockTCPv6Transport.h b/test/unittest/transport/mock/MockTCPv6Transport.h index cc23f039a5a..f65088d4bb4 100644 --- a/test/unittest/transport/mock/MockTCPv6Transport.h +++ b/test/unittest/transport/mock/MockTCPv6Transport.h @@ -15,7 +15,7 @@ #ifndef MOCK_TRANSPORT_TCP6_STUFF_H #define MOCK_TRANSPORT_TCP6_STUFF_H -#include +#include #include namespace eprosima { @@ -31,7 +31,7 @@ class MockTCPv6Transport : public TCPv6Transport public: MockTCPv6Transport( - const TCPv6TransportDescriptor& descriptor) + const fastdds::rtps::TCPv6TransportDescriptor& descriptor) : TCPv6Transport(descriptor) { } diff --git a/test/unittest/utils/BitmapRangeTests.cpp b/test/unittest/utils/BitmapRangeTests.cpp index fe0cadd436e..2c649a339f8 100644 --- a/test/unittest/utils/BitmapRangeTests.cpp +++ b/test/unittest/utils/BitmapRangeTests.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include -#include +#include #include #include diff --git a/test/unittest/utils/CMakeLists.txt b/test/unittest/utils/CMakeLists.txt index f528cf6d0f7..881b79ded67 100644 --- a/test/unittest/utils/CMakeLists.txt +++ b/test/unittest/utils/CMakeLists.txt @@ -18,10 +18,6 @@ endif() set(STRINGMATCHINGTESTS_SOURCE StringMatchingTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -34,9 +30,6 @@ set(STRINGMATCHINGTESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) -set(FIXEDSIZESTRINGTESTS_SOURCE - FixedSizeStringTests.cpp) - set(BITMAPRANGETESTS_SOURCE BitmapRangeTests.cpp) @@ -45,10 +38,6 @@ set(RESOURCELIMITEDVECTORTESTS_SOURCE set(LOCATORTESTS_SOURCE LocatorTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -65,10 +54,6 @@ set(FIXEDSIZEQUEUETESTS_SOURCE set(SYSTEMINFOTESTS_SOURCE SystemInfoTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -93,7 +78,12 @@ target_include_directories(StringMatchingTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(StringMatchingTests GTest::gtest ${MOCKS}) +target_link_libraries(StringMatchingTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} + ) if(MSVC OR MSVC_IDE) target_link_libraries(StringMatchingTests ${PRIVACY} iphlpapi Shlwapi ) @@ -101,17 +91,6 @@ endif() gtest_discover_tests(StringMatchingTests) -add_executable(FixedSizeStringTests ${FIXEDSIZESTRINGTESTS_SOURCE}) -target_compile_definitions(FixedSizeStringTests PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(FixedSizeStringTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) -target_link_libraries(FixedSizeStringTests GTest::gtest ${MOCKS}) -gtest_discover_tests(FixedSizeStringTests) - - add_executable(BitmapRangeTests ${BITMAPRANGETESTS_SOURCE}) target_compile_definitions(BitmapRangeTests PRIVATE $<$>,$>:__DEBUG> @@ -143,7 +122,12 @@ target_compile_definitions(LocatorTests PRIVATE target_include_directories(LocatorTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LocatorTests GTest::gtest ${MOCKS}) +target_link_libraries(LocatorTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} + ) if(QNX) target_link_libraries(LocatorTests socket) endif() @@ -170,12 +154,16 @@ target_compile_definitions(SystemInfoTests PRIVATE target_include_directories(SystemInfoTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) -target_link_libraries(SystemInfoTests GTest::gtest) +target_link_libraries(SystemInfoTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(SystemInfoTests) add_executable(SharedMutexTests shared_mutex_tests.cpp) target_compile_definitions(SharedMutexTests PUBLIC USE_THIRDPARTY_SHARED_MUTEX=1) -target_include_directories(SharedMutexTests PUBLIC ${PROJECT_SOURCE_DIR}/include) +target_include_directories(SharedMutexTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp) target_link_libraries(SharedMutexTests PUBLIC GTest::gtest) gtest_discover_tests(SharedMutexTests) diff --git a/test/unittest/utils/FixedSizeStringTests.cpp b/test/unittest/utils/FixedSizeStringTests.cpp deleted file mode 100644 index d0c25ef2660..00000000000 --- a/test/unittest/utils/FixedSizeStringTests.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -using namespace eprosima::fastrtps; - -constexpr size_t MAX_CHARS = 255; -constexpr size_t OTHER_MAX_CHARS = 127; - -class FixedSizeStringTests : public ::testing::Test -{ -public: - - char const* pattern0 = "foo/bar/baz"; - char const* long_pattern = - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF" - "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"; - - size_t pattern0_len = strlen(pattern0); -}; - -TEST_F(FixedSizeStringTests, default_constructor) -{ - std::string std_s; - fixed_string fixed_s; - - ASSERT_EQ(fixed_s.size(), 0u); - ASSERT_EQ(fixed_s, ""); - ASSERT_EQ(fixed_s, std_s); -} - -TEST_F(FixedSizeStringTests, construct_with_empty_c_string) -{ - std::string std_s; - fixed_string fixed_s(""); - - ASSERT_EQ(fixed_s.size(), 0u); - ASSERT_EQ(fixed_s, ""); - ASSERT_EQ(fixed_s, std_s); -} - -TEST_F(FixedSizeStringTests, construct_with_empty_std_string) -{ - std::string std_s; - fixed_string fixed_s(std_s); - - ASSERT_EQ(fixed_s.size(), 0u); - ASSERT_EQ(fixed_s, ""); - ASSERT_EQ(fixed_s, std_s); -} - -TEST_F(FixedSizeStringTests, construct_with_c_string) -{ - fixed_string fixed_s(pattern0); - - ASSERT_EQ(fixed_s.size(), pattern0_len); - ASSERT_EQ(fixed_s, pattern0); -} - -TEST_F(FixedSizeStringTests, construct_with_std_string) -{ - std::string std_string(pattern0); - fixed_string fixed_s(std_string); - - ASSERT_EQ(fixed_s.size(), pattern0_len); - ASSERT_EQ(fixed_s, std_string); -} - -TEST_F(FixedSizeStringTests, construct_with_long_c_string) -{ - fixed_string fixed_s(long_pattern); - - ASSERT_EQ(fixed_s.size(), MAX_CHARS); - ASSERT_EQ(fixed_s, long_pattern); -} - -TEST_F(FixedSizeStringTests, construct_with_long_std_string) -{ - std::string std_string(long_pattern); - fixed_string fixed_s(std_string); - - ASSERT_EQ(fixed_s.size(), MAX_CHARS); - ASSERT_EQ(fixed_s, std_string); -} - -TEST_F(FixedSizeStringTests, assign_operators_and_inequality) -{ - fixed_string fixed_s; - - std::string std_s_empty; - std::string std_s(pattern0); - std::string std_s_long(long_pattern); - - fixed_s = std_s_long; - ASSERT_EQ(fixed_s.size(), MAX_CHARS); - ASSERT_EQ(fixed_s, long_pattern); - ASSERT_NE(fixed_s, pattern0); - ASSERT_NE(fixed_s, ""); - - fixed_s = pattern0; - ASSERT_EQ(fixed_s.size(), pattern0_len); - ASSERT_EQ(fixed_s, std_s); - ASSERT_NE(fixed_s, std_s_empty); - ASSERT_NE(fixed_s, std_s_long); - - fixed_s = std_s_empty; - ASSERT_EQ(fixed_s.size(), 0u); - ASSERT_EQ(fixed_s, ""); - ASSERT_NE(fixed_s, long_pattern); - ASSERT_NE(fixed_s, pattern0); - - fixed_s = long_pattern; - ASSERT_EQ(fixed_s.size(), MAX_CHARS); - ASSERT_EQ(fixed_s, std_s_long); - ASSERT_NE(fixed_s, std_s); - ASSERT_NE(fixed_s, std_s_empty); - - fixed_s = std_s; - ASSERT_EQ(fixed_s.size(), pattern0_len); - ASSERT_EQ(fixed_s, pattern0); - ASSERT_NE(fixed_s, ""); - ASSERT_NE(fixed_s, long_pattern); - - fixed_s = ""; - ASSERT_EQ(fixed_s.size(), 0u); - ASSERT_EQ(fixed_s, std_s_empty); - ASSERT_NE(fixed_s, std_s_long); - ASSERT_NE(fixed_s, std_s); -} - -TEST_F(FixedSizeStringTests, different_fixed_sizes) -{ - fixed_string s1; - fixed_string s2; - - ASSERT_EQ(s1, s2); - - s1 = long_pattern; - ASSERT_NE(s1, s2); - - s2 = s1; - ASSERT_EQ(s2, s1); - - s2 = pattern0; - ASSERT_NE(s2, s1); - - s1 = s2; - ASSERT_EQ(s1, s2); -} - -TEST_F(FixedSizeStringTests, comparisons) -{ - const char* c_string_short = "test string"; - const char* c_string_a = "test string a"; - const char* c_string_b = "test string b"; - const char* c_string_c = "test string c"; - const char* c_string_large = "test string b "; - std::string std_string_short = "test string"; - std::string std_string_a = "test string a"; - std::string std_string_b = "test string b"; - std::string std_string_c = "test string c"; - std::string std_string_large = "test string b "; - fixed_string fixed_short = "test string"; - fixed_string fixed_a = "test string a"; - fixed_string fixed_b = "test string b"; - fixed_string fixed_c = "test string c"; - fixed_string fixed_large = "test string b "; - - ASSERT_NE(fixed_b, c_string_short); - ASSERT_NE(fixed_b, c_string_a); - ASSERT_EQ(fixed_b, c_string_b); - ASSERT_NE(fixed_b, c_string_c); - ASSERT_NE(fixed_b, c_string_large); - - ASSERT_LT(0, fixed_b.compare(c_string_short)); - ASSERT_LT(0, fixed_b.compare(c_string_a)); - ASSERT_EQ(0, fixed_b.compare(c_string_b)); - ASSERT_GT(0, fixed_b.compare(c_string_c)); - ASSERT_GT(0, fixed_b.compare(c_string_large)); - - ASSERT_NE(fixed_b, std_string_short); - ASSERT_NE(fixed_b, std_string_a); - ASSERT_EQ(fixed_b, std_string_b); - ASSERT_NE(fixed_b, std_string_c); - ASSERT_NE(fixed_b, std_string_large); - - ASSERT_LE(0, fixed_b.compare(std_string_short)); - ASSERT_LE(0, fixed_b.compare(std_string_a)); - ASSERT_EQ(0, fixed_b.compare(std_string_b)); - ASSERT_GT(0, fixed_b.compare(std_string_c)); - ASSERT_GT(0, fixed_b.compare(std_string_large)); - - ASSERT_NE(fixed_b, fixed_short); - ASSERT_NE(fixed_b, fixed_a); - ASSERT_EQ(fixed_b, fixed_b); - ASSERT_NE(fixed_b, fixed_c); - ASSERT_NE(fixed_b, fixed_large); - - ASSERT_LE(0, fixed_b.compare(fixed_short)); - ASSERT_LE(0, fixed_b.compare(fixed_a)); - ASSERT_EQ(0, fixed_b.compare(fixed_b)); - ASSERT_GT(0, fixed_b.compare(fixed_c)); - ASSERT_GT(0, fixed_b.compare(fixed_large)); -} - -TEST_F(FixedSizeStringTests, less_than_operator_fixed_string) -{ - fixed_string fixed_string_short = "test string"; - fixed_string fixed_string_long = "test string long"; - - ASSERT_FALSE(fixed_string_short < fixed_string_short); - ASSERT_FALSE(fixed_string_long < fixed_string_long); - ASSERT_TRUE(fixed_string_short < fixed_string_long); - ASSERT_FALSE(fixed_string_long < fixed_string_short); -} - -TEST_F(FixedSizeStringTests, less_than_operator_std_string) -{ - fixed_string fixed_string_short = "test string"; - std::string std_string_long = "test string long"; - std::string std_string_short = "test"; - - ASSERT_TRUE(fixed_string_short < std_string_long); - ASSERT_FALSE(fixed_string_short < std_string_short); -} - -TEST_F(FixedSizeStringTests, greater_than_operator_fixed_string) -{ - fixed_string fixed_string_short = "test string"; - fixed_string fixed_string_long = "test string long"; - - ASSERT_FALSE(fixed_string_short > fixed_string_short); - ASSERT_FALSE(fixed_string_long > fixed_string_long); - ASSERT_FALSE(fixed_string_short > fixed_string_long); - ASSERT_TRUE(fixed_string_long > fixed_string_short); -} - -TEST_F(FixedSizeStringTests, greater_than_operator_std_string) -{ - fixed_string fixed_string_short = "test string"; - std::string std_string_long = "test string long"; - std::string std_string_short = "test"; - - ASSERT_FALSE(fixed_string_short > std_string_long); - ASSERT_TRUE(fixed_string_short > std_string_short); -} - -int main( - int argc, - char** argv) -{ - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/utils/LocatorTests.cpp b/test/unittest/utils/LocatorTests.cpp index 17719a5b5c3..08d126628d0 100644 --- a/test/unittest/utils/LocatorTests.cpp +++ b/test/unittest/utils/LocatorTests.cpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include -#include +#include #include -#include +#include +#include +#include +#include +#include +#include using namespace eprosima::fastrtps::rtps; diff --git a/test/unittest/utils/ResourceLimitedVectorTests.cpp b/test/unittest/utils/ResourceLimitedVectorTests.cpp index 98c2a581bad..5772fdc4f2a 100644 --- a/test/unittest/utils/ResourceLimitedVectorTests.cpp +++ b/test/unittest/utils/ResourceLimitedVectorTests.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include #include using namespace eprosima::fastrtps; diff --git a/test/unittest/utils/StringMatchingTests.cpp b/test/unittest/utils/StringMatchingTests.cpp index dfaba43ff8a..3ef84302476 100644 --- a/test/unittest/utils/StringMatchingTests.cpp +++ b/test/unittest/utils/StringMatchingTests.cpp @@ -12,31 +12,38 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include + #include -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; +#include + +using namespace eprosima::fastdds::rtps; -class StringMatchingTests: public ::testing::Test +class StringMatchingTests : public ::testing::Test { - public: - StringMatchingTests(){} - ~StringMatchingTests(){} +public: + + StringMatchingTests() + { + } + + ~StringMatchingTests() + { + } - char const *path = "foo/bar/baz"; - char const *pattern0 = "foo/bar/baz"; - char const *pattern1 = "foo*"; - char const *pattern2 = "*baz"; - char const *pattern3 = "foo/*/baz"; - char const *pattern4 = "foo/bar/ba?"; - char const *pattern5 = "*ba?*"; - char const *pattern6 = "foo\\bar\\baz"; - char const *pattern7 = "*bar"; - char const *pattern8 = "*"; - char const *pattern9 = "foo/bar/qux"; - char const *pattern10 = "FOO/BAR/QUX"; + char const* path = "foo/bar/baz"; + char const* pattern0 = "foo/bar/baz"; + char const* pattern1 = "foo*"; + char const* pattern2 = "*baz"; + char const* pattern3 = "foo/*/baz"; + char const* pattern4 = "foo/bar/ba?"; + char const* pattern5 = "*ba?*"; + char const* pattern6 = "foo\\bar\\baz"; + char const* pattern7 = "*bar"; + char const* pattern8 = "*"; + char const* pattern9 = "foo/bar/qux"; + char const* pattern10 = "FOO/BAR/QUX"; }; @@ -56,7 +63,9 @@ TEST_F(StringMatchingTests, patterns_with_wildcards) } -int main(int argc, char **argv) +int main( + int argc, + char** argv) { eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); testing::InitGoogleTest(&argc, argv); diff --git a/test/unittest/utils/SystemInfoTests.cpp b/test/unittest/utils/SystemInfoTests.cpp index d94a6e4bb34..50da9759535 100644 --- a/test/unittest/utils/SystemInfoTests.cpp +++ b/test/unittest/utils/SystemInfoTests.cpp @@ -30,15 +30,13 @@ #endif // _WIN32 #include -#include -#include #include + +#include #include #define SIZE 512 -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class SystemInfoTests : public ::testing::Test { public: @@ -96,68 +94,69 @@ TEST_F(SystemInfoTests, GetEnvTest) ASSERT_EQ(0, setenv(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, value.c_str(), 1)); ASSERT_EQ(0, setenv(empty_var_name.c_str(), value.c_str(), 1)); #endif // _WIN32 - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); // 2. Read environment variable not contained in the file but set in the environment - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); EXPECT_EQ(env_value, value); // 3. Read environment variable contained in the file and in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 4. Read variable set empty in the file but with a valid value in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); EXPECT_TRUE(env_value.empty()); // 5. Invalid environment name: neither in the file nor in the environment - EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), ReturnCode_t::RETCODE_NO_DATA); + EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), eprosima::fastdds::dds::RETCODE_NO_DATA); // 6. Bad parameters: empty environment name std::string non_init_string; - EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); - EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); // 7. Check that reading the environment variable directly from file returns correctly - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 8. Check that an empty environment variable returns correctly std::string empty_environment_variable = "EMPTY_ENV_VAR"; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, empty_environment_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 9. Check that a non-existent tag returns RETCODE_NO_DATA + // 9. Check that a non-existent tag returns eprosima::fastdds::dds::RETCODE_NO_DATA std::string non_existent_env_variable = "NON_EXISTENT_ENV_VARIBLE"; env_value.clear(); - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, non_existent_env_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 10. Check that a non-existent file returns RETCODE_BAD_PARAMETER + // 10. Check that a non-existent file returns eprosima::fastdds::dds::RETCODE_BAD_PARAMETER filename = "non_existent.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); - // 11. Check that a wrong formatted file returns RETCODE_ERROR + // 11. Check that a wrong formatted file returns eprosima::fastdds::dds::RETCODE_ERROR filename = "empty_environment_test_file.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); } /* * This test checks the get_username static method of the SystemInfo class - * The test only checks that the method returns RETCODE_OK and that the username is not an empty string + * The test only checks that the method returns eprosima::fastdds::dds::RETCODE_OK and that the username is not an empty string */ TEST_F(SystemInfoTests, GetUsernameTest) { std::string username; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_username(username)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_username(username)); EXPECT_FALSE(username.empty()); } @@ -204,9 +203,9 @@ TEST_F(SystemInfoTests, FileExistsTest) */ TEST_F(SystemInfoTests, EnvironmentFileTest) { - // 1. Environment variable not set: call to set_environment_variable returns RETCODE_NO_DATA and + // 1. Environment variable not set: call to set_environment_variable returns eprosima::fastdds::dds::RETCODE_NO_DATA and // get_environment_file returns empty - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); EXPECT_TRUE(eprosima::SystemInfo::get_environment_file().empty()); // 2. Set environment file variable and see that it returns correctly @@ -216,7 +215,7 @@ TEST_F(SystemInfoTests, EnvironmentFileTest) #else ASSERT_EQ(0, setenv(eprosima::FASTDDS_ENVIRONMENT_FILE_ENV_VAR, value.c_str(), 1)); #endif // _WIN32 - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); EXPECT_EQ(0, eprosima::SystemInfo::get_environment_file().compare(value)); } diff --git a/test/unittest/utils/shared_mutex_tests.cpp b/test/unittest/utils/shared_mutex_tests.cpp index eba86e73e46..77dc39a46b3 100644 --- a/test/unittest/utils/shared_mutex_tests.cpp +++ b/test/unittest/utils/shared_mutex_tests.cpp @@ -8,9 +8,10 @@ #include #include -#include #include +#include + using namespace std; using namespace std::chrono; using namespace eprosima; diff --git a/test/unittest/xmlparser/CMakeLists.txt b/test/unittest/xmlparser/CMakeLists.txt index f631a897b1e..a5575b364fe 100644 --- a/test/unittest/xmlparser/CMakeLists.txt +++ b/test/unittest/xmlparser/CMakeLists.txt @@ -78,31 +78,10 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/regressions" DESTINATION "${CMAKE_CURRENT ################################### XMLProfileParserTests #################################################### set(XMLPROFILEPARSER_SOURCE XMLProfileParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -114,17 +93,17 @@ set(XMLPROFILEPARSER_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # External sources @@ -155,7 +134,10 @@ target_compile_definitions(XMLProfileParserTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(XMLProfileParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/Log + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -164,7 +146,8 @@ target_include_directories(XMLProfileParserTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantAttributes - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> @@ -175,6 +158,7 @@ target_link_libraries(XMLProfileParserTests GTest::gmock $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLProfileParserTests socket) @@ -188,36 +172,10 @@ gtest_discover_tests(XMLProfileParserTests) set(XMLPARSER_SOURCE XMLParserTests.cpp XMLElementParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -229,17 +187,17 @@ set(XMLPARSER_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLProfileManager.cpp ) # External sources @@ -265,6 +223,9 @@ target_compile_definitions(XMLParserTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(XMLParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -285,6 +246,8 @@ target_link_libraries(XMLParserTests GTest::gtest $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLParserTests socket) @@ -314,6 +277,7 @@ target_compile_definitions(XMLTreeTests PRIVATE target_include_directories(XMLTreeTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) @@ -328,36 +292,10 @@ gtest_discover_tests(XMLTreeTests) ################################### XMLENDPOINTPARSERTESTS ################################################### set(XMLENDPOINTPARSERTESTS_SOURCE XMLEndpointParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -368,13 +306,16 @@ set(XMLENDPOINTPARSERTESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/PortBasedTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/xmlparser/XMLParserCommon.cpp + + # locators + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/UnitsParser.cpp ) @@ -400,7 +341,10 @@ target_compile_definitions(XMLEndpointParserTests PRIVATE ASIO_STANDALONE ) target_include_directories(XMLEndpointParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -422,6 +366,8 @@ target_link_libraries(XMLEndpointParserTests GTest::gtest $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLEndpointParserTests socket) diff --git a/test/unittest/xmlparser/SHM_transport_descriptors_config_profile.xml b/test/unittest/xmlparser/SHM_transport_descriptors_config_profile.xml index a079f97229b..5411c729ad4 100644 --- a/test/unittest/xmlparser/SHM_transport_descriptors_config_profile.xml +++ b/test/unittest/xmlparser/SHM_transport_descriptors_config_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/xmlparser/UDP_transport_descriptors_config_profile.xml b/test/unittest/xmlparser/UDP_transport_descriptors_config_profile.xml index 9a80454373f..3bf2ace35ed 100644 --- a/test/unittest/xmlparser/UDP_transport_descriptors_config_profile.xml +++ b/test/unittest/xmlparser/UDP_transport_descriptors_config_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/xmlparser/XMLElementParserTests.cpp b/test/unittest/xmlparser/XMLElementParserTests.cpp index 3f9bf02e258..190c552e2d9 100644 --- a/test/unittest/xmlparser/XMLElementParserTests.cpp +++ b/test/unittest/xmlparser/XMLElementParserTests.cpp @@ -25,15 +25,17 @@ #include #include +#include #include -#include -#include -#include -#include +#include + +#include +#include +#include #include "../common/env_var_utils.hpp" #include "../logging/mock/MockConsumer.h" -#include "rtps/xmlparser/XMLParserUtils.hpp" +#include "xmlparser/XMLParserUtils.hpp" #include "wrapper/XMLParserTest.hpp" using namespace eprosima::fastdds::dds; @@ -552,7 +554,7 @@ TEST_F(XMLParserTests, getXMLLocatorTCPv6) TEST_F(XMLParserTests, getXMLTransports) { uint8_t ident = 1; - std::vector> transports; + std::vector> transports; tinyxml2::XMLDocument xml_doc; tinyxml2::XMLElement* titleElement; @@ -1770,7 +1772,7 @@ TEST_F(XMLParserTests, getXMLWriterReaderUnsupportedQosPolicies) TEST_F(XMLParserTests, ParticipantAllocationAttributesDataLimits) { uint8_t ident = 1; - rtps::RTPSParticipantAllocationAttributes allocation; + eprosima::fastrtps::rtps::RTPSParticipantAllocationAttributes allocation; tinyxml2::XMLDocument xml_doc; tinyxml2::XMLElement* titleElement; @@ -1809,7 +1811,7 @@ TEST_F(XMLParserTests, ParticipantAllocationAttributesDataLimits) TEST_F(XMLParserTests, getXMLDiscoverySettingsStaticEDP) { uint8_t ident = 1; - rtps::DiscoverySettings settings; + eprosima::fastrtps::rtps::DiscoverySettings settings; tinyxml2::XMLDocument xml_doc; tinyxml2::XMLElement* titleElement; @@ -2010,7 +2012,6 @@ TEST_F(XMLParserTests, getXMLDurabilityQosKind) * * * - * * 2. Check invalid element */ TEST_F(XMLParserTests, getXMLBuiltinAttributes_NegativeClauses) @@ -2051,8 +2052,7 @@ TEST_F(XMLParserTests, getXMLBuiltinAttributes_NegativeClauses) "readerPayloadSize", "writerPayloadSize", "mutation_tries", - "avoid_builtin_multicast", - "typelookup_config" + "avoid_builtin_multicast" }; for (std::string tag : field_vec) @@ -3374,7 +3374,7 @@ TEST_F(XMLParserTests, getXMLEnum_NegativeClauses) // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ \ @@ -3475,7 +3475,7 @@ TEST_F(XMLParserTests, getXMLEnum_positive) // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ OFF\ @@ -3485,12 +3485,12 @@ TEST_F(XMLParserTests, getXMLEnum_positive) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(enum_p)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLEnum_wrapper(titleElement, &e, ident)); - EXPECT_EQ(IntraprocessDeliveryType::INTRAPROCESS_OFF, e); + EXPECT_EQ(eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_OFF, e); } // IntraprocessDeliveryType Enum { - IntraprocessDeliveryType e; + eprosima::fastdds::IntraprocessDeliveryType e; const char* enum_p = "\ USER_DATA_ONLY\ @@ -3500,7 +3500,7 @@ TEST_F(XMLParserTests, getXMLEnum_positive) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(enum_p)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLEnum_wrapper(titleElement, &e, ident)); - EXPECT_EQ(IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, e); + EXPECT_EQ(eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY, e); } // DiscoveryProtocol Enum @@ -4003,109 +4003,6 @@ TEST_F(XMLParserTests, getXMLOwnershipStrengthQos) } } -/* - * This test checks the positive cases of configuration through XML of the TypeLookupService. - * 1. Check that the XML return code is correct for the TypeLookup configuration settings. - * 2. Check that the flags are corretly set. - */ -TEST_F(XMLParserTests, getXMLTypeLookupSettings) -{ - uint8_t ident = 1; - TypeLookupSettings settings; - tinyxml2::XMLDocument xml_doc; - tinyxml2::XMLElement* titleElement; - - // XML snippet - const char* xml = - "\ - \ - true\ - false\ - \ - "; - - // Load the xml - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - // Check that the XML return code is correct for the TypeLookup settings - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - EXPECT_TRUE(settings.use_server); - EXPECT_FALSE(settings.use_client); - - // XML snippet - xml = - "\ - \ - false\ - true\ - \ - "; - - // Load the xml - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - // Check that the XML return code is correct for the TypeLookup settings - EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - EXPECT_FALSE(settings.use_server); - EXPECT_TRUE(settings.use_client); -} - -/* - * This test checks the negative cases in the xml element. - * 1. Check an invalid tag of: - * - * - * 2. Check invalid element. - */ -TEST_F(XMLParserTests, getXMLTypeLookupSettings_NegativeClauses) -{ - uint8_t ident = 1; - TypeLookupSettings settings; - tinyxml2::XMLDocument xml_doc; - tinyxml2::XMLElement* titleElement; - - // Parametrized XML - const char* xml_p = - "\ - \ - %s\ - \ - "; - constexpr size_t xml_len {1000}; - char xml[xml_len]; - - const char* field_p = - "\ - <%s>\ - \ - \ - "; - constexpr size_t field_len {500}; - char field[field_len]; - - std::vector field_vec = - { - "use_client", - "use_server", - }; - - for (std::string tag : field_vec) - { - snprintf(field, field_len, field_p, tag.c_str(), tag.c_str()); - snprintf(xml, xml_len, xml_p, field); - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_ERROR, - XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - } - - // Invalid element - snprintf(xml, xml_len, xml_p, " "); - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_ERROR, - XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); -} - TEST_F(XMLParserTests, get_element_text) { using namespace eprosima::fastdds::xml::detail; diff --git a/test/unittest/xmlparser/XMLEndpointParserTests.cpp b/test/unittest/xmlparser/XMLEndpointParserTests.cpp index 59ecdf722a7..c92dbed8d23 100644 --- a/test/unittest/xmlparser/XMLEndpointParserTests.cpp +++ b/test/unittest/xmlparser/XMLEndpointParserTests.cpp @@ -12,22 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include +#include +#include +#include + +#include +#include + +#include #include #include -#include #include #include -#include "../logging/mock/MockConsumer.h" +#include +#include -#include -#include +#include -#include -#include -#include +#include "../logging/mock/MockConsumer.h" using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; diff --git a/test/unittest/xmlparser/XMLParserTests.cpp b/test/unittest/xmlparser/XMLParserTests.cpp index b36a0e383b4..811618d10f7 100644 --- a/test/unittest/xmlparser/XMLParserTests.cpp +++ b/test/unittest/xmlparser/XMLParserTests.cpp @@ -17,6 +17,9 @@ #include #include +#include +#include + #include #include #include @@ -28,18 +31,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include -#include +#include +#include +#include #include "../logging/mock/MockConsumer.h" #include "wrapper/XMLParserTest.hpp" @@ -89,7 +89,7 @@ TEST_F(XMLParserTests, NoFile) TEST_F(XMLParserTests, EmptyDefaultFile) { std::ifstream inFile; - inFile.open("DEFAULT_FASTRTPS_PROFILES.xml"); + inFile.open("DEFAULT_FASTDDS_PROFILES.xml"); std::unique_ptr root; ASSERT_EQ(XMLParser::loadDefaultXMLFile(root), XMLP_ret::XML_ERROR); } @@ -524,8 +524,6 @@ TEST_F(XMLParserTests, Data) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -620,8 +618,6 @@ TEST_F(XMLParserTests, DataDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -716,8 +712,6 @@ TEST_F(XMLParserTests, DataBuffer) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -812,8 +806,6 @@ TEST_F(XMLParserTests, DataBufferDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -962,8 +954,8 @@ TEST_F(XMLParserTests, parseXMLTransportData) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parseXMLTransportData_wrapper(titleElement)); - std::shared_ptr pUDPv4Desc = - std::dynamic_pointer_cast( + std::shared_ptr pUDPv4Desc = + std::dynamic_pointer_cast( xmlparser::XMLProfileManager::getTransportById("TransportId1")); EXPECT_EQ(pUDPv4Desc->sendBufferSize, 8192u); EXPECT_EQ(pUDPv4Desc->receiveBufferSize, 8192u); @@ -991,8 +983,8 @@ TEST_F(XMLParserTests, parseXMLTransportData) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parseXMLTransportData_wrapper(titleElement)); - std::shared_ptr pUDPv6Desc = - std::dynamic_pointer_cast( + std::shared_ptr pUDPv6Desc = + std::dynamic_pointer_cast( xmlparser::XMLProfileManager::getTransportById("TransportId1")); EXPECT_EQ(pUDPv6Desc->sendBufferSize, 8192u); EXPECT_EQ(pUDPv6Desc->receiveBufferSize, 8192u); @@ -1102,8 +1094,8 @@ TEST_F(XMLParserTests, parseXMLTransportData) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parseXMLTransportData_wrapper(titleElement)); - std::shared_ptr pTCPv4Desc = - std::dynamic_pointer_cast( + std::shared_ptr pTCPv4Desc = + std::dynamic_pointer_cast( xmlparser::XMLProfileManager::getTransportById("TransportId1")); EXPECT_EQ(pTCPv4Desc->sendBufferSize, 8192u); EXPECT_EQ(pTCPv4Desc->receiveBufferSize, 8192u); @@ -1142,8 +1134,8 @@ TEST_F(XMLParserTests, parseXMLTransportData) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parseXMLTransportData_wrapper(titleElement)); - std::shared_ptr pTCPv6Desc = - std::dynamic_pointer_cast( + std::shared_ptr pTCPv6Desc = + std::dynamic_pointer_cast( xmlparser::XMLProfileManager::getTransportById("TransportId1")); EXPECT_EQ(pTCPv6Desc->sendBufferSize, 8192u); EXPECT_EQ(pTCPv6Desc->receiveBufferSize, 8192u); @@ -1989,7 +1981,7 @@ TEST_F(XMLParserTests, parseTLSConfigPositiveClauses) std::unique_ptr root; tinyxml2::XMLElement* titleElement; std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); // Parametrized XML const char* xml = @@ -2024,7 +2016,7 @@ TEST_F(XMLParserTests, parseTLSConfigNegativeClauses) std::unique_ptr root; tinyxml2::XMLElement* titleElement; std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); constexpr size_t xml_len {600}; char xml[xml_len]; @@ -2172,7 +2164,7 @@ TEST_F(XMLParserTests, parseTLSConfigHandshakeRole) std::unique_ptr root; tinyxml2::XMLElement* titleElement; std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); constexpr size_t xml_len {600}; char xml[xml_len]; @@ -2191,10 +2183,10 @@ TEST_F(XMLParserTests, parseTLSConfigHandshakeRole) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_EQ(descriptor->tls_config.handshake_role, - TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::DEFAULT); + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::DEFAULT); } // Check that the CLIENT setting return an xml ok code and is set correctly. @@ -2203,10 +2195,10 @@ TEST_F(XMLParserTests, parseTLSConfigHandshakeRole) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_EQ(descriptor->tls_config.handshake_role, - TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::CLIENT); + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::CLIENT); } // Check that the SERVER setting return an xml ok code and is set correctly. @@ -2215,10 +2207,10 @@ TEST_F(XMLParserTests, parseTLSConfigHandshakeRole) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_EQ(descriptor->tls_config.handshake_role, - TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::SERVER); + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::SERVER); } } @@ -2254,12 +2246,13 @@ TEST_F(XMLParserTests, parseTLSConfigVerifyMode) titleElement = xml_doc.RootElement(); std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); - EXPECT_EQ(descriptor->tls_config.verify_mode, TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_NONE); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); + EXPECT_EQ(descriptor->tls_config.verify_mode, + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_NONE); } // Check that the VERIFY_PEER setting return an xml ok code and is set correctly. @@ -2269,12 +2262,13 @@ TEST_F(XMLParserTests, parseTLSConfigVerifyMode) titleElement = xml_doc.RootElement(); std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); - EXPECT_EQ(descriptor->tls_config.verify_mode, TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); + EXPECT_EQ(descriptor->tls_config.verify_mode, + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER); } // Check that the VERIFY_FAIL_IF_NO_PEER_CERT setting return an xml ok code and is set correctly. @@ -2284,13 +2278,13 @@ TEST_F(XMLParserTests, parseTLSConfigVerifyMode) titleElement = xml_doc.RootElement(); std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_EQ(descriptor->tls_config.verify_mode, - TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_FAIL_IF_NO_PEER_CERT); + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_FAIL_IF_NO_PEER_CERT); } // Check that the VERIFY_CLIENT_ONCE setting return an xml ok code and is set correctly. @@ -2300,12 +2294,12 @@ TEST_F(XMLParserTests, parseTLSConfigVerifyMode) titleElement = xml_doc.RootElement(); std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_EQ(descriptor->tls_config.verify_mode, - TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_CLIENT_ONCE); + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_CLIENT_ONCE); } } @@ -2327,7 +2321,7 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) std::unique_ptr root; tinyxml2::XMLElement* titleElement; std::shared_ptr tcp_transport = - std::make_shared(); + std::make_shared(); constexpr size_t xml_len {600}; char xml[xml_len]; @@ -2347,10 +2341,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::DEFAULT_WORKAROUNDS)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + DEFAULT_WORKAROUNDS)); } // Check that the NO_COMPRESSION setting return an xml ok code and is set correctly. @@ -2359,10 +2354,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_COMPRESSION)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_COMPRESSION)); } // Check that the NO_SSLV2 setting return an xml ok code and is set correctly. @@ -2371,10 +2367,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV2)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_SSLV2)); } // Check that the NO_SSLV3 setting return an xml ok code and is set correctly. @@ -2383,10 +2380,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV3)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_SSLV3)); } // Check that the NO_TLSV1 setting return an xml ok code and is set correctly. @@ -2395,10 +2393,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_TLSV1)); } // Check that the NO_TLSV1_1 setting return an xml ok code and is set correctly. @@ -2407,10 +2406,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_1)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_TLSV1_1)); } // Check that the NO_TLSV1_2 setting return an xml ok code and is set correctly. @@ -2419,10 +2419,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_2)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_TLSV1_2)); } // Check that the NO_TLSV1_3 setting return an xml ok code and is set correctly. @@ -2431,10 +2432,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_3)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + NO_TLSV1_3)); } // Check that the SINGLE_DH_USE setting return an xml ok code and is set correctly. @@ -2443,10 +2445,11 @@ TEST_F(XMLParserTests, parseTLSConfigOptions) ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); titleElement = xml_doc.RootElement(); EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::parse_tls_config_wrapper(titleElement, tcp_transport)); - std::shared_ptr descriptor = - std::dynamic_pointer_cast(tcp_transport); + std::shared_ptr descriptor = + std::dynamic_pointer_cast(tcp_transport); EXPECT_TRUE( - descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::SINGLE_DH_USE)); + descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions:: + SINGLE_DH_USE)); } } @@ -3071,7 +3074,7 @@ TEST_F(XMLParserTests, parseXMLReceptionThreads) std::string title; std::string xml; xmlparser::XMLP_ret result; - PortBasedTransportDescriptor::ReceptionThreadsConfigMap threads_config; + eprosima::fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap threads_config; }; ThreadSettings modified_thread_settings; @@ -3181,7 +3184,7 @@ TEST_F(XMLParserTests, parseXMLReceptionThreads) tinyxml2::XMLDocument xml_doc; std::unique_ptr root; tinyxml2::XMLElement* titleElement; - PortBasedTransportDescriptor::ReceptionThreadsConfigMap reception_threads; + eprosima::fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap reception_threads; ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(test_case.xml.c_str())) << "test_case = [" << test_case.title << "]"; diff --git a/test/unittest/xmlparser/XMLParserTests.hpp b/test/unittest/xmlparser/XMLParserTests.hpp index 5791f15e288..7e3be090639 100644 --- a/test/unittest/xmlparser/XMLParserTests.hpp +++ b/test/unittest/xmlparser/XMLParserTests.hpp @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include -#include -#include -#include +#include +#include #include "../logging/mock/MockConsumer.h" - +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::xmlparser; diff --git a/test/unittest/xmlparser/XMLProfileParserTests.cpp b/test/unittest/xmlparser/XMLProfileParserTests.cpp index 74de575eab8..d8e98b0554c 100644 --- a/test/unittest/xmlparser/XMLProfileParserTests.cpp +++ b/test/unittest/xmlparser/XMLProfileParserTests.cpp @@ -28,17 +28,21 @@ #include #include #include +#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include + +#include #include "../common/env_var_utils.hpp" +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using namespace eprosima::testing; @@ -331,8 +335,9 @@ TEST_F(XMLProfileParserBasicTests, XMLParserRootLibrarySettings) ASSERT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::loadXMLFile("test_xml_root_library_settings_profile.xml")); - const LibrarySettingsAttributes& library_settings = xmlparser::XMLProfileManager::library_settings(); - EXPECT_EQ(library_settings.intraprocess_delivery, IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY); + const eprosima::fastdds::LibrarySettings& library_settings = xmlparser::XMLProfileManager::library_settings(); + EXPECT_EQ(library_settings.intraprocess_delivery, + eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_USER_DATA_ONLY); } TEST_F(XMLProfileParserBasicTests, XMLoadProfiles) @@ -457,8 +462,8 @@ TEST_P(XMLProfileParserTests, XMLParserLibrarySettings) ASSERT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::loadXMLFile(xml_filename_)); - const LibrarySettingsAttributes& library_settings = xmlparser::XMLProfileManager::library_settings(); - EXPECT_EQ(library_settings.intraprocess_delivery, IntraprocessDeliveryType::INTRAPROCESS_FULL); + const eprosima::fastdds::LibrarySettings& library_settings = xmlparser::XMLProfileManager::library_settings(); + EXPECT_EQ(library_settings.intraprocess_delivery, eprosima::fastdds::IntraprocessDeliveryType::INTRAPROCESS_FULL); } /* @@ -546,8 +551,6 @@ TEST_P(XMLProfileParserTests, XMLParserParticipant) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -571,9 +574,9 @@ TEST_F(XMLProfileParserBasicTests, XMLParserParticipantDeprecated) std::string participant_profile = std::string("test_participant_profile"); ParticipantAttributes participant_atts; - ASSERT_EQ( xmlparser::XMLP_ret::XML_OK, + ASSERT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::loadXMLFile("test_xml_deprecated.xml")); - EXPECT_EQ( xmlparser::XMLP_ret::XML_OK, + EXPECT_EQ(xmlparser::XMLP_ret::XML_OK, xmlparser::XMLProfileManager::fillParticipantAttributes(participant_profile, participant_atts)); EXPECT_EQ(participant_atts.domainId, 2019102u); @@ -648,8 +651,6 @@ TEST_F(XMLProfileParserBasicTests, XMLParserParticipantDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -733,8 +734,6 @@ TEST_P(XMLProfileParserTests, XMLParserDefaultParticipantProfile) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -818,8 +817,6 @@ TEST_F(XMLProfileParserBasicTests, XMLParserDefaultParticipantProfileDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -1667,8 +1664,8 @@ TEST_F(XMLProfileParserBasicTests, tls_config) xmlparser::sp_transport_t transport = xmlparser::XMLProfileManager::getTransportById("Test"); - using TCPDescriptor = std::shared_ptr; - TCPDescriptor descriptor = std::dynamic_pointer_cast(transport); + using TCPDescriptor = std::shared_ptr; + TCPDescriptor descriptor = std::dynamic_pointer_cast(transport); /* @@ -1692,16 +1689,26 @@ TEST_F(XMLProfileParserBasicTests, tls_config) EXPECT_EQ("DH.pem", descriptor->tls_config.tmp_dh_file); EXPECT_EQ("verify.pem", descriptor->tls_config.verify_file); EXPECT_EQ("my_server.com", descriptor->tls_config.server_name); - EXPECT_EQ(TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER, descriptor->tls_config.verify_mode); - EXPECT_TRUE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1)); - EXPECT_TRUE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_1)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV2)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV3)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_2)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_3)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::DEFAULT_WORKAROUNDS)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::NO_COMPRESSION)); - EXPECT_FALSE(descriptor->tls_config.get_option(TCPTransportDescriptor::TLSConfig::TLSOptions::SINGLE_DH_USE)); + EXPECT_EQ(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER, + descriptor->tls_config.verify_mode); + EXPECT_TRUE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions + ::NO_TLSV1)); + EXPECT_TRUE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSOptions + ::NO_TLSV1_1)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::NO_SSLV2)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::NO_SSLV3)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::NO_TLSV1_2)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::NO_TLSV1_3)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::DEFAULT_WORKAROUNDS)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::NO_COMPRESSION)); + EXPECT_FALSE(descriptor->tls_config.get_option(eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig:: + TLSOptions::SINGLE_DH_USE)); EXPECT_EQ(descriptor->tls_config.verify_paths.size(), static_cast(3)); EXPECT_EQ(descriptor->tls_config.verify_paths[0], "Path1"); @@ -1710,7 +1717,8 @@ TEST_F(XMLProfileParserBasicTests, tls_config) EXPECT_EQ(descriptor->tls_config.verify_depth, static_cast(55)); EXPECT_TRUE(descriptor->tls_config.default_verify_path); - EXPECT_EQ(descriptor->tls_config.handshake_role, TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::SERVER); + EXPECT_EQ(descriptor->tls_config.handshake_role, + eprosima::fastdds::rtps::TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::SERVER); } TEST_F(XMLProfileParserBasicTests, UDP_transport_descriptors_config) @@ -1722,8 +1730,8 @@ TEST_F(XMLProfileParserBasicTests, UDP_transport_descriptors_config) xmlparser::sp_transport_t transport = xmlparser::XMLProfileManager::getTransportById("Test"); - using UDPDescriptor = std::shared_ptr; - UDPDescriptor descriptor = std::dynamic_pointer_cast(transport); + using UDPDescriptor = std::shared_ptr; + UDPDescriptor descriptor = std::dynamic_pointer_cast(transport); ASSERT_NE(descriptor, nullptr); EXPECT_EQ(descriptor->sendBufferSize, 8192u); @@ -1777,15 +1785,9 @@ TEST_F(XMLProfileParserBasicTests, insertTransportByIdNegativeClauses) */ TEST_F(XMLProfileParserBasicTests, getDynamicTypeByNameNegativeClausesNegativeClauses) { - EXPECT_EQ(nullptr, xmlparser::XMLProfileManager::getDynamicTypeByName("wrong_type")); -} - -/* - * Test return code of the CreateDynamicPubSubType method when trying to retrieve a type which has not been parsed - */ -TEST_F(XMLProfileParserBasicTests, CreateDynamicPubSubType) -{ - EXPECT_EQ(nullptr, xmlparser::XMLProfileManager::CreateDynamicPubSubType("wrong_type")); + eprosima::fastdds::dds::traits::ref_type type; + EXPECT_EQ(xmlparser::XMLP_ret::XML_ERROR, xmlparser::XMLProfileManager::getDynamicTypeByName(type, "wrong_type")); + ASSERT_FALSE(type); } /* @@ -2074,7 +2076,7 @@ TEST_F(XMLProfileParserBasicTests, skip_default_xml) "; tinyxml2::XMLDocument xml_doc; xml_doc.Parse(xml); - xml_doc.SaveFile("DEFAULT_FASTRTPS_PROFILES.xml"); + xml_doc.SaveFile("DEFAULT_FASTDDS_PROFILES.xml"); #ifdef _WIN32 _putenv_s("SKIP_DEFAULT_XML_FILE", "1"); @@ -2094,13 +2096,13 @@ TEST_F(XMLProfileParserBasicTests, skip_default_xml) xmlparser::XMLProfileManager::loadDefaultXMLFile(); xmlparser::XMLProfileManager::getDefaultParticipantAttributes(participant_atts_default); - remove("DEFAULT_FASTRTPS_PROFILES.xml"); + remove("DEFAULT_FASTDDS_PROFILES.xml"); EXPECT_NE(participant_atts_none.domainId, participant_atts_default.domainId); } /* - * Tests whether the FASTRTPS_DEFAULT_PROFILES_FILE environment file correctly loads the selected file as default. + * Tests whether the FASTDDS_DEFAULT_PROFILES_FILE environment file correctly loads the selected file as default. * - participant_atts_default contains the attributes in the default file in this folder. * - participant_atts_file contains the attributes in the default file created by the test. */ @@ -2117,21 +2119,21 @@ TEST_F(XMLProfileParserBasicTests, default_env_variable) "; tinyxml2::XMLDocument xml_doc; xml_doc.Parse(xml); - xml_doc.SaveFile("FASTRTPS_PROFILES.xml"); + xml_doc.SaveFile("FASTDDS_PROFILES.xml"); ParticipantAttributes participant_atts_default; xmlparser::XMLProfileManager::loadDefaultXMLFile(); xmlparser::XMLProfileManager::getDefaultParticipantAttributes(participant_atts_default); #ifdef _WIN32 - _putenv_s("FASTRTPS_DEFAULT_PROFILES_FILE", "FASTRTPS_PROFILES.xml"); + _putenv_s("FASTDDS_DEFAULT_PROFILES_FILE", "FASTDDS_PROFILES.xml"); #else - setenv("FASTRTPS_DEFAULT_PROFILES_FILE", "FASTRTPS_PROFILES.xml", 1); + setenv("FASTDDS_DEFAULT_PROFILES_FILE", "FASTDDS_PROFILES.xml", 1); #endif // ifdef _WIN32 ParticipantAttributes participant_atts_file; xmlparser::XMLProfileManager::loadDefaultXMLFile(); xmlparser::XMLProfileManager::getDefaultParticipantAttributes(participant_atts_file); - remove("FASTRTPS_PROFILES.xml"); + remove("FASTDDS_PROFILES.xml"); EXPECT_NE(participant_atts_file.domainId, participant_atts_default.domainId); } @@ -3232,7 +3234,7 @@ TEST_F(XMLProfileParserBasicTests, log_thread_settings_qos) "log_thread_settings_ok", R"( - + -1 @@ -3248,7 +3250,7 @@ TEST_F(XMLProfileParserBasicTests, log_thread_settings_qos) "log_thread_settings_duplicate", R"( - + -1 @@ -3270,7 +3272,7 @@ TEST_F(XMLProfileParserBasicTests, log_thread_settings_qos) "log_thread_settings_wrong", R"( - + -1 @@ -3325,7 +3327,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "entity_factory_ok", R"( - + @@ -3345,7 +3347,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "shm_watchdog_thread_ok", R"( - + @@ -3368,7 +3370,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "file_watch_threads_ok", R"( - + @@ -3391,7 +3393,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "all_present_ok", R"( - + @@ -3423,7 +3425,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "qos_duplicated", R"( - + @@ -3448,7 +3450,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "entity_factory_wrong_tag", R"( - + @@ -3468,7 +3470,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "entity_factory_duplicated_autoenable_created_entities_tag", R"( - + @@ -3489,7 +3491,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "entity_factory_duplicated_autoenable_created_entities_and_wrong_tag", R"( - + @@ -3510,7 +3512,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "entity_factory_duplicated", R"( - + @@ -3545,7 +3547,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "shm_watchdog_thread_duplicated", R"( - + @@ -3583,7 +3585,7 @@ TEST_F(XMLProfileParserBasicTests, domainparticipantfactory) "file_watch_threads_duplicated", R"( - + @@ -3677,7 +3679,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "builtin_controllers_sender_thread_ok", R"( - + @@ -3704,7 +3706,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "builtin_controllers_sender_thread_nok", R"( - + @@ -3731,7 +3733,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "timed_events_thread_ok", R"( - + @@ -3758,7 +3760,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "timed_events_thread_nok", R"( - + @@ -3785,7 +3787,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "discovery_server_thread_ok", R"( - + @@ -3812,7 +3814,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "discovery_server_thread_nok", R"( - + @@ -3839,7 +3841,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "builtin_transports_reception_threads_ok", R"( - + @@ -3866,7 +3868,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "builtin_transports_reception_threads_nok", R"( - + @@ -3894,7 +3896,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "security_log_thread_ok", R"( - + @@ -3919,7 +3921,7 @@ TEST_F(XMLProfileParserBasicTests, participant_thread_settings) "security_log_thread_nok", R"( - + @@ -4000,7 +4002,7 @@ TEST_F(XMLProfileParserBasicTests, datareader_thread_settings) "data_sharing_listener_thread_ok", R"( - + @@ -4024,7 +4026,7 @@ TEST_F(XMLProfileParserBasicTests, datareader_thread_settings) "data_sharing_listener_thread_empty", R"( - + @@ -4044,7 +4046,7 @@ TEST_F(XMLProfileParserBasicTests, datareader_thread_settings) "no_data_sharing_listener_thread", R"( - + @@ -4062,7 +4064,7 @@ TEST_F(XMLProfileParserBasicTests, datareader_thread_settings) "data_sharing_listener_thread_wrong_value", R"( - + @@ -4086,7 +4088,7 @@ TEST_F(XMLProfileParserBasicTests, datareader_thread_settings) "data_sharing_listener_thread_wrong_tag", R"( - + diff --git a/test/unittest/xmlparser/XMLTreeTests.cpp b/test/unittest/xmlparser/XMLTreeTests.cpp index 035e7fa4e24..2bdcd23f13a 100644 --- a/test/unittest/xmlparser/XMLTreeTests.cpp +++ b/test/unittest/xmlparser/XMLTreeTests.cpp @@ -1,7 +1,21 @@ -#include +// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include -#include #include +#include #include diff --git a/test/unittest/xmlparser/log_def_file_profile.xml b/test/unittest/xmlparser/log_def_file_profile.xml index 38b052a081c..75d4e306f48 100644 --- a/test/unittest/xmlparser/log_def_file_profile.xml +++ b/test/unittest/xmlparser/log_def_file_profile.xml @@ -1,5 +1,5 @@ - + TRUE diff --git a/test/unittest/xmlparser/log_inactive_profile.xml b/test/unittest/xmlparser/log_inactive_profile.xml index 2039beb7893..c0ec35418f7 100644 --- a/test/unittest/xmlparser/log_inactive_profile.xml +++ b/test/unittest/xmlparser/log_inactive_profile.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/log_node_file_append_profile.xml b/test/unittest/xmlparser/log_node_file_append_profile.xml index 635690b99fc..abab527ad4a 100644 --- a/test/unittest/xmlparser/log_node_file_append_profile.xml +++ b/test/unittest/xmlparser/log_node_file_append_profile.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/log_stdouterr_profile.xml b/test/unittest/xmlparser/log_stdouterr_profile.xml index 7faf82121d2..e9df184dd96 100644 --- a/test/unittest/xmlparser/log_stdouterr_profile.xml +++ b/test/unittest/xmlparser/log_stdouterr_profile.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/log_stdouterr_two_thresholds_profile.xml b/test/unittest/xmlparser/log_stdouterr_two_thresholds_profile.xml index d543dd93d21..bc19a1a9b81 100644 --- a/test/unittest/xmlparser/log_stdouterr_two_thresholds_profile.xml +++ b/test/unittest/xmlparser/log_stdouterr_two_thresholds_profile.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/log_stdouterr_wrong_property_name_profile_invalid.xml b/test/unittest/xmlparser/log_stdouterr_wrong_property_name_profile_invalid.xml index dd0d194e9ff..86f63abb28a 100644 --- a/test/unittest/xmlparser/log_stdouterr_wrong_property_name_profile_invalid.xml +++ b/test/unittest/xmlparser/log_stdouterr_wrong_property_name_profile_invalid.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/log_stdouterr_wrong_property_value_profile_invalid.xml b/test/unittest/xmlparser/log_stdouterr_wrong_property_value_profile_invalid.xml index e6ae3b47e5e..a12f037253c 100644 --- a/test/unittest/xmlparser/log_stdouterr_wrong_property_value_profile_invalid.xml +++ b/test/unittest/xmlparser/log_stdouterr_wrong_property_value_profile_invalid.xml @@ -1,5 +1,5 @@ - + FALSE diff --git a/test/unittest/xmlparser/regressions/simple_participant_profiles_nok.xml b/test/unittest/xmlparser/regressions/simple_participant_profiles_nok.xml index 6c8f945c202..87a11151c4b 100644 --- a/test/unittest/xmlparser/regressions/simple_participant_profiles_nok.xml +++ b/test/unittest/xmlparser/regressions/simple_participant_profiles_nok.xml @@ -1,5 +1,5 @@ - + 1 diff --git a/test/unittest/xmlparser/regressions/simple_participant_profiles_ok.xml b/test/unittest/xmlparser/regressions/simple_participant_profiles_ok.xml index ef1729dde01..660706c1f02 100644 --- a/test/unittest/xmlparser/regressions/simple_participant_profiles_ok.xml +++ b/test/unittest/xmlparser/regressions/simple_participant_profiles_ok.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/xmlparser/test_xml_deprecated.xml b/test/unittest/xmlparser/test_xml_deprecated.xml index 99ead8f8282..baa203da3df 100644 --- a/test/unittest/xmlparser/test_xml_deprecated.xml +++ b/test/unittest/xmlparser/test_xml_deprecated.xml @@ -1,5 +1,5 @@ - + 2019102 @@ -127,10 +127,6 @@ 1000 2000 55 - - true - true - 12 @@ -169,6 +165,12 @@ 12 12 + + 12 + 12 + 12 + 12 + 12 12 diff --git a/test/unittest/xmlparser/test_xml_duration_profile.xml b/test/unittest/xmlparser/test_xml_duration_profile.xml index 8829d39f714..e9cafefa7ff 100644 --- a/test/unittest/xmlparser/test_xml_duration_profile.xml +++ b/test/unittest/xmlparser/test_xml_duration_profile.xml @@ -1,5 +1,5 @@ - + 80 diff --git a/test/unittest/xmlparser/test_xml_profile.xml b/test/unittest/xmlparser/test_xml_profile.xml index fa9207f9c52..f75239b65db 100644 --- a/test/unittest/xmlparser/test_xml_profile.xml +++ b/test/unittest/xmlparser/test_xml_profile.xml @@ -1,5 +1,5 @@ - + @@ -146,10 +146,6 @@ 1000 2000 55 - - true - true - 12 @@ -185,6 +181,12 @@ 12 12 + + 12 + 12 + 12 + 12 + 12 12 @@ -434,6 +436,48 @@ 1001 + + request_topic_name + reply_topic_name + + + + MANUAL_BY_TOPIC + + + + + + + MANUAL_BY_TOPIC + + + + + + request_topic_name + reply_topic_name + + + + MANUAL_BY_TOPIC + + + + + + + MANUAL_BY_TOPIC + + + + FULL diff --git a/test/unittest/xmlparser/test_xml_profile_env_var.xml b/test/unittest/xmlparser/test_xml_profile_env_var.xml index 63a4deb22b7..57428c1151a 100644 --- a/test/unittest/xmlparser/test_xml_profile_env_var.xml +++ b/test/unittest/xmlparser/test_xml_profile_env_var.xml @@ -1,5 +1,5 @@ - + ${XML_PROFILES_ENV_VAR_1} @@ -127,10 +127,6 @@ ${XML_PROFILES_ENV_VAR_51} ${XML_PROFILES_ENV_VAR_52} ${XML_PROFILES_ENV_VAR_53} - - ${XML_PROFILES_ENV_VAR_54} - ${XML_PROFILES_ENV_VAR_55} - ${XML_PROFILES_ENV_VAR_56} @@ -166,6 +162,12 @@ ${XML_PROFILES_ENV_VAR_160} ${XML_PROFILES_ENV_VAR_161} + + ${XML_PROFILES_ENV_VAR_158} + ${XML_PROFILES_ENV_VAR_159} + ${XML_PROFILES_ENV_VAR_160} + ${XML_PROFILES_ENV_VAR_161} + ${XML_PROFILES_ENV_VAR_158} ${XML_PROFILES_ENV_VAR_159} diff --git a/test/unittest/xmlparser/test_xml_root_library_settings_profile.xml b/test/unittest/xmlparser/test_xml_root_library_settings_profile.xml index 38b4b0f3d78..6edb9e2d25b 100644 --- a/test/unittest/xmlparser/test_xml_root_library_settings_profile.xml +++ b/test/unittest/xmlparser/test_xml_root_library_settings_profile.xml @@ -1,5 +1,5 @@ - + USER_DATA_ONLY diff --git a/test/unittest/xmlparser/test_xml_rooted_deprecated.xml b/test/unittest/xmlparser/test_xml_rooted_deprecated.xml index 79d773dfba8..3a5939c3cf8 100644 --- a/test/unittest/xmlparser/test_xml_rooted_deprecated.xml +++ b/test/unittest/xmlparser/test_xml_rooted_deprecated.xml @@ -1,5 +1,5 @@ - + @@ -105,10 +105,6 @@ - - true - true - 12 @@ -144,6 +140,12 @@ 12 12 + + 12 + 12 + 12 + 12 + 12 12 diff --git a/test/unittest/xmlparser/test_xml_rooted_profile.xml b/test/unittest/xmlparser/test_xml_rooted_profile.xml index b6e95e1751e..d02b379f79a 100644 --- a/test/unittest/xmlparser/test_xml_rooted_profile.xml +++ b/test/unittest/xmlparser/test_xml_rooted_profile.xml @@ -1,5 +1,5 @@ - + @@ -124,10 +124,6 @@ - - true - true - 12 @@ -159,6 +155,12 @@ 12 12 + + 12 + 12 + 12 + 12 + 12 12 diff --git a/test/unittest/xmlparser/test_xml_security_profile.xml b/test/unittest/xmlparser/test_xml_security_profile.xml index 644b35a7da7..825f678f5cb 100644 --- a/test/unittest/xmlparser/test_xml_security_profile.xml +++ b/test/unittest/xmlparser/test_xml_security_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/xmlparser/tls_config_profile.xml b/test/unittest/xmlparser/tls_config_profile.xml index 5944cdc4b03..e04382f07e7 100644 --- a/test/unittest/xmlparser/tls_config_profile.xml +++ b/test/unittest/xmlparser/tls_config_profile.xml @@ -1,5 +1,5 @@ - + diff --git a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp index 3372b20b638..f6b54832a32 100644 --- a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp +++ b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp @@ -13,10 +13,13 @@ // limitations under the License. #include +#include #include #include -#include +#include + +using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; @@ -147,7 +150,7 @@ class XMLParserTest : public XMLParser static XMLP_ret getXMLTransports_wrapper( tinyxml2::XMLElement* elem, - std::vector>& transports, + std::vector>& transports, uint8_t ident) { return getXMLTransports(elem, transports, ident); @@ -242,14 +245,6 @@ class XMLParserTest : public XMLParser return getXMLBuiltinAttributes(elem, builtin, ident); } - static XMLP_ret getXMLTypeLookupSettings_wrapper( - tinyxml2::XMLElement* elem, - TypeLookupSettings& settings, - uint8_t ident) - { - return getXMLTypeLookupSettings(elem, settings, ident); - } - static XMLP_ret getXMLThroughputController_wrapper( tinyxml2::XMLElement* elem, ThroughputControllerDescriptor& throughputController, @@ -412,7 +407,7 @@ class XMLParserTest : public XMLParser static XMLP_ret getXMLEnum_wrapper( tinyxml2::XMLElement* elem, - IntraprocessDeliveryType* e, + eprosima::fastdds::IntraprocessDeliveryType* e, uint8_t ident) { return getXMLEnum(elem, e, ident); diff --git a/test/unittest/xtypes/CMakeLists.txt b/test/unittest/xtypes/CMakeLists.txt deleted file mode 100644 index 3b10f04b396..00000000000 --- a/test/unittest/xtypes/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -set(XTYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/network.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetmaskFilterKind.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp - ) - -set(XTYPES_TEST_SOURCE - XTypesTests.cpp - idl/TypesTypeObject.cxx - idl/Types.cxx - idl/Typesv1.cxx - idl/WideEnumTypeObject.cxx - idl/WideEnum.cxx - idl/WideEnumv1.cxx - ${XTYPES_SOURCE} - ) - -if(ANDROID) - if (ANDROID_NATIVE_API_LEVEL LESS 24) - list(APPEND XTYPES_TEST_SOURCE - ${ANDROID_IFADDRS_SOURCE_DIR}/ifaddrs.c - ) - endif() -endif() - -include_directories(mock/) - -add_executable(XTypesTests ${XTYPES_TEST_SOURCE}) -target_compile_definitions(XTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(XTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) -target_link_libraries(XTypesTests GTest::gtest ${MOCKS}) -if(MSVC OR MSVC_IDE) - target_link_libraries(XTypesTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) -else() - target_link_libraries(XTypesTests ${PRIVACY} fastcdr) -endif() -gtest_discover_tests(XTypesTests) diff --git a/test/unittest/xtypes/XTypesTests.cpp b/test/unittest/xtypes/XTypesTests.cpp deleted file mode 100644 index d32886e3322..00000000000 --- a/test/unittest/xtypes/XTypesTests.cpp +++ /dev/null @@ -1,844 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include -#include "idl/TypesTypeObject.h" -#include "idl/WideEnumTypeObject.h" -#include -#include -#include - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::types; - -class XTypesTests : public ::testing::Test -{ -public: - - XTypesTests() - { - //registerTypesTypes(); - } - - ~XTypesTests() - { - TypeObjectFactory::delete_instance(); - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - } - -}; - -TEST_F(XTypesTests, EnumMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetMinimalMyEnumStructObject(); - const TypeObject* my_bad_enum = GetMinimalMyBadEnumStructObject(); - const TypeObject* my_wide_enum = GetMinimalMyEnumWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_TRUE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't ignore names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_FALSE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, EnumCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetCompleteMyEnumStructObject(); - const TypeObject* my_bad_enum = GetCompleteMyBadEnumStructObject(); - const TypeObject* my_wide_enum = GetCompleteMyEnumWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_TRUE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't ignore names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_FALSE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, AliasMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetMinimalMyEnumStructObject(); - const TypeObject* my_alias_enum = GetMinimalMyAliasEnumStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, AliasCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetCompleteMyEnumStructObject(); - const TypeObject* my_alias_enum = GetCompleteMyAliasEnumStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, BasicStructMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_struct = GetMinimalBasicStructObject(); - const TypeObject* basic_names_struct = GetMinimalBasicNamesStructObject(); - const TypeObject* basic_bad_struct = GetMinimalBasicBadStructObject(); - const TypeObject* basic_wide_struct = GetMinimalBasicWideStructObject(); - const TypeObject* basic_wide_bad_struct = GetMinimalBadBasicWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_bad_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); -} - -TEST_F(XTypesTests, BasicStructCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_struct = GetCompleteBasicStructObject(); - const TypeObject* basic_names_struct = GetCompleteBasicNamesStructObject(); - const TypeObject* basic_bad_struct = GetCompleteBasicBadStructObject(); - const TypeObject* basic_wide_struct = GetCompleteBasicWideStructObject(); - const TypeObject* basic_wide_bad_struct = GetCompleteBadBasicWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_bad_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); -} - -TEST_F(XTypesTests, StringMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_string = GetMinimalStringStructObject(); - const TypeObject* my_lstring = GetMinimalLargeStringStructObject(); - const TypeObject* my_wstring = GetMinimalWStringStructObject(); - const TypeObject* my_lwstring = GetMinimalLargeWStringStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_TRUE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_string->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_lstring, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_wstring, consistencyQos)); - - // Don't ignoring string bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_string_bounds = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); -} - -TEST_F(XTypesTests, StringCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_string = GetCompleteStringStructObject(); - const TypeObject* my_lstring = GetCompleteLargeStringStructObject(); - const TypeObject* my_wstring = GetCompleteWStringStructObject(); - const TypeObject* my_lwstring = GetCompleteLargeWStringStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_TRUE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_string->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_lstring, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_wstring, consistencyQos)); - - // Don't ignoring string bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_string_bounds = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); -} - -TEST_F(XTypesTests, ArrayMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_array = GetMinimalArrayStructObject(); - const TypeObject* my_array_equal = GetMinimalArrayStructEqualObject(); - const TypeObject* my_array_bad = GetMinimalArrayBadStructObject(); - const TypeObject* my_array_dims = GetMinimalArrayDimensionsStructObject(); - const TypeObject* my_array_size = GetMinimalArraySizeStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_array->consistent(*my_array_equal, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_bad, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_dims, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_size, consistencyQos)); - ASSERT_TRUE(my_array_equal->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_bad->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_dims->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_size->consistent(*my_array, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_array->consistent(*my_array_equal, consistencyQos)); -} - -TEST_F(XTypesTests, ArrayCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_array = GetCompleteArrayStructObject(); - const TypeObject* my_array_equal = GetCompleteArrayStructEqualObject(); - const TypeObject* my_array_bad = GetCompleteArrayBadStructObject(); - const TypeObject* my_array_dims = GetCompleteArrayDimensionsStructObject(); - const TypeObject* my_array_size = GetCompleteArraySizeStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_array->consistent(*my_array_equal, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_bad, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_dims, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_size, consistencyQos)); - ASSERT_TRUE(my_array_equal->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_bad->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_dims->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_size->consistent(*my_array, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_array->consistent(*my_array_equal, consistencyQos)); -} - -TEST_F(XTypesTests, SequenceMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_sequence = GetMinimalSequenceStructObject(); - const TypeObject* my_sequence_equal = GetMinimalSequenceStructEqualObject(); - const TypeObject* my_sequence_bad = GetMinimalSequenceBadStructObject(); - const TypeObject* my_sequence_bound = GetMinimalSequenceBoundsStructObject(); - const TypeObject* my_sequence_sequence = GetMinimalSequenceSequenceStructObject(); - const TypeObject* my_sequence_sequence_bound = GetMinimalSequenceSequenceBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bad, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence_bad->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring sequence bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_FALSE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); -} - -TEST_F(XTypesTests, SequenceCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_sequence = GetCompleteSequenceStructObject(); - const TypeObject* my_sequence_equal = GetCompleteSequenceStructEqualObject(); - const TypeObject* my_sequence_bad = GetCompleteSequenceBadStructObject(); - const TypeObject* my_sequence_bound = GetCompleteSequenceBoundsStructObject(); - const TypeObject* my_sequence_sequence = GetCompleteSequenceSequenceStructObject(); - const TypeObject* my_sequence_sequence_bound = GetCompleteSequenceSequenceBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bad, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence_bad->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring sequence bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_FALSE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); -} - -TEST_F(XTypesTests, MapMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_map = GetMinimalMapStructObject(); - const TypeObject* my_map_equal = GetMinimalMapStructEqualObject(); - const TypeObject* my_map_bad_key = GetMinimalMapBadKeyStructObject(); - const TypeObject* my_map_bad_elem = GetMinimalMapBadElemStructObject(); - const TypeObject* my_map_bound = GetMinimalMapBoundsStructObject(); - const TypeObject* my_map_map = GetMinimalMapMapStructObject(); - const TypeObject* my_map_map_bound = GetMinimalMapMapBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_key, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_elem, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_key->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_elem->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring map bounds, doesn't apply on maps - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_FALSE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); -} - -TEST_F(XTypesTests, MapCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_map = GetCompleteMapStructObject(); - const TypeObject* my_map_equal = GetCompleteMapStructEqualObject(); - const TypeObject* my_map_bad_key = GetCompleteMapBadKeyStructObject(); - const TypeObject* my_map_bad_elem = GetCompleteMapBadElemStructObject(); - const TypeObject* my_map_bound = GetCompleteMapBoundsStructObject(); - const TypeObject* my_map_map = GetCompleteMapMapStructObject(); - const TypeObject* my_map_map_bound = GetCompleteMapMapBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_key, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_elem, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_key->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_elem->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring map bounds, doesn't apply on maps - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_FALSE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); -} - -TEST_F(XTypesTests, SimpleUnionMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_union = GetMinimalSimpleUnionStructObject(); - const TypeObject* basic_union_equal = GetMinimalSimpleUnionStructEqualObject(); - const TypeObject* basic_union_names = GetMinimalSimpleUnionNamesStructObject(); - const TypeObject* basic_union_type = GetMinimalSimpleTypeUnionStructObject(); - const TypeObject* basic_bad_union = GetMinimalSimpleBadUnionStructObject(); - const TypeObject* basic_bad_union_disc = GetMinimalSimplBadDiscUnionStructObject(); - const TypeObject* basic_wide_union = GetMinimalSimpleWideUnionStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_type, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union_disc, consistencyQos)); - ASSERT_TRUE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union_names->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_union_type->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union_disc->consistent(*basic_union, consistencyQos)); - - - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_TRUE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_FALSE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); -} - -TEST_F(XTypesTests, SimpleUnionCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_union = GetCompleteSimpleUnionStructObject(); - const TypeObject* basic_union_equal = GetCompleteSimpleUnionStructEqualObject(); - const TypeObject* basic_union_names = GetCompleteSimpleUnionNamesStructObject(); - const TypeObject* basic_union_type = GetCompleteSimpleTypeUnionStructObject(); - const TypeObject* basic_bad_union = GetCompleteSimpleBadUnionStructObject(); - const TypeObject* basic_bad_union_disc = GetCompleteSimplBadDiscUnionStructObject(); - const TypeObject* basic_wide_union = GetCompleteSimpleWideUnionStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_type, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union_disc, consistencyQos)); - ASSERT_TRUE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union_names->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_union_type->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union_disc->consistent(*basic_union, consistencyQos)); - - - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_TRUE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_FALSE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); -} - -TEST_F(XTypesTests, TypeDescriptorFullyQualifiedName) -{ - DynamicTypeBuilder_ptr my_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); - my_builder->add_member(0, "x", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(0, "y", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(0, "z", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - const TypeDescriptor* my_descriptor = my_builder->get_type_descriptor(); - - my_builder->set_name("Position"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("Position_"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("Position123"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("position_123"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("_Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("123Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("Position&"); - ASSERT_FALSE(my_descriptor->is_consistent()); - - my_builder->set_name("my_interface::action::dds_::Position"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface:action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface:::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("_my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("1my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name(":my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("::my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("$my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::2action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::_action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::*action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::action*::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); -} - -TEST_F(XTypesTests, MemberDescriptorFullyQualifiedName) -{ - MemberId member_id = 0; - DynamicTypeBuilder_ptr my_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); - my_builder->add_member(member_id++, "x", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(member_id++, "y", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(member_id, "z", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - - my_builder->set_name("Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t1", my_builder->build())); - my_builder->set_name("Position_"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t2", my_builder->build())); - my_builder->set_name("Position123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t3", my_builder->build())); - my_builder->set_name("position_123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t4", my_builder->build())); - my_builder->set_name("_Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t5", my_builder->build())); - my_builder->set_name("123Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t6", my_builder->build())); - my_builder->set_name("Position&"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t7", my_builder->build())); - - my_builder->set_name("my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t8", my_builder->build())); - my_builder->set_name("my_interface:action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t9", my_builder->build())); - my_builder->set_name("my_interface:::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tA", my_builder->build())); - my_builder->set_name("_my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tB", my_builder->build())); - my_builder->set_name("1my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tC", my_builder->build())); - my_builder->set_name(":my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tD", my_builder->build())); - my_builder->set_name("::my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tE", my_builder->build())); - my_builder->set_name("$my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tF", my_builder->build())); - my_builder->set_name("my_interface::2action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tG", my_builder->build())); - my_builder->set_name("my_interface::_action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tH", my_builder->build())); - my_builder->set_name("my_interface::*action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tI", my_builder->build())); - my_builder->set_name("my_interface::action*::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tJ", my_builder->build())); -} - -int main( - int argc, - char** argv) -{ - eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/xtypes/idl/Types.cxx b/test/unittest/xtypes/idl/Types.cxx deleted file mode 100644 index d0ee9153b8d..00000000000 --- a/test/unittest/xtypes/idl/Types.cxx +++ /dev/null @@ -1,5244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumStruct::MyEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -BasicStruct::BasicStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - -BasicBadStruct::BasicBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - -BasicWideStruct::BasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - -StringStruct::StringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - - m_my_string = x.m_my_string; - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - -LargeStringStruct::LargeStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - - m_my_large_string = x.m_my_large_string; - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - - m_my_large_string = std::move(x.m_my_large_string); - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - -WStringStruct::WStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - - m_my_wstring = x.m_my_wstring; - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - - m_my_wstring = std::move(x.m_my_wstring); - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - - m_my_large_wstring = x.m_my_large_wstring; - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - -ArrayStruct::ArrayStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - - m_my_array_equal = x.m_my_array_equal; - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - - m_my_array_equal = std::move(x.m_my_array_equal); - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - -SequenceStruct::SequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - - m_my_sequence_equal = x.m_my_sequence_equal; - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - -MapStruct::MapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapStructEqual::MapStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - - m_my_map_equal = x.m_my_map_equal; - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - - m_my_map_equal = std::move(x.m_my_map_equal); - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch (__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 0: - switch (__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch (__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - - m_my_union_equal = x.m_my_union_equal; - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - - m_my_union_equal = std::move(x.m_my_union_equal); - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TypesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/Types.h b/test/unittest/xtypes/idl/Types.h deleted file mode 100644 index e482676e515..00000000000 --- a/test/unittest/xtypes/idl/Types.h +++ /dev/null @@ -1,4432 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - -private: - - MyEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - -private: - - MyBadEnum m_my_enum{::A1}; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - -private: - - MyAliasEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - -private: - - bool m_my_bool_name{false}; - int32_t m_my_int32_name{0}; - std::string m_my_string_name; - -}; - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - uint8_t m_my_bool{0}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - int32_t m_new_int32{0}; - std::string m_new_string; - -}; - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - int32_t m_new_int32{0}; - std::string m_new_string; - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - -private: - - std::wstring m_my_wstring; - -}; - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - -private: - - std::wstring m_my_large_wstring; - -}; - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - -private: - - std::array m_my_array_equal{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - -private: - - std::array, 2> m_my_array{ {{0}} }; - -}; - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - -private: - - std::vector m_my_sequence_equal; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - -private: - - std::map m_my_map_equal; - -}; - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - -private: - - int32_t m__d; - - int32_t m_first_case{0}; - int64_t m_second_case{0}; -}; - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - uint8_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - uint8_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - -private: - - SimpleUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - -private: - - SimpleUnion m_my_union_equal; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - -private: - - SimpleUnionNames m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - -private: - - SimpleTypeUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - -private: - - SimpleBadUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - -private: - - SimpleBadDiscUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/Types.idl b/test/unittest/xtypes/idl/Types.idl deleted file mode 100644 index fea3438ed82..00000000000 --- a/test/unittest/xtypes/idl/Types.idl +++ /dev/null @@ -1,271 +0,0 @@ -// Enum - -enum MyEnum -{ - A, - B, - C -}; - -enum MyBadEnum -{ - A1, - B1, - C1 -}; - -struct MyEnumStruct -{ - MyEnum my_enum; -}; - -struct MyBadEnumStruct -{ - MyBadEnum my_enum; -}; - -// Alias - -typedef MyEnum MyAliasEnum; - -struct MyAliasEnumStruct -{ - MyAliasEnum my_enum; // Keep same name -}; - -// All basic types - -struct BasicStruct -{ - boolean my_bool; - long my_int32; - string my_string; -}; - -struct BasicNamesStruct -{ - boolean my_bool_name; - long my_int32_name; - string my_string_name; -}; - -struct BasicBadStruct -{ - octet my_bool; - long my_int32; - string my_string; -}; - -// Wide Struct - -struct BasicWideStruct -{ - boolean my_bool; - long my_int32; - string my_string; - long new_int32; - string new_string; -}; - -// Bad Wide Struct - -struct BadBasicWideStruct -{ - long new_int32; - string new_string; - boolean my_bool; - long my_int32; - string my_string; -}; - -// String bounds - -struct StringStruct -{ - string my_string; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -// WString bounds - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -// Array dimensions and size - -struct ArrayStruct -{ - long my_array[2]; -}; - -struct ArrayStructEqual -{ - long my_array_equal[2]; -}; - -struct ArrayBadStruct -{ - octet my_array[2]; -}; - -struct ArrayDimensionsStruct -{ - long my_array[2][2]; -}; - -struct ArraySizeStruct -{ - long my_array[5]; -}; - -// Sequence bounds - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceStructEqual -{ - sequence my_sequence_equal; -}; - -struct SequenceBadStruct -{ - sequence my_sequence; -}; - -struct SequenceBoundsStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct SequenceSequenceBoundsStruct -{ - sequence, 5> my_sequence_sequence; -}; - -// Map bounds - -struct MapStruct -{ - map my_map; -}; - -struct MapStructEqual -{ - map my_map_equal; -}; - -struct MapBadKeyStruct -{ - map my_map; -}; - -struct MapBadElemStruct -{ - map my_map; -}; - -struct MapBoundsStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -struct MapMapBoundsStruct -{ - map , 3> my_map_map; -}; - -// Unions - -union SimpleUnion switch (long) -{ - case A: - long first; - case B: - long long second; -}; - -union SimpleUnionNames switch (long) -{ - case A: - long first_case; - case B: - long long second_case; -}; - -union SimpleTypeUnion switch (long) -{ - case A: - octet first; - case B: - long long second; -}; - -union SimpleBadUnion switch (long) -{ - case A: - long first; - case C: - long long second; -}; - -union SimpleBadDiscUnion switch (octet) -{ - case 0: - long first; - case 1: - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct SimpleUnionStructEqual -{ - SimpleUnion my_union_equal; -}; - -struct SimpleUnionNamesStruct -{ - SimpleUnionNames my_union; -}; - -struct SimpleTypeUnionStruct -{ - SimpleTypeUnion my_union; -}; - -struct SimpleBadUnionStruct -{ - SimpleBadUnion my_union; -}; - -struct SimplBadDiscUnionStruct -{ - SimpleBadDiscUnion my_union; -}; \ No newline at end of file diff --git a/test/unittest/xtypes/idl/TypesCdrAux.hpp b/test/unittest/xtypes/idl/TypesCdrAux.hpp deleted file mode 100644 index 14992724933..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.hpp +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - -#include "Types.h" - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceBoundsStruct_max_cdr_typesize {132UL}; -constexpr uint32_t SequenceSequenceBoundsStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyAliasEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyAliasEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayBadStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ArrayBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBadKeyStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapBadKeyStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleBadUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleBadUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MyEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayStructEqual_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeWStringStruct_max_cdr_typesize {83858UL}; -constexpr uint32_t LargeWStringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WStringStruct_max_cdr_typesize {518UL}; -constexpr uint32_t WStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStruct_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleTypeUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleTypeUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayDimensionsStruct_max_cdr_typesize {20UL}; -constexpr uint32_t ArrayDimensionsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceStruct_max_cdr_typesize {48UL}; -constexpr uint32_t SequenceSequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBoundsStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStructEqual_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t MapStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBoundsStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SequenceBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapMapStruct_max_cdr_typesize {60UL}; -constexpr uint32_t MapMapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BasicWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimplBadDiscUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimplBadDiscUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyBadEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyBadEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBadStruct_max_cdr_typesize {10UL}; -constexpr uint32_t SequenceBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionNamesStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeStringStruct_max_cdr_typesize {41934UL}; -constexpr uint32_t LargeStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayStruct_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BadBasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BadBasicWideStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArraySizeStruct_max_cdr_typesize {24UL}; -constexpr uint32_t ArraySizeStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapBadElemStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBadElemStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicBadStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicNamesStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StringStruct_max_cdr_typesize {264UL}; -constexpr uint32_t StringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapMapBoundsStruct_max_cdr_typesize {108UL}; -constexpr uint32_t MapMapBoundsStruct_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data); - - - - - - - - - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - diff --git a/test/unittest/xtypes/idl/TypesCdrAux.ipp b/test/unittest/xtypes/idl/TypesCdrAux.ipp deleted file mode 100644 index 5d6735bcfef..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.ipp +++ /dev/null @@ -1,3543 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - -#include "TypesCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyBadEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyBadEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyAliasEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyAliasEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicNamesStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string_name(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool_name() - << eprosima::fastcdr::MemberId(1) << data.my_int32_name() - << eprosima::fastcdr::MemberId(2) << data.my_string_name() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicNamesStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool_name(); - break; - - case 1: - dcdr >> data.my_int32_name(); - break; - - case 2: - dcdr >> data.my_string_name(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicWideStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.new_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() - << eprosima::fastcdr::MemberId(3) << data.new_int32() - << eprosima::fastcdr::MemberId(4) << data.new_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicWideStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - case 3: - dcdr >> data.new_int32(); - break; - - case 4: - dcdr >> data.new_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BadBasicWideStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.new_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.new_int32() - << eprosima::fastcdr::MemberId(1) << data.new_string() - << eprosima::fastcdr::MemberId(2) << data.my_bool() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BadBasicWideStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.new_int32(); - break; - - case 1: - dcdr >> data.new_string(); - break; - - case 2: - dcdr >> data.my_bool(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeWStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeWStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayDimensionsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayDimensionsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArraySizeStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArraySizeStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadKeyStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadKeyStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadElemStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadElemStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNames& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first_case(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second_case(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNames& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first_case(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second_case(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNames& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first_case(); - break; - - case B: - dcdr >> data.second_case(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case C: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case C: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadDiscUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case 1: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadDiscUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case 1: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadDiscUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case 0: - dcdr >> data.first(); - break; - - case 1: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNamesStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNamesStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimplBadDiscUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimplBadDiscUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx b/test/unittest/xtypes/idl/TypesPubSubTypes.cxx deleted file mode 100644 index 0c0a8f0363e..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx +++ /dev/null @@ -1,6927 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TypesPubSubTypes.h" -#include "TypesCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - -MyEnumStructPubSubType::MyEnumStructPubSubType() -{ - setName("MyEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumStruct::getMaxCdrSerializedSize()); -#else - MyEnumStruct_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 = MyEnumStruct_max_key_cdr_typesize > 16 ? MyEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumStructPubSubType::~MyEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumStruct* 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; - } - 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 MyEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumStruct* 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 MyEnumStructPubSubType::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* MyEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumStruct()); -} - -void MyEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumStruct_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 || MyEnumStruct_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; -} - - - -MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() -{ - setName("MyBadEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); -#else - MyBadEnumStruct_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 = MyBadEnumStruct_max_key_cdr_typesize > 16 ? MyBadEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyBadEnumStructPubSubType::~MyBadEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyBadEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyBadEnumStruct* 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; - } - 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 MyBadEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyBadEnumStruct* 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 MyBadEnumStructPubSubType::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* MyBadEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyBadEnumStruct()); -} - -void MyBadEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyBadEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyBadEnumStruct_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 || MyBadEnumStruct_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; -} - - - - - -MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() -{ - setName("MyAliasEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); -#else - MyAliasEnumStruct_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 = MyAliasEnumStruct_max_key_cdr_typesize > 16 ? MyAliasEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyAliasEnumStructPubSubType::~MyAliasEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyAliasEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyAliasEnumStruct* 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; - } - 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 MyAliasEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyAliasEnumStruct* 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 MyAliasEnumStructPubSubType::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* MyAliasEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyAliasEnumStruct()); -} - -void MyAliasEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyAliasEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyAliasEnumStruct_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 || MyAliasEnumStruct_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; -} - - - -BasicStructPubSubType::BasicStructPubSubType() -{ - setName("BasicStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicStruct::getMaxCdrSerializedSize()); -#else - BasicStruct_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 = BasicStruct_max_key_cdr_typesize > 16 ? BasicStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicStructPubSubType::~BasicStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicStruct* 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; - } - 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 BasicStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicStruct* 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 BasicStructPubSubType::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* BasicStructPubSubType::createData() -{ - return reinterpret_cast(new BasicStruct()); -} - -void BasicStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicStruct_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 || BasicStruct_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; -} - - - -BasicNamesStructPubSubType::BasicNamesStructPubSubType() -{ - setName("BasicNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); -#else - BasicNamesStruct_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 = BasicNamesStruct_max_key_cdr_typesize > 16 ? BasicNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicNamesStructPubSubType::~BasicNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicNamesStruct* 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; - } - 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 BasicNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicNamesStruct* 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 BasicNamesStructPubSubType::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* BasicNamesStructPubSubType::createData() -{ - return reinterpret_cast(new BasicNamesStruct()); -} - -void BasicNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicNamesStruct_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 || BasicNamesStruct_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; -} - - - -BasicBadStructPubSubType::BasicBadStructPubSubType() -{ - setName("BasicBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicBadStruct::getMaxCdrSerializedSize()); -#else - BasicBadStruct_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 = BasicBadStruct_max_key_cdr_typesize > 16 ? BasicBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicBadStructPubSubType::~BasicBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicBadStruct* 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; - } - 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 BasicBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicBadStruct* 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 BasicBadStructPubSubType::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* BasicBadStructPubSubType::createData() -{ - return reinterpret_cast(new BasicBadStruct()); -} - -void BasicBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicBadStruct_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 || BasicBadStruct_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; -} - - - -BasicWideStructPubSubType::BasicWideStructPubSubType() -{ - setName("BasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicWideStruct::getMaxCdrSerializedSize()); -#else - BasicWideStruct_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 = BasicWideStruct_max_key_cdr_typesize > 16 ? BasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicWideStructPubSubType::~BasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicWideStruct* 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; - } - 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 BasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicWideStruct* 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 BasicWideStructPubSubType::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* BasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BasicWideStruct()); -} - -void BasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicWideStruct_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 || BasicWideStruct_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; -} - - - -BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() -{ - setName("BadBasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); -#else - BadBasicWideStruct_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 = BadBasicWideStruct_max_key_cdr_typesize > 16 ? BadBasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BadBasicWideStructPubSubType::~BadBasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BadBasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BadBasicWideStruct* 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; - } - 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 BadBasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BadBasicWideStruct* 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 BadBasicWideStructPubSubType::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* BadBasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BadBasicWideStruct()); -} - -void BadBasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BadBasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BadBasicWideStruct_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 || BadBasicWideStruct_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; -} - - - -StringStructPubSubType::StringStructPubSubType() -{ - setName("StringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StringStruct::getMaxCdrSerializedSize()); -#else - StringStruct_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 = StringStruct_max_key_cdr_typesize > 16 ? StringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StringStructPubSubType::~StringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StringStruct* 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; - } - 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 StringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StringStruct* 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 StringStructPubSubType::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* StringStructPubSubType::createData() -{ - return reinterpret_cast(new StringStruct()); -} - -void StringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StringStruct_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 || StringStruct_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; -} - - - -LargeStringStructPubSubType::LargeStringStructPubSubType() -{ - setName("LargeStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeStringStruct::getMaxCdrSerializedSize()); -#else - LargeStringStruct_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 = LargeStringStruct_max_key_cdr_typesize > 16 ? LargeStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeStringStructPubSubType::~LargeStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeStringStruct* 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; - } - 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 LargeStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeStringStruct* 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 LargeStringStructPubSubType::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* LargeStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeStringStruct()); -} - -void LargeStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeStringStruct_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 || LargeStringStruct_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; -} - - - -WStringStructPubSubType::WStringStructPubSubType() -{ - setName("WStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WStringStruct::getMaxCdrSerializedSize()); -#else - WStringStruct_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 = WStringStruct_max_key_cdr_typesize > 16 ? WStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WStringStructPubSubType::~WStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WStringStruct* 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; - } - 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 WStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WStringStruct* 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 WStringStructPubSubType::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* WStringStructPubSubType::createData() -{ - return reinterpret_cast(new WStringStruct()); -} - -void WStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WStringStruct_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 || WStringStruct_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; -} - - - -LargeWStringStructPubSubType::LargeWStringStructPubSubType() -{ - setName("LargeWStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); -#else - LargeWStringStruct_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 = LargeWStringStruct_max_key_cdr_typesize > 16 ? LargeWStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeWStringStructPubSubType::~LargeWStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeWStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeWStringStruct* 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; - } - 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 LargeWStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeWStringStruct* 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 LargeWStringStructPubSubType::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* LargeWStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeWStringStruct()); -} - -void LargeWStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeWStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeWStringStruct_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 || LargeWStringStruct_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; -} - - - -ArrayStructPubSubType::ArrayStructPubSubType() -{ - setName("ArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayStruct_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 = ArrayStruct_max_key_cdr_typesize > 16 ? ArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructPubSubType::~ArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStruct* 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; - } - 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 ArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStruct* 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 ArrayStructPubSubType::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* ArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayStruct()); -} - -void ArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStruct_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 || ArrayStruct_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; -} - - - -ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() -{ - setName("ArrayStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); -#else - ArrayStructEqual_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 = ArrayStructEqual_max_key_cdr_typesize > 16 ? ArrayStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructEqualPubSubType::~ArrayStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStructEqual* 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; - } - 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 ArrayStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStructEqual* 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 ArrayStructEqualPubSubType::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* ArrayStructEqualPubSubType::createData() -{ - return reinterpret_cast(new ArrayStructEqual()); -} - -void ArrayStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStructEqual_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 || ArrayStructEqual_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; -} - - - -ArrayBadStructPubSubType::ArrayBadStructPubSubType() -{ - setName("ArrayBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); -#else - ArrayBadStruct_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 = ArrayBadStruct_max_key_cdr_typesize > 16 ? ArrayBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayBadStructPubSubType::~ArrayBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayBadStruct* 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; - } - 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 ArrayBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayBadStruct* 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 ArrayBadStructPubSubType::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* ArrayBadStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayBadStruct()); -} - -void ArrayBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayBadStruct_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 || ArrayBadStruct_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; -} - - - -ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() -{ - setName("ArrayDimensionsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); -#else - ArrayDimensionsStruct_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 = ArrayDimensionsStruct_max_key_cdr_typesize > 16 ? ArrayDimensionsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayDimensionsStructPubSubType::~ArrayDimensionsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayDimensionsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayDimensionsStruct* 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; - } - 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 ArrayDimensionsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayDimensionsStruct* 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 ArrayDimensionsStructPubSubType::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* ArrayDimensionsStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayDimensionsStruct()); -} - -void ArrayDimensionsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayDimensionsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayDimensionsStruct_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 || ArrayDimensionsStruct_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; -} - - - -ArraySizeStructPubSubType::ArraySizeStructPubSubType() -{ - setName("ArraySizeStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); -#else - ArraySizeStruct_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 = ArraySizeStruct_max_key_cdr_typesize > 16 ? ArraySizeStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraySizeStructPubSubType::~ArraySizeStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraySizeStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraySizeStruct* 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; - } - 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 ArraySizeStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraySizeStruct* 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 ArraySizeStructPubSubType::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* ArraySizeStructPubSubType::createData() -{ - return reinterpret_cast(new ArraySizeStruct()); -} - -void ArraySizeStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraySizeStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraySizeStruct_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 || ArraySizeStruct_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; -} - - - - - -SequenceStructPubSubType::SequenceStructPubSubType() -{ - setName("SequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceStruct_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 = SequenceStruct_max_key_cdr_typesize > 16 ? SequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructPubSubType::~SequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStruct* 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; - } - 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 SequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStruct* 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 SequenceStructPubSubType::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* SequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceStruct()); -} - -void SequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStruct_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 || SequenceStruct_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; -} - - - - - -SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() -{ - setName("SequenceStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); -#else - SequenceStructEqual_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 = SequenceStructEqual_max_key_cdr_typesize > 16 ? SequenceStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructEqualPubSubType::~SequenceStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStructEqual* 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; - } - 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 SequenceStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStructEqual* 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 SequenceStructEqualPubSubType::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* SequenceStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SequenceStructEqual()); -} - -void SequenceStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStructEqual_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 || SequenceStructEqual_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; -} - - - - - -SequenceBadStructPubSubType::SequenceBadStructPubSubType() -{ - setName("SequenceBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); -#else - SequenceBadStruct_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 = SequenceBadStruct_max_key_cdr_typesize > 16 ? SequenceBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBadStructPubSubType::~SequenceBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBadStruct* 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; - } - 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 SequenceBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBadStruct* 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 SequenceBadStructPubSubType::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* SequenceBadStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBadStruct()); -} - -void SequenceBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBadStruct_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 || SequenceBadStruct_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; -} - - - - - -SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() -{ - setName("SequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceBoundsStruct_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 = SequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBoundsStructPubSubType::~SequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBoundsStruct* 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; - } - 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 SequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBoundsStruct* 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 SequenceBoundsStructPubSubType::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* SequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBoundsStruct()); -} - -void SequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBoundsStruct_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 || SequenceBoundsStruct_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; -} - - - - - - - -SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() -{ - setName("SequenceSequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceStruct_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 = SequenceSequenceStruct_max_key_cdr_typesize > 16 ? SequenceSequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceStructPubSubType::~SequenceSequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceStruct* 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; - } - 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 SequenceSequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceStruct* 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 SequenceSequenceStructPubSubType::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* SequenceSequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceStruct()); -} - -void SequenceSequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceStruct_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 || SequenceSequenceStruct_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; -} - - - - - - - -SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() -{ - setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceBoundsStruct_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 = SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceSequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceBoundsStructPubSubType::~SequenceSequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceBoundsStruct* 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; - } - 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 SequenceSequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceBoundsStruct* 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 SequenceSequenceBoundsStructPubSubType::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* SequenceSequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceBoundsStruct()); -} - -void SequenceSequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceBoundsStruct_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 || SequenceSequenceBoundsStruct_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; -} - - - - - -MapStructPubSubType::MapStructPubSubType() -{ - setName("MapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStruct::getMaxCdrSerializedSize()); -#else - MapStruct_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 = MapStruct_max_key_cdr_typesize > 16 ? MapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructPubSubType::~MapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStruct* 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; - } - 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 MapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStruct* 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 MapStructPubSubType::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* MapStructPubSubType::createData() -{ - return reinterpret_cast(new MapStruct()); -} - -void MapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStruct_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 || MapStruct_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; -} - - - - - -MapStructEqualPubSubType::MapStructEqualPubSubType() -{ - setName("MapStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStructEqual::getMaxCdrSerializedSize()); -#else - MapStructEqual_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 = MapStructEqual_max_key_cdr_typesize > 16 ? MapStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructEqualPubSubType::~MapStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStructEqual* 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; - } - 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 MapStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStructEqual* 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 MapStructEqualPubSubType::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* MapStructEqualPubSubType::createData() -{ - return reinterpret_cast(new MapStructEqual()); -} - -void MapStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStructEqual_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 || MapStructEqual_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; -} - - - - - -MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() -{ - setName("MapBadKeyStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); -#else - MapBadKeyStruct_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 = MapBadKeyStruct_max_key_cdr_typesize > 16 ? MapBadKeyStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadKeyStructPubSubType::~MapBadKeyStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadKeyStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadKeyStruct* 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; - } - 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 MapBadKeyStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadKeyStruct* 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 MapBadKeyStructPubSubType::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* MapBadKeyStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadKeyStruct()); -} - -void MapBadKeyStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadKeyStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadKeyStruct_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 || MapBadKeyStruct_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; -} - - - - - -MapBadElemStructPubSubType::MapBadElemStructPubSubType() -{ - setName("MapBadElemStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); -#else - MapBadElemStruct_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 = MapBadElemStruct_max_key_cdr_typesize > 16 ? MapBadElemStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadElemStructPubSubType::~MapBadElemStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadElemStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadElemStruct* 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; - } - 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 MapBadElemStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadElemStruct* 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 MapBadElemStructPubSubType::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* MapBadElemStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadElemStruct()); -} - -void MapBadElemStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadElemStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadElemStruct_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 || MapBadElemStruct_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; -} - - - - - -MapBoundsStructPubSubType::MapBoundsStructPubSubType() -{ - setName("MapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapBoundsStruct_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 = MapBoundsStruct_max_key_cdr_typesize > 16 ? MapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBoundsStructPubSubType::~MapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBoundsStruct* 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; - } - 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 MapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBoundsStruct* 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 MapBoundsStructPubSubType::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* MapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapBoundsStruct()); -} - -void MapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBoundsStruct_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 || MapBoundsStruct_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; -} - - - - - - - -MapMapStructPubSubType::MapMapStructPubSubType() -{ - setName("MapMapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapStruct::getMaxCdrSerializedSize()); -#else - MapMapStruct_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 = MapMapStruct_max_key_cdr_typesize > 16 ? MapMapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapStructPubSubType::~MapMapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapStruct* 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; - } - 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 MapMapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapStruct* 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 MapMapStructPubSubType::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* MapMapStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapStruct()); -} - -void MapMapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapStruct_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 || MapMapStruct_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; -} - - - - - - - -MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() -{ - setName("MapMapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapMapBoundsStruct_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 = MapMapBoundsStruct_max_key_cdr_typesize > 16 ? MapMapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapBoundsStructPubSubType::~MapMapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapBoundsStruct* 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; - } - 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 MapMapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapBoundsStruct* 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 MapMapBoundsStructPubSubType::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* MapMapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapBoundsStruct()); -} - -void MapMapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapBoundsStruct_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 || MapMapBoundsStruct_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; -} - - - - - - - - - - - - - - - - - - - - - - - -SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() -{ - setName("SimpleUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionStruct_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 = SimpleUnionStruct_max_key_cdr_typesize > 16 ? SimpleUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructPubSubType::~SimpleUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStruct* 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; - } - 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 SimpleUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStruct* 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 SimpleUnionStructPubSubType::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* SimpleUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStruct()); -} - -void SimpleUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStruct_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 || SimpleUnionStruct_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; -} - - - -SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() -{ - setName("SimpleUnionStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); -#else - SimpleUnionStructEqual_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 = SimpleUnionStructEqual_max_key_cdr_typesize > 16 ? SimpleUnionStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructEqualPubSubType::~SimpleUnionStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStructEqual* 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; - } - 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 SimpleUnionStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStructEqual* 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 SimpleUnionStructEqualPubSubType::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* SimpleUnionStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStructEqual()); -} - -void SimpleUnionStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStructEqual_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 || SimpleUnionStructEqual_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; -} - - - -SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() -{ - setName("SimpleUnionNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionNamesStruct_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 = SimpleUnionNamesStruct_max_key_cdr_typesize > 16 ? SimpleUnionNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionNamesStructPubSubType::~SimpleUnionNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionNamesStruct* 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; - } - 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 SimpleUnionNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionNamesStruct* 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 SimpleUnionNamesStructPubSubType::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* SimpleUnionNamesStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionNamesStruct()); -} - -void SimpleUnionNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionNamesStruct_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 || SimpleUnionNamesStruct_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; -} - - - -SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() -{ - setName("SimpleTypeUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleTypeUnionStruct_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 = SimpleTypeUnionStruct_max_key_cdr_typesize > 16 ? SimpleTypeUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleTypeUnionStructPubSubType::~SimpleTypeUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleTypeUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleTypeUnionStruct* 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; - } - 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 SimpleTypeUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleTypeUnionStruct* 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 SimpleTypeUnionStructPubSubType::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* SimpleTypeUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleTypeUnionStruct()); -} - -void SimpleTypeUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleTypeUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleTypeUnionStruct_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 || SimpleTypeUnionStruct_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; -} - - - -SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() -{ - setName("SimpleBadUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleBadUnionStruct_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 = SimpleBadUnionStruct_max_key_cdr_typesize > 16 ? SimpleBadUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleBadUnionStructPubSubType::~SimpleBadUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleBadUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleBadUnionStruct* 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; - } - 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 SimpleBadUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleBadUnionStruct* 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 SimpleBadUnionStructPubSubType::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* SimpleBadUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleBadUnionStruct()); -} - -void SimpleBadUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleBadUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleBadUnionStruct_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 || SimpleBadUnionStruct_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; -} - - - -SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() -{ - setName("SimplBadDiscUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); -#else - SimplBadDiscUnionStruct_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 = SimplBadDiscUnionStruct_max_key_cdr_typesize > 16 ? SimplBadDiscUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimplBadDiscUnionStructPubSubType::~SimplBadDiscUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimplBadDiscUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimplBadDiscUnionStruct* 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; - } - 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 SimplBadDiscUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimplBadDiscUnionStruct* 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 SimplBadDiscUnionStructPubSubType::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* SimplBadDiscUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimplBadDiscUnionStruct()); -} - -void SimplBadDiscUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimplBadDiscUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimplBadDiscUnionStruct_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 || SimplBadDiscUnionStruct_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; -} - diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.h b/test/unittest/xtypes/idl/TypesPubSubTypes.h deleted file mode 100644 index 6a934f82843..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.h +++ /dev/null @@ -1,3337 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Types.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumStruct type; - - eProsima_user_DllExport MyEnumStructPubSubType(); - - eProsima_user_DllExport ~MyEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyBadEnumStruct type; - - eProsima_user_DllExport MyBadEnumStructPubSubType(); - - eProsima_user_DllExport ~MyBadEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyAliasEnumStruct type; - - eProsima_user_DllExport MyAliasEnumStructPubSubType(); - - eProsima_user_DllExport ~MyAliasEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicStruct type; - - eProsima_user_DllExport BasicStructPubSubType(); - - eProsima_user_DllExport ~BasicStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicNamesStruct type; - - eProsima_user_DllExport BasicNamesStructPubSubType(); - - eProsima_user_DllExport ~BasicNamesStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicBadStruct type; - - eProsima_user_DllExport BasicBadStructPubSubType(); - - eProsima_user_DllExport ~BasicBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicWideStruct type; - - eProsima_user_DllExport BasicWideStructPubSubType(); - - eProsima_user_DllExport ~BasicWideStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BadBasicWideStruct type; - - eProsima_user_DllExport BadBasicWideStructPubSubType(); - - eProsima_user_DllExport ~BadBasicWideStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StringStruct type; - - eProsima_user_DllExport StringStructPubSubType(); - - eProsima_user_DllExport ~StringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeStringStruct type; - - eProsima_user_DllExport LargeStringStructPubSubType(); - - eProsima_user_DllExport ~LargeStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WStringStruct type; - - eProsima_user_DllExport WStringStructPubSubType(); - - eProsima_user_DllExport ~WStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeWStringStruct type; - - eProsima_user_DllExport LargeWStringStructPubSubType(); - - eProsima_user_DllExport ~LargeWStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStruct type; - - eProsima_user_DllExport ArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStructEqual type; - - eProsima_user_DllExport ArrayStructEqualPubSubType(); - - eProsima_user_DllExport ~ArrayStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayBadStruct type; - - eProsima_user_DllExport ArrayBadStructPubSubType(); - - eProsima_user_DllExport ~ArrayBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayDimensionsStruct type; - - eProsima_user_DllExport ArrayDimensionsStructPubSubType(); - - eProsima_user_DllExport ~ArrayDimensionsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraySizeStruct type; - - eProsima_user_DllExport ArraySizeStructPubSubType(); - - eProsima_user_DllExport ~ArraySizeStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStruct type; - - eProsima_user_DllExport SequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStructEqual type; - - eProsima_user_DllExport SequenceStructEqualPubSubType(); - - eProsima_user_DllExport ~SequenceStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBadStruct type; - - eProsima_user_DllExport SequenceBadStructPubSubType(); - - eProsima_user_DllExport ~SequenceBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBoundsStruct type; - - eProsima_user_DllExport SequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceStruct type; - - eProsima_user_DllExport SequenceSequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceBoundsStruct type; - - eProsima_user_DllExport SequenceSequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStruct type; - - eProsima_user_DllExport MapStructPubSubType(); - - eProsima_user_DllExport ~MapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStructEqual type; - - eProsima_user_DllExport MapStructEqualPubSubType(); - - eProsima_user_DllExport ~MapStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadKeyStruct type; - - eProsima_user_DllExport MapBadKeyStructPubSubType(); - - eProsima_user_DllExport ~MapBadKeyStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadElemStruct type; - - eProsima_user_DllExport MapBadElemStructPubSubType(); - - eProsima_user_DllExport ~MapBadElemStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBoundsStruct type; - - eProsima_user_DllExport MapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapStruct type; - - eProsima_user_DllExport MapMapStructPubSubType(); - - eProsima_user_DllExport ~MapMapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapBoundsStruct type; - - eProsima_user_DllExport MapMapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapMapBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStruct type; - - eProsima_user_DllExport SimpleUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStructEqual type; - - eProsima_user_DllExport SimpleUnionStructEqualPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionNamesStruct type; - - eProsima_user_DllExport SimpleUnionNamesStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionNamesStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleTypeUnionStruct type; - - eProsima_user_DllExport SimpleTypeUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleTypeUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleBadUnionStruct type; - - eProsima_user_DllExport SimpleBadUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleBadUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimplBadDiscUnionStruct type; - - eProsima_user_DllExport SimplBadDiscUnionStructPubSubType(); - - eProsima_user_DllExport ~SimplBadDiscUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/TypesTypeObject.cxx b/test/unittest/xtypes/idl/TypesTypeObject.cxx deleted file mode 100644 index bcefed47249..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObject.cxx +++ /dev/null @@ -1,8988 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Types.h" -#include "TypesTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTypesTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(true), - GetMyBadEnumObject(true)); - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(false), - GetMyBadEnumObject(false)); - - - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(true), - GetMyEnumStructObject(true)); - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(false), - GetMyEnumStructObject(false)); - - - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(true), - GetMyBadEnumStructObject(true)); - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(false), - GetMyBadEnumStructObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(true), - GetMyAliasEnumStructObject(true)); - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(false), - GetMyAliasEnumStructObject(false)); - - - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(true), - GetBasicStructObject(true)); - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(false), - GetBasicStructObject(false)); - - - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(true), - GetBasicNamesStructObject(true)); - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(false), - GetBasicNamesStructObject(false)); - - - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(true), - GetBasicBadStructObject(true)); - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(false), - GetBasicBadStructObject(false)); - - - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(true), - GetBasicWideStructObject(true)); - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(false), - GetBasicWideStructObject(false)); - - - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(true), - GetBadBasicWideStructObject(true)); - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(false), - GetBadBasicWideStructObject(false)); - - - factory->add_type_object("StringStruct", GetStringStructIdentifier(true), - GetStringStructObject(true)); - factory->add_type_object("StringStruct", GetStringStructIdentifier(false), - GetStringStructObject(false)); - - - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(true), - GetLargeStringStructObject(true)); - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(false), - GetLargeStringStructObject(false)); - - - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(true), - GetWStringStructObject(true)); - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(false), - GetWStringStructObject(false)); - - - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(true), - GetLargeWStringStructObject(true)); - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(false), - GetLargeWStringStructObject(false)); - - - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(true), - GetArrayStructObject(true)); - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(false), - GetArrayStructObject(false)); - - - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(true), - GetArrayStructEqualObject(true)); - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(false), - GetArrayStructEqualObject(false)); - - - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(true), - GetArrayBadStructObject(true)); - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(false), - GetArrayBadStructObject(false)); - - - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(true), - GetArrayDimensionsStructObject(true)); - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(false), - GetArrayDimensionsStructObject(false)); - - - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(true), - GetArraySizeStructObject(true)); - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(false), - GetArraySizeStructObject(false)); - - - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(true), - GetSequenceStructObject(true)); - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(false), - GetSequenceStructObject(false)); - - - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(true), - GetSequenceStructEqualObject(true)); - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(false), - GetSequenceStructEqualObject(false)); - - - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(true), - GetSequenceBadStructObject(true)); - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(false), - GetSequenceBadStructObject(false)); - - - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(true), - GetSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(false), - GetSequenceBoundsStructObject(false)); - - - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(true), - GetSequenceSequenceStructObject(true)); - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(false), - GetSequenceSequenceStructObject(false)); - - - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(true), - GetSequenceSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(false), - GetSequenceSequenceBoundsStructObject(false)); - - - factory->add_type_object("MapStruct", GetMapStructIdentifier(true), - GetMapStructObject(true)); - factory->add_type_object("MapStruct", GetMapStructIdentifier(false), - GetMapStructObject(false)); - - - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(true), - GetMapStructEqualObject(true)); - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(false), - GetMapStructEqualObject(false)); - - - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(true), - GetMapBadKeyStructObject(true)); - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(false), - GetMapBadKeyStructObject(false)); - - - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(true), - GetMapBadElemStructObject(true)); - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(false), - GetMapBadElemStructObject(false)); - - - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(true), - GetMapBoundsStructObject(true)); - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(false), - GetMapBoundsStructObject(false)); - - - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(true), - GetMapMapStructObject(true)); - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(false), - GetMapMapStructObject(false)); - - - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(true), - GetMapMapBoundsStructObject(true)); - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(false), - GetMapMapBoundsStructObject(false)); - - - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(true), - GetSimpleUnionObject(true)); - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(false), - GetSimpleUnionObject(false)); - - - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(true), - GetSimpleUnionNamesObject(true)); - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(false), - GetSimpleUnionNamesObject(false)); - - - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(true), - GetSimpleTypeUnionObject(true)); - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(false), - GetSimpleTypeUnionObject(false)); - - - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(true), - GetSimpleBadUnionObject(true)); - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(false), - GetSimpleBadUnionObject(false)); - - - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(true), - GetSimpleBadDiscUnionObject(true)); - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(false), - GetSimpleBadDiscUnionObject(false)); - - - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(true), - GetSimpleUnionStructObject(true)); - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(false), - GetSimpleUnionStructObject(false)); - - - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(true), - GetSimpleUnionStructEqualObject(true)); - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(false), - GetSimpleUnionStructEqualObject(false)); - - - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(true), - GetSimpleUnionNamesStructObject(true)); - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(false), - GetSimpleUnionNamesStructObject(false)); - - - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(true), - GetSimpleTypeUnionStructObject(true)); - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(false), - GetSimpleTypeUnionStructObject(false)); - - - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(true), - GetSimpleBadUnionStructObject(true)); - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(false), - GetSimpleBadUnionStructObject(false)); - - - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(true), - GetSimplBadDiscUnionStructObject(true)); - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(false), - GetSimplBadDiscUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyBadEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); -} - -const TypeObject* GetMyBadEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumObject(); - } - // else - return GetMinimalMyBadEnumObject(); -} - -const TypeObject* GetMinimalMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A1; - mel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A1.common().flags().IS_KEY(false); // Doesn't apply - mel_A1.common().flags().IS_DEFAULT(false); - mel_A1.common().value(value++); - MD5 A1_hash("A1"); - for(int i = 0; i < 4; ++i) - { - mel_A1.detail().name_hash()[i] = A1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A1); - - MinimalEnumeratedLiteral mel_B1; - mel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B1.common().flags().IS_KEY(false); // Doesn't apply - mel_B1.common().flags().IS_DEFAULT(false); - mel_B1.common().value(value++); - MD5 B1_hash("B1"); - for(int i = 0; i < 4; ++i) - { - mel_B1.detail().name_hash()[i] = B1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B1); - - MinimalEnumeratedLiteral mel_C1; - mel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C1.common().flags().IS_KEY(false); // Doesn't apply - mel_C1.common().flags().IS_DEFAULT(false); - mel_C1.common().value(value++); - MD5 C1_hash("C1"); - for(int i = 0; i < 4; ++i) - { - mel_C1.detail().name_hash()[i] = C1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); -} - -const TypeObject* GetCompleteMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyBadEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A1; - cel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A1.common().flags().IS_KEY(false); // Doesn't apply - cel_A1.common().flags().IS_DEFAULT(false); - cel_A1.common().value(value++); - cel_A1.detail().name("A1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A1); - - CompleteEnumeratedLiteral cel_B1; - cel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B1.common().flags().IS_KEY(false); // Doesn't apply - cel_B1.common().flags().IS_DEFAULT(false); - cel_B1.common().value(value++); - cel_B1.detail().name("B1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B1); - - CompleteEnumeratedLiteral cel_C1; - cel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C1.common().flags().IS_KEY(false); // Doesn't apply - cel_C1.common().flags().IS_DEFAULT(false); - cel_C1.common().value(value++); - cel_C1.detail().name("C1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); -} - - - -const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); -} - -const TypeObject* GetMyEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumStructObject(); - } - //else - return GetMinimalMyEnumStructObject(); -} - -const TypeObject* GetMinimalMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); -} - -const TypeObject* GetCompleteMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); -} - - - -const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); -} - -const TypeObject* GetMyBadEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumStructObject(); - } - //else - return GetMinimalMyBadEnumStructObject(); -} - -const TypeObject* GetMinimalMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); -} - -const TypeObject* GetCompleteMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - - - -const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); -} - -const TypeObject* GetMyAliasEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumStructObject(); - } - //else - return GetMinimalMyAliasEnumStructObject(); -} - -const TypeObject* GetMinimalMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); -} - -const TypeObject* GetCompleteMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); -} - - - -const TypeIdentifier* GetBasicStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); -} - -const TypeObject* GetBasicStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicStructObject(); - } - //else - return GetMinimalBasicStructObject(); -} - -const TypeObject* GetMinimalBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); -} - -const TypeObject* GetCompleteBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); -} - - - -const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); -} - -const TypeObject* GetBasicNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicNamesStructObject(); - } - //else - return GetMinimalBasicNamesStructObject(); -} - -const TypeObject* GetMinimalBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool_name; - mst_my_bool_name.common().member_id(memberId++); - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - mst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool_name.common().member_flags().IS_KEY(false); - mst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_name_hash("my_bool_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool_name.detail().name_hash()[i] = my_bool_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool_name); - - MinimalStructMember mst_my_int32_name; - mst_my_int32_name.common().member_id(memberId++); - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - mst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32_name.common().member_flags().IS_KEY(false); - mst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_name_hash("my_int32_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32_name.detail().name_hash()[i] = my_int32_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32_name); - - MinimalStructMember mst_my_string_name; - mst_my_string_name.common().member_id(memberId++); - mst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string_name.common().member_flags().IS_OPTIONAL(false); - mst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string_name.common().member_flags().IS_KEY(false); - mst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_name_hash("my_string_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_string_name.detail().name_hash()[i] = my_string_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string_name); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); -} - -const TypeObject* GetCompleteBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool_name; - cst_my_bool_name.common().member_id(memberId++); - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - cst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool_name.common().member_flags().IS_KEY(false); - cst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool_name.detail().name("my_bool_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool_name); - - CompleteStructMember cst_my_int32_name; - cst_my_int32_name.common().member_id(memberId++); - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - cst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32_name.common().member_flags().IS_KEY(false); - cst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32_name.detail().name("my_int32_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32_name); - - CompleteStructMember cst_my_string_name; - cst_my_string_name.common().member_id(memberId++); - cst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string_name.common().member_flags().IS_OPTIONAL(false); - cst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string_name.common().member_flags().IS_KEY(false); - cst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string_name.detail().name("my_string_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string_name); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); -} - - - -const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); -} - -const TypeObject* GetBasicBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicBadStructObject(); - } - //else - return GetMinimalBasicBadStructObject(); -} - -const TypeObject* GetMinimalBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); -} - -const TypeObject* GetCompleteBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); -} - - - -const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); -} - -const TypeObject* GetBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicWideStructObject(); - } - //else - return GetMinimalBasicWideStructObject(); -} - -const TypeObject* GetMinimalBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); -} - -const TypeObject* GetCompleteBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); -} - - - -const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBadBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); -} - -const TypeObject* GetBadBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBadBasicWideStructObject(); - } - //else - return GetMinimalBadBasicWideStructObject(); -} - -const TypeObject* GetMinimalBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); -} - -const TypeObject* GetCompleteBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); -} - - - -const TypeIdentifier* GetStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); -} - -const TypeObject* GetStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStringStructObject(); - } - //else - return GetMinimalStringStructObject(); -} - -const TypeObject* GetMinimalStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); -} - -const TypeObject* GetCompleteStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); -} - - - -const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); -} - -const TypeObject* GetLargeStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeStringStructObject(); - } - //else - return GetMinimalLargeStringStructObject(); -} - -const TypeObject* GetMinimalLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_string; - mst_my_large_string.common().member_id(memberId++); - mst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string.common().member_flags().IS_KEY(false); - mst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - MD5 my_large_string_hash("my_large_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string.detail().name_hash()[i] = my_large_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); -} - -const TypeObject* GetCompleteLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_string; - cst_my_large_string.common().member_id(memberId++); - cst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string.common().member_flags().IS_KEY(false); - cst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - cst_my_large_string.detail().name("my_large_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); -} - - - -const TypeIdentifier* GetWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); -} - -const TypeObject* GetWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWStringStructObject(); - } - //else - return GetMinimalWStringStructObject(); -} - -const TypeObject* GetMinimalWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wstring; - mst_my_wstring.common().member_id(memberId++); - mst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wstring.common().member_flags().IS_KEY(false); - mst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - MD5 my_wstring_hash("my_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_wstring.detail().name_hash()[i] = my_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); -} - -const TypeObject* GetCompleteWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wstring; - cst_my_wstring.common().member_id(memberId++); - cst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wstring.common().member_flags().IS_KEY(false); - cst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - cst_my_wstring.detail().name("my_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); -} - - - -const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); -} - -const TypeObject* GetLargeWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeWStringStructObject(); - } - //else - return GetMinimalLargeWStringStructObject(); -} - -const TypeObject* GetMinimalLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_wstring; - mst_my_large_wstring.common().member_id(memberId++); - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_wstring.common().member_flags().IS_KEY(false); - mst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - MD5 my_large_wstring_hash("my_large_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_wstring.detail().name_hash()[i] = my_large_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); -} - -const TypeObject* GetCompleteLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_wstring; - cst_my_large_wstring.common().member_id(memberId++); - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_wstring.common().member_flags().IS_KEY(false); - cst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - cst_my_large_wstring.detail().name("my_large_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); -} - - - -const TypeIdentifier* GetArrayStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); -} - -const TypeObject* GetArrayStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructObject(); - } - //else - return GetMinimalArrayStructObject(); -} - -const TypeObject* GetMinimalArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); -} - -const TypeObject* GetCompleteArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); -} - - - -const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); -} - -const TypeObject* GetArrayStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructEqualObject(); - } - //else - return GetMinimalArrayStructEqualObject(); -} - -const TypeObject* GetMinimalArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array_equal; - mst_my_array_equal.common().member_id(memberId++); - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_equal.common().member_flags().IS_KEY(false); - mst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_equal_hash("my_array_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_equal.detail().name_hash()[i] = my_array_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); -} - -const TypeObject* GetCompleteArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array_equal; - cst_my_array_equal.common().member_id(memberId++); - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_equal.common().member_flags().IS_KEY(false); - cst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array_equal.detail().name("my_array_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); -} - - - -const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); -} - -const TypeObject* GetArrayBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayBadStructObject(); - } - //else - return GetMinimalArrayBadStructObject(); -} - -const TypeObject* GetMinimalArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); -} - -const TypeObject* GetCompleteArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); -} - - - -const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayDimensionsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); -} - -const TypeObject* GetArrayDimensionsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayDimensionsStructObject(); - } - //else - return GetMinimalArrayDimensionsStructObject(); -} - -const TypeObject* GetMinimalArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); -} - -const TypeObject* GetCompleteArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); -} - - - -const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArraySizeStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); -} - -const TypeObject* GetArraySizeStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArraySizeStructObject(); - } - //else - return GetMinimalArraySizeStructObject(); -} - -const TypeObject* GetMinimalArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); -} - -const TypeObject* GetCompleteArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); -} - -const TypeObject* GetSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructObject(); - } - //else - return GetMinimalSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); -} - -const TypeObject* GetSequenceStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructEqualObject(); - } - //else - return GetMinimalSequenceStructEqualObject(); -} - -const TypeObject* GetMinimalSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_equal; - mst_my_sequence_equal.common().member_id(memberId++); - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_equal.common().member_flags().IS_KEY(false); - mst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_equal_hash("my_sequence_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_equal.detail().name_hash()[i] = my_sequence_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); -} - -const TypeObject* GetCompleteSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_equal; - cst_my_sequence_equal.common().member_id(memberId++); - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_equal.common().member_flags().IS_KEY(false); - cst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence_equal.detail().name("my_sequence_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); -} - - - - - -const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); -} - -const TypeObject* GetSequenceBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBadStructObject(); - } - //else - return GetMinimalSequenceBadStructObject(); -} - -const TypeObject* GetMinimalSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); -} - -const TypeObject* GetCompleteSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); -} - -const TypeObject* GetSequenceSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceStructObject(); - } - //else - return GetMinimalSequenceSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); -} - -const TypeObject* GetMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructObject(); - } - //else - return GetMinimalMapStructObject(); -} - -const TypeObject* GetMinimalMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); -} - -const TypeObject* GetCompleteMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); -} - -const TypeObject* GetMapStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructEqualObject(); - } - //else - return GetMinimalMapStructEqualObject(); -} - -const TypeObject* GetMinimalMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_equal; - mst_my_map_equal.common().member_id(memberId++); - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_equal.common().member_flags().IS_KEY(false); - mst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_equal_hash("my_map_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_equal.detail().name_hash()[i] = my_map_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); -} - -const TypeObject* GetCompleteMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_equal; - cst_my_map_equal.common().member_id(memberId++); - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_equal.common().member_flags().IS_KEY(false); - cst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map_equal.detail().name("my_map_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); -} - - - - - -const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadKeyStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); -} - -const TypeObject* GetMapBadKeyStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadKeyStructObject(); - } - //else - return GetMinimalMapBadKeyStructObject(); -} - -const TypeObject* GetMinimalMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); -} - -const TypeObject* GetCompleteMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); -} - - - - - -const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadElemStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); -} - -const TypeObject* GetMapBadElemStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadElemStructObject(); - } - //else - return GetMinimalMapBadElemStructObject(); -} - -const TypeObject* GetMinimalMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); -} - -const TypeObject* GetCompleteMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); -} - - - - - -const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); -} - -const TypeObject* GetMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBoundsStructObject(); - } - //else - return GetMinimalMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); -} - -const TypeObject* GetMapMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapStructObject(); - } - //else - return GetMinimalMapMapStructObject(); -} - -const TypeObject* GetMinimalMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); -} - -const TypeObject* GetCompleteMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); -} - -const TypeObject* GetMapMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapBoundsStructObject(); - } - //else - return GetMinimalMapMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); -} - -const TypeObject* GetSimpleUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionObject(); - } - // else - return GetMinimalSimpleUnionObject(); -} - -const TypeObject* GetMinimalSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); -} - -const TypeObject* GetCompleteSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); -} - -const TypeObject* GetSimpleUnionNamesObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesObject(); - } - // else - return GetMinimalSimpleUnionNamesObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first_case; - mst_first_case.common().member_id(memberId++); - mst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first_case.common().member_flags().IS_DEFAULT(false); - mst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first_case.common().label_seq().emplace_back(A); - - MD5 first_case_hash("first_case"); - for(int i = 0; i < 4; ++i) - { - mst_first_case.detail().name_hash()[i] = first_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first_case); - - MinimalUnionMember mst_second_case; - mst_second_case.common().member_id(memberId++); - mst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second_case.common().member_flags().IS_DEFAULT(false); - mst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second_case.common().label_seq().emplace_back(B); - - MD5 second_case_hash("second_case"); - for(int i = 0; i < 4; ++i) - { - mst_second_case.detail().name_hash()[i] = second_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second_case); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first_case; - cst_first_case.common().member_id(memberId++); - cst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first_case.common().member_flags().IS_DEFAULT(false); - cst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first_case.common().label_seq().emplace_back(A); - - - cst_first_case.detail().name("first_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first_case); - - CompleteUnionMember cst_second_case; - cst_second_case.common().member_id(memberId++); - cst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second_case.common().member_flags().IS_DEFAULT(false); - cst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second_case.common().label_seq().emplace_back(B); - - - cst_second_case.detail().name("second_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second_case); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnionNames"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); -} - -const TypeObject* GetSimpleTypeUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionObject(); - } - // else - return GetMinimalSimpleTypeUnionObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleTypeUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); -} - -const TypeObject* GetSimpleBadUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionObject(); - } - // else - return GetMinimalSimpleBadUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(C); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); -} - -const TypeObject* GetCompleteSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(C); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadDiscUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); -} - -const TypeObject* GetSimpleBadDiscUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadDiscUnionObject(); - } - // else - return GetMinimalSimpleBadDiscUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(0); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(1); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); -} - -const TypeObject* GetCompleteSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(0); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(1); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadDiscUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); -} - -const TypeObject* GetSimpleUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructObject(); - } - //else - return GetMinimalSimpleUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); -} - -const TypeObject* GetSimpleUnionStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructEqualObject(); - } - //else - return GetMinimalSimpleUnionStructEqualObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union_equal; - mst_my_union_equal.common().member_id(memberId++); - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union_equal.common().member_flags().IS_KEY(false); - mst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_equal_hash("my_union_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_union_equal.detail().name_hash()[i] = my_union_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); -} - -const TypeObject* GetCompleteSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union_equal; - cst_my_union_equal.common().member_id(memberId++); - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union_equal.common().member_flags().IS_KEY(false); - cst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union_equal.detail().name("my_union_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); -} - -const TypeObject* GetSimpleUnionNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesStructObject(); - } - //else - return GetMinimalSimpleUnionNamesStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); -} - -const TypeObject* GetSimpleTypeUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionStructObject(); - } - //else - return GetMinimalSimpleTypeUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); -} - -const TypeObject* GetSimpleBadUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionStructObject(); - } - //else - return GetMinimalSimpleBadUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); -} - - - -const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimplBadDiscUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); -} - -const TypeObject* GetSimplBadDiscUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimplBadDiscUnionStructObject(); - } - //else - return GetMinimalSimplBadDiscUnionStructObject(); -} - -const TypeObject* GetMinimalSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); -} - -const TypeObject* GetCompleteSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); -} diff --git a/test/unittest/xtypes/idl/TypesTypeObject.h b/test/unittest/xtypes/idl/TypesTypeObject.h deleted file mode 100644 index 2f615b62792..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObject.h +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Types_SOURCE) -#define Types_DllAPI __declspec( dllexport ) -#else -#define Types_DllAPI __declspec( dllimport ) -#endif // Types_SOURCE -#else -#define Types_DllAPI -#endif -#else -#define Types_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTypesTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimplBadDiscUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/xtypes/idl/Typesv1.cxx b/test/unittest/xtypes/idl/Typesv1.cxx deleted file mode 100644 index 54b0d494ecc..00000000000 --- a/test/unittest/xtypes/idl/Typesv1.cxx +++ /dev/null @@ -1,8202 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define SimpleUnionStruct_max_cdr_typesize 24ULL; -#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; - -#define MyAliasEnumStruct_max_cdr_typesize 8ULL; -#define ArrayBadStruct_max_cdr_typesize 6ULL; -#define MapBadKeyStruct_max_cdr_typesize 24ULL; -#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; -#define MyEnumStruct_max_cdr_typesize 8ULL; - -#define ArrayStructEqual_max_cdr_typesize 12ULL; -#define LargeWStringStruct_max_cdr_typesize 167708ULL; - -#define WStringStruct_max_cdr_typesize 1028ULL; -#define SequenceStruct_max_cdr_typesize 16ULL; -#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; - -#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; -#define SequenceSequenceStruct_max_cdr_typesize 48ULL; -#define MapBoundsStruct_max_cdr_typesize 40ULL; -#define SequenceStructEqual_max_cdr_typesize 16ULL; -#define MapStructEqual_max_cdr_typesize 24ULL; -#define BasicStruct_max_cdr_typesize 272ULL; -#define SequenceBoundsStruct_max_cdr_typesize 24ULL; -#define MapMapStruct_max_cdr_typesize 60ULL; -#define BasicWideStruct_max_cdr_typesize 536ULL; - -#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; -#define MapStruct_max_cdr_typesize 24ULL; - -#define MyBadEnumStruct_max_cdr_typesize 8ULL; -#define SequenceBadStruct_max_cdr_typesize 10ULL; -#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; -#define LargeStringStruct_max_cdr_typesize 41934ULL; -#define ArrayStruct_max_cdr_typesize 12ULL; -#define BadBasicWideStruct_max_cdr_typesize 536ULL; -#define ArraySizeStruct_max_cdr_typesize 24ULL; - -#define MapBadElemStruct_max_cdr_typesize 40ULL; -#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; -#define BasicBadStruct_max_cdr_typesize 272ULL; -#define BasicNamesStruct_max_cdr_typesize 272ULL; -#define StringStruct_max_cdr_typesize 264ULL; - -#define MapMapBoundsStruct_max_cdr_typesize 108ULL; - - - - -MyEnumStruct::MyEnumStruct() -{ - // MyEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumStruct_max_cdr_typesize; -} - -size_t MyEnumStruct::getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - -} - - -bool MyEnumStruct::isKeyDefined() -{ - return false; -} - -void MyEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // MyBadEnum m_my_enum - m_my_enum = ::A1; - - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyBadEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyBadEnumStruct_max_cdr_typesize; -} - -size_t MyBadEnumStruct::getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyBadEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyBadEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyBadEnum)enum_value; - } - - -} - - -bool MyBadEnumStruct::isKeyDefined() -{ - return false; -} - -void MyBadEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // MyAliasEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyAliasEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyAliasEnumStruct_max_cdr_typesize; -} - -size_t MyAliasEnumStruct::getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyAliasEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyAliasEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyAliasEnum)enum_value; - } - - -} - - -bool MyAliasEnumStruct::isKeyDefined() -{ - return false; -} - -void MyAliasEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -BasicStruct::BasicStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -size_t BasicStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicStruct_max_cdr_typesize; -} - -size_t BasicStruct::getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicStruct::isKeyDefined() -{ - return false; -} - -void BasicStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // boolean m_my_bool_name - m_my_bool_name = false; - // long m_my_int32_name - m_my_int32_name = 0; - // /type_d() m_my_string_name - - - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -size_t BasicNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicNamesStruct_max_cdr_typesize; -} - -size_t BasicNamesStruct::getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool_name; - - scdr << m_my_int32_name; - - scdr << m_my_string_name.c_str(); - -} - -void BasicNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool_name; - - - - dcdr >> m_my_int32_name; - - - - dcdr >> m_my_string_name; - - -} - - -bool BasicNamesStruct::isKeyDefined() -{ - return false; -} - -void BasicNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - - -BasicBadStruct::BasicBadStruct() -{ - // octet m_my_bool - m_my_bool = 0; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -size_t BasicBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicBadStruct_max_cdr_typesize; -} - -size_t BasicBadStruct::getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicBadStruct::isKeyDefined() -{ - return false; -} - -void BasicBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicWideStruct::BasicWideStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicWideStruct_max_cdr_typesize; -} - -size_t BasicWideStruct::getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - -} - -void BasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - - - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - -} - - -bool BasicWideStruct::isKeyDefined() -{ - return false; -} - -void BasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BadBasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BadBasicWideStruct_max_cdr_typesize; -} - -size_t BadBasicWideStruct::getCdrSerializedSize( - const BadBasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BadBasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BadBasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - - - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BadBasicWideStruct::isKeyDefined() -{ - return false; -} - -void BadBasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - - -StringStruct::StringStruct() -{ - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -size_t StringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringStruct_max_cdr_typesize; -} - -size_t StringStruct::getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_string.c_str(); - -} - -void StringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_string; - - -} - - -bool StringStruct::isKeyDefined() -{ - return false; -} - -void StringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - - -LargeStringStruct::LargeStringStruct() -{ - // /type_d() m_my_large_string - - - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeStringStruct_max_cdr_typesize; -} - -size_t LargeStringStruct::getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void LargeStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_string.c_str(); - -} - -void LargeStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_my_large_string = aux.c_str(); - } - - -} - - -bool LargeStringStruct::isKeyDefined() -{ - return false; -} - -void LargeStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - - -WStringStruct::WStringStruct() -{ - // /type_15() m_my_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -size_t WStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WStringStruct_max_cdr_typesize; -} - -size_t WStringStruct::getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void WStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wstring; - -} - -void WStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wstring; - - -} - - -bool WStringStruct::isKeyDefined() -{ - return false; -} - -void WStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // /type_15() m_my_large_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeWStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeWStringStruct_max_cdr_typesize; -} - -size_t LargeWStringStruct::getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void LargeWStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_wstring; - -} - -void LargeWStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_large_wstring; - - -} - - -bool LargeWStringStruct::isKeyDefined() -{ - return false; -} - -void LargeWStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - - -ArrayStruct::ArrayStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStruct_max_cdr_typesize; -} - -size_t ArrayStruct::getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayStruct::isKeyDefined() -{ - return false; -} - -void ArrayStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // long m_my_array_equal - memset(&m_my_array_equal, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -size_t ArrayStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStructEqual_max_cdr_typesize; -} - -size_t ArrayStructEqual::getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array_equal; - - -} - -void ArrayStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array_equal; - - -} - - -bool ArrayStructEqual::isKeyDefined() -{ - return false; -} - -void ArrayStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // octet m_my_array - memset(&m_my_array, 0, ((2)) * 1); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayBadStruct_max_cdr_typesize; -} - -size_t ArrayBadStruct::getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void ArrayBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayBadStruct::isKeyDefined() -{ - return false; -} - -void ArrayBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2) * (2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayDimensionsStruct_max_cdr_typesize; -} - -size_t ArrayDimensionsStruct::getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayDimensionsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t b = 0; b < m_my_array.size(); ++b) - { - scdr << m_my_array[b]; - - } - - - -} - -void ArrayDimensionsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t d = 0; d < m_my_array.size(); ++d) - { - dcdr >> m_my_array[d]; - - } - - - -} - - -bool ArrayDimensionsStruct::isKeyDefined() -{ - return false; -} - -void ArrayDimensionsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((5)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -size_t ArraySizeStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArraySizeStruct_max_cdr_typesize; -} - -size_t ArraySizeStruct::getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArraySizeStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArraySizeStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArraySizeStruct::isKeyDefined() -{ - return false; -} - -void ArraySizeStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - - -SequenceStruct::SequenceStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStruct_max_cdr_typesize; -} - -size_t SequenceStruct::getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // sequence m_my_sequence_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -size_t SequenceStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStructEqual_max_cdr_typesize; -} - -size_t SequenceStructEqual::getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_equal().size() > 0) - { - current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_equal; - - -} - -void SequenceStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_equal; - - -} - - -bool SequenceStructEqual::isKeyDefined() -{ - return false; -} - -void SequenceStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBadStruct_max_cdr_typesize; -} - -size_t SequenceBadStruct::getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBadStruct::isKeyDefined() -{ - return false; -} - -void SequenceBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceBoundsStruct::getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // sequence, 3> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceStruct_max_cdr_typesize; -} - -size_t SequenceSequenceStruct::getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // sequence, 5> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - -MapStruct::MapStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -size_t MapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStruct_max_cdr_typesize; -} - -size_t MapStruct::getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapStruct::isKeyDefined() -{ - return false; -} - -void MapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapStructEqual::MapStructEqual() -{ - // map m_my_map_equal - - - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -size_t MapStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStructEqual_max_cdr_typesize; -} - -size_t MapStructEqual::getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_equal()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_equal.size()); - for (const auto& pair : m_my_map_equal) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_equal; - - -} - - -bool MapStructEqual::isKeyDefined() -{ - return false; -} - -void MapStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadKeyStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadKeyStruct_max_cdr_typesize; -} - -size_t MapBadKeyStruct::getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadKeyStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadKeyStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadKeyStruct::isKeyDefined() -{ - return false; -} - -void MapBadKeyStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadElemStruct_max_cdr_typesize; -} - -size_t MapBadElemStruct::getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadElemStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadElemStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadElemStruct::isKeyDefined() -{ - return false; -} - -void MapBadElemStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBoundsStruct_max_cdr_typesize; -} - -size_t MapBoundsStruct::getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapStruct_max_cdr_typesize; -} - -size_t MapMapStruct::getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - } - - - return current_alignment - initial_alignment; -} - - -void MapMapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapStruct::isKeyDefined() -{ - return false; -} - -void MapMapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapBoundsStruct_max_cdr_typesize; -} - -size_t MapMapBoundsStruct::getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - } - - - return current_alignment - initial_alignment; -} - - -void MapMapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapMapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleUnion::getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; - // long m_first_case - m_first_case = 0; - // long long m_second_case - m_second_case = 0; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - -// TODO(Ricardo) Review -size_t SimpleUnionNames::getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNames::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first_case; - - break; - - - case B: - scdr << m_second_case; - - break; - - default: - break; - } -} - -void SimpleUnionNames::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first_case; - - - break; - - - case B: - dcdr >> m_second_case; - - - break; - - default: - break; - } -} - - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; - // octet m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleTypeUnion::getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleTypeUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch(__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadUnion::getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case C: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case C: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case C: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 0: - switch(__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch(__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadDiscUnion::getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 0: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 1: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadDiscUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 0: - scdr << m_first; - - break; - - - case 1: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadDiscUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 0: - dcdr >> m_first; - - - break; - - - case 1: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // SimpleUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStruct_max_cdr_typesize; -} - -size_t SimpleUnionStruct::getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // SimpleUnion m_my_union_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStructEqual_max_cdr_typesize; -} - -size_t SimpleUnionStructEqual::getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union_equal; - -} - -void SimpleUnionStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union_equal; - - -} - - -bool SimpleUnionStructEqual::isKeyDefined() -{ - return false; -} - -void SimpleUnionStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // SimpleUnionNames m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionNamesStruct_max_cdr_typesize; -} - -size_t SimpleUnionNamesStruct::getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionNamesStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // SimpleTypeUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleTypeUnionStruct_max_cdr_typesize; -} - -size_t SimpleTypeUnionStruct::getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleTypeUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleTypeUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleTypeUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // SimpleBadUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleBadUnionStruct_max_cdr_typesize; -} - -size_t SimpleBadUnionStruct::getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleBadUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleBadUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleBadUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // SimpleBadDiscUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimplBadDiscUnionStruct_max_cdr_typesize; -} - -size_t SimplBadDiscUnionStruct::getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimplBadDiscUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimplBadDiscUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimplBadDiscUnionStruct::isKeyDefined() -{ - return false; -} - -void SimplBadDiscUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/Typesv1.h b/test/unittest/xtypes/idl/Typesv1.h deleted file mode 100644 index d350f662843..00000000000 --- a/test/unittest/xtypes/idl/Typesv1.h +++ /dev/null @@ -1,6496 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyBadEnum m_my_enum; - -}; - -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool_name; - int32_t m_my_int32_name; - std::string m_my_string_name; - -}; - - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - int32_t m_new_int32; - std::string m_new_string; - -}; - - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BadBasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_new_int32; - std::string m_new_string; - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastrtps::fixed_string<41925> m_my_large_string; - -}; - - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_wstring; - -}; - - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_large_wstring; - -}; - - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array_equal; - -}; - - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2> m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence_equal; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map_equal; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first_case; - int64_t m_second_case; -}; - - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - uint8_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - uint8_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union_equal; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnionNames m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleTypeUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadDiscUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnum.cxx b/test/unittest/xtypes/idl/WideEnum.cxx deleted file mode 100644 index 504b70b0b4a..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.cxx +++ /dev/null @@ -1,591 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnum.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "WideEnum.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "WideEnumTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumWideStruct::MyEnumWideStruct() -{ - // Just to register all known types - registerWideEnumTypes(); -} - -MyEnumWideStruct::~MyEnumWideStruct() -{ -} - -MyEnumWideStruct::MyEnumWideStruct( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; -} - -MyEnumWideStruct::MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - const MyEnumWideStruct& x) -{ - - m_my_enum_wide = x.m_my_enum_wide; - return *this; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - MyEnumWideStruct&& x) noexcept -{ - - m_my_enum_wide = x.m_my_enum_wide; - return *this; -} - -bool MyEnumWideStruct::operator ==( - const MyEnumWideStruct& x) const -{ - return (m_my_enum_wide == x.m_my_enum_wide); -} - -bool MyEnumWideStruct::operator !=( - const MyEnumWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ -void MyEnumWideStruct::my_enum_wide( - MyEnumWide _my_enum_wide) -{ - m_my_enum_wide = _my_enum_wide; -} - -/*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ -MyEnumWide MyEnumWideStruct::my_enum_wide() const -{ - return m_my_enum_wide; -} - -/*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ -MyEnumWide& MyEnumWideStruct::my_enum_wide() -{ - return m_my_enum_wide; -} - - - - -SimpleWideUnion::SimpleWideUnion() -{ - m__d = A; -} - -SimpleWideUnion::~SimpleWideUnion() -{ -} - -SimpleWideUnion::SimpleWideUnion( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion::SimpleWideUnion( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion& SimpleWideUnion::operator =( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -SimpleWideUnion& SimpleWideUnion::operator =( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -bool SimpleWideUnion::operator ==( - const SimpleWideUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - - case D: - return (m_third == x.m_third); - break; - - default: - break; - } - return false; -} - -bool SimpleWideUnion::operator !=( - const SimpleWideUnion& x) const -{ - return !(*this == x); -} - -void SimpleWideUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case D: - switch (__d) - { - case D: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleWideUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleWideUnion::_d() -{ - return m__d; -} - -void SimpleWideUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleWideUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleWideUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleWideUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleWideUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleWideUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -void SimpleWideUnion::third( - uint8_t _third) -{ - m_third = _third; - m__d = D; - -} - -uint8_t SimpleWideUnion::third() const -{ - bool b = false; - - switch (m__d) - { - case D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - -uint8_t& SimpleWideUnion::third() -{ - bool b = false; - - switch (m__d) - { - case D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - - - - -SimpleWideUnionStruct::SimpleWideUnionStruct() -{ - // Just to register all known types - registerWideEnumTypes(); -} - -SimpleWideUnionStruct::~SimpleWideUnionStruct() -{ -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - const SimpleWideUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - SimpleWideUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleWideUnionStruct::operator ==( - const SimpleWideUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleWideUnionStruct::operator !=( - const SimpleWideUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleWideUnionStruct::my_union( - const SimpleWideUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleWideUnionStruct::my_union( - SimpleWideUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleWideUnion& SimpleWideUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleWideUnion& SimpleWideUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "WideEnumCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnum.h b/test/unittest/xtypes/idl/WideEnum.h deleted file mode 100644 index 3a731aeb935..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.h +++ /dev/null @@ -1,426 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnum.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "WideEnumv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WIDEENUM_SOURCE) -#define WIDEENUM_DllAPI __declspec( dllexport ) -#else -#define WIDEENUM_DllAPI __declspec( dllimport ) -#endif // WIDEENUM_SOURCE -#else -#define WIDEENUM_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define WIDEENUM_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. - * @ingroup WideEnum - */ -enum MyEnumWide : uint32_t -{ - A, - B, - C, - D -}; - - -/*! - * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - const MyEnumWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - const MyEnumWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ - eProsima_user_DllExport void my_enum_wide( - MyEnumWide _my_enum_wide); - - /*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide my_enum_wide() const; - - /*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide& my_enum_wide(); - -private: - - MyEnumWide m_my_enum_wide{::A}; - -}; - - -/*! - * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - const SimpleWideUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - const SimpleWideUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function sets a value in member third - * @param _third New value for member third - */ - eProsima_user_DllExport void third( - uint8_t _third); - - /*! - * @brief This function returns the value of member third - * @return Value of member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t third() const; - - /*! - * @brief This function returns a reference to member third - * @return Reference to member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& third(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; - uint8_t m_third{0}; -}; - - -/*! - * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleWideUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleWideUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleWideUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleWideUnion& my_union(); - -private: - - SimpleWideUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnum.idl b/test/unittest/xtypes/idl/WideEnum.idl deleted file mode 100644 index b31b2bb7070..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.idl +++ /dev/null @@ -1,30 +0,0 @@ -// Enum - -enum MyEnumWide -{ - A, - B, - C, - D -}; - -struct MyEnumWideStruct -{ - MyEnumWide my_enum_wide; -}; - - -union SimpleWideUnion switch (long) -{ - case A: - long first; - case B: - long long second; - case D: - octet third; -}; - -struct SimpleWideUnionStruct -{ - SimpleWideUnion my_union; -}; \ No newline at end of file diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp b/test/unittest/xtypes/idl/WideEnumCdrAux.hpp deleted file mode 100644 index 34c5600fbef..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ - -#include "WideEnum.h" - -constexpr uint32_t MyEnumWideStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimpleWideUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleWideUnionStruct_max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumWideStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ - diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp b/test/unittest/xtypes/idl/WideEnumCdrAux.ipp deleted file mode 100644 index 380b5cf4c6f..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ - -#include "WideEnumCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyEnumWideStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum_wide(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyEnumWideStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum_wide() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumWideStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum_wide(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleWideUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - case D: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.third(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - case D: - scdr << eprosima::fastcdr::MemberId(3) << data.third(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleWideUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - case D: - dcdr >> data.third(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleWideUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleWideUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ - diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx b/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx deleted file mode 100644 index 3e60c0cd922..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "WideEnumPubSubTypes.h" -#include "WideEnumCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - -MyEnumWideStructPubSubType::MyEnumWideStructPubSubType() -{ - setName("MyEnumWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumWideStruct::getMaxCdrSerializedSize()); -#else - MyEnumWideStruct_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 = MyEnumWideStruct_max_key_cdr_typesize > 16 ? MyEnumWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumWideStructPubSubType::~MyEnumWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumWideStruct* 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; - } - 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 MyEnumWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumWideStruct* 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 MyEnumWideStructPubSubType::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* MyEnumWideStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumWideStruct()); -} - -void MyEnumWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumWideStruct_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 || MyEnumWideStruct_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; -} - - - - - - - -SimpleWideUnionStructPubSubType::SimpleWideUnionStructPubSubType() -{ - setName("SimpleWideUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleWideUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleWideUnionStruct_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 = SimpleWideUnionStruct_max_key_cdr_typesize > 16 ? SimpleWideUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleWideUnionStructPubSubType::~SimpleWideUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleWideUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleWideUnionStruct* 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; - } - 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 SimpleWideUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleWideUnionStruct* 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 SimpleWideUnionStructPubSubType::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* SimpleWideUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleWideUnionStruct()); -} - -void SimpleWideUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleWideUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleWideUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleWideUnionStruct_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 || SimpleWideUnionStruct_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; -} - diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h b/test/unittest/xtypes/idl/WideEnumPubSubTypes.h deleted file mode 100644 index 8119ba12ac2..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "WideEnum.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated WideEnum is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumWideStruct type; - - eProsima_user_DllExport MyEnumWideStructPubSubType(); - - eProsima_user_DllExport ~MyEnumWideStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleWideUnionStruct type; - - eProsima_user_DllExport SimpleWideUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleWideUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx b/test/unittest/xtypes/idl/WideEnumTypeObject.cxx deleted file mode 100644 index 0ae2ba7138b..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx +++ /dev/null @@ -1,957 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "WideEnum.h" -#include "WideEnumTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerWideEnumTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnumWide", GetMyEnumWideIdentifier(true), - GetMyEnumWideObject(true)); - factory->add_type_object("MyEnumWide", GetMyEnumWideIdentifier(false), - GetMyEnumWideObject(false)); - - - factory->add_type_object("MyEnumWideStruct", GetMyEnumWideStructIdentifier(true), - GetMyEnumWideStructObject(true)); - factory->add_type_object("MyEnumWideStruct", GetMyEnumWideStructIdentifier(false), - GetMyEnumWideStructObject(false)); - - - factory->add_type_object("SimpleWideUnion", GetSimpleWideUnionIdentifier(true), - GetSimpleWideUnionObject(true)); - factory->add_type_object("SimpleWideUnion", GetSimpleWideUnionIdentifier(false), - GetSimpleWideUnionObject(false)); - - - factory->add_type_object("SimpleWideUnionStruct", GetSimpleWideUnionStructIdentifier(true), - GetSimpleWideUnionStructObject(true)); - factory->add_type_object("SimpleWideUnionStruct", GetSimpleWideUnionStructIdentifier(false), - GetSimpleWideUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumWideIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWide", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumWideObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWide", complete); -} - -const TypeObject* GetMyEnumWideObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumWideObject(); - } - // else - return GetMinimalMyEnumWideObject(); -} - -const TypeObject* GetMinimalMyEnumWideObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - MinimalEnumeratedLiteral mel_D; - mel_D.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_D.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_D.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_D.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_D.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_D.common().flags().IS_KEY(false); // Doesn't apply - mel_D.common().flags().IS_DEFAULT(false); - mel_D.common().value(value++); - MD5 D_hash("D"); - for(int i = 0; i < 4; ++i) - { - mel_D.detail().name_hash()[i] = D_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_D); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWide", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", false); -} - -const TypeObject* GetCompleteMyEnumWideObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnumWide"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - CompleteEnumeratedLiteral cel_D; - cel_D.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_D.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_D.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_D.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_D.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_D.common().flags().IS_KEY(false); // Doesn't apply - cel_D.common().flags().IS_DEFAULT(false); - cel_D.common().value(value++); - cel_D.detail().name("D"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_D); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWide", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", true); -} - - - -const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWideStruct", complete); -} - -const TypeObject* GetMyEnumWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumWideStructObject(); - } - //else - return GetMinimalMyEnumWideStructObject(); -} - -const TypeObject* GetMinimalMyEnumWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum_wide; - mst_my_enum_wide.common().member_id(memberId++); - mst_my_enum_wide.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum_wide.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum_wide.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum_wide.common().member_flags().IS_OPTIONAL(false); - mst_my_enum_wide.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum_wide.common().member_flags().IS_KEY(false); - mst_my_enum_wide.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum_wide.common().member_type_id(*GetMyEnumWideIdentifier(false)); - - MD5 my_enum_wide_hash("my_enum_wide"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum_wide.detail().name_hash()[i] = my_enum_wide_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum_wide); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", false); -} - -const TypeObject* GetCompleteMyEnumWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum_wide; - cst_my_enum_wide.common().member_id(memberId++); - cst_my_enum_wide.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum_wide.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum_wide.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum_wide.common().member_flags().IS_OPTIONAL(false); - cst_my_enum_wide.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum_wide.common().member_flags().IS_KEY(false); - cst_my_enum_wide.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum_wide.common().member_type_id(*GetMyEnumWideIdentifier(true)); - - cst_my_enum_wide.detail().name("my_enum_wide"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum_wide); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", true); -} - - - -const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleWideUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnion", complete); -} - -const TypeObject* GetSimpleWideUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleWideUnionObject(); - } - // else - return GetMinimalSimpleWideUnionObject(); -} - -const TypeObject* GetMinimalSimpleWideUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - MinimalUnionMember mst_third; - mst_third.common().member_id(memberId++); - mst_third.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_third.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_third.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_third.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_third.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_third.common().member_flags().IS_KEY(false); // Doesn't apply - mst_third.common().member_flags().IS_DEFAULT(false); - mst_third.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_third.common().label_seq().emplace_back(D); - - MD5 third_hash("third"); - for(int i = 0; i < 4; ++i) - { - mst_third.detail().name_hash()[i] = third_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_third); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", false); -} - -const TypeObject* GetCompleteSimpleWideUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - CompleteUnionMember cst_third; - cst_third.common().member_id(memberId++); - cst_third.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_third.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_third.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_third.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_third.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_third.common().member_flags().IS_KEY(false); // Doesn't apply - cst_third.common().member_flags().IS_DEFAULT(false); - cst_third.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_third.common().label_seq().emplace_back(D); - - - cst_third.detail().name("third"); - - type_object->complete().union_type().member_seq().emplace_back(cst_third); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleWideUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", true); -} - - - -const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleWideUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnionStruct", complete); -} - -const TypeObject* GetSimpleWideUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleWideUnionStructObject(); - } - //else - return GetMinimalSimpleWideUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleWideUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleWideUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleWideUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleWideUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleWideUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", true); -} diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.h b/test/unittest/xtypes/idl/WideEnumTypeObject.h deleted file mode 100644 index 34ea60df451..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnumTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WideEnum_SOURCE) -#define WideEnum_DllAPI __declspec( dllexport ) -#else -#define WideEnum_DllAPI __declspec( dllimport ) -#endif // WideEnum_SOURCE -#else -#define WideEnum_DllAPI -#endif -#else -#define WideEnum_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerWideEnumTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumWideIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumWideObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleWideUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleWideUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleWideUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleWideUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/xtypes/idl/WideEnumv1.cxx b/test/unittest/xtypes/idl/WideEnumv1.cxx deleted file mode 100644 index a49be8dfc84..00000000000 --- a/test/unittest/xtypes/idl/WideEnumv1.cxx +++ /dev/null @@ -1,858 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnum.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "WideEnum.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "WideEnumTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define MyEnumWideStruct_max_cdr_typesize 8ULL; - -#define SimpleWideUnionStruct_max_cdr_typesize 24ULL; - - - - - -MyEnumWideStruct::MyEnumWideStruct() -{ - // MyEnumWide m_my_enum_wide - m_my_enum_wide = ::A; - - // Just to register all known types - registerWideEnumTypes(); -} - -MyEnumWideStruct::~MyEnumWideStruct() -{ -} - -MyEnumWideStruct::MyEnumWideStruct( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; - -} - -MyEnumWideStruct::MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; - -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; - - return *this; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; - - return *this; -} - -bool MyEnumWideStruct::operator ==( - const MyEnumWideStruct& x) const -{ - return (m_my_enum_wide == x.m_my_enum_wide); -} - -bool MyEnumWideStruct::operator !=( - const MyEnumWideStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumWideStruct_max_cdr_typesize; -} - -size_t MyEnumWideStruct::getCdrSerializedSize( - const MyEnumWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum_wide; - -} - -void MyEnumWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum_wide = (MyEnumWide)enum_value; - } - - -} - - -bool MyEnumWideStruct::isKeyDefined() -{ - return false; -} - -void MyEnumWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ -void MyEnumWideStruct::my_enum_wide( - MyEnumWide _my_enum_wide) -{ - m_my_enum_wide = _my_enum_wide; -} - -/*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ -MyEnumWide MyEnumWideStruct::my_enum_wide() const -{ - return m_my_enum_wide; -} - -/*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ -MyEnumWide& MyEnumWideStruct::my_enum_wide() -{ - return m_my_enum_wide; -} - - - - - -SimpleWideUnion::SimpleWideUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; - // octet m_third - m_third = 0; -} - -SimpleWideUnion::~SimpleWideUnion() -{ -} - -SimpleWideUnion::SimpleWideUnion( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion::SimpleWideUnion( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion& SimpleWideUnion::operator =( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -SimpleWideUnion& SimpleWideUnion::operator =( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -bool SimpleWideUnion::operator ==( - const SimpleWideUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - - case D: - return (m_third == x.m_third); - break; - - default: - break; - } - return false; -} - -bool SimpleWideUnion::operator !=( - const SimpleWideUnion& x) const -{ - return !(*this == x); -} - -void SimpleWideUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case D: - switch(__d) - { - case D: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleWideUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleWideUnion::_d() -{ - return m__d; -} - -void SimpleWideUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleWideUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleWideUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleWideUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleWideUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleWideUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -void SimpleWideUnion::third( - uint8_t _third) -{ - m_third = _third; - m__d = D; - -} - -uint8_t SimpleWideUnion::third() const -{ - bool b = false; - - switch(m__d) - { - case D: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - -uint8_t& SimpleWideUnion::third() -{ - bool b = false; - - switch(m__d) - { - case D: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - - -// TODO(Ricardo) Review -size_t SimpleWideUnion::getCdrSerializedSize( - const SimpleWideUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - - case D: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleWideUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - - case D: - scdr << m_third; - - break; - - default: - break; - } -} - -void SimpleWideUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - - case D: - dcdr >> m_third; - - - break; - - default: - break; - } -} - - - - - -SimpleWideUnionStruct::SimpleWideUnionStruct() -{ - // SimpleWideUnion m_my_union - - - // Just to register all known types - registerWideEnumTypes(); -} - -SimpleWideUnionStruct::~SimpleWideUnionStruct() -{ -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleWideUnionStruct::operator ==( - const SimpleWideUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleWideUnionStruct::operator !=( - const SimpleWideUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleWideUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleWideUnionStruct_max_cdr_typesize; -} - -size_t SimpleWideUnionStruct::getCdrSerializedSize( - const SimpleWideUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleWideUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleWideUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleWideUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleWideUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleWideUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleWideUnionStruct::my_union( - const SimpleWideUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleWideUnionStruct::my_union( - SimpleWideUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleWideUnion& SimpleWideUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleWideUnion& SimpleWideUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnumv1.h b/test/unittest/xtypes/idl/WideEnumv1.h deleted file mode 100644 index aac7aeb1a72..00000000000 --- a/test/unittest/xtypes/idl/WideEnumv1.h +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file WideEnum.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WIDEENUM_SOURCE) -#define WIDEENUM_DllAPI __declspec( dllexport ) -#else -#define WIDEENUM_DllAPI __declspec( dllimport ) -#endif // WIDEENUM_SOURCE -#else -#define WIDEENUM_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define WIDEENUM_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. - * @ingroup WideEnum - */ -enum MyEnumWide : uint32_t -{ - A, - B, - C, - D -}; - - -/*! - * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - const MyEnumWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - const MyEnumWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ - eProsima_user_DllExport void my_enum_wide( - MyEnumWide _my_enum_wide); - - /*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide my_enum_wide() const; - - /*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide& my_enum_wide(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyEnumWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnumWide m_my_enum_wide; - -}; - - - -/*! - * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - const SimpleWideUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - const SimpleWideUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function sets a value in member third - * @param _third New value for member third - */ - eProsima_user_DllExport void third( - uint8_t _third); - - /*! - * @brief This function returns the value of member third - * @return Value of member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t third() const; - - /*! - * @brief This function returns a reference to member third - * @return Reference to member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& third(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleWideUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; - uint8_t m_third; -}; - - - -/*! - * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleWideUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleWideUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleWideUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleWideUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleWideUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleWideUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_WIDEENUM_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/utils/ScopedLogs.hpp b/test/utils/ScopedLogs.hpp new file mode 100644 index 00000000000..72cd50fbdbc --- /dev/null +++ b/test/utils/ScopedLogs.hpp @@ -0,0 +1,69 @@ +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef _TEST_UTILS_SCOPEDLOGS_HPP_ +#define _TEST_UTILS_SCOPEDLOGS_HPP_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace testing { + +//! RAII to setup Logging +struct ScopeLogs +{ + //! Set a specific category filter + ScopeLogs( + std::string category_filter) + { +#ifdef __cpp_lib_make_unique + filter_ = std::make_unique(dds::Log::GetCategoryFilter()); +#else + filter_ = std::unique_ptr(new std::regex(dds::Log::GetCategoryFilter())); +#endif // ifdef __cpp_lib_make_unique + dds::Log::SetCategoryFilter(std::regex{category_filter}); + } + + //! Set a specified level + ScopeLogs( + dds::Log::Kind new_verbosity = dds::Log::Error) + { + old_ = dds::Log::GetVerbosity(); + dds::Log::SetVerbosity(new_verbosity); + } + + ~ScopeLogs() + { + if (filter_) + { + dds::Log::SetCategoryFilter(*filter_); + } + else + { + dds::Log::SetVerbosity(old_); + } + } + + dds::Log::Kind old_; + std::unique_ptr filter_; +}; + +} // namespace testing +} // namespace fastdds +} // namespace eprosima + +#endif // _TEST_UTILS_SCOPEDLOGS_HPP_ diff --git a/test/xtypes/CMakeLists.txt b/test/xtypes/CMakeLists.txt deleted file mode 100644 index 1719a3fdead..00000000000 --- a/test/xtypes/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -############################################################################### -# Unit tests -############################################################################### -set(XTYPES_TESTS_SOURCE XTypesTests.cpp - idl/Types.cxx - idl/Typesv1.cxx - idl/TypesPubSubTypes.cxx - idl/TypesTypeObject.cxx - TestPublisher.cpp - TestSubscriber.cpp - ) - -add_executable(XTypesBlackBoxTests ${XTYPES_TESTS_SOURCE}) -target_compile_definitions(XTypesBlackBoxTests PRIVATE - EPROSIMA_SHAPES_DLL_EXPORT - BUILD_SHARED_LIBS - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(XTypesBlackBoxTests PRIVATE ${Asio_INCLUDE_DIR}) -target_link_libraries(XTypesBlackBoxTests fastrtps fastcdr GTest::gtest) -gtest_discover_tests(XTypesBlackBoxTests) diff --git a/test/xtypes/TestPublisher.cpp b/test/xtypes/TestPublisher.cpp deleted file mode 100644 index 5076ee6eda4..00000000000 --- a/test/xtypes/TestPublisher.cpp +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -/** - * @file TestPublisher.cpp - * - */ - -#include "TestPublisher.h" - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastdds::dds::xtypes; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TestPublisher::TestPublisher() - : m_iSamples(-1) - , m_sentSamples(0) - , m_iWaitTime(1000) - , m_Data(nullptr) - , m_bInitialized(false) - , using_typelookup_(false) - , tls_callback_called_(false) - , mp_participant(nullptr) - , mp_publisher(nullptr) - , writer_(nullptr) - , part_listener_(this) - , m_pubListener(this) - -{ -} - -bool TestPublisher::init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastrtps::DataRepresentationQosPolicy* dataRepresentationQos, - bool use_typelookup) -{ - m_Name = name; - m_Type.swap(type); - using_typelookup_ = use_typelookup; - - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(1, 0); - pqos.wire_protocol().builtin.typelookup_config.use_client = using_typelookup_; - pqos.wire_protocol().builtin.typelookup_config.use_server = using_typelookup_; - pqos.name(m_Name.c_str()); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - mp_participant = DomainParticipantFactory::get_instance()->create_participant(domain, pqos, &part_listener_); - if (mp_participant == nullptr) - { - return false; - } - mp_participant->enable(); - - // CREATE THE PUBLISHER - std::string data_type = m_Type != nullptr ? m_Type->getName() : ""; - DataWriterQos wqos; - - //REGISTER THE TYPE - if (m_Type != nullptr) - { - m_Type->auto_fill_type_information(false); - m_Type->auto_fill_type_object(false); - if (type_object != nullptr) - { - m_Type->type_object(*type_object); - } - if (type_identifier != nullptr) - { - m_Type->type_identifier(*type_identifier); - } - if (type_info != nullptr) - { - m_Type->type_information(*type_info); - } - m_Type.register_type(mp_participant); - } - - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << domain; - topic_name_ = t.str(); - - if (dataRepresentationQos != nullptr) - { - wqos.representation(*dataRepresentationQos); - } - - if (m_Type != nullptr) - { - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - if (mp_publisher == nullptr) - { - return false; - } - - mp_topic = mp_participant->create_topic(t.str(), data_type, TOPIC_QOS_DEFAULT); - if (mp_topic == nullptr) - { - return false; - } - - writer_ = mp_publisher->create_datawriter(mp_topic, wqos, &m_pubListener); - - m_Data = m_Type->createData(); - } - - m_bInitialized = true; - writer_qos = wqos; - - return true; -} - -TestPublisher::~TestPublisher() -{ - if (m_Type) - { - m_Type->deleteData(m_Data); - } - if (writer_) - { - mp_publisher->delete_datawriter(writer_); - } - if (mp_publisher) - { - mp_participant->delete_publisher(mp_publisher); - } - if (mp_topic) - { - mp_participant->delete_topic(mp_topic); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -void TestPublisher::waitDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(m_mDiscovery); - - if (m_pubListener.n_matched == 0) - { - m_cvDiscovery.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_GE(m_pubListener.n_matched, 1); - } - else - { - ASSERT_EQ(m_pubListener.n_matched, 0); - } -} - -void TestPublisher::waitTypeDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(mtx_type_discovery_); - - if (!part_listener_.discovered_) - { - cv_type_discovery_.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_TRUE(part_listener_.discovered_); - } - else - { - ASSERT_FALSE(part_listener_.discovered_); - } -} - -void TestPublisher::matched() -{ - std::unique_lock lock(m_mDiscovery); - ++m_pubListener.n_matched; - if (m_pubListener.n_matched >= 1) - { - m_cvDiscovery.notify_one(); - } -} - -TestPublisher::PubListener::PubListener( - TestPublisher* parent) - : mParent(parent) - , n_matched(0) -{ -} - -void TestPublisher::PubListener::on_publication_matched( - eprosima::fastdds::dds::DataWriter*, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) -{ - if (info.current_count_change > 0) - { - std::cout << mParent->m_Name << " matched." << std::endl; - mParent->matched(); - } - else - { - std::cout << mParent->m_Name << " unmatched." << std::endl; - } -} - -void TestPublisher::PartListener::on_type_discovery( - eprosima::fastdds::dds::DomainParticipant*, - const rtps::SampleIdentity&, - const eprosima::fastrtps::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - if (!parent_->using_typelookup_ || parent_->tls_callback_called_) - { - std::cout << "Discovered type: " << dyn_type->get_name() << " on topic: " << topic << std::endl; - std::lock_guard lock(parent_->mtx_type_discovery_); - discovered_ = true; - parent_->disc_type_ = dyn_type; - parent_->cv_type_discovery_.notify_one(); - } -} - -void TestPublisher::PartListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string&, const types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - parent_->tls_callback_called_ = true; - on_type_discovery(nullptr, rtps::SampleIdentity(), topic_name, nullptr, nullptr, type); - parent_->tls_callback_called_ = false; - }; - - std::cout << "Received type information: " << type_name << " on topic: " << topic_name << std::endl; - parent_->mp_participant->register_remote_type(type_information, type_name.to_string(), callback); -} - -void TestPublisher::runThread() -{ - int iPrevCount = 0; - std::cout << m_Name << " running..." << std::endl; - while (!publish() && iPrevCount < m_iSamples) - { - std::this_thread::sleep_for(std::chrono::milliseconds(m_iWaitTime)); - ++iPrevCount; - } -} - -void TestPublisher::run() -{ - std::thread thread(&TestPublisher::runThread, this); - thread.join(); -} - -bool TestPublisher::publish() -{ - if (m_pubListener.n_matched > 0) - { - if (writer_->write(m_Data)) - { - ++m_sentSamples; - //std::cout << m_Name << " sent a total of " << m_sentSamples << " samples." << std::endl; - return true; - } - //else - //{ - // std::cout << m_Name << " failed to send " << (m_sentSamples + 1) << " sample." << std::endl; - //} - } - return false; -} - -DataWriter* TestPublisher::create_datawriter() -{ - if (mp_publisher == nullptr) - { - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - - if (mp_publisher == nullptr) - { - return nullptr; - } - } - mp_topic = mp_participant->create_topic(topic_name_, disc_type_->get_name(), TOPIC_QOS_DEFAULT); - if (mp_topic == nullptr) - { - return nullptr; - } - return mp_publisher->create_datawriter(mp_topic, writer_qos, &m_pubListener); - -} - -void TestPublisher::delete_datawriter( - eprosima::fastdds::dds::DataWriter* writer) -{ - mp_publisher->delete_datawriter(writer); -} - -bool TestPublisher::register_discovered_type() -{ - TypeSupport type(disc_type_); - type->auto_fill_type_object(true); - type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; -} diff --git a/test/xtypes/TestPublisher.h b/test/xtypes/TestPublisher.h deleted file mode 100644 index 5eef5b1359b..00000000000 --- a/test/xtypes/TestPublisher.h +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TestPublisher.h - * - */ - -#ifndef _TEST_PUBLISHER_H_ -#define _TEST_PUBLISHER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class TestPublisher -{ -public: - - TestPublisher(); - - virtual ~TestPublisher(); - - //!Initialize - bool init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastrtps::DataRepresentationQosPolicy* dataRepresentationQos, - bool use_typelookup = false); - - //!Publish a sample - bool publish(); - - //!Run for number samples - void run(); - - // Auxiliar test methods - bool isInitialized() const - { - return m_bInitialized; - } - - void waitDiscovery( - bool expectMatch = true, - int maxWait = 10); - - void waitTypeDiscovery( - bool expectMatch = true, - int maxWait = 10); - - void matched(); - - bool isMatched() - { - return m_pubListener.n_matched > 0; - } - - void send() - { - waitDiscovery(); publish(); - } - - eprosima::fastrtps::types::DynamicType_ptr discovered_type() const - { - return disc_type_; - } - - eprosima::fastdds::dds::DataWriter* create_datawriter(); - - void delete_datawriter( - eprosima::fastdds::dds::DataWriter* writer); - - bool register_discovered_type(); - - eprosima::fastdds::dds::TypeSupport m_Type; - -private: - - std::string m_Name; - - std::string topic_name_; - - - - int m_iSamples; - - int m_sentSamples; - - int m_iWaitTime; - - void* m_Data; - - bool m_bInitialized; - - bool using_typelookup_; - - bool tls_callback_called_; - - std::mutex m_mDiscovery; - - std::mutex mtx_type_discovery_; - - std::condition_variable m_cvDiscovery; - - std::condition_variable cv_type_discovery_; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Publisher* mp_publisher; - - eprosima::fastdds::dds::Topic* mp_topic; - - eprosima::fastdds::dds::DataWriter* writer_; - - eprosima::fastrtps::types::DynamicType_ptr disc_type_; - - eprosima::fastdds::dds::DataWriterQos writer_qos; - - class PartListener : public eprosima::fastdds::dds::DomainParticipantListener - { -public: - - PartListener( - TestPublisher* parent) - : parent_(parent) - , discovered_(false) - { - } - - ~PartListener() override - { - } - - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastrtps::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - TestPublisher* parent_; - std::atomic discovered_; - - } part_listener_; - - class PubListener : public eprosima::fastdds::dds::DataWriterListener - { -public: - - PubListener() - { - } - - PubListener( - TestPublisher* parent); - - ~PubListener() override - { - } - - void on_publication_matched( - eprosima::fastdds::dds::DataWriter* writer, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; - - TestPublisher* mParent; - int n_matched; - } m_pubListener; - - void runThread(); -}; - - - -#endif /* _TEST_PUBLISHER_H_ */ diff --git a/test/xtypes/TestSubscriber.cpp b/test/xtypes/TestSubscriber.cpp deleted file mode 100644 index b524fba7a7e..00000000000 --- a/test/xtypes/TestSubscriber.cpp +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TestSubscriber.cpp - * - */ - -#include "TestSubscriber.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TestSubscriber::TestSubscriber() - : mp_participant(nullptr) - , mp_subscriber(nullptr) - , reader_(nullptr) - , topic_(nullptr) - , m_Data(nullptr) - , m_bInitialized(false) - , using_typelookup_(false) - , tls_callback_called_(false) - , dataRepresentationQos_(nullptr) - , typeConsistencyQos_(nullptr) - , part_listener_(this) - , m_subListener(this) -{ -} - -bool TestSubscriber::init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastrtps::DataRepresentationQosPolicy* dataRepresentationQos, - const eprosima::fastrtps::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos, - bool use_typelookup) -{ - dataRepresentationQos_ = dataRepresentationQos; - typeConsistencyQos_ = typeConsistencyQos; - - m_Name = name; - m_Type.swap(type); - using_typelookup_ = use_typelookup; - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(1, 0); - pqos.wire_protocol().builtin.typelookup_config.use_client = using_typelookup_; - pqos.wire_protocol().builtin.typelookup_config.use_server = using_typelookup_; - pqos.name(m_Name.c_str()); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - mp_participant = DomainParticipantFactory::get_instance()->create_participant(domain, pqos, &part_listener_); - if (mp_participant == nullptr) - { - std::cout << "ERROR" << std::endl; - return false; - } - mp_participant->enable(); - - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << domain; - topic_name_ = t.str(); - - //REGISTER THE TYPE - if (m_Type != nullptr) - { - if (type_object != nullptr) - { - m_Type->type_object(*type_object); - } - if (type_identifier != nullptr) - { - m_Type->type_identifier(*type_identifier); - } - if (type_info != nullptr) - { - m_Type->type_information(*type_info); - } - - m_Type->auto_fill_type_information(false); - m_Type->auto_fill_type_object(false); - m_Type.register_type(mp_participant); - - //CREATE THE TOPIC - topic_ = mp_participant->create_topic( - topic_name_, - m_Type->getName(), - TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return false; - } - - //CREATE THE SUBSCRIBER - mp_subscriber = mp_participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (mp_subscriber == nullptr) - { - return false; - } - - //CREATE THE DATAREADER - reader_qos = mp_subscriber->get_default_datareader_qos(); - if (typeConsistencyQos_ != nullptr) - { - reader_qos.type_consistency().type_consistency = *typeConsistencyQos_; - } - if (dataRepresentationQos_ != nullptr) - { - reader_qos.type_consistency().representation = *dataRepresentationQos_; - } - reader_ = mp_subscriber->create_datareader(topic_, reader_qos, &m_subListener); - - if (reader_ == nullptr) - { - return false; - } - - m_Data = m_Type->createData(); - } - m_bInitialized = true; - - return true; -} - -TestSubscriber::~TestSubscriber() -{ - if (m_Type != nullptr) - { - m_Type->deleteData(m_Data); - } - - if (reader_ != nullptr) - { - mp_subscriber->delete_datareader(reader_); - } - if (mp_subscriber != nullptr) - { - mp_participant->delete_subscriber(mp_subscriber); - } - if (topic_ != nullptr) - { - mp_participant->delete_topic(topic_); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -TestSubscriber::SubListener::SubListener( - TestSubscriber* parent) - : mParent(parent) - , n_matched(0) - , n_samples(0) -{ -} - -void TestSubscriber::waitDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(m_mDiscovery); - - if (m_subListener.n_matched == 0) - { - m_cvDiscovery.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_GE(m_subListener.n_matched, 1); - } - else - { - ASSERT_EQ(m_subListener.n_matched, 0); - } -} - -void TestSubscriber::waitTypeDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(mtx_type_discovery_); - - if (!part_listener_.discovered_) - { - cv_type_discovery_.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_TRUE(part_listener_.discovered_); - } - else - { - ASSERT_FALSE(part_listener_.discovered_); - } -} - -void TestSubscriber::matched( - bool unmatched) -{ - std::unique_lock lock(m_mDiscovery); - if (unmatched) - { - --m_subListener.n_matched; - } - else - { - ++m_subListener.n_matched; - } - if (m_subListener.n_matched >= 1) - { - m_cvDiscovery.notify_one(); - } -} - -void TestSubscriber::SubListener::on_subscription_matched( - eprosima::fastdds::dds::DataReader*, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) -{ - if (info.current_count_change > 0) - { - mParent->matched(); - std::cout << mParent->m_Name << " matched." << std::endl; - } - else if (info.current_count_change < 0) - { - mParent->matched(true); - std::cout << mParent->m_Name << " unmatched." << std::endl; - } -} - -void TestSubscriber::SubListener::on_data_available( - eprosima::fastdds::dds::DataReader* reader) -{ - SampleInfo info; - if (!!reader->take_next_sample(mParent->m_Data, &info)) - { - if (info.valid_data) - { - ++n_samples; - mParent->cv_.notify_one(); - //std::cout << mParent->m_Name << " received a total of " << n_samples << " samples." << std::endl; - } - } -} - -void TestSubscriber::PartListener::on_type_discovery( - eprosima::fastdds::dds::DomainParticipant*, - const rtps::SampleIdentity&, - const eprosima::fastrtps::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - if (!parent_->using_typelookup_ || parent_->tls_callback_called_) - { - std::cout << "Discovered type: " << dyn_type->get_name() << " on topic: " << topic << std::endl; - std::lock_guard lock(parent_->mtx_type_discovery_); - discovered_ = true; - parent_->disc_type_ = dyn_type; - parent_->cv_type_discovery_.notify_one(); - } -} - -void TestSubscriber::PartListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string&, const types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - parent_->tls_callback_called_ = true; - on_type_discovery(nullptr, rtps::SampleIdentity(), topic_name, nullptr, nullptr, type); - parent_->tls_callback_called_ = false; - }; - - std::cout << "Received type information: " << type_name << " on topic: " << topic_name << std::endl; - parent_->mp_participant->register_remote_type(type_information, type_name.to_string(), callback); -} - -DataReader* TestSubscriber::create_datareader() -{ - assert (topic_ == nullptr); - assert (mp_subscriber == nullptr); - - //CREATE THE TOPIC - topic_ = mp_participant->create_topic( - topic_name_, - disc_type_->get_name(), - TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return nullptr; - } - - mp_subscriber = mp_participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (mp_subscriber == nullptr) - { - return nullptr; - } - - reader_qos = mp_subscriber->get_default_datareader_qos(); - if (typeConsistencyQos_ != nullptr) - { - reader_qos.type_consistency().type_consistency = *typeConsistencyQos_; - } - if (dataRepresentationQos_ != nullptr) - { - reader_qos.type_consistency().representation = *dataRepresentationQos_; - } - reader_ = mp_subscriber->create_datareader(topic_, reader_qos, &m_subListener); - return reader_; -} - -void TestSubscriber::delete_datareader( - eprosima::fastdds::dds::DataReader* reader) -{ - mp_subscriber->delete_datareader(reader); -} - -bool TestSubscriber::register_discovered_type() -{ - TypeSupport type(disc_type_); - type->auto_fill_type_object(true); - type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; -} - -void TestSubscriber::run() -{ - std::cout << m_Name << " running..." << std::endl; - std::cin.ignore(); -} diff --git a/test/xtypes/TestSubscriber.h b/test/xtypes/TestSubscriber.h deleted file mode 100644 index 35476289132..00000000000 --- a/test/xtypes/TestSubscriber.h +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file TestSubscriber.h - * - */ - -#ifndef _TEST_SUBSCRIBER_H_ -#define _TEST_SUBSCRIBER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -class TestSubscriber -{ -public: - - TestSubscriber(); - - virtual ~TestSubscriber(); - - //!Initialize the subscriber - bool init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastrtps::DataRepresentationQosPolicy* dataRepresentationQos, - const eprosima::fastrtps::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos, - bool use_typelookup = false); - - //!RUN the subscriber - void run(); - - // Auxiliar test methods - bool isInitialized() const - { - return m_bInitialized; - } - - void waitDiscovery( - bool expectMatch = true, - int maxWait = 10); - void waitTypeDiscovery( - bool expectMatch = true, - int maxWait = 10); - void matched( - bool unmatched = false); - bool isMatched() - { - return m_subListener.n_matched > 0; - } - - uint32_t samplesReceived() - { - return m_subListener.n_samples; - } - - eprosima::fastrtps::types::DynamicType_ptr discovered_type() const - { - return disc_type_; - } - - bool register_discovered_type(); - - eprosima::fastdds::dds::DataReader* create_datareader(); - - void delete_datareader( - eprosima::fastdds::dds::DataReader* reader); - - eprosima::fastdds::dds::TypeSupport m_Type; - -private: - - std::string m_Name; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - eprosima::fastdds::dds::Subscriber* mp_subscriber; - eprosima::fastdds::dds::DataReader* reader_; - eprosima::fastdds::dds::Topic* topic_; - void* m_Data; - bool m_bInitialized; - std::mutex m_mDiscovery; - std::mutex mtx_type_discovery_; - std::condition_variable m_cvDiscovery; - std::condition_variable cv_type_discovery_; - std::condition_variable cv_; - eprosima::fastrtps::types::DynamicType_ptr disc_type_; - eprosima::fastdds::dds::DataReaderQos reader_qos; - bool using_typelookup_; - bool tls_callback_called_; - std::string topic_name_; - const eprosima::fastrtps::DataRepresentationQosPolicy* dataRepresentationQos_; - const eprosima::fastrtps::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos_; - -public: - - class PartListener : public eprosima::fastdds::dds::DomainParticipantListener - { -public: - - PartListener( - TestSubscriber* parent) - : parent_(parent) - , discovered_(false) - { - } - - ~PartListener() override - { - } - - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastrtps::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::string_255 topic_name, - const eprosima::fastrtps::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - TestSubscriber* parent_; - std::atomic discovered_; - - } part_listener_; - - class SubListener : public eprosima::fastdds::dds::DataReaderListener - { -public: - - SubListener() - { - } - - SubListener( - TestSubscriber* parent); - - ~SubListener() override - { - } - - void on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - - void on_data_available( - eprosima::fastdds::dds::DataReader* reader) override; - - TestSubscriber* mParent; - int n_matched; - uint32_t n_samples; - } m_subListener; -}; - -#endif /* _TEST_SUBSCRIBER_H_ */ diff --git a/test/xtypes/XTypesTests.cpp b/test/xtypes/XTypesTests.cpp deleted file mode 100644 index b3b3c901454..00000000000 --- a/test/xtypes/XTypesTests.cpp +++ /dev/null @@ -1,1687 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "idl/TypesPubSubTypes.h" -#include "idl/TypesTypeObject.h" - -#include - -#include "TestPublisher.h" -#include "TestSubscriber.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#define GET_PID _getpid -#include -#else -#define GET_PID getpid -#include -#include -#endif // if defined(_WIN32) - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps::rtps; - -static int DOMAIN_ID_ = 10; - -// TODO - Remove DISABLED when XTYPES are implemented. - -class xtypestests : public ::testing::Test -{ -public: - - xtypestests() - { - //Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - //Log::SetCategoryFilter(std::regex("(SECURITY)")); - - DOMAIN_ID_ = static_cast(GET_PID()) % 230; - registerTypesTypes(); - } - - ~xtypestests() - { - //Log::Reset(); - eprosima::fastdds::dds::Log::KillThread(); - eprosima::fastrtps::Domain::stopAll(); - ++DOMAIN_ID_; - DOMAIN_ID_ %= 230; - } - -}; - -/**** NO TYPE OBJECT ****/ - -/* - * Both endpoints share the same type without DataRepresentationQos, so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, NoTypeObjectSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - ASSERT_TRUE(type != nullptr); - ASSERT_FALSE(type == nullptr); - - pub.init("NoTypeObjectSameType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectSameType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", nullptr, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints share the same type without DataRepresentationQosm, but they force type validation, - * so they must not match. - */ -TEST_F(xtypestests, NoTypeObjectSameTypeForce) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = true; - - pub.init("NoTypeObjectSameTypeForce", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectSameTypeForce", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * The endpoints have different types without DataRepresentationQos, so they must not match. - * This represents classical mismatch. - */ -TEST_F(xtypestests, NoTypeObjectDifferentType) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - pub.init("NoTypeObjectDifferentType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectDifferentType", DOMAIN_ID_, type2, nullptr, nullptr, nullptr, "Sub1", nullptr, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TYPE OBJECT V1 ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeObjectV1SameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SameType", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SameType", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 30); - pub.waitDiscovery(true, 30); -} - -/* - * TEST TYPE DISCOVERY - * RETRIEVE PUB's TYPE - */ -TEST_F(xtypestests, TypeDiscoverySubs) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeDiscoverySubs", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeDiscoverySubs", DOMAIN_ID_, TypeSupport( - nullptr), nullptr, nullptr, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitTypeDiscovery(true, 3); - - eprosima::fastrtps::types::DynamicType_ptr disc_type = sub.discovered_type(); - ASSERT_TRUE(disc_type != nullptr); - - sub.register_discovered_type(); - sub.create_datareader(); - - pub.waitDiscovery(true, 3); - sub.waitDiscovery(true, 3); -} - -/* - * TEST TYPE DISCOVERY - * RETRIEVE SUB's TYPE - */ -TEST_F(xtypestests, TypeDiscoveryPubs) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeDiscoveryPubs", DOMAIN_ID_, TypeSupport(nullptr), nullptr, nullptr, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeDiscoveryPubs", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - pub.waitTypeDiscovery(true, 3); - - eprosima::fastrtps::types::DynamicType_ptr disc_type = pub.discovered_type(); - ASSERT_TRUE(disc_type != nullptr); - - pub.register_discovered_type(); - DataWriter* writer = pub.create_datawriter(); - - pub.waitDiscovery(true, 3); - sub.waitDiscovery(true, 3); - - writer->set_listener(nullptr); - pub.delete_datawriter(writer); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeObjectV1DifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicBadStructObject(); - const TypeIdentifier* type_id2 = GetBasicBadStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1DifferentType", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1DifferentType", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeIdentifier's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1NamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeIdentifier's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1NamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names when disallowed type coercion has no effect. - * The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1NamesIgnoredDisallow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesIgnoredDisallow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesIgnoredDisallow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks type widening. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1TypeWidening) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWidening", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWidening", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BadBasicWideStruct are similar structures, but with "Wide" adds a member, and in this case - * modifies the type of other member. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1BadTypeWidening) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BadBasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBadBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBadBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1BadTypeWidening", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1BadTypeWidening", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks prevent type widening when assigning narrow to wide. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1TypeWideningPreventedNarrowToWide) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = true; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningPreventedNarrowToWide", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", - &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningPreventedNarrowToWide", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, - "Sub1", &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks prevent type widening when assining from wide to narrow. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1TypeWideningPreventedWideToNarrow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = true; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningPreventedWideToNarrow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Pub1", - &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningPreventedWideToNarrow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, - "Sub1", &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member, but coercion is disallowed. - * This test checks type widening. The endpoints must match. - */ -TEST_F(xtypestests, TypeObjectV1TypeWideningDisallow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningDisallow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningDisallow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * SequenceStruct and SequenceBoundsStruct are similar structures, but with "Bounds" the size of the sequence is bigger. - * This test checks sequence bounds. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1SequenceBoundsIgnored) -{ - TypeSupport type1(new SequenceStructPubSubType()); - TypeSupport type2(new SequenceBoundsStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalSequenceStructObject(); - const TypeIdentifier* type_id1 = GetSequenceStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalSequenceBoundsStructObject(); - const TypeIdentifier* type_id2 = GetSequenceBoundsStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SequenceBoundsIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SequenceBoundsIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * SequenceStruct and SequenceBoundsStruct are similar structures, but with "Bounds" the size of the sequence is bigger. - * This test checks sequence bounds. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1SequenceBoundsManaged) -{ - TypeSupport type1(new SequenceStructPubSubType()); - TypeSupport type2(new SequenceBoundsStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalSequenceStructObject(); - const TypeIdentifier* type_id1 = GetSequenceStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalSequenceBoundsStructObject(); - const TypeIdentifier* type_id2 = GetSequenceBoundsStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = false; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SequenceBoundsManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SequenceBoundsManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * StringStruct and LargeStringStruct are similar structures, but with "Large" the size of the string is bigger. - * Names are ignored because the member is named different. - * This test checks string bounds. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1LargeStringIgnored) -{ - TypeSupport type1(new StringStructPubSubType()); - TypeSupport type2(new LargeStringStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalStringStructObject(); - const TypeIdentifier* type_id1 = GetStringStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalLargeStringStructObject(); - const TypeIdentifier* type_id2 = GetLargeStringStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1LargeStringIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1LargeStringIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * StringStruct and LargeStringStruct are similar structures, but with "Large" the size of the string is bigger. - * Names are ignored because the member is named different. - * This test checks string bounds. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1LargeStringManaged) -{ - TypeSupport type1(new StringStructPubSubType()); - TypeSupport type2(new LargeStringStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalStringStructObject(); - const TypeIdentifier* type_id1 = GetStringStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalLargeStringStructObject(); - const TypeIdentifier* type_id2 = GetLargeStringStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = false; - typeConQos.m_ignore_string_bounds = false; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1LargeStringManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1LargeStringManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Both endpoints share the same type using XCDR1 so they must match, in this case using Complete. - */ -TEST_F(xtypestests, TypeObjectV1SameTypeComplete) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SameTypeComplete", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SameTypeComplete", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints use compatible but different types using XCDR1 but without coercion so they must not match, - * in this case using Complete. - */ -TEST_F(xtypestests, TypeObjectV1InvalidComplete) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(true); - const TypeObject* type_obj2 = GetCompleteBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1InvalidComplete", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1InvalidComplete", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Both endpoints the same type using XCDR1 but one using minimal and the other complete. - * They shouldn't match. - */ -TEST_F(xtypestests, MixingMinimalAndComplete) -{ - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id2 = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("MixingMinimalAndComplete", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("MixingMinimalAndComplete", DOMAIN_ID_, type1, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TYPE IDENTIFIER ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeIdentifierSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierSameType", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierSameType", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeIdentifierDifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicBadStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierDifferentType", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierDifferentType", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeIdentifier's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeIdentifierNamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierNamesManaged", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierNamesManaged", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeIdentifier's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeIdentifierNamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierNamesIgnored", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierNamesIgnored", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/**** TYPE INFORMATION ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeInformationSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationSameType", DOMAIN_ID_, type, nullptr, nullptr, type_info, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationSameType", DOMAIN_ID_, type, nullptr, nullptr, type_info, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeInformationDifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicBadStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationDifferentType", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationDifferentType", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeInformation's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeInformationNamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicNamesStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationNamesManaged", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationNamesManaged", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeInformation's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeInformationNamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicNamesStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationNamesIgnored", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationNamesIgnored", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/**** Mixing TypeObject, TypeInformation and TypeIdentifier ****/ - -TEST_F(xtypestests, TypeIdentifier_TypeObject) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeIdentifier_TypeObject", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifier_TypeObject", DOMAIN_ID_, type1, type_obj, nullptr, nullptr, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -TEST_F(xtypestests, TypeIdentifier_TypeInformation) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeIdentifier_TypeInformation", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifier_TypeInformation", DOMAIN_ID_, type1, nullptr, nullptr, type_info, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -TEST_F(xtypestests, TypeObject_TypeInformation) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - TestPublisher pub; - TestSubscriber sub; - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeObject_TypeInformation", DOMAIN_ID_, type, type_obj, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObject_TypeInformation", DOMAIN_ID_, type1, nullptr, nullptr, type_info, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TODO - Enable when implemented - DataRepresentation Compatibility tests ****/ - -/* - * Empty-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoSEE) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos; - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSEE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSEE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XCDR1 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE1) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE1", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE1", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE2) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE2", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE2", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XML - */ -TEST_F(xtypestests, DISABLED_DataRepQoSEX) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSEX", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSEX", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Empty-XCDR12 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE12) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XCDR1-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS12) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XCDR2-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoS2E) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XCDR2-XCDR1 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS21) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XCDR2-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS22) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS22", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS22", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XML-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoSXE) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XML-XML - Fails until supported. - */ -TEST_F(xtypestests, DISABLED_DataRepQoSXX) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -int main( - int argc, - char** argv) -{ - testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); -} diff --git a/test/xtypes/idl/Types.cxx b/test/xtypes/idl/Types.cxx deleted file mode 100644 index d0ee9153b8d..00000000000 --- a/test/xtypes/idl/Types.cxx +++ /dev/null @@ -1,5244 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumStruct::MyEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -BasicStruct::BasicStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - -BasicBadStruct::BasicBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - -BasicWideStruct::BasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - -StringStruct::StringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - - m_my_string = x.m_my_string; - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - -LargeStringStruct::LargeStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - - m_my_large_string = x.m_my_large_string; - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - - m_my_large_string = std::move(x.m_my_large_string); - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - -WStringStruct::WStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - - m_my_wstring = x.m_my_wstring; - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - - m_my_wstring = std::move(x.m_my_wstring); - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - - m_my_large_wstring = x.m_my_large_wstring; - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - -ArrayStruct::ArrayStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - - m_my_array_equal = x.m_my_array_equal; - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - - m_my_array_equal = std::move(x.m_my_array_equal); - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - -SequenceStruct::SequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - - m_my_sequence_equal = x.m_my_sequence_equal; - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - -MapStruct::MapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapStructEqual::MapStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - - m_my_map_equal = x.m_my_map_equal; - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - - m_my_map_equal = std::move(x.m_my_map_equal); - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch (__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 0: - switch (__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch (__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - - m_my_union_equal = x.m_my_union_equal; - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - - m_my_union_equal = std::move(x.m_my_union_equal); - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TypesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/Types.h b/test/xtypes/idl/Types.h deleted file mode 100644 index e482676e515..00000000000 --- a/test/xtypes/idl/Types.h +++ /dev/null @@ -1,4432 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - -private: - - MyEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - -private: - - MyBadEnum m_my_enum{::A1}; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - -private: - - MyAliasEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - -private: - - bool m_my_bool_name{false}; - int32_t m_my_int32_name{0}; - std::string m_my_string_name; - -}; - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - uint8_t m_my_bool{0}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - int32_t m_new_int32{0}; - std::string m_new_string; - -}; - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - int32_t m_new_int32{0}; - std::string m_new_string; - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - -private: - - std::wstring m_my_wstring; - -}; - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - -private: - - std::wstring m_my_large_wstring; - -}; - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - -private: - - std::array m_my_array_equal{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - -private: - - std::array, 2> m_my_array{ {{0}} }; - -}; - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - -private: - - std::vector m_my_sequence_equal; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - -private: - - std::map m_my_map_equal; - -}; - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - -private: - - int32_t m__d; - - int32_t m_first_case{0}; - int64_t m_second_case{0}; -}; - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - uint8_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - uint8_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - -private: - - SimpleUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - -private: - - SimpleUnion m_my_union_equal; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - -private: - - SimpleUnionNames m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - -private: - - SimpleTypeUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - -private: - - SimpleBadUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - -private: - - SimpleBadDiscUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/Types.idl b/test/xtypes/idl/Types.idl deleted file mode 100644 index fea3438ed82..00000000000 --- a/test/xtypes/idl/Types.idl +++ /dev/null @@ -1,271 +0,0 @@ -// Enum - -enum MyEnum -{ - A, - B, - C -}; - -enum MyBadEnum -{ - A1, - B1, - C1 -}; - -struct MyEnumStruct -{ - MyEnum my_enum; -}; - -struct MyBadEnumStruct -{ - MyBadEnum my_enum; -}; - -// Alias - -typedef MyEnum MyAliasEnum; - -struct MyAliasEnumStruct -{ - MyAliasEnum my_enum; // Keep same name -}; - -// All basic types - -struct BasicStruct -{ - boolean my_bool; - long my_int32; - string my_string; -}; - -struct BasicNamesStruct -{ - boolean my_bool_name; - long my_int32_name; - string my_string_name; -}; - -struct BasicBadStruct -{ - octet my_bool; - long my_int32; - string my_string; -}; - -// Wide Struct - -struct BasicWideStruct -{ - boolean my_bool; - long my_int32; - string my_string; - long new_int32; - string new_string; -}; - -// Bad Wide Struct - -struct BadBasicWideStruct -{ - long new_int32; - string new_string; - boolean my_bool; - long my_int32; - string my_string; -}; - -// String bounds - -struct StringStruct -{ - string my_string; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -// WString bounds - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -// Array dimensions and size - -struct ArrayStruct -{ - long my_array[2]; -}; - -struct ArrayStructEqual -{ - long my_array_equal[2]; -}; - -struct ArrayBadStruct -{ - octet my_array[2]; -}; - -struct ArrayDimensionsStruct -{ - long my_array[2][2]; -}; - -struct ArraySizeStruct -{ - long my_array[5]; -}; - -// Sequence bounds - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceStructEqual -{ - sequence my_sequence_equal; -}; - -struct SequenceBadStruct -{ - sequence my_sequence; -}; - -struct SequenceBoundsStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct SequenceSequenceBoundsStruct -{ - sequence, 5> my_sequence_sequence; -}; - -// Map bounds - -struct MapStruct -{ - map my_map; -}; - -struct MapStructEqual -{ - map my_map_equal; -}; - -struct MapBadKeyStruct -{ - map my_map; -}; - -struct MapBadElemStruct -{ - map my_map; -}; - -struct MapBoundsStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -struct MapMapBoundsStruct -{ - map , 3> my_map_map; -}; - -// Unions - -union SimpleUnion switch (long) -{ - case A: - long first; - case B: - long long second; -}; - -union SimpleUnionNames switch (long) -{ - case A: - long first_case; - case B: - long long second_case; -}; - -union SimpleTypeUnion switch (long) -{ - case A: - octet first; - case B: - long long second; -}; - -union SimpleBadUnion switch (long) -{ - case A: - long first; - case C: - long long second; -}; - -union SimpleBadDiscUnion switch (octet) -{ - case 0: - long first; - case 1: - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct SimpleUnionStructEqual -{ - SimpleUnion my_union_equal; -}; - -struct SimpleUnionNamesStruct -{ - SimpleUnionNames my_union; -}; - -struct SimpleTypeUnionStruct -{ - SimpleTypeUnion my_union; -}; - -struct SimpleBadUnionStruct -{ - SimpleBadUnion my_union; -}; - -struct SimplBadDiscUnionStruct -{ - SimpleBadDiscUnion my_union; -}; \ No newline at end of file diff --git a/test/xtypes/idl/TypesCdrAux.hpp b/test/xtypes/idl/TypesCdrAux.hpp deleted file mode 100644 index 14992724933..00000000000 --- a/test/xtypes/idl/TypesCdrAux.hpp +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - -#include "Types.h" - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceBoundsStruct_max_cdr_typesize {132UL}; -constexpr uint32_t SequenceSequenceBoundsStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyAliasEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyAliasEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayBadStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ArrayBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBadKeyStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapBadKeyStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleBadUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleBadUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MyEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayStructEqual_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeWStringStruct_max_cdr_typesize {83858UL}; -constexpr uint32_t LargeWStringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WStringStruct_max_cdr_typesize {518UL}; -constexpr uint32_t WStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStruct_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleTypeUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleTypeUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayDimensionsStruct_max_cdr_typesize {20UL}; -constexpr uint32_t ArrayDimensionsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceStruct_max_cdr_typesize {48UL}; -constexpr uint32_t SequenceSequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBoundsStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStructEqual_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t MapStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBoundsStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SequenceBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapMapStruct_max_cdr_typesize {60UL}; -constexpr uint32_t MapMapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BasicWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimplBadDiscUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimplBadDiscUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyBadEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyBadEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBadStruct_max_cdr_typesize {10UL}; -constexpr uint32_t SequenceBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionNamesStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeStringStruct_max_cdr_typesize {41934UL}; -constexpr uint32_t LargeStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayStruct_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BadBasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BadBasicWideStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArraySizeStruct_max_cdr_typesize {24UL}; -constexpr uint32_t ArraySizeStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapBadElemStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBadElemStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicBadStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicNamesStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StringStruct_max_cdr_typesize {264UL}; -constexpr uint32_t StringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapMapBoundsStruct_max_cdr_typesize {108UL}; -constexpr uint32_t MapMapBoundsStruct_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data); - - - - - - - - - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - diff --git a/test/xtypes/idl/TypesCdrAux.ipp b/test/xtypes/idl/TypesCdrAux.ipp deleted file mode 100644 index 5d6735bcfef..00000000000 --- a/test/xtypes/idl/TypesCdrAux.ipp +++ /dev/null @@ -1,3543 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - -#include "TypesCdrAux.hpp" - -#include -#include - - -#include -using namespace eprosima::fastcdr::exception; - -namespace eprosima { -namespace fastcdr { - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyBadEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyBadEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyAliasEnumStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_enum(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyAliasEnumStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicNamesStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string_name(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool_name() - << eprosima::fastcdr::MemberId(1) << data.my_int32_name() - << eprosima::fastcdr::MemberId(2) << data.my_string_name() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicNamesStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool_name(); - break; - - case 1: - dcdr >> data.my_int32_name(); - break; - - case 2: - dcdr >> data.my_string_name(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicWideStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.new_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() - << eprosima::fastcdr::MemberId(3) << data.new_int32() - << eprosima::fastcdr::MemberId(4) << data.new_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicWideStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - case 3: - dcdr >> data.new_int32(); - break; - - case 4: - dcdr >> data.new_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BadBasicWideStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.new_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.new_int32() - << eprosima::fastcdr::MemberId(1) << data.new_string() - << eprosima::fastcdr::MemberId(2) << data.my_bool() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BadBasicWideStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.new_int32(); - break; - - case 1: - dcdr >> data.new_string(); - break; - - case 2: - dcdr >> data.my_bool(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_string(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeWStringStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_large_wstring(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeWStringStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_large_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayDimensionsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayDimensionsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArraySizeStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_array(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArraySizeStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBadStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBadStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_sequence_sequence(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadKeyStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadKeyStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadElemStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadElemStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapBoundsStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_map_map(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapBoundsStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNames& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first_case(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second_case(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNames& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first_case(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second_case(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNames& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first_case(); - break; - - case B: - dcdr >> data.second_case(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case C: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case A: - dcdr >> data.first(); - break; - - case C: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadDiscUnion& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), data._d(), - current_alignment); - - switch (data._d()) - { - case 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case 1: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadDiscUnion& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr << eprosima::fastcdr::MemberId(0) << data._d(); - - switch (data._d()) - { - case 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case 1: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadDiscUnion& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data._d(); - break; - default: - switch (data._d()) - { - case 0: - dcdr >> data.first(); - break; - - case 1: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStructEqual& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union_equal(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStructEqual& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNamesStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNamesStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimplBadDiscUnionStruct& data, - size_t& current_alignment) -{ - static_cast(data); - - eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - current_alignment)}; - - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.my_union(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - eprosima::fastcdr::Cdr::state current_state(scdr); - scdr.begin_serialize_type(current_state, - eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); - - scdr - << eprosima::fastcdr::MemberId(0) << data.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimplBadDiscUnionStruct& data) -{ - cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, - [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool - { - bool ret_value = true; - switch (mid.id) - { - case 0: - dcdr >> data.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - diff --git a/test/xtypes/idl/TypesPubSubTypes.cxx b/test/xtypes/idl/TypesPubSubTypes.cxx deleted file mode 100644 index 0c0a8f0363e..00000000000 --- a/test/xtypes/idl/TypesPubSubTypes.cxx +++ /dev/null @@ -1,6927 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "TypesPubSubTypes.h" -#include "TypesCdrAux.hpp" - -using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; -using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; - - - -MyEnumStructPubSubType::MyEnumStructPubSubType() -{ - setName("MyEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumStruct::getMaxCdrSerializedSize()); -#else - MyEnumStruct_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 = MyEnumStruct_max_key_cdr_typesize > 16 ? MyEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumStructPubSubType::~MyEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumStruct* 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; - } - 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 MyEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumStruct* 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 MyEnumStructPubSubType::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* MyEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumStruct()); -} - -void MyEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumStruct_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 || MyEnumStruct_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; -} - - - -MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() -{ - setName("MyBadEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); -#else - MyBadEnumStruct_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 = MyBadEnumStruct_max_key_cdr_typesize > 16 ? MyBadEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyBadEnumStructPubSubType::~MyBadEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyBadEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyBadEnumStruct* 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; - } - 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 MyBadEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyBadEnumStruct* 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 MyBadEnumStructPubSubType::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* MyBadEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyBadEnumStruct()); -} - -void MyBadEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyBadEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyBadEnumStruct_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 || MyBadEnumStruct_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; -} - - - - - -MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() -{ - setName("MyAliasEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); -#else - MyAliasEnumStruct_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 = MyAliasEnumStruct_max_key_cdr_typesize > 16 ? MyAliasEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyAliasEnumStructPubSubType::~MyAliasEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyAliasEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyAliasEnumStruct* 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; - } - 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 MyAliasEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyAliasEnumStruct* 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 MyAliasEnumStructPubSubType::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* MyAliasEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyAliasEnumStruct()); -} - -void MyAliasEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyAliasEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyAliasEnumStruct_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 || MyAliasEnumStruct_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; -} - - - -BasicStructPubSubType::BasicStructPubSubType() -{ - setName("BasicStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicStruct::getMaxCdrSerializedSize()); -#else - BasicStruct_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 = BasicStruct_max_key_cdr_typesize > 16 ? BasicStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicStructPubSubType::~BasicStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicStruct* 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; - } - 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 BasicStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicStruct* 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 BasicStructPubSubType::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* BasicStructPubSubType::createData() -{ - return reinterpret_cast(new BasicStruct()); -} - -void BasicStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicStruct_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 || BasicStruct_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; -} - - - -BasicNamesStructPubSubType::BasicNamesStructPubSubType() -{ - setName("BasicNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); -#else - BasicNamesStruct_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 = BasicNamesStruct_max_key_cdr_typesize > 16 ? BasicNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicNamesStructPubSubType::~BasicNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicNamesStruct* 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; - } - 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 BasicNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicNamesStruct* 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 BasicNamesStructPubSubType::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* BasicNamesStructPubSubType::createData() -{ - return reinterpret_cast(new BasicNamesStruct()); -} - -void BasicNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicNamesStruct_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 || BasicNamesStruct_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; -} - - - -BasicBadStructPubSubType::BasicBadStructPubSubType() -{ - setName("BasicBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicBadStruct::getMaxCdrSerializedSize()); -#else - BasicBadStruct_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 = BasicBadStruct_max_key_cdr_typesize > 16 ? BasicBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicBadStructPubSubType::~BasicBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicBadStruct* 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; - } - 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 BasicBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicBadStruct* 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 BasicBadStructPubSubType::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* BasicBadStructPubSubType::createData() -{ - return reinterpret_cast(new BasicBadStruct()); -} - -void BasicBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicBadStruct_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 || BasicBadStruct_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; -} - - - -BasicWideStructPubSubType::BasicWideStructPubSubType() -{ - setName("BasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicWideStruct::getMaxCdrSerializedSize()); -#else - BasicWideStruct_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 = BasicWideStruct_max_key_cdr_typesize > 16 ? BasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicWideStructPubSubType::~BasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicWideStruct* 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; - } - 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 BasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicWideStruct* 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 BasicWideStructPubSubType::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* BasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BasicWideStruct()); -} - -void BasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicWideStruct_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 || BasicWideStruct_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; -} - - - -BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() -{ - setName("BadBasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); -#else - BadBasicWideStruct_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 = BadBasicWideStruct_max_key_cdr_typesize > 16 ? BadBasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BadBasicWideStructPubSubType::~BadBasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BadBasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BadBasicWideStruct* 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; - } - 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 BadBasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BadBasicWideStruct* 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 BadBasicWideStructPubSubType::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* BadBasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BadBasicWideStruct()); -} - -void BadBasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BadBasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BadBasicWideStruct_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 || BadBasicWideStruct_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; -} - - - -StringStructPubSubType::StringStructPubSubType() -{ - setName("StringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StringStruct::getMaxCdrSerializedSize()); -#else - StringStruct_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 = StringStruct_max_key_cdr_typesize > 16 ? StringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StringStructPubSubType::~StringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StringStruct* 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; - } - 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 StringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StringStruct* 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 StringStructPubSubType::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* StringStructPubSubType::createData() -{ - return reinterpret_cast(new StringStruct()); -} - -void StringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StringStruct_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 || StringStruct_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; -} - - - -LargeStringStructPubSubType::LargeStringStructPubSubType() -{ - setName("LargeStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeStringStruct::getMaxCdrSerializedSize()); -#else - LargeStringStruct_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 = LargeStringStruct_max_key_cdr_typesize > 16 ? LargeStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeStringStructPubSubType::~LargeStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeStringStruct* 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; - } - 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 LargeStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeStringStruct* 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 LargeStringStructPubSubType::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* LargeStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeStringStruct()); -} - -void LargeStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeStringStruct_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 || LargeStringStruct_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; -} - - - -WStringStructPubSubType::WStringStructPubSubType() -{ - setName("WStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WStringStruct::getMaxCdrSerializedSize()); -#else - WStringStruct_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 = WStringStruct_max_key_cdr_typesize > 16 ? WStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WStringStructPubSubType::~WStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WStringStruct* 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; - } - 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 WStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WStringStruct* 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 WStringStructPubSubType::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* WStringStructPubSubType::createData() -{ - return reinterpret_cast(new WStringStruct()); -} - -void WStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WStringStruct_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 || WStringStruct_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; -} - - - -LargeWStringStructPubSubType::LargeWStringStructPubSubType() -{ - setName("LargeWStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); -#else - LargeWStringStruct_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 = LargeWStringStruct_max_key_cdr_typesize > 16 ? LargeWStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeWStringStructPubSubType::~LargeWStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeWStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeWStringStruct* 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; - } - 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 LargeWStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeWStringStruct* 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 LargeWStringStructPubSubType::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* LargeWStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeWStringStruct()); -} - -void LargeWStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeWStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeWStringStruct_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 || LargeWStringStruct_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; -} - - - -ArrayStructPubSubType::ArrayStructPubSubType() -{ - setName("ArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayStruct_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 = ArrayStruct_max_key_cdr_typesize > 16 ? ArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructPubSubType::~ArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStruct* 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; - } - 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 ArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStruct* 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 ArrayStructPubSubType::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* ArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayStruct()); -} - -void ArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStruct_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 || ArrayStruct_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; -} - - - -ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() -{ - setName("ArrayStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); -#else - ArrayStructEqual_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 = ArrayStructEqual_max_key_cdr_typesize > 16 ? ArrayStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructEqualPubSubType::~ArrayStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStructEqual* 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; - } - 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 ArrayStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStructEqual* 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 ArrayStructEqualPubSubType::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* ArrayStructEqualPubSubType::createData() -{ - return reinterpret_cast(new ArrayStructEqual()); -} - -void ArrayStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStructEqual_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 || ArrayStructEqual_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; -} - - - -ArrayBadStructPubSubType::ArrayBadStructPubSubType() -{ - setName("ArrayBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); -#else - ArrayBadStruct_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 = ArrayBadStruct_max_key_cdr_typesize > 16 ? ArrayBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayBadStructPubSubType::~ArrayBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayBadStruct* 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; - } - 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 ArrayBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayBadStruct* 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 ArrayBadStructPubSubType::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* ArrayBadStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayBadStruct()); -} - -void ArrayBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayBadStruct_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 || ArrayBadStruct_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; -} - - - -ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() -{ - setName("ArrayDimensionsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); -#else - ArrayDimensionsStruct_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 = ArrayDimensionsStruct_max_key_cdr_typesize > 16 ? ArrayDimensionsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayDimensionsStructPubSubType::~ArrayDimensionsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayDimensionsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayDimensionsStruct* 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; - } - 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 ArrayDimensionsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayDimensionsStruct* 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 ArrayDimensionsStructPubSubType::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* ArrayDimensionsStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayDimensionsStruct()); -} - -void ArrayDimensionsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayDimensionsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayDimensionsStruct_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 || ArrayDimensionsStruct_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; -} - - - -ArraySizeStructPubSubType::ArraySizeStructPubSubType() -{ - setName("ArraySizeStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); -#else - ArraySizeStruct_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 = ArraySizeStruct_max_key_cdr_typesize > 16 ? ArraySizeStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraySizeStructPubSubType::~ArraySizeStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraySizeStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraySizeStruct* 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; - } - 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 ArraySizeStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraySizeStruct* 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 ArraySizeStructPubSubType::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* ArraySizeStructPubSubType::createData() -{ - return reinterpret_cast(new ArraySizeStruct()); -} - -void ArraySizeStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraySizeStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraySizeStruct_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 || ArraySizeStruct_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; -} - - - - - -SequenceStructPubSubType::SequenceStructPubSubType() -{ - setName("SequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceStruct_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 = SequenceStruct_max_key_cdr_typesize > 16 ? SequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructPubSubType::~SequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStruct* 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; - } - 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 SequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStruct* 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 SequenceStructPubSubType::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* SequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceStruct()); -} - -void SequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStruct_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 || SequenceStruct_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; -} - - - - - -SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() -{ - setName("SequenceStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); -#else - SequenceStructEqual_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 = SequenceStructEqual_max_key_cdr_typesize > 16 ? SequenceStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructEqualPubSubType::~SequenceStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStructEqual* 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; - } - 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 SequenceStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStructEqual* 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 SequenceStructEqualPubSubType::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* SequenceStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SequenceStructEqual()); -} - -void SequenceStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStructEqual_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 || SequenceStructEqual_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; -} - - - - - -SequenceBadStructPubSubType::SequenceBadStructPubSubType() -{ - setName("SequenceBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); -#else - SequenceBadStruct_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 = SequenceBadStruct_max_key_cdr_typesize > 16 ? SequenceBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBadStructPubSubType::~SequenceBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBadStruct* 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; - } - 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 SequenceBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBadStruct* 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 SequenceBadStructPubSubType::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* SequenceBadStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBadStruct()); -} - -void SequenceBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBadStruct_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 || SequenceBadStruct_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; -} - - - - - -SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() -{ - setName("SequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceBoundsStruct_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 = SequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBoundsStructPubSubType::~SequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBoundsStruct* 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; - } - 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 SequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBoundsStruct* 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 SequenceBoundsStructPubSubType::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* SequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBoundsStruct()); -} - -void SequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBoundsStruct_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 || SequenceBoundsStruct_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; -} - - - - - - - -SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() -{ - setName("SequenceSequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceStruct_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 = SequenceSequenceStruct_max_key_cdr_typesize > 16 ? SequenceSequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceStructPubSubType::~SequenceSequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceStruct* 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; - } - 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 SequenceSequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceStruct* 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 SequenceSequenceStructPubSubType::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* SequenceSequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceStruct()); -} - -void SequenceSequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceStruct_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 || SequenceSequenceStruct_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; -} - - - - - - - -SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() -{ - setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceBoundsStruct_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 = SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceSequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceBoundsStructPubSubType::~SequenceSequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceBoundsStruct* 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; - } - 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 SequenceSequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceBoundsStruct* 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 SequenceSequenceBoundsStructPubSubType::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* SequenceSequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceBoundsStruct()); -} - -void SequenceSequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceBoundsStruct_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 || SequenceSequenceBoundsStruct_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; -} - - - - - -MapStructPubSubType::MapStructPubSubType() -{ - setName("MapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStruct::getMaxCdrSerializedSize()); -#else - MapStruct_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 = MapStruct_max_key_cdr_typesize > 16 ? MapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructPubSubType::~MapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStruct* 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; - } - 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 MapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStruct* 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 MapStructPubSubType::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* MapStructPubSubType::createData() -{ - return reinterpret_cast(new MapStruct()); -} - -void MapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStruct_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 || MapStruct_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; -} - - - - - -MapStructEqualPubSubType::MapStructEqualPubSubType() -{ - setName("MapStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStructEqual::getMaxCdrSerializedSize()); -#else - MapStructEqual_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 = MapStructEqual_max_key_cdr_typesize > 16 ? MapStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructEqualPubSubType::~MapStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStructEqual* 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; - } - 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 MapStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStructEqual* 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 MapStructEqualPubSubType::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* MapStructEqualPubSubType::createData() -{ - return reinterpret_cast(new MapStructEqual()); -} - -void MapStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStructEqual_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 || MapStructEqual_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; -} - - - - - -MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() -{ - setName("MapBadKeyStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); -#else - MapBadKeyStruct_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 = MapBadKeyStruct_max_key_cdr_typesize > 16 ? MapBadKeyStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadKeyStructPubSubType::~MapBadKeyStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadKeyStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadKeyStruct* 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; - } - 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 MapBadKeyStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadKeyStruct* 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 MapBadKeyStructPubSubType::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* MapBadKeyStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadKeyStruct()); -} - -void MapBadKeyStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadKeyStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadKeyStruct_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 || MapBadKeyStruct_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; -} - - - - - -MapBadElemStructPubSubType::MapBadElemStructPubSubType() -{ - setName("MapBadElemStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); -#else - MapBadElemStruct_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 = MapBadElemStruct_max_key_cdr_typesize > 16 ? MapBadElemStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadElemStructPubSubType::~MapBadElemStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadElemStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadElemStruct* 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; - } - 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 MapBadElemStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadElemStruct* 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 MapBadElemStructPubSubType::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* MapBadElemStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadElemStruct()); -} - -void MapBadElemStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadElemStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadElemStruct_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 || MapBadElemStruct_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; -} - - - - - -MapBoundsStructPubSubType::MapBoundsStructPubSubType() -{ - setName("MapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapBoundsStruct_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 = MapBoundsStruct_max_key_cdr_typesize > 16 ? MapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBoundsStructPubSubType::~MapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBoundsStruct* 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; - } - 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 MapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBoundsStruct* 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 MapBoundsStructPubSubType::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* MapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapBoundsStruct()); -} - -void MapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBoundsStruct_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 || MapBoundsStruct_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; -} - - - - - - - -MapMapStructPubSubType::MapMapStructPubSubType() -{ - setName("MapMapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapStruct::getMaxCdrSerializedSize()); -#else - MapMapStruct_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 = MapMapStruct_max_key_cdr_typesize > 16 ? MapMapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapStructPubSubType::~MapMapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapStruct* 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; - } - 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 MapMapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapStruct* 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 MapMapStructPubSubType::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* MapMapStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapStruct()); -} - -void MapMapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapStruct_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 || MapMapStruct_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; -} - - - - - - - -MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() -{ - setName("MapMapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapMapBoundsStruct_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 = MapMapBoundsStruct_max_key_cdr_typesize > 16 ? MapMapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapBoundsStructPubSubType::~MapMapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapBoundsStruct* 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; - } - 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 MapMapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapBoundsStruct* 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 MapMapBoundsStructPubSubType::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* MapMapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapBoundsStruct()); -} - -void MapMapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapBoundsStruct_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 || MapMapBoundsStruct_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; -} - - - - - - - - - - - - - - - - - - - - - - - -SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() -{ - setName("SimpleUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionStruct_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 = SimpleUnionStruct_max_key_cdr_typesize > 16 ? SimpleUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructPubSubType::~SimpleUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStruct* 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; - } - 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 SimpleUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStruct* 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 SimpleUnionStructPubSubType::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* SimpleUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStruct()); -} - -void SimpleUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStruct_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 || SimpleUnionStruct_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; -} - - - -SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() -{ - setName("SimpleUnionStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); -#else - SimpleUnionStructEqual_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 = SimpleUnionStructEqual_max_key_cdr_typesize > 16 ? SimpleUnionStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructEqualPubSubType::~SimpleUnionStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStructEqual* 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; - } - 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 SimpleUnionStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStructEqual* 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 SimpleUnionStructEqualPubSubType::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* SimpleUnionStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStructEqual()); -} - -void SimpleUnionStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStructEqual_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 || SimpleUnionStructEqual_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; -} - - - -SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() -{ - setName("SimpleUnionNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionNamesStruct_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 = SimpleUnionNamesStruct_max_key_cdr_typesize > 16 ? SimpleUnionNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionNamesStructPubSubType::~SimpleUnionNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionNamesStruct* 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; - } - 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 SimpleUnionNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionNamesStruct* 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 SimpleUnionNamesStructPubSubType::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* SimpleUnionNamesStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionNamesStruct()); -} - -void SimpleUnionNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionNamesStruct_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 || SimpleUnionNamesStruct_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; -} - - - -SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() -{ - setName("SimpleTypeUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleTypeUnionStruct_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 = SimpleTypeUnionStruct_max_key_cdr_typesize > 16 ? SimpleTypeUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleTypeUnionStructPubSubType::~SimpleTypeUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleTypeUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleTypeUnionStruct* 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; - } - 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 SimpleTypeUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleTypeUnionStruct* 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 SimpleTypeUnionStructPubSubType::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* SimpleTypeUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleTypeUnionStruct()); -} - -void SimpleTypeUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleTypeUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleTypeUnionStruct_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 || SimpleTypeUnionStruct_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; -} - - - -SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() -{ - setName("SimpleBadUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleBadUnionStruct_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 = SimpleBadUnionStruct_max_key_cdr_typesize > 16 ? SimpleBadUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleBadUnionStructPubSubType::~SimpleBadUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleBadUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleBadUnionStruct* 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; - } - 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 SimpleBadUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleBadUnionStruct* 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 SimpleBadUnionStructPubSubType::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* SimpleBadUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleBadUnionStruct()); -} - -void SimpleBadUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleBadUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleBadUnionStruct_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 || SimpleBadUnionStruct_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; -} - - - -SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() -{ - setName("SimplBadDiscUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); -#else - SimplBadDiscUnionStruct_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 = SimplBadDiscUnionStruct_max_key_cdr_typesize > 16 ? SimplBadDiscUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimplBadDiscUnionStructPubSubType::~SimplBadDiscUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimplBadDiscUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimplBadDiscUnionStruct* 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; - } - 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 SimplBadDiscUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimplBadDiscUnionStruct* 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 SimplBadDiscUnionStructPubSubType::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* SimplBadDiscUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimplBadDiscUnionStruct()); -} - -void SimplBadDiscUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimplBadDiscUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimplBadDiscUnionStruct_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 || SimplBadDiscUnionStruct_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; -} - diff --git a/test/xtypes/idl/TypesPubSubTypes.h b/test/xtypes/idl/TypesPubSubTypes.h deleted file mode 100644 index 6a934f82843..00000000000 --- a/test/xtypes/idl/TypesPubSubTypes.h +++ /dev/null @@ -1,3337 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Types.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated Types is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumStruct type; - - eProsima_user_DllExport MyEnumStructPubSubType(); - - eProsima_user_DllExport ~MyEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyBadEnumStruct type; - - eProsima_user_DllExport MyBadEnumStructPubSubType(); - - eProsima_user_DllExport ~MyBadEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyAliasEnumStruct type; - - eProsima_user_DllExport MyAliasEnumStructPubSubType(); - - eProsima_user_DllExport ~MyAliasEnumStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicStruct type; - - eProsima_user_DllExport BasicStructPubSubType(); - - eProsima_user_DllExport ~BasicStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicNamesStruct type; - - eProsima_user_DllExport BasicNamesStructPubSubType(); - - eProsima_user_DllExport ~BasicNamesStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicBadStruct type; - - eProsima_user_DllExport BasicBadStructPubSubType(); - - eProsima_user_DllExport ~BasicBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicWideStruct type; - - eProsima_user_DllExport BasicWideStructPubSubType(); - - eProsima_user_DllExport ~BasicWideStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BadBasicWideStruct type; - - eProsima_user_DllExport BadBasicWideStructPubSubType(); - - eProsima_user_DllExport ~BadBasicWideStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StringStruct type; - - eProsima_user_DllExport StringStructPubSubType(); - - eProsima_user_DllExport ~StringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeStringStruct type; - - eProsima_user_DllExport LargeStringStructPubSubType(); - - eProsima_user_DllExport ~LargeStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WStringStruct type; - - eProsima_user_DllExport WStringStructPubSubType(); - - eProsima_user_DllExport ~WStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeWStringStruct type; - - eProsima_user_DllExport LargeWStringStructPubSubType(); - - eProsima_user_DllExport ~LargeWStringStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStruct type; - - eProsima_user_DllExport ArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStructEqual type; - - eProsima_user_DllExport ArrayStructEqualPubSubType(); - - eProsima_user_DllExport ~ArrayStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayBadStruct type; - - eProsima_user_DllExport ArrayBadStructPubSubType(); - - eProsima_user_DllExport ~ArrayBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayDimensionsStruct type; - - eProsima_user_DllExport ArrayDimensionsStructPubSubType(); - - eProsima_user_DllExport ~ArrayDimensionsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraySizeStruct type; - - eProsima_user_DllExport ArraySizeStructPubSubType(); - - eProsima_user_DllExport ~ArraySizeStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStruct type; - - eProsima_user_DllExport SequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStructEqual type; - - eProsima_user_DllExport SequenceStructEqualPubSubType(); - - eProsima_user_DllExport ~SequenceStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBadStruct type; - - eProsima_user_DllExport SequenceBadStructPubSubType(); - - eProsima_user_DllExport ~SequenceBadStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBoundsStruct type; - - eProsima_user_DllExport SequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceStruct type; - - eProsima_user_DllExport SequenceSequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceBoundsStruct type; - - eProsima_user_DllExport SequenceSequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStruct type; - - eProsima_user_DllExport MapStructPubSubType(); - - eProsima_user_DllExport ~MapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStructEqual type; - - eProsima_user_DllExport MapStructEqualPubSubType(); - - eProsima_user_DllExport ~MapStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadKeyStruct type; - - eProsima_user_DllExport MapBadKeyStructPubSubType(); - - eProsima_user_DllExport ~MapBadKeyStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadElemStruct type; - - eProsima_user_DllExport MapBadElemStructPubSubType(); - - eProsima_user_DllExport ~MapBadElemStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBoundsStruct type; - - eProsima_user_DllExport MapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapStruct type; - - eProsima_user_DllExport MapMapStructPubSubType(); - - eProsima_user_DllExport ~MapMapStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapBoundsStruct type; - - eProsima_user_DllExport MapMapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapMapBoundsStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStruct type; - - eProsima_user_DllExport SimpleUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStructEqual type; - - eProsima_user_DllExport SimpleUnionStructEqualPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructEqualPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionNamesStruct type; - - eProsima_user_DllExport SimpleUnionNamesStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionNamesStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleTypeUnionStruct type; - - eProsima_user_DllExport SimpleTypeUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleTypeUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleBadUnionStruct type; - - eProsima_user_DllExport SimpleBadUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleBadUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimplBadDiscUnionStruct type; - - eProsima_user_DllExport SimplBadDiscUnionStructPubSubType(); - - eProsima_user_DllExport ~SimplBadDiscUnionStructPubSubType() 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, - 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 std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() 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 true; - } - -#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; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - diff --git a/test/xtypes/idl/TypesTypeObject.cxx b/test/xtypes/idl/TypesTypeObject.cxx deleted file mode 100644 index bcefed47249..00000000000 --- a/test/xtypes/idl/TypesTypeObject.cxx +++ /dev/null @@ -1,8988 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Types.h" -#include "TypesTypeObject.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTypesTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(true), - GetMyBadEnumObject(true)); - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(false), - GetMyBadEnumObject(false)); - - - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(true), - GetMyEnumStructObject(true)); - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(false), - GetMyEnumStructObject(false)); - - - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(true), - GetMyBadEnumStructObject(true)); - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(false), - GetMyBadEnumStructObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(true), - GetMyAliasEnumStructObject(true)); - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(false), - GetMyAliasEnumStructObject(false)); - - - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(true), - GetBasicStructObject(true)); - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(false), - GetBasicStructObject(false)); - - - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(true), - GetBasicNamesStructObject(true)); - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(false), - GetBasicNamesStructObject(false)); - - - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(true), - GetBasicBadStructObject(true)); - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(false), - GetBasicBadStructObject(false)); - - - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(true), - GetBasicWideStructObject(true)); - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(false), - GetBasicWideStructObject(false)); - - - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(true), - GetBadBasicWideStructObject(true)); - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(false), - GetBadBasicWideStructObject(false)); - - - factory->add_type_object("StringStruct", GetStringStructIdentifier(true), - GetStringStructObject(true)); - factory->add_type_object("StringStruct", GetStringStructIdentifier(false), - GetStringStructObject(false)); - - - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(true), - GetLargeStringStructObject(true)); - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(false), - GetLargeStringStructObject(false)); - - - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(true), - GetWStringStructObject(true)); - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(false), - GetWStringStructObject(false)); - - - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(true), - GetLargeWStringStructObject(true)); - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(false), - GetLargeWStringStructObject(false)); - - - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(true), - GetArrayStructObject(true)); - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(false), - GetArrayStructObject(false)); - - - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(true), - GetArrayStructEqualObject(true)); - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(false), - GetArrayStructEqualObject(false)); - - - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(true), - GetArrayBadStructObject(true)); - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(false), - GetArrayBadStructObject(false)); - - - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(true), - GetArrayDimensionsStructObject(true)); - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(false), - GetArrayDimensionsStructObject(false)); - - - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(true), - GetArraySizeStructObject(true)); - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(false), - GetArraySizeStructObject(false)); - - - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(true), - GetSequenceStructObject(true)); - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(false), - GetSequenceStructObject(false)); - - - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(true), - GetSequenceStructEqualObject(true)); - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(false), - GetSequenceStructEqualObject(false)); - - - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(true), - GetSequenceBadStructObject(true)); - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(false), - GetSequenceBadStructObject(false)); - - - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(true), - GetSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(false), - GetSequenceBoundsStructObject(false)); - - - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(true), - GetSequenceSequenceStructObject(true)); - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(false), - GetSequenceSequenceStructObject(false)); - - - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(true), - GetSequenceSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(false), - GetSequenceSequenceBoundsStructObject(false)); - - - factory->add_type_object("MapStruct", GetMapStructIdentifier(true), - GetMapStructObject(true)); - factory->add_type_object("MapStruct", GetMapStructIdentifier(false), - GetMapStructObject(false)); - - - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(true), - GetMapStructEqualObject(true)); - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(false), - GetMapStructEqualObject(false)); - - - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(true), - GetMapBadKeyStructObject(true)); - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(false), - GetMapBadKeyStructObject(false)); - - - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(true), - GetMapBadElemStructObject(true)); - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(false), - GetMapBadElemStructObject(false)); - - - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(true), - GetMapBoundsStructObject(true)); - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(false), - GetMapBoundsStructObject(false)); - - - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(true), - GetMapMapStructObject(true)); - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(false), - GetMapMapStructObject(false)); - - - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(true), - GetMapMapBoundsStructObject(true)); - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(false), - GetMapMapBoundsStructObject(false)); - - - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(true), - GetSimpleUnionObject(true)); - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(false), - GetSimpleUnionObject(false)); - - - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(true), - GetSimpleUnionNamesObject(true)); - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(false), - GetSimpleUnionNamesObject(false)); - - - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(true), - GetSimpleTypeUnionObject(true)); - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(false), - GetSimpleTypeUnionObject(false)); - - - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(true), - GetSimpleBadUnionObject(true)); - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(false), - GetSimpleBadUnionObject(false)); - - - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(true), - GetSimpleBadDiscUnionObject(true)); - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(false), - GetSimpleBadDiscUnionObject(false)); - - - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(true), - GetSimpleUnionStructObject(true)); - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(false), - GetSimpleUnionStructObject(false)); - - - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(true), - GetSimpleUnionStructEqualObject(true)); - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(false), - GetSimpleUnionStructEqualObject(false)); - - - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(true), - GetSimpleUnionNamesStructObject(true)); - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(false), - GetSimpleUnionNamesStructObject(false)); - - - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(true), - GetSimpleTypeUnionStructObject(true)); - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(false), - GetSimpleTypeUnionStructObject(false)); - - - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(true), - GetSimpleBadUnionStructObject(true)); - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(false), - GetSimpleBadUnionStructObject(false)); - - - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(true), - GetSimplBadDiscUnionStructObject(true)); - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(false), - GetSimplBadDiscUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyBadEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); -} - -const TypeObject* GetMyBadEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumObject(); - } - // else - return GetMinimalMyBadEnumObject(); -} - -const TypeObject* GetMinimalMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A1; - mel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A1.common().flags().IS_KEY(false); // Doesn't apply - mel_A1.common().flags().IS_DEFAULT(false); - mel_A1.common().value(value++); - MD5 A1_hash("A1"); - for(int i = 0; i < 4; ++i) - { - mel_A1.detail().name_hash()[i] = A1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A1); - - MinimalEnumeratedLiteral mel_B1; - mel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B1.common().flags().IS_KEY(false); // Doesn't apply - mel_B1.common().flags().IS_DEFAULT(false); - mel_B1.common().value(value++); - MD5 B1_hash("B1"); - for(int i = 0; i < 4; ++i) - { - mel_B1.detail().name_hash()[i] = B1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B1); - - MinimalEnumeratedLiteral mel_C1; - mel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C1.common().flags().IS_KEY(false); // Doesn't apply - mel_C1.common().flags().IS_DEFAULT(false); - mel_C1.common().value(value++); - MD5 C1_hash("C1"); - for(int i = 0; i < 4; ++i) - { - mel_C1.detail().name_hash()[i] = C1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); -} - -const TypeObject* GetCompleteMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyBadEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A1; - cel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A1.common().flags().IS_KEY(false); // Doesn't apply - cel_A1.common().flags().IS_DEFAULT(false); - cel_A1.common().value(value++); - cel_A1.detail().name("A1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A1); - - CompleteEnumeratedLiteral cel_B1; - cel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B1.common().flags().IS_KEY(false); // Doesn't apply - cel_B1.common().flags().IS_DEFAULT(false); - cel_B1.common().value(value++); - cel_B1.detail().name("B1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B1); - - CompleteEnumeratedLiteral cel_C1; - cel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C1.common().flags().IS_KEY(false); // Doesn't apply - cel_C1.common().flags().IS_DEFAULT(false); - cel_C1.common().value(value++); - cel_C1.detail().name("C1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); -} - - - -const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); -} - -const TypeObject* GetMyEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumStructObject(); - } - //else - return GetMinimalMyEnumStructObject(); -} - -const TypeObject* GetMinimalMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); -} - -const TypeObject* GetCompleteMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); -} - - - -const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); -} - -const TypeObject* GetMyBadEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumStructObject(); - } - //else - return GetMinimalMyBadEnumStructObject(); -} - -const TypeObject* GetMinimalMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); -} - -const TypeObject* GetCompleteMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - - - -const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); -} - -const TypeObject* GetMyAliasEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumStructObject(); - } - //else - return GetMinimalMyAliasEnumStructObject(); -} - -const TypeObject* GetMinimalMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); -} - -const TypeObject* GetCompleteMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); -} - - - -const TypeIdentifier* GetBasicStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); -} - -const TypeObject* GetBasicStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicStructObject(); - } - //else - return GetMinimalBasicStructObject(); -} - -const TypeObject* GetMinimalBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); -} - -const TypeObject* GetCompleteBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); -} - - - -const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); -} - -const TypeObject* GetBasicNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicNamesStructObject(); - } - //else - return GetMinimalBasicNamesStructObject(); -} - -const TypeObject* GetMinimalBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool_name; - mst_my_bool_name.common().member_id(memberId++); - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - mst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool_name.common().member_flags().IS_KEY(false); - mst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_name_hash("my_bool_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool_name.detail().name_hash()[i] = my_bool_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool_name); - - MinimalStructMember mst_my_int32_name; - mst_my_int32_name.common().member_id(memberId++); - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - mst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32_name.common().member_flags().IS_KEY(false); - mst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_name_hash("my_int32_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32_name.detail().name_hash()[i] = my_int32_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32_name); - - MinimalStructMember mst_my_string_name; - mst_my_string_name.common().member_id(memberId++); - mst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string_name.common().member_flags().IS_OPTIONAL(false); - mst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string_name.common().member_flags().IS_KEY(false); - mst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_name_hash("my_string_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_string_name.detail().name_hash()[i] = my_string_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string_name); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); -} - -const TypeObject* GetCompleteBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool_name; - cst_my_bool_name.common().member_id(memberId++); - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - cst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool_name.common().member_flags().IS_KEY(false); - cst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool_name.detail().name("my_bool_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool_name); - - CompleteStructMember cst_my_int32_name; - cst_my_int32_name.common().member_id(memberId++); - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - cst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32_name.common().member_flags().IS_KEY(false); - cst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32_name.detail().name("my_int32_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32_name); - - CompleteStructMember cst_my_string_name; - cst_my_string_name.common().member_id(memberId++); - cst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string_name.common().member_flags().IS_OPTIONAL(false); - cst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string_name.common().member_flags().IS_KEY(false); - cst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string_name.detail().name("my_string_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string_name); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); -} - - - -const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); -} - -const TypeObject* GetBasicBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicBadStructObject(); - } - //else - return GetMinimalBasicBadStructObject(); -} - -const TypeObject* GetMinimalBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); -} - -const TypeObject* GetCompleteBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); -} - - - -const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); -} - -const TypeObject* GetBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicWideStructObject(); - } - //else - return GetMinimalBasicWideStructObject(); -} - -const TypeObject* GetMinimalBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); -} - -const TypeObject* GetCompleteBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); -} - - - -const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBadBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); -} - -const TypeObject* GetBadBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBadBasicWideStructObject(); - } - //else - return GetMinimalBadBasicWideStructObject(); -} - -const TypeObject* GetMinimalBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); -} - -const TypeObject* GetCompleteBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); -} - - - -const TypeIdentifier* GetStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); -} - -const TypeObject* GetStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStringStructObject(); - } - //else - return GetMinimalStringStructObject(); -} - -const TypeObject* GetMinimalStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); -} - -const TypeObject* GetCompleteStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); -} - - - -const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); -} - -const TypeObject* GetLargeStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeStringStructObject(); - } - //else - return GetMinimalLargeStringStructObject(); -} - -const TypeObject* GetMinimalLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_string; - mst_my_large_string.common().member_id(memberId++); - mst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string.common().member_flags().IS_KEY(false); - mst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - MD5 my_large_string_hash("my_large_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string.detail().name_hash()[i] = my_large_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); -} - -const TypeObject* GetCompleteLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_string; - cst_my_large_string.common().member_id(memberId++); - cst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string.common().member_flags().IS_KEY(false); - cst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - cst_my_large_string.detail().name("my_large_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); -} - - - -const TypeIdentifier* GetWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); -} - -const TypeObject* GetWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWStringStructObject(); - } - //else - return GetMinimalWStringStructObject(); -} - -const TypeObject* GetMinimalWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wstring; - mst_my_wstring.common().member_id(memberId++); - mst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wstring.common().member_flags().IS_KEY(false); - mst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - MD5 my_wstring_hash("my_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_wstring.detail().name_hash()[i] = my_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); -} - -const TypeObject* GetCompleteWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wstring; - cst_my_wstring.common().member_id(memberId++); - cst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wstring.common().member_flags().IS_KEY(false); - cst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - cst_my_wstring.detail().name("my_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); -} - - - -const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); -} - -const TypeObject* GetLargeWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeWStringStructObject(); - } - //else - return GetMinimalLargeWStringStructObject(); -} - -const TypeObject* GetMinimalLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_wstring; - mst_my_large_wstring.common().member_id(memberId++); - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_wstring.common().member_flags().IS_KEY(false); - mst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - MD5 my_large_wstring_hash("my_large_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_wstring.detail().name_hash()[i] = my_large_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); -} - -const TypeObject* GetCompleteLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_wstring; - cst_my_large_wstring.common().member_id(memberId++); - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_wstring.common().member_flags().IS_KEY(false); - cst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - cst_my_large_wstring.detail().name("my_large_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); -} - - - -const TypeIdentifier* GetArrayStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); -} - -const TypeObject* GetArrayStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructObject(); - } - //else - return GetMinimalArrayStructObject(); -} - -const TypeObject* GetMinimalArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); -} - -const TypeObject* GetCompleteArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); -} - - - -const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); -} - -const TypeObject* GetArrayStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructEqualObject(); - } - //else - return GetMinimalArrayStructEqualObject(); -} - -const TypeObject* GetMinimalArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array_equal; - mst_my_array_equal.common().member_id(memberId++); - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_equal.common().member_flags().IS_KEY(false); - mst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_equal_hash("my_array_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_equal.detail().name_hash()[i] = my_array_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); -} - -const TypeObject* GetCompleteArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array_equal; - cst_my_array_equal.common().member_id(memberId++); - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_equal.common().member_flags().IS_KEY(false); - cst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array_equal.detail().name("my_array_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); -} - - - -const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); -} - -const TypeObject* GetArrayBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayBadStructObject(); - } - //else - return GetMinimalArrayBadStructObject(); -} - -const TypeObject* GetMinimalArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); -} - -const TypeObject* GetCompleteArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); -} - - - -const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayDimensionsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); -} - -const TypeObject* GetArrayDimensionsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayDimensionsStructObject(); - } - //else - return GetMinimalArrayDimensionsStructObject(); -} - -const TypeObject* GetMinimalArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); -} - -const TypeObject* GetCompleteArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); -} - - - -const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArraySizeStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); -} - -const TypeObject* GetArraySizeStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArraySizeStructObject(); - } - //else - return GetMinimalArraySizeStructObject(); -} - -const TypeObject* GetMinimalArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); -} - -const TypeObject* GetCompleteArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); -} - -const TypeObject* GetSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructObject(); - } - //else - return GetMinimalSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); -} - -const TypeObject* GetSequenceStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructEqualObject(); - } - //else - return GetMinimalSequenceStructEqualObject(); -} - -const TypeObject* GetMinimalSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_equal; - mst_my_sequence_equal.common().member_id(memberId++); - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_equal.common().member_flags().IS_KEY(false); - mst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_equal_hash("my_sequence_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_equal.detail().name_hash()[i] = my_sequence_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); -} - -const TypeObject* GetCompleteSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_equal; - cst_my_sequence_equal.common().member_id(memberId++); - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_equal.common().member_flags().IS_KEY(false); - cst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence_equal.detail().name("my_sequence_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); -} - - - - - -const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); -} - -const TypeObject* GetSequenceBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBadStructObject(); - } - //else - return GetMinimalSequenceBadStructObject(); -} - -const TypeObject* GetMinimalSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); -} - -const TypeObject* GetCompleteSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); -} - -const TypeObject* GetSequenceSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceStructObject(); - } - //else - return GetMinimalSequenceSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); -} - -const TypeObject* GetMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructObject(); - } - //else - return GetMinimalMapStructObject(); -} - -const TypeObject* GetMinimalMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); -} - -const TypeObject* GetCompleteMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); -} - -const TypeObject* GetMapStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructEqualObject(); - } - //else - return GetMinimalMapStructEqualObject(); -} - -const TypeObject* GetMinimalMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_equal; - mst_my_map_equal.common().member_id(memberId++); - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_equal.common().member_flags().IS_KEY(false); - mst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_equal_hash("my_map_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_equal.detail().name_hash()[i] = my_map_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); -} - -const TypeObject* GetCompleteMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_equal; - cst_my_map_equal.common().member_id(memberId++); - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_equal.common().member_flags().IS_KEY(false); - cst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map_equal.detail().name("my_map_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); -} - - - - - -const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadKeyStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); -} - -const TypeObject* GetMapBadKeyStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadKeyStructObject(); - } - //else - return GetMinimalMapBadKeyStructObject(); -} - -const TypeObject* GetMinimalMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); -} - -const TypeObject* GetCompleteMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); -} - - - - - -const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadElemStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); -} - -const TypeObject* GetMapBadElemStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadElemStructObject(); - } - //else - return GetMinimalMapBadElemStructObject(); -} - -const TypeObject* GetMinimalMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); -} - -const TypeObject* GetCompleteMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); -} - - - - - -const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); -} - -const TypeObject* GetMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBoundsStructObject(); - } - //else - return GetMinimalMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); -} - -const TypeObject* GetMapMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapStructObject(); - } - //else - return GetMinimalMapMapStructObject(); -} - -const TypeObject* GetMinimalMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); -} - -const TypeObject* GetCompleteMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); -} - -const TypeObject* GetMapMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapBoundsStructObject(); - } - //else - return GetMinimalMapMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); -} - -const TypeObject* GetSimpleUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionObject(); - } - // else - return GetMinimalSimpleUnionObject(); -} - -const TypeObject* GetMinimalSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); -} - -const TypeObject* GetCompleteSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); -} - -const TypeObject* GetSimpleUnionNamesObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesObject(); - } - // else - return GetMinimalSimpleUnionNamesObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first_case; - mst_first_case.common().member_id(memberId++); - mst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first_case.common().member_flags().IS_DEFAULT(false); - mst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first_case.common().label_seq().emplace_back(A); - - MD5 first_case_hash("first_case"); - for(int i = 0; i < 4; ++i) - { - mst_first_case.detail().name_hash()[i] = first_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first_case); - - MinimalUnionMember mst_second_case; - mst_second_case.common().member_id(memberId++); - mst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second_case.common().member_flags().IS_DEFAULT(false); - mst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second_case.common().label_seq().emplace_back(B); - - MD5 second_case_hash("second_case"); - for(int i = 0; i < 4; ++i) - { - mst_second_case.detail().name_hash()[i] = second_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second_case); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first_case; - cst_first_case.common().member_id(memberId++); - cst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first_case.common().member_flags().IS_DEFAULT(false); - cst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first_case.common().label_seq().emplace_back(A); - - - cst_first_case.detail().name("first_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first_case); - - CompleteUnionMember cst_second_case; - cst_second_case.common().member_id(memberId++); - cst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second_case.common().member_flags().IS_DEFAULT(false); - cst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second_case.common().label_seq().emplace_back(B); - - - cst_second_case.detail().name("second_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second_case); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnionNames"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); -} - -const TypeObject* GetSimpleTypeUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionObject(); - } - // else - return GetMinimalSimpleTypeUnionObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleTypeUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); -} - -const TypeObject* GetSimpleBadUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionObject(); - } - // else - return GetMinimalSimpleBadUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(C); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); -} - -const TypeObject* GetCompleteSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(C); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadDiscUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); -} - -const TypeObject* GetSimpleBadDiscUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadDiscUnionObject(); - } - // else - return GetMinimalSimpleBadDiscUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(0); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(1); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); -} - -const TypeObject* GetCompleteSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(0); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(1); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadDiscUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); -} - -const TypeObject* GetSimpleUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructObject(); - } - //else - return GetMinimalSimpleUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); -} - -const TypeObject* GetSimpleUnionStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructEqualObject(); - } - //else - return GetMinimalSimpleUnionStructEqualObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union_equal; - mst_my_union_equal.common().member_id(memberId++); - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union_equal.common().member_flags().IS_KEY(false); - mst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_equal_hash("my_union_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_union_equal.detail().name_hash()[i] = my_union_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); -} - -const TypeObject* GetCompleteSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union_equal; - cst_my_union_equal.common().member_id(memberId++); - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union_equal.common().member_flags().IS_KEY(false); - cst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union_equal.detail().name("my_union_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); -} - -const TypeObject* GetSimpleUnionNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesStructObject(); - } - //else - return GetMinimalSimpleUnionNamesStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); -} - -const TypeObject* GetSimpleTypeUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionStructObject(); - } - //else - return GetMinimalSimpleTypeUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); -} - -const TypeObject* GetSimpleBadUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionStructObject(); - } - //else - return GetMinimalSimpleBadUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); -} - - - -const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimplBadDiscUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); -} - -const TypeObject* GetSimplBadDiscUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimplBadDiscUnionStructObject(); - } - //else - return GetMinimalSimplBadDiscUnionStructObject(); -} - -const TypeObject* GetMinimalSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); -} - -const TypeObject* GetCompleteSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); -} diff --git a/test/xtypes/idl/TypesTypeObject.h b/test/xtypes/idl/TypesTypeObject.h deleted file mode 100644 index 2f615b62792..00000000000 --- a/test/xtypes/idl/TypesTypeObject.h +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file TypesTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Types_SOURCE) -#define Types_DllAPI __declspec( dllexport ) -#else -#define Types_DllAPI __declspec( dllimport ) -#endif // Types_SOURCE -#else -#define Types_DllAPI -#endif -#else -#define Types_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTypesTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimplBadDiscUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/xtypes/idl/Typesv1.cxx b/test/xtypes/idl/Typesv1.cxx deleted file mode 100644 index 54b0d494ecc..00000000000 --- a/test/xtypes/idl/Typesv1.cxx +++ /dev/null @@ -1,8202 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define SimpleUnionStruct_max_cdr_typesize 24ULL; -#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; - -#define MyAliasEnumStruct_max_cdr_typesize 8ULL; -#define ArrayBadStruct_max_cdr_typesize 6ULL; -#define MapBadKeyStruct_max_cdr_typesize 24ULL; -#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; -#define MyEnumStruct_max_cdr_typesize 8ULL; - -#define ArrayStructEqual_max_cdr_typesize 12ULL; -#define LargeWStringStruct_max_cdr_typesize 167708ULL; - -#define WStringStruct_max_cdr_typesize 1028ULL; -#define SequenceStruct_max_cdr_typesize 16ULL; -#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; - -#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; -#define SequenceSequenceStruct_max_cdr_typesize 48ULL; -#define MapBoundsStruct_max_cdr_typesize 40ULL; -#define SequenceStructEqual_max_cdr_typesize 16ULL; -#define MapStructEqual_max_cdr_typesize 24ULL; -#define BasicStruct_max_cdr_typesize 272ULL; -#define SequenceBoundsStruct_max_cdr_typesize 24ULL; -#define MapMapStruct_max_cdr_typesize 60ULL; -#define BasicWideStruct_max_cdr_typesize 536ULL; - -#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; -#define MapStruct_max_cdr_typesize 24ULL; - -#define MyBadEnumStruct_max_cdr_typesize 8ULL; -#define SequenceBadStruct_max_cdr_typesize 10ULL; -#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; -#define LargeStringStruct_max_cdr_typesize 41934ULL; -#define ArrayStruct_max_cdr_typesize 12ULL; -#define BadBasicWideStruct_max_cdr_typesize 536ULL; -#define ArraySizeStruct_max_cdr_typesize 24ULL; - -#define MapBadElemStruct_max_cdr_typesize 40ULL; -#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; -#define BasicBadStruct_max_cdr_typesize 272ULL; -#define BasicNamesStruct_max_cdr_typesize 272ULL; -#define StringStruct_max_cdr_typesize 264ULL; - -#define MapMapBoundsStruct_max_cdr_typesize 108ULL; - - - - -MyEnumStruct::MyEnumStruct() -{ - // MyEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumStruct_max_cdr_typesize; -} - -size_t MyEnumStruct::getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - -} - - -bool MyEnumStruct::isKeyDefined() -{ - return false; -} - -void MyEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // MyBadEnum m_my_enum - m_my_enum = ::A1; - - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyBadEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyBadEnumStruct_max_cdr_typesize; -} - -size_t MyBadEnumStruct::getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyBadEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyBadEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyBadEnum)enum_value; - } - - -} - - -bool MyBadEnumStruct::isKeyDefined() -{ - return false; -} - -void MyBadEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // MyAliasEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyAliasEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyAliasEnumStruct_max_cdr_typesize; -} - -size_t MyAliasEnumStruct::getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyAliasEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyAliasEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyAliasEnum)enum_value; - } - - -} - - -bool MyAliasEnumStruct::isKeyDefined() -{ - return false; -} - -void MyAliasEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -BasicStruct::BasicStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -size_t BasicStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicStruct_max_cdr_typesize; -} - -size_t BasicStruct::getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicStruct::isKeyDefined() -{ - return false; -} - -void BasicStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // boolean m_my_bool_name - m_my_bool_name = false; - // long m_my_int32_name - m_my_int32_name = 0; - // /type_d() m_my_string_name - - - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -size_t BasicNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicNamesStruct_max_cdr_typesize; -} - -size_t BasicNamesStruct::getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool_name; - - scdr << m_my_int32_name; - - scdr << m_my_string_name.c_str(); - -} - -void BasicNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool_name; - - - - dcdr >> m_my_int32_name; - - - - dcdr >> m_my_string_name; - - -} - - -bool BasicNamesStruct::isKeyDefined() -{ - return false; -} - -void BasicNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - - -BasicBadStruct::BasicBadStruct() -{ - // octet m_my_bool - m_my_bool = 0; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -size_t BasicBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicBadStruct_max_cdr_typesize; -} - -size_t BasicBadStruct::getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicBadStruct::isKeyDefined() -{ - return false; -} - -void BasicBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicWideStruct::BasicWideStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicWideStruct_max_cdr_typesize; -} - -size_t BasicWideStruct::getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - -} - -void BasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - - - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - -} - - -bool BasicWideStruct::isKeyDefined() -{ - return false; -} - -void BasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BadBasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BadBasicWideStruct_max_cdr_typesize; -} - -size_t BadBasicWideStruct::getCdrSerializedSize( - const BadBasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BadBasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BadBasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - - - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BadBasicWideStruct::isKeyDefined() -{ - return false; -} - -void BadBasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - - -StringStruct::StringStruct() -{ - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -size_t StringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringStruct_max_cdr_typesize; -} - -size_t StringStruct::getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_string.c_str(); - -} - -void StringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_string; - - -} - - -bool StringStruct::isKeyDefined() -{ - return false; -} - -void StringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - - -LargeStringStruct::LargeStringStruct() -{ - // /type_d() m_my_large_string - - - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeStringStruct_max_cdr_typesize; -} - -size_t LargeStringStruct::getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void LargeStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_string.c_str(); - -} - -void LargeStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_my_large_string = aux.c_str(); - } - - -} - - -bool LargeStringStruct::isKeyDefined() -{ - return false; -} - -void LargeStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - - -WStringStruct::WStringStruct() -{ - // /type_15() m_my_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -size_t WStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WStringStruct_max_cdr_typesize; -} - -size_t WStringStruct::getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void WStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wstring; - -} - -void WStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wstring; - - -} - - -bool WStringStruct::isKeyDefined() -{ - return false; -} - -void WStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // /type_15() m_my_large_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeWStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeWStringStruct_max_cdr_typesize; -} - -size_t LargeWStringStruct::getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void LargeWStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_wstring; - -} - -void LargeWStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_large_wstring; - - -} - - -bool LargeWStringStruct::isKeyDefined() -{ - return false; -} - -void LargeWStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - - -ArrayStruct::ArrayStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStruct_max_cdr_typesize; -} - -size_t ArrayStruct::getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayStruct::isKeyDefined() -{ - return false; -} - -void ArrayStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // long m_my_array_equal - memset(&m_my_array_equal, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -size_t ArrayStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStructEqual_max_cdr_typesize; -} - -size_t ArrayStructEqual::getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array_equal; - - -} - -void ArrayStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array_equal; - - -} - - -bool ArrayStructEqual::isKeyDefined() -{ - return false; -} - -void ArrayStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // octet m_my_array - memset(&m_my_array, 0, ((2)) * 1); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayBadStruct_max_cdr_typesize; -} - -size_t ArrayBadStruct::getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void ArrayBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayBadStruct::isKeyDefined() -{ - return false; -} - -void ArrayBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2) * (2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayDimensionsStruct_max_cdr_typesize; -} - -size_t ArrayDimensionsStruct::getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayDimensionsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t b = 0; b < m_my_array.size(); ++b) - { - scdr << m_my_array[b]; - - } - - - -} - -void ArrayDimensionsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t d = 0; d < m_my_array.size(); ++d) - { - dcdr >> m_my_array[d]; - - } - - - -} - - -bool ArrayDimensionsStruct::isKeyDefined() -{ - return false; -} - -void ArrayDimensionsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((5)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -size_t ArraySizeStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArraySizeStruct_max_cdr_typesize; -} - -size_t ArraySizeStruct::getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArraySizeStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArraySizeStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArraySizeStruct::isKeyDefined() -{ - return false; -} - -void ArraySizeStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - - -SequenceStruct::SequenceStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStruct_max_cdr_typesize; -} - -size_t SequenceStruct::getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // sequence m_my_sequence_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -size_t SequenceStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStructEqual_max_cdr_typesize; -} - -size_t SequenceStructEqual::getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_equal().size() > 0) - { - current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_equal; - - -} - -void SequenceStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_equal; - - -} - - -bool SequenceStructEqual::isKeyDefined() -{ - return false; -} - -void SequenceStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBadStruct_max_cdr_typesize; -} - -size_t SequenceBadStruct::getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBadStruct::isKeyDefined() -{ - return false; -} - -void SequenceBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceBoundsStruct::getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // sequence, 3> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceStruct_max_cdr_typesize; -} - -size_t SequenceSequenceStruct::getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // sequence, 5> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - -MapStruct::MapStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -size_t MapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStruct_max_cdr_typesize; -} - -size_t MapStruct::getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapStruct::isKeyDefined() -{ - return false; -} - -void MapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapStructEqual::MapStructEqual() -{ - // map m_my_map_equal - - - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -size_t MapStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStructEqual_max_cdr_typesize; -} - -size_t MapStructEqual::getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_equal()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_equal.size()); - for (const auto& pair : m_my_map_equal) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_equal; - - -} - - -bool MapStructEqual::isKeyDefined() -{ - return false; -} - -void MapStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadKeyStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadKeyStruct_max_cdr_typesize; -} - -size_t MapBadKeyStruct::getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadKeyStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadKeyStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadKeyStruct::isKeyDefined() -{ - return false; -} - -void MapBadKeyStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadElemStruct_max_cdr_typesize; -} - -size_t MapBadElemStruct::getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadElemStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadElemStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadElemStruct::isKeyDefined() -{ - return false; -} - -void MapBadElemStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBoundsStruct_max_cdr_typesize; -} - -size_t MapBoundsStruct::getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapStruct_max_cdr_typesize; -} - -size_t MapMapStruct::getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - } - - - return current_alignment - initial_alignment; -} - - -void MapMapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapStruct::isKeyDefined() -{ - return false; -} - -void MapMapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapBoundsStruct_max_cdr_typesize; -} - -size_t MapMapBoundsStruct::getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - } - - - return current_alignment - initial_alignment; -} - - -void MapMapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapMapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleUnion::getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; - // long m_first_case - m_first_case = 0; - // long long m_second_case - m_second_case = 0; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - -// TODO(Ricardo) Review -size_t SimpleUnionNames::getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNames::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first_case; - - break; - - - case B: - scdr << m_second_case; - - break; - - default: - break; - } -} - -void SimpleUnionNames::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first_case; - - - break; - - - case B: - dcdr >> m_second_case; - - - break; - - default: - break; - } -} - - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; - // octet m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleTypeUnion::getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleTypeUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch(__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadUnion::getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case C: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case C: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case C: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 0: - switch(__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch(__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadDiscUnion::getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 0: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 1: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadDiscUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 0: - scdr << m_first; - - break; - - - case 1: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadDiscUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 0: - dcdr >> m_first; - - - break; - - - case 1: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // SimpleUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStruct_max_cdr_typesize; -} - -size_t SimpleUnionStruct::getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // SimpleUnion m_my_union_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStructEqual_max_cdr_typesize; -} - -size_t SimpleUnionStructEqual::getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union_equal; - -} - -void SimpleUnionStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union_equal; - - -} - - -bool SimpleUnionStructEqual::isKeyDefined() -{ - return false; -} - -void SimpleUnionStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // SimpleUnionNames m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionNamesStruct_max_cdr_typesize; -} - -size_t SimpleUnionNamesStruct::getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionNamesStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // SimpleTypeUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleTypeUnionStruct_max_cdr_typesize; -} - -size_t SimpleTypeUnionStruct::getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleTypeUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleTypeUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleTypeUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // SimpleBadUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleBadUnionStruct_max_cdr_typesize; -} - -size_t SimpleBadUnionStruct::getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleBadUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleBadUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleBadUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // SimpleBadDiscUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimplBadDiscUnionStruct_max_cdr_typesize; -} - -size_t SimplBadDiscUnionStruct::getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimplBadDiscUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimplBadDiscUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimplBadDiscUnionStruct::isKeyDefined() -{ - return false; -} - -void SimplBadDiscUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/xtypes/idl/Typesv1.h b/test/xtypes/idl/Typesv1.h deleted file mode 100644 index d350f662843..00000000000 --- a/test/xtypes/idl/Typesv1.h +++ /dev/null @@ -1,6496 +0,0 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*! - * @file Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - - -#include - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyBadEnum m_my_enum; - -}; - -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool_name; - int32_t m_my_int32_name; - std::string m_my_string_name; - -}; - - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - int32_t m_new_int32; - std::string m_new_string; - -}; - - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const BadBasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_new_int32; - std::string m_new_string; - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastrtps::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastrtps::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastrtps::fixed_string<41925> m_my_large_string; - -}; - - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_wstring; - -}; - - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_large_wstring; - -}; - - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array_equal; - -}; - - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2> m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence_equal; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map_equal; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first_case; - int64_t m_second_case; -}; - - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - uint8_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - -private: - - uint8_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union_equal; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnionNames m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleTypeUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - - - /*! - * @brief This function returns the maximum serialized size of an object - * depending on the buffer alignment. - * @param current_alignment Buffer alignment. - * @return Maximum serialized size. - */ - eProsima_user_DllExport static size_t getMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function returns the serialized size of a data depending on the buffer alignment. - * @param data Data which is calculated its serialized size. - * @param current_alignment Buffer alignment. - * @return Serialized size. - */ - eProsima_user_DllExport static size_t getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadDiscUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/thirdparty/boost/include/boostconfig.hpp b/thirdparty/boost/include/boostconfig.hpp index 7cd06c68b1f..e2594b80eb3 100644 --- a/thirdparty/boost/include/boostconfig.hpp +++ b/thirdparty/boost/include/boostconfig.hpp @@ -42,7 +42,7 @@ #include // TODO(Adolfo): This will fail if windows system without program data in C: drive -#define BOOST_INTERPROCESS_SHARED_DIR_PATH "C:\\ProgramData\\eprosima\\fastrtps_interprocess" +#define BOOST_INTERPROCESS_SHARED_DIR_PATH "C:\\ProgramData\\eprosima\\fastdds_interprocess" // Check that generic emulation has not been accidentally enabled #include diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 065857df1b4..fe0c55218de 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(fastrtps_FOUND TRUE) +set(fastdds_FOUND TRUE) cmake_policy(PUSH) add_subdirectory(fds) diff --git a/tools/fastdds/fastdds.py b/tools/fastdds/fastdds.py index 15cdad83790..c5b632d765a 100755 --- a/tools/fastdds/fastdds.py +++ b/tools/fastdds/fastdds.py @@ -17,7 +17,7 @@ """ fastdds CLI tool. -This CLI tool provide a set commands and sub-commands to perform, Fast-DDS +This CLI tool provide a set commands and sub-commands to perform, Fast DDS related, maintenance / configuration tasks. usage: fastdds [] diff --git a/tools/fastdds/shm/clean.py b/tools/fastdds/shm/clean.py index d0196176dba..03dc71464fb 100644 --- a/tools/fastdds/shm/clean.py +++ b/tools/fastdds/shm/clean.py @@ -63,7 +63,7 @@ def __shm_dir(self): # Windows if os.name == 'nt': shm_path = Path('c:\\programdata\\eprosima\\' - 'fastrtps_interprocess\\').resolve() + 'fastdds_interprocess\\').resolve() elif os.name == 'posix': # MAC if platform.mac_ver()[0] != '': @@ -91,7 +91,7 @@ def __clean_zombie_segments(self): The deleted file names """ - segment_lock_re = re.compile('^fastrtps_(\\d|[a-z]){16}(_el|_sl)') + segment_lock_re = re.compile('^fastdds_(\\d|[a-z]){16}(_el|_sl)') # Each segment has an "_el" lock file that is locked if the segment # is open and the owner process is alive @@ -123,7 +123,7 @@ def __clean_zombie_ports(self): the deleted file names """ - port_lock_re = re.compile('^fastrtps_port\\d{,5}(_el|_sl)') + port_lock_re = re.compile('^fastdds_port\\d{,5}(_el|_sl)') # Each port has an "_el | _sl" lock file that is locked if the port # is open and the owner process is alive port_locks = [ diff --git a/tools/fastdds/shm/parser.py b/tools/fastdds/shm/parser.py index 64f8f9e171d..86e91fb2e69 100644 --- a/tools/fastdds/shm/parser.py +++ b/tools/fastdds/shm/parser.py @@ -15,7 +15,7 @@ """ fastdds shm sub-command. -This verb provides maintenance tasks related with Fast-DDS shared-memory +This verb provides maintenance tasks related with Fast DDS shared-memory transport. usage: fastdds shm [] diff --git a/tools/fastdds/xml_ci/parser.py b/tools/fastdds/xml_ci/parser.py index e638256439c..f295073e761 100644 --- a/tools/fastdds/xml_ci/parser.py +++ b/tools/fastdds/xml_ci/parser.py @@ -108,4 +108,4 @@ def xsd_dir(self): """ tool_path = Path(os.path.dirname(os.path.realpath(__file__))) # We assume the schema path is relative to our installation path - return tool_path / '../../../share/fastRTPS_profiles.xsd' + return tool_path / '../../../share/fastdds_profiles.xsd' diff --git a/tools/fds/CMakeLists.txt b/tools/fds/CMakeLists.txt index 6d523d7628a..8e6008952a8 100644 --- a/tools/fds/CMakeLists.txt +++ b/tools/fds/CMakeLists.txt @@ -20,8 +20,8 @@ project(fast-discovery-server VERSION 1.0.1 LANGUAGES CXX) # Load external dependencies ############################################################################### -if(NOT fastrtps_FOUND) - find_package(fastrtps 2.12 REQUIRED) +if(NOT fastdds_FOUND) + find_package(fastdds 3 REQUIRED) endif() ############################################################################### @@ -34,7 +34,7 @@ if (MSVC) if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) # add fast headers to enable class view on visual studio IDE - get_target_property(FAST_INCLUDE_DIR fastrtps INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(FAST_INCLUDE_DIR fastdds INTERFACE_INCLUDE_DIRECTORIES) list(GET FAST_INCLUDE_DIR 0 FAST_INCLUDE_DIR) file(GLOB_RECURSE ALL_FAST_HEADERS @@ -43,7 +43,7 @@ if (MSVC) "${FAST_INCLUDE_DIR}/**/*.hxx" ) - source_group("Fast-RTPS Headers" FILES ${ALL_FAST_HEADERS}) + source_group("Fast DDS Headers" FILES ${ALL_FAST_HEADERS}) endif() @@ -62,7 +62,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE FAST_SERVER_VERSION=\"${PROJECT_VERSION}\" PRIVATE FAST_SERVER_BINARY=\"$\" ) -target_link_libraries(${PROJECT_NAME} fastrtps fastcdr fastdds::optionparser) +target_link_libraries(${PROJECT_NAME} fastdds fastcdr fastdds::optionparser) # Properties that change bin names depending on current config. # This is convenient because on installation all bins share folder @@ -76,8 +76,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX d-${PROJECT_VERSI ############################################################################### # If not isolated integrate -if(CMAKE_PROJECT_NAME STREQUAL "fastrtps" ) - set(BIN_INSTALL_DIR tools/fds/${BIN_INSTALL_DIR} CACHE PATH "Installation directory for binaries within Fast-DDS") +if(CMAKE_PROJECT_NAME STREQUAL "fastdds" ) + set(BIN_INSTALL_DIR tools/fds/${BIN_INSTALL_DIR} CACHE PATH "Installation directory for binaries within Fast DDS") else() set(BIN_INSTALL_DIR bin/ CACHE PATH "Installation directory for binaries") endif() @@ -102,7 +102,7 @@ install(EXPORT ${PROJECT_NAME}-targets ) # export xsd schema -install(FILES ../../resources/xsd/fastRTPS_profiles.xsd +install(FILES ../../resources/xsd/fastdds_profiles.xsd DESTINATION ${DATA_INSTALL_DIR} COMPONENT cmake ) diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index 29cc0f5e172..251aab948f5 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -33,8 +33,7 @@ #include #include #include -#include -#include +#include volatile sig_atomic_t g_signal_status = 0; std::mutex g_signal_mutex; @@ -117,7 +116,7 @@ int fastdds_discovery_server( sXMLConfigFile = sXMLConfigFile.substr(delimiter_pos + 1, sXMLConfigFile.length()); } - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( sXMLConfigFile)) { std::cout << "Cannot open XML file " << sXMLConfigFile << ". Please, check the path of this " @@ -128,7 +127,7 @@ int fastdds_discovery_server( { // Set environment variables to prevent loading the default XML file #ifdef _WIN32 - if (0 != _putenv_s("FASTRTPS_DEFAULT_PROFILES_FILE", "") || + if (0 != _putenv_s("FASTDDS_DEFAULT_PROFILES_FILE", "") || 0 != _putenv_s("SKIP_DEFAULT_XML_FILE", "1")) { char errmsg[1024]; @@ -137,15 +136,15 @@ int fastdds_discovery_server( return 1; } #else - if (0 != unsetenv(fastrtps::xmlparser::DEFAULT_FASTRTPS_ENV_VARIABLE) || - 0 != setenv(fastrtps::xmlparser::SKIP_DEFAULT_XML_FILE, "1", 1)) + if (0 != unsetenv("FASTDDS_DEFAULT_PROFILES_FILE") || + 0 != setenv("SKIP_DEFAULT_XML_FILE", "1", 1)) { std::cout << "Error setting environment variables: " << std::strerror(errno) << std::endl; return 1; } #endif // ifdef _WIN32 // Set default participant QoS from XML file - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) { std::cout << "Error setting default DomainParticipantQos from XML default profile." << std::endl; return 1; @@ -154,7 +153,7 @@ int fastdds_discovery_server( } else { - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile( profile, participantQos)) { diff --git a/utils/doxygen/complete_doxyfile_api b/utils/doxygen/complete_doxyfile_api deleted file mode 100644 index 4cd522704d8..00000000000 --- a/utils/doxygen/complete_doxyfile_api +++ /dev/null @@ -1,2355 +0,0 @@ -# Doxyfile 1.8.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "Fast RTPS" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = $(VERSION_DOX) - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Fast RTPS Implementation" - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = ./doxygenfiles/eProsimaLogo.png - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = output/doxygen - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = YES - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = NO - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = ../../include/fastrtps \ - ../../thirdparty/eprosima-common-code/eProsima_cpp/log \ - doxygenfiles/mainpage.dox - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = boost - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = ./utils/examples \ - ./examples/C++ - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = doxygenfiles - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = ./doxygenfiles/eprosima_header.html - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = ./doxygenfiles/eprosima_footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = ./doxygenfiles/customdoxygen.css - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = ./doxygenfiles/general_architecture.png - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 208 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 221 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 100 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /